@tldraw/editor 5.5.0-canary.d1591ff8ef95 → 5.5.0-canary.d5a92f075dcb
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cjs/index.d.ts +17 -11
- package/dist-cjs/index.js +1 -1
- package/dist-cjs/lib/editor/Editor.js +24 -26
- package/dist-cjs/lib/editor/Editor.js.map +2 -2
- package/dist-cjs/lib/editor/managers/ClickManager/ClickManager.js +3 -2
- package/dist-cjs/lib/editor/managers/ClickManager/ClickManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/EditorManager.js +11 -2
- package/dist-cjs/lib/editor/managers/EditorManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/PerformanceManager/PerformanceManager.js +49 -63
- package/dist-cjs/lib/editor/managers/PerformanceManager/PerformanceManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/ScribbleManager/ScribbleManager.js +1 -1
- package/dist-cjs/lib/editor/managers/ScribbleManager/ScribbleManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/SnapManager/BoundsSnaps.js +24 -24
- package/dist-cjs/lib/editor/managers/SnapManager/BoundsSnaps.js.map +2 -2
- package/dist-cjs/lib/editor/managers/SnapManager/HandleSnaps.js +7 -1
- package/dist-cjs/lib/editor/managers/SnapManager/HandleSnaps.js.map +2 -2
- package/dist-cjs/lib/editor/managers/SnapManager/SnapManager.js +4 -3
- package/dist-cjs/lib/editor/managers/SnapManager/SnapManager.js.map +2 -2
- package/dist-cjs/lib/utils/sync/LocalIndexedDb.js +10 -1
- package/dist-cjs/lib/utils/sync/LocalIndexedDb.js.map +2 -2
- package/dist-cjs/version.js +3 -3
- package/dist-cjs/version.js.map +1 -1
- package/dist-esm/index.d.mts +17 -11
- package/dist-esm/index.mjs +1 -1
- package/dist-esm/lib/editor/Editor.mjs +24 -26
- package/dist-esm/lib/editor/Editor.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/ClickManager/ClickManager.mjs +3 -2
- package/dist-esm/lib/editor/managers/ClickManager/ClickManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/EditorManager.mjs +11 -2
- package/dist-esm/lib/editor/managers/EditorManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/PerformanceManager/PerformanceManager.mjs +49 -63
- package/dist-esm/lib/editor/managers/PerformanceManager/PerformanceManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/ScribbleManager/ScribbleManager.mjs +1 -1
- package/dist-esm/lib/editor/managers/ScribbleManager/ScribbleManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/SnapManager/BoundsSnaps.mjs +24 -24
- package/dist-esm/lib/editor/managers/SnapManager/BoundsSnaps.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/SnapManager/HandleSnaps.mjs +7 -1
- package/dist-esm/lib/editor/managers/SnapManager/HandleSnaps.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/SnapManager/SnapManager.mjs +4 -3
- package/dist-esm/lib/editor/managers/SnapManager/SnapManager.mjs.map +2 -2
- package/dist-esm/lib/utils/sync/LocalIndexedDb.mjs +10 -1
- package/dist-esm/lib/utils/sync/LocalIndexedDb.mjs.map +2 -2
- package/dist-esm/version.mjs +3 -3
- package/dist-esm/version.mjs.map +1 -1
- package/package.json +16 -18
- package/src/lib/editor/Editor.test.ts +45 -0
- package/src/lib/editor/Editor.ts +40 -35
- package/src/lib/editor/managers/ClickManager/ClickManager.test.ts +1 -0
- package/src/lib/editor/managers/ClickManager/ClickManager.ts +3 -2
- package/src/lib/editor/managers/EditorManager.test.ts +32 -1
- package/src/lib/editor/managers/EditorManager.ts +15 -3
- package/src/lib/editor/managers/PerformanceManager/PerformanceManager.test.ts +80 -0
- package/src/lib/editor/managers/PerformanceManager/PerformanceManager.ts +54 -81
- package/src/lib/editor/managers/ScribbleManager/ScribbleManager.ts +1 -1
- package/src/lib/editor/managers/SnapManager/BoundsSnaps.ts +32 -36
- package/src/lib/editor/managers/SnapManager/HandleSnaps.ts +13 -2
- package/src/lib/editor/managers/SnapManager/SnapManager.test.ts +13 -0
- package/src/lib/editor/managers/SnapManager/SnapManager.ts +6 -4
- package/src/lib/utils/sync/LocalIndexedDb.test.ts +26 -1
- package/src/lib/utils/sync/LocalIndexedDb.ts +10 -1
- package/src/version.ts +3 -3
package/dist-cjs/index.d.ts
CHANGED
|
@@ -1274,6 +1274,9 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1274
1274
|
* @public
|
|
1275
1275
|
*/
|
|
1276
1276
|
readonly timers: {
|
|
1277
|
+
cancelAnimationFrame: (id: number | undefined) => void;
|
|
1278
|
+
clearInterval: (id: number | undefined) => void;
|
|
1279
|
+
clearTimeout: (id: number | undefined) => void;
|
|
1277
1280
|
dispose: () => void;
|
|
1278
1281
|
requestAnimationFrame: (callback: FrameRequestCallback) => number;
|
|
1279
1282
|
setInterval: (handler: TimerHandler, timeout?: number, ...args: any[]) => number;
|
|
@@ -4576,6 +4579,8 @@ export declare const EditorContext: React_3.Context<Editor | null>;
|
|
|
4576
4579
|
* - Reaction (`react(...)` from `@tldraw/state`): `this.register(react(...))`
|
|
4577
4580
|
* - DOM listener: `this.register(() => el.removeEventListener(...))`
|
|
4578
4581
|
* - Other resource (cache, index, child manager): `this.register(() => x.dispose())`
|
|
4582
|
+
* - Resource held only part of the time (a listener attached while subscribers exist):
|
|
4583
|
+
* `this.register(...)` on attach and `this.unregister(...)` on detach, see `PerformanceManager`
|
|
4579
4584
|
*
|
|
4580
4585
|
* For timeouts, intervals, and animation frames prefer `editor.timers` (context-grouped
|
|
4581
4586
|
* and auto-disposed) over raw `setTimeout`. For cleanup on the editor itself rather than a
|
|
@@ -4595,11 +4600,18 @@ export declare abstract class EditorManager {
|
|
|
4595
4600
|
* make a resource "see itself out". Returns the same function for convenience.
|
|
4596
4601
|
*/
|
|
4597
4602
|
protected register(dispose: () => void): () => void;
|
|
4603
|
+
/**
|
|
4604
|
+
* Run a registered teardown now instead of at `dispose()`. A teardown that is no longer
|
|
4605
|
+
* registered (already run by `dispose()`, or never registered) is skipped, so nothing is
|
|
4606
|
+
* torn down twice.
|
|
4607
|
+
*/
|
|
4608
|
+
protected unregister(dispose: () => void): void;
|
|
4598
4609
|
/**
|
|
4599
4610
|
* Subscribe to an editor bus event and register the matching unsubscribe, so the listener
|
|
4600
|
-
* is removed automatically on `dispose()`.
|
|
4611
|
+
* is removed automatically on `dispose()`. Returns that unsubscribe, for passing to
|
|
4612
|
+
* {@link EditorManager.unregister} to detach it before `dispose()`.
|
|
4601
4613
|
*/
|
|
4602
|
-
protected addEditorEvent<E extends keyof TLEventMap>(event: E, fn: (...args: TLEventMap[E]) => void): void;
|
|
4614
|
+
protected addEditorEvent<E extends keyof TLEventMap>(event: E, fn: (...args: TLEventMap[E]) => void): () => void;
|
|
4603
4615
|
/* Excluded from this release type: dispose */
|
|
4604
4616
|
}
|
|
4605
4617
|
|
|
@@ -5987,17 +5999,11 @@ export declare class PerformanceApiAdapter {
|
|
|
5987
5999
|
*
|
|
5988
6000
|
* @public
|
|
5989
6001
|
*/
|
|
5990
|
-
export declare class PerformanceManager {
|
|
6002
|
+
export declare class PerformanceManager extends EditorManager {
|
|
5991
6003
|
/* Excluded from this release type: emitter */
|
|
5992
|
-
private editor;
|
|
5993
6004
|
private activeInteraction;
|
|
5994
6005
|
private activeCamera;
|
|
5995
|
-
private
|
|
5996
|
-
private shapeCreatedCleanup;
|
|
5997
|
-
private shapeEditedCleanup;
|
|
5998
|
-
private shapeDeletedCleanup;
|
|
5999
|
-
private loafObserver;
|
|
6000
|
-
constructor(editor: Editor);
|
|
6006
|
+
private readonly lazyCleanups;
|
|
6001
6007
|
/**
|
|
6002
6008
|
* Subscribe to a performance event. Returns an unsubscribe function.
|
|
6003
6009
|
*
|
|
@@ -6031,11 +6037,11 @@ export declare class PerformanceManager {
|
|
|
6031
6037
|
private _onShapesEdited;
|
|
6032
6038
|
private _onShapesDeleted;
|
|
6033
6039
|
private _startLoafObserver;
|
|
6034
|
-
private _stopLoafObserver;
|
|
6035
6040
|
private _needsFrameListener;
|
|
6036
6041
|
private _needsLoafObserver;
|
|
6037
6042
|
private _maybeAttachLazyListeners;
|
|
6038
6043
|
private _maybeDetachLazyListeners;
|
|
6044
|
+
private _detachLazy;
|
|
6039
6045
|
}
|
|
6040
6046
|
|
|
6041
6047
|
/**
|
package/dist-cjs/index.js
CHANGED
|
@@ -392,7 +392,7 @@ var import_uniq = require("./lib/utils/uniq");
|
|
|
392
392
|
var import_defaultThemes2 = require("./lib/editor/managers/ThemeManager/defaultThemes");
|
|
393
393
|
(0, import_utils.registerTldrawLibraryVersion)(
|
|
394
394
|
"@tldraw/editor",
|
|
395
|
-
"5.5.0-canary.
|
|
395
|
+
"5.5.0-canary.d5a92f075dcb",
|
|
396
396
|
"cjs"
|
|
397
397
|
);
|
|
398
398
|
//# sourceMappingURL=index.js.map
|
|
@@ -1408,7 +1408,7 @@ class Editor extends import_eventemitter3.default {
|
|
|
1408
1408
|
updateInstanceState(partial, historyOptions) {
|
|
1409
1409
|
this._updateInstanceState(partial, { history: "ignore", ...historyOptions });
|
|
1410
1410
|
if (partial.isChangingStyle !== void 0) {
|
|
1411
|
-
clearTimeout(this._isChangingStyleTimeout);
|
|
1411
|
+
this.timers.clearTimeout(this._isChangingStyleTimeout);
|
|
1412
1412
|
if (partial.isChangingStyle === true) {
|
|
1413
1413
|
this._isChangingStyleTimeout = this.timers.setTimeout(() => {
|
|
1414
1414
|
this._updateInstanceState({ isChangingStyle: false }, { history: "ignore" });
|
|
@@ -7822,22 +7822,22 @@ class Editor extends import_eventemitter3.default {
|
|
|
7822
7822
|
const releaseCtrl = this._ctrlKeyTimeout !== -1;
|
|
7823
7823
|
const releaseMeta = this._metaKeyTimeout !== -1;
|
|
7824
7824
|
if (releaseShift) {
|
|
7825
|
-
clearTimeout(this._shiftKeyTimeout);
|
|
7825
|
+
this.timers.clearTimeout(this._shiftKeyTimeout);
|
|
7826
7826
|
this._shiftKeyTimeout = -1;
|
|
7827
7827
|
this.inputs.setShiftKey(false);
|
|
7828
7828
|
}
|
|
7829
7829
|
if (releaseAlt) {
|
|
7830
|
-
clearTimeout(this._altKeyTimeout);
|
|
7830
|
+
this.timers.clearTimeout(this._altKeyTimeout);
|
|
7831
7831
|
this._altKeyTimeout = -1;
|
|
7832
7832
|
this.inputs.setAltKey(false);
|
|
7833
7833
|
}
|
|
7834
7834
|
if (releaseCtrl) {
|
|
7835
|
-
clearTimeout(this._ctrlKeyTimeout);
|
|
7835
|
+
this.timers.clearTimeout(this._ctrlKeyTimeout);
|
|
7836
7836
|
this._ctrlKeyTimeout = -1;
|
|
7837
7837
|
this.inputs.setCtrlKey(false);
|
|
7838
7838
|
}
|
|
7839
7839
|
if (releaseMeta) {
|
|
7840
|
-
clearTimeout(this._metaKeyTimeout);
|
|
7840
|
+
this.timers.clearTimeout(this._metaKeyTimeout);
|
|
7841
7841
|
this._metaKeyTimeout = -1;
|
|
7842
7842
|
this.inputs.setMetaKey(false);
|
|
7843
7843
|
}
|
|
@@ -7951,28 +7951,28 @@ class Editor extends import_eventemitter3.default {
|
|
|
7951
7951
|
return;
|
|
7952
7952
|
}
|
|
7953
7953
|
if (info.shiftKey) {
|
|
7954
|
-
clearTimeout(this._shiftKeyTimeout);
|
|
7954
|
+
this.timers.clearTimeout(this._shiftKeyTimeout);
|
|
7955
7955
|
this._shiftKeyTimeout = -1;
|
|
7956
7956
|
inputs.setShiftKey(true);
|
|
7957
7957
|
} else if (!info.shiftKey && inputs.getShiftKey() && this._shiftKeyTimeout === -1) {
|
|
7958
7958
|
this._shiftKeyTimeout = this.timers.setTimeout(this._releaseShiftKey, 150);
|
|
7959
7959
|
}
|
|
7960
7960
|
if (info.altKey) {
|
|
7961
|
-
clearTimeout(this._altKeyTimeout);
|
|
7961
|
+
this.timers.clearTimeout(this._altKeyTimeout);
|
|
7962
7962
|
this._altKeyTimeout = -1;
|
|
7963
7963
|
inputs.setAltKey(true);
|
|
7964
7964
|
} else if (!info.altKey && inputs.getAltKey() && this._altKeyTimeout === -1) {
|
|
7965
7965
|
this._altKeyTimeout = this.timers.setTimeout(this._releaseAltKey, 150);
|
|
7966
7966
|
}
|
|
7967
7967
|
if (info.ctrlKey) {
|
|
7968
|
-
clearTimeout(this._ctrlKeyTimeout);
|
|
7968
|
+
this.timers.clearTimeout(this._ctrlKeyTimeout);
|
|
7969
7969
|
this._ctrlKeyTimeout = -1;
|
|
7970
7970
|
inputs.setCtrlKey(true);
|
|
7971
7971
|
} else if (!info.ctrlKey && inputs.getCtrlKey() && this._ctrlKeyTimeout === -1) {
|
|
7972
7972
|
this._ctrlKeyTimeout = this.timers.setTimeout(this._releaseCtrlKey, 150);
|
|
7973
7973
|
}
|
|
7974
7974
|
if (info.metaKey && info.name !== "key_up") {
|
|
7975
|
-
clearTimeout(this._metaKeyTimeout);
|
|
7975
|
+
this.timers.clearTimeout(this._metaKeyTimeout);
|
|
7976
7976
|
this._metaKeyTimeout = -1;
|
|
7977
7977
|
inputs.setMetaKey(true);
|
|
7978
7978
|
} else if (!info.metaKey && inputs.getMetaKey() && this._metaKeyTimeout === -1) {
|
|
@@ -7986,8 +7986,7 @@ class Editor extends import_eventemitter3.default {
|
|
|
7986
7986
|
const cameraOptions = this._cameraOptions.__unsafe__getWithoutCapture();
|
|
7987
7987
|
switch (type) {
|
|
7988
7988
|
case "pinch": {
|
|
7989
|
-
|
|
7990
|
-
clearTimeout(this._longPressTimeout);
|
|
7989
|
+
this.timers.clearTimeout(this._longPressTimeout);
|
|
7991
7990
|
this.inputs.updateFromEvent(info);
|
|
7992
7991
|
switch (info.name) {
|
|
7993
7992
|
case "pinch_start": {
|
|
@@ -8008,6 +8007,7 @@ class Editor extends import_eventemitter3.default {
|
|
|
8008
8007
|
}
|
|
8009
8008
|
case "pinch": {
|
|
8010
8009
|
if (!inputs.getIsPinching()) return;
|
|
8010
|
+
if (cameraOptions.isLocked) return;
|
|
8011
8011
|
const {
|
|
8012
8012
|
point: { z = 1 },
|
|
8013
8013
|
delta: { x: dx, y: dy }
|
|
@@ -8063,7 +8063,7 @@ class Editor extends import_eventemitter3.default {
|
|
|
8063
8063
|
const { panSpeed, zoomSpeed } = cameraOptions;
|
|
8064
8064
|
let wheelBehavior = cameraOptions.wheelBehavior;
|
|
8065
8065
|
const inputMode = this.user.getUserPreferences().inputMode;
|
|
8066
|
-
if (inputMode !== null) {
|
|
8066
|
+
if (inputMode !== null && wheelBehavior !== "none") {
|
|
8067
8067
|
wheelBehavior = inputMode === "trackpad" ? "pan" : "zoom";
|
|
8068
8068
|
}
|
|
8069
8069
|
if (wheelBehavior !== "none") {
|
|
@@ -8115,12 +8115,12 @@ class Editor extends import_eventemitter3.default {
|
|
|
8115
8115
|
}
|
|
8116
8116
|
case "pointer": {
|
|
8117
8117
|
if (inputs.getIsPinching()) return;
|
|
8118
|
-
this.inputs.updateFromEvent(info);
|
|
8119
8118
|
const { isPen } = info;
|
|
8120
8119
|
const { isPenMode } = instanceState;
|
|
8120
|
+
if (isPenMode && !isPen) return;
|
|
8121
|
+
this.inputs.updateFromEvent(info);
|
|
8121
8122
|
switch (info.name) {
|
|
8122
8123
|
case "pointer_down": {
|
|
8123
|
-
if (isPenMode && !isPen) return;
|
|
8124
8124
|
this._releaseDebouncedModifiers();
|
|
8125
8125
|
if (!this.inputs.getIsPanning()) {
|
|
8126
8126
|
this._longPressTimeout = this.timers.setTimeout(() => {
|
|
@@ -8149,7 +8149,7 @@ class Editor extends import_eventemitter3.default {
|
|
|
8149
8149
|
this.updateInstanceState({ isPenMode: true });
|
|
8150
8150
|
this.interrupt();
|
|
8151
8151
|
}
|
|
8152
|
-
if (info.button === import_constants.STYLUS_ERASER_BUTTON) {
|
|
8152
|
+
if (info.button === import_constants.STYLUS_ERASER_BUTTON && this.getStateDescendant("eraser")) {
|
|
8153
8153
|
this._restoreToolId = this.getCurrentToolId();
|
|
8154
8154
|
this.complete();
|
|
8155
8155
|
this.setCurrentTool("eraser");
|
|
@@ -8158,10 +8158,10 @@ class Editor extends import_eventemitter3.default {
|
|
|
8158
8158
|
this._prevCursor = this.getInstanceState().cursor.type;
|
|
8159
8159
|
}
|
|
8160
8160
|
this.inputs.setIsPanning(true);
|
|
8161
|
-
clearTimeout(this._longPressTimeout);
|
|
8161
|
+
this.timers.clearTimeout(this._longPressTimeout);
|
|
8162
8162
|
} else if (info.button === import_constants.RIGHT_MOUSE_BUTTON && this.options.rightClickPanning) {
|
|
8163
8163
|
this.inputs.setIsRightPointing(true);
|
|
8164
|
-
clearTimeout(this._longPressTimeout);
|
|
8164
|
+
this.timers.clearTimeout(this._longPressTimeout);
|
|
8165
8165
|
return this;
|
|
8166
8166
|
}
|
|
8167
8167
|
if (this.inputs.getIsPanning()) {
|
|
@@ -8172,7 +8172,6 @@ class Editor extends import_eventemitter3.default {
|
|
|
8172
8172
|
break;
|
|
8173
8173
|
}
|
|
8174
8174
|
case "pointer_move": {
|
|
8175
|
-
if (!isPen && isPenMode) return;
|
|
8176
8175
|
const { x: cx, y: cy, z: cz } = (0, import_state.unsafe__withoutCapture)(() => this.getCamera());
|
|
8177
8176
|
if (this.inputs.getIsRightPointing() && !this.inputs.getIsPanning()) {
|
|
8178
8177
|
const currentScreenPoint = this.inputs.getCurrentScreenPoint();
|
|
@@ -8203,16 +8202,15 @@ class Editor extends import_eventemitter3.default {
|
|
|
8203
8202
|
}
|
|
8204
8203
|
if (inputs.getIsPointing() && !inputs.getIsDragging() && import_Vec.Vec.Dist2(inputs.getOriginPagePoint(), inputs.getCurrentPagePoint()) * this.getZoomLevel() > (instanceState.isCoarsePointer ? this.options.coarseDragDistanceSquared : this.options.dragDistanceSquared) / cz) {
|
|
8205
8204
|
inputs.setIsDragging(true);
|
|
8206
|
-
clearTimeout(this._longPressTimeout);
|
|
8205
|
+
this.timers.clearTimeout(this._longPressTimeout);
|
|
8207
8206
|
}
|
|
8208
8207
|
break;
|
|
8209
8208
|
}
|
|
8210
8209
|
case "pointer_up": {
|
|
8211
8210
|
inputs.setIsDragging(false);
|
|
8212
8211
|
inputs.setIsPointing(false);
|
|
8213
|
-
clearTimeout(this._longPressTimeout);
|
|
8212
|
+
this.timers.clearTimeout(this._longPressTimeout);
|
|
8214
8213
|
inputs.buttons.delete(info.button);
|
|
8215
|
-
if (instanceState.isPenMode && !isPen) return;
|
|
8216
8214
|
if (this.inputs.getIsRightPointing() && !this.inputs.getIsPanning()) {
|
|
8217
8215
|
this.inputs.setIsRightPointing(false);
|
|
8218
8216
|
this._selectedShapeIdsAtPointerDown = [];
|
|
@@ -8268,7 +8266,7 @@ class Editor extends import_eventemitter3.default {
|
|
|
8268
8266
|
});
|
|
8269
8267
|
}
|
|
8270
8268
|
} else {
|
|
8271
|
-
if (info.button === import_constants.STYLUS_ERASER_BUTTON) {
|
|
8269
|
+
if (info.button === import_constants.STYLUS_ERASER_BUTTON && this.getStateDescendant("eraser")) {
|
|
8272
8270
|
this.complete();
|
|
8273
8271
|
this.setCurrentTool(this._restoreToolId);
|
|
8274
8272
|
}
|
|
@@ -8295,7 +8293,7 @@ class Editor extends import_eventemitter3.default {
|
|
|
8295
8293
|
}
|
|
8296
8294
|
this.inputs.setIsPanning(true);
|
|
8297
8295
|
this.inputs.setIsSpacebarPanning(true);
|
|
8298
|
-
clearTimeout(this._longPressTimeout);
|
|
8296
|
+
this.timers.clearTimeout(this._longPressTimeout);
|
|
8299
8297
|
this.setCursor({
|
|
8300
8298
|
type: this.inputs.getIsPointing() ? "grabbing" : "grab",
|
|
8301
8299
|
rotation: 0
|
|
@@ -8321,7 +8319,7 @@ class Editor extends import_eventemitter3.default {
|
|
|
8321
8319
|
break;
|
|
8322
8320
|
}
|
|
8323
8321
|
}
|
|
8324
|
-
if (offset) {
|
|
8322
|
+
if (offset && !cameraOptions.isLocked) {
|
|
8325
8323
|
const bounds = this.getViewportPageBounds();
|
|
8326
8324
|
const next = bounds.clone().translate(offset.mulV({ x: bounds.w, y: bounds.h }));
|
|
8327
8325
|
this._animateToViewport(next, { animation: { duration: 320 } });
|
|
@@ -8361,7 +8359,7 @@ class Editor extends import_eventemitter3.default {
|
|
|
8361
8359
|
this.setCurrentTool("select");
|
|
8362
8360
|
}
|
|
8363
8361
|
const { isPenMode } = this.store.unsafeGetWithoutCapture(import_tlschema.TLINSTANCE_ID);
|
|
8364
|
-
if (info.isPen
|
|
8362
|
+
if (!isPenMode || info.isPen) {
|
|
8365
8363
|
const clickInfo = this._clickManager.handlePointerEvent(info);
|
|
8366
8364
|
if (info.name !== clickInfo.name) {
|
|
8367
8365
|
this.root.handleEvent(info);
|
|
@@ -8383,7 +8381,7 @@ class Editor extends import_eventemitter3.default {
|
|
|
8383
8381
|
maybeTrackPerformance(name) {
|
|
8384
8382
|
if (import_debug_flags.debugFlags.measurePerformance.get()) {
|
|
8385
8383
|
if (this.performanceTracker.isStarted()) {
|
|
8386
|
-
clearTimeout(this.performanceTrackerTimeout);
|
|
8384
|
+
this.timers.clearTimeout(this.performanceTrackerTimeout);
|
|
8387
8385
|
} else {
|
|
8388
8386
|
this.performanceTracker.start(name);
|
|
8389
8387
|
}
|