tldraw 4.1.0-next.542f014c3fac → 4.1.0-next.58b63dd1ac80
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 +32 -2
- package/dist-cjs/index.js +4 -1
- package/dist-cjs/index.js.map +2 -2
- package/dist-cjs/lib/canvas/TldrawCropHandles.js +1 -1
- package/dist-cjs/lib/canvas/TldrawScribble.js +1 -1
- package/dist-cjs/lib/canvas/TldrawSelectionForeground.js +1 -1
- package/dist-cjs/lib/defaultEmbedDefinitions.js +24 -6
- package/dist-cjs/lib/defaultEmbedDefinitions.js.map +2 -2
- package/dist-cjs/lib/defaultExternalContentHandlers.js +2 -2
- package/dist-cjs/lib/defaultExternalContentHandlers.js.map +2 -2
- package/dist-cjs/lib/shapes/arrow/ArrowShapeUtil.js +3 -0
- package/dist-cjs/lib/shapes/arrow/ArrowShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/arrow/curved-arrow.js +8 -2
- package/dist-cjs/lib/shapes/arrow/curved-arrow.js.map +2 -2
- package/dist-cjs/lib/shapes/arrow/straight-arrow.js +4 -1
- package/dist-cjs/lib/shapes/arrow/straight-arrow.js.map +2 -2
- package/dist-cjs/lib/shapes/bookmark/BookmarkShapeUtil.js +14 -2
- package/dist-cjs/lib/shapes/bookmark/BookmarkShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/frame/FrameShapeUtil.js +1 -1
- package/dist-cjs/lib/shapes/image/ImageShapeUtil.js +1 -1
- package/dist-cjs/lib/shapes/line/LineShapeUtil.js +3 -0
- package/dist-cjs/lib/shapes/line/LineShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/HyperlinkButton.js +1 -1
- package/dist-cjs/lib/shapes/shared/PlainTextLabel.js +1 -1
- package/dist-cjs/lib/shapes/shared/RichTextLabel.js +2 -2
- package/dist-cjs/lib/shapes/shared/RichTextLabel.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/ShapeFill.js +1 -1
- package/dist-cjs/lib/shapes/text/PlainTextArea.js +1 -1
- package/dist-cjs/lib/shapes/text/RichTextArea.js +1 -1
- package/dist-cjs/lib/shapes/video/VideoShapeUtil.js +1 -1
- package/dist-cjs/lib/tools/SelectTool/childStates/Crop/children/Idle.js +1 -1
- package/dist-cjs/lib/tools/SelectTool/childStates/Crop/children/Idle.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/DraggingHandle.js +9 -1
- package/dist-cjs/lib/tools/SelectTool/childStates/DraggingHandle.js.map +2 -2
- package/dist-cjs/lib/tools/SelectTool/childStates/Idle.js +1 -1
- package/dist-cjs/lib/tools/SelectTool/childStates/Idle.js.map +2 -2
- package/dist-cjs/lib/ui/TldrawUi.js +2 -2
- package/dist-cjs/lib/ui/components/DebugMenu/DefaultDebugMenuContent.js +1 -1
- package/dist-cjs/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialog.js +1 -1
- package/dist-cjs/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.js +1 -1
- package/dist-cjs/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.js.map +1 -1
- package/dist-cjs/lib/ui/components/Minimap/DefaultMinimap.js +1 -1
- package/dist-cjs/lib/ui/components/Minimap/MinimapManager.js +5 -0
- package/dist-cjs/lib/ui/components/Minimap/MinimapManager.js.map +2 -2
- package/dist-cjs/lib/ui/components/OfflineIndicator/OfflineIndicator.js +1 -1
- package/dist-cjs/lib/ui/components/SharePanel/PeopleMenu.js +6 -2
- package/dist-cjs/lib/ui/components/SharePanel/PeopleMenu.js.map +2 -2
- package/dist-cjs/lib/ui/components/SharePanel/UserPresenceColorPicker.js +1 -1
- package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanel.js +1 -1
- package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanelContent.js +64 -56
- package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanelContent.js.map +2 -2
- package/dist-cjs/lib/ui/components/StylePanel/StylePanelButtonPicker.js +54 -47
- package/dist-cjs/lib/ui/components/StylePanel/StylePanelButtonPicker.js.map +3 -3
- package/dist-cjs/lib/ui/components/StylePanel/StylePanelDoubleDropdownPicker.js +63 -56
- package/dist-cjs/lib/ui/components/StylePanel/StylePanelDoubleDropdownPicker.js.map +2 -2
- package/dist-cjs/lib/ui/components/StylePanel/StylePanelDropdownPicker.js +13 -6
- package/dist-cjs/lib/ui/components/StylePanel/StylePanelDropdownPicker.js.map +2 -2
- package/dist-cjs/lib/ui/components/Toolbar/DefaultToolbar.js +1 -1
- package/dist-cjs/lib/ui/components/Toolbar/OverflowingToolbar.js +1 -1
- package/dist-cjs/lib/ui/components/Toolbar/ToggleToolLockedButton.js +1 -1
- package/dist-cjs/lib/ui/components/primitives/Button/TldrawUiButton.js +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiContextualToolbar.js +1 -1
- package/dist-cjs/lib/ui/components/primitives/TldrawUiDialog.js +1 -1
- package/dist-cjs/lib/ui/components/primitives/TldrawUiDropdownMenu.js +1 -1
- package/dist-cjs/lib/ui/components/primitives/TldrawUiIcon.js +1 -1
- package/dist-cjs/lib/ui/components/primitives/TldrawUiInput.js +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiPopover.js +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiSlider.js +1 -1
- package/dist-cjs/lib/ui/components/primitives/TldrawUiToolbar.js +2 -2
- package/dist-cjs/lib/ui/components/primitives/TldrawUiTooltip.js +1 -1
- package/dist-cjs/lib/ui/components/primitives/layout.js +1 -1
- package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuGroup.js +1 -1
- package/dist-cjs/lib/ui/context/actions.js +1 -1
- package/dist-cjs/lib/ui/context/breakpoints.js +1 -1
- package/dist-cjs/lib/ui/context/events.js +1 -1
- package/dist-cjs/lib/ui/hooks/useClipboardEvents.js +1 -1
- package/dist-cjs/lib/ui/hooks/useKeyboardShortcuts.js +1 -1
- package/dist-cjs/lib/ui/hooks/useLocalStorageState.js +1 -1
- package/dist-cjs/lib/ui/hooks/useTools.js +1 -1
- package/dist-cjs/lib/ui/hooks/useTranslation/useTranslation.js +1 -1
- package/dist-cjs/lib/ui/version.js +4 -4
- package/dist-cjs/lib/ui/version.js.map +1 -1
- package/dist-cjs/lib/utils/text/richText.js +4 -4
- package/dist-esm/index.d.mts +32 -2
- package/dist-esm/index.mjs +10 -4
- package/dist-esm/index.mjs.map +2 -2
- package/dist-esm/lib/defaultEmbedDefinitions.mjs +24 -6
- package/dist-esm/lib/defaultEmbedDefinitions.mjs.map +2 -2
- package/dist-esm/lib/defaultExternalContentHandlers.mjs +2 -2
- package/dist-esm/lib/defaultExternalContentHandlers.mjs.map +2 -2
- package/dist-esm/lib/shapes/arrow/ArrowShapeUtil.mjs +3 -0
- package/dist-esm/lib/shapes/arrow/ArrowShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/arrow/curved-arrow.mjs +8 -2
- package/dist-esm/lib/shapes/arrow/curved-arrow.mjs.map +2 -2
- package/dist-esm/lib/shapes/arrow/straight-arrow.mjs +4 -1
- package/dist-esm/lib/shapes/arrow/straight-arrow.mjs.map +2 -2
- package/dist-esm/lib/shapes/bookmark/BookmarkShapeUtil.mjs +13 -1
- package/dist-esm/lib/shapes/bookmark/BookmarkShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/line/LineShapeUtil.mjs +3 -0
- package/dist-esm/lib/shapes/line/LineShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/RichTextLabel.mjs +1 -1
- package/dist-esm/lib/shapes/shared/RichTextLabel.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/Crop/children/Idle.mjs +1 -1
- package/dist-esm/lib/tools/SelectTool/childStates/Crop/children/Idle.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/DraggingHandle.mjs +11 -2
- package/dist-esm/lib/tools/SelectTool/childStates/DraggingHandle.mjs.map +2 -2
- package/dist-esm/lib/tools/SelectTool/childStates/Idle.mjs +1 -1
- package/dist-esm/lib/tools/SelectTool/childStates/Idle.mjs.map +2 -2
- package/dist-esm/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.mjs +1 -1
- package/dist-esm/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.mjs.map +1 -1
- package/dist-esm/lib/ui/components/Minimap/MinimapManager.mjs +5 -0
- package/dist-esm/lib/ui/components/Minimap/MinimapManager.mjs.map +2 -2
- package/dist-esm/lib/ui/components/SharePanel/PeopleMenu.mjs +6 -2
- package/dist-esm/lib/ui/components/SharePanel/PeopleMenu.mjs.map +2 -2
- package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanelContent.mjs +68 -57
- package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanelContent.mjs.map +2 -2
- package/dist-esm/lib/ui/components/StylePanel/StylePanelButtonPicker.mjs +54 -47
- package/dist-esm/lib/ui/components/StylePanel/StylePanelButtonPicker.mjs.map +3 -3
- package/dist-esm/lib/ui/components/StylePanel/StylePanelDoubleDropdownPicker.mjs +63 -56
- package/dist-esm/lib/ui/components/StylePanel/StylePanelDoubleDropdownPicker.mjs.map +2 -2
- package/dist-esm/lib/ui/components/StylePanel/StylePanelDropdownPicker.mjs +12 -5
- package/dist-esm/lib/ui/components/StylePanel/StylePanelDropdownPicker.mjs.map +2 -2
- package/dist-esm/lib/ui/version.mjs +4 -4
- package/dist-esm/lib/ui/version.mjs.map +1 -1
- package/package.json +11 -11
- package/src/index.ts +3 -0
- package/src/lib/defaultEmbedDefinitions.ts +19 -0
- package/src/lib/defaultExternalContentHandlers.ts +2 -2
- package/src/lib/shapes/arrow/ArrowShapeUtil.test.ts +211 -1
- package/src/lib/shapes/arrow/ArrowShapeUtil.tsx +3 -0
- package/src/lib/shapes/arrow/curved-arrow.ts +8 -2
- package/src/lib/shapes/arrow/straight-arrow.ts +5 -1
- package/src/lib/shapes/bookmark/BookmarkShapeUtil.tsx +13 -3
- package/src/lib/shapes/line/LineShapeUtil.tsx +3 -0
- package/src/lib/shapes/shared/RichTextLabel.tsx +1 -1
- package/src/lib/shapes/text/TextShapeTool.test.ts +74 -0
- package/src/lib/tools/SelectTool/childStates/Crop/children/Idle.ts +1 -1
- package/src/lib/tools/SelectTool/childStates/DraggingHandle.tsx +13 -1
- package/src/lib/tools/SelectTool/childStates/Idle.ts +1 -1
- package/src/lib/ui/components/KeyboardShortcutsDialog/DefaultKeyboardShortcutsDialogContent.tsx +1 -1
- package/src/lib/ui/components/Minimap/MinimapManager.ts +6 -0
- package/src/lib/ui/components/SharePanel/PeopleMenu.tsx +6 -2
- package/src/lib/ui/components/StylePanel/DefaultStylePanelContent.tsx +60 -49
- package/src/lib/ui/components/StylePanel/StylePanelButtonPicker.tsx +70 -53
- package/src/lib/ui/components/StylePanel/StylePanelDoubleDropdownPicker.tsx +105 -90
- package/src/lib/ui/components/StylePanel/StylePanelDropdownPicker.tsx +72 -51
- package/src/lib/ui/version.ts +4 -4
- package/src/test/customSnapping.test.tsx +55 -11
- package/tldraw.css +7 -2
|
@@ -28,7 +28,21 @@ export interface StylePanelDropdownPickerProps<T extends string> {
|
|
|
28
28
|
onValueChange?(style: StyleProp<T>, value: T): void
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
function
|
|
31
|
+
function StylePanelDropdownPickerInner<T extends string>(props: StylePanelDropdownPickerProps<T>) {
|
|
32
|
+
const msg = useTranslation()
|
|
33
|
+
const toolbarLabel = props.label
|
|
34
|
+
? msg(props.label)
|
|
35
|
+
: msg(`style-panel.${props.stylePanelType}` as TLUiTranslationKey)
|
|
36
|
+
return (
|
|
37
|
+
<TldrawUiToolbar label={toolbarLabel}>
|
|
38
|
+
<StylePanelDropdownPickerInline {...props} />
|
|
39
|
+
</TldrawUiToolbar>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function StylePanelDropdownPickerInlineInner<T extends string>(
|
|
44
|
+
props: StylePanelDropdownPickerProps<T>
|
|
45
|
+
) {
|
|
32
46
|
const ctx = useStylePanelContext()
|
|
33
47
|
const {
|
|
34
48
|
id,
|
|
@@ -60,60 +74,67 @@ function DropdownPickerInner<T extends string>(props: StylePanelDropdownPickerPr
|
|
|
60
74
|
|
|
61
75
|
const popoverId = `style panel ${id}`
|
|
62
76
|
return (
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
>
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
>
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
<
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
</TldrawUiPopover>
|
|
111
|
-
</TldrawUiToolbar>
|
|
77
|
+
<TldrawUiPopover
|
|
78
|
+
id={popoverId}
|
|
79
|
+
open={isOpen}
|
|
80
|
+
onOpenChange={setIsOpen}
|
|
81
|
+
className="tlui-style-panel__dropdown-picker"
|
|
82
|
+
>
|
|
83
|
+
<TldrawUiPopoverTrigger>
|
|
84
|
+
<TldrawUiToolbarButton
|
|
85
|
+
type={type}
|
|
86
|
+
data-testid={`style.${uiType}`}
|
|
87
|
+
data-direction="left"
|
|
88
|
+
title={titleStr}
|
|
89
|
+
>
|
|
90
|
+
{labelStr && <TldrawUiButtonLabel>{labelStr}</TldrawUiButtonLabel>}
|
|
91
|
+
<TldrawUiButtonIcon icon={(icon as TLUiIconType) ?? 'mixed'} />
|
|
92
|
+
</TldrawUiToolbarButton>
|
|
93
|
+
</TldrawUiPopoverTrigger>
|
|
94
|
+
<TldrawUiPopoverContent side="left" align="center">
|
|
95
|
+
<TldrawUiToolbar orientation={items.length > 4 ? 'grid' : 'horizontal'} label={labelStr}>
|
|
96
|
+
<TldrawUiMenuContextProvider type="icons" sourceId="style-panel">
|
|
97
|
+
{items.map((item) => {
|
|
98
|
+
return (
|
|
99
|
+
<TldrawUiToolbarButton
|
|
100
|
+
key={item.value}
|
|
101
|
+
type="icon"
|
|
102
|
+
data-testid={`style.${uiType}.${item.value}`}
|
|
103
|
+
title={
|
|
104
|
+
stylePanelName +
|
|
105
|
+
' — ' +
|
|
106
|
+
msg(`${uiType}-style.${item.value}` as TLUiTranslationKey)
|
|
107
|
+
}
|
|
108
|
+
isActive={icon === item.icon}
|
|
109
|
+
onClick={() => {
|
|
110
|
+
ctx.onHistoryMark('select style dropdown item')
|
|
111
|
+
onValueChange(style, item.value)
|
|
112
|
+
tlmenus.deleteOpenMenu(popoverId, editor.contextId)
|
|
113
|
+
setIsOpen(false)
|
|
114
|
+
}}
|
|
115
|
+
>
|
|
116
|
+
<TldrawUiButtonIcon icon={item.icon} />
|
|
117
|
+
</TldrawUiToolbarButton>
|
|
118
|
+
)
|
|
119
|
+
})}
|
|
120
|
+
</TldrawUiMenuContextProvider>
|
|
121
|
+
</TldrawUiToolbar>
|
|
122
|
+
</TldrawUiPopoverContent>
|
|
123
|
+
</TldrawUiPopover>
|
|
112
124
|
)
|
|
113
125
|
}
|
|
114
126
|
|
|
115
127
|
// need to export like this to get generics
|
|
116
128
|
/** @public @react */
|
|
117
|
-
export const StylePanelDropdownPicker = React.memo(
|
|
129
|
+
export const StylePanelDropdownPicker = React.memo(StylePanelDropdownPickerInner) as <
|
|
130
|
+
T extends string,
|
|
131
|
+
>(
|
|
132
|
+
props: StylePanelDropdownPickerProps<T>
|
|
133
|
+
) => React.JSX.Element
|
|
134
|
+
|
|
135
|
+
/** @public @react */
|
|
136
|
+
export const StylePanelDropdownPickerInline = React.memo(StylePanelDropdownPickerInlineInner) as <
|
|
137
|
+
T extends string,
|
|
138
|
+
>(
|
|
118
139
|
props: StylePanelDropdownPickerProps<T>
|
|
119
140
|
) => React.JSX.Element
|
package/src/lib/ui/version.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// This file is automatically generated by internal/scripts/refresh-assets.ts.
|
|
2
2
|
// Do not edit manually. Or do, I'm a comment, not a cop.
|
|
3
3
|
|
|
4
|
-
export const version = '4.1.0-next.
|
|
4
|
+
export const version = '4.1.0-next.58b63dd1ac80'
|
|
5
5
|
export const publishDates = {
|
|
6
|
-
major: '2025-09-
|
|
7
|
-
minor: '2025-
|
|
8
|
-
patch: '2025-
|
|
6
|
+
major: '2025-09-18T14:39:22.803Z',
|
|
7
|
+
minor: '2025-10-15T11:02:19.723Z',
|
|
8
|
+
patch: '2025-10-15T11:02:19.723Z',
|
|
9
9
|
}
|
|
@@ -173,6 +173,7 @@ describe('custom handle snapping', () => {
|
|
|
173
173
|
handlePoints: VecModel[] | 'default'
|
|
174
174
|
selfSnapOutline: VecModel[] | 'default'
|
|
175
175
|
selfSnapPoints: VecModel[] | 'default'
|
|
176
|
+
handleSnapType?: 'point' | 'align'
|
|
176
177
|
}
|
|
177
178
|
>
|
|
178
179
|
class TestShapeUtil extends BaseBoxShapeUtil<TestShape> {
|
|
@@ -213,17 +214,23 @@ describe('custom handle snapping', () => {
|
|
|
213
214
|
}
|
|
214
215
|
}
|
|
215
216
|
override getHandles(shape: TestShape): TLHandle[] {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
217
|
+
const handle: TLHandle = {
|
|
218
|
+
id: 'handle',
|
|
219
|
+
label: 'handle',
|
|
220
|
+
type: 'vertex',
|
|
221
|
+
x: shape.props.ownHandle.x,
|
|
222
|
+
y: shape.props.ownHandle.y,
|
|
223
|
+
index: ZERO_INDEX_KEY,
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if (shape.props.handleSnapType) {
|
|
227
|
+
handle.snapType = shape.props.handleSnapType
|
|
228
|
+
} else {
|
|
229
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
230
|
+
handle.canSnap = true
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
return [handle]
|
|
227
234
|
}
|
|
228
235
|
override onHandleDrag(shape: TestShape, { handle }: TLHandleDragInfo<TestShape>) {
|
|
229
236
|
return { ...shape, props: { ...shape.props, ownHandle: { x: handle.x, y: handle.y } } }
|
|
@@ -495,5 +502,42 @@ describe('custom handle snapping', () => {
|
|
|
495
502
|
expect(ownHandlePosition()).toMatchObject({ x: 20, y: 50 })
|
|
496
503
|
})
|
|
497
504
|
})
|
|
505
|
+
|
|
506
|
+
describe('with snapType set to align', () => {
|
|
507
|
+
beforeEach(() => {
|
|
508
|
+
editor.updateShape<TestShape>({
|
|
509
|
+
id: ids.test,
|
|
510
|
+
type: 'test',
|
|
511
|
+
props: {
|
|
512
|
+
selfSnapPoints: [
|
|
513
|
+
{ x: 20, y: 50 },
|
|
514
|
+
{ x: 60, y: 10 },
|
|
515
|
+
],
|
|
516
|
+
handleSnapType: 'align',
|
|
517
|
+
},
|
|
518
|
+
})
|
|
519
|
+
})
|
|
520
|
+
|
|
521
|
+
test('snaps to the y axis', () => {
|
|
522
|
+
startDraggingOwnHandle()
|
|
523
|
+
editor.pointerMove(18, 0, undefined, { ctrlKey: true })
|
|
524
|
+
expect(editor.snaps.getIndicators()).toHaveLength(1)
|
|
525
|
+
expect(ownHandlePosition()).toMatchObject({ x: 20, y: 0 })
|
|
526
|
+
})
|
|
527
|
+
|
|
528
|
+
test('snaps to the x axis', () => {
|
|
529
|
+
startDraggingOwnHandle()
|
|
530
|
+
editor.pointerMove(0, 48, undefined, { ctrlKey: true })
|
|
531
|
+
expect(editor.snaps.getIndicators()).toHaveLength(1)
|
|
532
|
+
expect(ownHandlePosition()).toMatchObject({ x: 0, y: 50 })
|
|
533
|
+
})
|
|
534
|
+
|
|
535
|
+
test('snaps to both axes', () => {
|
|
536
|
+
startDraggingOwnHandle()
|
|
537
|
+
editor.pointerMove(18, 9, undefined, { ctrlKey: true })
|
|
538
|
+
expect(editor.snaps.getIndicators()).toHaveLength(2)
|
|
539
|
+
expect(ownHandlePosition()).toMatchObject({ x: 20, y: 10 })
|
|
540
|
+
})
|
|
541
|
+
})
|
|
498
542
|
})
|
|
499
543
|
})
|
package/tldraw.css
CHANGED
|
@@ -1325,6 +1325,10 @@ input,
|
|
|
1325
1325
|
flex: 1;
|
|
1326
1326
|
}
|
|
1327
1327
|
|
|
1328
|
+
.tl-bookmark__copy_container:has(.tl-bookmark__link:only-child) {
|
|
1329
|
+
justify-content: center;
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1328
1332
|
.tl-bookmark__heading,
|
|
1329
1333
|
.tl-bookmark__description,
|
|
1330
1334
|
.tl-bookmark__link {
|
|
@@ -1357,7 +1361,7 @@ input,
|
|
|
1357
1361
|
line-clamp: 3;
|
|
1358
1362
|
text-overflow: ellipsis;
|
|
1359
1363
|
display: -webkit-box;
|
|
1360
|
-
color: var(--tl-color-text-
|
|
1364
|
+
color: var(--tl-color-text-1);
|
|
1361
1365
|
margin: var(--tl-space-2) 0px;
|
|
1362
1366
|
}
|
|
1363
1367
|
|
|
@@ -1369,11 +1373,12 @@ input,
|
|
|
1369
1373
|
font-size: 12px;
|
|
1370
1374
|
pointer-events: all;
|
|
1371
1375
|
display: flex;
|
|
1372
|
-
color: var(--tl-color-text-
|
|
1376
|
+
color: var(--tl-color-text-1);
|
|
1373
1377
|
align-items: center;
|
|
1374
1378
|
cursor: var(--tl-cursor-pointer);
|
|
1375
1379
|
width: fit-content;
|
|
1376
1380
|
max-width: 100%;
|
|
1381
|
+
text-decoration: none;
|
|
1377
1382
|
}
|
|
1378
1383
|
|
|
1379
1384
|
.tl-bookmark__link > span {
|