@bigbluebutton/tldraw 2.0.0-alpha.19 → 2.0.0-alpha.21

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.
Files changed (69) hide show
  1. package/dist-cjs/index.d.ts +55 -50
  2. package/dist-cjs/lib/shapes/bookmark/BookmarkShapeUtil.js +2 -2
  3. package/dist-cjs/lib/shapes/bookmark/BookmarkShapeUtil.js.map +1 -1
  4. package/dist-cjs/lib/tools/SelectTool/childStates/Brushing.js +3 -0
  5. package/dist-cjs/lib/tools/SelectTool/childStates/Brushing.js.map +2 -2
  6. package/dist-cjs/lib/tools/SelectTool/childStates/Idle.js +2 -2
  7. package/dist-cjs/lib/tools/SelectTool/childStates/Idle.js.map +2 -2
  8. package/dist-cjs/lib/tools/SelectTool/childStates/Resizing.js +3 -0
  9. package/dist-cjs/lib/tools/SelectTool/childStates/Resizing.js.map +2 -2
  10. package/dist-cjs/lib/tools/SelectTool/childStates/Translating.js +7 -6
  11. package/dist-cjs/lib/tools/SelectTool/childStates/Translating.js.map +2 -2
  12. package/dist-cjs/lib/ui/hooks/useActions.js +13 -0
  13. package/dist-cjs/lib/ui/hooks/useActions.js.map +2 -2
  14. package/dist-cjs/lib/ui/hooks/useEventsProvider.js.map +2 -2
  15. package/dist-cjs/lib/ui/hooks/useMenuSchema.js +5 -0
  16. package/dist-cjs/lib/ui/hooks/useMenuSchema.js.map +2 -2
  17. package/dist-cjs/lib/ui/hooks/usePreloadAssets.js +1 -0
  18. package/dist-cjs/lib/ui/hooks/usePreloadAssets.js.map +2 -2
  19. package/dist-cjs/lib/ui/hooks/useTranslation/TLUiTranslationKey.js.map +1 -1
  20. package/dist-cjs/lib/ui/hooks/useTranslation/defaultTranslation.js +2 -0
  21. package/dist-cjs/lib/ui/hooks/useTranslation/defaultTranslation.js.map +2 -2
  22. package/dist-cjs/lib/ui/version.js +1 -1
  23. package/dist-cjs/lib/ui/version.js.map +1 -1
  24. package/dist-cjs/lib/utils/assets/assets.js +5 -1
  25. package/dist-cjs/lib/utils/assets/assets.js.map +2 -2
  26. package/dist-esm/index.d.mts +55 -50
  27. package/dist-esm/lib/shapes/bookmark/BookmarkShapeUtil.mjs +2 -2
  28. package/dist-esm/lib/shapes/bookmark/BookmarkShapeUtil.mjs.map +1 -1
  29. package/dist-esm/lib/tools/SelectTool/childStates/Brushing.mjs +4 -0
  30. package/dist-esm/lib/tools/SelectTool/childStates/Brushing.mjs.map +2 -2
  31. package/dist-esm/lib/tools/SelectTool/childStates/Idle.mjs +2 -2
  32. package/dist-esm/lib/tools/SelectTool/childStates/Idle.mjs.map +2 -2
  33. package/dist-esm/lib/tools/SelectTool/childStates/Resizing.mjs +5 -1
  34. package/dist-esm/lib/tools/SelectTool/childStates/Resizing.mjs.map +2 -2
  35. package/dist-esm/lib/tools/SelectTool/childStates/Translating.mjs +9 -7
  36. package/dist-esm/lib/tools/SelectTool/childStates/Translating.mjs.map +2 -2
  37. package/dist-esm/lib/ui/hooks/useActions.mjs +13 -0
  38. package/dist-esm/lib/ui/hooks/useActions.mjs.map +2 -2
  39. package/dist-esm/lib/ui/hooks/useEventsProvider.mjs.map +2 -2
  40. package/dist-esm/lib/ui/hooks/useMenuSchema.mjs +5 -0
  41. package/dist-esm/lib/ui/hooks/useMenuSchema.mjs.map +2 -2
  42. package/dist-esm/lib/ui/hooks/usePreloadAssets.mjs +1 -0
  43. package/dist-esm/lib/ui/hooks/usePreloadAssets.mjs.map +2 -2
  44. package/dist-esm/lib/ui/hooks/useTranslation/defaultTranslation.mjs +2 -0
  45. package/dist-esm/lib/ui/hooks/useTranslation/defaultTranslation.mjs.map +2 -2
  46. package/dist-esm/lib/ui/version.mjs +1 -1
  47. package/dist-esm/lib/ui/version.mjs.map +1 -1
  48. package/dist-esm/lib/utils/assets/assets.mjs +5 -1
  49. package/dist-esm/lib/utils/assets/assets.mjs.map +2 -2
  50. package/package.json +3 -3
  51. package/src/lib/shapes/bookmark/BookmarkShapeUtil.tsx +2 -2
  52. package/src/lib/shapes/line/LineShapeUtil.test.ts +1 -1
  53. package/src/lib/tools/SelectTool/childStates/Brushing.ts +6 -0
  54. package/src/lib/tools/SelectTool/childStates/Idle.ts +6 -2
  55. package/src/lib/tools/SelectTool/childStates/Resizing.ts +6 -0
  56. package/src/lib/tools/SelectTool/childStates/Translating.ts +10 -7
  57. package/src/lib/ui/hooks/useActions.tsx +13 -0
  58. package/src/lib/ui/hooks/useEventsProvider.tsx +1 -0
  59. package/src/lib/ui/hooks/useMenuSchema.tsx +5 -0
  60. package/src/lib/ui/hooks/usePreloadAssets.ts +1 -0
  61. package/src/lib/ui/hooks/useTranslation/TLUiTranslationKey.ts +2 -0
  62. package/src/lib/ui/hooks/useTranslation/defaultTranslation.ts +2 -0
  63. package/src/lib/ui/version.ts +1 -1
  64. package/src/lib/utils/assets/assets.ts +5 -1
  65. package/src/test/TLUserPreferences.test.ts +4 -1
  66. package/src/test/TestEditor.ts +3 -0
  67. package/src/test/resizing.test.ts +22 -0
  68. package/src/test/selection-omnibus.test.ts +93 -0
  69. package/src/test/translating.test.ts +35 -0
@@ -14,6 +14,7 @@ import { EnumStyleProp } from '@bigbluebutton/editor';
14
14
  import { Geometry2d } from '@bigbluebutton/editor';
15
15
  import { Group2d } from '@bigbluebutton/editor';
16
16
  import { JsonObject } from '@bigbluebutton/editor';
17
+ import { JSX as JSX_2 } from 'react/jsx-runtime';
17
18
  import { LANGUAGES } from '@bigbluebutton/editor';
18
19
  import { Matrix2d } from '@bigbluebutton/editor';
19
20
  import { Matrix2dModel } from '@bigbluebutton/editor';
@@ -95,6 +96,7 @@ import { TLStore } from '@bigbluebutton/editor';
95
96
  import { TLStoreWithStatus } from '@bigbluebutton/editor';
96
97
  import { TLSvgOptions } from '@bigbluebutton/editor';
97
98
  import { TLTextShape } from '@bigbluebutton/editor';
99
+ import { TLTickEventHandler } from '@bigbluebutton/editor';
98
100
  import { TLUnknownShape } from '@bigbluebutton/editor';
99
101
  import { TLVideoShape } from '@bigbluebutton/editor';
100
102
  import { UnionValidator } from '@bigbluebutton/editor';
@@ -217,8 +219,8 @@ export declare class ArrowShapeUtil extends ShapeUtil<TLArrowShape> {
217
219
  onTranslateStart: TLOnTranslateStartHandler<TLArrowShape>;
218
220
  onResize: TLOnResizeHandler<TLArrowShape>;
219
221
  onDoubleClickHandle: (shape: TLArrowShape, handle: TLHandle) => TLShapePartial<TLArrowShape> | void;
220
- component(shape: TLArrowShape): JSX.Element | null;
221
- indicator(shape: TLArrowShape): JSX.Element | null;
222
+ component(shape: TLArrowShape): JSX_2.Element | null;
223
+ indicator(shape: TLArrowShape): JSX_2.Element | null;
222
224
  onEditEnd: TLOnEditEndHandler<TLArrowShape>;
223
225
  toSvg(shape: TLArrowShape, ctx: SvgExportContext): SVGGElement;
224
226
  getCanvasSvgDefs(): TLShapeUtilCanvasSvgDef[];
@@ -231,7 +233,7 @@ declare function Body_2({ className, children, style, }: {
231
233
  className?: string;
232
234
  children: any;
233
235
  style?: React.CSSProperties;
234
- }): JSX.Element;
236
+ }): JSX_2.Element;
235
237
 
236
238
  /** @public */
237
239
  export declare class BookmarkShapeUtil extends BaseBoxShapeUtil<TLBookmarkShape> {
@@ -246,8 +248,8 @@ export declare class BookmarkShapeUtil extends BaseBoxShapeUtil<TLBookmarkShape>
246
248
  canResize: () => boolean;
247
249
  hideSelectionBoundsFg: () => boolean;
248
250
  getDefaultProps(): TLBookmarkShape['props'];
249
- component(shape: TLBookmarkShape): JSX.Element;
250
- indicator(shape: TLBookmarkShape): JSX.Element;
251
+ component(shape: TLBookmarkShape): JSX_2.Element;
252
+ indicator(shape: TLBookmarkShape): JSX_2.Element;
251
253
  onBeforeCreate?: TLOnBeforeCreateHandler<TLBookmarkShape>;
252
254
  onBeforeUpdate?: TLOnBeforeUpdateHandler<TLBookmarkShape>;
253
255
  }
@@ -261,7 +263,7 @@ declare type BoxWidthHeight = {
261
263
  export declare function BreakPointProvider({ forceMobile, children, }: {
262
264
  forceMobile?: boolean;
263
265
  children: any;
264
- }): JSX.Element;
266
+ }): JSX_2.Element;
265
267
 
266
268
  declare class Brushing extends StateNode {
267
269
  static id: string;
@@ -286,6 +288,7 @@ declare class Brushing extends StateNode {
286
288
  target: 'canvas';
287
289
  }) => void;
288
290
  onExit: () => void;
291
+ onTick: TLTickEventHandler;
289
292
  onPointerMove: () => void;
290
293
  onPointerUp: TLEventHandlers['onPointerUp'];
291
294
  onComplete: TLEventHandlers['onComplete'];
@@ -304,10 +307,10 @@ declare class Brushing extends StateNode {
304
307
  export declare const Button: React_3.ForwardRefExoticComponent<TLUiButtonProps & React_3.RefAttributes<HTMLButtonElement>>;
305
308
 
306
309
  /** @public */
307
- declare function CheckboxItem({ children, onSelect, ...rest }: DropdownMenuCheckboxItemProps): JSX.Element;
310
+ declare function CheckboxItem({ children, onSelect, ...rest }: DropdownMenuCheckboxItemProps): JSX_2.Element;
308
311
 
309
312
  /** @public */
310
- declare function CloseButton(): JSX.Element;
313
+ declare function CloseButton(): JSX_2.Element;
311
314
 
312
315
  declare enum ColorStyle {
313
316
  White = "white",
@@ -344,12 +347,12 @@ declare function Content({ side, align, sideOffset, alignOffset, children, }: {
344
347
  sideOffset?: number;
345
348
  align?: 'center' | 'end' | 'start';
346
349
  side?: 'bottom' | 'left' | 'right' | 'top';
347
- }): JSX.Element;
350
+ }): JSX_2.Element;
348
351
 
349
352
  /** @public */
350
353
  export declare const ContextMenu: ({ children }: {
351
354
  children: any;
352
- }) => JSX.Element;
355
+ }) => JSX_2.Element;
353
356
 
354
357
  /**
355
358
  * Copy the given shapes to the clipboard.
@@ -585,8 +588,8 @@ export declare class DrawShapeUtil extends ShapeUtil<TLDrawShape> {
585
588
  hideSelectionBoundsFg: (shape: TLDrawShape) => boolean;
586
589
  getDefaultProps(): TLDrawShape['props'];
587
590
  getGeometry(shape: TLDrawShape): Circle2d | Polyline2d;
588
- component(shape: TLDrawShape): JSX.Element;
589
- indicator(shape: TLDrawShape): JSX.Element;
591
+ component(shape: TLDrawShape): JSX_2.Element;
592
+ indicator(shape: TLDrawShape): JSX_2.Element;
590
593
  toSvg(shape: TLDrawShape, ctx: SvgExportContext): SVGGElement;
591
594
  getCanvasSvgDefs(): TLShapeUtilCanvasSvgDef[];
592
595
  onResize: TLOnResizeHandler<TLDrawShape>;
@@ -660,8 +663,8 @@ export declare class EmbedShapeUtil extends BaseBoxShapeUtil<TLEmbedShape> {
660
663
  getDefaultProps(): TLEmbedShape['props'];
661
664
  isAspectRatioLocked: TLShapeUtilFlag<TLEmbedShape>;
662
665
  onResize: TLOnResizeHandler<TLEmbedShape>;
663
- component(shape: TLEmbedShape): JSX.Element;
664
- indicator(shape: TLEmbedShape): JSX.Element;
666
+ component(shape: TLEmbedShape): JSX_2.Element;
667
+ indicator(shape: TLEmbedShape): JSX_2.Element;
665
668
  }
666
669
 
667
670
  /** @public */
@@ -735,7 +738,7 @@ declare enum FontStyle {
735
738
  declare function Footer({ className, children }: {
736
739
  className?: string;
737
740
  children: any;
738
- }): JSX.Element;
741
+ }): JSX_2.Element;
739
742
 
740
743
  /** @public */
741
744
  export declare class FrameShapeTool extends BaseBoxShapeTool {
@@ -758,9 +761,9 @@ export declare class FrameShapeUtil extends BaseBoxShapeUtil<TLFrameShape> {
758
761
  canEdit: () => boolean;
759
762
  getDefaultProps(): TLFrameShape['props'];
760
763
  getGeometry(shape: TLFrameShape): Geometry2d;
761
- component(shape: TLFrameShape): JSX.Element;
764
+ component(shape: TLFrameShape): JSX_2.Element;
762
765
  toSvg(shape: TLFrameShape): Promise<SVGElement> | SVGElement;
763
- indicator(shape: TLFrameShape): JSX.Element;
766
+ indicator(shape: TLFrameShape): JSX_2.Element;
764
767
  canReceiveNewChildrenOfType: (shape: TLShape, _type: TLShape['type']) => boolean;
765
768
  providesBackgroundForChildren(): boolean;
766
769
  canDropShapes: (shape: TLFrameShape, _shapes: TLShape[]) => boolean;
@@ -804,8 +807,8 @@ export declare class GeoShapeUtil extends BaseBoxShapeUtil<TLGeoShape> {
804
807
  getDefaultProps(): TLGeoShape['props'];
805
808
  getGeometry(shape: TLGeoShape): Geometry2d;
806
809
  onEditEnd: TLOnEditEndHandler<TLGeoShape>;
807
- component(shape: TLGeoShape): JSX.Element;
808
- indicator(shape: TLGeoShape): JSX.Element;
810
+ component(shape: TLGeoShape): JSX_2.Element;
811
+ indicator(shape: TLGeoShape): JSX_2.Element;
809
812
  toSvg(shape: TLGeoShape, ctx: SvgExportContext): SVGElement;
810
813
  getCanvasSvgDefs(): TLShapeUtilCanvasSvgDef[];
811
814
  onResize: TLOnResizeHandler<TLGeoShape>;
@@ -948,7 +951,7 @@ declare function getTranslatingSnapshot(editor: Editor): {
948
951
  declare function Group({ children, size, }: {
949
952
  children: any;
950
953
  size?: 'medium' | 'small' | 'tiny' | 'wide';
951
- }): JSX.Element;
954
+ }): JSX_2.Element;
952
955
 
953
956
  declare interface GroupShape extends TDBaseShape {
954
957
  type: TDShapeType.Group;
@@ -970,7 +973,7 @@ export declare class HandTool extends StateNode {
970
973
  declare function Header({ className, children }: {
971
974
  className?: string;
972
975
  children: any;
973
- }): JSX.Element;
976
+ }): JSX_2.Element;
974
977
 
975
978
  /** @public */
976
979
  export declare class HighlightShapeTool extends StateNode {
@@ -1000,9 +1003,9 @@ export declare class HighlightShapeUtil extends ShapeUtil<TLHighlightShape> {
1000
1003
  hideSelectionBoundsFg: (shape: TLHighlightShape) => boolean;
1001
1004
  getDefaultProps(): TLHighlightShape['props'];
1002
1005
  getGeometry(shape: TLHighlightShape): Circle2d | Polygon2d;
1003
- component(shape: TLHighlightShape): JSX.Element;
1004
- backgroundComponent(shape: TLHighlightShape): JSX.Element;
1005
- indicator(shape: TLHighlightShape): JSX.Element;
1006
+ component(shape: TLHighlightShape): JSX_2.Element;
1007
+ backgroundComponent(shape: TLHighlightShape): JSX_2.Element;
1008
+ indicator(shape: TLHighlightShape): JSX_2.Element;
1006
1009
  toSvg(shape: TLHighlightShape): SVGPathElement;
1007
1010
  toBackgroundSvg(shape: TLHighlightShape): SVGPathElement;
1008
1011
  onResize: TLOnResizeHandler<TLHighlightShape>;
@@ -1147,15 +1150,15 @@ export declare class ImageShapeUtil extends BaseBoxShapeUtil<TLImageShape> {
1147
1150
  isAspectRatioLocked: () => boolean;
1148
1151
  canCrop: () => boolean;
1149
1152
  getDefaultProps(): TLImageShape['props'];
1150
- component(shape: TLImageShape): JSX.Element;
1151
- indicator(shape: TLImageShape): JSX.Element | null;
1153
+ component(shape: TLImageShape): JSX_2.Element;
1154
+ indicator(shape: TLImageShape): JSX_2.Element | null;
1152
1155
  toSvg(shape: TLImageShape): Promise<SVGGElement>;
1153
1156
  onDoubleClick: (shape: TLImageShape) => void;
1154
1157
  onDoubleClickEdge: TLOnDoubleClickHandler<TLImageShape>;
1155
1158
  }
1156
1159
 
1157
1160
  /** @public */
1158
- declare function Indicator(): JSX.Element;
1161
+ declare function Indicator(): JSX_2.Element;
1159
1162
 
1160
1163
  /** @public */
1161
1164
  export declare const Input: React_3.ForwardRefExoticComponent<TLUiInputProps & React_3.RefAttributes<HTMLInputElement>>;
@@ -1164,7 +1167,7 @@ export declare const Input: React_3.ForwardRefExoticComponent<TLUiInputProps & R
1164
1167
  export declare function isGifAnimated(file: File): Promise<boolean>;
1165
1168
 
1166
1169
  /** @public */
1167
- declare function Item({ noClose, ...props }: DropdownMenuItemProps): JSX.Element;
1170
+ declare function Item({ noClose, ...props }: DropdownMenuItemProps): JSX_2.Element;
1168
1171
 
1169
1172
  declare type Join<T, K> = K extends null ? {
1170
1173
  [R in keyof T]: T[R];
@@ -1227,8 +1230,8 @@ export declare class LineShapeUtil extends ShapeUtil<TLLineShape> {
1227
1230
  getOutlineSegments(shape: TLLineShape): Vec2d[][];
1228
1231
  onResize: TLOnResizeHandler<TLLineShape>;
1229
1232
  onHandleChange: TLOnHandleChangeHandler<TLLineShape>;
1230
- component(shape: TLLineShape): JSX.Element | undefined;
1231
- indicator(shape: TLLineShape): JSX.Element;
1233
+ component(shape: TLLineShape): JSX_2.Element | undefined;
1234
+ indicator(shape: TLLineShape): JSX_2.Element;
1232
1235
  toSvg(shape: TLLineShape): SVGGElement;
1233
1236
  }
1234
1237
 
@@ -1289,8 +1292,8 @@ export declare class NoteShapeUtil extends ShapeUtil<TLNoteShape> {
1289
1292
  getDefaultProps(): TLNoteShape['props'];
1290
1293
  getHeight(shape: TLNoteShape): number;
1291
1294
  getGeometry(shape: TLNoteShape): Rectangle2d;
1292
- component(shape: TLNoteShape): JSX.Element;
1293
- indicator(shape: TLNoteShape): JSX.Element;
1295
+ component(shape: TLNoteShape): JSX_2.Element;
1296
+ indicator(shape: TLNoteShape): JSX_2.Element;
1294
1297
  toSvg(shape: TLNoteShape, ctx: SvgExportContext): SVGGElement;
1295
1298
  onBeforeCreate: (next: TLNoteShape) => {
1296
1299
  props: {
@@ -1342,7 +1345,7 @@ export declare class NoteShapeUtil extends ShapeUtil<TLNoteShape> {
1342
1345
  }
1343
1346
 
1344
1347
  /** @public */
1345
- export declare function OfflineIndicator(): JSX.Element;
1348
+ export declare function OfflineIndicator(): JSX_2.Element;
1346
1349
 
1347
1350
  /* Excluded from this release type: parseAndLoadDocument */
1348
1351
 
@@ -1615,7 +1618,7 @@ declare class PointingShape extends StateNode {
1615
1618
  }
1616
1619
 
1617
1620
  /** @public */
1618
- declare function RadioItem({ children, onSelect, ...rest }: DropdownMenuCheckboxItemProps): JSX.Element;
1621
+ declare function RadioItem({ children, onSelect, ...rest }: DropdownMenuCheckboxItemProps): JSX_2.Element;
1619
1622
 
1620
1623
  declare interface RectangleShape extends TDBaseShape {
1621
1624
  type: TDShapeType.Rectangle;
@@ -1660,6 +1663,7 @@ declare class Resizing extends StateNode {
1660
1663
  creationCursorOffset: VecLike;
1661
1664
  private snapshot;
1662
1665
  onEnter: TLEnterEventHandler;
1666
+ onTick: TLTickEventHandler;
1663
1667
  onPointerMove: TLEventHandlers['onPointerMove'];
1664
1668
  onKeyDown: TLEventHandlers['onKeyDown'];
1665
1669
  onKeyUp: TLEventHandlers['onKeyUp'];
@@ -1707,7 +1711,7 @@ declare function Root({ id, children, modal, debugOpen, }: {
1707
1711
  children: any;
1708
1712
  modal?: boolean;
1709
1713
  debugOpen?: boolean;
1710
- }): JSX.Element;
1714
+ }): JSX_2.Element;
1711
1715
 
1712
1716
  declare class Rotating extends StateNode {
1713
1717
  static id: string;
@@ -1815,21 +1819,21 @@ declare interface StickyShape extends TDBaseShape {
1815
1819
  declare function Sub({ id, children }: {
1816
1820
  id: string;
1817
1821
  children: any;
1818
- }): JSX.Element;
1822
+ }): JSX_2.Element;
1819
1823
 
1820
1824
  /** @public */
1821
1825
  declare function SubContent({ alignOffset, sideOffset, children, }: {
1822
1826
  alignOffset?: number;
1823
1827
  sideOffset?: number;
1824
1828
  children: any;
1825
- }): JSX.Element;
1829
+ }): JSX_2.Element;
1826
1830
 
1827
1831
  /** @public */
1828
1832
  declare function SubTrigger({ label, 'data-testid': testId, 'data-direction': dataDirection, }: {
1829
1833
  label: Exclude<string, TLUiTranslationKey> | TLUiTranslationKey;
1830
1834
  'data-testid'?: string;
1831
1835
  'data-direction'?: 'left' | 'right';
1832
- }): JSX.Element;
1836
+ }): JSX_2.Element;
1833
1837
 
1834
1838
  declare type TDAsset = TDImageAsset | TDVideoAsset;
1835
1839
 
@@ -1926,8 +1930,8 @@ export declare class TextShapeUtil extends ShapeUtil<TLTextShape> {
1926
1930
  getGeometry(shape: TLTextShape): Rectangle2d;
1927
1931
  canEdit: () => boolean;
1928
1932
  isAspectRatioLocked: TLShapeUtilFlag<TLTextShape>;
1929
- component(shape: TLTextShape): JSX.Element;
1930
- indicator(shape: TLTextShape): JSX.Element | null;
1933
+ component(shape: TLTextShape): JSX_2.Element;
1934
+ indicator(shape: TLTextShape): JSX_2.Element | null;
1931
1935
  toSvg(shape: TLTextShape, ctx: SvgExportContext): SVGGElement;
1932
1936
  onResize: TLOnResizeHandler<TLTextShape>;
1933
1937
  onBeforeCreate: (shape: TLTextShape) => {
@@ -1998,19 +2002,19 @@ export declare class TextShapeUtil extends ShapeUtil<TLTextShape> {
1998
2002
  declare function Title({ className, children }: {
1999
2003
  className?: string;
2000
2004
  children: any;
2001
- }): JSX.Element;
2005
+ }): JSX_2.Element;
2002
2006
 
2003
2007
  /** @public */
2004
2008
  declare type TLCopyType = 'jpeg' | 'json' | 'png' | 'svg';
2005
2009
 
2006
2010
  /** @public */
2007
- export declare function Tldraw(props: TldrawProps): JSX.Element;
2011
+ export declare function Tldraw(props: TldrawProps): JSX_2.Element;
2008
2012
 
2009
2013
  /** @public */
2010
2014
  export declare const TLDRAW_FILE_EXTENSION: ".tldr";
2011
2015
 
2012
2016
  /** @public */
2013
- export declare function TldrawCropHandles({ size, width, height, hideAlternateHandles, }: TldrawCropHandlesProps): JSX.Element;
2017
+ export declare function TldrawCropHandles({ size, width, height, hideAlternateHandles, }: TldrawCropHandlesProps): JSX_2.Element;
2014
2018
 
2015
2019
  /** @public */
2016
2020
  export declare interface TldrawCropHandlesProps {
@@ -2107,7 +2111,7 @@ export declare interface TldrawUiBaseProps {
2107
2111
  }
2108
2112
 
2109
2113
  /** @public */
2110
- export declare function TldrawUiContextProvider({ overrides, assetUrls, onUiEvent, forceMobile, children, }: TldrawUiContextProviderProps): JSX.Element;
2114
+ export declare function TldrawUiContextProvider({ overrides, assetUrls, onUiEvent, forceMobile, children, }: TldrawUiContextProviderProps): JSX_2.Element;
2111
2115
 
2112
2116
  /**
2113
2117
  * Props for the {@link @bigbluebutton/tldraw#Tldraw} and {@link TldrawUi} components.
@@ -2362,6 +2366,7 @@ export declare interface TLUiEventMap {
2362
2366
  'toggle-debug-mode': null;
2363
2367
  'toggle-lock': null;
2364
2368
  'toggle-reduce-motion': null;
2369
+ 'toggle-edge-scrolling': null;
2365
2370
  'exit-pen-mode': null;
2366
2371
  'stop-following': null;
2367
2372
  'open-cursor-chat': null;
@@ -2590,7 +2595,7 @@ export declare type TLUiTranslation = {
2590
2595
  export declare type TLUiTranslationContextType = TLUiTranslation;
2591
2596
 
2592
2597
  /** @public */
2593
- export declare type TLUiTranslationKey = 'action.align-bottom' | 'action.align-center-horizontal.short' | 'action.align-center-horizontal' | 'action.align-center-vertical.short' | 'action.align-center-vertical' | 'action.align-left' | 'action.align-right' | 'action.align-top' | 'action.back-to-content' | 'action.bring-forward' | 'action.bring-to-front' | 'action.convert-to-bookmark' | 'action.convert-to-embed' | 'action.copy-as-json.short' | 'action.copy-as-json' | 'action.copy-as-png.short' | 'action.copy-as-png' | 'action.copy-as-svg.short' | 'action.copy-as-svg' | 'action.copy' | 'action.cut' | 'action.delete' | 'action.distribute-horizontal.short' | 'action.distribute-horizontal' | 'action.distribute-vertical.short' | 'action.distribute-vertical' | 'action.duplicate' | 'action.edit-link' | 'action.exit-pen-mode' | 'action.export-as-json.short' | 'action.export-as-json' | 'action.export-as-png.short' | 'action.export-as-png' | 'action.export-as-svg.short' | 'action.export-as-svg' | 'action.fit-frame-to-content' | 'action.flip-horizontal.short' | 'action.flip-horizontal' | 'action.flip-vertical.short' | 'action.flip-vertical' | 'action.fork-project' | 'action.group' | 'action.insert-embed' | 'action.insert-media' | 'action.leave-shared-project' | 'action.new-project' | 'action.new-shared-project' | 'action.open-cursor-chat' | 'action.open-embed-link' | 'action.open-file' | 'action.pack' | 'action.paste' | 'action.print' | 'action.redo' | 'action.remove-frame' | 'action.rotate-ccw' | 'action.rotate-cw' | 'action.save-copy' | 'action.select-all' | 'action.select-none' | 'action.send-backward' | 'action.send-to-back' | 'action.share-project' | 'action.stack-horizontal.short' | 'action.stack-horizontal' | 'action.stack-vertical.short' | 'action.stack-vertical' | 'action.stop-following' | 'action.stretch-horizontal.short' | 'action.stretch-horizontal' | 'action.stretch-vertical.short' | 'action.stretch-vertical' | 'action.toggle-auto-size' | 'action.toggle-dark-mode.menu' | 'action.toggle-dark-mode' | 'action.toggle-debug-mode.menu' | 'action.toggle-debug-mode' | 'action.toggle-focus-mode.menu' | 'action.toggle-focus-mode' | 'action.toggle-grid.menu' | 'action.toggle-grid' | 'action.toggle-lock' | 'action.toggle-reduce-motion.menu' | 'action.toggle-reduce-motion' | 'action.toggle-snap-mode.menu' | 'action.toggle-snap-mode' | 'action.toggle-tool-lock.menu' | 'action.toggle-tool-lock' | 'action.toggle-transparent.context-menu' | 'action.toggle-transparent.menu' | 'action.toggle-transparent' | 'action.undo' | 'action.ungroup' | 'action.unlock-all' | 'action.zoom-in' | 'action.zoom-out' | 'action.zoom-to-100' | 'action.zoom-to-fit' | 'action.zoom-to-selection' | 'actions-menu.title' | 'align-style.end' | 'align-style.justify' | 'align-style.middle' | 'align-style.start' | 'arrowheadEnd-style.arrow' | 'arrowheadEnd-style.bar' | 'arrowheadEnd-style.diamond' | 'arrowheadEnd-style.dot' | 'arrowheadEnd-style.inverted' | 'arrowheadEnd-style.none' | 'arrowheadEnd-style.pipe' | 'arrowheadEnd-style.square' | 'arrowheadEnd-style.triangle' | 'arrowheadStart-style.arrow' | 'arrowheadStart-style.bar' | 'arrowheadStart-style.diamond' | 'arrowheadStart-style.dot' | 'arrowheadStart-style.inverted' | 'arrowheadStart-style.none' | 'arrowheadStart-style.pipe' | 'arrowheadStart-style.square' | 'arrowheadStart-style.triangle' | 'color-style.black' | 'color-style.blue' | 'color-style.green' | 'color-style.grey' | 'color-style.light-blue' | 'color-style.light-green' | 'color-style.light-red' | 'color-style.light-violet' | 'color-style.orange' | 'color-style.red' | 'color-style.violet' | 'color-style.yellow' | 'context-menu.arrange' | 'context-menu.copy-as' | 'context-menu.export-as' | 'context-menu.move-to-page' | 'context-menu.reorder' | 'context.pages.new-page' | 'cursor-chat.type-to-chat' | 'dash-style.dashed' | 'dash-style.dotted' | 'dash-style.draw' | 'dash-style.solid' | 'debug-panel.more' | 'edit-link-dialog.cancel' | 'edit-link-dialog.clear' | 'edit-link-dialog.detail' | 'edit-link-dialog.invalid-url' | 'edit-link-dialog.save' | 'edit-link-dialog.title' | 'edit-link-dialog.url' | 'edit-pages-dialog.move-down' | 'edit-pages-dialog.move-up' | 'embed-dialog.back' | 'embed-dialog.cancel' | 'embed-dialog.create' | 'embed-dialog.instruction' | 'embed-dialog.invalid-url' | 'embed-dialog.title' | 'embed-dialog.url' | 'file-system.confirm-clear.cancel' | 'file-system.confirm-clear.continue' | 'file-system.confirm-clear.description' | 'file-system.confirm-clear.dont-show-again' | 'file-system.confirm-clear.title' | 'file-system.confirm-open.cancel' | 'file-system.confirm-open.description' | 'file-system.confirm-open.dont-show-again' | 'file-system.confirm-open.open' | 'file-system.confirm-open.title' | 'file-system.file-open-error.file-format-version-too-new' | 'file-system.file-open-error.generic-corrupted-file' | 'file-system.file-open-error.not-a-tldraw-file' | 'file-system.file-open-error.title' | 'file-system.shared-document-file-open-error.description' | 'file-system.shared-document-file-open-error.title' | 'fill-style.none' | 'fill-style.pattern' | 'fill-style.semi' | 'fill-style.solid' | 'focus-mode.toggle-focus-mode' | 'font-style.draw' | 'font-style.mono' | 'font-style.sans' | 'font-style.serif' | 'geo-style.arrow-down' | 'geo-style.arrow-left' | 'geo-style.arrow-right' | 'geo-style.arrow-up' | 'geo-style.check-box' | 'geo-style.cloud' | 'geo-style.diamond' | 'geo-style.ellipse' | 'geo-style.hexagon' | 'geo-style.octagon' | 'geo-style.oval' | 'geo-style.pentagon' | 'geo-style.rectangle' | 'geo-style.rhombus-2' | 'geo-style.rhombus' | 'geo-style.star' | 'geo-style.trapezoid' | 'geo-style.triangle' | 'geo-style.x-box' | 'help-menu.about' | 'help-menu.discord' | 'help-menu.github' | 'help-menu.keyboard-shortcuts' | 'help-menu.title' | 'help-menu.twitter' | 'home-project-dialog.description' | 'home-project-dialog.ok' | 'home-project-dialog.title' | 'menu.copy-as' | 'menu.edit' | 'menu.export-as' | 'menu.file' | 'menu.language' | 'menu.preferences' | 'menu.title' | 'menu.view' | 'navigation-zone.toggle-minimap' | 'navigation-zone.zoom' | 'opacity-style.0.1' | 'opacity-style.0.25' | 'opacity-style.0.5' | 'opacity-style.0.75' | 'opacity-style.1' | 'page-menu.create-new-page' | 'page-menu.edit-done' | 'page-menu.edit-start' | 'page-menu.go-to-page' | 'page-menu.max-page-count-reached' | 'page-menu.new-page-initial-name' | 'page-menu.submenu.delete' | 'page-menu.submenu.duplicate-page' | 'page-menu.submenu.move-down' | 'page-menu.submenu.move-up' | 'page-menu.submenu.rename' | 'page-menu.submenu.title' | 'page-menu.title' | 'people-menu.change-color' | 'people-menu.change-name' | 'people-menu.follow' | 'people-menu.following' | 'people-menu.invite' | 'people-menu.leading' | 'people-menu.title' | 'people-menu.user' | 'rename-project-dialog.cancel' | 'rename-project-dialog.rename' | 'rename-project-dialog.title' | 'share-menu.copy-link-note' | 'share-menu.copy-link' | 'share-menu.copy-readonly-link-note' | 'share-menu.copy-readonly-link' | 'share-menu.create-snapshot-link' | 'share-menu.default-project-name' | 'share-menu.fork-note' | 'share-menu.offline-note' | 'share-menu.project-too-large' | 'share-menu.readonly-link' | 'share-menu.save-note' | 'share-menu.share-project' | 'share-menu.snapshot-link-note' | 'share-menu.title' | 'share-menu.upload-failed' | 'sharing.confirm-leave.cancel' | 'sharing.confirm-leave.description' | 'sharing.confirm-leave.dont-show-again' | 'sharing.confirm-leave.leave' | 'sharing.confirm-leave.title' | 'shortcuts-dialog.collaboration' | 'shortcuts-dialog.edit' | 'shortcuts-dialog.file' | 'shortcuts-dialog.preferences' | 'shortcuts-dialog.title' | 'shortcuts-dialog.tools' | 'shortcuts-dialog.transform' | 'shortcuts-dialog.view' | 'size-style.l' | 'size-style.m' | 'size-style.s' | 'size-style.xl' | 'spline-style.cubic' | 'spline-style.line' | 'status.offline' | 'status.online' | 'style-panel.align' | 'style-panel.arrowhead-end' | 'style-panel.arrowhead-start' | 'style-panel.arrowheads' | 'style-panel.color' | 'style-panel.dash' | 'style-panel.fill' | 'style-panel.font' | 'style-panel.geo' | 'style-panel.mixed' | 'style-panel.opacity' | 'style-panel.position' | 'style-panel.size' | 'style-panel.spline' | 'style-panel.title' | 'style-panel.vertical-align' | 'toast.close' | 'toast.error.copy-fail.desc' | 'toast.error.copy-fail.title' | 'toast.error.export-fail.desc' | 'toast.error.export-fail.title' | 'tool-panel.drawing' | 'tool-panel.more' | 'tool-panel.shapes' | 'tool.arrow-down' | 'tool.arrow-left' | 'tool.arrow-right' | 'tool.arrow-up' | 'tool.arrow' | 'tool.asset' | 'tool.check-box' | 'tool.cloud' | 'tool.diamond' | 'tool.draw' | 'tool.ellipse' | 'tool.embed' | 'tool.eraser' | 'tool.frame' | 'tool.hand' | 'tool.hexagon' | 'tool.highlight' | 'tool.laser' | 'tool.line' | 'tool.note' | 'tool.octagon' | 'tool.oval' | 'tool.pentagon' | 'tool.rectangle' | 'tool.rhombus' | 'tool.select' | 'tool.star' | 'tool.text' | 'tool.trapezoid' | 'tool.triangle' | 'tool.x-box' | 'vscode.file-open.backup-failed' | 'vscode.file-open.backup-saved' | 'vscode.file-open.backup' | 'vscode.file-open.desc' | 'vscode.file-open.dont-show-again' | 'vscode.file-open.open';
2598
+ export declare type TLUiTranslationKey = 'action.align-bottom' | 'action.align-center-horizontal.short' | 'action.align-center-horizontal' | 'action.align-center-vertical.short' | 'action.align-center-vertical' | 'action.align-left' | 'action.align-right' | 'action.align-top' | 'action.back-to-content' | 'action.bring-forward' | 'action.bring-to-front' | 'action.convert-to-bookmark' | 'action.convert-to-embed' | 'action.copy-as-json.short' | 'action.copy-as-json' | 'action.copy-as-png.short' | 'action.copy-as-png' | 'action.copy-as-svg.short' | 'action.copy-as-svg' | 'action.copy' | 'action.cut' | 'action.delete' | 'action.distribute-horizontal.short' | 'action.distribute-horizontal' | 'action.distribute-vertical.short' | 'action.distribute-vertical' | 'action.duplicate' | 'action.edit-link' | 'action.exit-pen-mode' | 'action.export-as-json.short' | 'action.export-as-json' | 'action.export-as-png.short' | 'action.export-as-png' | 'action.export-as-svg.short' | 'action.export-as-svg' | 'action.fit-frame-to-content' | 'action.flip-horizontal.short' | 'action.flip-horizontal' | 'action.flip-vertical.short' | 'action.flip-vertical' | 'action.fork-project' | 'action.group' | 'action.insert-embed' | 'action.insert-media' | 'action.leave-shared-project' | 'action.new-project' | 'action.new-shared-project' | 'action.open-cursor-chat' | 'action.open-embed-link' | 'action.open-file' | 'action.pack' | 'action.paste' | 'action.print' | 'action.redo' | 'action.remove-frame' | 'action.rotate-ccw' | 'action.rotate-cw' | 'action.save-copy' | 'action.select-all' | 'action.select-none' | 'action.send-backward' | 'action.send-to-back' | 'action.share-project' | 'action.stack-horizontal.short' | 'action.stack-horizontal' | 'action.stack-vertical.short' | 'action.stack-vertical' | 'action.stop-following' | 'action.stretch-horizontal.short' | 'action.stretch-horizontal' | 'action.stretch-vertical.short' | 'action.stretch-vertical' | 'action.toggle-auto-size' | 'action.toggle-dark-mode.menu' | 'action.toggle-dark-mode' | 'action.toggle-debug-mode.menu' | 'action.toggle-debug-mode' | 'action.toggle-edge-scrolling.menu' | 'action.toggle-edge-scrolling' | 'action.toggle-focus-mode.menu' | 'action.toggle-focus-mode' | 'action.toggle-grid.menu' | 'action.toggle-grid' | 'action.toggle-lock' | 'action.toggle-reduce-motion.menu' | 'action.toggle-reduce-motion' | 'action.toggle-snap-mode.menu' | 'action.toggle-snap-mode' | 'action.toggle-tool-lock.menu' | 'action.toggle-tool-lock' | 'action.toggle-transparent.context-menu' | 'action.toggle-transparent.menu' | 'action.toggle-transparent' | 'action.undo' | 'action.ungroup' | 'action.unlock-all' | 'action.zoom-in' | 'action.zoom-out' | 'action.zoom-to-100' | 'action.zoom-to-fit' | 'action.zoom-to-selection' | 'actions-menu.title' | 'align-style.end' | 'align-style.justify' | 'align-style.middle' | 'align-style.start' | 'arrowheadEnd-style.arrow' | 'arrowheadEnd-style.bar' | 'arrowheadEnd-style.diamond' | 'arrowheadEnd-style.dot' | 'arrowheadEnd-style.inverted' | 'arrowheadEnd-style.none' | 'arrowheadEnd-style.pipe' | 'arrowheadEnd-style.square' | 'arrowheadEnd-style.triangle' | 'arrowheadStart-style.arrow' | 'arrowheadStart-style.bar' | 'arrowheadStart-style.diamond' | 'arrowheadStart-style.dot' | 'arrowheadStart-style.inverted' | 'arrowheadStart-style.none' | 'arrowheadStart-style.pipe' | 'arrowheadStart-style.square' | 'arrowheadStart-style.triangle' | 'color-style.black' | 'color-style.blue' | 'color-style.green' | 'color-style.grey' | 'color-style.light-blue' | 'color-style.light-green' | 'color-style.light-red' | 'color-style.light-violet' | 'color-style.orange' | 'color-style.red' | 'color-style.violet' | 'color-style.yellow' | 'context-menu.arrange' | 'context-menu.copy-as' | 'context-menu.export-as' | 'context-menu.move-to-page' | 'context-menu.reorder' | 'context.pages.new-page' | 'cursor-chat.type-to-chat' | 'dash-style.dashed' | 'dash-style.dotted' | 'dash-style.draw' | 'dash-style.solid' | 'debug-panel.more' | 'edit-link-dialog.cancel' | 'edit-link-dialog.clear' | 'edit-link-dialog.detail' | 'edit-link-dialog.invalid-url' | 'edit-link-dialog.save' | 'edit-link-dialog.title' | 'edit-link-dialog.url' | 'edit-pages-dialog.move-down' | 'edit-pages-dialog.move-up' | 'embed-dialog.back' | 'embed-dialog.cancel' | 'embed-dialog.create' | 'embed-dialog.instruction' | 'embed-dialog.invalid-url' | 'embed-dialog.title' | 'embed-dialog.url' | 'file-system.confirm-clear.cancel' | 'file-system.confirm-clear.continue' | 'file-system.confirm-clear.description' | 'file-system.confirm-clear.dont-show-again' | 'file-system.confirm-clear.title' | 'file-system.confirm-open.cancel' | 'file-system.confirm-open.description' | 'file-system.confirm-open.dont-show-again' | 'file-system.confirm-open.open' | 'file-system.confirm-open.title' | 'file-system.file-open-error.file-format-version-too-new' | 'file-system.file-open-error.generic-corrupted-file' | 'file-system.file-open-error.not-a-tldraw-file' | 'file-system.file-open-error.title' | 'file-system.shared-document-file-open-error.description' | 'file-system.shared-document-file-open-error.title' | 'fill-style.none' | 'fill-style.pattern' | 'fill-style.semi' | 'fill-style.solid' | 'focus-mode.toggle-focus-mode' | 'font-style.draw' | 'font-style.mono' | 'font-style.sans' | 'font-style.serif' | 'geo-style.arrow-down' | 'geo-style.arrow-left' | 'geo-style.arrow-right' | 'geo-style.arrow-up' | 'geo-style.check-box' | 'geo-style.cloud' | 'geo-style.diamond' | 'geo-style.ellipse' | 'geo-style.hexagon' | 'geo-style.octagon' | 'geo-style.oval' | 'geo-style.pentagon' | 'geo-style.rectangle' | 'geo-style.rhombus-2' | 'geo-style.rhombus' | 'geo-style.star' | 'geo-style.trapezoid' | 'geo-style.triangle' | 'geo-style.x-box' | 'help-menu.about' | 'help-menu.discord' | 'help-menu.github' | 'help-menu.keyboard-shortcuts' | 'help-menu.title' | 'help-menu.twitter' | 'home-project-dialog.description' | 'home-project-dialog.ok' | 'home-project-dialog.title' | 'menu.copy-as' | 'menu.edit' | 'menu.export-as' | 'menu.file' | 'menu.language' | 'menu.preferences' | 'menu.title' | 'menu.view' | 'navigation-zone.toggle-minimap' | 'navigation-zone.zoom' | 'opacity-style.0.1' | 'opacity-style.0.25' | 'opacity-style.0.5' | 'opacity-style.0.75' | 'opacity-style.1' | 'page-menu.create-new-page' | 'page-menu.edit-done' | 'page-menu.edit-start' | 'page-menu.go-to-page' | 'page-menu.max-page-count-reached' | 'page-menu.new-page-initial-name' | 'page-menu.submenu.delete' | 'page-menu.submenu.duplicate-page' | 'page-menu.submenu.move-down' | 'page-menu.submenu.move-up' | 'page-menu.submenu.rename' | 'page-menu.submenu.title' | 'page-menu.title' | 'people-menu.change-color' | 'people-menu.change-name' | 'people-menu.follow' | 'people-menu.following' | 'people-menu.invite' | 'people-menu.leading' | 'people-menu.title' | 'people-menu.user' | 'rename-project-dialog.cancel' | 'rename-project-dialog.rename' | 'rename-project-dialog.title' | 'share-menu.copy-link-note' | 'share-menu.copy-link' | 'share-menu.copy-readonly-link-note' | 'share-menu.copy-readonly-link' | 'share-menu.create-snapshot-link' | 'share-menu.default-project-name' | 'share-menu.fork-note' | 'share-menu.offline-note' | 'share-menu.project-too-large' | 'share-menu.readonly-link' | 'share-menu.save-note' | 'share-menu.share-project' | 'share-menu.snapshot-link-note' | 'share-menu.title' | 'share-menu.upload-failed' | 'sharing.confirm-leave.cancel' | 'sharing.confirm-leave.description' | 'sharing.confirm-leave.dont-show-again' | 'sharing.confirm-leave.leave' | 'sharing.confirm-leave.title' | 'shortcuts-dialog.collaboration' | 'shortcuts-dialog.edit' | 'shortcuts-dialog.file' | 'shortcuts-dialog.preferences' | 'shortcuts-dialog.title' | 'shortcuts-dialog.tools' | 'shortcuts-dialog.transform' | 'shortcuts-dialog.view' | 'size-style.l' | 'size-style.m' | 'size-style.s' | 'size-style.xl' | 'spline-style.cubic' | 'spline-style.line' | 'status.offline' | 'status.online' | 'style-panel.align' | 'style-panel.arrowhead-end' | 'style-panel.arrowhead-start' | 'style-panel.arrowheads' | 'style-panel.color' | 'style-panel.dash' | 'style-panel.fill' | 'style-panel.font' | 'style-panel.geo' | 'style-panel.mixed' | 'style-panel.opacity' | 'style-panel.position' | 'style-panel.size' | 'style-panel.spline' | 'style-panel.title' | 'style-panel.vertical-align' | 'toast.close' | 'toast.error.copy-fail.desc' | 'toast.error.copy-fail.title' | 'toast.error.export-fail.desc' | 'toast.error.export-fail.title' | 'tool-panel.drawing' | 'tool-panel.more' | 'tool-panel.shapes' | 'tool.arrow-down' | 'tool.arrow-left' | 'tool.arrow-right' | 'tool.arrow-up' | 'tool.arrow' | 'tool.asset' | 'tool.check-box' | 'tool.cloud' | 'tool.diamond' | 'tool.draw' | 'tool.ellipse' | 'tool.embed' | 'tool.eraser' | 'tool.frame' | 'tool.hand' | 'tool.hexagon' | 'tool.highlight' | 'tool.laser' | 'tool.line' | 'tool.note' | 'tool.octagon' | 'tool.oval' | 'tool.pentagon' | 'tool.rectangle' | 'tool.rhombus' | 'tool.select' | 'tool.star' | 'tool.text' | 'tool.trapezoid' | 'tool.triangle' | 'tool.x-box' | 'vscode.file-open.backup-failed' | 'vscode.file-open.backup-saved' | 'vscode.file-open.backup' | 'vscode.file-open.desc' | 'vscode.file-open.dont-show-again' | 'vscode.file-open.open';
2594
2599
 
2595
2600
  /** @public */
2596
2601
  declare interface TLUiTranslationProviderProps {
@@ -2701,6 +2706,7 @@ declare class Translating extends StateNode {
2701
2706
  onInteractionEnd?: string;
2702
2707
  }) => void;
2703
2708
  onExit: () => void;
2709
+ onTick: TLTickEventHandler;
2704
2710
  onPointerMove: () => void;
2705
2711
  onKeyDown: () => void;
2706
2712
  onKeyUp: TLEventHandlers['onKeyUp'];
@@ -2709,7 +2715,6 @@ declare class Translating extends StateNode {
2709
2715
  onCancel: TLEventHandlers['onCancel'];
2710
2716
  protected startCloning(): void;
2711
2717
  protected stopCloning(): void;
2712
- updateParent: () => void;
2713
2718
  reset(): void;
2714
2719
  protected complete(): void;
2715
2720
  private cancel;
@@ -2770,13 +2775,13 @@ declare interface TriangleShape extends TDBaseShape {
2770
2775
  declare function Trigger({ children, 'data-testid': testId, }: {
2771
2776
  children: any;
2772
2777
  'data-testid'?: string;
2773
- }): JSX.Element;
2778
+ }): JSX_2.Element;
2774
2779
 
2775
2780
  /** @public */
2776
2781
  export declare const truncateStringWithEllipsis: (str: string, maxLength: number) => string;
2777
2782
 
2778
2783
  /** @public */
2779
- export declare function UiEventsProvider({ onEvent, children }: EventsProviderProps): JSX.Element;
2784
+ export declare function UiEventsProvider({ onEvent, children }: EventsProviderProps): JSX_2.Element;
2780
2785
 
2781
2786
  /** @public */
2782
2787
  export declare function useActions(): TLUiActionsContextType;
@@ -2904,8 +2909,8 @@ export declare class VideoShapeUtil extends BaseBoxShapeUtil<TLVideoShape> {
2904
2909
  canEdit: () => boolean;
2905
2910
  isAspectRatioLocked: () => boolean;
2906
2911
  getDefaultProps(): TLVideoShape['props'];
2907
- component(shape: TLVideoShape): JSX.Element;
2908
- indicator(shape: TLVideoShape): JSX.Element;
2912
+ component(shape: TLVideoShape): JSX_2.Element;
2913
+ indicator(shape: TLVideoShape): JSX_2.Element;
2909
2914
  toSvg(shape: TLVideoShape): SVGGElement;
2910
2915
  }
2911
2916
 
@@ -79,8 +79,8 @@ class BookmarkShapeUtil extends BaseBoxShapeUtil {
79
79
  {
80
80
  width: toDomPrecision(shape.props.w),
81
81
  height: toDomPrecision(shape.props.h),
82
- rx: "8",
83
- ry: "8"
82
+ rx: "6",
83
+ ry: "6"
84
84
  }
85
85
  );
86
86
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/lib/shapes/bookmark/BookmarkShapeUtil.tsx"],
4
- "sourcesContent": ["import {\n\tAssetRecordType,\n\tBaseBoxShapeUtil,\n\tEditor,\n\tHTMLContainer,\n\tTLAssetId,\n\tTLBookmarkAsset,\n\tTLBookmarkShape,\n\tTLOnBeforeCreateHandler,\n\tTLOnBeforeUpdateHandler,\n\tbookmarkShapeMigrations,\n\tbookmarkShapeProps,\n\tdebounce,\n\tgetHashForString,\n\tisValidUrl,\n\tstopEventPropagation,\n\ttoDomPrecision,\n} from '@bigbluebutton/editor'\nimport { truncateStringWithEllipsis } from '../../utils/text/text'\nimport { HyperlinkButton } from '../shared/HyperlinkButton'\nimport { getRotatedBoxShadow } from '../shared/rotated-box-shadow'\n\n/** @public */\nexport class BookmarkShapeUtil extends BaseBoxShapeUtil<TLBookmarkShape> {\n\tstatic override type = 'bookmark' as const\n\tstatic override props = bookmarkShapeProps\n\tstatic override migrations = bookmarkShapeMigrations\n\n\toverride canResize = () => false\n\n\toverride hideSelectionBoundsFg = () => true\n\n\toverride getDefaultProps(): TLBookmarkShape['props'] {\n\t\treturn {\n\t\t\turl: '',\n\t\t\tw: 300,\n\t\t\th: 320,\n\t\t\tassetId: null,\n\t\t}\n\t}\n\n\toverride component(shape: TLBookmarkShape) {\n\t\tconst asset = (\n\t\t\tshape.props.assetId ? this.editor.getAsset(shape.props.assetId) : null\n\t\t) as TLBookmarkAsset\n\n\t\tconst pageRotation = this.editor.getShapePageTransform(shape)!.rotation()\n\n\t\tconst address = getHumanReadableAddress(shape)\n\n\t\treturn (\n\t\t\t<HTMLContainer>\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"tl-bookmark__container\"\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tboxShadow: getRotatedBoxShadow(pageRotation),\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<div className=\"tl-bookmark__image_container\">\n\t\t\t\t\t\t{asset?.props.image ? (\n\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\tclassName=\"tl-bookmark__image\"\n\t\t\t\t\t\t\t\tdraggable={false}\n\t\t\t\t\t\t\t\tsrc={asset?.props.image}\n\t\t\t\t\t\t\t\talt={asset?.props.title || ''}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div className=\"tl-bookmark__placeholder\" />\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<HyperlinkButton url={shape.props.url} zoomLevel={this.editor.getZoomLevel()} />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"tl-bookmark__copy_container\">\n\t\t\t\t\t\t{asset?.props.title && (\n\t\t\t\t\t\t\t<h2 className=\"tl-bookmark__heading\">\n\t\t\t\t\t\t\t\t{truncateStringWithEllipsis(asset?.props.title || '', 54)}\n\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{asset?.props.description && (\n\t\t\t\t\t\t\t<p className=\"tl-bookmark__description\">\n\t\t\t\t\t\t\t\t{truncateStringWithEllipsis(asset?.props.description || '', 128)}\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\tclassName=\"tl-bookmark__link\"\n\t\t\t\t\t\t\thref={shape.props.url || ''}\n\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\tonPointerDown={stopEventPropagation}\n\t\t\t\t\t\t\tonPointerUp={stopEventPropagation}\n\t\t\t\t\t\t\tonClick={stopEventPropagation}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{truncateStringWithEllipsis(address, 45)}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</HTMLContainer>\n\t\t)\n\t}\n\n\toverride indicator(shape: TLBookmarkShape) {\n\t\treturn (\n\t\t\t<rect\n\t\t\t\twidth={toDomPrecision(shape.props.w)}\n\t\t\t\theight={toDomPrecision(shape.props.h)}\n\t\t\t\trx=\"8\"\n\t\t\t\try=\"8\"\n\t\t\t/>\n\t\t)\n\t}\n\n\toverride onBeforeCreate?: TLOnBeforeCreateHandler<TLBookmarkShape> = (shape) => {\n\t\tupdateBookmarkAssetOnUrlChange(this.editor, shape)\n\t}\n\n\toverride onBeforeUpdate?: TLOnBeforeUpdateHandler<TLBookmarkShape> = (prev, shape) => {\n\t\tif (prev.props.url !== shape.props.url) {\n\t\t\tif (!isValidUrl(shape.props.url)) {\n\t\t\t\treturn { ...shape, props: { ...shape.props, url: prev.props.url } }\n\t\t\t} else {\n\t\t\t\tupdateBookmarkAssetOnUrlChange(this.editor, shape)\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** @internal */\nexport const getHumanReadableAddress = (shape: TLBookmarkShape) => {\n\ttry {\n\t\tconst url = new URL(shape.props.url)\n\t\tconst path = url.pathname.replace(/\\/*$/, '')\n\t\treturn `${url.hostname}${path}`\n\t} catch (e) {\n\t\treturn shape.props.url\n\t}\n}\n\nfunction updateBookmarkAssetOnUrlChange(editor: Editor, shape: TLBookmarkShape) {\n\tconst { url } = shape.props\n\n\t// Derive the asset id from the URL\n\tconst assetId: TLAssetId = AssetRecordType.createId(getHashForString(url))\n\n\tif (editor.getAsset(assetId)) {\n\t\t// Existing asset for this URL?\n\t\tif (shape.props.assetId !== assetId) {\n\t\t\teditor.updateShapes<TLBookmarkShape>([\n\t\t\t\t{\n\t\t\t\t\tid: shape.id,\n\t\t\t\t\ttype: shape.type,\n\t\t\t\t\tprops: { assetId },\n\t\t\t\t},\n\t\t\t])\n\t\t}\n\t} else {\n\t\t// No asset for this URL?\n\n\t\t// First, clear out the existing asset reference\n\t\teditor.updateShapes<TLBookmarkShape>([\n\t\t\t{\n\t\t\t\tid: shape.id,\n\t\t\t\ttype: shape.type,\n\t\t\t\tprops: { assetId: null },\n\t\t\t},\n\t\t])\n\n\t\t// Then try to asyncronously create a new one\n\t\tcreateBookmarkAssetOnUrlChange(editor, shape)\n\t}\n}\n\nconst createBookmarkAssetOnUrlChange = debounce(async (editor: Editor, shape: TLBookmarkShape) => {\n\tconst { url } = shape.props\n\n\t// Create the asset using the external content manager's createAssetFromUrl method.\n\t// This may be overwritten by the user (for example, we overwrite it on tldraw.com)\n\tconst asset = await editor.getAssetForExternalContent({ type: 'url', url })\n\n\tif (!asset) {\n\t\t// No asset? Just leave the bookmark as a null assetId.\n\t\treturn\n\t}\n\n\teditor.batch(() => {\n\t\t// Create the new asset\n\t\teditor.createAssets([asset])\n\n\t\t// And update the shape\n\t\teditor.updateShapes<TLBookmarkShape>([\n\t\t\t{\n\t\t\t\tid: shape.id,\n\t\t\t\ttype: shape.type,\n\t\t\t\tprops: { assetId: asset.id },\n\t\t\t},\n\t\t])\n\t})\n}, 500)\n"],
4
+ "sourcesContent": ["import {\n\tAssetRecordType,\n\tBaseBoxShapeUtil,\n\tEditor,\n\tHTMLContainer,\n\tTLAssetId,\n\tTLBookmarkAsset,\n\tTLBookmarkShape,\n\tTLOnBeforeCreateHandler,\n\tTLOnBeforeUpdateHandler,\n\tbookmarkShapeMigrations,\n\tbookmarkShapeProps,\n\tdebounce,\n\tgetHashForString,\n\tisValidUrl,\n\tstopEventPropagation,\n\ttoDomPrecision,\n} from '@bigbluebutton/editor'\nimport { truncateStringWithEllipsis } from '../../utils/text/text'\nimport { HyperlinkButton } from '../shared/HyperlinkButton'\nimport { getRotatedBoxShadow } from '../shared/rotated-box-shadow'\n\n/** @public */\nexport class BookmarkShapeUtil extends BaseBoxShapeUtil<TLBookmarkShape> {\n\tstatic override type = 'bookmark' as const\n\tstatic override props = bookmarkShapeProps\n\tstatic override migrations = bookmarkShapeMigrations\n\n\toverride canResize = () => false\n\n\toverride hideSelectionBoundsFg = () => true\n\n\toverride getDefaultProps(): TLBookmarkShape['props'] {\n\t\treturn {\n\t\t\turl: '',\n\t\t\tw: 300,\n\t\t\th: 320,\n\t\t\tassetId: null,\n\t\t}\n\t}\n\n\toverride component(shape: TLBookmarkShape) {\n\t\tconst asset = (\n\t\t\tshape.props.assetId ? this.editor.getAsset(shape.props.assetId) : null\n\t\t) as TLBookmarkAsset\n\n\t\tconst pageRotation = this.editor.getShapePageTransform(shape)!.rotation()\n\n\t\tconst address = getHumanReadableAddress(shape)\n\n\t\treturn (\n\t\t\t<HTMLContainer>\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"tl-bookmark__container\"\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tboxShadow: getRotatedBoxShadow(pageRotation),\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<div className=\"tl-bookmark__image_container\">\n\t\t\t\t\t\t{asset?.props.image ? (\n\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\tclassName=\"tl-bookmark__image\"\n\t\t\t\t\t\t\t\tdraggable={false}\n\t\t\t\t\t\t\t\tsrc={asset?.props.image}\n\t\t\t\t\t\t\t\talt={asset?.props.title || ''}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div className=\"tl-bookmark__placeholder\" />\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<HyperlinkButton url={shape.props.url} zoomLevel={this.editor.getZoomLevel()} />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"tl-bookmark__copy_container\">\n\t\t\t\t\t\t{asset?.props.title && (\n\t\t\t\t\t\t\t<h2 className=\"tl-bookmark__heading\">\n\t\t\t\t\t\t\t\t{truncateStringWithEllipsis(asset?.props.title || '', 54)}\n\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{asset?.props.description && (\n\t\t\t\t\t\t\t<p className=\"tl-bookmark__description\">\n\t\t\t\t\t\t\t\t{truncateStringWithEllipsis(asset?.props.description || '', 128)}\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\tclassName=\"tl-bookmark__link\"\n\t\t\t\t\t\t\thref={shape.props.url || ''}\n\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\tonPointerDown={stopEventPropagation}\n\t\t\t\t\t\t\tonPointerUp={stopEventPropagation}\n\t\t\t\t\t\t\tonClick={stopEventPropagation}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{truncateStringWithEllipsis(address, 45)}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</HTMLContainer>\n\t\t)\n\t}\n\n\toverride indicator(shape: TLBookmarkShape) {\n\t\treturn (\n\t\t\t<rect\n\t\t\t\twidth={toDomPrecision(shape.props.w)}\n\t\t\t\theight={toDomPrecision(shape.props.h)}\n\t\t\t\trx=\"6\"\n\t\t\t\try=\"6\"\n\t\t\t/>\n\t\t)\n\t}\n\n\toverride onBeforeCreate?: TLOnBeforeCreateHandler<TLBookmarkShape> = (shape) => {\n\t\tupdateBookmarkAssetOnUrlChange(this.editor, shape)\n\t}\n\n\toverride onBeforeUpdate?: TLOnBeforeUpdateHandler<TLBookmarkShape> = (prev, shape) => {\n\t\tif (prev.props.url !== shape.props.url) {\n\t\t\tif (!isValidUrl(shape.props.url)) {\n\t\t\t\treturn { ...shape, props: { ...shape.props, url: prev.props.url } }\n\t\t\t} else {\n\t\t\t\tupdateBookmarkAssetOnUrlChange(this.editor, shape)\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** @internal */\nexport const getHumanReadableAddress = (shape: TLBookmarkShape) => {\n\ttry {\n\t\tconst url = new URL(shape.props.url)\n\t\tconst path = url.pathname.replace(/\\/*$/, '')\n\t\treturn `${url.hostname}${path}`\n\t} catch (e) {\n\t\treturn shape.props.url\n\t}\n}\n\nfunction updateBookmarkAssetOnUrlChange(editor: Editor, shape: TLBookmarkShape) {\n\tconst { url } = shape.props\n\n\t// Derive the asset id from the URL\n\tconst assetId: TLAssetId = AssetRecordType.createId(getHashForString(url))\n\n\tif (editor.getAsset(assetId)) {\n\t\t// Existing asset for this URL?\n\t\tif (shape.props.assetId !== assetId) {\n\t\t\teditor.updateShapes<TLBookmarkShape>([\n\t\t\t\t{\n\t\t\t\t\tid: shape.id,\n\t\t\t\t\ttype: shape.type,\n\t\t\t\t\tprops: { assetId },\n\t\t\t\t},\n\t\t\t])\n\t\t}\n\t} else {\n\t\t// No asset for this URL?\n\n\t\t// First, clear out the existing asset reference\n\t\teditor.updateShapes<TLBookmarkShape>([\n\t\t\t{\n\t\t\t\tid: shape.id,\n\t\t\t\ttype: shape.type,\n\t\t\t\tprops: { assetId: null },\n\t\t\t},\n\t\t])\n\n\t\t// Then try to asyncronously create a new one\n\t\tcreateBookmarkAssetOnUrlChange(editor, shape)\n\t}\n}\n\nconst createBookmarkAssetOnUrlChange = debounce(async (editor: Editor, shape: TLBookmarkShape) => {\n\tconst { url } = shape.props\n\n\t// Create the asset using the external content manager's createAssetFromUrl method.\n\t// This may be overwritten by the user (for example, we overwrite it on tldraw.com)\n\tconst asset = await editor.getAssetForExternalContent({ type: 'url', url })\n\n\tif (!asset) {\n\t\t// No asset? Just leave the bookmark as a null assetId.\n\t\treturn\n\t}\n\n\teditor.batch(() => {\n\t\t// Create the new asset\n\t\teditor.createAssets([asset])\n\n\t\t// And update the shape\n\t\teditor.updateShapes<TLBookmarkShape>([\n\t\t\t{\n\t\t\t\tid: shape.id,\n\t\t\t\ttype: shape.type,\n\t\t\t\tprops: { assetId: asset.id },\n\t\t\t},\n\t\t])\n\t})\n}, 500)\n"],
5
5
  "mappings": "AA0DK,SAEE,KAFF;AA1DL;AAAA,EACC;AAAA,EACA;AAAA,EAEA;AAAA,EAMA;AAAA,EACA;AAAA,EACA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,IAAI,MAAM;AAGtB,QAAM,UAAqB,gBAAgB,SAAS,iBAAiB,GAAG,CAAC;AAEzE,MAAI,OAAO,SAAS,OAAO,GAAG;AAE7B,QAAI,MAAM,MAAM,YAAY,SAAS;AACpC,aAAO,aAA8B;AAAA,QACpC;AAAA,UACC,IAAI,MAAM;AAAA,UACV,MAAM,MAAM;AAAA,UACZ,OAAO,EAAE,QAAQ;AAAA,QAClB;AAAA,MACD,CAAC;AAAA,IACF;AAAA,EACD,OAAO;AAIN,WAAO,aAA8B;AAAA,MACpC;AAAA,QACC,IAAI,MAAM;AAAA,QACV,MAAM,MAAM;AAAA,QACZ,OAAO,EAAE,SAAS,KAAK;AAAA,MACxB;AAAA,IACD,CAAC;AAGD,mCAA+B,QAAQ,KAAK;AAAA,EAC7C;AACD;AAEA,MAAM,iCAAiC,SAAS,OAAO,QAAgB,UAA2B;AACjG,QAAM,EAAE,IAAI,IAAI,MAAM;AAItB,QAAM,QAAQ,MAAM,OAAO,2BAA2B,EAAE,MAAM,OAAO,IAAI,CAAC;AAE1E,MAAI,CAAC,OAAO;AAEX;AAAA,EACD;AAEA,SAAO,MAAM,MAAM;AAElB,WAAO,aAAa,CAAC,KAAK,CAAC;AAG3B,WAAO,aAA8B;AAAA,MACpC;AAAA,QACC,IAAI,MAAM;AAAA,QACV,MAAM,MAAM;AAAA,QACZ,OAAO,EAAE,SAAS,MAAM,GAAG;AAAA,MAC5B;AAAA,IACD,CAAC;AAAA,EACF,CAAC;AACF,GAAG,GAAG;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,7 @@ import {
2
2
  Box2d,
3
3
  HIT_TEST_MARGIN,
4
4
  StateNode,
5
+ moveCameraWhenCloseToEdge,
5
6
  pointInPolygon,
6
7
  polygonsIntersect
7
8
  } from "@bigbluebutton/editor";
@@ -33,6 +34,9 @@ class Brushing extends StateNode {
33
34
  this.initialSelectedShapeIds = [];
34
35
  this.editor.updateInstanceState({ brush: null });
35
36
  };
37
+ onTick = () => {
38
+ moveCameraWhenCloseToEdge(this.editor);
39
+ };
36
40
  onPointerMove = () => {
37
41
  this.hitTestShapes();
38
42
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/lib/tools/SelectTool/childStates/Brushing.ts"],
4
- "sourcesContent": ["import {\n\tBox2d,\n\tHIT_TEST_MARGIN,\n\tMatrix2d,\n\tStateNode,\n\tTLCancelEvent,\n\tTLEventHandlers,\n\tTLFrameShape,\n\tTLGroupShape,\n\tTLInterruptEvent,\n\tTLKeyboardEvent,\n\tTLPageId,\n\tTLPointerEventInfo,\n\tTLShape,\n\tTLShapeId,\n\tVec2d,\n\tpointInPolygon,\n\tpolygonsIntersect,\n} from '@bigbluebutton/editor'\n\nexport class Brushing extends StateNode {\n\tstatic override id = 'brushing'\n\n\tinfo = {} as TLPointerEventInfo & { target: 'canvas' }\n\n\tbrush = new Box2d()\n\tinitialSelectedShapeIds: TLShapeId[] = []\n\texcludedShapeIds = new Set<TLShapeId>()\n\n\t// The shape that the brush started on\n\tinitialStartShape: TLShape | null = null\n\n\toverride onEnter = (info: TLPointerEventInfo & { target: 'canvas' }) => {\n\t\tconst { altKey, currentPagePoint } = this.editor.inputs\n\n\t\tif (altKey) {\n\t\t\tthis.parent.transition('scribble_brushing', info)\n\t\t\treturn\n\t\t}\n\n\t\tthis.excludedShapeIds = new Set(\n\t\t\tthis.editor\n\t\t\t\t.getCurrentPageShapes()\n\t\t\t\t.filter(\n\t\t\t\t\t(shape) =>\n\t\t\t\t\t\tthis.editor.isShapeOfType<TLGroupShape>(shape, 'group') ||\n\t\t\t\t\t\tthis.editor.isShapeOrAncestorLocked(shape)\n\t\t\t\t)\n\t\t\t\t.map((shape) => shape.id)\n\t\t)\n\n\t\tthis.info = info\n\t\tthis.initialSelectedShapeIds = this.editor.getSelectedShapeIds().slice()\n\t\tthis.initialStartShape = this.editor.getShapesAtPoint(currentPagePoint)[0]\n\t\tthis.onPointerMove()\n\t}\n\n\toverride onExit = () => {\n\t\tthis.initialSelectedShapeIds = []\n\t\tthis.editor.updateInstanceState({ brush: null })\n\t}\n\n\toverride onPointerMove = () => {\n\t\tthis.hitTestShapes()\n\t}\n\n\toverride onPointerUp: TLEventHandlers['onPointerUp'] = () => {\n\t\tthis.complete()\n\t}\n\n\toverride onComplete: TLEventHandlers['onComplete'] = () => {\n\t\tthis.complete()\n\t}\n\n\toverride onCancel?: TLCancelEvent | undefined = (info) => {\n\t\tthis.editor.setSelectedShapes(this.initialSelectedShapeIds, { squashing: true })\n\t\tthis.parent.transition('idle', info)\n\t}\n\n\toverride onKeyDown: TLEventHandlers['onKeyDown'] = (info) => {\n\t\tif (this.editor.inputs.altKey) {\n\t\t\tthis.parent.transition('scribble_brushing', info)\n\t\t} else {\n\t\t\tthis.hitTestShapes()\n\t\t}\n\t}\n\n\toverride onKeyUp?: TLKeyboardEvent | undefined = () => {\n\t\tthis.hitTestShapes()\n\t}\n\n\tprivate complete() {\n\t\tthis.parent.transition('idle')\n\t}\n\n\tprivate hitTestShapes() {\n\t\tconst zoomLevel = this.editor.getZoomLevel()\n\t\tconst currentPageShapes = this.editor.getCurrentPageShapes()\n\t\tconst currentPageId = this.editor.getCurrentPageId()\n\t\tconst {\n\t\t\tinputs: { originPagePoint, currentPagePoint, shiftKey, ctrlKey },\n\t\t} = this.editor\n\n\t\t// Set the brush to contain the current and origin points\n\t\tthis.brush.setTo(Box2d.FromPoints([originPagePoint, currentPagePoint]))\n\n\t\t// We'll be collecting shape ids\n\t\tconst results = new Set(shiftKey ? this.initialSelectedShapeIds : [])\n\n\t\tlet A: Vec2d,\n\t\t\tB: Vec2d,\n\t\t\tshape: TLShape,\n\t\t\tpageBounds: Box2d | undefined,\n\t\t\tpageTransform: Matrix2d | undefined,\n\t\t\tlocalCorners: Vec2d[]\n\n\t\t// We'll be testing the corners of the brush against the shapes\n\t\tconst { corners } = this.brush\n\n\t\tconst { excludedShapeIds } = this\n\n\t\ttestAllShapes: for (let i = 0, n = currentPageShapes.length; i < n; i++) {\n\t\t\tshape = currentPageShapes[i]\n\t\t\tif (excludedShapeIds.has(shape.id)) continue testAllShapes\n\t\t\tif (results.has(shape.id)) continue testAllShapes\n\n\t\t\tpageBounds = this.editor.getShapePageBounds(shape)\n\t\t\tif (!pageBounds) continue testAllShapes\n\n\t\t\t// If the brush fully wraps a shape, it's almost certainly a hit\n\t\t\tif (this.brush.contains(pageBounds)) {\n\t\t\t\tthis.handleHit(shape, currentPagePoint, currentPageId, results, corners)\n\t\t\t\tcontinue testAllShapes\n\t\t\t}\n\n\t\t\t// Should we even test for a single segment intersections? Only if\n\t\t\t// we're not holding the ctrl key for alternate selection mode\n\t\t\t// (only wraps count!), or if the shape is a frame.\n\t\t\tif (ctrlKey || this.editor.isShapeOfType<TLFrameShape>(shape, 'frame')) {\n\t\t\t\tcontinue testAllShapes\n\t\t\t}\n\n\t\t\t// If the brush collides the page bounds, then do hit tests against\n\t\t\t// each of the brush's four sides.\n\t\t\tif (this.brush.collides(pageBounds)) {\n\t\t\t\t// Shapes expect to hit test line segments in their own coordinate system,\n\t\t\t\t// so we first need to get the brush corners in the shape's local space.\n\t\t\t\tconst geometry = this.editor.getShapeGeometry(shape)\n\n\t\t\t\tpageTransform = this.editor.getShapePageTransform(shape)\n\n\t\t\t\tif (!pageTransform) {\n\t\t\t\t\tcontinue testAllShapes\n\t\t\t\t}\n\n\t\t\t\t// Check whether any of the the brush edges intersect the shape\n\t\t\t\tlocalCorners = pageTransform.clone().invert().applyToPoints(corners)\n\n\t\t\t\thitTestBrushEdges: for (let i = 0; i < localCorners.length; i++) {\n\t\t\t\t\tA = localCorners[i]\n\t\t\t\t\tB = localCorners[(i + 1) % localCorners.length]\n\n\t\t\t\t\tif (geometry.hitTestLineSegment(A, B, HIT_TEST_MARGIN / zoomLevel)) {\n\t\t\t\t\t\tthis.handleHit(shape, currentPagePoint, currentPageId, results, corners)\n\t\t\t\t\t\tbreak hitTestBrushEdges\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.editor.updateInstanceState({ brush: { ...this.brush.toJson() } })\n\t\tthis.editor.setSelectedShapes(Array.from(results), { squashing: true })\n\t}\n\n\toverride onInterrupt: TLInterruptEvent = () => {\n\t\tthis.editor.updateInstanceState({ brush: null })\n\t}\n\n\tprivate handleHit(\n\t\tshape: TLShape,\n\t\tcurrentPagePoint: Vec2d,\n\t\tcurrentPageId: TLPageId,\n\t\tresults: Set<TLShapeId>,\n\t\tcorners: Vec2d[]\n\t) {\n\t\tif (shape.parentId === currentPageId) {\n\t\t\tresults.add(shape.id)\n\t\t\treturn\n\t\t}\n\n\t\t// Find the outermost selectable shape, check to see if it has a\n\t\t// page mask; and if so, check to see if the brush intersects it\n\t\tconst selectedShape = this.editor.getOutermostSelectableShape(shape)\n\t\tconst pageMask = this.editor.getShapeMask(selectedShape.id)\n\n\t\tif (\n\t\t\tpageMask &&\n\t\t\t!polygonsIntersect(pageMask, corners) &&\n\t\t\t!pointInPolygon(currentPagePoint, pageMask)\n\t\t) {\n\t\t\treturn\n\t\t}\n\n\t\tresults.add(selectedShape.id)\n\t}\n}\n"],
5
- "mappings": "AAAA;AAAA,EACC;AAAA,EACA;AAAA,EAEA;AAAA,EAYA;AAAA,EACA;AAAA,OACM;AAEA,MAAM,iBAAiB,UAAU;AAAA,EACvC,OAAgB,KAAK;AAAA,EAErB,OAAO,CAAC;AAAA,EAER,QAAQ,IAAI,MAAM;AAAA,EAClB,0BAAuC,CAAC;AAAA,EACxC,mBAAmB,oBAAI,IAAe;AAAA;AAAA,EAGtC,oBAAoC;AAAA,EAE3B,UAAU,CAAC,SAAoD;AACvE,UAAM,EAAE,QAAQ,iBAAiB,IAAI,KAAK,OAAO;AAEjD,QAAI,QAAQ;AACX,WAAK,OAAO,WAAW,qBAAqB,IAAI;AAChD;AAAA,IACD;AAEA,SAAK,mBAAmB,IAAI;AAAA,MAC3B,KAAK,OACH,qBAAqB,EACrB;AAAA,QACA,CAAC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AAA,QACD;AAAA,MACD;AAEA,SAAK,OAAO,oBAAoB,EAAE,OAAO,EAAE,GAAG,KAAK,MAAM,OAAO,EAAE,EAAE,CAAC;AACrE,SAAK,OAAO,kBAAkB,MAAM,KAAK,OAAO,GAAG,EAAE,WAAW,KAAK,CAAC;AAAA,EACvE;AAAA,EAES,cAAgC,MAAM;AAC9C,SAAK,OAAO,oBAAoB,EAAE,OAAO,KAAK,CAAC;AAAA,EAChD;AAAA,EAEQ,UACP,OACA,kBACA,eACA,SACA,SACC;AACD,QAAI,MAAM,aAAa,eAAe;AACrC,cAAQ,IAAI,MAAM,EAAE;AACpB;AAAA,IACD;AAIA,UAAM,gBAAgB,KAAK,OAAO,4BAA4B,KAAK;AACnE,UAAM,WAAW,KAAK,OAAO,aAAa,cAAc,EAAE;AAE1D,QACC,YACA,CAAC,kBAAkB,UAAU,OAAO,KACpC,CAAC,eAAe,kBAAkB,QAAQ,GACzC;AACD;AAAA,IACD;AAEA,YAAQ,IAAI,cAAc,EAAE;AAAA,EAC7B;AACD;",
4
+ "sourcesContent": ["import {\n\tBox2d,\n\tHIT_TEST_MARGIN,\n\tMatrix2d,\n\tStateNode,\n\tTLCancelEvent,\n\tTLEventHandlers,\n\tTLFrameShape,\n\tTLGroupShape,\n\tTLInterruptEvent,\n\tTLKeyboardEvent,\n\tTLPageId,\n\tTLPointerEventInfo,\n\tTLShape,\n\tTLShapeId,\n\tTLTickEventHandler,\n\tVec2d,\n\tmoveCameraWhenCloseToEdge,\n\tpointInPolygon,\n\tpolygonsIntersect,\n} from '@bigbluebutton/editor'\n\nexport class Brushing extends StateNode {\n\tstatic override id = 'brushing'\n\n\tinfo = {} as TLPointerEventInfo & { target: 'canvas' }\n\n\tbrush = new Box2d()\n\tinitialSelectedShapeIds: TLShapeId[] = []\n\texcludedShapeIds = new Set<TLShapeId>()\n\n\t// The shape that the brush started on\n\tinitialStartShape: TLShape | null = null\n\n\toverride onEnter = (info: TLPointerEventInfo & { target: 'canvas' }) => {\n\t\tconst { altKey, currentPagePoint } = this.editor.inputs\n\n\t\tif (altKey) {\n\t\t\tthis.parent.transition('scribble_brushing', info)\n\t\t\treturn\n\t\t}\n\n\t\tthis.excludedShapeIds = new Set(\n\t\t\tthis.editor\n\t\t\t\t.getCurrentPageShapes()\n\t\t\t\t.filter(\n\t\t\t\t\t(shape) =>\n\t\t\t\t\t\tthis.editor.isShapeOfType<TLGroupShape>(shape, 'group') ||\n\t\t\t\t\t\tthis.editor.isShapeOrAncestorLocked(shape)\n\t\t\t\t)\n\t\t\t\t.map((shape) => shape.id)\n\t\t)\n\n\t\tthis.info = info\n\t\tthis.initialSelectedShapeIds = this.editor.getSelectedShapeIds().slice()\n\t\tthis.initialStartShape = this.editor.getShapesAtPoint(currentPagePoint)[0]\n\t\tthis.onPointerMove()\n\t}\n\n\toverride onExit = () => {\n\t\tthis.initialSelectedShapeIds = []\n\t\tthis.editor.updateInstanceState({ brush: null })\n\t}\n\n\toverride onTick: TLTickEventHandler = () => {\n\t\tmoveCameraWhenCloseToEdge(this.editor)\n\t}\n\n\toverride onPointerMove = () => {\n\t\tthis.hitTestShapes()\n\t}\n\n\toverride onPointerUp: TLEventHandlers['onPointerUp'] = () => {\n\t\tthis.complete()\n\t}\n\n\toverride onComplete: TLEventHandlers['onComplete'] = () => {\n\t\tthis.complete()\n\t}\n\n\toverride onCancel?: TLCancelEvent | undefined = (info) => {\n\t\tthis.editor.setSelectedShapes(this.initialSelectedShapeIds, { squashing: true })\n\t\tthis.parent.transition('idle', info)\n\t}\n\n\toverride onKeyDown: TLEventHandlers['onKeyDown'] = (info) => {\n\t\tif (this.editor.inputs.altKey) {\n\t\t\tthis.parent.transition('scribble_brushing', info)\n\t\t} else {\n\t\t\tthis.hitTestShapes()\n\t\t}\n\t}\n\n\toverride onKeyUp?: TLKeyboardEvent | undefined = () => {\n\t\tthis.hitTestShapes()\n\t}\n\n\tprivate complete() {\n\t\tthis.parent.transition('idle')\n\t}\n\n\tprivate hitTestShapes() {\n\t\tconst zoomLevel = this.editor.getZoomLevel()\n\t\tconst currentPageShapes = this.editor.getCurrentPageShapes()\n\t\tconst currentPageId = this.editor.getCurrentPageId()\n\t\tconst {\n\t\t\tinputs: { originPagePoint, currentPagePoint, shiftKey, ctrlKey },\n\t\t} = this.editor\n\n\t\t// Set the brush to contain the current and origin points\n\t\tthis.brush.setTo(Box2d.FromPoints([originPagePoint, currentPagePoint]))\n\n\t\t// We'll be collecting shape ids\n\t\tconst results = new Set(shiftKey ? this.initialSelectedShapeIds : [])\n\n\t\tlet A: Vec2d,\n\t\t\tB: Vec2d,\n\t\t\tshape: TLShape,\n\t\t\tpageBounds: Box2d | undefined,\n\t\t\tpageTransform: Matrix2d | undefined,\n\t\t\tlocalCorners: Vec2d[]\n\n\t\t// We'll be testing the corners of the brush against the shapes\n\t\tconst { corners } = this.brush\n\n\t\tconst { excludedShapeIds } = this\n\n\t\ttestAllShapes: for (let i = 0, n = currentPageShapes.length; i < n; i++) {\n\t\t\tshape = currentPageShapes[i]\n\t\t\tif (excludedShapeIds.has(shape.id)) continue testAllShapes\n\t\t\tif (results.has(shape.id)) continue testAllShapes\n\n\t\t\tpageBounds = this.editor.getShapePageBounds(shape)\n\t\t\tif (!pageBounds) continue testAllShapes\n\n\t\t\t// If the brush fully wraps a shape, it's almost certainly a hit\n\t\t\tif (this.brush.contains(pageBounds)) {\n\t\t\t\tthis.handleHit(shape, currentPagePoint, currentPageId, results, corners)\n\t\t\t\tcontinue testAllShapes\n\t\t\t}\n\n\t\t\t// Should we even test for a single segment intersections? Only if\n\t\t\t// we're not holding the ctrl key for alternate selection mode\n\t\t\t// (only wraps count!), or if the shape is a frame.\n\t\t\tif (ctrlKey || this.editor.isShapeOfType<TLFrameShape>(shape, 'frame')) {\n\t\t\t\tcontinue testAllShapes\n\t\t\t}\n\n\t\t\t// If the brush collides the page bounds, then do hit tests against\n\t\t\t// each of the brush's four sides.\n\t\t\tif (this.brush.collides(pageBounds)) {\n\t\t\t\t// Shapes expect to hit test line segments in their own coordinate system,\n\t\t\t\t// so we first need to get the brush corners in the shape's local space.\n\t\t\t\tconst geometry = this.editor.getShapeGeometry(shape)\n\n\t\t\t\tpageTransform = this.editor.getShapePageTransform(shape)\n\n\t\t\t\tif (!pageTransform) {\n\t\t\t\t\tcontinue testAllShapes\n\t\t\t\t}\n\n\t\t\t\t// Check whether any of the the brush edges intersect the shape\n\t\t\t\tlocalCorners = pageTransform.clone().invert().applyToPoints(corners)\n\n\t\t\t\thitTestBrushEdges: for (let i = 0; i < localCorners.length; i++) {\n\t\t\t\t\tA = localCorners[i]\n\t\t\t\t\tB = localCorners[(i + 1) % localCorners.length]\n\n\t\t\t\t\tif (geometry.hitTestLineSegment(A, B, HIT_TEST_MARGIN / zoomLevel)) {\n\t\t\t\t\t\tthis.handleHit(shape, currentPagePoint, currentPageId, results, corners)\n\t\t\t\t\t\tbreak hitTestBrushEdges\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.editor.updateInstanceState({ brush: { ...this.brush.toJson() } })\n\t\tthis.editor.setSelectedShapes(Array.from(results), { squashing: true })\n\t}\n\n\toverride onInterrupt: TLInterruptEvent = () => {\n\t\tthis.editor.updateInstanceState({ brush: null })\n\t}\n\n\tprivate handleHit(\n\t\tshape: TLShape,\n\t\tcurrentPagePoint: Vec2d,\n\t\tcurrentPageId: TLPageId,\n\t\tresults: Set<TLShapeId>,\n\t\tcorners: Vec2d[]\n\t) {\n\t\tif (shape.parentId === currentPageId) {\n\t\t\tresults.add(shape.id)\n\t\t\treturn\n\t\t}\n\n\t\t// Find the outermost selectable shape, check to see if it has a\n\t\t// page mask; and if so, check to see if the brush intersects it\n\t\tconst selectedShape = this.editor.getOutermostSelectableShape(shape)\n\t\tconst pageMask = this.editor.getShapeMask(selectedShape.id)\n\n\t\tif (\n\t\t\tpageMask &&\n\t\t\t!polygonsIntersect(pageMask, corners) &&\n\t\t\t!pointInPolygon(currentPagePoint, pageMask)\n\t\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GACzC;AACD;AAAA,IACD;AAEA,YAAQ,IAAI,cAAc,EAAE;AAAA,EAC7B;AACD;",
6
6
  "names": ["i"]
7
7
  }
@@ -39,7 +39,7 @@ class Idle extends StateNode {
39
39
  switch (info.target) {
40
40
  case "canvas": {
41
41
  const hitShape = getHitShapeOnCanvasPointerDown(this.editor);
42
- if (hitShape) {
42
+ if (hitShape && !hitShape.isLocked) {
43
43
  this.onPointerDown({
44
44
  ...info,
45
45
  shape: hitShape,
@@ -116,7 +116,7 @@ class Idle extends StateNode {
116
116
  }
117
117
  default: {
118
118
  const hoveredShape = this.editor.getHoveredShape();
119
- if (hoveredShape && !this.editor.getSelectedShapeIds().includes(hoveredShape.id)) {
119
+ if (hoveredShape && !this.editor.getSelectedShapeIds().includes(hoveredShape.id) && !hoveredShape.isLocked) {
120
120
  this.onPointerDown({
121
121
  ...info,
122
122
  shape: hoveredShape,