tldraw 4.3.0-canary.e5f56251a468 → 4.3.0-canary.ef0248947f13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist-cjs/index.d.ts +3 -0
  2. package/dist-cjs/index.js +2 -1
  3. package/dist-cjs/index.js.map +2 -2
  4. package/dist-cjs/lib/ui/components/primitives/TldrawUiSlider.js +1 -1
  5. package/dist-cjs/lib/ui/components/primitives/TldrawUiSlider.js.map +2 -2
  6. package/dist-cjs/lib/ui/components/primitives/TldrawUiTooltip.js +143 -88
  7. package/dist-cjs/lib/ui/components/primitives/TldrawUiTooltip.js.map +2 -2
  8. package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuItem.js +1 -1
  9. package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuItem.js.map +2 -2
  10. package/dist-cjs/lib/ui/version.js +3 -3
  11. package/dist-cjs/lib/ui/version.js.map +1 -1
  12. package/dist-cjs/lib/utils/text/richText.js +7 -17
  13. package/dist-cjs/lib/utils/text/richText.js.map +3 -3
  14. package/dist-esm/index.d.mts +3 -0
  15. package/dist-esm/index.mjs +3 -1
  16. package/dist-esm/index.mjs.map +2 -2
  17. package/dist-esm/lib/ui/components/primitives/TldrawUiSlider.mjs +2 -2
  18. package/dist-esm/lib/ui/components/primitives/TldrawUiSlider.mjs.map +2 -2
  19. package/dist-esm/lib/ui/components/primitives/TldrawUiTooltip.mjs +151 -90
  20. package/dist-esm/lib/ui/components/primitives/TldrawUiTooltip.mjs.map +2 -2
  21. package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuItem.mjs +2 -2
  22. package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuItem.mjs.map +2 -2
  23. package/dist-esm/lib/ui/version.mjs +3 -3
  24. package/dist-esm/lib/ui/version.mjs.map +1 -1
  25. package/dist-esm/lib/utils/text/richText.mjs +3 -3
  26. package/dist-esm/lib/utils/text/richText.mjs.map +2 -2
  27. package/package.json +3 -3
  28. package/src/index.ts +1 -0
  29. package/src/lib/ui/components/primitives/TldrawUiSlider.tsx +2 -2
  30. package/src/lib/ui/components/primitives/TldrawUiTooltip.tsx +196 -108
  31. package/src/lib/ui/components/primitives/menus/TldrawUiMenuItem.tsx +2 -2
  32. package/src/lib/ui/version.ts +3 -3
  33. package/src/lib/utils/text/richText.ts +3 -3
  34. package/src/test/TldrawEditor.test.tsx +3 -2
  35. package/src/test/commands/putContent.test.ts +79 -1
@@ -1902,6 +1902,9 @@ export declare function HeartToolbarItem(): JSX_2.Element;
1902
1902
  /** @public @react */
1903
1903
  export declare function HexagonToolbarItem(): JSX_2.Element;
1904
1904
 
1905
+ /** @public */
1906
+ export declare function hideAllTooltips(): void;
1907
+
1905
1908
  /** @public */
1906
1909
  export declare interface HighlightShapeOptions {
1907
1910
  /**
package/dist-cjs/index.js CHANGED
@@ -344,6 +344,7 @@ __export(index_exports, {
344
344
  getStrokePoints: () => import_getStrokePoints.getStrokePoints,
345
345
  getSvgPathFromStrokePoints: () => import_svg.getSvgPathFromStrokePoints,
346
346
  getUncroppedSize: () => import_crop.getUncroppedSize,
347
+ hideAllTooltips: () => import_TldrawUiTooltip.hideAllTooltips,
347
348
  notifyIfFileNotAllowed: () => import_defaultExternalContentHandlers.notifyIfFileNotAllowed,
348
349
  onDragFromToolbarToCreateShape: () => import_useTools.onDragFromToolbarToCreateShape,
349
350
  parseAndLoadDocument: () => import_file.parseAndLoadDocument,
@@ -584,7 +585,7 @@ var import_buildFromV1Document = require("./lib/utils/tldr/buildFromV1Document")
584
585
  var import_file = require("./lib/utils/tldr/file");
585
586
  (0, import_editor.registerTldrawLibraryVersion)(
586
587
  "tldraw",
587
- "4.3.0-canary.e5f56251a468",
588
+ "4.3.0-canary.ef0248947f13",
588
589
  "cjs"
589
590
  );
590
591
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
- "sourcesContent": ["/// <reference types=\"react\" />\n\nimport { registerTldrawLibraryVersion } from '@tldraw/editor'\nexport {\n\tPathBuilder,\n\tPathBuilderGeometry2d,\n\ttype BasePathBuilderOpts,\n\ttype CubicBezierToPathBuilderCommand,\n\ttype DashedPathBuilderOpts,\n\ttype DrawPathBuilderDOpts,\n\ttype DrawPathBuilderOpts,\n\ttype LineToPathBuilderCommand,\n\ttype MoveToPathBuilderCommand,\n\ttype PathBuilderCommand,\n\ttype PathBuilderCommandBase,\n\ttype PathBuilderCommandInfo,\n\ttype PathBuilderCommandOpts,\n\ttype PathBuilderLineOpts,\n\ttype PathBuilderOpts,\n\ttype PathBuilderToDOpts,\n\ttype SolidPathBuilderOpts,\n} from './lib/shapes/shared/PathBuilder'\nexport { usePrefersReducedMotion } from './lib/shapes/shared/usePrefersReducedMotion'\nexport { DefaultA11yAnnouncer, useSelectedShapesAnnouncer } from './lib/ui/components/A11y'\nexport { AccessibilityMenu } from './lib/ui/components/AccessibilityMenu'\nexport { ColorSchemeMenu } from './lib/ui/components/ColorSchemeMenu'\nexport { DefaultFollowingIndicator } from './lib/ui/components/DefaultFollowingIndicator'\nexport { DefaultDialogs } from './lib/ui/components/Dialogs'\nexport {\n\tTldrawUiColumn,\n\tTldrawUiGrid,\n\tTldrawUiOrientationProvider,\n\tTldrawUiRow,\n\tuseTldrawUiOrientation,\n\ttype TldrawUiOrientationContext,\n\ttype TldrawUiOrientationProviderProps,\n\ttype TLUiLayoutProps,\n} from './lib/ui/components/primitives/layout'\nexport {\n\tTldrawUiMenuActionCheckboxItem,\n\ttype TLUiMenuActionCheckboxItemProps,\n} from './lib/ui/components/primitives/menus/TldrawUiMenuActionCheckboxItem'\nexport {\n\tTldrawUiMenuActionItem,\n\ttype TLUiMenuActionItemProps,\n} from './lib/ui/components/primitives/menus/TldrawUiMenuActionItem'\nexport {\n\tTldrawUiMenuToolItem,\n\ttype TLUiMenuToolItemProps,\n} from './lib/ui/components/primitives/menus/TldrawUiMenuToolItem'\nexport { DefaultToasts } from './lib/ui/components/Toasts'\nexport { TldrawUiTranslationProvider } from './lib/ui/hooks/useTranslation/useTranslation'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/editor'\nexport { ArrowBindingUtil } from './lib/bindings/arrow/ArrowBindingUtil'\nexport { TldrawCropHandles, type TldrawCropHandlesProps } from './lib/canvas/TldrawCropHandles'\nexport { TldrawHandles } from './lib/canvas/TldrawHandles'\nexport { TldrawArrowHints, TldrawOverlays } from './lib/canvas/TldrawOverlays'\nexport { TldrawScribble } from './lib/canvas/TldrawScribble'\nexport { TldrawSelectionForeground } from './lib/canvas/TldrawSelectionForeground'\nexport { TldrawShapeIndicators } from './lib/canvas/TldrawShapeIndicators'\nexport { defaultBindingUtils } from './lib/defaultBindingUtils'\nexport {\n\tDEFAULT_EMBED_DEFINITIONS,\n\tembedShapePermissionDefaults,\n\ttype CustomEmbedDefinition,\n\ttype DefaultEmbedDefinitionType,\n\ttype EmbedDefinition,\n\ttype TLEmbedDefinition,\n\ttype TLEmbedShapePermissions,\n} from './lib/defaultEmbedDefinitions'\nexport {\n\tcenterSelectionAroundPoint,\n\tcreateEmptyBookmarkShape,\n\tcreateShapesForAssets,\n\tDEFAULT_MAX_ASSET_SIZE,\n\tDEFAULT_MAX_IMAGE_DIMENSION,\n\tdefaultHandleExternalEmbedContent,\n\tdefaultHandleExternalExcalidrawContent,\n\tdefaultHandleExternalFileAsset,\n\tdefaultHandleExternalFileContent,\n\tdefaultHandleExternalSvgTextContent,\n\tdefaultHandleExternalTextContent,\n\tdefaultHandleExternalTldrawContent,\n\tdefaultHandleExternalUrlAsset,\n\tdefaultHandleExternalUrlContent,\n\tgetAssetInfo,\n\tgetMediaAssetInfoPartial,\n\tnotifyIfFileNotAllowed,\n\tregisterDefaultExternalContentHandlers,\n\ttype TLDefaultExternalContentHandlerOpts,\n\ttype TLExternalContentProps,\n} from './lib/defaultExternalContentHandlers'\nexport { defaultShapeTools } from './lib/defaultShapeTools'\nexport { defaultShapeUtils } from './lib/defaultShapeUtils'\nexport { registerDefaultSideEffects } from './lib/defaultSideEffects'\nexport { defaultTools } from './lib/defaultTools'\nexport {\n\ttype ArrowShapeOptions,\n\ttype TLArcArrowInfo,\n\ttype TLArcInfo,\n\ttype TLArrowInfo,\n\ttype TLArrowPoint,\n\ttype TLElbowArrowInfo,\n\ttype TLStraightArrowInfo,\n} from './lib/shapes/arrow/arrow-types'\nexport { ArrowShapeTool } from './lib/shapes/arrow/ArrowShapeTool'\nexport { ArrowShapeUtil } from './lib/shapes/arrow/ArrowShapeUtil'\nexport {\n\tclearArrowTargetState,\n\tgetArrowTargetState,\n\tupdateArrowTargetState,\n\ttype ArrowTargetState,\n\ttype UpdateArrowTargetStateOpts,\n} from './lib/shapes/arrow/arrowTargetState'\nexport {\n\ttype ElbowArrowBox,\n\ttype ElbowArrowBoxEdges,\n\ttype ElbowArrowBoxes,\n\ttype ElbowArrowEdge,\n\ttype ElbowArrowInfo,\n\ttype ElbowArrowInfoWithoutRoute,\n\ttype ElbowArrowMidpointHandle,\n\ttype ElbowArrowOptions,\n\ttype ElbowArrowRange,\n\ttype ElbowArrowRoute,\n\ttype ElbowArrowSide,\n\ttype ElbowArrowSideReason,\n\ttype ElbowArrowTargetBox,\n} from './lib/shapes/arrow/elbow/definitions'\nexport {\n\tgetArrowBindings,\n\tgetArrowInfo,\n\tgetArrowTerminalsInArrowSpace,\n\ttype TLArrowBindings,\n} from './lib/shapes/arrow/shared'\nexport { createBookmarkFromUrl } from './lib/shapes/bookmark/bookmarks'\nexport { BookmarkShapeUtil } from './lib/shapes/bookmark/BookmarkShapeUtil'\nexport { DrawShapeTool } from './lib/shapes/draw/DrawShapeTool'\nexport { DrawShapeUtil, type DrawShapeOptions } from './lib/shapes/draw/DrawShapeUtil'\nexport { EmbedShapeUtil } from './lib/shapes/embed/EmbedShapeUtil'\nexport { FrameShapeTool } from './lib/shapes/frame/FrameShapeTool'\nexport { FrameShapeUtil, type FrameShapeOptions } from './lib/shapes/frame/FrameShapeUtil'\nexport { GeoShapeTool } from './lib/shapes/geo/GeoShapeTool'\nexport { GeoShapeUtil } from './lib/shapes/geo/GeoShapeUtil'\nexport { HighlightShapeTool } from './lib/shapes/highlight/HighlightShapeTool'\nexport {\n\tHighlightShapeUtil,\n\ttype HighlightShapeOptions,\n} from './lib/shapes/highlight/HighlightShapeUtil'\nexport { ImageShapeUtil } from './lib/shapes/image/ImageShapeUtil'\nexport { LineShapeTool } from './lib/shapes/line/LineShapeTool'\nexport { LineShapeUtil } from './lib/shapes/line/LineShapeUtil'\nexport { NoteShapeTool } from './lib/shapes/note/NoteShapeTool'\nexport { NoteShapeUtil, type NoteShapeOptions } from './lib/shapes/note/NoteShapeUtil'\nexport {\n\tASPECT_RATIO_OPTIONS,\n\tASPECT_RATIO_TO_VALUE,\n\tgetCropBox,\n\tgetDefaultCrop,\n\tgetUncroppedSize,\n\ttype ASPECT_RATIO_OPTION,\n\ttype CropBoxOptions,\n} from './lib/shapes/shared/crop'\nexport {\n\tARROW_LABEL_FONT_SIZES,\n\tFONT_FAMILIES,\n\tFONT_SIZES,\n\tLABEL_FONT_SIZES,\n\tSTROKE_SIZES,\n\tTEXT_PROPS,\n} from './lib/shapes/shared/default-shape-constants'\nexport {\n\tallDefaultFontFaces,\n\tDefaultFontFaces,\n\ttype TLDefaultFont,\n\ttype TLDefaultFonts,\n} from './lib/shapes/shared/defaultFonts'\nexport { getStrokePoints } from './lib/shapes/shared/freehand/getStrokePoints'\nexport { getSvgPathFromStrokePoints } from './lib/shapes/shared/freehand/svg'\nexport { type StrokeOptions, type StrokePoint } from './lib/shapes/shared/freehand/types'\nexport { PlainTextLabel, type PlainTextLabelProps } from './lib/shapes/shared/PlainTextLabel'\nexport {\n\tRichTextLabel,\n\tRichTextSVG,\n\ttype RichTextLabelProps,\n\ttype RichTextSVGProps,\n} from './lib/shapes/shared/RichTextLabel'\nexport { useDefaultColorTheme } from './lib/shapes/shared/useDefaultColorTheme'\nexport { useEditablePlainText } from './lib/shapes/shared/useEditablePlainText'\nexport { useEditableRichText } from './lib/shapes/shared/useEditableRichText'\nexport {\n\tuseImageOrVideoAsset,\n\ttype UseImageOrVideoAssetOptions,\n} from './lib/shapes/shared/useImageOrVideoAsset'\nexport { PlainTextArea } from './lib/shapes/text/PlainTextArea'\nexport { RichTextArea, type TextAreaProps } from './lib/shapes/text/RichTextArea'\nexport { TextShapeTool } from './lib/shapes/text/TextShapeTool'\nexport { TextShapeUtil, type TextShapeOptions } from './lib/shapes/text/TextShapeUtil'\nexport { VideoShapeUtil, type VideoShapeOptions } from './lib/shapes/video/VideoShapeUtil'\nexport { type StyleValuesForUi } from './lib/styles'\nexport { Tldraw, type TLComponents, type TldrawBaseProps, type TldrawProps } from './lib/Tldraw'\nexport { TldrawImage, type TldrawImageProps } from './lib/TldrawImage'\nexport { EraserTool } from './lib/tools/EraserTool/EraserTool'\nexport { HandTool } from './lib/tools/HandTool/HandTool'\nexport { LaserTool } from './lib/tools/LaserTool/LaserTool'\nexport { getHitShapeOnCanvasPointerDown } from './lib/tools/selection-logic/getHitShapeOnCanvasPointerDown'\nexport { SelectTool } from './lib/tools/SelectTool/SelectTool'\nexport { ZoomTool } from './lib/tools/ZoomTool/ZoomTool'\nexport {\n\tsetDefaultUiAssetUrls,\n\ttype TLUiAssetUrlOverrides,\n\ttype TLUiAssetUrls,\n} from './lib/ui/assetUrls'\nexport {\n\tDefaultActionsMenu,\n\ttype TLUiActionsMenuProps,\n} from './lib/ui/components/ActionsMenu/DefaultActionsMenu'\nexport {\n\tAlignMenuItems,\n\tDefaultActionsMenuContent,\n\tDistributeMenuItems,\n\tGroupOrUngroupMenuItem,\n\tReorderMenuItems,\n\tRotateCWMenuItem,\n\tStackMenuItems,\n\tZoomOrRotateMenuItem,\n} from './lib/ui/components/ActionsMenu/DefaultActionsMenuContent'\nexport {\n\tDefaultContextMenu as ContextMenu,\n\tDefaultContextMenu,\n\ttype TLUiContextMenuProps,\n} from './lib/ui/components/ContextMenu/DefaultContextMenu'\nexport { DefaultContextMenuContent } from './lib/ui/components/ContextMenu/DefaultContextMenuContent'\nexport {\n\tDefaultDebugMenu,\n\ttype TLUiDebugMenuProps,\n} from './lib/ui/components/DebugMenu/DefaultDebugMenu'\nexport {\n\tDebugFlags,\n\tDefaultDebugMenuContent,\n\tExampleDialog,\n\tFeatureFlags,\n\ttype CustomDebugFlags,\n\ttype DebugFlagsProps,\n\ttype ExampleDialogProps,\n\ttype FeatureFlagsProps,\n} from './lib/ui/components/DebugMenu/DefaultDebugMenuContent'\nexport { DefaultMenuPanel } from './lib/ui/components/DefaultMenuPanel'\nexport {\n\tDefaultHelperButtons,\n\ttype TLUiHelperButtonsProps,\n} from './lib/ui/components/HelperButtons/DefaultHelperButtons'\nexport { DefaultHelperButtonsContent } from './lib/ui/components/HelperButtons/DefaultHelperButtonsContent'\nexport {\n\tDefaultHelpMenu,\n\ttype TLUiHelpMenuProps,\n} from './lib/ui/components/HelpMenu/DefaultHelpMenu'\nexport {\n\tDefaultHelpMenuContent,\n\tKeyboardShortcutsMenuItem,\n} from './lib/ui/components/HelpMenu/DefaultHelpMenuContent'\nexport {\n\tDefaultKeyboardShortcutsDialog,\n\ttype TLUiKeyboardShortcutsDialogProps,\n} from './lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialog'\nexport { DefaultKeyboardShortcutsDialogContent } from './lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent'\nexport { LanguageMenu } from './lib/ui/components/LanguageMenu'\nexport {\n\tDefaultMainMenu,\n\ttype TLUiMainMenuProps,\n} from './lib/ui/components/MainMenu/DefaultMainMenu'\nexport {\n\tDefaultMainMenuContent,\n\tEditSubmenu,\n\tExportFileContentSubMenu,\n\tExtrasGroup,\n\tLockGroup,\n\tMiscMenuGroup,\n\tPreferencesGroup,\n\tUndoRedoGroup,\n\tViewSubmenu,\n} from './lib/ui/components/MainMenu/DefaultMainMenuContent'\nexport {\n\tArrangeMenuSubmenu,\n\tClipboardMenuGroup,\n\tConversionsMenuGroup,\n\tConvertToBookmarkMenuItem,\n\tConvertToEmbedMenuItem,\n\tCopyAsMenuGroup,\n\tCopyMenuItem,\n\tCursorChatItem,\n\tCutMenuItem,\n\tDeleteMenuItem,\n\tDuplicateMenuItem,\n\tEditLinkMenuItem,\n\tEditMenuSubmenu,\n\tFitFrameToContentMenuItem,\n\tGroupMenuItem,\n\tMoveToPageMenu,\n\tPasteMenuItem,\n\tPrintItem,\n\tRemoveFrameMenuItem,\n\tReorderMenuSubmenu,\n\tSelectAllMenuItem,\n\tToggleAutoSizeMenuItem,\n\tToggleDebugModeItem,\n\tToggleDynamicSizeModeItem,\n\tToggleEdgeScrollingItem,\n\tToggleEnhancedA11yModeItem,\n\tToggleFocusModeItem,\n\tToggleGridItem,\n\tToggleKeyboardShortcutsItem,\n\tToggleLockMenuItem,\n\tTogglePasteAtCursorItem,\n\tToggleReduceMotionItem,\n\tToggleSnapModeItem,\n\tToggleToolLockItem,\n\tToggleTransparentBgMenuItem,\n\tToggleWrapModeItem,\n\tUngroupMenuItem,\n\tUnlockAllMenuItem,\n\tZoomTo100MenuItem,\n\tZoomToFitMenuItem,\n\tZoomToSelectionMenuItem,\n} from './lib/ui/components/menu-items'\nexport { DefaultMinimap } from './lib/ui/components/Minimap/DefaultMinimap'\nexport { MobileStylePanel } from './lib/ui/components/MobileStylePanel'\nexport { DefaultNavigationPanel } from './lib/ui/components/NavigationPanel/DefaultNavigationPanel'\nexport { OfflineIndicator } from './lib/ui/components/OfflineIndicator/OfflineIndicator'\nexport { DefaultPageMenu } from './lib/ui/components/PageMenu/DefaultPageMenu'\nexport { PageItemInput, type PageItemInputProps } from './lib/ui/components/PageMenu/PageItemInput'\nexport {\n\tPageItemSubmenu,\n\ttype PageItemSubmenuProps,\n} from './lib/ui/components/PageMenu/PageItemSubmenu'\nexport {\n\tTldrawUiButton,\n\ttype TLUiButtonProps,\n} from './lib/ui/components/primitives/Button/TldrawUiButton'\nexport {\n\tTldrawUiButtonCheck,\n\ttype TLUiButtonCheckProps,\n} from './lib/ui/components/primitives/Button/TldrawUiButtonCheck'\nexport {\n\tTldrawUiButtonIcon,\n\ttype TLUiButtonIconProps,\n} from './lib/ui/components/primitives/Button/TldrawUiButtonIcon'\nexport {\n\tTldrawUiButtonLabel,\n\ttype TLUiButtonLabelProps,\n} from './lib/ui/components/primitives/Button/TldrawUiButtonLabel'\nexport {\n\tTldrawUiMenuCheckboxItem,\n\ttype TLUiMenuCheckboxItemProps,\n} from './lib/ui/components/primitives/menus/TldrawUiMenuCheckboxItem'\nexport {\n\tTldrawUiMenuContextProvider,\n\ttype TLUiMenuContextProviderProps,\n\ttype TLUiMenuContextType,\n} from './lib/ui/components/primitives/menus/TldrawUiMenuContext'\nexport {\n\tTldrawUiMenuGroup,\n\ttype TLUiMenuGroupProps,\n} from './lib/ui/components/primitives/menus/TldrawUiMenuGroup'\nexport {\n\tTldrawUiMenuItem,\n\ttype TLUiMenuItemProps,\n} from './lib/ui/components/primitives/menus/TldrawUiMenuItem'\nexport {\n\tTldrawUiMenuSubmenu,\n\ttype TLUiMenuSubmenuProps,\n} from './lib/ui/components/primitives/menus/TldrawUiMenuSubmenu'\nexport {\n\tTldrawUiContextualToolbar,\n\ttype TLUiContextualToolbarProps,\n} from './lib/ui/components/primitives/TldrawUiContextualToolbar'\nexport {\n\tTldrawUiDialogBody,\n\tTldrawUiDialogCloseButton,\n\tTldrawUiDialogFooter,\n\tTldrawUiDialogHeader,\n\tTldrawUiDialogTitle,\n\ttype TLUiDialogBodyProps,\n\ttype TLUiDialogFooterProps,\n\ttype TLUiDialogHeaderProps,\n\ttype TLUiDialogTitleProps,\n} from './lib/ui/components/primitives/TldrawUiDialog'\nexport {\n\tTldrawUiDropdownMenuCheckboxItem,\n\tTldrawUiDropdownMenuContent,\n\tTldrawUiDropdownMenuGroup,\n\tTldrawUiDropdownMenuIndicator,\n\tTldrawUiDropdownMenuItem,\n\tTldrawUiDropdownMenuRoot,\n\tTldrawUiDropdownMenuSub,\n\tTldrawUiDropdownMenuSubTrigger,\n\tTldrawUiDropdownMenuTrigger,\n\ttype TLUiDropdownMenuCheckboxItemProps,\n\ttype TLUiDropdownMenuContentProps,\n\ttype TLUiDropdownMenuGroupProps,\n\ttype TLUiDropdownMenuItemProps,\n\ttype TLUiDropdownMenuRootProps,\n\ttype TLUiDropdownMenuSubProps,\n\ttype TLUiDropdownMenuSubTriggerProps,\n\ttype TLUiDropdownMenuTriggerProps,\n} from './lib/ui/components/primitives/TldrawUiDropdownMenu'\nexport {\n\tTldrawUiIcon,\n\ttype TLUiIconJsx,\n\ttype TLUiIconProps,\n} from './lib/ui/components/primitives/TldrawUiIcon'\nexport { TldrawUiInput, type TLUiInputProps } from './lib/ui/components/primitives/TldrawUiInput'\nexport { TldrawUiKbd, type TLUiKbdProps } from './lib/ui/components/primitives/TldrawUiKbd'\nexport {\n\tTldrawUiPopover,\n\tTldrawUiPopoverContent,\n\tTldrawUiPopoverTrigger,\n\ttype TLUiPopoverContentProps,\n\ttype TLUiPopoverProps,\n\ttype TLUiPopoverTriggerProps,\n} from './lib/ui/components/primitives/TldrawUiPopover'\nexport { TldrawUiSlider, type TLUiSliderProps } from './lib/ui/components/primitives/TldrawUiSlider'\nexport {\n\tTldrawUiToolbar,\n\tTldrawUiToolbarButton,\n\tTldrawUiToolbarToggleGroup,\n\tTldrawUiToolbarToggleItem,\n\ttype TLUiToolbarButtonProps,\n\ttype TLUiToolbarProps,\n\ttype TLUiToolbarToggleGroupProps,\n\ttype TLUiToolbarToggleItemProps,\n} from './lib/ui/components/primitives/TldrawUiToolbar'\nexport {\n\tTldrawUiTooltip,\n\tTldrawUiTooltipProvider,\n\ttype TldrawUiTooltipProps,\n\ttype TldrawUiTooltipProviderProps,\n} from './lib/ui/components/primitives/TldrawUiTooltip'\nexport {\n\tDefaultQuickActions,\n\ttype TLUiQuickActionsProps,\n} from './lib/ui/components/QuickActions/DefaultQuickActions'\nexport { DefaultQuickActionsContent } from './lib/ui/components/QuickActions/DefaultQuickActionsContent'\nexport { DefaultSharePanel } from './lib/ui/components/SharePanel/DefaultSharePanel'\nexport { PeopleMenu, type PeopleMenuProps } from './lib/ui/components/SharePanel/PeopleMenu'\nexport { Spinner } from './lib/ui/components/Spinner'\nexport {\n\tDefaultStylePanel,\n\ttype TLUiStylePanelProps,\n} from './lib/ui/components/StylePanel/DefaultStylePanel'\nexport {\n\tDefaultStylePanelContent,\n\tStylePanelArrowheadPicker,\n\tStylePanelArrowKindPicker,\n\tStylePanelColorPicker,\n\tStylePanelDashPicker,\n\tStylePanelFillPicker,\n\tStylePanelFontPicker,\n\tStylePanelGeoShapePicker,\n\tStylePanelLabelAlignPicker,\n\tStylePanelOpacityPicker,\n\tStylePanelSection,\n\tStylePanelSizePicker,\n\tStylePanelSplinePicker,\n\tStylePanelTextAlignPicker,\n\ttype StylePanelSectionProps,\n} from './lib/ui/components/StylePanel/DefaultStylePanelContent'\nexport {\n\tStylePanelButtonPicker,\n\tStylePanelButtonPickerInline,\n\ttype StylePanelButtonPickerProps,\n} from './lib/ui/components/StylePanel/StylePanelButtonPicker'\nexport {\n\tStylePanelContextProvider,\n\tuseStylePanelContext,\n\ttype StylePanelContext,\n\ttype StylePanelContextProviderProps,\n} from './lib/ui/components/StylePanel/StylePanelContext'\nexport {\n\tStylePanelDoubleDropdownPicker,\n\tStylePanelDoubleDropdownPickerInline,\n\ttype StylePanelDoubleDropdownPickerProps,\n} from './lib/ui/components/StylePanel/StylePanelDoubleDropdownPicker'\nexport {\n\tStylePanelDropdownPicker,\n\tStylePanelDropdownPickerInline,\n\ttype StylePanelDropdownPickerProps,\n} from './lib/ui/components/StylePanel/StylePanelDropdownPicker'\nexport {\n\tStylePanelSubheading,\n\ttype StylePanelSubheadingProps,\n} from './lib/ui/components/StylePanel/StylePanelSubheading'\nexport {\n\tDefaultImageToolbar,\n\ttype TLUiImageToolbarProps,\n} from './lib/ui/components/Toolbar/DefaultImageToolbar'\nexport {\n\tDefaultImageToolbarContent,\n\ttype DefaultImageToolbarContentProps,\n} from './lib/ui/components/Toolbar/DefaultImageToolbarContent'\nexport {\n\tDefaultRichTextToolbar,\n\ttype TLUiRichTextToolbarProps,\n} from './lib/ui/components/Toolbar/DefaultRichTextToolbar'\nexport {\n\tDefaultRichTextToolbarContent,\n\ttype DefaultRichTextToolbarContentProps,\n} from './lib/ui/components/Toolbar/DefaultRichTextToolbarContent'\nexport {\n\tDefaultToolbar,\n\ttype DefaultToolbarProps,\n} from './lib/ui/components/Toolbar/DefaultToolbar'\nexport {\n\tArrowDownToolbarItem,\n\tArrowLeftToolbarItem,\n\tArrowRightToolbarItem,\n\tArrowToolbarItem,\n\tArrowUpToolbarItem,\n\tAssetToolbarItem,\n\tCheckBoxToolbarItem,\n\tCloudToolbarItem,\n\tDefaultToolbarContent,\n\tDiamondToolbarItem,\n\tDrawToolbarItem,\n\tEllipseToolbarItem,\n\tEraserToolbarItem,\n\tFrameToolbarItem,\n\tHandToolbarItem,\n\tHeartToolbarItem,\n\tHexagonToolbarItem,\n\tHighlightToolbarItem,\n\tLaserToolbarItem,\n\tLineToolbarItem,\n\tNoteToolbarItem,\n\tOvalToolbarItem,\n\tRectangleToolbarItem,\n\tRhombusToolbarItem,\n\tSelectToolbarItem,\n\tStarToolbarItem,\n\tTextToolbarItem,\n\tToolbarItem,\n\tTrapezoidToolbarItem,\n\tTriangleToolbarItem,\n\tuseIsToolSelected,\n\tXBoxToolbarItem,\n\ttype ToolbarItemProps,\n} from './lib/ui/components/Toolbar/DefaultToolbarContent'\nexport {\n\tDefaultVideoToolbar,\n\ttype TLUiVideoToolbarProps,\n} from './lib/ui/components/Toolbar/DefaultVideoToolbar'\nexport {\n\tDefaultVideoToolbarContent,\n\ttype DefaultVideoToolbarContentProps,\n} from './lib/ui/components/Toolbar/DefaultVideoToolbarContent'\nexport {\n\tOverflowingToolbar,\n\ttype OverflowingToolbarProps,\n} from './lib/ui/components/Toolbar/OverflowingToolbar'\nexport {\n\tToggleToolLockedButton,\n\ttype ToggleToolLockedButtonProps,\n} from './lib/ui/components/Toolbar/ToggleToolLockedButton'\nexport {\n\tCenteredTopPanelContainer,\n\ttype CenteredTopPanelContainerProps,\n} from './lib/ui/components/TopPanel/CenteredTopPanelContainer'\nexport { DefaultTopPanel } from './lib/ui/components/TopPanel/DefaultTopPanel'\nexport {\n\tDefaultZoomMenu,\n\ttype TLUiZoomMenuProps,\n} from './lib/ui/components/ZoomMenu/DefaultZoomMenu'\nexport { DefaultZoomMenuContent } from './lib/ui/components/ZoomMenu/DefaultZoomMenuContent'\nexport { PORTRAIT_BREAKPOINT } from './lib/ui/constants'\nexport {\n\tTldrawUiA11yProvider,\n\tuseA11y,\n\ttype A11yPriority,\n\ttype A11yProviderProps,\n\ttype TLUiA11y,\n\ttype TLUiA11yContextType,\n} from './lib/ui/context/a11y'\nexport {\n\tunwrapLabel,\n\tuseActions,\n\ttype ActionsProviderProps,\n\ttype TLUiActionItem,\n\ttype TLUiActionsContextType,\n} from './lib/ui/context/actions'\nexport { AssetUrlsProvider, useAssetUrls } from './lib/ui/context/asset-urls'\nexport {\n\tBreakPointProvider,\n\tuseBreakpoint,\n\ttype BreakPointProviderProps,\n} from './lib/ui/context/breakpoints'\nexport {\n\tTldrawUiComponentsProvider,\n\tuseTldrawUiComponents,\n\ttype TLUiComponents,\n\ttype TLUiComponentsProviderProps,\n} from './lib/ui/context/components'\nexport {\n\tTldrawUiDialogsProvider,\n\tuseDialogs,\n\ttype TLUiDialog,\n\ttype TLUiDialogProps,\n\ttype TLUiDialogsContextType,\n\ttype TLUiDialogsProviderProps,\n} from './lib/ui/context/dialogs'\nexport {\n\tTldrawUiEventsProvider,\n\tuseUiEvents,\n\ttype EventsProviderProps,\n\ttype TLUiEventContextType,\n\ttype TLUiEventData,\n\ttype TLUiEventHandler,\n\ttype TLUiEventMap,\n\ttype TLUiEventSource,\n} from './lib/ui/context/events'\nexport {\n\tTldrawUiContextProvider,\n\ttype TLUiContextProviderProps,\n} from './lib/ui/context/TldrawUiContextProvider'\nexport {\n\tTldrawUiToastsProvider,\n\tuseToasts,\n\ttype AlertSeverity,\n\ttype TLUiToast,\n\ttype TLUiToastAction,\n\ttype TLUiToastsContextType,\n\ttype TLUiToastsProviderProps,\n} from './lib/ui/context/toasts'\nexport { useCanRedo, useCanUndo, useUnlockedSelectedShapesCount } from './lib/ui/hooks/menu-hooks'\nexport { useMenuClipboardEvents, useNativeClipboardEvents } from './lib/ui/hooks/useClipboardEvents'\nexport {\n\tuseCollaborationStatus,\n\tuseShowCollaborationUi,\n} from './lib/ui/hooks/useCollaborationStatus'\nexport { useCopyAs } from './lib/ui/hooks/useCopyAs'\nexport { useExportAs } from './lib/ui/hooks/useExportAs'\nexport { useKeyboardShortcuts } from './lib/ui/hooks/useKeyboardShortcuts'\nexport { useLocalStorageState } from './lib/ui/hooks/useLocalStorageState'\nexport { useMenuIsOpen } from './lib/ui/hooks/useMenuIsOpen'\nexport { useReadonly } from './lib/ui/hooks/useReadonly'\nexport { useRelevantStyles } from './lib/ui/hooks/useRelevantStyles'\nexport {\n\tonDragFromToolbarToCreateShape,\n\tuseTools,\n\ttype OnDragFromToolbarToCreateShapesOpts,\n\ttype TLUiToolItem,\n\ttype TLUiToolsContextType,\n\ttype TLUiToolsProviderProps,\n} from './lib/ui/hooks/useTools'\nexport { type TLUiTranslationKey } from './lib/ui/hooks/useTranslation/TLUiTranslationKey'\nexport { type TLUiTranslation } from './lib/ui/hooks/useTranslation/translations'\nexport {\n\tuseCurrentTranslation,\n\tuseTranslation,\n\ttype TLUiTranslationContextType,\n\ttype TLUiTranslationProviderProps,\n} from './lib/ui/hooks/useTranslation/useTranslation'\nexport { type TLUiIconType } from './lib/ui/icon-types'\nexport { useDefaultHelpers, type TLUiOverrideHelpers, type TLUiOverrides } from './lib/ui/overrides'\nexport { TldrawUi, TldrawUiInFrontOfTheCanvas, type TldrawUiProps } from './lib/ui/TldrawUi'\nexport { containBoxSize, downsizeImage, type BoxWidthHeight } from './lib/utils/assets/assets'\nexport { preloadFont, type TLTypeFace } from './lib/utils/assets/preload-font'\nexport { getEmbedInfo, type TLEmbedResult } from './lib/utils/embeds/embeds'\nexport { putExcalidrawContent } from './lib/utils/excalidraw/putExcalidrawContent'\nexport { copyAs, type CopyAsOptions, type TLCopyType } from './lib/utils/export/copyAs'\nexport { downloadFile, exportAs, type ExportAsOptions } from './lib/utils/export/exportAs'\nexport { fitFrameToContent, removeFrame } from './lib/utils/frames/frames'\nexport {\n\tdefaultEditorAssetUrls,\n\tsetDefaultEditorAssetUrls,\n\ttype TLEditorAssetUrls,\n} from './lib/utils/static-assets/assetUrls'\nexport {\n\tdefaultAddFontsFromNode,\n\tKeyboardShiftEnterTweakExtension,\n\trenderHtmlFromRichText,\n\trenderHtmlFromRichTextForMeasurement,\n\trenderPlaintextFromRichText,\n\trenderRichTextFromHTML,\n\ttipTapDefaultExtensions,\n} from './lib/utils/text/richText'\nexport { truncateStringWithEllipsis } from './lib/utils/text/text'\nexport { TextDirection } from './lib/utils/text/textDirection'\nexport {\n\tbuildFromV1Document,\n\tTLV1AlignStyle,\n\tTLV1AssetType,\n\tTLV1ColorStyle,\n\tTLV1DashStyle,\n\tTLV1Decoration,\n\tTLV1FontStyle,\n\tTLV1ShapeType,\n\tTLV1SizeStyle,\n\ttype TLV1ArrowBinding,\n\ttype TLV1ArrowShape,\n\ttype TLV1Asset,\n\ttype TLV1BaseAsset,\n\ttype TLV1BaseBinding,\n\ttype TLV1BaseShape,\n\ttype TLV1Binding,\n\ttype TLV1Bounds,\n\ttype TLV1Document,\n\ttype TLV1DrawShape,\n\ttype TLV1EllipseShape,\n\ttype TLV1GroupShape,\n\ttype TLV1Handle,\n\ttype TLV1ImageAsset,\n\ttype TLV1ImageShape,\n\ttype TLV1Page,\n\ttype TLV1PageState,\n\ttype TLV1RectangleShape,\n\ttype TLV1Shape,\n\ttype TLV1ShapeStyles,\n\ttype TLV1StickyShape,\n\ttype TLV1TextShape,\n\ttype TLV1TriangleShape,\n\ttype TLV1VideoAsset,\n\ttype TLV1VideoShape,\n} from './lib/utils/tldr/buildFromV1Document'\nexport {\n\tparseAndLoadDocument,\n\tparseTldrawJsonFile,\n\tserializeTldrawJson,\n\tserializeTldrawJsonBlob,\n\tTLDRAW_FILE_EXTENSION,\n\ttype TldrawFile,\n\ttype TldrawFileParseError,\n} from './lib/utils/tldr/file'\n\nregisterTldrawLibraryVersion(\n\t(globalThis as any).TLDRAW_LIBRARY_NAME,\n\t(globalThis as any).TLDRAW_LIBRARY_VERSION,\n\t(globalThis as any).TLDRAW_LIBRARY_MODULES\n)\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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AACrC,kCAAqC;AACrC,2BAA8B;AAC9B,yBAA4B;AAC5B,+BAAkC;AAClC,sBAOO;AAGP,IAAAA,yBAKO;AAEP,uBAAgF;AAChF,sBAAyE;AACzE,oBAAmE;AACnE,0BAA6C;AAC7C,oBAAiD;AACjD,kCAAqC;AACrC,oBAA4D;AAC5D,sBAA6D;AAC7D,oBAA+C;AAC/C,IAAAC,oBAIO;AACP,sBAQO;AACP,kBAA2C;AAC3C,2BAA8B;AAC9B,iCAmCO;AACP,kBAQO;AAAA,IAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AACF;",
4
+ "sourcesContent": ["/// <reference types=\"react\" />\n\nimport { registerTldrawLibraryVersion } from '@tldraw/editor'\nexport {\n\tPathBuilder,\n\tPathBuilderGeometry2d,\n\ttype BasePathBuilderOpts,\n\ttype CubicBezierToPathBuilderCommand,\n\ttype DashedPathBuilderOpts,\n\ttype DrawPathBuilderDOpts,\n\ttype DrawPathBuilderOpts,\n\ttype LineToPathBuilderCommand,\n\ttype MoveToPathBuilderCommand,\n\ttype PathBuilderCommand,\n\ttype PathBuilderCommandBase,\n\ttype PathBuilderCommandInfo,\n\ttype PathBuilderCommandOpts,\n\ttype PathBuilderLineOpts,\n\ttype PathBuilderOpts,\n\ttype PathBuilderToDOpts,\n\ttype SolidPathBuilderOpts,\n} from './lib/shapes/shared/PathBuilder'\nexport { usePrefersReducedMotion } from './lib/shapes/shared/usePrefersReducedMotion'\nexport { DefaultA11yAnnouncer, useSelectedShapesAnnouncer } from './lib/ui/components/A11y'\nexport { AccessibilityMenu } from './lib/ui/components/AccessibilityMenu'\nexport { ColorSchemeMenu } from './lib/ui/components/ColorSchemeMenu'\nexport { DefaultFollowingIndicator } from './lib/ui/components/DefaultFollowingIndicator'\nexport { DefaultDialogs } from './lib/ui/components/Dialogs'\nexport {\n\tTldrawUiColumn,\n\tTldrawUiGrid,\n\tTldrawUiOrientationProvider,\n\tTldrawUiRow,\n\tuseTldrawUiOrientation,\n\ttype TldrawUiOrientationContext,\n\ttype TldrawUiOrientationProviderProps,\n\ttype TLUiLayoutProps,\n} from './lib/ui/components/primitives/layout'\nexport {\n\tTldrawUiMenuActionCheckboxItem,\n\ttype TLUiMenuActionCheckboxItemProps,\n} from './lib/ui/components/primitives/menus/TldrawUiMenuActionCheckboxItem'\nexport {\n\tTldrawUiMenuActionItem,\n\ttype TLUiMenuActionItemProps,\n} from './lib/ui/components/primitives/menus/TldrawUiMenuActionItem'\nexport {\n\tTldrawUiMenuToolItem,\n\ttype TLUiMenuToolItemProps,\n} from './lib/ui/components/primitives/menus/TldrawUiMenuToolItem'\nexport { DefaultToasts } from './lib/ui/components/Toasts'\nexport { TldrawUiTranslationProvider } from './lib/ui/hooks/useTranslation/useTranslation'\n// eslint-disable-next-line local/no-export-star\nexport * from '@tldraw/editor'\nexport { ArrowBindingUtil } from './lib/bindings/arrow/ArrowBindingUtil'\nexport { TldrawCropHandles, type TldrawCropHandlesProps } from './lib/canvas/TldrawCropHandles'\nexport { TldrawHandles } from './lib/canvas/TldrawHandles'\nexport { TldrawArrowHints, TldrawOverlays } from './lib/canvas/TldrawOverlays'\nexport { TldrawScribble } from './lib/canvas/TldrawScribble'\nexport { TldrawSelectionForeground } from './lib/canvas/TldrawSelectionForeground'\nexport { TldrawShapeIndicators } from './lib/canvas/TldrawShapeIndicators'\nexport { defaultBindingUtils } from './lib/defaultBindingUtils'\nexport {\n\tDEFAULT_EMBED_DEFINITIONS,\n\tembedShapePermissionDefaults,\n\ttype CustomEmbedDefinition,\n\ttype DefaultEmbedDefinitionType,\n\ttype EmbedDefinition,\n\ttype TLEmbedDefinition,\n\ttype TLEmbedShapePermissions,\n} from './lib/defaultEmbedDefinitions'\nexport {\n\tcenterSelectionAroundPoint,\n\tcreateEmptyBookmarkShape,\n\tcreateShapesForAssets,\n\tDEFAULT_MAX_ASSET_SIZE,\n\tDEFAULT_MAX_IMAGE_DIMENSION,\n\tdefaultHandleExternalEmbedContent,\n\tdefaultHandleExternalExcalidrawContent,\n\tdefaultHandleExternalFileAsset,\n\tdefaultHandleExternalFileContent,\n\tdefaultHandleExternalSvgTextContent,\n\tdefaultHandleExternalTextContent,\n\tdefaultHandleExternalTldrawContent,\n\tdefaultHandleExternalUrlAsset,\n\tdefaultHandleExternalUrlContent,\n\tgetAssetInfo,\n\tgetMediaAssetInfoPartial,\n\tnotifyIfFileNotAllowed,\n\tregisterDefaultExternalContentHandlers,\n\ttype TLDefaultExternalContentHandlerOpts,\n\ttype TLExternalContentProps,\n} from './lib/defaultExternalContentHandlers'\nexport { defaultShapeTools } from './lib/defaultShapeTools'\nexport { defaultShapeUtils } from './lib/defaultShapeUtils'\nexport { registerDefaultSideEffects } from './lib/defaultSideEffects'\nexport { defaultTools } from './lib/defaultTools'\nexport {\n\ttype ArrowShapeOptions,\n\ttype TLArcArrowInfo,\n\ttype TLArcInfo,\n\ttype TLArrowInfo,\n\ttype TLArrowPoint,\n\ttype TLElbowArrowInfo,\n\ttype TLStraightArrowInfo,\n} from './lib/shapes/arrow/arrow-types'\nexport { ArrowShapeTool } from './lib/shapes/arrow/ArrowShapeTool'\nexport { ArrowShapeUtil } from './lib/shapes/arrow/ArrowShapeUtil'\nexport {\n\tclearArrowTargetState,\n\tgetArrowTargetState,\n\tupdateArrowTargetState,\n\ttype ArrowTargetState,\n\ttype UpdateArrowTargetStateOpts,\n} from './lib/shapes/arrow/arrowTargetState'\nexport {\n\ttype ElbowArrowBox,\n\ttype ElbowArrowBoxEdges,\n\ttype ElbowArrowBoxes,\n\ttype ElbowArrowEdge,\n\ttype ElbowArrowInfo,\n\ttype ElbowArrowInfoWithoutRoute,\n\ttype ElbowArrowMidpointHandle,\n\ttype ElbowArrowOptions,\n\ttype ElbowArrowRange,\n\ttype ElbowArrowRoute,\n\ttype ElbowArrowSide,\n\ttype ElbowArrowSideReason,\n\ttype ElbowArrowTargetBox,\n} from './lib/shapes/arrow/elbow/definitions'\nexport {\n\tgetArrowBindings,\n\tgetArrowInfo,\n\tgetArrowTerminalsInArrowSpace,\n\ttype TLArrowBindings,\n} from './lib/shapes/arrow/shared'\nexport { createBookmarkFromUrl } from './lib/shapes/bookmark/bookmarks'\nexport { BookmarkShapeUtil } from './lib/shapes/bookmark/BookmarkShapeUtil'\nexport { DrawShapeTool } from './lib/shapes/draw/DrawShapeTool'\nexport { DrawShapeUtil, type DrawShapeOptions } from './lib/shapes/draw/DrawShapeUtil'\nexport { EmbedShapeUtil } from './lib/shapes/embed/EmbedShapeUtil'\nexport { FrameShapeTool } from './lib/shapes/frame/FrameShapeTool'\nexport { FrameShapeUtil, type FrameShapeOptions } from './lib/shapes/frame/FrameShapeUtil'\nexport { GeoShapeTool } from './lib/shapes/geo/GeoShapeTool'\nexport { GeoShapeUtil } from './lib/shapes/geo/GeoShapeUtil'\nexport { HighlightShapeTool } from './lib/shapes/highlight/HighlightShapeTool'\nexport {\n\tHighlightShapeUtil,\n\ttype HighlightShapeOptions,\n} from './lib/shapes/highlight/HighlightShapeUtil'\nexport { ImageShapeUtil } from './lib/shapes/image/ImageShapeUtil'\nexport { LineShapeTool } from './lib/shapes/line/LineShapeTool'\nexport { LineShapeUtil } from './lib/shapes/line/LineShapeUtil'\nexport { NoteShapeTool } from './lib/shapes/note/NoteShapeTool'\nexport { NoteShapeUtil, type NoteShapeOptions } from './lib/shapes/note/NoteShapeUtil'\nexport {\n\tASPECT_RATIO_OPTIONS,\n\tASPECT_RATIO_TO_VALUE,\n\tgetCropBox,\n\tgetDefaultCrop,\n\tgetUncroppedSize,\n\ttype ASPECT_RATIO_OPTION,\n\ttype CropBoxOptions,\n} from './lib/shapes/shared/crop'\nexport {\n\tARROW_LABEL_FONT_SIZES,\n\tFONT_FAMILIES,\n\tFONT_SIZES,\n\tLABEL_FONT_SIZES,\n\tSTROKE_SIZES,\n\tTEXT_PROPS,\n} from './lib/shapes/shared/default-shape-constants'\nexport {\n\tallDefaultFontFaces,\n\tDefaultFontFaces,\n\ttype TLDefaultFont,\n\ttype TLDefaultFonts,\n} from './lib/shapes/shared/defaultFonts'\nexport { getStrokePoints } from './lib/shapes/shared/freehand/getStrokePoints'\nexport { getSvgPathFromStrokePoints } from './lib/shapes/shared/freehand/svg'\nexport { type StrokeOptions, type StrokePoint } from './lib/shapes/shared/freehand/types'\nexport { PlainTextLabel, type PlainTextLabelProps } from './lib/shapes/shared/PlainTextLabel'\nexport {\n\tRichTextLabel,\n\tRichTextSVG,\n\ttype RichTextLabelProps,\n\ttype RichTextSVGProps,\n} from './lib/shapes/shared/RichTextLabel'\nexport { useDefaultColorTheme } from './lib/shapes/shared/useDefaultColorTheme'\nexport { useEditablePlainText } from './lib/shapes/shared/useEditablePlainText'\nexport { useEditableRichText } from './lib/shapes/shared/useEditableRichText'\nexport {\n\tuseImageOrVideoAsset,\n\ttype UseImageOrVideoAssetOptions,\n} from './lib/shapes/shared/useImageOrVideoAsset'\nexport { PlainTextArea } from './lib/shapes/text/PlainTextArea'\nexport { RichTextArea, type TextAreaProps } from './lib/shapes/text/RichTextArea'\nexport { TextShapeTool } from './lib/shapes/text/TextShapeTool'\nexport { TextShapeUtil, type TextShapeOptions } from './lib/shapes/text/TextShapeUtil'\nexport { VideoShapeUtil, type VideoShapeOptions } from './lib/shapes/video/VideoShapeUtil'\nexport { type StyleValuesForUi } from './lib/styles'\nexport { Tldraw, type TLComponents, type TldrawBaseProps, type TldrawProps } from './lib/Tldraw'\nexport { TldrawImage, type TldrawImageProps } from './lib/TldrawImage'\nexport { EraserTool } from './lib/tools/EraserTool/EraserTool'\nexport { HandTool } from './lib/tools/HandTool/HandTool'\nexport { LaserTool } from './lib/tools/LaserTool/LaserTool'\nexport { getHitShapeOnCanvasPointerDown } from './lib/tools/selection-logic/getHitShapeOnCanvasPointerDown'\nexport { SelectTool } from './lib/tools/SelectTool/SelectTool'\nexport { ZoomTool } from './lib/tools/ZoomTool/ZoomTool'\nexport {\n\tsetDefaultUiAssetUrls,\n\ttype TLUiAssetUrlOverrides,\n\ttype TLUiAssetUrls,\n} from './lib/ui/assetUrls'\nexport {\n\tDefaultActionsMenu,\n\ttype TLUiActionsMenuProps,\n} from './lib/ui/components/ActionsMenu/DefaultActionsMenu'\nexport {\n\tAlignMenuItems,\n\tDefaultActionsMenuContent,\n\tDistributeMenuItems,\n\tGroupOrUngroupMenuItem,\n\tReorderMenuItems,\n\tRotateCWMenuItem,\n\tStackMenuItems,\n\tZoomOrRotateMenuItem,\n} from './lib/ui/components/ActionsMenu/DefaultActionsMenuContent'\nexport {\n\tDefaultContextMenu as ContextMenu,\n\tDefaultContextMenu,\n\ttype TLUiContextMenuProps,\n} from './lib/ui/components/ContextMenu/DefaultContextMenu'\nexport { DefaultContextMenuContent } from './lib/ui/components/ContextMenu/DefaultContextMenuContent'\nexport {\n\tDefaultDebugMenu,\n\ttype TLUiDebugMenuProps,\n} from './lib/ui/components/DebugMenu/DefaultDebugMenu'\nexport {\n\tDebugFlags,\n\tDefaultDebugMenuContent,\n\tExampleDialog,\n\tFeatureFlags,\n\ttype CustomDebugFlags,\n\ttype DebugFlagsProps,\n\ttype ExampleDialogProps,\n\ttype FeatureFlagsProps,\n} from './lib/ui/components/DebugMenu/DefaultDebugMenuContent'\nexport { DefaultMenuPanel } from './lib/ui/components/DefaultMenuPanel'\nexport {\n\tDefaultHelperButtons,\n\ttype TLUiHelperButtonsProps,\n} from './lib/ui/components/HelperButtons/DefaultHelperButtons'\nexport { DefaultHelperButtonsContent } from './lib/ui/components/HelperButtons/DefaultHelperButtonsContent'\nexport {\n\tDefaultHelpMenu,\n\ttype TLUiHelpMenuProps,\n} from './lib/ui/components/HelpMenu/DefaultHelpMenu'\nexport {\n\tDefaultHelpMenuContent,\n\tKeyboardShortcutsMenuItem,\n} from './lib/ui/components/HelpMenu/DefaultHelpMenuContent'\nexport {\n\tDefaultKeyboardShortcutsDialog,\n\ttype TLUiKeyboardShortcutsDialogProps,\n} from './lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialog'\nexport { DefaultKeyboardShortcutsDialogContent } from './lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent'\nexport { LanguageMenu } from './lib/ui/components/LanguageMenu'\nexport {\n\tDefaultMainMenu,\n\ttype TLUiMainMenuProps,\n} from './lib/ui/components/MainMenu/DefaultMainMenu'\nexport {\n\tDefaultMainMenuContent,\n\tEditSubmenu,\n\tExportFileContentSubMenu,\n\tExtrasGroup,\n\tLockGroup,\n\tMiscMenuGroup,\n\tPreferencesGroup,\n\tUndoRedoGroup,\n\tViewSubmenu,\n} from './lib/ui/components/MainMenu/DefaultMainMenuContent'\nexport {\n\tArrangeMenuSubmenu,\n\tClipboardMenuGroup,\n\tConversionsMenuGroup,\n\tConvertToBookmarkMenuItem,\n\tConvertToEmbedMenuItem,\n\tCopyAsMenuGroup,\n\tCopyMenuItem,\n\tCursorChatItem,\n\tCutMenuItem,\n\tDeleteMenuItem,\n\tDuplicateMenuItem,\n\tEditLinkMenuItem,\n\tEditMenuSubmenu,\n\tFitFrameToContentMenuItem,\n\tGroupMenuItem,\n\tMoveToPageMenu,\n\tPasteMenuItem,\n\tPrintItem,\n\tRemoveFrameMenuItem,\n\tReorderMenuSubmenu,\n\tSelectAllMenuItem,\n\tToggleAutoSizeMenuItem,\n\tToggleDebugModeItem,\n\tToggleDynamicSizeModeItem,\n\tToggleEdgeScrollingItem,\n\tToggleEnhancedA11yModeItem,\n\tToggleFocusModeItem,\n\tToggleGridItem,\n\tToggleKeyboardShortcutsItem,\n\tToggleLockMenuItem,\n\tTogglePasteAtCursorItem,\n\tToggleReduceMotionItem,\n\tToggleSnapModeItem,\n\tToggleToolLockItem,\n\tToggleTransparentBgMenuItem,\n\tToggleWrapModeItem,\n\tUngroupMenuItem,\n\tUnlockAllMenuItem,\n\tZoomTo100MenuItem,\n\tZoomToFitMenuItem,\n\tZoomToSelectionMenuItem,\n} from './lib/ui/components/menu-items'\nexport { DefaultMinimap } from './lib/ui/components/Minimap/DefaultMinimap'\nexport { MobileStylePanel } from './lib/ui/components/MobileStylePanel'\nexport { DefaultNavigationPanel } from './lib/ui/components/NavigationPanel/DefaultNavigationPanel'\nexport { OfflineIndicator } from './lib/ui/components/OfflineIndicator/OfflineIndicator'\nexport { DefaultPageMenu } from './lib/ui/components/PageMenu/DefaultPageMenu'\nexport { PageItemInput, type PageItemInputProps } from './lib/ui/components/PageMenu/PageItemInput'\nexport {\n\tPageItemSubmenu,\n\ttype PageItemSubmenuProps,\n} from './lib/ui/components/PageMenu/PageItemSubmenu'\nexport {\n\tTldrawUiButton,\n\ttype TLUiButtonProps,\n} from './lib/ui/components/primitives/Button/TldrawUiButton'\nexport {\n\tTldrawUiButtonCheck,\n\ttype TLUiButtonCheckProps,\n} from './lib/ui/components/primitives/Button/TldrawUiButtonCheck'\nexport {\n\tTldrawUiButtonIcon,\n\ttype TLUiButtonIconProps,\n} from './lib/ui/components/primitives/Button/TldrawUiButtonIcon'\nexport {\n\tTldrawUiButtonLabel,\n\ttype TLUiButtonLabelProps,\n} from './lib/ui/components/primitives/Button/TldrawUiButtonLabel'\nexport {\n\tTldrawUiMenuCheckboxItem,\n\ttype TLUiMenuCheckboxItemProps,\n} from './lib/ui/components/primitives/menus/TldrawUiMenuCheckboxItem'\nexport {\n\tTldrawUiMenuContextProvider,\n\ttype TLUiMenuContextProviderProps,\n\ttype TLUiMenuContextType,\n} from './lib/ui/components/primitives/menus/TldrawUiMenuContext'\nexport {\n\tTldrawUiMenuGroup,\n\ttype TLUiMenuGroupProps,\n} from './lib/ui/components/primitives/menus/TldrawUiMenuGroup'\nexport {\n\tTldrawUiMenuItem,\n\ttype TLUiMenuItemProps,\n} from './lib/ui/components/primitives/menus/TldrawUiMenuItem'\nexport {\n\tTldrawUiMenuSubmenu,\n\ttype TLUiMenuSubmenuProps,\n} from './lib/ui/components/primitives/menus/TldrawUiMenuSubmenu'\nexport {\n\tTldrawUiContextualToolbar,\n\ttype TLUiContextualToolbarProps,\n} from './lib/ui/components/primitives/TldrawUiContextualToolbar'\nexport {\n\tTldrawUiDialogBody,\n\tTldrawUiDialogCloseButton,\n\tTldrawUiDialogFooter,\n\tTldrawUiDialogHeader,\n\tTldrawUiDialogTitle,\n\ttype TLUiDialogBodyProps,\n\ttype TLUiDialogFooterProps,\n\ttype TLUiDialogHeaderProps,\n\ttype TLUiDialogTitleProps,\n} from './lib/ui/components/primitives/TldrawUiDialog'\nexport {\n\tTldrawUiDropdownMenuCheckboxItem,\n\tTldrawUiDropdownMenuContent,\n\tTldrawUiDropdownMenuGroup,\n\tTldrawUiDropdownMenuIndicator,\n\tTldrawUiDropdownMenuItem,\n\tTldrawUiDropdownMenuRoot,\n\tTldrawUiDropdownMenuSub,\n\tTldrawUiDropdownMenuSubTrigger,\n\tTldrawUiDropdownMenuTrigger,\n\ttype TLUiDropdownMenuCheckboxItemProps,\n\ttype TLUiDropdownMenuContentProps,\n\ttype TLUiDropdownMenuGroupProps,\n\ttype TLUiDropdownMenuItemProps,\n\ttype TLUiDropdownMenuRootProps,\n\ttype TLUiDropdownMenuSubProps,\n\ttype TLUiDropdownMenuSubTriggerProps,\n\ttype TLUiDropdownMenuTriggerProps,\n} from './lib/ui/components/primitives/TldrawUiDropdownMenu'\nexport {\n\tTldrawUiIcon,\n\ttype TLUiIconJsx,\n\ttype TLUiIconProps,\n} from './lib/ui/components/primitives/TldrawUiIcon'\nexport { TldrawUiInput, type TLUiInputProps } from './lib/ui/components/primitives/TldrawUiInput'\nexport { TldrawUiKbd, type TLUiKbdProps } from './lib/ui/components/primitives/TldrawUiKbd'\nexport {\n\tTldrawUiPopover,\n\tTldrawUiPopoverContent,\n\tTldrawUiPopoverTrigger,\n\ttype TLUiPopoverContentProps,\n\ttype TLUiPopoverProps,\n\ttype TLUiPopoverTriggerProps,\n} from './lib/ui/components/primitives/TldrawUiPopover'\nexport { TldrawUiSlider, type TLUiSliderProps } from './lib/ui/components/primitives/TldrawUiSlider'\nexport {\n\tTldrawUiToolbar,\n\tTldrawUiToolbarButton,\n\tTldrawUiToolbarToggleGroup,\n\tTldrawUiToolbarToggleItem,\n\ttype TLUiToolbarButtonProps,\n\ttype TLUiToolbarProps,\n\ttype TLUiToolbarToggleGroupProps,\n\ttype TLUiToolbarToggleItemProps,\n} from './lib/ui/components/primitives/TldrawUiToolbar'\nexport {\n\thideAllTooltips,\n\tTldrawUiTooltip,\n\tTldrawUiTooltipProvider,\n\ttype TldrawUiTooltipProps,\n\ttype TldrawUiTooltipProviderProps,\n} from './lib/ui/components/primitives/TldrawUiTooltip'\nexport {\n\tDefaultQuickActions,\n\ttype TLUiQuickActionsProps,\n} from './lib/ui/components/QuickActions/DefaultQuickActions'\nexport { DefaultQuickActionsContent } from './lib/ui/components/QuickActions/DefaultQuickActionsContent'\nexport { DefaultSharePanel } from './lib/ui/components/SharePanel/DefaultSharePanel'\nexport { PeopleMenu, type PeopleMenuProps } from './lib/ui/components/SharePanel/PeopleMenu'\nexport { Spinner } from './lib/ui/components/Spinner'\nexport {\n\tDefaultStylePanel,\n\ttype TLUiStylePanelProps,\n} from './lib/ui/components/StylePanel/DefaultStylePanel'\nexport {\n\tDefaultStylePanelContent,\n\tStylePanelArrowheadPicker,\n\tStylePanelArrowKindPicker,\n\tStylePanelColorPicker,\n\tStylePanelDashPicker,\n\tStylePanelFillPicker,\n\tStylePanelFontPicker,\n\tStylePanelGeoShapePicker,\n\tStylePanelLabelAlignPicker,\n\tStylePanelOpacityPicker,\n\tStylePanelSection,\n\tStylePanelSizePicker,\n\tStylePanelSplinePicker,\n\tStylePanelTextAlignPicker,\n\ttype StylePanelSectionProps,\n} from './lib/ui/components/StylePanel/DefaultStylePanelContent'\nexport {\n\tStylePanelButtonPicker,\n\tStylePanelButtonPickerInline,\n\ttype StylePanelButtonPickerProps,\n} from './lib/ui/components/StylePanel/StylePanelButtonPicker'\nexport {\n\tStylePanelContextProvider,\n\tuseStylePanelContext,\n\ttype StylePanelContext,\n\ttype StylePanelContextProviderProps,\n} from './lib/ui/components/StylePanel/StylePanelContext'\nexport {\n\tStylePanelDoubleDropdownPicker,\n\tStylePanelDoubleDropdownPickerInline,\n\ttype StylePanelDoubleDropdownPickerProps,\n} from './lib/ui/components/StylePanel/StylePanelDoubleDropdownPicker'\nexport {\n\tStylePanelDropdownPicker,\n\tStylePanelDropdownPickerInline,\n\ttype StylePanelDropdownPickerProps,\n} from './lib/ui/components/StylePanel/StylePanelDropdownPicker'\nexport {\n\tStylePanelSubheading,\n\ttype StylePanelSubheadingProps,\n} from './lib/ui/components/StylePanel/StylePanelSubheading'\nexport {\n\tDefaultImageToolbar,\n\ttype TLUiImageToolbarProps,\n} from './lib/ui/components/Toolbar/DefaultImageToolbar'\nexport {\n\tDefaultImageToolbarContent,\n\ttype DefaultImageToolbarContentProps,\n} from './lib/ui/components/Toolbar/DefaultImageToolbarContent'\nexport {\n\tDefaultRichTextToolbar,\n\ttype TLUiRichTextToolbarProps,\n} from './lib/ui/components/Toolbar/DefaultRichTextToolbar'\nexport {\n\tDefaultRichTextToolbarContent,\n\ttype DefaultRichTextToolbarContentProps,\n} from './lib/ui/components/Toolbar/DefaultRichTextToolbarContent'\nexport {\n\tDefaultToolbar,\n\ttype DefaultToolbarProps,\n} from './lib/ui/components/Toolbar/DefaultToolbar'\nexport {\n\tArrowDownToolbarItem,\n\tArrowLeftToolbarItem,\n\tArrowRightToolbarItem,\n\tArrowToolbarItem,\n\tArrowUpToolbarItem,\n\tAssetToolbarItem,\n\tCheckBoxToolbarItem,\n\tCloudToolbarItem,\n\tDefaultToolbarContent,\n\tDiamondToolbarItem,\n\tDrawToolbarItem,\n\tEllipseToolbarItem,\n\tEraserToolbarItem,\n\tFrameToolbarItem,\n\tHandToolbarItem,\n\tHeartToolbarItem,\n\tHexagonToolbarItem,\n\tHighlightToolbarItem,\n\tLaserToolbarItem,\n\tLineToolbarItem,\n\tNoteToolbarItem,\n\tOvalToolbarItem,\n\tRectangleToolbarItem,\n\tRhombusToolbarItem,\n\tSelectToolbarItem,\n\tStarToolbarItem,\n\tTextToolbarItem,\n\tToolbarItem,\n\tTrapezoidToolbarItem,\n\tTriangleToolbarItem,\n\tuseIsToolSelected,\n\tXBoxToolbarItem,\n\ttype ToolbarItemProps,\n} from './lib/ui/components/Toolbar/DefaultToolbarContent'\nexport {\n\tDefaultVideoToolbar,\n\ttype TLUiVideoToolbarProps,\n} from './lib/ui/components/Toolbar/DefaultVideoToolbar'\nexport {\n\tDefaultVideoToolbarContent,\n\ttype DefaultVideoToolbarContentProps,\n} from './lib/ui/components/Toolbar/DefaultVideoToolbarContent'\nexport {\n\tOverflowingToolbar,\n\ttype OverflowingToolbarProps,\n} from './lib/ui/components/Toolbar/OverflowingToolbar'\nexport {\n\tToggleToolLockedButton,\n\ttype ToggleToolLockedButtonProps,\n} from './lib/ui/components/Toolbar/ToggleToolLockedButton'\nexport {\n\tCenteredTopPanelContainer,\n\ttype CenteredTopPanelContainerProps,\n} from './lib/ui/components/TopPanel/CenteredTopPanelContainer'\nexport { DefaultTopPanel } from './lib/ui/components/TopPanel/DefaultTopPanel'\nexport {\n\tDefaultZoomMenu,\n\ttype TLUiZoomMenuProps,\n} from './lib/ui/components/ZoomMenu/DefaultZoomMenu'\nexport { DefaultZoomMenuContent } from './lib/ui/components/ZoomMenu/DefaultZoomMenuContent'\nexport { PORTRAIT_BREAKPOINT } from './lib/ui/constants'\nexport {\n\tTldrawUiA11yProvider,\n\tuseA11y,\n\ttype A11yPriority,\n\ttype A11yProviderProps,\n\ttype TLUiA11y,\n\ttype TLUiA11yContextType,\n} from './lib/ui/context/a11y'\nexport {\n\tunwrapLabel,\n\tuseActions,\n\ttype ActionsProviderProps,\n\ttype TLUiActionItem,\n\ttype TLUiActionsContextType,\n} from './lib/ui/context/actions'\nexport { AssetUrlsProvider, useAssetUrls } from './lib/ui/context/asset-urls'\nexport {\n\tBreakPointProvider,\n\tuseBreakpoint,\n\ttype BreakPointProviderProps,\n} from './lib/ui/context/breakpoints'\nexport {\n\tTldrawUiComponentsProvider,\n\tuseTldrawUiComponents,\n\ttype TLUiComponents,\n\ttype TLUiComponentsProviderProps,\n} from './lib/ui/context/components'\nexport {\n\tTldrawUiDialogsProvider,\n\tuseDialogs,\n\ttype TLUiDialog,\n\ttype TLUiDialogProps,\n\ttype TLUiDialogsContextType,\n\ttype TLUiDialogsProviderProps,\n} from './lib/ui/context/dialogs'\nexport {\n\tTldrawUiEventsProvider,\n\tuseUiEvents,\n\ttype EventsProviderProps,\n\ttype TLUiEventContextType,\n\ttype TLUiEventData,\n\ttype TLUiEventHandler,\n\ttype TLUiEventMap,\n\ttype TLUiEventSource,\n} from './lib/ui/context/events'\nexport {\n\tTldrawUiContextProvider,\n\ttype TLUiContextProviderProps,\n} from './lib/ui/context/TldrawUiContextProvider'\nexport {\n\tTldrawUiToastsProvider,\n\tuseToasts,\n\ttype AlertSeverity,\n\ttype TLUiToast,\n\ttype TLUiToastAction,\n\ttype TLUiToastsContextType,\n\ttype TLUiToastsProviderProps,\n} from './lib/ui/context/toasts'\nexport { useCanRedo, useCanUndo, useUnlockedSelectedShapesCount } from './lib/ui/hooks/menu-hooks'\nexport { useMenuClipboardEvents, useNativeClipboardEvents } from './lib/ui/hooks/useClipboardEvents'\nexport {\n\tuseCollaborationStatus,\n\tuseShowCollaborationUi,\n} from './lib/ui/hooks/useCollaborationStatus'\nexport { useCopyAs } from './lib/ui/hooks/useCopyAs'\nexport { useExportAs } from './lib/ui/hooks/useExportAs'\nexport { useKeyboardShortcuts } from './lib/ui/hooks/useKeyboardShortcuts'\nexport { useLocalStorageState } from './lib/ui/hooks/useLocalStorageState'\nexport { useMenuIsOpen } from './lib/ui/hooks/useMenuIsOpen'\nexport { useReadonly } from './lib/ui/hooks/useReadonly'\nexport { useRelevantStyles } from './lib/ui/hooks/useRelevantStyles'\nexport {\n\tonDragFromToolbarToCreateShape,\n\tuseTools,\n\ttype OnDragFromToolbarToCreateShapesOpts,\n\ttype TLUiToolItem,\n\ttype TLUiToolsContextType,\n\ttype TLUiToolsProviderProps,\n} from './lib/ui/hooks/useTools'\nexport { type TLUiTranslationKey } from './lib/ui/hooks/useTranslation/TLUiTranslationKey'\nexport { type TLUiTranslation } from './lib/ui/hooks/useTranslation/translations'\nexport {\n\tuseCurrentTranslation,\n\tuseTranslation,\n\ttype TLUiTranslationContextType,\n\ttype TLUiTranslationProviderProps,\n} from './lib/ui/hooks/useTranslation/useTranslation'\nexport { type TLUiIconType } from './lib/ui/icon-types'\nexport { useDefaultHelpers, type TLUiOverrideHelpers, type TLUiOverrides } from './lib/ui/overrides'\nexport { TldrawUi, TldrawUiInFrontOfTheCanvas, type TldrawUiProps } from './lib/ui/TldrawUi'\nexport { containBoxSize, downsizeImage, type BoxWidthHeight } from './lib/utils/assets/assets'\nexport { preloadFont, type TLTypeFace } from './lib/utils/assets/preload-font'\nexport { getEmbedInfo, type TLEmbedResult } from './lib/utils/embeds/embeds'\nexport { putExcalidrawContent } from './lib/utils/excalidraw/putExcalidrawContent'\nexport { copyAs, type CopyAsOptions, type TLCopyType } from './lib/utils/export/copyAs'\nexport { downloadFile, exportAs, type ExportAsOptions } from './lib/utils/export/exportAs'\nexport { fitFrameToContent, removeFrame } from './lib/utils/frames/frames'\nexport {\n\tdefaultEditorAssetUrls,\n\tsetDefaultEditorAssetUrls,\n\ttype TLEditorAssetUrls,\n} from './lib/utils/static-assets/assetUrls'\nexport {\n\tdefaultAddFontsFromNode,\n\tKeyboardShiftEnterTweakExtension,\n\trenderHtmlFromRichText,\n\trenderHtmlFromRichTextForMeasurement,\n\trenderPlaintextFromRichText,\n\trenderRichTextFromHTML,\n\ttipTapDefaultExtensions,\n} from './lib/utils/text/richText'\nexport { truncateStringWithEllipsis } from './lib/utils/text/text'\nexport { TextDirection } from './lib/utils/text/textDirection'\nexport {\n\tbuildFromV1Document,\n\tTLV1AlignStyle,\n\tTLV1AssetType,\n\tTLV1ColorStyle,\n\tTLV1DashStyle,\n\tTLV1Decoration,\n\tTLV1FontStyle,\n\tTLV1ShapeType,\n\tTLV1SizeStyle,\n\ttype TLV1ArrowBinding,\n\ttype TLV1ArrowShape,\n\ttype TLV1Asset,\n\ttype TLV1BaseAsset,\n\ttype TLV1BaseBinding,\n\ttype TLV1BaseShape,\n\ttype TLV1Binding,\n\ttype TLV1Bounds,\n\ttype TLV1Document,\n\ttype TLV1DrawShape,\n\ttype TLV1EllipseShape,\n\ttype TLV1GroupShape,\n\ttype TLV1Handle,\n\ttype TLV1ImageAsset,\n\ttype TLV1ImageShape,\n\ttype TLV1Page,\n\ttype TLV1PageState,\n\ttype TLV1RectangleShape,\n\ttype TLV1Shape,\n\ttype TLV1ShapeStyles,\n\ttype TLV1StickyShape,\n\ttype TLV1TextShape,\n\ttype TLV1TriangleShape,\n\ttype TLV1VideoAsset,\n\ttype TLV1VideoShape,\n} from './lib/utils/tldr/buildFromV1Document'\nexport {\n\tparseAndLoadDocument,\n\tparseTldrawJsonFile,\n\tserializeTldrawJson,\n\tserializeTldrawJsonBlob,\n\tTLDRAW_FILE_EXTENSION,\n\ttype TldrawFile,\n\ttype TldrawFileParseError,\n} from './lib/utils/tldr/file'\n\nregisterTldrawLibraryVersion(\n\t(globalThis as any).TLDRAW_LIBRARY_NAME,\n\t(globalThis as any).TLDRAW_LIBRARY_VERSION,\n\t(globalThis as any).TLDRAW_LIBRARY_MODULES\n)\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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CAGO;AACP,iCAGO;AACP,wCAGO;AACP,oCAGO;AACP,2CAGO;AACP,4BAGO;AACP,mCAkCO;AACP,iCAGO;AACP,wCAGO;AACP,gCAGO;AACP,oCAGO;AACP,uCAGO;AACP,6BAAgC;AAChC,6BAGO;AACP,oCAAuC;AACvC,uBAAoC;AACpC,kBAOO;AACP,qBAMO;AACP,wBAAgD;AAChD,yBAIO;AACP,wBAKO;AACP,qBAOO;AACP,oBASO;AACP,qCAGO;AACP,oBAQO;AACP,wBAAuE;AACvE,gCAAiE;AACjE,oCAGO;AACP,uBAA0B;AAC1B,yBAA4B;AAC5B,kCAAqC;AACrC,kCAAqC;AACrC,2BAA8B;AAC9B,yBAA4B;AAC5B,+BAAkC;AAClC,sBAOO;AAGP,IAAAA,yBAKO;AAEP,uBAAgF;AAChF,sBAAyE;AACzE,oBAAmE;AACnE,0BAA6C;AAC7C,oBAAiD;AACjD,kCAAqC;AACrC,oBAA4D;AAC5D,sBAA6D;AAC7D,oBAA+C;AAC/C,IAAAC,oBAIO;AACP,sBAQO;AACP,kBAA2C;AAC3C,2BAA8B;AAC9B,iCAmCO;AACP,kBAQO;AAAA,IAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AACF;",
6
6
  "names": ["import_useTranslation", "import_assetUrls"]
7
7
  }
@@ -61,7 +61,7 @@ const TldrawUiSlider = import_react.default.forwardRef(function Slider({
61
61
  [onValueChange]
62
62
  );
63
63
  const handlePointerDown = (0, import_react.useCallback)(() => {
64
- import_TldrawUiTooltip.tooltipManager.hideAllTooltips();
64
+ (0, import_TldrawUiTooltip.hideAllTooltips)();
65
65
  onHistoryMark?.("click slider");
66
66
  }, [onHistoryMark]);
67
67
  (0, import_react.useEffect)(() => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/lib/ui/components/primitives/TldrawUiSlider.tsx"],
4
- "sourcesContent": ["import { tltime } from '@tldraw/editor'\nimport { Slider as _Slider } from 'radix-ui'\nimport React, { useCallback, useEffect, useState } from 'react'\nimport { TLUiTranslationKey } from '../../hooks/useTranslation/TLUiTranslationKey'\nimport { useTranslation } from '../../hooks/useTranslation/useTranslation'\nimport { TldrawUiTooltip, tooltipManager } from './TldrawUiTooltip'\n\n/** @public */\nexport interface TLUiSliderProps {\n\tmin?: number\n\tsteps: number\n\tvalue: number | null\n\tlabel: string\n\ttitle: string\n\tonValueChange(value: number): void\n\tonHistoryMark?(id: string): void\n\t'data-testid'?: string\n\tariaValueModifier?: number\n}\n\n/** @public @react */\nexport const TldrawUiSlider = React.forwardRef<HTMLDivElement, TLUiSliderProps>(function Slider(\n\t{\n\t\tonHistoryMark,\n\t\ttitle,\n\t\tmin,\n\t\tsteps,\n\t\tvalue,\n\t\tlabel,\n\t\tonValueChange,\n\t\t['data-testid']: testId,\n\t\tariaValueModifier = 1,\n\t}: TLUiSliderProps,\n\tref\n) {\n\tconst msg = useTranslation()\n\tconst [titleAndLabel, setTitleAndLabel] = useState('')\n\n\t// XXX: Radix starts out our slider with a tabIndex of 0\n\t// This causes some tab focusing issues, most prevelant in MobileStylePanel,\n\t// where it grabs the focus. This works around it.\n\tconst [tabIndex, setTabIndex] = useState(-1)\n\tuseEffect(() => {\n\t\tsetTabIndex(0)\n\t}, [])\n\n\tconst handleValueChange = useCallback(\n\t\t(value: number[]) => {\n\t\t\tonValueChange(value[0])\n\t\t},\n\t\t[onValueChange]\n\t)\n\n\tconst handlePointerDown = useCallback(() => {\n\t\ttooltipManager.hideAllTooltips()\n\t\tonHistoryMark?.('click slider')\n\t}, [onHistoryMark])\n\n\t// N.B. This is a bit silly. The Radix slider auto-focuses which\n\t// triggers TldrawUiTooltip handleFocus when we dbl-click to edit an image,\n\t// which in turn makes the tooltip display prematurely.\n\t// This makes it wait until we've focused to show the tooltip.\n\tuseEffect(() => {\n\t\tconst timeout = tltime.setTimeout(\n\t\t\t'set title and label',\n\t\t\t() => {\n\t\t\t\tsetTitleAndLabel(title + ' \u2014 ' + msg(label as TLUiTranslationKey))\n\t\t\t},\n\t\t\t0\n\t\t)\n\t\treturn () => clearTimeout(timeout)\n\t}, [label, msg, title])\n\n\t// N.B. Annoying. For a11y purposes, we need Tab to work.\n\t// For some reason, Radix has some custom behavior here\n\t// that interferes with tabbing past the slider and then\n\t// you get stuck in the slider.\n\tconst handleKeyEvent = useCallback((event: React.KeyboardEvent) => {\n\t\tif (event.key === 'Tab') {\n\t\t\tevent.stopPropagation()\n\t\t}\n\t}, [])\n\n\treturn (\n\t\t<div className=\"tlui-slider__container\">\n\t\t\t<TldrawUiTooltip content={titleAndLabel}>\n\t\t\t\t<_Slider.Root\n\t\t\t\t\tdata-testid={testId}\n\t\t\t\t\tclassName=\"tlui-slider\"\n\t\t\t\t\tdir=\"ltr\"\n\t\t\t\t\tmin={min ?? 0}\n\t\t\t\t\tmax={steps}\n\t\t\t\t\tstep={1}\n\t\t\t\t\tvalue={value !== null ? [value] : undefined}\n\t\t\t\t\tonPointerDown={handlePointerDown}\n\t\t\t\t\tonValueChange={handleValueChange}\n\t\t\t\t\tonKeyDownCapture={handleKeyEvent}\n\t\t\t\t\tonKeyUpCapture={handleKeyEvent}\n\t\t\t\t>\n\t\t\t\t\t<_Slider.Track className=\"tlui-slider__track\" dir=\"ltr\">\n\t\t\t\t\t\t{value !== null && <_Slider.Range className=\"tlui-slider__range\" dir=\"ltr\" />}\n\t\t\t\t\t</_Slider.Track>\n\t\t\t\t\t{value !== null && (\n\t\t\t\t\t\t<_Slider.Thumb\n\t\t\t\t\t\t\taria-valuemin={(min ?? 0) * ariaValueModifier}\n\t\t\t\t\t\t\taria-valuenow={value * ariaValueModifier}\n\t\t\t\t\t\t\taria-valuemax={steps * ariaValueModifier}\n\t\t\t\t\t\t\taria-label={titleAndLabel}\n\t\t\t\t\t\t\tclassName=\"tlui-slider__thumb\"\n\t\t\t\t\t\t\tdir=\"ltr\"\n\t\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\t\ttabIndex={tabIndex}\n\t\t\t\t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,GAAG,CAAC,CAAC;AAEL,SACC,4CAAC,SAAI,WAAU,0BACd,sDAAC,0CAAgB,SAAS,eACzB;AAAA,IAAC,gBAAAC,OAAQ;AAAA,IAAR;AAAA,MACA,eAAa;AAAA,MACb,WAAU;AAAA,MACV,KAAI;AAAA,MACJ,KAAK,OAAO;AAAA,MACZ,KAAK;AAAA,MACL,MAAM;AAAA,MACN,OAAO,UAAU,OAAO,CAAC,KAAK,IAAI;AAAA,MAClC,eAAe;AAAA,MACf,eAAe;AAAA,MACf,kBAAkB;AAAA,MAClB,gBAAgB;AAAA,MAEhB;AAAA,oDAAC,gBAAAA,OAAQ,OAAR,EAAc,WAAU,sBAAqB,KAAI,OAChD,oBAAU,QAAQ,4CAAC,gBAAAA,OAAQ,OAAR,EAAc,WAAU,sBAAqB,KAAI,OAAM,GAC5E;AAAA,QACC,UAAU,QACV;AAAA,UAAC,gBAAAA,OAAQ;AAAA,UAAR;AAAA,YACA,kBAAgB,OAAO,KAAK;AAAA,YAC5B,iBAAe,QAAQ;AAAA,YACvB,iBAAe,QAAQ;AAAA,YACvB,cAAY;AAAA,YACZ,WAAU;AAAA,YACV,KAAI;AAAA,YACJ;AAAA,YACA;AAAA;AAAA,QACD;AAAA;AAAA;AAAA,EAEF,GACD,GACD;AAEF,CAAC;",
4
+ "sourcesContent": ["import { tltime } from '@tldraw/editor'\nimport { Slider as _Slider } from 'radix-ui'\nimport React, { useCallback, useEffect, useState } from 'react'\nimport { TLUiTranslationKey } from '../../hooks/useTranslation/TLUiTranslationKey'\nimport { useTranslation } from '../../hooks/useTranslation/useTranslation'\nimport { hideAllTooltips, TldrawUiTooltip } from './TldrawUiTooltip'\n\n/** @public */\nexport interface TLUiSliderProps {\n\tmin?: number\n\tsteps: number\n\tvalue: number | null\n\tlabel: string\n\ttitle: string\n\tonValueChange(value: number): void\n\tonHistoryMark?(id: string): void\n\t'data-testid'?: string\n\tariaValueModifier?: number\n}\n\n/** @public @react */\nexport const TldrawUiSlider = React.forwardRef<HTMLDivElement, TLUiSliderProps>(function Slider(\n\t{\n\t\tonHistoryMark,\n\t\ttitle,\n\t\tmin,\n\t\tsteps,\n\t\tvalue,\n\t\tlabel,\n\t\tonValueChange,\n\t\t['data-testid']: testId,\n\t\tariaValueModifier = 1,\n\t}: TLUiSliderProps,\n\tref\n) {\n\tconst msg = useTranslation()\n\tconst [titleAndLabel, setTitleAndLabel] = useState('')\n\n\t// XXX: Radix starts out our slider with a tabIndex of 0\n\t// This causes some tab focusing issues, most prevelant in MobileStylePanel,\n\t// where it grabs the focus. This works around it.\n\tconst [tabIndex, setTabIndex] = useState(-1)\n\tuseEffect(() => {\n\t\tsetTabIndex(0)\n\t}, [])\n\n\tconst handleValueChange = useCallback(\n\t\t(value: number[]) => {\n\t\t\tonValueChange(value[0])\n\t\t},\n\t\t[onValueChange]\n\t)\n\n\tconst handlePointerDown = useCallback(() => {\n\t\thideAllTooltips()\n\t\tonHistoryMark?.('click slider')\n\t}, [onHistoryMark])\n\n\t// N.B. This is a bit silly. The Radix slider auto-focuses which\n\t// triggers TldrawUiTooltip handleFocus when we dbl-click to edit an image,\n\t// which in turn makes the tooltip display prematurely.\n\t// This makes it wait until we've focused to show the tooltip.\n\tuseEffect(() => {\n\t\tconst timeout = tltime.setTimeout(\n\t\t\t'set title and label',\n\t\t\t() => {\n\t\t\t\tsetTitleAndLabel(title + ' \u2014 ' + msg(label as TLUiTranslationKey))\n\t\t\t},\n\t\t\t0\n\t\t)\n\t\treturn () => clearTimeout(timeout)\n\t}, [label, msg, title])\n\n\t// N.B. Annoying. For a11y purposes, we need Tab to work.\n\t// For some reason, Radix has some custom behavior here\n\t// that interferes with tabbing past the slider and then\n\t// you get stuck in the slider.\n\tconst handleKeyEvent = useCallback((event: React.KeyboardEvent) => {\n\t\tif (event.key === 'Tab') {\n\t\t\tevent.stopPropagation()\n\t\t}\n\t}, [])\n\n\treturn (\n\t\t<div className=\"tlui-slider__container\">\n\t\t\t<TldrawUiTooltip content={titleAndLabel}>\n\t\t\t\t<_Slider.Root\n\t\t\t\t\tdata-testid={testId}\n\t\t\t\t\tclassName=\"tlui-slider\"\n\t\t\t\t\tdir=\"ltr\"\n\t\t\t\t\tmin={min ?? 0}\n\t\t\t\t\tmax={steps}\n\t\t\t\t\tstep={1}\n\t\t\t\t\tvalue={value !== null ? [value] : undefined}\n\t\t\t\t\tonPointerDown={handlePointerDown}\n\t\t\t\t\tonValueChange={handleValueChange}\n\t\t\t\t\tonKeyDownCapture={handleKeyEvent}\n\t\t\t\t\tonKeyUpCapture={handleKeyEvent}\n\t\t\t\t>\n\t\t\t\t\t<_Slider.Track className=\"tlui-slider__track\" dir=\"ltr\">\n\t\t\t\t\t\t{value !== null && <_Slider.Range className=\"tlui-slider__range\" dir=\"ltr\" />}\n\t\t\t\t\t</_Slider.Track>\n\t\t\t\t\t{value !== null && (\n\t\t\t\t\t\t<_Slider.Thumb\n\t\t\t\t\t\t\taria-valuemin={(min ?? 0) * ariaValueModifier}\n\t\t\t\t\t\t\taria-valuenow={value * ariaValueModifier}\n\t\t\t\t\t\t\taria-valuemax={steps * ariaValueModifier}\n\t\t\t\t\t\t\taria-label={titleAndLabel}\n\t\t\t\t\t\t\tclassName=\"tlui-slider__thumb\"\n\t\t\t\t\t\t\tdir=\"ltr\"\n\t\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\t\ttabIndex={tabIndex}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</_Slider.Root>\n\t\t\t</TldrawUiTooltip>\n\t\t</div>\n\t)\n})\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAsFI;AAtFJ,oBAAuB;AACvB,sBAAkC;AAClC,mBAAwD;AAExD,4BAA+B;AAC/B,6BAAiD;AAgB1C,MAAM,iBAAiB,aAAAA,QAAM,WAA4C,SAAS,OACxF;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;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oDAAC,gBAAAA,OAAQ,OAAR,EAAc,WAAU,sBAAqB,KAAI,OAChD,oBAAU,QAAQ,4CAAC,gBAAAA,OAAQ,OAAR,EAAc,WAAU,sBAAqB,KAAI,OAAM,GAC5E;AAAA,QACC,UAAU,QACV;AAAA,UAAC,gBAAAA,OAAQ;AAAA,UAAR;AAAA,YACA,kBAAgB,OAAO,KAAK;AAAA,YAC5B,iBAAe,QAAQ;AAAA,YACvB,iBAAe,QAAQ;AAAA,YACvB,cAAY;AAAA,YACZ,WAAU;AAAA,YACV,KAAI;AAAA,YACJ;AAAA,YACA;AAAA;AAAA,QACD;AAAA;AAAA;AAAA,EAEF,GACD,GACD;AAEF,CAAC;",
6
6
  "names": ["React", "value", "_Slider"]
7
7
  }
@@ -30,7 +30,7 @@ var TldrawUiTooltip_exports = {};
30
30
  __export(TldrawUiTooltip_exports, {
31
31
  TldrawUiTooltip: () => TldrawUiTooltip,
32
32
  TldrawUiTooltipProvider: () => TldrawUiTooltipProvider,
33
- tooltipManager: () => tooltipManager
33
+ hideAllTooltips: () => hideAllTooltips
34
34
  });
35
35
  module.exports = __toCommonJS(TldrawUiTooltip_exports);
36
36
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -41,74 +41,97 @@ var import_layout = require("./layout");
41
41
  const DEFAULT_TOOLTIP_DELAY_MS = 700;
42
42
  class TooltipManager {
43
43
  static instance = null;
44
- currentTooltip = (0, import_editor.atom)("current tooltip", null);
45
- destroyTimeoutId = null;
44
+ state = (0, import_editor.atom)("tooltip state", { name: "idle" });
46
45
  static getInstance() {
47
46
  if (!TooltipManager.instance) {
48
47
  TooltipManager.instance = new TooltipManager();
49
48
  }
50
49
  return TooltipManager.instance;
51
50
  }
52
- showTooltip(tooltipId, content, targetElement, side, sideOffset, showOnMobile, delayDuration) {
53
- if (this.destroyTimeoutId) {
54
- clearTimeout(this.destroyTimeoutId);
55
- this.destroyTimeoutId = null;
56
- }
57
- this.currentTooltip.set({
58
- id: tooltipId,
59
- content,
60
- side,
61
- sideOffset,
62
- showOnMobile,
63
- targetElement,
64
- delayDuration
65
- });
51
+ hideAllTooltips() {
52
+ this.handleEvent({ type: "hide_all" });
66
53
  }
67
- updateCurrentTooltip(tooltipId, update) {
68
- this.currentTooltip.update((tooltip) => {
69
- if (tooltip?.id === tooltipId) {
70
- return update(tooltip);
54
+ handleEvent(event) {
55
+ const currentState = this.state.get();
56
+ switch (event.type) {
57
+ case "pointer_down": {
58
+ if (currentState.name === "waiting_to_hide") {
59
+ clearTimeout(currentState.timeoutId);
60
+ }
61
+ this.state.set({ name: "pointer_down" });
62
+ break;
71
63
  }
72
- return tooltip;
73
- });
74
- }
75
- hideTooltip(editor, tooltipId, instant = false) {
76
- const hide = () => {
77
- if (this.currentTooltip.get()?.id === tooltipId) {
78
- this.currentTooltip.set(null);
79
- this.destroyTimeoutId = null;
64
+ case "pointer_up": {
65
+ if (currentState.name === "pointer_down") {
66
+ this.state.set({ name: "idle" });
67
+ }
68
+ break;
69
+ }
70
+ case "show": {
71
+ if (currentState.name === "pointer_down") {
72
+ return;
73
+ }
74
+ if (currentState.name === "waiting_to_hide") {
75
+ clearTimeout(currentState.timeoutId);
76
+ }
77
+ this.state.set({ name: "showing", tooltip: event.tooltip });
78
+ break;
79
+ }
80
+ case "hide": {
81
+ const { tooltipId, editor, instant } = event;
82
+ if (currentState.name === "showing" && currentState.tooltip.id === tooltipId) {
83
+ if (editor && !instant) {
84
+ const timeoutId = editor.timers.setTimeout(() => {
85
+ const state = this.state.get();
86
+ if (state.name === "waiting_to_hide" && state.tooltip.id === tooltipId) {
87
+ this.state.set({ name: "idle" });
88
+ }
89
+ }, 300);
90
+ this.state.set({
91
+ name: "waiting_to_hide",
92
+ tooltip: currentState.tooltip,
93
+ timeoutId
94
+ });
95
+ } else {
96
+ this.state.set({ name: "idle" });
97
+ }
98
+ } else if (currentState.name === "waiting_to_hide" && currentState.tooltip.id === tooltipId) {
99
+ if (instant) {
100
+ clearTimeout(currentState.timeoutId);
101
+ this.state.set({ name: "idle" });
102
+ }
103
+ }
104
+ break;
105
+ }
106
+ case "hide_all": {
107
+ if (currentState.name === "waiting_to_hide") {
108
+ clearTimeout(currentState.timeoutId);
109
+ }
110
+ if (currentState.name === "pointer_down") {
111
+ return;
112
+ }
113
+ this.state.set({ name: "idle" });
114
+ break;
80
115
  }
81
- };
82
- if (editor && !instant) {
83
- this.destroyTimeoutId = editor.timers.setTimeout(hide, 300);
84
- } else {
85
- hide();
86
116
  }
87
117
  }
88
- hideAllTooltips() {
89
- this.currentTooltip.set(null);
90
- this.destroyTimeoutId = null;
91
- }
92
118
  getCurrentTooltipData() {
93
- const currentTooltip = this.currentTooltip.get();
94
- if (!currentTooltip) return null;
95
- if (!this.supportsHover() && !currentTooltip.showOnMobile) return null;
96
- return currentTooltip;
97
- }
98
- supportsHoverAtom = null;
99
- supportsHover() {
100
- if (!this.supportsHoverAtom) {
101
- const mediaQuery = window.matchMedia("(hover: hover)");
102
- const supportsHover = (0, import_editor.atom)("has hover", mediaQuery.matches);
103
- this.supportsHoverAtom = supportsHover;
104
- mediaQuery.addEventListener("change", (e) => {
105
- supportsHover.set(e.matches);
106
- });
119
+ const currentState = this.state.get();
120
+ let tooltip = null;
121
+ if (currentState.name === "showing") {
122
+ tooltip = currentState.tooltip;
123
+ } else if (currentState.name === "waiting_to_hide") {
124
+ tooltip = currentState.tooltip;
107
125
  }
108
- return this.supportsHoverAtom.get();
126
+ if (!tooltip) return null;
127
+ if (import_editor.tlenvReactive.get().isCoarsePointer && !tooltip.showOnMobile) return null;
128
+ return tooltip;
109
129
  }
110
130
  }
111
131
  const tooltipManager = TooltipManager.getInstance();
132
+ function hideAllTooltips() {
133
+ tooltipManager.hideAllTooltips();
134
+ }
112
135
  const TooltipSingletonContext = (0, import_react.createContext)(false);
113
136
  function TldrawUiTooltipProvider({ children }) {
114
137
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Tooltip.Provider, { skipDelayDuration: 700, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TooltipSingletonContext.Provider, { value: true, children: [
@@ -129,13 +152,18 @@ function TooltipSingleton() {
129
152
  const cameraState = (0, import_editor.useValue)("camera state", () => editor?.getCameraState(), [editor]);
130
153
  (0, import_react.useEffect)(() => {
131
154
  if (cameraState === "moving" && isOpen && currentTooltip) {
132
- tooltipManager.hideTooltip(editor, currentTooltip.id, true);
155
+ tooltipManager.handleEvent({
156
+ type: "hide",
157
+ tooltipId: currentTooltip.id,
158
+ editor,
159
+ instant: true
160
+ });
133
161
  }
134
162
  }, [cameraState, isOpen, currentTooltip, editor]);
135
163
  (0, import_react.useEffect)(() => {
136
164
  function handleKeyDown(event) {
137
165
  if (event.key === "Escape" && currentTooltip && isOpen) {
138
- tooltipManager.hideTooltip(editor, currentTooltip.id);
166
+ hideAllTooltips();
139
167
  event.stopPropagation();
140
168
  }
141
169
  }
@@ -143,7 +171,24 @@ function TooltipSingleton() {
143
171
  return () => {
144
172
  document.removeEventListener("keydown", handleKeyDown, { capture: true });
145
173
  };
146
- }, [editor, currentTooltip, isOpen]);
174
+ }, [currentTooltip, isOpen]);
175
+ (0, import_react.useEffect)(() => {
176
+ function handlePointerDown() {
177
+ tooltipManager.handleEvent({ type: "pointer_down" });
178
+ }
179
+ function handlePointerUp() {
180
+ tooltipManager.handleEvent({ type: "pointer_up" });
181
+ }
182
+ document.addEventListener("pointerdown", handlePointerDown, { capture: true });
183
+ document.addEventListener("pointerup", handlePointerUp, { capture: true });
184
+ document.addEventListener("pointercancel", handlePointerUp, { capture: true });
185
+ return () => {
186
+ document.removeEventListener("pointerdown", handlePointerDown, { capture: true });
187
+ document.removeEventListener("pointerup", handlePointerUp, { capture: true });
188
+ document.removeEventListener("pointercancel", handlePointerUp, { capture: true });
189
+ tooltipManager.handleEvent({ type: "pointer_up" });
190
+ };
191
+ }, []);
147
192
  (0, import_react.useEffect)(() => {
148
193
  let timer = null;
149
194
  if (currentTooltip && triggerRef.current) {
@@ -220,21 +265,15 @@ const TldrawUiTooltip = (0, import_react.forwardRef)(
220
265
  const currentTooltipId = tooltipId.current;
221
266
  return () => {
222
267
  if (hasProvider) {
223
- tooltipManager.hideTooltip(editor, currentTooltipId, true);
268
+ tooltipManager.handleEvent({
269
+ type: "hide",
270
+ tooltipId: currentTooltipId,
271
+ editor,
272
+ instant: true
273
+ });
224
274
  }
225
275
  };
226
276
  }, [editor, hasProvider]);
227
- (0, import_react.useLayoutEffect)(() => {
228
- if (hasProvider && tooltipManager.getCurrentTooltipData()?.id === tooltipId.current) {
229
- tooltipManager.updateCurrentTooltip(tooltipId.current, (tooltip) => ({
230
- ...tooltip,
231
- content,
232
- side: sideToUse,
233
- sideOffset,
234
- showOnMobile
235
- }));
236
- }
237
- }, [content, sideToUse, sideOffset, showOnMobile, hasProvider]);
238
277
  if (disabled || !content) {
239
278
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
240
279
  }
@@ -275,35 +314,51 @@ const TldrawUiTooltip = (0, import_react.forwardRef)(
275
314
  (0, import_editor.assert)(import_react.default.isValidElement(child), "TldrawUiTooltip children must be a single element");
276
315
  const handleMouseEnter = (event) => {
277
316
  child.props.onMouseEnter?.(event);
278
- tooltipManager.showTooltip(
279
- tooltipId.current,
280
- content,
281
- event.currentTarget,
282
- sideToUse,
283
- sideOffset,
284
- showOnMobile,
285
- delayDurationToUse
286
- );
317
+ tooltipManager.handleEvent({
318
+ type: "show",
319
+ tooltip: {
320
+ id: tooltipId.current,
321
+ content,
322
+ targetElement: event.currentTarget,
323
+ side: sideToUse,
324
+ sideOffset,
325
+ showOnMobile,
326
+ delayDuration: delayDurationToUse
327
+ }
328
+ });
287
329
  };
288
330
  const handleMouseLeave = (event) => {
289
331
  child.props.onMouseLeave?.(event);
290
- tooltipManager.hideTooltip(editor, tooltipId.current);
332
+ tooltipManager.handleEvent({
333
+ type: "hide",
334
+ tooltipId: tooltipId.current,
335
+ editor,
336
+ instant: false
337
+ });
291
338
  };
292
339
  const handleFocus = (event) => {
293
340
  child.props.onFocus?.(event);
294
- tooltipManager.showTooltip(
295
- tooltipId.current,
296
- content,
297
- event.currentTarget,
298
- sideToUse,
299
- sideOffset,
300
- showOnMobile,
301
- delayDurationToUse
302
- );
341
+ tooltipManager.handleEvent({
342
+ type: "show",
343
+ tooltip: {
344
+ id: tooltipId.current,
345
+ content,
346
+ targetElement: event.currentTarget,
347
+ side: sideToUse,
348
+ sideOffset,
349
+ showOnMobile,
350
+ delayDuration: delayDurationToUse
351
+ }
352
+ });
303
353
  };
304
354
  const handleBlur = (event) => {
305
355
  child.props.onBlur?.(event);
306
- tooltipManager.hideTooltip(editor, tooltipId.current);
356
+ tooltipManager.handleEvent({
357
+ type: "hide",
358
+ tooltipId: tooltipId.current,
359
+ editor,
360
+ instant: false
361
+ });
307
362
  };
308
363
  const childrenWithHandlers = import_react.default.cloneElement(children, {
309
364
  onMouseEnter: handleMouseEnter,