tldraw 4.1.0-next.58b63dd1ac80 → 4.1.0-next.74327a60f18a
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 +2 -11
- package/dist-cjs/index.js +1 -4
- package/dist-cjs/index.js.map +2 -2
- package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanelContent.js +55 -63
- package/dist-cjs/lib/ui/components/StylePanel/DefaultStylePanelContent.js.map +2 -2
- package/dist-cjs/lib/ui/components/StylePanel/StylePanelButtonPicker.js +47 -54
- package/dist-cjs/lib/ui/components/StylePanel/StylePanelButtonPicker.js.map +3 -3
- package/dist-cjs/lib/ui/components/StylePanel/StylePanelDoubleDropdownPicker.js +55 -62
- package/dist-cjs/lib/ui/components/StylePanel/StylePanelDoubleDropdownPicker.js.map +2 -2
- package/dist-cjs/lib/ui/components/StylePanel/StylePanelDropdownPicker.js +5 -12
- package/dist-cjs/lib/ui/components/StylePanel/StylePanelDropdownPicker.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-esm/index.d.mts +2 -11
- package/dist-esm/index.mjs +4 -10
- package/dist-esm/index.mjs.map +2 -2
- package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanelContent.mjs +57 -68
- package/dist-esm/lib/ui/components/StylePanel/DefaultStylePanelContent.mjs.map +2 -2
- package/dist-esm/lib/ui/components/StylePanel/StylePanelButtonPicker.mjs +47 -54
- package/dist-esm/lib/ui/components/StylePanel/StylePanelButtonPicker.mjs.map +3 -3
- package/dist-esm/lib/ui/components/StylePanel/StylePanelDoubleDropdownPicker.mjs +56 -63
- package/dist-esm/lib/ui/components/StylePanel/StylePanelDoubleDropdownPicker.mjs.map +2 -2
- package/dist-esm/lib/ui/components/StylePanel/StylePanelDropdownPicker.mjs +5 -12
- package/dist-esm/lib/ui/components/StylePanel/StylePanelDropdownPicker.mjs.map +2 -2
- package/dist-esm/lib/ui/version.mjs +3 -3
- package/dist-esm/lib/ui/version.mjs.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +0 -3
- package/src/lib/ui/components/StylePanel/DefaultStylePanelContent.tsx +49 -60
- package/src/lib/ui/components/StylePanel/StylePanelButtonPicker.tsx +53 -70
- package/src/lib/ui/components/StylePanel/StylePanelDoubleDropdownPicker.tsx +90 -105
- package/src/lib/ui/components/StylePanel/StylePanelDropdownPicker.tsx +51 -72
- package/src/lib/ui/version.ts +3 -3
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
TLDefaultColorStyle,
|
|
7
7
|
useEditor,
|
|
8
8
|
} from '@tldraw/editor'
|
|
9
|
-
import { memo, useMemo, useRef } from 'react'
|
|
9
|
+
import { memo, ReactElement, useMemo, useRef } from 'react'
|
|
10
10
|
import { useDefaultColorTheme } from '../../../shapes/shared/useDefaultColorTheme'
|
|
11
11
|
import { StyleValuesForUi } from '../../../styles'
|
|
12
12
|
import { PORTRAIT_BREAKPOINT } from '../../constants'
|
|
@@ -34,19 +34,8 @@ export interface StylePanelButtonPickerProps<T extends string> {
|
|
|
34
34
|
onHistoryMark?(id: string): void
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<>
|
|
41
|
-
{enhancedA11yMode && <StylePanelSubheading>{props.title}</StylePanelSubheading>}
|
|
42
|
-
<TldrawUiToolbar label={props.title}>
|
|
43
|
-
<StylePanelButtonPickerInline {...props} />
|
|
44
|
-
</TldrawUiToolbar>
|
|
45
|
-
</>
|
|
46
|
-
)
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function StylePanelButtonPickerInlineInner<T extends string>(
|
|
37
|
+
/** @public */
|
|
38
|
+
export const StylePanelButtonPicker = memo(function StylePanelButtonPicker<T extends string>(
|
|
50
39
|
props: StylePanelButtonPickerProps<T>
|
|
51
40
|
) {
|
|
52
41
|
const ctx = useStylePanelContext()
|
|
@@ -137,60 +126,54 @@ function StylePanelButtonPickerInlineInner<T extends string>(
|
|
|
137
126
|
const Layout = items.length > 4 ? TldrawUiGrid : TldrawUiRow
|
|
138
127
|
|
|
139
128
|
return (
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
{isActive ?
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
129
|
+
<>
|
|
130
|
+
{ctx.enhancedA11yMode && <StylePanelSubheading>{title}</StylePanelSubheading>}
|
|
131
|
+
<TldrawUiToolbar label={title}>
|
|
132
|
+
<TldrawUiToolbarToggleGroup
|
|
133
|
+
data-testid={`style.${uiType}`}
|
|
134
|
+
type="single"
|
|
135
|
+
value={value.type === 'shared' ? value.value : undefined}
|
|
136
|
+
asChild
|
|
137
|
+
>
|
|
138
|
+
<Layout>
|
|
139
|
+
{items.map((item) => {
|
|
140
|
+
const isActive = value.type === 'shared' && value.value === item.value
|
|
141
|
+
const label =
|
|
142
|
+
title + ' — ' + msg(`${uiType}-style.${item.value}` as TLUiTranslationKey)
|
|
143
|
+
return (
|
|
144
|
+
<TldrawUiToolbarToggleItem
|
|
145
|
+
type="icon"
|
|
146
|
+
key={item.value}
|
|
147
|
+
data-id={item.value}
|
|
148
|
+
data-testid={`style.${uiType}.${item.value}`}
|
|
149
|
+
aria-label={label + (isActive ? ` (${msg('style-panel.selected')})` : '')}
|
|
150
|
+
tooltip={
|
|
151
|
+
<>
|
|
152
|
+
<div>{label}</div>
|
|
153
|
+
{isActive ? <div>({msg('style-panel.selected')})</div> : null}
|
|
154
|
+
</>
|
|
155
|
+
}
|
|
156
|
+
value={item.value}
|
|
157
|
+
data-state={value.type === 'shared' && value.value === item.value ? 'on' : 'off'}
|
|
158
|
+
data-isactive={isActive}
|
|
159
|
+
title={label}
|
|
160
|
+
style={
|
|
161
|
+
style === (DefaultColorStyle as StyleProp<unknown>)
|
|
162
|
+
? { color: getColorValue(theme, item.value as TLDefaultColorStyle, 'solid') }
|
|
163
|
+
: undefined
|
|
164
|
+
}
|
|
165
|
+
onPointerEnter={handleButtonPointerEnter}
|
|
166
|
+
onPointerDown={handleButtonPointerDown}
|
|
167
|
+
onPointerUp={handleButtonPointerUp}
|
|
168
|
+
onClick={handleButtonClick}
|
|
169
|
+
>
|
|
170
|
+
<TldrawUiButtonIcon icon={item.icon} />
|
|
171
|
+
</TldrawUiToolbarToggleItem>
|
|
172
|
+
)
|
|
173
|
+
})}
|
|
174
|
+
</Layout>
|
|
175
|
+
</TldrawUiToolbarToggleGroup>
|
|
176
|
+
</TldrawUiToolbar>
|
|
177
|
+
</>
|
|
183
178
|
)
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
/** @public @react */
|
|
187
|
-
export const StylePanelButtonPicker = memo(StylePanelButtonPickerInner) as <T extends string>(
|
|
188
|
-
props: StylePanelButtonPickerProps<T>
|
|
189
|
-
) => React.JSX.Element
|
|
190
|
-
|
|
191
|
-
/** @public @react*/
|
|
192
|
-
export const StylePanelButtonPickerInline = memo(StylePanelButtonPickerInlineInner) as <
|
|
193
|
-
T extends string,
|
|
194
|
-
>(
|
|
195
|
-
props: StylePanelButtonPickerProps<T>
|
|
196
|
-
) => React.JSX.Element
|
|
179
|
+
}) as <T extends string>(props: StylePanelButtonPickerProps<T>) => ReactElement
|
|
@@ -29,27 +29,12 @@ export interface StylePanelDoubleDropdownPickerProps<T extends string> {
|
|
|
29
29
|
onValueChange?(style: StyleProp<T>, value: T): void
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
function
|
|
33
|
-
props: StylePanelDoubleDropdownPickerProps<T>
|
|
34
|
-
) {
|
|
35
|
-
const msg = useTranslation()
|
|
36
|
-
return (
|
|
37
|
-
<div className="tlui-style-panel__double-select-picker">
|
|
38
|
-
<div title={msg(props.label)} className="tlui-style-panel__double-select-picker-label">
|
|
39
|
-
{msg(props.label)}
|
|
40
|
-
</div>
|
|
41
|
-
<TldrawUiToolbar orientation="horizontal" label={msg(props.label)}>
|
|
42
|
-
<StylePanelDoubleDropdownPickerInline {...props} />
|
|
43
|
-
</TldrawUiToolbar>
|
|
44
|
-
</div>
|
|
45
|
-
)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function StylePanelDoubleDropdownPickerInlineInner<T extends string>(
|
|
32
|
+
function DoubleDropdownPickerInner<T extends string>(
|
|
49
33
|
props: StylePanelDoubleDropdownPickerProps<T>
|
|
50
34
|
) {
|
|
51
35
|
const ctx = useStylePanelContext()
|
|
52
36
|
const {
|
|
37
|
+
label,
|
|
53
38
|
uiTypeA,
|
|
54
39
|
uiTypeB,
|
|
55
40
|
labelA,
|
|
@@ -85,100 +70,100 @@ function StylePanelDoubleDropdownPickerInlineInner<T extends string>(
|
|
|
85
70
|
const idA = `style panel ${uiTypeA} A`
|
|
86
71
|
const idB = `style panel ${uiTypeB} B`
|
|
87
72
|
return (
|
|
88
|
-
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
73
|
+
<div className="tlui-style-panel__double-select-picker">
|
|
74
|
+
<div title={msg(label)} className="tlui-style-panel__double-select-picker-label">
|
|
75
|
+
{msg(label)}
|
|
76
|
+
</div>
|
|
77
|
+
<TldrawUiToolbar orientation="horizontal" label={msg(label)}>
|
|
78
|
+
<TldrawUiPopover id={idA} open={isOpenA} onOpenChange={setIsOpenA}>
|
|
79
|
+
<TldrawUiPopoverTrigger>
|
|
80
|
+
<TldrawUiToolbarButton
|
|
81
|
+
type="icon"
|
|
82
|
+
data-testid={`style.${uiTypeA}`}
|
|
83
|
+
title={
|
|
84
|
+
msg(labelA) +
|
|
85
|
+
' — ' +
|
|
86
|
+
(valueA === null || valueA.type === 'mixed'
|
|
87
|
+
? msg('style-panel.mixed')
|
|
88
|
+
: msg(`${uiTypeA}-style.${valueA.value}` as TLUiTranslationKey))
|
|
89
|
+
}
|
|
90
|
+
>
|
|
91
|
+
<TldrawUiButtonIcon icon={iconA} small invertIcon />
|
|
92
|
+
</TldrawUiToolbarButton>
|
|
93
|
+
</TldrawUiPopoverTrigger>
|
|
94
|
+
<TldrawUiPopoverContent side="left" align="center" sideOffset={80} alignOffset={0}>
|
|
95
|
+
<TldrawUiToolbar orientation="grid" label={msg(labelA)}>
|
|
96
|
+
<TldrawUiMenuContextProvider type="icons" sourceId="style-panel">
|
|
97
|
+
{itemsA.map((item) => {
|
|
98
|
+
return (
|
|
99
|
+
<TldrawUiToolbarButton
|
|
100
|
+
data-testid={`style.${uiTypeA}.${item.value}`}
|
|
101
|
+
type="icon"
|
|
102
|
+
key={item.value}
|
|
103
|
+
onClick={() => {
|
|
104
|
+
onValueChange(styleA, item.value)
|
|
105
|
+
tlmenus.deleteOpenMenu(idA, editor.contextId)
|
|
106
|
+
setIsOpenA(false)
|
|
107
|
+
}}
|
|
108
|
+
title={`${msg(labelA)} — ${msg(`${uiTypeA}-style.${item.value}`)}`}
|
|
109
|
+
>
|
|
110
|
+
<TldrawUiButtonIcon icon={item.icon} invertIcon />
|
|
111
|
+
</TldrawUiToolbarButton>
|
|
112
|
+
)
|
|
113
|
+
})}
|
|
114
|
+
</TldrawUiMenuContextProvider>
|
|
115
|
+
</TldrawUiToolbar>
|
|
116
|
+
</TldrawUiPopoverContent>
|
|
117
|
+
</TldrawUiPopover>
|
|
118
|
+
<TldrawUiPopover id={idB} open={isOpenB} onOpenChange={setIsOpenB}>
|
|
119
|
+
<TldrawUiPopoverTrigger>
|
|
120
|
+
<TldrawUiToolbarButton
|
|
121
|
+
type="icon"
|
|
122
|
+
data-testid={`style.${uiTypeB}`}
|
|
123
|
+
title={
|
|
124
|
+
msg(labelB) +
|
|
125
|
+
' — ' +
|
|
126
|
+
(valueB === null || valueB.type === 'mixed'
|
|
127
|
+
? msg('style-panel.mixed')
|
|
128
|
+
: msg(`${uiTypeB}-style.${valueB.value}` as TLUiTranslationKey))
|
|
129
|
+
}
|
|
130
|
+
>
|
|
131
|
+
<TldrawUiButtonIcon icon={iconB} small />
|
|
132
|
+
</TldrawUiToolbarButton>
|
|
133
|
+
</TldrawUiPopoverTrigger>
|
|
134
|
+
<TldrawUiPopoverContent side="left" align="center" sideOffset={116} alignOffset={0}>
|
|
135
|
+
<TldrawUiToolbar orientation="grid" label={msg(labelB)}>
|
|
136
|
+
<TldrawUiMenuContextProvider type="icons" sourceId="style-panel">
|
|
137
|
+
{itemsB.map((item) => {
|
|
138
|
+
return (
|
|
139
|
+
<TldrawUiToolbarButton
|
|
140
|
+
key={item.value}
|
|
141
|
+
type="icon"
|
|
142
|
+
title={`${msg(labelB)} — ${msg(`${uiTypeB}-style.${item.value}` as TLUiTranslationKey)}`}
|
|
143
|
+
data-testid={`style.${uiTypeB}.${item.value}`}
|
|
144
|
+
onClick={() => {
|
|
145
|
+
onValueChange(styleB, item.value)
|
|
146
|
+
tlmenus.deleteOpenMenu(idB, editor.contextId)
|
|
147
|
+
setIsOpenB(false)
|
|
148
|
+
}}
|
|
149
|
+
>
|
|
150
|
+
<TldrawUiButtonIcon icon={item.icon} />
|
|
151
|
+
</TldrawUiToolbarButton>
|
|
152
|
+
)
|
|
153
|
+
})}
|
|
154
|
+
</TldrawUiMenuContextProvider>
|
|
155
|
+
</TldrawUiToolbar>
|
|
156
|
+
</TldrawUiPopoverContent>
|
|
157
|
+
</TldrawUiPopover>
|
|
158
|
+
</TldrawUiToolbar>
|
|
159
|
+
</div>
|
|
170
160
|
)
|
|
171
161
|
}
|
|
172
162
|
|
|
173
163
|
// need to memo like this to get generics
|
|
174
164
|
/** @public @react */
|
|
175
|
-
export const StylePanelDoubleDropdownPicker = React.memo(
|
|
165
|
+
export const StylePanelDoubleDropdownPicker = React.memo(DoubleDropdownPickerInner) as <
|
|
176
166
|
T extends string,
|
|
177
167
|
>(
|
|
178
168
|
props: StylePanelDoubleDropdownPickerProps<T>
|
|
179
169
|
) => React.JSX.Element
|
|
180
|
-
|
|
181
|
-
/** @public @react */
|
|
182
|
-
export const StylePanelDoubleDropdownPickerInline = React.memo(
|
|
183
|
-
StylePanelDoubleDropdownPickerInlineInner
|
|
184
|
-
) as <T extends string>(props: StylePanelDoubleDropdownPickerProps<T>) => React.JSX.Element
|
|
@@ -28,21 +28,7 @@ export interface StylePanelDropdownPickerProps<T extends string> {
|
|
|
28
28
|
onValueChange?(style: StyleProp<T>, value: T): void
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
function
|
|
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
|
-
) {
|
|
31
|
+
function DropdownPickerInner<T extends string>(props: StylePanelDropdownPickerProps<T>) {
|
|
46
32
|
const ctx = useStylePanelContext()
|
|
47
33
|
const {
|
|
48
34
|
id,
|
|
@@ -74,67 +60,60 @@ function StylePanelDropdownPickerInlineInner<T extends string>(
|
|
|
74
60
|
|
|
75
61
|
const popoverId = `style panel ${id}`
|
|
76
62
|
return (
|
|
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
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
63
|
+
<TldrawUiToolbar label={stylePanelName}>
|
|
64
|
+
<TldrawUiPopover
|
|
65
|
+
id={popoverId}
|
|
66
|
+
open={isOpen}
|
|
67
|
+
onOpenChange={setIsOpen}
|
|
68
|
+
className="tlui-style-panel__dropdown-picker"
|
|
69
|
+
>
|
|
70
|
+
<TldrawUiPopoverTrigger>
|
|
71
|
+
<TldrawUiToolbarButton
|
|
72
|
+
type={type}
|
|
73
|
+
data-testid={`style.${uiType}`}
|
|
74
|
+
data-direction="left"
|
|
75
|
+
title={titleStr}
|
|
76
|
+
>
|
|
77
|
+
{labelStr && <TldrawUiButtonLabel>{labelStr}</TldrawUiButtonLabel>}
|
|
78
|
+
<TldrawUiButtonIcon icon={(icon as TLUiIconType) ?? 'mixed'} />
|
|
79
|
+
</TldrawUiToolbarButton>
|
|
80
|
+
</TldrawUiPopoverTrigger>
|
|
81
|
+
<TldrawUiPopoverContent side="left" align="center">
|
|
82
|
+
<TldrawUiToolbar orientation={items.length > 4 ? 'grid' : 'horizontal'} label={labelStr}>
|
|
83
|
+
<TldrawUiMenuContextProvider type="icons" sourceId="style-panel">
|
|
84
|
+
{items.map((item) => {
|
|
85
|
+
return (
|
|
86
|
+
<TldrawUiToolbarButton
|
|
87
|
+
key={item.value}
|
|
88
|
+
type="icon"
|
|
89
|
+
data-testid={`style.${uiType}.${item.value}`}
|
|
90
|
+
title={
|
|
91
|
+
stylePanelName +
|
|
92
|
+
' — ' +
|
|
93
|
+
msg(`${uiType}-style.${item.value}` as TLUiTranslationKey)
|
|
94
|
+
}
|
|
95
|
+
isActive={icon === item.icon}
|
|
96
|
+
onClick={() => {
|
|
97
|
+
ctx.onHistoryMark('select style dropdown item')
|
|
98
|
+
onValueChange(style, item.value)
|
|
99
|
+
tlmenus.deleteOpenMenu(popoverId, editor.contextId)
|
|
100
|
+
setIsOpen(false)
|
|
101
|
+
}}
|
|
102
|
+
>
|
|
103
|
+
<TldrawUiButtonIcon icon={item.icon} />
|
|
104
|
+
</TldrawUiToolbarButton>
|
|
105
|
+
)
|
|
106
|
+
})}
|
|
107
|
+
</TldrawUiMenuContextProvider>
|
|
108
|
+
</TldrawUiToolbar>
|
|
109
|
+
</TldrawUiPopoverContent>
|
|
110
|
+
</TldrawUiPopover>
|
|
111
|
+
</TldrawUiToolbar>
|
|
124
112
|
)
|
|
125
113
|
}
|
|
126
114
|
|
|
127
115
|
// need to export like this to get generics
|
|
128
116
|
/** @public @react */
|
|
129
|
-
export const StylePanelDropdownPicker = React.memo(
|
|
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
|
-
>(
|
|
117
|
+
export const StylePanelDropdownPicker = React.memo(DropdownPickerInner) as <T extends string>(
|
|
139
118
|
props: StylePanelDropdownPickerProps<T>
|
|
140
119
|
) => 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.74327a60f18a'
|
|
5
5
|
export const publishDates = {
|
|
6
6
|
major: '2025-09-18T14:39:22.803Z',
|
|
7
|
-
minor: '2025-10-
|
|
8
|
-
patch: '2025-10-
|
|
7
|
+
minor: '2025-10-15T10:52:21.047Z',
|
|
8
|
+
patch: '2025-10-15T10:52:21.047Z',
|
|
9
9
|
}
|