@ibodr/draw 0.2.6 → 0.2.9
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 +1741 -1327
- package/dist/index.mjs +8814 -7074
- package/dist/index.mjs.map +1 -1
- package/draw.css +147 -34
- package/package.json +7 -4
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,
|
|
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
|
|
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
|
-
*
|
|
638
|
+
* Like {@link useCurrentTranslation}, but returns `null` instead of throwing when used outside
|
|
639
|
+
* of a `<DrawUiTranslationProvider />` / `<DrawUiContextProvider />`.
|
|
625
640
|
*
|
|
626
|
-
* @
|
|
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
|
|
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
|
-
|
|
850
|
-
|
|
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
|
|
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
|
|
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():
|
|
866
|
-
render(ctx: CanvasRenderingContext2D, overlays:
|
|
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
|
|
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
|
|
930
|
+
* Overlay util for the zoom brush rectangle.
|
|
906
931
|
*
|
|
907
932
|
* @public
|
|
908
933
|
*/
|
|
909
|
-
declare class
|
|
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():
|
|
917
|
-
render(ctx: CanvasRenderingContext2D, overlays:
|
|
918
|
-
renderMinimap(ctx: CanvasRenderingContext2D, overlays:
|
|
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
|
-
/**
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
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
|
-
/**
|
|
1024
|
-
|
|
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
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
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
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
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
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
static
|
|
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;
|
|
@@ -2262,6 +2353,11 @@ declare class ArrowShapeUtil extends ShapeUtil<DrArrowShape> {
|
|
|
2262
2353
|
canBeLaidOut(shape: DrArrowShape, info: DrShapeUtilCanBeLaidOutOpts): boolean;
|
|
2263
2354
|
getFontFaces(shape: DrArrowShape): _ibodr_schema.DrFontFace[];
|
|
2264
2355
|
getDefaultProps(): DrArrowShape['props'];
|
|
2356
|
+
getLodStyle(shape: DrArrowShape): {
|
|
2357
|
+
fill: null;
|
|
2358
|
+
stroke: string;
|
|
2359
|
+
strokeWidth: number;
|
|
2360
|
+
};
|
|
2265
2361
|
getGeometry(shape: DrArrowShape): Group2d;
|
|
2266
2362
|
getHandles(shape: DrArrowShape): DrHandle[];
|
|
2267
2363
|
getText(shape: DrArrowShape): string;
|
|
@@ -2330,6 +2426,7 @@ declare class BookmarkShapeUtil extends BaseBoxShapeUtil<DrBookmarkShape> {
|
|
|
2330
2426
|
getText(shape: DrBookmarkShape): string;
|
|
2331
2427
|
getAriaDescriptor(shape: DrBookmarkShape): string | undefined;
|
|
2332
2428
|
getDefaultProps(): DrBookmarkShape['props'];
|
|
2429
|
+
getGeometry(shape: DrBookmarkShape): Rectangle2d;
|
|
2333
2430
|
component(shape: DrBookmarkShape): react_jsx_runtime.JSX.Element;
|
|
2334
2431
|
getIndicatorPath(shape: DrBookmarkShape): Path2D;
|
|
2335
2432
|
onBeforeCreate(next: DrBookmarkShape): {
|
|
@@ -2351,25 +2448,7 @@ declare class BookmarkShapeUtil extends BaseBoxShapeUtil<DrBookmarkShape> {
|
|
|
2351
2448
|
opacity: _ibodr_schema.DrOpacityType;
|
|
2352
2449
|
meta: _ibodr_utils.JsonObject;
|
|
2353
2450
|
};
|
|
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;
|
|
2451
|
+
onBeforeUpdate(prev: DrBookmarkShape, shape: DrBookmarkShape): DrBookmarkShape | undefined;
|
|
2373
2452
|
getInterpolatedProps(startShape: DrBookmarkShape, endShape: DrBookmarkShape, t: number): DrBookmarkShapeProps;
|
|
2374
2453
|
}
|
|
2375
2454
|
|
|
@@ -2398,6 +2477,11 @@ declare class DrawShapeUtil extends ShapeUtil<DrDrawShape> {
|
|
|
2398
2477
|
hideRotateHandle(shape: DrDrawShape): boolean;
|
|
2399
2478
|
hideSelectionBoundsFg(shape: DrDrawShape): boolean;
|
|
2400
2479
|
getDefaultProps(): DrDrawShape['props'];
|
|
2480
|
+
getLodStyle(shape: DrDrawShape): {
|
|
2481
|
+
fill: string | null;
|
|
2482
|
+
stroke: string;
|
|
2483
|
+
strokeWidth: number;
|
|
2484
|
+
} | null;
|
|
2401
2485
|
getGeometry(shape: DrDrawShape): Polyline2d | Circle2d;
|
|
2402
2486
|
component(shape: DrDrawShape): react_jsx_runtime.JSX.Element;
|
|
2403
2487
|
getIndicatorPath(shape: DrDrawShape): Path2D;
|
|
@@ -2424,9 +2508,10 @@ type DrEmbedResult = {
|
|
|
2424
2508
|
* return undefined.
|
|
2425
2509
|
*
|
|
2426
2510
|
* @param inputUrl - The URL to match
|
|
2511
|
+
* @param embedConfig - Optional per-embed config, keyed by embed type, passed to `toEmbedUrl`
|
|
2427
2512
|
* @public
|
|
2428
2513
|
*/
|
|
2429
|
-
declare function getEmbedInfo(definitions: readonly DrEmbedDefinition[], inputUrl: string): DrEmbedResult;
|
|
2514
|
+
declare function getEmbedInfo(definitions: readonly DrEmbedDefinition[], inputUrl: string, embedConfig?: Record<string, unknown>): DrEmbedResult;
|
|
2430
2515
|
|
|
2431
2516
|
/** @public */
|
|
2432
2517
|
interface EmbedShapeUtilDisplayValues {
|
|
@@ -2436,6 +2521,15 @@ interface EmbedShapeUtilDisplayValues {
|
|
|
2436
2521
|
interface EmbedShapeOptions extends ShapeOptionsWithDisplayValues<DrEmbedShape, EmbedShapeUtilDisplayValues> {
|
|
2437
2522
|
/** The embed definitions to use for this shape util. */
|
|
2438
2523
|
readonly embedDefinitions: readonly DrEmbedDefinition[];
|
|
2524
|
+
/**
|
|
2525
|
+
* Per-embed configuration, keyed by embed type. Passed to each definition's `toEmbedUrl` when
|
|
2526
|
+
* building its embed URL — for example, an API key for the default Google Maps embed:
|
|
2527
|
+
*
|
|
2528
|
+
* ```ts
|
|
2529
|
+
* EmbedShapeUtil.configure({ embedConfig: { google_maps: { apiKey: '...' } } })
|
|
2530
|
+
* ```
|
|
2531
|
+
*/
|
|
2532
|
+
readonly embedConfig?: DefaultEmbedConfig & Record<string, unknown>;
|
|
2439
2533
|
}
|
|
2440
2534
|
/** @public */
|
|
2441
2535
|
declare class EmbedShapeUtil extends BaseBoxShapeUtil<DrEmbedShape> {
|
|
@@ -2446,10 +2540,23 @@ declare class EmbedShapeUtil extends BaseBoxShapeUtil<DrEmbedShape> {
|
|
|
2446
2540
|
canEditWhileLocked(shape: DrEmbedShape): boolean;
|
|
2447
2541
|
private static legacyEmbedDefinitions;
|
|
2448
2542
|
/** @deprecated - Use `EmbedShapeUtil.configure({ embedDefinitions: [...] })` instead. */
|
|
2449
|
-
static setEmbedDefinitions(embedDefinitions: readonly
|
|
2543
|
+
static setEmbedDefinitions(embedDefinitions: readonly DrEmbedDefinition[]): void;
|
|
2450
2544
|
private getEmbedDefs;
|
|
2451
2545
|
getEmbedDefinitions(): readonly DrEmbedDefinition[];
|
|
2452
2546
|
getEmbedDefinition(url: string): DrEmbedResult;
|
|
2547
|
+
/**
|
|
2548
|
+
* Resolve the embed's true aspect ratio (for definitions with `sizeToContentAspectRatio`) and
|
|
2549
|
+
* correct the shape's size to match. The dimensions come from the URL's OpenGraph metadata via
|
|
2550
|
+
* the editor's url asset handler (the same "unfurl" path bookmarks use). The correction is
|
|
2551
|
+
* applied without adding to the undo history.
|
|
2552
|
+
*/
|
|
2553
|
+
resolveAspectRatio(shape: DrEmbedShape): Promise<void>;
|
|
2554
|
+
/**
|
|
2555
|
+
* Resolve the content's aspect ratio from the URL's OpenGraph metadata, fetched through the
|
|
2556
|
+
* editor's url asset handler (the "unfurl" service). Returns `undefined` if no usable dimensions
|
|
2557
|
+
* are available (e.g. no unfurl service is configured, or the page reports no image size).
|
|
2558
|
+
*/
|
|
2559
|
+
private getContentAspectRatio;
|
|
2453
2560
|
getText(shape: DrEmbedShape): string;
|
|
2454
2561
|
getAriaDescriptor(shape: DrEmbedShape): string | undefined;
|
|
2455
2562
|
hideSelectionBoundsFg(shape: DrEmbedShape): boolean;
|
|
@@ -2459,6 +2566,12 @@ declare class EmbedShapeUtil extends BaseBoxShapeUtil<DrEmbedShape> {
|
|
|
2459
2566
|
getDefaultProps(): DrEmbedShape['props'];
|
|
2460
2567
|
getGeometry(shape: DrEmbedShape): _ibodr_editor.Geometry2d;
|
|
2461
2568
|
isAspectRatioLocked(shape: DrEmbedShape): boolean;
|
|
2569
|
+
/**
|
|
2570
|
+
* The minimum width/height a resize of `shape` is allowed to reach. When the embed's aspect ratio
|
|
2571
|
+
* is locked, the longer axis's minimum is inflated by the current aspect ratio so that shrinking
|
|
2572
|
+
* to the floor keeps the shorter axis at or above the base minimum.
|
|
2573
|
+
*/
|
|
2574
|
+
private getResizeMinBounds;
|
|
2462
2575
|
onResize(shape: DrEmbedShape, info: DrResizeInfo<DrEmbedShape>): DrEmbedShape;
|
|
2463
2576
|
component(shape: DrEmbedShape): react_jsx_runtime.JSX.Element | null;
|
|
2464
2577
|
getIndicatorPath(shape: DrEmbedShape): Path2D;
|
|
@@ -2504,6 +2617,11 @@ declare class FrameShapeUtil extends BaseFrameLikeShapeUtil<DrFrameShape> {
|
|
|
2504
2617
|
isExportBoundsContainer(): boolean;
|
|
2505
2618
|
getDefaultProps(): DrFrameShape['props'];
|
|
2506
2619
|
getAriaDescriptor(shape: DrFrameShape): string;
|
|
2620
|
+
getLodStyle(shape: DrFrameShape): {
|
|
2621
|
+
fill: string;
|
|
2622
|
+
stroke: string;
|
|
2623
|
+
strokeWidth: number;
|
|
2624
|
+
};
|
|
2507
2625
|
getGeometry(shape: DrFrameShape): Geometry2d;
|
|
2508
2626
|
getText(shape: DrFrameShape): string | undefined;
|
|
2509
2627
|
component(shape: DrFrameShape): react_jsx_runtime.JSX.Element;
|
|
@@ -2513,6 +2631,8 @@ declare class FrameShapeUtil extends BaseFrameLikeShapeUtil<DrFrameShape> {
|
|
|
2513
2631
|
onDoubleClickEdge(shape: DrFrameShape, info: DrClickEventInfo): {
|
|
2514
2632
|
id: _ibodr_schema.DrShapeId;
|
|
2515
2633
|
type: "frame";
|
|
2634
|
+
x: number;
|
|
2635
|
+
y: number;
|
|
2516
2636
|
props: {
|
|
2517
2637
|
w: number;
|
|
2518
2638
|
h: number;
|
|
@@ -2528,7 +2648,7 @@ declare class FrameShapeUtil extends BaseFrameLikeShapeUtil<DrFrameShape> {
|
|
|
2528
2648
|
* Defines the behavior for a geo shape type. Every built-in geo type is
|
|
2529
2649
|
* registered through this same interface (see {@link defaultGeoTypeDefinitions}),
|
|
2530
2650
|
* and consumers can register additional types via
|
|
2531
|
-
* {@link @ibodr/
|
|
2651
|
+
* {@link @ibodr/draw#GeoShapeUtil.configure | GeoShapeUtil.configure()}.
|
|
2532
2652
|
*
|
|
2533
2653
|
* @public
|
|
2534
2654
|
*/
|
|
@@ -2564,7 +2684,7 @@ interface GeoTypeDefinition {
|
|
|
2564
2684
|
* geo type (rectangle, ellipse, cloud, etc.) is registered here. The same
|
|
2565
2685
|
* registry powers path generation, handle snapping, the style panel picker,
|
|
2566
2686
|
* and creation defaults — so custom types added through
|
|
2567
|
-
* {@link @ibodr/
|
|
2687
|
+
* {@link @ibodr/draw#GeoShapeUtil.configure | GeoShapeUtil.configure()} get
|
|
2568
2688
|
* the same treatment as the built-ins.
|
|
2569
2689
|
*
|
|
2570
2690
|
* The key order here defines the visual order of items in the geo style panel
|
|
@@ -2747,6 +2867,11 @@ declare class GeoShapeUtil extends BaseBoxShapeUtil<DrGeoShape> {
|
|
|
2747
2867
|
options: GeoShapeOptions;
|
|
2748
2868
|
canEdit(shape: DrGeoShape): boolean;
|
|
2749
2869
|
getDefaultProps(): DrGeoShape['props'];
|
|
2870
|
+
getLodStyle(shape: DrGeoShape): {
|
|
2871
|
+
fill: string | null;
|
|
2872
|
+
stroke: string;
|
|
2873
|
+
strokeWidth: number;
|
|
2874
|
+
};
|
|
2750
2875
|
getGeometry(shape: DrGeoShape): Group2d;
|
|
2751
2876
|
getHandleSnapGeometry(shape: DrGeoShape): HandleSnapGeometry;
|
|
2752
2877
|
getText(shape: DrGeoShape): string;
|
|
@@ -2935,6 +3060,12 @@ declare class HighlightShapeUtil extends ShapeUtil<DrHighlightShape> {
|
|
|
2935
3060
|
hideRotateHandle(shape: DrHighlightShape): boolean;
|
|
2936
3061
|
hideSelectionBoundsFg(shape: DrHighlightShape): boolean;
|
|
2937
3062
|
getDefaultProps(): DrHighlightShape['props'];
|
|
3063
|
+
getLodStyle(shape: DrHighlightShape): {
|
|
3064
|
+
fill: null;
|
|
3065
|
+
stroke: string;
|
|
3066
|
+
strokeWidth: number;
|
|
3067
|
+
opacity: number;
|
|
3068
|
+
} | null;
|
|
2938
3069
|
getGeometry(shape: DrHighlightShape): Polygon2d | Circle2d;
|
|
2939
3070
|
component(shape: DrHighlightShape): react_jsx_runtime.JSX.Element;
|
|
2940
3071
|
backgroundComponent(shape: DrHighlightShape): react_jsx_runtime.JSX.Element;
|
|
@@ -2966,6 +3097,12 @@ declare class ImageShapeUtil extends BaseBoxShapeUtil<DrImageShape> {
|
|
|
2966
3097
|
isAspectRatioLocked(shape: DrImageShape): boolean;
|
|
2967
3098
|
canCrop(shape: DrImageShape): boolean;
|
|
2968
3099
|
isExportBoundsContainer(): boolean;
|
|
3100
|
+
getLodStyle(_shape: DrImageShape): {
|
|
3101
|
+
fill: null;
|
|
3102
|
+
stroke: null;
|
|
3103
|
+
strokeWidth: number;
|
|
3104
|
+
unmountWhenCulled: boolean;
|
|
3105
|
+
};
|
|
2969
3106
|
getDefaultProps(): DrImageShape['props'];
|
|
2970
3107
|
createShapeForAsset(asset: DrAsset, position: VecModel): DrShapePartial | null;
|
|
2971
3108
|
getGeometry(shape: DrImageShape): Geometry2d;
|
|
@@ -2998,6 +3135,11 @@ declare class LineShapeUtil extends ShapeUtil<DrLineShape> {
|
|
|
2998
3135
|
hideSelectionBoundsBg(shape: DrLineShape): boolean;
|
|
2999
3136
|
hideInMinimap(): boolean;
|
|
3000
3137
|
getDefaultProps(): DrLineShape['props'];
|
|
3138
|
+
getLodStyle(shape: DrLineShape): {
|
|
3139
|
+
fill: null;
|
|
3140
|
+
stroke: string;
|
|
3141
|
+
strokeWidth: number;
|
|
3142
|
+
};
|
|
3001
3143
|
getGeometry(shape: DrLineShape): PathBuilderGeometry2d;
|
|
3002
3144
|
getHandles(shape: DrLineShape): DrHandle[];
|
|
3003
3145
|
onResize(shape: DrLineShape, info: DrResizeInfo<DrLineShape>): {
|
|
@@ -3077,8 +3219,50 @@ declare class LineShapeUtil extends ShapeUtil<DrLineShape> {
|
|
|
3077
3219
|
}
|
|
3078
3220
|
|
|
3079
3221
|
/** @public */
|
|
3080
|
-
interface
|
|
3081
|
-
|
|
3222
|
+
interface DrNoteShapeAttributionProps {
|
|
3223
|
+
/** The note shape the attribution belongs to. */
|
|
3224
|
+
shape: DrNoteShape;
|
|
3225
|
+
/** The full display name of the user who last edited the note's text. */
|
|
3226
|
+
name: string;
|
|
3227
|
+
/** The first name (the part shown in the badge). */
|
|
3228
|
+
firstName: string;
|
|
3229
|
+
/** The label color to use for the badge. */
|
|
3230
|
+
color: string;
|
|
3231
|
+
/** The note's scale. Only meaningful for the `'canvas'` variant. */
|
|
3232
|
+
scale: number;
|
|
3233
|
+
/**
|
|
3234
|
+
* Where the attribution is being rendered. The `'canvas'` variant renders the interactive badge
|
|
3235
|
+
* (with a tooltip); the `'export'` variant renders static markup suitable for an SVG/PNG export.
|
|
3236
|
+
*/
|
|
3237
|
+
variant: 'canvas' | 'export';
|
|
3238
|
+
}
|
|
3239
|
+
/**
|
|
3240
|
+
* The default attribution badge shown in the corner of a note shape — the display name of the user
|
|
3241
|
+
* who last edited the note's text.
|
|
3242
|
+
*
|
|
3243
|
+
* Override it (or hide it) with the note shape util's `AttributionComponent` option:
|
|
3244
|
+
*
|
|
3245
|
+
* ```tsx
|
|
3246
|
+
* // hide the attribution badge
|
|
3247
|
+
* <Draw shapeUtils={[NoteShapeUtil.configure({ AttributionComponent: null })]} />
|
|
3248
|
+
*
|
|
3249
|
+
* // render your own
|
|
3250
|
+
* <Draw shapeUtils={[NoteShapeUtil.configure({ AttributionComponent: (props) => <MyBadge {...props} /> })]} />
|
|
3251
|
+
* ```
|
|
3252
|
+
*
|
|
3253
|
+
* @public @react
|
|
3254
|
+
*/
|
|
3255
|
+
declare function DefaultNoteShapeAttribution({ name, firstName, color, scale, variant, }: DrNoteShapeAttributionProps): react_jsx_runtime.JSX.Element;
|
|
3256
|
+
/**
|
|
3257
|
+
* The component used to render a note shape's attribution badge, or `null` to hide it.
|
|
3258
|
+
*
|
|
3259
|
+
* @public
|
|
3260
|
+
*/
|
|
3261
|
+
type DrNoteShapeAttributionComponent = ComponentType<DrNoteShapeAttributionProps> | null;
|
|
3262
|
+
|
|
3263
|
+
/** @public */
|
|
3264
|
+
interface NoteShapeUtilDisplayValues {
|
|
3265
|
+
noteWidth: number;
|
|
3082
3266
|
noteHeight: number;
|
|
3083
3267
|
noteBackgroundColor: string;
|
|
3084
3268
|
borderColor: string;
|
|
@@ -3101,6 +3285,22 @@ interface NoteShapeOptions extends ShapeOptionsWithDisplayValues<DrNoteShape, No
|
|
|
3101
3285
|
* but you can set it to be user-resizable using scale.
|
|
3102
3286
|
*/
|
|
3103
3287
|
resizeMode: 'none' | 'scale';
|
|
3288
|
+
/**
|
|
3289
|
+
* The component used to render the note's "last edited by" attribution badge, both on the canvas
|
|
3290
|
+
* and in image exports. Defaults to {@link DefaultNoteShapeAttribution}. Set it to `null` to hide
|
|
3291
|
+
* the badge, or provide your own component (receiving {@link DrNoteShapeAttributionProps}) to
|
|
3292
|
+
* replace it.
|
|
3293
|
+
*
|
|
3294
|
+
* @example
|
|
3295
|
+
* ```tsx
|
|
3296
|
+
* // hide the badge
|
|
3297
|
+
* NoteShapeUtil.configure({ AttributionComponent: null })
|
|
3298
|
+
*
|
|
3299
|
+
* // render your own
|
|
3300
|
+
* NoteShapeUtil.configure({ AttributionComponent: (props) => <MyBadge {...props} /> })
|
|
3301
|
+
* ```
|
|
3302
|
+
*/
|
|
3303
|
+
AttributionComponent: DrNoteShapeAttributionComponent;
|
|
3104
3304
|
}
|
|
3105
3305
|
/** @public */
|
|
3106
3306
|
declare class NoteShapeUtil extends ShapeUtil<DrNoteShape> {
|
|
@@ -3113,6 +3313,11 @@ declare class NoteShapeUtil extends ShapeUtil<DrNoteShape> {
|
|
|
3113
3313
|
isAspectRatioLocked(shape: DrNoteShape): boolean;
|
|
3114
3314
|
hideSelectionBoundsFg(shape: DrNoteShape): boolean;
|
|
3115
3315
|
getDefaultProps(): DrNoteShape['props'];
|
|
3316
|
+
getLodStyle(shape: DrNoteShape): {
|
|
3317
|
+
fill: string;
|
|
3318
|
+
stroke: null;
|
|
3319
|
+
strokeWidth: number;
|
|
3320
|
+
};
|
|
3116
3321
|
getGeometry(shape: DrNoteShape): Group2d;
|
|
3117
3322
|
getHandles(shape: DrNoteShape): DrHandle[];
|
|
3118
3323
|
onResize(shape: any, info: DrResizeInfo<any>): {
|
|
@@ -3141,7 +3346,7 @@ declare class NoteShapeUtil extends ShapeUtil<DrNoteShape> {
|
|
|
3141
3346
|
url: string;
|
|
3142
3347
|
richText: _ibodr_schema.DrRichText;
|
|
3143
3348
|
scale: number;
|
|
3144
|
-
|
|
3349
|
+
textLastEditedBy: string | null;
|
|
3145
3350
|
};
|
|
3146
3351
|
id: DrShapeId;
|
|
3147
3352
|
typeName: "shape";
|
|
@@ -3155,6 +3360,7 @@ declare class NoteShapeUtil extends ShapeUtil<DrNoteShape> {
|
|
|
3155
3360
|
opacity: _ibodr_schema.DrOpacityType;
|
|
3156
3361
|
meta: _ibodr_utils.JsonObject;
|
|
3157
3362
|
} | undefined;
|
|
3363
|
+
onBeforeDuplicate(_source: DrNoteShape, duplicate: DrNoteShape): DrNoteShape | undefined;
|
|
3158
3364
|
onBeforeUpdate(prev: DrNoteShape, next: DrNoteShape): DrNoteShape | undefined;
|
|
3159
3365
|
getInterpolatedProps(startShape: DrNoteShape, endShape: DrNoteShape, t: number): DrNoteShapeProps;
|
|
3160
3366
|
/**
|
|
@@ -3202,6 +3408,12 @@ declare class TextShapeUtil extends ShapeUtil<DrTextShape> {
|
|
|
3202
3408
|
width: number;
|
|
3203
3409
|
height: number;
|
|
3204
3410
|
};
|
|
3411
|
+
getLodStyle(shape: DrTextShape): {
|
|
3412
|
+
fill: null;
|
|
3413
|
+
stroke: string;
|
|
3414
|
+
strokeWidth: number;
|
|
3415
|
+
opacity: number;
|
|
3416
|
+
};
|
|
3205
3417
|
getGeometry(shape: DrTextShape, opts: DrGeometryOpts): Rectangle2d;
|
|
3206
3418
|
getFontFaces(shape: DrTextShape): _ibodr_schema.DrFontFace[];
|
|
3207
3419
|
getText(shape: DrTextShape): string;
|
|
@@ -3310,8 +3522,6 @@ declare class HandTool extends StateNode {
|
|
|
3310
3522
|
static isLockable: boolean;
|
|
3311
3523
|
static children(): DrStateNodeConstructor[];
|
|
3312
3524
|
onDoubleClick(info: DrClickEventInfo): void;
|
|
3313
|
-
onTripleClick(info: DrClickEventInfo): void;
|
|
3314
|
-
onQuadrupleClick(info: DrClickEventInfo): void;
|
|
3315
3525
|
}
|
|
3316
3526
|
|
|
3317
3527
|
/** @public */
|
|
@@ -3365,597 +3575,167 @@ declare class ZoomTool extends StateNode {
|
|
|
3365
3575
|
/** @public */
|
|
3366
3576
|
declare const defaultTools: readonly [typeof EraserTool, typeof HandTool, typeof LaserTool, typeof ZoomTool, typeof SelectTool];
|
|
3367
3577
|
|
|
3368
|
-
/**
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
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
|
-
};
|
|
3578
|
+
/** @public */
|
|
3579
|
+
interface DrEditorAssetUrls {
|
|
3580
|
+
fonts?: {
|
|
3581
|
+
draw_mono?: string;
|
|
3582
|
+
draw_mono_italic?: string;
|
|
3583
|
+
draw_mono_bold?: string;
|
|
3584
|
+
draw_mono_italic_bold?: string;
|
|
3585
|
+
draw_serif?: string;
|
|
3586
|
+
draw_serif_italic?: string;
|
|
3587
|
+
draw_serif_bold?: string;
|
|
3588
|
+
draw_serif_italic_bold?: string;
|
|
3589
|
+
draw_sans?: string;
|
|
3590
|
+
draw_sans_italic?: string;
|
|
3591
|
+
draw_sans_bold?: string;
|
|
3592
|
+
draw_sans_italic_bold?: string;
|
|
3593
|
+
draw_draw?: string;
|
|
3594
|
+
draw_draw_italic?: string;
|
|
3595
|
+
draw_draw_bold?: string;
|
|
3596
|
+
draw_draw_italic_bold?: string;
|
|
3597
|
+
[key: string]: string | undefined;
|
|
3409
3598
|
};
|
|
3410
|
-
isExact: boolean;
|
|
3411
|
-
isPrecise: boolean;
|
|
3412
|
-
centerInPageSpace: VecLike;
|
|
3413
|
-
anchorInPageSpace: VecLike;
|
|
3414
|
-
snap: ElbowArrowSnap;
|
|
3415
|
-
normalizedAnchor: VecLike;
|
|
3416
3599
|
}
|
|
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
3600
|
/** @public */
|
|
3440
|
-
declare
|
|
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>>;
|
|
3601
|
+
declare let defaultEditorAssetUrls: DrEditorAssetUrls;
|
|
3602
|
+
/** @internal */
|
|
3603
|
+
declare function setDefaultEditorAssetUrls(assetUrls: DrEditorAssetUrls): void;
|
|
3455
3604
|
|
|
3456
3605
|
/** @public */
|
|
3457
|
-
interface
|
|
3458
|
-
|
|
3459
|
-
|
|
3606
|
+
interface DrUiAssetUrls extends DrEditorAssetUrls {
|
|
3607
|
+
icons: Record<DrUiIconType | Exclude<string, DrUiIconType>, string>;
|
|
3608
|
+
translations: Record<string, string>;
|
|
3609
|
+
embedIcons: Partial<Record<(typeof DEFAULT_EMBED_DEFINITIONS)[number]['type'], string>>;
|
|
3460
3610
|
}
|
|
3461
3611
|
/** @public */
|
|
3462
|
-
|
|
3463
|
-
/** @
|
|
3464
|
-
|
|
3612
|
+
type DrUiAssetUrlOverrides = RecursivePartial<DrUiAssetUrls>;
|
|
3613
|
+
/** @internal */
|
|
3614
|
+
declare function setDefaultUiAssetUrls(urls: DrUiAssetUrls): void;
|
|
3615
|
+
|
|
3465
3616
|
/** @public */
|
|
3466
|
-
|
|
3617
|
+
interface DrUiActionsMenuProps {
|
|
3618
|
+
children?: ReactNode;
|
|
3619
|
+
}
|
|
3620
|
+
/** @public @react */
|
|
3621
|
+
declare const DefaultActionsMenu: React$1.NamedExoticComponent<DrUiActionsMenuProps>;
|
|
3622
|
+
|
|
3467
3623
|
/** @public */
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
w: number;
|
|
3476
|
-
h: number;
|
|
3477
|
-
}, crop: DrShapeCrop | null): {
|
|
3478
|
-
w: number;
|
|
3479
|
-
h: number;
|
|
3480
|
-
};
|
|
3624
|
+
interface DrUiContextMenuProps {
|
|
3625
|
+
children?: ReactNode;
|
|
3626
|
+
disabled?: boolean;
|
|
3627
|
+
}
|
|
3628
|
+
/** @public @react */
|
|
3629
|
+
declare const DefaultContextMenu: React$1.NamedExoticComponent<DrUiContextMenuProps>;
|
|
3630
|
+
|
|
3481
3631
|
/** @public */
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
props: ShapeWithCrop['props'];
|
|
3488
|
-
} | undefined;
|
|
3632
|
+
interface DrUiHelperButtonsProps {
|
|
3633
|
+
children?: ReactNode;
|
|
3634
|
+
}
|
|
3635
|
+
/** @public @react */
|
|
3636
|
+
declare function DefaultHelperButtons({ children }: DrUiHelperButtonsProps): react_jsx_runtime.JSX.Element;
|
|
3489
3637
|
|
|
3490
|
-
/** @internal */
|
|
3491
|
-
declare const STROKE_SIZES: Record<DrDefaultSizeStyle, number>;
|
|
3492
3638
|
/** @public */
|
|
3493
|
-
|
|
3639
|
+
interface DrUiHelpMenuProps {
|
|
3640
|
+
children?: ReactNode;
|
|
3641
|
+
}
|
|
3642
|
+
/** @public @react */
|
|
3643
|
+
declare const DefaultHelpMenu: React$1.NamedExoticComponent<DrUiHelpMenuProps>;
|
|
3494
3644
|
|
|
3495
3645
|
/** @public */
|
|
3496
|
-
interface
|
|
3497
|
-
|
|
3498
|
-
normal: DrFontFace;
|
|
3499
|
-
bold: DrFontFace;
|
|
3500
|
-
};
|
|
3501
|
-
italic: {
|
|
3502
|
-
normal: DrFontFace;
|
|
3503
|
-
bold: DrFontFace;
|
|
3504
|
-
};
|
|
3646
|
+
interface DrUiDialogProps {
|
|
3647
|
+
onClose(): void;
|
|
3505
3648
|
}
|
|
3506
3649
|
/** @public */
|
|
3507
|
-
interface
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3650
|
+
interface DrUiDialog {
|
|
3651
|
+
id: string;
|
|
3652
|
+
onClose?(): void;
|
|
3653
|
+
component: ComponentType<DrUiDialogProps>;
|
|
3654
|
+
preventBackgroundClose?: boolean;
|
|
3512
3655
|
}
|
|
3513
3656
|
/** @public */
|
|
3514
|
-
|
|
3657
|
+
interface DrUiDialogsContextType {
|
|
3658
|
+
addDialog(dialog: Omit<DrUiDialog, 'id'> & {
|
|
3659
|
+
id?: string;
|
|
3660
|
+
}): string;
|
|
3661
|
+
removeDialog(id: string): string;
|
|
3662
|
+
clearDialogs(): void;
|
|
3663
|
+
dialogs: Atom<DrUiDialog[]>;
|
|
3664
|
+
}
|
|
3515
3665
|
/** @public */
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
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[];
|
|
3666
|
+
interface DrUiDialogsProviderProps {
|
|
3667
|
+
context?: string;
|
|
3668
|
+
overrides?(editor: Editor): DrUiDialogsContextType;
|
|
3669
|
+
children: ReactNode;
|
|
3670
|
+
}
|
|
3671
|
+
/** @public @react */
|
|
3672
|
+
declare function DrawUiDialogsProvider({ context, children }: DrUiDialogsProviderProps): react_jsx_runtime.JSX.Element;
|
|
3673
|
+
/** @public */
|
|
3674
|
+
declare function useDialogs(): DrUiDialogsContextType;
|
|
3553
3675
|
|
|
3554
3676
|
/** @public */
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
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;
|
|
3677
|
+
type DrUiKeyboardShortcutsDialogProps = DrUiDialogProps & {
|
|
3678
|
+
children?: ReactNode;
|
|
3679
|
+
};
|
|
3680
|
+
/** @public @react */
|
|
3681
|
+
declare const DefaultKeyboardShortcutsDialog: React$1.NamedExoticComponent<DrUiKeyboardShortcutsDialogProps>;
|
|
3566
3682
|
|
|
3567
3683
|
/** @public */
|
|
3568
|
-
interface
|
|
3569
|
-
|
|
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;
|
|
3684
|
+
interface DrUiMainMenuProps {
|
|
3685
|
+
children?: ReactNode;
|
|
3590
3686
|
}
|
|
3591
|
-
/**
|
|
3592
|
-
|
|
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>;
|
|
3687
|
+
/** @public @react */
|
|
3688
|
+
declare const DefaultMainMenu: React$1.NamedExoticComponent<DrUiMainMenuProps>;
|
|
3599
3689
|
|
|
3600
3690
|
/** @public */
|
|
3601
|
-
interface
|
|
3602
|
-
|
|
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;
|
|
3691
|
+
interface DrUiQuickActionsProps {
|
|
3692
|
+
children?: ReactNode;
|
|
3626
3693
|
}
|
|
3627
|
-
/**
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
* supports rich text editing.
|
|
3631
|
-
*
|
|
3632
|
-
* @public @react
|
|
3633
|
-
*/
|
|
3634
|
-
declare const RichTextLabel: React__default.NamedExoticComponent<RichTextLabelProps>;
|
|
3694
|
+
/** @public @react */
|
|
3695
|
+
declare const DefaultQuickActions: React$1.NamedExoticComponent<DrUiQuickActionsProps>;
|
|
3696
|
+
|
|
3635
3697
|
/** @public */
|
|
3636
|
-
interface
|
|
3637
|
-
|
|
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;
|
|
3698
|
+
interface DrUiPeopleMenuAvatarProps {
|
|
3699
|
+
userId: DrUserId;
|
|
3648
3700
|
}
|
|
3649
|
-
/**
|
|
3650
|
-
|
|
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;
|
|
3701
|
+
/** @public @react */
|
|
3702
|
+
declare function DefaultPeopleMenuAvatar({ userId }: DrUiPeopleMenuAvatarProps): react_jsx_runtime.JSX.Element | null;
|
|
3655
3703
|
|
|
3656
3704
|
/** @public */
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
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
|
-
};
|
|
3705
|
+
interface DrUiPeopleMenuFacePileProps {
|
|
3706
|
+
userIds: DrUserId[];
|
|
3707
|
+
userName: string;
|
|
3708
|
+
userColor: string;
|
|
3709
|
+
}
|
|
3710
|
+
/** @public @react */
|
|
3711
|
+
declare function DefaultPeopleMenuFacePile({ userIds, userName, userColor, }: DrUiPeopleMenuFacePileProps): react_jsx_runtime.JSX.Element;
|
|
3676
3712
|
|
|
3677
3713
|
/** @public */
|
|
3678
|
-
|
|
3679
|
-
|
|
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
|
-
};
|
|
3697
|
-
|
|
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;
|
|
3714
|
+
interface DrUiPeopleMenuItemProps {
|
|
3715
|
+
userId: DrUserId;
|
|
3715
3716
|
}
|
|
3716
|
-
/**
|
|
3717
|
-
|
|
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
|
-
};
|
|
3717
|
+
/** @public @react */
|
|
3718
|
+
declare const DefaultPeopleMenuItem: React$1.NamedExoticComponent<DrUiPeopleMenuItemProps>;
|
|
3731
3719
|
|
|
3732
3720
|
/** @public */
|
|
3733
|
-
interface
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
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;
|
|
3721
|
+
interface DrUiStylePanelProps {
|
|
3722
|
+
isMobile?: boolean;
|
|
3723
|
+
styles?: ReadonlySharedStyleMap | null;
|
|
3724
|
+
children?: ReactNode;
|
|
3749
3725
|
}
|
|
3750
|
-
/**
|
|
3751
|
-
|
|
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.
|
|
3759
|
-
*
|
|
3760
|
-
* @public @react
|
|
3761
|
-
*/
|
|
3762
|
-
declare const RichTextArea: React__default.ForwardRefExoticComponent<TextAreaProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
3726
|
+
/** @public @react */
|
|
3727
|
+
declare const DefaultStylePanel: React$1.NamedExoticComponent<DrUiStylePanelProps>;
|
|
3763
3728
|
|
|
3729
|
+
/** @public */
|
|
3730
|
+
interface DrUiRichTextToolbarProps {
|
|
3731
|
+
children?: React__default.ReactNode;
|
|
3732
|
+
}
|
|
3764
3733
|
/**
|
|
3765
|
-
*
|
|
3734
|
+
* The default rich text toolbar.
|
|
3766
3735
|
*
|
|
3767
3736
|
* @public @react
|
|
3768
3737
|
*/
|
|
3769
|
-
declare const
|
|
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>;
|
|
3738
|
+
declare const DefaultRichTextToolbar: React__default.NamedExoticComponent<DrUiRichTextToolbarProps>;
|
|
3959
3739
|
|
|
3960
3740
|
/** @public */
|
|
3961
3741
|
interface DrUiZoomMenuProps {
|
|
@@ -4077,6 +3857,12 @@ interface OnDragFromToolbarToCreateShapesOpts {
|
|
|
4077
3857
|
* Called once the drag interaction has finished.
|
|
4078
3858
|
*/
|
|
4079
3859
|
onDragEnd?(id: DrShapeId): void;
|
|
3860
|
+
/**
|
|
3861
|
+
* The id of the toolbar tool to keep highlighted while dragging. Defaults to the created shape's
|
|
3862
|
+
* type. Set this when the dragged shape's type differs from the tool it's dragged from — for
|
|
3863
|
+
* example, dragging a `draw` shape out from the select tool.
|
|
3864
|
+
*/
|
|
3865
|
+
maskedToolId?: string;
|
|
4080
3866
|
}
|
|
4081
3867
|
/**
|
|
4082
3868
|
* A helper method to use in {@link tldraw#DrUiToolItem.onDragStart} to create a shape by dragging it from
|
|
@@ -4168,165 +3954,607 @@ interface DrawUiProps extends DrUiContextProviderProps {
|
|
|
4168
3954
|
*/
|
|
4169
3955
|
hideUi?: boolean;
|
|
4170
3956
|
/**
|
|
4171
|
-
* Overrides for the UI components.
|
|
3957
|
+
* Overrides for the UI components.
|
|
3958
|
+
*/
|
|
3959
|
+
components?: DrUiComponents;
|
|
3960
|
+
/**
|
|
3961
|
+
* Additional items to add to the debug menu (will be deprecated)
|
|
3962
|
+
*/
|
|
3963
|
+
renderDebugMenuItems?(): React__default.ReactNode;
|
|
3964
|
+
/** Asset URL override. */
|
|
3965
|
+
assetUrls?: DrUiAssetUrlOverrides;
|
|
3966
|
+
}
|
|
3967
|
+
/**
|
|
3968
|
+
* @public
|
|
3969
|
+
* @react
|
|
3970
|
+
*/
|
|
3971
|
+
declare const DrawUi: React__default.NamedExoticComponent<DrawUiProps>;
|
|
3972
|
+
/** @public @react */
|
|
3973
|
+
declare function DrawUiInFrontOfTheCanvas(): react_jsx_runtime.JSX.Element;
|
|
3974
|
+
|
|
3975
|
+
/**
|
|
3976
|
+
* Override the default react components used by the editor and UI. Set components to null to
|
|
3977
|
+
* disable them entirely.
|
|
3978
|
+
*
|
|
3979
|
+
* @example
|
|
3980
|
+
* ```tsx
|
|
3981
|
+
* import { Draw, DrComponents, DrCollaboratorCursorProps } from '@ibodr/draw'
|
|
3982
|
+
*
|
|
3983
|
+
* const MyCursor = ({ point, color, name, scale, layout }: DrCollaboratorCursorProps) => (
|
|
3984
|
+
* // custom pointer + badge; `layout.badgeOffset` / `layout.iconOffset` come from Draw
|
|
3985
|
+
* )
|
|
3986
|
+
*
|
|
3987
|
+
* const components: DrComponents = {
|
|
3988
|
+
* CollaboratorCursor: MyCursor,
|
|
3989
|
+
* }
|
|
3990
|
+
*
|
|
3991
|
+
* export function MyApp() {
|
|
3992
|
+
* return (
|
|
3993
|
+
* <Draw
|
|
3994
|
+
* components={components}
|
|
3995
|
+
* collaboratorCursorLayout={{ badgeOffset: { x: 2, y: 0 } }}
|
|
3996
|
+
* />
|
|
3997
|
+
* )
|
|
3998
|
+
* }
|
|
3999
|
+
* ```
|
|
4000
|
+
*
|
|
4001
|
+
*
|
|
4002
|
+
* @public
|
|
4003
|
+
*/
|
|
4004
|
+
interface DrComponents extends DrEditorComponents, DrUiComponents {
|
|
4005
|
+
}
|
|
4006
|
+
/** @public */
|
|
4007
|
+
interface DrawBaseProps extends DrawUiProps, DrawEditorBaseProps, DrExternalContentProps {
|
|
4008
|
+
/** Urls for custom assets.
|
|
4009
|
+
*
|
|
4010
|
+
* ⚠︎ Important! This must be memoized (with useMemo) or defined outside of any React component.
|
|
4011
|
+
*/
|
|
4012
|
+
assetUrls?: DrUiAssetUrlOverrides;
|
|
4013
|
+
/** Overrides for tldraw's components.
|
|
4014
|
+
*
|
|
4015
|
+
* ⚠︎ Important! This must be memoized (with useMemo) or defined outside of any React component.
|
|
4016
|
+
*/
|
|
4017
|
+
components?: DrComponents;
|
|
4018
|
+
/**
|
|
4019
|
+
* Offsets for the collaborator cursor pointer and name badge.
|
|
4020
|
+
* Applied to the default cursor and passed via `layout` to custom `CollaboratorCursor` components.
|
|
4021
|
+
*
|
|
4022
|
+
* @example
|
|
4023
|
+
* ```tsx
|
|
4024
|
+
* <Draw collaboratorCursorLayout={{ badgeOffset: { x: 2, y: 0 } }} />
|
|
4025
|
+
* ```
|
|
4026
|
+
*/
|
|
4027
|
+
collaboratorCursorLayout?: Partial<DrCollaboratorCursorLayout>;
|
|
4028
|
+
/** Custom definitions for tldraw's embeds.
|
|
4029
|
+
*
|
|
4030
|
+
* ⚠︎ Important! This must be memoized (with useMemo) or defined outside of any React component.
|
|
4031
|
+
*
|
|
4032
|
+
* @deprecated Use `EmbedShapeUtil.configure({ embedDefinitions: embeds })` instead.
|
|
4033
|
+
*/
|
|
4034
|
+
embeds?: DrEmbedDefinition[];
|
|
4035
|
+
/**
|
|
4036
|
+
* Text options for the editor.
|
|
4037
|
+
*
|
|
4038
|
+
* @deprecated Use `options.text` instead. This prop will be removed in a future release.
|
|
4039
|
+
*/
|
|
4040
|
+
textOptions?: DrTextOptions;
|
|
4041
|
+
/**
|
|
4042
|
+
* The locale to use for the editor's UI. When set, this takes priority over
|
|
4043
|
+
* both the browser's language preferences (`navigator.languages`) and the
|
|
4044
|
+
* user's locale preference (e.g. via
|
|
4045
|
+
* `editor.user.updateUserPreferences({ locale: '...' })`), giving the
|
|
4046
|
+
* application explicit control over the displayed language.
|
|
4047
|
+
*
|
|
4048
|
+
* @example
|
|
4049
|
+
* ```tsx
|
|
4050
|
+
* <Draw locale="fr" />
|
|
4051
|
+
* ```
|
|
4052
|
+
*/
|
|
4053
|
+
locale?: string;
|
|
4054
|
+
}
|
|
4055
|
+
/** @public */
|
|
4056
|
+
type DrawProps = DrawBaseProps & DrawEditorStoreProps;
|
|
4057
|
+
/** @public @react */
|
|
4058
|
+
declare function Draw(props: DrawProps): react_jsx_runtime.JSX.Element;
|
|
4059
|
+
|
|
4060
|
+
/** @public */
|
|
4061
|
+
interface DrawImageProps extends DrImageExportOptions {
|
|
4062
|
+
/**
|
|
4063
|
+
* The snapshot to display.
|
|
4064
|
+
*/
|
|
4065
|
+
snapshot: Partial<DrEditorSnapshot> | DrStoreSnapshot;
|
|
4066
|
+
/**
|
|
4067
|
+
* The image format to use. Defaults to 'svg'.
|
|
4068
|
+
*/
|
|
4069
|
+
format?: 'svg' | 'png';
|
|
4070
|
+
/**
|
|
4071
|
+
* The page to display. Defaults to the first page.
|
|
4072
|
+
*/
|
|
4073
|
+
pageId?: DrPageId;
|
|
4074
|
+
/**
|
|
4075
|
+
* Additional shape utils to use.
|
|
4076
|
+
*/
|
|
4077
|
+
shapeUtils?: readonly DrAnyShapeUtilConstructor[];
|
|
4078
|
+
/**
|
|
4079
|
+
* Additional binding utils to use.
|
|
4080
|
+
*/
|
|
4081
|
+
bindingUtils?: readonly DrAnyBindingUtilConstructor[];
|
|
4082
|
+
/**
|
|
4083
|
+
* Asset URL overrides.
|
|
4084
|
+
*/
|
|
4085
|
+
assetUrls?: DrUiAssetUrlOverrides;
|
|
4086
|
+
/**
|
|
4087
|
+
* The asset store to use for resolving the snapshot's assets, matching the `assets` prop on
|
|
4088
|
+
* {@link Draw}. Without one, assets that aren't stored inline (as data URLs) can't be
|
|
4089
|
+
* resolved and won't appear in the image.
|
|
4090
|
+
*/
|
|
4091
|
+
assets?: DrAssetStore;
|
|
4092
|
+
/**
|
|
4093
|
+
* Options for the editor.
|
|
4094
|
+
*/
|
|
4095
|
+
options?: Partial<DrawOptions>;
|
|
4096
|
+
/**
|
|
4097
|
+
* Text options for the editor.
|
|
4098
|
+
*
|
|
4099
|
+
* @deprecated Use `options.text` instead. This prop will be removed in a future release.
|
|
4100
|
+
*/
|
|
4101
|
+
textOptions?: DrTextOptions;
|
|
4102
|
+
}
|
|
4103
|
+
/**
|
|
4104
|
+
* A rendered SVG image of a Draw snapshot.
|
|
4105
|
+
*
|
|
4106
|
+
* @example
|
|
4107
|
+
* ```tsx
|
|
4108
|
+
* <DrawImage
|
|
4109
|
+
* snapshot={snapshot}
|
|
4110
|
+
* pageId={pageId}
|
|
4111
|
+
* background={false}
|
|
4112
|
+
* darkMode={true}
|
|
4113
|
+
* bounds={new Box(0,0,600,400)}
|
|
4114
|
+
* scale={1}
|
|
4115
|
+
* />
|
|
4116
|
+
* ```
|
|
4117
|
+
*
|
|
4118
|
+
* @public
|
|
4119
|
+
* @react
|
|
4120
|
+
*/
|
|
4121
|
+
declare const DrawImage: React$1.NamedExoticComponent<DrawImageProps>;
|
|
4122
|
+
|
|
4123
|
+
/**
|
|
4124
|
+
* Options passed to {@link updateArrowTargetState}.
|
|
4125
|
+
*
|
|
4126
|
+
* @public
|
|
4127
|
+
*/
|
|
4128
|
+
interface UpdateArrowTargetStateOpts {
|
|
4129
|
+
editor: Editor;
|
|
4130
|
+
pointInPageSpace: VecLike;
|
|
4131
|
+
arrow: DrArrowShape | undefined;
|
|
4132
|
+
isPrecise: boolean;
|
|
4133
|
+
currentBinding: DrArrowBinding | undefined;
|
|
4134
|
+
/** The binding from the opposite end of the arrow, if one exists. */
|
|
4135
|
+
oppositeBinding: DrArrowBinding | undefined;
|
|
4136
|
+
}
|
|
4137
|
+
/**
|
|
4138
|
+
* State representing what we're pointing to when drawing or updating an arrow. You can get this
|
|
4139
|
+
* state using {@link getArrowTargetState}, and update it as part of an arrow interaction with
|
|
4140
|
+
* {@link updateArrowTargetState} or {@link clearArrowTargetState}.
|
|
4141
|
+
*
|
|
4142
|
+
* @public
|
|
4143
|
+
*/
|
|
4144
|
+
interface ArrowTargetState {
|
|
4145
|
+
target: DrShape;
|
|
4146
|
+
arrowKind: DrArrowShapeKind;
|
|
4147
|
+
handlesInPageSpace: {
|
|
4148
|
+
top: {
|
|
4149
|
+
point: VecLike;
|
|
4150
|
+
isEnabled: boolean;
|
|
4151
|
+
};
|
|
4152
|
+
bottom: {
|
|
4153
|
+
point: VecLike;
|
|
4154
|
+
isEnabled: boolean;
|
|
4155
|
+
};
|
|
4156
|
+
left: {
|
|
4157
|
+
point: VecLike;
|
|
4158
|
+
isEnabled: boolean;
|
|
4159
|
+
};
|
|
4160
|
+
right: {
|
|
4161
|
+
point: VecLike;
|
|
4162
|
+
isEnabled: boolean;
|
|
4163
|
+
};
|
|
4164
|
+
};
|
|
4165
|
+
isExact: boolean;
|
|
4166
|
+
isPrecise: boolean;
|
|
4167
|
+
centerInPageSpace: VecLike;
|
|
4168
|
+
anchorInPageSpace: VecLike;
|
|
4169
|
+
snap: ElbowArrowSnap;
|
|
4170
|
+
normalizedAnchor: VecLike;
|
|
4171
|
+
}
|
|
4172
|
+
/**
|
|
4173
|
+
* Get the current arrow target state for an editor. See {@link ArrowTargetState} for more
|
|
4174
|
+
* information.
|
|
4175
|
+
*
|
|
4176
|
+
* @public
|
|
4177
|
+
*/
|
|
4178
|
+
declare function getArrowTargetState(editor: Editor): ArrowTargetState | null;
|
|
4179
|
+
/**
|
|
4180
|
+
* Clear the current arrow target state for an editor. See {@link ArrowTargetState} for more
|
|
4181
|
+
* information.
|
|
4182
|
+
*
|
|
4183
|
+
* @public
|
|
4184
|
+
*/
|
|
4185
|
+
declare function clearArrowTargetState(editor: Editor): void;
|
|
4186
|
+
/**
|
|
4187
|
+
* Update the current arrow target state for an editor. See {@link ArrowTargetState} for more
|
|
4188
|
+
* information.
|
|
4189
|
+
*
|
|
4190
|
+
* @public
|
|
4191
|
+
*/
|
|
4192
|
+
declare function updateArrowTargetState({ editor, pointInPageSpace, arrow, isPrecise, currentBinding, oppositeBinding, }: UpdateArrowTargetStateOpts): ArrowTargetState | null;
|
|
4193
|
+
|
|
4194
|
+
/** @public */
|
|
4195
|
+
declare function getArrowInfo(editor: Editor, shape: DrArrowShape | DrShapeId): DrArrowInfo | undefined;
|
|
4196
|
+
|
|
4197
|
+
/**
|
|
4198
|
+
* Creates a bookmark shape from a URL.
|
|
4199
|
+
*
|
|
4200
|
+
* The shape is created immediately as a placeholder so the user gets visible
|
|
4201
|
+
* feedback at the paste location, and the bookmark metadata (title, description,
|
|
4202
|
+
* image, favicon) is fetched in the background. Once metadata resolves, the
|
|
4203
|
+
* shape is patched with the resulting asset. If the fetch fails, the shape is
|
|
4204
|
+
* left as a URL-only bookmark.
|
|
4205
|
+
*
|
|
4206
|
+
* @returns A Result containing the created bookmark shape or an error
|
|
4207
|
+
* @public
|
|
4208
|
+
*/
|
|
4209
|
+
declare function createBookmarkFromUrl(editor: Editor, { url, center, }: {
|
|
4210
|
+
url: string;
|
|
4211
|
+
center?: {
|
|
4212
|
+
x: number;
|
|
4213
|
+
y: number;
|
|
4214
|
+
};
|
|
4215
|
+
}): Promise<Result<DrBookmarkShape, string>>;
|
|
4216
|
+
|
|
4217
|
+
/** @public */
|
|
4218
|
+
interface CropBoxOptions {
|
|
4219
|
+
minWidth?: number;
|
|
4220
|
+
minHeight?: number;
|
|
4221
|
+
}
|
|
4222
|
+
/** @public */
|
|
4223
|
+
declare function getDefaultCrop(): DrShapeCrop;
|
|
4224
|
+
/** @public */
|
|
4225
|
+
type ASPECT_RATIO_OPTION = 'original' | 'square' | 'circle' | 'landscape' | 'portrait' | 'wide';
|
|
4226
|
+
/** @public */
|
|
4227
|
+
declare const ASPECT_RATIO_OPTIONS: ASPECT_RATIO_OPTION[];
|
|
4228
|
+
/** @public */
|
|
4229
|
+
declare const ASPECT_RATIO_TO_VALUE: Record<ASPECT_RATIO_OPTION, number>;
|
|
4230
|
+
/**
|
|
4231
|
+
* Original (uncropped) width and height of shape.
|
|
4232
|
+
*
|
|
4233
|
+
* @public
|
|
4234
|
+
*/
|
|
4235
|
+
declare function getUncroppedSize(shapeSize: {
|
|
4236
|
+
w: number;
|
|
4237
|
+
h: number;
|
|
4238
|
+
}, crop: DrShapeCrop | null): {
|
|
4239
|
+
w: number;
|
|
4240
|
+
h: number;
|
|
4241
|
+
};
|
|
4242
|
+
/** @public */
|
|
4243
|
+
declare function getCropBox<T extends ShapeWithCrop>(shape: T, info: DrCropInfo<T>, opts?: CropBoxOptions): {
|
|
4244
|
+
id: DrShapeId;
|
|
4245
|
+
type: T['type'];
|
|
4246
|
+
x: number;
|
|
4247
|
+
y: number;
|
|
4248
|
+
props: ShapeWithCrop['props'];
|
|
4249
|
+
} | undefined;
|
|
4250
|
+
|
|
4251
|
+
/** @internal */
|
|
4252
|
+
declare const STROKE_SIZES: Record<DrDefaultSizeStyle, number>;
|
|
4253
|
+
/** @public */
|
|
4254
|
+
declare function getFontFamily(theme: DrTheme, font: string): string;
|
|
4255
|
+
|
|
4256
|
+
/** @public */
|
|
4257
|
+
interface DrDefaultFont {
|
|
4258
|
+
normal: {
|
|
4259
|
+
normal: DrFontFace;
|
|
4260
|
+
bold: DrFontFace;
|
|
4261
|
+
};
|
|
4262
|
+
italic: {
|
|
4263
|
+
normal: DrFontFace;
|
|
4264
|
+
bold: DrFontFace;
|
|
4265
|
+
};
|
|
4266
|
+
}
|
|
4267
|
+
/** @public */
|
|
4268
|
+
interface DrDefaultFonts {
|
|
4269
|
+
draw_draw: DrDefaultFont;
|
|
4270
|
+
draw_sans: DrDefaultFont;
|
|
4271
|
+
draw_serif: DrDefaultFont;
|
|
4272
|
+
draw_mono: DrDefaultFont;
|
|
4273
|
+
}
|
|
4274
|
+
/** @public */
|
|
4275
|
+
declare const DefaultFontFaces: DrDefaultFonts;
|
|
4276
|
+
/** @public */
|
|
4277
|
+
declare const allDefaultFontFaces: DrFontFace[];
|
|
4278
|
+
|
|
4279
|
+
/**
|
|
4280
|
+
* ## getStroke
|
|
4281
|
+
*
|
|
4282
|
+
* Get an array of points describing a polygon that surrounds the input points.
|
|
4283
|
+
*
|
|
4284
|
+
* @param points - An array of points (as `[x, y, pressure]` or `{x, y, pressure}`). Pressure is
|
|
4285
|
+
* optional in both cases.
|
|
4286
|
+
* @param options - An object with options.
|
|
4287
|
+
* @public
|
|
4288
|
+
*/
|
|
4289
|
+
declare function getStroke(points: VecLike[], options?: StrokeOptions): Vec[];
|
|
4290
|
+
|
|
4291
|
+
/**
|
|
4292
|
+
* ## getStrokeOutlinePoints
|
|
4293
|
+
*
|
|
4294
|
+
* Get an array of points (as `[x, y]`) representing the outline of a stroke.
|
|
4295
|
+
*
|
|
4296
|
+
* @param points - An array of StrokePoints as returned from `getStrokePoints`.
|
|
4297
|
+
* @param options - An object with options.
|
|
4298
|
+
* @public
|
|
4299
|
+
*/
|
|
4300
|
+
declare function getStrokeOutlinePoints(strokePoints: StrokePoint[], options?: StrokeOptions): Vec[];
|
|
4301
|
+
|
|
4302
|
+
/**
|
|
4303
|
+
* ## getStrokePoints
|
|
4304
|
+
*
|
|
4305
|
+
* Get an array of points as objects with an adjusted point, pressure, vector, distance, and
|
|
4306
|
+
* runningLength.
|
|
4307
|
+
*
|
|
4308
|
+
* @param points - An array of points (as `[x, y, pressure]` or `{x, y, pressure}`). Pressure is
|
|
4309
|
+
* optional in both cases.
|
|
4310
|
+
* @param options - An object with options.
|
|
4311
|
+
* @public
|
|
4312
|
+
*/
|
|
4313
|
+
declare function getStrokePoints(rawInputPoints: VecLike[], options?: StrokeOptions): StrokePoint[];
|
|
4314
|
+
|
|
4315
|
+
/**
|
|
4316
|
+
* Turn an array of stroke points into a path of quadratic curves.
|
|
4317
|
+
*
|
|
4318
|
+
* The path uses relative commands with coordinates rounded to hundredths of a pixel, which
|
|
4319
|
+
* renders identically to the absolute 4-decimal form but is much smaller and faster to build.
|
|
4320
|
+
*
|
|
4321
|
+
* @param points - The stroke points returned from perfect-freehand
|
|
4322
|
+
* @param closed - Whether the shape is closed
|
|
4323
|
+
*
|
|
4324
|
+
* @public
|
|
4325
|
+
*/
|
|
4326
|
+
declare function getSvgPathFromStrokePoints(points: StrokePoint[], closed?: boolean): string;
|
|
4327
|
+
|
|
4328
|
+
/** @public */
|
|
4329
|
+
interface PlainTextLabelProps {
|
|
4330
|
+
shapeId: DrShapeId;
|
|
4331
|
+
type: ExtractShapeByProps<{
|
|
4332
|
+
text: string;
|
|
4333
|
+
}>['type'];
|
|
4334
|
+
fontFamily: string;
|
|
4335
|
+
fontSize: number;
|
|
4336
|
+
lineHeight: number;
|
|
4337
|
+
textAlign: 'start' | 'center' | 'end';
|
|
4338
|
+
verticalAlign: 'start' | 'middle' | 'end';
|
|
4339
|
+
wrap?: boolean;
|
|
4340
|
+
text?: string;
|
|
4341
|
+
labelColor: string;
|
|
4342
|
+
bounds?: Box;
|
|
4343
|
+
isSelected: boolean;
|
|
4344
|
+
onKeyDown?(e: KeyboardEvent): void;
|
|
4345
|
+
classNamePrefix?: string;
|
|
4346
|
+
style?: React__default.CSSProperties;
|
|
4347
|
+
textWidth?: number;
|
|
4348
|
+
textHeight?: number;
|
|
4349
|
+
padding?: number;
|
|
4350
|
+
showTextOutline?: boolean;
|
|
4351
|
+
}
|
|
4352
|
+
/**
|
|
4353
|
+
* Renders a text label that can be used inside of shapes.
|
|
4354
|
+
* The component has the ability to be edited in place and furthermore
|
|
4355
|
+
* supports rich text editing.
|
|
4356
|
+
*
|
|
4357
|
+
* @public @react
|
|
4358
|
+
*/
|
|
4359
|
+
declare const PlainTextLabel: React__default.NamedExoticComponent<PlainTextLabelProps>;
|
|
4360
|
+
|
|
4361
|
+
/** @public */
|
|
4362
|
+
interface RichTextLabelProps {
|
|
4363
|
+
shapeId: DrShapeId;
|
|
4364
|
+
type: ExtractShapeByProps<{
|
|
4365
|
+
richText: DrRichText;
|
|
4366
|
+
}>['type'];
|
|
4367
|
+
fontFamily: string;
|
|
4368
|
+
fontSize: number;
|
|
4369
|
+
lineHeight: number;
|
|
4370
|
+
textAlign: 'start' | 'center' | 'end';
|
|
4371
|
+
verticalAlign: 'start' | 'middle' | 'end';
|
|
4372
|
+
wrap?: boolean;
|
|
4373
|
+
richText?: DrRichText;
|
|
4374
|
+
labelColor: string;
|
|
4375
|
+
bounds?: Box;
|
|
4376
|
+
isSelected: boolean;
|
|
4377
|
+
onKeyDown?(e: KeyboardEvent): void;
|
|
4378
|
+
classNamePrefix?: string;
|
|
4379
|
+
style?: React__default.CSSProperties;
|
|
4380
|
+
textWidth?: number;
|
|
4381
|
+
textHeight?: number;
|
|
4382
|
+
padding?: number;
|
|
4383
|
+
hasCustomTabBehavior?: boolean;
|
|
4384
|
+
showTextOutline?: boolean;
|
|
4385
|
+
/** Whether clicking a link inside the text opens it in a new tab. Defaults to `true`. */
|
|
4386
|
+
openLinksOnClick?: boolean;
|
|
4387
|
+
}
|
|
4388
|
+
/**
|
|
4389
|
+
* Renders a text label that can be used inside of shapes.
|
|
4390
|
+
* The component has the ability to be edited in place and furthermore
|
|
4391
|
+
* supports rich text editing.
|
|
4392
|
+
*
|
|
4393
|
+
* @public @react
|
|
4394
|
+
*/
|
|
4395
|
+
declare const RichTextLabel: React__default.NamedExoticComponent<RichTextLabelProps>;
|
|
4396
|
+
/** @public */
|
|
4397
|
+
interface RichTextSVGProps {
|
|
4398
|
+
bounds: Box;
|
|
4399
|
+
richText: DrRichText;
|
|
4400
|
+
fontSize: number;
|
|
4401
|
+
fontFamily: string;
|
|
4402
|
+
lineHeight: number;
|
|
4403
|
+
textAlign: 'start' | 'center' | 'end';
|
|
4404
|
+
verticalAlign: 'start' | 'middle' | 'end';
|
|
4405
|
+
wrap?: boolean;
|
|
4406
|
+
labelColor: string;
|
|
4407
|
+
padding: number;
|
|
4408
|
+
showTextOutline?: boolean;
|
|
4409
|
+
}
|
|
4410
|
+
/**
|
|
4411
|
+
* Renders a rich text string as SVG given bounds and text properties.
|
|
4412
|
+
*
|
|
4413
|
+
* @public @react
|
|
4414
|
+
*/
|
|
4415
|
+
declare function RichTextSVG({ bounds, richText, fontSize, fontFamily, lineHeight, textAlign, verticalAlign, wrap, labelColor, padding, showTextOutline, }: RichTextSVGProps): react_jsx_runtime.JSX.Element;
|
|
4416
|
+
|
|
4417
|
+
/** @public */
|
|
4418
|
+
declare function useEditablePlainText(shapeId: DrShapeId, type: ExtractShapeByProps<{
|
|
4419
|
+
text: string;
|
|
4420
|
+
}>['type'], text?: string): {
|
|
4421
|
+
handleFocus: () => void;
|
|
4422
|
+
handleBlur: () => void;
|
|
4423
|
+
handleInputPointerDown: (e: React__default.PointerEvent) => void;
|
|
4424
|
+
handleDoubleClick: (e: Event | {
|
|
4425
|
+
nativeEvent: Event;
|
|
4426
|
+
}) => void;
|
|
4427
|
+
handlePaste: (e: ClipboardEvent | React__default.ClipboardEvent<HTMLTextAreaElement>) => void;
|
|
4428
|
+
isEditing: boolean;
|
|
4429
|
+
isReadyForEditing: boolean;
|
|
4430
|
+
rInput: React__default.RefObject<HTMLTextAreaElement | null>;
|
|
4431
|
+
handleKeyDown: (e: KeyboardEvent) => void;
|
|
4432
|
+
handleChange: ({ plaintext }: {
|
|
4433
|
+
plaintext: string;
|
|
4434
|
+
}) => void;
|
|
4435
|
+
isEmpty: boolean;
|
|
4436
|
+
};
|
|
4437
|
+
|
|
4438
|
+
/** @public */
|
|
4439
|
+
declare function useEditableRichText(shapeId: DrShapeId, type: ExtractShapeByProps<{
|
|
4440
|
+
richText: DrRichText;
|
|
4441
|
+
}>['type'], richText?: DrRichText): {
|
|
4442
|
+
handleFocus: () => void;
|
|
4443
|
+
handleBlur: () => void;
|
|
4444
|
+
handleInputPointerDown: (e: React.PointerEvent) => void;
|
|
4445
|
+
handleDoubleClick: (e: Event | {
|
|
4446
|
+
nativeEvent: Event;
|
|
4447
|
+
}) => void;
|
|
4448
|
+
handlePaste: (e: ClipboardEvent | React.ClipboardEvent<HTMLTextAreaElement>) => void;
|
|
4449
|
+
isEditing: boolean;
|
|
4450
|
+
isReadyForEditing: boolean;
|
|
4451
|
+
rInput: React$1.RefObject<HTMLDivElement | null>;
|
|
4452
|
+
handleKeyDown: (e: KeyboardEvent) => void;
|
|
4453
|
+
handleChange: ({ richText }: {
|
|
4454
|
+
richText: DrRichText;
|
|
4455
|
+
}) => void;
|
|
4456
|
+
isEmpty: boolean | undefined;
|
|
4457
|
+
};
|
|
4458
|
+
|
|
4459
|
+
/**
|
|
4460
|
+
* Options for {@link useImageOrVideoAsset}.
|
|
4461
|
+
*
|
|
4462
|
+
* @public
|
|
4463
|
+
*/
|
|
4464
|
+
interface UseImageOrVideoAssetOptions {
|
|
4465
|
+
/** The asset ID you want a URL for. */
|
|
4466
|
+
assetId: DrAssetId | null;
|
|
4467
|
+
/**
|
|
4468
|
+
* The shape the asset is being used for. We won't update the resolved URL while the shape is
|
|
4469
|
+
* off-screen.
|
|
4172
4470
|
*/
|
|
4173
|
-
|
|
4471
|
+
shapeId?: DrShapeId;
|
|
4174
4472
|
/**
|
|
4175
|
-
*
|
|
4473
|
+
* The width at which the asset will be displayed, in shape-space pixels.
|
|
4176
4474
|
*/
|
|
4177
|
-
|
|
4178
|
-
/** Asset URL override. */
|
|
4179
|
-
assetUrls?: DrUiAssetUrlOverrides;
|
|
4475
|
+
width: number;
|
|
4180
4476
|
}
|
|
4181
4477
|
/**
|
|
4478
|
+
* This is a handy helper hook that resolves an asset to an optimized URL for a given shape, or its
|
|
4479
|
+
* {@link @ibodr/editor#Editor.createTemporaryAssetPreview | placeholder} if the asset is still
|
|
4480
|
+
* uploading. This is used in particular for high-resolution images when you want lower and higher
|
|
4481
|
+
* resolution depending on the size of the image on the canvas and the zoom level.
|
|
4482
|
+
*
|
|
4483
|
+
* For image scaling to work, you need to implement scaled URLs in
|
|
4484
|
+
* {@link @ibodr/schema#DrAssetStore.resolve}.
|
|
4485
|
+
*
|
|
4182
4486
|
* @public
|
|
4183
|
-
* @react
|
|
4184
4487
|
*/
|
|
4185
|
-
declare
|
|
4186
|
-
|
|
4187
|
-
|
|
4488
|
+
declare function useImageOrVideoAsset({ shapeId, assetId, width }: UseImageOrVideoAssetOptions): {
|
|
4489
|
+
asset: (DrImageAsset | DrVideoAsset) | null;
|
|
4490
|
+
url: string | null;
|
|
4491
|
+
};
|
|
4188
4492
|
|
|
4493
|
+
/** @public */
|
|
4494
|
+
interface TextAreaProps {
|
|
4495
|
+
isEditing: boolean;
|
|
4496
|
+
text?: string;
|
|
4497
|
+
shapeId: DrShapeId;
|
|
4498
|
+
richText?: DrRichText;
|
|
4499
|
+
handleFocus(): void;
|
|
4500
|
+
handleBlur(): void;
|
|
4501
|
+
handleKeyDown(e: KeyboardEvent): void;
|
|
4502
|
+
handleChange(changeInfo: {
|
|
4503
|
+
plaintext?: string;
|
|
4504
|
+
richText?: DrRichText;
|
|
4505
|
+
}): void;
|
|
4506
|
+
handleInputPointerDown(e: React__default.PointerEvent<HTMLElement>): void;
|
|
4507
|
+
handleDoubleClick(e: any): any;
|
|
4508
|
+
handlePaste(e: ClipboardEvent | React__default.ClipboardEvent<HTMLTextAreaElement>): void;
|
|
4509
|
+
hasCustomTabBehavior?: boolean;
|
|
4510
|
+
}
|
|
4189
4511
|
/**
|
|
4190
|
-
*
|
|
4191
|
-
*
|
|
4192
|
-
*
|
|
4193
|
-
*
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
*
|
|
4197
|
-
*
|
|
4198
|
-
* // custom pointer + badge; `layout.badgeOffset` / `layout.iconOffset` come from Draw
|
|
4199
|
-
* )
|
|
4512
|
+
* N.B. In Development mode you need to ensure you're testing this without StrictMode on.
|
|
4513
|
+
* Otherwise it's not gonna work as expected on iOS.
|
|
4514
|
+
* Specifically, it means that the virtual keyboard won't pop open sometimes
|
|
4515
|
+
* (iOS starts flipping out when you render multiple times when trying to focus something) .
|
|
4516
|
+
*/
|
|
4517
|
+
/**
|
|
4518
|
+
* A rich text area that can be used for editing text with rich text formatting.
|
|
4519
|
+
* This component uses the TipTap editor under the hood.
|
|
4200
4520
|
*
|
|
4201
|
-
*
|
|
4202
|
-
|
|
4203
|
-
|
|
4521
|
+
* @public @react
|
|
4522
|
+
*/
|
|
4523
|
+
declare const RichTextArea: React__default.ForwardRefExoticComponent<TextAreaProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
4524
|
+
|
|
4525
|
+
/**
|
|
4526
|
+
* A plain text area that can be used for basic editing text.
|
|
4204
4527
|
*
|
|
4205
|
-
*
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4528
|
+
* @public @react
|
|
4529
|
+
*/
|
|
4530
|
+
declare const PlainTextArea: React__default.ForwardRefExoticComponent<TextAreaProps & React__default.RefAttributes<HTMLTextAreaElement>>;
|
|
4531
|
+
|
|
4532
|
+
/** @public */
|
|
4533
|
+
type StyleValuesForUi<T> = readonly {
|
|
4534
|
+
readonly value: T;
|
|
4535
|
+
readonly icon: string | DrUiIconJsx;
|
|
4536
|
+
}[];
|
|
4537
|
+
/**
|
|
4538
|
+
* Returns the current list of color style items for the style panel,
|
|
4539
|
+
* derived from the theme's color palette. Only palette colors are included;
|
|
4540
|
+
* utility colors like `text`, `background`, etc. are excluded.
|
|
4214
4541
|
*
|
|
4542
|
+
* Colors are ordered by their position in {@link @ibodr/schema#DefaultColorStyle},
|
|
4543
|
+
* followed by any additional theme colors in their object key order.
|
|
4215
4544
|
*
|
|
4216
4545
|
* @public
|
|
4217
4546
|
*/
|
|
4218
|
-
|
|
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
|
-
}
|
|
4547
|
+
declare function getColorStyleItems(colors: DrThemeColors): StyleValuesForUi<string>;
|
|
4311
4548
|
/**
|
|
4312
|
-
*
|
|
4549
|
+
* Returns the current list of font style items for the style panel,
|
|
4550
|
+
* derived from the theme's font palette.
|
|
4313
4551
|
*
|
|
4314
|
-
* @
|
|
4315
|
-
*
|
|
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
|
-
* ```
|
|
4552
|
+
* Fonts are ordered by their position in {@link @ibodr/schema#DefaultFontStyle},
|
|
4553
|
+
* followed by any additional theme fonts in their object key order.
|
|
4325
4554
|
*
|
|
4326
4555
|
* @public
|
|
4327
|
-
* @react
|
|
4328
4556
|
*/
|
|
4329
|
-
declare
|
|
4557
|
+
declare function getFontStyleItems(theme: DrTheme): StyleValuesForUi<string>;
|
|
4330
4558
|
|
|
4331
4559
|
/** @public */
|
|
4332
4560
|
declare function getHitShapeOnCanvasPointerDown(editor: Editor, hitLabels?: boolean): DrShape | undefined;
|
|
@@ -4349,7 +4577,7 @@ declare function RotateCWMenuItem(): react_jsx_runtime.JSX.Element;
|
|
|
4349
4577
|
declare function GroupOrUngroupMenuItem(): react_jsx_runtime.JSX.Element;
|
|
4350
4578
|
|
|
4351
4579
|
/** @public @react */
|
|
4352
|
-
declare function DefaultContextMenuContent(): react_jsx_runtime.JSX.Element
|
|
4580
|
+
declare function DefaultContextMenuContent(): react_jsx_runtime.JSX.Element;
|
|
4353
4581
|
|
|
4354
4582
|
/** @public */
|
|
4355
4583
|
interface DrUiDebugMenuProps {
|
|
@@ -4403,18 +4631,18 @@ declare function DefaultHelpMenuContent(): react_jsx_runtime.JSX.Element;
|
|
|
4403
4631
|
declare function KeyboardShortcutsMenuItem(): react_jsx_runtime.JSX.Element | null;
|
|
4404
4632
|
|
|
4405
4633
|
/** @public @react */
|
|
4406
|
-
declare function
|
|
4634
|
+
declare function InputModeMenu(): react_jsx_runtime.JSX.Element;
|
|
4407
4635
|
|
|
4408
4636
|
/** @public @react */
|
|
4409
|
-
declare function
|
|
4637
|
+
declare function DefaultKeyboardShortcutsDialogContent(): react_jsx_runtime.JSX.Element;
|
|
4410
4638
|
|
|
4411
4639
|
/** @public @react */
|
|
4412
|
-
declare function
|
|
4640
|
+
declare function LanguageMenu(): react_jsx_runtime.JSX.Element | null;
|
|
4413
4641
|
|
|
4414
4642
|
/** @public @react */
|
|
4415
4643
|
declare function DefaultMainMenuContent(): react_jsx_runtime.JSX.Element;
|
|
4416
4644
|
/** @public @react */
|
|
4417
|
-
declare function ExportFileContentSubMenu(): react_jsx_runtime.JSX.Element;
|
|
4645
|
+
declare function ExportFileContentSubMenu(): react_jsx_runtime.JSX.Element | null;
|
|
4418
4646
|
/** @public @react */
|
|
4419
4647
|
declare function EditSubmenu(): react_jsx_runtime.JSX.Element;
|
|
4420
4648
|
/** @public @react */
|
|
@@ -4459,7 +4687,9 @@ declare function ZoomToSelectionMenuItem(): react_jsx_runtime.JSX.Element;
|
|
|
4459
4687
|
/** @public @react */
|
|
4460
4688
|
declare function ClipboardMenuGroup(): react_jsx_runtime.JSX.Element;
|
|
4461
4689
|
/** @public @react */
|
|
4462
|
-
declare function CopyAsMenuGroup(): react_jsx_runtime.JSX.Element;
|
|
4690
|
+
declare function CopyAsMenuGroup(): react_jsx_runtime.JSX.Element | null;
|
|
4691
|
+
/** @public @react */
|
|
4692
|
+
declare function ExportAsMenuGroup(): react_jsx_runtime.JSX.Element | null;
|
|
4463
4693
|
/** @public @react */
|
|
4464
4694
|
declare function CutMenuItem(): react_jsx_runtime.JSX.Element;
|
|
4465
4695
|
/** @public @react */
|
|
@@ -4564,68 +4794,29 @@ interface DrUiButtonProps extends React$1.HTMLAttributes<HTMLButtonElement> {
|
|
|
4564
4794
|
}
|
|
4565
4795
|
/** @public @react */
|
|
4566
4796
|
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';
|
|
4797
|
+
|
|
4593
4798
|
/** @public */
|
|
4594
|
-
interface
|
|
4595
|
-
|
|
4596
|
-
sourceId: DrUiEventSource;
|
|
4597
|
-
children: React.ReactNode;
|
|
4799
|
+
interface DrUiButtonCheckProps {
|
|
4800
|
+
checked: boolean;
|
|
4598
4801
|
}
|
|
4599
4802
|
/** @public @react */
|
|
4600
|
-
declare function
|
|
4803
|
+
declare function DrawUiButtonCheck({ checked }: DrUiButtonCheckProps): react_jsx_runtime.JSX.Element;
|
|
4601
4804
|
|
|
4602
4805
|
/** @public */
|
|
4603
|
-
interface
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
*/
|
|
4608
|
-
label?: TranslationKey | {
|
|
4609
|
-
[key: string]: TranslationKey;
|
|
4610
|
-
};
|
|
4611
|
-
className?: string;
|
|
4612
|
-
children?: ReactNode;
|
|
4806
|
+
interface DrUiButtonIconProps {
|
|
4807
|
+
icon: string | DrUiIconJsx;
|
|
4808
|
+
small?: boolean;
|
|
4809
|
+
invertIcon?: boolean;
|
|
4613
4810
|
}
|
|
4614
4811
|
/** @public @react */
|
|
4615
|
-
declare function
|
|
4812
|
+
declare function DrawUiButtonIcon({ icon, small, invertIcon }: DrUiButtonIconProps): react_jsx_runtime.JSX.Element;
|
|
4616
4813
|
|
|
4617
4814
|
/** @public */
|
|
4618
|
-
interface
|
|
4619
|
-
|
|
4620
|
-
label?: Translation | {
|
|
4621
|
-
[key: string]: Translation;
|
|
4622
|
-
};
|
|
4623
|
-
disabled?: boolean;
|
|
4624
|
-
children: ReactNode;
|
|
4625
|
-
size?: 'tiny' | 'small' | 'medium' | 'wide';
|
|
4815
|
+
interface DrUiButtonLabelProps {
|
|
4816
|
+
children?: ReactNode;
|
|
4626
4817
|
}
|
|
4627
4818
|
/** @public @react */
|
|
4628
|
-
declare function
|
|
4819
|
+
declare function DrawUiButtonLabel({ children }: DrUiButtonLabelProps): react_jsx_runtime.JSX.Element;
|
|
4629
4820
|
|
|
4630
4821
|
/** @public */
|
|
4631
4822
|
interface DrUiContextualToolbarProps {
|
|
@@ -4642,7 +4833,7 @@ interface DrUiContextualToolbarProps {
|
|
|
4642
4833
|
*
|
|
4643
4834
|
* @public @react
|
|
4644
4835
|
*/
|
|
4645
|
-
declare
|
|
4836
|
+
declare function DrawUiContextualToolbar({ children, className, isMousingDown, getSelectionBounds, changeOnlyWhenYChanges, label, }: DrUiContextualToolbarProps): react_jsx_runtime.JSX.Element;
|
|
4646
4837
|
|
|
4647
4838
|
/** @public */
|
|
4648
4839
|
interface DrUiDialogHeaderProps {
|
|
@@ -4700,10 +4891,11 @@ interface DrUiDropdownMenuContentProps {
|
|
|
4700
4891
|
align?: 'start' | 'center' | 'end';
|
|
4701
4892
|
sideOffset?: number;
|
|
4702
4893
|
alignOffset?: number;
|
|
4894
|
+
collisionPadding?: number;
|
|
4703
4895
|
children: ReactNode;
|
|
4704
4896
|
}
|
|
4705
4897
|
/** @public @react */
|
|
4706
|
-
declare function DrawUiDropdownMenuContent({ className, side, align, sideOffset, alignOffset, children, }: DrUiDropdownMenuContentProps): react_jsx_runtime.JSX.Element;
|
|
4898
|
+
declare function DrawUiDropdownMenuContent({ className, side, align, sideOffset, alignOffset, collisionPadding, children, }: DrUiDropdownMenuContentProps): react_jsx_runtime.JSX.Element;
|
|
4707
4899
|
/** @public */
|
|
4708
4900
|
interface DrUiDropdownMenuSubProps {
|
|
4709
4901
|
id: string;
|
|
@@ -4768,6 +4960,8 @@ interface DrUiInputProps {
|
|
|
4768
4960
|
autoSelect?: boolean;
|
|
4769
4961
|
children?: React$1.ReactNode;
|
|
4770
4962
|
defaultValue?: string;
|
|
4963
|
+
/** Maximum number of characters the input will accept. */
|
|
4964
|
+
maxLength?: number;
|
|
4771
4965
|
placeholder?: string;
|
|
4772
4966
|
onComplete?(value: string): void;
|
|
4773
4967
|
onValueChange?(value: string): void;
|
|
@@ -4822,11 +5016,16 @@ interface DrUiPopoverContentProps {
|
|
|
4822
5016
|
align?: 'start' | 'center' | 'end';
|
|
4823
5017
|
alignOffset?: number;
|
|
4824
5018
|
sideOffset?: number;
|
|
5019
|
+
/**
|
|
5020
|
+
* Minimum distance to keep between the popover and the viewport edge before it
|
|
5021
|
+
* shifts to stay in view. Defaults to Radix's `0`.
|
|
5022
|
+
*/
|
|
5023
|
+
collisionPadding?: number;
|
|
4825
5024
|
disableEscapeKeyDown?: boolean;
|
|
4826
5025
|
autoFocusFirstButton?: boolean;
|
|
4827
5026
|
}
|
|
4828
5027
|
/** @public @react */
|
|
4829
|
-
declare function DrawUiPopoverContent({ side, children, align, sideOffset, alignOffset, disableEscapeKeyDown, autoFocusFirstButton, }: DrUiPopoverContentProps): react_jsx_runtime.JSX.Element;
|
|
5028
|
+
declare function DrawUiPopoverContent({ side, children, align, sideOffset, alignOffset, collisionPadding, disableEscapeKeyDown, autoFocusFirstButton, }: DrUiPopoverContentProps): react_jsx_runtime.JSX.Element;
|
|
4830
5029
|
|
|
4831
5030
|
/** @public */
|
|
4832
5031
|
interface DrUiSelectProps {
|
|
@@ -4964,7 +5163,7 @@ interface DrUiToolbarToggleGroupProps extends React__default.HTMLAttributes<HTML
|
|
|
4964
5163
|
asChild?: boolean;
|
|
4965
5164
|
}
|
|
4966
5165
|
/** @public @react */
|
|
4967
|
-
declare
|
|
5166
|
+
declare function DrawUiToolbarToggleGroup({ children, className, type, asChild, ...props }: DrUiToolbarToggleGroupProps): react_jsx_runtime.JSX.Element;
|
|
4968
5167
|
/** @public */
|
|
4969
5168
|
interface DrUiToolbarToggleItemProps extends React__default.HTMLAttributes<HTMLButtonElement> {
|
|
4970
5169
|
children?: React__default.ReactNode;
|
|
@@ -4974,7 +5173,7 @@ interface DrUiToolbarToggleItemProps extends React__default.HTMLAttributes<HTMLB
|
|
|
4974
5173
|
tooltip?: React__default.ReactNode;
|
|
4975
5174
|
}
|
|
4976
5175
|
/** @public @react */
|
|
4977
|
-
declare
|
|
5176
|
+
declare function DrawUiToolbarToggleItem({ children, className, type, value, tooltip, ...props }: DrUiToolbarToggleItemProps): react_jsx_runtime.JSX.Element;
|
|
4978
5177
|
|
|
4979
5178
|
/** @public */
|
|
4980
5179
|
interface DrawUiTooltipProps {
|
|
@@ -4997,6 +5196,45 @@ declare function DrawUiTooltipProvider({ children }: DrawUiTooltipProviderProps)
|
|
|
4997
5196
|
/** @public @react */
|
|
4998
5197
|
declare const DrawUiTooltip: React__default.ForwardRefExoticComponent<DrawUiTooltipProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
4999
5198
|
|
|
5199
|
+
/** @public */
|
|
5200
|
+
type DrUiMenuContextType = 'menu' | 'small-icons' | 'context-menu' | 'icons' | 'keyboard-shortcuts' | 'helper-buttons' | 'toolbar' | 'toolbar-overflow';
|
|
5201
|
+
/** @public */
|
|
5202
|
+
interface DrUiMenuContextProviderProps {
|
|
5203
|
+
type: DrUiMenuContextType;
|
|
5204
|
+
sourceId: DrUiEventSource;
|
|
5205
|
+
children: React.ReactNode;
|
|
5206
|
+
}
|
|
5207
|
+
/** @public @react */
|
|
5208
|
+
declare function DrawUiMenuContextProvider({ type, sourceId, children, }: DrUiMenuContextProviderProps): react_jsx_runtime.JSX.Element;
|
|
5209
|
+
|
|
5210
|
+
/** @public */
|
|
5211
|
+
interface DrUiMenuGroupProps<TranslationKey extends string = string> {
|
|
5212
|
+
id: string;
|
|
5213
|
+
/**
|
|
5214
|
+
* 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.
|
|
5215
|
+
*/
|
|
5216
|
+
label?: TranslationKey | {
|
|
5217
|
+
[key: string]: TranslationKey;
|
|
5218
|
+
};
|
|
5219
|
+
className?: string;
|
|
5220
|
+
children?: ReactNode;
|
|
5221
|
+
}
|
|
5222
|
+
/** @public @react */
|
|
5223
|
+
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;
|
|
5224
|
+
|
|
5225
|
+
/** @public */
|
|
5226
|
+
interface DrUiMenuSubmenuProps<Translation extends string = string> {
|
|
5227
|
+
id: string;
|
|
5228
|
+
label?: Translation | {
|
|
5229
|
+
[key: string]: Translation;
|
|
5230
|
+
};
|
|
5231
|
+
disabled?: boolean;
|
|
5232
|
+
children: ReactNode;
|
|
5233
|
+
size?: 'tiny' | 'small' | 'medium' | 'wide';
|
|
5234
|
+
}
|
|
5235
|
+
/** @public @react */
|
|
5236
|
+
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;
|
|
5237
|
+
|
|
5000
5238
|
/** @public @react */
|
|
5001
5239
|
declare function DefaultQuickActionsContent(): react_jsx_runtime.JSX.Element | undefined;
|
|
5002
5240
|
|
|
@@ -5009,7 +5247,7 @@ declare function DefaultPeopleMenu({ children }: DefaultPeopleMenuProps): react_
|
|
|
5009
5247
|
|
|
5010
5248
|
/** @public */
|
|
5011
5249
|
interface DefaultPeopleMenuContentProps {
|
|
5012
|
-
userIds:
|
|
5250
|
+
userIds: DrUserId[];
|
|
5013
5251
|
}
|
|
5014
5252
|
/** @public @react */
|
|
5015
5253
|
declare function DefaultPeopleMenuContent({ userIds }: DefaultPeopleMenuContentProps): react_jsx_runtime.JSX.Element;
|
|
@@ -5122,8 +5360,13 @@ interface StylePanelDropdownPickerProps<T extends string> {
|
|
|
5122
5360
|
onValueChange?(style: StyleProp<T>, value: T): void;
|
|
5123
5361
|
/** Override the test ID prefix. Defaults to uiType. */
|
|
5124
5362
|
testIdType?: string;
|
|
5125
|
-
/**
|
|
5363
|
+
/**
|
|
5364
|
+
* Distance to push the popover left of the trigger so it lands flush with the style panel.
|
|
5365
|
+
* Defaults to the standard popover gap so standalone dropdowns don't sit flush against the panel.
|
|
5366
|
+
*/
|
|
5126
5367
|
sideOffset?: number;
|
|
5368
|
+
/** 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.*/
|
|
5369
|
+
isOverflow?: boolean;
|
|
5127
5370
|
}
|
|
5128
5371
|
/** @public @react */
|
|
5129
5372
|
declare const StylePanelDropdownPicker: <T extends string>(props: StylePanelDropdownPickerProps<T>) => React$1.JSX.Element;
|
|
@@ -5204,6 +5447,14 @@ declare function HandToolbarItem(): react_jsx_runtime.JSX.Element;
|
|
|
5204
5447
|
declare function DrawToolbarItem(): react_jsx_runtime.JSX.Element;
|
|
5205
5448
|
/** @public @react */
|
|
5206
5449
|
declare function EraserToolbarItem(): react_jsx_runtime.JSX.Element;
|
|
5450
|
+
/**
|
|
5451
|
+
* Renders the comment tool if it has been registered (e.g. via `@tldraw/commenting`) and commenting
|
|
5452
|
+
* is licensed. Renders nothing otherwise, so it's safe to include in the default toolbar for every
|
|
5453
|
+
* editor.
|
|
5454
|
+
*
|
|
5455
|
+
* @public @react
|
|
5456
|
+
*/
|
|
5457
|
+
declare function CommentToolbarItem(): react_jsx_runtime.JSX.Element | null;
|
|
5207
5458
|
/** @public @react */
|
|
5208
5459
|
declare function ArrowToolbarItem(): react_jsx_runtime.JSX.Element;
|
|
5209
5460
|
/** @public @react */
|
|
@@ -5351,12 +5602,19 @@ declare function DrawUiA11yProvider({ children }: A11yProviderProps): react_jsx_
|
|
|
5351
5602
|
/** @public */
|
|
5352
5603
|
declare function useA11y(): DrUiA11yContextType;
|
|
5353
5604
|
|
|
5354
|
-
/** @
|
|
5355
|
-
|
|
5605
|
+
/** @public */
|
|
5606
|
+
interface AssetUrlsProviderProps {
|
|
5356
5607
|
assetUrls: DrUiAssetUrls;
|
|
5357
5608
|
children: React.ReactNode;
|
|
5358
|
-
}
|
|
5359
|
-
/**
|
|
5609
|
+
}
|
|
5610
|
+
/**
|
|
5611
|
+
* Provides asset URLs (icons, fonts, translations, embed icons) to the editor's UI.
|
|
5612
|
+
* Required when using `DrawUiTranslationProvider` without `DrawUiContextProvider`.
|
|
5613
|
+
*
|
|
5614
|
+
* @public @react
|
|
5615
|
+
*/
|
|
5616
|
+
declare function AssetUrlsProvider({ assetUrls, children }: AssetUrlsProviderProps): react_jsx_runtime.JSX.Element;
|
|
5617
|
+
/** @public */
|
|
5360
5618
|
declare function useAssetUrls(): DrUiAssetUrls;
|
|
5361
5619
|
|
|
5362
5620
|
/** @public */
|
|
@@ -5390,7 +5648,7 @@ declare function useCanApplySelectionAction(): boolean;
|
|
|
5390
5648
|
*
|
|
5391
5649
|
* @public
|
|
5392
5650
|
*/
|
|
5393
|
-
declare
|
|
5651
|
+
declare function handleNativeOrMenuCopy(editor: Editor, context?: DrClipboardWriteInfo): Promise<boolean>;
|
|
5394
5652
|
/** @public */
|
|
5395
5653
|
declare function useMenuClipboardEvents(): {
|
|
5396
5654
|
copy: (source: DrUiEventSource) => Promise<void>;
|
|
@@ -5428,204 +5686,86 @@ declare function copyAs(editor: Editor, ids: DrShapeId[], opts: CopyAsOptions):
|
|
|
5428
5686
|
declare function useCopyAs(): (ids: DrShapeId[], format?: DrCopyType) => void;
|
|
5429
5687
|
|
|
5430
5688
|
/** @public */
|
|
5431
|
-
declare function useExportAs(): (ids: DrShapeId[], opts?: {
|
|
5432
|
-
format?: DrExportType;
|
|
5433
|
-
name?: string;
|
|
5434
|
-
scale?: number;
|
|
5435
|
-
}) => void;
|
|
5436
|
-
|
|
5437
|
-
/*!
|
|
5438
|
-
* The
|
|
5439
|
-
*
|
|
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.
|
|
5689
|
+
declare function useExportAs(): (ids: DrShapeId[], opts?: {
|
|
5690
|
+
format?: DrExportType;
|
|
5691
|
+
name?: string;
|
|
5692
|
+
scale?: number;
|
|
5693
|
+
}) => void;
|
|
5694
|
+
|
|
5695
|
+
/*!
|
|
5696
|
+
* The form-input filter pattern in `shouldSkipEvent` (including its list of non-text INPUT
|
|
5697
|
+
* types) is adapted from hotkeys-js, which this hook previously depended on.
|
|
5596
5698
|
*
|
|
5597
|
-
*
|
|
5699
|
+
* MIT License: https://github.com/jaywcjlove/hotkeys-js/blob/master/LICENSE
|
|
5700
|
+
* Copyright (c) 2015-present, Kenny Wong
|
|
5701
|
+
* Copyright (c) 2011-2013 Thomas Fuchs (https://github.com/madrobby/keymaster)
|
|
5702
|
+
* Source: https://github.com/jaywcjlove/hotkeys-js
|
|
5598
5703
|
*/
|
|
5599
|
-
|
|
5704
|
+
|
|
5705
|
+
/** @public */
|
|
5706
|
+
declare function useKeyboardShortcuts(): void;
|
|
5707
|
+
|
|
5708
|
+
/** @public */
|
|
5709
|
+
declare function useLocalStorageState<T = any>(key: string, defaultValue: T): readonly [T, (setter: T | ((value: T) => T)) => void];
|
|
5710
|
+
|
|
5711
|
+
/** @public */
|
|
5712
|
+
declare function useMenuIsOpen(id: string, cb?: (isOpen: boolean) => void): readonly [boolean, (isOpen: boolean) => void];
|
|
5713
|
+
|
|
5714
|
+
/** @public */
|
|
5715
|
+
declare function useReadonly(): boolean;
|
|
5716
|
+
|
|
5717
|
+
/** @public */
|
|
5718
|
+
declare function useRelevantStyles(stylesToCheck?: readonly StyleProp<any>[]): ReadonlySharedStyleMap | null;
|
|
5719
|
+
|
|
5720
|
+
/** @public */
|
|
5721
|
+
interface BoxWidthHeight {
|
|
5722
|
+
w: number;
|
|
5723
|
+
h: number;
|
|
5724
|
+
}
|
|
5600
5725
|
/**
|
|
5601
|
-
*
|
|
5602
|
-
* @param editor - The editor instance.
|
|
5603
|
-
* @param richText - The rich text content.
|
|
5726
|
+
* Contains the size within the given box size
|
|
5604
5727
|
*
|
|
5728
|
+
* @param originalSize - The size of the asset
|
|
5729
|
+
* @param containBoxSize - The container size
|
|
5730
|
+
* @returns Adjusted size
|
|
5605
5731
|
* @public
|
|
5606
5732
|
*/
|
|
5607
|
-
declare function
|
|
5733
|
+
declare function containBoxSize(originalSize: BoxWidthHeight, containBoxSize: BoxWidthHeight): BoxWidthHeight;
|
|
5608
5734
|
/**
|
|
5609
|
-
*
|
|
5610
|
-
* @param editor - The editor instance.
|
|
5611
|
-
* @param richText - The rich text content.
|
|
5735
|
+
* Resize an image Blob to be smaller than it is currently.
|
|
5612
5736
|
*
|
|
5613
|
-
* @
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
*
|
|
5618
|
-
*
|
|
5619
|
-
* @param richText - The rich text content.
|
|
5737
|
+
* @example
|
|
5738
|
+
* ```ts
|
|
5739
|
+
* const image = await (await fetch('/image.jpg')).blob()
|
|
5740
|
+
* const size = await getImageSize(image)
|
|
5741
|
+
* const resizedImage = await downsizeImage(image, size.w / 2, size.h / 2, { type: "image/jpeg", quality: 0.85 })
|
|
5742
|
+
* ```
|
|
5620
5743
|
*
|
|
5744
|
+
* @param image - The image Blob.
|
|
5745
|
+
* @param width - The desired width.
|
|
5746
|
+
* @param height - The desired height.
|
|
5747
|
+
* @param opts - Options for the image.
|
|
5621
5748
|
* @public
|
|
5622
5749
|
*/
|
|
5623
|
-
declare function
|
|
5624
|
-
|
|
5625
|
-
|
|
5750
|
+
declare function downsizeImage(blob: Blob, width: number, height: number, opts?: {
|
|
5751
|
+
type?: string;
|
|
5752
|
+
quality?: number;
|
|
5753
|
+
}): Promise<Blob>;
|
|
5626
5754
|
|
|
5627
5755
|
/** @public */
|
|
5628
|
-
|
|
5756
|
+
interface DrTypeFace {
|
|
5757
|
+
url: string;
|
|
5758
|
+
display?: any;
|
|
5759
|
+
featureSettings?: string;
|
|
5760
|
+
stretch?: string;
|
|
5761
|
+
style?: string;
|
|
5762
|
+
unicodeRange?: string;
|
|
5763
|
+
variant?: string;
|
|
5764
|
+
weight?: string;
|
|
5765
|
+
format?: string;
|
|
5766
|
+
}
|
|
5767
|
+
/** @public */
|
|
5768
|
+
declare function preloadFont(id: string, font: DrTypeFace, targetDocument?: Document): Promise<FontFace>;
|
|
5629
5769
|
|
|
5630
5770
|
/** @internal */
|
|
5631
5771
|
declare function buildFromV1Document(editor: Editor, _document: unknown): void;
|
|
@@ -5938,4 +6078,278 @@ declare function serializeDrawJsonBlob(editor: Editor): Promise<Blob>;
|
|
|
5938
6078
|
/** @internal */
|
|
5939
6079
|
declare function parseAndLoadDocument(editor: Editor, document: string, msg: (id: DrUiTranslationKey | Exclude<string, DrUiTranslationKey>) => string, addToast: DrUiToastsContextType['addToast'], onV1FileLoad?: () => void, forceDarkMode?: boolean): Promise<void>;
|
|
5940
6080
|
|
|
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 };
|
|
6081
|
+
/**
|
|
6082
|
+
* Put excalidraw clipboard content onto the current page.
|
|
6083
|
+
*
|
|
6084
|
+
* @param editor - The editor instance.
|
|
6085
|
+
* @param excalidrawClipboardContent - The excalidraw clipboard model.
|
|
6086
|
+
* @param point - The point at which to put the excalidraw content.
|
|
6087
|
+
* @public
|
|
6088
|
+
*/
|
|
6089
|
+
declare function putExcalidrawContent(editor: Editor, excalidrawClipboardContent: any, point?: VecLike): Promise<void>;
|
|
6090
|
+
|
|
6091
|
+
/** @public */
|
|
6092
|
+
interface ExportAsOptions extends DrImageExportOptions {
|
|
6093
|
+
/** {@inheritdoc @ibodr/editor#DrImageExportOptions.format} */
|
|
6094
|
+
format: DrExportType;
|
|
6095
|
+
/** Name of the exported file. If undefined a predefined name, based on the selection, will be used. */
|
|
6096
|
+
name?: string;
|
|
6097
|
+
}
|
|
6098
|
+
/**
|
|
6099
|
+
* Export the given shapes as files.
|
|
6100
|
+
*
|
|
6101
|
+
* @param editor - The editor instance.
|
|
6102
|
+
* @param ids - The ids of the shapes to export.
|
|
6103
|
+
* @param opts - Options for the export.
|
|
6104
|
+
*
|
|
6105
|
+
* @public
|
|
6106
|
+
*/
|
|
6107
|
+
declare function exportAs(editor: Editor, ids: DrShapeId[], opts: ExportAsOptions): Promise<void>;
|
|
6108
|
+
/** @internal */
|
|
6109
|
+
declare function downloadFile(file: File, doc?: Document): void;
|
|
6110
|
+
|
|
6111
|
+
/**
|
|
6112
|
+
* Remove a frame (or any frame-like container shape).
|
|
6113
|
+
*
|
|
6114
|
+
* @param editor - tldraw editor instance.
|
|
6115
|
+
* @param ids - Ids of the frames you wish to remove.
|
|
6116
|
+
*
|
|
6117
|
+
* @public
|
|
6118
|
+
*/
|
|
6119
|
+
declare function removeFrame(editor: Editor, ids: DrShapeId[]): void;
|
|
6120
|
+
/**
|
|
6121
|
+
* Fit a frame (or any frame-like container shape) to its content.
|
|
6122
|
+
*
|
|
6123
|
+
* @param id - Id of the frame you wish to fit to content.
|
|
6124
|
+
* @param editor - tlraw editor instance.
|
|
6125
|
+
* @param opts - Options for fitting the frame.
|
|
6126
|
+
*
|
|
6127
|
+
* @public
|
|
6128
|
+
*/
|
|
6129
|
+
declare function fitFrameToContent(editor: Editor, id: DrShapeId, opts?: {
|
|
6130
|
+
padding: number;
|
|
6131
|
+
}): void;
|
|
6132
|
+
|
|
6133
|
+
/*!
|
|
6134
|
+
* SVG/attribute allowlists and URI sanitization approach derived from DOMPurify.
|
|
6135
|
+
* DOMPurify — MIT License, Copyright (c) 2015 Mario Heiderich
|
|
6136
|
+
* https://github.com/cure53/DOMPurify/blob/main/LICENSE
|
|
6137
|
+
*/
|
|
6138
|
+
/**
|
|
6139
|
+
* Sanitizes an SVG string by removing dangerous elements, attributes, and URIs
|
|
6140
|
+
* while preserving safe content including foreignObject (for text rendering),
|
|
6141
|
+
* style elements (for fonts with data: URLs), and animation elements.
|
|
6142
|
+
* Embedded SVG data URIs on `<image>`/`<feImage>` are recursively sanitized.
|
|
6143
|
+
*
|
|
6144
|
+
* Returns the sanitized SVG string, or an empty string if the input was
|
|
6145
|
+
* malformed (parse error) or contained no safe content after sanitization.
|
|
6146
|
+
*
|
|
6147
|
+
* @public
|
|
6148
|
+
*/
|
|
6149
|
+
declare function sanitizeSvg(svgText: string): string;
|
|
6150
|
+
|
|
6151
|
+
/** @public */
|
|
6152
|
+
declare const KeyboardShiftEnterTweakExtension: Extension<any, any>;
|
|
6153
|
+
/**
|
|
6154
|
+
* Build tldraw's default TipTap extension set, optionally overriding the bundled `StarterKit`
|
|
6155
|
+
* options. The one lever most consumers want is turning individual nodes off (e.g. comments use a
|
|
6156
|
+
* headingless set via `getTipTapDefaultExtensions({ heading: false })`); because `StarterKit` is a
|
|
6157
|
+
* single umbrella extension, its sub-extensions can only be disabled through its config, not by
|
|
6158
|
+
* filtering the returned array.
|
|
6159
|
+
*
|
|
6160
|
+
* @public
|
|
6161
|
+
*/
|
|
6162
|
+
declare function getTipTapDefaultExtensions(starterKitOptions?: Partial<StarterKitOptions>): Extensions;
|
|
6163
|
+
/**
|
|
6164
|
+
* Default extensions for the TipTap editor.
|
|
6165
|
+
*
|
|
6166
|
+
* @public
|
|
6167
|
+
*/
|
|
6168
|
+
declare const tipTapDefaultExtensions: Extensions;
|
|
6169
|
+
/**
|
|
6170
|
+
* Renders HTML from a rich text string using an explicit set of TipTap extensions, rather than the
|
|
6171
|
+
* ones configured on an editor. Use this when rendering rich text outside of a shape's editor
|
|
6172
|
+
* config (e.g. comments, which render through their own headingless extension set).
|
|
6173
|
+
*
|
|
6174
|
+
* @param richText - The rich text content.
|
|
6175
|
+
* @param extensions - The TipTap extensions to render with.
|
|
6176
|
+
*
|
|
6177
|
+
* @public
|
|
6178
|
+
*/
|
|
6179
|
+
declare function renderHtmlFromRichTextWithExtensions(richText: DrRichText, extensions: Extensions): string;
|
|
6180
|
+
/**
|
|
6181
|
+
* Renders HTML from a rich text string.
|
|
6182
|
+
*
|
|
6183
|
+
* @param editor - The editor instance.
|
|
6184
|
+
* @param richText - The rich text content.
|
|
6185
|
+
*
|
|
6186
|
+
* @public
|
|
6187
|
+
*/
|
|
6188
|
+
declare function renderHtmlFromRichText(editor: Editor, richText: DrRichText): string;
|
|
6189
|
+
/**
|
|
6190
|
+
* Renders HTML from a rich text string for measurement.
|
|
6191
|
+
* @param editor - The editor instance.
|
|
6192
|
+
* @param richText - The rich text content.
|
|
6193
|
+
*
|
|
6194
|
+
* @public
|
|
6195
|
+
*/
|
|
6196
|
+
declare function renderHtmlFromRichTextForMeasurement(editor: Editor, richText: DrRichText): string;
|
|
6197
|
+
/**
|
|
6198
|
+
* Renders plaintext from a rich text string.
|
|
6199
|
+
* @param editor - The editor instance.
|
|
6200
|
+
* @param richText - The rich text content.
|
|
6201
|
+
*
|
|
6202
|
+
* @public
|
|
6203
|
+
*/
|
|
6204
|
+
declare function renderPlaintextFromRichText(editor: Editor, richText: DrRichText): string;
|
|
6205
|
+
/**
|
|
6206
|
+
* Renders JSONContent from html.
|
|
6207
|
+
* @param editor - The editor instance.
|
|
6208
|
+
* @param richText - The rich text content.
|
|
6209
|
+
*
|
|
6210
|
+
* @public
|
|
6211
|
+
*/
|
|
6212
|
+
declare function renderRichTextFromHTML(editor: Editor, html: string): DrRichText;
|
|
6213
|
+
/** @public */
|
|
6214
|
+
declare function defaultAddFontsFromNode(node: Node, state: RichTextFontVisitorState, addFont: (font: DrFontFace) => void): RichTextFontVisitorState;
|
|
6215
|
+
|
|
6216
|
+
/** @public */
|
|
6217
|
+
declare function truncateStringWithEllipsis(str: string, maxLength: number): string;
|
|
6218
|
+
|
|
6219
|
+
interface TaskItemOptions {
|
|
6220
|
+
/**
|
|
6221
|
+
* A callback function that is called when the checkbox is clicked while the editor is in readonly mode.
|
|
6222
|
+
* @param node The prosemirror node of the task item
|
|
6223
|
+
* @param checked The new checked state
|
|
6224
|
+
* @returns boolean
|
|
6225
|
+
*/
|
|
6226
|
+
onReadOnlyChecked?: (node: Node, checked: boolean) => boolean;
|
|
6227
|
+
/**
|
|
6228
|
+
* Controls whether the task items can be nested or not.
|
|
6229
|
+
* @default false
|
|
6230
|
+
* @example true
|
|
6231
|
+
*/
|
|
6232
|
+
nested: boolean;
|
|
6233
|
+
/**
|
|
6234
|
+
* HTML attributes to add to the task item element.
|
|
6235
|
+
* @default {}
|
|
6236
|
+
* @example { class: 'foo' }
|
|
6237
|
+
*/
|
|
6238
|
+
HTMLAttributes: Record<string, any>;
|
|
6239
|
+
/**
|
|
6240
|
+
* The node type for taskList nodes
|
|
6241
|
+
* @default 'taskList'
|
|
6242
|
+
* @example 'myCustomTaskList'
|
|
6243
|
+
*/
|
|
6244
|
+
taskListTypeName: string;
|
|
6245
|
+
/**
|
|
6246
|
+
* Accessibility options for the task item.
|
|
6247
|
+
* @default {}
|
|
6248
|
+
* @example
|
|
6249
|
+
* ```js
|
|
6250
|
+
* {
|
|
6251
|
+
* checkboxLabel: (node) => `Task item: ${node.textContent || 'empty task item'}`
|
|
6252
|
+
* }
|
|
6253
|
+
*/
|
|
6254
|
+
a11y?: {
|
|
6255
|
+
checkboxLabel?: (node: Node, checked: boolean) => string;
|
|
6256
|
+
};
|
|
6257
|
+
}
|
|
6258
|
+
/**
|
|
6259
|
+
* This extension allows you to create task items.
|
|
6260
|
+
* @see https://www.tiptap.dev/api/nodes/task-item
|
|
6261
|
+
*/
|
|
6262
|
+
declare const TaskItem: Node$1<TaskItemOptions, any>;
|
|
6263
|
+
|
|
6264
|
+
interface TaskListOptions {
|
|
6265
|
+
/**
|
|
6266
|
+
* The node type name for a task item.
|
|
6267
|
+
* @default 'taskItem'
|
|
6268
|
+
* @example 'myCustomTaskItem'
|
|
6269
|
+
*/
|
|
6270
|
+
itemTypeName: string;
|
|
6271
|
+
/**
|
|
6272
|
+
* The HTML attributes for a task list node.
|
|
6273
|
+
* @default {}
|
|
6274
|
+
* @example { class: 'foo' }
|
|
6275
|
+
*/
|
|
6276
|
+
HTMLAttributes: Record<string, any>;
|
|
6277
|
+
}
|
|
6278
|
+
declare module '@tiptap/core' {
|
|
6279
|
+
interface Commands<ReturnType> {
|
|
6280
|
+
bulletList: {
|
|
6281
|
+
/**
|
|
6282
|
+
* Toggle a bullet list
|
|
6283
|
+
*/
|
|
6284
|
+
toggleBulletList: () => ReturnType;
|
|
6285
|
+
};
|
|
6286
|
+
}
|
|
6287
|
+
}
|
|
6288
|
+
declare module '@tiptap/core' {
|
|
6289
|
+
interface Commands<ReturnType> {
|
|
6290
|
+
orderedList: {
|
|
6291
|
+
/**
|
|
6292
|
+
* Toggle an ordered list
|
|
6293
|
+
* @example editor.commands.toggleOrderedList()
|
|
6294
|
+
*/
|
|
6295
|
+
toggleOrderedList: () => ReturnType;
|
|
6296
|
+
};
|
|
6297
|
+
}
|
|
6298
|
+
}
|
|
6299
|
+
declare module '@tiptap/core' {
|
|
6300
|
+
interface Commands<ReturnType> {
|
|
6301
|
+
taskList: {
|
|
6302
|
+
/**
|
|
6303
|
+
* Toggle a task list
|
|
6304
|
+
* @example editor.commands.toggleTaskList()
|
|
6305
|
+
*/
|
|
6306
|
+
toggleTaskList: () => ReturnType;
|
|
6307
|
+
};
|
|
6308
|
+
}
|
|
6309
|
+
}
|
|
6310
|
+
/**
|
|
6311
|
+
* This extension allows you to create task lists.
|
|
6312
|
+
* @see https://www.tiptap.dev/api/nodes/task-list
|
|
6313
|
+
*/
|
|
6314
|
+
declare const TaskList: Node$1<TaskListOptions, any>;
|
|
6315
|
+
|
|
6316
|
+
/**
|
|
6317
|
+
* The pairs the selection gets wrapped in, keyed by the character you type: with `hello` selected,
|
|
6318
|
+
* typing `(` gives `(hello)` and typing `¡` gives `¡hello!`.
|
|
6319
|
+
*
|
|
6320
|
+
* Either half of a pair wraps in the whole pair. `¡` and `¿` are out of reach on most keyboard
|
|
6321
|
+
* layouts, so typing the `!` or `?` that closes them has to work too.
|
|
6322
|
+
*
|
|
6323
|
+
* A straight quote wraps in the curly pair, because {@link https://tiptap.dev/docs/editor/extensions/functionality/typography | Typography}
|
|
6324
|
+
* turns a typed `"` into `“` or `”` anyway. Inside code or monospace text it wraps in straight
|
|
6325
|
+
* quotes. Pass your own `pairs` to {@link WrapSelectionExtension} to wrap in straight quotes
|
|
6326
|
+
* everywhere, or to add pairs of your own.
|
|
6327
|
+
*
|
|
6328
|
+
* @public
|
|
6329
|
+
*/
|
|
6330
|
+
declare const defaultWrappingPairs: Record<string, readonly [string, string]>;
|
|
6331
|
+
/**
|
|
6332
|
+
* Options for {@link WrapSelectionExtension}.
|
|
6333
|
+
*
|
|
6334
|
+
* @public
|
|
6335
|
+
*/
|
|
6336
|
+
interface WrapSelectionOptions {
|
|
6337
|
+
/**
|
|
6338
|
+
* The `[opening, closing]` pair to wrap the selection in, keyed by the character typed.
|
|
6339
|
+
* Defaults to {@link defaultWrappingPairs}.
|
|
6340
|
+
*/
|
|
6341
|
+
pairs: Record<string, readonly [string, string]>;
|
|
6342
|
+
}
|
|
6343
|
+
/**
|
|
6344
|
+
* Wraps the selected text in a pair of matching characters instead of replacing it: select `hello`,
|
|
6345
|
+
* press `¡` or `!`, and you get `¡hello!`. See {@link defaultWrappingPairs} for the pairs, which
|
|
6346
|
+
* can be replaced or extended through the extension's `pairs` option.
|
|
6347
|
+
*
|
|
6348
|
+
* A backtick is the exception: it toggles the `code` mark on the selection instead, when the schema
|
|
6349
|
+
* has one.
|
|
6350
|
+
*
|
|
6351
|
+
* @public
|
|
6352
|
+
*/
|
|
6353
|
+
declare const WrapSelectionExtension: Extension<WrapSelectionOptions, any>;
|
|
6354
|
+
|
|
6355
|
+
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 };
|