tldraw 4.3.0-canary.ef37ae623ce8 → 4.3.0-canary.ef709265bb13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cjs/index.d.ts +3 -0
- package/dist-cjs/index.js +2 -1
- package/dist-cjs/index.js.map +2 -2
- package/dist-cjs/lib/canvas/TldrawSelectionForeground.js +2 -2
- package/dist-cjs/lib/canvas/TldrawSelectionForeground.js.map +2 -2
- package/dist-cjs/lib/shapes/arrow/ArrowShapeUtil.js +5 -10
- package/dist-cjs/lib/shapes/arrow/ArrowShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/draw/DrawShapeUtil.js +3 -3
- package/dist-cjs/lib/shapes/draw/DrawShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/frame/FrameShapeUtil.js +1 -1
- package/dist-cjs/lib/shapes/frame/FrameShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/geo/GeoShapeUtil.js +3 -4
- package/dist-cjs/lib/shapes/geo/GeoShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/highlight/HighlightShapeUtil.js +1 -1
- package/dist-cjs/lib/shapes/highlight/HighlightShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/note/NoteShapeUtil.js +4 -5
- package/dist-cjs/lib/shapes/note/NoteShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/HyperlinkButton.js +2 -1
- package/dist-cjs/lib/shapes/shared/HyperlinkButton.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/ShapeFill.js +2 -2
- package/dist-cjs/lib/shapes/shared/ShapeFill.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/{useForceSolid.js → useEfficientZoomThreshold.js} +10 -7
- package/dist-cjs/lib/shapes/shared/useEfficientZoomThreshold.js.map +7 -0
- package/dist-cjs/lib/shapes/shared/useImageOrVideoAsset.js +1 -1
- package/dist-cjs/lib/shapes/shared/useImageOrVideoAsset.js.map +2 -2
- package/dist-cjs/lib/shapes/video/VideoShapeUtil.js +1 -1
- package/dist-cjs/lib/shapes/video/VideoShapeUtil.js.map +2 -2
- package/dist-cjs/lib/ui/components/ActionsMenu/DefaultActionsMenuContent.js +3 -9
- package/dist-cjs/lib/ui/components/ActionsMenu/DefaultActionsMenuContent.js.map +2 -2
- package/dist-cjs/lib/ui/components/ZoomMenu/DefaultZoomMenu.js +1 -1
- package/dist-cjs/lib/ui/components/ZoomMenu/DefaultZoomMenu.js.map +2 -2
- package/dist-cjs/lib/ui/components/menu-items.js +3 -1
- package/dist-cjs/lib/ui/components/menu-items.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiSlider.js +1 -1
- package/dist-cjs/lib/ui/components/primitives/TldrawUiSlider.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiTooltip.js +143 -88
- package/dist-cjs/lib/ui/components/primitives/TldrawUiTooltip.js.map +2 -2
- package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuItem.js +1 -1
- package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuItem.js.map +2 -2
- package/dist-cjs/lib/ui/version.js +3 -3
- package/dist-cjs/lib/ui/version.js.map +1 -1
- package/dist-cjs/lib/utils/text/richText.js +7 -17
- package/dist-cjs/lib/utils/text/richText.js.map +3 -3
- package/dist-esm/index.d.mts +3 -0
- package/dist-esm/index.mjs +3 -1
- package/dist-esm/index.mjs.map +2 -2
- package/dist-esm/lib/canvas/TldrawSelectionForeground.mjs +2 -2
- package/dist-esm/lib/canvas/TldrawSelectionForeground.mjs.map +2 -2
- package/dist-esm/lib/shapes/arrow/ArrowShapeUtil.mjs +6 -12
- package/dist-esm/lib/shapes/arrow/ArrowShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/draw/DrawShapeUtil.mjs +3 -3
- package/dist-esm/lib/shapes/draw/DrawShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/frame/FrameShapeUtil.mjs +1 -1
- package/dist-esm/lib/shapes/frame/FrameShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/geo/GeoShapeUtil.mjs +3 -4
- package/dist-esm/lib/shapes/geo/GeoShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/highlight/HighlightShapeUtil.mjs +1 -1
- package/dist-esm/lib/shapes/highlight/HighlightShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/note/NoteShapeUtil.mjs +4 -5
- package/dist-esm/lib/shapes/note/NoteShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/HyperlinkButton.mjs +3 -2
- package/dist-esm/lib/shapes/shared/HyperlinkButton.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/ShapeFill.mjs +2 -2
- package/dist-esm/lib/shapes/shared/ShapeFill.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/useEfficientZoomThreshold.mjs +12 -0
- package/dist-esm/lib/shapes/shared/useEfficientZoomThreshold.mjs.map +7 -0
- package/dist-esm/lib/shapes/shared/useImageOrVideoAsset.mjs +1 -1
- package/dist-esm/lib/shapes/shared/useImageOrVideoAsset.mjs.map +2 -2
- package/dist-esm/lib/shapes/video/VideoShapeUtil.mjs +1 -1
- package/dist-esm/lib/shapes/video/VideoShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/ui/components/ActionsMenu/DefaultActionsMenuContent.mjs +2 -8
- package/dist-esm/lib/ui/components/ActionsMenu/DefaultActionsMenuContent.mjs.map +2 -2
- package/dist-esm/lib/ui/components/ZoomMenu/DefaultZoomMenu.mjs +1 -1
- package/dist-esm/lib/ui/components/ZoomMenu/DefaultZoomMenu.mjs.map +2 -2
- package/dist-esm/lib/ui/components/menu-items.mjs +3 -1
- package/dist-esm/lib/ui/components/menu-items.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiSlider.mjs +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiSlider.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/TldrawUiTooltip.mjs +151 -90
- package/dist-esm/lib/ui/components/primitives/TldrawUiTooltip.mjs.map +2 -2
- package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuItem.mjs +2 -2
- package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuItem.mjs.map +2 -2
- package/dist-esm/lib/ui/version.mjs +3 -3
- package/dist-esm/lib/ui/version.mjs.map +1 -1
- package/dist-esm/lib/utils/text/richText.mjs +3 -3
- package/dist-esm/lib/utils/text/richText.mjs.map +2 -2
- package/package.json +3 -3
- package/src/index.ts +1 -0
- package/src/lib/canvas/TldrawSelectionForeground.tsx +2 -2
- package/src/lib/shapes/arrow/ArrowShapeUtil.tsx +6 -11
- package/src/lib/shapes/draw/DrawShapeUtil.tsx +3 -3
- package/src/lib/shapes/frame/FrameShapeUtil.tsx +1 -1
- package/src/lib/shapes/geo/GeoShapeUtil.tsx +3 -4
- package/src/lib/shapes/highlight/HighlightShapeUtil.tsx +1 -1
- package/src/lib/shapes/note/NoteShapeUtil.tsx +6 -8
- package/src/lib/shapes/shared/HyperlinkButton.tsx +3 -2
- package/src/lib/shapes/shared/ShapeFill.tsx +2 -2
- package/src/lib/shapes/shared/useEfficientZoomThreshold.ts +10 -0
- package/src/lib/shapes/shared/useImageOrVideoAsset.ts +1 -1
- package/src/lib/shapes/video/VideoShapeUtil.tsx +2 -1
- package/src/lib/ui/components/ActionsMenu/DefaultActionsMenuContent.tsx +1 -9
- package/src/lib/ui/components/ZoomMenu/DefaultZoomMenu.tsx +1 -1
- package/src/lib/ui/components/menu-items.tsx +3 -1
- package/src/lib/ui/components/primitives/TldrawUiSlider.tsx +2 -2
- package/src/lib/ui/components/primitives/TldrawUiTooltip.tsx +196 -108
- package/src/lib/ui/components/primitives/menus/TldrawUiMenuItem.tsx +2 -2
- package/src/lib/ui/version.ts +3 -3
- package/src/lib/utils/text/richText.ts +3 -3
- package/src/test/commands/cameraState.test.ts +299 -0
- package/src/test/commands/putContent.test.ts +79 -1
- package/dist-cjs/lib/shapes/shared/useForceSolid.js.map +0 -7
- package/dist-esm/lib/shapes/shared/useForceSolid.mjs +0 -9
- package/dist-esm/lib/shapes/shared/useForceSolid.mjs.map +0 -7
- package/src/lib/shapes/shared/useForceSolid.ts +0 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/lib/utils/text/richText.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n\tExtension,\n\tExtensions,\n\tgenerateHTML,\n\tgenerateJSON,\n\tgenerateText,\n\tJSONContent,\n} from '@tiptap/core'\nimport Code from '@tiptap/extension-code'\nimport Highlight from '@tiptap/extension-highlight'\nimport { Node } from '@tiptap/pm/model'\nimport StarterKit from '@tiptap/starter-kit'\nimport {\n\tEditor,\n\tgetOwnProperty,\n\tRichTextFontVisitorState,\n\tTLFontFace,\n\tTLRichText,\n\tWeakCache,\n} from '@tldraw/editor'\nimport { DefaultFontFaces } from '../../shapes/shared/defaultFonts'\nimport { TextDirection } from './textDirection'\n\n/** @public */\nexport const KeyboardShiftEnterTweakExtension = Extension.create({\n\tname: 'keyboardShiftEnterHandler',\n\taddKeyboardShortcuts() {\n\t\treturn {\n\t\t\t// We don't support soft breaks, so we just use the default enter command.\n\t\t\t'Shift-Enter': ({ editor }) => editor.commands.enter(),\n\t\t}\n\t},\n})\n\n// We change the default Code to override what's in the StarterKit.\n// It allows for other attributes/extensions.\n// @ts-ignore this is fine.\nCode.config.excludes = undefined\n\n// We want the highlighting to take precedence over bolding/italics/links\n// as far as rendering is concerned. Otherwise, the highlighting\n// looks broken up.\nHighlight.config.priority = 1100\n\n/**\n * Default extensions for the TipTap editor.\n *\n * @public\n */\nexport const tipTapDefaultExtensions: Extensions = [\n\tStarterKit.configure({\n\t\tblockquote: false,\n\t\tcodeBlock: false,\n\t\thorizontalRule: false,\n\t\tlink: {\n\t\t\topenOnClick: false,\n\t\t\tautolink: true,\n\t\t},\n\t}),\n\tHighlight,\n\tKeyboardShiftEnterTweakExtension,\n\tTextDirection,\n]\n\n// todo: bust this if the editor changes, too\nconst htmlCache = new WeakCache<TLRichText, string>()\n\n/**\n * Renders HTML from a rich text string.\n *\n * @param editor - The editor instance.\n * @param richText - The rich text content.\n *\n * @public\n */\nexport function renderHtmlFromRichText(editor: Editor, richText: TLRichText) {\n\treturn htmlCache.get(richText, () => {\n\t\tconst tipTapExtensions =\n\t\t\teditor.getTextOptions().tipTapConfig?.extensions ?? tipTapDefaultExtensions\n\t\tconst html = generateHTML(richText as JSONContent, tipTapExtensions)\n\t\t// We replace empty paragraphs with a single line break to prevent the browser from collapsing them.\n\t\treturn html.replaceAll('<p dir=\"auto\"></p>', '<p><br /></p>') ?? ''\n\t})\n}\n\n/**\n * Renders HTML from a rich text string for measurement.\n * @param editor - The editor instance.\n * @param richText - The rich text content.\n *\n *\n * @public\n */\nexport function renderHtmlFromRichTextForMeasurement(editor: Editor, richText: TLRichText) {\n\tconst html = renderHtmlFromRichText(editor, richText)\n\treturn `<div class=\"tl-rich-text\">${html}</div>`\n}\n\n// A weak cache used to store plaintext that's been extracted from rich text.\nconst plainTextFromRichTextCache = new WeakCache<TLRichText, string>()\n\nexport function isEmptyRichText(richText: TLRichText) {\n\tif (richText.content.length === 1) {\n\t\tif (!(richText.content[0] as any).content) return true\n\t}\n\treturn false\n}\n\n/**\n * Renders plaintext from a rich text string.\n * @param editor - The editor instance.\n * @param richText - The rich text content.\n *\n *\n * @public\n */\nexport function renderPlaintextFromRichText(editor: Editor, richText: TLRichText) {\n\tif (isEmptyRichText(richText)) return ''\n\n\treturn plainTextFromRichTextCache.get(richText, () => {\n\t\tconst tipTapExtensions =\n\t\t\teditor.getTextOptions().tipTapConfig?.extensions ?? tipTapDefaultExtensions\n\t\treturn generateText(richText as JSONContent, tipTapExtensions, {\n\t\t\tblockSeparator: '\\n',\n\t\t})\n\t})\n}\n\n/**\n * Renders JSONContent from html.\n * @param editor - The editor instance.\n * @param richText - The rich text content.\n *\n *\n * @public\n */\nexport function renderRichTextFromHTML(editor: Editor, html: string): TLRichText {\n\tconst tipTapExtensions =\n\t\teditor.getTextOptions().tipTapConfig?.extensions ?? tipTapDefaultExtensions\n\treturn generateJSON(html, tipTapExtensions) as TLRichText\n}\n\n/** @public */\nexport function defaultAddFontsFromNode(\n\tnode: Node,\n\tstate: RichTextFontVisitorState,\n\taddFont: (font: TLFontFace) => void\n) {\n\tfor (const mark of node.marks) {\n\t\tif (mark.type.name === 'bold' && state.weight !== 'bold') {\n\t\t\tstate = { ...state, weight: 'bold' }\n\t\t}\n\t\tif (mark.type.name === 'italic' && state.style !== 'italic') {\n\t\t\tstate = { ...state, style: 'italic' }\n\t\t}\n\t\tif (mark.type.name === 'code' && state.family !== 'tldraw_mono') {\n\t\t\tstate = { ...state, family: 'tldraw_mono' }\n\t\t}\n\t}\n\n\tconst fontsForFamily = getOwnProperty(DefaultFontFaces, state.family)\n\tif (!fontsForFamily) return state\n\n\tconst fontsForStyle = getOwnProperty(fontsForFamily, state.style)\n\tif (!fontsForStyle) return state\n\n\tconst fontsForWeight = getOwnProperty(fontsForStyle, state.weight)\n\tif (!fontsForWeight) return state\n\n\taddFont(fontsForWeight)\n\n\treturn state\n}\n"],
|
|
5
|
-
"mappings": "AAAA;AAAA,EACC;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,OAEM;AACP,
|
|
4
|
+
"sourcesContent": ["import {\n\tExtension,\n\tExtensions,\n\tgenerateHTML,\n\tgenerateJSON,\n\tgenerateText,\n\tJSONContent,\n} from '@tiptap/core'\nimport { Code } from '@tiptap/extension-code'\nimport { Highlight } from '@tiptap/extension-highlight'\nimport { Node } from '@tiptap/pm/model'\nimport { StarterKit } from '@tiptap/starter-kit'\nimport {\n\tEditor,\n\tgetOwnProperty,\n\tRichTextFontVisitorState,\n\tTLFontFace,\n\tTLRichText,\n\tWeakCache,\n} from '@tldraw/editor'\nimport { DefaultFontFaces } from '../../shapes/shared/defaultFonts'\nimport { TextDirection } from './textDirection'\n\n/** @public */\nexport const KeyboardShiftEnterTweakExtension = Extension.create({\n\tname: 'keyboardShiftEnterHandler',\n\taddKeyboardShortcuts() {\n\t\treturn {\n\t\t\t// We don't support soft breaks, so we just use the default enter command.\n\t\t\t'Shift-Enter': ({ editor }) => editor.commands.enter(),\n\t\t}\n\t},\n})\n\n// We change the default Code to override what's in the StarterKit.\n// It allows for other attributes/extensions.\n// @ts-ignore this is fine.\nCode.config.excludes = undefined\n\n// We want the highlighting to take precedence over bolding/italics/links\n// as far as rendering is concerned. Otherwise, the highlighting\n// looks broken up.\nHighlight.config.priority = 1100\n\n/**\n * Default extensions for the TipTap editor.\n *\n * @public\n */\nexport const tipTapDefaultExtensions: Extensions = [\n\tStarterKit.configure({\n\t\tblockquote: false,\n\t\tcodeBlock: false,\n\t\thorizontalRule: false,\n\t\tlink: {\n\t\t\topenOnClick: false,\n\t\t\tautolink: true,\n\t\t},\n\t}),\n\tHighlight,\n\tKeyboardShiftEnterTweakExtension,\n\tTextDirection,\n]\n\n// todo: bust this if the editor changes, too\nconst htmlCache = new WeakCache<TLRichText, string>()\n\n/**\n * Renders HTML from a rich text string.\n *\n * @param editor - The editor instance.\n * @param richText - The rich text content.\n *\n * @public\n */\nexport function renderHtmlFromRichText(editor: Editor, richText: TLRichText) {\n\treturn htmlCache.get(richText, () => {\n\t\tconst tipTapExtensions =\n\t\t\teditor.getTextOptions().tipTapConfig?.extensions ?? tipTapDefaultExtensions\n\t\tconst html = generateHTML(richText as JSONContent, tipTapExtensions)\n\t\t// We replace empty paragraphs with a single line break to prevent the browser from collapsing them.\n\t\treturn html.replaceAll('<p dir=\"auto\"></p>', '<p><br /></p>') ?? ''\n\t})\n}\n\n/**\n * Renders HTML from a rich text string for measurement.\n * @param editor - The editor instance.\n * @param richText - The rich text content.\n *\n *\n * @public\n */\nexport function renderHtmlFromRichTextForMeasurement(editor: Editor, richText: TLRichText) {\n\tconst html = renderHtmlFromRichText(editor, richText)\n\treturn `<div class=\"tl-rich-text\">${html}</div>`\n}\n\n// A weak cache used to store plaintext that's been extracted from rich text.\nconst plainTextFromRichTextCache = new WeakCache<TLRichText, string>()\n\nexport function isEmptyRichText(richText: TLRichText) {\n\tif (richText.content.length === 1) {\n\t\tif (!(richText.content[0] as any).content) return true\n\t}\n\treturn false\n}\n\n/**\n * Renders plaintext from a rich text string.\n * @param editor - The editor instance.\n * @param richText - The rich text content.\n *\n *\n * @public\n */\nexport function renderPlaintextFromRichText(editor: Editor, richText: TLRichText) {\n\tif (isEmptyRichText(richText)) return ''\n\n\treturn plainTextFromRichTextCache.get(richText, () => {\n\t\tconst tipTapExtensions =\n\t\t\teditor.getTextOptions().tipTapConfig?.extensions ?? tipTapDefaultExtensions\n\t\treturn generateText(richText as JSONContent, tipTapExtensions, {\n\t\t\tblockSeparator: '\\n',\n\t\t})\n\t})\n}\n\n/**\n * Renders JSONContent from html.\n * @param editor - The editor instance.\n * @param richText - The rich text content.\n *\n *\n * @public\n */\nexport function renderRichTextFromHTML(editor: Editor, html: string): TLRichText {\n\tconst tipTapExtensions =\n\t\teditor.getTextOptions().tipTapConfig?.extensions ?? tipTapDefaultExtensions\n\treturn generateJSON(html, tipTapExtensions) as TLRichText\n}\n\n/** @public */\nexport function defaultAddFontsFromNode(\n\tnode: Node,\n\tstate: RichTextFontVisitorState,\n\taddFont: (font: TLFontFace) => void\n) {\n\tfor (const mark of node.marks) {\n\t\tif (mark.type.name === 'bold' && state.weight !== 'bold') {\n\t\t\tstate = { ...state, weight: 'bold' }\n\t\t}\n\t\tif (mark.type.name === 'italic' && state.style !== 'italic') {\n\t\t\tstate = { ...state, style: 'italic' }\n\t\t}\n\t\tif (mark.type.name === 'code' && state.family !== 'tldraw_mono') {\n\t\t\tstate = { ...state, family: 'tldraw_mono' }\n\t\t}\n\t}\n\n\tconst fontsForFamily = getOwnProperty(DefaultFontFaces, state.family)\n\tif (!fontsForFamily) return state\n\n\tconst fontsForStyle = getOwnProperty(fontsForFamily, state.style)\n\tif (!fontsForStyle) return state\n\n\tconst fontsForWeight = getOwnProperty(fontsForStyle, state.weight)\n\tif (!fontsForWeight) return state\n\n\taddFont(fontsForWeight)\n\n\treturn state\n}\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA,EACC;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,OAEM;AACP,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAE1B,SAAS,kBAAkB;AAC3B;AAAA,EAEC;AAAA,EAIA;AAAA,OACM;AACP,SAAS,wBAAwB;AACjC,SAAS,qBAAqB;AAGvB,MAAM,mCAAmC,UAAU,OAAO;AAAA,EAChE,MAAM;AAAA,EACN,uBAAuB;AACtB,WAAO;AAAA;AAAA,MAEN,eAAe,CAAC,EAAE,OAAO,MAAM,OAAO,SAAS,MAAM;AAAA,IACtD;AAAA,EACD;AACD,CAAC;AAKD,KAAK,OAAO,WAAW;AAKvB,UAAU,OAAO,WAAW;AAOrB,MAAM,0BAAsC;AAAA,EAClD,WAAW,UAAU;AAAA,IACpB,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,gBAAgB;AAAA,IAChB,MAAM;AAAA,MACL,aAAa;AAAA,MACb,UAAU;AAAA,IACX;AAAA,EACD,CAAC;AAAA,EACD;AAAA,EACA;AAAA,EACA;AACD;AAGA,MAAM,YAAY,IAAI,UAA8B;AAU7C,SAAS,uBAAuB,QAAgB,UAAsB;AAC5E,SAAO,UAAU,IAAI,UAAU,MAAM;AACpC,UAAM,mBACL,OAAO,eAAe,EAAE,cAAc,cAAc;AACrD,UAAM,OAAO,aAAa,UAAyB,gBAAgB;AAEnE,WAAO,KAAK,WAAW,sBAAsB,eAAe,KAAK;AAAA,EAClE,CAAC;AACF;AAUO,SAAS,qCAAqC,QAAgB,UAAsB;AAC1F,QAAM,OAAO,uBAAuB,QAAQ,QAAQ;AACpD,SAAO,6BAA6B,IAAI;AACzC;AAGA,MAAM,6BAA6B,IAAI,UAA8B;AAE9D,SAAS,gBAAgB,UAAsB;AACrD,MAAI,SAAS,QAAQ,WAAW,GAAG;AAClC,QAAI,CAAE,SAAS,QAAQ,CAAC,EAAU,QAAS,QAAO;AAAA,EACnD;AACA,SAAO;AACR;AAUO,SAAS,4BAA4B,QAAgB,UAAsB;AACjF,MAAI,gBAAgB,QAAQ,EAAG,QAAO;AAEtC,SAAO,2BAA2B,IAAI,UAAU,MAAM;AACrD,UAAM,mBACL,OAAO,eAAe,EAAE,cAAc,cAAc;AACrD,WAAO,aAAa,UAAyB,kBAAkB;AAAA,MAC9D,gBAAgB;AAAA,IACjB,CAAC;AAAA,EACF,CAAC;AACF;AAUO,SAAS,uBAAuB,QAAgB,MAA0B;AAChF,QAAM,mBACL,OAAO,eAAe,EAAE,cAAc,cAAc;AACrD,SAAO,aAAa,MAAM,gBAAgB;AAC3C;AAGO,SAAS,wBACf,MACA,OACA,SACC;AACD,aAAW,QAAQ,KAAK,OAAO;AAC9B,QAAI,KAAK,KAAK,SAAS,UAAU,MAAM,WAAW,QAAQ;AACzD,cAAQ,EAAE,GAAG,OAAO,QAAQ,OAAO;AAAA,IACpC;AACA,QAAI,KAAK,KAAK,SAAS,YAAY,MAAM,UAAU,UAAU;AAC5D,cAAQ,EAAE,GAAG,OAAO,OAAO,SAAS;AAAA,IACrC;AACA,QAAI,KAAK,KAAK,SAAS,UAAU,MAAM,WAAW,eAAe;AAChE,cAAQ,EAAE,GAAG,OAAO,QAAQ,cAAc;AAAA,IAC3C;AAAA,EACD;AAEA,QAAM,iBAAiB,eAAe,kBAAkB,MAAM,MAAM;AACpE,MAAI,CAAC,eAAgB,QAAO;AAE5B,QAAM,gBAAgB,eAAe,gBAAgB,MAAM,KAAK;AAChE,MAAI,CAAC,cAAe,QAAO;AAE3B,QAAM,iBAAiB,eAAe,eAAe,MAAM,MAAM;AACjE,MAAI,CAAC,eAAgB,QAAO;AAE5B,UAAQ,cAAc;AAEtB,SAAO;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tldraw",
|
|
3
3
|
"description": "A tiny little drawing editor.",
|
|
4
|
-
"version": "4.3.0-canary.
|
|
4
|
+
"version": "4.3.0-canary.ef709265bb13",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "tldraw Inc.",
|
|
7
7
|
"email": "hello@tldraw.com"
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"@tiptap/pm": "^3.6.2",
|
|
63
63
|
"@tiptap/react": "^3.6.2",
|
|
64
64
|
"@tiptap/starter-kit": "^3.6.2",
|
|
65
|
-
"@tldraw/editor": "4.3.0-canary.
|
|
66
|
-
"@tldraw/store": "4.3.0-canary.
|
|
65
|
+
"@tldraw/editor": "4.3.0-canary.ef709265bb13",
|
|
66
|
+
"@tldraw/store": "4.3.0-canary.ef709265bb13",
|
|
67
67
|
"classnames": "^2.5.1",
|
|
68
68
|
"hotkeys-js": "^3.13.9",
|
|
69
69
|
"idb": "^7.1.1",
|
package/src/index.ts
CHANGED
|
@@ -63,7 +63,7 @@ export const TldrawSelectionForeground = track(function TldrawSelectionForegroun
|
|
|
63
63
|
|
|
64
64
|
if (onlyShape && editor.isShapeHidden(onlyShape)) return null
|
|
65
65
|
|
|
66
|
-
const zoom = editor.
|
|
66
|
+
const zoom = editor.getEfficientZoomLevel()
|
|
67
67
|
const isChangingStyle = editor.getInstanceState().isChangingStyle
|
|
68
68
|
|
|
69
69
|
const width = expandedBounds.width
|
|
@@ -532,7 +532,7 @@ export const MobileRotateHandle = function RotateHandle({
|
|
|
532
532
|
const events = useSelectionEvents('mobile_rotate')
|
|
533
533
|
|
|
534
534
|
const editor = useEditor()
|
|
535
|
-
const zoom = useValue('zoom level', () => editor.
|
|
535
|
+
const zoom = useValue('zoom level', () => editor.getEfficientZoomLevel(), [editor])
|
|
536
536
|
const bgRadius = Math.max(14 * (1 / zoom), 20 / Math.max(1, zoom))
|
|
537
537
|
const msg = useTranslation()
|
|
538
538
|
return (
|
|
@@ -45,7 +45,6 @@ import {
|
|
|
45
45
|
useEditor,
|
|
46
46
|
useIsEditing,
|
|
47
47
|
useSharedSafeId,
|
|
48
|
-
useValue,
|
|
49
48
|
} from '@tldraw/editor'
|
|
50
49
|
import React, { useMemo } from 'react'
|
|
51
50
|
import { updateArrowTerminal } from '../../bindings/arrow/ArrowBindingUtil'
|
|
@@ -56,6 +55,7 @@ import { ShapeFill } from '../shared/ShapeFill'
|
|
|
56
55
|
import { ARROW_LABEL_PADDING, STROKE_SIZES, TEXT_PROPS } from '../shared/default-shape-constants'
|
|
57
56
|
import { getFillDefForCanvas, getFillDefForExport } from '../shared/defaultStyleDefs'
|
|
58
57
|
import { useDefaultColorTheme } from '../shared/useDefaultColorTheme'
|
|
58
|
+
import { useEfficientZoomThreshold } from '../shared/useEfficientZoomThreshold'
|
|
59
59
|
import { getArrowBodyPath, getArrowHandlePath } from './ArrowPath'
|
|
60
60
|
import { ArrowShapeOptions } from './arrow-types'
|
|
61
61
|
import {
|
|
@@ -269,7 +269,7 @@ export class ArrowShapeUtil extends ShapeUtil<TLArrowShape> {
|
|
|
269
269
|
|
|
270
270
|
const segmentStart = shapePageTransform.applyToPoint(info.route.midpointHandle.segmentStart)
|
|
271
271
|
const segmentEnd = shapePageTransform.applyToPoint(info.route.midpointHandle.segmentEnd)
|
|
272
|
-
const segmentLength = Vec.Dist(segmentStart, segmentEnd) * this.editor.
|
|
272
|
+
const segmentLength = Vec.Dist(segmentStart, segmentEnd) * this.editor.getEfficientZoomLevel()
|
|
273
273
|
|
|
274
274
|
if (segmentLength > this.options.elbowMinSegmentLengthToShowMidpointHandle) {
|
|
275
275
|
handles.push({
|
|
@@ -369,7 +369,8 @@ export class ArrowShapeUtil extends ShapeUtil<TLArrowShape> {
|
|
|
369
369
|
|
|
370
370
|
// we want to snap to certain points. the maximum distance at which a snap will occur is
|
|
371
371
|
// relative to the zoom level:
|
|
372
|
-
const maxSnapDistance =
|
|
372
|
+
const maxSnapDistance =
|
|
373
|
+
this.options.elbowMidpointSnapDistance / this.editor.getEfficientZoomLevel()
|
|
373
374
|
|
|
374
375
|
// we snap to the midpoint of the range by default
|
|
375
376
|
const midPoint = perpDistanceToLineAngle(
|
|
@@ -1005,13 +1006,7 @@ const ArrowSvg = track(function ArrowSvg({
|
|
|
1005
1006
|
const editor = useEditor()
|
|
1006
1007
|
const theme = useDefaultColorTheme()
|
|
1007
1008
|
const info = getArrowInfo(editor, shape)
|
|
1008
|
-
const isForceSolid =
|
|
1009
|
-
'force solid',
|
|
1010
|
-
() => {
|
|
1011
|
-
return editor.getZoomLevel() < 0.2
|
|
1012
|
-
},
|
|
1013
|
-
[editor]
|
|
1014
|
-
)
|
|
1009
|
+
const isForceSolid = useEfficientZoomThreshold(shape.props.scale * 0.25)
|
|
1015
1010
|
const clipPathId = useSharedSafeId(shape.id + '_clip')
|
|
1016
1011
|
const arrowheadDotId = useSharedSafeId('arrowhead-dot')
|
|
1017
1012
|
const arrowheadCrossId = useSharedSafeId('arrowhead-cross')
|
|
@@ -1037,7 +1032,7 @@ const ArrowSvg = track(function ArrowSvg({
|
|
|
1037
1032
|
start: 'skip',
|
|
1038
1033
|
end: 'skip',
|
|
1039
1034
|
lengthRatio: 2.5,
|
|
1040
|
-
strokeWidth: 2 / editor.
|
|
1035
|
+
strokeWidth: 2 / editor.getEfficientZoomLevel(),
|
|
1041
1036
|
props: {
|
|
1042
1037
|
className: 'tl-arrow-hint',
|
|
1043
1038
|
markerStart: bindings.start
|
|
@@ -139,7 +139,7 @@ export class DrawShapeUtil extends ShapeUtil<TLDrawShape> {
|
|
|
139
139
|
const forceSolid = useValue(
|
|
140
140
|
'force solid',
|
|
141
141
|
() => {
|
|
142
|
-
const zoomLevel = this.editor.
|
|
142
|
+
const zoomLevel = this.editor.getEfficientZoomLevel()
|
|
143
143
|
return zoomLevel < 0.5 && zoomLevel < 1.5 / sw
|
|
144
144
|
},
|
|
145
145
|
[this.editor, sw]
|
|
@@ -244,7 +244,7 @@ function DrawShapeSvg({ shape, zoomOverride }: { shape: TLDrawShape; zoomOverrid
|
|
|
244
244
|
const forceSolid = useValue(
|
|
245
245
|
'force solid',
|
|
246
246
|
() => {
|
|
247
|
-
const zoomLevel = zoomOverride ?? editor.
|
|
247
|
+
const zoomLevel = zoomOverride ?? editor.getEfficientZoomLevel()
|
|
248
248
|
return zoomLevel < 0.5 && zoomLevel < 1.5 / sw
|
|
249
249
|
},
|
|
250
250
|
[editor, sw, zoomOverride]
|
|
@@ -253,7 +253,7 @@ function DrawShapeSvg({ shape, zoomOverride }: { shape: TLDrawShape; zoomOverrid
|
|
|
253
253
|
const dotAdjustment = useValue(
|
|
254
254
|
'dot adjustment',
|
|
255
255
|
() => {
|
|
256
|
-
const zoomLevel = zoomOverride ?? editor.
|
|
256
|
+
const zoomLevel = zoomOverride ?? editor.getEfficientZoomLevel()
|
|
257
257
|
// If we're zoomed way out (10%), then we need to make the dotted line go to 9 instead 0.1
|
|
258
258
|
// Chrome doesn't render anything otherwise.
|
|
259
259
|
return zoomLevel < 0.2 ? 0 : 0.1
|
|
@@ -115,7 +115,7 @@ export class FrameShapeUtil extends BaseBoxShapeUtil<TLFrameShape> {
|
|
|
115
115
|
override getGeometry(shape: TLFrameShape): Geometry2d {
|
|
116
116
|
const { editor } = this
|
|
117
117
|
|
|
118
|
-
const z = editor.
|
|
118
|
+
const z = editor.getEfficientZoomLevel()
|
|
119
119
|
|
|
120
120
|
// Which dimension measures the top edge after rotation?
|
|
121
121
|
const labelSide = getFrameHeadingSide(editor, shape)
|
|
@@ -43,6 +43,7 @@ import {
|
|
|
43
43
|
import { getFillDefForCanvas, getFillDefForExport } from '../shared/defaultStyleDefs'
|
|
44
44
|
import { useDefaultColorTheme } from '../shared/useDefaultColorTheme'
|
|
45
45
|
import { useIsReadyForEditing } from '../shared/useEditablePlainText'
|
|
46
|
+
import { useEfficientZoomThreshold } from '../shared/useEfficientZoomThreshold'
|
|
46
47
|
import { GeoShapeBody } from './components/GeoShapeBody'
|
|
47
48
|
import { getGeoShapePath } from './getGeoShapePath'
|
|
48
49
|
|
|
@@ -195,7 +196,7 @@ export class GeoShapeUtil extends BaseBoxShapeUtil<TLGeoShape> {
|
|
|
195
196
|
const isReadyForEditing = useIsReadyForEditing(editor, shape.id)
|
|
196
197
|
const isEmpty = isEmptyRichText(shape.props.richText)
|
|
197
198
|
const showHtmlContainer = isReadyForEditing || !isEmpty
|
|
198
|
-
const isForceSolid =
|
|
199
|
+
const isForceSolid = useEfficientZoomThreshold(shape.props.scale * 0.25)
|
|
199
200
|
|
|
200
201
|
return (
|
|
201
202
|
<>
|
|
@@ -233,9 +234,7 @@ export class GeoShapeUtil extends BaseBoxShapeUtil<TLGeoShape> {
|
|
|
233
234
|
}
|
|
234
235
|
|
|
235
236
|
indicator(shape: TLGeoShape) {
|
|
236
|
-
const isZoomedOut =
|
|
237
|
-
this.editor,
|
|
238
|
-
])
|
|
237
|
+
const isZoomedOut = useEfficientZoomThreshold(shape.props.scale * 0.25)
|
|
239
238
|
|
|
240
239
|
const { size, dash, scale } = shape.props
|
|
241
240
|
const strokeWidth = STROKE_SIZES[size]
|
|
@@ -315,7 +315,7 @@ function useHighlightForceSolid(editor: Editor, shape: TLHighlightShape) {
|
|
|
315
315
|
'forceSolid',
|
|
316
316
|
() => {
|
|
317
317
|
const sw = getStrokeWidth(shape)
|
|
318
|
-
const zoomLevel = editor.
|
|
318
|
+
const zoomLevel = editor.getEfficientZoomLevel()
|
|
319
319
|
if (sw / zoomLevel < 1.5) {
|
|
320
320
|
return true
|
|
321
321
|
}
|
|
@@ -50,6 +50,7 @@ import {
|
|
|
50
50
|
} from '../shared/default-shape-constants'
|
|
51
51
|
import { useDefaultColorTheme } from '../shared/useDefaultColorTheme'
|
|
52
52
|
import { useIsReadyForEditing } from '../shared/useEditablePlainText'
|
|
53
|
+
import { useEfficientZoomThreshold } from '../shared/useEfficientZoomThreshold'
|
|
53
54
|
import {
|
|
54
55
|
CLONE_HANDLE_MARGIN,
|
|
55
56
|
NOTE_CENTER_OFFSET,
|
|
@@ -158,7 +159,7 @@ export class NoteShapeUtil extends ShapeUtil<TLNoteShape> {
|
|
|
158
159
|
const isCoarsePointer = this.editor.getInstanceState().isCoarsePointer
|
|
159
160
|
if (isCoarsePointer) return []
|
|
160
161
|
|
|
161
|
-
const zoom = this.editor.
|
|
162
|
+
const zoom = this.editor.getEfficientZoomLevel()
|
|
162
163
|
if (zoom * scale < 0.25) return []
|
|
163
164
|
|
|
164
165
|
const nh = getNoteHeight(shape)
|
|
@@ -268,15 +269,12 @@ export class NoteShapeUtil extends ShapeUtil<TLNoteShape> {
|
|
|
268
269
|
[this.editor]
|
|
269
270
|
)
|
|
270
271
|
|
|
271
|
-
// todo: consider hiding shadows on dark mode if they're invisible anyway
|
|
272
|
-
|
|
273
|
-
const hideShadows = useValue('zoom', () => this.editor.getZoomLevel() < 0.35 / scale, [
|
|
274
|
-
scale,
|
|
275
|
-
this.editor,
|
|
276
|
-
])
|
|
277
|
-
|
|
278
272
|
const isDarkMode = useValue('dark mode', () => this.editor.user.getIsDarkMode(), [this.editor])
|
|
279
273
|
|
|
274
|
+
// Shadows are hidden when zoomed out far enough or in dark mode
|
|
275
|
+
let hideShadows = useEfficientZoomThreshold(scale * 0.25)
|
|
276
|
+
if (isDarkMode) hideShadows = true
|
|
277
|
+
|
|
280
278
|
const isSelected = shape.id === this.editor.getOnlySelectedShapeId()
|
|
281
279
|
|
|
282
280
|
const isReadyForEditing = useIsReadyForEditing(this.editor, shape.id)
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { useEditor
|
|
1
|
+
import { useEditor } from '@tldraw/editor'
|
|
2
2
|
import classNames from 'classnames'
|
|
3
3
|
import { PointerEventHandler, useCallback } from 'react'
|
|
4
|
+
import { useEfficientZoomThreshold } from './useEfficientZoomThreshold'
|
|
4
5
|
|
|
5
6
|
const LINK_ICON =
|
|
6
7
|
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' fill='none'%3E%3Cpath stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M13 5H7a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6M19 5h6m0 0v6m0-6L13 17'/%3E%3C/svg%3E"
|
|
7
8
|
|
|
8
9
|
export function HyperlinkButton({ url }: { url: string }) {
|
|
9
10
|
const editor = useEditor()
|
|
10
|
-
const hideButton =
|
|
11
|
+
const hideButton = useEfficientZoomThreshold()
|
|
11
12
|
const markAsHandledOnShiftKey = useCallback<PointerEventHandler>(
|
|
12
13
|
(e) => {
|
|
13
14
|
if (!editor.inputs.shiftKey) editor.markEventAsHandled(e)
|
|
@@ -50,10 +50,10 @@ export const ShapeFill = React.memo(function ShapeFill({
|
|
|
50
50
|
export function PatternFill({ d, color, theme }: ShapeFillProps) {
|
|
51
51
|
const editor = useEditor()
|
|
52
52
|
const svgExport = useSvgExportContext()
|
|
53
|
-
const zoomLevel = useValue('zoomLevel', () => editor.
|
|
53
|
+
const zoomLevel = useValue('zoomLevel', () => editor.getEfficientZoomLevel(), [editor])
|
|
54
54
|
const getHashPatternZoomName = useGetHashPatternZoomName()
|
|
55
55
|
|
|
56
|
-
const teenyTiny =
|
|
56
|
+
const teenyTiny = zoomLevel <= 0.18
|
|
57
57
|
|
|
58
58
|
return (
|
|
59
59
|
<>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useEditor, useValue } from '@tldraw/editor'
|
|
2
|
+
|
|
3
|
+
/** Returns true when zoomed out far enough that shapes should render in a simplified "solid" style. */
|
|
4
|
+
export function useEfficientZoomThreshold(threshold = 0.25) {
|
|
5
|
+
const editor = useEditor()
|
|
6
|
+
return useValue('efficient zoom threshold', () => editor.getEfficientZoomLevel() < threshold, [
|
|
7
|
+
editor,
|
|
8
|
+
threshold,
|
|
9
|
+
])
|
|
10
|
+
}
|
|
@@ -96,7 +96,7 @@ export function useImageOrVideoAsset({ shapeId, assetId, width }: UseImageOrVide
|
|
|
96
96
|
|
|
97
97
|
const screenScale = exportInfo
|
|
98
98
|
? exportInfo.scale * (width / asset.props.w)
|
|
99
|
-
: editor.
|
|
99
|
+
: editor.getEfficientZoomLevel() * (width / asset.props.w)
|
|
100
100
|
|
|
101
101
|
function resolve(asset: TLImageAsset | TLVideoAsset, url: string | null) {
|
|
102
102
|
if (isCancelled) return // don't update if the hook has remounted
|
|
@@ -95,7 +95,8 @@ export class VideoShapeUtil extends BaseBoxShapeUtil<TLVideoShape> {
|
|
|
95
95
|
|
|
96
96
|
const VideoShape = memo(function VideoShape({ shape }: { shape: TLVideoShape }) {
|
|
97
97
|
const editor = useEditor()
|
|
98
|
-
const showControls =
|
|
98
|
+
const showControls =
|
|
99
|
+
editor.getShapeGeometry(shape).bounds.w * editor.getEfficientZoomLevel() >= 110
|
|
99
100
|
const isEditing = useIsEditing(shape.id)
|
|
100
101
|
const prefersReducedMotion = usePrefersReducedMotion()
|
|
101
102
|
const { Spinner } = useEditorComponents()
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useEditor, useValue } from '@tldraw/editor'
|
|
2
1
|
import { PORTRAIT_BREAKPOINT } from '../../constants'
|
|
3
2
|
import { useBreakpoint } from '../../context/breakpoints'
|
|
4
3
|
import {
|
|
@@ -9,6 +8,7 @@ import {
|
|
|
9
8
|
useThreeStackableItems,
|
|
10
9
|
useUnlockedSelectedShapesCount,
|
|
11
10
|
} from '../../hooks/menu-hooks'
|
|
11
|
+
import { ZoomTo100MenuItem } from '../menu-items'
|
|
12
12
|
import { TldrawUiMenuActionItem } from '../primitives/menus/TldrawUiMenuActionItem'
|
|
13
13
|
|
|
14
14
|
/** @public @react */
|
|
@@ -99,14 +99,6 @@ export function ZoomOrRotateMenuItem() {
|
|
|
99
99
|
}
|
|
100
100
|
/** @public @react */
|
|
101
101
|
|
|
102
|
-
export function ZoomTo100MenuItem() {
|
|
103
|
-
const editor = useEditor()
|
|
104
|
-
const isZoomedTo100 = useValue('zoom is 1', () => editor.getZoomLevel() === 1, [editor])
|
|
105
|
-
|
|
106
|
-
return <TldrawUiMenuActionItem actionId="zoom-to-100" disabled={isZoomedTo100} />
|
|
107
|
-
}
|
|
108
|
-
/** @public @react */
|
|
109
|
-
|
|
110
102
|
export function RotateCCWMenuItem() {
|
|
111
103
|
const oneSelected = useUnlockedSelectedShapesCount(1)
|
|
112
104
|
const isInSelectState = useIsInSelectState()
|
|
@@ -48,7 +48,7 @@ export const DefaultZoomMenu = memo(function DefaultZoomMenu({ children }: TLUiZ
|
|
|
48
48
|
const ZoomTriggerButton = () => {
|
|
49
49
|
const editor = useEditor()
|
|
50
50
|
const breakpoint = useBreakpoint()
|
|
51
|
-
const zoom = useValue('zoom', () => editor.
|
|
51
|
+
const zoom = useValue('zoom', () => editor.getEfficientZoomLevel(), [editor])
|
|
52
52
|
const msg = useTranslation()
|
|
53
53
|
|
|
54
54
|
const handleDoubleClick = useCallback(() => {
|
|
@@ -182,7 +182,9 @@ export function UnlockAllMenuItem() {
|
|
|
182
182
|
/** @public @react */
|
|
183
183
|
export function ZoomTo100MenuItem() {
|
|
184
184
|
const editor = useEditor()
|
|
185
|
-
const isZoomedTo100 = useValue('zoomed to 100', () => editor.
|
|
185
|
+
const isZoomedTo100 = useValue('zoomed to 100', () => editor.getEfficientZoomLevel() === 1, [
|
|
186
|
+
editor,
|
|
187
|
+
])
|
|
186
188
|
|
|
187
189
|
return <TldrawUiMenuActionItem actionId="zoom-to-100" noClose disabled={isZoomedTo100} />
|
|
188
190
|
}
|
|
@@ -3,7 +3,7 @@ import { Slider as _Slider } from 'radix-ui'
|
|
|
3
3
|
import React, { useCallback, useEffect, useState } from 'react'
|
|
4
4
|
import { TLUiTranslationKey } from '../../hooks/useTranslation/TLUiTranslationKey'
|
|
5
5
|
import { useTranslation } from '../../hooks/useTranslation/useTranslation'
|
|
6
|
-
import {
|
|
6
|
+
import { hideAllTooltips, TldrawUiTooltip } from './TldrawUiTooltip'
|
|
7
7
|
|
|
8
8
|
/** @public */
|
|
9
9
|
export interface TLUiSliderProps {
|
|
@@ -52,7 +52,7 @@ export const TldrawUiSlider = React.forwardRef<HTMLDivElement, TLUiSliderProps>(
|
|
|
52
52
|
)
|
|
53
53
|
|
|
54
54
|
const handlePointerDown = useCallback(() => {
|
|
55
|
-
|
|
55
|
+
hideAllTooltips()
|
|
56
56
|
onHistoryMark?.('click slider')
|
|
57
57
|
}, [onHistoryMark])
|
|
58
58
|
|