@tldraw/editor 3.13.0-canary.8754dedf4cf0 → 3.13.0-canary.8b1562e59f12
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 +1 -1
- package/dist-cjs/lib/components/Shape.js +2 -1
- package/dist-cjs/lib/components/Shape.js.map +2 -2
- package/dist-cjs/lib/editor/Editor.js +20 -7
- package/dist-cjs/lib/editor/Editor.js.map +2 -2
- package/dist-cjs/lib/utils/areShapesContentEqual.js +25 -0
- package/dist-cjs/lib/utils/areShapesContentEqual.js.map +7 -0
- package/dist-cjs/version.js +3 -3
- package/dist-cjs/version.js.map +1 -1
- package/dist-esm/index.mjs +1 -1
- package/dist-esm/lib/components/Shape.mjs +2 -1
- package/dist-esm/lib/components/Shape.mjs.map +2 -2
- package/dist-esm/lib/editor/Editor.mjs +20 -7
- package/dist-esm/lib/editor/Editor.mjs.map +2 -2
- package/dist-esm/lib/utils/areShapesContentEqual.mjs +5 -0
- package/dist-esm/lib/utils/areShapesContentEqual.mjs.map +7 -0
- package/dist-esm/version.mjs +3 -3
- package/dist-esm/version.mjs.map +1 -1
- package/package.json +7 -7
- package/src/lib/components/Shape.tsx +2 -4
- package/src/lib/editor/Editor.ts +20 -7
- package/src/lib/utils/areShapesContentEqual.ts +4 -0
- package/src/version.ts +3 -3
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/lib/utils/areShapesContentEqual.ts"],
|
|
4
|
+
"sourcesContent": ["import { TLShape } from '@tldraw/tlschema'\n\nexport const areShapesContentEqual = (a: TLShape, b: TLShape) =>\n\ta.props === b.props && a.meta === b.meta\n"],
|
|
5
|
+
"mappings": "AAEO,MAAM,wBAAwB,CAAC,GAAY,MACjD,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist-esm/version.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const version = "3.13.0-canary.
|
|
1
|
+
const version = "3.13.0-canary.8b1562e59f12";
|
|
2
2
|
const publishDates = {
|
|
3
3
|
major: "2024-09-13T14:36:29.063Z",
|
|
4
|
-
minor: "2025-05-
|
|
5
|
-
patch: "2025-05-
|
|
4
|
+
minor: "2025-05-05T15:52:26.021Z",
|
|
5
|
+
patch: "2025-05-05T15:52:26.021Z"
|
|
6
6
|
};
|
|
7
7
|
export {
|
|
8
8
|
publishDates,
|
package/dist-esm/version.mjs.map
CHANGED
|
@@ -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 = '3.13.0-canary.
|
|
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 = '3.13.0-canary.8b1562e59f12'\nexport const publishDates = {\n\tmajor: '2024-09-13T14:36:29.063Z',\n\tminor: '2025-05-05T15:52:26.021Z',\n\tpatch: '2025-05-05T15:52:26.021Z',\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": "A tiny little drawing app (editor).",
|
|
4
|
-
"version": "3.13.0-canary.
|
|
4
|
+
"version": "3.13.0-canary.8b1562e59f12",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "tldraw Inc.",
|
|
7
7
|
"email": "hello@tldraw.com"
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
"@tiptap/core": "^2.9.1",
|
|
49
49
|
"@tiptap/pm": "^2.9.1",
|
|
50
50
|
"@tiptap/react": "^2.9.1",
|
|
51
|
-
"@tldraw/state": "3.13.0-canary.
|
|
52
|
-
"@tldraw/state-react": "3.13.0-canary.
|
|
53
|
-
"@tldraw/store": "3.13.0-canary.
|
|
54
|
-
"@tldraw/tlschema": "3.13.0-canary.
|
|
55
|
-
"@tldraw/utils": "3.13.0-canary.
|
|
56
|
-
"@tldraw/validate": "3.13.0-canary.
|
|
51
|
+
"@tldraw/state": "3.13.0-canary.8b1562e59f12",
|
|
52
|
+
"@tldraw/state-react": "3.13.0-canary.8b1562e59f12",
|
|
53
|
+
"@tldraw/store": "3.13.0-canary.8b1562e59f12",
|
|
54
|
+
"@tldraw/tlschema": "3.13.0-canary.8b1562e59f12",
|
|
55
|
+
"@tldraw/utils": "3.13.0-canary.8b1562e59f12",
|
|
56
|
+
"@tldraw/validate": "3.13.0-canary.8b1562e59f12",
|
|
57
57
|
"@types/core-js": "^2.5.8",
|
|
58
58
|
"@use-gesture/react": "^10.3.1",
|
|
59
59
|
"classnames": "^2.5.1",
|
|
@@ -6,6 +6,7 @@ import { ShapeUtil } from '../editor/shapes/ShapeUtil'
|
|
|
6
6
|
import { useEditor } from '../hooks/useEditor'
|
|
7
7
|
import { useEditorComponents } from '../hooks/useEditorComponents'
|
|
8
8
|
import { Mat } from '../primitives/Mat'
|
|
9
|
+
import { areShapesContentEqual } from '../utils/areShapesContentEqual'
|
|
9
10
|
import { setStyleProperty } from '../utils/dom'
|
|
10
11
|
import { OptionalErrorBoundary } from './ErrorBoundary'
|
|
11
12
|
|
|
@@ -190,10 +191,7 @@ export const InnerShape = memo(
|
|
|
190
191
|
[util, shape.id]
|
|
191
192
|
)
|
|
192
193
|
},
|
|
193
|
-
(prev, next) =>
|
|
194
|
-
prev.shape.props === next.shape.props &&
|
|
195
|
-
prev.shape.meta === next.shape.meta &&
|
|
196
|
-
prev.util === next.util
|
|
194
|
+
(prev, next) => areShapesContentEqual(prev.shape, next.shape) && prev.util === next.util
|
|
197
195
|
)
|
|
198
196
|
|
|
199
197
|
export const InnerShapeBackground = memo(
|
package/src/lib/editor/Editor.ts
CHANGED
|
@@ -129,6 +129,7 @@ import { Group2d } from '../primitives/geometry/Group2d'
|
|
|
129
129
|
import { intersectPolygonPolygon } from '../primitives/intersect'
|
|
130
130
|
import { PI, approximately, areAnglesCompatible, clamp, pointInPolygon } from '../primitives/utils'
|
|
131
131
|
import { ReadonlySharedStyleMap, SharedStyle, SharedStyleMap } from '../utils/SharedStylesMap'
|
|
132
|
+
import { areShapesContentEqual } from '../utils/areShapesContentEqual'
|
|
132
133
|
import { dataUrlToFile } from '../utils/assets'
|
|
133
134
|
import { debugFlags } from '../utils/debug-flags'
|
|
134
135
|
import {
|
|
@@ -4574,7 +4575,7 @@ export class Editor extends EventEmitter<TLEventMap> {
|
|
|
4574
4575
|
this.fonts.trackFontsForShape(shape)
|
|
4575
4576
|
return this.getShapeUtil(shape).getGeometry(shape, opts)
|
|
4576
4577
|
},
|
|
4577
|
-
{ areRecordsEqual:
|
|
4578
|
+
{ areRecordsEqual: areShapesContentEqual }
|
|
4578
4579
|
)
|
|
4579
4580
|
}
|
|
4580
4581
|
return this._shapeGeometryCaches[context].get(
|
|
@@ -4622,9 +4623,15 @@ export class Editor extends EventEmitter<TLEventMap> {
|
|
|
4622
4623
|
|
|
4623
4624
|
/** @internal */
|
|
4624
4625
|
@computed private _getShapeHandlesCache(): ComputedCache<TLHandle[] | undefined, TLShape> {
|
|
4625
|
-
return this.store.createComputedCache(
|
|
4626
|
-
|
|
4627
|
-
|
|
4626
|
+
return this.store.createComputedCache(
|
|
4627
|
+
'handles',
|
|
4628
|
+
(shape) => {
|
|
4629
|
+
return this.getShapeUtil(shape).getHandles?.(shape)
|
|
4630
|
+
},
|
|
4631
|
+
{
|
|
4632
|
+
areRecordsEqual: areShapesContentEqual,
|
|
4633
|
+
}
|
|
4634
|
+
)
|
|
4628
4635
|
}
|
|
4629
4636
|
|
|
4630
4637
|
/**
|
|
@@ -5845,9 +5852,15 @@ export class Editor extends EventEmitter<TLEventMap> {
|
|
|
5845
5852
|
@computed
|
|
5846
5853
|
private _getBindingsIndexCache() {
|
|
5847
5854
|
const index = bindingsIndex(this)
|
|
5848
|
-
return this.store.createComputedCache<TLBinding[], TLShape>(
|
|
5849
|
-
|
|
5850
|
-
|
|
5855
|
+
return this.store.createComputedCache<TLBinding[], TLShape>(
|
|
5856
|
+
'bindingsIndex',
|
|
5857
|
+
(shape) => {
|
|
5858
|
+
return index.get().get(shape.id)
|
|
5859
|
+
},
|
|
5860
|
+
// we can ignore the shape equality check here because the index is
|
|
5861
|
+
// computed incrementally based on what bindings are in the store
|
|
5862
|
+
{ areRecordsEqual: () => true }
|
|
5863
|
+
)
|
|
5851
5864
|
}
|
|
5852
5865
|
|
|
5853
5866
|
/**
|
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 = '3.13.0-canary.
|
|
4
|
+
export const version = '3.13.0-canary.8b1562e59f12'
|
|
5
5
|
export const publishDates = {
|
|
6
6
|
major: '2024-09-13T14:36:29.063Z',
|
|
7
|
-
minor: '2025-05-
|
|
8
|
-
patch: '2025-05-
|
|
7
|
+
minor: '2025-05-05T15:52:26.021Z',
|
|
8
|
+
patch: '2025-05-05T15:52:26.021Z',
|
|
9
9
|
}
|