@tldraw/editor 5.2.0-canary.fe03bcdddf34 → 5.2.0-canary.fff413eea248
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/README.md +7 -1
- package/dist-cjs/index.d.ts +43 -47
- package/dist-cjs/index.js +4 -4
- package/dist-cjs/index.js.map +2 -2
- package/dist-cjs/lib/editor/Editor.js +92 -53
- package/dist-cjs/lib/editor/Editor.js.map +3 -3
- package/dist-cjs/lib/editor/managers/ClickManager/ClickManager.js +8 -58
- package/dist-cjs/lib/editor/managers/ClickManager/ClickManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.js +3 -3
- package/dist-cjs/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/FocusManager/FocusManager.js +1 -2
- package/dist-cjs/lib/editor/managers/FocusManager/FocusManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/HistoryManager/HistoryManager.js +12 -2
- package/dist-cjs/lib/editor/managers/HistoryManager/HistoryManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.js +4 -2
- package/dist-cjs/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/TextManager/TextManager.js +7 -3
- package/dist-cjs/lib/editor/managers/TextManager/TextManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.js +15 -2
- package/dist-cjs/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.js.map +2 -2
- package/dist-cjs/lib/editor/overlays/strokeShapeIndicators.js +79 -0
- package/dist-cjs/lib/editor/overlays/strokeShapeIndicators.js.map +7 -0
- package/dist-cjs/lib/editor/tools/BaseBoxShapeTool/children/Pointing.js +3 -0
- package/dist-cjs/lib/editor/tools/BaseBoxShapeTool/children/Pointing.js.map +2 -2
- package/dist-cjs/lib/editor/tools/StateNode.js.map +2 -2
- package/dist-cjs/lib/editor/types/event-types.js +0 -2
- package/dist-cjs/lib/editor/types/event-types.js.map +2 -2
- package/dist-cjs/lib/hooks/usePresence.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 +43 -47
- package/dist-esm/index.mjs +5 -7
- package/dist-esm/index.mjs.map +2 -2
- package/dist-esm/lib/editor/Editor.mjs +92 -53
- package/dist-esm/lib/editor/Editor.mjs.map +3 -3
- package/dist-esm/lib/editor/managers/ClickManager/ClickManager.mjs +8 -58
- package/dist-esm/lib/editor/managers/ClickManager/ClickManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.mjs +3 -3
- package/dist-esm/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/FocusManager/FocusManager.mjs +1 -2
- package/dist-esm/lib/editor/managers/FocusManager/FocusManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/HistoryManager/HistoryManager.mjs +12 -2
- package/dist-esm/lib/editor/managers/HistoryManager/HistoryManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.mjs +4 -2
- package/dist-esm/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs +7 -3
- package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs +15 -2
- package/dist-esm/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.mjs.map +2 -2
- package/dist-esm/lib/editor/overlays/strokeShapeIndicators.mjs +59 -0
- package/dist-esm/lib/editor/overlays/strokeShapeIndicators.mjs.map +7 -0
- package/dist-esm/lib/editor/tools/BaseBoxShapeTool/children/Pointing.mjs +3 -0
- package/dist-esm/lib/editor/tools/BaseBoxShapeTool/children/Pointing.mjs.map +2 -2
- package/dist-esm/lib/editor/tools/StateNode.mjs.map +2 -2
- package/dist-esm/lib/editor/types/event-types.mjs +0 -2
- package/dist-esm/lib/editor/types/event-types.mjs.map +2 -2
- package/dist-esm/lib/hooks/usePresence.mjs.map +2 -2
- package/dist-esm/version.mjs +3 -3
- package/dist-esm/version.mjs.map +1 -1
- package/editor.css +2 -0
- package/package.json +8 -8
- package/src/index.ts +2 -5
- package/src/lib/editor/Editor.ts +124 -64
- package/src/lib/editor/managers/ClickManager/ClickManager.test.ts +54 -74
- package/src/lib/editor/managers/ClickManager/ClickManager.ts +15 -65
- package/src/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.test.ts +43 -16
- package/src/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.ts +8 -5
- package/src/lib/editor/managers/FocusManager/FocusManager.test.ts +4 -4
- package/src/lib/editor/managers/FocusManager/FocusManager.ts +1 -2
- package/src/lib/editor/managers/FontManager/FontManager.test.ts +13 -9
- package/src/lib/editor/managers/HistoryManager/HistoryManager.ts +20 -2
- package/src/lib/editor/managers/SpatialIndexManager/SpatialIndexManager.ts +9 -2
- package/src/lib/editor/managers/TextManager/TextManager.test.ts +16 -14
- package/src/lib/editor/managers/TextManager/TextManager.ts +17 -2
- package/src/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.test.ts +12 -2
- package/src/lib/editor/managers/UserPreferencesManager/UserPreferencesManager.ts +27 -2
- package/src/lib/editor/overlays/strokeShapeIndicators.ts +86 -0
- package/src/lib/editor/tools/BaseBoxShapeTool/children/Pointing.ts +4 -0
- package/src/lib/editor/tools/StateNode.ts +0 -2
- package/src/lib/editor/types/event-types.ts +2 -6
- package/src/lib/hooks/usePresence.ts +2 -2
- package/src/version.ts +3 -3
- package/dist-cjs/lib/editor/overlays/ShapeIndicatorOverlayUtil.js +0 -161
- package/dist-cjs/lib/editor/overlays/ShapeIndicatorOverlayUtil.js.map +0 -7
- package/dist-esm/lib/editor/overlays/ShapeIndicatorOverlayUtil.mjs +0 -141
- package/dist-esm/lib/editor/overlays/ShapeIndicatorOverlayUtil.mjs.map +0 -7
- package/src/lib/editor/overlays/ShapeIndicatorOverlayUtil.ts +0 -216
package/README.md
CHANGED
|
@@ -4,6 +4,12 @@ The core editor and composable parts for tldraw. [Click here](https://tldraw.dev
|
|
|
4
4
|
|
|
5
5
|
You might be more interested in the general package [tldraw](https://github.com/tldraw/tldraw/tree/main/packages/tldraw) instead of using this package directly.
|
|
6
6
|
|
|
7
|
+
## Documentation
|
|
8
|
+
|
|
9
|
+
Documentation for the most recent release can be found on [tldraw.dev/docs](https://tldraw.dev/docs), including [reference docs](https://tldraw.dev/reference/editor/Editor). Our release notes can be found [here](https://tldraw.dev/releases).
|
|
10
|
+
|
|
11
|
+
For more agent-friendly docs, see our [LLMs.txt](https://tldraw.dev/llms.txt).
|
|
12
|
+
|
|
7
13
|
## License
|
|
8
14
|
|
|
9
15
|
This project is part of the tldraw SDK. It is provided under the [tldraw SDK license](https://github.com/tldraw/tldraw/blob/main/LICENSE.md).
|
|
@@ -20,7 +26,7 @@ You can find tldraw on npm [here](https://www.npmjs.com/package/@tldraw/tldraw?a
|
|
|
20
26
|
|
|
21
27
|
## Contribution
|
|
22
28
|
|
|
23
|
-
|
|
29
|
+
Found a bug? Please [submit an issue](https://github.com/tldraw/tldraw/issues/new).
|
|
24
30
|
|
|
25
31
|
## Community
|
|
26
32
|
|
package/dist-cjs/index.d.ts
CHANGED
|
@@ -89,6 +89,7 @@ import { TLUnknownAsset } from '@tldraw/tlschema';
|
|
|
89
89
|
import { TLUnknownBinding } from '@tldraw/tlschema';
|
|
90
90
|
import { TLUnknownShape } from '@tldraw/tlschema';
|
|
91
91
|
import { TLUser } from '@tldraw/tlschema';
|
|
92
|
+
import { TLUserId } from '@tldraw/tlschema';
|
|
92
93
|
import { TLUserStore } from '@tldraw/tlschema';
|
|
93
94
|
import { TLVideoAsset } from '@tldraw/tlschema';
|
|
94
95
|
import { UnknownRecord } from '@tldraw/store';
|
|
@@ -746,6 +747,7 @@ export declare class ClickManager {
|
|
|
746
747
|
private _clickTimeout?;
|
|
747
748
|
private _clickScreenPoint?;
|
|
748
749
|
private _previousScreenPoint?;
|
|
750
|
+
private _isPressingWhilePending;
|
|
749
751
|
_getClickTimeout(state: TLClickState, id?: string): void;
|
|
750
752
|
/* Excluded from this release type: _clickState */
|
|
751
753
|
/**
|
|
@@ -2455,7 +2457,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2455
2457
|
* @param opts - The camera move options.
|
|
2456
2458
|
* @public
|
|
2457
2459
|
*/
|
|
2458
|
-
zoomToUser(userId:
|
|
2460
|
+
zoomToUser(userId: TLUserId, opts?: TLCameraMoveOptions): this;
|
|
2459
2461
|
/* Excluded from this release type: _willSetInitialBounds */
|
|
2460
2462
|
/**
|
|
2461
2463
|
* Update the viewport. The viewport will measure the size and screen position of its container
|
|
@@ -2608,7 +2610,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
2608
2610
|
*
|
|
2609
2611
|
* @public
|
|
2610
2612
|
*/
|
|
2611
|
-
startFollowingUser(userId:
|
|
2613
|
+
startFollowingUser(userId: TLUserId): this;
|
|
2612
2614
|
/**
|
|
2613
2615
|
* Stop viewport-following a user.
|
|
2614
2616
|
*
|
|
@@ -3719,6 +3721,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3719
3721
|
* @public
|
|
3720
3722
|
*/
|
|
3721
3723
|
resizeShape(shape: TLShape | TLShapeId, scale: VecLike, opts?: TLResizeShapeOptions): this;
|
|
3724
|
+
/* Excluded from this release type: getResizeShapePartial */
|
|
3722
3725
|
/* Excluded from this release type: _scalePagePoint */
|
|
3723
3726
|
/* Excluded from this release type: _resizeUnalignedShape */
|
|
3724
3727
|
/**
|
|
@@ -6029,6 +6032,19 @@ export declare function resizeScaled(shape: TLBaseShape<any, {
|
|
|
6029
6032
|
y: number;
|
|
6030
6033
|
};
|
|
6031
6034
|
|
|
6035
|
+
/**
|
|
6036
|
+
* The whole-pixel line-height for a given font size and tldraw's unitless line-height
|
|
6037
|
+
* multiplier. tldraw's theme stores line-height as a multiplier (e.g. 1.35); resolving it
|
|
6038
|
+
* to a whole pixel keeps line spacing identical across rendering engines, which otherwise
|
|
6039
|
+
* disagree on fractional line boxes (WebKit snaps them to whole pixels, Blink keeps the
|
|
6040
|
+
* fraction) and let multi-line text drift apart. Apply it everywhere line-height is used —
|
|
6041
|
+
* measurement, on-canvas render, and export — so geometry and rendering agree.
|
|
6042
|
+
* See https://github.com/tldraw/tldraw/issues/8970.
|
|
6043
|
+
*
|
|
6044
|
+
* @public
|
|
6045
|
+
*/
|
|
6046
|
+
export declare function resolveLineHeightPx(fontSize: number, lineHeight: number): number;
|
|
6047
|
+
|
|
6032
6048
|
/**
|
|
6033
6049
|
* Resolve a partial set of user-provided themes into a complete `TLThemes`
|
|
6034
6050
|
* record by merging with `DEFAULT_THEME`. The result is suitable for passing to
|
|
@@ -6266,32 +6282,6 @@ export declare function setRuntimeOverrides(input: Partial<typeof runtime>): voi
|
|
|
6266
6282
|
/** @public */
|
|
6267
6283
|
export declare function setUserPreferences(user: TLUserPreferences): void;
|
|
6268
6284
|
|
|
6269
|
-
/**
|
|
6270
|
-
* Overlay util for shape indicators — the selection / hover / hint outlines drawn
|
|
6271
|
-
* under the selection foreground. Paints local indicators in the theme's
|
|
6272
|
-
* selection color.
|
|
6273
|
-
*
|
|
6274
|
-
* Remote collaborator selection indicators are drawn by a separate overlay util
|
|
6275
|
-
* (e.g. `CollaboratorShapeIndicatorOverlayUtil` from `tldraw`) that runs at a
|
|
6276
|
-
* lower z-index so peer selections appear under the local indicators.
|
|
6277
|
-
*
|
|
6278
|
-
* Non-interactive: contributes no hit-test geometry.
|
|
6279
|
-
*
|
|
6280
|
-
* @public
|
|
6281
|
-
*/
|
|
6282
|
-
export declare class ShapeIndicatorOverlayUtil extends OverlayUtil<TLShapeIndicatorOverlay> {
|
|
6283
|
-
static type: string;
|
|
6284
|
-
options: {
|
|
6285
|
-
hintedLineWidth: number;
|
|
6286
|
-
lineWidth: number;
|
|
6287
|
-
zIndex: number;
|
|
6288
|
-
};
|
|
6289
|
-
private _instanceFlags$;
|
|
6290
|
-
isActive(): boolean;
|
|
6291
|
-
getOverlays(): TLShapeIndicatorOverlay[];
|
|
6292
|
-
render(ctx: CanvasRenderingContext2D, overlays: TLShapeIndicatorOverlay[]): void;
|
|
6293
|
-
}
|
|
6294
|
-
|
|
6295
6285
|
/** @public */
|
|
6296
6286
|
export declare abstract class ShapeUtil<Shape extends TLShape = TLShape> {
|
|
6297
6287
|
editor: Editor;
|
|
@@ -7166,8 +7156,6 @@ export declare abstract class StateNode implements Partial<TLEventHandlers> {
|
|
|
7166
7156
|
onLongPress?(info: TLPointerEventInfo): void;
|
|
7167
7157
|
onPointerUp?(info: TLPointerEventInfo): void;
|
|
7168
7158
|
onDoubleClick?(info: TLClickEventInfo): void;
|
|
7169
|
-
onTripleClick?(info: TLClickEventInfo): void;
|
|
7170
|
-
onQuadrupleClick?(info: TLClickEventInfo): void;
|
|
7171
7159
|
onRightClick?(info: TLPointerEventInfo): void;
|
|
7172
7160
|
onMiddleClick?(info: TLPointerEventInfo): void;
|
|
7173
7161
|
onKeyDown?(info: TLKeyboardEventInfo): void;
|
|
@@ -7199,8 +7187,8 @@ export declare function stopEventPropagation(e: any): any;
|
|
|
7199
7187
|
* arrows with labels or complex arrowheads) can't be batched — they still
|
|
7200
7188
|
* stroke individually inside a save/restore with `ctx.clip` applied.
|
|
7201
7189
|
*
|
|
7202
|
-
* Shared by
|
|
7203
|
-
*
|
|
7190
|
+
* Shared by any overlay util that paints shape indicators (e.g. collaborator
|
|
7191
|
+
* selections).
|
|
7204
7192
|
*
|
|
7205
7193
|
* @public
|
|
7206
7194
|
*/
|
|
@@ -7567,17 +7555,17 @@ export declare type TLClickEvent = (info: TLClickEventInfo) => void;
|
|
|
7567
7555
|
export declare type TLClickEventInfo = TLBaseEventInfo & {
|
|
7568
7556
|
button: number;
|
|
7569
7557
|
name: TLCLickEventName;
|
|
7570
|
-
phase: 'down' | 'settle' | 'up';
|
|
7558
|
+
phase: 'down' | 'settle-down' | 'settle-up' | 'up';
|
|
7571
7559
|
point: VecLike;
|
|
7572
7560
|
pointerId: number;
|
|
7573
7561
|
type: 'click';
|
|
7574
7562
|
} & TLPointerEventTarget;
|
|
7575
7563
|
|
|
7576
7564
|
/** @public */
|
|
7577
|
-
export declare type TLCLickEventName = 'double_click'
|
|
7565
|
+
export declare type TLCLickEventName = 'double_click';
|
|
7578
7566
|
|
|
7579
7567
|
/** @public */
|
|
7580
|
-
export declare type TLClickState = 'idle' | 'overflow' | 'pendingDouble' | 'pendingOverflow'
|
|
7568
|
+
export declare type TLClickState = 'idle' | 'overflow' | 'pendingDouble' | 'pendingOverflow';
|
|
7581
7569
|
|
|
7582
7570
|
/**
|
|
7583
7571
|
* Raw clipboard paste payload, before tldraw parses clipboard contents into {@link TLExternalContent}.
|
|
@@ -8357,8 +8345,6 @@ export declare interface TLEventHandlers {
|
|
|
8357
8345
|
onLongPress: TLPointerEvent;
|
|
8358
8346
|
onRightClick: TLPointerEvent;
|
|
8359
8347
|
onDoubleClick: TLClickEvent;
|
|
8360
|
-
onTripleClick: TLClickEvent;
|
|
8361
|
-
onQuadrupleClick: TLClickEvent;
|
|
8362
8348
|
onMiddleClick: TLPointerEvent;
|
|
8363
8349
|
onPointerUp: TLPointerEvent;
|
|
8364
8350
|
onKeyDown: TLKeyboardEvent;
|
|
@@ -9165,14 +9151,6 @@ export declare type TLShapeErrorFallbackComponent = ComponentType<{
|
|
|
9165
9151
|
error: any;
|
|
9166
9152
|
}>;
|
|
9167
9153
|
|
|
9168
|
-
/** @public */
|
|
9169
|
-
export declare interface TLShapeIndicatorOverlay extends TLOverlay {
|
|
9170
|
-
props: {
|
|
9171
|
-
hintingShapeIds: TLShapeId[];
|
|
9172
|
-
idsToDisplay: TLShapeId[];
|
|
9173
|
-
};
|
|
9174
|
-
}
|
|
9175
|
-
|
|
9176
9154
|
/**
|
|
9177
9155
|
* Emitted when shapes are created, updated, or deleted.
|
|
9178
9156
|
* @public
|
|
@@ -9654,13 +9632,13 @@ export declare function usePassThroughWheelEvents(ref: RefObject<HTMLElement | n
|
|
|
9654
9632
|
* @returns The list of peer UserIDs
|
|
9655
9633
|
* @public
|
|
9656
9634
|
*/
|
|
9657
|
-
export declare function usePeerIds():
|
|
9635
|
+
export declare function usePeerIds(): TLUserId[];
|
|
9658
9636
|
|
|
9659
9637
|
/**
|
|
9660
9638
|
* @returns The latest presence of the user matching userId
|
|
9661
9639
|
* @public
|
|
9662
9640
|
*/
|
|
9663
|
-
export declare function usePresence(userId:
|
|
9641
|
+
export declare function usePresence(userId: TLUserId): null | TLInstancePresence;
|
|
9664
9642
|
|
|
9665
9643
|
/* Excluded from this release type: USER_COLORS */
|
|
9666
9644
|
|
|
@@ -9700,7 +9678,25 @@ export declare class UserPreferencesManager {
|
|
|
9700
9678
|
getEdgeScrollSpeed(): number;
|
|
9701
9679
|
getAnimationSpeed(): number;
|
|
9702
9680
|
getAreKeyboardShortcutsEnabled(): boolean;
|
|
9681
|
+
/**
|
|
9682
|
+
* The current user's raw, app-provided id — the value set in the user's
|
|
9683
|
+
* {@link @tldraw/editor#TLUserPreferences}. Use this when you need the id your application
|
|
9684
|
+
* assigned to the user. To compare against or look up store records, use
|
|
9685
|
+
* {@link UserPreferencesManager.getRecordId} instead.
|
|
9686
|
+
*/
|
|
9687
|
+
getExternalId(): string;
|
|
9688
|
+
/**
|
|
9689
|
+
* @deprecated Use {@link UserPreferencesManager.getExternalId} for the raw app-provided id, or
|
|
9690
|
+
* {@link UserPreferencesManager.getRecordId} for the prefixed `TLUserId` record id.
|
|
9691
|
+
*/
|
|
9703
9692
|
getId(): string;
|
|
9693
|
+
/**
|
|
9694
|
+
* The current user's id as a tldraw {@link @tldraw/tlschema#TLUserId} record id (prefixed
|
|
9695
|
+
* with `user:`). Use this when comparing against or looking up store records, such as a
|
|
9696
|
+
* presence record's `userId` or `followingUserId`. For the raw, app-provided id, use
|
|
9697
|
+
* {@link UserPreferencesManager.getExternalId}.
|
|
9698
|
+
*/
|
|
9699
|
+
getRecordId(): TLUserId;
|
|
9704
9700
|
getName(): string;
|
|
9705
9701
|
getLocale(): string;
|
|
9706
9702
|
getColor(): string;
|
package/dist-cjs/index.js
CHANGED
|
@@ -88,7 +88,6 @@ __export(index_exports, {
|
|
|
88
88
|
SIN: () => import_utils2.SIN,
|
|
89
89
|
SVGContainer: () => import_SVGContainer.SVGContainer,
|
|
90
90
|
ScribbleManager: () => import_ScribbleManager.ScribbleManager,
|
|
91
|
-
ShapeIndicatorOverlayUtil: () => import_ShapeIndicatorOverlayUtil.ShapeIndicatorOverlayUtil,
|
|
92
91
|
ShapeUtil: () => import_ShapeUtil.ShapeUtil,
|
|
93
92
|
SharedStyleMap: () => import_SharedStylesMap.SharedStyleMap,
|
|
94
93
|
SnapManager: () => import_SnapManager.SnapManager,
|
|
@@ -194,6 +193,7 @@ __export(index_exports, {
|
|
|
194
193
|
releasePointerCapture: () => import_dom.releasePointerCapture,
|
|
195
194
|
resizeBox: () => import_resizeBox.resizeBox,
|
|
196
195
|
resizeScaled: () => import_resizeScaled.resizeScaled,
|
|
196
|
+
resolveLineHeightPx: () => import_TextManager.resolveLineHeightPx,
|
|
197
197
|
resolveThemes: () => import_ThemeManager.resolveThemes,
|
|
198
198
|
rotateSelectionHandle: () => import_Box.rotateSelectionHandle,
|
|
199
199
|
runtime: () => import_runtime.runtime,
|
|
@@ -204,7 +204,7 @@ __export(index_exports, {
|
|
|
204
204
|
shortAngleDist: () => import_utils2.shortAngleDist,
|
|
205
205
|
snapAngle: () => import_utils2.snapAngle,
|
|
206
206
|
stopEventPropagation: () => import_dom.stopEventPropagation,
|
|
207
|
-
strokeShapeIndicators: () =>
|
|
207
|
+
strokeShapeIndicators: () => import_strokeShapeIndicators.strokeShapeIndicators,
|
|
208
208
|
suffixSafeId: () => import_useSafeId.suffixSafeId,
|
|
209
209
|
tlenv: () => import_environment.tlenv,
|
|
210
210
|
tlenvReactive: () => import_environment.tlenvReactive,
|
|
@@ -300,7 +300,7 @@ var import_ShapeUtil = require("./lib/editor/shapes/ShapeUtil");
|
|
|
300
300
|
var import_getOverlayDisplayValues = require("./lib/editor/overlays/getOverlayDisplayValues");
|
|
301
301
|
var import_OverlayManager = require("./lib/editor/overlays/OverlayManager");
|
|
302
302
|
var import_OverlayUtil = require("./lib/editor/overlays/OverlayUtil");
|
|
303
|
-
var
|
|
303
|
+
var import_strokeShapeIndicators = require("./lib/editor/overlays/strokeShapeIndicators");
|
|
304
304
|
var import_getPerfectDashProps = require("./lib/editor/shapes/shared/getPerfectDashProps");
|
|
305
305
|
var import_resizeBox = require("./lib/editor/shapes/shared/resizeBox");
|
|
306
306
|
var import_resizeScaled = require("./lib/editor/shapes/shared/resizeScaled");
|
|
@@ -380,7 +380,7 @@ var import_uniq = require("./lib/utils/uniq");
|
|
|
380
380
|
var import_defaultThemes2 = require("./lib/editor/managers/ThemeManager/defaultThemes");
|
|
381
381
|
(0, import_utils.registerTldrawLibraryVersion)(
|
|
382
382
|
"@tldraw/editor",
|
|
383
|
-
"5.2.0-canary.
|
|
383
|
+
"5.2.0-canary.fff413eea248",
|
|
384
384
|
"cjs"
|
|
385
385
|
);
|
|
386
386
|
//# sourceMappingURL=index.js.map
|
package/dist-cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { registerTldrawLibraryVersion } from '@tldraw/utils'\n\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/state'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/state-react'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/store'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/tlschema'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/utils'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/validate'\n\nexport { DefaultBackground } from './lib/components/default-components/DefaultBackground'\nexport {\n\tDefaultCanvas,\n\ttype TLCanvasComponentProps,\n} from './lib/components/default-components/DefaultCanvas'\nexport {\n\tDefaultErrorFallback,\n\ttype TLErrorFallbackComponent,\n} from './lib/components/default-components/DefaultErrorFallback'\nexport { DefaultGrid, type TLGridProps } from './lib/components/default-components/DefaultGrid'\nexport {\n\tDefaultSelectionBackground,\n\ttype TLSelectionBackgroundProps,\n} from './lib/components/default-components/DefaultSelectionBackground'\nexport { type TLShapeErrorFallbackComponent } from './lib/components/default-components/DefaultShapeErrorFallback'\nexport {\n\tDefaultShapeWrapper,\n\ttype TLShapeWrapperProps,\n} from './lib/components/default-components/DefaultShapeWrapper'\nexport { DefaultSpinner } from './lib/components/default-components/DefaultSpinner'\nexport { DefaultSvgDefs } from './lib/components/default-components/DefaultSvgDefs'\nexport {\n\tErrorBoundary,\n\tOptionalErrorBoundary,\n\ttype TLErrorBoundaryProps,\n} from './lib/components/ErrorBoundary'\nexport { HTMLContainer, type HTMLContainerProps } from './lib/components/HTMLContainer'\nexport { MenuClickCapture } from './lib/components/MenuClickCapture'\nexport { SVGContainer, type SVGContainerProps } from './lib/components/SVGContainer'\nexport {\n\tcreateTLCurrentUser,\n\tuseTldrawCurrentUser,\n\ttype TLCurrentUser,\n} from './lib/config/createTLCurrentUser'\nexport {\n\tcreateTLSchemaFromUtils,\n\tcreateTLStore,\n\tdefaultUserStore,\n\tinlineBase64AssetStore,\n\ttype TLStoreBaseOptions,\n\ttype TLStoreEventInfo,\n\ttype TLStoreOptions,\n\ttype TLStoreSchemaOptions,\n} from './lib/config/createTLStore'\nexport { type TLAnyAssetUtilConstructor } from './lib/config/defaultAssets'\nexport { type TLAnyBindingUtilConstructor } from './lib/config/defaultBindings'\nexport { coreShapes, type TLAnyShapeUtilConstructor } from './lib/config/defaultShapes'\nexport {\n\tgetSnapshot,\n\tloadSnapshot,\n\ttype TLEditorSnapshot,\n\ttype TLLoadSnapshotOptions,\n} from './lib/config/TLEditorSnapshot'\nexport {\n\tcreateSessionStateSnapshotSignal,\n\textractSessionStateFromLegacySnapshot,\n\tloadSessionStateSnapshotIntoStore,\n\tTAB_ID,\n\ttype TLLoadSessionStateSnapshotOptions,\n\ttype TLSessionStateSnapshot,\n} from './lib/config/TLSessionStateSnapshot'\nexport {\n\tdefaultUserPreferences,\n\tgetFreshUserPreferences,\n\tgetUserPreferences,\n\tsetUserPreferences,\n\tUSER_COLORS,\n\tuserTypeValidator,\n\ttype TLUserPreferences,\n} from './lib/config/TLUserPreferences'\nexport { DEFAULT_ANIMATION_OPTIONS, DEFAULT_CAMERA_OPTIONS, SIDES } from './lib/constants'\nexport { AssetUtil, type TLAssetUtilConstructor } from './lib/editor/assets/AssetUtil'\nexport {\n\tBindingUtil,\n\ttype BindingOnChangeOptions,\n\ttype BindingOnCreateOptions,\n\ttype BindingOnDeleteOptions,\n\ttype BindingOnShapeChangeOptions,\n\ttype BindingOnShapeDeleteOptions,\n\ttype BindingOnShapeIsolateOptions,\n\ttype TLBindingUtilConstructor,\n} from './lib/editor/bindings/BindingUtil'\nexport {\n\tEditor,\n\ttype TLEditorOptions,\n\ttype TLEditorRunOptions,\n\ttype TLRenderingShape,\n\ttype TLResizeShapeOptions,\n} from './lib/editor/Editor'\nexport { ClickManager, type TLClickState } from './lib/editor/managers/ClickManager/ClickManager'\nexport { EdgeScrollManager } from './lib/editor/managers/EdgeScrollManager/EdgeScrollManager'\nexport { FontManager } from './lib/editor/managers/FontManager/FontManager'\nexport { HistoryManager } from './lib/editor/managers/HistoryManager/HistoryManager'\nexport { InputsManager } from './lib/editor/managers/InputsManager/InputsManager'\nexport {\n\tScribbleManager,\n\ttype ScribbleItem,\n\ttype ScribbleSessionOptions,\n} from './lib/editor/managers/ScribbleManager/ScribbleManager'\nexport {\n\tBoundsSnaps,\n\ttype BoundsSnapGeometry,\n\ttype BoundsSnapPoint,\n} from './lib/editor/managers/SnapManager/BoundsSnaps'\nexport { HandleSnaps, type HandleSnapGeometry } from './lib/editor/managers/SnapManager/HandleSnaps'\nexport {\n\tSnapManager,\n\ttype GapsSnapIndicator,\n\ttype PointsSnapIndicator,\n\ttype SnapData,\n\ttype SnapIndicator,\n} from './lib/editor/managers/SnapManager/SnapManager'\nexport { SpatialIndexManager } from './lib/editor/managers/SpatialIndexManager/SpatialIndexManager'\nexport {\n\tTextManager,\n\ttype BatchMeasurementRequest,\n\ttype TLMeasuredTextSize,\n\ttype TLMeasureTextOpts,\n\ttype TLMeasureTextSpanOpts,\n} from './lib/editor/managers/TextManager/TextManager'\nexport { DEFAULT_THEME } from './lib/editor/managers/ThemeManager/defaultThemes'\nexport { ThemeManager, resolveThemes } from './lib/editor/managers/ThemeManager/ThemeManager'\nexport { TickManager } from './lib/editor/managers/TickManager/TickManager'\nexport { CollaboratorsManager } from './lib/editor/managers/CollaboratorsManager/CollaboratorsManager'\nexport { PerformanceApiAdapter } from './lib/editor/managers/PerformanceManager/PerformanceApiAdapter'\nexport { PerformanceManager } from './lib/editor/managers/PerformanceManager/PerformanceManager'\nexport {\n\ttype TLCameraEndPerfEvent,\n\ttype TLCameraStartPerfEvent,\n\ttype TLFramePerfEvent,\n\ttype TLInteractionEndPerfEvent,\n\ttype TLInteractionStartPerfEvent,\n\ttype TLPerfEventMap,\n\ttype TLPerfFrameTimeStats,\n\ttype TLPerfLongAnimationFrame,\n\ttype TLPerfLongAnimationFrameScript,\n\ttype TLShapeOperationPerfEvent,\n\ttype TLUndoRedoPerfEvent,\n} from './lib/editor/managers/PerformanceManager/perf-types'\nexport { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager/UserPreferencesManager'\nexport { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'\nexport { BaseFrameLikeShapeUtil } from './lib/editor/shapes/BaseFrameLikeShapeUtil'\nexport { GroupShapeUtil } from './lib/editor/shapes/group/GroupShapeUtil'\nexport {\n\tShapeUtil,\n\ttype TLCropInfo,\n\ttype TLDragShapesInInfo,\n\ttype TLDragShapesOutInfo,\n\ttype TLDragShapesOverInfo,\n\ttype TLDropShapesOverInfo,\n\ttype TLEditStartInfo,\n\ttype TLGeometryOpts,\n\ttype TLHandleDragInfo,\n\ttype TLIndicatorPath,\n\ttype TLResizeInfo,\n\ttype TLResizeMode,\n\ttype TLShapeUtilCanBeLaidOutOpts,\n\ttype TLShapeUtilCanBindOpts,\n\ttype TLShapeUtilCanvasSvgDef,\n\ttype TLShapeUtilConstructor,\n} from './lib/editor/shapes/ShapeUtil'\nexport {\n\tgetOverlayDisplayValues,\n\ttype OverlayOptionsWithDisplayValues,\n} from './lib/editor/overlays/getOverlayDisplayValues'\nexport { OverlayManager, type TLOverlayEntry } from './lib/editor/overlays/OverlayManager'\nexport {\n\tOverlayUtil,\n\ttype TLAnyOverlayUtilConstructor,\n\ttype TLOverlay,\n\ttype TLOverlayUtilConstructor,\n} from './lib/editor/overlays/OverlayUtil'\nexport {\n\tShapeIndicatorOverlayUtil,\n\tstrokeShapeIndicators,\n\ttype TLShapeIndicatorOverlay,\n} from './lib/editor/overlays/ShapeIndicatorOverlayUtil'\nexport {\n\tgetPerfectDashProps,\n\ttype PerfectDashTerminal,\n} from './lib/editor/shapes/shared/getPerfectDashProps'\nexport { resizeBox, type ResizeBoxOptions } from './lib/editor/shapes/shared/resizeBox'\nexport { resizeScaled } from './lib/editor/shapes/shared/resizeScaled'\nexport { BaseBoxShapeTool } from './lib/editor/tools/BaseBoxShapeTool/BaseBoxShapeTool'\nexport { maybeSnapToGrid } from './lib/editor/tools/BaseBoxShapeTool/children/Pointing'\nexport { StateNode, type TLStateNodeConstructor } from './lib/editor/tools/StateNode'\nexport { type TLContent } from './lib/editor/types/clipboard-types'\nexport { type TLEventMap, type TLEventMapHandler } from './lib/editor/types/emit-types'\nexport {\n\tEVENT_NAME_MAP,\n\ttype TLBaseEventInfo,\n\ttype TLCancelEvent,\n\ttype TLCancelEventInfo,\n\ttype TLClickEvent,\n\ttype TLClickEventInfo,\n\ttype TLCLickEventName,\n\ttype TLCompleteEvent,\n\ttype TLCompleteEventInfo,\n\ttype TLEnterEventHandler,\n\ttype TLEventHandlers,\n\ttype TLEventInfo,\n\ttype TLEventName,\n\ttype TLExitEventHandler,\n\ttype TLInterruptEvent,\n\ttype TLInterruptEventInfo,\n\ttype TLKeyboardEvent,\n\ttype TLKeyboardEventInfo,\n\ttype TLKeyboardEventName,\n\ttype TLPinchEvent,\n\ttype TLPinchEventInfo,\n\ttype TLPinchEventName,\n\ttype TLPointerEvent,\n\ttype TLPointerEventInfo,\n\ttype TLPointerEventName,\n\ttype TLPointerEventTarget,\n\ttype TLTickEvent,\n\ttype TLTickEventInfo,\n\ttype TLWheelEvent,\n\ttype TLWheelEventInfo,\n\ttype UiEvent,\n\ttype UiEventType,\n} from './lib/editor/types/event-types'\nexport {\n\ttype TLBaseExternalContent,\n\ttype TLEmbedExternalContent,\n\ttype TLErrorExternalContentSource,\n\ttype TLExcalidrawExternalContent,\n\ttype TLExcalidrawExternalContentSource,\n\ttype TLExternalAsset,\n\ttype TLExternalContent,\n\ttype TLExternalContentSource,\n\ttype TLFileExternalAsset,\n\ttype TLFileReplaceExternalContent,\n\ttype TLFilesExternalContent,\n\ttype TLSvgTextExternalContent,\n\ttype TLTextExternalContent,\n\ttype TLTextExternalContentSource,\n\ttype TLTldrawExternalContent,\n\ttype TLTldrawExternalContentSource,\n\ttype TLUrlExternalAsset,\n\ttype TLUrlExternalContent,\n} from './lib/editor/types/external-content'\nexport {\n\ttype TLHistoryBatchOptions,\n\ttype TLHistoryDiff,\n\ttype TLHistoryEntry,\n\ttype TLHistoryMark,\n} from './lib/editor/types/history-types'\nexport {\n\ttype OptionalKeys,\n\ttype RequiredKeys,\n\ttype TLCameraConstraints,\n\ttype TLCameraMoveOptions,\n\ttype TLCameraOptions,\n\ttype TLExportType,\n\ttype TLGetShapeAtPointOptions,\n\ttype TLImageExportOptions,\n\ttype TLSvgExportOptions,\n\ttype TLUpdatePointerOptions,\n} from './lib/editor/types/misc-types'\nexport {\n\ttype TLAdjacentDirection,\n\ttype TLResizeHandle,\n\ttype TLSelectionHandle,\n} from './lib/editor/types/selection-types'\nexport {\n\tuseDelaySvgExport,\n\tuseSvgExportContext,\n\ttype SvgExportContext,\n\ttype SvgExportDef,\n} from './lib/editor/types/SvgExportContext'\nexport { getOwnerDocument, getOwnerWindow } from './lib/exports/domUtils'\nexport { getSvgAsImage } from './lib/exports/getSvgAsImage'\nexport { tlenv, tlenvReactive } from './lib/globals/environment'\nexport { tlmenus } from './lib/globals/menus'\nexport { tltime } from './lib/globals/time'\nexport {\n\tContainerProvider,\n\tuseContainer,\n\tuseContainerIfExists,\n\ttype ContainerProviderProps,\n} from './lib/hooks/useContainer'\nexport { useColorMode } from './lib/hooks/useColorMode'\nexport { getCursor } from './lib/hooks/useCursor'\nexport {\n\tEditorContext,\n\tEditorProvider,\n\tuseEditor,\n\tuseMaybeEditor,\n\ttype EditorProviderProps,\n} from './lib/hooks/useEditor'\nexport { useEditorComponents } from './lib/hooks/useEditorComponents'\nexport type { TLEditorComponents } from './lib/hooks/useEditorComponents'\nexport { useEvent, useReactiveEvent } from './lib/hooks/useEvent'\nexport { useGlobalMenuIsOpen } from './lib/hooks/useGlobalMenuIsOpen'\nexport { useShallowArrayIdentity, useShallowObjectIdentity } from './lib/hooks/useIdentity'\nexport { useIsCropping } from './lib/hooks/useIsCropping'\nexport { useIsEditing } from './lib/hooks/useIsEditing'\nexport { useLocalStore } from './lib/hooks/useLocalStore'\nexport { usePassThroughMouseOverEvents } from './lib/hooks/usePassThroughMouseOverEvents'\nexport { usePassThroughWheelEvents } from './lib/hooks/usePassThroughWheelEvents'\nexport { usePeerIds } from './lib/hooks/usePeerIds'\nexport { usePresence } from './lib/hooks/usePresence'\nexport { useRefState } from './lib/hooks/useRefState'\nexport {\n\tsanitizeId,\n\tsuffixSafeId,\n\tuseSharedSafeId,\n\tuseUniqueSafeId,\n\ttype SafeId,\n} from './lib/hooks/useSafeId'\nexport { useTLSchemaFromUtils, useTLStore } from './lib/hooks/useTLStore'\nexport { useTransform } from './lib/hooks/useTransform'\nexport { useViewportHeight } from './lib/hooks/useViewportHeight'\nexport {\n\tLicenseManager,\n\ttype InvalidLicenseKeyResult,\n\ttype InvalidLicenseReason,\n\ttype LicenseFromKeyResult,\n\ttype LicenseInfo,\n\ttype LicenseState,\n\ttype ValidLicenseKeyResult,\n} from './lib/license/LicenseManager'\nexport { LICENSE_TIMEOUT } from './lib/license/LicenseProvider'\nexport {\n\tdefaultTldrawOptions,\n\ttype TLClipboardPasteRawInfo,\n\ttype TLClipboardWriteInfo,\n\ttype TldrawOptions,\n} from './lib/options'\nexport {\n\tBox,\n\tROTATE_CORNER_TO_SELECTION_CORNER,\n\trotateSelectionHandle,\n\ttype BoxLike,\n\ttype RotateCorner,\n\ttype SelectionCorner,\n\ttype SelectionEdge,\n\ttype SelectionHandle,\n} from './lib/primitives/Box'\nexport { EASINGS } from './lib/primitives/easings'\nexport { Arc2d } from './lib/primitives/geometry/Arc2d'\nexport { Circle2d } from './lib/primitives/geometry/Circle2d'\nexport { CubicBezier2d } from './lib/primitives/geometry/CubicBezier2d'\nexport { CubicSpline2d } from './lib/primitives/geometry/CubicSpline2d'\nexport { Edge2d } from './lib/primitives/geometry/Edge2d'\nexport { Ellipse2d } from './lib/primitives/geometry/Ellipse2d'\nexport { getVerticesCountForArcLength } from './lib/primitives/geometry/geometry-constants'\nexport {\n\tGeometry2d,\n\tGeometry2dFilters,\n\tTransformedGeometry2d,\n\ttype Geometry2dOptions,\n\ttype TransformedGeometry2dOptions,\n} from './lib/primitives/geometry/Geometry2d'\nexport { Group2d } from './lib/primitives/geometry/Group2d'\nexport { Point2d } from './lib/primitives/geometry/Point2d'\nexport { Polygon2d } from './lib/primitives/geometry/Polygon2d'\nexport { Polyline2d } from './lib/primitives/geometry/Polyline2d'\nexport { Rectangle2d } from './lib/primitives/geometry/Rectangle2d'\nexport { Stadium2d } from './lib/primitives/geometry/Stadium2d'\nexport {\n\tintersectCircleCircle,\n\tintersectCirclePolygon,\n\tintersectCirclePolyline,\n\tintersectLineSegmentCircle,\n\tintersectLineSegmentLineSegment,\n\tintersectLineSegmentPolygon,\n\tintersectLineSegmentPolyline,\n\tintersectPolygonBounds,\n\tintersectPolygonPolygon,\n\tlinesIntersect,\n\tpolygonIntersectsPolyline,\n\tpolygonsIntersect,\n} from './lib/primitives/intersect'\nexport { Mat, type MatLike, type MatModel } from './lib/primitives/Mat'\nexport {\n\tangleDistance,\n\tapproximately,\n\tareAnglesCompatible,\n\taverage,\n\tcanonicalizeRotation,\n\tcenterOfCircleFromThreePoints,\n\tclamp,\n\tclampRadians,\n\tclockwiseAngleDist,\n\tcounterClockwiseAngleDist,\n\tdegreesToRadians,\n\tgetArcMeasure,\n\tgetPointInArcT,\n\tgetPointOnCircle,\n\tgetPointsOnArc,\n\tgetPolygonVertices,\n\tHALF_PI,\n\tisSafeFloat,\n\tperimeterOfEllipse,\n\tPI,\n\tPI2,\n\tpointInPolygon,\n\tprecise,\n\tradiansToDegrees,\n\trangeIntersection,\n\tshortAngleDist,\n\tSIN,\n\tsnapAngle,\n\ttoDomPrecision,\n\ttoFixed,\n\ttoPrecision,\n} from './lib/primitives/utils'\nexport { Vec, type VecLike } from './lib/primitives/Vec'\nexport {\n\tErrorScreen,\n\tLoadingScreen,\n\tTldrawEditor,\n\tuseOnMount,\n\ttype LoadingScreenProps,\n\ttype TldrawEditorBaseProps,\n\ttype TldrawEditorProps,\n\ttype TldrawEditorStoreProps,\n\ttype TldrawEditorWithoutStoreProps,\n\ttype TldrawEditorWithStoreProps,\n\ttype TLOnMountHandler,\n} from './lib/TldrawEditor'\nexport { dataUrlToFile, getDefaultCdnBaseUrl } from './lib/utils/assets'\nexport { clampToBrowserMaxCanvasSize, type CanvasMaxSize } from './lib/utils/browserCanvasMaxSize'\nexport {\n\tcreateDebugValue,\n\tdebugFlags,\n\tfeatureFlags,\n\ttype DebugFlag,\n\ttype DebugFlagDef,\n\ttype DebugFlagDefaults,\n} from './lib/utils/debug-flags'\nexport {\n\tcreateDeepLinkString,\n\tparseDeepLinkString,\n\ttype TLDeepLink,\n\ttype TLDeepLinkOptions,\n} from './lib/utils/deepLinks'\nexport {\n\tactiveElementShouldCaptureKeys,\n\telementShouldCaptureKeys,\n\tgetGlobalDocument,\n\tgetGlobalWindow,\n\tloopToHtmlElement,\n\tpreventDefault,\n\treleasePointerCapture,\n\tsetPointerCapture,\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\tstopEventPropagation,\n} from './lib/utils/dom'\nexport { EditorAtom } from './lib/utils/EditorAtom'\nexport { getIncrementedName } from './lib/utils/getIncrementedName'\nexport { getPointerInfo } from './lib/utils/getPointerInfo'\nexport { getSvgPathFromPoints } from './lib/utils/getSvgPathFromPoints'\nexport { isAccelKey } from './lib/utils/keyboard'\nexport { normalizeWheel } from './lib/utils/normalizeWheel'\nexport { getDroppedShapesToNewParents, kickoutOccludedShapes } from './lib/utils/reparenting'\nexport {\n\tgetFontsFromRichText,\n\ttype RichTextFontVisitor,\n\ttype RichTextFontVisitorState,\n\ttype TiptapEditor,\n\ttype TiptapNode,\n\ttype TLTextOptions,\n} from './lib/utils/richText'\nexport {\n\tapplyRotationToSnapshotShapes,\n\tgetRotationSnapshot,\n\ttype TLRotationSnapshot,\n} from './lib/utils/rotation'\nexport {\n\thardResetEditor,\n\topenWindow,\n\trefreshPage,\n\truntime,\n\tsetRuntimeOverrides,\n} from './lib/utils/runtime'\nexport {\n\tReadonlySharedStyleMap,\n\tSharedStyleMap,\n\ttype SharedStyle,\n} from './lib/utils/SharedStylesMap'\nexport { hardReset } from './lib/utils/sync/hardReset'\nexport { LocalIndexedDb, Table, type StoreName } from './lib/utils/sync/LocalIndexedDb'\nexport { type TLStoreWithStatus } from './lib/utils/sync/StoreWithStatus'\nexport { uniq } from './lib/utils/uniq'\n\nregisterTldrawLibraryVersion(\n\t(globalThis as any).TLDRAW_LIBRARY_NAME,\n\t(globalThis as any).TLDRAW_LIBRARY_VERSION,\n\t(globalThis as any).TLDRAW_LIBRARY_MODULES\n)\n\nexport { getColorValue } from './lib/editor/managers/ThemeManager/defaultThemes'\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA6C;AAG7C,0BAAc,0BAHd;AAKA,0BAAc,gCALd;AAOA,0BAAc,0BAPd;AASA,0BAAc,6BATd;AAWA,0BAAc,0BAXd;AAaA,0BAAc,6BAbd;AAeA,+BAAkC;AAClC,2BAGO;AACP,kCAGO;AACP,yBAA8C;AAC9C,wCAGO;AAEP,iCAGO;AACP,4BAA+B;AAC/B,4BAA+B;AAC/B,2BAIO;AACP,2BAAuD;AACvD,8BAAiC;AACjC,0BAAqD;AACrD,iCAIO;AACP,2BASO;AAGP,2BAA2D;AAC3D,8BAKO;AACP,oCAOO;AACP,+BAQO;AACP,uBAAyE;AACzE,uBAAuD;AACvD,yBASO;AACP,oBAMO;AACP,0BAAgD;AAChD,+BAAkC;AAClC,yBAA4B;AAC5B,4BAA+B;AAC/B,2BAA8B;AAC9B,6BAIO;AACP,yBAIO;AACP,yBAAqD;AACrD,yBAMO;AACP,iCAAoC;AACpC,
|
|
4
|
+
"sourcesContent": ["import { registerTldrawLibraryVersion } from '@tldraw/utils'\n\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/state'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/state-react'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/store'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/tlschema'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/utils'\n// eslint-disable-next-line tldraw/no-export-star\nexport * from '@tldraw/validate'\n\nexport { DefaultBackground } from './lib/components/default-components/DefaultBackground'\nexport {\n\tDefaultCanvas,\n\ttype TLCanvasComponentProps,\n} from './lib/components/default-components/DefaultCanvas'\nexport {\n\tDefaultErrorFallback,\n\ttype TLErrorFallbackComponent,\n} from './lib/components/default-components/DefaultErrorFallback'\nexport { DefaultGrid, type TLGridProps } from './lib/components/default-components/DefaultGrid'\nexport {\n\tDefaultSelectionBackground,\n\ttype TLSelectionBackgroundProps,\n} from './lib/components/default-components/DefaultSelectionBackground'\nexport { type TLShapeErrorFallbackComponent } from './lib/components/default-components/DefaultShapeErrorFallback'\nexport {\n\tDefaultShapeWrapper,\n\ttype TLShapeWrapperProps,\n} from './lib/components/default-components/DefaultShapeWrapper'\nexport { DefaultSpinner } from './lib/components/default-components/DefaultSpinner'\nexport { DefaultSvgDefs } from './lib/components/default-components/DefaultSvgDefs'\nexport {\n\tErrorBoundary,\n\tOptionalErrorBoundary,\n\ttype TLErrorBoundaryProps,\n} from './lib/components/ErrorBoundary'\nexport { HTMLContainer, type HTMLContainerProps } from './lib/components/HTMLContainer'\nexport { MenuClickCapture } from './lib/components/MenuClickCapture'\nexport { SVGContainer, type SVGContainerProps } from './lib/components/SVGContainer'\nexport {\n\tcreateTLCurrentUser,\n\tuseTldrawCurrentUser,\n\ttype TLCurrentUser,\n} from './lib/config/createTLCurrentUser'\nexport {\n\tcreateTLSchemaFromUtils,\n\tcreateTLStore,\n\tdefaultUserStore,\n\tinlineBase64AssetStore,\n\ttype TLStoreBaseOptions,\n\ttype TLStoreEventInfo,\n\ttype TLStoreOptions,\n\ttype TLStoreSchemaOptions,\n} from './lib/config/createTLStore'\nexport { type TLAnyAssetUtilConstructor } from './lib/config/defaultAssets'\nexport { type TLAnyBindingUtilConstructor } from './lib/config/defaultBindings'\nexport { coreShapes, type TLAnyShapeUtilConstructor } from './lib/config/defaultShapes'\nexport {\n\tgetSnapshot,\n\tloadSnapshot,\n\ttype TLEditorSnapshot,\n\ttype TLLoadSnapshotOptions,\n} from './lib/config/TLEditorSnapshot'\nexport {\n\tcreateSessionStateSnapshotSignal,\n\textractSessionStateFromLegacySnapshot,\n\tloadSessionStateSnapshotIntoStore,\n\tTAB_ID,\n\ttype TLLoadSessionStateSnapshotOptions,\n\ttype TLSessionStateSnapshot,\n} from './lib/config/TLSessionStateSnapshot'\nexport {\n\tdefaultUserPreferences,\n\tgetFreshUserPreferences,\n\tgetUserPreferences,\n\tsetUserPreferences,\n\tUSER_COLORS,\n\tuserTypeValidator,\n\ttype TLUserPreferences,\n} from './lib/config/TLUserPreferences'\nexport { DEFAULT_ANIMATION_OPTIONS, DEFAULT_CAMERA_OPTIONS, SIDES } from './lib/constants'\nexport { AssetUtil, type TLAssetUtilConstructor } from './lib/editor/assets/AssetUtil'\nexport {\n\tBindingUtil,\n\ttype BindingOnChangeOptions,\n\ttype BindingOnCreateOptions,\n\ttype BindingOnDeleteOptions,\n\ttype BindingOnShapeChangeOptions,\n\ttype BindingOnShapeDeleteOptions,\n\ttype BindingOnShapeIsolateOptions,\n\ttype TLBindingUtilConstructor,\n} from './lib/editor/bindings/BindingUtil'\nexport {\n\tEditor,\n\ttype TLEditorOptions,\n\ttype TLEditorRunOptions,\n\ttype TLRenderingShape,\n\ttype TLResizeShapeOptions,\n} from './lib/editor/Editor'\nexport { ClickManager, type TLClickState } from './lib/editor/managers/ClickManager/ClickManager'\nexport { EdgeScrollManager } from './lib/editor/managers/EdgeScrollManager/EdgeScrollManager'\nexport { FontManager } from './lib/editor/managers/FontManager/FontManager'\nexport { HistoryManager } from './lib/editor/managers/HistoryManager/HistoryManager'\nexport { InputsManager } from './lib/editor/managers/InputsManager/InputsManager'\nexport {\n\tScribbleManager,\n\ttype ScribbleItem,\n\ttype ScribbleSessionOptions,\n} from './lib/editor/managers/ScribbleManager/ScribbleManager'\nexport {\n\tBoundsSnaps,\n\ttype BoundsSnapGeometry,\n\ttype BoundsSnapPoint,\n} from './lib/editor/managers/SnapManager/BoundsSnaps'\nexport { HandleSnaps, type HandleSnapGeometry } from './lib/editor/managers/SnapManager/HandleSnaps'\nexport {\n\tSnapManager,\n\ttype GapsSnapIndicator,\n\ttype PointsSnapIndicator,\n\ttype SnapData,\n\ttype SnapIndicator,\n} from './lib/editor/managers/SnapManager/SnapManager'\nexport { SpatialIndexManager } from './lib/editor/managers/SpatialIndexManager/SpatialIndexManager'\nexport {\n\tTextManager,\n\tresolveLineHeightPx,\n\ttype BatchMeasurementRequest,\n\ttype TLMeasuredTextSize,\n\ttype TLMeasureTextOpts,\n\ttype TLMeasureTextSpanOpts,\n} from './lib/editor/managers/TextManager/TextManager'\nexport { DEFAULT_THEME } from './lib/editor/managers/ThemeManager/defaultThemes'\nexport { ThemeManager, resolveThemes } from './lib/editor/managers/ThemeManager/ThemeManager'\nexport { TickManager } from './lib/editor/managers/TickManager/TickManager'\nexport { CollaboratorsManager } from './lib/editor/managers/CollaboratorsManager/CollaboratorsManager'\nexport { PerformanceApiAdapter } from './lib/editor/managers/PerformanceManager/PerformanceApiAdapter'\nexport { PerformanceManager } from './lib/editor/managers/PerformanceManager/PerformanceManager'\nexport {\n\ttype TLCameraEndPerfEvent,\n\ttype TLCameraStartPerfEvent,\n\ttype TLFramePerfEvent,\n\ttype TLInteractionEndPerfEvent,\n\ttype TLInteractionStartPerfEvent,\n\ttype TLPerfEventMap,\n\ttype TLPerfFrameTimeStats,\n\ttype TLPerfLongAnimationFrame,\n\ttype TLPerfLongAnimationFrameScript,\n\ttype TLShapeOperationPerfEvent,\n\ttype TLUndoRedoPerfEvent,\n} from './lib/editor/managers/PerformanceManager/perf-types'\nexport { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager/UserPreferencesManager'\nexport { BaseBoxShapeUtil, type TLBaseBoxShape } from './lib/editor/shapes/BaseBoxShapeUtil'\nexport { BaseFrameLikeShapeUtil } from './lib/editor/shapes/BaseFrameLikeShapeUtil'\nexport { GroupShapeUtil } from './lib/editor/shapes/group/GroupShapeUtil'\nexport {\n\tShapeUtil,\n\ttype TLCropInfo,\n\ttype TLDragShapesInInfo,\n\ttype TLDragShapesOutInfo,\n\ttype TLDragShapesOverInfo,\n\ttype TLDropShapesOverInfo,\n\ttype TLEditStartInfo,\n\ttype TLGeometryOpts,\n\ttype TLHandleDragInfo,\n\ttype TLIndicatorPath,\n\ttype TLResizeInfo,\n\ttype TLResizeMode,\n\ttype TLShapeUtilCanBeLaidOutOpts,\n\ttype TLShapeUtilCanBindOpts,\n\ttype TLShapeUtilCanvasSvgDef,\n\ttype TLShapeUtilConstructor,\n} from './lib/editor/shapes/ShapeUtil'\nexport {\n\tgetOverlayDisplayValues,\n\ttype OverlayOptionsWithDisplayValues,\n} from './lib/editor/overlays/getOverlayDisplayValues'\nexport { OverlayManager, type TLOverlayEntry } from './lib/editor/overlays/OverlayManager'\nexport {\n\tOverlayUtil,\n\ttype TLAnyOverlayUtilConstructor,\n\ttype TLOverlay,\n\ttype TLOverlayUtilConstructor,\n} from './lib/editor/overlays/OverlayUtil'\nexport { strokeShapeIndicators } from './lib/editor/overlays/strokeShapeIndicators'\nexport {\n\tgetPerfectDashProps,\n\ttype PerfectDashTerminal,\n} from './lib/editor/shapes/shared/getPerfectDashProps'\nexport { resizeBox, type ResizeBoxOptions } from './lib/editor/shapes/shared/resizeBox'\nexport { resizeScaled } from './lib/editor/shapes/shared/resizeScaled'\nexport { BaseBoxShapeTool } from './lib/editor/tools/BaseBoxShapeTool/BaseBoxShapeTool'\nexport { maybeSnapToGrid } from './lib/editor/tools/BaseBoxShapeTool/children/Pointing'\nexport { StateNode, type TLStateNodeConstructor } from './lib/editor/tools/StateNode'\nexport { type TLContent } from './lib/editor/types/clipboard-types'\nexport { type TLEventMap, type TLEventMapHandler } from './lib/editor/types/emit-types'\nexport {\n\tEVENT_NAME_MAP,\n\ttype TLBaseEventInfo,\n\ttype TLCancelEvent,\n\ttype TLCancelEventInfo,\n\ttype TLClickEvent,\n\ttype TLClickEventInfo,\n\ttype TLCLickEventName,\n\ttype TLCompleteEvent,\n\ttype TLCompleteEventInfo,\n\ttype TLEnterEventHandler,\n\ttype TLEventHandlers,\n\ttype TLEventInfo,\n\ttype TLEventName,\n\ttype TLExitEventHandler,\n\ttype TLInterruptEvent,\n\ttype TLInterruptEventInfo,\n\ttype TLKeyboardEvent,\n\ttype TLKeyboardEventInfo,\n\ttype TLKeyboardEventName,\n\ttype TLPinchEvent,\n\ttype TLPinchEventInfo,\n\ttype TLPinchEventName,\n\ttype TLPointerEvent,\n\ttype TLPointerEventInfo,\n\ttype TLPointerEventName,\n\ttype TLPointerEventTarget,\n\ttype TLTickEvent,\n\ttype TLTickEventInfo,\n\ttype TLWheelEvent,\n\ttype TLWheelEventInfo,\n\ttype UiEvent,\n\ttype UiEventType,\n} from './lib/editor/types/event-types'\nexport {\n\ttype TLBaseExternalContent,\n\ttype TLEmbedExternalContent,\n\ttype TLErrorExternalContentSource,\n\ttype TLExcalidrawExternalContent,\n\ttype TLExcalidrawExternalContentSource,\n\ttype TLExternalAsset,\n\ttype TLExternalContent,\n\ttype TLExternalContentSource,\n\ttype TLFileExternalAsset,\n\ttype TLFileReplaceExternalContent,\n\ttype TLFilesExternalContent,\n\ttype TLSvgTextExternalContent,\n\ttype TLTextExternalContent,\n\ttype TLTextExternalContentSource,\n\ttype TLTldrawExternalContent,\n\ttype TLTldrawExternalContentSource,\n\ttype TLUrlExternalAsset,\n\ttype TLUrlExternalContent,\n} from './lib/editor/types/external-content'\nexport {\n\ttype TLHistoryBatchOptions,\n\ttype TLHistoryDiff,\n\ttype TLHistoryEntry,\n\ttype TLHistoryMark,\n} from './lib/editor/types/history-types'\nexport {\n\ttype OptionalKeys,\n\ttype RequiredKeys,\n\ttype TLCameraConstraints,\n\ttype TLCameraMoveOptions,\n\ttype TLCameraOptions,\n\ttype TLExportType,\n\ttype TLGetShapeAtPointOptions,\n\ttype TLImageExportOptions,\n\ttype TLSvgExportOptions,\n\ttype TLUpdatePointerOptions,\n} from './lib/editor/types/misc-types'\nexport {\n\ttype TLAdjacentDirection,\n\ttype TLResizeHandle,\n\ttype TLSelectionHandle,\n} from './lib/editor/types/selection-types'\nexport {\n\tuseDelaySvgExport,\n\tuseSvgExportContext,\n\ttype SvgExportContext,\n\ttype SvgExportDef,\n} from './lib/editor/types/SvgExportContext'\nexport { getOwnerDocument, getOwnerWindow } from './lib/exports/domUtils'\nexport { getSvgAsImage } from './lib/exports/getSvgAsImage'\nexport { tlenv, tlenvReactive } from './lib/globals/environment'\nexport { tlmenus } from './lib/globals/menus'\nexport { tltime } from './lib/globals/time'\nexport {\n\tContainerProvider,\n\tuseContainer,\n\tuseContainerIfExists,\n\ttype ContainerProviderProps,\n} from './lib/hooks/useContainer'\nexport { useColorMode } from './lib/hooks/useColorMode'\nexport { getCursor } from './lib/hooks/useCursor'\nexport {\n\tEditorContext,\n\tEditorProvider,\n\tuseEditor,\n\tuseMaybeEditor,\n\ttype EditorProviderProps,\n} from './lib/hooks/useEditor'\nexport { useEditorComponents } from './lib/hooks/useEditorComponents'\nexport type { TLEditorComponents } from './lib/hooks/useEditorComponents'\nexport { useEvent, useReactiveEvent } from './lib/hooks/useEvent'\nexport { useGlobalMenuIsOpen } from './lib/hooks/useGlobalMenuIsOpen'\nexport { useShallowArrayIdentity, useShallowObjectIdentity } from './lib/hooks/useIdentity'\nexport { useIsCropping } from './lib/hooks/useIsCropping'\nexport { useIsEditing } from './lib/hooks/useIsEditing'\nexport { useLocalStore } from './lib/hooks/useLocalStore'\nexport { usePassThroughMouseOverEvents } from './lib/hooks/usePassThroughMouseOverEvents'\nexport { usePassThroughWheelEvents } from './lib/hooks/usePassThroughWheelEvents'\nexport { usePeerIds } from './lib/hooks/usePeerIds'\nexport { usePresence } from './lib/hooks/usePresence'\nexport { useRefState } from './lib/hooks/useRefState'\nexport {\n\tsanitizeId,\n\tsuffixSafeId,\n\tuseSharedSafeId,\n\tuseUniqueSafeId,\n\ttype SafeId,\n} from './lib/hooks/useSafeId'\nexport { useTLSchemaFromUtils, useTLStore } from './lib/hooks/useTLStore'\nexport { useTransform } from './lib/hooks/useTransform'\nexport { useViewportHeight } from './lib/hooks/useViewportHeight'\nexport {\n\tLicenseManager,\n\ttype InvalidLicenseKeyResult,\n\ttype InvalidLicenseReason,\n\ttype LicenseFromKeyResult,\n\ttype LicenseInfo,\n\ttype LicenseState,\n\ttype ValidLicenseKeyResult,\n} from './lib/license/LicenseManager'\nexport { LICENSE_TIMEOUT } from './lib/license/LicenseProvider'\nexport {\n\tdefaultTldrawOptions,\n\ttype TLClipboardPasteRawInfo,\n\ttype TLClipboardWriteInfo,\n\ttype TldrawOptions,\n} from './lib/options'\nexport {\n\tBox,\n\tROTATE_CORNER_TO_SELECTION_CORNER,\n\trotateSelectionHandle,\n\ttype BoxLike,\n\ttype RotateCorner,\n\ttype SelectionCorner,\n\ttype SelectionEdge,\n\ttype SelectionHandle,\n} from './lib/primitives/Box'\nexport { EASINGS } from './lib/primitives/easings'\nexport { Arc2d } from './lib/primitives/geometry/Arc2d'\nexport { Circle2d } from './lib/primitives/geometry/Circle2d'\nexport { CubicBezier2d } from './lib/primitives/geometry/CubicBezier2d'\nexport { CubicSpline2d } from './lib/primitives/geometry/CubicSpline2d'\nexport { Edge2d } from './lib/primitives/geometry/Edge2d'\nexport { Ellipse2d } from './lib/primitives/geometry/Ellipse2d'\nexport { getVerticesCountForArcLength } from './lib/primitives/geometry/geometry-constants'\nexport {\n\tGeometry2d,\n\tGeometry2dFilters,\n\tTransformedGeometry2d,\n\ttype Geometry2dOptions,\n\ttype TransformedGeometry2dOptions,\n} from './lib/primitives/geometry/Geometry2d'\nexport { Group2d } from './lib/primitives/geometry/Group2d'\nexport { Point2d } from './lib/primitives/geometry/Point2d'\nexport { Polygon2d } from './lib/primitives/geometry/Polygon2d'\nexport { Polyline2d } from './lib/primitives/geometry/Polyline2d'\nexport { Rectangle2d } from './lib/primitives/geometry/Rectangle2d'\nexport { Stadium2d } from './lib/primitives/geometry/Stadium2d'\nexport {\n\tintersectCircleCircle,\n\tintersectCirclePolygon,\n\tintersectCirclePolyline,\n\tintersectLineSegmentCircle,\n\tintersectLineSegmentLineSegment,\n\tintersectLineSegmentPolygon,\n\tintersectLineSegmentPolyline,\n\tintersectPolygonBounds,\n\tintersectPolygonPolygon,\n\tlinesIntersect,\n\tpolygonIntersectsPolyline,\n\tpolygonsIntersect,\n} from './lib/primitives/intersect'\nexport { Mat, type MatLike, type MatModel } from './lib/primitives/Mat'\nexport {\n\tangleDistance,\n\tapproximately,\n\tareAnglesCompatible,\n\taverage,\n\tcanonicalizeRotation,\n\tcenterOfCircleFromThreePoints,\n\tclamp,\n\tclampRadians,\n\tclockwiseAngleDist,\n\tcounterClockwiseAngleDist,\n\tdegreesToRadians,\n\tgetArcMeasure,\n\tgetPointInArcT,\n\tgetPointOnCircle,\n\tgetPointsOnArc,\n\tgetPolygonVertices,\n\tHALF_PI,\n\tisSafeFloat,\n\tperimeterOfEllipse,\n\tPI,\n\tPI2,\n\tpointInPolygon,\n\tprecise,\n\tradiansToDegrees,\n\trangeIntersection,\n\tshortAngleDist,\n\tSIN,\n\tsnapAngle,\n\ttoDomPrecision,\n\ttoFixed,\n\ttoPrecision,\n} from './lib/primitives/utils'\nexport { Vec, type VecLike } from './lib/primitives/Vec'\nexport {\n\tErrorScreen,\n\tLoadingScreen,\n\tTldrawEditor,\n\tuseOnMount,\n\ttype LoadingScreenProps,\n\ttype TldrawEditorBaseProps,\n\ttype TldrawEditorProps,\n\ttype TldrawEditorStoreProps,\n\ttype TldrawEditorWithoutStoreProps,\n\ttype TldrawEditorWithStoreProps,\n\ttype TLOnMountHandler,\n} from './lib/TldrawEditor'\nexport { dataUrlToFile, getDefaultCdnBaseUrl } from './lib/utils/assets'\nexport { clampToBrowserMaxCanvasSize, type CanvasMaxSize } from './lib/utils/browserCanvasMaxSize'\nexport {\n\tcreateDebugValue,\n\tdebugFlags,\n\tfeatureFlags,\n\ttype DebugFlag,\n\ttype DebugFlagDef,\n\ttype DebugFlagDefaults,\n} from './lib/utils/debug-flags'\nexport {\n\tcreateDeepLinkString,\n\tparseDeepLinkString,\n\ttype TLDeepLink,\n\ttype TLDeepLinkOptions,\n} from './lib/utils/deepLinks'\nexport {\n\tactiveElementShouldCaptureKeys,\n\telementShouldCaptureKeys,\n\tgetGlobalDocument,\n\tgetGlobalWindow,\n\tloopToHtmlElement,\n\tpreventDefault,\n\treleasePointerCapture,\n\tsetPointerCapture,\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\tstopEventPropagation,\n} from './lib/utils/dom'\nexport { EditorAtom } from './lib/utils/EditorAtom'\nexport { getIncrementedName } from './lib/utils/getIncrementedName'\nexport { getPointerInfo } from './lib/utils/getPointerInfo'\nexport { getSvgPathFromPoints } from './lib/utils/getSvgPathFromPoints'\nexport { isAccelKey } from './lib/utils/keyboard'\nexport { normalizeWheel } from './lib/utils/normalizeWheel'\nexport { getDroppedShapesToNewParents, kickoutOccludedShapes } from './lib/utils/reparenting'\nexport {\n\tgetFontsFromRichText,\n\ttype RichTextFontVisitor,\n\ttype RichTextFontVisitorState,\n\ttype TiptapEditor,\n\ttype TiptapNode,\n\ttype TLTextOptions,\n} from './lib/utils/richText'\nexport {\n\tapplyRotationToSnapshotShapes,\n\tgetRotationSnapshot,\n\ttype TLRotationSnapshot,\n} from './lib/utils/rotation'\nexport {\n\thardResetEditor,\n\topenWindow,\n\trefreshPage,\n\truntime,\n\tsetRuntimeOverrides,\n} from './lib/utils/runtime'\nexport {\n\tReadonlySharedStyleMap,\n\tSharedStyleMap,\n\ttype SharedStyle,\n} from './lib/utils/SharedStylesMap'\nexport { hardReset } from './lib/utils/sync/hardReset'\nexport { LocalIndexedDb, Table, type StoreName } from './lib/utils/sync/LocalIndexedDb'\nexport { type TLStoreWithStatus } from './lib/utils/sync/StoreWithStatus'\nexport { uniq } from './lib/utils/uniq'\n\nregisterTldrawLibraryVersion(\n\t(globalThis as any).TLDRAW_LIBRARY_NAME,\n\t(globalThis as any).TLDRAW_LIBRARY_VERSION,\n\t(globalThis as any).TLDRAW_LIBRARY_MODULES\n)\n\nexport { getColorValue } from './lib/editor/managers/ThemeManager/defaultThemes'\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA6C;AAG7C,0BAAc,0BAHd;AAKA,0BAAc,gCALd;AAOA,0BAAc,0BAPd;AASA,0BAAc,6BATd;AAWA,0BAAc,0BAXd;AAaA,0BAAc,6BAbd;AAeA,+BAAkC;AAClC,2BAGO;AACP,kCAGO;AACP,yBAA8C;AAC9C,wCAGO;AAEP,iCAGO;AACP,4BAA+B;AAC/B,4BAA+B;AAC/B,2BAIO;AACP,2BAAuD;AACvD,8BAAiC;AACjC,0BAAqD;AACrD,iCAIO;AACP,2BASO;AAGP,2BAA2D;AAC3D,8BAKO;AACP,oCAOO;AACP,+BAQO;AACP,uBAAyE;AACzE,uBAAuD;AACvD,yBASO;AACP,oBAMO;AACP,0BAAgD;AAChD,+BAAkC;AAClC,yBAA4B;AAC5B,4BAA+B;AAC/B,2BAA8B;AAC9B,6BAIO;AACP,yBAIO;AACP,yBAAqD;AACrD,yBAMO;AACP,iCAAoC;AACpC,yBAOO;AACP,2BAA8B;AAC9B,0BAA4C;AAC5C,yBAA4B;AAC5B,kCAAqC;AACrC,mCAAsC;AACtC,gCAAmC;AAcnC,oCAAuC;AACvC,8BAAsD;AACtD,oCAAuC;AACvC,4BAA+B;AAC/B,uBAiBO;AACP,qCAGO;AACP,4BAAoD;AACpD,yBAKO;AACP,mCAAsC;AACtC,iCAGO;AACP,uBAAiD;AACjD,0BAA6B;AAC7B,8BAAiC;AACjC,sBAAgC;AAChC,uBAAuD;AAGvD,yBAiCO;AA4CP,8BAKO;AACP,sBAAiD;AACjD,2BAA8B;AAC9B,yBAAqC;AACrC,mBAAwB;AACxB,kBAAuB;AACvB,0BAKO;AACP,0BAA6B;AAC7B,uBAA0B;AAC1B,uBAMO;AACP,iCAAoC;AAEpC,sBAA2C;AAC3C,iCAAoC;AACpC,yBAAkE;AAClE,2BAA8B;AAC9B,0BAA6B;AAC7B,2BAA8B;AAC9B,2CAA8C;AAC9C,uCAA0C;AAC1C,wBAA2B;AAC3B,yBAA4B;AAC5B,yBAA4B;AAC5B,uBAMO;AACP,wBAAiD;AACjD,0BAA6B;AAC7B,+BAAkC;AAClC,4BAQO;AACP,6BAAgC;AAChC,qBAKO;AACP,iBASO;AACP,qBAAwB;AACxB,mBAAsB;AACtB,sBAAyB;AACzB,2BAA8B;AAC9B,2BAA8B;AAC9B,oBAAuB;AACvB,uBAA0B;AAC1B,gCAA6C;AAC7C,wBAMO;AACP,qBAAwB;AACxB,qBAAwB;AACxB,uBAA0B;AAC1B,wBAA2B;AAC3B,yBAA4B;AAC5B,uBAA0B;AAC1B,uBAaO;AACP,iBAAiD;AACjD,IAAAA,gBAgCO;AACP,iBAAkC;AAClC,0BAYO;AACP,oBAAoD;AACpD,kCAAgE;AAChE,yBAOO;AACP,uBAKO;AACP,iBAWO;AACP,wBAA2B;AAC3B,gCAAmC;AACnC,4BAA+B;AAC/B,kCAAqC;AACrC,sBAA2B;AAC3B,4BAA+B;AAC/B,yBAAoE;AACpE,sBAOO;AACP,sBAIO;AACP,qBAMO;AACP,6BAIO;AACP,uBAA0B;AAC1B,4BAAsD;AAEtD,kBAAqB;AAQrB,IAAAC,wBAA8B;AAAA,IAN9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AACF;",
|
|
6
6
|
"names": ["import_utils", "import_defaultThemes"]
|
|
7
7
|
}
|
|
@@ -2152,7 +2152,7 @@ class Editor extends import_eventemitter3.default {
|
|
|
2152
2152
|
return baseCamera;
|
|
2153
2153
|
}
|
|
2154
2154
|
_getFollowingPresence(targetUserId) {
|
|
2155
|
-
const visited = [this.user.
|
|
2155
|
+
const visited = [this.user.getRecordId()];
|
|
2156
2156
|
const collaborators = this.getCollaborators();
|
|
2157
2157
|
let leaderPresence = null;
|
|
2158
2158
|
while (targetUserId && !visited.includes(targetUserId)) {
|
|
@@ -2340,6 +2340,11 @@ class Editor extends import_eventemitter3.default {
|
|
|
2340
2340
|
getConstrainedCamera(point, opts) {
|
|
2341
2341
|
const currentCamera = this.getCamera();
|
|
2342
2342
|
let { x, y, z = currentCamera.z } = point;
|
|
2343
|
+
const preserveFocalPoint = (current, requested, rz, z2) => {
|
|
2344
|
+
const cz = currentCamera.z;
|
|
2345
|
+
if (rz === cz) return current;
|
|
2346
|
+
return current + (requested - current) * (1 / z2 - 1 / cz) / (1 / rz - 1 / cz);
|
|
2347
|
+
};
|
|
2343
2348
|
if (!opts?.force) {
|
|
2344
2349
|
const cameraOptions = this.getCameraOptions();
|
|
2345
2350
|
const zoomMin = cameraOptions.zoomSteps[0];
|
|
@@ -2359,14 +2364,10 @@ class Editor extends import_eventemitter3.default {
|
|
|
2359
2364
|
z = this.getInitialZoom();
|
|
2360
2365
|
}
|
|
2361
2366
|
if (z < minZ || z > maxZ) {
|
|
2362
|
-
const
|
|
2363
|
-
const cxA = -cx + vsb.w / cz / 2;
|
|
2364
|
-
const cyA = -cy + vsb.h / cz / 2;
|
|
2367
|
+
const rz = z;
|
|
2365
2368
|
z = (0, import_utils2.clamp)(z, minZ, maxZ);
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
x = cx + cxB - cxA;
|
|
2369
|
-
y = cy + cyB - cyA;
|
|
2369
|
+
x = preserveFocalPoint(currentCamera.x, x, rz, z);
|
|
2370
|
+
y = preserveFocalPoint(currentCamera.y, y, rz, z);
|
|
2370
2371
|
}
|
|
2371
2372
|
const minX = px / z - bounds.x;
|
|
2372
2373
|
const minY = py / z - bounds.y;
|
|
@@ -2435,10 +2436,10 @@ class Editor extends import_eventemitter3.default {
|
|
|
2435
2436
|
}
|
|
2436
2437
|
} else {
|
|
2437
2438
|
if (z > zoomMax || z < zoomMin) {
|
|
2438
|
-
const
|
|
2439
|
+
const rz = z;
|
|
2439
2440
|
z = (0, import_utils2.clamp)(z, zoomMin, zoomMax);
|
|
2440
|
-
x =
|
|
2441
|
-
y =
|
|
2441
|
+
x = preserveFocalPoint(currentCamera.x, x, rz, z);
|
|
2442
|
+
y = preserveFocalPoint(currentCamera.y, y, rz, z);
|
|
2442
2443
|
}
|
|
2443
2444
|
}
|
|
2444
2445
|
}
|
|
@@ -2861,14 +2862,25 @@ class Editor extends import_eventemitter3.default {
|
|
|
2861
2862
|
this.off("stop-camera-animation", cancel);
|
|
2862
2863
|
};
|
|
2863
2864
|
this.once("stop-camera-animation", cancel);
|
|
2865
|
+
const dirZ = direction.z ?? 0;
|
|
2864
2866
|
const moveCamera = (elapsed) => {
|
|
2865
2867
|
const { x: cx, y: cy, z: cz } = this.getCamera();
|
|
2866
|
-
const
|
|
2868
|
+
const dx = direction.x * (currentSpeed * elapsed) / cz;
|
|
2869
|
+
const dy = direction.y * (currentSpeed * elapsed) / cz;
|
|
2870
|
+
let newCx = cx + dx;
|
|
2871
|
+
let newCy = cy + dy;
|
|
2872
|
+
let newCz = cz;
|
|
2873
|
+
if (dirZ !== 0) {
|
|
2874
|
+
newCz = cz * (1 + dirZ * currentSpeed * elapsed);
|
|
2875
|
+
const center = this.getViewportScreenCenter();
|
|
2876
|
+
newCx += center.x / newCz - center.x / cz;
|
|
2877
|
+
newCy += center.y / newCz - center.y / cz;
|
|
2878
|
+
}
|
|
2867
2879
|
currentSpeed *= 1 - friction;
|
|
2868
2880
|
if (currentSpeed < speedThreshold) {
|
|
2869
2881
|
cancel();
|
|
2870
2882
|
} else {
|
|
2871
|
-
this._setCamera(new import_Vec.Vec(
|
|
2883
|
+
this._setCamera(new import_Vec.Vec(newCx, newCy, newCz));
|
|
2872
2884
|
}
|
|
2873
2885
|
};
|
|
2874
2886
|
this.on("tick", moveCamera);
|
|
@@ -3188,7 +3200,7 @@ class Editor extends import_eventemitter3.default {
|
|
|
3188
3200
|
*/
|
|
3189
3201
|
startFollowingUser(userId) {
|
|
3190
3202
|
this.stopFollowingUser();
|
|
3191
|
-
const thisUserId = this.user.
|
|
3203
|
+
const thisUserId = this.user.getExternalId();
|
|
3192
3204
|
if (!thisUserId) {
|
|
3193
3205
|
console.warn("You should set the userId for the current instance before following a user");
|
|
3194
3206
|
}
|
|
@@ -5892,24 +5904,40 @@ class Editor extends import_eventemitter3.default {
|
|
|
5892
5904
|
* @public
|
|
5893
5905
|
*/
|
|
5894
5906
|
resizeShape(shape, scale, opts = {}) {
|
|
5907
|
+
const partial = this.getResizeShapePartial(shape, scale, opts);
|
|
5908
|
+
if (partial) this.updateShapes([partial]);
|
|
5909
|
+
return this;
|
|
5910
|
+
}
|
|
5911
|
+
/**
|
|
5912
|
+
* Get the update for a resized shape without committing it to the store. Interactions that
|
|
5913
|
+
* resize many shapes at once use this to collect all of the updates and commit them in a
|
|
5914
|
+
* single batch. Returns null when there is nothing to update.
|
|
5915
|
+
*
|
|
5916
|
+
* Shapes that are rotated out of alignment with the scale axis cannot be resized with a
|
|
5917
|
+
* single update; those shapes are resized immediately (as `resizeShape` would do) and null
|
|
5918
|
+
* is returned.
|
|
5919
|
+
*
|
|
5920
|
+
* @internal
|
|
5921
|
+
*/
|
|
5922
|
+
getResizeShapePartial(shape, scale, opts = {}) {
|
|
5895
5923
|
const id = typeof shape === "string" ? shape : shape.id;
|
|
5896
|
-
if (this.getIsReadonly()) return
|
|
5924
|
+
if (this.getIsReadonly()) return null;
|
|
5897
5925
|
if (!Number.isFinite(scale.x)) scale = new import_Vec.Vec(1, scale.y);
|
|
5898
5926
|
if (!Number.isFinite(scale.y)) scale = new import_Vec.Vec(scale.x, 1);
|
|
5899
5927
|
const initialShape = opts.initialShape ?? this.getShape(id);
|
|
5900
|
-
if (!initialShape) return
|
|
5928
|
+
if (!initialShape) return null;
|
|
5901
5929
|
const scaleOrigin = opts.scaleOrigin ?? this.getShapePageBounds(id)?.center;
|
|
5902
|
-
if (!scaleOrigin) return
|
|
5930
|
+
if (!scaleOrigin) return null;
|
|
5903
5931
|
const pageTransform = opts.initialPageTransform ? import_Mat.Mat.Cast(opts.initialPageTransform) : this.getShapePageTransform(id);
|
|
5904
|
-
if (!pageTransform) return
|
|
5932
|
+
if (!pageTransform) return null;
|
|
5905
5933
|
const pageRotation = pageTransform.rotation();
|
|
5906
|
-
if (pageRotation == null) return
|
|
5934
|
+
if (pageRotation == null) return null;
|
|
5907
5935
|
const scaleAxisRotation = opts.scaleAxisRotation ?? pageRotation;
|
|
5908
5936
|
const initialBounds = opts.initialBounds ?? this.getShapeGeometry(id).bounds;
|
|
5909
|
-
if (!initialBounds) return
|
|
5937
|
+
if (!initialBounds) return null;
|
|
5910
5938
|
const isAspectRatioLocked = opts.isAspectRatioLocked ?? this.getShapeUtil(initialShape).isAspectRatioLocked(initialShape);
|
|
5911
5939
|
if (!(0, import_utils2.areAnglesCompatible)(pageRotation, scaleAxisRotation)) {
|
|
5912
|
-
|
|
5940
|
+
this._resizeUnalignedShape(id, scale, {
|
|
5913
5941
|
...opts,
|
|
5914
5942
|
initialBounds,
|
|
5915
5943
|
scaleOrigin,
|
|
@@ -5918,6 +5946,7 @@ class Editor extends import_eventemitter3.default {
|
|
|
5918
5946
|
isAspectRatioLocked,
|
|
5919
5947
|
initialShape
|
|
5920
5948
|
});
|
|
5949
|
+
return null;
|
|
5921
5950
|
}
|
|
5922
5951
|
const util = this.getShapeUtil(initialShape);
|
|
5923
5952
|
if (isAspectRatioLocked) {
|
|
@@ -5927,7 +5956,7 @@ class Editor extends import_eventemitter3.default {
|
|
|
5927
5956
|
scale = new import_Vec.Vec(Math.sign(scale.x) * Math.abs(scale.y), scale.y);
|
|
5928
5957
|
}
|
|
5929
5958
|
}
|
|
5930
|
-
let
|
|
5959
|
+
let workingShape = null;
|
|
5931
5960
|
if (util.onResize && util.canResize(initialShape)) {
|
|
5932
5961
|
const newPagePoint = this._scalePagePoint(
|
|
5933
5962
|
import_Mat.Mat.applyToPoint(pageTransform, new import_Vec.Vec(0, 0)),
|
|
@@ -5945,7 +5974,7 @@ class Editor extends import_eventemitter3.default {
|
|
|
5945
5974
|
myScale.y = areWidthAndHeightAlignedWithCorrectAxis ? scale.y : scale.x;
|
|
5946
5975
|
const initialPagePoint = import_Mat.Mat.applyToPoint(pageTransform, new import_Vec.Vec());
|
|
5947
5976
|
const { x, y } = this.getPointInParentSpace(initialShape.id, initialPagePoint);
|
|
5948
|
-
|
|
5977
|
+
workingShape = initialShape;
|
|
5949
5978
|
if (!opts.skipStartAndEndCallbacks) {
|
|
5950
5979
|
workingShape = applyPartialToRecordWithProps(
|
|
5951
5980
|
initialShape,
|
|
@@ -5965,9 +5994,6 @@ class Editor extends import_eventemitter3.default {
|
|
|
5965
5994
|
initialShape
|
|
5966
5995
|
}
|
|
5967
5996
|
);
|
|
5968
|
-
if (resizedShape) {
|
|
5969
|
-
didResize = true;
|
|
5970
|
-
}
|
|
5971
5997
|
workingShape = applyPartialToRecordWithProps(workingShape, {
|
|
5972
5998
|
id,
|
|
5973
5999
|
type: initialShape.type,
|
|
@@ -5981,32 +6007,36 @@ class Editor extends import_eventemitter3.default {
|
|
|
5981
6007
|
util.onResizeEnd?.(initialShape, workingShape) ?? void 0
|
|
5982
6008
|
);
|
|
5983
6009
|
}
|
|
5984
|
-
|
|
6010
|
+
if (resizedShape) {
|
|
6011
|
+
return workingShape;
|
|
6012
|
+
}
|
|
5985
6013
|
}
|
|
5986
|
-
|
|
5987
|
-
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
y: initialShape.y + delta.y
|
|
6006
|
-
}
|
|
6007
|
-
]);
|
|
6014
|
+
const initialPageCenter = import_Mat.Mat.applyToPoint(pageTransform, initialBounds.center);
|
|
6015
|
+
const newPageCenter = this._scalePagePoint(
|
|
6016
|
+
initialPageCenter,
|
|
6017
|
+
scaleOrigin,
|
|
6018
|
+
scale,
|
|
6019
|
+
scaleAxisRotation
|
|
6020
|
+
);
|
|
6021
|
+
const initialPageCenterInParentSpace = this.getPointInParentSpace(
|
|
6022
|
+
initialShape.id,
|
|
6023
|
+
initialPageCenter
|
|
6024
|
+
);
|
|
6025
|
+
const newPageCenterInParentSpace = this.getPointInParentSpace(initialShape.id, newPageCenter);
|
|
6026
|
+
const delta = import_Vec.Vec.Sub(newPageCenterInParentSpace, initialPageCenterInParentSpace);
|
|
6027
|
+
if (workingShape) {
|
|
6028
|
+
return {
|
|
6029
|
+
...workingShape,
|
|
6030
|
+
x: initialShape.x + delta.x,
|
|
6031
|
+
y: initialShape.y + delta.y
|
|
6032
|
+
};
|
|
6008
6033
|
}
|
|
6009
|
-
return
|
|
6034
|
+
return {
|
|
6035
|
+
id,
|
|
6036
|
+
type: initialShape.type,
|
|
6037
|
+
x: initialShape.x + delta.x,
|
|
6038
|
+
y: initialShape.y + delta.y
|
|
6039
|
+
};
|
|
6010
6040
|
}
|
|
6011
6041
|
/** @internal */
|
|
6012
6042
|
_scalePagePoint(point, scaleOrigin, scale, scaleAxisRotation) {
|
|
@@ -8125,7 +8155,10 @@ class Editor extends import_eventemitter3.default {
|
|
|
8125
8155
|
inputs.buttons.add(info.button);
|
|
8126
8156
|
inputs.setIsPointing(true);
|
|
8127
8157
|
inputs.setIsDragging(false);
|
|
8128
|
-
if (!isPenMode && isPen)
|
|
8158
|
+
if (!isPenMode && isPen) {
|
|
8159
|
+
this.updateInstanceState({ isPenMode: true });
|
|
8160
|
+
this.interrupt();
|
|
8161
|
+
}
|
|
8129
8162
|
if (info.button === import_constants.STYLUS_ERASER_BUTTON) {
|
|
8130
8163
|
this._restoreToolId = this.getCurrentToolId();
|
|
8131
8164
|
this.complete();
|
|
@@ -8228,7 +8261,10 @@ class Editor extends import_eventemitter3.default {
|
|
|
8228
8261
|
this.setCursor({ type: this._prevCursor, rotation: 0 });
|
|
8229
8262
|
}
|
|
8230
8263
|
if (slideSpeed > 0) {
|
|
8231
|
-
this.slideCamera({
|
|
8264
|
+
this.slideCamera({
|
|
8265
|
+
speed: slideSpeed,
|
|
8266
|
+
direction: { x: slideDirection.x, y: slideDirection.y, z: 0 }
|
|
8267
|
+
});
|
|
8232
8268
|
}
|
|
8233
8269
|
this._selectedShapeIdsAtPointerDown = [];
|
|
8234
8270
|
this._didCaptureSelectionAtPointerDown = false;
|
|
@@ -8236,7 +8272,10 @@ class Editor extends import_eventemitter3.default {
|
|
|
8236
8272
|
}
|
|
8237
8273
|
}
|
|
8238
8274
|
if (slideSpeed > 0) {
|
|
8239
|
-
this.slideCamera({
|
|
8275
|
+
this.slideCamera({
|
|
8276
|
+
speed: slideSpeed,
|
|
8277
|
+
direction: { x: slideDirection.x, y: slideDirection.y, z: 0 }
|
|
8278
|
+
});
|
|
8240
8279
|
}
|
|
8241
8280
|
} else {
|
|
8242
8281
|
if (info.button === import_constants.STYLUS_ERASER_BUTTON) {
|