@bigbluebutton/tldraw 2.0.0-alpha.19 → 2.0.0-alpha.20

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 (64) hide show
  1. package/dist-cjs/index.d.ts +55 -50
  2. package/dist-cjs/lib/shapes/bookmark/BookmarkShapeUtil.js +2 -2
  3. package/dist-cjs/lib/shapes/bookmark/BookmarkShapeUtil.js.map +1 -1
  4. package/dist-cjs/lib/tools/SelectTool/childStates/Brushing.js +3 -0
  5. package/dist-cjs/lib/tools/SelectTool/childStates/Brushing.js.map +2 -2
  6. package/dist-cjs/lib/tools/SelectTool/childStates/Idle.js +2 -2
  7. package/dist-cjs/lib/tools/SelectTool/childStates/Idle.js.map +2 -2
  8. package/dist-cjs/lib/tools/SelectTool/childStates/Resizing.js +3 -0
  9. package/dist-cjs/lib/tools/SelectTool/childStates/Resizing.js.map +2 -2
  10. package/dist-cjs/lib/tools/SelectTool/childStates/Translating.js +7 -6
  11. package/dist-cjs/lib/tools/SelectTool/childStates/Translating.js.map +2 -2
  12. package/dist-cjs/lib/ui/hooks/useActions.js +13 -0
  13. package/dist-cjs/lib/ui/hooks/useActions.js.map +2 -2
  14. package/dist-cjs/lib/ui/hooks/useEventsProvider.js.map +2 -2
  15. package/dist-cjs/lib/ui/hooks/useMenuSchema.js +5 -0
  16. package/dist-cjs/lib/ui/hooks/useMenuSchema.js.map +2 -2
  17. package/dist-cjs/lib/ui/hooks/usePreloadAssets.js +1 -0
  18. package/dist-cjs/lib/ui/hooks/usePreloadAssets.js.map +2 -2
  19. package/dist-cjs/lib/ui/hooks/useTranslation/TLUiTranslationKey.js.map +1 -1
  20. package/dist-cjs/lib/ui/hooks/useTranslation/defaultTranslation.js +2 -0
  21. package/dist-cjs/lib/ui/hooks/useTranslation/defaultTranslation.js.map +2 -2
  22. package/dist-cjs/lib/utils/assets/assets.js +5 -1
  23. package/dist-cjs/lib/utils/assets/assets.js.map +2 -2
  24. package/dist-esm/index.d.mts +55 -50
  25. package/dist-esm/lib/shapes/bookmark/BookmarkShapeUtil.mjs +2 -2
  26. package/dist-esm/lib/shapes/bookmark/BookmarkShapeUtil.mjs.map +1 -1
  27. package/dist-esm/lib/tools/SelectTool/childStates/Brushing.mjs +4 -0
  28. package/dist-esm/lib/tools/SelectTool/childStates/Brushing.mjs.map +2 -2
  29. package/dist-esm/lib/tools/SelectTool/childStates/Idle.mjs +2 -2
  30. package/dist-esm/lib/tools/SelectTool/childStates/Idle.mjs.map +2 -2
  31. package/dist-esm/lib/tools/SelectTool/childStates/Resizing.mjs +5 -1
  32. package/dist-esm/lib/tools/SelectTool/childStates/Resizing.mjs.map +2 -2
  33. package/dist-esm/lib/tools/SelectTool/childStates/Translating.mjs +9 -7
  34. package/dist-esm/lib/tools/SelectTool/childStates/Translating.mjs.map +2 -2
  35. package/dist-esm/lib/ui/hooks/useActions.mjs +13 -0
  36. package/dist-esm/lib/ui/hooks/useActions.mjs.map +2 -2
  37. package/dist-esm/lib/ui/hooks/useEventsProvider.mjs.map +2 -2
  38. package/dist-esm/lib/ui/hooks/useMenuSchema.mjs +5 -0
  39. package/dist-esm/lib/ui/hooks/useMenuSchema.mjs.map +2 -2
  40. package/dist-esm/lib/ui/hooks/usePreloadAssets.mjs +1 -0
  41. package/dist-esm/lib/ui/hooks/usePreloadAssets.mjs.map +2 -2
  42. package/dist-esm/lib/ui/hooks/useTranslation/defaultTranslation.mjs +2 -0
  43. package/dist-esm/lib/ui/hooks/useTranslation/defaultTranslation.mjs.map +2 -2
  44. package/dist-esm/lib/utils/assets/assets.mjs +5 -1
  45. package/dist-esm/lib/utils/assets/assets.mjs.map +2 -2
  46. package/package.json +3 -3
  47. package/src/lib/shapes/bookmark/BookmarkShapeUtil.tsx +2 -2
  48. package/src/lib/shapes/line/LineShapeUtil.test.ts +1 -1
  49. package/src/lib/tools/SelectTool/childStates/Brushing.ts +6 -0
  50. package/src/lib/tools/SelectTool/childStates/Idle.ts +6 -2
  51. package/src/lib/tools/SelectTool/childStates/Resizing.ts +6 -0
  52. package/src/lib/tools/SelectTool/childStates/Translating.ts +10 -7
  53. package/src/lib/ui/hooks/useActions.tsx +13 -0
  54. package/src/lib/ui/hooks/useEventsProvider.tsx +1 -0
  55. package/src/lib/ui/hooks/useMenuSchema.tsx +5 -0
  56. package/src/lib/ui/hooks/usePreloadAssets.ts +1 -0
  57. package/src/lib/ui/hooks/useTranslation/TLUiTranslationKey.ts +2 -0
  58. package/src/lib/ui/hooks/useTranslation/defaultTranslation.ts +2 -0
  59. package/src/lib/utils/assets/assets.ts +5 -1
  60. package/src/test/TLUserPreferences.test.ts +4 -1
  61. package/src/test/TestEditor.ts +3 -0
  62. package/src/test/resizing.test.ts +22 -0
  63. package/src/test/selection-omnibus.test.ts +93 -0
  64. package/src/test/translating.test.ts +35 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/lib/ui/hooks/useActions.tsx"],
4
- "sourcesContent": ["import {\n\tANIMATION_MEDIUM_MS,\n\tBox2d,\n\tEditor,\n\tTAU,\n\tTLBookmarkShape,\n\tTLEmbedShape,\n\tTLFrameShape,\n\tTLGroupShape,\n\tTLShapeId,\n\tTLShapePartial,\n\tTLTextShape,\n\tVec2d,\n\tapproximately,\n\tcompact,\n\tcreateShapeId,\n\topenWindow,\n\tuseEditor,\n} from '@bigbluebutton/editor'\nimport * as React from 'react'\nimport { getEmbedInfo } from '../../utils/embeds/embeds'\nimport { fitFrameToContent, removeFrame } from '../../utils/frames/frames'\nimport { EditLinkDialog } from '../components/EditLinkDialog'\nimport { EmbedDialog } from '../components/EmbedDialog'\nimport { TLUiIconType } from '../icon-types'\nimport { useMenuClipboardEvents } from './useClipboardEvents'\nimport { useCopyAs } from './useCopyAs'\nimport { useDialogs } from './useDialogsProvider'\nimport { TLUiEventSource, useUiEvents } from './useEventsProvider'\nimport { useExportAs } from './useExportAs'\nimport { useInsertMedia } from './useInsertMedia'\nimport { usePrint } from './usePrint'\nimport { useToasts } from './useToastsProvider'\nimport { TLUiTranslationKey } from './useTranslation/TLUiTranslationKey'\n\n/** @public */\nexport interface TLUiActionItem<\n\tTransationKey extends string = string,\n\tIconType extends string = string\n> {\n\ticon?: IconType\n\tid: string\n\tkbd?: string\n\ttitle?: string\n\tlabel?: TransationKey\n\tmenuLabel?: TransationKey\n\tshortcutsLabel?: TransationKey\n\tcontextMenuLabel?: TransationKey\n\treadonlyOk: boolean\n\tcheckbox?: boolean\n\tonSelect: (source: TLUiEventSource) => Promise<void> | void\n}\n\n/** @public */\nexport type TLUiActionsContextType = Record<string, TLUiActionItem>\n\n/** @internal */\nexport const ActionsContext = React.createContext<TLUiActionsContextType>({})\n\n/** @public */\nexport type ActionsProviderProps = {\n\toverrides?: (\n\t\teditor: Editor,\n\t\tactions: TLUiActionsContextType,\n\t\thelpers: undefined\n\t) => TLUiActionsContextType\n\tchildren: any\n}\n\nfunction makeActions(actions: TLUiActionItem[]) {\n\treturn Object.fromEntries(actions.map((action) => [action.id, action])) as TLUiActionsContextType\n}\n\n/** @internal */\nexport function ActionsProvider({ overrides, children }: ActionsProviderProps) {\n\tconst editor = useEditor()\n\n\tconst { addDialog, clearDialogs } = useDialogs()\n\tconst { clearToasts } = useToasts()\n\n\tconst insertMedia = useInsertMedia()\n\tconst printSelectionOrPages = usePrint()\n\tconst { cut, copy, paste } = useMenuClipboardEvents()\n\tconst copyAs = useCopyAs()\n\tconst exportAs = useExportAs()\n\n\tconst trackEvent = useUiEvents()\n\n\t// should this be a useMemo? looks like it doesn't actually deref any reactive values\n\tconst actions = React.useMemo<TLUiActionsContextType>(() => {\n\t\tfunction mustGoBackToSelectToolFirst() {\n\t\t\tif (!editor.isIn('select')) {\n\t\t\t\teditor.complete()\n\t\t\t\teditor.setCurrentTool('select')\n\t\t\t\treturn false // false will still let the action happen, true will stop it\n\t\t\t\t// todo: remove this return value once we're suuuuure\n\t\t\t}\n\n\t\t\treturn false\n\t\t}\n\n\t\tfunction hasSelectedShapes() {\n\t\t\treturn editor.getSelectedShapeIds().length > 0\n\t\t}\n\n\t\tconst actionItems: TLUiActionItem<TLUiTranslationKey, TLUiIconType>[] = [\n\t\t\t{\n\t\t\t\tid: 'edit-link',\n\t\t\t\tlabel: 'action.edit-link',\n\t\t\t\ticon: 'link',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('edit-link', { source })\n\t\t\t\t\teditor.mark('edit-link')\n\t\t\t\t\taddDialog({ component: EditLinkDialog })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'insert-embed',\n\t\t\t\tlabel: 'action.insert-embed',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tkbd: '$i',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('insert-embed', { source })\n\t\t\t\t\taddDialog({ component: EmbedDialog })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'insert-media',\n\t\t\t\tlabel: 'action.insert-media',\n\t\t\t\tkbd: '$u',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('insert-media', { source })\n\t\t\t\t\tinsertMedia()\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'undo',\n\t\t\t\tlabel: 'action.undo',\n\t\t\t\ticon: 'undo',\n\t\t\t\tkbd: '$z',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('undo', { source })\n\t\t\t\t\teditor.undo()\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'redo',\n\t\t\t\tlabel: 'action.redo',\n\t\t\t\ticon: 'redo',\n\t\t\t\tkbd: '$!z',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('redo', { source })\n\t\t\t\t\teditor.redo()\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'export-as-svg',\n\t\t\t\tlabel: 'action.export-as-svg',\n\t\t\t\tmenuLabel: 'action.export-as-svg.short',\n\t\t\t\tcontextMenuLabel: 'action.export-as-svg.short',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('export-as', { format: 'svg', source })\n\t\t\t\t\texportAs(editor.getSelectedShapeIds(), 'svg')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'export-as-png',\n\t\t\t\tlabel: 'action.export-as-png',\n\t\t\t\tmenuLabel: 'action.export-as-png.short',\n\t\t\t\tcontextMenuLabel: 'action.export-as-png.short',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('export-as', { format: 'png', source })\n\t\t\t\t\texportAs(editor.getSelectedShapeIds(), 'png')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'export-as-json',\n\t\t\t\tlabel: 'action.export-as-json',\n\t\t\t\tmenuLabel: 'action.export-as-json.short',\n\t\t\t\tcontextMenuLabel: 'action.export-as-json.short',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('export-as', { format: 'json', source })\n\t\t\t\t\texportAs(editor.getSelectedShapeIds(), 'json')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'copy-as-svg',\n\t\t\t\tlabel: 'action.copy-as-svg',\n\t\t\t\tmenuLabel: 'action.copy-as-svg.short',\n\t\t\t\tcontextMenuLabel: 'action.copy-as-svg.short',\n\t\t\t\tkbd: '$!c',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('copy-as', { format: 'svg', source })\n\t\t\t\t\tcopyAs(editor.getSelectedShapeIds(), 'svg')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'copy-as-png',\n\t\t\t\tlabel: 'action.copy-as-png',\n\t\t\t\tmenuLabel: 'action.copy-as-png.short',\n\t\t\t\tcontextMenuLabel: 'action.copy-as-png.short',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('copy-as', { format: 'png', source })\n\t\t\t\t\tcopyAs(editor.getSelectedShapeIds(), 'png')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'copy-as-json',\n\t\t\t\tlabel: 'action.copy-as-json',\n\t\t\t\tmenuLabel: 'action.copy-as-json.short',\n\t\t\t\tcontextMenuLabel: 'action.copy-as-json.short',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('copy-as', { format: 'json', source })\n\t\t\t\t\tcopyAs(editor.getSelectedShapeIds(), 'json')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-auto-size',\n\t\t\t\tlabel: 'action.toggle-auto-size',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('toggle-auto-size', { source })\n\t\t\t\t\teditor.mark('toggling auto size')\n\t\t\t\t\teditor.updateShapes(\n\t\t\t\t\t\teditor\n\t\t\t\t\t\t\t.getSelectedShapes()\n\t\t\t\t\t\t\t.filter(\n\t\t\t\t\t\t\t\t(shape): shape is TLTextShape =>\n\t\t\t\t\t\t\t\t\teditor.isShapeOfType<TLTextShape>(shape, 'text') && shape.props.autoSize === false\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.map((shape) => {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tid: shape.id,\n\t\t\t\t\t\t\t\t\ttype: shape.type,\n\t\t\t\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\t\t\t\t...shape.props,\n\t\t\t\t\t\t\t\t\t\tw: 8,\n\t\t\t\t\t\t\t\t\t\tautoSize: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'open-embed-link',\n\t\t\t\tlabel: 'action.open-embed-link',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('open-embed-link', { source })\n\t\t\t\t\tconst ids = editor.getSelectedShapeIds()\n\t\t\t\t\tconst warnMsg = 'No embed shapes selected'\n\t\t\t\t\tif (ids.length !== 1) {\n\t\t\t\t\t\tconsole.error(warnMsg)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tconst shape = editor.getShape(ids[0])\n\t\t\t\t\tif (!shape || !editor.isShapeOfType<TLEmbedShape>(shape, 'embed')) {\n\t\t\t\t\t\tconsole.error(warnMsg)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\topenWindow(shape.props.url, '_blank')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'select-zoom-tool',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tkbd: 'z',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (editor.root.getCurrent()?.id === 'zoom') return\n\n\t\t\t\t\ttrackEvent('zoom-tool', { source })\n\t\t\t\t\tif (!(editor.inputs.shiftKey || editor.inputs.ctrlKey)) {\n\t\t\t\t\t\tconst currentTool = editor.root.getCurrent()\n\t\t\t\t\t\tif (currentTool && currentTool.getCurrent()?.id === 'idle') {\n\t\t\t\t\t\t\teditor.setCurrentTool('zoom', { onInteractionEnd: currentTool.id, maskAs: 'zoom' })\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'convert-to-bookmark',\n\t\t\t\tlabel: 'action.convert-to-bookmark',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\teditor.batch(() => {\n\t\t\t\t\t\ttrackEvent('convert-to-bookmark', { source })\n\t\t\t\t\t\tconst shapes = editor.getSelectedShapes()\n\n\t\t\t\t\t\tconst createList: TLShapePartial[] = []\n\t\t\t\t\t\tconst deleteList: TLShapeId[] = []\n\t\t\t\t\t\tfor (const shape of shapes) {\n\t\t\t\t\t\t\tif (!shape || !editor.isShapeOfType<TLEmbedShape>(shape, 'embed') || !shape.props.url)\n\t\t\t\t\t\t\t\tcontinue\n\n\t\t\t\t\t\t\tconst newPos = new Vec2d(shape.x, shape.y)\n\t\t\t\t\t\t\tnewPos.rot(-shape.rotation)\n\t\t\t\t\t\t\tnewPos.add(new Vec2d(shape.props.w / 2 - 300 / 2, shape.props.h / 2 - 320 / 2)) // see bookmark shape util\n\t\t\t\t\t\t\tnewPos.rot(shape.rotation)\n\t\t\t\t\t\t\tconst partial: TLShapePartial<TLBookmarkShape> = {\n\t\t\t\t\t\t\t\tid: createShapeId(),\n\t\t\t\t\t\t\t\ttype: 'bookmark',\n\t\t\t\t\t\t\t\trotation: shape.rotation,\n\t\t\t\t\t\t\t\tx: newPos.x,\n\t\t\t\t\t\t\t\ty: newPos.y,\n\t\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\t\t\turl: shape.props.url,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcreateList.push(partial)\n\t\t\t\t\t\t\tdeleteList.push(shape.id)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\teditor.mark('convert shapes to bookmark')\n\t\t\t\t\t\teditor.deleteShapes(deleteList)\n\t\t\t\t\t\teditor.createShapes(createList)\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'convert-to-embed',\n\t\t\t\tlabel: 'action.convert-to-embed',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('convert-to-embed', { source })\n\n\t\t\t\t\teditor.batch(() => {\n\t\t\t\t\t\tconst ids = editor.getSelectedShapeIds()\n\t\t\t\t\t\tconst shapes = compact(ids.map((id) => editor.getShape(id)))\n\n\t\t\t\t\t\tconst createList: TLShapePartial[] = []\n\t\t\t\t\t\tconst deleteList: TLShapeId[] = []\n\t\t\t\t\t\tfor (const shape of shapes) {\n\t\t\t\t\t\t\tif (!editor.isShapeOfType<TLBookmarkShape>(shape, 'bookmark')) continue\n\n\t\t\t\t\t\t\tconst { url } = shape.props\n\n\t\t\t\t\t\t\tconst embedInfo = getEmbedInfo(shape.props.url)\n\n\t\t\t\t\t\t\tif (!embedInfo) continue\n\t\t\t\t\t\t\tif (!embedInfo.definition) continue\n\n\t\t\t\t\t\t\tconst { width, height } = embedInfo.definition\n\n\t\t\t\t\t\t\tconst newPos = new Vec2d(shape.x, shape.y)\n\t\t\t\t\t\t\tnewPos.rot(-shape.rotation)\n\t\t\t\t\t\t\tnewPos.add(new Vec2d(shape.props.w / 2 - width / 2, shape.props.h / 2 - height / 2))\n\t\t\t\t\t\t\tnewPos.rot(shape.rotation)\n\n\t\t\t\t\t\t\tconst shapeToCreate: TLShapePartial<TLEmbedShape> = {\n\t\t\t\t\t\t\t\tid: createShapeId(),\n\t\t\t\t\t\t\t\ttype: 'embed',\n\t\t\t\t\t\t\t\tx: newPos.x,\n\t\t\t\t\t\t\t\ty: newPos.y,\n\t\t\t\t\t\t\t\trotation: shape.rotation,\n\t\t\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\t\t\turl: url,\n\t\t\t\t\t\t\t\t\tw: width,\n\t\t\t\t\t\t\t\t\th: height,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcreateList.push(shapeToCreate)\n\t\t\t\t\t\t\tdeleteList.push(shape.id)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\teditor.mark('convert shapes to embed')\n\t\t\t\t\t\teditor.deleteShapes(deleteList)\n\t\t\t\t\t\teditor.createShapes(createList)\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'duplicate',\n\t\t\t\tkbd: '$d',\n\t\t\t\tlabel: 'action.duplicate',\n\t\t\t\ticon: 'duplicate',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('duplicate-shapes', { source })\n\t\t\t\t\tconst ids = editor.getSelectedShapeIds()\n\t\t\t\t\tconst commonBounds = Box2d.Common(compact(ids.map((id) => editor.getShapePageBounds(id))))\n\t\t\t\t\tconst offset = editor.getInstanceState().canMoveCamera\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tx: commonBounds.width + 10,\n\t\t\t\t\t\t\t\ty: 0,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\tx: 16 / editor.getZoomLevel(),\n\t\t\t\t\t\t\t\ty: 16 / editor.getZoomLevel(),\n\t\t\t\t\t\t }\n\t\t\t\t\teditor.mark('duplicate shapes')\n\t\t\t\t\teditor.duplicateShapes(ids, offset)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'ungroup',\n\t\t\t\tlabel: 'action.ungroup',\n\t\t\t\tkbd: '$!g',\n\t\t\t\ticon: 'ungroup',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('ungroup-shapes', { source })\n\t\t\t\t\teditor.mark('ungroup')\n\t\t\t\t\teditor.ungroupShapes(editor.getSelectedShapeIds())\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'group',\n\t\t\t\tlabel: 'action.group',\n\t\t\t\tkbd: '$g',\n\t\t\t\ticon: 'group',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('group-shapes', { source })\n\t\t\t\t\tconst onlySelectedShape = editor.getOnlySelectedShape()\n\t\t\t\t\tif (onlySelectedShape && editor.isShapeOfType<TLGroupShape>(onlySelectedShape, 'group')) {\n\t\t\t\t\t\teditor.mark('ungroup')\n\t\t\t\t\t\teditor.ungroupShapes(editor.getSelectedShapeIds())\n\t\t\t\t\t} else {\n\t\t\t\t\t\teditor.mark('group')\n\t\t\t\t\t\teditor.groupShapes(editor.getSelectedShapeIds())\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'remove-frame',\n\t\t\t\tlabel: 'action.remove-frame',\n\t\t\t\tkbd: '$!f',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\n\t\t\t\t\ttrackEvent('remove-frame', { source })\n\t\t\t\t\tconst selectedShapes = editor.getSelectedShapes()\n\t\t\t\t\tif (\n\t\t\t\t\t\tselectedShapes.length > 0 &&\n\t\t\t\t\t\tselectedShapes.every((shape) => editor.isShapeOfType<TLFrameShape>(shape, 'frame'))\n\t\t\t\t\t) {\n\t\t\t\t\t\teditor.mark('remove-frame')\n\t\t\t\t\t\tremoveFrame(\n\t\t\t\t\t\t\teditor,\n\t\t\t\t\t\t\tselectedShapes.map((shape) => shape.id)\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'fit-frame-to-content',\n\t\t\t\tlabel: 'action.fit-frame-to-content',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\n\t\t\t\t\ttrackEvent('fit-frame-to-content', { source })\n\t\t\t\t\tconst onlySelectedShape = editor.getOnlySelectedShape()\n\t\t\t\t\tif (onlySelectedShape && editor.isShapeOfType<TLFrameShape>(onlySelectedShape, 'frame')) {\n\t\t\t\t\t\teditor.mark('fit-frame-to-content')\n\t\t\t\t\t\tfitFrameToContent(editor, onlySelectedShape.id)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'align-left',\n\t\t\t\tlabel: 'action.align-left',\n\t\t\t\tkbd: '?A',\n\t\t\t\ticon: 'align-left',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('align-shapes', { operation: 'left', source })\n\t\t\t\t\teditor.mark('align left')\n\t\t\t\t\teditor.alignShapes(editor.getSelectedShapeIds(), 'left')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'align-center-horizontal',\n\t\t\t\tlabel: 'action.align-center-horizontal',\n\t\t\t\tcontextMenuLabel: 'action.align-center-horizontal.short',\n\t\t\t\tkbd: '?H',\n\t\t\t\ticon: 'align-center-horizontal',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('align-shapes', { operation: 'center-horizontal', source })\n\t\t\t\t\teditor.mark('align center horizontal')\n\t\t\t\t\teditor.alignShapes(editor.getSelectedShapeIds(), 'center-horizontal')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'align-right',\n\t\t\t\tlabel: 'action.align-right',\n\t\t\t\tkbd: '?D',\n\t\t\t\ticon: 'align-right',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('align-shapes', { operation: 'right', source })\n\t\t\t\t\teditor.mark('align right')\n\t\t\t\t\teditor.alignShapes(editor.getSelectedShapeIds(), 'right')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'align-center-vertical',\n\t\t\t\tlabel: 'action.align-center-vertical',\n\t\t\t\tcontextMenuLabel: 'action.align-center-vertical.short',\n\t\t\t\tkbd: '?V',\n\t\t\t\ticon: 'align-center-vertical',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('align-shapes', { operation: 'center-vertical', source })\n\t\t\t\t\teditor.mark('align center vertical')\n\t\t\t\t\teditor.alignShapes(editor.getSelectedShapeIds(), 'center-vertical')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'align-top',\n\t\t\t\tlabel: 'action.align-top',\n\t\t\t\ticon: 'align-top',\n\t\t\t\tkbd: '?W',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('align-shapes', { operation: 'top', source })\n\t\t\t\t\teditor.mark('align top')\n\t\t\t\t\teditor.alignShapes(editor.getSelectedShapeIds(), 'top')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'align-bottom',\n\t\t\t\tlabel: 'action.align-bottom',\n\t\t\t\ticon: 'align-bottom',\n\t\t\t\tkbd: '?S',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('align-shapes', { operation: 'bottom', source })\n\t\t\t\t\teditor.mark('align bottom')\n\t\t\t\t\teditor.alignShapes(editor.getSelectedShapeIds(), 'bottom')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'distribute-horizontal',\n\t\t\t\tlabel: 'action.distribute-horizontal',\n\t\t\t\tcontextMenuLabel: 'action.distribute-horizontal.short',\n\t\t\t\ticon: 'distribute-horizontal',\n\t\t\t\tkbd: '?!h',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('distribute-shapes', { operation: 'horizontal', source })\n\t\t\t\t\teditor.mark('distribute horizontal')\n\t\t\t\t\teditor.distributeShapes(editor.getSelectedShapeIds(), 'horizontal')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'distribute-vertical',\n\t\t\t\tlabel: 'action.distribute-vertical',\n\t\t\t\tcontextMenuLabel: 'action.distribute-vertical.short',\n\t\t\t\ticon: 'distribute-vertical',\n\t\t\t\tkbd: '?!V',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('distribute-shapes', { operation: 'vertical', source })\n\t\t\t\t\teditor.mark('distribute vertical')\n\t\t\t\t\teditor.distributeShapes(editor.getSelectedShapeIds(), 'vertical')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'stretch-horizontal',\n\t\t\t\tlabel: 'action.stretch-horizontal',\n\t\t\t\tcontextMenuLabel: 'action.stretch-horizontal.short',\n\t\t\t\ticon: 'stretch-horizontal',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('stretch-shapes', { operation: 'horizontal', source })\n\t\t\t\t\teditor.mark('stretch horizontal')\n\t\t\t\t\teditor.stretchShapes(editor.getSelectedShapeIds(), 'horizontal')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'stretch-vertical',\n\t\t\t\tlabel: 'action.stretch-vertical',\n\t\t\t\tcontextMenuLabel: 'action.stretch-vertical.short',\n\t\t\t\ticon: 'stretch-vertical',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('stretch-shapes', { operation: 'vertical', source })\n\t\t\t\t\teditor.mark('stretch vertical')\n\t\t\t\t\teditor.stretchShapes(editor.getSelectedShapeIds(), 'vertical')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'flip-horizontal',\n\t\t\t\tlabel: 'action.flip-horizontal',\n\t\t\t\tcontextMenuLabel: 'action.flip-horizontal.short',\n\t\t\t\tkbd: '!h',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('flip-shapes', { operation: 'horizontal', source })\n\t\t\t\t\teditor.mark('flip horizontal')\n\t\t\t\t\teditor.flipShapes(editor.getSelectedShapeIds(), 'horizontal')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'flip-vertical',\n\t\t\t\tlabel: 'action.flip-vertical',\n\t\t\t\tcontextMenuLabel: 'action.flip-vertical.short',\n\t\t\t\tkbd: '!v',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('flip-shapes', { operation: 'vertical', source })\n\t\t\t\t\teditor.mark('flip vertical')\n\t\t\t\t\teditor.flipShapes(editor.getSelectedShapeIds(), 'vertical')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'pack',\n\t\t\t\tlabel: 'action.pack',\n\t\t\t\ticon: 'pack',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('pack-shapes', { source })\n\t\t\t\t\teditor.mark('pack')\n\t\t\t\t\teditor.packShapes(editor.getSelectedShapeIds(), 16)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'stack-vertical',\n\t\t\t\tlabel: 'action.stack-vertical',\n\t\t\t\tcontextMenuLabel: 'action.stack-vertical.short',\n\t\t\t\ticon: 'stack-vertical',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('stack-shapes', { operation: 'vertical', source })\n\t\t\t\t\teditor.mark('stack-vertical')\n\t\t\t\t\teditor.stackShapes(editor.getSelectedShapeIds(), 'vertical', 16)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'stack-horizontal',\n\t\t\t\tlabel: 'action.stack-horizontal',\n\t\t\t\tcontextMenuLabel: 'action.stack-horizontal.short',\n\t\t\t\ticon: 'stack-horizontal',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('stack-shapes', { operation: 'horizontal', source })\n\t\t\t\t\teditor.mark('stack-horizontal')\n\t\t\t\t\teditor.stackShapes(editor.getSelectedShapeIds(), 'horizontal', 16)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'bring-to-front',\n\t\t\t\tlabel: 'action.bring-to-front',\n\t\t\t\tkbd: ']',\n\t\t\t\ticon: 'bring-to-front',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('reorder-shapes', { operation: 'toFront', source })\n\t\t\t\t\teditor.mark('bring to front')\n\t\t\t\t\teditor.bringToFront(editor.getSelectedShapeIds())\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'bring-forward',\n\t\t\t\tlabel: 'action.bring-forward',\n\t\t\t\ticon: 'bring-forward',\n\t\t\t\tkbd: '?]',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('reorder-shapes', { operation: 'forward', source })\n\t\t\t\t\teditor.mark('bring forward')\n\t\t\t\t\teditor.bringForward(editor.getSelectedShapeIds())\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'send-backward',\n\t\t\t\tlabel: 'action.send-backward',\n\t\t\t\ticon: 'send-backward',\n\t\t\t\tkbd: '?[',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('reorder-shapes', { operation: 'backward', source })\n\t\t\t\t\teditor.mark('send backward')\n\t\t\t\t\teditor.sendBackward(editor.getSelectedShapeIds())\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'send-to-back',\n\t\t\t\tlabel: 'action.send-to-back',\n\t\t\t\ticon: 'send-to-back',\n\t\t\t\tkbd: '[',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('reorder-shapes', { operation: 'toBack', source })\n\t\t\t\t\teditor.mark('send to back')\n\t\t\t\t\teditor.sendToBack(editor.getSelectedShapeIds())\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'cut',\n\t\t\t\tlabel: 'action.cut',\n\t\t\t\tkbd: '$x',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\teditor.mark('cut')\n\t\t\t\t\tcut(source)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'copy',\n\t\t\t\tlabel: 'action.copy',\n\t\t\t\tkbd: '$c',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\tcopy(source)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'paste',\n\t\t\t\tlabel: 'action.paste',\n\t\t\t\tkbd: '$v',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tnavigator.clipboard?.read().then((clipboardItems) => {\n\t\t\t\t\t\tpaste(\n\t\t\t\t\t\t\tclipboardItems,\n\t\t\t\t\t\t\tsource,\n\t\t\t\t\t\t\tsource === 'context-menu' ? editor.inputs.currentPagePoint : undefined\n\t\t\t\t\t\t)\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'select-all',\n\t\t\t\tlabel: 'action.select-all',\n\t\t\t\tkbd: '$a',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\teditor.batch(() => {\n\t\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\t\ttrackEvent('select-all-shapes', { source })\n\n\t\t\t\t\t\teditor.mark('select all kbd')\n\t\t\t\t\t\teditor.selectAll()\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'select-none',\n\t\t\t\tlabel: 'action.select-none',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('select-none-shapes', { source })\n\t\t\t\t\teditor.mark('select none')\n\t\t\t\t\teditor.selectNone()\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'delete',\n\t\t\t\tlabel: 'action.delete',\n\t\t\t\tkbd: '\u232B,del,backspace',\n\t\t\t\ticon: 'trash',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('delete-shapes', { source })\n\t\t\t\t\teditor.mark('delete')\n\t\t\t\t\teditor.deleteShapes(editor.getSelectedShapeIds())\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'rotate-cw',\n\t\t\t\tlabel: 'action.rotate-cw',\n\t\t\t\ticon: 'rotate-cw',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('rotate-cw', { source })\n\t\t\t\t\teditor.mark('rotate-cw')\n\t\t\t\t\tconst offset = editor.getSelectionRotation() % (TAU / 2)\n\t\t\t\t\tconst dontUseOffset = approximately(offset, 0) || approximately(offset, TAU / 2)\n\t\t\t\t\teditor.rotateShapesBy(\n\t\t\t\t\t\teditor.getSelectedShapeIds(),\n\t\t\t\t\t\tTAU / 2 - (dontUseOffset ? 0 : offset)\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'rotate-ccw',\n\t\t\t\tlabel: 'action.rotate-ccw',\n\t\t\t\ticon: 'rotate-ccw',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('rotate-ccw', { source })\n\t\t\t\t\teditor.mark('rotate-ccw')\n\t\t\t\t\tconst offset = editor.getSelectionRotation() % (TAU / 2)\n\t\t\t\t\tconst offsetCloseToZero = approximately(offset, 0)\n\t\t\t\t\teditor.rotateShapesBy(\n\t\t\t\t\t\teditor.getSelectedShapeIds(),\n\t\t\t\t\t\toffsetCloseToZero ? -(TAU / 2) : -offset\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'zoom-in',\n\t\t\t\tlabel: 'action.zoom-in',\n\t\t\t\tkbd: '$=,=',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('zoom-in', { source })\n\t\t\t\t\teditor.zoomIn(editor.getViewportScreenCenter(), { duration: ANIMATION_MEDIUM_MS })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'zoom-out',\n\t\t\t\tlabel: 'action.zoom-out',\n\t\t\t\tkbd: '$-,-',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('zoom-out', { source })\n\t\t\t\t\teditor.zoomOut(editor.getViewportScreenCenter(), { duration: ANIMATION_MEDIUM_MS })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'zoom-to-100',\n\t\t\t\tlabel: 'action.zoom-to-100',\n\t\t\t\ticon: 'reset-zoom',\n\t\t\t\tkbd: '!0',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('reset-zoom', { source })\n\t\t\t\t\teditor.resetZoom(editor.getViewportScreenCenter(), { duration: ANIMATION_MEDIUM_MS })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'zoom-to-fit',\n\t\t\t\tlabel: 'action.zoom-to-fit',\n\t\t\t\tkbd: '!1',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('zoom-to-fit', { source })\n\t\t\t\t\teditor.zoomToFit({ duration: ANIMATION_MEDIUM_MS })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'zoom-to-selection',\n\t\t\t\tlabel: 'action.zoom-to-selection',\n\t\t\t\tkbd: '!2',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('zoom-to-selection', { source })\n\t\t\t\t\teditor.zoomToSelection({ duration: ANIMATION_MEDIUM_MS })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-snap-mode',\n\t\t\t\tlabel: 'action.toggle-snap-mode',\n\t\t\t\tmenuLabel: 'action.toggle-snap-mode.menu',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('toggle-snap-mode', { source })\n\t\t\t\t\teditor.user.updateUserPreferences({ isSnapMode: !editor.user.getIsSnapMode() })\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-dark-mode',\n\t\t\t\tlabel: 'action.toggle-dark-mode',\n\t\t\t\tmenuLabel: 'action.toggle-dark-mode.menu',\n\t\t\t\tkbd: '$/',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('toggle-dark-mode', { source })\n\t\t\t\t\teditor.user.updateUserPreferences({ isDarkMode: !editor.user.getIsDarkMode() })\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-reduce-motion',\n\t\t\t\tlabel: 'action.toggle-reduce-motion',\n\t\t\t\tmenuLabel: 'action.toggle-reduce-motion.menu',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('toggle-reduce-motion', { source })\n\t\t\t\t\teditor.user.updateUserPreferences({\n\t\t\t\t\t\tanimationSpeed: editor.user.getAnimationSpeed() === 0 ? 1 : 0,\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-transparent',\n\t\t\t\tlabel: 'action.toggle-transparent',\n\t\t\t\tmenuLabel: 'action.toggle-transparent.menu',\n\t\t\t\tcontextMenuLabel: 'action.toggle-transparent.context-menu',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('toggle-transparent', { source })\n\t\t\t\t\teditor.updateInstanceState(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\texportBackground: !editor.getInstanceState().exportBackground,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ ephemeral: true }\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-tool-lock',\n\t\t\t\tlabel: 'action.toggle-tool-lock',\n\t\t\t\tmenuLabel: 'action.toggle-tool-lock.menu',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tkbd: 'q',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('toggle-tool-lock', { source })\n\t\t\t\t\teditor.updateInstanceState({ isToolLocked: !editor.getInstanceState().isToolLocked })\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'unlock-all',\n\t\t\t\tlabel: 'action.unlock-all',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('unlock-all', { source })\n\t\t\t\t\tconst updates = [] as TLShapePartial[]\n\t\t\t\t\tfor (const shape of editor.getCurrentPageShapes()) {\n\t\t\t\t\t\tif (shape.isLocked) {\n\t\t\t\t\t\t\tupdates.push({ id: shape.id, type: shape.type, isLocked: false })\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (updates.length > 0) {\n\t\t\t\t\t\teditor.updateShapes(updates)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-focus-mode',\n\t\t\t\tlabel: 'action.toggle-focus-mode',\n\t\t\t\tmenuLabel: 'action.toggle-focus-mode.menu',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tkbd: '$.',\n\t\t\t\tcheckbox: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\t// this needs to be deferred because it causes the menu\n\t\t\t\t\t// UI to unmount which puts us in a dodgy state\n\t\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\t\teditor.batch(() => {\n\t\t\t\t\t\t\ttrackEvent('toggle-focus-mode', { source })\n\t\t\t\t\t\t\tclearDialogs()\n\t\t\t\t\t\t\tclearToasts()\n\t\t\t\t\t\t\teditor.updateInstanceState({ isFocusMode: !editor.getInstanceState().isFocusMode })\n\t\t\t\t\t\t})\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-grid',\n\t\t\t\tlabel: 'action.toggle-grid',\n\t\t\t\tmenuLabel: 'action.toggle-grid.menu',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tkbd: \"$'\",\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('toggle-grid-mode', { source })\n\t\t\t\t\teditor.updateInstanceState({ isGridMode: !editor.getInstanceState().isGridMode })\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-debug-mode',\n\t\t\t\tlabel: 'action.toggle-debug-mode',\n\t\t\t\tmenuLabel: 'action.toggle-debug-mode.menu',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('toggle-debug-mode', { source })\n\t\t\t\t\teditor.updateInstanceState({\n\t\t\t\t\t\tisDebugMode: !editor.getInstanceState().isDebugMode,\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'print',\n\t\t\t\tlabel: 'action.print',\n\t\t\t\tkbd: '$p',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('print', { source })\n\t\t\t\t\tprintSelectionOrPages()\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'exit-pen-mode',\n\t\t\t\tlabel: 'action.exit-pen-mode',\n\t\t\t\ticon: 'cross-2',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('exit-pen-mode', { source })\n\t\t\t\t\teditor.updateInstanceState({ isPenMode: false })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'stop-following',\n\t\t\t\tlabel: 'action.stop-following',\n\t\t\t\ticon: 'cross-2',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('stop-following', { source })\n\t\t\t\t\teditor.stopFollowingUser()\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'back-to-content',\n\t\t\t\tlabel: 'action.back-to-content',\n\t\t\t\ticon: 'arrow-left',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('zoom-to-content', { source })\n\t\t\t\t\teditor.zoomToContent()\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-lock',\n\t\t\t\tlabel: 'action.toggle-lock',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tkbd: '!l',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\teditor.mark('locking')\n\t\t\t\t\ttrackEvent('toggle-lock', { source })\n\t\t\t\t\teditor.toggleLock(editor.getSelectedShapeIds())\n\t\t\t\t},\n\t\t\t},\n\t\t]\n\n\t\tconst actions = makeActions(actionItems)\n\n\t\tif (overrides) {\n\t\t\treturn overrides(editor, actions, undefined)\n\t\t}\n\n\t\treturn actions\n\t}, [\n\t\teditor,\n\t\ttrackEvent,\n\t\toverrides,\n\t\taddDialog,\n\t\tinsertMedia,\n\t\texportAs,\n\t\tcopyAs,\n\t\tcut,\n\t\tcopy,\n\t\tpaste,\n\t\tclearDialogs,\n\t\tclearToasts,\n\t\tprintSelectionOrPages,\n\t])\n\n\treturn <ActionsContext.Provider value={asActions(actions)}>{children}</ActionsContext.Provider>\n}\n\n/** @public */\nexport function useActions() {\n\tconst ctx = React.useContext(ActionsContext)\n\n\tif (!ctx) {\n\t\tthrow new Error('useTools must be used within a ToolProvider')\n\t}\n\n\treturn ctx\n}\n\nfunction asActions<T extends Record<string, TLUiActionItem>>(actions: T) {\n\treturn actions as Record<keyof typeof actions, TL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AAA,QACZ,KAAK;AAAA,QACL,SAAS,QAAQ;AAChB,iBAAO,KAAK,SAAS;AACrB,qBAAW,eAAe,EAAE,OAAO,CAAC;AACpC,iBAAO,WAAW,OAAO,oBAAoB,CAAC;AAAA,QAC/C;AAAA,MACD;AAAA,IACD;AAEA,UAAMA,WAAU,YAAY,WAAW;AAEvC,QAAI,WAAW;AACd,aAAO,UAAU,QAAQA,UAAS,MAAS;AAAA,IAC5C;AAEA,WAAOA;AAAA,EACR,GAAG;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAC;AAED,SAAO,4CAAC,eAAe,UAAf,EAAwB,OAAO,UAAU,OAAO,GAAI,UAAS;AACtE;AAGO,SAAS,aAAa;AAC5B,QAAM,MAAM,MAAM,WAAW,cAAc;AAE3C,MAAI,CAAC,KAAK;AACT,UAAM,IAAI,MAAM,6CAA6C;AAAA,EAC9D;AAEA,SAAO;AACR;AAEA,SAAS,UAAoD,SAAY;AACxE,SAAO;AACR;",
4
+ "sourcesContent": ["import {\n\tANIMATION_MEDIUM_MS,\n\tBox2d,\n\tEditor,\n\tTAU,\n\tTLBookmarkShape,\n\tTLEmbedShape,\n\tTLFrameShape,\n\tTLGroupShape,\n\tTLShapeId,\n\tTLShapePartial,\n\tTLTextShape,\n\tVec2d,\n\tapproximately,\n\tcompact,\n\tcreateShapeId,\n\topenWindow,\n\tuseEditor,\n} from '@bigbluebutton/editor'\nimport * as React from 'react'\nimport { getEmbedInfo } from '../../utils/embeds/embeds'\nimport { fitFrameToContent, removeFrame } from '../../utils/frames/frames'\nimport { EditLinkDialog } from '../components/EditLinkDialog'\nimport { EmbedDialog } from '../components/EmbedDialog'\nimport { TLUiIconType } from '../icon-types'\nimport { useMenuClipboardEvents } from './useClipboardEvents'\nimport { useCopyAs } from './useCopyAs'\nimport { useDialogs } from './useDialogsProvider'\nimport { TLUiEventSource, useUiEvents } from './useEventsProvider'\nimport { useExportAs } from './useExportAs'\nimport { useInsertMedia } from './useInsertMedia'\nimport { usePrint } from './usePrint'\nimport { useToasts } from './useToastsProvider'\nimport { TLUiTranslationKey } from './useTranslation/TLUiTranslationKey'\n\n/** @public */\nexport interface TLUiActionItem<\n\tTransationKey extends string = string,\n\tIconType extends string = string\n> {\n\ticon?: IconType\n\tid: string\n\tkbd?: string\n\ttitle?: string\n\tlabel?: TransationKey\n\tmenuLabel?: TransationKey\n\tshortcutsLabel?: TransationKey\n\tcontextMenuLabel?: TransationKey\n\treadonlyOk: boolean\n\tcheckbox?: boolean\n\tonSelect: (source: TLUiEventSource) => Promise<void> | void\n}\n\n/** @public */\nexport type TLUiActionsContextType = Record<string, TLUiActionItem>\n\n/** @internal */\nexport const ActionsContext = React.createContext<TLUiActionsContextType>({})\n\n/** @public */\nexport type ActionsProviderProps = {\n\toverrides?: (\n\t\teditor: Editor,\n\t\tactions: TLUiActionsContextType,\n\t\thelpers: undefined\n\t) => TLUiActionsContextType\n\tchildren: any\n}\n\nfunction makeActions(actions: TLUiActionItem[]) {\n\treturn Object.fromEntries(actions.map((action) => [action.id, action])) as TLUiActionsContextType\n}\n\n/** @internal */\nexport function ActionsProvider({ overrides, children }: ActionsProviderProps) {\n\tconst editor = useEditor()\n\n\tconst { addDialog, clearDialogs } = useDialogs()\n\tconst { clearToasts } = useToasts()\n\n\tconst insertMedia = useInsertMedia()\n\tconst printSelectionOrPages = usePrint()\n\tconst { cut, copy, paste } = useMenuClipboardEvents()\n\tconst copyAs = useCopyAs()\n\tconst exportAs = useExportAs()\n\n\tconst trackEvent = useUiEvents()\n\n\t// should this be a useMemo? looks like it doesn't actually deref any reactive values\n\tconst actions = React.useMemo<TLUiActionsContextType>(() => {\n\t\tfunction mustGoBackToSelectToolFirst() {\n\t\t\tif (!editor.isIn('select')) {\n\t\t\t\teditor.complete()\n\t\t\t\teditor.setCurrentTool('select')\n\t\t\t\treturn false // false will still let the action happen, true will stop it\n\t\t\t\t// todo: remove this return value once we're suuuuure\n\t\t\t}\n\n\t\t\treturn false\n\t\t}\n\n\t\tfunction hasSelectedShapes() {\n\t\t\treturn editor.getSelectedShapeIds().length > 0\n\t\t}\n\n\t\tconst actionItems: TLUiActionItem<TLUiTranslationKey, TLUiIconType>[] = [\n\t\t\t{\n\t\t\t\tid: 'edit-link',\n\t\t\t\tlabel: 'action.edit-link',\n\t\t\t\ticon: 'link',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('edit-link', { source })\n\t\t\t\t\teditor.mark('edit-link')\n\t\t\t\t\taddDialog({ component: EditLinkDialog })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'insert-embed',\n\t\t\t\tlabel: 'action.insert-embed',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tkbd: '$i',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('insert-embed', { source })\n\t\t\t\t\taddDialog({ component: EmbedDialog })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'insert-media',\n\t\t\t\tlabel: 'action.insert-media',\n\t\t\t\tkbd: '$u',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('insert-media', { source })\n\t\t\t\t\tinsertMedia()\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'undo',\n\t\t\t\tlabel: 'action.undo',\n\t\t\t\ticon: 'undo',\n\t\t\t\tkbd: '$z',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('undo', { source })\n\t\t\t\t\teditor.undo()\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'redo',\n\t\t\t\tlabel: 'action.redo',\n\t\t\t\ticon: 'redo',\n\t\t\t\tkbd: '$!z',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('redo', { source })\n\t\t\t\t\teditor.redo()\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'export-as-svg',\n\t\t\t\tlabel: 'action.export-as-svg',\n\t\t\t\tmenuLabel: 'action.export-as-svg.short',\n\t\t\t\tcontextMenuLabel: 'action.export-as-svg.short',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('export-as', { format: 'svg', source })\n\t\t\t\t\texportAs(editor.getSelectedShapeIds(), 'svg')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'export-as-png',\n\t\t\t\tlabel: 'action.export-as-png',\n\t\t\t\tmenuLabel: 'action.export-as-png.short',\n\t\t\t\tcontextMenuLabel: 'action.export-as-png.short',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('export-as', { format: 'png', source })\n\t\t\t\t\texportAs(editor.getSelectedShapeIds(), 'png')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'export-as-json',\n\t\t\t\tlabel: 'action.export-as-json',\n\t\t\t\tmenuLabel: 'action.export-as-json.short',\n\t\t\t\tcontextMenuLabel: 'action.export-as-json.short',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('export-as', { format: 'json', source })\n\t\t\t\t\texportAs(editor.getSelectedShapeIds(), 'json')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'copy-as-svg',\n\t\t\t\tlabel: 'action.copy-as-svg',\n\t\t\t\tmenuLabel: 'action.copy-as-svg.short',\n\t\t\t\tcontextMenuLabel: 'action.copy-as-svg.short',\n\t\t\t\tkbd: '$!c',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('copy-as', { format: 'svg', source })\n\t\t\t\t\tcopyAs(editor.getSelectedShapeIds(), 'svg')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'copy-as-png',\n\t\t\t\tlabel: 'action.copy-as-png',\n\t\t\t\tmenuLabel: 'action.copy-as-png.short',\n\t\t\t\tcontextMenuLabel: 'action.copy-as-png.short',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('copy-as', { format: 'png', source })\n\t\t\t\t\tcopyAs(editor.getSelectedShapeIds(), 'png')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'copy-as-json',\n\t\t\t\tlabel: 'action.copy-as-json',\n\t\t\t\tmenuLabel: 'action.copy-as-json.short',\n\t\t\t\tcontextMenuLabel: 'action.copy-as-json.short',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('copy-as', { format: 'json', source })\n\t\t\t\t\tcopyAs(editor.getSelectedShapeIds(), 'json')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-auto-size',\n\t\t\t\tlabel: 'action.toggle-auto-size',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('toggle-auto-size', { source })\n\t\t\t\t\teditor.mark('toggling auto size')\n\t\t\t\t\teditor.updateShapes(\n\t\t\t\t\t\teditor\n\t\t\t\t\t\t\t.getSelectedShapes()\n\t\t\t\t\t\t\t.filter(\n\t\t\t\t\t\t\t\t(shape): shape is TLTextShape =>\n\t\t\t\t\t\t\t\t\teditor.isShapeOfType<TLTextShape>(shape, 'text') && shape.props.autoSize === false\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.map((shape) => {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tid: shape.id,\n\t\t\t\t\t\t\t\t\ttype: shape.type,\n\t\t\t\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\t\t\t\t...shape.props,\n\t\t\t\t\t\t\t\t\t\tw: 8,\n\t\t\t\t\t\t\t\t\t\tautoSize: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'open-embed-link',\n\t\t\t\tlabel: 'action.open-embed-link',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('open-embed-link', { source })\n\t\t\t\t\tconst ids = editor.getSelectedShapeIds()\n\t\t\t\t\tconst warnMsg = 'No embed shapes selected'\n\t\t\t\t\tif (ids.length !== 1) {\n\t\t\t\t\t\tconsole.error(warnMsg)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tconst shape = editor.getShape(ids[0])\n\t\t\t\t\tif (!shape || !editor.isShapeOfType<TLEmbedShape>(shape, 'embed')) {\n\t\t\t\t\t\tconsole.error(warnMsg)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\topenWindow(shape.props.url, '_blank')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'select-zoom-tool',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tkbd: 'z',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (editor.root.getCurrent()?.id === 'zoom') return\n\n\t\t\t\t\ttrackEvent('zoom-tool', { source })\n\t\t\t\t\tif (!(editor.inputs.shiftKey || editor.inputs.ctrlKey)) {\n\t\t\t\t\t\tconst currentTool = editor.root.getCurrent()\n\t\t\t\t\t\tif (currentTool && currentTool.getCurrent()?.id === 'idle') {\n\t\t\t\t\t\t\teditor.setCurrentTool('zoom', { onInteractionEnd: currentTool.id, maskAs: 'zoom' })\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'convert-to-bookmark',\n\t\t\t\tlabel: 'action.convert-to-bookmark',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\teditor.batch(() => {\n\t\t\t\t\t\ttrackEvent('convert-to-bookmark', { source })\n\t\t\t\t\t\tconst shapes = editor.getSelectedShapes()\n\n\t\t\t\t\t\tconst createList: TLShapePartial[] = []\n\t\t\t\t\t\tconst deleteList: TLShapeId[] = []\n\t\t\t\t\t\tfor (const shape of shapes) {\n\t\t\t\t\t\t\tif (!shape || !editor.isShapeOfType<TLEmbedShape>(shape, 'embed') || !shape.props.url)\n\t\t\t\t\t\t\t\tcontinue\n\n\t\t\t\t\t\t\tconst newPos = new Vec2d(shape.x, shape.y)\n\t\t\t\t\t\t\tnewPos.rot(-shape.rotation)\n\t\t\t\t\t\t\tnewPos.add(new Vec2d(shape.props.w / 2 - 300 / 2, shape.props.h / 2 - 320 / 2)) // see bookmark shape util\n\t\t\t\t\t\t\tnewPos.rot(shape.rotation)\n\t\t\t\t\t\t\tconst partial: TLShapePartial<TLBookmarkShape> = {\n\t\t\t\t\t\t\t\tid: createShapeId(),\n\t\t\t\t\t\t\t\ttype: 'bookmark',\n\t\t\t\t\t\t\t\trotation: shape.rotation,\n\t\t\t\t\t\t\t\tx: newPos.x,\n\t\t\t\t\t\t\t\ty: newPos.y,\n\t\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\t\t\turl: shape.props.url,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcreateList.push(partial)\n\t\t\t\t\t\t\tdeleteList.push(shape.id)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\teditor.mark('convert shapes to bookmark')\n\t\t\t\t\t\teditor.deleteShapes(deleteList)\n\t\t\t\t\t\teditor.createShapes(createList)\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'convert-to-embed',\n\t\t\t\tlabel: 'action.convert-to-embed',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('convert-to-embed', { source })\n\n\t\t\t\t\teditor.batch(() => {\n\t\t\t\t\t\tconst ids = editor.getSelectedShapeIds()\n\t\t\t\t\t\tconst shapes = compact(ids.map((id) => editor.getShape(id)))\n\n\t\t\t\t\t\tconst createList: TLShapePartial[] = []\n\t\t\t\t\t\tconst deleteList: TLShapeId[] = []\n\t\t\t\t\t\tfor (const shape of shapes) {\n\t\t\t\t\t\t\tif (!editor.isShapeOfType<TLBookmarkShape>(shape, 'bookmark')) continue\n\n\t\t\t\t\t\t\tconst { url } = shape.props\n\n\t\t\t\t\t\t\tconst embedInfo = getEmbedInfo(shape.props.url)\n\n\t\t\t\t\t\t\tif (!embedInfo) continue\n\t\t\t\t\t\t\tif (!embedInfo.definition) continue\n\n\t\t\t\t\t\t\tconst { width, height } = embedInfo.definition\n\n\t\t\t\t\t\t\tconst newPos = new Vec2d(shape.x, shape.y)\n\t\t\t\t\t\t\tnewPos.rot(-shape.rotation)\n\t\t\t\t\t\t\tnewPos.add(new Vec2d(shape.props.w / 2 - width / 2, shape.props.h / 2 - height / 2))\n\t\t\t\t\t\t\tnewPos.rot(shape.rotation)\n\n\t\t\t\t\t\t\tconst shapeToCreate: TLShapePartial<TLEmbedShape> = {\n\t\t\t\t\t\t\t\tid: createShapeId(),\n\t\t\t\t\t\t\t\ttype: 'embed',\n\t\t\t\t\t\t\t\tx: newPos.x,\n\t\t\t\t\t\t\t\ty: newPos.y,\n\t\t\t\t\t\t\t\trotation: shape.rotation,\n\t\t\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\t\t\turl: url,\n\t\t\t\t\t\t\t\t\tw: width,\n\t\t\t\t\t\t\t\t\th: height,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcreateList.push(shapeToCreate)\n\t\t\t\t\t\t\tdeleteList.push(shape.id)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\teditor.mark('convert shapes to embed')\n\t\t\t\t\t\teditor.deleteShapes(deleteList)\n\t\t\t\t\t\teditor.createShapes(createList)\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'duplicate',\n\t\t\t\tkbd: '$d',\n\t\t\t\tlabel: 'action.duplicate',\n\t\t\t\ticon: 'duplicate',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('duplicate-shapes', { source })\n\t\t\t\t\tconst ids = editor.getSelectedShapeIds()\n\t\t\t\t\tconst commonBounds = Box2d.Common(compact(ids.map((id) => editor.getShapePageBounds(id))))\n\t\t\t\t\tconst offset = editor.getInstanceState().canMoveCamera\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tx: commonBounds.width + 10,\n\t\t\t\t\t\t\t\ty: 0,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\tx: 16 / editor.getZoomLevel(),\n\t\t\t\t\t\t\t\ty: 16 / editor.getZoomLevel(),\n\t\t\t\t\t\t }\n\t\t\t\t\teditor.mark('duplicate shapes')\n\t\t\t\t\teditor.duplicateShapes(ids, offset)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'ungroup',\n\t\t\t\tlabel: 'action.ungroup',\n\t\t\t\tkbd: '$!g',\n\t\t\t\ticon: 'ungroup',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('ungroup-shapes', { source })\n\t\t\t\t\teditor.mark('ungroup')\n\t\t\t\t\teditor.ungroupShapes(editor.getSelectedShapeIds())\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'group',\n\t\t\t\tlabel: 'action.group',\n\t\t\t\tkbd: '$g',\n\t\t\t\ticon: 'group',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('group-shapes', { source })\n\t\t\t\t\tconst onlySelectedShape = editor.getOnlySelectedShape()\n\t\t\t\t\tif (onlySelectedShape && editor.isShapeOfType<TLGroupShape>(onlySelectedShape, 'group')) {\n\t\t\t\t\t\teditor.mark('ungroup')\n\t\t\t\t\t\teditor.ungroupShapes(editor.getSelectedShapeIds())\n\t\t\t\t\t} else {\n\t\t\t\t\t\teditor.mark('group')\n\t\t\t\t\t\teditor.groupShapes(editor.getSelectedShapeIds())\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'remove-frame',\n\t\t\t\tlabel: 'action.remove-frame',\n\t\t\t\tkbd: '$!f',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\n\t\t\t\t\ttrackEvent('remove-frame', { source })\n\t\t\t\t\tconst selectedShapes = editor.getSelectedShapes()\n\t\t\t\t\tif (\n\t\t\t\t\t\tselectedShapes.length > 0 &&\n\t\t\t\t\t\tselectedShapes.every((shape) => editor.isShapeOfType<TLFrameShape>(shape, 'frame'))\n\t\t\t\t\t) {\n\t\t\t\t\t\teditor.mark('remove-frame')\n\t\t\t\t\t\tremoveFrame(\n\t\t\t\t\t\t\teditor,\n\t\t\t\t\t\t\tselectedShapes.map((shape) => shape.id)\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'fit-frame-to-content',\n\t\t\t\tlabel: 'action.fit-frame-to-content',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\n\t\t\t\t\ttrackEvent('fit-frame-to-content', { source })\n\t\t\t\t\tconst onlySelectedShape = editor.getOnlySelectedShape()\n\t\t\t\t\tif (onlySelectedShape && editor.isShapeOfType<TLFrameShape>(onlySelectedShape, 'frame')) {\n\t\t\t\t\t\teditor.mark('fit-frame-to-content')\n\t\t\t\t\t\tfitFrameToContent(editor, onlySelectedShape.id)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'align-left',\n\t\t\t\tlabel: 'action.align-left',\n\t\t\t\tkbd: '?A',\n\t\t\t\ticon: 'align-left',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('align-shapes', { operation: 'left', source })\n\t\t\t\t\teditor.mark('align left')\n\t\t\t\t\teditor.alignShapes(editor.getSelectedShapeIds(), 'left')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'align-center-horizontal',\n\t\t\t\tlabel: 'action.align-center-horizontal',\n\t\t\t\tcontextMenuLabel: 'action.align-center-horizontal.short',\n\t\t\t\tkbd: '?H',\n\t\t\t\ticon: 'align-center-horizontal',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('align-shapes', { operation: 'center-horizontal', source })\n\t\t\t\t\teditor.mark('align center horizontal')\n\t\t\t\t\teditor.alignShapes(editor.getSelectedShapeIds(), 'center-horizontal')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'align-right',\n\t\t\t\tlabel: 'action.align-right',\n\t\t\t\tkbd: '?D',\n\t\t\t\ticon: 'align-right',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('align-shapes', { operation: 'right', source })\n\t\t\t\t\teditor.mark('align right')\n\t\t\t\t\teditor.alignShapes(editor.getSelectedShapeIds(), 'right')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'align-center-vertical',\n\t\t\t\tlabel: 'action.align-center-vertical',\n\t\t\t\tcontextMenuLabel: 'action.align-center-vertical.short',\n\t\t\t\tkbd: '?V',\n\t\t\t\ticon: 'align-center-vertical',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('align-shapes', { operation: 'center-vertical', source })\n\t\t\t\t\teditor.mark('align center vertical')\n\t\t\t\t\teditor.alignShapes(editor.getSelectedShapeIds(), 'center-vertical')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'align-top',\n\t\t\t\tlabel: 'action.align-top',\n\t\t\t\ticon: 'align-top',\n\t\t\t\tkbd: '?W',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('align-shapes', { operation: 'top', source })\n\t\t\t\t\teditor.mark('align top')\n\t\t\t\t\teditor.alignShapes(editor.getSelectedShapeIds(), 'top')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'align-bottom',\n\t\t\t\tlabel: 'action.align-bottom',\n\t\t\t\ticon: 'align-bottom',\n\t\t\t\tkbd: '?S',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('align-shapes', { operation: 'bottom', source })\n\t\t\t\t\teditor.mark('align bottom')\n\t\t\t\t\teditor.alignShapes(editor.getSelectedShapeIds(), 'bottom')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'distribute-horizontal',\n\t\t\t\tlabel: 'action.distribute-horizontal',\n\t\t\t\tcontextMenuLabel: 'action.distribute-horizontal.short',\n\t\t\t\ticon: 'distribute-horizontal',\n\t\t\t\tkbd: '?!h',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('distribute-shapes', { operation: 'horizontal', source })\n\t\t\t\t\teditor.mark('distribute horizontal')\n\t\t\t\t\teditor.distributeShapes(editor.getSelectedShapeIds(), 'horizontal')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'distribute-vertical',\n\t\t\t\tlabel: 'action.distribute-vertical',\n\t\t\t\tcontextMenuLabel: 'action.distribute-vertical.short',\n\t\t\t\ticon: 'distribute-vertical',\n\t\t\t\tkbd: '?!V',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('distribute-shapes', { operation: 'vertical', source })\n\t\t\t\t\teditor.mark('distribute vertical')\n\t\t\t\t\teditor.distributeShapes(editor.getSelectedShapeIds(), 'vertical')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'stretch-horizontal',\n\t\t\t\tlabel: 'action.stretch-horizontal',\n\t\t\t\tcontextMenuLabel: 'action.stretch-horizontal.short',\n\t\t\t\ticon: 'stretch-horizontal',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('stretch-shapes', { operation: 'horizontal', source })\n\t\t\t\t\teditor.mark('stretch horizontal')\n\t\t\t\t\teditor.stretchShapes(editor.getSelectedShapeIds(), 'horizontal')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'stretch-vertical',\n\t\t\t\tlabel: 'action.stretch-vertical',\n\t\t\t\tcontextMenuLabel: 'action.stretch-vertical.short',\n\t\t\t\ticon: 'stretch-vertical',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('stretch-shapes', { operation: 'vertical', source })\n\t\t\t\t\teditor.mark('stretch vertical')\n\t\t\t\t\teditor.stretchShapes(editor.getSelectedShapeIds(), 'vertical')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'flip-horizontal',\n\t\t\t\tlabel: 'action.flip-horizontal',\n\t\t\t\tcontextMenuLabel: 'action.flip-horizontal.short',\n\t\t\t\tkbd: '!h',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('flip-shapes', { operation: 'horizontal', source })\n\t\t\t\t\teditor.mark('flip horizontal')\n\t\t\t\t\teditor.flipShapes(editor.getSelectedShapeIds(), 'horizontal')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'flip-vertical',\n\t\t\t\tlabel: 'action.flip-vertical',\n\t\t\t\tcontextMenuLabel: 'action.flip-vertical.short',\n\t\t\t\tkbd: '!v',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('flip-shapes', { operation: 'vertical', source })\n\t\t\t\t\teditor.mark('flip vertical')\n\t\t\t\t\teditor.flipShapes(editor.getSelectedShapeIds(), 'vertical')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'pack',\n\t\t\t\tlabel: 'action.pack',\n\t\t\t\ticon: 'pack',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('pack-shapes', { source })\n\t\t\t\t\teditor.mark('pack')\n\t\t\t\t\teditor.packShapes(editor.getSelectedShapeIds(), 16)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'stack-vertical',\n\t\t\t\tlabel: 'action.stack-vertical',\n\t\t\t\tcontextMenuLabel: 'action.stack-vertical.short',\n\t\t\t\ticon: 'stack-vertical',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('stack-shapes', { operation: 'vertical', source })\n\t\t\t\t\teditor.mark('stack-vertical')\n\t\t\t\t\teditor.stackShapes(editor.getSelectedShapeIds(), 'vertical', 16)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'stack-horizontal',\n\t\t\t\tlabel: 'action.stack-horizontal',\n\t\t\t\tcontextMenuLabel: 'action.stack-horizontal.short',\n\t\t\t\ticon: 'stack-horizontal',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('stack-shapes', { operation: 'horizontal', source })\n\t\t\t\t\teditor.mark('stack-horizontal')\n\t\t\t\t\teditor.stackShapes(editor.getSelectedShapeIds(), 'horizontal', 16)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'bring-to-front',\n\t\t\t\tlabel: 'action.bring-to-front',\n\t\t\t\tkbd: ']',\n\t\t\t\ticon: 'bring-to-front',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('reorder-shapes', { operation: 'toFront', source })\n\t\t\t\t\teditor.mark('bring to front')\n\t\t\t\t\teditor.bringToFront(editor.getSelectedShapeIds())\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'bring-forward',\n\t\t\t\tlabel: 'action.bring-forward',\n\t\t\t\ticon: 'bring-forward',\n\t\t\t\tkbd: '?]',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('reorder-shapes', { operation: 'forward', source })\n\t\t\t\t\teditor.mark('bring forward')\n\t\t\t\t\teditor.bringForward(editor.getSelectedShapeIds())\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'send-backward',\n\t\t\t\tlabel: 'action.send-backward',\n\t\t\t\ticon: 'send-backward',\n\t\t\t\tkbd: '?[',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('reorder-shapes', { operation: 'backward', source })\n\t\t\t\t\teditor.mark('send backward')\n\t\t\t\t\teditor.sendBackward(editor.getSelectedShapeIds())\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'send-to-back',\n\t\t\t\tlabel: 'action.send-to-back',\n\t\t\t\ticon: 'send-to-back',\n\t\t\t\tkbd: '[',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('reorder-shapes', { operation: 'toBack', source })\n\t\t\t\t\teditor.mark('send to back')\n\t\t\t\t\teditor.sendToBack(editor.getSelectedShapeIds())\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'cut',\n\t\t\t\tlabel: 'action.cut',\n\t\t\t\tkbd: '$x',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\teditor.mark('cut')\n\t\t\t\t\tcut(source)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'copy',\n\t\t\t\tlabel: 'action.copy',\n\t\t\t\tkbd: '$c',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\tcopy(source)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'paste',\n\t\t\t\tlabel: 'action.paste',\n\t\t\t\tkbd: '$v',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tnavigator.clipboard?.read().then((clipboardItems) => {\n\t\t\t\t\t\tpaste(\n\t\t\t\t\t\t\tclipboardItems,\n\t\t\t\t\t\t\tsource,\n\t\t\t\t\t\t\tsource === 'context-menu' ? editor.inputs.currentPagePoint : undefined\n\t\t\t\t\t\t)\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'select-all',\n\t\t\t\tlabel: 'action.select-all',\n\t\t\t\tkbd: '$a',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\teditor.batch(() => {\n\t\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\t\ttrackEvent('select-all-shapes', { source })\n\n\t\t\t\t\t\teditor.mark('select all kbd')\n\t\t\t\t\t\teditor.selectAll()\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'select-none',\n\t\t\t\tlabel: 'action.select-none',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('select-none-shapes', { source })\n\t\t\t\t\teditor.mark('select none')\n\t\t\t\t\teditor.selectNone()\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'delete',\n\t\t\t\tlabel: 'action.delete',\n\t\t\t\tkbd: '\u232B,del,backspace',\n\t\t\t\ticon: 'trash',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('delete-shapes', { source })\n\t\t\t\t\teditor.mark('delete')\n\t\t\t\t\teditor.deleteShapes(editor.getSelectedShapeIds())\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'rotate-cw',\n\t\t\t\tlabel: 'action.rotate-cw',\n\t\t\t\ticon: 'rotate-cw',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('rotate-cw', { source })\n\t\t\t\t\teditor.mark('rotate-cw')\n\t\t\t\t\tconst offset = editor.getSelectionRotation() % (TAU / 2)\n\t\t\t\t\tconst dontUseOffset = approximately(offset, 0) || approximately(offset, TAU / 2)\n\t\t\t\t\teditor.rotateShapesBy(\n\t\t\t\t\t\teditor.getSelectedShapeIds(),\n\t\t\t\t\t\tTAU / 2 - (dontUseOffset ? 0 : offset)\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'rotate-ccw',\n\t\t\t\tlabel: 'action.rotate-ccw',\n\t\t\t\ticon: 'rotate-ccw',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('rotate-ccw', { source })\n\t\t\t\t\teditor.mark('rotate-ccw')\n\t\t\t\t\tconst offset = editor.getSelectionRotation() % (TAU / 2)\n\t\t\t\t\tconst offsetCloseToZero = approximately(offset, 0)\n\t\t\t\t\teditor.rotateShapesBy(\n\t\t\t\t\t\teditor.getSelectedShapeIds(),\n\t\t\t\t\t\toffsetCloseToZero ? -(TAU / 2) : -offset\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'zoom-in',\n\t\t\t\tlabel: 'action.zoom-in',\n\t\t\t\tkbd: '$=,=',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('zoom-in', { source })\n\t\t\t\t\teditor.zoomIn(editor.getViewportScreenCenter(), { duration: ANIMATION_MEDIUM_MS })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'zoom-out',\n\t\t\t\tlabel: 'action.zoom-out',\n\t\t\t\tkbd: '$-,-',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('zoom-out', { source })\n\t\t\t\t\teditor.zoomOut(editor.getViewportScreenCenter(), { duration: ANIMATION_MEDIUM_MS })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'zoom-to-100',\n\t\t\t\tlabel: 'action.zoom-to-100',\n\t\t\t\ticon: 'reset-zoom',\n\t\t\t\tkbd: '!0',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('reset-zoom', { source })\n\t\t\t\t\teditor.resetZoom(editor.getViewportScreenCenter(), { duration: ANIMATION_MEDIUM_MS })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'zoom-to-fit',\n\t\t\t\tlabel: 'action.zoom-to-fit',\n\t\t\t\tkbd: '!1',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('zoom-to-fit', { source })\n\t\t\t\t\teditor.zoomToFit({ duration: ANIMATION_MEDIUM_MS })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'zoom-to-selection',\n\t\t\t\tlabel: 'action.zoom-to-selection',\n\t\t\t\tkbd: '!2',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!hasSelectedShapes()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('zoom-to-selection', { source })\n\t\t\t\t\teditor.zoomToSelection({ duration: ANIMATION_MEDIUM_MS })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-snap-mode',\n\t\t\t\tlabel: 'action.toggle-snap-mode',\n\t\t\t\tmenuLabel: 'action.toggle-snap-mode.menu',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('toggle-snap-mode', { source })\n\t\t\t\t\teditor.user.updateUserPreferences({ isSnapMode: !editor.user.getIsSnapMode() })\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-dark-mode',\n\t\t\t\tlabel: 'action.toggle-dark-mode',\n\t\t\t\tmenuLabel: 'action.toggle-dark-mode.menu',\n\t\t\t\tkbd: '$/',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('toggle-dark-mode', { source })\n\t\t\t\t\teditor.user.updateUserPreferences({ isDarkMode: !editor.user.getIsDarkMode() })\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-reduce-motion',\n\t\t\t\tlabel: 'action.toggle-reduce-motion',\n\t\t\t\tmenuLabel: 'action.toggle-reduce-motion.menu',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('toggle-reduce-motion', { source })\n\t\t\t\t\teditor.user.updateUserPreferences({\n\t\t\t\t\t\tanimationSpeed: editor.user.getAnimationSpeed() === 0 ? 1 : 0,\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-edge-scrolling',\n\t\t\t\tlabel: 'action.toggle-edge-scrolling',\n\t\t\t\tmenuLabel: 'action.toggle-edge-scrolling.menu',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('toggle-edge-scrolling', { source })\n\t\t\t\t\teditor.user.updateUserPreferences({\n\t\t\t\t\t\tedgeScrollSpeed: editor.user.getEdgeScrollSpeed() === 0 ? 1 : 0,\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-transparent',\n\t\t\t\tlabel: 'action.toggle-transparent',\n\t\t\t\tmenuLabel: 'action.toggle-transparent.menu',\n\t\t\t\tcontextMenuLabel: 'action.toggle-transparent.context-menu',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('toggle-transparent', { source })\n\t\t\t\t\teditor.updateInstanceState(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\texportBackground: !editor.getInstanceState().exportBackground,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ ephemeral: true }\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-tool-lock',\n\t\t\t\tlabel: 'action.toggle-tool-lock',\n\t\t\t\tmenuLabel: 'action.toggle-tool-lock.menu',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tkbd: 'q',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('toggle-tool-lock', { source })\n\t\t\t\t\teditor.updateInstanceState({ isToolLocked: !editor.getInstanceState().isToolLocked })\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'unlock-all',\n\t\t\t\tlabel: 'action.unlock-all',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('unlock-all', { source })\n\t\t\t\t\tconst updates = [] as TLShapePartial[]\n\t\t\t\t\tfor (const shape of editor.getCurrentPageShapes()) {\n\t\t\t\t\t\tif (shape.isLocked) {\n\t\t\t\t\t\t\tupdates.push({ id: shape.id, type: shape.type, isLocked: false })\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (updates.length > 0) {\n\t\t\t\t\t\teditor.updateShapes(updates)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-focus-mode',\n\t\t\t\tlabel: 'action.toggle-focus-mode',\n\t\t\t\tmenuLabel: 'action.toggle-focus-mode.menu',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tkbd: '$.',\n\t\t\t\tcheckbox: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\t// this needs to be deferred because it causes the menu\n\t\t\t\t\t// UI to unmount which puts us in a dodgy state\n\t\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\t\teditor.batch(() => {\n\t\t\t\t\t\t\ttrackEvent('toggle-focus-mode', { source })\n\t\t\t\t\t\t\tclearDialogs()\n\t\t\t\t\t\t\tclearToasts()\n\t\t\t\t\t\t\teditor.updateInstanceState({ isFocusMode: !editor.getInstanceState().isFocusMode })\n\t\t\t\t\t\t})\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-grid',\n\t\t\t\tlabel: 'action.toggle-grid',\n\t\t\t\tmenuLabel: 'action.toggle-grid.menu',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tkbd: \"$'\",\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('toggle-grid-mode', { source })\n\t\t\t\t\teditor.updateInstanceState({ isGridMode: !editor.getInstanceState().isGridMode })\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-debug-mode',\n\t\t\t\tlabel: 'action.toggle-debug-mode',\n\t\t\t\tmenuLabel: 'action.toggle-debug-mode.menu',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('toggle-debug-mode', { source })\n\t\t\t\t\teditor.updateInstanceState({\n\t\t\t\t\t\tisDebugMode: !editor.getInstanceState().isDebugMode,\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'print',\n\t\t\t\tlabel: 'action.print',\n\t\t\t\tkbd: '$p',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('print', { source })\n\t\t\t\t\tprintSelectionOrPages()\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'exit-pen-mode',\n\t\t\t\tlabel: 'action.exit-pen-mode',\n\t\t\t\ticon: 'cross-2',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('exit-pen-mode', { source })\n\t\t\t\t\teditor.updateInstanceState({ isPenMode: false })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'stop-following',\n\t\t\t\tlabel: 'action.stop-following',\n\t\t\t\ticon: 'cross-2',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('stop-following', { source })\n\t\t\t\t\teditor.stopFollowingUser()\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'back-to-content',\n\t\t\t\tlabel: 'action.back-to-content',\n\t\t\t\ticon: 'arrow-left',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('zoom-to-content', { source })\n\t\t\t\t\teditor.zoomToContent()\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-lock',\n\t\t\t\tlabel: 'action.toggle-lock',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tkbd: '!l',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\teditor.mark('locking')\n\t\t\t\t\ttrackEvent('toggle-lock', { source })\n\t\t\t\t\teditor.toggleLock(editor.getSelectedShapeIds())\n\t\t\t\t},\n\t\t\t},\n\t\t]\n\n\t\tconst actions = makeActions(actionItems)\n\n\t\tif (overrides) {\n\t\t\treturn overrides(editor, actions, undefined)\n\t\t}\n\n\t\treturn actions\n\t}, [\n\t\teditor,\n\t\ttrackEvent,\n\t\toverrides,\n\t\taddDialog,\n\t\tinsertMedia,\n\t\texportAs,\n\t\tcopyAs,\n\t\tcut,\n\t\tcopy,\n\t\tpaste,\n\t\tclearDialogs,\n\t\tclearToasts,\n\t\tprintSelectionOrPages,\n\t])\n\n\treturn <ActionsContext.Provider value={asActions(actions)}>{children}</ActionsContext.Provider>\n}\n\n/** @public */\nexport function useActions() {\n\tconst ctx = React.useContext(ActionsContext)\n\n\tif (!ctx) {\n\t\tthrow new Error('useTools must be used within a ToolProvider')\n\t}\n\n\treturn ctx\n}\n\nfunction asActions<T extends Record<string, TLUiActionItem>>(actions: T) {\n\treturn actions as Record<keyof typeof actions, TLUiActionItem>\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwpCQ;AAxpCR,oBAkBO;AACP,YAAuB;AACvB,oBAA6B;AAC7B,oBAA+C;AAC/C,4BAA+B;AAC/B,yBAA4B;AAE5B,gCAAuC;AACvC,uBAA0B;AAC1B,gCAA2B;AAC3B,+BAA6C;AAC7C,yBAA4B;AAC5B,4BAA+B;AAC/B,sBAAyB;AACzB,+BAA0B;AAyBnB,MAAM,iBAAiB,MAAM,cAAsC,CAAC,CAAC;AAY5E,SAAS,YAAY,SAA2B;AAC/C,SAAO,OAAO,YAAY,QAAQ,IAAI,CAAC,WAAW,CAAC,OAAO,IAAI,MAAM,CAAC,CAAC;AACvE;AAGO,SAAS,gBAAgB,EAAE,WAAW,SAAS,GAAyB;AAC9E,QAAM,aAAS,yBAAU;AAEzB,QAAM,EAAE,WAAW,aAAa,QAAI,sCAAW;AAC/C,QAAM,EAAE,YAAY,QAAI,oCAAU;AAElC,QAAM,kBAAc,sCAAe;AACnC,QAAM,4BAAwB,0BAAS;AACvC,QAAM,EAAE,KAAK,MAAM,MAAM,QAA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,EACD,CAAC;AAED,SAAO,4CAAC,eAAe,UAAf,EAAwB,OAAO,UAAU,OAAO,GAAI,UAAS;AACtE;AAGO,SAAS,aAAa;AAC5B,QAAM,MAAM,MAAM,WAAW,cAAc;AAE3C,MAAI,CAAC,KAAK;AACT,UAAM,IAAI,MAAM,6CAA6C;AAAA,EAC9D;AAEA,SAAO;AACR;AAEA,SAAS,UAAoD,SAAY;AACxE,SAAO;AACR;",
6
6
  "names": ["actions"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/lib/ui/hooks/useEventsProvider.tsx"],
4
- "sourcesContent": ["import * as React from 'react'\n\n/** @public */\nexport type TLUiEventSource =\n\t| 'menu'\n\t| 'context-menu'\n\t| 'zoom-menu'\n\t| 'navigation-zone'\n\t| 'quick-actions'\n\t| 'actions-menu'\n\t| 'kbd'\n\t| 'debug-panel'\n\t| 'page-menu'\n\t| 'share-menu'\n\t| 'export-menu'\n\t| 'toolbar'\n\t| 'people-menu'\n\t| 'dialog'\n\t| 'help-menu'\n\t| 'helper-buttons'\n\t| 'unknown'\n\n/** @public */\nexport interface TLUiEventMap {\n\t// Actions\n\tundo: null\n\tredo: null\n\t'group-shapes': null\n\t'ungroup-shapes': null\n\t'remove-frame': null\n\t'fit-frame-to-content': null\n\t'convert-to-embed': null\n\t'convert-to-bookmark': null\n\t'open-embed-link': null\n\t'toggle-auto-size': null\n\t'copy-as': { format: 'svg' | 'png' | 'json' }\n\t'export-as': { format: 'svg' | 'png' | 'json' }\n\t'edit-link': null\n\t'insert-embed': null\n\t'insert-media': null\n\t'align-shapes': {\n\t\toperation: 'left' | 'center-horizontal' | 'right' | 'top' | 'center-vertical' | 'bottom'\n\t}\n\t'duplicate-shapes': null\n\t'pack-shapes': null\n\t'stack-shapes': { operation: 'horizontal' | 'vertical' }\n\t'flip-shapes': { operation: 'horizontal' | 'vertical' }\n\t'distribute-shapes': { operation: 'horizontal' | 'vertical' }\n\t'stretch-shapes': { operation: 'horizontal' | 'vertical' }\n\t'reorder-shapes': {\n\t\toperation: 'toBack' | 'toFront' | 'forward' | 'backward'\n\t}\n\t'delete-shapes': null\n\t'select-all-shapes': null\n\t'select-none-shapes': null\n\t'rotate-ccw': null\n\t'rotate-cw': null\n\t'zoom-in': null\n\t'zoom-out': null\n\t'zoom-to-fit': null\n\t'zoom-to-selection': null\n\t'reset-zoom': null\n\t'zoom-into-view': null\n\t'zoom-to-content': null\n\t'open-menu': { id: string }\n\t'close-menu': { id: string }\n\t'create-new-project': null\n\t'save-project-to-file': null\n\t'open-file': null\n\t'select-tool': { id: string }\n\tprint: null\n\tcopy: null\n\tpaste: null\n\tcut: null\n\t'toggle-transparent': null\n\t'toggle-snap-mode': null\n\t'toggle-tool-lock': null\n\t'toggle-grid-mode': null\n\t'toggle-dark-mode': null\n\t'toggle-focus-mode': null\n\t'toggle-debug-mode': null\n\t'toggle-lock': null\n\t'toggle-reduce-motion': null\n\t'exit-pen-mode': null\n\t'stop-following': null\n\t'open-cursor-chat': null\n\t'zoom-tool': null\n\t'unlock-all': null\n}\n\ntype Join<T, K> = K extends null\n\t? { [R in keyof T]: T[R] }\n\t: { [R in keyof T]: T[R] } & { [R in keyof K]: K[R] }\n\n/** @public */\nexport type TLUiEventHandler<T extends keyof TLUiEventMap = keyof TLUiEventMap> = (\n\tname: T,\n\tdata: Join<{ source: TLUiEventSource }, TLUiEventMap[T]>\n) => void\n\n/** @internal */\nconst defaultEventHandler: TLUiEventHandler = () => void null\n\n/** @public */\nexport type TLUiEventContextType = TLUiEventHandler<keyof TLUiEventMap>\n\n/** @internal */\nexport const EventsContext = React.createContext<TLUiEventContextType>({} as TLUiEventContextType)\n\n/** @public */\nexport type EventsProviderProps = {\n\tonEvent?: TLUiEventHandler\n\tchildren: any\n}\n\n/** @public */\nexport function UiEventsProvider({ onEvent, children }: EventsProviderProps) {\n\treturn (\n\t\t<EventsContext.Provider value={onEvent ?? defaultEventHandler}>\n\t\t\t{children}\n\t\t</EventsContext.Provider>\n\t)\n}\n\n/** @public */\nexport function useUiEvents() {\n\tconst eventHandler = React.useContext(EventsContext)\n\treturn eventHandler ?? defaultEventHandler\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsHE;AAtHF,YAAuB;AAqGvB,MAAM,sBAAwC,MAAM;AAM7C,MAAM,gBAAgB,MAAM,cAAoC,CAAC,CAAyB;AAS1F,SAAS,iBAAiB,EAAE,SAAS,SAAS,GAAwB;AAC5E,SACC,4CAAC,cAAc,UAAd,EAAuB,OAAO,WAAW,qBACxC,UACF;AAEF;AAGO,SAAS,cAAc;AAC7B,QAAM,eAAe,MAAM,WAAW,aAAa;AACnD,SAAO,gBAAgB;AACxB;",
4
+ "sourcesContent": ["import * as React from 'react'\n\n/** @public */\nexport type TLUiEventSource =\n\t| 'menu'\n\t| 'context-menu'\n\t| 'zoom-menu'\n\t| 'navigation-zone'\n\t| 'quick-actions'\n\t| 'actions-menu'\n\t| 'kbd'\n\t| 'debug-panel'\n\t| 'page-menu'\n\t| 'share-menu'\n\t| 'export-menu'\n\t| 'toolbar'\n\t| 'people-menu'\n\t| 'dialog'\n\t| 'help-menu'\n\t| 'helper-buttons'\n\t| 'unknown'\n\n/** @public */\nexport interface TLUiEventMap {\n\t// Actions\n\tundo: null\n\tredo: null\n\t'group-shapes': null\n\t'ungroup-shapes': null\n\t'remove-frame': null\n\t'fit-frame-to-content': null\n\t'convert-to-embed': null\n\t'convert-to-bookmark': null\n\t'open-embed-link': null\n\t'toggle-auto-size': null\n\t'copy-as': { format: 'svg' | 'png' | 'json' }\n\t'export-as': { format: 'svg' | 'png' | 'json' }\n\t'edit-link': null\n\t'insert-embed': null\n\t'insert-media': null\n\t'align-shapes': {\n\t\toperation: 'left' | 'center-horizontal' | 'right' | 'top' | 'center-vertical' | 'bottom'\n\t}\n\t'duplicate-shapes': null\n\t'pack-shapes': null\n\t'stack-shapes': { operation: 'horizontal' | 'vertical' }\n\t'flip-shapes': { operation: 'horizontal' | 'vertical' }\n\t'distribute-shapes': { operation: 'horizontal' | 'vertical' }\n\t'stretch-shapes': { operation: 'horizontal' | 'vertical' }\n\t'reorder-shapes': {\n\t\toperation: 'toBack' | 'toFront' | 'forward' | 'backward'\n\t}\n\t'delete-shapes': null\n\t'select-all-shapes': null\n\t'select-none-shapes': null\n\t'rotate-ccw': null\n\t'rotate-cw': null\n\t'zoom-in': null\n\t'zoom-out': null\n\t'zoom-to-fit': null\n\t'zoom-to-selection': null\n\t'reset-zoom': null\n\t'zoom-into-view': null\n\t'zoom-to-content': null\n\t'open-menu': { id: string }\n\t'close-menu': { id: string }\n\t'create-new-project': null\n\t'save-project-to-file': null\n\t'open-file': null\n\t'select-tool': { id: string }\n\tprint: null\n\tcopy: null\n\tpaste: null\n\tcut: null\n\t'toggle-transparent': null\n\t'toggle-snap-mode': null\n\t'toggle-tool-lock': null\n\t'toggle-grid-mode': null\n\t'toggle-dark-mode': null\n\t'toggle-focus-mode': null\n\t'toggle-debug-mode': null\n\t'toggle-lock': null\n\t'toggle-reduce-motion': null\n\t'toggle-edge-scrolling': null\n\t'exit-pen-mode': null\n\t'stop-following': null\n\t'open-cursor-chat': null\n\t'zoom-tool': null\n\t'unlock-all': null\n}\n\ntype Join<T, K> = K extends null\n\t? { [R in keyof T]: T[R] }\n\t: { [R in keyof T]: T[R] } & { [R in keyof K]: K[R] }\n\n/** @public */\nexport type TLUiEventHandler<T extends keyof TLUiEventMap = keyof TLUiEventMap> = (\n\tname: T,\n\tdata: Join<{ source: TLUiEventSource }, TLUiEventMap[T]>\n) => void\n\n/** @internal */\nconst defaultEventHandler: TLUiEventHandler = () => void null\n\n/** @public */\nexport type TLUiEventContextType = TLUiEventHandler<keyof TLUiEventMap>\n\n/** @internal */\nexport const EventsContext = React.createContext<TLUiEventContextType>({} as TLUiEventContextType)\n\n/** @public */\nexport type EventsProviderProps = {\n\tonEvent?: TLUiEventHandler\n\tchildren: any\n}\n\n/** @public */\nexport function UiEventsProvider({ onEvent, children }: EventsProviderProps) {\n\treturn (\n\t\t<EventsContext.Provider value={onEvent ?? defaultEventHandler}>\n\t\t\t{children}\n\t\t</EventsContext.Provider>\n\t)\n}\n\n/** @public */\nexport function useUiEvents() {\n\tconst eventHandler = React.useContext(EventsContext)\n\treturn eventHandler ?? defaultEventHandler\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuHE;AAvHF,YAAuB;AAsGvB,MAAM,sBAAwC,MAAM;AAM7C,MAAM,gBAAgB,MAAM,cAAoC,CAAC,CAAyB;AAS1F,SAAS,iBAAiB,EAAE,SAAS,SAAS,GAAwB;AAC5E,SACC,4CAAC,cAAc,UAAd,EAAuB,OAAO,WAAW,qBACxC,UACF;AAEF;AAGO,SAAS,cAAc;AAC7B,QAAM,eAAe,MAAM,WAAW,aAAa;AACnD,SAAO,gBAAgB;AACxB;",
6
6
  "names": []
7
7
  }
@@ -52,6 +52,9 @@ function TLUiMenuSchemaProvider({ overrides, children }) {
52
52
  const isMobile = breakpoint < 5;
53
53
  const isDarkMode = (0, import_editor.useValue)("isDarkMode", () => editor.user.getIsDarkMode(), [editor]);
54
54
  const animationSpeed = (0, import_editor.useValue)("animationSpeed", () => editor.user.getAnimationSpeed(), [editor]);
55
+ const edgeScrollSpeed = (0, import_editor.useValue)("edgeScrollSpeed", () => editor.user.getEdgeScrollSpeed(), [
56
+ editor
57
+ ]);
55
58
  const isGridMode = (0, import_editor.useValue)("isGridMode", () => editor.getInstanceState().isGridMode, [editor]);
56
59
  const isSnapMode = (0, import_editor.useValue)("isSnapMode", () => editor.user.getIsSnapMode(), [editor]);
57
60
  const isToolLock = (0, import_editor.useValue)("isToolLock", () => editor.getInstanceState().isToolLocked, [editor]);
@@ -202,6 +205,7 @@ function TLUiMenuSchemaProvider({ overrides, children }) {
202
205
  (0, import_menuHelpers.menuItem)(actions["toggle-grid"], { checked: isGridMode }),
203
206
  (0, import_menuHelpers.menuItem)(actions["toggle-dark-mode"], { checked: isDarkMode }),
204
207
  (0, import_menuHelpers.menuItem)(actions["toggle-focus-mode"], { checked: isFocusMode }),
208
+ (0, import_menuHelpers.menuItem)(actions["toggle-edge-scrolling"], { checked: edgeScrollSpeed === 1 }),
205
209
  (0, import_menuHelpers.menuItem)(actions["toggle-reduce-motion"], { checked: animationSpeed === 0 }),
206
210
  (0, import_menuHelpers.menuItem)(actions["toggle-debug-mode"], { checked: isDebugMode })
207
211
  )
@@ -244,6 +248,7 @@ function TLUiMenuSchemaProvider({ overrides, children }) {
244
248
  isFocusMode,
245
249
  exportBackground,
246
250
  isDebugMode,
251
+ edgeScrollSpeed,
247
252
  isZoomedTo100,
248
253
  oneEmbeddableBookmarkSelected,
249
254
  oneEmbedSelected
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/lib/ui/hooks/useMenuSchema.tsx"],
4
- "sourcesContent": ["import { Editor, TLBookmarkShape, TLEmbedShape, useEditor, useValue } from '@bigbluebutton/editor'\nimport React, { useMemo } from 'react'\nimport { getEmbedInfo } from '../../utils/embeds/embeds'\nimport {\n\tTLUiMenuSchema,\n\tcompactMenuItems,\n\tmenuCustom,\n\tmenuGroup,\n\tmenuItem,\n\tmenuSubmenu,\n\tshowMenuPaste,\n\tuseAllowGroup,\n\tuseAllowUngroup,\n} from './menuHelpers'\nimport { useActions } from './useActions'\nimport { useBreakpoint } from './useBreakpoint'\nimport { useCanRedo } from './useCanRedo'\nimport { useCanUndo } from './useCanUndo'\nimport { useHasLinkShapeSelected } from './useHasLinkShapeSelected'\nimport { useShowAutoSizeToggle } from './useShowAutoSizeToggle'\n\n/** @public */\nexport type TLUiMenuSchemaContextType = TLUiMenuSchema\n\n/** @internal */\nexport const TLUiMenuSchemaContext = React.createContext({} as TLUiMenuSchemaContextType)\n\n/** @public */\nexport type TLUiMenuSchemaProviderProps = {\n\toverrides?: (\n\t\teditor: Editor,\n\t\tschema: TLUiMenuSchemaContextType,\n\t\thelpers: {\n\t\t\tactions: ReturnType<typeof useActions>\n\t\t\tnoneSelected: boolean\n\t\t\toneSelected: boolean\n\t\t\ttwoSelected: boolean\n\t\t\tthreeSelected: boolean\n\t\t}\n\t) => TLUiMenuSchemaContextType\n\tchildren: any\n}\n\n/** @internal */\nexport function TLUiMenuSchemaProvider({ overrides, children }: TLUiMenuSchemaProviderProps) {\n\tconst editor = useEditor()\n\tconst actions = useActions()\n\n\tconst breakpoint = useBreakpoint()\n\tconst isMobile = breakpoint < 5\n\n\tconst isDarkMode = useValue('isDarkMode', () => editor.user.getIsDarkMode(), [editor])\n\tconst animationSpeed = useValue('animationSpeed', () => editor.user.getAnimationSpeed(), [editor])\n\tconst isGridMode = useValue('isGridMode', () => editor.getInstanceState().isGridMode, [editor])\n\tconst isSnapMode = useValue('isSnapMode', () => editor.user.getIsSnapMode(), [editor])\n\tconst isToolLock = useValue('isToolLock', () => editor.getInstanceState().isToolLocked, [editor])\n\tconst isFocusMode = useValue('isFocusMode', () => editor.getInstanceState().isFocusMode, [editor])\n\tconst isDebugMode = useValue('isDebugMode', () => editor.getInstanceState().isDebugMode, [editor])\n\tconst exportBackground = useValue(\n\t\t'exportBackground',\n\t\t() => editor.getInstanceState().exportBackground,\n\t\t[editor]\n\t)\n\n\tconst emptyPage = useValue('emptyPage', () => editor.getCurrentPageShapeIds().size === 0, [\n\t\teditor,\n\t])\n\n\tconst selectedCount = useValue('selectedCount', () => editor.getSelectedShapeIds().length, [\n\t\teditor,\n\t])\n\tconst noneSelected = selectedCount === 0\n\tconst oneSelected = selectedCount > 0\n\tconst twoSelected = selectedCount > 1\n\tconst threeSelected = selectedCount > 2\n\n\tconst hasClipboardWrite = Boolean(window.navigator.clipboard?.write)\n\tconst showEditLink = useHasLinkShapeSelected()\n\tconst showAutoSizeToggle = useShowAutoSizeToggle()\n\tconst allowGroup = useAllowGroup()\n\tconst allowUngroup = useAllowUngroup()\n\tconst canUndo = useCanUndo()\n\tconst canRedo = useCanRedo()\n\tconst isZoomedTo100 = useValue('isZoomedTo100', () => editor.getZoomLevel() === 1, [editor])\n\n\tconst oneEmbedSelected = useValue(\n\t\t'oneEmbedSelected',\n\t\t() => {\n\t\t\tconst onlySelectedShape = editor.getOnlySelectedShape()\n\t\t\tif (!onlySelectedShape) return false\n\t\t\treturn !!(\n\t\t\t\teditor.isShapeOfType<TLEmbedShape>(onlySelectedShape, 'embed') &&\n\t\t\t\tonlySelectedShape.props.url &&\n\t\t\t\t!editor.isShapeOrAncestorLocked(onlySelectedShape)\n\t\t\t)\n\t\t},\n\t\t[]\n\t)\n\n\tconst oneEmbeddableBookmarkSelected = useValue(\n\t\t'oneEmbeddableBookmarkSelected',\n\t\t() => {\n\t\t\tconst onlySelectedShape = editor.getOnlySelectedShape()\n\t\t\tif (!onlySelectedShape) return false\n\t\t\treturn !!(\n\t\t\t\teditor.isShapeOfType<TLBookmarkShape>(onlySelectedShape, 'bookmark') &&\n\t\t\t\tonlySelectedShape.props.url &&\n\t\t\t\tgetEmbedInfo(onlySelectedShape.props.url) &&\n\t\t\t\t!editor.isShapeOrAncestorLocked(onlySelectedShape)\n\t\t\t)\n\t\t},\n\t\t[]\n\t)\n\n\tconst menuSchema = useMemo<TLUiMenuSchema>(() => {\n\t\tconst menuSchema: TLUiMenuSchema = compactMenuItems([\n\t\t\tmenuGroup(\n\t\t\t\t'menu',\n\t\t\t\tmenuSubmenu(\n\t\t\t\t\t'file',\n\t\t\t\t\t'menu.file',\n\t\t\t\t\tmenuGroup('print', menuItem(actions['print'], { disabled: emptyPage }))\n\t\t\t\t),\n\t\t\t\tmenuSubmenu(\n\t\t\t\t\t'edit',\n\t\t\t\t\t'menu.edit',\n\t\t\t\t\tmenuGroup(\n\t\t\t\t\t\t'undo-actions',\n\t\t\t\t\t\tmenuItem(actions['undo'], { disabled: !canUndo }),\n\t\t\t\t\t\tmenuItem(actions['redo'], { disabled: !canRedo })\n\t\t\t\t\t),\n\t\t\t\t\tmenuGroup(\n\t\t\t\t\t\t'clipboard-actions',\n\t\t\t\t\t\tmenuItem(actions['cut'], { disabled: noneSelected }),\n\t\t\t\t\t\tmenuItem(actions['copy'], { disabled: noneSelected }),\n\t\t\t\t\t\tmenuItem(actions['paste'], { disabled: !showMenuPaste })\n\t\t\t\t\t),\n\t\t\t\t\tmenuGroup(\n\t\t\t\t\t\t'conversions',\n\t\t\t\t\t\tmenuSubmenu(\n\t\t\t\t\t\t\t'copy-as',\n\t\t\t\t\t\t\t'menu.copy-as',\n\t\t\t\t\t\t\tmenuGroup(\n\t\t\t\t\t\t\t\t'copy-as-group',\n\t\t\t\t\t\t\t\tmenuItem(actions['copy-as-svg'], { disabled: emptyPage }),\n\t\t\t\t\t\t\t\tmenuItem(actions['copy-as-png'], { disabled: emptyPage || !hasClipboardWrite }),\n\t\t\t\t\t\t\t\tmenuItem(actions['copy-as-json'], { disabled: emptyPage })\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tmenuGroup(\n\t\t\t\t\t\t\t\t'export-bg',\n\t\t\t\t\t\t\t\tmenuItem(actions['toggle-transparent'], { checked: !exportBackground })\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tmenuSubmenu(\n\t\t\t\t\t\t\t'export-as',\n\t\t\t\t\t\t\t'menu.export-as',\n\t\t\t\t\t\t\tmenuGroup(\n\t\t\t\t\t\t\t\t'export-as-group',\n\t\t\t\t\t\t\t\tmenuItem(actions['export-as-svg'], { disabled: emptyPage }),\n\t\t\t\t\t\t\t\tmenuItem(actions['export-as-png'], { disabled: emptyPage }),\n\t\t\t\t\t\t\t\tmenuItem(actions['export-as-json'], { disabled: emptyPage })\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tmenuGroup(\n\t\t\t\t\t\t\t\t'export-bg',\n\t\t\t\t\t\t\t\tmenuItem(actions['toggle-transparent'], { checked: !exportBackground })\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\tmenuGroup(\n\t\t\t\t\t\t'set-selection-group',\n\t\t\t\t\t\tmenuItem(actions['select-all'], { disabled: emptyPage }),\n\t\t\t\t\t\tmenuItem(actions['select-none'], { disabled: !oneSelected })\n\t\t\t\t\t),\n\t\t\t\t\tmenuGroup(\n\t\t\t\t\t\t'selection',\n\t\t\t\t\t\tshowAutoSizeToggle && menuItem(actions['toggle-auto-size']),\n\t\t\t\t\t\tshowEditLink && menuItem(actions['edit-link']),\n\t\t\t\t\t\tmenuItem(actions['duplicate'], { disabled: !oneSelected }),\n\t\t\t\t\t\tallowGroup && menuItem(actions['group']),\n\t\t\t\t\t\tallowUngroup && menuItem(actions['ungroup']),\n\t\t\t\t\t\tmenuItem(actions['unlock-all'], { disabled: emptyPage })\n\t\t\t\t\t),\n\t\t\t\t\tmenuGroup('delete-group', menuItem(actions['delete'], { disabled: !oneSelected })),\n\t\t\t\t\tmenuGroup(\n\t\t\t\t\t\t'embeds',\n\t\t\t\t\t\toneEmbedSelected && menuItem(actions['open-embed-link']),\n\t\t\t\t\t\toneEmbedSelected && menuItem(actions['convert-to-bookmark']),\n\t\t\t\t\t\toneEmbeddableBookmarkSelected && menuItem(actions['convert-to-embed'])\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tmenuSubmenu(\n\t\t\t\t\t'view',\n\t\t\t\t\t'menu.view',\n\t\t\t\t\tmenuGroup(\n\t\t\t\t\t\t'view-actions',\n\t\t\t\t\t\tmenuItem(actions['zoom-in']),\n\t\t\t\t\t\tmenuItem(actions['zoom-out']),\n\t\t\t\t\t\tmenuItem(actions['zoom-to-100'], { disabled: isZoomedTo100 }),\n\t\t\t\t\t\tmenuItem(actions['zoom-to-fit'], { disabled: emptyPage }),\n\t\t\t\t\t\tmenuItem(actions['zoom-to-selection'], { disabled: emptyPage || !oneSelected })\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\tmenuGroup('extras', menuItem(actions['insert-embed']), menuItem(actions['insert-media'])),\n\t\t\tmenuGroup(\n\t\t\t\t'preferences',\n\t\t\t\tmenuSubmenu(\n\t\t\t\t\t'preferences',\n\t\t\t\t\t'menu.preferences',\n\t\t\t\t\tmenuGroup(\n\t\t\t\t\t\t'preferences-actions',\n\t\t\t\t\t\tmenuItem(actions['toggle-snap-mode'], { checked: isSnapMode }),\n\t\t\t\t\t\tmenuItem(actions['toggle-tool-lock'], { checked: isToolLock }),\n\t\t\t\t\t\tmenuItem(actions['toggle-grid'], { checked: isGridMode }),\n\t\t\t\t\t\tmenuItem(actions['toggle-dark-mode'], { checked: isDarkMode }),\n\t\t\t\t\t\tmenuItem(actions['toggle-focus-mode'], { checked: isFocusMode }),\n\t\t\t\t\t\tmenuItem(actions['toggle-reduce-motion'], { checked: animationSpeed === 0 }),\n\t\t\t\t\t\tmenuItem(actions['toggle-debug-mode'], { checked: isDebugMode })\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tisMobile && menuCustom('LANGUAGE_MENU', { readonlyOk: true })\n\t\t\t),\n\t\t])\n\n\t\tif (overrides) {\n\t\t\treturn overrides(editor, menuSchema, {\n\t\t\t\tactions,\n\t\t\t\tnoneSelected,\n\t\t\t\toneSelected,\n\t\t\t\ttwoSelected,\n\t\t\t\tthreeSelected,\n\t\t\t})\n\t\t}\n\n\t\treturn menuSchema\n\t}, [\n\t\teditor,\n\t\toverrides,\n\t\tactions,\n\t\toneSelected,\n\t\ttwoSelected,\n\t\tthreeSelected,\n\t\temptyPage,\n\t\tisMobile,\n\t\tallowGroup,\n\t\tallowUngroup,\n\t\tshowEditLink,\n\t\thasClipboardWrite,\n\t\tshowAutoSizeToggle,\n\t\tnoneSelected,\n\t\tcanUndo,\n\t\tcanRedo,\n\t\tanimationSpeed,\n\t\tisDarkMode,\n\t\tisGridMode,\n\t\tisSnapMode,\n\t\tisToolLock,\n\t\tisFocusMode,\n\t\texportBackground,\n\t\tisDebugMode,\n\t\tisZoomedTo100,\n\t\toneEmbeddableBookmarkSelected,\n\t\toneEmbedSelected,\n\t])\n\n\treturn (\n\t\t<TLUiMenuSchemaContext.Provider value={menuSchema}>{children}</TLUiMenuSchemaContext.Provider>\n\t)\n}\n\n/** @public */\nexport function useMenuSchema(): TLUiMenuSchema {\n\tconst ctx = React.useContext(TLUiMenuSchemaContext)\n\n\tif (!ctx) {\n\t\tthrow new Error('useMenuSchema must be used inside of a TLUiMenuSchemaProvider.')\n\t}\n\n\treturn ctx\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0QE;AA1QF,oBAA2E;AAC3E,mBAA+B;AAC/B,oBAA6B;AAC7B,yBAUO;AACP,wBAA2B;AAC3B,2BAA8B;AAC9B,wBAA2B;AAC3B,wBAA2B;AAC3B,qCAAwC;AACxC,mCAAsC;AAM/B,MAAM,wBAAwB,aAAAA,QAAM,cAAc,CAAC,CAA8B;AAmBjF,SAAS,uBAAuB,EAAE,WAAW,SAAS,GAAgC;AAC5F,QAAM,aAAS,yBAAU;AACzB,QAAM,cAAU,8BAAW;AAE3B,QAAM,iBAAa,oCAAc;AACjC,QAAM,WAAW,aAAa;AAE9B,QAAM,iBAAa,wBAAS,cAAc,MAAM,OAAO,KAAK,cAAc,GAAG,CAAC,MAAM,CAAC;AACrF,QAAM,qBAAiB,wBAAS,kBAAkB,MAAM,OAAO,KAAK,kBAAkB,GAAG,CAAC,MAAM,CAAC;AACjG,QAAM,iBAAa,wBAAS,cAAc,MAAM,OAAO,iBAAiB,EAAE,YAAY,CAAC,MAAM,CAAC;AAC9F,QAAM,iBAAa,wBAAS,cAAc,MAAM,OAAO,KAAK,cAAc,GAAG,CAAC,MAAM,CAAC;AACrF,QAAM,iBAAa,wBAAS,cAAc,MAAM,OAAO,iBAAiB,EAAE,cAAc,CAAC,MAAM,CAAC;AAChG,QAAM,kBAAc,wB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MACD,CAAC;AAAA,IACF;AAEA,WAAOA;AAAA,EACR,GAAG;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAC;AAED,SACC,4CAAC,sBAAsB,UAAtB,EAA+B,OAAO,YAAa,UAAS;AAE/D;AAGO,SAAS,gBAAgC;AAC/C,QAAM,MAAM,aAAAD,QAAM,WAAW,qBAAqB;AAElD,MAAI,CAAC,KAAK;AACT,UAAM,IAAI,MAAM,gEAAgE;AAAA,EACjF;AAEA,SAAO;AACR;",
4
+ "sourcesContent": ["import { Editor, TLBookmarkShape, TLEmbedShape, useEditor, useValue } from '@bigbluebutton/editor'\nimport React, { useMemo } from 'react'\nimport { getEmbedInfo } from '../../utils/embeds/embeds'\nimport {\n\tTLUiMenuSchema,\n\tcompactMenuItems,\n\tmenuCustom,\n\tmenuGroup,\n\tmenuItem,\n\tmenuSubmenu,\n\tshowMenuPaste,\n\tuseAllowGroup,\n\tuseAllowUngroup,\n} from './menuHelpers'\nimport { useActions } from './useActions'\nimport { useBreakpoint } from './useBreakpoint'\nimport { useCanRedo } from './useCanRedo'\nimport { useCanUndo } from './useCanUndo'\nimport { useHasLinkShapeSelected } from './useHasLinkShapeSelected'\nimport { useShowAutoSizeToggle } from './useShowAutoSizeToggle'\n\n/** @public */\nexport type TLUiMenuSchemaContextType = TLUiMenuSchema\n\n/** @internal */\nexport const TLUiMenuSchemaContext = React.createContext({} as TLUiMenuSchemaContextType)\n\n/** @public */\nexport type TLUiMenuSchemaProviderProps = {\n\toverrides?: (\n\t\teditor: Editor,\n\t\tschema: TLUiMenuSchemaContextType,\n\t\thelpers: {\n\t\t\tactions: ReturnType<typeof useActions>\n\t\t\tnoneSelected: boolean\n\t\t\toneSelected: boolean\n\t\t\ttwoSelected: boolean\n\t\t\tthreeSelected: boolean\n\t\t}\n\t) => TLUiMenuSchemaContextType\n\tchildren: any\n}\n\n/** @internal */\nexport function TLUiMenuSchemaProvider({ overrides, children }: TLUiMenuSchemaProviderProps) {\n\tconst editor = useEditor()\n\tconst actions = useActions()\n\n\tconst breakpoint = useBreakpoint()\n\tconst isMobile = breakpoint < 5\n\n\tconst isDarkMode = useValue('isDarkMode', () => editor.user.getIsDarkMode(), [editor])\n\tconst animationSpeed = useValue('animationSpeed', () => editor.user.getAnimationSpeed(), [editor])\n\tconst edgeScrollSpeed = useValue('edgeScrollSpeed', () => editor.user.getEdgeScrollSpeed(), [\n\t\teditor,\n\t])\n\tconst isGridMode = useValue('isGridMode', () => editor.getInstanceState().isGridMode, [editor])\n\tconst isSnapMode = useValue('isSnapMode', () => editor.user.getIsSnapMode(), [editor])\n\tconst isToolLock = useValue('isToolLock', () => editor.getInstanceState().isToolLocked, [editor])\n\tconst isFocusMode = useValue('isFocusMode', () => editor.getInstanceState().isFocusMode, [editor])\n\tconst isDebugMode = useValue('isDebugMode', () => editor.getInstanceState().isDebugMode, [editor])\n\tconst exportBackground = useValue(\n\t\t'exportBackground',\n\t\t() => editor.getInstanceState().exportBackground,\n\t\t[editor]\n\t)\n\n\tconst emptyPage = useValue('emptyPage', () => editor.getCurrentPageShapeIds().size === 0, [\n\t\teditor,\n\t])\n\n\tconst selectedCount = useValue('selectedCount', () => editor.getSelectedShapeIds().length, [\n\t\teditor,\n\t])\n\tconst noneSelected = selectedCount === 0\n\tconst oneSelected = selectedCount > 0\n\tconst twoSelected = selectedCount > 1\n\tconst threeSelected = selectedCount > 2\n\n\tconst hasClipboardWrite = Boolean(window.navigator.clipboard?.write)\n\tconst showEditLink = useHasLinkShapeSelected()\n\tconst showAutoSizeToggle = useShowAutoSizeToggle()\n\tconst allowGroup = useAllowGroup()\n\tconst allowUngroup = useAllowUngroup()\n\tconst canUndo = useCanUndo()\n\tconst canRedo = useCanRedo()\n\tconst isZoomedTo100 = useValue('isZoomedTo100', () => editor.getZoomLevel() === 1, [editor])\n\n\tconst oneEmbedSelected = useValue(\n\t\t'oneEmbedSelected',\n\t\t() => {\n\t\t\tconst onlySelectedShape = editor.getOnlySelectedShape()\n\t\t\tif (!onlySelectedShape) return false\n\t\t\treturn !!(\n\t\t\t\teditor.isShapeOfType<TLEmbedShape>(onlySelectedShape, 'embed') &&\n\t\t\t\tonlySelectedShape.props.url &&\n\t\t\t\t!editor.isShapeOrAncestorLocked(onlySelectedShape)\n\t\t\t)\n\t\t},\n\t\t[]\n\t)\n\n\tconst oneEmbeddableBookmarkSelected = useValue(\n\t\t'oneEmbeddableBookmarkSelected',\n\t\t() => {\n\t\t\tconst onlySelectedShape = editor.getOnlySelectedShape()\n\t\t\tif (!onlySelectedShape) return false\n\t\t\treturn !!(\n\t\t\t\teditor.isShapeOfType<TLBookmarkShape>(onlySelectedShape, 'bookmark') &&\n\t\t\t\tonlySelectedShape.props.url &&\n\t\t\t\tgetEmbedInfo(onlySelectedShape.props.url) &&\n\t\t\t\t!editor.isShapeOrAncestorLocked(onlySelectedShape)\n\t\t\t)\n\t\t},\n\t\t[]\n\t)\n\n\tconst menuSchema = useMemo<TLUiMenuSchema>(() => {\n\t\tconst menuSchema: TLUiMenuSchema = compactMenuItems([\n\t\t\tmenuGroup(\n\t\t\t\t'menu',\n\t\t\t\tmenuSubmenu(\n\t\t\t\t\t'file',\n\t\t\t\t\t'menu.file',\n\t\t\t\t\tmenuGroup('print', menuItem(actions['print'], { disabled: emptyPage }))\n\t\t\t\t),\n\t\t\t\tmenuSubmenu(\n\t\t\t\t\t'edit',\n\t\t\t\t\t'menu.edit',\n\t\t\t\t\tmenuGroup(\n\t\t\t\t\t\t'undo-actions',\n\t\t\t\t\t\tmenuItem(actions['undo'], { disabled: !canUndo }),\n\t\t\t\t\t\tmenuItem(actions['redo'], { disabled: !canRedo })\n\t\t\t\t\t),\n\t\t\t\t\tmenuGroup(\n\t\t\t\t\t\t'clipboard-actions',\n\t\t\t\t\t\tmenuItem(actions['cut'], { disabled: noneSelected }),\n\t\t\t\t\t\tmenuItem(actions['copy'], { disabled: noneSelected }),\n\t\t\t\t\t\tmenuItem(actions['paste'], { disabled: !showMenuPaste })\n\t\t\t\t\t),\n\t\t\t\t\tmenuGroup(\n\t\t\t\t\t\t'conversions',\n\t\t\t\t\t\tmenuSubmenu(\n\t\t\t\t\t\t\t'copy-as',\n\t\t\t\t\t\t\t'menu.copy-as',\n\t\t\t\t\t\t\tmenuGroup(\n\t\t\t\t\t\t\t\t'copy-as-group',\n\t\t\t\t\t\t\t\tmenuItem(actions['copy-as-svg'], { disabled: emptyPage }),\n\t\t\t\t\t\t\t\tmenuItem(actions['copy-as-png'], { disabled: emptyPage || !hasClipboardWrite }),\n\t\t\t\t\t\t\t\tmenuItem(actions['copy-as-json'], { disabled: emptyPage })\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tmenuGroup(\n\t\t\t\t\t\t\t\t'export-bg',\n\t\t\t\t\t\t\t\tmenuItem(actions['toggle-transparent'], { checked: !exportBackground })\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tmenuSubmenu(\n\t\t\t\t\t\t\t'export-as',\n\t\t\t\t\t\t\t'menu.export-as',\n\t\t\t\t\t\t\tmenuGroup(\n\t\t\t\t\t\t\t\t'export-as-group',\n\t\t\t\t\t\t\t\tmenuItem(actions['export-as-svg'], { disabled: emptyPage }),\n\t\t\t\t\t\t\t\tmenuItem(actions['export-as-png'], { disabled: emptyPage }),\n\t\t\t\t\t\t\t\tmenuItem(actions['export-as-json'], { disabled: emptyPage })\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tmenuGroup(\n\t\t\t\t\t\t\t\t'export-bg',\n\t\t\t\t\t\t\t\tmenuItem(actions['toggle-transparent'], { checked: !exportBackground })\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\tmenuGroup(\n\t\t\t\t\t\t'set-selection-group',\n\t\t\t\t\t\tmenuItem(actions['select-all'], { disabled: emptyPage }),\n\t\t\t\t\t\tmenuItem(actions['select-none'], { disabled: !oneSelected })\n\t\t\t\t\t),\n\t\t\t\t\tmenuGroup(\n\t\t\t\t\t\t'selection',\n\t\t\t\t\t\tshowAutoSizeToggle && menuItem(actions['toggle-auto-size']),\n\t\t\t\t\t\tshowEditLink && menuItem(actions['edit-link']),\n\t\t\t\t\t\tmenuItem(actions['duplicate'], { disabled: !oneSelected }),\n\t\t\t\t\t\tallowGroup && menuItem(actions['group']),\n\t\t\t\t\t\tallowUngroup && menuItem(actions['ungroup']),\n\t\t\t\t\t\tmenuItem(actions['unlock-all'], { disabled: emptyPage })\n\t\t\t\t\t),\n\t\t\t\t\tmenuGroup('delete-group', menuItem(actions['delete'], { disabled: !oneSelected })),\n\t\t\t\t\tmenuGroup(\n\t\t\t\t\t\t'embeds',\n\t\t\t\t\t\toneEmbedSelected && menuItem(actions['open-embed-link']),\n\t\t\t\t\t\toneEmbedSelected && menuItem(actions['convert-to-bookmark']),\n\t\t\t\t\t\toneEmbeddableBookmarkSelected && menuItem(actions['convert-to-embed'])\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tmenuSubmenu(\n\t\t\t\t\t'view',\n\t\t\t\t\t'menu.view',\n\t\t\t\t\tmenuGroup(\n\t\t\t\t\t\t'view-actions',\n\t\t\t\t\t\tmenuItem(actions['zoom-in']),\n\t\t\t\t\t\tmenuItem(actions['zoom-out']),\n\t\t\t\t\t\tmenuItem(actions['zoom-to-100'], { disabled: isZoomedTo100 }),\n\t\t\t\t\t\tmenuItem(actions['zoom-to-fit'], { disabled: emptyPage }),\n\t\t\t\t\t\tmenuItem(actions['zoom-to-selection'], { disabled: emptyPage || !oneSelected })\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\tmenuGroup('extras', menuItem(actions['insert-embed']), menuItem(actions['insert-media'])),\n\t\t\tmenuGroup(\n\t\t\t\t'preferences',\n\t\t\t\tmenuSubmenu(\n\t\t\t\t\t'preferences',\n\t\t\t\t\t'menu.preferences',\n\t\t\t\t\tmenuGroup(\n\t\t\t\t\t\t'preferences-actions',\n\t\t\t\t\t\tmenuItem(actions['toggle-snap-mode'], { checked: isSnapMode }),\n\t\t\t\t\t\tmenuItem(actions['toggle-tool-lock'], { checked: isToolLock }),\n\t\t\t\t\t\tmenuItem(actions['toggle-grid'], { checked: isGridMode }),\n\t\t\t\t\t\tmenuItem(actions['toggle-dark-mode'], { checked: isDarkMode }),\n\t\t\t\t\t\tmenuItem(actions['toggle-focus-mode'], { checked: isFocusMode }),\n\t\t\t\t\t\tmenuItem(actions['toggle-edge-scrolling'], { checked: edgeScrollSpeed === 1 }),\n\t\t\t\t\t\tmenuItem(actions['toggle-reduce-motion'], { checked: animationSpeed === 0 }),\n\t\t\t\t\t\tmenuItem(actions['toggle-debug-mode'], { checked: isDebugMode })\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tisMobile && menuCustom('LANGUAGE_MENU', { readonlyOk: true })\n\t\t\t),\n\t\t])\n\n\t\tif (overrides) {\n\t\t\treturn overrides(editor, menuSchema, {\n\t\t\t\tactions,\n\t\t\t\tnoneSelected,\n\t\t\t\toneSelected,\n\t\t\t\ttwoSelected,\n\t\t\t\tthreeSelected,\n\t\t\t})\n\t\t}\n\n\t\treturn menuSchema\n\t}, [\n\t\teditor,\n\t\toverrides,\n\t\tactions,\n\t\toneSelected,\n\t\ttwoSelected,\n\t\tthreeSelected,\n\t\temptyPage,\n\t\tisMobile,\n\t\tallowGroup,\n\t\tallowUngroup,\n\t\tshowEditLink,\n\t\thasClipboardWrite,\n\t\tshowAutoSizeToggle,\n\t\tnoneSelected,\n\t\tcanUndo,\n\t\tcanRedo,\n\t\tanimationSpeed,\n\t\tisDarkMode,\n\t\tisGridMode,\n\t\tisSnapMode,\n\t\tisToolLock,\n\t\tisFocusMode,\n\t\texportBackground,\n\t\tisDebugMode,\n\t\tedgeScrollSpeed,\n\t\tisZoomedTo100,\n\t\toneEmbeddableBookmarkSelected,\n\t\toneEmbedSelected,\n\t])\n\n\treturn (\n\t\t<TLUiMenuSchemaContext.Provider value={menuSchema}>{children}</TLUiMenuSchemaContext.Provider>\n\t)\n}\n\n/** @public */\nexport function useMenuSchema(): TLUiMenuSchema {\n\tconst ctx = React.useContext(TLUiMenuSchemaContext)\n\n\tif (!ctx) {\n\t\tthrow new Error('useMenuSchema must be used inside of a TLUiMenuSchemaProvider.')\n\t}\n\n\treturn ctx\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+QE;AA/QF,oBAA2E;AAC3E,mBAA+B;AAC/B,oBAA6B;AAC7B,yBAUO;AACP,wBAA2B;AAC3B,2BAA8B;AAC9B,wBAA2B;AAC3B,wBAA2B;AAC3B,qCAAwC;AACxC,mCAAsC;AAM/B,MAAM,wBAAwB,aAAAA,QAAM,cAAc,CAAC,CAA8B;AAmBjF,SAAS,uBAAuB,EAAE,WAAW,SAAS,GAAgC;AAC5F,QAAM,aAAS,yBAAU;AACzB,QAAM,cAAU,8BAAW;AAE3B,QAAM,iBAAa,oCAAc;AACjC,QAAM,WAAW,aAAa;AAE9B,QAAM,iBAAa,wBAAS,cAAc,MAAM,OAAO,KAAK,cAAc,GAAG,CAAC,MAAM,CAAC;AACrF,QAAM,qBAAiB,wBAAS,kBAAkB,MAAM,OAAO,KAAK,kBAAkB,GAAG,CAAC,MAAM,CAAC;AACjG,QAAM,sBAAkB,wBAAS,mBAAmB,MAAM,OAAO,KAAK,mBAAmB,GAAG;AAAA,IAC3F;AAAA,EACD,CAAC;AACD,QAAM,iBAAa,wBAAS,cAAc,MAAM,OAAO,iBAAiB,EAAE,YAAY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,gBAC3E,6BAAS,QAAQ,mBAAmB,GAAG,EAAE,SAAS,YAAY,CAAC;AAAA,UAChE;AAAA,QACD;AAAA,QACA,gBAAY,+BAAW,iBAAiB,EAAE,YAAY,KAAK,CAAC;AAAA,MAC7D;AAAA,IACD,CAAC;AAED,QAAI,WAAW;AACd,aAAO,UAAU,QAAQA,aAAY;AAAA,QACpC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD,CAAC;AAAA,IACF;AAEA,WAAOA;AAAA,EACR,GAAG;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAC;AAED,SACC,4CAAC,sBAAsB,UAAtB,EAA+B,OAAO,YAAa,UAAS;AAE/D;AAGO,SAAS,gBAAgC;AAC/C,QAAM,MAAM,aAAAD,QAAM,WAAW,qBAAqB;AAElD,MAAI,CAAC,KAAK;AACT,UAAM,IAAI,MAAM,gEAAgE;AAAA,EACjF;AAEA,SAAO;AACR;",
6
6
  "names": ["React", "menuSchema"]
7
7
  }
@@ -50,6 +50,7 @@ const usePreloadFont = (id, font) => {
50
50
  featureSettings,
51
51
  stretch,
52
52
  unicodeRange,
53
+ // @ts-expect-error
53
54
  variant
54
55
  };
55
56
  const fontInstance = new FontFace(id, `url(${url})`, descriptors);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/lib/ui/hooks/usePreloadAssets.ts"],
4
- "sourcesContent": ["import { useEffect, useMemo, useState } from 'react'\nimport { TLEditorAssetUrls } from '../../utils/static-assets/assetUrls'\n\nexport type TLTypeFace = {\n\turl: string\n\tdisplay?: any // FontDisplay\n\tfeatureSettings?: string\n\tstretch?: string\n\tstyle?: string\n\tunicodeRange?: string\n\tvariant?: string\n\tweight?: string\n}\n\nexport type TLTypeFaces = {\n\tdraw: TLTypeFace\n\tmonospace: TLTypeFace\n\tserif: TLTypeFace\n\tsansSerif: TLTypeFace\n}\n\nenum PreloadStatus {\n\tSUCCESS,\n\tFAILED,\n\tWAITING,\n}\n\nconst usePreloadFont = (id: string, font: TLTypeFace): PreloadStatus => {\n\tconst [state, setState] = useState<PreloadStatus>(PreloadStatus.WAITING)\n\n\tuseEffect(() => {\n\t\tconst {\n\t\t\turl,\n\t\t\tstyle = 'normal',\n\t\t\tweight = '500',\n\t\t\tdisplay,\n\t\t\tfeatureSettings,\n\t\t\tstretch,\n\t\t\tunicodeRange,\n\t\t\tvariant,\n\t\t} = font\n\n\t\tlet cancelled = false\n\t\tsetState(PreloadStatus.WAITING)\n\n\t\tconst descriptors: FontFaceDescriptors = {\n\t\t\tstyle,\n\t\t\tweight,\n\t\t\tdisplay,\n\t\t\tfeatureSettings,\n\t\t\tstretch,\n\t\t\tunicodeRange,\n\t\t\tvariant,\n\t\t}\n\n\t\tconst fontInstance = new FontFace(id, `url(${url})`, descriptors)\n\n\t\tfontInstance\n\t\t\t.load()\n\t\t\t.then(() => {\n\t\t\t\tif (cancelled) return\n\t\t\t\tdocument.fonts.add(fontInstance)\n\t\t\t\tsetState(PreloadStatus.SUCCESS)\n\t\t\t})\n\t\t\t.catch((err) => {\n\t\t\t\tif (cancelled) return\n\t\t\t\tconsole.error(err)\n\t\t\t\tsetState(PreloadStatus.FAILED)\n\t\t\t})\n\n\t\t// @ts-expect-error\n\t\tfontInstance.$$_url = url\n\n\t\t// @ts-expect-error\n\t\tfontInstance.$$_fontface = `\n@font-face {\n\tfont-family: ${fontInstance.family};\n\tfont-stretch: ${fontInstance.stretch};\n\tfont-weight: ${fontInstance.weight};\n\tfont-style: ${fontInstance.style};\n\tsrc: url(\"${url}\") format(\"woff2\")\n}`\n\n\t\treturn () => {\n\t\t\tdocument.fonts.delete(fontInstance)\n\t\t\tcancelled = true\n\t\t}\n\t}, [id, font])\n\n\treturn state\n}\n\nfunction getTypefaces(assetUrls: TLEditorAssetUrls) {\n\treturn {\n\t\tdraw: { url: assetUrls.fonts.draw },\n\t\tserif: { url: assetUrls.fonts.serif },\n\t\tsansSerif: { url: assetUrls.fonts.sansSerif },\n\t\tmonospace: { url: assetUrls.fonts.monospace },\n\t}\n}\n\n// todo: Expose this via a public API (prop on <Tldraw>).\n\nexport function usePreloadAssets(assetUrls: TLEditorAssetUrls) {\n\tconst typefaces = useMemo(() => getTypefaces(assetUrls), [assetUrls])\n\n\tconst results = [\n\t\tusePreloadFont('tldraw_draw', typefaces.draw),\n\t\tusePreloadFont('tldraw_serif', typefaces.serif),\n\t\tusePreloadFont('tldraw_sans', typefaces.sansSerif),\n\t\tusePreloadFont('tldraw_mono', typefaces.monospace),\n\t]\n\n\treturn {\n\t\t// If any of the results have errored, then preloading has failed\n\t\terror: results.some((result) => result === PreloadStatus.FAILED),\n\t\t// If any of the results are waiting, then we're not done yet\n\t\tdone: !results.some((result) => result === PreloadStatus.WAITING),\n\t}\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA6C;AAqB7C,IAAK,gBAAL,kBAAKA,mBAAL;AACC,EAAAA,8BAAA;AACA,EAAAA,8BAAA;AACA,EAAAA,8BAAA;AAHI,SAAAA;AAAA,GAAA;AAML,MAAM,iBAAiB,CAAC,IAAY,SAAoC;AACvE,QAAM,CAAC,OAAO,QAAQ,QAAI,uBAAwB,eAAqB;AAEvE,8BAAU,MAAM;AACf,UAAM;AAAA,MACL;AAAA,MACA,QAAQ;AAAA,MACR,SAAS;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,IAAI;AAEJ,QAAI,YA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AA,EAClD;AAEA,SAAO;AAAA;AAAA,IAEN,OAAO,QAAQ,KAAK,CAAC,WAAW,WAAW,cAAoB;AAAA;AAAA,IAE/D,MAAM,CAAC,QAAQ,KAAK,CAAC,WAAW,WAAW,eAAqB;AAAA,EACjE;AACD;",
4
+ "sourcesContent": ["import { useEffect, useMemo, useState } from 'react'\nimport { TLEditorAssetUrls } from '../../utils/static-assets/assetUrls'\n\nexport type TLTypeFace = {\n\turl: string\n\tdisplay?: any // FontDisplay\n\tfeatureSettings?: string\n\tstretch?: string\n\tstyle?: string\n\tunicodeRange?: string\n\tvariant?: string\n\tweight?: string\n}\n\nexport type TLTypeFaces = {\n\tdraw: TLTypeFace\n\tmonospace: TLTypeFace\n\tserif: TLTypeFace\n\tsansSerif: TLTypeFace\n}\n\nenum PreloadStatus {\n\tSUCCESS,\n\tFAILED,\n\tWAITING,\n}\n\nconst usePreloadFont = (id: string, font: TLTypeFace): PreloadStatus => {\n\tconst [state, setState] = useState<PreloadStatus>(PreloadStatus.WAITING)\n\n\tuseEffect(() => {\n\t\tconst {\n\t\t\turl,\n\t\t\tstyle = 'normal',\n\t\t\tweight = '500',\n\t\t\tdisplay,\n\t\t\tfeatureSettings,\n\t\t\tstretch,\n\t\t\tunicodeRange,\n\t\t\tvariant,\n\t\t} = font\n\n\t\tlet cancelled = false\n\t\tsetState(PreloadStatus.WAITING)\n\n\t\tconst descriptors: FontFaceDescriptors = {\n\t\t\tstyle,\n\t\t\tweight,\n\t\t\tdisplay,\n\t\t\tfeatureSettings,\n\t\t\tstretch,\n\t\t\tunicodeRange,\n\t\t\t// @ts-expect-error\n\t\t\tvariant,\n\t\t}\n\n\t\tconst fontInstance = new FontFace(id, `url(${url})`, descriptors)\n\n\t\tfontInstance\n\t\t\t.load()\n\t\t\t.then(() => {\n\t\t\t\tif (cancelled) return\n\t\t\t\tdocument.fonts.add(fontInstance)\n\t\t\t\tsetState(PreloadStatus.SUCCESS)\n\t\t\t})\n\t\t\t.catch((err) => {\n\t\t\t\tif (cancelled) return\n\t\t\t\tconsole.error(err)\n\t\t\t\tsetState(PreloadStatus.FAILED)\n\t\t\t})\n\n\t\t// @ts-expect-error\n\t\tfontInstance.$$_url = url\n\n\t\t// @ts-expect-error\n\t\tfontInstance.$$_fontface = `\n@font-face {\n\tfont-family: ${fontInstance.family};\n\tfont-stretch: ${fontInstance.stretch};\n\tfont-weight: ${fontInstance.weight};\n\tfont-style: ${fontInstance.style};\n\tsrc: url(\"${url}\") format(\"woff2\")\n}`\n\n\t\treturn () => {\n\t\t\tdocument.fonts.delete(fontInstance)\n\t\t\tcancelled = true\n\t\t}\n\t}, [id, font])\n\n\treturn state\n}\n\nfunction getTypefaces(assetUrls: TLEditorAssetUrls) {\n\treturn {\n\t\tdraw: { url: assetUrls.fonts.draw },\n\t\tserif: { url: assetUrls.fonts.serif },\n\t\tsansSerif: { url: assetUrls.fonts.sansSerif },\n\t\tmonospace: { url: assetUrls.fonts.monospace },\n\t}\n}\n\n// todo: Expose this via a public API (prop on <Tldraw>).\n\nexport function usePreloadAssets(assetUrls: TLEditorAssetUrls) {\n\tconst typefaces = useMemo(() => getTypefaces(assetUrls), [assetUrls])\n\n\tconst results = [\n\t\tusePreloadFont('tldraw_draw', typefaces.draw),\n\t\tusePreloadFont('tldraw_serif', typefaces.serif),\n\t\tusePreloadFont('tldraw_sans', typefaces.sansSerif),\n\t\tusePreloadFont('tldraw_mono', typefaces.monospace),\n\t]\n\n\treturn {\n\t\t// If any of the results have errored, then preloading has failed\n\t\terror: results.some((result) => result === PreloadStatus.FAILED),\n\t\t// If any of the results are waiting, then we're not done yet\n\t\tdone: !results.some((result) => result === PreloadStatus.WAITING),\n\t}\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA6C;AAqB7C,IAAK,gBAAL,kBAAKA,mBAAL;AACC,EAAAA,8BAAA;AACA,EAAAA,8BAAA;AACA,EAAAA,8BAAA;AAHI,S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EAC7C;AACD;AAIO,SAAS,iBAAiB,WAA8B;AAC9D,QAAM,gBAAY,sBAAQ,MAAM,aAAa,SAAS,GAAG,CAAC,SAAS,CAAC;AAEpE,QAAM,UAAU;AAAA,IACf,eAAe,eAAe,UAAU,IAAI;AAAA,IAC5C,eAAe,gBAAgB,UAAU,KAAK;AAAA,IAC9C,eAAe,eAAe,UAAU,SAAS;AAAA,IACjD,eAAe,eAAe,UAAU,SAAS;AAAA,EAClD;AAEA,SAAO;AAAA;AAAA,IAEN,OAAO,QAAQ,KAAK,CAAC,WAAW,WAAW,cAAoB;AAAA;AAAA,IAE/D,MAAM,CAAC,QAAQ,KAAK,CAAC,WAAW,WAAW,eAAqB;AAAA,EACjE;AACD;",
6
6
  "names": ["PreloadStatus"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/lib/ui/hooks/useTranslation/TLUiTranslationKey.ts"],
4
- "sourcesContent": ["// This file is automatically generated by scripts/refresh-assets.ts.\n// Do not edit manually.\n\n/** @public */\nexport type TLUiTranslationKey =\n\t| 'action.convert-to-bookmark'\n\t| 'action.convert-to-embed'\n\t| 'action.open-embed-link'\n\t| 'action.align-bottom'\n\t| 'action.align-center-horizontal'\n\t| 'action.align-center-vertical'\n\t| 'action.align-center-horizontal.short'\n\t| 'action.align-center-vertical.short'\n\t| 'action.align-left'\n\t| 'action.align-right'\n\t| 'action.align-top'\n\t| 'action.back-to-content'\n\t| 'action.bring-forward'\n\t| 'action.bring-to-front'\n\t| 'action.copy-as-json.short'\n\t| 'action.copy-as-json'\n\t| 'action.copy-as-png.short'\n\t| 'action.copy-as-png'\n\t| 'action.copy-as-svg.short'\n\t| 'action.copy-as-svg'\n\t| 'action.copy'\n\t| 'action.cut'\n\t| 'action.delete'\n\t| 'action.unlock-all'\n\t| 'action.distribute-horizontal'\n\t| 'action.distribute-vertical'\n\t| 'action.distribute-horizontal.short'\n\t| 'action.distribute-vertical.short'\n\t| 'action.duplicate'\n\t| 'action.edit-link'\n\t| 'action.exit-pen-mode'\n\t| 'action.export-as-json.short'\n\t| 'action.export-as-json'\n\t| 'action.export-as-png.short'\n\t| 'action.export-as-png'\n\t| 'action.export-as-svg.short'\n\t| 'action.export-as-svg'\n\t| 'action.fit-frame-to-content'\n\t| 'action.flip-horizontal'\n\t| 'action.flip-vertical'\n\t| 'action.flip-horizontal.short'\n\t| 'action.flip-vertical.short'\n\t| 'action.fork-project'\n\t| 'action.group'\n\t| 'action.insert-embed'\n\t| 'action.insert-media'\n\t| 'action.leave-shared-project'\n\t| 'action.new-project'\n\t| 'action.new-shared-project'\n\t| 'action.open-cursor-chat'\n\t| 'action.open-file'\n\t| 'action.pack'\n\t| 'action.paste'\n\t| 'action.print'\n\t| 'action.redo'\n\t| 'action.remove-frame'\n\t| 'action.rotate-ccw'\n\t| 'action.rotate-cw'\n\t| 'action.save-copy'\n\t| 'action.select-all'\n\t| 'action.select-none'\n\t| 'action.send-backward'\n\t| 'action.send-to-back'\n\t| 'action.share-project'\n\t| 'action.stack-horizontal'\n\t| 'action.stack-vertical'\n\t| 'action.stack-horizontal.short'\n\t| 'action.stack-vertical.short'\n\t| 'action.stop-following'\n\t| 'action.stretch-horizontal'\n\t| 'action.stretch-vertical'\n\t| 'action.stretch-horizontal.short'\n\t| 'action.stretch-vertical.short'\n\t| 'action.toggle-auto-size'\n\t| 'action.toggle-dark-mode.menu'\n\t| 'action.toggle-dark-mode'\n\t| 'action.toggle-reduce-motion.menu'\n\t| 'action.toggle-reduce-motion'\n\t| 'action.toggle-debug-mode.menu'\n\t| 'action.toggle-debug-mode'\n\t| 'action.toggle-focus-mode.menu'\n\t| 'action.toggle-focus-mode'\n\t| 'action.toggle-grid.menu'\n\t| 'action.toggle-grid'\n\t| 'action.toggle-lock'\n\t| 'action.toggle-snap-mode.menu'\n\t| 'action.toggle-snap-mode'\n\t| 'action.toggle-tool-lock.menu'\n\t| 'action.toggle-tool-lock'\n\t| 'action.toggle-transparent.context-menu'\n\t| 'action.toggle-transparent.menu'\n\t| 'action.toggle-transparent'\n\t| 'action.undo'\n\t| 'action.ungroup'\n\t| 'action.zoom-in'\n\t| 'action.zoom-out'\n\t| 'action.zoom-to-100'\n\t| 'action.zoom-to-fit'\n\t| 'action.zoom-to-selection'\n\t| 'color-style.black'\n\t| 'color-style.blue'\n\t| 'color-style.green'\n\t| 'color-style.grey'\n\t| 'color-style.light-blue'\n\t| 'color-style.light-green'\n\t| 'color-style.light-red'\n\t| 'color-style.light-violet'\n\t| 'color-style.orange'\n\t| 'color-style.red'\n\t| 'color-style.violet'\n\t| 'color-style.yellow'\n\t| 'fill-style.none'\n\t| 'fill-style.semi'\n\t| 'fill-style.solid'\n\t| 'fill-style.pattern'\n\t| 'dash-style.dashed'\n\t| 'dash-style.dotted'\n\t| 'dash-style.draw'\n\t| 'dash-style.solid'\n\t| 'size-style.s'\n\t| 'size-style.m'\n\t| 'size-style.l'\n\t| 'size-style.xl'\n\t| 'opacity-style.0.1'\n\t| 'opacity-style.0.25'\n\t| 'opacity-style.0.5'\n\t| 'opacity-style.0.75'\n\t| 'opacity-style.1'\n\t| 'font-style.draw'\n\t| 'font-style.sans'\n\t| 'font-style.serif'\n\t| 'font-style.mono'\n\t| 'align-style.start'\n\t| 'align-style.middle'\n\t| 'align-style.end'\n\t| 'align-style.justify'\n\t| 'geo-style.arrow-down'\n\t| 'geo-style.arrow-left'\n\t| 'geo-style.arrow-right'\n\t| 'geo-style.arrow-up'\n\t| 'geo-style.diamond'\n\t| 'geo-style.ellipse'\n\t| 'geo-style.hexagon'\n\t| 'geo-style.octagon'\n\t| 'geo-style.oval'\n\t| 'geo-style.cloud'\n\t| 'geo-style.pentagon'\n\t| 'geo-style.rectangle'\n\t| 'geo-style.rhombus-2'\n\t| 'geo-style.rhombus'\n\t| 'geo-style.star'\n\t| 'geo-style.trapezoid'\n\t| 'geo-style.triangle'\n\t| 'geo-style.x-box'\n\t| 'geo-style.check-box'\n\t| 'arrowheadStart-style.none'\n\t| 'arrowheadStart-style.arrow'\n\t| 'arrowheadStart-style.bar'\n\t| 'arrowheadStart-style.diamond'\n\t| 'arrowheadStart-style.dot'\n\t| 'arrowheadStart-style.inverted'\n\t| 'arrowheadStart-style.pipe'\n\t| 'arrowheadStart-style.square'\n\t| 'arrowheadStart-style.triangle'\n\t| 'arrowheadEnd-style.none'\n\t| 'arrowheadEnd-style.arrow'\n\t| 'arrowheadEnd-style.bar'\n\t| 'arrowheadEnd-style.diamond'\n\t| 'arrowheadEnd-style.dot'\n\t| 'arrowheadEnd-style.inverted'\n\t| 'arrowheadEnd-style.pipe'\n\t| 'arrowheadEnd-style.square'\n\t| 'arrowheadEnd-style.triangle'\n\t| 'spline-style.line'\n\t| 'spline-style.cubic'\n\t| 'tool.select'\n\t| 'tool.hand'\n\t| 'tool.draw'\n\t| 'tool.eraser'\n\t| 'tool.arrow-down'\n\t| 'tool.arrow-left'\n\t| 'tool.arrow-right'\n\t| 'tool.arrow-up'\n\t| 'tool.arrow'\n\t| 'tool.cloud'\n\t| 'tool.diamond'\n\t| 'tool.ellipse'\n\t| 'tool.hexagon'\n\t| 'tool.highlight'\n\t| 'tool.line'\n\t| 'tool.octagon'\n\t| 'tool.oval'\n\t| 'tool.pentagon'\n\t| 'tool.rectangle'\n\t| 'tool.rhombus'\n\t| 'tool.star'\n\t| 'tool.trapezoid'\n\t| 'tool.triangle'\n\t| 'tool.x-box'\n\t| 'tool.check-box'\n\t| 'tool.asset'\n\t| 'tool.frame'\n\t| 'tool.note'\n\t| 'tool.laser'\n\t| 'tool.embed'\n\t| 'tool.text'\n\t| 'menu.title'\n\t| 'menu.copy-as'\n\t| 'menu.edit'\n\t| 'menu.export-as'\n\t| 'menu.file'\n\t| 'menu.language'\n\t| 'menu.preferences'\n\t| 'menu.view'\n\t| 'context-menu.arrange'\n\t| 'context-menu.copy-as'\n\t| 'context-menu.export-as'\n\t| 'context-menu.move-to-page'\n\t| 'context-menu.reorder'\n\t| 'page-menu.title'\n\t| 'page-menu.create-new-page'\n\t| 'page-menu.max-page-count-reached'\n\t| 'page-menu.new-page-initial-name'\n\t| 'page-menu.edit-start'\n\t| 'page-menu.edit-done'\n\t| 'page-menu.go-to-page'\n\t| 'page-menu.submenu.rename'\n\t| 'page-menu.submenu.duplicate-page'\n\t| 'page-menu.submenu.title'\n\t| 'page-menu.submenu.move-down'\n\t| 'page-menu.submenu.move-up'\n\t| 'page-menu.submenu.delete'\n\t| 'share-menu.title'\n\t| 'share-menu.save-note'\n\t| 'share-menu.fork-note'\n\t| 'share-menu.share-project'\n\t| 'share-menu.default-project-name'\n\t| 'share-menu.copy-link'\n\t| 'share-menu.readonly-link'\n\t| 'share-menu.create-snapshot-link'\n\t| 'share-menu.snapshot-link-note'\n\t| 'share-menu.copy-readonly-link'\n\t| 'share-menu.offline-note'\n\t| 'share-menu.copy-link-note'\n\t| 'share-menu.copy-readonly-link-note'\n\t| 'share-menu.project-too-large'\n\t| 'share-menu.upload-failed'\n\t| 'status.offline'\n\t| 'status.online'\n\t| 'people-menu.title'\n\t| 'people-menu.change-name'\n\t| 'people-menu.change-color'\n\t| 'people-menu.follow'\n\t| 'people-menu.following'\n\t| 'people-menu.leading'\n\t| 'people-menu.user'\n\t| 'people-menu.invite'\n\t| 'help-menu.title'\n\t| 'help-menu.about'\n\t| 'help-menu.discord'\n\t| 'help-menu.github'\n\t| 'help-menu.keyboard-shortcuts'\n\t| 'help-menu.twitter'\n\t| 'actions-menu.title'\n\t| 'edit-link-dialog.title'\n\t| 'edit-link-dialog.invalid-url'\n\t| 'edit-link-dialog.detail'\n\t| 'edit-link-dialog.url'\n\t| 'edit-link-dialog.clear'\n\t| 'edit-link-dialog.save'\n\t| 'edit-link-dialog.cancel'\n\t| 'embed-dialog.title'\n\t| 'embed-dialog.back'\n\t| 'embed-dialog.create'\n\t| 'embed-dialog.cancel'\n\t| 'embed-dialog.url'\n\t| 'embed-dialog.instruction'\n\t| 'embed-dialog.invalid-url'\n\t| 'edit-pages-dialog.move-down'\n\t| 'edit-pages-dialog.move-up'\n\t| 'shortcuts-dialog.title'\n\t| 'shortcuts-dialog.edit'\n\t| 'shortcuts-dialog.file'\n\t| 'shortcuts-dialog.preferences'\n\t| 'shortcuts-dialog.tools'\n\t| 'shortcuts-dialog.transform'\n\t| 'shortcuts-dialog.view'\n\t| 'shortcuts-dialog.collaboration'\n\t| 'home-project-dialog.title'\n\t| 'home-project-dialog.description'\n\t| 'rename-project-dialog.title'\n\t| 'rename-project-dialog.cancel'\n\t| 'rename-project-dialog.rename'\n\t| 'home-project-dialog.ok'\n\t| 'style-panel.title'\n\t| 'style-panel.align'\n\t| 'style-panel.vertical-align'\n\t| 'style-panel.position'\n\t| 'style-panel.arrowheads'\n\t| 'style-panel.arrowhead-start'\n\t| 'style-panel.arrowhead-end'\n\t| 'style-panel.color'\n\t| 'style-panel.dash'\n\t| 'style-panel.fill'\n\t| 'style-panel.font'\n\t| 'style-panel.geo'\n\t| 'style-panel.mixed'\n\t| 'style-panel.opacity'\n\t| 'style-panel.size'\n\t| 'style-panel.spline'\n\t| 'tool-panel.drawing'\n\t| 'tool-panel.shapes'\n\t| 'tool-panel.more'\n\t| 'debug-panel.more'\n\t| 'navigation-zone.toggle-minimap'\n\t| 'navigation-zone.zoom'\n\t| 'focus-mode.toggle-focus-mode'\n\t| 'toast.close'\n\t| 'file-system.file-open-error.title'\n\t| 'file-system.file-open-error.not-a-tldraw-file'\n\t| 'file-system.file-open-error.file-format-version-too-new'\n\t| 'file-system.file-open-error.generic-corrupted-file'\n\t| 'file-system.confirm-open.title'\n\t| 'file-system.confirm-open.description'\n\t| 'file-system.confirm-open.cancel'\n\t| 'file-system.confirm-open.open'\n\t| 'file-system.confirm-open.dont-show-again'\n\t| 'file-system.confirm-clear.title'\n\t| 'file-system.confirm-clear.description'\n\t| 'file-system.confirm-clear.cancel'\n\t| 'file-system.confirm-clear.continue'\n\t| 'file-system.confirm-clear.dont-show-again'\n\t| 'file-system.shared-document-file-open-error.title'\n\t| 'file-system.shared-document-file-open-error.description'\n\t| 'sharing.confirm-leave.title'\n\t| 'sharing.confirm-leave.description'\n\t| 'sharing.confirm-leave.cancel'\n\t| 'sharing.confirm-leave.leave'\n\t| 'sharing.confirm-leave.dont-show-again'\n\t| 'toast.error.export-fail.title'\n\t| 'toast.error.export-fail.desc'\n\t| 'toast.error.copy-fail.title'\n\t| 'toast.error.copy-fail.desc'\n\t| 'context.pages.new-page'\n\t| 'vscode.file-open.desc'\n\t| 'vscode.file-open.open'\n\t| 'vscode.file-open.backup'\n\t| 'vscode.file-open.backup-saved'\n\t| 'vscode.file-open.backup-failed'\n\t| 'vscode.file-open.dont-show-again'\n\t| 'cursor-chat.type-to-chat'\n"],
4
+ "sourcesContent": ["// This file is automatically generated by scripts/refresh-assets.ts.\n// Do not edit manually.\n\n/** @public */\nexport type TLUiTranslationKey =\n\t| 'action.convert-to-bookmark'\n\t| 'action.convert-to-embed'\n\t| 'action.open-embed-link'\n\t| 'action.align-bottom'\n\t| 'action.align-center-horizontal'\n\t| 'action.align-center-vertical'\n\t| 'action.align-center-horizontal.short'\n\t| 'action.align-center-vertical.short'\n\t| 'action.align-left'\n\t| 'action.align-right'\n\t| 'action.align-top'\n\t| 'action.back-to-content'\n\t| 'action.bring-forward'\n\t| 'action.bring-to-front'\n\t| 'action.copy-as-json.short'\n\t| 'action.copy-as-json'\n\t| 'action.copy-as-png.short'\n\t| 'action.copy-as-png'\n\t| 'action.copy-as-svg.short'\n\t| 'action.copy-as-svg'\n\t| 'action.copy'\n\t| 'action.cut'\n\t| 'action.delete'\n\t| 'action.unlock-all'\n\t| 'action.distribute-horizontal'\n\t| 'action.distribute-vertical'\n\t| 'action.distribute-horizontal.short'\n\t| 'action.distribute-vertical.short'\n\t| 'action.duplicate'\n\t| 'action.edit-link'\n\t| 'action.exit-pen-mode'\n\t| 'action.export-as-json.short'\n\t| 'action.export-as-json'\n\t| 'action.export-as-png.short'\n\t| 'action.export-as-png'\n\t| 'action.export-as-svg.short'\n\t| 'action.export-as-svg'\n\t| 'action.fit-frame-to-content'\n\t| 'action.flip-horizontal'\n\t| 'action.flip-vertical'\n\t| 'action.flip-horizontal.short'\n\t| 'action.flip-vertical.short'\n\t| 'action.fork-project'\n\t| 'action.group'\n\t| 'action.insert-embed'\n\t| 'action.insert-media'\n\t| 'action.leave-shared-project'\n\t| 'action.new-project'\n\t| 'action.new-shared-project'\n\t| 'action.open-cursor-chat'\n\t| 'action.open-file'\n\t| 'action.pack'\n\t| 'action.paste'\n\t| 'action.print'\n\t| 'action.redo'\n\t| 'action.remove-frame'\n\t| 'action.rotate-ccw'\n\t| 'action.rotate-cw'\n\t| 'action.save-copy'\n\t| 'action.select-all'\n\t| 'action.select-none'\n\t| 'action.send-backward'\n\t| 'action.send-to-back'\n\t| 'action.share-project'\n\t| 'action.stack-horizontal'\n\t| 'action.stack-vertical'\n\t| 'action.stack-horizontal.short'\n\t| 'action.stack-vertical.short'\n\t| 'action.stop-following'\n\t| 'action.stretch-horizontal'\n\t| 'action.stretch-vertical'\n\t| 'action.stretch-horizontal.short'\n\t| 'action.stretch-vertical.short'\n\t| 'action.toggle-auto-size'\n\t| 'action.toggle-dark-mode.menu'\n\t| 'action.toggle-dark-mode'\n\t| 'action.toggle-reduce-motion.menu'\n\t| 'action.toggle-reduce-motion'\n\t| 'action.toggle-edge-scrolling.menu'\n\t| 'action.toggle-edge-scrolling'\n\t| 'action.toggle-debug-mode.menu'\n\t| 'action.toggle-debug-mode'\n\t| 'action.toggle-focus-mode.menu'\n\t| 'action.toggle-focus-mode'\n\t| 'action.toggle-grid.menu'\n\t| 'action.toggle-grid'\n\t| 'action.toggle-lock'\n\t| 'action.toggle-snap-mode.menu'\n\t| 'action.toggle-snap-mode'\n\t| 'action.toggle-tool-lock.menu'\n\t| 'action.toggle-tool-lock'\n\t| 'action.toggle-transparent.context-menu'\n\t| 'action.toggle-transparent.menu'\n\t| 'action.toggle-transparent'\n\t| 'action.undo'\n\t| 'action.ungroup'\n\t| 'action.zoom-in'\n\t| 'action.zoom-out'\n\t| 'action.zoom-to-100'\n\t| 'action.zoom-to-fit'\n\t| 'action.zoom-to-selection'\n\t| 'color-style.black'\n\t| 'color-style.blue'\n\t| 'color-style.green'\n\t| 'color-style.grey'\n\t| 'color-style.light-blue'\n\t| 'color-style.light-green'\n\t| 'color-style.light-red'\n\t| 'color-style.light-violet'\n\t| 'color-style.orange'\n\t| 'color-style.red'\n\t| 'color-style.violet'\n\t| 'color-style.yellow'\n\t| 'fill-style.none'\n\t| 'fill-style.semi'\n\t| 'fill-style.solid'\n\t| 'fill-style.pattern'\n\t| 'dash-style.dashed'\n\t| 'dash-style.dotted'\n\t| 'dash-style.draw'\n\t| 'dash-style.solid'\n\t| 'size-style.s'\n\t| 'size-style.m'\n\t| 'size-style.l'\n\t| 'size-style.xl'\n\t| 'opacity-style.0.1'\n\t| 'opacity-style.0.25'\n\t| 'opacity-style.0.5'\n\t| 'opacity-style.0.75'\n\t| 'opacity-style.1'\n\t| 'font-style.draw'\n\t| 'font-style.sans'\n\t| 'font-style.serif'\n\t| 'font-style.mono'\n\t| 'align-style.start'\n\t| 'align-style.middle'\n\t| 'align-style.end'\n\t| 'align-style.justify'\n\t| 'geo-style.arrow-down'\n\t| 'geo-style.arrow-left'\n\t| 'geo-style.arrow-right'\n\t| 'geo-style.arrow-up'\n\t| 'geo-style.diamond'\n\t| 'geo-style.ellipse'\n\t| 'geo-style.hexagon'\n\t| 'geo-style.octagon'\n\t| 'geo-style.oval'\n\t| 'geo-style.cloud'\n\t| 'geo-style.pentagon'\n\t| 'geo-style.rectangle'\n\t| 'geo-style.rhombus-2'\n\t| 'geo-style.rhombus'\n\t| 'geo-style.star'\n\t| 'geo-style.trapezoid'\n\t| 'geo-style.triangle'\n\t| 'geo-style.x-box'\n\t| 'geo-style.check-box'\n\t| 'arrowheadStart-style.none'\n\t| 'arrowheadStart-style.arrow'\n\t| 'arrowheadStart-style.bar'\n\t| 'arrowheadStart-style.diamond'\n\t| 'arrowheadStart-style.dot'\n\t| 'arrowheadStart-style.inverted'\n\t| 'arrowheadStart-style.pipe'\n\t| 'arrowheadStart-style.square'\n\t| 'arrowheadStart-style.triangle'\n\t| 'arrowheadEnd-style.none'\n\t| 'arrowheadEnd-style.arrow'\n\t| 'arrowheadEnd-style.bar'\n\t| 'arrowheadEnd-style.diamond'\n\t| 'arrowheadEnd-style.dot'\n\t| 'arrowheadEnd-style.inverted'\n\t| 'arrowheadEnd-style.pipe'\n\t| 'arrowheadEnd-style.square'\n\t| 'arrowheadEnd-style.triangle'\n\t| 'spline-style.line'\n\t| 'spline-style.cubic'\n\t| 'tool.select'\n\t| 'tool.hand'\n\t| 'tool.draw'\n\t| 'tool.eraser'\n\t| 'tool.arrow-down'\n\t| 'tool.arrow-left'\n\t| 'tool.arrow-right'\n\t| 'tool.arrow-up'\n\t| 'tool.arrow'\n\t| 'tool.cloud'\n\t| 'tool.diamond'\n\t| 'tool.ellipse'\n\t| 'tool.hexagon'\n\t| 'tool.highlight'\n\t| 'tool.line'\n\t| 'tool.octagon'\n\t| 'tool.oval'\n\t| 'tool.pentagon'\n\t| 'tool.rectangle'\n\t| 'tool.rhombus'\n\t| 'tool.star'\n\t| 'tool.trapezoid'\n\t| 'tool.triangle'\n\t| 'tool.x-box'\n\t| 'tool.check-box'\n\t| 'tool.asset'\n\t| 'tool.frame'\n\t| 'tool.note'\n\t| 'tool.laser'\n\t| 'tool.embed'\n\t| 'tool.text'\n\t| 'menu.title'\n\t| 'menu.copy-as'\n\t| 'menu.edit'\n\t| 'menu.export-as'\n\t| 'menu.file'\n\t| 'menu.language'\n\t| 'menu.preferences'\n\t| 'menu.view'\n\t| 'context-menu.arrange'\n\t| 'context-menu.copy-as'\n\t| 'context-menu.export-as'\n\t| 'context-menu.move-to-page'\n\t| 'context-menu.reorder'\n\t| 'page-menu.title'\n\t| 'page-menu.create-new-page'\n\t| 'page-menu.max-page-count-reached'\n\t| 'page-menu.new-page-initial-name'\n\t| 'page-menu.edit-start'\n\t| 'page-menu.edit-done'\n\t| 'page-menu.go-to-page'\n\t| 'page-menu.submenu.rename'\n\t| 'page-menu.submenu.duplicate-page'\n\t| 'page-menu.submenu.title'\n\t| 'page-menu.submenu.move-down'\n\t| 'page-menu.submenu.move-up'\n\t| 'page-menu.submenu.delete'\n\t| 'share-menu.title'\n\t| 'share-menu.save-note'\n\t| 'share-menu.fork-note'\n\t| 'share-menu.share-project'\n\t| 'share-menu.default-project-name'\n\t| 'share-menu.copy-link'\n\t| 'share-menu.readonly-link'\n\t| 'share-menu.create-snapshot-link'\n\t| 'share-menu.snapshot-link-note'\n\t| 'share-menu.copy-readonly-link'\n\t| 'share-menu.offline-note'\n\t| 'share-menu.copy-link-note'\n\t| 'share-menu.copy-readonly-link-note'\n\t| 'share-menu.project-too-large'\n\t| 'share-menu.upload-failed'\n\t| 'status.offline'\n\t| 'status.online'\n\t| 'people-menu.title'\n\t| 'people-menu.change-name'\n\t| 'people-menu.change-color'\n\t| 'people-menu.follow'\n\t| 'people-menu.following'\n\t| 'people-menu.leading'\n\t| 'people-menu.user'\n\t| 'people-menu.invite'\n\t| 'help-menu.title'\n\t| 'help-menu.about'\n\t| 'help-menu.discord'\n\t| 'help-menu.github'\n\t| 'help-menu.keyboard-shortcuts'\n\t| 'help-menu.twitter'\n\t| 'actions-menu.title'\n\t| 'edit-link-dialog.title'\n\t| 'edit-link-dialog.invalid-url'\n\t| 'edit-link-dialog.detail'\n\t| 'edit-link-dialog.url'\n\t| 'edit-link-dialog.clear'\n\t| 'edit-link-dialog.save'\n\t| 'edit-link-dialog.cancel'\n\t| 'embed-dialog.title'\n\t| 'embed-dialog.back'\n\t| 'embed-dialog.create'\n\t| 'embed-dialog.cancel'\n\t| 'embed-dialog.url'\n\t| 'embed-dialog.instruction'\n\t| 'embed-dialog.invalid-url'\n\t| 'edit-pages-dialog.move-down'\n\t| 'edit-pages-dialog.move-up'\n\t| 'shortcuts-dialog.title'\n\t| 'shortcuts-dialog.edit'\n\t| 'shortcuts-dialog.file'\n\t| 'shortcuts-dialog.preferences'\n\t| 'shortcuts-dialog.tools'\n\t| 'shortcuts-dialog.transform'\n\t| 'shortcuts-dialog.view'\n\t| 'shortcuts-dialog.collaboration'\n\t| 'home-project-dialog.title'\n\t| 'home-project-dialog.description'\n\t| 'rename-project-dialog.title'\n\t| 'rename-project-dialog.cancel'\n\t| 'rename-project-dialog.rename'\n\t| 'home-project-dialog.ok'\n\t| 'style-panel.title'\n\t| 'style-panel.align'\n\t| 'style-panel.vertical-align'\n\t| 'style-panel.position'\n\t| 'style-panel.arrowheads'\n\t| 'style-panel.arrowhead-start'\n\t| 'style-panel.arrowhead-end'\n\t| 'style-panel.color'\n\t| 'style-panel.dash'\n\t| 'style-panel.fill'\n\t| 'style-panel.font'\n\t| 'style-panel.geo'\n\t| 'style-panel.mixed'\n\t| 'style-panel.opacity'\n\t| 'style-panel.size'\n\t| 'style-panel.spline'\n\t| 'tool-panel.drawing'\n\t| 'tool-panel.shapes'\n\t| 'tool-panel.more'\n\t| 'debug-panel.more'\n\t| 'navigation-zone.toggle-minimap'\n\t| 'navigation-zone.zoom'\n\t| 'focus-mode.toggle-focus-mode'\n\t| 'toast.close'\n\t| 'file-system.file-open-error.title'\n\t| 'file-system.file-open-error.not-a-tldraw-file'\n\t| 'file-system.file-open-error.file-format-version-too-new'\n\t| 'file-system.file-open-error.generic-corrupted-file'\n\t| 'file-system.confirm-open.title'\n\t| 'file-system.confirm-open.description'\n\t| 'file-system.confirm-open.cancel'\n\t| 'file-system.confirm-open.open'\n\t| 'file-system.confirm-open.dont-show-again'\n\t| 'file-system.confirm-clear.title'\n\t| 'file-system.confirm-clear.description'\n\t| 'file-system.confirm-clear.cancel'\n\t| 'file-system.confirm-clear.continue'\n\t| 'file-system.confirm-clear.dont-show-again'\n\t| 'file-system.shared-document-file-open-error.title'\n\t| 'file-system.shared-document-file-open-error.description'\n\t| 'sharing.confirm-leave.title'\n\t| 'sharing.confirm-leave.description'\n\t| 'sharing.confirm-leave.cancel'\n\t| 'sharing.confirm-leave.leave'\n\t| 'sharing.confirm-leave.dont-show-again'\n\t| 'toast.error.export-fail.title'\n\t| 'toast.error.export-fail.desc'\n\t| 'toast.error.copy-fail.title'\n\t| 'toast.error.copy-fail.desc'\n\t| 'context.pages.new-page'\n\t| 'vscode.file-open.desc'\n\t| 'vscode.file-open.open'\n\t| 'vscode.file-open.backup'\n\t| 'vscode.file-open.backup-saved'\n\t| 'vscode.file-open.backup-failed'\n\t| 'vscode.file-open.dont-show-again'\n\t| 'cursor-chat.type-to-chat'\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -100,6 +100,8 @@ const DEFAULT_TRANSLATION = {
100
100
  "action.toggle-dark-mode": "Toggle dark mode",
101
101
  "action.toggle-reduce-motion.menu": "Reduce motion",
102
102
  "action.toggle-reduce-motion": "Toggle reduce motion",
103
+ "action.toggle-edge-scrolling.menu": "Edge scrolling",
104
+ "action.toggle-edge-scrolling": "Toggle edge scrolling",
103
105
  "action.toggle-debug-mode.menu": "Debug mode",
104
106
  "action.toggle-debug-mode": "Toggle debug mode",
105
107
  "action.toggle-focus-mode.menu": "Focus mode",