@tldraw/editor 5.4.0-canary.bce4c97b3811 → 5.4.0-next.b120f7febb0f

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.js CHANGED
@@ -389,7 +389,7 @@ var import_uniq = require("./lib/utils/uniq");
389
389
  var import_defaultThemes2 = require("./lib/editor/managers/ThemeManager/defaultThemes");
390
390
  (0, import_utils.registerTldrawLibraryVersion)(
391
391
  "@tldraw/editor",
392
- "5.4.0-canary.bce4c97b3811",
392
+ "5.4.0-next.b120f7febb0f",
393
393
  "cjs"
394
394
  );
395
395
  //# sourceMappingURL=index.js.map
@@ -25,8 +25,6 @@ var import_environment = require("../globals/environment");
25
25
  const MAX_ZOOM_STEP = 10;
26
26
  function normalizeWheel(event) {
27
27
  let { deltaY, deltaX } = event;
28
- if (!Number.isFinite(deltaX)) deltaX = 0;
29
- if (!Number.isFinite(deltaY)) deltaY = 0;
30
28
  let deltaZ = 0;
31
29
  if (event.ctrlKey || event.altKey || event.metaKey) {
32
30
  deltaZ = (Math.abs(deltaY) > MAX_ZOOM_STEP ? MAX_ZOOM_STEP * Math.sign(deltaY) : deltaY) / 100;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/lib/utils/normalizeWheel.ts"],
4
- "sourcesContent": ["import { tlenv } from '../globals/environment'\n\nconst MAX_ZOOM_STEP = 10\n\n/**\n * Normalizes a wheel event, so that the delta values are consistent across different browsers or devices. Adapted from https://stackoverflow.com/a/13650579.\n * @param event - The wheel event to normalize.\n * @returns The normalized wheel event.\n * @internal */\nexport function normalizeWheel(event: WheelEvent | React.WheelEvent<HTMLElement>) {\n\tlet { deltaY, deltaX } = event\n\n\t// Coerce non-finite deltas to no movement so they can't propagate into the camera and\n\t// crash validation. Also covers deltaZ below, which is derived from deltaY.\n\tif (!Number.isFinite(deltaX)) deltaX = 0\n\tif (!Number.isFinite(deltaY)) deltaY = 0\n\n\tlet deltaZ = 0\n\n\t// wheeling\n\tif (event.ctrlKey || event.altKey || event.metaKey) {\n\t\tdeltaZ = (Math.abs(deltaY) > MAX_ZOOM_STEP ? MAX_ZOOM_STEP * Math.sign(deltaY) : deltaY) / 100\n\t} else {\n\t\tif (event.shiftKey && !tlenv.isDarwin && !tlenv.isIos) {\n\t\t\tdeltaX = deltaY\n\t\t\tdeltaY = 0\n\t\t}\n\t}\n\n\treturn { x: -deltaX, y: -deltaY, z: -deltaZ }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAsB;AAEtB,MAAM,gBAAgB;AAOf,SAAS,eAAe,OAAmD;AACjF,MAAI,EAAE,QAAQ,OAAO,IAAI;AAIzB,MAAI,CAAC,OAAO,SAAS,MAAM,EAAG,UAAS;AACvC,MAAI,CAAC,OAAO,SAAS,MAAM,EAAG,UAAS;AAEvC,MAAI,SAAS;AAGb,MAAI,MAAM,WAAW,MAAM,UAAU,MAAM,SAAS;AACnD,cAAU,KAAK,IAAI,MAAM,IAAI,gBAAgB,gBAAgB,KAAK,KAAK,MAAM,IAAI,UAAU;AAAA,EAC5F,OAAO;AACN,QAAI,MAAM,YAAY,CAAC,yBAAM,YAAY,CAAC,yBAAM,OAAO;AACtD,eAAS;AACT,eAAS;AAAA,IACV;AAAA,EACD;AAEA,SAAO,EAAE,GAAG,CAAC,QAAQ,GAAG,CAAC,QAAQ,GAAG,CAAC,OAAO;AAC7C;",
4
+ "sourcesContent": ["import { tlenv } from '../globals/environment'\n\nconst MAX_ZOOM_STEP = 10\n\n/**\n * Normalizes a wheel event, so that the delta values are consistent across different browsers or devices. Adapted from https://stackoverflow.com/a/13650579.\n * @param event - The wheel event to normalize.\n * @returns The normalized wheel event.\n * @internal */\nexport function normalizeWheel(event: WheelEvent | React.WheelEvent<HTMLElement>) {\n\tlet { deltaY, deltaX } = event\n\tlet deltaZ = 0\n\n\t// wheeling\n\tif (event.ctrlKey || event.altKey || event.metaKey) {\n\t\tdeltaZ = (Math.abs(deltaY) > MAX_ZOOM_STEP ? MAX_ZOOM_STEP * Math.sign(deltaY) : deltaY) / 100\n\t} else {\n\t\tif (event.shiftKey && !tlenv.isDarwin && !tlenv.isIos) {\n\t\t\tdeltaX = deltaY\n\t\t\tdeltaY = 0\n\t\t}\n\t}\n\n\treturn { x: -deltaX, y: -deltaY, z: -deltaZ }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAsB;AAEtB,MAAM,gBAAgB;AAOf,SAAS,eAAe,OAAmD;AACjF,MAAI,EAAE,QAAQ,OAAO,IAAI;AACzB,MAAI,SAAS;AAGb,MAAI,MAAM,WAAW,MAAM,UAAU,MAAM,SAAS;AACnD,cAAU,KAAK,IAAI,MAAM,IAAI,gBAAgB,gBAAgB,KAAK,KAAK,MAAM,IAAI,UAAU;AAAA,EAC5F,OAAO;AACN,QAAI,MAAM,YAAY,CAAC,yBAAM,YAAY,CAAC,yBAAM,OAAO;AACtD,eAAS;AACT,eAAS;AAAA,IACV;AAAA,EACD;AAEA,SAAO,EAAE,GAAG,CAAC,QAAQ,GAAG,CAAC,QAAQ,GAAG,CAAC,OAAO;AAC7C;",
6
6
  "names": []
7
7
  }
@@ -22,10 +22,10 @@ __export(version_exports, {
22
22
  version: () => version
23
23
  });
24
24
  module.exports = __toCommonJS(version_exports);
25
- const version = "5.4.0-canary.bce4c97b3811";
25
+ const version = "5.4.0-next.b120f7febb0f";
26
26
  const publishDates = {
27
27
  major: "2026-05-06T16:28:18.473Z",
28
- minor: "2026-08-07T09:21:19.301Z",
29
- patch: "2026-08-07T09:21:19.301Z"
28
+ minor: "2026-08-07T10:20:18.607Z",
29
+ patch: "2026-08-07T10:20:18.607Z"
30
30
  };
31
31
  //# sourceMappingURL=version.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/version.ts"],
4
- "sourcesContent": ["// This file is automatically generated by internal/scripts/refresh-assets.ts.\n// Do not edit manually. Or do, I'm a comment, not a cop.\n\nexport const version = '5.4.0-canary.bce4c97b3811'\nexport const publishDates = {\n\tmajor: '2026-05-06T16:28:18.473Z',\n\tminor: '2026-08-07T09:21:19.301Z',\n\tpatch: '2026-08-07T09:21:19.301Z',\n}\n"],
4
+ "sourcesContent": ["// This file is automatically generated by internal/scripts/refresh-assets.ts.\n// Do not edit manually. Or do, I'm a comment, not a cop.\n\nexport const version = '5.4.0-next.b120f7febb0f'\nexport const publishDates = {\n\tmajor: '2026-05-06T16:28:18.473Z',\n\tminor: '2026-08-07T10:20:18.607Z',\n\tpatch: '2026-08-07T10:20:18.607Z',\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,UAAU;AAChB,MAAM,eAAe;AAAA,EAC3B,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACR;",
6
6
  "names": []
7
7
  }
@@ -305,7 +305,7 @@ import { LocalIndexedDb, Table } from "./lib/utils/sync/LocalIndexedDb.mjs";
305
305
  import { uniq } from "./lib/utils/uniq.mjs";
306
306
  registerTldrawLibraryVersion(
307
307
  "@tldraw/editor",
308
- "5.4.0-canary.bce4c97b3811",
308
+ "5.4.0-next.b120f7febb0f",
309
309
  "esm"
310
310
  );
311
311
  import { getColorValue } from "./lib/editor/managers/ThemeManager/defaultThemes.mjs";
@@ -2,8 +2,6 @@ import { tlenv } from "../globals/environment.mjs";
2
2
  const MAX_ZOOM_STEP = 10;
3
3
  function normalizeWheel(event) {
4
4
  let { deltaY, deltaX } = event;
5
- if (!Number.isFinite(deltaX)) deltaX = 0;
6
- if (!Number.isFinite(deltaY)) deltaY = 0;
7
5
  let deltaZ = 0;
8
6
  if (event.ctrlKey || event.altKey || event.metaKey) {
9
7
  deltaZ = (Math.abs(deltaY) > MAX_ZOOM_STEP ? MAX_ZOOM_STEP * Math.sign(deltaY) : deltaY) / 100;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/lib/utils/normalizeWheel.ts"],
4
- "sourcesContent": ["import { tlenv } from '../globals/environment'\n\nconst MAX_ZOOM_STEP = 10\n\n/**\n * Normalizes a wheel event, so that the delta values are consistent across different browsers or devices. Adapted from https://stackoverflow.com/a/13650579.\n * @param event - The wheel event to normalize.\n * @returns The normalized wheel event.\n * @internal */\nexport function normalizeWheel(event: WheelEvent | React.WheelEvent<HTMLElement>) {\n\tlet { deltaY, deltaX } = event\n\n\t// Coerce non-finite deltas to no movement so they can't propagate into the camera and\n\t// crash validation. Also covers deltaZ below, which is derived from deltaY.\n\tif (!Number.isFinite(deltaX)) deltaX = 0\n\tif (!Number.isFinite(deltaY)) deltaY = 0\n\n\tlet deltaZ = 0\n\n\t// wheeling\n\tif (event.ctrlKey || event.altKey || event.metaKey) {\n\t\tdeltaZ = (Math.abs(deltaY) > MAX_ZOOM_STEP ? MAX_ZOOM_STEP * Math.sign(deltaY) : deltaY) / 100\n\t} else {\n\t\tif (event.shiftKey && !tlenv.isDarwin && !tlenv.isIos) {\n\t\t\tdeltaX = deltaY\n\t\t\tdeltaY = 0\n\t\t}\n\t}\n\n\treturn { x: -deltaX, y: -deltaY, z: -deltaZ }\n}\n"],
5
- "mappings": "AAAA,SAAS,aAAa;AAEtB,MAAM,gBAAgB;AAOf,SAAS,eAAe,OAAmD;AACjF,MAAI,EAAE,QAAQ,OAAO,IAAI;AAIzB,MAAI,CAAC,OAAO,SAAS,MAAM,EAAG,UAAS;AACvC,MAAI,CAAC,OAAO,SAAS,MAAM,EAAG,UAAS;AAEvC,MAAI,SAAS;AAGb,MAAI,MAAM,WAAW,MAAM,UAAU,MAAM,SAAS;AACnD,cAAU,KAAK,IAAI,MAAM,IAAI,gBAAgB,gBAAgB,KAAK,KAAK,MAAM,IAAI,UAAU;AAAA,EAC5F,OAAO;AACN,QAAI,MAAM,YAAY,CAAC,MAAM,YAAY,CAAC,MAAM,OAAO;AACtD,eAAS;AACT,eAAS;AAAA,IACV;AAAA,EACD;AAEA,SAAO,EAAE,GAAG,CAAC,QAAQ,GAAG,CAAC,QAAQ,GAAG,CAAC,OAAO;AAC7C;",
4
+ "sourcesContent": ["import { tlenv } from '../globals/environment'\n\nconst MAX_ZOOM_STEP = 10\n\n/**\n * Normalizes a wheel event, so that the delta values are consistent across different browsers or devices. Adapted from https://stackoverflow.com/a/13650579.\n * @param event - The wheel event to normalize.\n * @returns The normalized wheel event.\n * @internal */\nexport function normalizeWheel(event: WheelEvent | React.WheelEvent<HTMLElement>) {\n\tlet { deltaY, deltaX } = event\n\tlet deltaZ = 0\n\n\t// wheeling\n\tif (event.ctrlKey || event.altKey || event.metaKey) {\n\t\tdeltaZ = (Math.abs(deltaY) > MAX_ZOOM_STEP ? MAX_ZOOM_STEP * Math.sign(deltaY) : deltaY) / 100\n\t} else {\n\t\tif (event.shiftKey && !tlenv.isDarwin && !tlenv.isIos) {\n\t\t\tdeltaX = deltaY\n\t\t\tdeltaY = 0\n\t\t}\n\t}\n\n\treturn { x: -deltaX, y: -deltaY, z: -deltaZ }\n}\n"],
5
+ "mappings": "AAAA,SAAS,aAAa;AAEtB,MAAM,gBAAgB;AAOf,SAAS,eAAe,OAAmD;AACjF,MAAI,EAAE,QAAQ,OAAO,IAAI;AACzB,MAAI,SAAS;AAGb,MAAI,MAAM,WAAW,MAAM,UAAU,MAAM,SAAS;AACnD,cAAU,KAAK,IAAI,MAAM,IAAI,gBAAgB,gBAAgB,KAAK,KAAK,MAAM,IAAI,UAAU;AAAA,EAC5F,OAAO;AACN,QAAI,MAAM,YAAY,CAAC,MAAM,YAAY,CAAC,MAAM,OAAO;AACtD,eAAS;AACT,eAAS;AAAA,IACV;AAAA,EACD;AAEA,SAAO,EAAE,GAAG,CAAC,QAAQ,GAAG,CAAC,QAAQ,GAAG,CAAC,OAAO;AAC7C;",
6
6
  "names": []
7
7
  }
@@ -1,8 +1,8 @@
1
- const version = "5.4.0-canary.bce4c97b3811";
1
+ const version = "5.4.0-next.b120f7febb0f";
2
2
  const publishDates = {
3
3
  major: "2026-05-06T16:28:18.473Z",
4
- minor: "2026-08-07T09:21:19.301Z",
5
- patch: "2026-08-07T09:21:19.301Z"
4
+ minor: "2026-08-07T10:20:18.607Z",
5
+ patch: "2026-08-07T10:20:18.607Z"
6
6
  };
7
7
  export {
8
8
  publishDates,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/version.ts"],
4
- "sourcesContent": ["// This file is automatically generated by internal/scripts/refresh-assets.ts.\n// Do not edit manually. Or do, I'm a comment, not a cop.\n\nexport const version = '5.4.0-canary.bce4c97b3811'\nexport const publishDates = {\n\tmajor: '2026-05-06T16:28:18.473Z',\n\tminor: '2026-08-07T09:21:19.301Z',\n\tpatch: '2026-08-07T09:21:19.301Z',\n}\n"],
4
+ "sourcesContent": ["// This file is automatically generated by internal/scripts/refresh-assets.ts.\n// Do not edit manually. Or do, I'm a comment, not a cop.\n\nexport const version = '5.4.0-next.b120f7febb0f'\nexport const publishDates = {\n\tmajor: '2026-05-06T16:28:18.473Z',\n\tminor: '2026-08-07T10:20:18.607Z',\n\tpatch: '2026-08-07T10:20:18.607Z',\n}\n"],
5
5
  "mappings": "AAGO,MAAM,UAAU;AAChB,MAAM,eAAe;AAAA,EAC3B,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACR;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tldraw/editor",
3
3
  "description": "tldraw infinite canvas SDK (editor).",
4
- "version": "5.4.0-canary.bce4c97b3811",
4
+ "version": "5.4.0-next.b120f7febb0f",
5
5
  "author": {
6
6
  "name": "tldraw Inc.",
7
7
  "email": "hello@tldraw.com"
@@ -49,12 +49,12 @@
49
49
  "@tiptap/core": "^3.12.1",
50
50
  "@tiptap/pm": "^3.12.1",
51
51
  "@tiptap/react": "^3.12.1",
52
- "@tldraw/state": "5.4.0-canary.bce4c97b3811",
53
- "@tldraw/state-react": "5.4.0-canary.bce4c97b3811",
54
- "@tldraw/store": "5.4.0-canary.bce4c97b3811",
55
- "@tldraw/tlschema": "5.4.0-canary.bce4c97b3811",
56
- "@tldraw/utils": "5.4.0-canary.bce4c97b3811",
57
- "@tldraw/validate": "5.4.0-canary.bce4c97b3811",
52
+ "@tldraw/state": "5.4.0-next.b120f7febb0f",
53
+ "@tldraw/state-react": "5.4.0-next.b120f7febb0f",
54
+ "@tldraw/store": "5.4.0-next.b120f7febb0f",
55
+ "@tldraw/tlschema": "5.4.0-next.b120f7febb0f",
56
+ "@tldraw/utils": "5.4.0-next.b120f7febb0f",
57
+ "@tldraw/validate": "5.4.0-next.b120f7febb0f",
58
58
  "classnames": "^2.5.1",
59
59
  "eventemitter3": "^4.0.7",
60
60
  "idb": "^7.1.1",
@@ -9,12 +9,6 @@ const MAX_ZOOM_STEP = 10
9
9
  * @internal */
10
10
  export function normalizeWheel(event: WheelEvent | React.WheelEvent<HTMLElement>) {
11
11
  let { deltaY, deltaX } = event
12
-
13
- // Coerce non-finite deltas to no movement so they can't propagate into the camera and
14
- // crash validation. Also covers deltaZ below, which is derived from deltaY.
15
- if (!Number.isFinite(deltaX)) deltaX = 0
16
- if (!Number.isFinite(deltaY)) deltaY = 0
17
-
18
12
  let deltaZ = 0
19
13
 
20
14
  // wheeling
package/src/version.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  // This file is automatically generated by internal/scripts/refresh-assets.ts.
2
2
  // Do not edit manually. Or do, I'm a comment, not a cop.
3
3
 
4
- export const version = '5.4.0-canary.bce4c97b3811'
4
+ export const version = '5.4.0-next.b120f7febb0f'
5
5
  export const publishDates = {
6
6
  major: '2026-05-06T16:28:18.473Z',
7
- minor: '2026-08-07T09:21:19.301Z',
8
- patch: '2026-08-07T09:21:19.301Z',
7
+ minor: '2026-08-07T10:20:18.607Z',
8
+ patch: '2026-08-07T10:20:18.607Z',
9
9
  }
@@ -1,39 +0,0 @@
1
- import { normalizeWheel } from './normalizeWheel'
2
-
3
- function wheelEvent(props: Partial<WheelEvent>): WheelEvent {
4
- return {
5
- deltaX: 0,
6
- deltaY: 0,
7
- ctrlKey: false,
8
- altKey: false,
9
- metaKey: false,
10
- shiftKey: false,
11
- ...props,
12
- } as WheelEvent
13
- }
14
-
15
- describe('normalizeWheel', () => {
16
- it('negates finite deltas for panning', () => {
17
- const { x, y } = normalizeWheel(wheelEvent({ deltaX: 5, deltaY: 10 }))
18
- expect(x).toBe(-5)
19
- expect(y).toBe(-10)
20
- })
21
-
22
- it('coerces a non-finite deltaX to zero movement', () => {
23
- const { x, y } = normalizeWheel(wheelEvent({ deltaX: NaN, deltaY: 10 }))
24
- expect(x === 0).toBe(true)
25
- expect(y).toBe(-10)
26
- })
27
-
28
- it('coerces a non-finite deltaY to zero movement', () => {
29
- const { x, y } = normalizeWheel(wheelEvent({ deltaX: 5, deltaY: Infinity }))
30
- expect(x).toBe(-5)
31
- expect(y === 0).toBe(true)
32
- })
33
-
34
- it('does not produce a non-finite zoom delta when wheeling with a bad deltaY', () => {
35
- const { z } = normalizeWheel(wheelEvent({ deltaY: NaN, ctrlKey: true }))
36
- expect(Number.isFinite(z)).toBe(true)
37
- expect(z === 0).toBe(true)
38
- })
39
- })