@tldraw/editor 3.9.0-canary.d799df28e99e → 3.9.0-canary.ef20f7307209
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/CHANGELOG.md +20 -0
- package/README.md +1 -1
- package/dist-cjs/index.d.ts +23 -6
- package/dist-cjs/index.js +1 -1
- package/dist-cjs/index.js.map +2 -2
- package/dist-cjs/lib/components/default-components/DefaultErrorFallback.js +1 -1
- package/dist-cjs/lib/components/default-components/DefaultErrorFallback.js.map +2 -2
- package/dist-cjs/lib/editor/Editor.js +413 -237
- package/dist-cjs/lib/editor/Editor.js.map +3 -3
- package/dist-cjs/lib/editor/shapes/ShapeUtil.js +7 -2
- package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +2 -2
- package/dist-cjs/lib/exports/getSvgJsx.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 +23 -6
- package/dist-esm/index.mjs +1 -1
- package/dist-esm/index.mjs.map +2 -2
- package/dist-esm/lib/components/default-components/DefaultErrorFallback.mjs +1 -1
- package/dist-esm/lib/components/default-components/DefaultErrorFallback.mjs.map +2 -2
- package/dist-esm/lib/editor/Editor.mjs +409 -233
- package/dist-esm/lib/editor/Editor.mjs.map +3 -3
- package/dist-esm/lib/editor/shapes/ShapeUtil.mjs +7 -2
- package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/exports/getSvgJsx.mjs.map +2 -2
- package/dist-esm/version.mjs +3 -3
- package/dist-esm/version.mjs.map +1 -1
- package/package.json +7 -7
- package/src/index.ts +1 -0
- package/src/lib/components/default-components/DefaultErrorFallback.tsx +5 -3
- package/src/lib/editor/Editor.ts +540 -262
- package/src/lib/editor/shapes/ShapeUtil.ts +21 -5
- package/src/lib/exports/getSvgJsx.tsx +1 -0
- package/src/version.ts +3 -3
|
@@ -36,7 +36,7 @@ export interface TLShapeUtilConstructor<
|
|
|
36
36
|
*
|
|
37
37
|
* @public
|
|
38
38
|
*/
|
|
39
|
-
export interface TLShapeUtilCanBindOpts<Shape extends TLUnknownShape =
|
|
39
|
+
export interface TLShapeUtilCanBindOpts<Shape extends TLUnknownShape = TLUnknownShape> {
|
|
40
40
|
/** The type of shape referenced by the `fromId` of the binding. */
|
|
41
41
|
fromShapeType: string
|
|
42
42
|
/** The type of shape referenced by the `toId` of the binding. */
|
|
@@ -46,7 +46,18 @@ export interface TLShapeUtilCanBindOpts<Shape extends TLUnknownShape = TLShape>
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* Options passed to {@link ShapeUtil.canBeLaidOut}.
|
|
50
|
+
*
|
|
51
|
+
* @public
|
|
52
|
+
*/
|
|
53
|
+
export interface TLShapeUtilCanBeLaidOutOpts {
|
|
54
|
+
/** The type of action causing the layout. */
|
|
55
|
+
type?: 'align' | 'distribute' | 'pack' | 'stack' | 'flip' | 'stretch'
|
|
56
|
+
/** The other shapes being laid out */
|
|
57
|
+
shapes?: TLShape[]
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Additional options for the {@link ShapeUtil.getGeometry} method.
|
|
50
61
|
*
|
|
51
62
|
* @public
|
|
52
63
|
*/
|
|
@@ -162,6 +173,7 @@ export abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknownShape> {
|
|
|
162
173
|
/**
|
|
163
174
|
* Whether the shape can be snapped to by another shape.
|
|
164
175
|
*
|
|
176
|
+
* @param shape - The shape.
|
|
165
177
|
* @public
|
|
166
178
|
*/
|
|
167
179
|
canSnap(_shape: Shape): boolean {
|
|
@@ -182,7 +194,7 @@ export abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknownShape> {
|
|
|
182
194
|
*
|
|
183
195
|
* @public
|
|
184
196
|
*/
|
|
185
|
-
canBind(_opts: TLShapeUtilCanBindOpts
|
|
197
|
+
canBind(_opts: TLShapeUtilCanBindOpts): boolean {
|
|
186
198
|
return true
|
|
187
199
|
}
|
|
188
200
|
|
|
@@ -223,11 +235,15 @@ export abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknownShape> {
|
|
|
223
235
|
}
|
|
224
236
|
|
|
225
237
|
/**
|
|
226
|
-
* Whether the shape
|
|
238
|
+
* Whether the shape can participate in layout functions such as alignment or distribution.
|
|
239
|
+
*
|
|
240
|
+
* @param shape - The shape.
|
|
241
|
+
* @param info - Additional context information: the type of action causing the layout and the
|
|
242
|
+
* @public
|
|
227
243
|
*
|
|
228
244
|
* @public
|
|
229
245
|
*/
|
|
230
|
-
canBeLaidOut(_shape: Shape): boolean {
|
|
246
|
+
canBeLaidOut(_shape: Shape, _info: TLShapeUtilCanBeLaidOutOpts): boolean {
|
|
231
247
|
return true
|
|
232
248
|
}
|
|
233
249
|
|
|
@@ -205,6 +205,7 @@ function SvgExport({
|
|
|
205
205
|
;(async () => {
|
|
206
206
|
const shapeDefs: Record<string, { pending: false; element: ReactElement }> = {}
|
|
207
207
|
|
|
208
|
+
// Then render everything. The shapes with assets should all hit the cache
|
|
208
209
|
const unorderedShapeElementPromises = renderingShapes.map(
|
|
209
210
|
async ({ id, opacity, index, backgroundIndex }) => {
|
|
210
211
|
// Don't render the frame if we're only exporting a single frame and it's children
|
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.9.0-canary.
|
|
4
|
+
export const version = '3.9.0-canary.ef20f7307209'
|
|
5
5
|
export const publishDates = {
|
|
6
6
|
major: '2024-09-13T14:36:29.063Z',
|
|
7
|
-
minor: '2025-02-
|
|
8
|
-
patch: '2025-02-
|
|
7
|
+
minor: '2025-02-27T14:57:10.316Z',
|
|
8
|
+
patch: '2025-02-27T14:57:10.316Z',
|
|
9
9
|
}
|