@tldraw/editor 4.3.0-next.f4772c19540d → 4.4.0-canary.1e3b436e33e4

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 (206) hide show
  1. package/README.md +1 -1
  2. package/dist-cjs/index.d.ts +503 -155
  3. package/dist-cjs/index.js +8 -1
  4. package/dist-cjs/index.js.map +2 -2
  5. package/dist-cjs/lib/components/ErrorBoundary.js.map +1 -1
  6. package/dist-cjs/lib/components/GeometryDebuggingView.js +1 -17
  7. package/dist-cjs/lib/components/GeometryDebuggingView.js.map +2 -2
  8. package/dist-cjs/lib/components/default-components/DefaultCanvas.js +4 -5
  9. package/dist-cjs/lib/components/default-components/DefaultCanvas.js.map +2 -2
  10. package/dist-cjs/lib/constants.js +1 -3
  11. package/dist-cjs/lib/constants.js.map +2 -2
  12. package/dist-cjs/lib/editor/Editor.js +346 -291
  13. package/dist-cjs/lib/editor/Editor.js.map +2 -2
  14. package/dist-cjs/lib/editor/bindings/BindingUtil.js.map +2 -2
  15. package/dist-cjs/lib/editor/derivations/bindingsIndex.js.map +2 -2
  16. package/dist-cjs/lib/editor/derivations/notVisibleShapes.js +16 -23
  17. package/dist-cjs/lib/editor/derivations/notVisibleShapes.js.map +3 -3
  18. package/dist-cjs/lib/editor/derivations/parentsToChildren.js +12 -3
  19. package/dist-cjs/lib/editor/derivations/parentsToChildren.js.map +2 -2
  20. package/dist-cjs/lib/editor/managers/ClickManager/ClickManager.js +1 -1
  21. package/dist-cjs/lib/editor/managers/ClickManager/ClickManager.js.map +2 -2
  22. package/dist-cjs/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.js +5 -6
  23. package/dist-cjs/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.js.map +2 -2
  24. package/dist-cjs/lib/editor/managers/InputsManager/InputsManager.js +591 -0
  25. package/dist-cjs/lib/editor/managers/InputsManager/InputsManager.js.map +7 -0
  26. package/dist-cjs/lib/editor/managers/SnapManager/SnapManager.js +1 -1
  27. package/dist-cjs/lib/editor/managers/SnapManager/SnapManager.js.map +2 -2
  28. package/dist-cjs/lib/editor/managers/SpatialIndexManager/RBushIndex.js +144 -0
  29. package/dist-cjs/lib/editor/managers/SpatialIndexManager/RBushIndex.js.map +7 -0
  30. package/dist-cjs/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.js +181 -0
  31. package/dist-cjs/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.js.map +7 -0
  32. package/dist-cjs/lib/editor/managers/TickManager/TickManager.js +1 -22
  33. package/dist-cjs/lib/editor/managers/TickManager/TickManager.js.map +2 -2
  34. package/dist-cjs/lib/editor/shapes/BaseBoxShapeUtil.js.map +1 -1
  35. package/dist-cjs/lib/editor/shapes/ShapeUtil.js +31 -23
  36. package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +2 -2
  37. package/dist-cjs/lib/editor/shapes/group/DashedOutlineBox.js +1 -1
  38. package/dist-cjs/lib/editor/shapes/group/DashedOutlineBox.js.map +2 -2
  39. package/dist-cjs/lib/editor/shapes/group/GroupShapeUtil.js.map +2 -2
  40. package/dist-cjs/lib/editor/tools/BaseBoxShapeTool/BaseBoxShapeTool.js.map +2 -2
  41. package/dist-cjs/lib/editor/tools/BaseBoxShapeTool/children/Pointing.js +3 -3
  42. package/dist-cjs/lib/editor/tools/BaseBoxShapeTool/children/Pointing.js.map +2 -2
  43. package/dist-cjs/lib/editor/types/emit-types.js.map +1 -1
  44. package/dist-cjs/lib/exports/getSvgJsx.js.map +2 -2
  45. package/dist-cjs/lib/exports/parseCss.js +1 -1
  46. package/dist-cjs/lib/exports/parseCss.js.map +2 -2
  47. package/dist-cjs/lib/globals/environment.js +45 -9
  48. package/dist-cjs/lib/globals/environment.js.map +2 -2
  49. package/dist-cjs/lib/globals/menus.js +1 -1
  50. package/dist-cjs/lib/globals/menus.js.map +2 -2
  51. package/dist-cjs/lib/hooks/useCoarsePointer.js +14 -29
  52. package/dist-cjs/lib/hooks/useCoarsePointer.js.map +2 -2
  53. package/dist-cjs/lib/hooks/useEvent.js +1 -1
  54. package/dist-cjs/lib/hooks/useEvent.js.map +2 -2
  55. package/dist-cjs/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.js.map +2 -2
  56. package/dist-cjs/lib/hooks/useGestureEvents.js +1 -1
  57. package/dist-cjs/lib/hooks/useGestureEvents.js.map +2 -2
  58. package/dist-cjs/lib/hooks/usePassThroughMouseOverEvents.js.map +2 -2
  59. package/dist-cjs/lib/hooks/usePassThroughWheelEvents.js.map +2 -2
  60. package/dist-cjs/lib/hooks/useScreenBounds.js.map +2 -2
  61. package/dist-cjs/lib/hooks/useStateAttribute.js +4 -1
  62. package/dist-cjs/lib/hooks/useStateAttribute.js.map +2 -2
  63. package/dist-cjs/lib/hooks/useTransform.js.map +1 -1
  64. package/dist-cjs/lib/hooks/useZoomCss.js +4 -8
  65. package/dist-cjs/lib/hooks/useZoomCss.js.map +2 -2
  66. package/dist-cjs/lib/options.js +6 -1
  67. package/dist-cjs/lib/options.js.map +2 -2
  68. package/dist-cjs/lib/primitives/Box.js +3 -0
  69. package/dist-cjs/lib/primitives/Box.js.map +2 -2
  70. package/dist-cjs/lib/primitives/geometry/Geometry2d.js +1 -0
  71. package/dist-cjs/lib/primitives/geometry/Geometry2d.js.map +2 -2
  72. package/dist-cjs/lib/utils/reparenting.js.map +2 -2
  73. package/dist-cjs/lib/utils/rotation.js +1 -1
  74. package/dist-cjs/lib/utils/rotation.js.map +2 -2
  75. package/dist-cjs/version.js +3 -3
  76. package/dist-cjs/version.js.map +1 -1
  77. package/dist-esm/index.d.mts +503 -155
  78. package/dist-esm/index.mjs +9 -2
  79. package/dist-esm/index.mjs.map +2 -2
  80. package/dist-esm/lib/components/ErrorBoundary.mjs.map +1 -1
  81. package/dist-esm/lib/components/GeometryDebuggingView.mjs +1 -17
  82. package/dist-esm/lib/components/GeometryDebuggingView.mjs.map +2 -2
  83. package/dist-esm/lib/components/default-components/DefaultCanvas.mjs +4 -5
  84. package/dist-esm/lib/components/default-components/DefaultCanvas.mjs.map +2 -2
  85. package/dist-esm/lib/constants.mjs +1 -3
  86. package/dist-esm/lib/constants.mjs.map +2 -2
  87. package/dist-esm/lib/editor/Editor.mjs +347 -294
  88. package/dist-esm/lib/editor/Editor.mjs.map +2 -2
  89. package/dist-esm/lib/editor/bindings/BindingUtil.mjs.map +2 -2
  90. package/dist-esm/lib/editor/derivations/bindingsIndex.mjs.map +2 -2
  91. package/dist-esm/lib/editor/derivations/notVisibleShapes.mjs +16 -23
  92. package/dist-esm/lib/editor/derivations/notVisibleShapes.mjs.map +3 -3
  93. package/dist-esm/lib/editor/derivations/parentsToChildren.mjs +13 -4
  94. package/dist-esm/lib/editor/derivations/parentsToChildren.mjs.map +2 -2
  95. package/dist-esm/lib/editor/managers/ClickManager/ClickManager.mjs +1 -1
  96. package/dist-esm/lib/editor/managers/ClickManager/ClickManager.mjs.map +2 -2
  97. package/dist-esm/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.mjs +5 -6
  98. package/dist-esm/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.mjs.map +2 -2
  99. package/dist-esm/lib/editor/managers/InputsManager/InputsManager.mjs +573 -0
  100. package/dist-esm/lib/editor/managers/InputsManager/InputsManager.mjs.map +7 -0
  101. package/dist-esm/lib/editor/managers/SnapManager/SnapManager.mjs +1 -1
  102. package/dist-esm/lib/editor/managers/SnapManager/SnapManager.mjs.map +2 -2
  103. package/dist-esm/lib/editor/managers/SpatialIndexManager/RBushIndex.mjs +114 -0
  104. package/dist-esm/lib/editor/managers/SpatialIndexManager/RBushIndex.mjs.map +7 -0
  105. package/dist-esm/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.mjs +161 -0
  106. package/dist-esm/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.mjs.map +7 -0
  107. package/dist-esm/lib/editor/managers/TickManager/TickManager.mjs +1 -22
  108. package/dist-esm/lib/editor/managers/TickManager/TickManager.mjs.map +2 -2
  109. package/dist-esm/lib/editor/shapes/BaseBoxShapeUtil.mjs.map +1 -1
  110. package/dist-esm/lib/editor/shapes/ShapeUtil.mjs +31 -23
  111. package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +2 -2
  112. package/dist-esm/lib/editor/shapes/group/DashedOutlineBox.mjs +1 -1
  113. package/dist-esm/lib/editor/shapes/group/DashedOutlineBox.mjs.map +2 -2
  114. package/dist-esm/lib/editor/shapes/group/GroupShapeUtil.mjs.map +2 -2
  115. package/dist-esm/lib/editor/tools/BaseBoxShapeTool/BaseBoxShapeTool.mjs.map +2 -2
  116. package/dist-esm/lib/editor/tools/BaseBoxShapeTool/children/Pointing.mjs +3 -3
  117. package/dist-esm/lib/editor/tools/BaseBoxShapeTool/children/Pointing.mjs.map +2 -2
  118. package/dist-esm/lib/exports/getSvgJsx.mjs.map +2 -2
  119. package/dist-esm/lib/exports/parseCss.mjs +1 -1
  120. package/dist-esm/lib/exports/parseCss.mjs.map +2 -2
  121. package/dist-esm/lib/globals/environment.mjs +45 -9
  122. package/dist-esm/lib/globals/environment.mjs.map +2 -2
  123. package/dist-esm/lib/globals/menus.mjs +1 -1
  124. package/dist-esm/lib/globals/menus.mjs.map +2 -2
  125. package/dist-esm/lib/hooks/useCoarsePointer.mjs +15 -30
  126. package/dist-esm/lib/hooks/useCoarsePointer.mjs.map +2 -2
  127. package/dist-esm/lib/hooks/useEvent.mjs +1 -1
  128. package/dist-esm/lib/hooks/useEvent.mjs.map +2 -2
  129. package/dist-esm/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.mjs.map +2 -2
  130. package/dist-esm/lib/hooks/useGestureEvents.mjs +1 -1
  131. package/dist-esm/lib/hooks/useGestureEvents.mjs.map +2 -2
  132. package/dist-esm/lib/hooks/usePassThroughMouseOverEvents.mjs.map +2 -2
  133. package/dist-esm/lib/hooks/usePassThroughWheelEvents.mjs.map +2 -2
  134. package/dist-esm/lib/hooks/useScreenBounds.mjs.map +2 -2
  135. package/dist-esm/lib/hooks/useStateAttribute.mjs +4 -1
  136. package/dist-esm/lib/hooks/useStateAttribute.mjs.map +2 -2
  137. package/dist-esm/lib/hooks/useTransform.mjs.map +1 -1
  138. package/dist-esm/lib/hooks/useZoomCss.mjs +4 -8
  139. package/dist-esm/lib/hooks/useZoomCss.mjs.map +2 -2
  140. package/dist-esm/lib/options.mjs +6 -1
  141. package/dist-esm/lib/options.mjs.map +2 -2
  142. package/dist-esm/lib/primitives/Box.mjs +3 -0
  143. package/dist-esm/lib/primitives/Box.mjs.map +2 -2
  144. package/dist-esm/lib/primitives/geometry/Geometry2d.mjs +1 -0
  145. package/dist-esm/lib/primitives/geometry/Geometry2d.mjs.map +2 -2
  146. package/dist-esm/lib/utils/reparenting.mjs.map +2 -2
  147. package/dist-esm/lib/utils/rotation.mjs +1 -1
  148. package/dist-esm/lib/utils/rotation.mjs.map +2 -2
  149. package/dist-esm/version.mjs +3 -3
  150. package/dist-esm/version.mjs.map +1 -1
  151. package/editor.css +14 -12
  152. package/package.json +21 -17
  153. package/src/index.ts +5 -1
  154. package/src/lib/components/ErrorBoundary.tsx +1 -1
  155. package/src/lib/components/GeometryDebuggingView.tsx +1 -19
  156. package/src/lib/components/default-components/DefaultCanvas.tsx +5 -8
  157. package/src/lib/config/TLUserPreferences.test.ts +40 -0
  158. package/src/lib/constants.ts +0 -2
  159. package/src/lib/editor/Editor.test.ts +150 -10
  160. package/src/lib/editor/Editor.ts +533 -384
  161. package/src/lib/editor/bindings/BindingUtil.ts +15 -9
  162. package/src/lib/editor/derivations/bindingsIndex.ts +2 -2
  163. package/src/lib/editor/derivations/notVisibleShapes.ts +21 -33
  164. package/src/lib/editor/derivations/parentsToChildren.ts +18 -7
  165. package/src/lib/editor/managers/ClickManager/ClickManager.test.ts +17 -31
  166. package/src/lib/editor/managers/ClickManager/ClickManager.ts +1 -1
  167. package/src/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.test.ts +129 -79
  168. package/src/lib/editor/managers/EdgeScrollManager/EdgeScrollManager.ts +10 -6
  169. package/src/lib/editor/managers/FontManager/FontManager.test.ts +14 -4
  170. package/src/lib/editor/managers/InputsManager/InputsManager.ts +566 -0
  171. package/src/lib/editor/managers/ScribbleManager/ScribbleManager.test.ts +0 -4
  172. package/src/lib/editor/managers/SnapManager/SnapManager.test.ts +12 -0
  173. package/src/lib/editor/managers/SnapManager/SnapManager.ts +4 -4
  174. package/src/lib/editor/managers/SpatialIndexManager/RBushIndex.ts +144 -0
  175. package/src/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.ts +215 -0
  176. package/src/lib/editor/managers/TickManager/TickManager.test.ts +40 -107
  177. package/src/lib/editor/managers/TickManager/TickManager.ts +2 -32
  178. package/src/lib/editor/shapes/BaseBoxShapeUtil.tsx +2 -2
  179. package/src/lib/editor/shapes/ShapeUtil.ts +72 -32
  180. package/src/lib/editor/shapes/group/DashedOutlineBox.tsx +1 -1
  181. package/src/lib/editor/shapes/group/GroupShapeUtil.tsx +1 -3
  182. package/src/lib/editor/tools/BaseBoxShapeTool/BaseBoxShapeTool.ts +2 -1
  183. package/src/lib/editor/tools/BaseBoxShapeTool/children/Pointing.ts +6 -6
  184. package/src/lib/editor/types/emit-types.ts +3 -1
  185. package/src/lib/exports/getSvgJsx.test.ts +10 -19
  186. package/src/lib/exports/getSvgJsx.tsx +2 -5
  187. package/src/lib/exports/parseCss.test.ts +1 -0
  188. package/src/lib/exports/parseCss.ts +1 -1
  189. package/src/lib/globals/environment.ts +65 -10
  190. package/src/lib/globals/menus.ts +1 -1
  191. package/src/lib/hooks/useCoarsePointer.ts +16 -59
  192. package/src/lib/hooks/useEvent.tsx +1 -1
  193. package/src/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.ts +1 -1
  194. package/src/lib/hooks/useGestureEvents.ts +2 -2
  195. package/src/lib/hooks/usePassThroughMouseOverEvents.ts +1 -1
  196. package/src/lib/hooks/usePassThroughWheelEvents.ts +1 -1
  197. package/src/lib/hooks/useScreenBounds.ts +1 -1
  198. package/src/lib/hooks/useStateAttribute.ts +4 -1
  199. package/src/lib/hooks/useTransform.ts +1 -1
  200. package/src/lib/hooks/useZoomCss.ts +3 -8
  201. package/src/lib/options.ts +32 -0
  202. package/src/lib/primitives/Box.ts +9 -0
  203. package/src/lib/primitives/geometry/Geometry2d.ts +1 -0
  204. package/src/lib/utils/reparenting.ts +5 -5
  205. package/src/lib/utils/rotation.ts +1 -1
  206. package/src/version.ts +3 -3
@@ -0,0 +1,573 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
5
+ var __typeError = (msg) => {
6
+ throw TypeError(msg);
7
+ };
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
10
+ var __decoratorStart = (base) => [, , , __create(base?.[__knownSymbol("metadata")] ?? null)];
11
+ var __decoratorStrings = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
12
+ var __expectFn = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError("Function expected") : fn;
13
+ var __decoratorContext = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError("Already initialized") : fns.push(__expectFn(fn || null)) });
14
+ var __decoratorMetadata = (array, target) => __defNormalProp(target, __knownSymbol("metadata"), array[3]);
15
+ var __runInitializers = (array, flags, self, value) => {
16
+ for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
17
+ return value;
18
+ };
19
+ var __decorateElement = (array, flags, name, decorators, target, extra) => {
20
+ var fn, it, done, ctx, access, k = flags & 7, s = !!(flags & 8), p = !!(flags & 16);
21
+ var j = k > 3 ? array.length + 1 : k ? s ? 1 : 2 : 0, key = __decoratorStrings[k + 5];
22
+ var initializers = k > 3 && (array[j - 1] = []), extraInitializers = array[j] || (array[j] = []);
23
+ var desc = k && (!p && !s && (target = target.prototype), k < 5 && (k > 3 || !p) && __getOwnPropDesc(k < 4 ? target : { get [name]() {
24
+ return __privateGet(this, extra);
25
+ }, set [name](x) {
26
+ return __privateSet(this, extra, x);
27
+ } }, name));
28
+ k ? p && k < 4 && __name(extra, (k > 2 ? "set " : k > 1 ? "get " : "") + name) : __name(target, name);
29
+ for (var i = decorators.length - 1; i >= 0; i--) {
30
+ ctx = __decoratorContext(k, name, done = {}, array[3], extraInitializers);
31
+ if (k) {
32
+ ctx.static = s, ctx.private = p, access = ctx.access = { has: p ? (x) => __privateIn(target, x) : (x) => name in x };
33
+ if (k ^ 3) access.get = p ? (x) => (k ^ 1 ? __privateGet : __privateMethod)(x, target, k ^ 4 ? extra : desc.get) : (x) => x[name];
34
+ if (k > 2) access.set = p ? (x, y) => __privateSet(x, target, y, k ^ 4 ? extra : desc.set) : (x, y) => x[name] = y;
35
+ }
36
+ it = (0, decorators[i])(k ? k < 4 ? p ? extra : desc[key] : k > 4 ? void 0 : { get: desc.get, set: desc.set } : target, ctx), done._ = 1;
37
+ if (k ^ 4 || it === void 0) __expectFn(it) && (k > 4 ? initializers.unshift(it) : k ? p ? extra = it : desc[key] = it : target = it);
38
+ else if (typeof it !== "object" || it === null) __typeError("Object expected");
39
+ else __expectFn(fn = it.get) && (desc.get = fn), __expectFn(fn = it.set) && (desc.set = fn), __expectFn(fn = it.init) && initializers.unshift(fn);
40
+ }
41
+ return k || __decoratorMetadata(array, target), desc && __defProp(target, name, desc), p ? k ^ 4 ? extra : desc : target;
42
+ };
43
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
44
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
45
+ var __privateIn = (member, obj) => Object(obj) !== obj ? __typeError('Cannot use the "in" operator on this value') : member.has(obj);
46
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
47
+ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
48
+ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
49
+ var __getHasCollaborators_dec, _init;
50
+ import { atom, computed, unsafe__withoutCapture } from "@tldraw/state";
51
+ import { AtomSet } from "@tldraw/store";
52
+ import { TLINSTANCE_ID, TLPOINTER_ID } from "@tldraw/tlschema";
53
+ import { INTERNAL_POINTER_IDS } from "../../../constants.mjs";
54
+ import { Vec } from "../../../primitives/Vec.mjs";
55
+ import { isAccelKey } from "../../../utils/keyboard.mjs";
56
+ __getHasCollaborators_dec = [computed];
57
+ class InputsManager {
58
+ constructor(editor) {
59
+ this.editor = editor;
60
+ __runInitializers(_init, 5, this);
61
+ __publicField(this, "_originPagePoint", atom("originPagePoint", new Vec()));
62
+ __publicField(this, "_originScreenPoint", atom("originScreenPoint", new Vec()));
63
+ __publicField(this, "_previousPagePoint", atom("previousPagePoint", new Vec()));
64
+ __publicField(this, "_previousScreenPoint", atom("previousScreenPoint", new Vec()));
65
+ __publicField(this, "_currentPagePoint", atom("currentPagePoint", new Vec()));
66
+ __publicField(this, "_currentScreenPoint", atom("currentScreenPoint", new Vec()));
67
+ __publicField(this, "_pointerVelocity", atom("pointerVelocity", new Vec()));
68
+ /**
69
+ * A set containing the currently pressed keys.
70
+ */
71
+ __publicField(this, "keys", new AtomSet("keys"));
72
+ /**
73
+ * A set containing the currently pressed buttons.
74
+ */
75
+ __publicField(this, "buttons", new AtomSet("buttons"));
76
+ __publicField(this, "_isPen", atom("isPen", false));
77
+ __publicField(this, "_shiftKey", atom("shiftKey", false));
78
+ __publicField(this, "_metaKey", atom("metaKey", false));
79
+ __publicField(this, "_ctrlKey", atom("ctrlKey", false));
80
+ __publicField(this, "_altKey", atom("altKey", false));
81
+ __publicField(this, "_isDragging", atom("isDragging", false));
82
+ __publicField(this, "_isPointing", atom("isPointing", false));
83
+ __publicField(this, "_isPinching", atom("isPinching", false));
84
+ __publicField(this, "_isEditing", atom("isEditing", false));
85
+ __publicField(this, "_isPanning", atom("isPanning", false));
86
+ __publicField(this, "_isSpacebarPanning", atom("isSpacebarPanning", false));
87
+ /**
88
+ * The previous point used for velocity calculation (updated each tick, not each pointer event).
89
+ * @internal
90
+ */
91
+ __publicField(this, "_velocityPrevPoint", new Vec());
92
+ }
93
+ /**
94
+ * The most recent pointer down's position in the current page space.
95
+ */
96
+ getOriginPagePoint() {
97
+ return this._originPagePoint.get();
98
+ }
99
+ /**
100
+ * @deprecated Use `getOriginPagePoint()` instead.
101
+ */
102
+ // eslint-disable-next-line no-restricted-syntax
103
+ get originPagePoint() {
104
+ return this.getOriginPagePoint();
105
+ }
106
+ /**
107
+ * The most recent pointer down's position in screen space.
108
+ */
109
+ getOriginScreenPoint() {
110
+ return this._originScreenPoint.get();
111
+ }
112
+ /**
113
+ * @deprecated Use `getOriginScreenPoint()` instead.
114
+ */
115
+ // eslint-disable-next-line no-restricted-syntax
116
+ get originScreenPoint() {
117
+ return this.getOriginScreenPoint();
118
+ }
119
+ /**
120
+ * The previous pointer position in the current page space.
121
+ */
122
+ getPreviousPagePoint() {
123
+ return this._previousPagePoint.get();
124
+ }
125
+ /**
126
+ * @deprecated Use `getPreviousPagePoint()` instead.
127
+ */
128
+ // eslint-disable-next-line no-restricted-syntax
129
+ get previousPagePoint() {
130
+ return this.getPreviousPagePoint();
131
+ }
132
+ /**
133
+ * The previous pointer position in screen space.
134
+ */
135
+ getPreviousScreenPoint() {
136
+ return this._previousScreenPoint.get();
137
+ }
138
+ /**
139
+ * @deprecated Use `getPreviousScreenPoint()` instead.
140
+ */
141
+ // eslint-disable-next-line no-restricted-syntax
142
+ get previousScreenPoint() {
143
+ return this.getPreviousScreenPoint();
144
+ }
145
+ /**
146
+ * The most recent pointer position in the current page space.
147
+ */
148
+ getCurrentPagePoint() {
149
+ return this._currentPagePoint.get();
150
+ }
151
+ /**
152
+ * @deprecated Use `getCurrentPagePoint()` instead.
153
+ */
154
+ // eslint-disable-next-line no-restricted-syntax
155
+ get currentPagePoint() {
156
+ return this.getCurrentPagePoint();
157
+ }
158
+ /**
159
+ * The most recent pointer position in screen space.
160
+ */
161
+ getCurrentScreenPoint() {
162
+ return this._currentScreenPoint.get();
163
+ }
164
+ /**
165
+ * @deprecated Use `getCurrentScreenPoint()` instead.
166
+ */
167
+ // eslint-disable-next-line no-restricted-syntax
168
+ get currentScreenPoint() {
169
+ return this.getCurrentScreenPoint();
170
+ }
171
+ /**
172
+ * Velocity of mouse pointer, in pixels per millisecond.
173
+ */
174
+ getPointerVelocity() {
175
+ return this._pointerVelocity.get();
176
+ }
177
+ /**
178
+ * @deprecated Use `getPointerVelocity()` instead.
179
+ */
180
+ // eslint-disable-next-line no-restricted-syntax
181
+ get pointerVelocity() {
182
+ return this.getPointerVelocity();
183
+ }
184
+ /**
185
+ * Normally you shouldn't need to set the pointer velocity directly, this is set by the tick manager.
186
+ * However, this is currently used in tests to fake pointer velocity.
187
+ * @param pointerVelocity - The pointer velocity.
188
+ * @internal
189
+ */
190
+ setPointerVelocity(pointerVelocity) {
191
+ this._pointerVelocity.set(pointerVelocity);
192
+ }
193
+ /**
194
+ * Whether the input is from a pen.
195
+ */
196
+ getIsPen() {
197
+ return this._isPen.get();
198
+ }
199
+ /**
200
+ * @deprecated Use `getIsPen()` instead.
201
+ */
202
+ // eslint-disable-next-line no-restricted-syntax
203
+ get isPen() {
204
+ return this.getIsPen();
205
+ }
206
+ // eslint-disable-next-line no-restricted-syntax
207
+ set isPen(isPen) {
208
+ this.setIsPen(isPen);
209
+ }
210
+ /**
211
+ * @param isPen - Whether the input is from a pen.
212
+ */
213
+ setIsPen(isPen) {
214
+ this._isPen.set(isPen);
215
+ }
216
+ /**
217
+ * Whether the shift key is currently pressed.
218
+ */
219
+ getShiftKey() {
220
+ return this._shiftKey.get();
221
+ }
222
+ /**
223
+ * @deprecated Use `getShiftKey()` instead.
224
+ */
225
+ // eslint-disable-next-line no-restricted-syntax
226
+ get shiftKey() {
227
+ return this.getShiftKey();
228
+ }
229
+ // eslint-disable-next-line no-restricted-syntax
230
+ set shiftKey(shiftKey) {
231
+ this.setShiftKey(shiftKey);
232
+ }
233
+ /**
234
+ * @param shiftKey - Whether the shift key is pressed.
235
+ * @internal
236
+ */
237
+ setShiftKey(shiftKey) {
238
+ this._shiftKey.set(shiftKey);
239
+ }
240
+ /**
241
+ * Whether the meta key is currently pressed.
242
+ */
243
+ getMetaKey() {
244
+ return this._metaKey.get();
245
+ }
246
+ /**
247
+ * @deprecated Use `getMetaKey()` instead.
248
+ */
249
+ // eslint-disable-next-line no-restricted-syntax
250
+ get metaKey() {
251
+ return this.getMetaKey();
252
+ }
253
+ // eslint-disable-next-line no-restricted-syntax
254
+ set metaKey(metaKey) {
255
+ this.setMetaKey(metaKey);
256
+ }
257
+ /**
258
+ * @param metaKey - Whether the meta key is pressed.
259
+ * @internal
260
+ */
261
+ setMetaKey(metaKey) {
262
+ this._metaKey.set(metaKey);
263
+ }
264
+ /**
265
+ * Whether the ctrl or command key is currently pressed.
266
+ */
267
+ getCtrlKey() {
268
+ return this._ctrlKey.get();
269
+ }
270
+ /**
271
+ * @deprecated Use `getCtrlKey()` instead.
272
+ */
273
+ // eslint-disable-next-line no-restricted-syntax
274
+ get ctrlKey() {
275
+ return this.getCtrlKey();
276
+ }
277
+ // eslint-disable-next-line no-restricted-syntax
278
+ set ctrlKey(ctrlKey) {
279
+ this.setCtrlKey(ctrlKey);
280
+ }
281
+ /**
282
+ * @param ctrlKey - Whether the ctrl key is pressed.
283
+ * @internal
284
+ */
285
+ setCtrlKey(ctrlKey) {
286
+ this._ctrlKey.set(ctrlKey);
287
+ }
288
+ /**
289
+ * Whether the alt or option key is currently pressed.
290
+ */
291
+ getAltKey() {
292
+ return this._altKey.get();
293
+ }
294
+ /**
295
+ * @deprecated Use `getAltKey()` instead.
296
+ */
297
+ // eslint-disable-next-line no-restricted-syntax
298
+ get altKey() {
299
+ return this.getAltKey();
300
+ }
301
+ // eslint-disable-next-line no-restricted-syntax
302
+ set altKey(altKey) {
303
+ this.setAltKey(altKey);
304
+ }
305
+ /**
306
+ * @param altKey - Whether the alt key is pressed.
307
+ * @internal
308
+ */
309
+ setAltKey(altKey) {
310
+ this._altKey.set(altKey);
311
+ }
312
+ /**
313
+ * Is the accelerator key (cmd on mac, ctrl elsewhere) currently pressed.
314
+ */
315
+ getAccelKey() {
316
+ return isAccelKey({ metaKey: this.getMetaKey(), ctrlKey: this.getCtrlKey() });
317
+ }
318
+ /**
319
+ * @deprecated Use `getAccelKey()` instead.
320
+ */
321
+ // eslint-disable-next-line no-restricted-syntax
322
+ get accelKey() {
323
+ return this.getAccelKey();
324
+ }
325
+ /**
326
+ * Whether the user is dragging.
327
+ */
328
+ getIsDragging() {
329
+ return this._isDragging.get();
330
+ }
331
+ /**
332
+ * Soon to be deprecated, use `getIsDragging()` instead.
333
+ */
334
+ // eslint-disable-next-line no-restricted-syntax
335
+ get isDragging() {
336
+ return this.getIsDragging();
337
+ }
338
+ // eslint-disable-next-line no-restricted-syntax
339
+ set isDragging(isDragging) {
340
+ this.setIsDragging(isDragging);
341
+ }
342
+ /**
343
+ * @param isDragging - Whether the user is dragging.
344
+ */
345
+ setIsDragging(isDragging) {
346
+ this._isDragging.set(isDragging);
347
+ }
348
+ /**
349
+ * Whether the user is pointing.
350
+ */
351
+ getIsPointing() {
352
+ return this._isPointing.get();
353
+ }
354
+ /**
355
+ * @deprecated Use `getIsPointing()` instead.
356
+ */
357
+ // eslint-disable-next-line no-restricted-syntax
358
+ get isPointing() {
359
+ return this.getIsPointing();
360
+ }
361
+ // eslint-disable-next-line no-restricted-syntax
362
+ set isPointing(isPointing) {
363
+ this.setIsPointing(isPointing);
364
+ }
365
+ /**
366
+ * @param isPointing - Whether the user is pointing.
367
+ * @internal
368
+ */
369
+ setIsPointing(isPointing) {
370
+ this._isPointing.set(isPointing);
371
+ }
372
+ /**
373
+ * Whether the user is pinching.
374
+ */
375
+ getIsPinching() {
376
+ return this._isPinching.get();
377
+ }
378
+ /**
379
+ * @deprecated Use `getIsPinching()` instead.
380
+ */
381
+ // eslint-disable-next-line no-restricted-syntax
382
+ get isPinching() {
383
+ return this.getIsPinching();
384
+ }
385
+ // eslint-disable-next-line no-restricted-syntax
386
+ set isPinching(isPinching) {
387
+ this.setIsPinching(isPinching);
388
+ }
389
+ /**
390
+ * @param isPinching - Whether the user is pinching.
391
+ * @internal
392
+ */
393
+ setIsPinching(isPinching) {
394
+ this._isPinching.set(isPinching);
395
+ }
396
+ /**
397
+ * Whether the user is editing.
398
+ */
399
+ getIsEditing() {
400
+ return this._isEditing.get();
401
+ }
402
+ /**
403
+ * @deprecated Use `getIsEditing()` instead.
404
+ */
405
+ // eslint-disable-next-line no-restricted-syntax
406
+ get isEditing() {
407
+ return this.getIsEditing();
408
+ }
409
+ // eslint-disable-next-line no-restricted-syntax
410
+ set isEditing(isEditing) {
411
+ this.setIsEditing(isEditing);
412
+ }
413
+ /**
414
+ * @param isEditing - Whether the user is editing.
415
+ */
416
+ setIsEditing(isEditing) {
417
+ this._isEditing.set(isEditing);
418
+ }
419
+ /**
420
+ * Whether the user is panning.
421
+ */
422
+ getIsPanning() {
423
+ return this._isPanning.get();
424
+ }
425
+ /**
426
+ * @deprecated Use `getIsPanning()` instead.
427
+ */
428
+ // eslint-disable-next-line no-restricted-syntax
429
+ get isPanning() {
430
+ return this.getIsPanning();
431
+ }
432
+ // eslint-disable-next-line no-restricted-syntax
433
+ set isPanning(isPanning) {
434
+ this.setIsPanning(isPanning);
435
+ }
436
+ /**
437
+ * @param isPanning - Whether the user is panning.
438
+ * @internal
439
+ */
440
+ setIsPanning(isPanning) {
441
+ this._isPanning.set(isPanning);
442
+ }
443
+ /**
444
+ * Whether the user is spacebar panning.
445
+ */
446
+ getIsSpacebarPanning() {
447
+ return this._isSpacebarPanning.get();
448
+ }
449
+ /**
450
+ * @deprecated Use `getIsSpacebarPanning()` instead.
451
+ */
452
+ // eslint-disable-next-line no-restricted-syntax
453
+ get isSpacebarPanning() {
454
+ return this.getIsSpacebarPanning();
455
+ }
456
+ // eslint-disable-next-line no-restricted-syntax
457
+ set isSpacebarPanning(isSpacebarPanning) {
458
+ this.setIsSpacebarPanning(isSpacebarPanning);
459
+ }
460
+ /**
461
+ * @param isSpacebarPanning - Whether the user is spacebar panning.
462
+ * @internal
463
+ */
464
+ setIsSpacebarPanning(isSpacebarPanning) {
465
+ this._isSpacebarPanning.set(isSpacebarPanning);
466
+ }
467
+ _getHasCollaborators() {
468
+ return this.editor.getCollaborators().length > 0;
469
+ }
470
+ /**
471
+ * Update the pointer velocity based on elapsed time. Called by the tick manager.
472
+ * @param elapsed - The time elapsed since the last tick in milliseconds.
473
+ * @internal
474
+ */
475
+ updatePointerVelocity(elapsed) {
476
+ const currentScreenPoint = this.getCurrentScreenPoint();
477
+ const pointerVelocity = this.getPointerVelocity();
478
+ if (elapsed === 0) return;
479
+ const delta = Vec.Sub(currentScreenPoint, this._velocityPrevPoint);
480
+ this._velocityPrevPoint = currentScreenPoint.clone();
481
+ const length = delta.len();
482
+ const direction = length ? delta.div(length) : new Vec(0, 0);
483
+ const next = pointerVelocity.clone().lrp(direction.mul(length / elapsed), 0.5);
484
+ if (Math.abs(next.x) < 0.01) next.x = 0;
485
+ if (Math.abs(next.y) < 0.01) next.y = 0;
486
+ if (!pointerVelocity.equals(next)) {
487
+ this._pointerVelocity.set(next);
488
+ }
489
+ }
490
+ /**
491
+ * Update the input points from a pointer, pinch, or wheel event.
492
+ *
493
+ * @param info - The event info.
494
+ * @internal
495
+ */
496
+ updateFromEvent(info) {
497
+ const currentScreenPoint = this._currentScreenPoint.__unsafe__getWithoutCapture();
498
+ const currentPagePoint = this._currentPagePoint.__unsafe__getWithoutCapture();
499
+ const isPinching = this._isPinching.__unsafe__getWithoutCapture();
500
+ const { screenBounds } = this.editor.store.unsafeGetWithoutCapture(TLINSTANCE_ID);
501
+ const { x: cx, y: cy, z: cz } = unsafe__withoutCapture(() => this.editor.getCamera());
502
+ const sx = info.point.x - screenBounds.x;
503
+ const sy = info.point.y - screenBounds.y;
504
+ const sz = info.point.z ?? 0.5;
505
+ this._previousScreenPoint.set(currentScreenPoint);
506
+ this._previousPagePoint.set(currentPagePoint);
507
+ this._currentScreenPoint.set(new Vec(sx, sy));
508
+ const nx = sx / cz - cx;
509
+ const ny = sy / cz - cy;
510
+ if (isFinite(nx) && isFinite(ny)) {
511
+ this._currentPagePoint.set(new Vec(nx, ny, sz));
512
+ }
513
+ this._isPen.set(info.type === "pointer" && info.isPen);
514
+ if (info.name === "pointer_down" || isPinching) {
515
+ this._pointerVelocity.set(new Vec());
516
+ this._originScreenPoint.set(this._currentScreenPoint.__unsafe__getWithoutCapture());
517
+ this._originPagePoint.set(this._currentPagePoint.__unsafe__getWithoutCapture());
518
+ }
519
+ if (this._getHasCollaborators()) {
520
+ this.editor.run(
521
+ () => {
522
+ const pagePoint = this._currentPagePoint.__unsafe__getWithoutCapture();
523
+ this.editor.store.put([
524
+ {
525
+ id: TLPOINTER_ID,
526
+ typeName: "pointer",
527
+ x: pagePoint.x,
528
+ y: pagePoint.y,
529
+ lastActivityTimestamp: (
530
+ // If our pointer moved only because we're following some other user, then don't
531
+ // update our last activity timestamp; otherwise, update it to the current timestamp.
532
+ (info.type === "pointer" && info.pointerId === INTERNAL_POINTER_IDS.CAMERA_MOVE ? this.editor.store.unsafeGetWithoutCapture(TLPOINTER_ID)?.lastActivityTimestamp ?? Date.now() : Date.now())
533
+ ),
534
+ meta: {}
535
+ }
536
+ ]);
537
+ },
538
+ { history: "ignore" }
539
+ );
540
+ }
541
+ }
542
+ toJson() {
543
+ return {
544
+ originPagePoint: this._originPagePoint.get().toJson(),
545
+ originScreenPoint: this._originScreenPoint.get().toJson(),
546
+ previousPagePoint: this._previousPagePoint.get().toJson(),
547
+ previousScreenPoint: this._previousScreenPoint.get().toJson(),
548
+ currentPagePoint: this._currentPagePoint.get().toJson(),
549
+ currentScreenPoint: this._currentScreenPoint.get().toJson(),
550
+ pointerVelocity: this._pointerVelocity.get().toJson(),
551
+ shiftKey: this._shiftKey.get(),
552
+ metaKey: this._metaKey.get(),
553
+ ctrlKey: this._ctrlKey.get(),
554
+ altKey: this._altKey.get(),
555
+ isPen: this._isPen.get(),
556
+ isDragging: this._isDragging.get(),
557
+ isPointing: this._isPointing.get(),
558
+ isPinching: this._isPinching.get(),
559
+ isEditing: this._isEditing.get(),
560
+ isPanning: this._isPanning.get(),
561
+ isSpacebarPanning: this._isSpacebarPanning.get(),
562
+ keys: Array.from(this.keys.keys()),
563
+ buttons: Array.from(this.buttons.keys())
564
+ };
565
+ }
566
+ }
567
+ _init = __decoratorStart(null);
568
+ __decorateElement(_init, 1, "_getHasCollaborators", __getHasCollaborators_dec, InputsManager);
569
+ __decoratorMetadata(_init, InputsManager);
570
+ export {
571
+ InputsManager
572
+ };
573
+ //# sourceMappingURL=InputsManager.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/lib/editor/managers/InputsManager/InputsManager.ts"],
4
+ "sourcesContent": ["import { atom, computed, unsafe__withoutCapture } from '@tldraw/state'\nimport { AtomSet } from '@tldraw/store'\nimport { TLINSTANCE_ID, TLPOINTER_ID } from '@tldraw/tlschema'\nimport { INTERNAL_POINTER_IDS } from '../../../constants'\nimport { Vec } from '../../../primitives/Vec'\nimport { isAccelKey } from '../../../utils/keyboard'\nimport { Editor } from '../../Editor'\nimport { TLPinchEventInfo, TLPointerEventInfo, TLWheelEventInfo } from '../../types/event-types'\n\n/** @public */\nexport class InputsManager {\n\tconstructor(private readonly editor: Editor) {}\n\n\tprivate _originPagePoint = atom<Vec>('originPagePoint', new Vec())\n\t/**\n\t * The most recent pointer down's position in the current page space.\n\t */\n\tgetOriginPagePoint() {\n\t\treturn this._originPagePoint.get()\n\t}\n\t/**\n\t * @deprecated Use `getOriginPagePoint()` instead.\n\t */\n\t// eslint-disable-next-line no-restricted-syntax\n\tget originPagePoint() {\n\t\treturn this.getOriginPagePoint()\n\t}\n\n\tprivate _originScreenPoint = atom<Vec>('originScreenPoint', new Vec())\n\t/**\n\t * The most recent pointer down's position in screen space.\n\t */\n\tgetOriginScreenPoint() {\n\t\treturn this._originScreenPoint.get()\n\t}\n\t/**\n\t * @deprecated Use `getOriginScreenPoint()` instead.\n\t */\n\t// eslint-disable-next-line no-restricted-syntax\n\tget originScreenPoint() {\n\t\treturn this.getOriginScreenPoint()\n\t}\n\n\tprivate _previousPagePoint = atom<Vec>('previousPagePoint', new Vec())\n\t/**\n\t * The previous pointer position in the current page space.\n\t */\n\tgetPreviousPagePoint() {\n\t\treturn this._previousPagePoint.get()\n\t}\n\t/**\n\t * @deprecated Use `getPreviousPagePoint()` instead.\n\t */\n\t// eslint-disable-next-line no-restricted-syntax\n\tget previousPagePoint() {\n\t\treturn this.getPreviousPagePoint()\n\t}\n\n\tprivate _previousScreenPoint = atom<Vec>('previousScreenPoint', new Vec())\n\t/**\n\t * The previous pointer position in screen space.\n\t */\n\tgetPreviousScreenPoint() {\n\t\treturn this._previousScreenPoint.get()\n\t}\n\t/**\n\t * @deprecated Use `getPreviousScreenPoint()` instead.\n\t */\n\t// eslint-disable-next-line no-restricted-syntax\n\tget previousScreenPoint() {\n\t\treturn this.getPreviousScreenPoint()\n\t}\n\n\tprivate _currentPagePoint = atom<Vec>('currentPagePoint', new Vec())\n\t/**\n\t * The most recent pointer position in the current page space.\n\t */\n\tgetCurrentPagePoint() {\n\t\treturn this._currentPagePoint.get()\n\t}\n\t/**\n\t * @deprecated Use `getCurrentPagePoint()` instead.\n\t */\n\t// eslint-disable-next-line no-restricted-syntax\n\tget currentPagePoint() {\n\t\treturn this.getCurrentPagePoint()\n\t}\n\n\tprivate _currentScreenPoint = atom<Vec>('currentScreenPoint', new Vec())\n\t/**\n\t * The most recent pointer position in screen space.\n\t */\n\tgetCurrentScreenPoint() {\n\t\treturn this._currentScreenPoint.get()\n\t}\n\t/**\n\t * @deprecated Use `getCurrentScreenPoint()` instead.\n\t */\n\t// eslint-disable-next-line no-restricted-syntax\n\tget currentScreenPoint() {\n\t\treturn this.getCurrentScreenPoint()\n\t}\n\n\tprivate _pointerVelocity = atom<Vec>('pointerVelocity', new Vec())\n\t/**\n\t * Velocity of mouse pointer, in pixels per millisecond.\n\t */\n\tgetPointerVelocity() {\n\t\treturn this._pointerVelocity.get()\n\t}\n\t/**\n\t * @deprecated Use `getPointerVelocity()` instead.\n\t */\n\t// eslint-disable-next-line no-restricted-syntax\n\tget pointerVelocity() {\n\t\treturn this.getPointerVelocity()\n\t}\n\n\t/**\n\t * Normally you shouldn't need to set the pointer velocity directly, this is set by the tick manager.\n\t * However, this is currently used in tests to fake pointer velocity.\n\t * @param pointerVelocity - The pointer velocity.\n\t * @internal\n\t */\n\tsetPointerVelocity(pointerVelocity: Vec) {\n\t\tthis._pointerVelocity.set(pointerVelocity)\n\t}\n\n\t/**\n\t * A set containing the currently pressed keys.\n\t */\n\treadonly keys = new AtomSet<string>('keys')\n\n\t/**\n\t * A set containing the currently pressed buttons.\n\t */\n\treadonly buttons = new AtomSet<number>('buttons')\n\n\tprivate _isPen = atom<boolean>('isPen', false)\n\n\t/**\n\t * Whether the input is from a pen.\n\t */\n\tgetIsPen() {\n\t\treturn this._isPen.get()\n\t}\n\t/**\n\t * @deprecated Use `getIsPen()` instead.\n\t */\n\t// eslint-disable-next-line no-restricted-syntax\n\tget isPen() {\n\t\treturn this.getIsPen()\n\t}\n\t// eslint-disable-next-line no-restricted-syntax\n\tset isPen(isPen: boolean) {\n\t\tthis.setIsPen(isPen)\n\t}\n\t/**\n\t * @param isPen - Whether the input is from a pen.\n\t */\n\tsetIsPen(isPen: boolean) {\n\t\tthis._isPen.set(isPen)\n\t}\n\n\tprivate _shiftKey = atom<boolean>('shiftKey', false)\n\t/**\n\t * Whether the shift key is currently pressed.\n\t */\n\tgetShiftKey() {\n\t\treturn this._shiftKey.get()\n\t}\n\t/**\n\t * @deprecated Use `getShiftKey()` instead.\n\t */\n\t// eslint-disable-next-line no-restricted-syntax\n\tget shiftKey() {\n\t\treturn this.getShiftKey()\n\t}\n\t// eslint-disable-next-line no-restricted-syntax\n\tset shiftKey(shiftKey: boolean) {\n\t\tthis.setShiftKey(shiftKey)\n\t}\n\t/**\n\t * @param shiftKey - Whether the shift key is pressed.\n\t * @internal\n\t */\n\tsetShiftKey(shiftKey: boolean) {\n\t\tthis._shiftKey.set(shiftKey)\n\t}\n\n\tprivate _metaKey = atom<boolean>('metaKey', false)\n\t/**\n\t * Whether the meta key is currently pressed.\n\t */\n\tgetMetaKey() {\n\t\treturn this._metaKey.get()\n\t}\n\t/**\n\t * @deprecated Use `getMetaKey()` instead.\n\t */\n\t// eslint-disable-next-line no-restricted-syntax\n\tget metaKey() {\n\t\treturn this.getMetaKey()\n\t}\n\t// eslint-disable-next-line no-restricted-syntax\n\tset metaKey(metaKey: boolean) {\n\t\tthis.setMetaKey(metaKey)\n\t}\n\t/**\n\t * @param metaKey - Whether the meta key is pressed.\n\t * @internal\n\t */\n\tsetMetaKey(metaKey: boolean) {\n\t\tthis._metaKey.set(metaKey)\n\t}\n\n\tprivate _ctrlKey = atom<boolean>('ctrlKey', false)\n\t/**\n\t * Whether the ctrl or command key is currently pressed.\n\t */\n\tgetCtrlKey() {\n\t\treturn this._ctrlKey.get()\n\t}\n\t/**\n\t * @deprecated Use `getCtrlKey()` instead.\n\t */\n\t// eslint-disable-next-line no-restricted-syntax\n\tget ctrlKey() {\n\t\treturn this.getCtrlKey()\n\t}\n\t// eslint-disable-next-line no-restricted-syntax\n\tset ctrlKey(ctrlKey: boolean) {\n\t\tthis.setCtrlKey(ctrlKey)\n\t}\n\t/**\n\t * @param ctrlKey - Whether the ctrl key is pressed.\n\t * @internal\n\t */\n\tsetCtrlKey(ctrlKey: boolean) {\n\t\tthis._ctrlKey.set(ctrlKey)\n\t}\n\n\tprivate _altKey = atom<boolean>('altKey', false)\n\t/**\n\t * Whether the alt or option key is currently pressed.\n\t */\n\tgetAltKey() {\n\t\treturn this._altKey.get()\n\t}\n\t/**\n\t * @deprecated Use `getAltKey()` instead.\n\t */\n\t// eslint-disable-next-line no-restricted-syntax\n\tget altKey() {\n\t\treturn this.getAltKey()\n\t}\n\t// eslint-disable-next-line no-restricted-syntax\n\tset altKey(altKey: boolean) {\n\t\tthis.setAltKey(altKey)\n\t}\n\t/**\n\t * @param altKey - Whether the alt key is pressed.\n\t * @internal\n\t */\n\tsetAltKey(altKey: boolean) {\n\t\tthis._altKey.set(altKey)\n\t}\n\n\t/**\n\t * Is the accelerator key (cmd on mac, ctrl elsewhere) currently pressed.\n\t */\n\tgetAccelKey() {\n\t\treturn isAccelKey({ metaKey: this.getMetaKey(), ctrlKey: this.getCtrlKey() })\n\t}\n\t/**\n\t * @deprecated Use `getAccelKey()` instead.\n\t */\n\t// eslint-disable-next-line no-restricted-syntax\n\tget accelKey() {\n\t\treturn this.getAccelKey()\n\t}\n\n\tprivate _isDragging = atom<boolean>('isDragging', false)\n\t/**\n\t * Whether the user is dragging.\n\t */\n\tgetIsDragging() {\n\t\treturn this._isDragging.get()\n\t}\n\t/**\n\t * Soon to be deprecated, use `getIsDragging()` instead.\n\t */\n\t// eslint-disable-next-line no-restricted-syntax\n\tget isDragging() {\n\t\treturn this.getIsDragging()\n\t}\n\t// eslint-disable-next-line no-restricted-syntax\n\tset isDragging(isDragging: boolean) {\n\t\tthis.setIsDragging(isDragging)\n\t}\n\t/**\n\t * @param isDragging - Whether the user is dragging.\n\t */\n\tsetIsDragging(isDragging: boolean) {\n\t\tthis._isDragging.set(isDragging)\n\t}\n\n\tprivate _isPointing = atom<boolean>('isPointing', false)\n\t/**\n\t * Whether the user is pointing.\n\t */\n\tgetIsPointing() {\n\t\treturn this._isPointing.get()\n\t}\n\t/**\n\t * @deprecated Use `getIsPointing()` instead.\n\t */\n\t// eslint-disable-next-line no-restricted-syntax\n\tget isPointing() {\n\t\treturn this.getIsPointing()\n\t}\n\t// eslint-disable-next-line no-restricted-syntax\n\tset isPointing(isPointing: boolean) {\n\t\tthis.setIsPointing(isPointing)\n\t}\n\t/**\n\t * @param isPointing - Whether the user is pointing.\n\t * @internal\n\t */\n\tsetIsPointing(isPointing: boolean) {\n\t\tthis._isPointing.set(isPointing)\n\t}\n\n\tprivate _isPinching = atom<boolean>('isPinching', false)\n\t/**\n\t * Whether the user is pinching.\n\t */\n\tgetIsPinching() {\n\t\treturn this._isPinching.get()\n\t}\n\t/**\n\t * @deprecated Use `getIsPinching()` instead.\n\t */\n\t// eslint-disable-next-line no-restricted-syntax\n\tget isPinching() {\n\t\treturn this.getIsPinching()\n\t}\n\t// eslint-disable-next-line no-restricted-syntax\n\tset isPinching(isPinching: boolean) {\n\t\tthis.setIsPinching(isPinching)\n\t}\n\t/**\n\t * @param isPinching - Whether the user is pinching.\n\t * @internal\n\t */\n\tsetIsPinching(isPinching: boolean) {\n\t\tthis._isPinching.set(isPinching)\n\t}\n\n\tprivate _isEditing = atom<boolean>('isEditing', false)\n\t/**\n\t * Whether the user is editing.\n\t */\n\tgetIsEditing() {\n\t\treturn this._isEditing.get()\n\t}\n\t/**\n\t * @deprecated Use `getIsEditing()` instead.\n\t */\n\t// eslint-disable-next-line no-restricted-syntax\n\tget isEditing() {\n\t\treturn this.getIsEditing()\n\t}\n\t// eslint-disable-next-line no-restricted-syntax\n\tset isEditing(isEditing: boolean) {\n\t\tthis.setIsEditing(isEditing)\n\t}\n\t/**\n\t * @param isEditing - Whether the user is editing.\n\t */\n\tsetIsEditing(isEditing: boolean) {\n\t\tthis._isEditing.set(isEditing)\n\t}\n\n\tprivate _isPanning = atom<boolean>('isPanning', false)\n\t/**\n\t * Whether the user is panning.\n\t */\n\tgetIsPanning() {\n\t\treturn this._isPanning.get()\n\t}\n\t/**\n\t * @deprecated Use `getIsPanning()` instead.\n\t */\n\t// eslint-disable-next-line no-restricted-syntax\n\tget isPanning() {\n\t\treturn this.getIsPanning()\n\t}\n\t// eslint-disable-next-line no-restricted-syntax\n\tset isPanning(isPanning: boolean) {\n\t\tthis.setIsPanning(isPanning)\n\t}\n\t/**\n\t * @param isPanning - Whether the user is panning.\n\t * @internal\n\t */\n\tsetIsPanning(isPanning: boolean) {\n\t\tthis._isPanning.set(isPanning)\n\t}\n\n\tprivate _isSpacebarPanning = atom<boolean>('isSpacebarPanning', false)\n\t/**\n\t * Whether the user is spacebar panning.\n\t */\n\tgetIsSpacebarPanning() {\n\t\treturn this._isSpacebarPanning.get()\n\t}\n\t/**\n\t * @deprecated Use `getIsSpacebarPanning()` instead.\n\t */\n\t// eslint-disable-next-line no-restricted-syntax\n\tget isSpacebarPanning() {\n\t\treturn this.getIsSpacebarPanning()\n\t}\n\t// eslint-disable-next-line no-restricted-syntax\n\tset isSpacebarPanning(isSpacebarPanning: boolean) {\n\t\tthis.setIsSpacebarPanning(isSpacebarPanning)\n\t}\n\t/**\n\t * @param isSpacebarPanning - Whether the user is spacebar panning.\n\t * @internal\n\t */\n\tsetIsSpacebarPanning(isSpacebarPanning: boolean) {\n\t\tthis._isSpacebarPanning.set(isSpacebarPanning)\n\t}\n\n\t@computed private _getHasCollaborators() {\n\t\treturn this.editor.getCollaborators().length > 0 // could we do this more efficiently?\n\t}\n\n\t/**\n\t * The previous point used for velocity calculation (updated each tick, not each pointer event).\n\t * @internal\n\t */\n\tprivate _velocityPrevPoint = new Vec()\n\n\t/**\n\t * Update the pointer velocity based on elapsed time. Called by the tick manager.\n\t * @param elapsed - The time elapsed since the last tick in milliseconds.\n\t * @internal\n\t */\n\tupdatePointerVelocity(elapsed: number) {\n\t\tconst currentScreenPoint = this.getCurrentScreenPoint()\n\t\tconst pointerVelocity = this.getPointerVelocity()\n\n\t\tif (elapsed === 0) return\n\n\t\tconst delta = Vec.Sub(currentScreenPoint, this._velocityPrevPoint)\n\t\tthis._velocityPrevPoint = currentScreenPoint.clone()\n\n\t\tconst length = delta.len()\n\t\tconst direction = length ? delta.div(length) : new Vec(0, 0)\n\n\t\t// consider adjusting this with an easing rather than a linear interpolation\n\t\tconst next = pointerVelocity.clone().lrp(direction.mul(length / elapsed), 0.5)\n\n\t\t// if the velocity is very small, just set it to 0\n\t\tif (Math.abs(next.x) < 0.01) next.x = 0\n\t\tif (Math.abs(next.y) < 0.01) next.y = 0\n\n\t\tif (!pointerVelocity.equals(next)) {\n\t\t\tthis._pointerVelocity.set(next)\n\t\t}\n\t}\n\n\t/**\n\t * Update the input points from a pointer, pinch, or wheel event.\n\t *\n\t * @param info - The event info.\n\t * @internal\n\t */\n\tupdateFromEvent(info: TLPointerEventInfo | TLPinchEventInfo | TLWheelEventInfo): void {\n\t\tconst currentScreenPoint = this._currentScreenPoint.__unsafe__getWithoutCapture()\n\t\tconst currentPagePoint = this._currentPagePoint.__unsafe__getWithoutCapture()\n\t\tconst isPinching = this._isPinching.__unsafe__getWithoutCapture()\n\t\tconst { screenBounds } = this.editor.store.unsafeGetWithoutCapture(TLINSTANCE_ID)!\n\t\tconst { x: cx, y: cy, z: cz } = unsafe__withoutCapture(() => this.editor.getCamera())\n\n\t\tconst sx = info.point.x - screenBounds.x\n\t\tconst sy = info.point.y - screenBounds.y\n\t\tconst sz = info.point.z ?? 0.5\n\n\t\tthis._previousScreenPoint.set(currentScreenPoint)\n\t\tthis._previousPagePoint.set(currentPagePoint)\n\n\t\t// The \"screen bounds\" is relative to the user's actual screen.\n\t\t// The \"screen point\" is relative to the \"screen bounds\";\n\t\t// it will be 0,0 when its actual screen position is equal\n\t\t// to screenBounds.point. This is confusing!\n\t\tthis._currentScreenPoint.set(new Vec(sx, sy))\n\t\tconst nx = sx / cz - cx\n\t\tconst ny = sy / cz - cy\n\t\tif (isFinite(nx) && isFinite(ny)) {\n\t\t\tthis._currentPagePoint.set(new Vec(nx, ny, sz))\n\t\t}\n\n\t\tthis._isPen.set(info.type === 'pointer' && info.isPen)\n\n\t\t// Reset velocity on pointer down, or when a pinch starts or ends\n\t\tif (info.name === 'pointer_down' || isPinching) {\n\t\t\tthis._pointerVelocity.set(new Vec())\n\t\t\tthis._originScreenPoint.set(this._currentScreenPoint.__unsafe__getWithoutCapture())\n\t\t\tthis._originPagePoint.set(this._currentPagePoint.__unsafe__getWithoutCapture())\n\t\t}\n\n\t\tif (this._getHasCollaborators()) {\n\t\t\tthis.editor.run(\n\t\t\t\t() => {\n\t\t\t\t\tconst pagePoint = this._currentPagePoint.__unsafe__getWithoutCapture()\n\t\t\t\t\tthis.editor.store.put([\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: TLPOINTER_ID,\n\t\t\t\t\t\t\ttypeName: 'pointer',\n\t\t\t\t\t\t\tx: pagePoint.x,\n\t\t\t\t\t\t\ty: pagePoint.y,\n\t\t\t\t\t\t\tlastActivityTimestamp:\n\t\t\t\t\t\t\t\t// If our pointer moved only because we're following some other user, then don't\n\t\t\t\t\t\t\t\t// update our last activity timestamp; otherwise, update it to the current timestamp.\n\t\t\t\t\t\t\t\tinfo.type === 'pointer' && info.pointerId === INTERNAL_POINTER_IDS.CAMERA_MOVE\n\t\t\t\t\t\t\t\t\t? (this.editor.store.unsafeGetWithoutCapture(TLPOINTER_ID)\n\t\t\t\t\t\t\t\t\t\t\t?.lastActivityTimestamp ?? Date.now())\n\t\t\t\t\t\t\t\t\t: Date.now(),\n\t\t\t\t\t\t\tmeta: {},\n\t\t\t\t\t\t},\n\t\t\t\t\t])\n\t\t\t\t},\n\t\t\t\t{ history: 'ignore' }\n\t\t\t)\n\t\t}\n\t}\n\n\ttoJson() {\n\t\treturn {\n\t\t\toriginPagePoint: this._originPagePoint.get().toJson(),\n\t\t\toriginScreenPoint: this._originScreenPoint.get().toJson(),\n\t\t\tpreviousPagePoint: this._previousPagePoint.get().toJson(),\n\t\t\tpreviousScreenPoint: this._previousScreenPoint.get().toJson(),\n\t\t\tcurrentPagePoint: this._currentPagePoint.get().toJson(),\n\t\t\tcurrentScreenPoint: this._currentScreenPoint.get().toJson(),\n\t\t\tpointerVelocity: this._pointerVelocity.get().toJson(),\n\t\t\tshiftKey: this._shiftKey.get(),\n\t\t\tmetaKey: this._metaKey.get(),\n\t\t\tctrlKey: this._ctrlKey.get(),\n\t\t\taltKey: this._altKey.get(),\n\t\t\tisPen: this._isPen.get(),\n\t\t\tisDragging: this._isDragging.get(),\n\t\t\tisPointing: this._isPointing.get(),\n\t\t\tisPinching: this._isPinching.get(),\n\t\t\tisEditing: this._isEditing.get(),\n\t\t\tisPanning: this._isPanning.get(),\n\t\t\tisSpacebarPanning: this._isSpacebarPanning.get(),\n\t\t\tkeys: Array.from(this.keys.keys()),\n\t\t\tbuttons: Array.from(this.buttons.keys()),\n\t\t}\n\t}\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAS,MAAM,UAAU,8BAA8B;AACvD,SAAS,eAAe;AACxB,SAAS,eAAe,oBAAoB;AAC5C,SAAS,4BAA4B;AACrC,SAAS,WAAW;AACpB,SAAS,kBAAkB;AA+a1B,6BAAC;AA1aK,MAAM,cAAc;AAAA,EAC1B,YAA6B,QAAgB;AAAhB;AADvB;AAGN,wBAAQ,oBAAmB,KAAU,mBAAmB,IAAI,IAAI,CAAC;AAejE,wBAAQ,sBAAqB,KAAU,qBAAqB,IAAI,IAAI,CAAC;AAerE,wBAAQ,sBAAqB,KAAU,qBAAqB,IAAI,IAAI,CAAC;AAerE,wBAAQ,wBAAuB,KAAU,uBAAuB,IAAI,IAAI,CAAC;AAezE,wBAAQ,qBAAoB,KAAU,oBAAoB,IAAI,IAAI,CAAC;AAenE,wBAAQ,uBAAsB,KAAU,sBAAsB,IAAI,IAAI,CAAC;AAevE,wBAAQ,oBAAmB,KAAU,mBAAmB,IAAI,IAAI,CAAC;AA4BjE;AAAA;AAAA;AAAA,wBAAS,QAAO,IAAI,QAAgB,MAAM;A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AAO,KAAK,OAAO,IAAI;AAAA,MACvB,YAAY,KAAK,YAAY,IAAI;AAAA,MACjC,YAAY,KAAK,YAAY,IAAI;AAAA,MACjC,YAAY,KAAK,YAAY,IAAI;AAAA,MACjC,WAAW,KAAK,WAAW,IAAI;AAAA,MAC/B,WAAW,KAAK,WAAW,IAAI;AAAA,MAC/B,mBAAmB,KAAK,mBAAmB,IAAI;AAAA,MAC/C,MAAM,MAAM,KAAK,KAAK,KAAK,KAAK,CAAC;AAAA,MACjC,SAAS,MAAM,KAAK,KAAK,QAAQ,KAAK,CAAC;AAAA,IACxC;AAAA,EACD;AACD;AA3iBO;AA0aI,4BAAQ,wBAAlB,2BA1aY;AAAN,2BAAM;",
6
+ "names": []
7
+ }
@@ -74,7 +74,7 @@ class SnapManager {
74
74
  this._snapIndicators.set(indicators);
75
75
  }
76
76
  getSnapThreshold() {
77
- return 8 / this.editor.getZoomLevel();
77
+ return this.editor.options.snapThreshold / this.editor.getZoomLevel();
78
78
  }
79
79
  getSnappableShapes() {
80
80
  const { editor } = this;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/lib/editor/managers/SnapManager/SnapManager.ts"],
4
- "sourcesContent": ["import { EMPTY_ARRAY, atom, computed } from '@tldraw/state'\nimport { TLFrameShape, TLGroupShape, TLParentId, TLShapeId, isShapeId } from '@tldraw/tlschema'\nimport { Vec, VecLike } from '../../../primitives/Vec'\nimport type { Editor } from '../../Editor'\nimport { BoundsSnaps } from './BoundsSnaps'\nimport { HandleSnaps } from './HandleSnaps'\n\n/** @public */\nexport interface PointsSnapIndicator {\n\tid: string\n\ttype: 'points'\n\tpoints: VecLike[]\n}\n\n/** @public */\nexport interface GapsSnapIndicator {\n\tid: string\n\ttype: 'gaps'\n\tdirection: 'horizontal' | 'vertical'\n\tgaps: Array<{\n\t\tstartEdge: [VecLike, VecLike]\n\t\tendEdge: [VecLike, VecLike]\n\t}>\n}\n\n/** @public */\nexport type SnapIndicator = PointsSnapIndicator | GapsSnapIndicator\n\n/** @public */\nexport interface SnapData {\n\tnudge: Vec\n}\n\n/** @public */\nexport class SnapManager {\n\treadonly shapeBounds: BoundsSnaps\n\treadonly handles: HandleSnaps\n\n\tprivate _snapIndicators = atom<SnapIndicator[] | undefined>('snapLines', undefined)\n\n\tconstructor(public readonly editor: Editor) {\n\t\tthis.shapeBounds = new BoundsSnaps(this)\n\t\tthis.handles = new HandleSnaps(this)\n\t}\n\n\tgetIndicators() {\n\t\treturn this._snapIndicators.get() ?? (EMPTY_ARRAY as SnapIndicator[])\n\t}\n\n\tclearIndicators() {\n\t\tif (this.getIndicators().length) {\n\t\t\tthis._snapIndicators.set(undefined)\n\t\t}\n\t}\n\n\tsetIndicators(indicators: SnapIndicator[]) {\n\t\tthis._snapIndicators.set(indicators)\n\t}\n\n\t@computed getSnapThreshold() {\n\t\treturn 8 / this.editor.getZoomLevel()\n\t}\n\n\t// TODO: make this an incremental derivation\n\t@computed getSnappableShapes(): Set<TLShapeId> {\n\t\tconst { editor } = this\n\t\tconst renderingBounds = editor.getViewportPageBounds()\n\t\tconst selectedShapeIds = editor.getSelectedShapeIds()\n\n\t\tconst snappableShapes: Set<TLShapeId> = new Set()\n\n\t\tconst collectSnappableShapesFromParent = (parentId: TLParentId) => {\n\t\t\tif (isShapeId(parentId)) {\n\t\t\t\tconst parent = editor.getShape(parentId)\n\t\t\t\tif (parent && editor.isShapeOfType<TLFrameShape>(parent, 'frame')) {\n\t\t\t\t\tsnappableShapes.add(parentId)\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst sortedChildIds = editor.getSortedChildIdsForParent(parentId)\n\t\t\tfor (const childId of sortedChildIds) {\n\t\t\t\t// Skip any selected ids\n\t\t\t\tif (selectedShapeIds.includes(childId)) continue\n\t\t\t\tconst childShape = editor.getShape(childId)\n\t\t\t\tif (!childShape) continue\n\t\t\t\tconst util = editor.getShapeUtil(childShape)\n\t\t\t\t// Skip any shapes that don't allow snapping\n\t\t\t\tif (!util.canSnap(childShape)) continue\n\t\t\t\t// Only consider shapes if they're inside of the viewport page bounds\n\t\t\t\tconst pageBounds = editor.getShapePageBounds(childId)\n\t\t\t\tif (!(pageBounds && renderingBounds.includes(pageBounds))) continue\n\t\t\t\t// Snap to children of groups but not group itself\n\t\t\t\tif (editor.isShapeOfType<TLGroupShape>(childShape, 'group')) {\n\t\t\t\t\tcollectSnappableShapesFromParent(childId)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tsnappableShapes.add(childId)\n\t\t\t}\n\t\t}\n\n\t\tcollectSnappableShapesFromParent(this.getCurrentCommonAncestor() ?? editor.getCurrentPageId())\n\n\t\treturn snappableShapes\n\t}\n\n\t// This needs to be external from any expensive work\n\t@computed getCurrentCommonAncestor() {\n\t\treturn this.editor.findCommonAncestor(this.editor.getSelectedShapes())\n\t}\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAS,aAAa,MAAM,gBAAgB;AAC5C,SAA4D,iBAAiB;AAG7E,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAsD3B,yBAAC,WAKD,2BAAC,WAyCD,iCAAC;AAvEK,MAAM,YAAY;AAAA,EAMxB,YAA4B,QAAgB;AAAhB;AANtB;AACN,wBAAS;AACT,wBAAS;AAET,wBAAQ,mBAAkB,KAAkC,aAAa,MAAS;AAGjF,SAAK,cAAc,IAAI,YAAY,IAAI;AACvC,SAAK,UAAU,IAAI,YAAY,IAAI;AAAA,EACpC;AAAA,EAEA,gBAAgB;AACf,WAAO,KAAK,gBAAgB,IAAI,KAAM;AAAA,EACvC;AAAA,EAEA,kBAAkB;AACjB,QAAI,KAAK,cAAc,EAAE,QAAQ;AAChC,WAAK,gBAAgB,IAAI,MAAS;AAAA,IACnC;AAAA,EACD;AAAA,EAEA,cAAc,YAA6B;AAC1C,SAAK,gBAAgB,IAAI,UAAU;AAAA,EACpC;AAAA,EAEU,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, isShapeId } from '@tldraw/tlschema'\nimport { Vec, VecLike } from '../../../primitives/Vec'\nimport type { Editor } from '../../Editor'\nimport { BoundsSnaps } from './BoundsSnaps'\nimport { HandleSnaps } from './HandleSnaps'\n\n/** @public */\nexport interface PointsSnapIndicator {\n\tid: string\n\ttype: 'points'\n\tpoints: VecLike[]\n}\n\n/** @public */\nexport interface GapsSnapIndicator {\n\tid: string\n\ttype: 'gaps'\n\tdirection: 'horizontal' | 'vertical'\n\tgaps: Array<{\n\t\tstartEdge: [VecLike, VecLike]\n\t\tendEdge: [VecLike, VecLike]\n\t}>\n}\n\n/** @public */\nexport type SnapIndicator = PointsSnapIndicator | GapsSnapIndicator\n\n/** @public */\nexport interface SnapData {\n\tnudge: Vec\n}\n\n/** @public */\nexport class SnapManager {\n\treadonly shapeBounds: BoundsSnaps\n\treadonly handles: HandleSnaps\n\n\tprivate _snapIndicators = atom<SnapIndicator[] | undefined>('snapLines', undefined)\n\n\tconstructor(public readonly editor: Editor) {\n\t\tthis.shapeBounds = new BoundsSnaps(this)\n\t\tthis.handles = new HandleSnaps(this)\n\t}\n\n\tgetIndicators() {\n\t\treturn this._snapIndicators.get() ?? (EMPTY_ARRAY as SnapIndicator[])\n\t}\n\n\tclearIndicators() {\n\t\tif (this.getIndicators().length) {\n\t\t\tthis._snapIndicators.set(undefined)\n\t\t}\n\t}\n\n\tsetIndicators(indicators: SnapIndicator[]) {\n\t\tthis._snapIndicators.set(indicators)\n\t}\n\n\t@computed getSnapThreshold() {\n\t\treturn this.editor.options.snapThreshold / this.editor.getZoomLevel()\n\t}\n\n\t// TODO: make this an incremental derivation\n\t@computed getSnappableShapes(): Set<TLShapeId> {\n\t\tconst { editor } = this\n\t\tconst renderingBounds = editor.getViewportPageBounds()\n\t\tconst selectedShapeIds = editor.getSelectedShapeIds()\n\n\t\tconst snappableShapes: Set<TLShapeId> = new Set()\n\n\t\tconst collectSnappableShapesFromParent = (parentId: TLParentId) => {\n\t\t\tif (isShapeId(parentId)) {\n\t\t\t\tconst parent = editor.getShape(parentId)\n\t\t\t\tif (parent && editor.isShapeOfType(parent, 'frame')) {\n\t\t\t\t\tsnappableShapes.add(parentId)\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst sortedChildIds = editor.getSortedChildIdsForParent(parentId)\n\t\t\tfor (const childId of sortedChildIds) {\n\t\t\t\t// Skip any selected ids\n\t\t\t\tif (selectedShapeIds.includes(childId)) continue\n\t\t\t\tconst childShape = editor.getShape(childId)\n\t\t\t\tif (!childShape) continue\n\t\t\t\tconst util = editor.getShapeUtil(childShape)\n\t\t\t\t// Skip any shapes that don't allow snapping\n\t\t\t\tif (!util.canSnap(childShape)) continue\n\t\t\t\t// Only consider shapes if they're inside of the viewport page bounds\n\t\t\t\tconst pageBounds = editor.getShapePageBounds(childId)\n\t\t\t\tif (!(pageBounds && renderingBounds.includes(pageBounds))) continue\n\t\t\t\t// Snap to children of groups but not group itself\n\t\t\t\tif (editor.isShapeOfType(childShape, 'group')) {\n\t\t\t\t\tcollectSnappableShapesFromParent(childId)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tsnappableShapes.add(childId)\n\t\t\t}\n\t\t}\n\n\t\tcollectSnappableShapesFromParent(this.getCurrentCommonAncestor() ?? editor.getCurrentPageId())\n\n\t\treturn snappableShapes\n\t}\n\n\t// This needs to be external from any expensive work\n\t@computed getCurrentCommonAncestor() {\n\t\treturn this.editor.findCommonAncestor(this.editor.getSelectedShapes())\n\t}\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAS,aAAa,MAAM,gBAAgB;AAC5C,SAAgC,iBAAiB;AAGjD,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAsD3B,yBAAC,WAKD,2BAAC,WAyCD,iCAAC;AAvEK,MAAM,YAAY;AAAA,EAMxB,YAA4B,QAAgB;AAAhB;AANtB;AACN,wBAAS;AACT,wBAAS;AAET,wB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