@bhbr/minter 0.0.0-stage → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (327) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +4 -2
  3. package/dist/boards/Board.d.ts +138 -0
  4. package/dist/boards/Board.d.ts.map +1 -0
  5. package/dist/boards/Board.js +1329 -0
  6. package/dist/boards/Board.js.map +1 -0
  7. package/dist/boards/BoardCreator.d.ts +8 -0
  8. package/dist/boards/BoardCreator.d.ts.map +1 -0
  9. package/dist/boards/BoardCreator.js +24 -0
  10. package/dist/boards/BoardCreator.js.map +1 -0
  11. package/dist/boards/EditableLinkHook.d.ts +2 -0
  12. package/dist/boards/EditableLinkHook.d.ts.map +1 -0
  13. package/dist/boards/EditableLinkHook.js +137 -0
  14. package/dist/boards/EditableLinkHook.js.map +1 -0
  15. package/dist/boards/EditableLinkHookView.d.ts +2 -0
  16. package/dist/boards/EditableLinkHookView.d.ts.map +1 -0
  17. package/dist/boards/EditableLinkHookView.js +42 -0
  18. package/dist/boards/EditableLinkHookView.js.map +1 -0
  19. package/dist/boards/ExpandButton.d.ts +17 -0
  20. package/dist/boards/ExpandButton.d.ts.map +1 -0
  21. package/dist/boards/ExpandButton.js +59 -0
  22. package/dist/boards/ExpandButton.js.map +1 -0
  23. package/dist/boards/ExpandedBoardIOList.d.ts +12 -0
  24. package/dist/boards/ExpandedBoardIOList.d.ts.map +1 -0
  25. package/dist/boards/ExpandedBoardIOList.js +35 -0
  26. package/dist/boards/ExpandedBoardIOList.js.map +1 -0
  27. package/dist/boards/ExpandedBoardInputList.d.ts +4 -0
  28. package/dist/boards/ExpandedBoardInputList.d.ts.map +1 -0
  29. package/dist/boards/ExpandedBoardInputList.js +4 -0
  30. package/dist/boards/ExpandedBoardInputList.js.map +1 -0
  31. package/dist/boards/ExpandedBoardOutputList.d.ts +4 -0
  32. package/dist/boards/ExpandedBoardOutputList.d.ts.map +1 -0
  33. package/dist/boards/ExpandedBoardOutputList.js +4 -0
  34. package/dist/boards/ExpandedBoardOutputList.js.map +1 -0
  35. package/dist/boards/constants.d.ts +6 -0
  36. package/dist/boards/constants.d.ts.map +1 -0
  37. package/dist/boards/constants.js +6 -0
  38. package/dist/boards/constants.js.map +1 -0
  39. package/dist/constants.d.ts +14 -0
  40. package/dist/constants.d.ts.map +1 -0
  41. package/dist/constants.js +23 -0
  42. package/dist/constants.js.map +1 -0
  43. package/dist/creators/Creator.d.ts +19 -0
  44. package/dist/creators/Creator.d.ts.map +1 -0
  45. package/dist/creators/Creator.js +54 -0
  46. package/dist/creators/Creator.js.map +1 -0
  47. package/dist/creators/DraggingCreator.d.ts +10 -0
  48. package/dist/creators/DraggingCreator.d.ts.map +1 -0
  49. package/dist/creators/DraggingCreator.js +45 -0
  50. package/dist/creators/DraggingCreator.js.map +1 -0
  51. package/dist/creators/Freehand.d.ts +16 -0
  52. package/dist/creators/Freehand.d.ts.map +1 -0
  53. package/dist/creators/Freehand.js +68 -0
  54. package/dist/creators/Freehand.js.map +1 -0
  55. package/dist/creators/SpanningCreator.d.ts +15 -0
  56. package/dist/creators/SpanningCreator.d.ts.map +1 -0
  57. package/dist/creators/SpanningCreator.js +66 -0
  58. package/dist/creators/SpanningCreator.js.map +1 -0
  59. package/dist/functions/logging.d.ts +4 -0
  60. package/dist/functions/logging.d.ts.map +1 -0
  61. package/dist/functions/logging.js +103 -0
  62. package/dist/functions/logging.js.map +1 -0
  63. package/dist/functions/math.d.ts +9 -0
  64. package/dist/functions/math.d.ts.map +1 -0
  65. package/dist/functions/math.js +85 -0
  66. package/dist/functions/math.js.map +1 -0
  67. package/dist/functions/various.d.ts +4 -0
  68. package/dist/functions/various.d.ts.map +1 -0
  69. package/dist/functions/various.js +54 -0
  70. package/dist/functions/various.js.map +1 -0
  71. package/dist/index.d.ts +77 -0
  72. package/dist/index.d.ts.map +1 -0
  73. package/dist/index.js +79 -0
  74. package/dist/index.js.map +1 -0
  75. package/dist/linkables/DependencyLink.d.ts +24 -0
  76. package/dist/linkables/DependencyLink.d.ts.map +1 -0
  77. package/dist/linkables/DependencyLink.js +70 -0
  78. package/dist/linkables/DependencyLink.js.map +1 -0
  79. package/dist/linkables/IOList.d.ts +37 -0
  80. package/dist/linkables/IOList.d.ts.map +1 -0
  81. package/dist/linkables/IOList.js +203 -0
  82. package/dist/linkables/IOList.js.map +1 -0
  83. package/dist/linkables/InputList.d.ts +7 -0
  84. package/dist/linkables/InputList.d.ts.map +1 -0
  85. package/dist/linkables/InputList.js +13 -0
  86. package/dist/linkables/InputList.js.map +1 -0
  87. package/dist/linkables/LinkBullet.d.ts +11 -0
  88. package/dist/linkables/LinkBullet.d.ts.map +1 -0
  89. package/dist/linkables/LinkBullet.js +35 -0
  90. package/dist/linkables/LinkBullet.js.map +1 -0
  91. package/dist/linkables/LinkHook.d.ts +14 -0
  92. package/dist/linkables/LinkHook.d.ts.map +1 -0
  93. package/dist/linkables/LinkHook.js +50 -0
  94. package/dist/linkables/LinkHook.js.map +1 -0
  95. package/dist/linkables/LinkOutlet.d.ts +26 -0
  96. package/dist/linkables/LinkOutlet.d.ts.map +1 -0
  97. package/dist/linkables/LinkOutlet.js +136 -0
  98. package/dist/linkables/LinkOutlet.js.map +1 -0
  99. package/dist/linkables/Linkable.d.ts +55 -0
  100. package/dist/linkables/Linkable.d.ts.map +1 -0
  101. package/dist/linkables/Linkable.js +258 -0
  102. package/dist/linkables/Linkable.js.map +1 -0
  103. package/dist/linkables/OutputList.d.ts +7 -0
  104. package/dist/linkables/OutputList.d.ts.map +1 -0
  105. package/dist/linkables/OutputList.js +16 -0
  106. package/dist/linkables/OutputList.js.map +1 -0
  107. package/dist/linkables/constants.d.ts +12 -0
  108. package/dist/linkables/constants.d.ts.map +1 -0
  109. package/dist/linkables/constants.js +16 -0
  110. package/dist/linkables/constants.js.map +1 -0
  111. package/dist/mobjects/Dependency.d.ts +11 -0
  112. package/dist/mobjects/Dependency.d.ts.map +1 -0
  113. package/dist/mobjects/Dependency.js +19 -0
  114. package/dist/mobjects/Dependency.js.map +1 -0
  115. package/dist/mobjects/MGroup.d.ts +5 -0
  116. package/dist/mobjects/MGroup.d.ts.map +1 -0
  117. package/dist/mobjects/MGroup.js +15 -0
  118. package/dist/mobjects/MGroup.js.map +1 -0
  119. package/dist/mobjects/Mobject.d.ts +138 -0
  120. package/dist/mobjects/Mobject.d.ts.map +1 -0
  121. package/dist/mobjects/Mobject.js +488 -0
  122. package/dist/mobjects/Mobject.js.map +1 -0
  123. package/dist/mobjects/Motor.d.ts +20 -0
  124. package/dist/mobjects/Motor.d.ts.map +1 -0
  125. package/dist/mobjects/Motor.js +118 -0
  126. package/dist/mobjects/Motor.js.map +1 -0
  127. package/dist/mobjects/Sensor.d.ts +112 -0
  128. package/dist/mobjects/Sensor.d.ts.map +1 -0
  129. package/dist/mobjects/Sensor.js +650 -0
  130. package/dist/mobjects/Sensor.js.map +1 -0
  131. package/dist/mobjects/UpdateCall.d.ts +17 -0
  132. package/dist/mobjects/UpdateCall.d.ts.map +1 -0
  133. package/dist/mobjects/UpdateCall.js +67 -0
  134. package/dist/mobjects/UpdateCall.js.map +1 -0
  135. package/dist/mobjects/screen_events.d.ts +38 -0
  136. package/dist/mobjects/screen_events.d.ts.map +1 -0
  137. package/dist/mobjects/screen_events.js +143 -0
  138. package/dist/mobjects/screen_events.js.map +1 -0
  139. package/dist/paper/APILoader.d.ts +10 -0
  140. package/dist/paper/APILoader.d.ts.map +1 -0
  141. package/dist/paper/APILoader.js +18 -0
  142. package/dist/paper/APILoader.js.map +1 -0
  143. package/dist/paper/Paper.d.ts +34 -0
  144. package/dist/paper/Paper.d.ts.map +1 -0
  145. package/dist/paper/Paper.js +210 -0
  146. package/dist/paper/Paper.js.map +1 -0
  147. package/dist/paper/PaperView.d.ts +5 -0
  148. package/dist/paper/PaperView.d.ts.map +1 -0
  149. package/dist/paper/PaperView.js +9 -0
  150. package/dist/paper/PaperView.js.map +1 -0
  151. package/dist/paper/getPaper.d.ts +3 -0
  152. package/dist/paper/getPaper.d.ts.map +1 -0
  153. package/dist/paper/getPaper.js +8 -0
  154. package/dist/paper/getPaper.js.map +1 -0
  155. package/dist/paper/initPaper.d.ts +2 -0
  156. package/dist/paper/initPaper.d.ts.map +1 -0
  157. package/dist/paper/initPaper.js +3 -0
  158. package/dist/paper/initPaper.js.map +1 -0
  159. package/dist/shapes/Circle.d.ts +6 -0
  160. package/dist/shapes/Circle.d.ts.map +1 -0
  161. package/dist/shapes/Circle.js +20 -0
  162. package/dist/shapes/Circle.js.map +1 -0
  163. package/dist/shapes/CircularArc.d.ts +13 -0
  164. package/dist/shapes/CircularArc.d.ts.map +1 -0
  165. package/dist/shapes/CircularArc.js +95 -0
  166. package/dist/shapes/CircularArc.js.map +1 -0
  167. package/dist/shapes/CurvedArrow.d.ts +19 -0
  168. package/dist/shapes/CurvedArrow.d.ts.map +1 -0
  169. package/dist/shapes/CurvedArrow.js +89 -0
  170. package/dist/shapes/CurvedArrow.js.map +1 -0
  171. package/dist/shapes/Line.d.ts +14 -0
  172. package/dist/shapes/Line.d.ts.map +1 -0
  173. package/dist/shapes/Line.js +33 -0
  174. package/dist/shapes/Line.js.map +1 -0
  175. package/dist/shapes/Pill.d.ts +9 -0
  176. package/dist/shapes/Pill.d.ts.map +1 -0
  177. package/dist/shapes/Pill.js +51 -0
  178. package/dist/shapes/Pill.js.map +1 -0
  179. package/dist/shapes/Rectangle.d.ts +14 -0
  180. package/dist/shapes/Rectangle.d.ts.map +1 -0
  181. package/dist/shapes/Rectangle.js +34 -0
  182. package/dist/shapes/Rectangle.js.map +1 -0
  183. package/dist/shapes/RoundedRectangle.d.ts +17 -0
  184. package/dist/shapes/RoundedRectangle.d.ts.map +1 -0
  185. package/dist/shapes/RoundedRectangle.js +86 -0
  186. package/dist/shapes/RoundedRectangle.js.map +1 -0
  187. package/dist/shapes/Square.d.ts +8 -0
  188. package/dist/shapes/Square.d.ts.map +1 -0
  189. package/dist/shapes/Square.js +25 -0
  190. package/dist/shapes/Square.js.map +1 -0
  191. package/dist/sidebar/Sidebar.d.ts +28 -0
  192. package/dist/sidebar/Sidebar.d.ts.map +1 -0
  193. package/dist/sidebar/Sidebar.js +222 -0
  194. package/dist/sidebar/Sidebar.js.map +1 -0
  195. package/dist/sidebar/SidebarView.d.ts +5 -0
  196. package/dist/sidebar/SidebarView.d.ts.map +1 -0
  197. package/dist/sidebar/SidebarView.js +9 -0
  198. package/dist/sidebar/SidebarView.js.map +1 -0
  199. package/dist/sidebar/buttons/BoardButton.d.ts +6 -0
  200. package/dist/sidebar/buttons/BoardButton.d.ts.map +1 -0
  201. package/dist/sidebar/buttons/BoardButton.js +14 -0
  202. package/dist/sidebar/buttons/BoardButton.js.map +1 -0
  203. package/dist/sidebar/buttons/ControlsButton.d.ts +5 -0
  204. package/dist/sidebar/buttons/ControlsButton.d.ts.map +1 -0
  205. package/dist/sidebar/buttons/ControlsButton.js +11 -0
  206. package/dist/sidebar/buttons/ControlsButton.js.map +1 -0
  207. package/dist/sidebar/buttons/CreativeButton.d.ts +13 -0
  208. package/dist/sidebar/buttons/CreativeButton.d.ts.map +1 -0
  209. package/dist/sidebar/buttons/CreativeButton.js +49 -0
  210. package/dist/sidebar/buttons/CreativeButton.js.map +1 -0
  211. package/dist/sidebar/buttons/DragButton.d.ts +5 -0
  212. package/dist/sidebar/buttons/DragButton.d.ts.map +1 -0
  213. package/dist/sidebar/buttons/DragButton.js +10 -0
  214. package/dist/sidebar/buttons/DragButton.js.map +1 -0
  215. package/dist/sidebar/buttons/EraseButton.d.ts +7 -0
  216. package/dist/sidebar/buttons/EraseButton.d.ts.map +1 -0
  217. package/dist/sidebar/buttons/EraseButton.js +34 -0
  218. package/dist/sidebar/buttons/EraseButton.js.map +1 -0
  219. package/dist/sidebar/buttons/LinkButton.d.ts +5 -0
  220. package/dist/sidebar/buttons/LinkButton.d.ts.map +1 -0
  221. package/dist/sidebar/buttons/LinkButton.js +9 -0
  222. package/dist/sidebar/buttons/LinkButton.js.map +1 -0
  223. package/dist/sidebar/buttons/SidebarButton.d.ts +72 -0
  224. package/dist/sidebar/buttons/SidebarButton.d.ts.map +1 -0
  225. package/dist/sidebar/buttons/SidebarButton.js +369 -0
  226. package/dist/sidebar/buttons/SidebarButton.js.map +1 -0
  227. package/dist/sidebar/buttons/SidebarButtonView.d.ts +6 -0
  228. package/dist/sidebar/buttons/SidebarButtonView.d.ts.map +1 -0
  229. package/dist/sidebar/buttons/SidebarButtonView.js +8 -0
  230. package/dist/sidebar/buttons/SidebarButtonView.js.map +1 -0
  231. package/dist/sidebar/buttons/ToggleButton.d.ts +17 -0
  232. package/dist/sidebar/buttons/ToggleButton.d.ts.map +1 -0
  233. package/dist/sidebar/buttons/ToggleButton.js +79 -0
  234. package/dist/sidebar/buttons/ToggleButton.js.map +1 -0
  235. package/dist/sidebar/buttons/button_geometry.d.ts +10 -0
  236. package/dist/sidebar/buttons/button_geometry.d.ts.map +1 -0
  237. package/dist/sidebar/buttons/button_geometry.js +15 -0
  238. package/dist/sidebar/buttons/button_geometry.js.map +1 -0
  239. package/dist/sidebar/getSidebar.d.ts +3 -0
  240. package/dist/sidebar/getSidebar.d.ts.map +1 -0
  241. package/dist/sidebar/getSidebar.js +8 -0
  242. package/dist/sidebar/getSidebar.js.map +1 -0
  243. package/dist/sidebar/initSidebar.d.ts +2 -0
  244. package/dist/sidebar/initSidebar.d.ts.map +1 -0
  245. package/dist/sidebar/initSidebar.js +3 -0
  246. package/dist/sidebar/initSidebar.js.map +1 -0
  247. package/dist/ui/Checkbox.d.ts +20 -0
  248. package/dist/ui/Checkbox.d.ts.map +1 -0
  249. package/dist/ui/Checkbox.js +71 -0
  250. package/dist/ui/Checkbox.js.map +1 -0
  251. package/dist/ui/InputTextBox.d.ts +24 -0
  252. package/dist/ui/InputTextBox.d.ts.map +1 -0
  253. package/dist/ui/InputTextBox.js +104 -0
  254. package/dist/ui/InputTextBox.js.map +1 -0
  255. package/dist/ui/LinkableInputTextBox.d.ts +11 -0
  256. package/dist/ui/LinkableInputTextBox.d.ts.map +1 -0
  257. package/dist/ui/LinkableInputTextBox.js +32 -0
  258. package/dist/ui/LinkableInputTextBox.js.map +1 -0
  259. package/dist/ui/Popover.d.ts +34 -0
  260. package/dist/ui/Popover.d.ts.map +1 -0
  261. package/dist/ui/Popover.js +187 -0
  262. package/dist/ui/Popover.js.map +1 -0
  263. package/dist/ui/RadioButton.d.ts +16 -0
  264. package/dist/ui/RadioButton.d.ts.map +1 -0
  265. package/dist/ui/RadioButton.js +53 -0
  266. package/dist/ui/RadioButton.js.map +1 -0
  267. package/dist/ui/RadioButtonList.d.ts +16 -0
  268. package/dist/ui/RadioButtonList.d.ts.map +1 -0
  269. package/dist/ui/RadioButtonList.js +71 -0
  270. package/dist/ui/RadioButtonList.js.map +1 -0
  271. package/dist/ui/Scroll.d.ts +10 -0
  272. package/dist/ui/Scroll.d.ts.map +1 -0
  273. package/dist/ui/Scroll.js +30 -0
  274. package/dist/ui/Scroll.js.map +1 -0
  275. package/dist/ui/SimpleButton.d.ts +16 -0
  276. package/dist/ui/SimpleButton.d.ts.map +1 -0
  277. package/dist/ui/SimpleButton.js +61 -0
  278. package/dist/ui/SimpleButton.js.map +1 -0
  279. package/dist/ui/TextLabel.d.ts +19 -0
  280. package/dist/ui/TextLabel.d.ts.map +1 -0
  281. package/dist/ui/TextLabel.js +21 -0
  282. package/dist/ui/TextLabel.js.map +1 -0
  283. package/dist/ui/TextLabelView.d.ts +15 -0
  284. package/dist/ui/TextLabelView.d.ts.map +1 -0
  285. package/dist/ui/TextLabelView.js +52 -0
  286. package/dist/ui/TextLabelView.js.map +1 -0
  287. package/dist/views/Color.d.ts +31 -0
  288. package/dist/views/Color.d.ts.map +1 -0
  289. package/dist/views/Color.js +107 -0
  290. package/dist/views/Color.js.map +1 -0
  291. package/dist/views/Frame.d.ts +64 -0
  292. package/dist/views/Frame.d.ts.map +1 -0
  293. package/dist/views/Frame.js +132 -0
  294. package/dist/views/Frame.js.map +1 -0
  295. package/dist/views/ImageView.d.ts +10 -0
  296. package/dist/views/ImageView.d.ts.map +1 -0
  297. package/dist/views/ImageView.js +28 -0
  298. package/dist/views/ImageView.js.map +1 -0
  299. package/dist/views/View.d.ts +45 -0
  300. package/dist/views/View.d.ts.map +1 -0
  301. package/dist/views/View.js +181 -0
  302. package/dist/views/View.js.map +1 -0
  303. package/dist/vmobjects/CurvedLine.d.ts +14 -0
  304. package/dist/vmobjects/CurvedLine.d.ts.map +1 -0
  305. package/dist/vmobjects/CurvedLine.js +66 -0
  306. package/dist/vmobjects/CurvedLine.js.map +1 -0
  307. package/dist/vmobjects/CurvedShape.d.ts +5 -0
  308. package/dist/vmobjects/CurvedShape.d.ts.map +1 -0
  309. package/dist/vmobjects/CurvedShape.js +12 -0
  310. package/dist/vmobjects/CurvedShape.js.map +1 -0
  311. package/dist/vmobjects/Polygon.d.ts +5 -0
  312. package/dist/vmobjects/Polygon.d.ts.map +1 -0
  313. package/dist/vmobjects/Polygon.js +12 -0
  314. package/dist/vmobjects/Polygon.js.map +1 -0
  315. package/dist/vmobjects/PolygonalLine.d.ts +9 -0
  316. package/dist/vmobjects/PolygonalLine.d.ts.map +1 -0
  317. package/dist/vmobjects/PolygonalLine.js +34 -0
  318. package/dist/vmobjects/PolygonalLine.js.map +1 -0
  319. package/dist/vmobjects/VMobject.d.ts +58 -0
  320. package/dist/vmobjects/VMobject.d.ts.map +1 -0
  321. package/dist/vmobjects/VMobject.js +165 -0
  322. package/dist/vmobjects/VMobject.js.map +1 -0
  323. package/dist/vmobjects/VView.d.ts +19 -0
  324. package/dist/vmobjects/VView.d.ts.map +1 -0
  325. package/dist/vmobjects/VView.js +61 -0
  326. package/dist/vmobjects/VView.js.map +1 -0
  327. package/package.json +43 -4
@@ -0,0 +1,650 @@
1
+ import { BetterObject } from '@bhbr/better-things';
2
+ import { ScreenEventHandler, ScreenEventDevice, ScreenEventType, screenEventDevice, screenEventType, eventVertex, isTouchDevice } from './screen_events.js';
3
+ import { MAX_TAP_DELAY, MERE_TAP_DELAY, LONG_PRESS_DURATION } from '../constants.js';
4
+ import { getPaper } from '../paper/getPaper.js';
5
+ import { getSidebar } from '../sidebar/getSidebar.js';
6
+ export class Sensor extends BetterObject {
7
+ defaults() {
8
+ return {
9
+ mobject: null,
10
+ screenEventHandler: ScreenEventHandler.Parent,
11
+ savedScreenEventHandler: null,
12
+ eventTarget: null,
13
+ screenEventHistory: [],
14
+ screenEventDevice: null,
15
+ eventStartTime: 0,
16
+ eventStartLocation: null
17
+ };
18
+ }
19
+ mutabilities() {
20
+ return {};
21
+ }
22
+ /*
23
+ Methods for temporarily disabling interactivity on a mobject
24
+ (e. g. when dragging a CindyCanvas)
25
+ */
26
+ disable() {
27
+ if (this.isDisabled()) {
28
+ return;
29
+ }
30
+ this.savedScreenEventHandler = this.screenEventHandler;
31
+ this.screenEventHandler = ScreenEventHandler.Parent; // .Below?
32
+ }
33
+ enable() {
34
+ if (this.isEnabled()) {
35
+ return;
36
+ }
37
+ this.screenEventHandler = this.savedScreenEventHandler;
38
+ this.savedScreenEventHandler = null;
39
+ }
40
+ isEnabled() {
41
+ return (this.savedScreenEventHandler === null);
42
+ }
43
+ isDisabled() {
44
+ return !this.isEnabled();
45
+ }
46
+ /*
47
+ Finding the event target
48
+
49
+ Depending on the screenEventHandler:
50
+
51
+ - .Below: mobject is transparent (via CSS), the sibling mobject
52
+ underneath or the parent should handle the event
53
+ Example: TwoPointCircle in a Construction
54
+ - .Auto: don't interfere with event propagation at all
55
+ Example: CindyCanvas
56
+
57
+ Otherwise the event is captured by the topmost view (paper or sidebar),
58
+ the automatic propagation is stopped and the event is passed onto the
59
+ eventTarget as determined by the declared screenEventHandlers in the
60
+ chain of possible event targets.
61
+ The event target is the lowest mobject willing to handle it and that
62
+ is not underneath a mobject that wants its parent to handle it.
63
+
64
+ - .Parent: the parent should handle it
65
+ - .Self: handle it if no child wants to handle it and if no parent wants
66
+ its parent to handle it
67
+ */
68
+ eventTargetMobject(e) {
69
+ /*
70
+ Find the lowest Mobject willing and allowed to handle the event
71
+ General rule: the event is handled by the lowest submob that can handle it
72
+ and that is not underneath a mobject that wants its parent to handle it.
73
+ If the event policies end in a loop, no one handles it.
74
+ */
75
+ var t = e.target;
76
+ if (t == this.mobject.view.div) {
77
+ return this.mobject;
78
+ }
79
+ let targetMobChain = this.eventTargetMobjectChain(e); // defined below
80
+ var m;
81
+ while (targetMobChain.length > 0) {
82
+ m = targetMobChain.pop();
83
+ if (m === undefined) {
84
+ return this.mobject;
85
+ }
86
+ if (m.sensor.screenEventHandler == ScreenEventHandler.Parent) {
87
+ continue;
88
+ }
89
+ if ((m.sensor.screenEventHandler == ScreenEventHandler.Self || m.sensor.screenEventHandler == ScreenEventHandler.Auto)) {
90
+ return m;
91
+ }
92
+ }
93
+ // if all of this fails, this mob must handle the event itself
94
+ return this.mobject;
95
+ }
96
+ eventTargetMobjectChain(e) {
97
+ // Collect the chain of corresponding target mobjects (highest to lowest)
98
+ let targetDivChain = this.eventTargetDivChain(e); // defined below
99
+ let targetMobChain = [];
100
+ for (var div of targetDivChain.values()) {
101
+ try {
102
+ let m = div['view'].mobject;
103
+ let mob = m;
104
+ // only consider targets above the first mobject
105
+ // with ScreenEventHandler.Parent
106
+ targetMobChain.push(mob);
107
+ }
108
+ catch {
109
+ continue;
110
+ }
111
+ }
112
+ return targetMobChain;
113
+ }
114
+ eventTargetDivChain(e) {
115
+ // Collect the chain of target views (highest to lowest)
116
+ var t = e.target;
117
+ if (t.tagName == 'path') {
118
+ t = t.parentElement.parentElement;
119
+ }
120
+ // the mob whose view contains the svg element containing the path
121
+ if (t.tagName == 'svg') {
122
+ t = t.parentElement;
123
+ } //.parentElement }
124
+ // we hit an svg outside its path (but inside its bounding box),
125
+ // so ignore the corresponding mob and pass the event on to its parent
126
+ let targetDivChain = [t];
127
+ while (t != undefined && t != this.mobject.view.div) {
128
+ t = t.parentElement;
129
+ targetDivChain.push(t);
130
+ }
131
+ return targetDivChain.reverse();
132
+ }
133
+ /*
134
+ Captured event methods
135
+ */
136
+ capturedOnPointerDown(e) {
137
+ this.eventStartLocation = this.localEventVertex(e);
138
+ if (this.eventStartTime == 0) {
139
+ this.eventStartTime = e.timeStamp;
140
+ }
141
+ let target = this.eventTargetMobject(e);
142
+ this.eventTarget = target;
143
+ if (target == null) {
144
+ return;
145
+ }
146
+ if (target.sensor.screenEventHandler == ScreenEventHandler.Auto) {
147
+ return;
148
+ }
149
+ e.stopPropagation();
150
+ if (this.eventTarget.preventDefault) {
151
+ e.preventDefault();
152
+ }
153
+ this.clearResetPointer();
154
+ this.clearDeleteHistoryTimeout();
155
+ this.decideEventAction(e);
156
+ }
157
+ capturedOnPointerMove(e) {
158
+ let target = this.eventTarget;
159
+ if (target == null || this.screenEventDevice == null) {
160
+ return;
161
+ }
162
+ if (target.sensor.screenEventHandler == ScreenEventHandler.Auto) {
163
+ return;
164
+ }
165
+ e.stopPropagation();
166
+ if (this.eventTarget.preventDefault) {
167
+ e.preventDefault();
168
+ }
169
+ switch (this.screenEventDevice) {
170
+ case ScreenEventDevice.Finger:
171
+ target.sensor.onTouchMove(e);
172
+ break;
173
+ case ScreenEventDevice.Pen:
174
+ target.sensor.onPenMove(e);
175
+ break;
176
+ case ScreenEventDevice.Mouse:
177
+ target.sensor.onMouseMove(e);
178
+ break;
179
+ default:
180
+ throw `Unknown pointer device ${this.screenEventDevice}`;
181
+ }
182
+ }
183
+ capturedOnPointerUp(e) {
184
+ let target = this.eventTarget;
185
+ if (target == null || this.screenEventDevice == null) {
186
+ if (this.mobject) {
187
+ if (this.mobject.isInstanceOf('Board')) {
188
+ let sidebar = getSidebar();
189
+ if (sidebar.activeButton) {
190
+ sidebar.activeButton.commonButtonUp();
191
+ }
192
+ }
193
+ }
194
+ return;
195
+ }
196
+ if (target.sensor.screenEventHandler == ScreenEventHandler.Auto) {
197
+ return;
198
+ }
199
+ e.stopPropagation();
200
+ if (this.eventTarget.preventDefault) {
201
+ e.preventDefault();
202
+ }
203
+ this.decideEventAction(e);
204
+ this.eventStartLocation = null;
205
+ if (this.deleteHistoryTimeoutID != null) {
206
+ return;
207
+ }
208
+ this.deleteHistoryTimeoutID = window.setTimeout(this.deleteScreenEventHistory.bind(this), 1000);
209
+ }
210
+ capturedOnPointerOut(e) {
211
+ let target = this.eventTarget;
212
+ if (target == null || this.screenEventDevice == null) {
213
+ return;
214
+ }
215
+ if (target.sensor.screenEventHandler == ScreenEventHandler.Auto) {
216
+ return;
217
+ }
218
+ e.stopPropagation();
219
+ if (this.eventTarget.preventDefault) {
220
+ e.preventDefault();
221
+ }
222
+ target.sensor.onPointerOut(e);
223
+ this.deleteScreenEventHistory();
224
+ }
225
+ decideEventAction(e) {
226
+ let device = screenEventDevice(e);
227
+ let type = screenEventType(e);
228
+ if (e instanceof MouseEvent && device == ScreenEventDevice.Pen && type == ScreenEventType.Down) {
229
+ //log('case 1')
230
+ this.eventTarget.sensor.rawOnPenDown(e);
231
+ this.eventTarget.sensor.registerScreenEvent(e);
232
+ this.screenEventDevice = ScreenEventDevice.Pen;
233
+ }
234
+ else if (e instanceof PointerEvent && device == ScreenEventDevice.Pen && type == ScreenEventType.Up) {
235
+ //log('case 2')
236
+ this.eventTarget.sensor.rawOnPenUp(e);
237
+ this.eventTarget.sensor.registerScreenEvent(e);
238
+ this.resetPointer();
239
+ }
240
+ else if (e instanceof MouseEvent && device == ScreenEventDevice.Pen && type == ScreenEventType.Up) {
241
+ //log('case 3')
242
+ // ignore
243
+ }
244
+ else if (e instanceof MouseEvent && device == ScreenEventDevice.Finger && type == ScreenEventType.Down) {
245
+ //log('case 4')
246
+ this.eventTarget.sensor.rawOnTouchDown(e);
247
+ this.eventTarget.sensor.registerScreenEvent(e);
248
+ this.screenEventDevice = ScreenEventDevice.Finger;
249
+ }
250
+ else if (e instanceof PointerEvent && device == ScreenEventDevice.Finger && type == ScreenEventType.Up) {
251
+ //log('case 5')
252
+ this.eventTarget.sensor.rawOnTouchUp(e);
253
+ this.eventTarget.sensor.registerScreenEvent(e);
254
+ this.resetPointer();
255
+ }
256
+ else if (e instanceof MouseEvent && device == ScreenEventDevice.Finger && type == ScreenEventType.Up) {
257
+ //log('case 6')
258
+ // ignore
259
+ }
260
+ else if (e instanceof MouseEvent && device == ScreenEventDevice.Mouse && type == ScreenEventType.Down) {
261
+ if (this.screenEventDevice == ScreenEventDevice.Finger) {
262
+ //log('case 7a')
263
+ // ignore
264
+ }
265
+ else if (this.screenEventDevice == ScreenEventDevice.Pen) {
266
+ //log('case 7b')
267
+ // ignore
268
+ }
269
+ else {
270
+ //log('case 7c')
271
+ this.eventTarget.sensor.rawOnMouseDown(e);
272
+ this.eventTarget.sensor.registerScreenEvent(e);
273
+ this.screenEventDevice = ScreenEventDevice.Mouse;
274
+ }
275
+ }
276
+ else if (e instanceof PointerEvent && device == ScreenEventDevice.Mouse && type == ScreenEventType.Up) {
277
+ if (this.screenEventDevice == ScreenEventDevice.Finger) {
278
+ if (isTouchDevice) {
279
+ //log('case 8a1')
280
+ this.eventTarget.sensor.rawOnTouchUp(e);
281
+ this.eventTarget.sensor.registerScreenEvent(e);
282
+ this.resetPointerTimeoutID = window.setTimeout(this.resetPointer.bind(this), 250);
283
+ }
284
+ else {
285
+ //log('case 8a2')
286
+ // ignore
287
+ }
288
+ }
289
+ else if (this.screenEventDevice == ScreenEventDevice.Pen) {
290
+ if (isTouchDevice) {
291
+ //log('case 8b1')
292
+ this.eventTarget.sensor.rawOnPenUp(e);
293
+ this.eventTarget.sensor.registerScreenEvent(e);
294
+ this.resetPointerTimeoutID = window.setTimeout(this.resetPointer.bind(this), 250);
295
+ }
296
+ else {
297
+ //log('case 8b2')
298
+ // ignore
299
+ }
300
+ }
301
+ else {
302
+ //log('case 8c')
303
+ this.eventTarget.sensor.rawOnMouseUp(e);
304
+ this.eventTarget.sensor.registerScreenEvent(e);
305
+ this.resetPointerTimeoutID = window.setTimeout(this.resetPointer.bind(this), 250);
306
+ }
307
+ }
308
+ else if (e instanceof MouseEvent && device == ScreenEventDevice.Mouse && type == ScreenEventType.Up) {
309
+ //log('case 9')
310
+ // ignore
311
+ }
312
+ else if (e instanceof TouchEvent && device == ScreenEventDevice.Finger && type == ScreenEventType.Down) {
313
+ //log('case 10')
314
+ this.screenEventDevice = ScreenEventDevice.Finger;
315
+ this.eventTarget.sensor.rawOnTouchDown(e);
316
+ this.eventTarget.sensor.registerScreenEvent(e);
317
+ }
318
+ else if (e instanceof TouchEvent && device == ScreenEventDevice.Pen && type == ScreenEventType.Down) {
319
+ //log('case 11')
320
+ this.eventTarget.sensor.rawOnPenDown(e);
321
+ this.eventTarget.sensor.registerScreenEvent(e);
322
+ this.screenEventDevice = ScreenEventDevice.Pen;
323
+ }
324
+ else {
325
+ //log('case 12')
326
+ // ignore
327
+ }
328
+ }
329
+ resetPointer() {
330
+ this.screenEventDevice = null;
331
+ this.resetPointerTimeoutID = null;
332
+ }
333
+ clearResetPointer() {
334
+ window.clearTimeout(this.resetPointerTimeoutID);
335
+ this.resetPointerTimeoutID = null;
336
+ }
337
+ registerScreenEvent(e) {
338
+ this.screenEventHistory.push(e);
339
+ }
340
+ rawOnTouchDown(e) {
341
+ this.longPressTimeoutID = window.setTimeout(this.onLongTouchDown.bind(this), LONG_PRESS_DURATION);
342
+ this.onTouchDown(e);
343
+ }
344
+ rawOnTouchUp(e) {
345
+ if (this.screenEventHistory.length > 0) {
346
+ let e1 = this.screenEventHistory[this.screenEventHistory.length - 1];
347
+ if (e.timeStamp - e1.timeStamp < MAX_TAP_DELAY) {
348
+ this.clearMereTapTimeout();
349
+ this.onTouchTap(e);
350
+ this.mereTapTimeoutID = window.setTimeout(function () {
351
+ this.mereTapTimeoutID = null;
352
+ if (this.screenEventHistory.length == 2) {
353
+ this.onMereTouchTap(e);
354
+ }
355
+ }.bind(this), MERE_TAP_DELAY);
356
+ if (this.screenEventHistory.length == 3) {
357
+ let e2 = this.screenEventHistory[this.screenEventHistory.length - 2];
358
+ let e3 = this.screenEventHistory[this.screenEventHistory.length - 3];
359
+ if (e1.timeStamp - e2.timeStamp < MAX_TAP_DELAY && e2.timeStamp - e3.timeStamp < MAX_TAP_DELAY) {
360
+ this.onDoubleTouchTap(e);
361
+ }
362
+ }
363
+ }
364
+ }
365
+ this.clearLongPressTimeout();
366
+ this.onTouchUp(e);
367
+ }
368
+ rawOnPenDown(e) {
369
+ this.longPressTimeoutID = window.setTimeout(this.onLongPenDown.bind(this), LONG_PRESS_DURATION);
370
+ this.onPenDown(e);
371
+ }
372
+ rawOnPenUp(e) {
373
+ let e1 = this.screenEventHistory[this.screenEventHistory.length - 1];
374
+ if (e.timeStamp - e1.timeStamp < MAX_TAP_DELAY) {
375
+ this.onPenTap(e);
376
+ this.mereTapTimeoutID = window.setTimeout(function () {
377
+ this.mereTapTimeoutID = null;
378
+ if (this.screenEventHistory.length == 2) {
379
+ this.onMerePenTap(e);
380
+ }
381
+ }.bind(this), MERE_TAP_DELAY);
382
+ if (this.screenEventHistory.length == 3) {
383
+ let e2 = this.screenEventHistory[this.screenEventHistory.length - 2];
384
+ let e3 = this.screenEventHistory[this.screenEventHistory.length - 3];
385
+ if (e1.timeStamp - e2.timeStamp < MAX_TAP_DELAY && e2.timeStamp - e3.timeStamp < MAX_TAP_DELAY) {
386
+ this.onDoublePenTap(e);
387
+ }
388
+ }
389
+ }
390
+ this.clearLongPressTimeout();
391
+ this.onPenUp(e);
392
+ }
393
+ rawOnMouseDown(e) {
394
+ this.longPressTimeoutID = window.setTimeout(this.onLongMouseDown.bind(this), LONG_PRESS_DURATION);
395
+ this.onMouseDown(e);
396
+ }
397
+ rawOnMouseUp(e) {
398
+ let e1 = this.screenEventHistory[this.screenEventHistory.length - 1];
399
+ if (e.timeStamp - e1.timeStamp < MAX_TAP_DELAY) {
400
+ this.onMouseClick(e);
401
+ this.mereTapTimeoutID = window.setTimeout(function () {
402
+ this.mereTapTimeoutID = null;
403
+ if (this.screenEventHistory.length == 2) {
404
+ this.onMereMouseClick(e);
405
+ }
406
+ }.bind(this), MERE_TAP_DELAY);
407
+ if (this.screenEventHistory.length == 3) {
408
+ let e2 = this.screenEventHistory[this.screenEventHistory.length - 2];
409
+ let e3 = this.screenEventHistory[this.screenEventHistory.length - 3];
410
+ if (e1.timeStamp - e2.timeStamp < MAX_TAP_DELAY && e2.timeStamp - e3.timeStamp < MAX_TAP_DELAY) {
411
+ this.onDoubleMouseClick(e);
412
+ }
413
+ }
414
+ }
415
+ this.clearLongPressTimeout();
416
+ this.onMouseUp(e);
417
+ }
418
+ // Local coordinates for use in custom event methods
419
+ localEventVertex(e) {
420
+ /*
421
+ eventVertex(e) gives the coordinates in the topmost
422
+ mobject's frame (paper or sidebar). This method here
423
+ finds them in the mobject's local frame.
424
+ */
425
+ let p = eventVertex(e);
426
+ var rt;
427
+ try {
428
+ rt = this.mobject.view.frame.relativeTransform(getPaper().frame);
429
+ }
430
+ catch {
431
+ rt = this.mobject.view.frame.relativeTransform(getSidebar().frame);
432
+ }
433
+ let q = rt.inverse().appliedTo(p);
434
+ return q;
435
+ }
436
+ // Cleanup methods
437
+ deleteScreenEventHistory() {
438
+ this.screenEventHistory = [];
439
+ this.eventTarget = null;
440
+ this.deleteHistoryTimeoutID = null;
441
+ }
442
+ clearDeleteHistoryTimeout() {
443
+ if (this.deleteHistoryTimeoutID) {
444
+ window.clearTimeout(this.deleteHistoryTimeoutID);
445
+ this.deleteHistoryTimeoutID = null;
446
+ }
447
+ }
448
+ clearMereTapTimeout() {
449
+ if (this.mereTapTimeoutID) {
450
+ window.clearTimeout(this.mereTapTimeoutID);
451
+ this.mereTapTimeoutID = null;
452
+ }
453
+ }
454
+ clearLongPressTimeout() {
455
+ if (this.longPressTimeoutID) {
456
+ window.clearTimeout(this.longPressTimeoutID);
457
+ this.longPressTimeoutID = null;
458
+ }
459
+ }
460
+ onPointerDown(e) { this.mobject.onPointerDown(e); }
461
+ onPointerMove(e) { this.mobject.onPointerMove(e); }
462
+ onPointerUp(e) { this.mobject.onPointerUp(e); }
463
+ onTap(e) { this.mobject.onTap(e); }
464
+ onMereTap(e) { this.mobject.onMereTap(e); }
465
+ onDoubleTap(e) { this.mobject.onDoubleTap(e); }
466
+ onLongPress(e) { this.mobject.onLongPress(e); }
467
+ onTouchDown(e) { this.mobject.onTouchDown(e); }
468
+ onTouchMove(e) { this.mobject.onTouchMove(e); }
469
+ onTouchUp(e) { this.mobject.onTouchUp(e); }
470
+ onTouchTap(e) { this.mobject.onTouchTap(e); }
471
+ onMereTouchTap(e) { this.mobject.onMereTouchTap(e); }
472
+ onDoubleTouchTap(e) { this.mobject.onDoubleTouchTap(e); }
473
+ onLongTouchDown(e) { this.mobject.onLongTouchDown(e); }
474
+ onPenDown(e) { this.mobject.onPenDown(e); }
475
+ onPenMove(e) { this.mobject.onPenMove(e); }
476
+ onPenUp(e) { this.mobject.onPenUp(e); }
477
+ onPenTap(e) { this.mobject.onPenTap(e); }
478
+ onMerePenTap(e) { this.mobject.onMerePenTap(e); }
479
+ onDoublePenTap(e) { this.mobject.onDoublePenTap(e); }
480
+ onLongPenDown(e) { this.mobject.onLongPenDown(e); }
481
+ onMouseDown(e) { this.mobject.onMouseDown(e); }
482
+ onMouseMove(e) { this.mobject.onMouseMove(e); }
483
+ onMouseUp(e) { this.mobject.onMouseUp(e); }
484
+ onMouseClick(e) { this.mobject.onMouseClick(e); }
485
+ onMereMouseClick(e) { this.mobject.onMereMouseClick(e); }
486
+ onDoubleMouseClick(e) { this.mobject.onDoubleMouseClick(e); }
487
+ onLongMouseDown(e) { this.mobject.onLongMouseDown(e); }
488
+ onPointerOut(e) { this.mobject.onPointerOut(e); }
489
+ /*
490
+ Backup versions for temporarily disabling
491
+ interactivity on a mobject (e. g. while dragging)
492
+ */
493
+ savedOnTouchDown(e) { }
494
+ savedOnTouchMove(e) { }
495
+ savedOnTouchUp(e) { }
496
+ savedOnTouchTap(e) { }
497
+ savedOnMereTouchTap(e) { }
498
+ savedOnDoubleTouchTap(e) { }
499
+ savedOnLongTouchDown(e) { }
500
+ savedOnPenDown(e) { }
501
+ savedOnPenMove(e) { }
502
+ savedOnPenUp(e) { }
503
+ savedOnPenTap(e) { }
504
+ savedOnMerePenTap(e) { }
505
+ savedOnDoublePenTap(e) { }
506
+ savedOnLongPenDown(e) { }
507
+ savedOnMouseDown(e) { }
508
+ savedOnMouseMove(e) { }
509
+ savedOnMouseUp(e) { }
510
+ savedOnMouseClick(e) { }
511
+ savedOnMereMouseClick(e) { }
512
+ savedOnDoubleMouseClick(e) { }
513
+ savedOnLongMouseDown(e) { }
514
+ savedOnPointerDown(e) { }
515
+ savedOnPointerMove(e) { }
516
+ savedOnPointerUp(e) { }
517
+ savedOnTap(e) { }
518
+ savedOnMereTap(e) { }
519
+ savedOnDoubleTap(e) { }
520
+ savedOnLongPress(e) { }
521
+ setTouchMethodsTo(newOnTouchDown, newOnTouchMove, newOnTouchUp) {
522
+ this.savedOnTouchDown = this.onTouchDown;
523
+ this.savedOnTouchMove = this.onTouchMove;
524
+ this.savedOnTouchUp = this.onTouchUp;
525
+ this.savedOnTouchTap = this.onTouchTap;
526
+ this.savedOnMereTouchTap = this.onMereTouchTap;
527
+ this.savedOnDoubleTouchTap = this.onDoubleTouchTap;
528
+ this.savedOnLongTouchDown = this.onLongTouchDown;
529
+ this.onTouchDown = newOnTouchDown;
530
+ this.onTouchMove = newOnTouchMove;
531
+ this.onTouchUp = newOnTouchUp;
532
+ this.onTouchTap = (e) => { };
533
+ this.onMereTouchTap = (e) => { };
534
+ this.onDoubleTouchTap = (e) => { };
535
+ this.onLongTouchDown = (e) => { };
536
+ }
537
+ setPenMethodsTo(newOnPenDown, newOnPenMove, newOnPenUp) {
538
+ this.savedOnPenDown = this.onPenDown;
539
+ this.savedOnPenMove = this.onPenMove;
540
+ this.savedOnPenUp = this.onPenUp;
541
+ this.savedOnPenTap = this.onPenTap;
542
+ this.savedOnMerePenTap = this.onMerePenTap;
543
+ this.savedOnDoublePenTap = this.onDoublePenTap;
544
+ this.savedOnLongPenDown = this.onLongPenDown;
545
+ this.onPenDown = newOnPenDown;
546
+ this.onPenMove = newOnPenMove;
547
+ this.onPenUp = newOnPenUp;
548
+ this.onPenTap = (e) => { };
549
+ this.onMerePenTap = (e) => { };
550
+ this.onDoublePenTap = (e) => { };
551
+ this.onLongPenDown = (e) => { };
552
+ }
553
+ setMouseMethodsTo(newOnMouseDown, newOnMouseMove, newOnMouseUp) {
554
+ this.savedOnMouseDown = this.onMouseDown;
555
+ this.savedOnMouseMove = this.onMouseMove;
556
+ this.savedOnMouseUp = this.onMouseUp;
557
+ this.savedOnMouseClick = this.onMouseClick;
558
+ this.savedOnMereMouseClick = this.onMereMouseClick;
559
+ this.savedOnDoubleMouseClick = this.onDoubleMouseClick;
560
+ this.savedOnLongMouseDown = this.onLongMouseDown;
561
+ this.onMouseDown = newOnMouseDown;
562
+ this.onMouseMove = newOnMouseMove;
563
+ this.onMouseUp = newOnMouseUp;
564
+ this.onMouseClick = (e) => { };
565
+ this.onMereMouseClick = (e) => { };
566
+ this.onDoubleMouseClick = (e) => { };
567
+ this.onLongMouseDown = (e) => { };
568
+ }
569
+ setPointerMethodsTo(newOnPointerDown, newOnPointerMove, newOnPointerUp) {
570
+ this.savedOnPointerDown = this.onPointerDown;
571
+ this.savedOnPointerMove = this.onPointerMove;
572
+ this.savedOnPointerUp = this.onPointerUp;
573
+ this.savedOnTap = this.onTap;
574
+ this.savedOnMereTap = this.onMereTap;
575
+ this.savedOnDoubleTap = this.onDoubleTap;
576
+ this.savedOnLongPress = this.onLongPress;
577
+ this.onPointerDown = newOnPointerDown;
578
+ this.onPointerMove = newOnPointerMove;
579
+ this.onPointerUp = newOnPointerUp;
580
+ this.onTap = (e) => { };
581
+ this.onMereTap = (e) => { };
582
+ this.onDoubleTap = (e) => { };
583
+ this.onLongPress = (e) => { };
584
+ }
585
+ restoreTouchMethods() {
586
+ this.onTouchDown = this.savedOnTouchDown;
587
+ this.onTouchMove = this.savedOnTouchMove;
588
+ this.onTouchUp = this.savedOnTouchUp;
589
+ this.onTouchTap = this.savedOnTouchTap;
590
+ this.onMereTouchTap = this.savedOnMereTouchTap;
591
+ this.onDoubleTouchTap = this.savedOnDoubleTouchTap;
592
+ this.onLongTouchDown = this.savedOnLongTouchDown;
593
+ this.savedOnTouchDown = (e) => { };
594
+ this.savedOnTouchMove = (e) => { };
595
+ this.savedOnTouchUp = (e) => { };
596
+ this.savedOnTouchTap = (e) => { };
597
+ this.savedOnMereTouchTap = (e) => { };
598
+ this.savedOnDoubleTouchTap = (e) => { };
599
+ this.savedOnLongTouchDown = (e) => { };
600
+ }
601
+ restorePenMethods() {
602
+ this.onPenDown = this.savedOnPenDown;
603
+ this.onPenMove = this.savedOnPenMove;
604
+ this.onPenUp = this.savedOnPenUp;
605
+ this.onPenTap = this.savedOnPenTap;
606
+ this.onMerePenTap = this.savedOnMerePenTap;
607
+ this.onDoublePenTap = this.savedOnDoublePenTap;
608
+ this.onLongPenDown = this.savedOnLongPenDown;
609
+ this.savedOnPenDown = (e) => { };
610
+ this.savedOnPenMove = (e) => { };
611
+ this.savedOnPenUp = (e) => { };
612
+ this.savedOnPenTap = (e) => { };
613
+ this.savedOnMerePenTap = (e) => { };
614
+ this.savedOnDoublePenTap = (e) => { };
615
+ this.savedOnLongPenDown = (e) => { };
616
+ }
617
+ restoreMouseMethods() {
618
+ this.onMouseDown = this.savedOnMouseDown;
619
+ this.onMouseMove = this.savedOnMouseMove;
620
+ this.onMouseUp = this.savedOnMouseUp;
621
+ this.onMouseClick = this.savedOnMouseClick;
622
+ this.onMereMouseClick = this.savedOnMereMouseClick;
623
+ this.onDoubleMouseClick = this.savedOnDoubleMouseClick;
624
+ this.onLongMouseDown = this.savedOnLongMouseDown;
625
+ this.savedOnMouseDown = (e) => { };
626
+ this.savedOnMouseMove = (e) => { };
627
+ this.savedOnMouseUp = (e) => { };
628
+ this.savedOnMouseClick = (e) => { };
629
+ this.savedOnMereMouseClick = (e) => { };
630
+ this.savedOnDoubleMouseClick = (e) => { };
631
+ this.savedOnLongMouseDown = (e) => { };
632
+ }
633
+ restorePointerMethods() {
634
+ this.onPointerDown = this.savedOnPointerDown;
635
+ this.onPointerMove = this.savedOnPointerMove;
636
+ this.onPointerUp = this.savedOnPointerUp;
637
+ this.onTap = this.savedOnTap;
638
+ this.onMereTap = this.savedOnMereTap;
639
+ this.onDoubleTap = this.savedOnDoubleTap;
640
+ this.onLongPress = this.savedOnLongPress;
641
+ this.savedOnPointerDown = (e) => { };
642
+ this.savedOnPointerMove = (e) => { };
643
+ this.savedOnPointerUp = (e) => { };
644
+ this.savedOnTap = (e) => { };
645
+ this.savedOnMereTap = (e) => { };
646
+ this.savedOnDoubleTap = (e) => { };
647
+ this.savedOnLongPress = (e) => { };
648
+ }
649
+ }
650
+ //# sourceMappingURL=Sensor.js.map