@ibodr/draw 0.2.5 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _ibodr_editor from '@ibodr/editor';
2
- import { Vec, DrDrawShapeSegment, VecModel, PerfectDashTerminal, VecLike, Geometry2dOptions, Geometry2d, Geometry2dFilters, Group2d, Editor, DrShape, DrShapeId, DrEventInfo, DrPointerEventInfo, AssetUtil, DrBookmarkAsset, DrImageAsset, DrAssetId, DrVideoAsset, OverlayUtil, DrOverlay, BindingUtil, DrArrowBinding, DrArrowBindingProps, BindingOnCreateOptions, BindingOnChangeOptions, BindingOnShapeChangeOptions, BindingOnShapeIsolateOptions, OverlayOptionsWithDisplayValues, DrScribble, DrCollaboratorCursorLayout, DrCollaboratorCursorProps, DrHandle, DrCursorType, DrSelectionHandle, RotateCorner, SnapIndicator, ShapeIndicatorOverlayUtil, Atom, DrBookmarkShape, DrAsset, DrContent, DrFileExternalAsset, DrFileReplaceExternalContent, DrUrlExternalAsset, StateNode, DrStateNodeConstructor, BaseBoxShapeTool, DrTheme, Box, DrArrowShape, DrDefaultSizeStyle, DrArrowShapeArrowheadStyle, ShapeUtil, DrShapeUtilCanBindOpts, DrShapeUtilCanBeLaidOutOpts, DrHandleDragInfo, DrArrowShapeProps, DrResizeInfo, DrShapePartial, SvgExportContext, DrShapeUtilCanvasSvgDef, BaseBoxShapeUtil, DrBookmarkShapeProps, DrDrawShape, Polyline2d, Circle2d, DrDrawShapeProps, DrEmbedShape, DrEmbedShapeProps, DrFrameShape, BaseFrameLikeShapeUtil, DrShapeUtilConstructor, DrEditStartInfo, DrFrameShapeProps, DrClickEventInfo, DrGeoShape, HandleSnapGeometry, DrGeoShapeProps, DrHighlightShape, Polygon2d, DrHighlightShapeProps, DrImageShape, DrImageShapeProps, DrLineShape, DrLineShapePoint, DrNoteShape, IndexKey, DrNoteShapeProps, DrTextShape, DrGeometryOpts, Rectangle2d, DrVideoShape, DrKeyboardEventInfo, DrArrowShapeKind, ElbowArrowSnap, Result, ShapeWithCrop, DrCropInfo, DrShapeCrop, DrFontFace, ExtractShapeByProps, DrRichText, DrThemeColors, RecursivePartial, ReadonlySharedStyleMap, DrEditorComponents, DrawEditorBaseProps, DrTextOptions, DrawEditorStoreProps, DrImageExportOptions, DrEditorSnapshot, DrStoreSnapshot, DrPageId, DrAnyShapeUtilConstructor, DrAnyBindingUtilConstructor, DrawOptions, DebugFlag, StyleProp, SharedStyle, TiptapEditor, DrClipboardWriteInfo, DrExportType, RichTextFontVisitorState, SerializedSchema, UnknownRecord, MigrationFailureReason, DrSchema, DrStore } from '@ibodr/editor';
2
+ import { Vec, DrDrawShapeSegment, VecModel, PerfectDashTerminal, VecLike, Geometry2dOptions, MatLike, Geometry2d, Geometry2dFilters, Group2d, Editor, DrShape, DrShapeId, DrEventInfo, DrPointerEventInfo, AssetUtil, DrBookmarkAsset, DrImageAsset, DrAssetId, DrVideoAsset, BindingUtil, DrArrowBinding, DrArrowBindingProps, BindingOnCreateOptions, BindingOnChangeOptions, BindingOnShapeChangeOptions, BindingOnShapeIsolateOptions, OverlayUtil, DrOverlay, OverlayOptionsWithDisplayValues, DrScribble, DrCollaboratorCursorLayout, DrCollaboratorCursorProps, Atom, DrBookmarkShape, DrAsset, DrContent, DrFileExternalAsset, DrFileReplaceExternalContent, DrUrlExternalAsset, DrSelectionHandle, RotateCorner, DrCursorType, DrHandle, SnapIndicator, StateNode, DrStateNodeConstructor, BaseBoxShapeTool, DrTheme, Box, DrArrowShape, DrDefaultSizeStyle, DrArrowShapeArrowheadStyle, ShapeUtil, DrShapeUtilCanBindOpts, DrShapeUtilCanBeLaidOutOpts, DrHandleDragInfo, DrArrowShapeProps, DrResizeInfo, DrShapePartial, SvgExportContext, DrShapeUtilCanvasSvgDef, BaseBoxShapeUtil, Rectangle2d, DrBookmarkShapeProps, DrDrawShape, Polyline2d, Circle2d, DrDrawShapeProps, DrEmbedShape, DrEmbedShapeProps, DrFrameShape, BaseFrameLikeShapeUtil, DrShapeUtilConstructor, DrEditStartInfo, DrFrameShapeProps, DrClickEventInfo, DrGeoShape, HandleSnapGeometry, DrGeoShapeProps, DrHighlightShape, Polygon2d, DrHighlightShapeProps, DrImageShape, DrImageShapeProps, DrLineShape, DrLineShapePoint, DrNoteShape, IndexKey, DrNoteShapeProps, DrTextShape, DrGeometryOpts, DrVideoShape, DrKeyboardEventInfo, RecursivePartial, DrUserId, ReadonlySharedStyleMap, DrEditorComponents, DrawEditorBaseProps, DrTextOptions, DrawEditorStoreProps, DrImageExportOptions, DrEditorSnapshot, DrStoreSnapshot, DrPageId, DrAnyShapeUtilConstructor, DrAnyBindingUtilConstructor, DrAssetStore, DrawOptions, DrArrowShapeKind, ElbowArrowSnap, Result, ShapeWithCrop, DrCropInfo, DrShapeCrop, DrFontFace, ExtractShapeByProps, DrRichText, DrThemeColors, DebugFlag, StyleProp, SharedStyle, TiptapEditor, DrClipboardWriteInfo, DrExportType, SerializedSchema, UnknownRecord, MigrationFailureReason, DrSchema, DrStore, RichTextFontVisitorState } from '@ibodr/editor';
3
3
  export * from '@ibodr/editor';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import * as React$1 from 'react';
@@ -7,9 +7,12 @@ import React__default, { SVGProps, HTMLAttributes, ReactNode, ReactElement, Comp
7
7
  import * as _ibodr_store from '@ibodr/store';
8
8
  import * as _ibodr_validate from '@ibodr/validate';
9
9
  import * as _ibodr_schema from '@ibodr/schema';
10
+ import { DrShapeId as DrShapeId$1 } from '@ibodr/schema';
10
11
  import * as _ibodr_utils from '@ibodr/utils';
11
- import { Extension, Extensions } from '@tiptap/core';
12
+ import { Extension, Extensions, Node as Node$1 } from '@tiptap/core';
13
+ export { Extension, Extensions, JSONContent, Mark, Node, getSchema, mergeAttributes } from '@tiptap/core';
12
14
  import { Node } from '@tiptap/pm/model';
15
+ import { StarterKitOptions } from '@tiptap/starter-kit';
13
16
 
14
17
  /**
15
18
  * The options object for `getStroke` or `getStrokePoints`.
@@ -51,7 +54,6 @@ interface StrokeOptions {
51
54
  interface StrokePoint {
52
55
  point: Vec;
53
56
  input: Vec;
54
- vector: Vec;
55
57
  pressure: number;
56
58
  distance: number;
57
59
  runningLength: number;
@@ -189,6 +191,15 @@ declare class PathBuilder {
189
191
  cubicBezierTo(x: number, y: number, cp1X: number, cp1Y: number, cp2X: number, cp2Y: number, opts?: PathBuilderCommandOpts): this;
190
192
  private cubicBezierToWithResolution;
191
193
  close(): this;
194
+ /**
195
+ * Return a new path with every point (including bezier control points) transformed by the given
196
+ * affine matrix. Command metadata (fill, dash, close state, draw offsets, etc.) is preserved, so
197
+ * this can be used to mirror, scale, translate, or otherwise transform a finished path while
198
+ * keeping it renderable and hit-testable.
199
+ *
200
+ * @param mat - The affine matrix to apply to each point.
201
+ */
202
+ transform(mat: MatLike): PathBuilder;
192
203
  toD(opts?: PathBuilderToDOpts): string;
193
204
  toSvg(opts: PathBuilderOpts): react_jsx_runtime.JSX.Element | null;
194
205
  toPath2D(opts: PathBuilderOpts): Path2D;
@@ -240,7 +251,7 @@ declare function startEditingShapeWithRichText(editor: Editor, shapeOrId: DrShap
240
251
  /** @public @react */
241
252
  declare const DefaultA11yAnnouncer: React$1.NamedExoticComponent<object>;
242
253
  /** @public */
243
- declare const useSelectedShapesAnnouncer: () => void;
254
+ declare function useSelectedShapesAnnouncer(): void;
244
255
 
245
256
  /** @public @react */
246
257
  declare function AccessibilityMenu(): react_jsx_runtime.JSX.Element;
@@ -319,6 +330,7 @@ interface DrUiEventMap {
319
330
  'rename-document': null;
320
331
  'group-shapes': null;
321
332
  'ungroup-shapes': null;
333
+ 'frame-selection': null;
322
334
  'remove-frame': null;
323
335
  'fit-frame-to-content': null;
324
336
  'convert-to-embed': null;
@@ -451,6 +463,7 @@ interface DrUiEventMap {
451
463
  operation: 'bold' | 'strike' | 'link' | 'link-edit' | 'link-visit' | 'link-remove' | 'heading' | 'bulletList';
452
464
  };
453
465
  edit: null;
466
+ 'copy-hovered-styles': null;
454
467
  }
455
468
  /** @public */
456
469
  type DrUiEventData<K> = K extends null ? {
@@ -473,9 +486,9 @@ declare function DrawUiEventsProvider({ onEvent, children }: EventsProviderProps
473
486
  declare function useUiEvents(): DrUiEventContextType;
474
487
 
475
488
  /** @public */
476
- type DrUiIconType = 'align-bottom' | 'align-center-horizontal' | 'align-center-vertical' | 'align-left' | 'align-right' | 'align-top' | 'alt' | 'arrow-arc' | 'arrow-cycle' | 'arrow-elbow' | 'arrow-left' | 'arrowhead-arrow' | 'arrowhead-bar' | 'arrowhead-diamond' | 'arrowhead-dot' | 'arrowhead-none' | 'arrowhead-square' | 'arrowhead-triangle-inverted' | 'arrowhead-triangle' | 'blob' | 'bold' | 'bookmark' | 'bring-forward' | 'bring-to-front' | 'broken' | 'bulletList' | 'check-circle' | 'check' | 'chevron-down' | 'chevron-left' | 'chevron-right' | 'chevron-up' | 'chevrons-ne' | 'chevrons-sw' | 'clipboard-copied' | 'clipboard-copy' | 'code' | 'color' | 'comment' | 'corners' | 'crop' | 'cross-2' | 'cross-circle' | 'dash-dashed' | 'dash-dotted' | 'dash-draw' | 'dash-solid' | 'disconnected' | 'discord' | 'distribute-horizontal' | 'distribute-vertical' | 'dot' | 'dots-horizontal' | 'dots-vertical' | 'download' | 'drag-handle-dots' | 'duplicate' | 'edit' | 'external-link' | 'fill-fill' | 'fill-lined-fill' | 'fill-none' | 'fill-pattern' | 'fill-semi' | 'fill-solid' | 'follow' | 'following' | 'font-draw' | 'font-mono' | 'font-sans' | 'font-serif' | 'geo-arrow-down' | 'geo-arrow-left' | 'geo-arrow-right' | 'geo-arrow-up' | 'geo-check-box' | 'geo-cloud' | 'geo-diamond' | 'geo-ellipse' | 'geo-heart' | 'geo-hexagon' | 'geo-octagon' | 'geo-oval' | 'geo-pentagon' | 'geo-rectangle' | 'geo-rhombus-2' | 'geo-rhombus' | 'geo-star' | 'geo-trapezoid' | 'geo-triangle' | 'geo-x-box' | 'github' | 'group' | 'heading' | 'help-circle' | 'highlight' | 'horizontal-align-end' | 'horizontal-align-middle' | 'horizontal-align-start' | 'info-circle' | 'italic' | 'leading' | 'link' | 'list' | 'lock' | 'manual' | 'menu' | 'minus' | 'mixed' | 'pack' | 'plus' | 'question-mark-circle' | 'question-mark' | 'redo' | 'reset-zoom' | 'rotate-ccw' | 'rotate-cw' | 'send-backward' | 'send-to-back' | 'share-1' | 'size-extra-large' | 'size-large' | 'size-medium' | 'size-small' | 'spline-cubic' | 'spline-line' | 'stack-horizontal' | 'stack-vertical' | 'status-offline' | 'stretch-horizontal' | 'stretch-vertical' | 'strike' | 'text-align-center' | 'text-align-left' | 'text-align-right' | 'toggle-off' | 'toggle-on' | 'tool-arrow' | 'tool-eraser' | 'tool-frame' | 'tool-hand' | 'tool-highlight' | 'tool-laser' | 'tool-line' | 'tool-media' | 'tool-note' | 'tool-pencil' | 'tool-pointer' | 'tool-screenshot' | 'tool-text' | 'trash' | 'twitter' | 'underline' | 'undo' | 'ungroup' | 'unlock' | 'vertical-align-end' | 'vertical-align-middle' | 'vertical-align-start' | 'warning-triangle' | 'zoom-in' | 'zoom-out';
489
+ type DrUiIconType = 'align-bottom' | 'align-center-horizontal' | 'align-center-vertical' | 'align-left' | 'align-right' | 'align-top' | 'alt' | 'arrow-arc' | 'arrow-cycle' | 'arrow-elbow' | 'arrow-left' | 'arrowhead-arrow' | 'arrowhead-bar' | 'arrowhead-diamond' | 'arrowhead-dot' | 'arrowhead-none' | 'arrowhead-square' | 'arrowhead-triangle-inverted' | 'arrowhead-triangle' | 'blob' | 'bold' | 'bookmark' | 'bring-forward' | 'bring-to-front' | 'broken' | 'bulletList' | 'check-circle' | 'check' | 'chevron-down' | 'chevron-left' | 'chevron-right' | 'chevron-up' | 'chevrons-ne' | 'chevrons-sw' | 'clipboard-copied' | 'clipboard-copy' | 'closed' | 'code' | 'color' | 'comment' | 'corners' | 'crop' | 'cross-2' | 'cross-circle' | 'dash-dashed' | 'dash-dotted' | 'dash-draw' | 'dash-solid' | 'disconnected' | 'discord' | 'distribute-horizontal' | 'distribute-vertical' | 'dot' | 'dots-horizontal' | 'dots-vertical' | 'download' | 'drag-handle-dots' | 'duplicate' | 'edit' | 'external-link' | 'fill-fill' | 'fill-lined-fill' | 'fill-none' | 'fill-pattern' | 'fill-semi' | 'fill-solid' | 'follow' | 'following' | 'font-draw' | 'font-mono' | 'font-sans' | 'font-serif' | 'geo-arrow-down' | 'geo-arrow-left' | 'geo-arrow-right' | 'geo-arrow-up' | 'geo-check-box' | 'geo-cloud' | 'geo-diamond' | 'geo-ellipse' | 'geo-heart' | 'geo-hexagon' | 'geo-octagon' | 'geo-oval' | 'geo-pentagon' | 'geo-rectangle' | 'geo-rhombus-2' | 'geo-rhombus' | 'geo-star' | 'geo-trapezoid' | 'geo-triangle' | 'geo-x-box' | 'github' | 'group' | 'heading' | 'help-circle' | 'highlight' | 'horizontal-align-end' | 'horizontal-align-middle' | 'horizontal-align-start' | 'info-circle' | 'italic' | 'leading' | 'link' | 'list' | 'lock' | 'manual' | 'menu' | 'minus' | 'mixed' | 'pack' | 'plus' | 'question-mark-circle' | 'question-mark' | 'redo' | 'reset-zoom' | 'rotate-ccw' | 'rotate-cw' | 'send-backward' | 'send-to-back' | 'share-1' | 'size-extra-large' | 'size-large' | 'size-medium' | 'size-small' | 'spline-cubic' | 'spline-line' | 'stack-horizontal' | 'stack-vertical' | 'status-offline' | 'stretch-horizontal' | 'stretch-vertical' | 'strike' | 'text-align-center' | 'text-align-left' | 'text-align-right' | 'toggle-off' | 'toggle-on' | 'tool-arrow' | 'tool-eraser' | 'tool-frame' | 'tool-hand' | 'tool-highlight' | 'tool-laser' | 'tool-line' | 'tool-media' | 'tool-note' | 'tool-pencil' | 'tool-pointer' | 'tool-screenshot' | 'tool-text' | 'trash' | 'twitter' | 'underline' | 'undo' | 'ungroup' | 'unlock' | 'vertical-align-end' | 'vertical-align-middle' | 'vertical-align-start' | 'warning-triangle' | 'zoom-in' | 'zoom-out';
477
490
  /** @public */
478
- declare const iconTypes: readonly ["align-bottom", "align-center-horizontal", "align-center-vertical", "align-left", "align-right", "align-top", "alt", "arrow-arc", "arrow-cycle", "arrow-elbow", "arrow-left", "arrowhead-arrow", "arrowhead-bar", "arrowhead-diamond", "arrowhead-dot", "arrowhead-none", "arrowhead-square", "arrowhead-triangle-inverted", "arrowhead-triangle", "blob", "bold", "bookmark", "bring-forward", "bring-to-front", "broken", "bulletList", "check-circle", "check", "chevron-down", "chevron-left", "chevron-right", "chevron-up", "chevrons-ne", "chevrons-sw", "clipboard-copied", "clipboard-copy", "code", "color", "comment", "corners", "crop", "cross-2", "cross-circle", "dash-dashed", "dash-dotted", "dash-draw", "dash-solid", "disconnected", "discord", "distribute-horizontal", "distribute-vertical", "dot", "dots-horizontal", "dots-vertical", "download", "drag-handle-dots", "duplicate", "edit", "external-link", "fill-fill", "fill-lined-fill", "fill-none", "fill-pattern", "fill-semi", "fill-solid", "follow", "following", "font-draw", "font-mono", "font-sans", "font-serif", "geo-arrow-down", "geo-arrow-left", "geo-arrow-right", "geo-arrow-up", "geo-check-box", "geo-cloud", "geo-diamond", "geo-ellipse", "geo-heart", "geo-hexagon", "geo-octagon", "geo-oval", "geo-pentagon", "geo-rectangle", "geo-rhombus-2", "geo-rhombus", "geo-star", "geo-trapezoid", "geo-triangle", "geo-x-box", "github", "group", "heading", "help-circle", "highlight", "horizontal-align-end", "horizontal-align-middle", "horizontal-align-start", "info-circle", "italic", "leading", "link", "list", "lock", "manual", "menu", "minus", "mixed", "pack", "plus", "question-mark-circle", "question-mark", "redo", "reset-zoom", "rotate-ccw", "rotate-cw", "send-backward", "send-to-back", "share-1", "size-extra-large", "size-large", "size-medium", "size-small", "spline-cubic", "spline-line", "stack-horizontal", "stack-vertical", "status-offline", "stretch-horizontal", "stretch-vertical", "strike", "text-align-center", "text-align-left", "text-align-right", "toggle-off", "toggle-on", "tool-arrow", "tool-eraser", "tool-frame", "tool-hand", "tool-highlight", "tool-laser", "tool-line", "tool-media", "tool-note", "tool-pencil", "tool-pointer", "tool-screenshot", "tool-text", "trash", "twitter", "underline", "undo", "ungroup", "unlock", "vertical-align-end", "vertical-align-middle", "vertical-align-start", "warning-triangle", "zoom-in", "zoom-out"];
491
+ declare const iconTypes: readonly ["align-bottom", "align-center-horizontal", "align-center-vertical", "align-left", "align-right", "align-top", "alt", "arrow-arc", "arrow-cycle", "arrow-elbow", "arrow-left", "arrowhead-arrow", "arrowhead-bar", "arrowhead-diamond", "arrowhead-dot", "arrowhead-none", "arrowhead-square", "arrowhead-triangle-inverted", "arrowhead-triangle", "blob", "bold", "bookmark", "bring-forward", "bring-to-front", "broken", "bulletList", "check-circle", "check", "chevron-down", "chevron-left", "chevron-right", "chevron-up", "chevrons-ne", "chevrons-sw", "clipboard-copied", "clipboard-copy", "closed", "code", "color", "comment", "corners", "crop", "cross-2", "cross-circle", "dash-dashed", "dash-dotted", "dash-draw", "dash-solid", "disconnected", "discord", "distribute-horizontal", "distribute-vertical", "dot", "dots-horizontal", "dots-vertical", "download", "drag-handle-dots", "duplicate", "edit", "external-link", "fill-fill", "fill-lined-fill", "fill-none", "fill-pattern", "fill-semi", "fill-solid", "follow", "following", "font-draw", "font-mono", "font-sans", "font-serif", "geo-arrow-down", "geo-arrow-left", "geo-arrow-right", "geo-arrow-up", "geo-check-box", "geo-cloud", "geo-diamond", "geo-ellipse", "geo-heart", "geo-hexagon", "geo-octagon", "geo-oval", "geo-pentagon", "geo-rectangle", "geo-rhombus-2", "geo-rhombus", "geo-star", "geo-trapezoid", "geo-triangle", "geo-x-box", "github", "group", "heading", "help-circle", "highlight", "horizontal-align-end", "horizontal-align-middle", "horizontal-align-start", "info-circle", "italic", "leading", "link", "list", "lock", "manual", "menu", "minus", "mixed", "pack", "plus", "question-mark-circle", "question-mark", "redo", "reset-zoom", "rotate-ccw", "rotate-cw", "send-backward", "send-to-back", "share-1", "size-extra-large", "size-large", "size-medium", "size-small", "spline-cubic", "spline-line", "stack-horizontal", "stack-vertical", "status-offline", "stretch-horizontal", "stretch-vertical", "strike", "text-align-center", "text-align-left", "text-align-right", "toggle-off", "toggle-on", "tool-arrow", "tool-eraser", "tool-frame", "tool-hand", "tool-highlight", "tool-laser", "tool-line", "tool-media", "tool-note", "tool-pencil", "tool-pointer", "tool-screenshot", "tool-text", "trash", "twitter", "underline", "undo", "ungroup", "unlock", "vertical-align-end", "vertical-align-middle", "vertical-align-start", "warning-triangle", "zoom-in", "zoom-out"];
479
492
 
480
493
  /** @public */
481
494
  type DrUiIconJsx = ReactElement<React.HTMLAttributes<HTMLDivElement>>;
@@ -484,6 +497,7 @@ interface DrUiIconProps extends React.HTMLAttributes<HTMLDivElement> {
484
497
  icon: DrUiIconType | Exclude<string, DrUiIconType> | DrUiIconJsx;
485
498
  label: string;
486
499
  small?: boolean;
500
+ tiny?: boolean;
487
501
  color?: string;
488
502
  children?: undefined;
489
503
  invertIcon?: boolean;
@@ -589,7 +603,7 @@ declare function DrawUiMenuToolItem({ toolId, ...rest }: DrUiMenuToolItemProps):
589
603
  declare const DefaultToasts: React$1.NamedExoticComponent<object>;
590
604
 
591
605
  /** @public */
592
- type DrUiTranslationKey = 'action.toggle-auto-pan' | 'action.toggle-auto-zoom' | 'action.toggle-auto-none' | 'action.toggle-mouse' | 'action.toggle-trackpad' | 'action.convert-to-bookmark' | 'action.convert-to-embed' | 'action.open-embed-link' | 'action.align-bottom' | 'action.align-center-horizontal' | 'action.align-center-vertical' | 'action.align-center-horizontal.short' | 'action.align-center-vertical.short' | 'action.align-left' | 'action.align-right' | 'action.align-top' | 'action.back-to-content' | 'action.bring-forward' | 'action.bring-to-front' | '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.copy-hovered-styles' | 'action.cut' | 'action.delete' | 'action.unlock-all' | 'action.distribute-horizontal' | 'action.distribute-vertical' | 'action.distribute-horizontal.short' | 'action.distribute-vertical.short' | 'action.download-original' | 'action.duplicate' | 'action.edit-link' | 'action.exit-pen-mode' | 'action.export-as-png.short' | 'action.export-as-png' | 'action.export-as-svg.short' | 'action.export-as-svg' | 'action.export-all-as-png.short' | 'action.export-all-as-png' | 'action.export-all-as-svg.short' | 'action.export-all-as-svg' | 'action.fit-frame-to-content' | 'action.flip-horizontal' | 'action.flip-vertical' | 'action.flip-horizontal.short' | 'action.flip-vertical.short' | 'action.fork-project' | 'action.fork-project-on-tldraw' | '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-kbd-shortcuts' | 'action.open-file' | 'action.pack' | 'action.paste' | 'action.paste-error-title' | 'action.paste-error-description' | 'action.print' | 'action.redo' | 'action.remove-frame' | 'action.rename' | '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' | 'action.stack-vertical' | 'action.stack-horizontal.short' | 'action.stack-vertical.short' | 'action.stop-following' | 'action.stretch-horizontal' | 'action.stretch-vertical' | 'action.stretch-horizontal.short' | 'action.stretch-vertical.short' | 'action.toggle-auto-size' | 'action.toggle-dark-mode.menu' | 'action.toggle-dark-mode' | 'action.toggle-paste-at-cursor.menu' | 'action.toggle-paste-at-cursor' | 'action.toggle-wrap-mode.menu' | 'action.toggle-wrap-mode' | 'action.toggle-reduce-motion.menu' | 'action.toggle-reduce-motion' | 'action.toggle-keyboard-shortcuts.menu' | 'action.toggle-keyboard-shortcuts' | 'action.enhanced-a11y-mode.menu' | 'action.enhanced-a11y-mode' | 'action.toggle-edge-scrolling.menu' | 'action.toggle-edge-scrolling' | 'action.toggle-invert-zoom.menu' | 'action.toggle-invert-zoom' | 'action.toggle-debug-mode.menu' | 'action.toggle-debug-mode' | 'action.toggle-focus-mode.menu' | 'action.toggle-focus-mode' | 'action.toggle-dynamic-size-mode.menu' | 'action.toggle-dynamic-size-mode' | 'action.toggle-grid.menu' | 'action.toggle-grid' | 'action.toggle-lock' | 'action.flatten-to-image' | '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.zoom-in' | 'action.zoom-out' | 'action.zoom-to-100' | 'action.zoom-to-fit' | 'action.zoom-to-selection' | 'action.zoom-quick' | 'action.select-zoom-tool' | 'assets.files.size-too-big' | 'assets.files.maximum-size' | 'assets.files.type-not-allowed' | 'assets.files.upload-failed' | 'assets.files.amount-too-many' | 'assets.url.failed' | 'theme.dark' | 'theme.light' | 'theme.system' | 'color-style.white' | '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' | 'fill-style.none' | 'document.default-name' | 'fill-style.semi' | 'fill-style.solid' | 'fill-style.pattern' | 'fill-style.fill' | 'fill-style.lined-fill' | 'dash-style.dashed' | 'dash-style.dotted' | 'dash-style.draw' | 'dash-style.solid' | 'size-style.xs' | 'size-style.s' | 'size-style.m' | 'size-style.l' | 'size-style.xl' | 'opacity-style.0.1' | 'opacity-style.0.25' | 'opacity-style.0.5' | 'opacity-style.0.75' | 'opacity-style.1' | 'font-style.draw' | 'font-style.sans' | 'font-style.serif' | 'font-style.mono' | 'align-style.start' | 'align-style.middle' | 'align-style.end' | 'align-style.justify' | 'verticalAlign-style.start' | 'verticalAlign-style.middle' | 'verticalAlign-style.end' | 'geo-style.arrow-down' | 'geo-style.arrow-left' | 'geo-style.arrow-right' | 'geo-style.arrow-up' | 'geo-style.cloud' | 'geo-style.diamond' | 'geo-style.ellipse' | 'geo-style.heart' | 'geo-style.hexagon' | 'geo-style.octagon' | 'geo-style.oval' | 'geo-style.pentagon' | 'geo-style.rectangle' | 'geo-style.rhombus' | 'geo-style.rhombus-2' | 'geo-style.star' | 'geo-style.trapezoid' | 'geo-style.triangle' | 'geo-style.x-box' | 'geo-style.check-box' | 'arrowheadStart-style.none' | 'arrowheadStart-style.arrow' | 'arrowheadStart-style.bar' | 'arrowheadStart-style.diamond' | 'arrowheadStart-style.dot' | 'arrowheadStart-style.inverted' | 'arrowheadStart-style.pipe' | 'arrowheadStart-style.square' | 'arrowheadStart-style.triangle' | 'arrowheadEnd-style.none' | 'arrowheadEnd-style.arrow' | 'arrowheadEnd-style.bar' | 'arrowheadEnd-style.diamond' | 'arrowheadEnd-style.dot' | 'arrowheadEnd-style.inverted' | 'arrowheadEnd-style.pipe' | 'arrowheadEnd-style.square' | 'arrowheadEnd-style.triangle' | 'spline-style.line' | 'spline-style.cubic' | 'arrow-kind-style.arc' | 'arrow-kind-style.elbow' | 'tool.select' | 'tool.hand' | 'tool.draw' | 'tool.eraser' | 'tool.arrow-down' | 'tool.arrow-left' | 'tool.arrow-right' | 'tool.arrow-up' | 'tool.arrow' | 'tool.cloud' | 'tool.diamond' | 'tool.ellipse' | 'tool.heart' | 'tool.hexagon' | 'tool.highlight' | 'tool.line' | 'tool.octagon' | 'tool.oval' | 'tool.pentagon' | 'tool.rectangle' | 'tool.rhombus' | 'tool.star' | 'tool.trapezoid' | 'tool.triangle' | 'tool.x-box' | 'tool.check-box' | 'tool.media' | 'tool.frame' | 'tool.note' | 'tool.laser' | 'tool.embed' | 'tool.text' | 'tool.pointer-down' | 'tool.image-zoom' | 'tool.replace-media' | 'tool.flip-horz' | 'tool.flip-vert' | 'tool.rotate-cw' | 'tool.aspect-ratio' | 'tool.aspect-ratio.original' | 'tool.aspect-ratio.square' | 'tool.aspect-ratio.circle' | 'tool.aspect-ratio.landscape' | 'tool.aspect-ratio.portrait' | 'tool.aspect-ratio.wide' | 'tool.image-toolbar-title' | 'tool.image-crop' | 'tool.image-crop-confirm' | 'tool.media-alt-text' | 'tool.media-alt-text-desc' | 'tool.media-alt-text-confirm' | 'tool.rich-text-bold' | 'tool.rich-text-italic' | 'tool.rich-text-code' | 'tool.rich-text-highlight' | 'tool.rich-text-strikethrough' | 'tool.rich-text-link' | 'tool.rich-text-link-visit' | 'tool.rich-text-link-remove' | 'tool.rich-text-header' | 'tool.rich-text-bulletList' | 'tool.rich-text-toolbar-title' | 'tool.rich-text-orderedList' | 'tool.bookmark' | 'a11y.status' | 'a11y.skip-to-main-content' | 'a11y.shape-index' | 'a11y.shape-image' | 'a11y.shape-video' | 'a11y.multiple-shapes' | 'a11y.select-shape' | 'a11y.select-shape-direction' | 'a11y.enter-leave-container' | 'a11y.repeat-shape' | 'a11y.move-shape' | 'a11y.move-shape-faster' | 'a11y.rotate-shape-cw' | 'a11y.rotate-shape-ccw' | 'a11y.rotate-shape-cw-fine' | 'a11y.rotate-shape-ccw-fine' | 'a11y.enlarge-shape' | 'a11y.shrink-shape' | 'a11y.pan-camera' | 'a11y.adjust-shape-styles' | 'a11y.open-context-menu' | 'a11y.open-keyboard-shortcuts' | 'menu.title' | 'menu.theme' | 'menu.color-theme' | 'menu.accessibility' | 'menu.copy-as' | 'menu.edit' | 'menu.export-as' | 'menu.file' | 'menu.language' | 'menu.preferences' | 'menu.view' | 'menu.input-device' | 'context-menu.title' | 'context-menu.edit' | 'context-menu.arrange' | 'context-menu.copy-as' | 'context-menu.export-as' | 'context-menu.export-all-as' | 'context-menu.move-to-page' | 'context-menu.reorder' | 'page-menu.title' | 'page-menu.create-new-page' | 'page-menu.new-page-initial-name' | 'page-menu.edit-start' | 'page-menu.edit-done' | 'page-menu.go-to-page' | 'page-menu.resize' | 'page-menu.submenu.rename' | 'page-menu.submenu.duplicate-page' | 'page-menu.submenu.title' | 'page-menu.submenu.move-down' | 'page-menu.submenu.move-up' | 'page-menu.submenu.delete' | 'share-menu.title' | 'share-menu.save-note' | 'share-menu.fork-note' | 'share-menu.share-project' | 'share-menu.copy-link' | 'share-menu.create-snapshot-link' | 'share-menu.snapshot-link-note' | 'share-menu.copy-readonly-link' | 'share-menu.offline-note' | 'share-menu.copy-link-note' | 'share-menu.copy-readonly-link-note' | 'share-menu.project-too-large' | 'share-menu.upload-failed' | 'share-menu.creating-project' | 'share-menu.copied' | 'document-name-menu.copy-link' | 'status.offline' | 'people-menu.title' | 'people-menu.change-name' | 'people-menu.avatar-color' | 'people-menu.change-color' | 'people-menu.follow' | 'people-menu.following' | 'people-menu.leading' | 'people-menu.user' | 'people-menu.invite' | 'people-menu.anonymous-user' | 'help-menu.import-tldr-file' | 'help-menu.title' | 'help-menu.about' | 'help-menu.discord' | 'help-menu.github' | 'help-menu.keyboard-shortcuts' | 'help-menu.twitter' | 'help-menu.terms' | 'help-menu.privacy' | 'actions-menu.title' | 'edit-link-dialog.title' | 'edit-link-dialog.invalid-url' | 'edit-link-dialog.detail' | 'edit-link-dialog.url' | 'edit-link-dialog.clear' | 'edit-link-dialog.save' | 'edit-link-dialog.cancel' | 'edit-link-dialog.external-link' | 'embed-dialog.title' | 'embed-dialog.back' | 'embed-dialog.create' | 'embed-dialog.cancel' | 'embed-dialog.url' | 'embed-dialog.instruction' | 'embed-dialog.invalid-url' | 'shortcuts-dialog.title' | 'shortcuts-dialog.edit' | 'shortcuts-dialog.file' | 'shortcuts-dialog.preferences' | 'shortcuts-dialog.tools' | 'shortcuts-dialog.transform' | 'shortcuts-dialog.view' | 'shortcuts-dialog.collaboration' | 'shortcuts-dialog.a11y' | 'shortcuts-dialog.text-formatting' | 'style-panel.title' | 'style-panel.align' | 'style-panel.label-align' | 'style-panel.vertical-align' | 'style-panel.position' | 'style-panel.arrowheads' | 'style-panel.arrowhead-start' | 'style-panel.arrowhead-end' | 'style-panel.arrow-kind' | 'style-panel.color' | 'style-panel.dash' | 'style-panel.fill' | 'style-panel.font' | 'style-panel.geo' | 'style-panel.mixed' | 'style-panel.opacity' | 'style-panel.size' | 'style-panel.spline' | 'style-panel.selected' | 'tool-panel.title' | 'tool-panel.more' | 'navigation-zone.title' | 'navigation-zone.minimap' | 'navigation-zone.toggle-minimap' | 'navigation-zone.zoom' | 'focus-mode.toggle-focus-mode' | 'toast.close' | 'toast.success' | 'toast.error' | 'toast.info' | 'toast.warning' | 'file-system.file-open-error.title' | 'file-system.file-open-error.not-a-tldraw-file' | 'file-system.file-open-error.file-format-version-too-new' | 'file-system.file-open-error.generic-corrupted-file' | 'file-system.confirm-open.title' | 'file-system.confirm-open.description' | 'file-system.confirm-open.cancel' | 'file-system.confirm-open.open' | 'file-system.confirm-open.dont-show-again' | 'file-system.confirm-clear.title' | 'file-system.confirm-clear.description' | 'file-system.confirm-clear.cancel' | 'file-system.confirm-clear.continue' | 'file-system.confirm-clear.dont-show-again' | 'file-system.shared-document-file-open-error.title' | 'file-system.shared-document-file-open-error.description' | 'sharing.confirm-leave.title' | 'sharing.confirm-leave.description' | 'sharing.confirm-leave.cancel' | 'sharing.confirm-leave.leave' | 'sharing.confirm-leave.dont-show-again' | 'toast.error.export-fail.title' | 'toast.error.export-fail.desc' | 'toast.error.copy-fail.title' | 'toast.error.copy-fail.desc' | 'context.pages.new-page' | 'vscode.file-open.desc' | 'vscode.file-open.open' | 'vscode.file-open.backup' | 'vscode.file-open.backup-saved' | 'vscode.file-open.backup-failed' | 'vscode.file-open.dont-show-again' | 'cursor-chat.type-to-chat' | 'app.loading' | 'handle.resize-top' | 'handle.resize-bottom' | 'handle.resize-left' | 'handle.resize-right' | 'handle.resize-top-left' | 'handle.resize-top-right' | 'handle.resize-bottom-left' | 'handle.resize-bottom-right' | 'handle.rotate.top_left_rotate' | 'handle.rotate.top_right_rotate' | 'handle.rotate.bottom_left_rotate' | 'handle.rotate.bottom_right_rotate' | 'handle.rotate.mobile_rotate' | 'handle.crop.top' | 'handle.crop.bottom' | 'handle.crop.left' | 'handle.crop.right' | 'handle.crop.top-left' | 'handle.crop.top-right' | 'handle.crop.bottom-left' | 'handle.crop.bottom-right' | 'ui.close' | 'ui.checked' | 'ui.unchecked';
606
+ type DrUiTranslationKey = 'action.toggle-auto-pan' | 'action.toggle-auto-zoom' | 'action.toggle-auto-none' | 'action.toggle-mouse' | 'action.toggle-trackpad' | 'action.convert-to-bookmark' | 'action.convert-to-embed' | 'action.open-embed-link' | 'action.align-bottom' | 'action.align-center-horizontal' | 'action.align-center-vertical' | 'action.align-center-horizontal.short' | 'action.align-center-vertical.short' | 'action.align-left' | 'action.align-right' | 'action.align-top' | 'action.back-to-content' | 'action.bring-forward' | 'action.bring-to-front' | '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.copy-hovered-styles' | 'action.cut' | 'action.delete' | 'action.unlock-all' | 'action.distribute-horizontal' | 'action.distribute-vertical' | 'action.distribute-horizontal.short' | 'action.distribute-vertical.short' | 'action.download-original' | 'action.duplicate' | 'action.edit-link' | 'action.exit-pen-mode' | 'action.export-as-png.short' | 'action.export-as-png' | 'action.export-as-svg.short' | 'action.export-as-svg' | 'action.export-all-as-png.short' | 'action.export-all-as-png' | 'action.export-all-as-svg.short' | 'action.export-all-as-svg' | 'action.fit-frame-to-content' | 'action.flip-horizontal' | 'action.flip-vertical' | 'action.flip-horizontal.short' | 'action.flip-vertical.short' | 'action.fork-project' | 'action.fork-project-on-tldraw' | 'action.frame-selection' | '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-kbd-shortcuts' | 'action.open-file' | 'action.pack' | 'action.paste' | 'action.paste-error-title' | 'action.paste-error-description' | 'action.print' | 'action.redo' | 'action.remove-frame' | 'action.rename' | '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' | 'action.stack-vertical' | 'action.stack-horizontal.short' | 'action.stack-vertical.short' | 'action.stop-following' | 'action.stretch-horizontal' | 'action.stretch-vertical' | 'action.stretch-horizontal.short' | 'action.stretch-vertical.short' | 'action.toggle-auto-size' | 'action.toggle-dark-mode.menu' | 'action.toggle-dark-mode' | 'action.toggle-paste-at-cursor.menu' | 'action.toggle-paste-at-cursor' | 'action.toggle-wrap-mode.menu' | 'action.toggle-wrap-mode' | 'action.toggle-reduce-motion.menu' | 'action.toggle-reduce-motion' | 'action.toggle-keyboard-shortcuts.menu' | 'action.toggle-keyboard-shortcuts' | 'action.enhanced-a11y-mode.menu' | 'action.enhanced-a11y-mode' | 'action.toggle-edge-scrolling.menu' | 'action.toggle-edge-scrolling' | 'action.toggle-invert-zoom.menu' | 'action.toggle-invert-zoom' | 'action.toggle-debug-mode.menu' | 'action.toggle-debug-mode' | 'action.toggle-focus-mode.menu' | 'action.toggle-focus-mode' | 'action.toggle-dynamic-size-mode.menu' | 'action.toggle-dynamic-size-mode' | 'action.toggle-grid.menu' | 'action.toggle-grid' | 'action.toggle-lock' | 'action.flatten-to-image' | '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.zoom-in' | 'action.zoom-out' | 'action.zoom-to-100' | 'action.zoom-to-fit' | 'action.zoom-to-selection' | 'action.zoom-quick' | 'action.select-zoom-tool' | 'assets.files.size-too-big' | 'assets.files.maximum-size' | 'assets.files.type-not-allowed' | 'assets.files.upload-failed' | 'assets.files.amount-too-many' | 'assets.url.failed' | 'theme.dark' | 'theme.light' | 'theme.system' | 'color-style.white' | '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' | 'fill-style.none' | 'document.default-name' | 'fill-style.semi' | 'fill-style.solid' | 'fill-style.pattern' | 'fill-style.fill' | 'fill-style.lined-fill' | 'dash-style.dashed' | 'dash-style.dotted' | 'dash-style.draw' | 'dash-style.solid' | 'size-style.xs' | 'size-style.s' | 'size-style.m' | 'size-style.l' | 'size-style.xl' | 'opacity-style.0.1' | 'opacity-style.0.25' | 'opacity-style.0.5' | 'opacity-style.0.75' | 'opacity-style.1' | 'font-style.draw' | 'font-style.sans' | 'font-style.serif' | 'font-style.mono' | 'align-style.start' | 'align-style.middle' | 'align-style.end' | 'align-style.justify' | 'verticalAlign-style.start' | 'verticalAlign-style.middle' | 'verticalAlign-style.end' | 'geo-style.arrow-down' | 'geo-style.arrow-left' | 'geo-style.arrow-right' | 'geo-style.arrow-up' | 'geo-style.cloud' | 'geo-style.diamond' | 'geo-style.ellipse' | 'geo-style.heart' | 'geo-style.hexagon' | 'geo-style.octagon' | 'geo-style.oval' | 'geo-style.pentagon' | 'geo-style.rectangle' | 'geo-style.rhombus' | 'geo-style.rhombus-2' | 'geo-style.star' | 'geo-style.trapezoid' | 'geo-style.triangle' | 'geo-style.x-box' | 'geo-style.check-box' | 'arrowheadStart-style.none' | 'arrowheadStart-style.arrow' | 'arrowheadStart-style.bar' | 'arrowheadStart-style.diamond' | 'arrowheadStart-style.dot' | 'arrowheadStart-style.inverted' | 'arrowheadStart-style.pipe' | 'arrowheadStart-style.square' | 'arrowheadStart-style.triangle' | 'arrowheadEnd-style.none' | 'arrowheadEnd-style.arrow' | 'arrowheadEnd-style.bar' | 'arrowheadEnd-style.diamond' | 'arrowheadEnd-style.dot' | 'arrowheadEnd-style.inverted' | 'arrowheadEnd-style.pipe' | 'arrowheadEnd-style.square' | 'arrowheadEnd-style.triangle' | 'spline-style.line' | 'spline-style.cubic' | 'arrow-kind-style.arc' | 'arrow-kind-style.elbow' | 'tool.select' | 'tool.hand' | 'tool.draw' | 'tool.eraser' | 'tool.arrow-down' | 'tool.arrow-left' | 'tool.arrow-right' | 'tool.arrow-up' | 'tool.arrow' | 'tool.cloud' | 'tool.diamond' | 'tool.ellipse' | 'tool.heart' | 'tool.hexagon' | 'tool.highlight' | 'tool.line' | 'tool.octagon' | 'tool.oval' | 'tool.pentagon' | 'tool.rectangle' | 'tool.rhombus' | 'tool.star' | 'tool.trapezoid' | 'tool.triangle' | 'tool.x-box' | 'tool.check-box' | 'tool.media' | 'tool.frame' | 'tool.note' | 'tool.laser' | 'tool.embed' | 'tool.text' | 'tool.pointer-down' | 'tool.image-zoom' | 'tool.replace-media' | 'tool.flip-horz' | 'tool.flip-vert' | 'tool.rotate-cw' | 'tool.aspect-ratio' | 'tool.aspect-ratio.original' | 'tool.aspect-ratio.square' | 'tool.aspect-ratio.circle' | 'tool.aspect-ratio.landscape' | 'tool.aspect-ratio.portrait' | 'tool.aspect-ratio.wide' | 'tool.image-toolbar-title' | 'tool.image-crop' | 'tool.image-crop-confirm' | 'tool.media-alt-text' | 'tool.media-alt-text-desc' | 'tool.media-alt-text-confirm' | 'tool.rich-text-bold' | 'tool.rich-text-italic' | 'tool.rich-text-code' | 'tool.rich-text-highlight' | 'tool.rich-text-strikethrough' | 'tool.rich-text-link' | 'tool.rich-text-link-visit' | 'tool.rich-text-link-remove' | 'tool.rich-text-header' | 'tool.rich-text-bulletList' | 'tool.rich-text-toolbar-title' | 'tool.rich-text-orderedList' | 'tool.bookmark' | 'a11y.status' | 'a11y.skip-to-main-content' | 'a11y.shape-index' | 'a11y.shape-image' | 'a11y.shape-video' | 'a11y.multiple-shapes' | 'a11y.select-shape' | 'a11y.select-shape-direction' | 'a11y.enter-leave-container' | 'a11y.repeat-shape' | 'a11y.move-shape' | 'a11y.move-shape-faster' | 'a11y.rotate-shape-cw' | 'a11y.rotate-shape-ccw' | 'a11y.rotate-shape-cw-fine' | 'a11y.rotate-shape-ccw-fine' | 'a11y.enlarge-shape' | 'a11y.shrink-shape' | 'a11y.pan-camera' | 'a11y.adjust-shape-styles' | 'a11y.open-context-menu' | 'a11y.open-keyboard-shortcuts' | 'menu.title' | 'menu.theme' | 'menu.color-theme' | 'menu.accessibility' | 'menu.copy-as' | 'menu.edit' | 'menu.export-as' | 'menu.file' | 'menu.language' | 'menu.preferences' | 'menu.view' | 'menu.input-device' | 'context-menu.title' | 'context-menu.edit' | 'context-menu.arrange' | 'context-menu.copy-as' | 'context-menu.export-as' | 'context-menu.export-all-as' | 'context-menu.move-to-page' | 'context-menu.reorder' | 'page-menu.title' | 'page-menu.create-new-page' | 'page-menu.new-page-initial-name' | 'page-menu.edit-start' | 'page-menu.edit-done' | 'page-menu.go-to-page' | 'page-menu.resize' | 'page-menu.submenu.rename' | 'page-menu.submenu.duplicate-page' | 'page-menu.submenu.title' | 'page-menu.submenu.move-down' | 'page-menu.submenu.move-up' | 'page-menu.submenu.delete' | 'share-menu.title' | 'share-menu.save-note' | 'share-menu.fork-note' | 'share-menu.share-project' | 'share-menu.copy-link' | 'share-menu.create-snapshot-link' | 'share-menu.snapshot-link-note' | 'share-menu.copy-readonly-link' | 'share-menu.offline-note' | 'share-menu.copy-link-note' | 'share-menu.copy-readonly-link-note' | 'share-menu.project-too-large' | 'share-menu.upload-failed' | 'share-menu.creating-project' | 'share-menu.copied' | 'document-name-menu.copy-link' | 'status.offline' | 'people-menu.title' | 'people-menu.change-name' | 'people-menu.avatar-color' | 'people-menu.change-color' | 'people-menu.follow' | 'people-menu.following' | 'people-menu.leading' | 'people-menu.user' | 'people-menu.invite' | 'people-menu.anonymous-user' | 'help-menu.import-tldr-file' | 'help-menu.title' | 'help-menu.about' | 'help-menu.discord' | 'help-menu.github' | 'help-menu.keyboard-shortcuts' | 'help-menu.twitter' | 'help-menu.terms' | 'help-menu.privacy' | 'actions-menu.title' | 'edit-link-dialog.title' | 'edit-link-dialog.invalid-url' | 'edit-link-dialog.detail' | 'edit-link-dialog.url' | 'edit-link-dialog.clear' | 'edit-link-dialog.save' | 'edit-link-dialog.cancel' | 'edit-link-dialog.external-link' | 'embed-dialog.title' | 'embed-dialog.back' | 'embed-dialog.create' | 'embed-dialog.cancel' | 'embed-dialog.url' | 'embed-dialog.instruction' | 'embed-dialog.invalid-url' | 'shortcuts-dialog.title' | 'shortcuts-dialog.edit' | 'shortcuts-dialog.file' | 'shortcuts-dialog.preferences' | 'shortcuts-dialog.tools' | 'shortcuts-dialog.transform' | 'shortcuts-dialog.view' | 'shortcuts-dialog.collaboration' | 'shortcuts-dialog.a11y' | 'shortcuts-dialog.text-formatting' | 'shortcuts-dialog.disabled-notice' | 'style-panel.title' | 'style-panel.align' | 'style-panel.label-align' | 'style-panel.vertical-align' | 'style-panel.position' | 'style-panel.arrowheads' | 'style-panel.arrowhead-start' | 'style-panel.arrowhead-end' | 'style-panel.arrow-kind' | 'style-panel.color' | 'style-panel.dash' | 'style-panel.fill' | 'style-panel.font' | 'style-panel.geo' | 'style-panel.mixed' | 'style-panel.opacity' | 'style-panel.size' | 'style-panel.spline' | 'style-panel.selected' | 'tool-panel.title' | 'tool-panel.more' | 'navigation-zone.title' | 'navigation-zone.minimap' | 'navigation-zone.toggle-minimap' | 'navigation-zone.zoom' | 'focus-mode.toggle-focus-mode' | 'toast.close' | 'toast.success' | 'toast.error' | 'toast.info' | 'toast.warning' | 'file-system.file-open-error.title' | 'file-system.file-open-error.not-a-tldraw-file' | 'file-system.file-open-error.file-format-version-too-new' | 'file-system.file-open-error.generic-corrupted-file' | 'file-system.confirm-open.title' | 'file-system.confirm-open.description' | 'file-system.confirm-open.cancel' | 'file-system.confirm-open.open' | 'file-system.confirm-open.dont-show-again' | 'file-system.confirm-clear.title' | 'file-system.confirm-clear.description' | 'file-system.confirm-clear.cancel' | 'file-system.confirm-clear.continue' | 'file-system.confirm-clear.dont-show-again' | 'file-system.shared-document-file-open-error.title' | 'file-system.shared-document-file-open-error.description' | 'sharing.confirm-leave.title' | 'sharing.confirm-leave.description' | 'sharing.confirm-leave.cancel' | 'sharing.confirm-leave.leave' | 'sharing.confirm-leave.dont-show-again' | 'toast.error.export-fail.title' | 'toast.error.export-fail.desc' | 'toast.error.copy-fail.title' | 'toast.error.copy-fail.desc' | 'context.pages.new-page' | 'vscode.file-open.desc' | 'vscode.file-open.open' | 'vscode.file-open.backup' | 'vscode.file-open.backup-saved' | 'vscode.file-open.backup-failed' | 'vscode.file-open.dont-show-again' | 'cursor-chat.type-to-chat' | 'app.loading' | 'handle.resize-top' | 'handle.resize-bottom' | 'handle.resize-left' | 'handle.resize-right' | 'handle.resize-top-left' | 'handle.resize-top-right' | 'handle.resize-bottom-left' | 'handle.resize-bottom-right' | 'handle.rotate.top_left_rotate' | 'handle.rotate.top_right_rotate' | 'handle.rotate.bottom_left_rotate' | 'handle.rotate.bottom_right_rotate' | 'handle.rotate.mobile_rotate' | 'handle.crop.top' | 'handle.crop.bottom' | 'handle.crop.left' | 'handle.crop.right' | 'handle.crop.top-left' | 'handle.crop.top-right' | 'handle.crop.bottom-left' | 'handle.crop.bottom-right' | 'ui.close' | 'ui.checked' | 'ui.unchecked' | 'comments.title' | 'comments.empty' | 'comments.empty-filtered' | 'comments.thread-title' | 'comments.resolved' | 'comments.filter' | 'comments.show-resolved' | 'comments.only-my-comments' | 'comments.only-unread' | 'comments.show-all-pages' | 'comments.more-options' | 'comments.hide' | 'comments.show' | 'comments.reply-placeholder' | 'comments.edit-placeholder' | 'comments.add-placeholder' | 'comments.save' | 'comments.edit' | 'comments.resolve' | 'comments.reopen' | 'comments.delete' | 'comments.edit-comment' | 'comments.delete-comment' | 'comments.dismiss' | 'comments.copy-link' | 'comments.link-copied' | 'comments.send' | 'comments.resolved-by' | 'comments.add-reaction' | 'comments.reacted-1' | 'comments.reacted-2' | 'comments.reacted-3' | 'comments.reacted-more' | 'comments.reacted-more-one' | 'comments.mention-you' | 'comments.mention-no-matches' | 'comments.preview-more' | 'comments.replies-one' | 'comments.replies' | 'comments.pin-label' | 'comments.pin-label-resolved' | 'comments.cluster-label' | 'comments.stack-label';
593
607
 
594
608
  /** @public */
595
609
  declare const RTL_LANGUAGES: Set<string>;
@@ -621,9 +635,18 @@ type DrUiTranslationContextType = DrUiTranslation;
621
635
  /** @public */
622
636
  declare function useCurrentTranslation(): DrUiTranslation;
623
637
  /**
624
- * Provides a translation context to the editor.
638
+ * Like {@link useCurrentTranslation}, but returns `null` instead of throwing when used outside
639
+ * of a `<DrawUiTranslationProvider />` / `<DrawUiContextProvider />`.
625
640
  *
626
- * @internal
641
+ * @public
642
+ */
643
+ declare function useMaybeCurrentTranslation(): DrUiTranslation | null;
644
+ /**
645
+ * Provides a translation context to the editor. Wrap this around components that use
646
+ * `useTranslation` (such as `DrawSelectionForeground`) when you don't want to use the
647
+ * full `DrawUiContextProvider`. Must be rendered inside an `AssetUrlsProvider`.
648
+ *
649
+ * @public @react
627
650
  */
628
651
  declare function DrawUiTranslationProvider({ overrides, locale, children, }: DrUiTranslationProviderProps): react_jsx_runtime.JSX.Element;
629
652
  /**
@@ -704,6 +727,21 @@ declare class VideoAssetUtil extends AssetUtil<DrVideoAsset> {
704
727
  getAssetFromFile(file: File, assetId: DrAssetId): Promise<DrVideoAsset | null>;
705
728
  }
706
729
 
730
+ /**
731
+ * @public
732
+ */
733
+ declare class ArrowBindingUtil extends BindingUtil<DrArrowBinding> {
734
+ static type: string;
735
+ static props: _ibodr_schema.RecordProps<DrArrowBinding>;
736
+ static migrations: _ibodr_schema.DrPropsMigrations;
737
+ getDefaultProps(): Partial<DrArrowBindingProps>;
738
+ onAfterCreate({ binding }: BindingOnCreateOptions<DrArrowBinding>): void;
739
+ onAfterChange({ bindingAfter }: BindingOnChangeOptions<DrArrowBinding>): void;
740
+ onAfterChangeFromShape({ shapeBefore, shapeAfter, reason, }: BindingOnShapeChangeOptions<DrArrowBinding>): void;
741
+ onAfterChangeToShape({ binding, shapeBefore, shapeAfter, reason, }: BindingOnShapeChangeOptions<DrArrowBinding>): void;
742
+ onBeforeIsolateFromShape({ binding, }: BindingOnShapeIsolateOptions<DrArrowBinding>): void;
743
+ }
744
+
707
745
  /** @public */
708
746
  interface DrArrowBindingHintOverlay extends DrOverlay {
709
747
  props: {
@@ -737,21 +775,6 @@ declare class ArrowBindingHintOverlayUtil extends OverlayUtil<DrArrowBindingHint
737
775
  private getMarkerAngle;
738
776
  }
739
777
 
740
- /**
741
- * @public
742
- */
743
- declare class ArrowBindingUtil extends BindingUtil<DrArrowBinding> {
744
- static type: string;
745
- static props: _ibodr_schema.RecordProps<DrArrowBinding>;
746
- static migrations: _ibodr_schema.DrPropsMigrations;
747
- getDefaultProps(): Partial<DrArrowBindingProps>;
748
- onAfterCreate({ binding }: BindingOnCreateOptions<DrArrowBinding>): void;
749
- onAfterChange({ bindingAfter }: BindingOnChangeOptions<DrArrowBinding>): void;
750
- onAfterChangeFromShape({ shapeBefore, shapeAfter, reason, }: BindingOnShapeChangeOptions<DrArrowBinding>): void;
751
- onAfterChangeToShape({ binding, shapeBefore, shapeAfter, reason, }: BindingOnShapeChangeOptions<DrArrowBinding>): void;
752
- onBeforeIsolateFromShape({ binding, }: BindingOnShapeIsolateOptions<DrArrowBinding>): void;
753
- }
754
-
755
778
  /** @public */
756
779
  interface DrArrowHintOverlay extends DrOverlay {
757
780
  props: {
@@ -842,29 +865,32 @@ declare class BrushOverlayUtil extends OverlayUtil<DrBrushOverlay> {
842
865
  }
843
866
 
844
867
  /** @public */
845
- interface DrZoomBrushOverlay extends DrOverlay {
868
+ interface DrCollaboratorHintOverlay extends DrOverlay {
846
869
  props: {
870
+ /** Clamped point on viewport edge, in page coordinates */
847
871
  x: number;
848
872
  y: number;
849
- w: number;
850
- h: number;
873
+ /** Rotation angle pointing toward the collaborator's actual cursor */
874
+ rotation: number;
875
+ color: string;
851
876
  };
852
877
  }
853
878
  /**
854
- * Overlay util for the zoom brush rectangle.
879
+ * Overlay util for off-screen collaborator cursor hints.
880
+ * Shows a small directional arrow at the viewport edge pointing toward the collaborator.
855
881
  *
856
882
  * @public
857
883
  */
858
- declare class ZoomBrushOverlayUtil extends OverlayUtil<DrZoomBrushOverlay> {
884
+ declare class CollaboratorHintOverlayUtil extends OverlayUtil<DrCollaboratorHintOverlay> {
859
885
  static type: string;
860
886
  options: {
861
887
  zIndex: number;
862
888
  lineWidth: number;
889
+ viewportPadding: number;
863
890
  };
864
891
  isActive(): boolean;
865
- getOverlays(): DrZoomBrushOverlay[];
866
- render(ctx: CanvasRenderingContext2D, overlays: DrZoomBrushOverlay[]): void;
867
- renderMinimap(ctx: CanvasRenderingContext2D, overlays: DrZoomBrushOverlay[], zoom: number): void;
892
+ getOverlays(): DrCollaboratorHintOverlay[];
893
+ render(ctx: CanvasRenderingContext2D, overlays: DrCollaboratorHintOverlay[]): void;
868
894
  }
869
895
 
870
896
  /** @public */
@@ -892,89 +918,36 @@ declare class ScribbleOverlayUtil extends OverlayUtil<DrScribbleOverlay> {
892
918
  }
893
919
 
894
920
  /** @public */
895
- interface DrCollaboratorBrushOverlay extends DrOverlay {
921
+ interface DrZoomBrushOverlay extends DrOverlay {
896
922
  props: {
897
923
  x: number;
898
924
  y: number;
899
925
  w: number;
900
926
  h: number;
901
- color: string;
902
927
  };
903
928
  }
904
929
  /**
905
- * Overlay util for collaborator selection brushes.
930
+ * Overlay util for the zoom brush rectangle.
906
931
  *
907
932
  * @public
908
933
  */
909
- declare class CollaboratorBrushOverlayUtil extends OverlayUtil<DrCollaboratorBrushOverlay> {
934
+ declare class ZoomBrushOverlayUtil extends OverlayUtil<DrZoomBrushOverlay> {
910
935
  static type: string;
911
936
  options: {
912
937
  zIndex: number;
913
938
  lineWidth: number;
914
939
  };
915
940
  isActive(): boolean;
916
- getOverlays(): DrCollaboratorBrushOverlay[];
917
- render(ctx: CanvasRenderingContext2D, overlays: DrCollaboratorBrushOverlay[]): void;
918
- renderMinimap(ctx: CanvasRenderingContext2D, overlays: DrCollaboratorBrushOverlay[]): void;
919
- }
920
-
921
- /** @public */
922
- interface DrCollaboratorScribbleOverlay extends DrOverlay {
923
- props: {
924
- scribble: DrScribble;
925
- color: string;
926
- };
927
- }
928
- /**
929
- * Overlay util for collaborator scribble strokes (eraser, lasso, etc.).
930
- *
931
- * @public
932
- */
933
- declare class CollaboratorScribbleOverlayUtil extends OverlayUtil<DrCollaboratorScribbleOverlay> {
934
- static type: string;
935
- options: {
936
- zIndex: number;
937
- streamline: number;
938
- cacheSize: number;
939
- };
940
- private _collabScribblePathCache;
941
- isActive(): boolean;
942
- getOverlays(): DrCollaboratorScribbleOverlay[];
943
- render(ctx: CanvasRenderingContext2D, overlays: DrCollaboratorScribbleOverlay[]): void;
941
+ getOverlays(): DrZoomBrushOverlay[];
942
+ render(ctx: CanvasRenderingContext2D, overlays: DrZoomBrushOverlay[]): void;
943
+ renderMinimap(ctx: CanvasRenderingContext2D, overlays: DrZoomBrushOverlay[], zoom: number): void;
944
944
  }
945
945
 
946
- /** @public */
947
- interface DrCollaboratorHintOverlay extends DrOverlay {
948
- props: {
949
- /** Clamped point on viewport edge, in page coordinates */
950
- x: number;
951
- y: number;
952
- /** Rotation angle pointing toward the collaborator's actual cursor */
953
- rotation: number;
954
- color: string;
955
- };
956
- }
957
946
  /**
958
- * Overlay util for off-screen collaborator cursor hints.
959
- * Shows a small directional arrow at the viewport edge pointing toward the collaborator.
960
- *
961
947
  * @public
948
+ * @deprecated Collaborator cursors are rendered as DOM elements rather than drawn to the overlay
949
+ * canvas. Use `DrCursorProps`, the props of the `CollaboratorCursor` editor component.
962
950
  */
963
- declare class CollaboratorHintOverlayUtil extends OverlayUtil<DrCollaboratorHintOverlay> {
964
- static type: string;
965
- options: {
966
- zIndex: number;
967
- lineWidth: number;
968
- viewportPadding: number;
969
- };
970
- isActive(): boolean;
971
- getOverlays(): DrCollaboratorHintOverlay[];
972
- render(ctx: CanvasRenderingContext2D, overlays: DrCollaboratorHintOverlay[]): void;
973
- /** @internal */
974
- private _isCursorInViewport;
975
- }
976
-
977
- /** @public */
978
951
  interface DrCollaboratorCursorOverlay extends DrOverlay {
979
952
  props: {
980
953
  x: number;
@@ -988,6 +961,11 @@ interface DrCollaboratorCursorOverlay extends DrOverlay {
988
961
  * Overlay util for collaborator cursors (arrow + name tag + chat message).
989
962
  *
990
963
  * @public
964
+ * @deprecated Collaborator cursors are no longer drawn to the overlay canvas, so this util is no
965
+ * longer part of `defaultOverlayUtils`. They render as DOM elements instead, customizable through
966
+ * the `CollaboratorCursor` editor component. To keep drawing cursors to the canvas, pass this util
967
+ * (or a subclass of it) to `overlayUtils` and set `components={{ CollaboratorCursor: null }}` so the
968
+ * DOM layer doesn't draw them a second time.
991
969
  */
992
970
  declare class CollaboratorCursorOverlayUtil extends OverlayUtil<DrCollaboratorCursorOverlay> {
993
971
  static type: string;
@@ -1012,22 +990,84 @@ declare class CollaboratorCursorOverlayUtil extends OverlayUtil<DrCollaboratorCu
1012
990
  private _setTruncatedTextCache;
1013
991
  }
1014
992
 
1015
- /** @public */
1016
- interface CollaboratorCursorsProps {
1017
- /** Layout overrides applied to each collaborator cursor. */
1018
- layout?: Partial<DrCollaboratorCursorLayout>;
1019
- }
1020
- /** @public @react */
1021
- declare const CollaboratorCursors: React$1.NamedExoticComponent<CollaboratorCursorsProps | undefined>;
993
+ /**
994
+ * Decode Miro clipboard payload (`miro-data-v1`).
995
+ *
996
+ * Miro puts an obfuscated JSON blob into `text/html` as:
997
+ * `<span data-meta="<--(miro-data-v1)BASE64(/miro-data-v1)-->"></span>`
998
+ *
999
+ * Encoding: UTF-8 JSON bytes → each byte +59 (mod 256) → base64.
1000
+ * See: https://github.com/Riley19280/miro-clipboard
1001
+ *
1002
+ * @internal research / future Miro paste parser
1003
+ */
1004
+ type MiroClipboardRoot = {
1005
+ boardId?: string;
1006
+ host?: string;
1007
+ version?: number;
1008
+ isProtected?: boolean;
1009
+ data?: {
1010
+ objects?: MiroClipboardObject[];
1011
+ shift?: {
1012
+ x?: number;
1013
+ y?: number;
1014
+ tokenizerIdDec?: string;
1015
+ };
1016
+ meta?: unknown;
1017
+ };
1018
+ };
1019
+ type MiroClipboardObject = {
1020
+ id?: number | string;
1021
+ initialId?: string;
1022
+ type?: number;
1023
+ widgetData?: {
1024
+ type?: string;
1025
+ json?: Record<string, unknown>;
1026
+ };
1027
+ [key: string]: unknown;
1028
+ };
1029
+ declare function extractMiroDataPayload(htmlOrMeta: string): {
1030
+ version: number;
1031
+ payload: string;
1032
+ } | null;
1033
+ declare function decodeMiroClipboardHtml(htmlOrMeta: string, encodingOffset?: number): MiroClipboardRoot | null;
1034
+ declare function summarizeMiroClipboard(root: MiroClipboardRoot): {
1035
+ boardId: string | null;
1036
+ host: string | null;
1037
+ version: number | null;
1038
+ isProtected: boolean | null;
1039
+ objectCount: number;
1040
+ widgetTypes: string[];
1041
+ hasShift: boolean;
1042
+ shift: {
1043
+ x?: number;
1044
+ y?: number;
1045
+ tokenizerIdDec?: string;
1046
+ } | null;
1047
+ };
1022
1048
 
1023
- /** @public @react */
1024
- declare function DefaultCollaboratorCursor({ point, color, name, chatMessage, scale, layout, }: DrCollaboratorCursorProps): react_jsx_runtime.JSX.Element;
1049
+ /**
1050
+ * Convert Miro clipboard JSON (`miro-data-v1`) into draw shapes and paste onto the page.
1051
+ *
1052
+ * Pattern mirrors `putExcalidrawContent`: build a `DrContent`, then
1053
+ * `editor.putContentOntoCurrentPage`.
1054
+ */
1025
1055
 
1026
- /** @public @react */
1027
- declare function CollaboratorCursorPointer({ color, iconOffset, }: {
1028
- color: string;
1029
- iconOffset: DrCollaboratorCursorLayout['iconOffset'];
1030
- }): react_jsx_runtime.JSX.Element;
1056
+ /** Summary of a successful Miro → board paste. @public */
1057
+ type MiroPasteInfo = {
1058
+ shapeCount: number;
1059
+ shapeIds: DrShapeId[];
1060
+ widgetTypes: string[];
1061
+ miroBoardId: string | null;
1062
+ miroHost: string | null;
1063
+ };
1064
+ /**
1065
+ * Put Miro clipboard content onto the current page.
1066
+ *
1067
+ * @returns Paste summary when at least one shape was created, otherwise `null`.
1068
+ * @public
1069
+ */
1070
+ declare function putMiroContent(editor: Editor, miroClipboardContent: MiroClipboardRoot, point?: VecLike): Promise<MiroPasteInfo | null>;
1031
1071
 
1032
1072
  /** @public @react */
1033
1073
  declare function CollaboratorCursorBadge({ color, name, chatMessage, badgeOffset, }: {
@@ -1042,6 +1082,23 @@ declare const DEFAULT_COLLABORATOR_CURSOR_LAYOUT: DrCollaboratorCursorLayout;
1042
1082
  /** @public */
1043
1083
  declare function mergeCollaboratorCursorLayout(overrides?: Partial<DrCollaboratorCursorLayout>): DrCollaboratorCursorLayout;
1044
1084
 
1085
+ /** @public @react */
1086
+ declare function CollaboratorCursorPointer({ color, iconOffset, }: {
1087
+ color: string;
1088
+ iconOffset: DrCollaboratorCursorLayout['iconOffset'];
1089
+ }): react_jsx_runtime.JSX.Element;
1090
+
1091
+ /** @public */
1092
+ interface CollaboratorCursorsProps {
1093
+ /** Layout overrides applied to each collaborator cursor. */
1094
+ layout?: Partial<DrCollaboratorCursorLayout>;
1095
+ }
1096
+ /** @public @react */
1097
+ declare const CollaboratorCursors: React$1.NamedExoticComponent<CollaboratorCursorsProps | undefined>;
1098
+
1099
+ /** @public @react */
1100
+ declare function DefaultCollaboratorCursor({ point, color, name, chatMessage, scale, layout, }: DrCollaboratorCursorProps): react_jsx_runtime.JSX.Element;
1101
+
1045
1102
  /** @public */
1046
1103
  interface DrCollaboratorCursorScaleOptions {
1047
1104
  /**
@@ -1079,158 +1136,23 @@ interface DrCollaboratorCursorScaleOptions {
1079
1136
  declare function getCollaboratorCursorScale(zoom: number, options?: DrCollaboratorCursorScaleOptions): number;
1080
1137
 
1081
1138
  /** @public */
1082
- interface DrCollaboratorShapeIndicatorOverlay extends DrOverlay {
1083
- props: {
1084
- indicators: Array<{
1085
- color: string;
1086
- shapeIds: DrShapeId[];
1087
- }>;
1088
- };
1089
- }
1090
- /**
1091
- * Overlay util for remote collaborators' shape selection indicators.
1092
- *
1093
- * Renders a per-peer outline around each shape another user has selected,
1094
- * using the peer's color. Drawn under the local `ShapeIndicatorOverlayUtil`
1095
- * (lower z-index) so the local user's selection always appears on top.
1096
- *
1097
- * Non-interactive: contributes no hit-test geometry.
1098
- *
1099
- * @public
1100
- */
1101
- declare class CollaboratorShapeIndicatorOverlayUtil extends OverlayUtil<DrCollaboratorShapeIndicatorOverlay> {
1102
- static type: string;
1103
- options: {
1104
- zIndex: number;
1105
- lineWidth: number;
1106
- alpha: number;
1107
- };
1108
- isActive(): boolean;
1109
- getOverlays(): DrCollaboratorShapeIndicatorOverlay[];
1110
- render(ctx: CanvasRenderingContext2D, overlays: DrCollaboratorShapeIndicatorOverlay[]): void;
1111
- }
1112
-
1113
- /** @public */
1114
- interface DrShapeHandleOverlay extends DrOverlay {
1115
- props: {
1116
- shapeId: DrShapeId;
1117
- handle: DrHandle;
1118
- };
1119
- }
1120
- /**
1121
- * Overlay util for shape handles (arrow endpoints, line vertices, etc.).
1122
- *
1123
- * @public
1124
- */
1125
- declare class ShapeHandleOverlayUtil extends OverlayUtil<DrShapeHandleOverlay> {
1126
- static type: string;
1127
- options: {
1128
- zIndex: number;
1129
- lineWidth: number;
1130
- };
1131
- isActive(): boolean;
1132
- getOverlays(): DrShapeHandleOverlay[];
1133
- getGeometry(overlay: DrShapeHandleOverlay): Geometry2d | null;
1134
- getCursor(_overlay: DrShapeHandleOverlay): DrCursorType | undefined;
1135
- render(ctx: CanvasRenderingContext2D, overlays: DrShapeHandleOverlay[]): void;
1136
- }
1137
-
1138
- /** @public */
1139
- interface DrSelectionForegroundOverlay extends DrOverlay {
1140
- props: {
1141
- overlayType: 'resize_handle' | 'rotate_handle' | 'mobile_rotate';
1142
- handle: DrSelectionHandle | RotateCorner;
1143
- };
1144
- }
1145
- /**
1146
- * Overlay util for selection foreground handles (resize corners/edges, rotate corners, mobile rotate).
1147
- * Each interactive element of the selection foreground becomes its own overlay instance.
1148
- *
1149
- * @public
1150
- */
1151
- declare class SelectionForegroundOverlayUtil extends OverlayUtil<DrSelectionForegroundOverlay> {
1152
- static type: string;
1153
- options: {
1154
- zIndex: number;
1155
- lineWidth: number;
1156
- };
1157
- isActive(): boolean;
1158
- getOverlays(): DrSelectionForegroundOverlay[];
1159
- getGeometry(overlay: DrSelectionForegroundOverlay): Geometry2d | null;
1160
- render(ctx: CanvasRenderingContext2D, _overlays: DrSelectionForegroundOverlay[]): void;
1161
- getCursor(overlay: DrSelectionForegroundOverlay): DrCursorType | undefined;
1162
- private _collectResizeCornerOverlays;
1163
- private _collectResizeEdgeOverlays;
1164
- private _collectRotateOverlays;
1165
- private _getResizeHandleGeometry;
1166
- private _getRotateHandleGeometry;
1167
- private _getMobileRotateGeometry;
1168
- private _renderSelectionBox;
1169
- private _renderResizeCorners;
1170
- private _renderCropHandles;
1171
- private _renderMobileRotateHandle;
1172
- private _renderTextResizeHandles;
1173
- /**
1174
- * Single source of truth for the derived state the selection foreground needs.
1175
- * Called from `getOverlays()`, `getGeometry()`, and `render()` so their visibility
1176
- * predicates can't drift. Returns `null` when no selection UI should appear at all
1177
- * (nothing selected, or the only selected shape is hidden).
1178
- */
1179
- private _computeSelectionState;
1180
- private _getMobileRotateCenter;
1181
- private _getThemeColors;
1182
- private _makeOverlay;
1183
- private _getEdgeLocalPoints;
1184
- private _getRotateHandleLocalCenter;
1185
- private _getCornerLocalPoint;
1186
- private _localRectToPoints;
1187
- }
1188
-
1189
- /** @public */
1190
- interface DrSnapIndicatorOverlay extends DrOverlay {
1191
- props: {
1192
- line: SnapIndicator;
1193
- };
1194
- }
1195
- /**
1196
- * Overlay util for snap alignment indicators (point snap lines and gap indicators).
1197
- *
1198
- * @public
1199
- */
1200
- declare class SnapIndicatorOverlayUtil extends OverlayUtil<DrSnapIndicatorOverlay> {
1201
- static type: string;
1202
- options: {
1203
- zIndex: number;
1204
- lineWidth: number;
1205
- };
1206
- isActive(): boolean;
1207
- getOverlays(): DrSnapIndicatorOverlay[];
1208
- render(ctx: CanvasRenderingContext2D, overlays: DrSnapIndicatorOverlay[]): void;
1209
- private _renderPoints;
1210
- private _renderGaps;
1211
- }
1212
-
1213
- /** @public */
1214
- declare const defaultAssetUtils: readonly [typeof ImageAssetUtil, typeof VideoAssetUtil, typeof BookmarkAssetUtil];
1215
-
1216
- /** @public */
1217
- declare const defaultBindingUtils: readonly [typeof ArrowBindingUtil];
1218
-
1219
- /** @public */
1220
- declare const defaultOverlayUtils: readonly [typeof CollaboratorShapeIndicatorOverlayUtil, typeof ShapeIndicatorOverlayUtil, typeof SelectionForegroundOverlayUtil, typeof ShapeHandleOverlayUtil, typeof BrushOverlayUtil, typeof ZoomBrushOverlayUtil, typeof SnapIndicatorOverlayUtil, typeof ScribbleOverlayUtil, typeof CollaboratorBrushOverlayUtil, typeof CollaboratorScribbleOverlayUtil, typeof CollaboratorHintOverlayUtil, typeof ArrowHintOverlayUtil, typeof ArrowBindingHintOverlayUtil];
1221
-
1222
- /** @public */
1223
- declare const DEFAULT_EMBED_DEFINITIONS: readonly [{
1224
- readonly type: "tldraw";
1225
- readonly title: "tldraw";
1226
- readonly hostnames: readonly ["beta.draw.com", "tldraw.com", "localhost:3000"];
1227
- readonly minWidth: 300;
1228
- readonly minHeight: 300;
1229
- readonly width: 720;
1230
- readonly height: 500;
1231
- readonly doesResize: true;
1232
- readonly overridePermissions: {
1233
- readonly 'allow-top-navigation': true;
1139
+ declare const defaultAssetUtils: readonly [typeof ImageAssetUtil, typeof VideoAssetUtil, typeof BookmarkAssetUtil];
1140
+
1141
+ /** @public */
1142
+ declare const defaultBindingUtils: readonly [typeof ArrowBindingUtil];
1143
+
1144
+ /** @public */
1145
+ declare const DEFAULT_EMBED_DEFINITIONS: readonly [{
1146
+ readonly type: "tldraw";
1147
+ readonly title: "tldraw";
1148
+ readonly hostnames: readonly ["beta.draw.com", "tldraw.com", "localhost:3000"];
1149
+ readonly minWidth: 300;
1150
+ readonly minHeight: 300;
1151
+ readonly width: 720;
1152
+ readonly height: 500;
1153
+ readonly doesResize: true;
1154
+ readonly overridePermissions: {
1155
+ readonly 'allow-top-navigation': true;
1234
1156
  };
1235
1157
  readonly toEmbedUrl: (url: string) => string | undefined;
1236
1158
  readonly fromEmbedUrl: (url: string) => string | undefined;
@@ -1265,7 +1187,7 @@ declare const DEFAULT_EMBED_DEFINITIONS: readonly [{
1265
1187
  readonly overridePermissions: {
1266
1188
  readonly 'allow-presentation': true;
1267
1189
  };
1268
- readonly toEmbedUrl: (url: string) => string | undefined;
1190
+ readonly toEmbedUrl: (url: string, config?: GoogleMapsEmbedConfig) => string | undefined;
1269
1191
  readonly fromEmbedUrl: (url: string) => string | undefined;
1270
1192
  readonly embedOnPaste: true;
1271
1193
  }, {
@@ -1411,6 +1333,7 @@ declare const DEFAULT_EMBED_DEFINITIONS: readonly [{
1411
1333
  readonly doesResize: true;
1412
1334
  readonly isAspectRatioLocked: true;
1413
1335
  readonly embedOnPaste: true;
1336
+ readonly sizeToContentAspectRatio: true;
1414
1337
  readonly toEmbedUrl: (url: string) => string | undefined;
1415
1338
  readonly fromEmbedUrl: (url: string) => string | undefined;
1416
1339
  }, {
@@ -1472,8 +1395,26 @@ type DrEmbedShapePermissions = {
1472
1395
  * @public
1473
1396
  */
1474
1397
  declare const unknownEmbedShapePermissionOverrides: DrEmbedShapePermissions;
1398
+ /**
1399
+ * Configuration for the default Google Maps embed. Provide an `apiKey` through
1400
+ * {@link EmbedShapeUtil}'s `embedConfig` option to render Google Maps embeds.
1401
+ *
1402
+ * @public
1403
+ */
1404
+ interface GoogleMapsEmbedConfig {
1405
+ readonly apiKey?: string;
1406
+ }
1407
+ /**
1408
+ * Per-embed configuration for the default embed definitions, keyed by embed type.
1409
+ * Passed to an embed definition's `toEmbedUrl` when building its embed URL.
1410
+ *
1411
+ * @public
1412
+ */
1413
+ interface DefaultEmbedConfig {
1414
+ readonly google_maps?: GoogleMapsEmbedConfig;
1415
+ }
1475
1416
  /** @public */
1476
- interface EmbedDefinition {
1417
+ interface EmbedDefinition<Config = never> {
1477
1418
  readonly type: string;
1478
1419
  readonly title: string;
1479
1420
  readonly hostnames: readonly string[];
@@ -1489,15 +1430,23 @@ interface EmbedDefinition {
1489
1430
  readonly embedOnPaste?: boolean;
1490
1431
  readonly canEditWhileLocked?: boolean;
1491
1432
  readonly overrideOutlineRadius?: number;
1492
- readonly toEmbedUrl: (url: string) => string | undefined;
1433
+ /**
1434
+ * When true, the embed shape corrects its size after creation to match the real aspect ratio of
1435
+ * its content, so fixed-aspect media (like video) isn't letterboxed inside the default box. The
1436
+ * dimensions are resolved from the URL's OpenGraph metadata via the editor's url asset handler
1437
+ * (the same "unfurl" path used for bookmarks), so it degrades gracefully when no metadata is
1438
+ * available.
1439
+ */
1440
+ readonly sizeToContentAspectRatio?: boolean;
1441
+ readonly toEmbedUrl: (url: string, config?: Config) => string | undefined;
1493
1442
  readonly fromEmbedUrl: (url: string) => string | undefined;
1494
1443
  }
1495
1444
  /** @public */
1496
- interface CustomEmbedDefinition extends EmbedDefinition {
1445
+ interface CustomEmbedDefinition<Config = never> extends EmbedDefinition<Config> {
1497
1446
  readonly icon: string;
1498
1447
  }
1499
1448
  /** @public */
1500
- type DrEmbedDefinition = EmbedDefinition | CustomEmbedDefinition;
1449
+ type DrEmbedDefinition = EmbedDefinition<any> | CustomEmbedDefinition<any>;
1501
1450
  /** @public */
1502
1451
  type DefaultEmbedDefinitionType = (typeof DEFAULT_EMBED_DEFINITIONS)[number]['type'];
1503
1452
 
@@ -1540,85 +1489,6 @@ declare function DrawUiToastsProvider({ children }: DrUiToastsProviderProps): re
1540
1489
  /** @public */
1541
1490
  declare function useToasts(): DrUiToastsContextType;
1542
1491
 
1543
- /**
1544
- * Decode Miro clipboard payload (`miro-data-v1`).
1545
- *
1546
- * Miro puts an obfuscated JSON blob into `text/html` as:
1547
- * `<span data-meta="<--(miro-data-v1)BASE64(/miro-data-v1)-->"></span>`
1548
- *
1549
- * Encoding: UTF-8 JSON bytes → each byte +59 (mod 256) → base64.
1550
- * See: https://github.com/Riley19280/miro-clipboard
1551
- *
1552
- * @internal research / future Miro paste parser
1553
- */
1554
- type MiroClipboardRoot = {
1555
- boardId?: string;
1556
- host?: string;
1557
- version?: number;
1558
- isProtected?: boolean;
1559
- data?: {
1560
- objects?: MiroClipboardObject[];
1561
- shift?: {
1562
- x?: number;
1563
- y?: number;
1564
- tokenizerIdDec?: string;
1565
- };
1566
- meta?: unknown;
1567
- };
1568
- };
1569
- type MiroClipboardObject = {
1570
- id?: number | string;
1571
- initialId?: string;
1572
- type?: number;
1573
- widgetData?: {
1574
- type?: string;
1575
- json?: Record<string, unknown>;
1576
- };
1577
- [key: string]: unknown;
1578
- };
1579
- declare function extractMiroDataPayload(htmlOrMeta: string): {
1580
- version: number;
1581
- payload: string;
1582
- } | null;
1583
- declare function decodeMiroClipboardHtml(htmlOrMeta: string, encodingOffset?: number): MiroClipboardRoot | null;
1584
- declare function summarizeMiroClipboard(root: MiroClipboardRoot): {
1585
- boardId: string | null;
1586
- host: string | null;
1587
- version: number | null;
1588
- isProtected: boolean | null;
1589
- objectCount: number;
1590
- widgetTypes: string[];
1591
- hasShift: boolean;
1592
- shift: {
1593
- x?: number;
1594
- y?: number;
1595
- tokenizerIdDec?: string;
1596
- } | null;
1597
- };
1598
-
1599
- /**
1600
- * Convert Miro clipboard JSON (`miro-data-v1`) into draw shapes and paste onto the page.
1601
- *
1602
- * Pattern mirrors `putExcalidrawContent`: build a `DrContent`, then
1603
- * `editor.putContentOntoCurrentPage`.
1604
- */
1605
-
1606
- /** Summary of a successful Miro → board paste. @public */
1607
- type MiroPasteInfo = {
1608
- shapeCount: number;
1609
- shapeIds: DrShapeId[];
1610
- widgetTypes: string[];
1611
- miroBoardId: string | null;
1612
- miroHost: string | null;
1613
- };
1614
- /**
1615
- * Put Miro clipboard content onto the current page.
1616
- *
1617
- * @returns Paste summary when at least one shape was created, otherwise `null`.
1618
- * @public
1619
- */
1620
- declare function putMiroContent(editor: Editor, miroClipboardContent: MiroClipboardRoot, point?: VecLike): Promise<MiroPasteInfo | null>;
1621
-
1622
1492
  /**
1623
1493
  * 5000px
1624
1494
  * @public
@@ -1696,9 +1566,10 @@ declare function defaultHandleExternalTextContent(editor: Editor, { point, text,
1696
1566
  html?: string;
1697
1567
  }): Promise<void>;
1698
1568
  /** @public */
1699
- declare function defaultHandleExternalUrlContent(editor: Editor, { point, url }: {
1569
+ declare function defaultHandleExternalUrlContent(editor: Editor, { point, url, shapeId }: {
1700
1570
  point?: VecLike;
1701
1571
  url: string;
1572
+ shapeId?: DrShapeId;
1702
1573
  }, { toasts, msg }: DrDefaultExternalContentHandlerOpts): Promise<void>;
1703
1574
  /** @public */
1704
1575
  declare function defaultHandleExternalDrawContent(editor: Editor, { point, content }: {
@@ -1755,19 +1626,239 @@ declare function notifyIfFileNotAllowed(editor: Editor, file: File, options: DrD
1755
1626
  declare function getAssetInfo(editor: Editor, file: File, assetId?: DrAssetId): Promise<DrAsset | null>;
1756
1627
 
1757
1628
  /** @public */
1758
- declare class ArrowShapeTool extends StateNode {
1759
- static id: string;
1760
- static initial: string;
1761
- static children(): DrStateNodeConstructor[];
1762
- shapeType: string;
1629
+ interface DrCollaboratorBrushOverlay extends DrOverlay {
1630
+ props: {
1631
+ x: number;
1632
+ y: number;
1633
+ w: number;
1634
+ h: number;
1635
+ color: string;
1636
+ };
1763
1637
  }
1764
-
1765
- /** @public */
1766
- declare class DrawShapeTool extends StateNode {
1767
- static id: string;
1768
- static initial: string;
1769
- static isLockable: boolean;
1770
- static useCoalescedEvents: boolean;
1638
+ /**
1639
+ * Overlay util for collaborator selection brushes.
1640
+ *
1641
+ * @public
1642
+ */
1643
+ declare class CollaboratorBrushOverlayUtil extends OverlayUtil<DrCollaboratorBrushOverlay> {
1644
+ static type: string;
1645
+ options: {
1646
+ zIndex: number;
1647
+ lineWidth: number;
1648
+ };
1649
+ isActive(): boolean;
1650
+ getOverlays(): DrCollaboratorBrushOverlay[];
1651
+ render(ctx: CanvasRenderingContext2D, overlays: DrCollaboratorBrushOverlay[]): void;
1652
+ renderMinimap(ctx: CanvasRenderingContext2D, overlays: DrCollaboratorBrushOverlay[]): void;
1653
+ }
1654
+
1655
+ /** @public */
1656
+ interface DrCollaboratorScribbleOverlay extends DrOverlay {
1657
+ props: {
1658
+ scribble: DrScribble;
1659
+ color: string;
1660
+ };
1661
+ }
1662
+ /**
1663
+ * Overlay util for collaborator scribble strokes (eraser, lasso, etc.).
1664
+ *
1665
+ * @public
1666
+ */
1667
+ declare class CollaboratorScribbleOverlayUtil extends OverlayUtil<DrCollaboratorScribbleOverlay> {
1668
+ static type: string;
1669
+ options: {
1670
+ zIndex: number;
1671
+ streamline: number;
1672
+ cacheSize: number;
1673
+ };
1674
+ private _collabScribblePathCache;
1675
+ isActive(): boolean;
1676
+ getOverlays(): DrCollaboratorScribbleOverlay[];
1677
+ render(ctx: CanvasRenderingContext2D, overlays: DrCollaboratorScribbleOverlay[]): void;
1678
+ }
1679
+
1680
+ /** @public */
1681
+ interface DrCollaboratorShapeIndicatorOverlay extends DrOverlay {
1682
+ props: {
1683
+ indicators: Array<{
1684
+ color: string;
1685
+ shapeIds: DrShapeId[];
1686
+ }>;
1687
+ };
1688
+ }
1689
+ /**
1690
+ * Overlay util for remote collaborators' shape selection indicators.
1691
+ *
1692
+ * Renders a per-peer outline around each shape another user has selected,
1693
+ * using the peer's color. Drawn under the local `ShapeIndicatorOverlayUtil`
1694
+ * (lower z-index) so the local user's selection always appears on top.
1695
+ *
1696
+ * Non-interactive: contributes no hit-test geometry.
1697
+ *
1698
+ * @public
1699
+ */
1700
+ declare class CollaboratorShapeIndicatorOverlayUtil extends OverlayUtil<DrCollaboratorShapeIndicatorOverlay> {
1701
+ static type: string;
1702
+ options: {
1703
+ zIndex: number;
1704
+ lineWidth: number;
1705
+ alpha: number;
1706
+ };
1707
+ isActive(): boolean;
1708
+ getOverlays(): DrCollaboratorShapeIndicatorOverlay[];
1709
+ render(ctx: CanvasRenderingContext2D, overlays: DrCollaboratorShapeIndicatorOverlay[]): void;
1710
+ }
1711
+
1712
+ /** @public */
1713
+ interface DrSelectionForegroundOverlay extends DrOverlay {
1714
+ props: {
1715
+ overlayType: 'resize_handle' | 'rotate_handle' | 'mobile_rotate';
1716
+ handle: DrSelectionHandle | RotateCorner;
1717
+ };
1718
+ }
1719
+ /**
1720
+ * Overlay util for selection foreground handles (resize corners/edges, rotate corners, mobile rotate).
1721
+ * Each interactive element of the selection foreground becomes its own overlay instance.
1722
+ *
1723
+ * @public
1724
+ */
1725
+ declare class SelectionForegroundOverlayUtil extends OverlayUtil<DrSelectionForegroundOverlay> {
1726
+ static type: string;
1727
+ options: {
1728
+ zIndex: number;
1729
+ lineWidth: number;
1730
+ };
1731
+ isActive(): boolean;
1732
+ getOverlays(): DrSelectionForegroundOverlay[];
1733
+ getGeometry(overlay: DrSelectionForegroundOverlay): Geometry2d | null;
1734
+ render(ctx: CanvasRenderingContext2D, _overlays: DrSelectionForegroundOverlay[]): void;
1735
+ getCursor(overlay: DrSelectionForegroundOverlay): DrCursorType | undefined;
1736
+ private _collectResizeCornerOverlays;
1737
+ private _collectResizeEdgeOverlays;
1738
+ private _collectRotateOverlays;
1739
+ private _getResizeHandleGeometry;
1740
+ private _getRotateHandleGeometry;
1741
+ private _getMobileRotateGeometry;
1742
+ private _renderSelectionBox;
1743
+ private _renderResizeCorners;
1744
+ private _renderCropHandles;
1745
+ private _renderMobileRotateHandle;
1746
+ private _renderTextResizeHandles;
1747
+ /**
1748
+ * Single source of truth for the derived state the selection foreground needs.
1749
+ * Called from `getOverlays()`, `getGeometry()`, and `render()` so their visibility
1750
+ * predicates can't drift. Returns `null` when no selection UI should appear at all
1751
+ * (nothing selected, or the only selected shape is hidden).
1752
+ */
1753
+ private _computeSelectionState;
1754
+ private _getMobileRotateCenter;
1755
+ private _getThemeColors;
1756
+ private _makeOverlay;
1757
+ private _getEdgeLocalRect;
1758
+ private _getRotateHandleLocalCenter;
1759
+ private _getCornerLocalPoint;
1760
+ private _localRectToPoints;
1761
+ }
1762
+
1763
+ /** @public */
1764
+ interface DrShapeHandleOverlay extends DrOverlay {
1765
+ props: {
1766
+ shapeId: DrShapeId;
1767
+ handle: DrHandle;
1768
+ };
1769
+ }
1770
+ /**
1771
+ * Overlay util for shape handles (arrow endpoints, line vertices, etc.).
1772
+ *
1773
+ * @public
1774
+ */
1775
+ declare class ShapeHandleOverlayUtil extends OverlayUtil<DrShapeHandleOverlay> {
1776
+ static type: string;
1777
+ options: {
1778
+ zIndex: number;
1779
+ lineWidth: number;
1780
+ };
1781
+ isActive(): boolean;
1782
+ getOverlays(): DrShapeHandleOverlay[];
1783
+ getGeometry(overlay: DrShapeHandleOverlay): Geometry2d | null;
1784
+ getCursor(_overlay: DrShapeHandleOverlay): DrCursorType | undefined;
1785
+ render(ctx: CanvasRenderingContext2D, overlays: DrShapeHandleOverlay[]): void;
1786
+ }
1787
+
1788
+ /** @public */
1789
+ interface DrShapeIndicatorOverlay extends DrOverlay {
1790
+ props: {
1791
+ idsToDisplay: DrShapeId$1[];
1792
+ hintingShapeIds: DrShapeId$1[];
1793
+ };
1794
+ }
1795
+ /**
1796
+ * Overlay util for shape indicators — the selection / hover / hint outlines drawn
1797
+ * under the selection foreground. Paints local indicators in the theme's
1798
+ * selection color.
1799
+ *
1800
+ * Remote collaborator selection indicators are drawn by a separate overlay util
1801
+ * (e.g. `CollaboratorShapeIndicatorOverlayUtil` from `tldraw`) that runs at a
1802
+ * lower z-index so peer selections appear under the local indicators.
1803
+ *
1804
+ * Non-interactive: contributes no hit-test geometry.
1805
+ *
1806
+ * @public
1807
+ */
1808
+ declare class ShapeIndicatorOverlayUtil extends OverlayUtil<DrShapeIndicatorOverlay> {
1809
+ static type: string;
1810
+ options: {
1811
+ zIndex: number;
1812
+ lineWidth: number;
1813
+ hintedLineWidth: number;
1814
+ };
1815
+ private _instanceFlags$;
1816
+ isActive(): boolean;
1817
+ getOverlays(): DrShapeIndicatorOverlay[];
1818
+ render(ctx: CanvasRenderingContext2D, overlays: DrShapeIndicatorOverlay[]): void;
1819
+ }
1820
+
1821
+ /** @public */
1822
+ interface DrSnapIndicatorOverlay extends DrOverlay {
1823
+ props: {
1824
+ line: SnapIndicator;
1825
+ };
1826
+ }
1827
+ /**
1828
+ * Overlay util for snap alignment indicators (point snap lines and gap indicators).
1829
+ *
1830
+ * @public
1831
+ */
1832
+ declare class SnapIndicatorOverlayUtil extends OverlayUtil<DrSnapIndicatorOverlay> {
1833
+ static type: string;
1834
+ options: {
1835
+ zIndex: number;
1836
+ lineWidth: number;
1837
+ };
1838
+ isActive(): boolean;
1839
+ getOverlays(): DrSnapIndicatorOverlay[];
1840
+ render(ctx: CanvasRenderingContext2D, overlays: DrSnapIndicatorOverlay[]): void;
1841
+ private _renderPoints;
1842
+ private _renderGaps;
1843
+ }
1844
+
1845
+ /** @public */
1846
+ declare const defaultOverlayUtils: readonly [typeof ArrowBindingHintOverlayUtil, typeof ArrowHintOverlayUtil, typeof BrushOverlayUtil, typeof CollaboratorBrushOverlayUtil, typeof CollaboratorHintOverlayUtil, typeof CollaboratorScribbleOverlayUtil, typeof CollaboratorShapeIndicatorOverlayUtil, typeof ScribbleOverlayUtil, typeof SelectionForegroundOverlayUtil, typeof ShapeHandleOverlayUtil, typeof ShapeIndicatorOverlayUtil, typeof SnapIndicatorOverlayUtil, typeof ZoomBrushOverlayUtil];
1847
+
1848
+ /** @public */
1849
+ declare class ArrowShapeTool extends StateNode {
1850
+ static id: string;
1851
+ static initial: string;
1852
+ static children(): DrStateNodeConstructor[];
1853
+ shapeType: string;
1854
+ }
1855
+
1856
+ /** @public */
1857
+ declare class DrawShapeTool extends StateNode {
1858
+ static id: string;
1859
+ static initial: string;
1860
+ static isLockable: boolean;
1861
+ static useCoalescedEvents: boolean;
1771
1862
  static children(): DrStateNodeConstructor[];
1772
1863
  shapeType: string;
1773
1864
  onExit(): void;
@@ -2330,6 +2421,7 @@ declare class BookmarkShapeUtil extends BaseBoxShapeUtil<DrBookmarkShape> {
2330
2421
  getText(shape: DrBookmarkShape): string;
2331
2422
  getAriaDescriptor(shape: DrBookmarkShape): string | undefined;
2332
2423
  getDefaultProps(): DrBookmarkShape['props'];
2424
+ getGeometry(shape: DrBookmarkShape): Rectangle2d;
2333
2425
  component(shape: DrBookmarkShape): react_jsx_runtime.JSX.Element;
2334
2426
  getIndicatorPath(shape: DrBookmarkShape): Path2D;
2335
2427
  onBeforeCreate(next: DrBookmarkShape): {
@@ -2351,25 +2443,7 @@ declare class BookmarkShapeUtil extends BaseBoxShapeUtil<DrBookmarkShape> {
2351
2443
  opacity: _ibodr_schema.DrOpacityType;
2352
2444
  meta: _ibodr_utils.JsonObject;
2353
2445
  };
2354
- onBeforeUpdate(prev: DrBookmarkShape, shape: DrBookmarkShape): {
2355
- props: {
2356
- h: number;
2357
- w: number;
2358
- assetId: DrAssetId | null;
2359
- url: string;
2360
- };
2361
- id: _ibodr_schema.DrShapeId;
2362
- typeName: "shape";
2363
- type: "bookmark";
2364
- x: number;
2365
- y: number;
2366
- rotation: number;
2367
- index: _ibodr_utils.IndexKey;
2368
- parentId: _ibodr_schema.DrParentId;
2369
- isLocked: boolean;
2370
- opacity: _ibodr_schema.DrOpacityType;
2371
- meta: _ibodr_utils.JsonObject;
2372
- } | undefined;
2446
+ onBeforeUpdate(prev: DrBookmarkShape, shape: DrBookmarkShape): DrBookmarkShape | undefined;
2373
2447
  getInterpolatedProps(startShape: DrBookmarkShape, endShape: DrBookmarkShape, t: number): DrBookmarkShapeProps;
2374
2448
  }
2375
2449
 
@@ -2424,9 +2498,10 @@ type DrEmbedResult = {
2424
2498
  * return undefined.
2425
2499
  *
2426
2500
  * @param inputUrl - The URL to match
2501
+ * @param embedConfig - Optional per-embed config, keyed by embed type, passed to `toEmbedUrl`
2427
2502
  * @public
2428
2503
  */
2429
- declare function getEmbedInfo(definitions: readonly DrEmbedDefinition[], inputUrl: string): DrEmbedResult;
2504
+ declare function getEmbedInfo(definitions: readonly DrEmbedDefinition[], inputUrl: string, embedConfig?: Record<string, unknown>): DrEmbedResult;
2430
2505
 
2431
2506
  /** @public */
2432
2507
  interface EmbedShapeUtilDisplayValues {
@@ -2436,6 +2511,15 @@ interface EmbedShapeUtilDisplayValues {
2436
2511
  interface EmbedShapeOptions extends ShapeOptionsWithDisplayValues<DrEmbedShape, EmbedShapeUtilDisplayValues> {
2437
2512
  /** The embed definitions to use for this shape util. */
2438
2513
  readonly embedDefinitions: readonly DrEmbedDefinition[];
2514
+ /**
2515
+ * Per-embed configuration, keyed by embed type. Passed to each definition's `toEmbedUrl` when
2516
+ * building its embed URL — for example, an API key for the default Google Maps embed:
2517
+ *
2518
+ * ```ts
2519
+ * EmbedShapeUtil.configure({ embedConfig: { google_maps: { apiKey: '...' } } })
2520
+ * ```
2521
+ */
2522
+ readonly embedConfig?: DefaultEmbedConfig & Record<string, unknown>;
2439
2523
  }
2440
2524
  /** @public */
2441
2525
  declare class EmbedShapeUtil extends BaseBoxShapeUtil<DrEmbedShape> {
@@ -2446,10 +2530,23 @@ declare class EmbedShapeUtil extends BaseBoxShapeUtil<DrEmbedShape> {
2446
2530
  canEditWhileLocked(shape: DrEmbedShape): boolean;
2447
2531
  private static legacyEmbedDefinitions;
2448
2532
  /** @deprecated - Use `EmbedShapeUtil.configure({ embedDefinitions: [...] })` instead. */
2449
- static setEmbedDefinitions(embedDefinitions: readonly EmbedDefinition[]): void;
2533
+ static setEmbedDefinitions(embedDefinitions: readonly DrEmbedDefinition[]): void;
2450
2534
  private getEmbedDefs;
2451
2535
  getEmbedDefinitions(): readonly DrEmbedDefinition[];
2452
2536
  getEmbedDefinition(url: string): DrEmbedResult;
2537
+ /**
2538
+ * Resolve the embed's true aspect ratio (for definitions with `sizeToContentAspectRatio`) and
2539
+ * correct the shape's size to match. The dimensions come from the URL's OpenGraph metadata via
2540
+ * the editor's url asset handler (the same "unfurl" path bookmarks use). The correction is
2541
+ * applied without adding to the undo history.
2542
+ */
2543
+ resolveAspectRatio(shape: DrEmbedShape): Promise<void>;
2544
+ /**
2545
+ * Resolve the content's aspect ratio from the URL's OpenGraph metadata, fetched through the
2546
+ * editor's url asset handler (the "unfurl" service). Returns `undefined` if no usable dimensions
2547
+ * are available (e.g. no unfurl service is configured, or the page reports no image size).
2548
+ */
2549
+ private getContentAspectRatio;
2453
2550
  getText(shape: DrEmbedShape): string;
2454
2551
  getAriaDescriptor(shape: DrEmbedShape): string | undefined;
2455
2552
  hideSelectionBoundsFg(shape: DrEmbedShape): boolean;
@@ -2459,6 +2556,12 @@ declare class EmbedShapeUtil extends BaseBoxShapeUtil<DrEmbedShape> {
2459
2556
  getDefaultProps(): DrEmbedShape['props'];
2460
2557
  getGeometry(shape: DrEmbedShape): _ibodr_editor.Geometry2d;
2461
2558
  isAspectRatioLocked(shape: DrEmbedShape): boolean;
2559
+ /**
2560
+ * The minimum width/height a resize of `shape` is allowed to reach. When the embed's aspect ratio
2561
+ * is locked, the longer axis's minimum is inflated by the current aspect ratio so that shrinking
2562
+ * to the floor keeps the shorter axis at or above the base minimum.
2563
+ */
2564
+ private getResizeMinBounds;
2462
2565
  onResize(shape: DrEmbedShape, info: DrResizeInfo<DrEmbedShape>): DrEmbedShape;
2463
2566
  component(shape: DrEmbedShape): react_jsx_runtime.JSX.Element | null;
2464
2567
  getIndicatorPath(shape: DrEmbedShape): Path2D;
@@ -2513,6 +2616,8 @@ declare class FrameShapeUtil extends BaseFrameLikeShapeUtil<DrFrameShape> {
2513
2616
  onDoubleClickEdge(shape: DrFrameShape, info: DrClickEventInfo): {
2514
2617
  id: _ibodr_schema.DrShapeId;
2515
2618
  type: "frame";
2619
+ x: number;
2620
+ y: number;
2516
2621
  props: {
2517
2622
  w: number;
2518
2623
  h: number;
@@ -2528,7 +2633,7 @@ declare class FrameShapeUtil extends BaseFrameLikeShapeUtil<DrFrameShape> {
2528
2633
  * Defines the behavior for a geo shape type. Every built-in geo type is
2529
2634
  * registered through this same interface (see {@link defaultGeoTypeDefinitions}),
2530
2635
  * and consumers can register additional types via
2531
- * {@link @ibodr/tldraw#GeoShapeUtil.configure | GeoShapeUtil.configure()}.
2636
+ * {@link @ibodr/draw#GeoShapeUtil.configure | GeoShapeUtil.configure()}.
2532
2637
  *
2533
2638
  * @public
2534
2639
  */
@@ -2564,7 +2669,7 @@ interface GeoTypeDefinition {
2564
2669
  * geo type (rectangle, ellipse, cloud, etc.) is registered here. The same
2565
2670
  * registry powers path generation, handle snapping, the style panel picker,
2566
2671
  * and creation defaults — so custom types added through
2567
- * {@link @ibodr/tldraw#GeoShapeUtil.configure | GeoShapeUtil.configure()} get
2672
+ * {@link @ibodr/draw#GeoShapeUtil.configure | GeoShapeUtil.configure()} get
2568
2673
  * the same treatment as the built-ins.
2569
2674
  *
2570
2675
  * The key order here defines the visual order of items in the geo style panel
@@ -3077,23 +3182,65 @@ declare class LineShapeUtil extends ShapeUtil<DrLineShape> {
3077
3182
  }
3078
3183
 
3079
3184
  /** @public */
3080
- interface NoteShapeUtilDisplayValues {
3081
- noteWidth: number;
3082
- noteHeight: number;
3083
- noteBackgroundColor: string;
3084
- borderColor: string;
3085
- borderWidth: number;
3086
- labelColor: string;
3087
- labelFontFamily: string;
3088
- labelFontSize: number;
3089
- labelLineHeight: number;
3090
- labelFontWeight: string;
3091
- labelFontVariant: string;
3092
- labelFontStyle: string;
3093
- labelPadding: number;
3094
- labelHorizontalAlign: 'start' | 'center' | 'end';
3095
- labelVerticalAlign: 'start' | 'middle' | 'end';
3096
- }
3185
+ interface DrNoteShapeAttributionProps {
3186
+ /** The note shape the attribution belongs to. */
3187
+ shape: DrNoteShape;
3188
+ /** The full display name of the user who last edited the note's text. */
3189
+ name: string;
3190
+ /** The first name (the part shown in the badge). */
3191
+ firstName: string;
3192
+ /** The label color to use for the badge. */
3193
+ color: string;
3194
+ /** The note's scale. Only meaningful for the `'canvas'` variant. */
3195
+ scale: number;
3196
+ /**
3197
+ * Where the attribution is being rendered. The `'canvas'` variant renders the interactive badge
3198
+ * (with a tooltip); the `'export'` variant renders static markup suitable for an SVG/PNG export.
3199
+ */
3200
+ variant: 'canvas' | 'export';
3201
+ }
3202
+ /**
3203
+ * The default attribution badge shown in the corner of a note shape — the display name of the user
3204
+ * who last edited the note's text.
3205
+ *
3206
+ * Override it (or hide it) with the note shape util's `AttributionComponent` option:
3207
+ *
3208
+ * ```tsx
3209
+ * // hide the attribution badge
3210
+ * <Draw shapeUtils={[NoteShapeUtil.configure({ AttributionComponent: null })]} />
3211
+ *
3212
+ * // render your own
3213
+ * <Draw shapeUtils={[NoteShapeUtil.configure({ AttributionComponent: (props) => <MyBadge {...props} /> })]} />
3214
+ * ```
3215
+ *
3216
+ * @public @react
3217
+ */
3218
+ declare function DefaultNoteShapeAttribution({ name, firstName, color, scale, variant, }: DrNoteShapeAttributionProps): react_jsx_runtime.JSX.Element;
3219
+ /**
3220
+ * The component used to render a note shape's attribution badge, or `null` to hide it.
3221
+ *
3222
+ * @public
3223
+ */
3224
+ type DrNoteShapeAttributionComponent = ComponentType<DrNoteShapeAttributionProps> | null;
3225
+
3226
+ /** @public */
3227
+ interface NoteShapeUtilDisplayValues {
3228
+ noteWidth: number;
3229
+ noteHeight: number;
3230
+ noteBackgroundColor: string;
3231
+ borderColor: string;
3232
+ borderWidth: number;
3233
+ labelColor: string;
3234
+ labelFontFamily: string;
3235
+ labelFontSize: number;
3236
+ labelLineHeight: number;
3237
+ labelFontWeight: string;
3238
+ labelFontVariant: string;
3239
+ labelFontStyle: string;
3240
+ labelPadding: number;
3241
+ labelHorizontalAlign: 'start' | 'center' | 'end';
3242
+ labelVerticalAlign: 'start' | 'middle' | 'end';
3243
+ }
3097
3244
  /** @public */
3098
3245
  interface NoteShapeOptions extends ShapeOptionsWithDisplayValues<DrNoteShape, NoteShapeUtilDisplayValues> {
3099
3246
  /**
@@ -3101,6 +3248,22 @@ interface NoteShapeOptions extends ShapeOptionsWithDisplayValues<DrNoteShape, No
3101
3248
  * but you can set it to be user-resizable using scale.
3102
3249
  */
3103
3250
  resizeMode: 'none' | 'scale';
3251
+ /**
3252
+ * The component used to render the note's "last edited by" attribution badge, both on the canvas
3253
+ * and in image exports. Defaults to {@link DefaultNoteShapeAttribution}. Set it to `null` to hide
3254
+ * the badge, or provide your own component (receiving {@link DrNoteShapeAttributionProps}) to
3255
+ * replace it.
3256
+ *
3257
+ * @example
3258
+ * ```tsx
3259
+ * // hide the badge
3260
+ * NoteShapeUtil.configure({ AttributionComponent: null })
3261
+ *
3262
+ * // render your own
3263
+ * NoteShapeUtil.configure({ AttributionComponent: (props) => <MyBadge {...props} /> })
3264
+ * ```
3265
+ */
3266
+ AttributionComponent: DrNoteShapeAttributionComponent;
3104
3267
  }
3105
3268
  /** @public */
3106
3269
  declare class NoteShapeUtil extends ShapeUtil<DrNoteShape> {
@@ -3141,7 +3304,7 @@ declare class NoteShapeUtil extends ShapeUtil<DrNoteShape> {
3141
3304
  url: string;
3142
3305
  richText: _ibodr_schema.DrRichText;
3143
3306
  scale: number;
3144
- textFirstEditedBy: string | null;
3307
+ textLastEditedBy: string | null;
3145
3308
  };
3146
3309
  id: DrShapeId;
3147
3310
  typeName: "shape";
@@ -3155,6 +3318,7 @@ declare class NoteShapeUtil extends ShapeUtil<DrNoteShape> {
3155
3318
  opacity: _ibodr_schema.DrOpacityType;
3156
3319
  meta: _ibodr_utils.JsonObject;
3157
3320
  } | undefined;
3321
+ onBeforeDuplicate(_source: DrNoteShape, duplicate: DrNoteShape): DrNoteShape | undefined;
3158
3322
  onBeforeUpdate(prev: DrNoteShape, next: DrNoteShape): DrNoteShape | undefined;
3159
3323
  getInterpolatedProps(startShape: DrNoteShape, endShape: DrNoteShape, t: number): DrNoteShapeProps;
3160
3324
  /**
@@ -3310,8 +3474,6 @@ declare class HandTool extends StateNode {
3310
3474
  static isLockable: boolean;
3311
3475
  static children(): DrStateNodeConstructor[];
3312
3476
  onDoubleClick(info: DrClickEventInfo): void;
3313
- onTripleClick(info: DrClickEventInfo): void;
3314
- onQuadrupleClick(info: DrClickEventInfo): void;
3315
3477
  }
3316
3478
 
3317
3479
  /** @public */
@@ -3365,597 +3527,167 @@ declare class ZoomTool extends StateNode {
3365
3527
  /** @public */
3366
3528
  declare const defaultTools: readonly [typeof EraserTool, typeof HandTool, typeof LaserTool, typeof ZoomTool, typeof SelectTool];
3367
3529
 
3368
- /**
3369
- * Options passed to {@link updateArrowTargetState}.
3370
- *
3371
- * @public
3372
- */
3373
- interface UpdateArrowTargetStateOpts {
3374
- editor: Editor;
3375
- pointInPageSpace: VecLike;
3376
- arrow: DrArrowShape | undefined;
3377
- isPrecise: boolean;
3378
- currentBinding: DrArrowBinding | undefined;
3379
- /** The binding from the opposite end of the arrow, if one exists. */
3380
- oppositeBinding: DrArrowBinding | undefined;
3381
- }
3382
- /**
3383
- * State representing what we're pointing to when drawing or updating an arrow. You can get this
3384
- * state using {@link getArrowTargetState}, and update it as part of an arrow interaction with
3385
- * {@link updateArrowTargetState} or {@link clearArrowTargetState}.
3386
- *
3387
- * @public
3388
- */
3389
- interface ArrowTargetState {
3390
- target: DrShape;
3391
- arrowKind: DrArrowShapeKind;
3392
- handlesInPageSpace: {
3393
- top: {
3394
- point: VecLike;
3395
- isEnabled: boolean;
3396
- };
3397
- bottom: {
3398
- point: VecLike;
3399
- isEnabled: boolean;
3400
- };
3401
- left: {
3402
- point: VecLike;
3403
- isEnabled: boolean;
3404
- };
3405
- right: {
3406
- point: VecLike;
3407
- isEnabled: boolean;
3408
- };
3530
+ /** @public */
3531
+ interface DrEditorAssetUrls {
3532
+ fonts?: {
3533
+ draw_mono?: string;
3534
+ draw_mono_italic?: string;
3535
+ draw_mono_bold?: string;
3536
+ draw_mono_italic_bold?: string;
3537
+ draw_serif?: string;
3538
+ draw_serif_italic?: string;
3539
+ draw_serif_bold?: string;
3540
+ draw_serif_italic_bold?: string;
3541
+ draw_sans?: string;
3542
+ draw_sans_italic?: string;
3543
+ draw_sans_bold?: string;
3544
+ draw_sans_italic_bold?: string;
3545
+ draw_draw?: string;
3546
+ draw_draw_italic?: string;
3547
+ draw_draw_bold?: string;
3548
+ draw_draw_italic_bold?: string;
3549
+ [key: string]: string | undefined;
3409
3550
  };
3410
- isExact: boolean;
3411
- isPrecise: boolean;
3412
- centerInPageSpace: VecLike;
3413
- anchorInPageSpace: VecLike;
3414
- snap: ElbowArrowSnap;
3415
- normalizedAnchor: VecLike;
3416
3551
  }
3417
- /**
3418
- * Get the current arrow target state for an editor. See {@link ArrowTargetState} for more
3419
- * information.
3420
- *
3421
- * @public
3422
- */
3423
- declare function getArrowTargetState(editor: Editor): ArrowTargetState | null;
3424
- /**
3425
- * Clear the current arrow target state for an editor. See {@link ArrowTargetState} for more
3426
- * information.
3427
- *
3428
- * @public
3429
- */
3430
- declare function clearArrowTargetState(editor: Editor): void;
3431
- /**
3432
- * Update the current arrow target state for an editor. See {@link ArrowTargetState} for more
3433
- * information.
3434
- *
3435
- * @public
3436
- */
3437
- declare function updateArrowTargetState({ editor, pointInPageSpace, arrow, isPrecise, currentBinding, oppositeBinding, }: UpdateArrowTargetStateOpts): ArrowTargetState | null;
3438
-
3439
3552
  /** @public */
3440
- declare function getArrowInfo(editor: Editor, shape: DrArrowShape | DrShapeId): DrArrowInfo | undefined;
3441
-
3442
- /**
3443
- * Creates a bookmark shape from a URL with unfurled metadata.
3444
- *
3445
- * @returns A Result containing the created bookmark shape or an error
3446
- * @public
3447
- */
3448
- declare function createBookmarkFromUrl(editor: Editor, { url, center, }: {
3449
- url: string;
3450
- center?: {
3451
- x: number;
3452
- y: number;
3453
- };
3454
- }): Promise<Result<DrBookmarkShape, string>>;
3553
+ declare let defaultEditorAssetUrls: DrEditorAssetUrls;
3554
+ /** @internal */
3555
+ declare function setDefaultEditorAssetUrls(assetUrls: DrEditorAssetUrls): void;
3455
3556
 
3456
3557
  /** @public */
3457
- interface CropBoxOptions {
3458
- minWidth?: number;
3459
- minHeight?: number;
3558
+ interface DrUiAssetUrls extends DrEditorAssetUrls {
3559
+ icons: Record<DrUiIconType | Exclude<string, DrUiIconType>, string>;
3560
+ translations: Record<string, string>;
3561
+ embedIcons: Partial<Record<(typeof DEFAULT_EMBED_DEFINITIONS)[number]['type'], string>>;
3460
3562
  }
3461
3563
  /** @public */
3462
- declare function getDefaultCrop(): DrShapeCrop;
3463
- /** @public */
3464
- type ASPECT_RATIO_OPTION = 'original' | 'square' | 'circle' | 'landscape' | 'portrait' | 'wide';
3564
+ type DrUiAssetUrlOverrides = RecursivePartial<DrUiAssetUrls>;
3565
+ /** @internal */
3566
+ declare function setDefaultUiAssetUrls(urls: DrUiAssetUrls): void;
3567
+
3465
3568
  /** @public */
3466
- declare const ASPECT_RATIO_OPTIONS: ASPECT_RATIO_OPTION[];
3569
+ interface DrUiActionsMenuProps {
3570
+ children?: ReactNode;
3571
+ }
3572
+ /** @public @react */
3573
+ declare const DefaultActionsMenu: React$1.NamedExoticComponent<DrUiActionsMenuProps>;
3574
+
3467
3575
  /** @public */
3468
- declare const ASPECT_RATIO_TO_VALUE: Record<ASPECT_RATIO_OPTION, number>;
3469
- /**
3470
- * Original (uncropped) width and height of shape.
3471
- *
3472
- * @public
3473
- */
3474
- declare function getUncroppedSize(shapeSize: {
3475
- w: number;
3476
- h: number;
3477
- }, crop: DrShapeCrop | null): {
3478
- w: number;
3479
- h: number;
3480
- };
3576
+ interface DrUiContextMenuProps {
3577
+ children?: ReactNode;
3578
+ disabled?: boolean;
3579
+ }
3580
+ /** @public @react */
3581
+ declare const DefaultContextMenu: React$1.NamedExoticComponent<DrUiContextMenuProps>;
3582
+
3481
3583
  /** @public */
3482
- declare function getCropBox<T extends ShapeWithCrop>(shape: T, info: DrCropInfo<T>, opts?: CropBoxOptions): {
3483
- id: DrShapeId;
3484
- type: T['type'];
3485
- x: number;
3486
- y: number;
3487
- props: ShapeWithCrop['props'];
3488
- } | undefined;
3584
+ interface DrUiHelperButtonsProps {
3585
+ children?: ReactNode;
3586
+ }
3587
+ /** @public @react */
3588
+ declare function DefaultHelperButtons({ children }: DrUiHelperButtonsProps): react_jsx_runtime.JSX.Element;
3489
3589
 
3490
- /** @internal */
3491
- declare const STROKE_SIZES: Record<DrDefaultSizeStyle, number>;
3492
3590
  /** @public */
3493
- declare function getFontFamily(theme: DrTheme, font: string): string;
3591
+ interface DrUiHelpMenuProps {
3592
+ children?: ReactNode;
3593
+ }
3594
+ /** @public @react */
3595
+ declare const DefaultHelpMenu: React$1.NamedExoticComponent<DrUiHelpMenuProps>;
3494
3596
 
3495
3597
  /** @public */
3496
- interface DrDefaultFont {
3497
- normal: {
3498
- normal: DrFontFace;
3499
- bold: DrFontFace;
3500
- };
3501
- italic: {
3502
- normal: DrFontFace;
3503
- bold: DrFontFace;
3504
- };
3598
+ interface DrUiDialogProps {
3599
+ onClose(): void;
3505
3600
  }
3506
3601
  /** @public */
3507
- interface DrDefaultFonts {
3508
- draw_draw: DrDefaultFont;
3509
- draw_sans: DrDefaultFont;
3510
- draw_serif: DrDefaultFont;
3511
- draw_mono: DrDefaultFont;
3602
+ interface DrUiDialog {
3603
+ id: string;
3604
+ onClose?(): void;
3605
+ component: ComponentType<DrUiDialogProps>;
3606
+ preventBackgroundClose?: boolean;
3512
3607
  }
3513
3608
  /** @public */
3514
- declare const DefaultFontFaces: DrDefaultFonts;
3609
+ interface DrUiDialogsContextType {
3610
+ addDialog(dialog: Omit<DrUiDialog, 'id'> & {
3611
+ id?: string;
3612
+ }): string;
3613
+ removeDialog(id: string): string;
3614
+ clearDialogs(): void;
3615
+ dialogs: Atom<DrUiDialog[]>;
3616
+ }
3515
3617
  /** @public */
3516
- declare const allDefaultFontFaces: DrFontFace[];
3517
-
3518
- /**
3519
- * ## getStroke
3520
- *
3521
- * Get an array of points describing a polygon that surrounds the input points.
3522
- *
3523
- * @param points - An array of points (as `[x, y, pressure]` or `{x, y, pressure}`). Pressure is
3524
- * optional in both cases.
3525
- * @param options - An object with options.
3526
- * @public
3527
- */
3528
- declare function getStroke(points: VecLike[], options?: StrokeOptions): Vec[];
3529
-
3530
- /**
3531
- * ## getStrokeOutlinePoints
3532
- *
3533
- * Get an array of points (as `[x, y]`) representing the outline of a stroke.
3534
- *
3535
- * @param points - An array of StrokePoints as returned from `getStrokePoints`.
3536
- * @param options - An object with options.
3537
- * @public
3538
- */
3539
- declare function getStrokeOutlinePoints(strokePoints: StrokePoint[], options?: StrokeOptions): Vec[];
3540
-
3541
- /**
3542
- * ## getStrokePoints
3543
- *
3544
- * Get an array of points as objects with an adjusted point, pressure, vector, distance, and
3545
- * runningLength.
3546
- *
3547
- * @param points - An array of points (as `[x, y, pressure]` or `{x, y, pressure}`). Pressure is
3548
- * optional in both cases.
3549
- * @param options - An object with options.
3550
- * @public
3551
- */
3552
- declare function getStrokePoints(rawInputPoints: VecLike[], options?: StrokeOptions): StrokePoint[];
3618
+ interface DrUiDialogsProviderProps {
3619
+ context?: string;
3620
+ overrides?(editor: Editor): DrUiDialogsContextType;
3621
+ children: ReactNode;
3622
+ }
3623
+ /** @public @react */
3624
+ declare function DrawUiDialogsProvider({ context, children }: DrUiDialogsProviderProps): react_jsx_runtime.JSX.Element;
3625
+ /** @public */
3626
+ declare function useDialogs(): DrUiDialogsContextType;
3553
3627
 
3554
3628
  /** @public */
3555
- declare function setStrokePointRadii(strokePoints: StrokePoint[], options: StrokeOptions): StrokePoint[];
3556
-
3557
- /**
3558
- * Turn an array of stroke points into a path of quadratic curves.
3559
- *
3560
- * @param points - The stroke points returned from perfect-freehand
3561
- * @param closed - Whether the shape is closed
3562
- *
3563
- * @public
3564
- */
3565
- declare function getSvgPathFromStrokePoints(points: StrokePoint[], closed?: boolean): string;
3629
+ type DrUiKeyboardShortcutsDialogProps = DrUiDialogProps & {
3630
+ children?: ReactNode;
3631
+ };
3632
+ /** @public @react */
3633
+ declare const DefaultKeyboardShortcutsDialog: React$1.NamedExoticComponent<DrUiKeyboardShortcutsDialogProps>;
3566
3634
 
3567
3635
  /** @public */
3568
- interface PlainTextLabelProps {
3569
- shapeId: DrShapeId;
3570
- type: ExtractShapeByProps<{
3571
- text: string;
3572
- }>['type'];
3573
- fontFamily: string;
3574
- fontSize: number;
3575
- lineHeight: number;
3576
- textAlign: 'start' | 'center' | 'end';
3577
- verticalAlign: 'start' | 'middle' | 'end';
3578
- wrap?: boolean;
3579
- text?: string;
3580
- labelColor: string;
3581
- bounds?: Box;
3582
- isSelected: boolean;
3583
- onKeyDown?(e: KeyboardEvent): void;
3584
- classNamePrefix?: string;
3585
- style?: React__default.CSSProperties;
3586
- textWidth?: number;
3587
- textHeight?: number;
3588
- padding?: number;
3589
- showTextOutline?: boolean;
3636
+ interface DrUiMainMenuProps {
3637
+ children?: ReactNode;
3590
3638
  }
3591
- /**
3592
- * Renders a text label that can be used inside of shapes.
3593
- * The component has the ability to be edited in place and furthermore
3594
- * supports rich text editing.
3595
- *
3596
- * @public @react
3597
- */
3598
- declare const PlainTextLabel: React__default.NamedExoticComponent<PlainTextLabelProps>;
3639
+ /** @public @react */
3640
+ declare const DefaultMainMenu: React$1.NamedExoticComponent<DrUiMainMenuProps>;
3599
3641
 
3600
3642
  /** @public */
3601
- interface RichTextLabelProps {
3602
- shapeId: DrShapeId;
3603
- type: ExtractShapeByProps<{
3604
- richText: DrRichText;
3605
- }>['type'];
3606
- fontFamily: string;
3607
- fontSize: number;
3608
- lineHeight: number;
3609
- textAlign: 'start' | 'center' | 'end';
3610
- verticalAlign: 'start' | 'middle' | 'end';
3611
- wrap?: boolean;
3612
- richText?: DrRichText;
3613
- labelColor: string;
3614
- bounds?: Box;
3615
- isSelected: boolean;
3616
- onKeyDown?(e: KeyboardEvent): void;
3617
- classNamePrefix?: string;
3618
- style?: React__default.CSSProperties;
3619
- textWidth?: number;
3620
- textHeight?: number;
3621
- padding?: number;
3622
- hasCustomTabBehavior?: boolean;
3623
- showTextOutline?: boolean;
3624
- /** Whether clicking a link inside the text opens it in a new tab. Defaults to `true`. */
3625
- openLinksOnClick?: boolean;
3643
+ interface DrUiQuickActionsProps {
3644
+ children?: ReactNode;
3626
3645
  }
3627
- /**
3628
- * Renders a text label that can be used inside of shapes.
3629
- * The component has the ability to be edited in place and furthermore
3630
- * supports rich text editing.
3631
- *
3632
- * @public @react
3633
- */
3634
- declare const RichTextLabel: React__default.NamedExoticComponent<RichTextLabelProps>;
3646
+ /** @public @react */
3647
+ declare const DefaultQuickActions: React$1.NamedExoticComponent<DrUiQuickActionsProps>;
3648
+
3635
3649
  /** @public */
3636
- interface RichTextSVGProps {
3637
- bounds: Box;
3638
- richText: DrRichText;
3639
- fontSize: number;
3640
- fontFamily: string;
3641
- lineHeight: number;
3642
- textAlign: 'start' | 'center' | 'end';
3643
- verticalAlign: 'start' | 'middle' | 'end';
3644
- wrap?: boolean;
3645
- labelColor: string;
3646
- padding: number;
3647
- showTextOutline?: boolean;
3650
+ interface DrUiPeopleMenuAvatarProps {
3651
+ userId: DrUserId;
3648
3652
  }
3649
- /**
3650
- * Renders a rich text string as SVG given bounds and text properties.
3651
- *
3652
- * @public @react
3653
- */
3654
- declare function RichTextSVG({ bounds, richText, fontSize, fontFamily, lineHeight, textAlign, verticalAlign, wrap, labelColor, padding, showTextOutline, }: RichTextSVGProps): react_jsx_runtime.JSX.Element;
3653
+ /** @public @react */
3654
+ declare function DefaultPeopleMenuAvatar({ userId }: DrUiPeopleMenuAvatarProps): react_jsx_runtime.JSX.Element | null;
3655
3655
 
3656
3656
  /** @public */
3657
- declare function useEditablePlainText(shapeId: DrShapeId, type: ExtractShapeByProps<{
3658
- text: string;
3659
- }>['type'], text?: string): {
3660
- handleFocus: () => void;
3661
- handleBlur: () => void;
3662
- handleInputPointerDown: (e: React__default.PointerEvent) => void;
3663
- handleDoubleClick: (e: Event | {
3664
- nativeEvent: Event;
3665
- }) => void;
3666
- handlePaste: (e: ClipboardEvent | React__default.ClipboardEvent<HTMLTextAreaElement>) => void;
3667
- isEditing: boolean;
3668
- isReadyForEditing: boolean;
3669
- rInput: React__default.RefObject<HTMLTextAreaElement | null>;
3670
- handleKeyDown: (e: KeyboardEvent) => void;
3671
- handleChange: ({ plaintext }: {
3672
- plaintext: string;
3673
- }) => void;
3674
- isEmpty: boolean;
3675
- };
3657
+ interface DrUiPeopleMenuFacePileProps {
3658
+ userIds: DrUserId[];
3659
+ userName: string;
3660
+ userColor: string;
3661
+ }
3662
+ /** @public @react */
3663
+ declare function DefaultPeopleMenuFacePile({ userIds, userName, userColor, }: DrUiPeopleMenuFacePileProps): react_jsx_runtime.JSX.Element;
3676
3664
 
3677
3665
  /** @public */
3678
- declare function useEditableRichText(shapeId: DrShapeId, type: ExtractShapeByProps<{
3679
- richText: DrRichText;
3680
- }>['type'], richText?: DrRichText): {
3681
- handleFocus: () => void;
3682
- handleBlur: () => void;
3683
- handleInputPointerDown: (e: React.PointerEvent) => void;
3684
- handleDoubleClick: (e: Event | {
3685
- nativeEvent: Event;
3686
- }) => void;
3687
- handlePaste: (e: ClipboardEvent | React.ClipboardEvent<HTMLTextAreaElement>) => void;
3688
- isEditing: boolean;
3689
- isReadyForEditing: boolean;
3690
- rInput: React$1.RefObject<HTMLDivElement | null>;
3691
- handleKeyDown: (e: KeyboardEvent) => void;
3692
- handleChange: ({ richText }: {
3693
- richText: DrRichText;
3694
- }) => void;
3695
- isEmpty: boolean | undefined;
3696
- };
3666
+ interface DrUiPeopleMenuItemProps {
3667
+ userId: DrUserId;
3668
+ }
3669
+ /** @public @react */
3670
+ declare const DefaultPeopleMenuItem: React$1.NamedExoticComponent<DrUiPeopleMenuItemProps>;
3697
3671
 
3698
- /**
3699
- * Options for {@link useImageOrVideoAsset}.
3700
- *
3701
- * @public
3702
- */
3703
- interface UseImageOrVideoAssetOptions {
3704
- /** The asset ID you want a URL for. */
3705
- assetId: DrAssetId | null;
3706
- /**
3707
- * The shape the asset is being used for. We won't update the resolved URL while the shape is
3708
- * off-screen.
3709
- */
3710
- shapeId?: DrShapeId;
3711
- /**
3712
- * The width at which the asset will be displayed, in shape-space pixels.
3713
- */
3714
- width: number;
3672
+ /** @public */
3673
+ interface DrUiStylePanelProps {
3674
+ isMobile?: boolean;
3675
+ styles?: ReadonlySharedStyleMap | null;
3676
+ children?: ReactNode;
3715
3677
  }
3716
- /**
3717
- * This is a handy helper hook that resolves an asset to an optimized URL for a given shape, or its
3718
- * {@link @ibodr/editor#Editor.createTemporaryAssetPreview | placeholder} if the asset is still
3719
- * uploading. This is used in particular for high-resolution images when you want lower and higher
3720
- * resolution depending on the size of the image on the canvas and the zoom level.
3721
- *
3722
- * For image scaling to work, you need to implement scaled URLs in
3723
- * {@link @ibodr/schema#DrAssetStore.resolve}.
3724
- *
3725
- * @public
3726
- */
3727
- declare function useImageOrVideoAsset({ shapeId, assetId, width }: UseImageOrVideoAssetOptions): {
3728
- asset: (DrImageAsset | DrVideoAsset) | null;
3729
- url: string | null;
3730
- };
3678
+ /** @public @react */
3679
+ declare const DefaultStylePanel: React$1.NamedExoticComponent<DrUiStylePanelProps>;
3731
3680
 
3732
3681
  /** @public */
3733
- interface TextAreaProps {
3734
- isEditing: boolean;
3735
- text?: string;
3736
- shapeId: DrShapeId;
3737
- richText?: DrRichText;
3738
- handleFocus(): void;
3739
- handleBlur(): void;
3740
- handleKeyDown(e: KeyboardEvent): void;
3741
- handleChange(changeInfo: {
3742
- plaintext?: string;
3743
- richText?: DrRichText;
3744
- }): void;
3745
- handleInputPointerDown(e: React__default.PointerEvent<HTMLElement>): void;
3746
- handleDoubleClick(e: any): any;
3747
- handlePaste(e: ClipboardEvent | React__default.ClipboardEvent<HTMLTextAreaElement>): void;
3748
- hasCustomTabBehavior?: boolean;
3682
+ interface DrUiRichTextToolbarProps {
3683
+ children?: React__default.ReactNode;
3749
3684
  }
3750
3685
  /**
3751
- * N.B. In Development mode you need to ensure you're testing this without StrictMode on.
3752
- * Otherwise it's not gonna work as expected on iOS.
3753
- * Specifically, it means that the virtual keyboard won't pop open sometimes
3754
- * (iOS starts flipping out when you render multiple times when trying to focus something) .
3755
- */
3756
- /**
3757
- * A rich text area that can be used for editing text with rich text formatting.
3758
- * This component uses the TipTap editor under the hood.
3686
+ * The default rich text toolbar.
3759
3687
  *
3760
3688
  * @public @react
3761
3689
  */
3762
- declare const RichTextArea: React__default.ForwardRefExoticComponent<TextAreaProps & React__default.RefAttributes<HTMLDivElement>>;
3763
-
3764
- /**
3765
- * A plain text area that can be used for basic editing text.
3766
- *
3767
- * @public @react
3768
- */
3769
- declare const PlainTextArea: React__default.ForwardRefExoticComponent<TextAreaProps & React__default.RefAttributes<HTMLTextAreaElement>>;
3770
-
3771
- /** @public */
3772
- type StyleValuesForUi<T> = readonly {
3773
- readonly value: T;
3774
- readonly icon: string | DrUiIconJsx;
3775
- }[];
3776
- /**
3777
- * Returns the current list of color style items for the style panel,
3778
- * derived from the theme's color palette. Only palette colors are included;
3779
- * utility colors like `text`, `background`, etc. are excluded.
3780
- *
3781
- * Colors are ordered by their position in {@link @ibodr/schema#DefaultColorStyle},
3782
- * followed by any additional theme colors in their object key order.
3783
- *
3784
- * @public
3785
- */
3786
- declare function getColorStyleItems(colors: DrThemeColors): StyleValuesForUi<string>;
3787
- /**
3788
- * Returns the current list of font style items for the style panel,
3789
- * derived from the theme's font palette.
3790
- *
3791
- * Fonts are ordered by their position in {@link @ibodr/schema#DefaultFontStyle},
3792
- * followed by any additional theme fonts in their object key order.
3793
- *
3794
- * @public
3795
- */
3796
- declare function getFontStyleItems(theme: DrTheme): StyleValuesForUi<string>;
3797
-
3798
- /** @public */
3799
- interface DrEditorAssetUrls {
3800
- fonts?: {
3801
- draw_mono?: string;
3802
- draw_mono_italic?: string;
3803
- draw_mono_bold?: string;
3804
- draw_mono_italic_bold?: string;
3805
- draw_serif?: string;
3806
- draw_serif_italic?: string;
3807
- draw_serif_bold?: string;
3808
- draw_serif_italic_bold?: string;
3809
- draw_sans?: string;
3810
- draw_sans_italic?: string;
3811
- draw_sans_bold?: string;
3812
- draw_sans_italic_bold?: string;
3813
- draw_draw?: string;
3814
- draw_draw_italic?: string;
3815
- draw_draw_bold?: string;
3816
- draw_draw_italic_bold?: string;
3817
- [key: string]: string | undefined;
3818
- };
3819
- }
3820
- /** @public */
3821
- declare let defaultEditorAssetUrls: DrEditorAssetUrls;
3822
- /** @internal */
3823
- declare function setDefaultEditorAssetUrls(assetUrls: DrEditorAssetUrls): void;
3824
-
3825
- /** @public */
3826
- interface DrUiAssetUrls extends DrEditorAssetUrls {
3827
- icons: Record<DrUiIconType | Exclude<string, DrUiIconType>, string>;
3828
- translations: Record<string, string>;
3829
- embedIcons: Partial<Record<(typeof DEFAULT_EMBED_DEFINITIONS)[number]['type'], string>>;
3830
- }
3831
- /** @public */
3832
- type DrUiAssetUrlOverrides = RecursivePartial<DrUiAssetUrls>;
3833
- /** @internal */
3834
- declare function setDefaultUiAssetUrls(urls: DrUiAssetUrls): void;
3835
-
3836
- /** @public */
3837
- interface DrUiActionsMenuProps {
3838
- children?: ReactNode;
3839
- }
3840
- /** @public @react */
3841
- declare const DefaultActionsMenu: React$1.NamedExoticComponent<DrUiActionsMenuProps>;
3842
-
3843
- /** @public */
3844
- interface DrUiContextMenuProps {
3845
- children?: ReactNode;
3846
- disabled?: boolean;
3847
- }
3848
- /** @public @react */
3849
- declare const DefaultContextMenu: React$1.NamedExoticComponent<DrUiContextMenuProps>;
3850
-
3851
- /** @public */
3852
- interface DrUiHelperButtonsProps {
3853
- children?: ReactNode;
3854
- }
3855
- /** @public @react */
3856
- declare function DefaultHelperButtons({ children }: DrUiHelperButtonsProps): react_jsx_runtime.JSX.Element;
3857
-
3858
- /** @public */
3859
- interface DrUiHelpMenuProps {
3860
- children?: ReactNode;
3861
- }
3862
- /** @public @react */
3863
- declare const DefaultHelpMenu: React$1.NamedExoticComponent<DrUiHelpMenuProps>;
3864
-
3865
- /** @public */
3866
- interface DrUiDialogProps {
3867
- onClose(): void;
3868
- }
3869
- /** @public */
3870
- interface DrUiDialog {
3871
- id: string;
3872
- onClose?(): void;
3873
- component: ComponentType<DrUiDialogProps>;
3874
- preventBackgroundClose?: boolean;
3875
- }
3876
- /** @public */
3877
- interface DrUiDialogsContextType {
3878
- addDialog(dialog: Omit<DrUiDialog, 'id'> & {
3879
- id?: string;
3880
- }): string;
3881
- removeDialog(id: string): string;
3882
- clearDialogs(): void;
3883
- dialogs: Atom<DrUiDialog[]>;
3884
- }
3885
- /** @public */
3886
- interface DrUiDialogsProviderProps {
3887
- context?: string;
3888
- overrides?(editor: Editor): DrUiDialogsContextType;
3889
- children: ReactNode;
3890
- }
3891
- /** @public @react */
3892
- declare function DrawUiDialogsProvider({ context, children }: DrUiDialogsProviderProps): react_jsx_runtime.JSX.Element;
3893
- /** @public */
3894
- declare function useDialogs(): DrUiDialogsContextType;
3895
-
3896
- /** @public */
3897
- type DrUiKeyboardShortcutsDialogProps = DrUiDialogProps & {
3898
- children?: ReactNode;
3899
- };
3900
- /** @public @react */
3901
- declare const DefaultKeyboardShortcutsDialog: React$1.NamedExoticComponent<DrUiKeyboardShortcutsDialogProps>;
3902
-
3903
- /** @public */
3904
- interface DrUiMainMenuProps {
3905
- children?: ReactNode;
3906
- }
3907
- /** @public @react */
3908
- declare const DefaultMainMenu: React$1.NamedExoticComponent<DrUiMainMenuProps>;
3909
-
3910
- /** @public */
3911
- interface DrUiQuickActionsProps {
3912
- children?: ReactNode;
3913
- }
3914
- /** @public @react */
3915
- declare const DefaultQuickActions: React$1.NamedExoticComponent<DrUiQuickActionsProps>;
3916
-
3917
- /** @public */
3918
- interface DrUiPeopleMenuAvatarProps {
3919
- userId: string;
3920
- }
3921
- /** @public @react */
3922
- declare function DefaultPeopleMenuAvatar({ userId }: DrUiPeopleMenuAvatarProps): react_jsx_runtime.JSX.Element | null;
3923
-
3924
- /** @public */
3925
- interface DrUiPeopleMenuFacePileProps {
3926
- userIds: string[];
3927
- userName: string;
3928
- userColor: string;
3929
- }
3930
- /** @public @react */
3931
- declare function DefaultPeopleMenuFacePile({ userIds, userName, userColor, }: DrUiPeopleMenuFacePileProps): react_jsx_runtime.JSX.Element;
3932
-
3933
- /** @public */
3934
- interface DrUiPeopleMenuItemProps {
3935
- userId: string;
3936
- }
3937
- /** @public @react */
3938
- declare const DefaultPeopleMenuItem: React$1.NamedExoticComponent<DrUiPeopleMenuItemProps>;
3939
-
3940
- /** @public */
3941
- interface DrUiStylePanelProps {
3942
- isMobile?: boolean;
3943
- styles?: ReadonlySharedStyleMap | null;
3944
- children?: ReactNode;
3945
- }
3946
- /** @public @react */
3947
- declare const DefaultStylePanel: React$1.NamedExoticComponent<DrUiStylePanelProps>;
3948
-
3949
- /** @public */
3950
- interface DrUiRichTextToolbarProps {
3951
- children?: React__default.ReactNode;
3952
- }
3953
- /**
3954
- * The default rich text toolbar.
3955
- *
3956
- * @public @react
3957
- */
3958
- declare const DefaultRichTextToolbar: React__default.NamedExoticComponent<DrUiRichTextToolbarProps>;
3690
+ declare const DefaultRichTextToolbar: React__default.NamedExoticComponent<DrUiRichTextToolbarProps>;
3959
3691
 
3960
3692
  /** @public */
3961
3693
  interface DrUiZoomMenuProps {
@@ -4077,6 +3809,12 @@ interface OnDragFromToolbarToCreateShapesOpts {
4077
3809
  * Called once the drag interaction has finished.
4078
3810
  */
4079
3811
  onDragEnd?(id: DrShapeId): void;
3812
+ /**
3813
+ * The id of the toolbar tool to keep highlighted while dragging. Defaults to the created shape's
3814
+ * type. Set this when the dragged shape's type differs from the tool it's dragged from — for
3815
+ * example, dragging a `draw` shape out from the select tool.
3816
+ */
3817
+ maskedToolId?: string;
4080
3818
  }
4081
3819
  /**
4082
3820
  * A helper method to use in {@link tldraw#DrUiToolItem.onDragStart} to create a shape by dragging it from
@@ -4168,165 +3906,607 @@ interface DrawUiProps extends DrUiContextProviderProps {
4168
3906
  */
4169
3907
  hideUi?: boolean;
4170
3908
  /**
4171
- * Overrides for the UI components.
3909
+ * Overrides for the UI components.
3910
+ */
3911
+ components?: DrUiComponents;
3912
+ /**
3913
+ * Additional items to add to the debug menu (will be deprecated)
3914
+ */
3915
+ renderDebugMenuItems?(): React__default.ReactNode;
3916
+ /** Asset URL override. */
3917
+ assetUrls?: DrUiAssetUrlOverrides;
3918
+ }
3919
+ /**
3920
+ * @public
3921
+ * @react
3922
+ */
3923
+ declare const DrawUi: React__default.NamedExoticComponent<DrawUiProps>;
3924
+ /** @public @react */
3925
+ declare function DrawUiInFrontOfTheCanvas(): react_jsx_runtime.JSX.Element;
3926
+
3927
+ /**
3928
+ * Override the default react components used by the editor and UI. Set components to null to
3929
+ * disable them entirely.
3930
+ *
3931
+ * @example
3932
+ * ```tsx
3933
+ * import { Draw, DrComponents, DrCollaboratorCursorProps } from '@ibodr/draw'
3934
+ *
3935
+ * const MyCursor = ({ point, color, name, scale, layout }: DrCollaboratorCursorProps) => (
3936
+ * // custom pointer + badge; `layout.badgeOffset` / `layout.iconOffset` come from Draw
3937
+ * )
3938
+ *
3939
+ * const components: DrComponents = {
3940
+ * CollaboratorCursor: MyCursor,
3941
+ * }
3942
+ *
3943
+ * export function MyApp() {
3944
+ * return (
3945
+ * <Draw
3946
+ * components={components}
3947
+ * collaboratorCursorLayout={{ badgeOffset: { x: 2, y: 0 } }}
3948
+ * />
3949
+ * )
3950
+ * }
3951
+ * ```
3952
+ *
3953
+ *
3954
+ * @public
3955
+ */
3956
+ interface DrComponents extends DrEditorComponents, DrUiComponents {
3957
+ }
3958
+ /** @public */
3959
+ interface DrawBaseProps extends DrawUiProps, DrawEditorBaseProps, DrExternalContentProps {
3960
+ /** Urls for custom assets.
3961
+ *
3962
+ * ⚠︎ Important! This must be memoized (with useMemo) or defined outside of any React component.
3963
+ */
3964
+ assetUrls?: DrUiAssetUrlOverrides;
3965
+ /** Overrides for tldraw's components.
3966
+ *
3967
+ * ⚠︎ Important! This must be memoized (with useMemo) or defined outside of any React component.
3968
+ */
3969
+ components?: DrComponents;
3970
+ /**
3971
+ * Offsets for the collaborator cursor pointer and name badge.
3972
+ * Applied to the default cursor and passed via `layout` to custom `CollaboratorCursor` components.
3973
+ *
3974
+ * @example
3975
+ * ```tsx
3976
+ * <Draw collaboratorCursorLayout={{ badgeOffset: { x: 2, y: 0 } }} />
3977
+ * ```
3978
+ */
3979
+ collaboratorCursorLayout?: Partial<DrCollaboratorCursorLayout>;
3980
+ /** Custom definitions for tldraw's embeds.
3981
+ *
3982
+ * ⚠︎ Important! This must be memoized (with useMemo) or defined outside of any React component.
3983
+ *
3984
+ * @deprecated Use `EmbedShapeUtil.configure({ embedDefinitions: embeds })` instead.
3985
+ */
3986
+ embeds?: DrEmbedDefinition[];
3987
+ /**
3988
+ * Text options for the editor.
3989
+ *
3990
+ * @deprecated Use `options.text` instead. This prop will be removed in a future release.
3991
+ */
3992
+ textOptions?: DrTextOptions;
3993
+ /**
3994
+ * The locale to use for the editor's UI. When set, this takes priority over
3995
+ * both the browser's language preferences (`navigator.languages`) and the
3996
+ * user's locale preference (e.g. via
3997
+ * `editor.user.updateUserPreferences({ locale: '...' })`), giving the
3998
+ * application explicit control over the displayed language.
3999
+ *
4000
+ * @example
4001
+ * ```tsx
4002
+ * <Draw locale="fr" />
4003
+ * ```
4004
+ */
4005
+ locale?: string;
4006
+ }
4007
+ /** @public */
4008
+ type DrawProps = DrawBaseProps & DrawEditorStoreProps;
4009
+ /** @public @react */
4010
+ declare function Draw(props: DrawProps): react_jsx_runtime.JSX.Element;
4011
+
4012
+ /** @public */
4013
+ interface DrawImageProps extends DrImageExportOptions {
4014
+ /**
4015
+ * The snapshot to display.
4016
+ */
4017
+ snapshot: Partial<DrEditorSnapshot> | DrStoreSnapshot;
4018
+ /**
4019
+ * The image format to use. Defaults to 'svg'.
4020
+ */
4021
+ format?: 'svg' | 'png';
4022
+ /**
4023
+ * The page to display. Defaults to the first page.
4024
+ */
4025
+ pageId?: DrPageId;
4026
+ /**
4027
+ * Additional shape utils to use.
4028
+ */
4029
+ shapeUtils?: readonly DrAnyShapeUtilConstructor[];
4030
+ /**
4031
+ * Additional binding utils to use.
4032
+ */
4033
+ bindingUtils?: readonly DrAnyBindingUtilConstructor[];
4034
+ /**
4035
+ * Asset URL overrides.
4036
+ */
4037
+ assetUrls?: DrUiAssetUrlOverrides;
4038
+ /**
4039
+ * The asset store to use for resolving the snapshot's assets, matching the `assets` prop on
4040
+ * {@link Draw}. Without one, assets that aren't stored inline (as data URLs) can't be
4041
+ * resolved and won't appear in the image.
4042
+ */
4043
+ assets?: DrAssetStore;
4044
+ /**
4045
+ * Options for the editor.
4046
+ */
4047
+ options?: Partial<DrawOptions>;
4048
+ /**
4049
+ * Text options for the editor.
4050
+ *
4051
+ * @deprecated Use `options.text` instead. This prop will be removed in a future release.
4052
+ */
4053
+ textOptions?: DrTextOptions;
4054
+ }
4055
+ /**
4056
+ * A rendered SVG image of a Draw snapshot.
4057
+ *
4058
+ * @example
4059
+ * ```tsx
4060
+ * <DrawImage
4061
+ * snapshot={snapshot}
4062
+ * pageId={pageId}
4063
+ * background={false}
4064
+ * darkMode={true}
4065
+ * bounds={new Box(0,0,600,400)}
4066
+ * scale={1}
4067
+ * />
4068
+ * ```
4069
+ *
4070
+ * @public
4071
+ * @react
4072
+ */
4073
+ declare const DrawImage: React$1.NamedExoticComponent<DrawImageProps>;
4074
+
4075
+ /**
4076
+ * Options passed to {@link updateArrowTargetState}.
4077
+ *
4078
+ * @public
4079
+ */
4080
+ interface UpdateArrowTargetStateOpts {
4081
+ editor: Editor;
4082
+ pointInPageSpace: VecLike;
4083
+ arrow: DrArrowShape | undefined;
4084
+ isPrecise: boolean;
4085
+ currentBinding: DrArrowBinding | undefined;
4086
+ /** The binding from the opposite end of the arrow, if one exists. */
4087
+ oppositeBinding: DrArrowBinding | undefined;
4088
+ }
4089
+ /**
4090
+ * State representing what we're pointing to when drawing or updating an arrow. You can get this
4091
+ * state using {@link getArrowTargetState}, and update it as part of an arrow interaction with
4092
+ * {@link updateArrowTargetState} or {@link clearArrowTargetState}.
4093
+ *
4094
+ * @public
4095
+ */
4096
+ interface ArrowTargetState {
4097
+ target: DrShape;
4098
+ arrowKind: DrArrowShapeKind;
4099
+ handlesInPageSpace: {
4100
+ top: {
4101
+ point: VecLike;
4102
+ isEnabled: boolean;
4103
+ };
4104
+ bottom: {
4105
+ point: VecLike;
4106
+ isEnabled: boolean;
4107
+ };
4108
+ left: {
4109
+ point: VecLike;
4110
+ isEnabled: boolean;
4111
+ };
4112
+ right: {
4113
+ point: VecLike;
4114
+ isEnabled: boolean;
4115
+ };
4116
+ };
4117
+ isExact: boolean;
4118
+ isPrecise: boolean;
4119
+ centerInPageSpace: VecLike;
4120
+ anchorInPageSpace: VecLike;
4121
+ snap: ElbowArrowSnap;
4122
+ normalizedAnchor: VecLike;
4123
+ }
4124
+ /**
4125
+ * Get the current arrow target state for an editor. See {@link ArrowTargetState} for more
4126
+ * information.
4127
+ *
4128
+ * @public
4129
+ */
4130
+ declare function getArrowTargetState(editor: Editor): ArrowTargetState | null;
4131
+ /**
4132
+ * Clear the current arrow target state for an editor. See {@link ArrowTargetState} for more
4133
+ * information.
4134
+ *
4135
+ * @public
4136
+ */
4137
+ declare function clearArrowTargetState(editor: Editor): void;
4138
+ /**
4139
+ * Update the current arrow target state for an editor. See {@link ArrowTargetState} for more
4140
+ * information.
4141
+ *
4142
+ * @public
4143
+ */
4144
+ declare function updateArrowTargetState({ editor, pointInPageSpace, arrow, isPrecise, currentBinding, oppositeBinding, }: UpdateArrowTargetStateOpts): ArrowTargetState | null;
4145
+
4146
+ /** @public */
4147
+ declare function getArrowInfo(editor: Editor, shape: DrArrowShape | DrShapeId): DrArrowInfo | undefined;
4148
+
4149
+ /**
4150
+ * Creates a bookmark shape from a URL.
4151
+ *
4152
+ * The shape is created immediately as a placeholder so the user gets visible
4153
+ * feedback at the paste location, and the bookmark metadata (title, description,
4154
+ * image, favicon) is fetched in the background. Once metadata resolves, the
4155
+ * shape is patched with the resulting asset. If the fetch fails, the shape is
4156
+ * left as a URL-only bookmark.
4157
+ *
4158
+ * @returns A Result containing the created bookmark shape or an error
4159
+ * @public
4160
+ */
4161
+ declare function createBookmarkFromUrl(editor: Editor, { url, center, }: {
4162
+ url: string;
4163
+ center?: {
4164
+ x: number;
4165
+ y: number;
4166
+ };
4167
+ }): Promise<Result<DrBookmarkShape, string>>;
4168
+
4169
+ /** @public */
4170
+ interface CropBoxOptions {
4171
+ minWidth?: number;
4172
+ minHeight?: number;
4173
+ }
4174
+ /** @public */
4175
+ declare function getDefaultCrop(): DrShapeCrop;
4176
+ /** @public */
4177
+ type ASPECT_RATIO_OPTION = 'original' | 'square' | 'circle' | 'landscape' | 'portrait' | 'wide';
4178
+ /** @public */
4179
+ declare const ASPECT_RATIO_OPTIONS: ASPECT_RATIO_OPTION[];
4180
+ /** @public */
4181
+ declare const ASPECT_RATIO_TO_VALUE: Record<ASPECT_RATIO_OPTION, number>;
4182
+ /**
4183
+ * Original (uncropped) width and height of shape.
4184
+ *
4185
+ * @public
4186
+ */
4187
+ declare function getUncroppedSize(shapeSize: {
4188
+ w: number;
4189
+ h: number;
4190
+ }, crop: DrShapeCrop | null): {
4191
+ w: number;
4192
+ h: number;
4193
+ };
4194
+ /** @public */
4195
+ declare function getCropBox<T extends ShapeWithCrop>(shape: T, info: DrCropInfo<T>, opts?: CropBoxOptions): {
4196
+ id: DrShapeId;
4197
+ type: T['type'];
4198
+ x: number;
4199
+ y: number;
4200
+ props: ShapeWithCrop['props'];
4201
+ } | undefined;
4202
+
4203
+ /** @internal */
4204
+ declare const STROKE_SIZES: Record<DrDefaultSizeStyle, number>;
4205
+ /** @public */
4206
+ declare function getFontFamily(theme: DrTheme, font: string): string;
4207
+
4208
+ /** @public */
4209
+ interface DrDefaultFont {
4210
+ normal: {
4211
+ normal: DrFontFace;
4212
+ bold: DrFontFace;
4213
+ };
4214
+ italic: {
4215
+ normal: DrFontFace;
4216
+ bold: DrFontFace;
4217
+ };
4218
+ }
4219
+ /** @public */
4220
+ interface DrDefaultFonts {
4221
+ draw_draw: DrDefaultFont;
4222
+ draw_sans: DrDefaultFont;
4223
+ draw_serif: DrDefaultFont;
4224
+ draw_mono: DrDefaultFont;
4225
+ }
4226
+ /** @public */
4227
+ declare const DefaultFontFaces: DrDefaultFonts;
4228
+ /** @public */
4229
+ declare const allDefaultFontFaces: DrFontFace[];
4230
+
4231
+ /**
4232
+ * ## getStroke
4233
+ *
4234
+ * Get an array of points describing a polygon that surrounds the input points.
4235
+ *
4236
+ * @param points - An array of points (as `[x, y, pressure]` or `{x, y, pressure}`). Pressure is
4237
+ * optional in both cases.
4238
+ * @param options - An object with options.
4239
+ * @public
4240
+ */
4241
+ declare function getStroke(points: VecLike[], options?: StrokeOptions): Vec[];
4242
+
4243
+ /**
4244
+ * ## getStrokeOutlinePoints
4245
+ *
4246
+ * Get an array of points (as `[x, y]`) representing the outline of a stroke.
4247
+ *
4248
+ * @param points - An array of StrokePoints as returned from `getStrokePoints`.
4249
+ * @param options - An object with options.
4250
+ * @public
4251
+ */
4252
+ declare function getStrokeOutlinePoints(strokePoints: StrokePoint[], options?: StrokeOptions): Vec[];
4253
+
4254
+ /**
4255
+ * ## getStrokePoints
4256
+ *
4257
+ * Get an array of points as objects with an adjusted point, pressure, vector, distance, and
4258
+ * runningLength.
4259
+ *
4260
+ * @param points - An array of points (as `[x, y, pressure]` or `{x, y, pressure}`). Pressure is
4261
+ * optional in both cases.
4262
+ * @param options - An object with options.
4263
+ * @public
4264
+ */
4265
+ declare function getStrokePoints(rawInputPoints: VecLike[], options?: StrokeOptions): StrokePoint[];
4266
+
4267
+ /**
4268
+ * Turn an array of stroke points into a path of quadratic curves.
4269
+ *
4270
+ * The path uses relative commands with coordinates rounded to hundredths of a pixel, which
4271
+ * renders identically to the absolute 4-decimal form but is much smaller and faster to build.
4272
+ *
4273
+ * @param points - The stroke points returned from perfect-freehand
4274
+ * @param closed - Whether the shape is closed
4275
+ *
4276
+ * @public
4277
+ */
4278
+ declare function getSvgPathFromStrokePoints(points: StrokePoint[], closed?: boolean): string;
4279
+
4280
+ /** @public */
4281
+ interface PlainTextLabelProps {
4282
+ shapeId: DrShapeId;
4283
+ type: ExtractShapeByProps<{
4284
+ text: string;
4285
+ }>['type'];
4286
+ fontFamily: string;
4287
+ fontSize: number;
4288
+ lineHeight: number;
4289
+ textAlign: 'start' | 'center' | 'end';
4290
+ verticalAlign: 'start' | 'middle' | 'end';
4291
+ wrap?: boolean;
4292
+ text?: string;
4293
+ labelColor: string;
4294
+ bounds?: Box;
4295
+ isSelected: boolean;
4296
+ onKeyDown?(e: KeyboardEvent): void;
4297
+ classNamePrefix?: string;
4298
+ style?: React__default.CSSProperties;
4299
+ textWidth?: number;
4300
+ textHeight?: number;
4301
+ padding?: number;
4302
+ showTextOutline?: boolean;
4303
+ }
4304
+ /**
4305
+ * Renders a text label that can be used inside of shapes.
4306
+ * The component has the ability to be edited in place and furthermore
4307
+ * supports rich text editing.
4308
+ *
4309
+ * @public @react
4310
+ */
4311
+ declare const PlainTextLabel: React__default.NamedExoticComponent<PlainTextLabelProps>;
4312
+
4313
+ /** @public */
4314
+ interface RichTextLabelProps {
4315
+ shapeId: DrShapeId;
4316
+ type: ExtractShapeByProps<{
4317
+ richText: DrRichText;
4318
+ }>['type'];
4319
+ fontFamily: string;
4320
+ fontSize: number;
4321
+ lineHeight: number;
4322
+ textAlign: 'start' | 'center' | 'end';
4323
+ verticalAlign: 'start' | 'middle' | 'end';
4324
+ wrap?: boolean;
4325
+ richText?: DrRichText;
4326
+ labelColor: string;
4327
+ bounds?: Box;
4328
+ isSelected: boolean;
4329
+ onKeyDown?(e: KeyboardEvent): void;
4330
+ classNamePrefix?: string;
4331
+ style?: React__default.CSSProperties;
4332
+ textWidth?: number;
4333
+ textHeight?: number;
4334
+ padding?: number;
4335
+ hasCustomTabBehavior?: boolean;
4336
+ showTextOutline?: boolean;
4337
+ /** Whether clicking a link inside the text opens it in a new tab. Defaults to `true`. */
4338
+ openLinksOnClick?: boolean;
4339
+ }
4340
+ /**
4341
+ * Renders a text label that can be used inside of shapes.
4342
+ * The component has the ability to be edited in place and furthermore
4343
+ * supports rich text editing.
4344
+ *
4345
+ * @public @react
4346
+ */
4347
+ declare const RichTextLabel: React__default.NamedExoticComponent<RichTextLabelProps>;
4348
+ /** @public */
4349
+ interface RichTextSVGProps {
4350
+ bounds: Box;
4351
+ richText: DrRichText;
4352
+ fontSize: number;
4353
+ fontFamily: string;
4354
+ lineHeight: number;
4355
+ textAlign: 'start' | 'center' | 'end';
4356
+ verticalAlign: 'start' | 'middle' | 'end';
4357
+ wrap?: boolean;
4358
+ labelColor: string;
4359
+ padding: number;
4360
+ showTextOutline?: boolean;
4361
+ }
4362
+ /**
4363
+ * Renders a rich text string as SVG given bounds and text properties.
4364
+ *
4365
+ * @public @react
4366
+ */
4367
+ declare function RichTextSVG({ bounds, richText, fontSize, fontFamily, lineHeight, textAlign, verticalAlign, wrap, labelColor, padding, showTextOutline, }: RichTextSVGProps): react_jsx_runtime.JSX.Element;
4368
+
4369
+ /** @public */
4370
+ declare function useEditablePlainText(shapeId: DrShapeId, type: ExtractShapeByProps<{
4371
+ text: string;
4372
+ }>['type'], text?: string): {
4373
+ handleFocus: () => void;
4374
+ handleBlur: () => void;
4375
+ handleInputPointerDown: (e: React__default.PointerEvent) => void;
4376
+ handleDoubleClick: (e: Event | {
4377
+ nativeEvent: Event;
4378
+ }) => void;
4379
+ handlePaste: (e: ClipboardEvent | React__default.ClipboardEvent<HTMLTextAreaElement>) => void;
4380
+ isEditing: boolean;
4381
+ isReadyForEditing: boolean;
4382
+ rInput: React__default.RefObject<HTMLTextAreaElement | null>;
4383
+ handleKeyDown: (e: KeyboardEvent) => void;
4384
+ handleChange: ({ plaintext }: {
4385
+ plaintext: string;
4386
+ }) => void;
4387
+ isEmpty: boolean;
4388
+ };
4389
+
4390
+ /** @public */
4391
+ declare function useEditableRichText(shapeId: DrShapeId, type: ExtractShapeByProps<{
4392
+ richText: DrRichText;
4393
+ }>['type'], richText?: DrRichText): {
4394
+ handleFocus: () => void;
4395
+ handleBlur: () => void;
4396
+ handleInputPointerDown: (e: React.PointerEvent) => void;
4397
+ handleDoubleClick: (e: Event | {
4398
+ nativeEvent: Event;
4399
+ }) => void;
4400
+ handlePaste: (e: ClipboardEvent | React.ClipboardEvent<HTMLTextAreaElement>) => void;
4401
+ isEditing: boolean;
4402
+ isReadyForEditing: boolean;
4403
+ rInput: React$1.RefObject<HTMLDivElement | null>;
4404
+ handleKeyDown: (e: KeyboardEvent) => void;
4405
+ handleChange: ({ richText }: {
4406
+ richText: DrRichText;
4407
+ }) => void;
4408
+ isEmpty: boolean | undefined;
4409
+ };
4410
+
4411
+ /**
4412
+ * Options for {@link useImageOrVideoAsset}.
4413
+ *
4414
+ * @public
4415
+ */
4416
+ interface UseImageOrVideoAssetOptions {
4417
+ /** The asset ID you want a URL for. */
4418
+ assetId: DrAssetId | null;
4419
+ /**
4420
+ * The shape the asset is being used for. We won't update the resolved URL while the shape is
4421
+ * off-screen.
4172
4422
  */
4173
- components?: DrUiComponents;
4423
+ shapeId?: DrShapeId;
4174
4424
  /**
4175
- * Additional items to add to the debug menu (will be deprecated)
4425
+ * The width at which the asset will be displayed, in shape-space pixels.
4176
4426
  */
4177
- renderDebugMenuItems?(): React__default.ReactNode;
4178
- /** Asset URL override. */
4179
- assetUrls?: DrUiAssetUrlOverrides;
4427
+ width: number;
4180
4428
  }
4181
4429
  /**
4430
+ * This is a handy helper hook that resolves an asset to an optimized URL for a given shape, or its
4431
+ * {@link @ibodr/editor#Editor.createTemporaryAssetPreview | placeholder} if the asset is still
4432
+ * uploading. This is used in particular for high-resolution images when you want lower and higher
4433
+ * resolution depending on the size of the image on the canvas and the zoom level.
4434
+ *
4435
+ * For image scaling to work, you need to implement scaled URLs in
4436
+ * {@link @ibodr/schema#DrAssetStore.resolve}.
4437
+ *
4182
4438
  * @public
4183
- * @react
4184
4439
  */
4185
- declare const DrawUi: React__default.NamedExoticComponent<DrawUiProps>;
4186
- /** @public @react */
4187
- declare function DrawUiInFrontOfTheCanvas(): react_jsx_runtime.JSX.Element;
4440
+ declare function useImageOrVideoAsset({ shapeId, assetId, width }: UseImageOrVideoAssetOptions): {
4441
+ asset: (DrImageAsset | DrVideoAsset) | null;
4442
+ url: string | null;
4443
+ };
4188
4444
 
4445
+ /** @public */
4446
+ interface TextAreaProps {
4447
+ isEditing: boolean;
4448
+ text?: string;
4449
+ shapeId: DrShapeId;
4450
+ richText?: DrRichText;
4451
+ handleFocus(): void;
4452
+ handleBlur(): void;
4453
+ handleKeyDown(e: KeyboardEvent): void;
4454
+ handleChange(changeInfo: {
4455
+ plaintext?: string;
4456
+ richText?: DrRichText;
4457
+ }): void;
4458
+ handleInputPointerDown(e: React__default.PointerEvent<HTMLElement>): void;
4459
+ handleDoubleClick(e: any): any;
4460
+ handlePaste(e: ClipboardEvent | React__default.ClipboardEvent<HTMLTextAreaElement>): void;
4461
+ hasCustomTabBehavior?: boolean;
4462
+ }
4189
4463
  /**
4190
- * Override the default react components used by the editor and UI. Set components to null to
4191
- * disable them entirely.
4192
- *
4193
- * @example
4194
- * ```tsx
4195
- * import { Draw, DrComponents, DrCollaboratorCursorProps } from '@ibodr/draw'
4196
- *
4197
- * const MyCursor = ({ point, color, name, scale, layout }: DrCollaboratorCursorProps) => (
4198
- * // custom pointer + badge; `layout.badgeOffset` / `layout.iconOffset` come from Draw
4199
- * )
4464
+ * N.B. In Development mode you need to ensure you're testing this without StrictMode on.
4465
+ * Otherwise it's not gonna work as expected on iOS.
4466
+ * Specifically, it means that the virtual keyboard won't pop open sometimes
4467
+ * (iOS starts flipping out when you render multiple times when trying to focus something) .
4468
+ */
4469
+ /**
4470
+ * A rich text area that can be used for editing text with rich text formatting.
4471
+ * This component uses the TipTap editor under the hood.
4200
4472
  *
4201
- * const components: DrComponents = {
4202
- * CollaboratorCursor: MyCursor,
4203
- * }
4473
+ * @public @react
4474
+ */
4475
+ declare const RichTextArea: React__default.ForwardRefExoticComponent<TextAreaProps & React__default.RefAttributes<HTMLDivElement>>;
4476
+
4477
+ /**
4478
+ * A plain text area that can be used for basic editing text.
4204
4479
  *
4205
- * export function MyApp() {
4206
- * return (
4207
- * <Draw
4208
- * components={components}
4209
- * collaboratorCursorLayout={{ badgeOffset: { x: 2, y: 0 } }}
4210
- * />
4211
- * )
4212
- * }
4213
- * ```
4480
+ * @public @react
4481
+ */
4482
+ declare const PlainTextArea: React__default.ForwardRefExoticComponent<TextAreaProps & React__default.RefAttributes<HTMLTextAreaElement>>;
4483
+
4484
+ /** @public */
4485
+ type StyleValuesForUi<T> = readonly {
4486
+ readonly value: T;
4487
+ readonly icon: string | DrUiIconJsx;
4488
+ }[];
4489
+ /**
4490
+ * Returns the current list of color style items for the style panel,
4491
+ * derived from the theme's color palette. Only palette colors are included;
4492
+ * utility colors like `text`, `background`, etc. are excluded.
4214
4493
  *
4494
+ * Colors are ordered by their position in {@link @ibodr/schema#DefaultColorStyle},
4495
+ * followed by any additional theme colors in their object key order.
4215
4496
  *
4216
4497
  * @public
4217
4498
  */
4218
- interface DrComponents extends DrEditorComponents, DrUiComponents {
4219
- }
4220
- /** @public */
4221
- interface DrawBaseProps extends DrawUiProps, DrawEditorBaseProps, DrExternalContentProps {
4222
- /** Urls for custom assets.
4223
- *
4224
- * ⚠︎ Important! This must be memoized (with useMemo) or defined outside of any React component.
4225
- */
4226
- assetUrls?: DrUiAssetUrlOverrides;
4227
- /** Overrides for tldraw's components.
4228
- *
4229
- * ⚠︎ Important! This must be memoized (with useMemo) or defined outside of any React component.
4230
- */
4231
- components?: DrComponents;
4232
- /**
4233
- * Offsets for the collaborator cursor pointer and name badge.
4234
- * Applied to the default cursor and passed via `layout` to custom `CollaboratorCursor` components.
4235
- *
4236
- * @example
4237
- * ```tsx
4238
- * <Draw collaboratorCursorLayout={{ badgeOffset: { x: 2, y: 0 } }} />
4239
- * ```
4240
- */
4241
- collaboratorCursorLayout?: Partial<DrCollaboratorCursorLayout>;
4242
- /** Custom definitions for tldraw's embeds.
4243
- *
4244
- * ⚠︎ Important! This must be memoized (with useMemo) or defined outside of any React component.
4245
- *
4246
- * @deprecated Use `EmbedShapeUtil.configure({ embedDefinitions: embeds })` instead.
4247
- */
4248
- embeds?: DrEmbedDefinition[];
4249
- /**
4250
- * Text options for the editor.
4251
- *
4252
- * @deprecated Use `options.text` instead. This prop will be removed in a future release.
4253
- */
4254
- textOptions?: DrTextOptions;
4255
- /**
4256
- * The locale to use for the editor's UI. When set, this takes priority over
4257
- * both the browser's language preferences (`navigator.languages`) and the
4258
- * user's locale preference (e.g. via
4259
- * `editor.user.updateUserPreferences({ locale: '...' })`), giving the
4260
- * application explicit control over the displayed language.
4261
- *
4262
- * @example
4263
- * ```tsx
4264
- * <Draw locale="fr" />
4265
- * ```
4266
- */
4267
- locale?: string;
4268
- }
4269
- /** @public */
4270
- type DrawProps = DrawBaseProps & DrawEditorStoreProps;
4271
- /** @public @react */
4272
- declare function Draw(props: DrawProps): react_jsx_runtime.JSX.Element;
4273
-
4274
- /** @public */
4275
- interface DrawImageProps extends DrImageExportOptions {
4276
- /**
4277
- * The snapshot to display.
4278
- */
4279
- snapshot: Partial<DrEditorSnapshot> | DrStoreSnapshot;
4280
- /**
4281
- * The image format to use. Defaults to 'svg'.
4282
- */
4283
- format?: 'svg' | 'png';
4284
- /**
4285
- * The page to display. Defaults to the first page.
4286
- */
4287
- pageId?: DrPageId;
4288
- /**
4289
- * Additional shape utils to use.
4290
- */
4291
- shapeUtils?: readonly DrAnyShapeUtilConstructor[];
4292
- /**
4293
- * Additional binding utils to use.
4294
- */
4295
- bindingUtils?: readonly DrAnyBindingUtilConstructor[];
4296
- /**
4297
- * Asset URL overrides.
4298
- */
4299
- assetUrls?: DrUiAssetUrlOverrides;
4300
- /**
4301
- * Options for the editor.
4302
- */
4303
- options?: Partial<DrawOptions>;
4304
- /**
4305
- * Text options for the editor.
4306
- *
4307
- * @deprecated Use `options.text` instead. This prop will be removed in a future release.
4308
- */
4309
- textOptions?: DrTextOptions;
4310
- }
4499
+ declare function getColorStyleItems(colors: DrThemeColors): StyleValuesForUi<string>;
4311
4500
  /**
4312
- * A rendered SVG image of a Draw snapshot.
4501
+ * Returns the current list of font style items for the style panel,
4502
+ * derived from the theme's font palette.
4313
4503
  *
4314
- * @example
4315
- * ```tsx
4316
- * <DrawImage
4317
- * snapshot={snapshot}
4318
- * pageId={pageId}
4319
- * background={false}
4320
- * darkMode={true}
4321
- * bounds={new Box(0,0,600,400)}
4322
- * scale={1}
4323
- * />
4324
- * ```
4504
+ * Fonts are ordered by their position in {@link @ibodr/schema#DefaultFontStyle},
4505
+ * followed by any additional theme fonts in their object key order.
4325
4506
  *
4326
4507
  * @public
4327
- * @react
4328
4508
  */
4329
- declare const DrawImage: React$1.NamedExoticComponent<DrawImageProps>;
4509
+ declare function getFontStyleItems(theme: DrTheme): StyleValuesForUi<string>;
4330
4510
 
4331
4511
  /** @public */
4332
4512
  declare function getHitShapeOnCanvasPointerDown(editor: Editor, hitLabels?: boolean): DrShape | undefined;
@@ -4349,7 +4529,7 @@ declare function RotateCWMenuItem(): react_jsx_runtime.JSX.Element;
4349
4529
  declare function GroupOrUngroupMenuItem(): react_jsx_runtime.JSX.Element;
4350
4530
 
4351
4531
  /** @public @react */
4352
- declare function DefaultContextMenuContent(): react_jsx_runtime.JSX.Element | null;
4532
+ declare function DefaultContextMenuContent(): react_jsx_runtime.JSX.Element;
4353
4533
 
4354
4534
  /** @public */
4355
4535
  interface DrUiDebugMenuProps {
@@ -4403,18 +4583,18 @@ declare function DefaultHelpMenuContent(): react_jsx_runtime.JSX.Element;
4403
4583
  declare function KeyboardShortcutsMenuItem(): react_jsx_runtime.JSX.Element | null;
4404
4584
 
4405
4585
  /** @public @react */
4406
- declare function DefaultKeyboardShortcutsDialogContent(): react_jsx_runtime.JSX.Element;
4586
+ declare function InputModeMenu(): react_jsx_runtime.JSX.Element;
4407
4587
 
4408
4588
  /** @public @react */
4409
- declare function LanguageMenu(): react_jsx_runtime.JSX.Element | null;
4589
+ declare function DefaultKeyboardShortcutsDialogContent(): react_jsx_runtime.JSX.Element;
4410
4590
 
4411
4591
  /** @public @react */
4412
- declare function InputModeMenu(): react_jsx_runtime.JSX.Element;
4592
+ declare function LanguageMenu(): react_jsx_runtime.JSX.Element | null;
4413
4593
 
4414
4594
  /** @public @react */
4415
4595
  declare function DefaultMainMenuContent(): react_jsx_runtime.JSX.Element;
4416
4596
  /** @public @react */
4417
- declare function ExportFileContentSubMenu(): react_jsx_runtime.JSX.Element;
4597
+ declare function ExportFileContentSubMenu(): react_jsx_runtime.JSX.Element | null;
4418
4598
  /** @public @react */
4419
4599
  declare function EditSubmenu(): react_jsx_runtime.JSX.Element;
4420
4600
  /** @public @react */
@@ -4459,7 +4639,9 @@ declare function ZoomToSelectionMenuItem(): react_jsx_runtime.JSX.Element;
4459
4639
  /** @public @react */
4460
4640
  declare function ClipboardMenuGroup(): react_jsx_runtime.JSX.Element;
4461
4641
  /** @public @react */
4462
- declare function CopyAsMenuGroup(): react_jsx_runtime.JSX.Element;
4642
+ declare function CopyAsMenuGroup(): react_jsx_runtime.JSX.Element | null;
4643
+ /** @public @react */
4644
+ declare function ExportAsMenuGroup(): react_jsx_runtime.JSX.Element | null;
4463
4645
  /** @public @react */
4464
4646
  declare function CutMenuItem(): react_jsx_runtime.JSX.Element;
4465
4647
  /** @public @react */
@@ -4564,68 +4746,29 @@ interface DrUiButtonProps extends React$1.HTMLAttributes<HTMLButtonElement> {
4564
4746
  }
4565
4747
  /** @public @react */
4566
4748
  declare const DrawUiButton: React$1.ForwardRefExoticComponent<DrUiButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
4567
-
4568
- /** @public */
4569
- interface DrUiButtonCheckProps {
4570
- checked: boolean;
4571
- }
4572
- /** @public @react */
4573
- declare function DrawUiButtonCheck({ checked }: DrUiButtonCheckProps): react_jsx_runtime.JSX.Element;
4574
-
4575
- /** @public */
4576
- interface DrUiButtonIconProps {
4577
- icon: string | DrUiIconJsx;
4578
- small?: boolean;
4579
- invertIcon?: boolean;
4580
- }
4581
- /** @public @react */
4582
- declare function DrawUiButtonIcon({ icon, small, invertIcon }: DrUiButtonIconProps): react_jsx_runtime.JSX.Element;
4583
-
4584
- /** @public */
4585
- interface DrUiButtonLabelProps {
4586
- children?: ReactNode;
4587
- }
4588
- /** @public @react */
4589
- declare function DrawUiButtonLabel({ children }: DrUiButtonLabelProps): react_jsx_runtime.JSX.Element;
4590
-
4591
- /** @public */
4592
- type DrUiMenuContextType = 'menu' | 'small-icons' | 'context-menu' | 'icons' | 'keyboard-shortcuts' | 'helper-buttons' | 'toolbar' | 'toolbar-overflow';
4749
+
4593
4750
  /** @public */
4594
- interface DrUiMenuContextProviderProps {
4595
- type: DrUiMenuContextType;
4596
- sourceId: DrUiEventSource;
4597
- children: React.ReactNode;
4751
+ interface DrUiButtonCheckProps {
4752
+ checked: boolean;
4598
4753
  }
4599
4754
  /** @public @react */
4600
- declare function DrawUiMenuContextProvider({ type, sourceId, children, }: DrUiMenuContextProviderProps): react_jsx_runtime.JSX.Element;
4755
+ declare function DrawUiButtonCheck({ checked }: DrUiButtonCheckProps): react_jsx_runtime.JSX.Element;
4601
4756
 
4602
4757
  /** @public */
4603
- interface DrUiMenuGroupProps<TranslationKey extends string = string> {
4604
- id: string;
4605
- /**
4606
- * The label to display on the item. If it's a string, it will be translated. If it's an object, the keys will be used as the language keys and the values will be translated.
4607
- */
4608
- label?: TranslationKey | {
4609
- [key: string]: TranslationKey;
4610
- };
4611
- className?: string;
4612
- children?: ReactNode;
4758
+ interface DrUiButtonIconProps {
4759
+ icon: string | DrUiIconJsx;
4760
+ small?: boolean;
4761
+ invertIcon?: boolean;
4613
4762
  }
4614
4763
  /** @public @react */
4615
- declare function DrawUiMenuGroup({ id, label, className, children }: DrUiMenuGroupProps): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
4764
+ declare function DrawUiButtonIcon({ icon, small, invertIcon }: DrUiButtonIconProps): react_jsx_runtime.JSX.Element;
4616
4765
 
4617
4766
  /** @public */
4618
- interface DrUiMenuSubmenuProps<Translation extends string = string> {
4619
- id: string;
4620
- label?: Translation | {
4621
- [key: string]: Translation;
4622
- };
4623
- disabled?: boolean;
4624
- children: ReactNode;
4625
- size?: 'tiny' | 'small' | 'medium' | 'wide';
4767
+ interface DrUiButtonLabelProps {
4768
+ children?: ReactNode;
4626
4769
  }
4627
4770
  /** @public @react */
4628
- declare function DrawUiMenuSubmenu<Translation extends string = string>({ id, disabled, label, size, children, }: DrUiMenuSubmenuProps<Translation>): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
4771
+ declare function DrawUiButtonLabel({ children }: DrUiButtonLabelProps): react_jsx_runtime.JSX.Element;
4629
4772
 
4630
4773
  /** @public */
4631
4774
  interface DrUiContextualToolbarProps {
@@ -4642,7 +4785,7 @@ interface DrUiContextualToolbarProps {
4642
4785
  *
4643
4786
  * @public @react
4644
4787
  */
4645
- declare const DrawUiContextualToolbar: ({ children, className, isMousingDown, getSelectionBounds, changeOnlyWhenYChanges, label, }: DrUiContextualToolbarProps) => react_jsx_runtime.JSX.Element;
4788
+ declare function DrawUiContextualToolbar({ children, className, isMousingDown, getSelectionBounds, changeOnlyWhenYChanges, label, }: DrUiContextualToolbarProps): react_jsx_runtime.JSX.Element;
4646
4789
 
4647
4790
  /** @public */
4648
4791
  interface DrUiDialogHeaderProps {
@@ -4700,10 +4843,11 @@ interface DrUiDropdownMenuContentProps {
4700
4843
  align?: 'start' | 'center' | 'end';
4701
4844
  sideOffset?: number;
4702
4845
  alignOffset?: number;
4846
+ collisionPadding?: number;
4703
4847
  children: ReactNode;
4704
4848
  }
4705
4849
  /** @public @react */
4706
- declare function DrawUiDropdownMenuContent({ className, side, align, sideOffset, alignOffset, children, }: DrUiDropdownMenuContentProps): react_jsx_runtime.JSX.Element;
4850
+ declare function DrawUiDropdownMenuContent({ className, side, align, sideOffset, alignOffset, collisionPadding, children, }: DrUiDropdownMenuContentProps): react_jsx_runtime.JSX.Element;
4707
4851
  /** @public */
4708
4852
  interface DrUiDropdownMenuSubProps {
4709
4853
  id: string;
@@ -4768,6 +4912,8 @@ interface DrUiInputProps {
4768
4912
  autoSelect?: boolean;
4769
4913
  children?: React$1.ReactNode;
4770
4914
  defaultValue?: string;
4915
+ /** Maximum number of characters the input will accept. */
4916
+ maxLength?: number;
4771
4917
  placeholder?: string;
4772
4918
  onComplete?(value: string): void;
4773
4919
  onValueChange?(value: string): void;
@@ -4822,11 +4968,16 @@ interface DrUiPopoverContentProps {
4822
4968
  align?: 'start' | 'center' | 'end';
4823
4969
  alignOffset?: number;
4824
4970
  sideOffset?: number;
4971
+ /**
4972
+ * Minimum distance to keep between the popover and the viewport edge before it
4973
+ * shifts to stay in view. Defaults to Radix's `0`.
4974
+ */
4975
+ collisionPadding?: number;
4825
4976
  disableEscapeKeyDown?: boolean;
4826
4977
  autoFocusFirstButton?: boolean;
4827
4978
  }
4828
4979
  /** @public @react */
4829
- declare function DrawUiPopoverContent({ side, children, align, sideOffset, alignOffset, disableEscapeKeyDown, autoFocusFirstButton, }: DrUiPopoverContentProps): react_jsx_runtime.JSX.Element;
4980
+ declare function DrawUiPopoverContent({ side, children, align, sideOffset, alignOffset, collisionPadding, disableEscapeKeyDown, autoFocusFirstButton, }: DrUiPopoverContentProps): react_jsx_runtime.JSX.Element;
4830
4981
 
4831
4982
  /** @public */
4832
4983
  interface DrUiSelectProps {
@@ -4964,7 +5115,7 @@ interface DrUiToolbarToggleGroupProps extends React__default.HTMLAttributes<HTML
4964
5115
  asChild?: boolean;
4965
5116
  }
4966
5117
  /** @public @react */
4967
- declare const DrawUiToolbarToggleGroup: ({ children, className, type, asChild, ...props }: DrUiToolbarToggleGroupProps) => react_jsx_runtime.JSX.Element;
5118
+ declare function DrawUiToolbarToggleGroup({ children, className, type, asChild, ...props }: DrUiToolbarToggleGroupProps): react_jsx_runtime.JSX.Element;
4968
5119
  /** @public */
4969
5120
  interface DrUiToolbarToggleItemProps extends React__default.HTMLAttributes<HTMLButtonElement> {
4970
5121
  children?: React__default.ReactNode;
@@ -4974,7 +5125,7 @@ interface DrUiToolbarToggleItemProps extends React__default.HTMLAttributes<HTMLB
4974
5125
  tooltip?: React__default.ReactNode;
4975
5126
  }
4976
5127
  /** @public @react */
4977
- declare const DrawUiToolbarToggleItem: ({ children, className, type, value, tooltip, ...props }: DrUiToolbarToggleItemProps) => react_jsx_runtime.JSX.Element;
5128
+ declare function DrawUiToolbarToggleItem({ children, className, type, value, tooltip, ...props }: DrUiToolbarToggleItemProps): react_jsx_runtime.JSX.Element;
4978
5129
 
4979
5130
  /** @public */
4980
5131
  interface DrawUiTooltipProps {
@@ -4997,6 +5148,45 @@ declare function DrawUiTooltipProvider({ children }: DrawUiTooltipProviderProps)
4997
5148
  /** @public @react */
4998
5149
  declare const DrawUiTooltip: React__default.ForwardRefExoticComponent<DrawUiTooltipProps & React__default.RefAttributes<HTMLButtonElement>>;
4999
5150
 
5151
+ /** @public */
5152
+ type DrUiMenuContextType = 'menu' | 'small-icons' | 'context-menu' | 'icons' | 'keyboard-shortcuts' | 'helper-buttons' | 'toolbar' | 'toolbar-overflow';
5153
+ /** @public */
5154
+ interface DrUiMenuContextProviderProps {
5155
+ type: DrUiMenuContextType;
5156
+ sourceId: DrUiEventSource;
5157
+ children: React.ReactNode;
5158
+ }
5159
+ /** @public @react */
5160
+ declare function DrawUiMenuContextProvider({ type, sourceId, children, }: DrUiMenuContextProviderProps): react_jsx_runtime.JSX.Element;
5161
+
5162
+ /** @public */
5163
+ interface DrUiMenuGroupProps<TranslationKey extends string = string> {
5164
+ id: string;
5165
+ /**
5166
+ * The label to display on the item. If it's a string, it will be translated. If it's an object, the keys will be used as the language keys and the values will be translated.
5167
+ */
5168
+ label?: TranslationKey | {
5169
+ [key: string]: TranslationKey;
5170
+ };
5171
+ className?: string;
5172
+ children?: ReactNode;
5173
+ }
5174
+ /** @public @react */
5175
+ declare function DrawUiMenuGroup({ id, label, className, children }: DrUiMenuGroupProps): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
5176
+
5177
+ /** @public */
5178
+ interface DrUiMenuSubmenuProps<Translation extends string = string> {
5179
+ id: string;
5180
+ label?: Translation | {
5181
+ [key: string]: Translation;
5182
+ };
5183
+ disabled?: boolean;
5184
+ children: ReactNode;
5185
+ size?: 'tiny' | 'small' | 'medium' | 'wide';
5186
+ }
5187
+ /** @public @react */
5188
+ declare function DrawUiMenuSubmenu<Translation extends string = string>({ id, disabled, label, size, children, }: DrUiMenuSubmenuProps<Translation>): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
5189
+
5000
5190
  /** @public @react */
5001
5191
  declare function DefaultQuickActionsContent(): react_jsx_runtime.JSX.Element | undefined;
5002
5192
 
@@ -5009,7 +5199,7 @@ declare function DefaultPeopleMenu({ children }: DefaultPeopleMenuProps): react_
5009
5199
 
5010
5200
  /** @public */
5011
5201
  interface DefaultPeopleMenuContentProps {
5012
- userIds: string[];
5202
+ userIds: DrUserId[];
5013
5203
  }
5014
5204
  /** @public @react */
5015
5205
  declare function DefaultPeopleMenuContent({ userIds }: DefaultPeopleMenuContentProps): react_jsx_runtime.JSX.Element;
@@ -5122,8 +5312,13 @@ interface StylePanelDropdownPickerProps<T extends string> {
5122
5312
  onValueChange?(style: StyleProp<T>, value: T): void;
5123
5313
  /** Override the test ID prefix. Defaults to uiType. */
5124
5314
  testIdType?: string;
5125
- /** Distance to push the popover left of the trigger so it lands flush with the style panel. */
5315
+ /**
5316
+ * Distance to push the popover left of the trigger so it lands flush with the style panel.
5317
+ * Defaults to the standard popover gap so standalone dropdowns don't sit flush against the panel.
5318
+ */
5126
5319
  sideOffset?: number;
5320
+ /** Is the dropdown an overflow of a different radio group? If so, show active when the group's active item is inside of the dropdown.*/
5321
+ isOverflow?: boolean;
5127
5322
  }
5128
5323
  /** @public @react */
5129
5324
  declare const StylePanelDropdownPicker: <T extends string>(props: StylePanelDropdownPickerProps<T>) => React$1.JSX.Element;
@@ -5204,6 +5399,14 @@ declare function HandToolbarItem(): react_jsx_runtime.JSX.Element;
5204
5399
  declare function DrawToolbarItem(): react_jsx_runtime.JSX.Element;
5205
5400
  /** @public @react */
5206
5401
  declare function EraserToolbarItem(): react_jsx_runtime.JSX.Element;
5402
+ /**
5403
+ * Renders the comment tool if it has been registered (e.g. via `@tldraw/commenting`) and commenting
5404
+ * is licensed. Renders nothing otherwise, so it's safe to include in the default toolbar for every
5405
+ * editor.
5406
+ *
5407
+ * @public @react
5408
+ */
5409
+ declare function CommentToolbarItem(): react_jsx_runtime.JSX.Element | null;
5207
5410
  /** @public @react */
5208
5411
  declare function ArrowToolbarItem(): react_jsx_runtime.JSX.Element;
5209
5412
  /** @public @react */
@@ -5351,12 +5554,19 @@ declare function DrawUiA11yProvider({ children }: A11yProviderProps): react_jsx_
5351
5554
  /** @public */
5352
5555
  declare function useA11y(): DrUiA11yContextType;
5353
5556
 
5354
- /** @internal */
5355
- declare function AssetUrlsProvider({ assetUrls, children, }: {
5557
+ /** @public */
5558
+ interface AssetUrlsProviderProps {
5356
5559
  assetUrls: DrUiAssetUrls;
5357
5560
  children: React.ReactNode;
5358
- }): react_jsx_runtime.JSX.Element;
5359
- /** @internal */
5561
+ }
5562
+ /**
5563
+ * Provides asset URLs (icons, fonts, translations, embed icons) to the editor's UI.
5564
+ * Required when using `DrawUiTranslationProvider` without `DrawUiContextProvider`.
5565
+ *
5566
+ * @public @react
5567
+ */
5568
+ declare function AssetUrlsProvider({ assetUrls, children }: AssetUrlsProviderProps): react_jsx_runtime.JSX.Element;
5569
+ /** @public */
5360
5570
  declare function useAssetUrls(): DrUiAssetUrls;
5361
5571
 
5362
5572
  /** @public */
@@ -5390,7 +5600,7 @@ declare function useCanApplySelectionAction(): boolean;
5390
5600
  *
5391
5601
  * @public
5392
5602
  */
5393
- declare const handleNativeOrMenuCopy: (editor: Editor, context?: DrClipboardWriteInfo) => Promise<boolean>;
5603
+ declare function handleNativeOrMenuCopy(editor: Editor, context?: DrClipboardWriteInfo): Promise<boolean>;
5394
5604
  /** @public */
5395
5605
  declare function useMenuClipboardEvents(): {
5396
5606
  copy: (source: DrUiEventSource) => Promise<void>;
@@ -5428,204 +5638,86 @@ declare function copyAs(editor: Editor, ids: DrShapeId[], opts: CopyAsOptions):
5428
5638
  declare function useCopyAs(): (ids: DrShapeId[], format?: DrCopyType) => void;
5429
5639
 
5430
5640
  /** @public */
5431
- declare function useExportAs(): (ids: DrShapeId[], opts?: {
5432
- format?: DrExportType;
5433
- name?: string;
5434
- scale?: number;
5435
- }) => void;
5436
-
5437
- /*!
5438
- * The kbd-string splitter (`getKeys`) and the form-input filter pattern in `shouldSkipEvent`
5439
- * (including its list of non-text INPUT types) are adapted from hotkeys-js, which this hook
5440
- * previously depended on.
5441
- *
5442
- * MIT License: https://github.com/jaywcjlove/hotkeys-js/blob/master/LICENSE
5443
- * Copyright (c) 2015-present, Kenny Wong
5444
- * Copyright (c) 2011-2013 Thomas Fuchs (https://github.com/madrobby/keymaster)
5445
- * Source: https://github.com/jaywcjlove/hotkeys-js
5446
- */
5447
-
5448
- /** @public */
5449
- declare function useKeyboardShortcuts(): void;
5450
-
5451
- /** @public */
5452
- declare function useLocalStorageState<T = any>(key: string, defaultValue: T): readonly [T, (setter: T | ((value: T) => T)) => void];
5453
-
5454
- /** @public */
5455
- declare function useMenuIsOpen(id: string, cb?: (isOpen: boolean) => void): readonly [boolean, (isOpen: boolean) => void];
5456
-
5457
- /** @public */
5458
- declare function useReadonly(): boolean;
5459
-
5460
- /** @public */
5461
- declare function useRelevantStyles(stylesToCheck?: readonly StyleProp<any>[]): ReadonlySharedStyleMap | null;
5462
-
5463
- /** @public */
5464
- interface BoxWidthHeight {
5465
- w: number;
5466
- h: number;
5467
- }
5468
- /**
5469
- * Contains the size within the given box size
5470
- *
5471
- * @param originalSize - The size of the asset
5472
- * @param containBoxSize - The container size
5473
- * @returns Adjusted size
5474
- * @public
5475
- */
5476
- declare function containBoxSize(originalSize: BoxWidthHeight, containBoxSize: BoxWidthHeight): BoxWidthHeight;
5477
- /**
5478
- * Resize an image Blob to be smaller than it is currently.
5479
- *
5480
- * @example
5481
- * ```ts
5482
- * const image = await (await fetch('/image.jpg')).blob()
5483
- * const size = await getImageSize(image)
5484
- * const resizedImage = await downsizeImage(image, size.w / 2, size.h / 2, { type: "image/jpeg", quality: 0.85 })
5485
- * ```
5486
- *
5487
- * @param image - The image Blob.
5488
- * @param width - The desired width.
5489
- * @param height - The desired height.
5490
- * @param opts - Options for the image.
5491
- * @public
5492
- */
5493
- declare function downsizeImage(blob: Blob, width: number, height: number, opts?: {
5494
- type?: string;
5495
- quality?: number;
5496
- }): Promise<Blob>;
5497
-
5498
- /** @public */
5499
- interface DrTypeFace {
5500
- url: string;
5501
- display?: any;
5502
- featureSettings?: string;
5503
- stretch?: string;
5504
- style?: string;
5505
- unicodeRange?: string;
5506
- variant?: string;
5507
- weight?: string;
5508
- format?: string;
5509
- }
5510
- /** @public */
5511
- declare function preloadFont(id: string, font: DrTypeFace, targetDocument?: Document): Promise<FontFace>;
5512
-
5513
- /**
5514
- * Put excalidraw clipboard content onto the current page.
5515
- *
5516
- * @param editor - The editor instance.
5517
- * @param excalidrawClipboardContent - The excalidraw clipboard model.
5518
- * @param point - The point at which to put the excalidraw content.
5519
- * @public
5520
- */
5521
- declare function putExcalidrawContent(editor: Editor, excalidrawClipboardContent: any, point?: VecLike): Promise<void>;
5522
-
5523
- /** @public */
5524
- interface ExportAsOptions extends DrImageExportOptions {
5525
- /** {@inheritdoc @ibodr/editor#DrImageExportOptions.format} */
5526
- format: DrExportType;
5527
- /** Name of the exported file. If undefined a predefined name, based on the selection, will be used. */
5528
- name?: string;
5529
- }
5530
- /**
5531
- * Export the given shapes as files.
5532
- *
5533
- * @param editor - The editor instance.
5534
- * @param ids - The ids of the shapes to export.
5535
- * @param opts - Options for the export.
5536
- *
5537
- * @public
5538
- */
5539
- declare function exportAs(editor: Editor, ids: DrShapeId[], opts: ExportAsOptions): Promise<void>;
5540
- /** @internal */
5541
- declare function downloadFile(file: File, doc?: Document): void;
5542
-
5543
- /**
5544
- * Remove a frame (or any frame-like container shape).
5545
- *
5546
- * @param editor - tldraw editor instance.
5547
- * @param ids - Ids of the frames you wish to remove.
5548
- *
5549
- * @public
5550
- */
5551
- declare function removeFrame(editor: Editor, ids: DrShapeId[]): void;
5552
- /**
5553
- * Fit a frame (or any frame-like container shape) to its content.
5554
- *
5555
- * @param id - Id of the frame you wish to fit to content.
5556
- * @param editor - tlraw editor instance.
5557
- * @param opts - Options for fitting the frame.
5558
- *
5559
- * @public
5560
- */
5561
- declare function fitFrameToContent(editor: Editor, id: DrShapeId, opts?: {
5562
- padding: number;
5563
- }): void;
5564
-
5565
- /*!
5566
- * SVG/attribute allowlists and URI sanitization approach derived from DOMPurify.
5567
- * DOMPurify — MIT License, Copyright (c) 2015 Mario Heiderich
5568
- * https://github.com/cure53/DOMPurify/blob/main/LICENSE
5569
- */
5570
- /**
5571
- * Sanitizes an SVG string by removing dangerous elements, attributes, and URIs
5572
- * while preserving safe content including foreignObject (for text rendering),
5573
- * style elements (for fonts with data: URLs), and animation elements.
5574
- * Embedded SVG data URIs on `<image>`/`<feImage>` are recursively sanitized.
5575
- *
5576
- * Returns the sanitized SVG string, or an empty string if the input was
5577
- * malformed (parse error) or contained no safe content after sanitization.
5578
- *
5579
- * @public
5580
- */
5581
- declare function sanitizeSvg(svgText: string): string;
5582
-
5583
- /** @public */
5584
- declare const KeyboardShiftEnterTweakExtension: Extension<any, any>;
5585
- /**
5586
- * Default extensions for the TipTap editor.
5587
- *
5588
- * @public
5589
- */
5590
- declare const tipTapDefaultExtensions: Extensions;
5591
- /**
5592
- * Renders HTML from a rich text string.
5593
- *
5594
- * @param editor - The editor instance.
5595
- * @param richText - The rich text content.
5641
+ declare function useExportAs(): (ids: DrShapeId[], opts?: {
5642
+ format?: DrExportType;
5643
+ name?: string;
5644
+ scale?: number;
5645
+ }) => void;
5646
+
5647
+ /*!
5648
+ * The form-input filter pattern in `shouldSkipEvent` (including its list of non-text INPUT
5649
+ * types) is adapted from hotkeys-js, which this hook previously depended on.
5596
5650
  *
5597
- * @public
5651
+ * MIT License: https://github.com/jaywcjlove/hotkeys-js/blob/master/LICENSE
5652
+ * Copyright (c) 2015-present, Kenny Wong
5653
+ * Copyright (c) 2011-2013 Thomas Fuchs (https://github.com/madrobby/keymaster)
5654
+ * Source: https://github.com/jaywcjlove/hotkeys-js
5598
5655
  */
5599
- declare function renderHtmlFromRichText(editor: Editor, richText: DrRichText): string;
5656
+
5657
+ /** @public */
5658
+ declare function useKeyboardShortcuts(): void;
5659
+
5660
+ /** @public */
5661
+ declare function useLocalStorageState<T = any>(key: string, defaultValue: T): readonly [T, (setter: T | ((value: T) => T)) => void];
5662
+
5663
+ /** @public */
5664
+ declare function useMenuIsOpen(id: string, cb?: (isOpen: boolean) => void): readonly [boolean, (isOpen: boolean) => void];
5665
+
5666
+ /** @public */
5667
+ declare function useReadonly(): boolean;
5668
+
5669
+ /** @public */
5670
+ declare function useRelevantStyles(stylesToCheck?: readonly StyleProp<any>[]): ReadonlySharedStyleMap | null;
5671
+
5672
+ /** @public */
5673
+ interface BoxWidthHeight {
5674
+ w: number;
5675
+ h: number;
5676
+ }
5600
5677
  /**
5601
- * Renders HTML from a rich text string for measurement.
5602
- * @param editor - The editor instance.
5603
- * @param richText - The rich text content.
5678
+ * Contains the size within the given box size
5604
5679
  *
5680
+ * @param originalSize - The size of the asset
5681
+ * @param containBoxSize - The container size
5682
+ * @returns Adjusted size
5605
5683
  * @public
5606
5684
  */
5607
- declare function renderHtmlFromRichTextForMeasurement(editor: Editor, richText: DrRichText): string;
5685
+ declare function containBoxSize(originalSize: BoxWidthHeight, containBoxSize: BoxWidthHeight): BoxWidthHeight;
5608
5686
  /**
5609
- * Renders plaintext from a rich text string.
5610
- * @param editor - The editor instance.
5611
- * @param richText - The rich text content.
5687
+ * Resize an image Blob to be smaller than it is currently.
5612
5688
  *
5613
- * @public
5614
- */
5615
- declare function renderPlaintextFromRichText(editor: Editor, richText: DrRichText): string;
5616
- /**
5617
- * Renders JSONContent from html.
5618
- * @param editor - The editor instance.
5619
- * @param richText - The rich text content.
5689
+ * @example
5690
+ * ```ts
5691
+ * const image = await (await fetch('/image.jpg')).blob()
5692
+ * const size = await getImageSize(image)
5693
+ * const resizedImage = await downsizeImage(image, size.w / 2, size.h / 2, { type: "image/jpeg", quality: 0.85 })
5694
+ * ```
5620
5695
  *
5696
+ * @param image - The image Blob.
5697
+ * @param width - The desired width.
5698
+ * @param height - The desired height.
5699
+ * @param opts - Options for the image.
5621
5700
  * @public
5622
5701
  */
5623
- declare function renderRichTextFromHTML(editor: Editor, html: string): DrRichText;
5624
- /** @public */
5625
- declare function defaultAddFontsFromNode(node: Node, state: RichTextFontVisitorState, addFont: (font: DrFontFace) => void): RichTextFontVisitorState;
5702
+ declare function downsizeImage(blob: Blob, width: number, height: number, opts?: {
5703
+ type?: string;
5704
+ quality?: number;
5705
+ }): Promise<Blob>;
5626
5706
 
5627
5707
  /** @public */
5628
- declare const truncateStringWithEllipsis: (str: string, maxLength: number) => string;
5708
+ interface DrTypeFace {
5709
+ url: string;
5710
+ display?: any;
5711
+ featureSettings?: string;
5712
+ stretch?: string;
5713
+ style?: string;
5714
+ unicodeRange?: string;
5715
+ variant?: string;
5716
+ weight?: string;
5717
+ format?: string;
5718
+ }
5719
+ /** @public */
5720
+ declare function preloadFont(id: string, font: DrTypeFace, targetDocument?: Document): Promise<FontFace>;
5629
5721
 
5630
5722
  /** @internal */
5631
5723
  declare function buildFromV1Document(editor: Editor, _document: unknown): void;
@@ -5938,4 +6030,278 @@ declare function serializeDrawJsonBlob(editor: Editor): Promise<Blob>;
5938
6030
  /** @internal */
5939
6031
  declare function parseAndLoadDocument(editor: Editor, document: string, msg: (id: DrUiTranslationKey | Exclude<string, DrUiTranslationKey>) => string, addToast: DrUiToastsContextType['addToast'], onV1FileLoad?: () => void, forceDarkMode?: boolean): Promise<void>;
5940
6032
 
5941
- export { type A11yPriority, type A11yProviderProps, type ASPECT_RATIO_OPTION, ASPECT_RATIO_OPTIONS, ASPECT_RATIO_TO_VALUE, AccessibilityMenu, type ActionsProviderProps, type AlertSeverity, AlignMenuItems, ArrangeMenuSubmenu, ArrowBindingHintOverlayUtil, ArrowBindingUtil, ArrowDownToolbarItem, ArrowHintOverlayUtil, ArrowLeftToolbarItem, ArrowRightToolbarItem, type ArrowShapeOptions, ArrowShapeTool, ArrowShapeUtil, type ArrowShapeUtilDisplayValues, type ArrowTargetState, ArrowToolbarItem, ArrowUpToolbarItem, AssetToolbarItem, AssetUrlsProvider, type BasePathBuilderOpts, BookmarkAssetUtil, type BookmarkShapeOptions, BookmarkShapeUtil, type BookmarkShapeUtilDisplayValues, type BoxWidthHeight, BreakPointProvider, type BreakPointProviderProps, BrushOverlayUtil, type BrushOverlayUtilDisplayValues, type BrushOverlayUtilOptions, CenteredTopPanelContainer, type CenteredTopPanelContainerProps, CheckBoxToolbarItem, ClipboardMenuGroup, CloudToolbarItem, CollaboratorBrushOverlayUtil, CollaboratorCursorBadge, CollaboratorCursorOverlayUtil, CollaboratorCursorPointer, CollaboratorCursors, type CollaboratorCursorsProps, CollaboratorHintOverlayUtil, CollaboratorScribbleOverlayUtil, CollaboratorShapeIndicatorOverlayUtil, ColorSchemeMenu, DefaultContextMenu as ContextMenu, ConversionsMenuGroup, ConvertToBookmarkMenuItem, ConvertToEmbedMenuItem, CopyAsMenuGroup, type CopyAsOptions, CopyMenuItem, type CropBoxOptions, type CubicBezierToPathBuilderCommand, CursorChatItem, type CustomDebugFlags, type CustomEmbedDefinition, CutMenuItem, DEFAULT_COLLABORATOR_CURSOR_LAYOUT, DEFAULT_EMBED_DEFINITIONS, DEFAULT_MAX_ASSET_SIZE, DEFAULT_MAX_IMAGE_DIMENSION, DRAW_FILE_EXTENSION, type DashedPathBuilderOpts, DebugFlags, type DebugFlagsProps, DefaultA11yAnnouncer, DefaultActionsMenu, DefaultActionsMenuContent, DefaultCollaboratorCursor, DefaultContextMenu, DefaultContextMenuContent, DefaultDebugMenu, DefaultDebugMenuContent, DefaultDialogs, type DefaultEmbedDefinitionType, DefaultFollowingIndicator, DefaultFontFaces, DefaultHelpMenu, DefaultHelpMenuContent, DefaultHelperButtons, DefaultHelperButtonsContent, DefaultImageToolbar, DefaultImageToolbarContent, type DefaultImageToolbarContentProps, DefaultKeyboardShortcutsDialog, DefaultKeyboardShortcutsDialogContent, DefaultMainMenu, DefaultMainMenuContent, DefaultMenuPanel, DefaultMinimap, DefaultNavigationPanel, DefaultPageMenu, DefaultPeopleMenu, DefaultPeopleMenuAvatar, DefaultPeopleMenuContent, type DefaultPeopleMenuContentProps, DefaultPeopleMenuFacePile, DefaultPeopleMenuItem, type DefaultPeopleMenuProps, DefaultQuickActions, DefaultQuickActionsContent, DefaultRichTextToolbar, DefaultRichTextToolbarContent, type DefaultRichTextToolbarContentProps, DefaultSharePanel, DefaultStylePanel, DefaultStylePanelContent, DefaultToasts, DefaultToolbar, DefaultToolbarContent, type DefaultToolbarProps, DefaultUserPresenceEditor, DefaultVideoToolbar, DefaultVideoToolbarContent, type DefaultVideoToolbarContentProps, DefaultZoomMenu, DefaultZoomMenuContent, DeleteMenuItem, DiamondToolbarItem, DistributeMenuItems, type DrArcArrowInfo, type DrArcInfo, type DrArrowBindingHintOverlay, type DrArrowBindings, type DrArrowHintOverlay, type DrArrowInfo, type DrArrowPoint, type DrBrushOverlay, type DrCollaboratorBrushOverlay, type DrCollaboratorCursorOverlay, type DrCollaboratorCursorScaleOptions, type DrCollaboratorHintOverlay, type DrCollaboratorScribbleOverlay, type DrCollaboratorShapeIndicatorOverlay, type DrComponents, type DrCopyType, type DrDefaultExternalContentHandlerOpts, type DrDefaultFont, type DrDefaultFonts, type DrEditorAssetUrls, type DrElbowArrowInfo, type DrEmbedDefinition, type DrEmbedResult, type DrEmbedShapePermissions, type DrExternalContentProps, type DrScribbleOverlay, type DrSelectionForegroundOverlay, type DrShapeHandleOverlay, type DrSnapIndicatorOverlay, type DrStraightArrowInfo, type DrTypeFace, type DrUiA11y, type DrUiA11yContextType, type DrUiActionItem, type DrUiActionsContextType, type DrUiActionsMenuProps, type DrUiAssetUrlOverrides, type DrUiAssetUrls, type DrUiButtonCheckProps, type DrUiButtonIconProps, type DrUiButtonLabelProps, type DrUiButtonProps, type DrUiComponents, type DrUiComponentsProviderProps, type DrUiContextMenuProps, type DrUiContextProviderProps, type DrUiContextualToolbarProps, type DrUiDebugMenuProps, type DrUiDialog, type DrUiDialogBodyProps, type DrUiDialogFooterProps, type DrUiDialogHeaderProps, type DrUiDialogProps, type DrUiDialogTitleProps, type DrUiDialogsContextType, type DrUiDialogsProviderProps, type DrUiDropdownMenuCheckboxItemProps, type DrUiDropdownMenuContentProps, type DrUiDropdownMenuGroupProps, type DrUiDropdownMenuItemProps, type DrUiDropdownMenuRootProps, type DrUiDropdownMenuSubContentProps, type DrUiDropdownMenuSubProps, type DrUiDropdownMenuSubTriggerProps, type DrUiDropdownMenuTriggerProps, type DrUiEventContextType, type DrUiEventData, type DrUiEventHandler, type DrUiEventMap, type DrUiEventSource, type DrUiHelpMenuProps, type DrUiHelperButtonsProps, type DrUiIconJsx, type DrUiIconProps, type DrUiIconType, type DrUiImageToolbarProps, type DrUiInputProps, type DrUiKbdProps, type DrUiKeyboardShortcutsDialogProps, type DrUiLayoutProps, type DrUiMainMenuProps, type DrUiMenuActionCheckboxItemProps, type DrUiMenuActionItemProps, type DrUiMenuCheckboxItemProps, type DrUiMenuContextProviderProps, type DrUiMenuContextType, type DrUiMenuGroupProps, type DrUiMenuItemProps, type DrUiMenuSubmenuProps, type DrUiMenuToolItemProps, type DrUiOverrideHelpers, type DrUiOverrides, type DrUiPeopleMenuAvatarProps, type DrUiPeopleMenuFacePileProps, type DrUiPeopleMenuItemProps, type DrUiPopoverContentProps, type DrUiPopoverProps, type DrUiPopoverTriggerProps, type DrUiQuickActionsProps, type DrUiRichTextToolbarProps, type DrUiSelectContentProps, type DrUiSelectItemProps, type DrUiSelectProps, type DrUiSelectTriggerProps, type DrUiSelectValueProps, type DrUiSliderProps, type DrUiStylePanelProps, type DrUiToast, type DrUiToastAction, type DrUiToastsContextType, type DrUiToastsProviderProps, type DrUiToolItem, type DrUiToolbarButtonProps, type DrUiToolbarProps, type DrUiToolbarToggleGroupProps, type DrUiToolbarToggleItemProps, type DrUiToolsContextType, type DrUiToolsProviderProps, type DrUiTranslation, type DrUiTranslationContextType, type DrUiTranslationKey, type DrUiTranslationProviderProps, type DrUiVideoToolbarProps, type DrUiZoomMenuProps, DrV1AlignStyle, type DrV1ArrowBinding, type DrV1ArrowShape, type DrV1Asset, DrV1AssetType, type DrV1BaseAsset, type DrV1BaseBinding, type DrV1BaseShape, type DrV1Binding, type DrV1Bounds, DrV1ColorStyle, DrV1DashStyle, DrV1Decoration, type DrV1Document, type DrV1DrawShape, type DrV1EllipseShape, DrV1FontStyle, type DrV1GroupShape, type DrV1Handle, type DrV1ImageAsset, type DrV1ImageShape, type DrV1Page, type DrV1PageState, type DrV1RectangleShape, type DrV1Shape, type DrV1ShapeStyles, DrV1ShapeType, DrV1SizeStyle, type DrV1StickyShape, type DrV1TextShape, type DrV1TriangleShape, type DrV1VideoAsset, type DrV1VideoShape, type DrZoomBrushOverlay, Draw, type DrawBaseProps, type DrawFile, type DrawFileParseError, DrawImage, type DrawImageProps, type DrawPathBuilderDOpts, type DrawPathBuilderOpts, type DrawProps, type DrawShapeOptions, DrawShapeTool, DrawShapeUtil, type DrawShapeUtilDisplayValues, DrawToolbarItem, DrawUi, DrawUiA11yProvider, DrawUiButton, DrawUiButtonCheck, DrawUiButtonIcon, DrawUiButtonLabel, DrawUiColumn, DrawUiComponentsProvider, DrawUiContextProvider, DrawUiContextualToolbar, DrawUiDialogBody, DrawUiDialogCloseButton, DrawUiDialogFooter, DrawUiDialogHeader, DrawUiDialogTitle, DrawUiDialogsProvider, DrawUiDropdownMenuCheckboxItem, DrawUiDropdownMenuContent, DrawUiDropdownMenuGroup, DrawUiDropdownMenuIndicator, DrawUiDropdownMenuItem, DrawUiDropdownMenuRoot, DrawUiDropdownMenuSub, DrawUiDropdownMenuSubContent, DrawUiDropdownMenuSubTrigger, DrawUiDropdownMenuTrigger, DrawUiEventsProvider, DrawUiGrid, DrawUiIcon, DrawUiInFrontOfTheCanvas, DrawUiInput, DrawUiKbd, DrawUiMenuActionCheckboxItem, DrawUiMenuActionItem, DrawUiMenuCheckboxItem, DrawUiMenuContextProvider, DrawUiMenuGroup, DrawUiMenuItem, DrawUiMenuSubmenu, DrawUiMenuToolItem, type DrawUiOrientationContext, DrawUiOrientationProvider, type DrawUiOrientationProviderProps, DrawUiPopover, DrawUiPopoverContent, DrawUiPopoverTrigger, type DrawUiProps, DrawUiRow, DrawUiSelect, DrawUiSelectContent, DrawUiSelectItem, DrawUiSelectTrigger, DrawUiSelectValue, DrawUiSlider, DrawUiToastsProvider, DrawUiToolbar, DrawUiToolbarButton, DrawUiToolbarToggleGroup, DrawUiToolbarToggleItem, DrawUiTooltip, type DrawUiTooltipProps, DrawUiTooltipProvider, type DrawUiTooltipProviderProps, DrawUiTranslationProvider, DuplicateMenuItem, EditLinkMenuItem, EditMenuSubmenu, EditSubmenu, type ElbowArrowBox, type ElbowArrowBoxEdges, type ElbowArrowBoxes, type ElbowArrowEdge, type ElbowArrowInfo, type ElbowArrowInfoWithoutRoute, type ElbowArrowMidpointHandle, type ElbowArrowOptions, type ElbowArrowRange, type ElbowArrowRoute, type ElbowArrowSide, type ElbowArrowSideReason, type ElbowArrowTargetBox, EllipseToolbarItem, type EmbedDefinition, type EmbedShapeOptions, EmbedShapeUtil, type EmbedShapeUtilDisplayValues, EraserTool, EraserToolbarItem, type EventsProviderProps, ExampleDialog, type ExampleDialogProps, type ExportAsOptions, ExportFileContentSubMenu, ExtrasGroup, FeatureFlags, type FeatureFlagsProps, FitFrameToContentMenuItem, type FrameShapeOptions, FrameShapeTool, FrameShapeUtil, type FrameShapeUtilDisplayValues, FrameToolbarItem, type GeoShapeOptions, GeoShapeTool, GeoShapeUtil, type GeoShapeUtilDisplayValues, type GeoTypeDefinition, GroupMenuItem, GroupOrUngroupMenuItem, HandTool, HandToolbarItem, HeartToolbarItem, HexagonToolbarItem, type HighlightShapeOptions, HighlightShapeTool, HighlightShapeUtil, type HighlightShapeUtilDisplayValues, HighlightToolbarItem, ImageAssetUtil, type ImageShapeOptions, ImageShapeUtil, type ImageShapeUtilDisplayValues, InputModeMenu, KeyboardShiftEnterTweakExtension, KeyboardShortcutsMenuItem, LanguageMenu, LaserTool, LaserToolbarItem, type LineShapeOptions, LineShapeTool, LineShapeUtil, type LineShapeUtilDisplayValues, type LineToPathBuilderCommand, LineToolbarItem, LockGroup, type MiroPasteInfo, MiscMenuGroup, MobileStylePanel, MoveToPageMenu, type MoveToPathBuilderCommand, type NonePathBuilderOpts, type NoteShapeOptions, NoteShapeTool, NoteShapeUtil, type NoteShapeUtilDisplayValues, NoteToolbarItem, OfflineIndicator, type OnDragFromToolbarToCreateShapesOpts, OvalToolbarItem, OverflowingToolbar, type OverflowingToolbarProps, PORTRAIT_BREAKPOINT, PageItemInput, type PageItemInputProps, PageItemSubmenu, type PageItemSubmenuProps, PasteMenuItem, PathBuilder, type PathBuilderCommand, type PathBuilderCommandBase, type PathBuilderCommandInfo, type PathBuilderCommandOpts, PathBuilderGeometry2d, type PathBuilderLineOpts, type PathBuilderOpts, type PathBuilderToDOpts, DefaultPeopleMenu as PeopleMenu, type DefaultPeopleMenuProps as PeopleMenuProps, PlainTextArea, PlainTextLabel, type PlainTextLabelProps, PreferencesGroup, PrintItem, RTL_LANGUAGES, RectangleToolbarItem, RemoveFrameMenuItem, ReorderMenuItems, ReorderMenuSubmenu, RhombusToolbarItem, RichTextArea, RichTextLabel, type RichTextLabelProps, RichTextSVG, type RichTextSVGProps, RotateCWMenuItem, STROKE_SIZES, ScribbleOverlayUtil, SelectAllMenuItem, SelectTool, SelectToolbarItem, SelectionForegroundOverlayUtil, ShapeHandleOverlayUtil, type ShapeOptionsWithDisplayValues, SnapIndicatorOverlayUtil, type SolidPathBuilderOpts, Spinner, StackMenuItems, StarToolbarItem, type StrokeOptions, type StrokePoint, StylePanelArrowKindPicker, StylePanelArrowheadPicker, StylePanelButtonPicker, StylePanelButtonPickerInline, type StylePanelButtonPickerProps, StylePanelColorPicker, type StylePanelContext, StylePanelContextProvider, type StylePanelContextProviderProps, StylePanelDashPicker, StylePanelDoubleDropdownPicker, StylePanelDoubleDropdownPickerInline, type StylePanelDoubleDropdownPickerProps, StylePanelDropdownPicker, StylePanelDropdownPickerInline, type StylePanelDropdownPickerProps, StylePanelFillPicker, StylePanelFontPicker, StylePanelGeoShapePicker, StylePanelLabelAlignPicker, StylePanelOpacityPicker, StylePanelSection, type StylePanelSectionProps, StylePanelSizePicker, StylePanelSplinePicker, StylePanelSubheading, type StylePanelSubheadingProps, StylePanelTextAlignPicker, type StyleValuesForUi, type TextAreaProps, type TextShapeOptions, TextShapeTool, TextShapeUtil, type TextShapeUtilDisplayValues, TextToolbarItem, ToggleAutoSizeMenuItem, ToggleDebugModeItem, ToggleDynamicSizeModeItem, ToggleEdgeScrollingItem, ToggleEnhancedA11yModeItem, ToggleFocusModeItem, ToggleGridItem, ToggleInvertZoomItem, ToggleKeyboardShortcutsItem, ToggleLockMenuItem, TogglePasteAtCursorItem, ToggleReduceMotionItem, ToggleSnapModeItem, ToggleToolLockItem, ToggleToolLockedButton, type ToggleToolLockedButtonProps, ToggleTransparentBgMenuItem, ToggleWrapModeItem, ToolbarItem, type ToolbarItemProps, TrapezoidToolbarItem, TriangleToolbarItem, UndoRedoGroup, UngroupMenuItem, UnlockAllMenuItem, type UpdateArrowTargetStateOpts, type UseImageOrVideoAssetOptions, VideoAssetUtil, type VideoShapeOptions, VideoShapeUtil, type VideoShapeUtilDisplayValues, ViewSubmenu, XBoxToolbarItem, ZoomBrushOverlayUtil, ZoomOrRotateMenuItem, ZoomTo100MenuItem, ZoomToFitMenuItem, ZoomToSelectionMenuItem, ZoomTool, allDefaultFontFaces, buildFromV1Document, centerSelectionAroundPoint, clearArrowTargetState, containBoxSize, copyAs, createBookmarkFromUrl, createEmptyBookmarkShape, createShapesForAssets, decodeMiroClipboardHtml, defaultAddFontsFromNode, defaultAssetUtils, defaultBindingUtils, defaultEditorAssetUrls, defaultGeoTypeDefinitions, defaultHandleExternalDrawContent, defaultHandleExternalEmbedContent, defaultHandleExternalExcalidrawContent, defaultHandleExternalFileAsset, defaultHandleExternalFileContent, defaultHandleExternalFileReplaceContent, defaultHandleExternalMiroContent, defaultHandleExternalSvgTextContent, defaultHandleExternalTextContent, defaultHandleExternalUrlAsset, defaultHandleExternalUrlContent, defaultOverlayUtils, defaultShapeTools, defaultShapeUtils, defaultTools, downloadFile, downsizeImage, embedShapePermissionDefaults, exportAs, extractMiroDataPayload, fitFrameToContent, getArrowBindings, getArrowInfo, getArrowTargetState, getArrowTerminalsInArrowSpace, getAssetInfo, getCollaboratorCursorScale, getColorStyleItems, getCropBox, getDefaultCrop, getDisplayValues, getEmbedInfo, getFontFamily, getFontStyleItems, getGeoTypeDefinition, getHitShapeOnCanvasPointerDown, getPointsFromDrawSegment, getPointsFromDrawSegments, getStroke, getStrokeOutlinePoints, getStrokePoints, getSvgPathFromStrokePoints, getUncroppedSize, handleNativeOrMenuCopy, hideAllTooltips, iconTypes, mergeCollaboratorCursorLayout, notifyIfFileNotAllowed, onDragFromToolbarToCreateShape, parseAndLoadDocument, parseDrawJsonFile, preloadFont, putExcalidrawContent, putMiroContent, registerDefaultExternalContentHandlers, registerDefaultSideEffects, removeFrame, renderHtmlFromRichText, renderHtmlFromRichTextForMeasurement, renderPlaintextFromRichText, renderRichTextFromHTML, sanitizeSvg, serializeDrawJson, serializeDrawJsonBlob, setDefaultEditorAssetUrls, setDefaultUiAssetUrls, setStrokePointRadii, startEditingShapeWithRichText, summarizeMiroClipboard, tipTapDefaultExtensions, truncateStringWithEllipsis, unknownEmbedShapePermissionOverrides, unwrapLabel, updateArrowTargetState, useA11y, useActions, useAssetUrls, useBreakpoint, useCanApplySelectionAction, useCanRedo, useCanUndo, useCollaborationStatus, useCopyAs, useCurrentTranslation, useDefaultHelpers, useDialogs, useDirection, useDrawUiComponents, useDrawUiOrientation, useEditablePlainText, useEditableRichText, useExportAs, useImageOrVideoAsset, useIsToolSelected, useKeyboardShortcuts, useLocalStorageState, useMenuClipboardEvents, useMenuIsOpen, useNativeClipboardEvents, usePrefersReducedMotion, useReadonly, useRelevantStyles, useSelectedShapesAnnouncer, useShowCollaborationUi, useStylePanelContext, useToasts, useTools, useTranslation, useUiEvents, useUnlockedSelectedShapesCount };
6033
+ /**
6034
+ * Put excalidraw clipboard content onto the current page.
6035
+ *
6036
+ * @param editor - The editor instance.
6037
+ * @param excalidrawClipboardContent - The excalidraw clipboard model.
6038
+ * @param point - The point at which to put the excalidraw content.
6039
+ * @public
6040
+ */
6041
+ declare function putExcalidrawContent(editor: Editor, excalidrawClipboardContent: any, point?: VecLike): Promise<void>;
6042
+
6043
+ /** @public */
6044
+ interface ExportAsOptions extends DrImageExportOptions {
6045
+ /** {@inheritdoc @ibodr/editor#DrImageExportOptions.format} */
6046
+ format: DrExportType;
6047
+ /** Name of the exported file. If undefined a predefined name, based on the selection, will be used. */
6048
+ name?: string;
6049
+ }
6050
+ /**
6051
+ * Export the given shapes as files.
6052
+ *
6053
+ * @param editor - The editor instance.
6054
+ * @param ids - The ids of the shapes to export.
6055
+ * @param opts - Options for the export.
6056
+ *
6057
+ * @public
6058
+ */
6059
+ declare function exportAs(editor: Editor, ids: DrShapeId[], opts: ExportAsOptions): Promise<void>;
6060
+ /** @internal */
6061
+ declare function downloadFile(file: File, doc?: Document): void;
6062
+
6063
+ /**
6064
+ * Remove a frame (or any frame-like container shape).
6065
+ *
6066
+ * @param editor - tldraw editor instance.
6067
+ * @param ids - Ids of the frames you wish to remove.
6068
+ *
6069
+ * @public
6070
+ */
6071
+ declare function removeFrame(editor: Editor, ids: DrShapeId[]): void;
6072
+ /**
6073
+ * Fit a frame (or any frame-like container shape) to its content.
6074
+ *
6075
+ * @param id - Id of the frame you wish to fit to content.
6076
+ * @param editor - tlraw editor instance.
6077
+ * @param opts - Options for fitting the frame.
6078
+ *
6079
+ * @public
6080
+ */
6081
+ declare function fitFrameToContent(editor: Editor, id: DrShapeId, opts?: {
6082
+ padding: number;
6083
+ }): void;
6084
+
6085
+ /*!
6086
+ * SVG/attribute allowlists and URI sanitization approach derived from DOMPurify.
6087
+ * DOMPurify — MIT License, Copyright (c) 2015 Mario Heiderich
6088
+ * https://github.com/cure53/DOMPurify/blob/main/LICENSE
6089
+ */
6090
+ /**
6091
+ * Sanitizes an SVG string by removing dangerous elements, attributes, and URIs
6092
+ * while preserving safe content including foreignObject (for text rendering),
6093
+ * style elements (for fonts with data: URLs), and animation elements.
6094
+ * Embedded SVG data URIs on `<image>`/`<feImage>` are recursively sanitized.
6095
+ *
6096
+ * Returns the sanitized SVG string, or an empty string if the input was
6097
+ * malformed (parse error) or contained no safe content after sanitization.
6098
+ *
6099
+ * @public
6100
+ */
6101
+ declare function sanitizeSvg(svgText: string): string;
6102
+
6103
+ /** @public */
6104
+ declare const KeyboardShiftEnterTweakExtension: Extension<any, any>;
6105
+ /**
6106
+ * Build tldraw's default TipTap extension set, optionally overriding the bundled `StarterKit`
6107
+ * options. The one lever most consumers want is turning individual nodes off (e.g. comments use a
6108
+ * headingless set via `getTipTapDefaultExtensions({ heading: false })`); because `StarterKit` is a
6109
+ * single umbrella extension, its sub-extensions can only be disabled through its config, not by
6110
+ * filtering the returned array.
6111
+ *
6112
+ * @public
6113
+ */
6114
+ declare function getTipTapDefaultExtensions(starterKitOptions?: Partial<StarterKitOptions>): Extensions;
6115
+ /**
6116
+ * Default extensions for the TipTap editor.
6117
+ *
6118
+ * @public
6119
+ */
6120
+ declare const tipTapDefaultExtensions: Extensions;
6121
+ /**
6122
+ * Renders HTML from a rich text string using an explicit set of TipTap extensions, rather than the
6123
+ * ones configured on an editor. Use this when rendering rich text outside of a shape's editor
6124
+ * config (e.g. comments, which render through their own headingless extension set).
6125
+ *
6126
+ * @param richText - The rich text content.
6127
+ * @param extensions - The TipTap extensions to render with.
6128
+ *
6129
+ * @public
6130
+ */
6131
+ declare function renderHtmlFromRichTextWithExtensions(richText: DrRichText, extensions: Extensions): string;
6132
+ /**
6133
+ * Renders HTML from a rich text string.
6134
+ *
6135
+ * @param editor - The editor instance.
6136
+ * @param richText - The rich text content.
6137
+ *
6138
+ * @public
6139
+ */
6140
+ declare function renderHtmlFromRichText(editor: Editor, richText: DrRichText): string;
6141
+ /**
6142
+ * Renders HTML from a rich text string for measurement.
6143
+ * @param editor - The editor instance.
6144
+ * @param richText - The rich text content.
6145
+ *
6146
+ * @public
6147
+ */
6148
+ declare function renderHtmlFromRichTextForMeasurement(editor: Editor, richText: DrRichText): string;
6149
+ /**
6150
+ * Renders plaintext from a rich text string.
6151
+ * @param editor - The editor instance.
6152
+ * @param richText - The rich text content.
6153
+ *
6154
+ * @public
6155
+ */
6156
+ declare function renderPlaintextFromRichText(editor: Editor, richText: DrRichText): string;
6157
+ /**
6158
+ * Renders JSONContent from html.
6159
+ * @param editor - The editor instance.
6160
+ * @param richText - The rich text content.
6161
+ *
6162
+ * @public
6163
+ */
6164
+ declare function renderRichTextFromHTML(editor: Editor, html: string): DrRichText;
6165
+ /** @public */
6166
+ declare function defaultAddFontsFromNode(node: Node, state: RichTextFontVisitorState, addFont: (font: DrFontFace) => void): RichTextFontVisitorState;
6167
+
6168
+ /** @public */
6169
+ declare function truncateStringWithEllipsis(str: string, maxLength: number): string;
6170
+
6171
+ interface TaskItemOptions {
6172
+ /**
6173
+ * A callback function that is called when the checkbox is clicked while the editor is in readonly mode.
6174
+ * @param node The prosemirror node of the task item
6175
+ * @param checked The new checked state
6176
+ * @returns boolean
6177
+ */
6178
+ onReadOnlyChecked?: (node: Node, checked: boolean) => boolean;
6179
+ /**
6180
+ * Controls whether the task items can be nested or not.
6181
+ * @default false
6182
+ * @example true
6183
+ */
6184
+ nested: boolean;
6185
+ /**
6186
+ * HTML attributes to add to the task item element.
6187
+ * @default {}
6188
+ * @example { class: 'foo' }
6189
+ */
6190
+ HTMLAttributes: Record<string, any>;
6191
+ /**
6192
+ * The node type for taskList nodes
6193
+ * @default 'taskList'
6194
+ * @example 'myCustomTaskList'
6195
+ */
6196
+ taskListTypeName: string;
6197
+ /**
6198
+ * Accessibility options for the task item.
6199
+ * @default {}
6200
+ * @example
6201
+ * ```js
6202
+ * {
6203
+ * checkboxLabel: (node) => `Task item: ${node.textContent || 'empty task item'}`
6204
+ * }
6205
+ */
6206
+ a11y?: {
6207
+ checkboxLabel?: (node: Node, checked: boolean) => string;
6208
+ };
6209
+ }
6210
+ /**
6211
+ * This extension allows you to create task items.
6212
+ * @see https://www.tiptap.dev/api/nodes/task-item
6213
+ */
6214
+ declare const TaskItem: Node$1<TaskItemOptions, any>;
6215
+
6216
+ interface TaskListOptions {
6217
+ /**
6218
+ * The node type name for a task item.
6219
+ * @default 'taskItem'
6220
+ * @example 'myCustomTaskItem'
6221
+ */
6222
+ itemTypeName: string;
6223
+ /**
6224
+ * The HTML attributes for a task list node.
6225
+ * @default {}
6226
+ * @example { class: 'foo' }
6227
+ */
6228
+ HTMLAttributes: Record<string, any>;
6229
+ }
6230
+ declare module '@tiptap/core' {
6231
+ interface Commands<ReturnType> {
6232
+ bulletList: {
6233
+ /**
6234
+ * Toggle a bullet list
6235
+ */
6236
+ toggleBulletList: () => ReturnType;
6237
+ };
6238
+ }
6239
+ }
6240
+ declare module '@tiptap/core' {
6241
+ interface Commands<ReturnType> {
6242
+ orderedList: {
6243
+ /**
6244
+ * Toggle an ordered list
6245
+ * @example editor.commands.toggleOrderedList()
6246
+ */
6247
+ toggleOrderedList: () => ReturnType;
6248
+ };
6249
+ }
6250
+ }
6251
+ declare module '@tiptap/core' {
6252
+ interface Commands<ReturnType> {
6253
+ taskList: {
6254
+ /**
6255
+ * Toggle a task list
6256
+ * @example editor.commands.toggleTaskList()
6257
+ */
6258
+ toggleTaskList: () => ReturnType;
6259
+ };
6260
+ }
6261
+ }
6262
+ /**
6263
+ * This extension allows you to create task lists.
6264
+ * @see https://www.tiptap.dev/api/nodes/task-list
6265
+ */
6266
+ declare const TaskList: Node$1<TaskListOptions, any>;
6267
+
6268
+ /**
6269
+ * The pairs the selection gets wrapped in, keyed by the character you type: with `hello` selected,
6270
+ * typing `(` gives `(hello)` and typing `¡` gives `¡hello!`.
6271
+ *
6272
+ * Either half of a pair wraps in the whole pair. `¡` and `¿` are out of reach on most keyboard
6273
+ * layouts, so typing the `!` or `?` that closes them has to work too.
6274
+ *
6275
+ * A straight quote wraps in the curly pair, because {@link https://tiptap.dev/docs/editor/extensions/functionality/typography | Typography}
6276
+ * turns a typed `"` into `“` or `”` anyway. Inside code or monospace text it wraps in straight
6277
+ * quotes. Pass your own `pairs` to {@link WrapSelectionExtension} to wrap in straight quotes
6278
+ * everywhere, or to add pairs of your own.
6279
+ *
6280
+ * @public
6281
+ */
6282
+ declare const defaultWrappingPairs: Record<string, readonly [string, string]>;
6283
+ /**
6284
+ * Options for {@link WrapSelectionExtension}.
6285
+ *
6286
+ * @public
6287
+ */
6288
+ interface WrapSelectionOptions {
6289
+ /**
6290
+ * The `[opening, closing]` pair to wrap the selection in, keyed by the character typed.
6291
+ * Defaults to {@link defaultWrappingPairs}.
6292
+ */
6293
+ pairs: Record<string, readonly [string, string]>;
6294
+ }
6295
+ /**
6296
+ * Wraps the selected text in a pair of matching characters instead of replacing it: select `hello`,
6297
+ * press `¡` or `!`, and you get `¡hello!`. See {@link defaultWrappingPairs} for the pairs, which
6298
+ * can be replaced or extended through the extension's `pairs` option.
6299
+ *
6300
+ * A backtick is the exception: it toggles the `code` mark on the selection instead, when the schema
6301
+ * has one.
6302
+ *
6303
+ * @public
6304
+ */
6305
+ declare const WrapSelectionExtension: Extension<WrapSelectionOptions, any>;
6306
+
6307
+ export { type A11yPriority, type A11yProviderProps, type ASPECT_RATIO_OPTION, ASPECT_RATIO_OPTIONS, ASPECT_RATIO_TO_VALUE, AccessibilityMenu, type ActionsProviderProps, type AlertSeverity, AlignMenuItems, ArrangeMenuSubmenu, ArrowBindingHintOverlayUtil, ArrowBindingUtil, ArrowDownToolbarItem, ArrowHintOverlayUtil, ArrowLeftToolbarItem, ArrowRightToolbarItem, type ArrowShapeOptions, ArrowShapeTool, ArrowShapeUtil, type ArrowShapeUtilDisplayValues, type ArrowTargetState, ArrowToolbarItem, ArrowUpToolbarItem, AssetToolbarItem, AssetUrlsProvider, type AssetUrlsProviderProps, type BasePathBuilderOpts, BookmarkAssetUtil, type BookmarkShapeOptions, BookmarkShapeUtil, type BookmarkShapeUtilDisplayValues, type BoxWidthHeight, BreakPointProvider, type BreakPointProviderProps, BrushOverlayUtil, type BrushOverlayUtilDisplayValues, type BrushOverlayUtilOptions, CenteredTopPanelContainer, type CenteredTopPanelContainerProps, CheckBoxToolbarItem, ClipboardMenuGroup, CloudToolbarItem, CollaboratorBrushOverlayUtil, CollaboratorCursorBadge, CollaboratorCursorOverlayUtil, CollaboratorCursorPointer, CollaboratorCursors, type CollaboratorCursorsProps, CollaboratorHintOverlayUtil, CollaboratorScribbleOverlayUtil, CollaboratorShapeIndicatorOverlayUtil, ColorSchemeMenu, CommentToolbarItem, DefaultContextMenu as ContextMenu, ConversionsMenuGroup, ConvertToBookmarkMenuItem, ConvertToEmbedMenuItem, CopyAsMenuGroup, type CopyAsOptions, CopyMenuItem, type CropBoxOptions, type CubicBezierToPathBuilderCommand, CursorChatItem, type CustomDebugFlags, type CustomEmbedDefinition, CutMenuItem, DEFAULT_COLLABORATOR_CURSOR_LAYOUT, DEFAULT_EMBED_DEFINITIONS, DEFAULT_MAX_ASSET_SIZE, DEFAULT_MAX_IMAGE_DIMENSION, DRAW_FILE_EXTENSION, type DashedPathBuilderOpts, DebugFlags, type DebugFlagsProps, DefaultA11yAnnouncer, DefaultActionsMenu, DefaultActionsMenuContent, DefaultCollaboratorCursor, DefaultContextMenu, DefaultContextMenuContent, DefaultDebugMenu, DefaultDebugMenuContent, DefaultDialogs, type DefaultEmbedConfig, type DefaultEmbedDefinitionType, DefaultFollowingIndicator, DefaultFontFaces, DefaultHelpMenu, DefaultHelpMenuContent, DefaultHelperButtons, DefaultHelperButtonsContent, DefaultImageToolbar, DefaultImageToolbarContent, type DefaultImageToolbarContentProps, DefaultKeyboardShortcutsDialog, DefaultKeyboardShortcutsDialogContent, DefaultMainMenu, DefaultMainMenuContent, DefaultMenuPanel, DefaultMinimap, DefaultNavigationPanel, DefaultNoteShapeAttribution, DefaultPageMenu, DefaultPeopleMenu, DefaultPeopleMenuAvatar, DefaultPeopleMenuContent, type DefaultPeopleMenuContentProps, DefaultPeopleMenuFacePile, DefaultPeopleMenuItem, type DefaultPeopleMenuProps, DefaultQuickActions, DefaultQuickActionsContent, DefaultRichTextToolbar, DefaultRichTextToolbarContent, type DefaultRichTextToolbarContentProps, DefaultSharePanel, DefaultStylePanel, DefaultStylePanelContent, DefaultToasts, DefaultToolbar, DefaultToolbarContent, type DefaultToolbarProps, DefaultUserPresenceEditor, DefaultVideoToolbar, DefaultVideoToolbarContent, type DefaultVideoToolbarContentProps, DefaultZoomMenu, DefaultZoomMenuContent, DeleteMenuItem, DiamondToolbarItem, DistributeMenuItems, type DrArcArrowInfo, type DrArcInfo, type DrArrowBindingHintOverlay, type DrArrowBindings, type DrArrowHintOverlay, type DrArrowInfo, type DrArrowPoint, type DrBrushOverlay, type DrCollaboratorBrushOverlay, type DrCollaboratorCursorOverlay, type DrCollaboratorCursorScaleOptions, type DrCollaboratorHintOverlay, type DrCollaboratorScribbleOverlay, type DrCollaboratorShapeIndicatorOverlay, type DrComponents, type DrCopyType, type DrDefaultExternalContentHandlerOpts, type DrDefaultFont, type DrDefaultFonts, type DrEditorAssetUrls, type DrElbowArrowInfo, type DrEmbedDefinition, type DrEmbedResult, type DrEmbedShapePermissions, type DrExternalContentProps, type DrNoteShapeAttributionComponent, type DrNoteShapeAttributionProps, type DrScribbleOverlay, type DrSelectionForegroundOverlay, type DrShapeHandleOverlay, type DrShapeIndicatorOverlay, type DrSnapIndicatorOverlay, type DrStraightArrowInfo, type DrTypeFace, type DrUiA11y, type DrUiA11yContextType, type DrUiActionItem, type DrUiActionsContextType, type DrUiActionsMenuProps, type DrUiAssetUrlOverrides, type DrUiAssetUrls, type DrUiButtonCheckProps, type DrUiButtonIconProps, type DrUiButtonLabelProps, type DrUiButtonProps, type DrUiComponents, type DrUiComponentsProviderProps, type DrUiContextMenuProps, type DrUiContextProviderProps, type DrUiContextualToolbarProps, type DrUiDebugMenuProps, type DrUiDialog, type DrUiDialogBodyProps, type DrUiDialogFooterProps, type DrUiDialogHeaderProps, type DrUiDialogProps, type DrUiDialogTitleProps, type DrUiDialogsContextType, type DrUiDialogsProviderProps, type DrUiDropdownMenuCheckboxItemProps, type DrUiDropdownMenuContentProps, type DrUiDropdownMenuGroupProps, type DrUiDropdownMenuItemProps, type DrUiDropdownMenuRootProps, type DrUiDropdownMenuSubContentProps, type DrUiDropdownMenuSubProps, type DrUiDropdownMenuSubTriggerProps, type DrUiDropdownMenuTriggerProps, type DrUiEventContextType, type DrUiEventData, type DrUiEventHandler, type DrUiEventMap, type DrUiEventSource, type DrUiHelpMenuProps, type DrUiHelperButtonsProps, type DrUiIconJsx, type DrUiIconProps, type DrUiIconType, type DrUiImageToolbarProps, type DrUiInputProps, type DrUiKbdProps, type DrUiKeyboardShortcutsDialogProps, type DrUiLayoutProps, type DrUiMainMenuProps, type DrUiMenuActionCheckboxItemProps, type DrUiMenuActionItemProps, type DrUiMenuCheckboxItemProps, type DrUiMenuContextProviderProps, type DrUiMenuContextType, type DrUiMenuGroupProps, type DrUiMenuItemProps, type DrUiMenuSubmenuProps, type DrUiMenuToolItemProps, type DrUiOverrideHelpers, type DrUiOverrides, type DrUiPeopleMenuAvatarProps, type DrUiPeopleMenuFacePileProps, type DrUiPeopleMenuItemProps, type DrUiPopoverContentProps, type DrUiPopoverProps, type DrUiPopoverTriggerProps, type DrUiQuickActionsProps, type DrUiRichTextToolbarProps, type DrUiSelectContentProps, type DrUiSelectItemProps, type DrUiSelectProps, type DrUiSelectTriggerProps, type DrUiSelectValueProps, type DrUiSliderProps, type DrUiStylePanelProps, type DrUiToast, type DrUiToastAction, type DrUiToastsContextType, type DrUiToastsProviderProps, type DrUiToolItem, type DrUiToolbarButtonProps, type DrUiToolbarProps, type DrUiToolbarToggleGroupProps, type DrUiToolbarToggleItemProps, type DrUiToolsContextType, type DrUiToolsProviderProps, type DrUiTranslation, type DrUiTranslationContextType, type DrUiTranslationKey, type DrUiTranslationProviderProps, type DrUiVideoToolbarProps, type DrUiZoomMenuProps, DrV1AlignStyle, type DrV1ArrowBinding, type DrV1ArrowShape, type DrV1Asset, DrV1AssetType, type DrV1BaseAsset, type DrV1BaseBinding, type DrV1BaseShape, type DrV1Binding, type DrV1Bounds, DrV1ColorStyle, DrV1DashStyle, DrV1Decoration, type DrV1Document, type DrV1DrawShape, type DrV1EllipseShape, DrV1FontStyle, type DrV1GroupShape, type DrV1Handle, type DrV1ImageAsset, type DrV1ImageShape, type DrV1Page, type DrV1PageState, type DrV1RectangleShape, type DrV1Shape, type DrV1ShapeStyles, DrV1ShapeType, DrV1SizeStyle, type DrV1StickyShape, type DrV1TextShape, type DrV1TriangleShape, type DrV1VideoAsset, type DrV1VideoShape, type DrZoomBrushOverlay, Draw, type DrawBaseProps, type DrawFile, type DrawFileParseError, DrawImage, type DrawImageProps, type DrawPathBuilderDOpts, type DrawPathBuilderOpts, type DrawProps, type DrawShapeOptions, DrawShapeTool, DrawShapeUtil, type DrawShapeUtilDisplayValues, DrawToolbarItem, DrawUi, DrawUiA11yProvider, DrawUiButton, DrawUiButtonCheck, DrawUiButtonIcon, DrawUiButtonLabel, DrawUiColumn, DrawUiComponentsProvider, DrawUiContextProvider, DrawUiContextualToolbar, DrawUiDialogBody, DrawUiDialogCloseButton, DrawUiDialogFooter, DrawUiDialogHeader, DrawUiDialogTitle, DrawUiDialogsProvider, DrawUiDropdownMenuCheckboxItem, DrawUiDropdownMenuContent, DrawUiDropdownMenuGroup, DrawUiDropdownMenuIndicator, DrawUiDropdownMenuItem, DrawUiDropdownMenuRoot, DrawUiDropdownMenuSub, DrawUiDropdownMenuSubContent, DrawUiDropdownMenuSubTrigger, DrawUiDropdownMenuTrigger, DrawUiEventsProvider, DrawUiGrid, DrawUiIcon, DrawUiInFrontOfTheCanvas, DrawUiInput, DrawUiKbd, DrawUiMenuActionCheckboxItem, DrawUiMenuActionItem, DrawUiMenuCheckboxItem, DrawUiMenuContextProvider, DrawUiMenuGroup, DrawUiMenuItem, DrawUiMenuSubmenu, DrawUiMenuToolItem, type DrawUiOrientationContext, DrawUiOrientationProvider, type DrawUiOrientationProviderProps, DrawUiPopover, DrawUiPopoverContent, DrawUiPopoverTrigger, type DrawUiProps, DrawUiRow, DrawUiSelect, DrawUiSelectContent, DrawUiSelectItem, DrawUiSelectTrigger, DrawUiSelectValue, DrawUiSlider, DrawUiToastsProvider, DrawUiToolbar, DrawUiToolbarButton, DrawUiToolbarToggleGroup, DrawUiToolbarToggleItem, DrawUiTooltip, type DrawUiTooltipProps, DrawUiTooltipProvider, type DrawUiTooltipProviderProps, DrawUiTranslationProvider, DuplicateMenuItem, EditLinkMenuItem, EditMenuSubmenu, EditSubmenu, type ElbowArrowBox, type ElbowArrowBoxEdges, type ElbowArrowBoxes, type ElbowArrowEdge, type ElbowArrowInfo, type ElbowArrowInfoWithoutRoute, type ElbowArrowMidpointHandle, type ElbowArrowOptions, type ElbowArrowRange, type ElbowArrowRoute, type ElbowArrowSide, type ElbowArrowSideReason, type ElbowArrowTargetBox, EllipseToolbarItem, type EmbedDefinition, type EmbedShapeOptions, EmbedShapeUtil, type EmbedShapeUtilDisplayValues, EraserTool, EraserToolbarItem, type EventsProviderProps, ExampleDialog, type ExampleDialogProps, ExportAsMenuGroup, type ExportAsOptions, ExportFileContentSubMenu, ExtrasGroup, FeatureFlags, type FeatureFlagsProps, FitFrameToContentMenuItem, type FrameShapeOptions, FrameShapeTool, FrameShapeUtil, type FrameShapeUtilDisplayValues, FrameToolbarItem, type GeoShapeOptions, GeoShapeTool, GeoShapeUtil, type GeoShapeUtilDisplayValues, type GeoTypeDefinition, type GoogleMapsEmbedConfig, GroupMenuItem, GroupOrUngroupMenuItem, HandTool, HandToolbarItem, HeartToolbarItem, HexagonToolbarItem, type HighlightShapeOptions, HighlightShapeTool, HighlightShapeUtil, type HighlightShapeUtilDisplayValues, HighlightToolbarItem, ImageAssetUtil, type ImageShapeOptions, ImageShapeUtil, type ImageShapeUtilDisplayValues, InputModeMenu, KeyboardShiftEnterTweakExtension, KeyboardShortcutsMenuItem, LanguageMenu, LaserTool, LaserToolbarItem, type LineShapeOptions, LineShapeTool, LineShapeUtil, type LineShapeUtilDisplayValues, type LineToPathBuilderCommand, LineToolbarItem, LockGroup, type MiroPasteInfo, MiscMenuGroup, MobileStylePanel, MoveToPageMenu, type MoveToPathBuilderCommand, type NonePathBuilderOpts, type NoteShapeOptions, NoteShapeTool, NoteShapeUtil, type NoteShapeUtilDisplayValues, NoteToolbarItem, OfflineIndicator, type OnDragFromToolbarToCreateShapesOpts, OvalToolbarItem, OverflowingToolbar, type OverflowingToolbarProps, PORTRAIT_BREAKPOINT, PageItemInput, type PageItemInputProps, PageItemSubmenu, type PageItemSubmenuProps, PasteMenuItem, PathBuilder, type PathBuilderCommand, type PathBuilderCommandBase, type PathBuilderCommandInfo, type PathBuilderCommandOpts, PathBuilderGeometry2d, type PathBuilderLineOpts, type PathBuilderOpts, type PathBuilderToDOpts, DefaultPeopleMenu as PeopleMenu, type DefaultPeopleMenuProps as PeopleMenuProps, PlainTextArea, PlainTextLabel, type PlainTextLabelProps, PreferencesGroup, PrintItem, RTL_LANGUAGES, RectangleToolbarItem, RemoveFrameMenuItem, ReorderMenuItems, ReorderMenuSubmenu, RhombusToolbarItem, RichTextArea, RichTextLabel, type RichTextLabelProps, RichTextSVG, type RichTextSVGProps, RotateCWMenuItem, STROKE_SIZES, ScribbleOverlayUtil, SelectAllMenuItem, SelectTool, SelectToolbarItem, SelectionForegroundOverlayUtil, ShapeHandleOverlayUtil, ShapeIndicatorOverlayUtil, type ShapeOptionsWithDisplayValues, SnapIndicatorOverlayUtil, type SolidPathBuilderOpts, Spinner, StackMenuItems, StarToolbarItem, type StrokeOptions, type StrokePoint, StylePanelArrowKindPicker, StylePanelArrowheadPicker, StylePanelButtonPicker, StylePanelButtonPickerInline, type StylePanelButtonPickerProps, StylePanelColorPicker, type StylePanelContext, StylePanelContextProvider, type StylePanelContextProviderProps, StylePanelDashPicker, StylePanelDoubleDropdownPicker, StylePanelDoubleDropdownPickerInline, type StylePanelDoubleDropdownPickerProps, StylePanelDropdownPicker, StylePanelDropdownPickerInline, type StylePanelDropdownPickerProps, StylePanelFillPicker, StylePanelFontPicker, StylePanelGeoShapePicker, StylePanelLabelAlignPicker, StylePanelOpacityPicker, StylePanelSection, type StylePanelSectionProps, StylePanelSizePicker, StylePanelSplinePicker, StylePanelSubheading, type StylePanelSubheadingProps, StylePanelTextAlignPicker, type StyleValuesForUi, TaskItem, type TaskItemOptions, TaskList, type TaskListOptions, type TextAreaProps, type TextShapeOptions, TextShapeTool, TextShapeUtil, type TextShapeUtilDisplayValues, TextToolbarItem, ToggleAutoSizeMenuItem, ToggleDebugModeItem, ToggleDynamicSizeModeItem, ToggleEdgeScrollingItem, ToggleEnhancedA11yModeItem, ToggleFocusModeItem, ToggleGridItem, ToggleInvertZoomItem, ToggleKeyboardShortcutsItem, ToggleLockMenuItem, TogglePasteAtCursorItem, ToggleReduceMotionItem, ToggleSnapModeItem, ToggleToolLockItem, ToggleToolLockedButton, type ToggleToolLockedButtonProps, ToggleTransparentBgMenuItem, ToggleWrapModeItem, ToolbarItem, type ToolbarItemProps, TrapezoidToolbarItem, TriangleToolbarItem, UndoRedoGroup, UngroupMenuItem, UnlockAllMenuItem, type UpdateArrowTargetStateOpts, type UseImageOrVideoAssetOptions, VideoAssetUtil, type VideoShapeOptions, VideoShapeUtil, type VideoShapeUtilDisplayValues, ViewSubmenu, WrapSelectionExtension, type WrapSelectionOptions, XBoxToolbarItem, ZoomBrushOverlayUtil, ZoomOrRotateMenuItem, ZoomTo100MenuItem, ZoomToFitMenuItem, ZoomToSelectionMenuItem, ZoomTool, allDefaultFontFaces, buildFromV1Document, centerSelectionAroundPoint, clearArrowTargetState, containBoxSize, copyAs, createBookmarkFromUrl, createEmptyBookmarkShape, createShapesForAssets, decodeMiroClipboardHtml, defaultAddFontsFromNode, defaultAssetUtils, defaultBindingUtils, defaultEditorAssetUrls, defaultGeoTypeDefinitions, defaultHandleExternalDrawContent, defaultHandleExternalEmbedContent, defaultHandleExternalExcalidrawContent, defaultHandleExternalFileAsset, defaultHandleExternalFileContent, defaultHandleExternalFileReplaceContent, defaultHandleExternalMiroContent, defaultHandleExternalSvgTextContent, defaultHandleExternalTextContent, defaultHandleExternalUrlAsset, defaultHandleExternalUrlContent, defaultOverlayUtils, defaultShapeTools, defaultShapeUtils, defaultTools, defaultWrappingPairs, downloadFile, downsizeImage, embedShapePermissionDefaults, exportAs, extractMiroDataPayload, fitFrameToContent, getArrowBindings, getArrowInfo, getArrowTargetState, getArrowTerminalsInArrowSpace, getAssetInfo, getCollaboratorCursorScale, getColorStyleItems, getCropBox, getDefaultCrop, getDisplayValues, getEmbedInfo, getFontFamily, getFontStyleItems, getGeoTypeDefinition, getHitShapeOnCanvasPointerDown, getPointsFromDrawSegment, getPointsFromDrawSegments, getStroke, getStrokeOutlinePoints, getStrokePoints, getSvgPathFromStrokePoints, getTipTapDefaultExtensions, getUncroppedSize, handleNativeOrMenuCopy, hideAllTooltips, iconTypes, mergeCollaboratorCursorLayout, notifyIfFileNotAllowed, onDragFromToolbarToCreateShape, parseAndLoadDocument, parseDrawJsonFile, preloadFont, putExcalidrawContent, putMiroContent, registerDefaultExternalContentHandlers, registerDefaultSideEffects, removeFrame, renderHtmlFromRichText, renderHtmlFromRichTextForMeasurement, renderHtmlFromRichTextWithExtensions, renderPlaintextFromRichText, renderRichTextFromHTML, sanitizeSvg, serializeDrawJson, serializeDrawJsonBlob, setDefaultEditorAssetUrls, setDefaultUiAssetUrls, startEditingShapeWithRichText, summarizeMiroClipboard, tipTapDefaultExtensions, truncateStringWithEllipsis, unknownEmbedShapePermissionOverrides, unwrapLabel, updateArrowTargetState, useA11y, useActions, useAssetUrls, useBreakpoint, useCanApplySelectionAction, useCanRedo, useCanUndo, useCollaborationStatus, useCopyAs, useCurrentTranslation, useDefaultHelpers, useDialogs, useDirection, useDrawUiComponents, useDrawUiOrientation, useEditablePlainText, useEditableRichText, useExportAs, useImageOrVideoAsset, useIsToolSelected, useKeyboardShortcuts, useLocalStorageState, useMaybeCurrentTranslation, useMenuClipboardEvents, useMenuIsOpen, useNativeClipboardEvents, usePrefersReducedMotion, useReadonly, useRelevantStyles, useSelectedShapesAnnouncer, useShowCollaborationUi, useStylePanelContext, useToasts, useTools, useTranslation, useUiEvents, useUnlockedSelectedShapesCount };