tldraw 5.3.2 → 5.4.0-canary.042da660fa66

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 (93) hide show
  1. package/DOCS.md +2822 -3224
  2. package/RELEASE_NOTES.md +11 -39
  3. package/dist-cjs/index.d.ts +264 -275
  4. package/dist-cjs/index.js +1 -1
  5. package/dist-cjs/lib/defaultExternalContentHandlers.js +2 -2
  6. package/dist-cjs/lib/defaultExternalContentHandlers.js.map +2 -2
  7. package/dist-cjs/lib/shapes/draw/toolStates/Drawing.js +2 -2
  8. package/dist-cjs/lib/shapes/draw/toolStates/Drawing.js.map +2 -2
  9. package/dist-cjs/lib/shapes/frame/frameHelpers.js +3 -0
  10. package/dist-cjs/lib/shapes/frame/frameHelpers.js.map +2 -2
  11. package/dist-cjs/lib/shapes/video/VideoShapeUtil.js +3 -2
  12. package/dist-cjs/lib/shapes/video/VideoShapeUtil.js.map +2 -2
  13. package/dist-cjs/lib/ui/TldrawUi.js +2 -3
  14. package/dist-cjs/lib/ui/TldrawUi.js.map +2 -2
  15. package/dist-cjs/lib/ui/components/ActionsMenu/DefaultActionsMenu.js +0 -3
  16. package/dist-cjs/lib/ui/components/ActionsMenu/DefaultActionsMenu.js.map +2 -2
  17. package/dist-cjs/lib/ui/components/ContextMenu/DefaultContextMenuContent.js +1 -1
  18. package/dist-cjs/lib/ui/components/ContextMenu/DefaultContextMenuContent.js.map +2 -2
  19. package/dist-cjs/lib/ui/components/Dialogs.js +8 -0
  20. package/dist-cjs/lib/ui/components/Dialogs.js.map +2 -2
  21. package/dist-cjs/lib/ui/components/SharePanel/DefaultPeopleMenuItem.js +1 -2
  22. package/dist-cjs/lib/ui/components/SharePanel/DefaultPeopleMenuItem.js.map +2 -2
  23. package/dist-cjs/lib/ui/context/actions.js +0 -1
  24. package/dist-cjs/lib/ui/context/actions.js.map +2 -2
  25. package/dist-cjs/lib/ui/hooks/useClipboardEvents.js +2 -0
  26. package/dist-cjs/lib/ui/hooks/useClipboardEvents.js.map +2 -2
  27. package/dist-cjs/lib/ui/hooks/useFlatten.js +42 -23
  28. package/dist-cjs/lib/ui/hooks/useFlatten.js.map +2 -2
  29. package/dist-cjs/lib/ui/hooks/useKeyboardShortcuts.js +5 -17
  30. package/dist-cjs/lib/ui/hooks/useKeyboardShortcuts.js.map +2 -2
  31. package/dist-cjs/lib/ui/kbd-utils.js +22 -3
  32. package/dist-cjs/lib/ui/kbd-utils.js.map +2 -2
  33. package/dist-cjs/lib/ui/version.js +3 -3
  34. package/dist-cjs/lib/ui/version.js.map +1 -1
  35. package/dist-esm/index.d.mts +264 -275
  36. package/dist-esm/index.mjs +1 -1
  37. package/dist-esm/lib/defaultExternalContentHandlers.mjs +2 -2
  38. package/dist-esm/lib/defaultExternalContentHandlers.mjs.map +2 -2
  39. package/dist-esm/lib/shapes/draw/toolStates/Drawing.mjs +2 -2
  40. package/dist-esm/lib/shapes/draw/toolStates/Drawing.mjs.map +2 -2
  41. package/dist-esm/lib/shapes/frame/frameHelpers.mjs +3 -0
  42. package/dist-esm/lib/shapes/frame/frameHelpers.mjs.map +2 -2
  43. package/dist-esm/lib/shapes/video/VideoShapeUtil.mjs +3 -2
  44. package/dist-esm/lib/shapes/video/VideoShapeUtil.mjs.map +2 -2
  45. package/dist-esm/lib/ui/TldrawUi.mjs +2 -3
  46. package/dist-esm/lib/ui/TldrawUi.mjs.map +2 -2
  47. package/dist-esm/lib/ui/components/ActionsMenu/DefaultActionsMenu.mjs +2 -5
  48. package/dist-esm/lib/ui/components/ActionsMenu/DefaultActionsMenu.mjs.map +2 -2
  49. package/dist-esm/lib/ui/components/ContextMenu/DefaultContextMenuContent.mjs +1 -1
  50. package/dist-esm/lib/ui/components/ContextMenu/DefaultContextMenuContent.mjs.map +2 -2
  51. package/dist-esm/lib/ui/components/Dialogs.mjs +9 -1
  52. package/dist-esm/lib/ui/components/Dialogs.mjs.map +2 -2
  53. package/dist-esm/lib/ui/components/SharePanel/DefaultPeopleMenuItem.mjs +1 -2
  54. package/dist-esm/lib/ui/components/SharePanel/DefaultPeopleMenuItem.mjs.map +2 -2
  55. package/dist-esm/lib/ui/context/actions.mjs +0 -1
  56. package/dist-esm/lib/ui/context/actions.mjs.map +2 -2
  57. package/dist-esm/lib/ui/hooks/useClipboardEvents.mjs +2 -0
  58. package/dist-esm/lib/ui/hooks/useClipboardEvents.mjs.map +2 -2
  59. package/dist-esm/lib/ui/hooks/useFlatten.mjs +42 -23
  60. package/dist-esm/lib/ui/hooks/useFlatten.mjs.map +2 -2
  61. package/dist-esm/lib/ui/hooks/useKeyboardShortcuts.mjs +5 -17
  62. package/dist-esm/lib/ui/hooks/useKeyboardShortcuts.mjs.map +2 -2
  63. package/dist-esm/lib/ui/kbd-utils.mjs +22 -3
  64. package/dist-esm/lib/ui/kbd-utils.mjs.map +2 -2
  65. package/dist-esm/lib/ui/version.mjs +3 -3
  66. package/dist-esm/lib/ui/version.mjs.map +1 -1
  67. package/package.json +6 -6
  68. package/src/lib/defaultExternalContentHandlers.ts +2 -2
  69. package/src/lib/shapes/draw/DrawShapeTool.test.ts +19 -0
  70. package/src/lib/shapes/draw/toolStates/Drawing.ts +2 -2
  71. package/src/lib/shapes/frame/frameHelpers.ts +10 -1
  72. package/src/lib/shapes/video/VideoShapeUtil.tsx +4 -2
  73. package/src/lib/ui/TldrawUi.tsx +1 -2
  74. package/src/lib/ui/components/ActionsMenu/DefaultActionsMenu.tsx +2 -6
  75. package/src/lib/ui/components/ContextMenu/DefaultContextMenuContent.tsx +5 -1
  76. package/src/lib/ui/components/Dialogs.tsx +17 -1
  77. package/src/lib/ui/components/SharePanel/DefaultPeopleMenuItem.tsx +2 -3
  78. package/src/lib/ui/context/actions.tsx +0 -1
  79. package/src/lib/ui/hooks/useClipboardEvents.ts +2 -0
  80. package/src/lib/ui/hooks/useFlatten.ts +56 -23
  81. package/src/lib/ui/hooks/useKeyboardShortcuts.ts +5 -23
  82. package/src/lib/ui/kbd-utils.test.ts +11 -0
  83. package/src/lib/ui/kbd-utils.ts +27 -4
  84. package/src/lib/ui/version.ts +3 -3
  85. package/src/lib/ui.css +7 -16
  86. package/src/test/TldrawEditor.test.tsx +3 -0
  87. package/src/test/VideoShapeUtil.test.tsx +126 -0
  88. package/src/test/bookmark-shapes.test.ts +110 -0
  89. package/src/test/commands/alignShapes.test.tsx +19 -10
  90. package/src/test/commands/clipboard.test.ts +36 -1
  91. package/src/test/flatten.test.ts +135 -0
  92. package/src/test/modifiers.test.ts +104 -0
  93. package/tldraw.css +7 -16
@@ -60,14 +60,13 @@ const TldrawUi = import_react.default.memo(function TldrawUi2({
60
60
  });
61
61
  const TldrawUiInner = import_react.default.memo(function TldrawUiInner2({
62
62
  children,
63
- hideUi,
64
- ...rest
63
+ hideUi
65
64
  }) {
66
65
  (0, import_useKeyboardShortcuts.useKeyboardShortcuts)();
67
66
  (0, import_useClipboardEvents.useNativeClipboardEvents)();
68
67
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
69
68
  children,
70
- hideUi ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TldrawUiContent, { ...rest })
69
+ hideUi ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TldrawUiContent, {})
71
70
  ] });
72
71
  });
73
72
  const TldrawUiContent = import_react.default.memo(function TldrawUI() {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/lib/ui/TldrawUi.tsx"],
4
- "sourcesContent": ["import { tlenv, useContainer, useEditor, useReactor, useValue } from '@tldraw/editor'\nimport classNames from 'classnames'\nimport React, { ReactNode, useEffect, useMemo, useRef, useState } from 'react'\nimport { TLUiAssetUrlOverrides } from './assetUrls'\nimport { SkipToMainContent } from './components/A11y'\nimport { TldrawUiButton } from './components/primitives/Button/TldrawUiButton'\nimport { TldrawUiButtonIcon } from './components/primitives/Button/TldrawUiButtonIcon'\nimport { PORTRAIT_BREAKPOINT, PORTRAIT_BREAKPOINTS } from './constants'\nimport { useActions } from './context/actions'\nimport { useBreakpoint } from './context/breakpoints'\nimport { TLUiComponents, useTldrawUiComponents } from './context/components'\nimport {\n\tTLUiContextProviderProps,\n\tTldrawUiContextProvider,\n} from './context/TldrawUiContextProvider'\nimport { useNativeClipboardEvents } from './hooks/useClipboardEvents'\nimport { useEditorEvents } from './hooks/useEditorEvents'\nimport { useKeyboardShortcuts } from './hooks/useKeyboardShortcuts'\nimport { useReadonly } from './hooks/useReadonly'\nimport { useDirection, useTranslation } from './hooks/useTranslation/useTranslation'\n\n/** @public */\nexport interface TldrawUiProps extends TLUiContextProviderProps {\n\t/**\n\t * The component's children.\n\t */\n\tchildren?: ReactNode\n\n\t/**\n\t * Whether to hide the user interface and only display the canvas.\n\t */\n\thideUi?: boolean\n\n\t/**\n\t * Overrides for the UI components.\n\t */\n\tcomponents?: TLUiComponents\n\n\t/**\n\t * Additional items to add to the debug menu (will be deprecated)\n\t */\n\trenderDebugMenuItems?(): React.ReactNode\n\n\t/** Asset URL override. */\n\tassetUrls?: TLUiAssetUrlOverrides\n}\n\n/**\n * @public\n * @react\n */\nexport const TldrawUi = React.memo(function TldrawUi({\n\trenderDebugMenuItems,\n\tchildren,\n\thideUi,\n\tcomponents,\n\t...rest\n}: TldrawUiProps) {\n\treturn (\n\t\t<TldrawUiContextProvider {...rest} components={components}>\n\t\t\t<TldrawUiInner hideUi={hideUi} renderDebugMenuItems={renderDebugMenuItems}>\n\t\t\t\t{children}\n\t\t\t</TldrawUiInner>\n\t\t</TldrawUiContextProvider>\n\t)\n})\n\ninterface TldrawUiContentProps {\n\thideUi?: boolean\n\tshareZone?: ReactNode\n\ttopZone?: ReactNode\n\trenderDebugMenuItems?(): React.ReactNode\n}\n\nconst TldrawUiInner = React.memo(function TldrawUiInner({\n\tchildren,\n\thideUi,\n\t...rest\n}: TldrawUiContentProps & { children: ReactNode }) {\n\t// The hideUi prop should prevent the UI from mounting.\n\t// If we ever need want the UI to mount and preserve state, then\n\t// we should change this behavior and hide the UI via CSS instead.\n\n\t// Keyboard shortcuts and clipboard events should always be mounted,\n\t// even when the UI is hidden.\n\tuseKeyboardShortcuts()\n\tuseNativeClipboardEvents()\n\n\treturn (\n\t\t<>\n\t\t\t{children}\n\t\t\t{hideUi ? null : <TldrawUiContent {...rest} />}\n\t\t</>\n\t)\n})\n\nconst TldrawUiContent = React.memo(function TldrawUI() {\n\tconst editor = useEditor()\n\tconst msg = useTranslation()\n\tconst breakpoint = useBreakpoint()\n\tconst isReadonlyMode = useReadonly()\n\tconst isFocusMode = useValue('focus', () => editor.getInstanceState().isFocusMode, [editor])\n\tconst isDebugMode = useValue('debug', () => editor.getInstanceState().isDebugMode, [editor])\n\n\tconst container = useContainer()\n\tconst dir = useDirection()\n\tconst locale = useValue('locale', () => editor.user.getLocale(), [editor])\n\tuseEffect(() => {\n\t\tcontainer.dir = dir\n\t\tcontainer.lang = locale\n\t}, [container, dir, locale])\n\n\tconst {\n\t\tSharePanel,\n\t\tTopPanel,\n\t\tMenuPanel,\n\t\tStylePanel,\n\t\tToolbar,\n\t\tHelpMenu,\n\t\tNavigationPanel,\n\t\tHelperButtons,\n\t\tDebugPanel,\n\t\tToasts,\n\t\tDialogs,\n\t\tA11y,\n\t\tFollowingIndicator,\n\t} = useTldrawUiComponents()\n\n\tuseEditorEvents()\n\n\tconst rIsEditingAnything = useRef(false)\n\tconst rHidingTimeout = useRef(-1 as any)\n\tconst [hideToolbarWhileEditing, setHideToolbarWhileEditing] = useState(false)\n\n\tuseReactor(\n\t\t'update hide toolbar while delayed',\n\t\t() => {\n\t\t\tconst isMobileEnvironment = tlenv.isIos || tlenv.isAndroid\n\t\t\tif (!isMobileEnvironment) return\n\n\t\t\tconst editingShape = editor.getEditingShapeId()\n\t\t\tif (editingShape === null) {\n\t\t\t\tif (rIsEditingAnything.current) {\n\t\t\t\t\trIsEditingAnything.current = false\n\t\t\t\t\tclearTimeout(rHidingTimeout.current)\n\t\t\t\t\tif (tlenv.isAndroid) {\n\t\t\t\t\t\t// On Android, hide it after 150ms\n\t\t\t\t\t\trHidingTimeout.current = editor.timers.setTimeout(() => {\n\t\t\t\t\t\t\tsetHideToolbarWhileEditing(false)\n\t\t\t\t\t\t}, 150)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// On iOS, just hide it immediately\n\t\t\t\t\t\tsetHideToolbarWhileEditing(false)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (!rIsEditingAnything.current) {\n\t\t\t\trIsEditingAnything.current = true\n\t\t\t\tclearTimeout(rHidingTimeout.current)\n\t\t\t\tsetHideToolbarWhileEditing(true)\n\t\t\t}\n\t\t},\n\t\t[]\n\t)\n\n\tconst { 'toggle-focus-mode': toggleFocus } = useActions()\n\n\tconst { breakpointsAbove, breakpointsBelow } = useMemo(() => {\n\t\tconst breakpointsAbove = []\n\t\tconst breakpointsBelow = []\n\t\tfor (let bp = 0; bp < PORTRAIT_BREAKPOINTS.length; bp++) {\n\t\t\tif (bp <= breakpoint) {\n\t\t\t\tbreakpointsAbove.push(bp)\n\t\t\t} else {\n\t\t\t\tbreakpointsBelow.push(bp)\n\t\t\t}\n\t\t}\n\t\treturn { breakpointsAbove, breakpointsBelow }\n\t}, [breakpoint])\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames('tlui-layout', {\n\t\t\t\t'tlui-layout__mobile': breakpoint < PORTRAIT_BREAKPOINT.TABLET_SM,\n\t\t\t})}\n\t\t\t// The outer editor container has role=\"application\" so that desktop screen readers treat\n\t\t\t// the canvas as an interactive surface. Mark the UI layer as role=\"document\" so that the\n\t\t\t// toolbar, menus, and dialogs stay navigable to assistive tech \u2014 especially mobile screen\n\t\t\t// readers like VoiceOver and TalkBack that do not announce role=\"application\". See\n\t\t\t// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/application_role\n\t\t\trole=\"document\"\n\t\t\t// When the virtual keyboard is opening we want it to hide immediately.\n\t\t\t// But when the virtual keyboard is closing we want to wait a bit before showing it again.\n\t\t\tdata-iseditinganything={hideToolbarWhileEditing}\n\t\t\tdata-breakpoint={breakpoint}\n\t\t\tdata-breakpoints-above={breakpointsAbove.join(' ')}\n\t\t\tdata-breakpoints-below={breakpointsBelow.join(' ')}\n\t\t>\n\t\t\t<SkipToMainContent />\n\t\t\t{isFocusMode ? (\n\t\t\t\t<div className=\"tlui-layout__top\">\n\t\t\t\t\t<TldrawUiButton\n\t\t\t\t\t\ttype=\"icon\"\n\t\t\t\t\t\tclassName=\"tlui-focus-button\"\n\t\t\t\t\t\ttitle={msg('focus-mode.toggle-focus-mode')}\n\t\t\t\t\t\tonClick={() => toggleFocus.onSelect('menu')}\n\t\t\t\t\t>\n\t\t\t\t\t\t<TldrawUiButtonIcon icon=\"dot\" />\n\t\t\t\t\t</TldrawUiButton>\n\t\t\t\t</div>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<div className=\"tlui-layout__top\">\n\t\t\t\t\t\t<div className=\"tlui-layout__top__left\">\n\t\t\t\t\t\t\t{MenuPanel && <MenuPanel />}\n\t\t\t\t\t\t\t{HelperButtons && <HelperButtons />}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"tlui-layout__top__center\">{TopPanel && <TopPanel />}</div>\n\t\t\t\t\t\t<div className=\"tlui-layout__top__right\">\n\t\t\t\t\t\t\t{SharePanel && <SharePanel />}\n\t\t\t\t\t\t\t{StylePanel && breakpoint >= PORTRAIT_BREAKPOINT.TABLET_SM && !isReadonlyMode && (\n\t\t\t\t\t\t\t\t<StylePanel />\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"tlui-layout__bottom\">\n\t\t\t\t\t\t<div className=\"tlui-layout__bottom__main\">\n\t\t\t\t\t\t\t{NavigationPanel && <NavigationPanel />}\n\t\t\t\t\t\t\t{Toolbar && <Toolbar />}\n\t\t\t\t\t\t\t{HelpMenu && <HelpMenu />}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{isDebugMode && DebugPanel && <DebugPanel />}\n\t\t\t\t\t\t{A11y && <A11y />}\n\t\t\t\t\t</div>\n\t\t\t\t</>\n\t\t\t)}\n\t\t\t{FollowingIndicator && <FollowingIndicator />}\n\t\t\t{Toasts && <Toasts />}\n\t\t\t{Dialogs && <Dialogs />}\n\t\t</div>\n\t)\n})\n\n/** @public @react */\nexport function TldrawUiInFrontOfTheCanvas() {\n\tconst { RichTextToolbar, ImageToolbar, VideoToolbar, CursorChatBubble } = useTldrawUiComponents()\n\n\treturn (\n\t\t<>\n\t\t\t{RichTextToolbar && <RichTextToolbar />}\n\t\t\t{ImageToolbar && <ImageToolbar />}\n\t\t\t{VideoToolbar && <VideoToolbar />}\n\t\t\t{CursorChatBubble && <CursorChatBubble />}\n\t\t</>\n\t)\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4DG;AA5DH,oBAAqE;AACrE,wBAAuB;AACvB,mBAAuE;AAEvE,kBAAkC;AAClC,4BAA+B;AAC/B,gCAAmC;AACnC,uBAA0D;AAC1D,qBAA2B;AAC3B,yBAA8B;AAC9B,wBAAsD;AACtD,qCAGO;AACP,gCAAyC;AACzC,6BAAgC;AAChC,kCAAqC;AACrC,yBAA4B;AAC5B,4BAA6C;AAgCtC,MAAM,WAAW,aAAAA,QAAM,KAAK,SAASC,UAAS;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAkB;AACjB,SACC,4CAAC,0DAAyB,GAAG,MAAM,YAClC,sDAAC,iBAAc,QAAgB,sBAC7B,UACF,GACD;AAEF,CAAC;AASD,MAAM,gBAAgB,aAAAD,QAAM,KAAK,SAASE,eAAc;AAAA,EACvD;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAmD;AAOlD,wDAAqB;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AAA,YAE1C,sDAAC,gDAAmB,MAAK,OAAM;AAAA;AAAA,QAChC,GACD,IAEA,4EACC;AAAA,uDAAC,SAAI,WAAU,oBACd;AAAA,yDAAC,SAAI,WAAU,0BACb;AAAA,2BAAa,4CAAC,aAAU;AAAA,cACxB,iBAAiB,4CAAC,iBAAc;AAAA,eAClC;AAAA,YACA,4CAAC,SAAI,WAAU,4BAA4B,sBAAY,4CAAC,YAAS,GAAG;AAAA,YACpE,6CAAC,SAAI,WAAU,2BACb;AAAA,4BAAc,4CAAC,cAAW;AAAA,cAC1B,cAAc,cAAc,qCAAoB,aAAa,CAAC,kBAC9D,4CAAC,cAAW;AAAA,eAEd;AAAA,aACD;AAAA,UACA,6CAAC,SAAI,WAAU,uBACd;AAAA,yDAAC,SAAI,WAAU,6BACb;AAAA,iCAAmB,4CAAC,mBAAgB;AAAA,cACpC,WAAW,4CAAC,WAAQ;AAAA,cACpB,YAAY,4CAAC,YAAS;AAAA,eACxB;AAAA,YACC,eAAe,cAAc,4CAAC,cAAW;AAAA,YACzC,QAAQ,4CAAC,QAAK;AAAA,aAChB;AAAA,WACD;AAAA,QAEA,sBAAsB,4CAAC,sBAAmB;AAAA,QAC1C,UAAU,4CAAC,UAAO;AAAA,QAClB,WAAW,4CAAC,WAAQ;AAAA;AAAA;AAAA,EACtB;AAEF,CAAC;AAGM,SAAS,6BAA6B;AAC5C,QAAM,EAAE,iBAAiB,cAAc,cAAc,iBAAiB,QAAI,yCAAsB;AAEhG,SACC,4EACE;AAAA,uBAAmB,4CAAC,mBAAgB;AAAA,IACpC,gBAAgB,4CAAC,gBAAa;AAAA,IAC9B,gBAAgB,4CAAC,gBAAa;AAAA,IAC9B,oBAAoB,4CAAC,oBAAiB;AAAA,KACxC;AAEF;",
4
+ "sourcesContent": ["import { tlenv, useContainer, useEditor, useReactor, useValue } from '@tldraw/editor'\nimport classNames from 'classnames'\nimport React, { ReactNode, useEffect, useMemo, useRef, useState } from 'react'\nimport { TLUiAssetUrlOverrides } from './assetUrls'\nimport { SkipToMainContent } from './components/A11y'\nimport { TldrawUiButton } from './components/primitives/Button/TldrawUiButton'\nimport { TldrawUiButtonIcon } from './components/primitives/Button/TldrawUiButtonIcon'\nimport { PORTRAIT_BREAKPOINT, PORTRAIT_BREAKPOINTS } from './constants'\nimport { useActions } from './context/actions'\nimport { useBreakpoint } from './context/breakpoints'\nimport { TLUiComponents, useTldrawUiComponents } from './context/components'\nimport {\n\tTLUiContextProviderProps,\n\tTldrawUiContextProvider,\n} from './context/TldrawUiContextProvider'\nimport { useNativeClipboardEvents } from './hooks/useClipboardEvents'\nimport { useEditorEvents } from './hooks/useEditorEvents'\nimport { useKeyboardShortcuts } from './hooks/useKeyboardShortcuts'\nimport { useReadonly } from './hooks/useReadonly'\nimport { useDirection, useTranslation } from './hooks/useTranslation/useTranslation'\n\n/** @public */\nexport interface TldrawUiProps extends TLUiContextProviderProps {\n\t/**\n\t * The component's children.\n\t */\n\tchildren?: ReactNode\n\n\t/**\n\t * Whether to hide the user interface and only display the canvas.\n\t */\n\thideUi?: boolean\n\n\t/**\n\t * Overrides for the UI components.\n\t */\n\tcomponents?: TLUiComponents\n\n\t/**\n\t * Additional items to add to the debug menu (will be deprecated)\n\t */\n\trenderDebugMenuItems?(): React.ReactNode\n\n\t/** Asset URL override. */\n\tassetUrls?: TLUiAssetUrlOverrides\n}\n\n/**\n * @public\n * @react\n */\nexport const TldrawUi = React.memo(function TldrawUi({\n\trenderDebugMenuItems,\n\tchildren,\n\thideUi,\n\tcomponents,\n\t...rest\n}: TldrawUiProps) {\n\treturn (\n\t\t<TldrawUiContextProvider {...rest} components={components}>\n\t\t\t<TldrawUiInner hideUi={hideUi} renderDebugMenuItems={renderDebugMenuItems}>\n\t\t\t\t{children}\n\t\t\t</TldrawUiInner>\n\t\t</TldrawUiContextProvider>\n\t)\n})\n\ninterface TldrawUiContentProps {\n\thideUi?: boolean\n\tshareZone?: ReactNode\n\ttopZone?: ReactNode\n\trenderDebugMenuItems?(): React.ReactNode\n}\n\nconst TldrawUiInner = React.memo(function TldrawUiInner({\n\tchildren,\n\thideUi,\n}: TldrawUiContentProps & { children: ReactNode }) {\n\t// The hideUi prop should prevent the UI from mounting.\n\t// If we ever need want the UI to mount and preserve state, then\n\t// we should change this behavior and hide the UI via CSS instead.\n\n\t// Keyboard shortcuts and clipboard events should always be mounted,\n\t// even when the UI is hidden.\n\tuseKeyboardShortcuts()\n\tuseNativeClipboardEvents()\n\n\treturn (\n\t\t<>\n\t\t\t{children}\n\t\t\t{hideUi ? null : <TldrawUiContent />}\n\t\t</>\n\t)\n})\n\nconst TldrawUiContent = React.memo(function TldrawUI() {\n\tconst editor = useEditor()\n\tconst msg = useTranslation()\n\tconst breakpoint = useBreakpoint()\n\tconst isReadonlyMode = useReadonly()\n\tconst isFocusMode = useValue('focus', () => editor.getInstanceState().isFocusMode, [editor])\n\tconst isDebugMode = useValue('debug', () => editor.getInstanceState().isDebugMode, [editor])\n\n\tconst container = useContainer()\n\tconst dir = useDirection()\n\tconst locale = useValue('locale', () => editor.user.getLocale(), [editor])\n\tuseEffect(() => {\n\t\tcontainer.dir = dir\n\t\tcontainer.lang = locale\n\t}, [container, dir, locale])\n\n\tconst {\n\t\tSharePanel,\n\t\tTopPanel,\n\t\tMenuPanel,\n\t\tStylePanel,\n\t\tToolbar,\n\t\tHelpMenu,\n\t\tNavigationPanel,\n\t\tHelperButtons,\n\t\tDebugPanel,\n\t\tToasts,\n\t\tDialogs,\n\t\tA11y,\n\t\tFollowingIndicator,\n\t} = useTldrawUiComponents()\n\n\tuseEditorEvents()\n\n\tconst rIsEditingAnything = useRef(false)\n\tconst rHidingTimeout = useRef(-1 as any)\n\tconst [hideToolbarWhileEditing, setHideToolbarWhileEditing] = useState(false)\n\n\tuseReactor(\n\t\t'update hide toolbar while delayed',\n\t\t() => {\n\t\t\tconst isMobileEnvironment = tlenv.isIos || tlenv.isAndroid\n\t\t\tif (!isMobileEnvironment) return\n\n\t\t\tconst editingShape = editor.getEditingShapeId()\n\t\t\tif (editingShape === null) {\n\t\t\t\tif (rIsEditingAnything.current) {\n\t\t\t\t\trIsEditingAnything.current = false\n\t\t\t\t\tclearTimeout(rHidingTimeout.current)\n\t\t\t\t\tif (tlenv.isAndroid) {\n\t\t\t\t\t\t// On Android, hide it after 150ms\n\t\t\t\t\t\trHidingTimeout.current = editor.timers.setTimeout(() => {\n\t\t\t\t\t\t\tsetHideToolbarWhileEditing(false)\n\t\t\t\t\t\t}, 150)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// On iOS, just hide it immediately\n\t\t\t\t\t\tsetHideToolbarWhileEditing(false)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (!rIsEditingAnything.current) {\n\t\t\t\trIsEditingAnything.current = true\n\t\t\t\tclearTimeout(rHidingTimeout.current)\n\t\t\t\tsetHideToolbarWhileEditing(true)\n\t\t\t}\n\t\t},\n\t\t[]\n\t)\n\n\tconst { 'toggle-focus-mode': toggleFocus } = useActions()\n\n\tconst { breakpointsAbove, breakpointsBelow } = useMemo(() => {\n\t\tconst breakpointsAbove = []\n\t\tconst breakpointsBelow = []\n\t\tfor (let bp = 0; bp < PORTRAIT_BREAKPOINTS.length; bp++) {\n\t\t\tif (bp <= breakpoint) {\n\t\t\t\tbreakpointsAbove.push(bp)\n\t\t\t} else {\n\t\t\t\tbreakpointsBelow.push(bp)\n\t\t\t}\n\t\t}\n\t\treturn { breakpointsAbove, breakpointsBelow }\n\t}, [breakpoint])\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames('tlui-layout', {\n\t\t\t\t'tlui-layout__mobile': breakpoint < PORTRAIT_BREAKPOINT.TABLET_SM,\n\t\t\t})}\n\t\t\t// The outer editor container has role=\"application\" so that desktop screen readers treat\n\t\t\t// the canvas as an interactive surface. Mark the UI layer as role=\"document\" so that the\n\t\t\t// toolbar, menus, and dialogs stay navigable to assistive tech \u2014 especially mobile screen\n\t\t\t// readers like VoiceOver and TalkBack that do not announce role=\"application\". See\n\t\t\t// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/application_role\n\t\t\trole=\"document\"\n\t\t\t// When the virtual keyboard is opening we want it to hide immediately.\n\t\t\t// But when the virtual keyboard is closing we want to wait a bit before showing it again.\n\t\t\tdata-iseditinganything={hideToolbarWhileEditing}\n\t\t\tdata-breakpoint={breakpoint}\n\t\t\tdata-breakpoints-above={breakpointsAbove.join(' ')}\n\t\t\tdata-breakpoints-below={breakpointsBelow.join(' ')}\n\t\t>\n\t\t\t<SkipToMainContent />\n\t\t\t{isFocusMode ? (\n\t\t\t\t<div className=\"tlui-layout__top\">\n\t\t\t\t\t<TldrawUiButton\n\t\t\t\t\t\ttype=\"icon\"\n\t\t\t\t\t\tclassName=\"tlui-focus-button\"\n\t\t\t\t\t\ttitle={msg('focus-mode.toggle-focus-mode')}\n\t\t\t\t\t\tonClick={() => toggleFocus.onSelect('menu')}\n\t\t\t\t\t>\n\t\t\t\t\t\t<TldrawUiButtonIcon icon=\"dot\" />\n\t\t\t\t\t</TldrawUiButton>\n\t\t\t\t</div>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<div className=\"tlui-layout__top\">\n\t\t\t\t\t\t<div className=\"tlui-layout__top__left\">\n\t\t\t\t\t\t\t{MenuPanel && <MenuPanel />}\n\t\t\t\t\t\t\t{HelperButtons && <HelperButtons />}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"tlui-layout__top__center\">{TopPanel && <TopPanel />}</div>\n\t\t\t\t\t\t<div className=\"tlui-layout__top__right\">\n\t\t\t\t\t\t\t{SharePanel && <SharePanel />}\n\t\t\t\t\t\t\t{StylePanel && breakpoint >= PORTRAIT_BREAKPOINT.TABLET_SM && !isReadonlyMode && (\n\t\t\t\t\t\t\t\t<StylePanel />\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"tlui-layout__bottom\">\n\t\t\t\t\t\t<div className=\"tlui-layout__bottom__main\">\n\t\t\t\t\t\t\t{NavigationPanel && <NavigationPanel />}\n\t\t\t\t\t\t\t{Toolbar && <Toolbar />}\n\t\t\t\t\t\t\t{HelpMenu && <HelpMenu />}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{isDebugMode && DebugPanel && <DebugPanel />}\n\t\t\t\t\t\t{A11y && <A11y />}\n\t\t\t\t\t</div>\n\t\t\t\t</>\n\t\t\t)}\n\t\t\t{FollowingIndicator && <FollowingIndicator />}\n\t\t\t{Toasts && <Toasts />}\n\t\t\t{Dialogs && <Dialogs />}\n\t\t</div>\n\t)\n})\n\n/** @public @react */\nexport function TldrawUiInFrontOfTheCanvas() {\n\tconst { RichTextToolbar, ImageToolbar, VideoToolbar, CursorChatBubble } = useTldrawUiComponents()\n\n\treturn (\n\t\t<>\n\t\t\t{RichTextToolbar && <RichTextToolbar />}\n\t\t\t{ImageToolbar && <ImageToolbar />}\n\t\t\t{VideoToolbar && <VideoToolbar />}\n\t\t\t{CursorChatBubble && <CursorChatBubble />}\n\t\t</>\n\t)\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4DG;AA5DH,oBAAqE;AACrE,wBAAuB;AACvB,mBAAuE;AAEvE,kBAAkC;AAClC,4BAA+B;AAC/B,gCAAmC;AACnC,uBAA0D;AAC1D,qBAA2B;AAC3B,yBAA8B;AAC9B,wBAAsD;AACtD,qCAGO;AACP,gCAAyC;AACzC,6BAAgC;AAChC,kCAAqC;AACrC,yBAA4B;AAC5B,4BAA6C;AAgCtC,MAAM,WAAW,aAAAA,QAAM,KAAK,SAASC,UAAS;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAkB;AACjB,SACC,4CAAC,0DAAyB,GAAG,MAAM,YAClC,sDAAC,iBAAc,QAAgB,sBAC7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awUiInner", "breakpointsAbove", "breakpointsBelow", "classNames"]
7
7
  }
@@ -41,8 +41,6 @@ const DefaultActionsMenu = (0, import_react.memo)(function DefaultActionsMenu2({
41
41
  const breakpoint = (0, import_breakpoints.useBreakpoint)();
42
42
  const isReadonlyMode = (0, import_useReadonly.useReadonly)();
43
43
  const { orientation } = (0, import_layout.useTldrawUiOrientation)();
44
- const ref = (0, import_react.useRef)(null);
45
- (0, import_editor.usePassThroughWheelEvents)(ref);
46
44
  const editor = (0, import_editor.useEditor)();
47
45
  const isInAcceptableReadonlyState = (0, import_editor.useValue)(
48
46
  "should display quick actions when in readonly",
@@ -75,7 +73,6 @@ const DefaultActionsMenu = (0, import_react.memo)(function DefaultActionsMenu2({
75
73
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
76
74
  import_TldrawUiToolbar.TldrawUiToolbar,
77
75
  {
78
- ref,
79
76
  label: msg("actions-menu.title"),
80
77
  className: "tlui-actions-menu",
81
78
  "data-testid": "actions-menu.content",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/lib/ui/components/ActionsMenu/DefaultActionsMenu.tsx"],
4
- "sourcesContent": ["import { useEditor, usePassThroughWheelEvents, useValue } from '@tldraw/editor'\nimport { ReactNode, memo, useRef } from 'react'\nimport { PORTRAIT_BREAKPOINT } from '../../constants'\nimport { useBreakpoint } from '../../context/breakpoints'\nimport { useReadonly } from '../../hooks/useReadonly'\nimport { useTranslation } from '../../hooks/useTranslation/useTranslation'\nimport { TldrawUiButtonIcon } from '../primitives/Button/TldrawUiButtonIcon'\nimport { useTldrawUiOrientation } from '../primitives/layout'\nimport { TldrawUiMenuContextProvider } from '../primitives/menus/TldrawUiMenuContext'\nimport {\n\tTldrawUiPopover,\n\tTldrawUiPopoverContent,\n\tTldrawUiPopoverTrigger,\n} from '../primitives/TldrawUiPopover'\nimport { TldrawUiToolbar, TldrawUiToolbarButton } from '../primitives/TldrawUiToolbar'\nimport { DefaultActionsMenuContent } from './DefaultActionsMenuContent'\n\n/** @public */\nexport interface TLUiActionsMenuProps {\n\tchildren?: ReactNode\n}\n\n/** @public @react */\nexport const DefaultActionsMenu = memo(function DefaultActionsMenu({\n\tchildren,\n}: TLUiActionsMenuProps) {\n\tconst msg = useTranslation()\n\tconst breakpoint = useBreakpoint()\n\tconst isReadonlyMode = useReadonly()\n\tconst { orientation } = useTldrawUiOrientation()\n\n\tconst ref = useRef<HTMLDivElement>(null)\n\tusePassThroughWheelEvents(ref)\n\n\tconst editor = useEditor()\n\tconst isInAcceptableReadonlyState = useValue(\n\t\t'should display quick actions when in readonly',\n\t\t() => editor.isInAny('hand', 'zoom'),\n\t\t[editor]\n\t)\n\n\t// Get the actions menu content, either the default component or the user's\n\t// override. If there's no menu content, then the user has set it to null,\n\t// so skip rendering the menu.\n\n\tconst content = children ?? <DefaultActionsMenuContent />\n\tif (isReadonlyMode && !isInAcceptableReadonlyState) return\n\n\treturn (\n\t\t<TldrawUiPopover id=\"actions-menu\">\n\t\t\t<TldrawUiPopoverTrigger>\n\t\t\t\t<TldrawUiToolbarButton\n\t\t\t\t\ttype=\"icon\"\n\t\t\t\t\tdata-testid=\"actions-menu.button\"\n\t\t\t\t\ttitle={msg('actions-menu.title')}\n\t\t\t\t>\n\t\t\t\t\t<TldrawUiButtonIcon\n\t\t\t\t\t\ticon={orientation === 'horizontal' ? 'dots-vertical' : 'dots-horizontal'}\n\t\t\t\t\t\tsmall\n\t\t\t\t\t/>\n\t\t\t\t</TldrawUiToolbarButton>\n\t\t\t</TldrawUiPopoverTrigger>\n\t\t\t<TldrawUiPopoverContent\n\t\t\t\tside={\n\t\t\t\t\torientation === 'horizontal'\n\t\t\t\t\t\t? breakpoint >= PORTRAIT_BREAKPOINT.TABLET\n\t\t\t\t\t\t\t? 'bottom'\n\t\t\t\t\t\t\t: 'top'\n\t\t\t\t\t\t: 'right'\n\t\t\t\t}\n\t\t\t\tsideOffset={6}\n\t\t\t>\n\t\t\t\t<TldrawUiToolbar\n\t\t\t\t\tref={ref}\n\t\t\t\t\tlabel={msg('actions-menu.title')}\n\t\t\t\t\tclassName=\"tlui-actions-menu\"\n\t\t\t\t\tdata-testid=\"actions-menu.content\"\n\t\t\t\t\torientation=\"grid\"\n\t\t\t\t>\n\t\t\t\t\t<TldrawUiMenuContextProvider type=\"icons\" sourceId=\"actions-menu\">\n\t\t\t\t\t\t{content}\n\t\t\t\t\t</TldrawUiMenuContextProvider>\n\t\t\t\t</TldrawUiToolbar>\n\t\t\t</TldrawUiPopoverContent>\n\t\t</TldrawUiPopover>\n\t)\n})\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA6C6B;AA7C7B,oBAA+D;AAC/D,mBAAwC;AACxC,uBAAoC;AACpC,yBAA8B;AAC9B,yBAA4B;AAC5B,4BAA+B;AAC/B,gCAAmC;AACnC,oBAAuC;AACvC,iCAA4C;AAC5C,6BAIO;AACP,6BAAuD;AACvD,uCAA0C;AAQnC,MAAM,yBAAqB,mBAAK,SAASA,oBAAmB;AAAA,EAClE;AACD,GAAyB;AACxB,QAAM,UAAM,sCAAe;AAC3B,QAAM,iBAAa,kCAAc;AACjC,QAAM,qBAAiB,gCAAY;AACnC,QAAM,EAAE,YAAY,QAAI,sCAAuB;AAE/C,QAAM,UAAM,qBAAuB,IAAI;AACvC,+CAA0B,GAAG;AAE7B,QAAM,aAAS,yBAAU;AACzB,QAAM,kCAA8B;AAAA,IACnC;AAAA,IACA,MAAM,OAAO,QAAQ,QAAQ,MAAM;AAAA,IACnC,CAAC,MAAM;AAAA,EACR;AAMA,QAAM,UAAU,YAAY,4CAAC,8DAA0B;AACvD,MAAI,kBAAkB,CAAC,4BAA6B;AAEpD,SACC,6CAAC,0CAAgB,IAAG,gBACnB;AAAA,gDAAC,iDACA;AAAA,MAAC;AAAA;AAAA,QACA,MAAK;AAAA,QACL,eAAY;AAAA,QACZ,OAAO,IAAI,oBAAoB;AAAA,QAE/B;AAAA,UAAC;AAAA;AAAA,YACA,MAAM,gBAAgB,eAAe,kBAAkB;AAAA,YACvD,OAAK;AAAA;AAAA,QACN;AAAA;AAAA,IACD,GACD;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA,MACC,gBAAgB,eACb,cAAc,qCAAoB,SACjC,WACA,QACD;AAAA,QAEJ,YAAY;AAAA,QAEZ;AAAA,UAAC;AAAA;AAAA,YACA;AAAA,YACA,OAAO,IAAI,oBAAoB;AAAA,YAC/B,WAAU;AAAA,YACV,eAAY;AAAA,YACZ,aAAY;AAAA,YAEZ,sDAAC,0DAA4B,MAAK,SAAQ,UAAS,gBACjD,mBACF;AAAA;AAAA,QACD;AAAA;AAAA,IACD;AAAA,KACD;AAEF,CAAC;",
4
+ "sourcesContent": ["import { useEditor, useValue } from '@tldraw/editor'\nimport { ReactNode, memo } from 'react'\nimport { PORTRAIT_BREAKPOINT } from '../../constants'\nimport { useBreakpoint } from '../../context/breakpoints'\nimport { useReadonly } from '../../hooks/useReadonly'\nimport { useTranslation } from '../../hooks/useTranslation/useTranslation'\nimport { TldrawUiButtonIcon } from '../primitives/Button/TldrawUiButtonIcon'\nimport { useTldrawUiOrientation } from '../primitives/layout'\nimport { TldrawUiMenuContextProvider } from '../primitives/menus/TldrawUiMenuContext'\nimport {\n\tTldrawUiPopover,\n\tTldrawUiPopoverContent,\n\tTldrawUiPopoverTrigger,\n} from '../primitives/TldrawUiPopover'\nimport { TldrawUiToolbar, TldrawUiToolbarButton } from '../primitives/TldrawUiToolbar'\nimport { DefaultActionsMenuContent } from './DefaultActionsMenuContent'\n\n/** @public */\nexport interface TLUiActionsMenuProps {\n\tchildren?: ReactNode\n}\n\n/** @public @react */\nexport const DefaultActionsMenu = memo(function DefaultActionsMenu({\n\tchildren,\n}: TLUiActionsMenuProps) {\n\tconst msg = useTranslation()\n\tconst breakpoint = useBreakpoint()\n\tconst isReadonlyMode = useReadonly()\n\tconst { orientation } = useTldrawUiOrientation()\n\n\tconst editor = useEditor()\n\tconst isInAcceptableReadonlyState = useValue(\n\t\t'should display quick actions when in readonly',\n\t\t() => editor.isInAny('hand', 'zoom'),\n\t\t[editor]\n\t)\n\n\t// Get the actions menu content, either the default component or the user's\n\t// override. If there's no menu content, then the user has set it to null,\n\t// so skip rendering the menu.\n\n\tconst content = children ?? <DefaultActionsMenuContent />\n\tif (isReadonlyMode && !isInAcceptableReadonlyState) return\n\n\treturn (\n\t\t<TldrawUiPopover id=\"actions-menu\">\n\t\t\t<TldrawUiPopoverTrigger>\n\t\t\t\t<TldrawUiToolbarButton\n\t\t\t\t\ttype=\"icon\"\n\t\t\t\t\tdata-testid=\"actions-menu.button\"\n\t\t\t\t\ttitle={msg('actions-menu.title')}\n\t\t\t\t>\n\t\t\t\t\t<TldrawUiButtonIcon\n\t\t\t\t\t\ticon={orientation === 'horizontal' ? 'dots-vertical' : 'dots-horizontal'}\n\t\t\t\t\t\tsmall\n\t\t\t\t\t/>\n\t\t\t\t</TldrawUiToolbarButton>\n\t\t\t</TldrawUiPopoverTrigger>\n\t\t\t<TldrawUiPopoverContent\n\t\t\t\tside={\n\t\t\t\t\torientation === 'horizontal'\n\t\t\t\t\t\t? breakpoint >= PORTRAIT_BREAKPOINT.TABLET\n\t\t\t\t\t\t\t? 'bottom'\n\t\t\t\t\t\t\t: 'top'\n\t\t\t\t\t\t: 'right'\n\t\t\t\t}\n\t\t\t\tsideOffset={6}\n\t\t\t>\n\t\t\t\t<TldrawUiToolbar\n\t\t\t\t\tlabel={msg('actions-menu.title')}\n\t\t\t\t\tclassName=\"tlui-actions-menu\"\n\t\t\t\t\tdata-testid=\"actions-menu.content\"\n\t\t\t\t\torientation=\"grid\"\n\t\t\t\t>\n\t\t\t\t\t<TldrawUiMenuContextProvider type=\"icons\" sourceId=\"actions-menu\">\n\t\t\t\t\t\t{content}\n\t\t\t\t\t</TldrawUiMenuContextProvider>\n\t\t\t\t</TldrawUiToolbar>\n\t\t\t</TldrawUiPopoverContent>\n\t\t</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;AAAA;AAAA,QACD;AAAA;AAAA,IACD;AAAA,KACD;AAEF,CAAC;",
6
6
  "names": ["DefaultActionsMenu"]
7
7
  }
@@ -33,7 +33,7 @@ function DefaultContextMenuContent() {
33
33
  editor
34
34
  ]);
35
35
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
36
- showCollaborationUi && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_menu_items.CursorChatItem, {}),
36
+ showCollaborationUi && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TldrawUiMenuGroup.TldrawUiMenuGroup, { id: "cursor-chat", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_menu_items.CursorChatItem, {}) }),
37
37
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_TldrawUiMenuGroup.TldrawUiMenuGroup, { id: "modify", children: [
38
38
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_menu_items.EditMenuSubmenu, {}),
39
39
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_menu_items.ArrangeMenuSubmenu, {}),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/lib/ui/components/ContextMenu/DefaultContextMenuContent.tsx"],
4
- "sourcesContent": ["import { useEditor, useValue } from '@tldraw/editor'\nimport { useShowCollaborationUi } from '../../hooks/useCollaborationStatus'\nimport {\n\tArrangeMenuSubmenu,\n\tClipboardMenuGroup,\n\tConversionsMenuGroup,\n\tCursorChatItem,\n\tEditMenuSubmenu,\n\tMoveToPageMenu,\n\tReorderMenuSubmenu,\n\tSelectAllMenuItem,\n} from '../menu-items'\nimport { TldrawUiMenuGroup } from '../primitives/menus/TldrawUiMenuGroup'\n\n/** @public @react */\nexport function DefaultContextMenuContent() {\n\tconst editor = useEditor()\n\tconst showCollaborationUi = useShowCollaborationUi()\n\n\tconst isSinglePageMode = useValue('isSinglePageMode', () => editor.options.maxPages <= 1, [\n\t\teditor,\n\t])\n\n\t// Note: we intentionally don't bail out for non-select tools. Each submenu\n\t// below self-hides when it has nothing to offer (no selection, no shapes,\n\t// readonly), so the menu carries the right items in any tool \u2014 e.g. Paste\n\t// and Select all after a touch long-press while a shape tool is active.\n\t// (Closes #8828.)\n\n\treturn (\n\t\t<>\n\t\t\t{showCollaborationUi && <CursorChatItem />}\n\t\t\t<TldrawUiMenuGroup id=\"modify\">\n\t\t\t\t<EditMenuSubmenu />\n\t\t\t\t<ArrangeMenuSubmenu />\n\t\t\t\t<ReorderMenuSubmenu />\n\t\t\t\t{!isSinglePageMode && <MoveToPageMenu />}\n\t\t\t</TldrawUiMenuGroup>\n\t\t\t<ClipboardMenuGroup />\n\t\t\t<ConversionsMenuGroup />\n\t\t\t<TldrawUiMenuGroup id=\"select-all\">\n\t\t\t\t<SelectAllMenuItem />\n\t\t\t</TldrawUiMenuGroup>\n\t\t</>\n\t)\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8BE;AA9BF,oBAAoC;AACpC,oCAAuC;AACvC,wBASO;AACP,+BAAkC;AAG3B,SAAS,4BAA4B;AAC3C,QAAM,aAAS,yBAAU;AACzB,QAAM,0BAAsB,sDAAuB;AAEnD,QAAM,uBAAmB,wBAAS,oBAAoB,MAAM,OAAO,QAAQ,YAAY,GAAG;AAAA,IACzF;AAAA,EACD,CAAC;AAQD,SACC,4EACE;AAAA,2BAAuB,4CAAC,oCAAe;AAAA,IACxC,6CAAC,8CAAkB,IAAG,UACrB;AAAA,kDAAC,qCAAgB;AAAA,MACjB,4CAAC,wCAAmB;AAAA,MACpB,4CAAC,wCAAmB;AAAA,MACnB,CAAC,oBAAoB,4CAAC,oCAAe;AAAA,OACvC;AAAA,IACA,4CAAC,wCAAmB;AAAA,IACpB,4CAAC,0CAAqB;AAAA,IACtB,4CAAC,8CAAkB,IAAG,cACrB,sDAAC,uCAAkB,GACpB;AAAA,KACD;AAEF;",
4
+ "sourcesContent": ["import { useEditor, useValue } from '@tldraw/editor'\nimport { useShowCollaborationUi } from '../../hooks/useCollaborationStatus'\nimport {\n\tArrangeMenuSubmenu,\n\tClipboardMenuGroup,\n\tConversionsMenuGroup,\n\tCursorChatItem,\n\tEditMenuSubmenu,\n\tMoveToPageMenu,\n\tReorderMenuSubmenu,\n\tSelectAllMenuItem,\n} from '../menu-items'\nimport { TldrawUiMenuGroup } from '../primitives/menus/TldrawUiMenuGroup'\n\n/** @public @react */\nexport function DefaultContextMenuContent() {\n\tconst editor = useEditor()\n\tconst showCollaborationUi = useShowCollaborationUi()\n\n\tconst isSinglePageMode = useValue('isSinglePageMode', () => editor.options.maxPages <= 1, [\n\t\teditor,\n\t])\n\n\t// Note: we intentionally don't bail out for non-select tools. Each submenu\n\t// below self-hides when it has nothing to offer (no selection, no shapes,\n\t// readonly), so the menu carries the right items in any tool \u2014 e.g. Paste\n\t// and Select all after a touch long-press while a shape tool is active.\n\t// (Closes #8828.)\n\n\treturn (\n\t\t<>\n\t\t\t{showCollaborationUi && (\n\t\t\t\t<TldrawUiMenuGroup id=\"cursor-chat\">\n\t\t\t\t\t<CursorChatItem />\n\t\t\t\t</TldrawUiMenuGroup>\n\t\t\t)}\n\t\t\t<TldrawUiMenuGroup id=\"modify\">\n\t\t\t\t<EditMenuSubmenu />\n\t\t\t\t<ArrangeMenuSubmenu />\n\t\t\t\t<ReorderMenuSubmenu />\n\t\t\t\t{!isSinglePageMode && <MoveToPageMenu />}\n\t\t\t</TldrawUiMenuGroup>\n\t\t\t<ClipboardMenuGroup />\n\t\t\t<ConversionsMenuGroup />\n\t\t\t<TldrawUiMenuGroup id=\"select-all\">\n\t\t\t\t<SelectAllMenuItem />\n\t\t\t</TldrawUiMenuGroup>\n\t\t</>\n\t)\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8BE;AA9BF,oBAAoC;AACpC,oCAAuC;AACvC,wBASO;AACP,+BAAkC;AAG3B,SAAS,4BAA4B;AAC3C,QAAM,aAAS,yBAAU;AACzB,QAAM,0BAAsB,sDAAuB;AAEnD,QAAM,uBAAmB,wBAAS,oBAAoB,MAAM,OAAO,QAAQ,YAAY,GAAG;AAAA,IACzF;AAAA,EACD,CAAC;AAQD,SACC,4EACE;AAAA,2BACA,4CAAC,8CAAkB,IAAG,eACrB,sDAAC,oCAAe,GACjB;AAAA,IAED,6CAAC,8CAAkB,IAAG,UACrB;AAAA,kDAAC,qCAAgB;AAAA,MACjB,4CAAC,wCAAmB;AAAA,MACpB,4CAAC,wCAAmB;AAAA,MACnB,CAAC,oBAAoB,4CAAC,oCAAe;AAAA,OACvC;AAAA,IACA,4CAAC,wCAAmB;AAAA,IACpB,4CAAC,0CAAqB;AAAA,IACtB,4CAAC,8CAAkB,IAAG,cACrB,sDAAC,uCAAkB,GACpB;AAAA,KACD;AAEF;",
6
6
  "names": []
7
7
  }
@@ -31,6 +31,7 @@ const TldrawUiDialog = ({ id, component: ModalContent, preventBackgroundClose })
31
31
  const { removeDialog } = (0, import_dialogs.useDialogs)();
32
32
  const container = (0, import_editor.useContainer)();
33
33
  const dir = (0, import_useTranslation.useDirection)();
34
+ const contentRef = (0, import_react.useRef)(null);
34
35
  const handleOpenChange = (0, import_react.useCallback)(
35
36
  (isOpen) => {
36
37
  if (!isOpen) {
@@ -44,10 +45,17 @@ const TldrawUiDialog = ({ id, component: ModalContent, preventBackgroundClose })
44
45
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { dir, className: "tlui-dialog__positioner", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
45
46
  import_radix_ui.Dialog.Content,
46
47
  {
48
+ ref: contentRef,
47
49
  dir,
48
50
  className: "tlui-dialog__content",
49
51
  "aria-describedby": void 0,
50
52
  onInteractOutside: (e) => {
53
+ const target = e.detail.originalEvent.target;
54
+ const pressedDialog = target instanceof Element ? target.closest(".tlui-dialog__content") : null;
55
+ if (pressedDialog && pressedDialog !== contentRef.current) {
56
+ e.preventDefault();
57
+ return;
58
+ }
51
59
  if (preventBackgroundClose) {
52
60
  e.preventDefault();
53
61
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/lib/ui/components/Dialogs.tsx"],
4
- "sourcesContent": ["import { useContainer, useValue } from '@tldraw/editor'\nimport { Dialog as _Dialog } from 'radix-ui'\nimport { memo, useCallback } from 'react'\nimport { TLUiDialog, useDialogs } from '../context/dialogs'\nimport { useDirection } from '../hooks/useTranslation/useTranslation'\n\n/** @internal */\nconst TldrawUiDialog = ({ id, component: ModalContent, preventBackgroundClose }: TLUiDialog) => {\n\tconst { removeDialog } = useDialogs()\n\n\tconst container = useContainer()\n\tconst dir = useDirection()\n\n\tconst handleOpenChange = useCallback(\n\t\t(isOpen: boolean) => {\n\t\t\tif (!isOpen) {\n\t\t\t\tremoveDialog(id)\n\t\t\t}\n\t\t},\n\t\t[id, removeDialog]\n\t)\n\n\treturn (\n\t\t<_Dialog.Root onOpenChange={handleOpenChange} defaultOpen>\n\t\t\t<_Dialog.Portal container={container}>\n\t\t\t\t{/* Radix renders the scrim and content as siblings. The positioner sits on\n\t\t\t\t top of the scrim and centers the content, scrolling and padding it when\n\t\t\t\t it's taller than the viewport. */}\n\t\t\t\t<_Dialog.Overlay dir={dir} className=\"tlui-dialog__overlay\" />\n\t\t\t\t<div dir={dir} className=\"tlui-dialog__positioner\">\n\t\t\t\t\t<_Dialog.Content\n\t\t\t\t\t\tdir={dir}\n\t\t\t\t\t\tclassName=\"tlui-dialog__content\"\n\t\t\t\t\t\taria-describedby={undefined}\n\t\t\t\t\t\tonInteractOutside={(e) => {\n\t\t\t\t\t\t\t// Radix's dismissable layers are layer-aware: an interaction outside the\n\t\t\t\t\t\t\t// topmost layer dismisses only that layer \u2014 an open select, or a dialog\n\t\t\t\t\t\t\t// stacked on top \u2014 leaving lower layers open. onInteractOutside fires for\n\t\t\t\t\t\t\t// both a pointer press and a focus shift outside the dialog; opt out of both\n\t\t\t\t\t\t\t// when the dialog asks to stay open on background interactions (escape still\n\t\t\t\t\t\t\t// closes it).\n\t\t\t\t\t\t\tif (preventBackgroundClose) {\n\t\t\t\t\t\t\t\te.preventDefault()\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ModalContent onClose={() => handleOpenChange(false)} />\n\t\t\t\t\t</_Dialog.Content>\n\t\t\t\t</div>\n\t\t\t</_Dialog.Portal>\n\t\t</_Dialog.Root>\n\t)\n}\n\n/** @public @react */\nexport const DefaultDialogs = memo(function DefaultDialogs() {\n\tconst { dialogs } = useDialogs()\n\tconst dialogsArray = useValue('dialogs', () => dialogs.get(), [dialogs])\n\t// Every stacked dialog stays modal (Radix's default). That's what keeps dismiss\n\t// layer-aware: a background press or escape closes only the topmost layer, because\n\t// Radix's focus-scope stack pauses lower dialogs rather than dismissing them. Don't\n\t// make a lower dialog non-modal to work around anything \u2014 without a focus scope it\n\t// dismisses on the focus shift when a nested dialog or select opens, collapsing the\n\t// whole stack.\n\treturn dialogsArray.map((dialog) => <TldrawUiDialog key={dialog.id} {...dialog} />)\n})\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBG;AAxBH,oBAAuC;AACvC,sBAAkC;AAClC,mBAAkC;AAClC,qBAAuC;AACvC,4BAA6B;AAG7B,MAAM,iBAAiB,CAAC,EAAE,IAAI,WAAW,cAAc,uBAAuB,MAAkB;AAC/F,QAAM,EAAE,aAAa,QAAI,2BAAW;AAEpC,QAAM,gBAAY,4BAAa;AAC/B,QAAM,UAAM,oCAAa;AAEzB,QAAM,uBAAmB;AAAA,IACxB,CAAC,WAAoB;AACpB,UAAI,CAAC,QAAQ;AACZ,qBAAa,EAAE;AAAA,MAChB;AAAA,IACD;AAAA,IACA,CAAC,IAAI,YAAY;AAAA,EAClB;AAEA,SACC,4CAAC,gBAAAA,OAAQ,MAAR,EAAa,cAAc,kBAAkB,aAAW,MACxD,uDAAC,gBAAAA,OAAQ,QAAR,EAAe,WAIf;AAAA,gDAAC,gBAAAA,OAAQ,SAAR,EAAgB,KAAU,WAAU,wBAAuB;AAAA,IAC5D,4CAAC,SAAI,KAAU,WAAU,2BACxB;AAAA,MAAC,gBAAAA,OAAQ;AAAA,MAAR;AAAA,QACA;AAAA,QACA,WAAU;AAAA,QACV,oBAAkB;AAAA,QAClB,mBAAmB,CAAC,MAAM;AAOzB,cAAI,wBAAwB;AAC3B,cAAE,eAAe;AAAA,UAClB;AAAA,QACD;AAAA,QAEA,sDAAC,gBAAa,SAAS,MAAM,iBAAiB,KAAK,GAAG;AAAA;AAAA,IACvD,GACD;AAAA,KACD,GACD;AAEF;AAGO,MAAM,qBAAiB,mBAAK,SAASC,kBAAiB;AAC5D,QAAM,EAAE,QAAQ,QAAI,2BAAW;AAC/B,QAAM,mBAAe,wBAAS,WAAW,MAAM,QAAQ,IAAI,GAAG,CAAC,OAAO,CAAC;AAOvE,SAAO,aAAa,IAAI,CAAC,WAAW,4CAAC,kBAAgC,GAAG,UAAf,OAAO,EAAgB,CAAE;AACnF,CAAC;",
4
+ "sourcesContent": ["import { useContainer, useValue } from '@tldraw/editor'\nimport { Dialog as _Dialog } from 'radix-ui'\nimport { memo, useCallback, useRef } from 'react'\nimport { TLUiDialog, useDialogs } from '../context/dialogs'\nimport { useDirection } from '../hooks/useTranslation/useTranslation'\n\n/** @internal */\nconst TldrawUiDialog = ({ id, component: ModalContent, preventBackgroundClose }: TLUiDialog) => {\n\tconst { removeDialog } = useDialogs()\n\n\tconst container = useContainer()\n\tconst dir = useDirection()\n\tconst contentRef = useRef<HTMLDivElement>(null)\n\n\tconst handleOpenChange = useCallback(\n\t\t(isOpen: boolean) => {\n\t\t\tif (!isOpen) {\n\t\t\t\tremoveDialog(id)\n\t\t\t}\n\t\t},\n\t\t[id, removeDialog]\n\t)\n\n\treturn (\n\t\t<_Dialog.Root onOpenChange={handleOpenChange} defaultOpen>\n\t\t\t<_Dialog.Portal container={container}>\n\t\t\t\t{/* Radix renders the scrim and content as siblings. The positioner sits on\n\t\t\t\t top of the scrim and centers the content, scrolling and padding it when\n\t\t\t\t it's taller than the viewport. */}\n\t\t\t\t<_Dialog.Overlay dir={dir} className=\"tlui-dialog__overlay\" />\n\t\t\t\t<div dir={dir} className=\"tlui-dialog__positioner\">\n\t\t\t\t\t<_Dialog.Content\n\t\t\t\t\t\tref={contentRef}\n\t\t\t\t\t\tdir={dir}\n\t\t\t\t\t\tclassName=\"tlui-dialog__content\"\n\t\t\t\t\t\taria-describedby={undefined}\n\t\t\t\t\t\tonInteractOutside={(e) => {\n\t\t\t\t\t\t\t// Radix's dismissable layers are layer-aware: an interaction outside the\n\t\t\t\t\t\t\t// topmost layer dismisses only that layer \u2014 an open select, or a dialog\n\t\t\t\t\t\t\t// stacked on top \u2014 leaving lower layers open. onInteractOutside fires for\n\t\t\t\t\t\t\t// both a pointer press and a focus shift outside the dialog; opt out of both\n\t\t\t\t\t\t\t// when the dialog asks to stay open on background interactions (escape still\n\t\t\t\t\t\t\t// closes it).\n\n\t\t\t\t\t\t\t// A touch press is checked against the layers at the following click rather\n\t\t\t\t\t\t\t// than at the press itself, so a press that closes a dialog stacked on top of\n\t\t\t\t\t\t\t// this one arrives here once this one is topmost, and reads as a press\n\t\t\t\t\t\t\t// outside it. A press inside another dialog is never outside this one, and\n\t\t\t\t\t\t\t// stays so after that dialog unmounts and takes the press's target with it.\n\t\t\t\t\t\t\tconst target = e.detail.originalEvent.target\n\t\t\t\t\t\t\tconst pressedDialog =\n\t\t\t\t\t\t\t\ttarget instanceof Element ? target.closest('.tlui-dialog__content') : null\n\t\t\t\t\t\t\tif (pressedDialog && pressedDialog !== contentRef.current) {\n\t\t\t\t\t\t\t\te.preventDefault()\n\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (preventBackgroundClose) {\n\t\t\t\t\t\t\t\te.preventDefault()\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ModalContent onClose={() => handleOpenChange(false)} />\n\t\t\t\t\t</_Dialog.Content>\n\t\t\t\t</div>\n\t\t\t</_Dialog.Portal>\n\t\t</_Dialog.Root>\n\t)\n}\n\n/** @public @react */\nexport const DefaultDialogs = memo(function DefaultDialogs() {\n\tconst { dialogs } = useDialogs()\n\tconst dialogsArray = useValue('dialogs', () => dialogs.get(), [dialogs])\n\t// Every stacked dialog stays modal (Radix's default). That's what keeps dismiss\n\t// layer-aware: a background press or escape closes only the topmost layer, because\n\t// Radix's focus-scope stack pauses lower dialogs rather than dismissing them. Don't\n\t// make a lower dialog non-modal to work around anything \u2014 without a focus scope it\n\t// dismisses on the focus shift when a nested dialog or select opens, collapsing the\n\t// whole stack.\n\treturn dialogsArray.map((dialog) => <TldrawUiDialog key={dialog.id} {...dialog} />)\n})\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBG;AAzBH,oBAAuC;AACvC,sBAAkC;AAClC,mBAA0C;AAC1C,qBAAuC;AACvC,4BAA6B;AAG7B,MAAM,iBAAiB,CAAC,EAAE,IAAI,WAAW,cAAc,uBAAuB,MAAkB;AAC/F,QAAM,EAAE,aAAa,QAAI,2BAAW;AAEpC,QAAM,gBAAY,4BAAa;AAC/B,QAAM,UAAM,oCAAa;AACzB,QAAM,iBAAa,qBAAuB,IAAI;AAE9C,QAAM,uBAAmB;AAAA,IACxB,CAAC,WAAoB;AACpB,UAAI,CAAC,QAAQ;AACZ,qBAAa,EAAE;AAAA,MAChB;AAAA,IACD;AAAA,IACA,CAAC,IAAI,YAAY;AAAA,EAClB;AAEA,SACC,4CAAC,gBAAAA,OAAQ,MAAR,EAAa,cAAc,kBAAkB,aAAW,MACxD,uDAAC,gBAAAA,OAAQ,QAAR,EAAe,WAIf;AAAA,gDAAC,gBAAAA,OAAQ,SAAR,EAAgB,KAAU,WAAU,wBAAuB;AAAA,IAC5D,4CAAC,SAAI,KAAU,WAAU,2BACxB;AAAA,MAAC,gBAAAA,OAAQ;AAAA,MAAR;AAAA,QACA,KAAK;AAAA,QACL;AAAA,QACA,WAAU;AAAA,QACV,oBAAkB;AAAA,QAClB,mBAAmB,CAAC,MAAM;AAazB,gBAAM,SAAS,EAAE,OAAO,cAAc;AACtC,gBAAM,gBACL,kBAAkB,UAAU,OAAO,QAAQ,uBAAuB,IAAI;AACvE,cAAI,iBAAiB,kBAAkB,WAAW,SAAS;AAC1D,cAAE,eAAe;AACjB;AAAA,UACD;AAEA,cAAI,wBAAwB;AAC3B,cAAE,eAAe;AAAA,UAClB;AAAA,QACD;AAAA,QAEA,sDAAC,gBAAa,SAAS,MAAM,iBAAiB,KAAK,GAAG;AAAA;AAAA,IACvD,GACD;AAAA,KACD,GACD;AAEF;AAGO,MAAM,qBAAiB,mBAAK,SAASC,kBAAiB;AAC5D,QAAM,EAAE,QAAQ,QAAI,2BAAW;AAC/B,QAAM,mBAAe,wBAAS,WAAW,MAAM,QAAQ,IAAI,GAAG,CAAC,OAAO,CAAC;AAOvE,SAAO,aAAa,IAAI,CAAC,WAAW,4CAAC,kBAAgC,GAAG,UAAf,OAAO,EAAgB,CAAE;AACnF,CAAC;",
6
6
  "names": ["_Dialog", "DefaultDialogs"]
7
7
  }
@@ -28,7 +28,6 @@ var import_events = require("../../context/events");
28
28
  var import_useTranslation = require("../../hooks/useTranslation/useTranslation");
29
29
  var import_TldrawUiButton = require("../primitives/Button/TldrawUiButton");
30
30
  var import_TldrawUiButtonIcon = require("../primitives/Button/TldrawUiButtonIcon");
31
- var import_layout = require("../primitives/layout");
32
31
  var import_TldrawUiIcon = require("../primitives/TldrawUiIcon");
33
32
  const DefaultPeopleMenuItem = (0, import_editor.track)(function DefaultPeopleMenuItem2({
34
33
  userId
@@ -50,7 +49,7 @@ const DefaultPeopleMenuItem = (0, import_editor.track)(function DefaultPeopleMen
50
49
  const youAreFollowingThem = editor.getInstanceState().followingUserId === userId;
51
50
  if (!presence) return null;
52
51
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
53
- import_layout.TldrawUiRow,
52
+ "div",
54
53
  {
55
54
  className: "tlui-people-menu__item",
56
55
  "data-follow": youAreFollowingThem || theyAreFollowingYou,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/lib/ui/components/SharePanel/DefaultPeopleMenuItem.tsx"],
4
- "sourcesContent": ["import { TLUserId, track, useEditor, usePresence } from '@tldraw/editor'\nimport { useCallback } from 'react'\nimport { useUiEvents } from '../../context/events'\nimport { useTranslation } from '../../hooks/useTranslation/useTranslation'\nimport { TldrawUiButton } from '../primitives/Button/TldrawUiButton'\nimport { TldrawUiButtonIcon } from '../primitives/Button/TldrawUiButtonIcon'\nimport { TldrawUiRow } from '../primitives/layout'\nimport { TldrawUiIcon } from '../primitives/TldrawUiIcon'\n\n/** @public */\nexport interface TLUiPeopleMenuItemProps {\n\tuserId: TLUserId\n}\n\n/** @public @react */\nexport const DefaultPeopleMenuItem = track(function DefaultPeopleMenuItem({\n\tuserId,\n}: TLUiPeopleMenuItemProps) {\n\tconst editor = useEditor()\n\tconst msg = useTranslation()\n\tconst trackEvent = useUiEvents()\n\n\tconst presence = usePresence(userId)\n\n\tconst handleFollowClick = useCallback(() => {\n\t\tif (editor.getInstanceState().followingUserId === userId) {\n\t\t\teditor.stopFollowingUser()\n\t\t\ttrackEvent('stop-following', { source: 'people-menu' })\n\t\t} else {\n\t\t\teditor.startFollowingUser(userId)\n\t\t\ttrackEvent('start-following', { source: 'people-menu' })\n\t\t}\n\t}, [editor, userId, trackEvent])\n\n\tconst theyAreFollowingYou = presence?.followingUserId === editor.user.getRecordId()\n\tconst youAreFollowingThem = editor.getInstanceState().followingUserId === userId\n\n\tif (!presence) return null\n\n\treturn (\n\t\t<TldrawUiRow\n\t\t\tclassName=\"tlui-people-menu__item\"\n\t\t\tdata-follow={youAreFollowingThem || theyAreFollowingYou}\n\t\t>\n\t\t\t<TldrawUiButton\n\t\t\t\ttype=\"menu\"\n\t\t\t\tclassName=\"tlui-people-menu__item__button\"\n\t\t\t\tonClick={() => editor.zoomToUser(userId)}\n\t\t\t\tonDoubleClick={handleFollowClick}\n\t\t\t>\n\t\t\t\t<TldrawUiIcon label={msg('people-menu.avatar-color')} icon=\"color\" color={presence.color} />\n\t\t\t\t<div className=\"tlui-people-menu__name\">\n\t\t\t\t\t{presence.userName?.trim() || msg('people-menu.anonymous-user')}\n\t\t\t\t</div>\n\t\t\t</TldrawUiButton>\n\t\t\t<TldrawUiButton\n\t\t\t\ttype=\"icon\"\n\t\t\t\tclassName=\"tlui-people-menu__item__follow\"\n\t\t\t\ttitle={\n\t\t\t\t\ttheyAreFollowingYou\n\t\t\t\t\t\t? msg('people-menu.leading')\n\t\t\t\t\t\t: youAreFollowingThem\n\t\t\t\t\t\t\t? msg('people-menu.following')\n\t\t\t\t\t\t\t: msg('people-menu.follow')\n\t\t\t\t}\n\t\t\t\tonClick={handleFollowClick}\n\t\t\t\tdisabled={theyAreFollowingYou}\n\t\t\t>\n\t\t\t\t<TldrawUiButtonIcon\n\t\t\t\t\ticon={theyAreFollowingYou ? 'leading' : youAreFollowingThem ? 'following' : 'follow'}\n\t\t\t\t/>\n\t\t\t</TldrawUiButton>\n\t\t</TldrawUiRow>\n\t)\n})\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA4CG;AA5CH,oBAAwD;AACxD,mBAA4B;AAC5B,oBAA4B;AAC5B,4BAA+B;AAC/B,4BAA+B;AAC/B,gCAAmC;AACnC,oBAA4B;AAC5B,0BAA6B;AAQtB,MAAM,4BAAwB,qBAAM,SAASA,uBAAsB;AAAA,EACzE;AACD,GAA4B;AAC3B,QAAM,aAAS,yBAAU;AACzB,QAAM,UAAM,sCAAe;AAC3B,QAAM,iBAAa,2BAAY;AAE/B,QAAM,eAAW,2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w/editor'\nimport { useCallback } from 'react'\nimport { useUiEvents } from '../../context/events'\nimport { useTranslation } from '../../hooks/useTranslation/useTranslation'\nimport { TldrawUiButton } from '../primitives/Button/TldrawUiButton'\nimport { TldrawUiButtonIcon } from '../primitives/Button/TldrawUiButtonIcon'\nimport { TldrawUiIcon } from '../primitives/TldrawUiIcon'\n\n/** @public */\nexport interface TLUiPeopleMenuItemProps {\n\tuserId: TLUserId\n}\n\n/** @public @react */\nexport const DefaultPeopleMenuItem = track(function DefaultPeopleMenuItem({\n\tuserId,\n}: TLUiPeopleMenuItemProps) {\n\tconst editor = useEditor()\n\tconst msg = useTranslation()\n\tconst trackEvent = useUiEvents()\n\n\tconst presence = usePresence(userId)\n\n\tconst handleFollowClick = useCallback(() => {\n\t\tif (editor.getInstanceState().followingUserId === userId) {\n\t\t\teditor.stopFollowingUser()\n\t\t\ttrackEvent('stop-following', { source: 'people-menu' })\n\t\t} else {\n\t\t\teditor.startFollowingUser(userId)\n\t\t\ttrackEvent('start-following', { source: 'people-menu' })\n\t\t}\n\t}, [editor, userId, trackEvent])\n\n\tconst theyAreFollowingYou = presence?.followingUserId === editor.user.getRecordId()\n\tconst youAreFollowingThem = editor.getInstanceState().followingUserId === userId\n\n\tif (!presence) return null\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"tlui-people-menu__item\"\n\t\t\tdata-follow={youAreFollowingThem || theyAreFollowingYou}\n\t\t>\n\t\t\t<TldrawUiButton\n\t\t\t\ttype=\"menu\"\n\t\t\t\tclassName=\"tlui-people-menu__item__button\"\n\t\t\t\tonClick={() => editor.zoomToUser(userId)}\n\t\t\t\tonDoubleClick={handleFollowClick}\n\t\t\t>\n\t\t\t\t<TldrawUiIcon label={msg('people-menu.avatar-color')} icon=\"color\" color={presence.color} />\n\t\t\t\t<div className=\"tlui-people-menu__name\">\n\t\t\t\t\t{presence.userName?.trim() || msg('people-menu.anonymous-user')}\n\t\t\t\t</div>\n\t\t\t</TldrawUiButton>\n\t\t\t<TldrawUiButton\n\t\t\t\ttype=\"icon\"\n\t\t\t\tclassName=\"tlui-people-menu__item__follow\"\n\t\t\t\ttitle={\n\t\t\t\t\ttheyAreFollowingYou\n\t\t\t\t\t\t? msg('people-menu.leading')\n\t\t\t\t\t\t: youAreFollowingThem\n\t\t\t\t\t\t\t? msg('people-menu.following')\n\t\t\t\t\t\t\t: msg('people-menu.follow')\n\t\t\t\t}\n\t\t\t\tonClick={handleFollowClick}\n\t\t\t\tdisabled={theyAreFollowingYou}\n\t\t\t>\n\t\t\t\t<TldrawUiButtonIcon\n\t\t\t\t\ticon={theyAreFollowingYou ? 'leading' : youAreFollowingThem ? 'following' : 'follow'}\n\t\t\t\t/>\n\t\t\t</TldrawUiButton>\n\t\t</div>\n\t)\n})\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA2CG;AA3CH,oBAAwD;AACxD,mBAA4B;AAC5B,oBAA4B;AAC5B,4BAA+B;AAC/B,4BAA+B;AAC/B,gCAAmC;AACnC,0BAA6B;AAQtB,MAAM,4BAAwB,qBAAM,SAASA,uBAAsB;AAAA,EACzE;AACD,GAA4B;AAC3B,QAAM,aAAS,yBAAU;AACzB,QAAM,UAAM,sCAAe;AAC3B,QAAM,iBAAa,2BAAY;AAE/B,QAAM,eAAW,2BAAY,MAAM;AAEnC,QAAM,wBAAoB,0BAAY,MAAM;AAC3C,QAAI,OAAO,iBAAiB,EAAE,oBAAoB,QAAQ;AACzD,aAAO,kBAAkB;AACzB,iBAAW,kBAAkB,EAAE,QAAQ,cAAc,CAAC;AAAA,IACvD,OAAO;AACN,aAAO,mBAAmB,MAAM;AAChC,iBAAW,mBAAmB,EAAE,QAAQ,cAAc,CAAC;AAAA,IACxD;AAAA,EACD,GAAG,CAAC,QAAQ,QAAQ,UAAU,CAAC;AAE/B,QAAM,sBAAsB,UAAU,oBAAoB,OAAO,KAAK,YAAY;AAClF,QAAM,sBAAsB,OAAO,iBAAiB,EAAE,oBAAoB;AAE1E,MAAI,CAAC,SAAU,QAAO;AAEtB,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,eAAa,uBAAuB;AAAA,MAEpC;AAAA;AAAA,UAAC;AAAA;AAAA,YACA,MAAK;AAAA,YACL,WAAU;AAAA,YACV,SAAS,MAAM,OAAO,WAAW,MAAM;AAAA,YACvC,eAAe;AAAA,YAEf;AAAA,0DAAC,oCAAa,OAAO,IAAI,0BAA0B,GAAG,MAAK,SAAQ,OAAO,SAAS,OAAO;AAAA,cAC1F,4CAAC,SAAI,WAAU,0BACb,mBAAS,UAAU,KAAK,KAAK,IAAI,4BAA4B,GAC/D;AAAA;AAAA;AAAA,QACD;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACA,MAAK;AAAA,YACL,WAAU;AAAA,YACV,OACC,sBACG,IAAI,qBAAqB,IACzB,sBACC,IAAI,uBAAuB,IAC3B,IAAI,oBAAoB;AAAA,YAE7B,SAAS;AAAA,YACT,UAAU;AAAA,YAEV;AAAA,cAAC;AAAA;AAAA,gBACA,MAAM,sBAAsB,YAAY,sBAAsB,cAAc;AAAA;AAAA,YAC7E;AAAA;AAAA,QACD;AAAA;AAAA;AAAA,EACD;AAEF,CAAC;",
6
6
  "names": ["DefaultPeopleMenuItem"]
7
7
  }
@@ -906,7 +906,6 @@ function ActionsProvider({ overrides, children }) {
906
906
  onSelect(source) {
907
907
  if (!canApplySelectionAction()) return;
908
908
  if (mustGoBackToSelectToolFirst()) return;
909
- editor.markHistoryStoppingPoint("cut");
910
909
  helpers.cut(source);
911
910
  }
912
911
  },