@ibodr/draw 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _ibodr_editor from '@ibodr/editor';
2
- import { Vec, DrDrawShapeSegment, VecModel, PerfectDashTerminal, VecLike, Geometry2dOptions, Geometry2d, Geometry2dFilters, Group2d, Editor, DrShape, DrShapeId, DrEventInfo, DrPointerEventInfo, LANGUAGES, RecursivePartial, AssetUtil, DrBookmarkAsset, DrImageAsset, DrAssetId, DrVideoAsset, OverlayUtil, DrOverlay, BindingUtil, DrArrowBinding, DrArrowBindingProps, BindingOnCreateOptions, BindingOnChangeOptions, BindingOnShapeChangeOptions, BindingOnShapeIsolateOptions, OverlayOptionsWithDisplayValues, DrScribble, DrHandle, DrCursorType, DrSelectionHandle, RotateCorner, SnapIndicator, ShapeIndicatorOverlayUtil, Atom, DrBookmarkShape, DrAsset, DrContent, DrFileExternalAsset, DrFileReplaceExternalContent, DrUrlExternalAsset, StateNode, DrStateNodeConstructor, BaseBoxShapeTool, DrTheme, Box, DrArrowShape, DrDefaultSizeStyle, DrArrowShapeArrowheadStyle, ShapeUtil, DrShapeUtilCanBindOpts, DrShapeUtilCanBeLaidOutOpts, DrHandleDragInfo, DrArrowShapeProps, DrResizeInfo, DrShapePartial, SvgExportContext, DrShapeUtilCanvasSvgDef, BaseBoxShapeUtil, DrBookmarkShapeProps, DrDrawShape, Polyline2d, Circle2d, DrDrawShapeProps, DrEmbedShape, DrEmbedShapeProps, DrFrameShape, BaseFrameLikeShapeUtil, DrShapeUtilConstructor, DrEditStartInfo, DrFrameShapeProps, DrClickEventInfo, DrGeoShape, HandleSnapGeometry, DrGeoShapeProps, DrHighlightShape, Polygon2d, DrHighlightShapeProps, DrImageShape, DrImageShapeProps, DrLineShape, DrLineShapePoint, DrNoteShape, IndexKey, DrNoteShapeProps, DrTextShape, DrGeometryOpts, Rectangle2d, DrVideoShape, DrKeyboardEventInfo, DrArrowShapeKind, ElbowArrowSnap, Result, ShapeWithCrop, DrCropInfo, DrShapeCrop, DrFontFace, ExtractShapeByProps, DrRichText, DrThemeColors, ReadonlySharedStyleMap, DrEditorComponents, DrawEditorBaseProps, DrTextOptions, DrawEditorStoreProps, DrImageExportOptions, DrEditorSnapshot, DrStoreSnapshot, DrPageId, DrAnyShapeUtilConstructor, DrAnyBindingUtilConstructor, DrawOptions, DebugFlag, StyleProp, SharedStyle, TiptapEditor, DrClipboardWriteInfo, DrExportType, RichTextFontVisitorState, SerializedSchema, UnknownRecord, MigrationFailureReason, DrSchema, DrStore } from '@ibodr/editor';
2
+ import { Vec, DrDrawShapeSegment, VecModel, PerfectDashTerminal, VecLike, Geometry2dOptions, Geometry2d, Geometry2dFilters, Group2d, Editor, DrShape, DrShapeId, DrEventInfo, DrPointerEventInfo, AssetUtil, DrBookmarkAsset, DrImageAsset, DrAssetId, DrVideoAsset, OverlayUtil, DrOverlay, BindingUtil, DrArrowBinding, DrArrowBindingProps, BindingOnCreateOptions, BindingOnChangeOptions, BindingOnShapeChangeOptions, BindingOnShapeIsolateOptions, OverlayOptionsWithDisplayValues, DrScribble, DrHandle, DrCursorType, DrSelectionHandle, RotateCorner, SnapIndicator, ShapeIndicatorOverlayUtil, Atom, DrBookmarkShape, DrAsset, DrContent, DrFileExternalAsset, DrFileReplaceExternalContent, DrUrlExternalAsset, StateNode, DrStateNodeConstructor, BaseBoxShapeTool, DrTheme, Box, DrArrowShape, DrDefaultSizeStyle, DrArrowShapeArrowheadStyle, ShapeUtil, DrShapeUtilCanBindOpts, DrShapeUtilCanBeLaidOutOpts, DrHandleDragInfo, DrArrowShapeProps, DrResizeInfo, DrShapePartial, SvgExportContext, DrShapeUtilCanvasSvgDef, BaseBoxShapeUtil, DrBookmarkShapeProps, DrDrawShape, Polyline2d, Circle2d, DrDrawShapeProps, DrEmbedShape, DrEmbedShapeProps, DrFrameShape, BaseFrameLikeShapeUtil, DrShapeUtilConstructor, DrEditStartInfo, DrFrameShapeProps, DrClickEventInfo, DrGeoShape, HandleSnapGeometry, DrGeoShapeProps, DrHighlightShape, Polygon2d, DrHighlightShapeProps, DrImageShape, DrImageShapeProps, DrLineShape, DrLineShapePoint, DrNoteShape, IndexKey, DrNoteShapeProps, DrTextShape, DrGeometryOpts, Rectangle2d, DrVideoShape, DrKeyboardEventInfo, DrArrowShapeKind, ElbowArrowSnap, Result, ShapeWithCrop, DrCropInfo, DrShapeCrop, DrFontFace, ExtractShapeByProps, DrRichText, DrThemeColors, RecursivePartial, ReadonlySharedStyleMap, DrEditorComponents, DrawEditorBaseProps, DrTextOptions, DrawEditorStoreProps, DrImageExportOptions, DrEditorSnapshot, DrStoreSnapshot, DrPageId, DrAnyShapeUtilConstructor, DrAnyBindingUtilConstructor, DrawOptions, DebugFlag, StyleProp, SharedStyle, TiptapEditor, DrClipboardWriteInfo, DrExportType, RichTextFontVisitorState, SerializedSchema, UnknownRecord, MigrationFailureReason, DrSchema, DrStore } from '@ibodr/editor';
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';
@@ -585,326 +585,6 @@ declare const DefaultToasts: React$1.NamedExoticComponent<object>;
585
585
  /** @public */
586
586
  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.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';
587
587
 
588
- /** @public */
589
- declare const DEFAULT_EMBED_DEFINITIONS: readonly [{
590
- readonly type: "tldraw";
591
- readonly title: "tldraw";
592
- readonly hostnames: readonly ["beta.draw.com", "tldraw.com", "localhost:3000"];
593
- readonly minWidth: 300;
594
- readonly minHeight: 300;
595
- readonly width: 720;
596
- readonly height: 500;
597
- readonly doesResize: true;
598
- readonly overridePermissions: {
599
- readonly 'allow-top-navigation': true;
600
- };
601
- readonly toEmbedUrl: (url: string) => string | undefined;
602
- readonly fromEmbedUrl: (url: string) => string | undefined;
603
- readonly embedOnPaste: false;
604
- }, {
605
- readonly type: "figma";
606
- readonly title: "Figma";
607
- readonly hostnames: readonly ["figma.com"];
608
- readonly width: 720;
609
- readonly height: 500;
610
- readonly doesResize: true;
611
- readonly toEmbedUrl: (url: string) => string | undefined;
612
- readonly fromEmbedUrl: (url: string) => string | undefined;
613
- readonly embedOnPaste: true;
614
- }, {
615
- readonly type: "canva";
616
- readonly title: "Canva";
617
- readonly hostnames: readonly ["canva.com"];
618
- readonly width: 720;
619
- readonly height: 500;
620
- readonly doesResize: true;
621
- readonly toEmbedUrl: (url: string) => string | undefined;
622
- readonly fromEmbedUrl: (url: string) => string | undefined;
623
- readonly embedOnPaste: true;
624
- }, {
625
- readonly type: "google_maps";
626
- readonly title: "Google Maps";
627
- readonly hostnames: readonly ["google.*"];
628
- readonly width: 720;
629
- readonly height: 500;
630
- readonly doesResize: true;
631
- readonly overridePermissions: {
632
- readonly 'allow-presentation': true;
633
- };
634
- readonly toEmbedUrl: (url: string) => string | undefined;
635
- readonly fromEmbedUrl: (url: string) => string | undefined;
636
- readonly embedOnPaste: true;
637
- }, {
638
- readonly type: "val_town";
639
- readonly title: "Val Town";
640
- readonly hostnames: readonly ["val.town"];
641
- readonly minWidth: 260;
642
- readonly minHeight: 100;
643
- readonly width: 720;
644
- readonly height: 500;
645
- readonly doesResize: true;
646
- readonly toEmbedUrl: (url: string) => string | undefined;
647
- readonly fromEmbedUrl: (url: string) => string | undefined;
648
- readonly embedOnPaste: true;
649
- }, {
650
- readonly type: "codesandbox";
651
- readonly title: "CodeSandbox";
652
- readonly hostnames: readonly ["codesandbox.io"];
653
- readonly minWidth: 300;
654
- readonly minHeight: 300;
655
- readonly width: 720;
656
- readonly height: 500;
657
- readonly doesResize: true;
658
- readonly toEmbedUrl: (url: string) => string | undefined;
659
- readonly fromEmbedUrl: (url: string) => string | undefined;
660
- readonly embedOnPaste: true;
661
- }, {
662
- readonly type: "codepen";
663
- readonly title: "Codepen";
664
- readonly hostnames: readonly ["codepen.io"];
665
- readonly minWidth: 300;
666
- readonly minHeight: 300;
667
- readonly width: 520;
668
- readonly height: 400;
669
- readonly doesResize: true;
670
- readonly toEmbedUrl: (url: string) => string | undefined;
671
- readonly fromEmbedUrl: (url: string) => string | undefined;
672
- readonly embedOnPaste: true;
673
- }, {
674
- readonly type: "scratch";
675
- readonly title: "Scratch";
676
- readonly hostnames: readonly ["scratch.mit.edu"];
677
- readonly width: 520;
678
- readonly height: 400;
679
- readonly doesResize: false;
680
- readonly embedOnPaste: true;
681
- readonly toEmbedUrl: (url: string) => string | undefined;
682
- readonly fromEmbedUrl: (url: string) => string | undefined;
683
- }, {
684
- readonly type: "youtube";
685
- readonly title: "YouTube";
686
- readonly hostnames: readonly ["*.youtube.com", "youtube.com", "youtu.be"];
687
- readonly width: 800;
688
- readonly height: 450;
689
- readonly doesResize: true;
690
- readonly overridePermissions: {
691
- readonly 'allow-presentation': true;
692
- readonly 'allow-popups-to-escape-sandbox': true;
693
- };
694
- readonly isAspectRatioLocked: true;
695
- readonly embedOnPaste: true;
696
- readonly toEmbedUrl: (url: string) => string | undefined;
697
- readonly fromEmbedUrl: (url: string) => string | undefined;
698
- }, {
699
- readonly type: "google_calendar";
700
- readonly title: "Google Calendar";
701
- readonly hostnames: readonly ["calendar.google.*"];
702
- readonly width: 720;
703
- readonly height: 500;
704
- readonly minWidth: 460;
705
- readonly minHeight: 360;
706
- readonly doesResize: true;
707
- readonly instructionLink: "https://support.google.com/calendar/answer/41207?hl=en";
708
- readonly overridePermissions: {
709
- readonly 'allow-popups-to-escape-sandbox': true;
710
- };
711
- readonly embedOnPaste: true;
712
- readonly toEmbedUrl: (url: string) => string | undefined;
713
- readonly fromEmbedUrl: (url: string) => string | undefined;
714
- }, {
715
- readonly type: "google_slides";
716
- readonly title: "Google Slides";
717
- readonly hostnames: readonly ["docs.google.*"];
718
- readonly width: 720;
719
- readonly height: 500;
720
- readonly minWidth: 460;
721
- readonly minHeight: 360;
722
- readonly doesResize: true;
723
- readonly overridePermissions: {
724
- readonly 'allow-popups-to-escape-sandbox': true;
725
- };
726
- readonly embedOnPaste: true;
727
- readonly toEmbedUrl: (url: string) => string | undefined;
728
- readonly fromEmbedUrl: (url: string) => string | undefined;
729
- }, {
730
- readonly type: "github_gist";
731
- readonly title: "GitHub Gist";
732
- readonly hostnames: readonly ["gist.github.com"];
733
- readonly width: 720;
734
- readonly height: 500;
735
- readonly doesResize: true;
736
- readonly embedOnPaste: true;
737
- readonly toEmbedUrl: (url: string) => string | undefined;
738
- readonly fromEmbedUrl: (url: string) => string | undefined;
739
- }, {
740
- readonly type: "replit";
741
- readonly title: "Replit";
742
- readonly hostnames: readonly ["replit.com"];
743
- readonly width: 720;
744
- readonly height: 500;
745
- readonly doesResize: true;
746
- readonly embedOnPaste: true;
747
- readonly toEmbedUrl: (url: string) => string | undefined;
748
- readonly fromEmbedUrl: (url: string) => string | undefined;
749
- }, {
750
- readonly type: "felt";
751
- readonly title: "Felt";
752
- readonly hostnames: readonly ["felt.com"];
753
- readonly width: 720;
754
- readonly height: 500;
755
- readonly doesResize: true;
756
- readonly embedOnPaste: true;
757
- readonly toEmbedUrl: (url: string) => string | undefined;
758
- readonly fromEmbedUrl: (url: string) => string | undefined;
759
- }, {
760
- readonly type: "spotify";
761
- readonly title: "Spotify";
762
- readonly hostnames: readonly ["open.spotify.com"];
763
- readonly width: 720;
764
- readonly height: 500;
765
- readonly minHeight: 500;
766
- readonly overrideOutlineRadius: 12;
767
- readonly doesResize: true;
768
- readonly embedOnPaste: true;
769
- readonly toEmbedUrl: (url: string) => string | undefined;
770
- readonly fromEmbedUrl: (url: string) => string | undefined;
771
- }, {
772
- readonly type: "vimeo";
773
- readonly title: "Vimeo";
774
- readonly hostnames: readonly ["vimeo.com", "player.vimeo.com"];
775
- readonly width: 640;
776
- readonly height: 360;
777
- readonly doesResize: true;
778
- readonly isAspectRatioLocked: true;
779
- readonly embedOnPaste: true;
780
- readonly toEmbedUrl: (url: string) => string | undefined;
781
- readonly fromEmbedUrl: (url: string) => string | undefined;
782
- }, {
783
- readonly type: "observable";
784
- readonly title: "Observable";
785
- readonly hostnames: readonly ["observablehq.com"];
786
- readonly width: 720;
787
- readonly height: 500;
788
- readonly doesResize: true;
789
- readonly isAspectRatioLocked: false;
790
- readonly backgroundColor: "#fff";
791
- readonly embedOnPaste: true;
792
- readonly toEmbedUrl: (url: string) => string | undefined;
793
- readonly fromEmbedUrl: (url: string) => string | undefined;
794
- }, {
795
- readonly type: "desmos";
796
- readonly title: "Desmos";
797
- readonly hostnames: readonly ["desmos.com"];
798
- readonly width: 700;
799
- readonly height: 450;
800
- readonly doesResize: true;
801
- readonly embedOnPaste: true;
802
- readonly toEmbedUrl: (url: string) => string | undefined;
803
- readonly fromEmbedUrl: (url: string) => string | undefined;
804
- }];
805
- /**
806
- * Permissions with note inline from
807
- * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-sandbox
808
- *
809
- * @public
810
- */
811
- declare const embedShapePermissionDefaults: {
812
- readonly 'allow-downloads-without-user-activation': false;
813
- readonly 'allow-downloads': false;
814
- readonly 'allow-modals': false;
815
- readonly 'allow-orientation-lock': false;
816
- readonly 'allow-pointer-lock': false;
817
- readonly 'allow-popups': true;
818
- readonly 'allow-popups-to-escape-sandbox': false;
819
- readonly 'allow-presentation': false;
820
- readonly 'allow-storage-access-by-user-activation': false;
821
- readonly 'allow-top-navigation': false;
822
- readonly 'allow-top-navigation-by-user-activation': false;
823
- readonly 'allow-scripts': true;
824
- readonly 'allow-same-origin': true;
825
- readonly 'allow-forms': true;
826
- };
827
- /** @public */
828
- type DrEmbedShapePermissions = {
829
- [K in keyof typeof embedShapePermissionDefaults]?: boolean;
830
- };
831
- /**
832
- * Overrides for unknown/arbitrary embeds that aren't in the curated embed definitions list.
833
- * These restrict the most dangerous sandbox permissions to mitigate:
834
- * - Same-origin sandbox escape (allow-scripts + allow-same-origin lets the iframe remove its own sandbox)
835
- * - Phishing via embedded forms
836
- * - Popup-based social engineering
837
- *
838
- * @public
839
- */
840
- declare const unknownEmbedShapePermissionOverrides: DrEmbedShapePermissions;
841
- /** @public */
842
- interface EmbedDefinition {
843
- readonly type: string;
844
- readonly title: string;
845
- readonly hostnames: readonly string[];
846
- readonly minWidth?: number;
847
- readonly minHeight?: number;
848
- readonly width: number;
849
- readonly height: number;
850
- readonly doesResize: boolean;
851
- readonly isAspectRatioLocked?: boolean;
852
- readonly overridePermissions?: DrEmbedShapePermissions;
853
- readonly instructionLink?: string;
854
- readonly backgroundColor?: string;
855
- readonly embedOnPaste?: boolean;
856
- readonly canEditWhileLocked?: boolean;
857
- readonly overrideOutlineRadius?: number;
858
- readonly toEmbedUrl: (url: string) => string | undefined;
859
- readonly fromEmbedUrl: (url: string) => string | undefined;
860
- }
861
- /** @public */
862
- interface CustomEmbedDefinition extends EmbedDefinition {
863
- readonly icon: string;
864
- }
865
- /** @public */
866
- type DrEmbedDefinition = EmbedDefinition | CustomEmbedDefinition;
867
- /** @public */
868
- type DefaultEmbedDefinitionType = (typeof DEFAULT_EMBED_DEFINITIONS)[number]['type'];
869
-
870
- /** @public */
871
- interface DrEditorAssetUrls {
872
- fonts?: {
873
- draw_mono?: string;
874
- draw_mono_italic?: string;
875
- draw_mono_bold?: string;
876
- draw_mono_italic_bold?: string;
877
- draw_serif?: string;
878
- draw_serif_italic?: string;
879
- draw_serif_bold?: string;
880
- draw_serif_italic_bold?: string;
881
- draw_sans?: string;
882
- draw_sans_italic?: string;
883
- draw_sans_bold?: string;
884
- draw_sans_italic_bold?: string;
885
- draw_draw?: string;
886
- draw_draw_italic?: string;
887
- draw_draw_bold?: string;
888
- draw_draw_italic_bold?: string;
889
- [key: string]: string | undefined;
890
- };
891
- }
892
- /** @public */
893
- declare let defaultEditorAssetUrls: DrEditorAssetUrls;
894
- /** @internal */
895
- declare function setDefaultEditorAssetUrls(assetUrls: DrEditorAssetUrls): void;
896
-
897
- /** @public */
898
- interface DrUiAssetUrls extends DrEditorAssetUrls {
899
- icons: Record<DrUiIconType | Exclude<string, DrUiIconType>, string>;
900
- translations: Record<(typeof LANGUAGES)[number]['locale'], string>;
901
- embedIcons: Partial<Record<(typeof DEFAULT_EMBED_DEFINITIONS)[number]['type'], string>>;
902
- }
903
- /** @public */
904
- type DrUiAssetUrlOverrides = RecursivePartial<DrUiAssetUrls>;
905
- /** @internal */
906
- declare function setDefaultUiAssetUrls(urls: DrUiAssetUrls): void;
907
-
908
588
  /** @public */
909
589
  declare const RTL_LANGUAGES: Set<string>;
910
590
  /** @public */
@@ -1364,108 +1044,390 @@ interface DrShapeHandleOverlay extends DrOverlay {
1364
1044
  shapeId: DrShapeId;
1365
1045
  handle: DrHandle;
1366
1046
  };
1367
- }
1047
+ }
1048
+ /**
1049
+ * Overlay util for shape handles (arrow endpoints, line vertices, etc.).
1050
+ *
1051
+ * @public
1052
+ */
1053
+ declare class ShapeHandleOverlayUtil extends OverlayUtil<DrShapeHandleOverlay> {
1054
+ static type: string;
1055
+ options: {
1056
+ zIndex: number;
1057
+ lineWidth: number;
1058
+ };
1059
+ isActive(): boolean;
1060
+ getOverlays(): DrShapeHandleOverlay[];
1061
+ getGeometry(overlay: DrShapeHandleOverlay): Geometry2d | null;
1062
+ getCursor(_overlay: DrShapeHandleOverlay): DrCursorType | undefined;
1063
+ render(ctx: CanvasRenderingContext2D, overlays: DrShapeHandleOverlay[]): void;
1064
+ }
1065
+
1066
+ /** @public */
1067
+ interface DrSelectionForegroundOverlay extends DrOverlay {
1068
+ props: {
1069
+ overlayType: 'resize_handle' | 'rotate_handle' | 'mobile_rotate';
1070
+ handle: DrSelectionHandle | RotateCorner;
1071
+ };
1072
+ }
1073
+ /**
1074
+ * Overlay util for selection foreground handles (resize corners/edges, rotate corners, mobile rotate).
1075
+ * Each interactive element of the selection foreground becomes its own overlay instance.
1076
+ *
1077
+ * @public
1078
+ */
1079
+ declare class SelectionForegroundOverlayUtil extends OverlayUtil<DrSelectionForegroundOverlay> {
1080
+ static type: string;
1081
+ options: {
1082
+ zIndex: number;
1083
+ lineWidth: number;
1084
+ };
1085
+ isActive(): boolean;
1086
+ getOverlays(): DrSelectionForegroundOverlay[];
1087
+ getGeometry(overlay: DrSelectionForegroundOverlay): Geometry2d | null;
1088
+ render(ctx: CanvasRenderingContext2D, _overlays: DrSelectionForegroundOverlay[]): void;
1089
+ getCursor(overlay: DrSelectionForegroundOverlay): DrCursorType | undefined;
1090
+ private _collectResizeCornerOverlays;
1091
+ private _collectResizeEdgeOverlays;
1092
+ private _collectRotateOverlays;
1093
+ private _getResizeHandleGeometry;
1094
+ private _getRotateHandleGeometry;
1095
+ private _getMobileRotateGeometry;
1096
+ private _renderSelectionBox;
1097
+ private _renderResizeCorners;
1098
+ private _renderCropHandles;
1099
+ private _renderMobileRotateHandle;
1100
+ private _renderTextResizeHandles;
1101
+ /**
1102
+ * Single source of truth for the derived state the selection foreground needs.
1103
+ * Called from `getOverlays()`, `getGeometry()`, and `render()` so their visibility
1104
+ * predicates can't drift. Returns `null` when no selection UI should appear at all
1105
+ * (nothing selected, or the only selected shape is hidden).
1106
+ */
1107
+ private _computeSelectionState;
1108
+ private _getMobileRotateCenter;
1109
+ private _getThemeColors;
1110
+ private _makeOverlay;
1111
+ private _getEdgeLocalPoints;
1112
+ private _getRotateHandleLocalCenter;
1113
+ private _getCornerLocalPoint;
1114
+ private _localRectToPoints;
1115
+ }
1116
+
1117
+ /** @public */
1118
+ interface DrSnapIndicatorOverlay extends DrOverlay {
1119
+ props: {
1120
+ line: SnapIndicator;
1121
+ };
1122
+ }
1123
+ /**
1124
+ * Overlay util for snap alignment indicators (point snap lines and gap indicators).
1125
+ *
1126
+ * @public
1127
+ */
1128
+ declare class SnapIndicatorOverlayUtil extends OverlayUtil<DrSnapIndicatorOverlay> {
1129
+ static type: string;
1130
+ options: {
1131
+ zIndex: number;
1132
+ lineWidth: number;
1133
+ };
1134
+ isActive(): boolean;
1135
+ getOverlays(): DrSnapIndicatorOverlay[];
1136
+ render(ctx: CanvasRenderingContext2D, overlays: DrSnapIndicatorOverlay[]): void;
1137
+ private _renderPoints;
1138
+ private _renderGaps;
1139
+ }
1140
+
1141
+ /** @public */
1142
+ declare const defaultAssetUtils: readonly [typeof ImageAssetUtil, typeof VideoAssetUtil, typeof BookmarkAssetUtil];
1143
+
1144
+ /** @public */
1145
+ declare const defaultBindingUtils: readonly [typeof ArrowBindingUtil];
1146
+
1147
+ /** @public */
1148
+ 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, typeof CollaboratorCursorOverlayUtil];
1149
+
1150
+ /** @public */
1151
+ declare const DEFAULT_EMBED_DEFINITIONS: readonly [{
1152
+ readonly type: "tldraw";
1153
+ readonly title: "tldraw";
1154
+ readonly hostnames: readonly ["beta.draw.com", "tldraw.com", "localhost:3000"];
1155
+ readonly minWidth: 300;
1156
+ readonly minHeight: 300;
1157
+ readonly width: 720;
1158
+ readonly height: 500;
1159
+ readonly doesResize: true;
1160
+ readonly overridePermissions: {
1161
+ readonly 'allow-top-navigation': true;
1162
+ };
1163
+ readonly toEmbedUrl: (url: string) => string | undefined;
1164
+ readonly fromEmbedUrl: (url: string) => string | undefined;
1165
+ readonly embedOnPaste: false;
1166
+ }, {
1167
+ readonly type: "figma";
1168
+ readonly title: "Figma";
1169
+ readonly hostnames: readonly ["figma.com"];
1170
+ readonly width: 720;
1171
+ readonly height: 500;
1172
+ readonly doesResize: true;
1173
+ readonly toEmbedUrl: (url: string) => string | undefined;
1174
+ readonly fromEmbedUrl: (url: string) => string | undefined;
1175
+ readonly embedOnPaste: true;
1176
+ }, {
1177
+ readonly type: "canva";
1178
+ readonly title: "Canva";
1179
+ readonly hostnames: readonly ["canva.com"];
1180
+ readonly width: 720;
1181
+ readonly height: 500;
1182
+ readonly doesResize: true;
1183
+ readonly toEmbedUrl: (url: string) => string | undefined;
1184
+ readonly fromEmbedUrl: (url: string) => string | undefined;
1185
+ readonly embedOnPaste: true;
1186
+ }, {
1187
+ readonly type: "google_maps";
1188
+ readonly title: "Google Maps";
1189
+ readonly hostnames: readonly ["google.*"];
1190
+ readonly width: 720;
1191
+ readonly height: 500;
1192
+ readonly doesResize: true;
1193
+ readonly overridePermissions: {
1194
+ readonly 'allow-presentation': true;
1195
+ };
1196
+ readonly toEmbedUrl: (url: string) => string | undefined;
1197
+ readonly fromEmbedUrl: (url: string) => string | undefined;
1198
+ readonly embedOnPaste: true;
1199
+ }, {
1200
+ readonly type: "val_town";
1201
+ readonly title: "Val Town";
1202
+ readonly hostnames: readonly ["val.town"];
1203
+ readonly minWidth: 260;
1204
+ readonly minHeight: 100;
1205
+ readonly width: 720;
1206
+ readonly height: 500;
1207
+ readonly doesResize: true;
1208
+ readonly toEmbedUrl: (url: string) => string | undefined;
1209
+ readonly fromEmbedUrl: (url: string) => string | undefined;
1210
+ readonly embedOnPaste: true;
1211
+ }, {
1212
+ readonly type: "codesandbox";
1213
+ readonly title: "CodeSandbox";
1214
+ readonly hostnames: readonly ["codesandbox.io"];
1215
+ readonly minWidth: 300;
1216
+ readonly minHeight: 300;
1217
+ readonly width: 720;
1218
+ readonly height: 500;
1219
+ readonly doesResize: true;
1220
+ readonly toEmbedUrl: (url: string) => string | undefined;
1221
+ readonly fromEmbedUrl: (url: string) => string | undefined;
1222
+ readonly embedOnPaste: true;
1223
+ }, {
1224
+ readonly type: "codepen";
1225
+ readonly title: "Codepen";
1226
+ readonly hostnames: readonly ["codepen.io"];
1227
+ readonly minWidth: 300;
1228
+ readonly minHeight: 300;
1229
+ readonly width: 520;
1230
+ readonly height: 400;
1231
+ readonly doesResize: true;
1232
+ readonly toEmbedUrl: (url: string) => string | undefined;
1233
+ readonly fromEmbedUrl: (url: string) => string | undefined;
1234
+ readonly embedOnPaste: true;
1235
+ }, {
1236
+ readonly type: "scratch";
1237
+ readonly title: "Scratch";
1238
+ readonly hostnames: readonly ["scratch.mit.edu"];
1239
+ readonly width: 520;
1240
+ readonly height: 400;
1241
+ readonly doesResize: false;
1242
+ readonly embedOnPaste: true;
1243
+ readonly toEmbedUrl: (url: string) => string | undefined;
1244
+ readonly fromEmbedUrl: (url: string) => string | undefined;
1245
+ }, {
1246
+ readonly type: "youtube";
1247
+ readonly title: "YouTube";
1248
+ readonly hostnames: readonly ["*.youtube.com", "youtube.com", "youtu.be"];
1249
+ readonly width: 800;
1250
+ readonly height: 450;
1251
+ readonly doesResize: true;
1252
+ readonly overridePermissions: {
1253
+ readonly 'allow-presentation': true;
1254
+ readonly 'allow-popups-to-escape-sandbox': true;
1255
+ };
1256
+ readonly isAspectRatioLocked: true;
1257
+ readonly embedOnPaste: true;
1258
+ readonly toEmbedUrl: (url: string) => string | undefined;
1259
+ readonly fromEmbedUrl: (url: string) => string | undefined;
1260
+ }, {
1261
+ readonly type: "google_calendar";
1262
+ readonly title: "Google Calendar";
1263
+ readonly hostnames: readonly ["calendar.google.*"];
1264
+ readonly width: 720;
1265
+ readonly height: 500;
1266
+ readonly minWidth: 460;
1267
+ readonly minHeight: 360;
1268
+ readonly doesResize: true;
1269
+ readonly instructionLink: "https://support.google.com/calendar/answer/41207?hl=en";
1270
+ readonly overridePermissions: {
1271
+ readonly 'allow-popups-to-escape-sandbox': true;
1272
+ };
1273
+ readonly embedOnPaste: true;
1274
+ readonly toEmbedUrl: (url: string) => string | undefined;
1275
+ readonly fromEmbedUrl: (url: string) => string | undefined;
1276
+ }, {
1277
+ readonly type: "google_slides";
1278
+ readonly title: "Google Slides";
1279
+ readonly hostnames: readonly ["docs.google.*"];
1280
+ readonly width: 720;
1281
+ readonly height: 500;
1282
+ readonly minWidth: 460;
1283
+ readonly minHeight: 360;
1284
+ readonly doesResize: true;
1285
+ readonly overridePermissions: {
1286
+ readonly 'allow-popups-to-escape-sandbox': true;
1287
+ };
1288
+ readonly embedOnPaste: true;
1289
+ readonly toEmbedUrl: (url: string) => string | undefined;
1290
+ readonly fromEmbedUrl: (url: string) => string | undefined;
1291
+ }, {
1292
+ readonly type: "github_gist";
1293
+ readonly title: "GitHub Gist";
1294
+ readonly hostnames: readonly ["gist.github.com"];
1295
+ readonly width: 720;
1296
+ readonly height: 500;
1297
+ readonly doesResize: true;
1298
+ readonly embedOnPaste: true;
1299
+ readonly toEmbedUrl: (url: string) => string | undefined;
1300
+ readonly fromEmbedUrl: (url: string) => string | undefined;
1301
+ }, {
1302
+ readonly type: "replit";
1303
+ readonly title: "Replit";
1304
+ readonly hostnames: readonly ["replit.com"];
1305
+ readonly width: 720;
1306
+ readonly height: 500;
1307
+ readonly doesResize: true;
1308
+ readonly embedOnPaste: true;
1309
+ readonly toEmbedUrl: (url: string) => string | undefined;
1310
+ readonly fromEmbedUrl: (url: string) => string | undefined;
1311
+ }, {
1312
+ readonly type: "felt";
1313
+ readonly title: "Felt";
1314
+ readonly hostnames: readonly ["felt.com"];
1315
+ readonly width: 720;
1316
+ readonly height: 500;
1317
+ readonly doesResize: true;
1318
+ readonly embedOnPaste: true;
1319
+ readonly toEmbedUrl: (url: string) => string | undefined;
1320
+ readonly fromEmbedUrl: (url: string) => string | undefined;
1321
+ }, {
1322
+ readonly type: "spotify";
1323
+ readonly title: "Spotify";
1324
+ readonly hostnames: readonly ["open.spotify.com"];
1325
+ readonly width: 720;
1326
+ readonly height: 500;
1327
+ readonly minHeight: 500;
1328
+ readonly overrideOutlineRadius: 12;
1329
+ readonly doesResize: true;
1330
+ readonly embedOnPaste: true;
1331
+ readonly toEmbedUrl: (url: string) => string | undefined;
1332
+ readonly fromEmbedUrl: (url: string) => string | undefined;
1333
+ }, {
1334
+ readonly type: "vimeo";
1335
+ readonly title: "Vimeo";
1336
+ readonly hostnames: readonly ["vimeo.com", "player.vimeo.com"];
1337
+ readonly width: 640;
1338
+ readonly height: 360;
1339
+ readonly doesResize: true;
1340
+ readonly isAspectRatioLocked: true;
1341
+ readonly embedOnPaste: true;
1342
+ readonly toEmbedUrl: (url: string) => string | undefined;
1343
+ readonly fromEmbedUrl: (url: string) => string | undefined;
1344
+ }, {
1345
+ readonly type: "observable";
1346
+ readonly title: "Observable";
1347
+ readonly hostnames: readonly ["observablehq.com"];
1348
+ readonly width: 720;
1349
+ readonly height: 500;
1350
+ readonly doesResize: true;
1351
+ readonly isAspectRatioLocked: false;
1352
+ readonly backgroundColor: "#fff";
1353
+ readonly embedOnPaste: true;
1354
+ readonly toEmbedUrl: (url: string) => string | undefined;
1355
+ readonly fromEmbedUrl: (url: string) => string | undefined;
1356
+ }, {
1357
+ readonly type: "desmos";
1358
+ readonly title: "Desmos";
1359
+ readonly hostnames: readonly ["desmos.com"];
1360
+ readonly width: 700;
1361
+ readonly height: 450;
1362
+ readonly doesResize: true;
1363
+ readonly embedOnPaste: true;
1364
+ readonly toEmbedUrl: (url: string) => string | undefined;
1365
+ readonly fromEmbedUrl: (url: string) => string | undefined;
1366
+ }];
1368
1367
  /**
1369
- * Overlay util for shape handles (arrow endpoints, line vertices, etc.).
1368
+ * Permissions with note inline from
1369
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-sandbox
1370
1370
  *
1371
1371
  * @public
1372
1372
  */
1373
- declare class ShapeHandleOverlayUtil extends OverlayUtil<DrShapeHandleOverlay> {
1374
- static type: string;
1375
- options: {
1376
- zIndex: number;
1377
- lineWidth: number;
1378
- };
1379
- isActive(): boolean;
1380
- getOverlays(): DrShapeHandleOverlay[];
1381
- getGeometry(overlay: DrShapeHandleOverlay): Geometry2d | null;
1382
- getCursor(_overlay: DrShapeHandleOverlay): DrCursorType | undefined;
1383
- render(ctx: CanvasRenderingContext2D, overlays: DrShapeHandleOverlay[]): void;
1384
- }
1385
-
1373
+ declare const embedShapePermissionDefaults: {
1374
+ readonly 'allow-downloads-without-user-activation': false;
1375
+ readonly 'allow-downloads': false;
1376
+ readonly 'allow-modals': false;
1377
+ readonly 'allow-orientation-lock': false;
1378
+ readonly 'allow-pointer-lock': false;
1379
+ readonly 'allow-popups': true;
1380
+ readonly 'allow-popups-to-escape-sandbox': false;
1381
+ readonly 'allow-presentation': false;
1382
+ readonly 'allow-storage-access-by-user-activation': false;
1383
+ readonly 'allow-top-navigation': false;
1384
+ readonly 'allow-top-navigation-by-user-activation': false;
1385
+ readonly 'allow-scripts': true;
1386
+ readonly 'allow-same-origin': true;
1387
+ readonly 'allow-forms': true;
1388
+ };
1386
1389
  /** @public */
1387
- interface DrSelectionForegroundOverlay extends DrOverlay {
1388
- props: {
1389
- overlayType: 'resize_handle' | 'rotate_handle' | 'mobile_rotate';
1390
- handle: DrSelectionHandle | RotateCorner;
1391
- };
1392
- }
1390
+ type DrEmbedShapePermissions = {
1391
+ [K in keyof typeof embedShapePermissionDefaults]?: boolean;
1392
+ };
1393
1393
  /**
1394
- * Overlay util for selection foreground handles (resize corners/edges, rotate corners, mobile rotate).
1395
- * Each interactive element of the selection foreground becomes its own overlay instance.
1394
+ * Overrides for unknown/arbitrary embeds that aren't in the curated embed definitions list.
1395
+ * These restrict the most dangerous sandbox permissions to mitigate:
1396
+ * - Same-origin sandbox escape (allow-scripts + allow-same-origin lets the iframe remove its own sandbox)
1397
+ * - Phishing via embedded forms
1398
+ * - Popup-based social engineering
1396
1399
  *
1397
1400
  * @public
1398
1401
  */
1399
- declare class SelectionForegroundOverlayUtil extends OverlayUtil<DrSelectionForegroundOverlay> {
1400
- static type: string;
1401
- options: {
1402
- zIndex: number;
1403
- lineWidth: number;
1404
- };
1405
- isActive(): boolean;
1406
- getOverlays(): DrSelectionForegroundOverlay[];
1407
- getGeometry(overlay: DrSelectionForegroundOverlay): Geometry2d | null;
1408
- render(ctx: CanvasRenderingContext2D, _overlays: DrSelectionForegroundOverlay[]): void;
1409
- getCursor(overlay: DrSelectionForegroundOverlay): DrCursorType | undefined;
1410
- private _collectResizeCornerOverlays;
1411
- private _collectResizeEdgeOverlays;
1412
- private _collectRotateOverlays;
1413
- private _getResizeHandleGeometry;
1414
- private _getRotateHandleGeometry;
1415
- private _getMobileRotateGeometry;
1416
- private _renderSelectionBox;
1417
- private _renderResizeCorners;
1418
- private _renderCropHandles;
1419
- private _renderMobileRotateHandle;
1420
- private _renderTextResizeHandles;
1421
- /**
1422
- * Single source of truth for the derived state the selection foreground needs.
1423
- * Called from `getOverlays()`, `getGeometry()`, and `render()` so their visibility
1424
- * predicates can't drift. Returns `null` when no selection UI should appear at all
1425
- * (nothing selected, or the only selected shape is hidden).
1426
- */
1427
- private _computeSelectionState;
1428
- private _getMobileRotateCenter;
1429
- private _getThemeColors;
1430
- private _makeOverlay;
1431
- private _getEdgeLocalPoints;
1432
- private _getRotateHandleLocalCenter;
1433
- private _getCornerLocalPoint;
1434
- private _localRectToPoints;
1435
- }
1436
-
1402
+ declare const unknownEmbedShapePermissionOverrides: DrEmbedShapePermissions;
1437
1403
  /** @public */
1438
- interface DrSnapIndicatorOverlay extends DrOverlay {
1439
- props: {
1440
- line: SnapIndicator;
1441
- };
1442
- }
1443
- /**
1444
- * Overlay util for snap alignment indicators (point snap lines and gap indicators).
1445
- *
1446
- * @public
1447
- */
1448
- declare class SnapIndicatorOverlayUtil extends OverlayUtil<DrSnapIndicatorOverlay> {
1449
- static type: string;
1450
- options: {
1451
- zIndex: number;
1452
- lineWidth: number;
1453
- };
1454
- isActive(): boolean;
1455
- getOverlays(): DrSnapIndicatorOverlay[];
1456
- render(ctx: CanvasRenderingContext2D, overlays: DrSnapIndicatorOverlay[]): void;
1457
- private _renderPoints;
1458
- private _renderGaps;
1404
+ interface EmbedDefinition {
1405
+ readonly type: string;
1406
+ readonly title: string;
1407
+ readonly hostnames: readonly string[];
1408
+ readonly minWidth?: number;
1409
+ readonly minHeight?: number;
1410
+ readonly width: number;
1411
+ readonly height: number;
1412
+ readonly doesResize: boolean;
1413
+ readonly isAspectRatioLocked?: boolean;
1414
+ readonly overridePermissions?: DrEmbedShapePermissions;
1415
+ readonly instructionLink?: string;
1416
+ readonly backgroundColor?: string;
1417
+ readonly embedOnPaste?: boolean;
1418
+ readonly canEditWhileLocked?: boolean;
1419
+ readonly overrideOutlineRadius?: number;
1420
+ readonly toEmbedUrl: (url: string) => string | undefined;
1421
+ readonly fromEmbedUrl: (url: string) => string | undefined;
1459
1422
  }
1460
-
1461
1423
  /** @public */
1462
- declare const defaultAssetUtils: readonly [typeof ImageAssetUtil, typeof VideoAssetUtil, typeof BookmarkAssetUtil];
1463
-
1424
+ interface CustomEmbedDefinition extends EmbedDefinition {
1425
+ readonly icon: string;
1426
+ }
1464
1427
  /** @public */
1465
- declare const defaultBindingUtils: readonly [typeof ArrowBindingUtil];
1466
-
1428
+ type DrEmbedDefinition = EmbedDefinition | CustomEmbedDefinition;
1467
1429
  /** @public */
1468
- 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, typeof CollaboratorCursorOverlayUtil];
1430
+ type DefaultEmbedDefinitionType = (typeof DEFAULT_EMBED_DEFINITIONS)[number]['type'];
1469
1431
 
1470
1432
  /** @public */
1471
1433
  type AlertSeverity = 'success' | 'info' | 'warning' | 'error';
@@ -3671,6 +3633,44 @@ declare function getColorStyleItems(colors: DrThemeColors): StyleValuesForUi<str
3671
3633
  */
3672
3634
  declare function getFontStyleItems(theme: DrTheme): StyleValuesForUi<string>;
3673
3635
 
3636
+ /** @public */
3637
+ interface DrEditorAssetUrls {
3638
+ fonts?: {
3639
+ draw_mono?: string;
3640
+ draw_mono_italic?: string;
3641
+ draw_mono_bold?: string;
3642
+ draw_mono_italic_bold?: string;
3643
+ draw_serif?: string;
3644
+ draw_serif_italic?: string;
3645
+ draw_serif_bold?: string;
3646
+ draw_serif_italic_bold?: string;
3647
+ draw_sans?: string;
3648
+ draw_sans_italic?: string;
3649
+ draw_sans_bold?: string;
3650
+ draw_sans_italic_bold?: string;
3651
+ draw_draw?: string;
3652
+ draw_draw_italic?: string;
3653
+ draw_draw_bold?: string;
3654
+ draw_draw_italic_bold?: string;
3655
+ [key: string]: string | undefined;
3656
+ };
3657
+ }
3658
+ /** @public */
3659
+ declare let defaultEditorAssetUrls: DrEditorAssetUrls;
3660
+ /** @internal */
3661
+ declare function setDefaultEditorAssetUrls(assetUrls: DrEditorAssetUrls): void;
3662
+
3663
+ /** @public */
3664
+ interface DrUiAssetUrls extends DrEditorAssetUrls {
3665
+ icons: Record<DrUiIconType | Exclude<string, DrUiIconType>, string>;
3666
+ translations: Record<string, string>;
3667
+ embedIcons: Partial<Record<(typeof DEFAULT_EMBED_DEFINITIONS)[number]['type'], string>>;
3668
+ }
3669
+ /** @public */
3670
+ type DrUiAssetUrlOverrides = RecursivePartial<DrUiAssetUrls>;
3671
+ /** @internal */
3672
+ declare function setDefaultUiAssetUrls(urls: DrUiAssetUrls): void;
3673
+
3674
3674
  /** @public */
3675
3675
  interface DrUiActionsMenuProps {
3676
3676
  children?: ReactNode;