@shapediver/viewer.features.drawing-tools 3.12.11 → 3.12.13

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 (53) hide show
  1. package/dist/business/implementation/managers/interaction/InteractionManagerAdapter.d.ts +36 -0
  2. package/dist/business/implementation/managers/interaction/InteractionManagerAdapter.d.ts.map +1 -0
  3. package/dist/business/implementation/managers/interaction/InteractionManagerAdapter.js +77 -0
  4. package/dist/business/implementation/managers/interaction/InteractionManagerAdapter.js.map +1 -0
  5. package/dist/business/implementation/managers/interaction/InteractionManagerRefactored.d.ts +82 -0
  6. package/dist/business/implementation/managers/interaction/InteractionManagerRefactored.d.ts.map +1 -0
  7. package/dist/business/implementation/managers/interaction/InteractionManagerRefactored.js +406 -0
  8. package/dist/business/implementation/managers/interaction/InteractionManagerRefactored.js.map +1 -0
  9. package/dist/business/implementation/managers/interaction/actions/InteractionActions.d.ts +107 -0
  10. package/dist/business/implementation/managers/interaction/actions/InteractionActions.d.ts.map +1 -0
  11. package/dist/business/implementation/managers/interaction/actions/InteractionActions.js +191 -0
  12. package/dist/business/implementation/managers/interaction/actions/InteractionActions.js.map +1 -0
  13. package/dist/business/implementation/managers/interaction/config/InteractionConfig.d.ts +134 -0
  14. package/dist/business/implementation/managers/interaction/config/InteractionConfig.d.ts.map +1 -0
  15. package/dist/business/implementation/managers/interaction/config/InteractionConfig.js +218 -0
  16. package/dist/business/implementation/managers/interaction/config/InteractionConfig.js.map +1 -0
  17. package/dist/business/implementation/managers/interaction/gestures/GestureRecognition.d.ts +118 -0
  18. package/dist/business/implementation/managers/interaction/gestures/GestureRecognition.d.ts.map +1 -0
  19. package/dist/business/implementation/managers/interaction/gestures/GestureRecognition.js +352 -0
  20. package/dist/business/implementation/managers/interaction/gestures/GestureRecognition.js.map +1 -0
  21. package/dist/business/implementation/managers/interaction/index.d.ts +13 -0
  22. package/dist/business/implementation/managers/interaction/index.d.ts.map +1 -0
  23. package/dist/business/implementation/managers/interaction/index.js +49 -0
  24. package/dist/business/implementation/managers/interaction/index.js.map +1 -0
  25. package/dist/business/implementation/managers/interaction/interfaces/IInteractionManagerForStrategy.d.ts +24 -0
  26. package/dist/business/implementation/managers/interaction/interfaces/IInteractionManagerForStrategy.d.ts.map +1 -0
  27. package/dist/business/implementation/managers/interaction/interfaces/IInteractionManagerForStrategy.js +3 -0
  28. package/dist/business/implementation/managers/interaction/interfaces/IInteractionManagerForStrategy.js.map +1 -0
  29. package/dist/business/implementation/managers/interaction/mobile-detection-example.d.ts +24 -0
  30. package/dist/business/implementation/managers/interaction/mobile-detection-example.d.ts.map +1 -0
  31. package/dist/business/implementation/managers/interaction/mobile-detection-example.js +112 -0
  32. package/dist/business/implementation/managers/interaction/mobile-detection-example.js.map +1 -0
  33. package/dist/business/implementation/managers/interaction/strategies/DesktopInteractionStrategy.d.ts +37 -0
  34. package/dist/business/implementation/managers/interaction/strategies/DesktopInteractionStrategy.d.ts.map +1 -0
  35. package/dist/business/implementation/managers/interaction/strategies/DesktopInteractionStrategy.js +290 -0
  36. package/dist/business/implementation/managers/interaction/strategies/DesktopInteractionStrategy.js.map +1 -0
  37. package/dist/business/implementation/managers/interaction/strategies/IInteractionStrategy.d.ts +52 -0
  38. package/dist/business/implementation/managers/interaction/strategies/IInteractionStrategy.d.ts.map +1 -0
  39. package/dist/business/implementation/managers/interaction/strategies/IInteractionStrategy.js +21 -0
  40. package/dist/business/implementation/managers/interaction/strategies/IInteractionStrategy.js.map +1 -0
  41. package/dist/business/implementation/managers/interaction/strategies/MobileInteractionStrategy.d.ts +72 -0
  42. package/dist/business/implementation/managers/interaction/strategies/MobileInteractionStrategy.d.ts.map +1 -0
  43. package/dist/business/implementation/managers/interaction/strategies/MobileInteractionStrategy.js +442 -0
  44. package/dist/business/implementation/managers/interaction/strategies/MobileInteractionStrategy.js.map +1 -0
  45. package/dist/business/implementation/managers/interaction/test-mobile-detection.d.ts +24 -0
  46. package/dist/business/implementation/managers/interaction/test-mobile-detection.d.ts.map +1 -0
  47. package/dist/business/implementation/managers/interaction/test-mobile-detection.js +136 -0
  48. package/dist/business/implementation/managers/interaction/test-mobile-detection.js.map +1 -0
  49. package/dist/business/implementation/managers/interaction/test-refactored.d.ts +9 -0
  50. package/dist/business/implementation/managers/interaction/test-refactored.d.ts.map +1 -0
  51. package/dist/business/implementation/managers/interaction/test-refactored.js +57 -0
  52. package/dist/business/implementation/managers/interaction/test-refactored.js.map +1 -0
  53. package/package.json +10 -10
@@ -0,0 +1,442 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MobileInteractionStrategy = void 0;
4
+ const viewer_1 = require("@shapediver/viewer");
5
+ const IInteractionStrategy_1 = require("./IInteractionStrategy");
6
+ /**
7
+ * Mobile-specific interaction strategy using touch gestures
8
+ */
9
+ class MobileInteractionStrategy {
10
+ constructor(drawingToolsManager, interactionManager, config) {
11
+ // Touch-specific state
12
+ this.touchStartTime = 0;
13
+ this.touchStartPosition = { x: 0, y: 0 };
14
+ this.isLongPress = false;
15
+ this.touchHasMoved = false;
16
+ this.isPotentialInsertion = false;
17
+ this.isDraggingPoint = false; // Track if we're dragging a point
18
+ this.lastTapTime = 0;
19
+ this.tapCount = 0;
20
+ this.drawingToolsManager = drawingToolsManager;
21
+ this.interactionManager = interactionManager;
22
+ this.config = config;
23
+ }
24
+ canHandle(event) {
25
+ // Handle all pointer types on mobile devices (touch, pen, mouse on tablets)
26
+ // Note: Strategy selection is now done via SystemInfo.isMobile,
27
+ // so this method is primarily for compatibility
28
+ return (event.pointerType === "touch" ||
29
+ event.pointerType === "pen" ||
30
+ event.pointerType === "mouse");
31
+ }
32
+ onPointerDown(event, ray) {
33
+ if (this.drawingToolsManager.closed) {
34
+ return { handled: false };
35
+ }
36
+ this.lastTouchEvent = event;
37
+ this.touchStartTime = Date.now();
38
+ this.touchStartPosition = { x: event.clientX, y: event.clientY };
39
+ this.isLongPress = false;
40
+ this.touchHasMoved = false;
41
+ this.isPotentialInsertion = false;
42
+ this.isDraggingPoint = false; // Reset drag state
43
+ // Start long press detection
44
+ this.startLongPressDetection(event, ray);
45
+ // Handle multi-touch for different actions
46
+ if (this.isMultiTouch(event)) {
47
+ return this.handleMultiTouch(event, ray);
48
+ }
49
+ // Handle insertion immediately in onPointerDown (like desktop strategy)
50
+ // Only if we're not near an existing point (which would be for dragging)
51
+ const distances = this.drawingToolsManager.geometryMathManager.checkPointDistances(ray, this.drawingToolsManager.positionArray);
52
+ const nearPoint = this.findNearestTouchTarget(distances);
53
+ if (nearPoint === undefined) {
54
+ // Not near a point, this could be an insertion tap
55
+ // Handle insertion finalization (exactly like desktop strategy)
56
+ if (this.interactionManager.insertionInteractionHandler
57
+ .insertionActive) {
58
+ const result = this.interactionManager.insertionInteractionHandler.finalizeInsertion();
59
+ if (result) {
60
+ this.drawingToolsManager.update();
61
+ this.disableMobileContinuousRendering();
62
+ return {
63
+ handled: true,
64
+ action: IInteractionStrategy_1.InteractionAction.INSERT_END,
65
+ };
66
+ }
67
+ else {
68
+ this.enableMobileContinuousRendering();
69
+ this.interactionManager.insertionInteractionHandler.startInsertion(event);
70
+ this.drawingToolsManager.update();
71
+ return {
72
+ handled: true,
73
+ action: IInteractionStrategy_1.InteractionAction.INSERT_START,
74
+ };
75
+ }
76
+ }
77
+ // Start insertion immediately (like desktop strategy)
78
+ this.isPotentialInsertion = true; // Track that we started an insertion
79
+ this.enableMobileContinuousRendering();
80
+ this.interactionManager.insertionInteractionHandler.startInsertion(event);
81
+ this.drawingToolsManager.update();
82
+ return {
83
+ handled: true,
84
+ action: IInteractionStrategy_1.InteractionAction.INSERT_START,
85
+ };
86
+ }
87
+ return this.handleSingleTouch(event, ray);
88
+ }
89
+ onPointerMove(event, ray) {
90
+ if (this.drawingToolsManager.closed) {
91
+ return { handled: false };
92
+ }
93
+ this.lastTouchEvent = event;
94
+ // Handle different move scenarios - check dragging FIRST
95
+ if (this.isDragging()) {
96
+ console.log('[Mobile] onPointerMove - isDragging() returned true, calling handleTouchDrag');
97
+ return this.handleTouchDrag(event, ray);
98
+ }
99
+ else {
100
+ console.log('[Mobile] onPointerMove - isDragging() returned false, helper.dragging:', this.interactionManager.interactionManagerHelper.dragging);
101
+ }
102
+ // Cancel long press if moved too far
103
+ if (this.hasTouchMovedBeyondThreshold(event)) {
104
+ this.touchHasMoved = true;
105
+ // Cancel insertion if this was a potential insertion that we just started
106
+ if (this.isPotentialInsertion && this.interactionManager.insertionInteractionHandler.insertionActive) {
107
+ this.interactionManager.insertionInteractionHandler.stopInsertion();
108
+ this.disableMobileContinuousRendering();
109
+ this.isPotentialInsertion = false;
110
+ }
111
+ this.cancelLongPress();
112
+ }
113
+ if (this.interactionManager.insertionInteractionHandler.insertionActive) {
114
+ return this.handleInsertionMove(event, ray);
115
+ }
116
+ // Update cursor for hover feedback
117
+ this.updateCursor();
118
+ return this.handleTouchHover(event, ray);
119
+ }
120
+ onPointerUp(event, ray) {
121
+ if (this.drawingToolsManager.closed) {
122
+ return { handled: false };
123
+ }
124
+ this.cancelLongPress();
125
+ // Clean up drag state
126
+ if (this.isDraggingPoint) {
127
+ this.isDraggingPoint = false;
128
+ this.disableMobileCameraFreeze(); // Remove mobile camera freeze
129
+ // Camera freeze will be automatically removed by the interaction manager
130
+ }
131
+ const touchDuration = Date.now() - this.touchStartTime;
132
+ const touchDistance = this.getTouchDistance(event);
133
+ // Determine gesture type
134
+ if (this.isLongPress) {
135
+ return this.handleLongPress(event, ray);
136
+ }
137
+ if (touchDistance < this.config.touchSettings.tapThreshold) {
138
+ return this.handleTap(event, ray, touchDuration);
139
+ }
140
+ if (this.isDragging()) {
141
+ return this.handleDragEnd(event, ray);
142
+ }
143
+ return { handled: true, action: IInteractionStrategy_1.InteractionAction.NONE };
144
+ }
145
+ onPointerOut() {
146
+ this.cancelLongPress();
147
+ return {
148
+ handled: true,
149
+ action: IInteractionStrategy_1.InteractionAction.NONE,
150
+ };
151
+ }
152
+ startLongPressDetection(event, ray) {
153
+ this.longPressTimer = window.setTimeout(() => {
154
+ this.isLongPress = true;
155
+ this.handleLongPressStart(event, ray);
156
+ }, this.config.touchSettings.longPressDuration);
157
+ }
158
+ cancelLongPress() {
159
+ if (this.longPressTimer) {
160
+ clearTimeout(this.longPressTimer);
161
+ this.longPressTimer = undefined;
162
+ }
163
+ }
164
+ isMultiTouch(event) {
165
+ // Check if there are multiple active pointers
166
+ // This would require tracking active pointers
167
+ return false; // Simplified for now
168
+ }
169
+ handleSingleTouch(event, ray) {
170
+ // Check if touching near a point for potential drag
171
+ const distances = this.drawingToolsManager.geometryMathManager.checkPointDistances(ray, this.drawingToolsManager.positionArray);
172
+ // Mobile-specific point selection with larger touch targets
173
+ const nearPoint = this.findNearestTouchTarget(distances);
174
+ if (nearPoint !== undefined) {
175
+ this.prepareForDrag(nearPoint, ray);
176
+ return {
177
+ handled: true,
178
+ action: IInteractionStrategy_1.InteractionAction.DRAG_START,
179
+ preventDefault: true,
180
+ };
181
+ }
182
+ return { handled: true, action: IInteractionStrategy_1.InteractionAction.NONE };
183
+ }
184
+ handleMultiTouch(event, ray) {
185
+ // Handle two-finger gestures for camera control or multi-select
186
+ return {
187
+ handled: true,
188
+ action: IInteractionStrategy_1.InteractionAction.NONE,
189
+ stopPropagation: true,
190
+ };
191
+ }
192
+ handleTap(event, ray, duration) {
193
+ const now = Date.now();
194
+ // Check for double tap
195
+ if (now - this.lastTapTime <
196
+ this.config.touchSettings.doubleTapInterval) {
197
+ this.tapCount++;
198
+ }
199
+ else {
200
+ this.tapCount = 1;
201
+ }
202
+ this.lastTapTime = now;
203
+ if (this.tapCount === 2) {
204
+ return this.handleDoubleTap(event, ray);
205
+ }
206
+ return this.handleSingleTap(event, ray);
207
+ }
208
+ handleSingleTap(event, ray) {
209
+ // Handle insertion finalization (like desktop strategy)
210
+ if (this.interactionManager.insertionInteractionHandler.insertionActive) {
211
+ const result = this.interactionManager.insertionInteractionHandler.finalizeInsertion();
212
+ if (result) {
213
+ this.drawingToolsManager.update();
214
+ this.disableMobileContinuousRendering();
215
+ return {
216
+ handled: true,
217
+ action: IInteractionStrategy_1.InteractionAction.INSERT_END,
218
+ };
219
+ }
220
+ else {
221
+ // Shape not complete, immediately restart insertion (like desktop)
222
+ try {
223
+ this.enableMobileContinuousRendering();
224
+ this.interactionManager.insertionInteractionHandler.startInsertion(event);
225
+ this.drawingToolsManager.update();
226
+ return {
227
+ handled: true,
228
+ action: IInteractionStrategy_1.InteractionAction.NONE, // Avoid triggering action system that might reset state
229
+ };
230
+ }
231
+ catch (error) {
232
+ // Insertion restart failed, continue with fallback
233
+ }
234
+ }
235
+ }
236
+ // Start insertion if not active (like desktop strategy - no auto-start call)
237
+ try {
238
+ this.enableMobileContinuousRendering();
239
+ this.interactionManager.insertionInteractionHandler.startInsertion(event);
240
+ this.drawingToolsManager.update();
241
+ return {
242
+ handled: true,
243
+ action: IInteractionStrategy_1.InteractionAction.NONE, // Avoid triggering action system that might reset state
244
+ };
245
+ }
246
+ catch (error) {
247
+ // Insertion failed, return default action
248
+ }
249
+ return { handled: true, action: IInteractionStrategy_1.InteractionAction.SELECT };
250
+ }
251
+ handleDoubleTap(event, ray) {
252
+ // Double tap for special actions like finishing insertion or deleting
253
+ this.tapCount = 0;
254
+ const distances = this.drawingToolsManager.geometryMathManager.checkPointDistances(ray, this.drawingToolsManager.positionArray);
255
+ const nearPoint = this.findNearestTouchTarget(distances);
256
+ if (nearPoint !== undefined) {
257
+ // Double tap on point could delete it
258
+ return this.handlePointDeletion(nearPoint);
259
+ }
260
+ // Double tap in empty space could finish current operation
261
+ if (this.interactionManager.insertionInteractionHandler.insertionActive) {
262
+ this.interactionManager.stopInsertion();
263
+ this.disableMobileContinuousRendering();
264
+ return {
265
+ handled: true,
266
+ action: IInteractionStrategy_1.InteractionAction.INSERT_END,
267
+ };
268
+ }
269
+ return { handled: true, action: IInteractionStrategy_1.InteractionAction.NONE };
270
+ }
271
+ handleLongPressStart(event, ray) {
272
+ // Long press could start context menu or multi-select mode
273
+ // Provide haptic feedback if available and enabled
274
+ this.triggerHapticFeedback();
275
+ }
276
+ handleLongPress(event, ray) {
277
+ // Long press actions - context menu or special mode
278
+ this.triggerHapticFeedback();
279
+ const distances = this.drawingToolsManager.geometryMathManager.checkPointDistances(ray, this.drawingToolsManager.positionArray);
280
+ const nearPoint = this.findNearestTouchTarget(distances);
281
+ if (nearPoint !== undefined) {
282
+ // Long press on point - show context menu or enter edit mode
283
+ return {
284
+ handled: true,
285
+ action: IInteractionStrategy_1.InteractionAction.CONTEXT_MENU,
286
+ preventDefault: true,
287
+ };
288
+ }
289
+ return { handled: true, action: IInteractionStrategy_1.InteractionAction.CONTEXT_MENU };
290
+ }
291
+ triggerHapticFeedback() {
292
+ if (this.config.touchSettings.enableHapticFeedback &&
293
+ "vibrate" in navigator) {
294
+ navigator.vibrate(this.config.touchSettings.hapticPattern);
295
+ }
296
+ }
297
+ handleTouchDrag(event, ray) {
298
+ // Touch drag for moving points - similar to mouse drag but with touch-specific behavior
299
+ console.log('[Mobile] handleTouchDrag called - helper.dragging:', this.interactionManager.interactionManagerHelper.dragging);
300
+ this.moveDraggedPoints(ray);
301
+ return {
302
+ handled: true,
303
+ action: IInteractionStrategy_1.InteractionAction.DRAG_MOVE,
304
+ preventDefault: true,
305
+ };
306
+ }
307
+ handleInsertionMove(event, ray) {
308
+ // Handle moving insertion point on mobile
309
+ this.interactionManager.insertionInteractionHandler.onMove(ray);
310
+ return {
311
+ handled: true,
312
+ action: IInteractionStrategy_1.InteractionAction.INSERT_MOVE,
313
+ };
314
+ }
315
+ handleTouchHover(event, ray) {
316
+ // Mobile doesn't have true hover, but we can update visual feedback
317
+ return { handled: true, action: IInteractionStrategy_1.InteractionAction.HOVER };
318
+ }
319
+ handleDragEnd(event, ray) {
320
+ // End drag operation - the interaction manager will handle cleanup
321
+ return {
322
+ handled: true,
323
+ action: IInteractionStrategy_1.InteractionAction.DRAG_END,
324
+ };
325
+ }
326
+ handlePointDeletion(pointIndex) {
327
+ // Handle point deletion with confirmation or undo option
328
+ return {
329
+ handled: true,
330
+ action: IInteractionStrategy_1.InteractionAction.DELETE,
331
+ };
332
+ }
333
+ hasTouchMovedBeyondThreshold(event) {
334
+ const distance = this.getTouchDistance(event);
335
+ return distance > this.config.touchSettings.tapMovementThreshold;
336
+ }
337
+ getTouchDistance(event) {
338
+ const dx = event.clientX - this.touchStartPosition.x;
339
+ const dy = event.clientY - this.touchStartPosition.y;
340
+ return Math.sqrt(dx * dx + dy * dy);
341
+ }
342
+ findNearestTouchTarget(distances) {
343
+ // Find nearest point with larger touch target area for mobile
344
+ // Use a larger threshold for point selection to make it easier to grab points
345
+ const touchThreshold = this.config.touchSettings.minTouchTargetSize * 2; // Double the touch target for easier point selection
346
+ if (distances && distances.length > 0) {
347
+ // Find the closest point within the mobile touch threshold
348
+ for (let i = 0; i < distances.length; i++) {
349
+ if (distances[i] && distances[i].distance < touchThreshold) {
350
+ return distances[i].index; // Return the actual point index, not the array index
351
+ }
352
+ }
353
+ }
354
+ return undefined;
355
+ }
356
+ isDragging() {
357
+ return this.interactionManager.interactionManagerHelper.dragging;
358
+ }
359
+ shouldStartInsertion() {
360
+ return (this.drawingToolsManager.settings.general.autoStart &&
361
+ !this.interactionManager.insertionInteractionHandler
362
+ .insertionActive &&
363
+ this.drawingToolsManager.getPointsData().length === 0);
364
+ }
365
+ prepareForDrag(pointIndex, ray) {
366
+ const helper = this.interactionManager.interactionManagerHelper;
367
+ // Set up point for dragging: hover -> select -> start dragging
368
+ const distances = [{ index: pointIndex, distance: 0 }];
369
+ console.log('[Mobile] Preparing to drag point:', pointIndex);
370
+ // First set the hovered point (required for startDragging) - IMPORTANT: pass the ray!
371
+ helper.checkHover(distances, ray);
372
+ console.log('[Mobile] After checkHover, hoveredPoint:', helper.hoveredPoint);
373
+ // Then select the point
374
+ helper.selectPoint(distances);
375
+ console.log('[Mobile] After selectPoint, selectedPoints:', helper.selectedPointIndices);
376
+ // Start dragging and enable camera freeze for mobile touch dragging
377
+ const draggingStarted = helper.startDragging();
378
+ console.log('[Mobile] startDragging result:', draggingStarted, 'helper.dragging:', helper.dragging);
379
+ if (draggingStarted) {
380
+ this.isDraggingPoint = true;
381
+ // Add camera freeze flag when dragging starts (both ways to be sure)
382
+ if (!this.interactionManager.getCameraFreezeFlag()) {
383
+ this.interactionManager.setCameraFreezeFlag();
384
+ }
385
+ this.enableMobileCameraFreeze(); // Add direct mobile camera freeze
386
+ }
387
+ }
388
+ moveDraggedPoints(ray) {
389
+ const helper = this.interactionManager.interactionManagerHelper;
390
+ helper.moveSelectedPoints(ray);
391
+ }
392
+ updateCursor() {
393
+ // Mobile devices don't typically show cursor changes, but we can update
394
+ // for hybrid devices (tablets with mouse support)
395
+ if (this.interactionManager.interactionManagerHelper.dragging) {
396
+ document.body.style.cursor = "grabbing";
397
+ }
398
+ else if (this.interactionManager.interactionManagerHelper.hoveredPoint !==
399
+ undefined) {
400
+ document.body.style.cursor = "pointer";
401
+ }
402
+ else {
403
+ document.body.style.cursor = "default";
404
+ }
405
+ }
406
+ /**
407
+ * Enable continuous rendering for mobile insertions to ensure immediate visual feedback
408
+ */
409
+ enableMobileContinuousRendering() {
410
+ if (!this.mobileContinuousRenderingFlag) {
411
+ this.mobileContinuousRenderingFlag = this.drawingToolsManager.viewport.addFlag(viewer_1.FLAG_TYPE.CONTINUOUS_RENDERING);
412
+ }
413
+ }
414
+ /**
415
+ * Disable continuous rendering for mobile insertions to save performance
416
+ */
417
+ disableMobileContinuousRendering() {
418
+ if (this.mobileContinuousRenderingFlag) {
419
+ this.drawingToolsManager.viewport.removeFlag(this.mobileContinuousRenderingFlag);
420
+ this.mobileContinuousRenderingFlag = undefined;
421
+ }
422
+ }
423
+ /**
424
+ * Enable camera freeze for mobile point dragging
425
+ */
426
+ enableMobileCameraFreeze() {
427
+ if (!this.mobileCameraFreezeFlag) {
428
+ this.mobileCameraFreezeFlag = this.drawingToolsManager.viewport.addFlag(viewer_1.FLAG_TYPE.CAMERA_FREEZE);
429
+ }
430
+ }
431
+ /**
432
+ * Disable camera freeze for mobile point dragging
433
+ */
434
+ disableMobileCameraFreeze() {
435
+ if (this.mobileCameraFreezeFlag) {
436
+ this.drawingToolsManager.viewport.removeFlag(this.mobileCameraFreezeFlag);
437
+ this.mobileCameraFreezeFlag = undefined;
438
+ }
439
+ }
440
+ }
441
+ exports.MobileInteractionStrategy = MobileInteractionStrategy;
442
+ //# sourceMappingURL=MobileInteractionStrategy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MobileInteractionStrategy.js","sourceRoot":"","sources":["../../../../../../src/business/implementation/managers/interaction/strategies/MobileInteractionStrategy.ts"],"names":[],"mappings":";;;AAAA,+CAA6C;AAK7C,iEAIgC;AAEhC;;GAEG;AACH,MAAa,yBAAyB;IAsBrC,YACC,mBAAwC,EACxC,kBAAkD,EAClD,MAAyB;QApB1B,uBAAuB;QACf,mBAAc,GAAW,CAAC,CAAC;QAC3B,uBAAkB,GAA2B,EAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAC,CAAC;QAE1D,gBAAW,GAAY,KAAK,CAAC;QAE7B,kBAAa,GAAY,KAAK,CAAC;QAC/B,yBAAoB,GAAY,KAAK,CAAC;QACtC,oBAAe,GAAY,KAAK,CAAC,CAAC,kCAAkC;QAEpE,gBAAW,GAAW,CAAC,CAAC;QACxB,aAAQ,GAAW,CAAC,CAAC;QAW5B,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;QAC/C,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;QAC7C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,CAAC;IAED,SAAS,CAAC,KAAmB;QAC5B,4EAA4E;QAC5E,gEAAgE;QAChE,gDAAgD;QAChD,OAAO,CACN,KAAK,CAAC,WAAW,KAAK,OAAO;YAC7B,KAAK,CAAC,WAAW,KAAK,KAAK;YAC3B,KAAK,CAAC,WAAW,KAAK,OAAO,CAC7B,CAAC;IACH,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OAEG;IACK,wBAAwB;QAC/B,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE;YACjC,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,OAAO,CACtE,kBAAS,CAAC,aAAa,CACvB,CAAC;SACF;IACF,CAAC;IAED;;OAEG;IACK,yBAAyB;QAChC,IAAI,IAAI,CAAC,sBAAsB,EAAE;YAChC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;YAC1E,IAAI,CAAC,sBAAsB,GAAG,SAAS,CAAC;SACxC;IACF,CAAC;CACD;AArkBD,8DAqkBC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Test Mobile Detection Functionality
3
+ *
4
+ * This file provides test functions to verify that mobile platform detection
5
+ * is working correctly and the appropriate strategies are being selected.
6
+ */
7
+ import { DrawingToolsManager } from "../../DrawingToolsManager";
8
+ /**
9
+ * Test that mobile detection correctly selects the appropriate strategy
10
+ */
11
+ export declare function testMobileDetection(drawingToolsManager: DrawingToolsManager): boolean;
12
+ /**
13
+ * Display current platform information
14
+ */
15
+ export declare function showPlatformInfo(): void;
16
+ /**
17
+ * Test strategy switching by mocking different platform conditions
18
+ */
19
+ export declare function testStrategySelection(drawingToolsManager: DrawingToolsManager): boolean;
20
+ /**
21
+ * Run all mobile detection tests
22
+ */
23
+ export declare function runMobileDetectionTests(drawingToolsManager: DrawingToolsManager): boolean;
24
+ //# sourceMappingURL=test-mobile-detection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-mobile-detection.d.ts","sourceRoot":"","sources":["../../../../../src/business/implementation/managers/interaction/test-mobile-detection.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAC,mBAAmB,EAAC,MAAM,2BAA2B,CAAC;AAK9D;;GAEG;AACH,wBAAgB,mBAAmB,CAClC,mBAAmB,EAAE,mBAAmB,GACtC,OAAO,CAyDT;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAYvC;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACpC,mBAAmB,EAAE,mBAAmB,GACtC,OAAO,CA+CT;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACtC,mBAAmB,EAAE,mBAAmB,GACtC,OAAO,CAoBT"}
@@ -0,0 +1,136 @@
1
+ "use strict";
2
+ /**
3
+ * Test Mobile Detection Functionality
4
+ *
5
+ * This file provides test functions to verify that mobile platform detection
6
+ * is working correctly and the appropriate strategies are being selected.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.runMobileDetectionTests = exports.testStrategySelection = exports.showPlatformInfo = exports.testMobileDetection = void 0;
10
+ const viewer_shared_services_1 = require("@shapediver/viewer.shared.services");
11
+ const InteractionManagerRefactored_1 = require("./InteractionManagerRefactored");
12
+ const DesktopInteractionStrategy_1 = require("./strategies/DesktopInteractionStrategy");
13
+ const MobileInteractionStrategy_1 = require("./strategies/MobileInteractionStrategy");
14
+ /**
15
+ * Test that mobile detection correctly selects the appropriate strategy
16
+ */
17
+ function testMobileDetection(drawingToolsManager) {
18
+ try {
19
+ // Create interaction manager
20
+ const interactionManager = new InteractionManagerRefactored_1.InteractionManagerRefactored(drawingToolsManager);
21
+ // Get the current platform detection
22
+ const isMobile = viewer_shared_services_1.SystemInfo.instance.isMobile;
23
+ // Create a mock pointer event for strategy selection
24
+ const mockPointerEvent = new PointerEvent("pointerdown", {
25
+ pointerId: 1,
26
+ clientX: 100,
27
+ clientY: 100,
28
+ });
29
+ // Trigger strategy selection by calling onDown
30
+ interactionManager.onDown(mockPointerEvent, {
31
+ origin: [0, 0, 0],
32
+ direction: [0, 0, -1],
33
+ });
34
+ // Check that the correct strategy was selected
35
+ const currentStrategy = interactionManager.currentStrategy;
36
+ if (isMobile) {
37
+ if (currentStrategy instanceof MobileInteractionStrategy_1.MobileInteractionStrategy) {
38
+ console.log("✅ Mobile platform detected, MobileInteractionStrategy selected");
39
+ return true;
40
+ }
41
+ else {
42
+ console.log("❌ Mobile platform detected, but wrong strategy selected:", currentStrategy === null || currentStrategy === void 0 ? void 0 : currentStrategy.constructor.name);
43
+ return false;
44
+ }
45
+ }
46
+ else {
47
+ if (currentStrategy instanceof DesktopInteractionStrategy_1.DesktopInteractionStrategy) {
48
+ console.log("✅ Desktop platform detected, DesktopInteractionStrategy selected");
49
+ return true;
50
+ }
51
+ else {
52
+ console.log("❌ Desktop platform detected, but wrong strategy selected:", currentStrategy === null || currentStrategy === void 0 ? void 0 : currentStrategy.constructor.name);
53
+ return false;
54
+ }
55
+ }
56
+ }
57
+ catch (error) {
58
+ console.error("❌ Mobile detection test failed with error:", error);
59
+ return false;
60
+ }
61
+ }
62
+ exports.testMobileDetection = testMobileDetection;
63
+ /**
64
+ * Display current platform information
65
+ */
66
+ function showPlatformInfo() {
67
+ const systemInfo = viewer_shared_services_1.SystemInfo.instance;
68
+ console.log("🔍 Platform Detection Information:");
69
+ console.log(` isMobile: ${systemInfo.isMobile}`);
70
+ console.log(` isIOS: ${systemInfo.isIOS}`);
71
+ console.log(` isAndroid: ${systemInfo.isAndroid}`);
72
+ console.log(` isMacOS: ${systemInfo.isMacOS}`);
73
+ console.log(` isBrowser: ${systemInfo.isBrowser}`);
74
+ console.log(` isChrome: ${systemInfo.isChrome}`);
75
+ console.log(` isSafari: ${systemInfo.isSafari}`);
76
+ console.log(` isFirefox: ${systemInfo.isFirefox}`);
77
+ }
78
+ exports.showPlatformInfo = showPlatformInfo;
79
+ /**
80
+ * Test strategy switching by mocking different platform conditions
81
+ */
82
+ function testStrategySelection(drawingToolsManager) {
83
+ try {
84
+ const interactionManager = new InteractionManagerRefactored_1.InteractionManagerRefactored(drawingToolsManager);
85
+ // Access the private selectStrategy method for testing
86
+ const selectStrategy = interactionManager.selectStrategy.bind(interactionManager);
87
+ // Create mock event
88
+ const mockEvent = new PointerEvent("pointerdown", {
89
+ pointerId: 1,
90
+ clientX: 100,
91
+ clientY: 100,
92
+ });
93
+ // Test strategy selection
94
+ const selectedStrategy = selectStrategy(mockEvent);
95
+ if (!selectedStrategy) {
96
+ console.log("❌ No strategy was selected");
97
+ return false;
98
+ }
99
+ const isMobile = viewer_shared_services_1.SystemInfo.instance.isMobile;
100
+ const expectedStrategyType = isMobile
101
+ ? "MobileInteractionStrategy"
102
+ : "DesktopInteractionStrategy";
103
+ const actualStrategyType = selectedStrategy.constructor.name;
104
+ if (actualStrategyType === expectedStrategyType) {
105
+ console.log(`✅ Strategy selection correct: ${actualStrategyType} for ${isMobile ? "mobile" : "desktop"} platform`);
106
+ return true;
107
+ }
108
+ else {
109
+ console.log(`❌ Strategy selection incorrect: expected ${expectedStrategyType}, got ${actualStrategyType}`);
110
+ return false;
111
+ }
112
+ }
113
+ catch (error) {
114
+ console.error("❌ Strategy selection test failed with error:", error);
115
+ return false;
116
+ }
117
+ }
118
+ exports.testStrategySelection = testStrategySelection;
119
+ /**
120
+ * Run all mobile detection tests
121
+ */
122
+ function runMobileDetectionTests(drawingToolsManager) {
123
+ console.log("🧪 Running Mobile Detection Tests...\n");
124
+ // Show platform information
125
+ showPlatformInfo();
126
+ console.log("");
127
+ // Test mobile detection
128
+ const detectionTest = testMobileDetection(drawingToolsManager);
129
+ // Test strategy selection
130
+ const selectionTest = testStrategySelection(drawingToolsManager);
131
+ const allTestsPassed = detectionTest && selectionTest;
132
+ console.log(`\n📊 Mobile Detection Tests: ${allTestsPassed ? "PASSED" : "FAILED"}`);
133
+ return allTestsPassed;
134
+ }
135
+ exports.runMobileDetectionTests = runMobileDetectionTests;
136
+ //# sourceMappingURL=test-mobile-detection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-mobile-detection.js","sourceRoot":"","sources":["../../../../../src/business/implementation/managers/interaction/test-mobile-detection.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,+EAA8D;AAE9D,iFAA4E;AAC5E,wFAAmF;AACnF,sFAAiF;AAEjF;;GAE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BAAmB,CAAC,CAAC;IAEjE,MAAM,cAAc,GAAG,aAAa,IAAI,aAAa,CAAC;IAEtD,OAAO,CAAC,GAAG,CACV,gCAAgC,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,CACtE,CAAC;IAEF,OAAO,cAAc,CAAC;AACvB,CAAC;AAtBD,0DAsBC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Simple test to verify the refactored interaction manager works correctly
3
+ */
4
+ import { DrawingToolsManager } from "../../DrawingToolsManager";
5
+ /**
6
+ * Test function to verify the interface implementation and temporary point functionality
7
+ */
8
+ export declare function testRefactoredInteractionManager(drawingToolsManager: DrawingToolsManager): boolean;
9
+ //# sourceMappingURL=test-refactored.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-refactored.d.ts","sourceRoot":"","sources":["../../../../../src/business/implementation/managers/interaction/test-refactored.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAC,mBAAmB,EAAC,MAAM,2BAA2B,CAAC;AAI9D;;GAEG;AACH,wBAAgB,gCAAgC,CAC/C,mBAAmB,EAAE,mBAAmB,WAyDxC"}