@drawback/ui 0.1.0 → 0.2.0-rc.20261201112126
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/index.d.mts +1 -1
- package/dist/index.mjs +146 -146
- package/package.json +4 -4
- package/src/app/default-editor.tsx +18 -18
- package/src/components/color-picker/color-picker.tsx +20 -20
- package/src/components/font-picker/font-picker.tsx +11 -11
- package/src/components/primitives.tsx +22 -22
- package/src/features/canvas-commands/canvas-commands.tsx +1 -1
- package/src/features/context-menu/context-menu.tsx +1 -1
- package/src/features/controls/controls.tsx +7 -7
- package/src/features/export/export-dialog.tsx +11 -11
- package/src/features/layers/layers.tsx +29 -29
- package/src/features/links/links.tsx +5 -5
- package/src/features/main-menu/canvas-properties.tsx +5 -5
- package/src/features/main-menu/main-menu.tsx +6 -6
- package/src/features/minimap/minimap.tsx +1 -1
- package/src/features/properties/properties.tsx +8 -8
- package/src/features/shortcuts/shortcuts-dialog.tsx +4 -4
- package/src/features/toolbar/toolbar.tsx +9 -9
- package/src/styles.css +475 -475
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drawback/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-rc.20261201112126",
|
|
4
4
|
"description": "Default React editor UI for the API-first interactive canvas engine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"canvas",
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"api-report": "api-extractor run --config api-extractor.json --local"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@drawback/canvas": "^0.
|
|
57
|
-
"@drawback/core": "^0.
|
|
58
|
-
"@drawback/react": "^0.
|
|
56
|
+
"@drawback/canvas": "^0.2.0-rc.20261201112126",
|
|
57
|
+
"@drawback/core": "^0.2.0-rc.20261201112126",
|
|
58
|
+
"@drawback/react": "^0.2.0-rc.20261201112126",
|
|
59
59
|
"lucide-react": "^1.84.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
@@ -150,12 +150,12 @@ function Layout({
|
|
|
150
150
|
return (
|
|
151
151
|
<EditorView
|
|
152
152
|
options={canvasOptions}
|
|
153
|
-
className="
|
|
153
|
+
className="db-canvas"
|
|
154
154
|
{...(onMount === undefined ? {} : { onMount })}
|
|
155
155
|
>
|
|
156
|
-
<div className="
|
|
157
|
-
<div className="
|
|
158
|
-
<div className="
|
|
156
|
+
<div className="db-overlay">
|
|
157
|
+
<div className="db-top">
|
|
158
|
+
<div className="db-top-left">
|
|
159
159
|
{show('mainMenu') && !zen && (
|
|
160
160
|
<Menu
|
|
161
161
|
{...(slots.mainMenuItems === undefined ? {} : { items: slots.mainMenuItems })}
|
|
@@ -166,7 +166,7 @@ function Layout({
|
|
|
166
166
|
{show('toolbar') && (
|
|
167
167
|
<ToolbarComponent {...{ start: slots.toolbarStart, end: slots.toolbarEnd }} />
|
|
168
168
|
)}
|
|
169
|
-
<div className="
|
|
169
|
+
<div className="db-top-right">
|
|
170
170
|
{slots.topRight}
|
|
171
171
|
{show('layers') && !zen && (
|
|
172
172
|
<IconButton
|
|
@@ -179,14 +179,14 @@ function Layout({
|
|
|
179
179
|
)}
|
|
180
180
|
</div>
|
|
181
181
|
</div>
|
|
182
|
-
<div className="
|
|
183
|
-
<div className="
|
|
184
|
-
<div className="
|
|
182
|
+
<div className="db-middle">
|
|
183
|
+
<div className="db-side db-side-start">{showProperties && <Properties />}</div>
|
|
184
|
+
<div className="db-side db-side-end">
|
|
185
185
|
{layersOpen && <Layers onClose={() => setOpen('layers', false)} />}
|
|
186
186
|
</div>
|
|
187
187
|
</div>
|
|
188
|
-
<div className="
|
|
189
|
-
<div className="
|
|
188
|
+
<div className="db-bottom">
|
|
189
|
+
<div className="db-bottom-left">
|
|
190
190
|
{!zen && show('zoom') && (
|
|
191
191
|
<Zoom
|
|
192
192
|
{...(show('minimap')
|
|
@@ -204,18 +204,18 @@ function Layout({
|
|
|
204
204
|
)}
|
|
205
205
|
{!zen && !viewing && show('undoRedo') && <History />}
|
|
206
206
|
{!zen && show('grid') && (
|
|
207
|
-
<Island className="
|
|
207
|
+
<Island className="db-row">
|
|
208
208
|
<GridControls />
|
|
209
209
|
</Island>
|
|
210
210
|
)}
|
|
211
211
|
{slots.bottomLeft}
|
|
212
212
|
</div>
|
|
213
|
-
<div className="
|
|
213
|
+
<div className="db-bottom-center">
|
|
214
214
|
{show('scrollToContent') && <ScrollToContent />}
|
|
215
215
|
{zen && (
|
|
216
216
|
<button
|
|
217
217
|
type="button"
|
|
218
|
-
className="
|
|
218
|
+
className="db-pill"
|
|
219
219
|
data-testid="exit-zen"
|
|
220
220
|
onClick={() => editor.modes.setPresentation({ zen: false })}
|
|
221
221
|
>
|
|
@@ -223,10 +223,10 @@ function Layout({
|
|
|
223
223
|
</button>
|
|
224
224
|
)}
|
|
225
225
|
</div>
|
|
226
|
-
<div className="
|
|
226
|
+
<div className="db-bottom-right">
|
|
227
227
|
{slots.bottomRight}
|
|
228
228
|
{!zen && show('help') && (
|
|
229
|
-
<Island className="
|
|
229
|
+
<Island className="db-row">
|
|
230
230
|
<IconButton
|
|
231
231
|
icon="help"
|
|
232
232
|
label={t('menu.shortcuts')}
|
|
@@ -315,7 +315,7 @@ export function DefaultEditor({
|
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
/**
|
|
318
|
-
* Scoped root element for UI components: carries the theme, direction and the `.
|
|
318
|
+
* Scoped root element for UI components: carries the theme, direction and the `.db-editor`
|
|
319
319
|
* class all styles are scoped to. Opens the shortcut reference on `?`.
|
|
320
320
|
*/
|
|
321
321
|
export function EditorRoot({
|
|
@@ -360,10 +360,10 @@ export function EditorRoot({
|
|
|
360
360
|
setElement(node);
|
|
361
361
|
ref?.(node);
|
|
362
362
|
}}
|
|
363
|
-
className={cx('
|
|
363
|
+
className={cx('db-editor', className)}
|
|
364
364
|
data-theme={theme}
|
|
365
365
|
dir={dir}
|
|
366
|
-
data-testid="
|
|
366
|
+
data-testid="db-editor"
|
|
367
367
|
>
|
|
368
368
|
{children}
|
|
369
369
|
</div>
|
|
@@ -37,9 +37,9 @@ export function Swatch({ color }: { readonly color: string | undefined }): React
|
|
|
37
37
|
return (
|
|
38
38
|
<span
|
|
39
39
|
className={cx(
|
|
40
|
-
'
|
|
41
|
-
color === 'transparent' && '
|
|
42
|
-
color === undefined && '
|
|
40
|
+
'db-swatch',
|
|
41
|
+
color === 'transparent' && 'db-swatch-transparent',
|
|
42
|
+
color === undefined && 'db-swatch-mixed',
|
|
43
43
|
)}
|
|
44
44
|
style={color === undefined || color === 'transparent' ? undefined : { background: color }}
|
|
45
45
|
/>
|
|
@@ -124,19 +124,19 @@ export function ColorPicker({ label, value, kind, onChange }: ColorPickerProps):
|
|
|
124
124
|
root.current.contains(focused) &&
|
|
125
125
|
!(focused instanceof HTMLInputElement)
|
|
126
126
|
) {
|
|
127
|
-
root.current.querySelector<HTMLElement>('.
|
|
127
|
+
root.current.querySelector<HTMLElement>('.db-color-grid [aria-checked="true"]')?.focus();
|
|
128
128
|
}
|
|
129
129
|
}, [activeFamily]);
|
|
130
130
|
|
|
131
131
|
return (
|
|
132
132
|
<div
|
|
133
133
|
ref={root}
|
|
134
|
-
className="
|
|
134
|
+
className="db-color-picker"
|
|
135
135
|
>
|
|
136
|
-
<h4 className="
|
|
137
|
-
<span className="
|
|
136
|
+
<h4 className="db-color-picker-title">{label}</h4>
|
|
137
|
+
<span className="db-caption">{t('color.colors')}</span>
|
|
138
138
|
<div
|
|
139
|
-
className="
|
|
139
|
+
className="db-color-grid"
|
|
140
140
|
role="radiogroup"
|
|
141
141
|
aria-label={t('color.colors')}
|
|
142
142
|
>
|
|
@@ -150,28 +150,28 @@ export function ColorPicker({ label, value, kind, onChange }: ColorPickerProps):
|
|
|
150
150
|
aria-checked={active?.family === family}
|
|
151
151
|
aria-label={`${t(`color.name.${family}`)} (${key.toUpperCase()})`}
|
|
152
152
|
title={`${t(`color.name.${family}`)} — ${key.toUpperCase()}`}
|
|
153
|
-
className={cx('
|
|
153
|
+
className={cx('db-color-cell', isDarkColor(color) && 'db-on-dark')}
|
|
154
154
|
data-testid={`color-${family}`}
|
|
155
155
|
data-autofocus={active?.family === family ? '' : undefined}
|
|
156
156
|
onClick={() => onChange(color)}
|
|
157
157
|
>
|
|
158
158
|
<Swatch color={color} />
|
|
159
|
-
<span className="
|
|
159
|
+
<span className="db-color-key">{key}</span>
|
|
160
160
|
</button>
|
|
161
161
|
);
|
|
162
162
|
})}
|
|
163
163
|
</div>
|
|
164
|
-
<span className="
|
|
164
|
+
<span className="db-caption">{t('color.shades')}</span>
|
|
165
165
|
{shades.length === 0 ? (
|
|
166
166
|
<p
|
|
167
|
-
className="
|
|
167
|
+
className="db-color-no-shades"
|
|
168
168
|
data-testid="color-no-shades"
|
|
169
169
|
>
|
|
170
170
|
{t('color.noShades')}
|
|
171
171
|
</p>
|
|
172
172
|
) : (
|
|
173
173
|
<div
|
|
174
|
-
className="
|
|
174
|
+
className="db-color-shades"
|
|
175
175
|
role="radiogroup"
|
|
176
176
|
aria-label={t('color.shades')}
|
|
177
177
|
>
|
|
@@ -183,18 +183,18 @@ export function ColorPicker({ label, value, kind, onChange }: ColorPickerProps):
|
|
|
183
183
|
aria-checked={active?.shade === index}
|
|
184
184
|
aria-label={`${t('color.shade', { index: index + 1 })} (Shift+${index + 1})`}
|
|
185
185
|
title={`${t('color.shade', { index: index + 1 })} — Shift+${index + 1}`}
|
|
186
|
-
className={cx('
|
|
186
|
+
className={cx('db-color-cell', isDarkColor(color) && 'db-on-dark')}
|
|
187
187
|
data-testid={`color-shade-${index + 1}`}
|
|
188
188
|
onClick={() => onChange(color)}
|
|
189
189
|
>
|
|
190
190
|
<Swatch color={color} />
|
|
191
|
-
<span className="
|
|
191
|
+
<span className="db-color-key">⇧{index + 1}</span>
|
|
192
192
|
</button>
|
|
193
193
|
))}
|
|
194
194
|
</div>
|
|
195
195
|
)}
|
|
196
|
-
<span className="
|
|
197
|
-
<div className="
|
|
196
|
+
<span className="db-caption">{t('color.hex')}</span>
|
|
197
|
+
<div className="db-color-hex">
|
|
198
198
|
<span aria-hidden>#</span>
|
|
199
199
|
<input
|
|
200
200
|
type="text"
|
|
@@ -289,7 +289,7 @@ export function ColorField({
|
|
|
289
289
|
const anchor = useRef<HTMLButtonElement>(null);
|
|
290
290
|
return (
|
|
291
291
|
<div
|
|
292
|
-
className="
|
|
292
|
+
className="db-color-field"
|
|
293
293
|
data-testid={testId}
|
|
294
294
|
>
|
|
295
295
|
<Choice
|
|
@@ -304,13 +304,13 @@ export function ColorField({
|
|
|
304
304
|
onChange={onChange}
|
|
305
305
|
/>
|
|
306
306
|
<span
|
|
307
|
-
className="
|
|
307
|
+
className="db-color-divider"
|
|
308
308
|
aria-hidden
|
|
309
309
|
/>
|
|
310
310
|
<button
|
|
311
311
|
ref={anchor}
|
|
312
312
|
type="button"
|
|
313
|
-
className="
|
|
313
|
+
className="db-choice-option db-swatch-option db-color-current"
|
|
314
314
|
aria-label={t('color.open', { label })}
|
|
315
315
|
title={t('color.open', { label })}
|
|
316
316
|
aria-haspopup="dialog"
|
|
@@ -121,10 +121,10 @@ export function FontPicker({ value, onChange }: FontPickerProps): ReactNode {
|
|
|
121
121
|
|
|
122
122
|
return (
|
|
123
123
|
<div
|
|
124
|
-
className="
|
|
124
|
+
className="db-font-picker"
|
|
125
125
|
data-testid="font-picker-panel"
|
|
126
126
|
>
|
|
127
|
-
<label className="
|
|
127
|
+
<label className="db-font-search">
|
|
128
128
|
<Icon name="search" />
|
|
129
129
|
<input
|
|
130
130
|
type="search"
|
|
@@ -163,11 +163,11 @@ export function FontPicker({ value, onChange }: FontPickerProps): ReactNode {
|
|
|
163
163
|
<div
|
|
164
164
|
ref={list}
|
|
165
165
|
id={listId}
|
|
166
|
-
className="
|
|
166
|
+
className="db-font-list"
|
|
167
167
|
role="listbox"
|
|
168
168
|
aria-label={t('properties.fontFamily')}
|
|
169
169
|
>
|
|
170
|
-
{entries.length === 0 && <p className="
|
|
170
|
+
{entries.length === 0 && <p className="db-font-empty">{t('font.none')}</p>}
|
|
171
171
|
{sections.map((section) => {
|
|
172
172
|
const items = entries
|
|
173
173
|
.map((entry, index) => ({ entry, index }))
|
|
@@ -184,7 +184,7 @@ export function FontPicker({ value, onChange }: FontPickerProps): ReactNode {
|
|
|
184
184
|
aria-label={section.title}
|
|
185
185
|
>
|
|
186
186
|
<div
|
|
187
|
-
className="
|
|
187
|
+
className="db-font-section"
|
|
188
188
|
aria-hidden
|
|
189
189
|
>
|
|
190
190
|
{section.title}
|
|
@@ -196,9 +196,9 @@ export function FontPicker({ value, onChange }: FontPickerProps): ReactNode {
|
|
|
196
196
|
role="option"
|
|
197
197
|
aria-selected={entry.id === value}
|
|
198
198
|
className={cx(
|
|
199
|
-
'
|
|
200
|
-
index === active && '
|
|
201
|
-
entry.id === value && '
|
|
199
|
+
'db-font-option',
|
|
200
|
+
index === active && 'db-active',
|
|
201
|
+
entry.id === value && 'db-selected',
|
|
202
202
|
)}
|
|
203
203
|
data-index={index}
|
|
204
204
|
data-testid={`font-option-${entry.id}`}
|
|
@@ -246,7 +246,7 @@ export function FontFamilyField({ value, onChange, testId }: FontFamilyFieldProp
|
|
|
246
246
|
: t('font.current', { name: fontName(editor.fonts.get(value), t, value) });
|
|
247
247
|
return (
|
|
248
248
|
<div
|
|
249
|
-
className="
|
|
249
|
+
className="db-color-field"
|
|
250
250
|
data-testid={testId}
|
|
251
251
|
>
|
|
252
252
|
<Choice
|
|
@@ -260,13 +260,13 @@ export function FontFamilyField({ value, onChange, testId }: FontFamilyFieldProp
|
|
|
260
260
|
onChange={onChange}
|
|
261
261
|
/>
|
|
262
262
|
<span
|
|
263
|
-
className="
|
|
263
|
+
className="db-color-divider"
|
|
264
264
|
aria-hidden
|
|
265
265
|
/>
|
|
266
266
|
<button
|
|
267
267
|
ref={anchor}
|
|
268
268
|
type="button"
|
|
269
|
-
className="
|
|
269
|
+
className="db-choice-option db-choice-square"
|
|
270
270
|
aria-label={title}
|
|
271
271
|
title={title}
|
|
272
272
|
aria-haspopup="dialog"
|
|
@@ -58,7 +58,7 @@ export function IconButton({
|
|
|
58
58
|
return (
|
|
59
59
|
<button
|
|
60
60
|
type="button"
|
|
61
|
-
className={cx('
|
|
61
|
+
className={cx('db-icon-button', danger && 'db-danger', className)}
|
|
62
62
|
aria-label={label}
|
|
63
63
|
title={title}
|
|
64
64
|
aria-pressed={pressed}
|
|
@@ -88,7 +88,7 @@ export function Island({
|
|
|
88
88
|
}): ReactNode {
|
|
89
89
|
return (
|
|
90
90
|
<div
|
|
91
|
-
className={cx('
|
|
91
|
+
className={cx('db-island', className)}
|
|
92
92
|
aria-label={label}
|
|
93
93
|
role={role}
|
|
94
94
|
data-testid={testId}
|
|
@@ -184,7 +184,7 @@ function useDismiss(
|
|
|
184
184
|
const target = event.target as Node;
|
|
185
185
|
// Popovers opened from inside this one (a color picker in a menu) portal after it.
|
|
186
186
|
const nested = (target instanceof Element ? target : target.parentElement)?.closest(
|
|
187
|
-
'.
|
|
187
|
+
'.db-popover',
|
|
188
188
|
);
|
|
189
189
|
const own = refs[0]?.current;
|
|
190
190
|
const inChild =
|
|
@@ -291,7 +291,7 @@ export function Popover({
|
|
|
291
291
|
<Portal>
|
|
292
292
|
<div
|
|
293
293
|
ref={ref}
|
|
294
|
-
className="
|
|
294
|
+
className="db-popover db-island"
|
|
295
295
|
role={role}
|
|
296
296
|
aria-label={label}
|
|
297
297
|
style={style}
|
|
@@ -327,11 +327,11 @@ export function MenuItems({
|
|
|
327
327
|
return entries.map((entry) => (
|
|
328
328
|
<div
|
|
329
329
|
key={entry.id}
|
|
330
|
-
className="
|
|
330
|
+
className="db-menu-group"
|
|
331
331
|
>
|
|
332
332
|
{entry.separatorBefore === true && (
|
|
333
333
|
<div
|
|
334
|
-
className="
|
|
334
|
+
className="db-separator"
|
|
335
335
|
role="separator"
|
|
336
336
|
/>
|
|
337
337
|
)}
|
|
@@ -339,7 +339,7 @@ export function MenuItems({
|
|
|
339
339
|
type="button"
|
|
340
340
|
role={entry.checked === undefined ? 'menuitem' : 'menuitemcheckbox'}
|
|
341
341
|
{...(entry.checked === undefined ? {} : { 'aria-checked': entry.checked })}
|
|
342
|
-
className={cx('
|
|
342
|
+
className={cx('db-menu-item', entry.danger && 'db-danger')}
|
|
343
343
|
disabled={entry.disabled}
|
|
344
344
|
data-testid={`menu-item-${entry.id}`}
|
|
345
345
|
onClick={() => {
|
|
@@ -350,11 +350,11 @@ export function MenuItems({
|
|
|
350
350
|
{entry.checked === true ? (
|
|
351
351
|
<Icon name="check" />
|
|
352
352
|
) : entry.icon === undefined ? (
|
|
353
|
-
<span className="
|
|
353
|
+
<span className="db-menu-icon" />
|
|
354
354
|
) : (
|
|
355
355
|
<Icon name={entry.icon} />
|
|
356
356
|
)}
|
|
357
|
-
<span className="
|
|
357
|
+
<span className="db-menu-label">{entry.label}</span>
|
|
358
358
|
{entry.shortcut !== undefined && <kbd>{formatShortcut(entry.shortcut)}</kbd>}
|
|
359
359
|
</button>
|
|
360
360
|
</div>
|
|
@@ -434,7 +434,7 @@ export function Dialog({ open, onClose, title, testId, wide, children }: DialogP
|
|
|
434
434
|
return (
|
|
435
435
|
<Portal>
|
|
436
436
|
<div
|
|
437
|
-
className="
|
|
437
|
+
className="db-dialog-backdrop"
|
|
438
438
|
onPointerDown={(event) => {
|
|
439
439
|
if (event.target === event.currentTarget) {
|
|
440
440
|
onClose();
|
|
@@ -443,14 +443,14 @@ export function Dialog({ open, onClose, title, testId, wide, children }: DialogP
|
|
|
443
443
|
>
|
|
444
444
|
<div
|
|
445
445
|
ref={ref}
|
|
446
|
-
className={cx('
|
|
446
|
+
className={cx('db-dialog db-island', wide && 'db-dialog-wide')}
|
|
447
447
|
role="dialog"
|
|
448
448
|
aria-modal="true"
|
|
449
449
|
aria-labelledby={titleId}
|
|
450
450
|
data-testid={testId}
|
|
451
451
|
onKeyDown={onKeyDown}
|
|
452
452
|
>
|
|
453
|
-
<header className="
|
|
453
|
+
<header className="db-dialog-header">
|
|
454
454
|
<h2 id={titleId}>{title}</h2>
|
|
455
455
|
<IconButton
|
|
456
456
|
icon="close"
|
|
@@ -459,7 +459,7 @@ export function Dialog({ open, onClose, title, testId, wide, children }: DialogP
|
|
|
459
459
|
testId="dialog-close"
|
|
460
460
|
/>
|
|
461
461
|
</header>
|
|
462
|
-
<div className="
|
|
462
|
+
<div className="db-dialog-body">{children}</div>
|
|
463
463
|
</div>
|
|
464
464
|
</div>
|
|
465
465
|
</Portal>
|
|
@@ -494,7 +494,7 @@ export function Choice<Value extends string | number>({
|
|
|
494
494
|
}): ReactNode {
|
|
495
495
|
return (
|
|
496
496
|
<div
|
|
497
|
-
className="
|
|
497
|
+
className="db-choice"
|
|
498
498
|
role="radiogroup"
|
|
499
499
|
aria-label={label}
|
|
500
500
|
data-testid={testId}
|
|
@@ -510,29 +510,29 @@ export function Choice<Value extends string | number>({
|
|
|
510
510
|
title={option.label}
|
|
511
511
|
disabled={disabled}
|
|
512
512
|
className={cx(
|
|
513
|
-
'
|
|
514
|
-
option.swatch !== undefined && '
|
|
515
|
-
(option.icon !== undefined || option.glyph !== undefined) && '
|
|
513
|
+
'db-choice-option',
|
|
514
|
+
option.swatch !== undefined && 'db-swatch-option',
|
|
515
|
+
(option.icon !== undefined || option.glyph !== undefined) && 'db-choice-square',
|
|
516
516
|
)}
|
|
517
517
|
data-value={String(option.value)}
|
|
518
518
|
onClick={() => onChange(option.value)}
|
|
519
519
|
>
|
|
520
520
|
{option.swatch !== undefined ? (
|
|
521
521
|
<span
|
|
522
|
-
className={cx('
|
|
522
|
+
className={cx('db-swatch', option.swatch === 'transparent' && 'db-swatch-none')}
|
|
523
523
|
style={option.swatch === 'transparent' ? undefined : { background: option.swatch }}
|
|
524
524
|
/>
|
|
525
525
|
) : option.icon !== undefined ? (
|
|
526
526
|
<Icon name={option.icon} />
|
|
527
527
|
) : option.glyph !== undefined ? (
|
|
528
528
|
<span
|
|
529
|
-
className="
|
|
529
|
+
className="db-choice-glyph"
|
|
530
530
|
aria-hidden
|
|
531
531
|
>
|
|
532
532
|
{option.glyph}
|
|
533
533
|
</span>
|
|
534
534
|
) : (
|
|
535
|
-
<span className="
|
|
535
|
+
<span className="db-choice-text">{option.label}</span>
|
|
536
536
|
)}
|
|
537
537
|
</button>
|
|
538
538
|
))}
|
|
@@ -550,12 +550,12 @@ export function Section({
|
|
|
550
550
|
const id = useId();
|
|
551
551
|
return (
|
|
552
552
|
<section
|
|
553
|
-
className="
|
|
553
|
+
className="db-section"
|
|
554
554
|
aria-labelledby={id}
|
|
555
555
|
>
|
|
556
556
|
<h3
|
|
557
557
|
id={id}
|
|
558
|
-
className="
|
|
558
|
+
className="db-section-title"
|
|
559
559
|
>
|
|
560
560
|
{title}
|
|
561
561
|
</h3>
|
|
@@ -309,7 +309,7 @@ export function ContextMenu(): ReactNode {
|
|
|
309
309
|
<Portal>
|
|
310
310
|
<div
|
|
311
311
|
ref={ref}
|
|
312
|
-
className="
|
|
312
|
+
className="db-popover db-island db-context-menu"
|
|
313
313
|
role="menu"
|
|
314
314
|
tabIndex={-1}
|
|
315
315
|
aria-label={t('contextMenu.label')}
|
|
@@ -23,7 +23,7 @@ export function UndoRedo(): ReactNode {
|
|
|
23
23
|
const redo = useCommand('core.redo');
|
|
24
24
|
return (
|
|
25
25
|
<Island
|
|
26
|
-
className="
|
|
26
|
+
className="db-row"
|
|
27
27
|
testId="undo-redo"
|
|
28
28
|
>
|
|
29
29
|
<IconButton
|
|
@@ -106,16 +106,16 @@ export function ZoomControls({ minimap }: ZoomControlsProps = {}): ReactNode {
|
|
|
106
106
|
},
|
|
107
107
|
];
|
|
108
108
|
return (
|
|
109
|
-
<div className="
|
|
110
|
-
{minimapOpen && <div className="
|
|
109
|
+
<div className="db-zoom">
|
|
110
|
+
{minimapOpen && <div className="db-minimap-card">{minimap}</div>}
|
|
111
111
|
<Island
|
|
112
|
-
className="
|
|
112
|
+
className="db-row"
|
|
113
113
|
testId="zoom-controls"
|
|
114
114
|
>
|
|
115
115
|
<button
|
|
116
116
|
ref={anchor}
|
|
117
117
|
type="button"
|
|
118
|
-
className="
|
|
118
|
+
className="db-zoom-level"
|
|
119
119
|
aria-haspopup="menu"
|
|
120
120
|
aria-expanded={menuOpen}
|
|
121
121
|
aria-label={`${t('zoom.menu')} (${t('zoom.level', { percent })})`}
|
|
@@ -131,7 +131,7 @@ export function ZoomControls({ minimap }: ZoomControlsProps = {}): ReactNode {
|
|
|
131
131
|
label={t('minimap.toggle')}
|
|
132
132
|
pressed={minimapOpen}
|
|
133
133
|
onClick={() => setOpen('minimap', !minimapOpen)}
|
|
134
|
-
className="
|
|
134
|
+
className="db-minimap-toggle"
|
|
135
135
|
testId="minimap-toggle"
|
|
136
136
|
/>
|
|
137
137
|
)}
|
|
@@ -211,7 +211,7 @@ export function ScrollToContent(): ReactNode {
|
|
|
211
211
|
return (
|
|
212
212
|
<button
|
|
213
213
|
type="button"
|
|
214
|
-
className="
|
|
214
|
+
className="db-pill"
|
|
215
215
|
onClick={() => void scrollToContent(editor)}
|
|
216
216
|
data-testid="scroll-to-content"
|
|
217
217
|
>
|
|
@@ -76,8 +76,8 @@ export function ExportDialog({ fileName = 'canvas' }: { readonly fileName?: stri
|
|
|
76
76
|
testId="export-dialog"
|
|
77
77
|
wide
|
|
78
78
|
>
|
|
79
|
-
<div className="
|
|
80
|
-
<div className="
|
|
79
|
+
<div className="db-export">
|
|
80
|
+
<div className="db-export-preview">
|
|
81
81
|
{preview !== undefined && (
|
|
82
82
|
<img
|
|
83
83
|
src={preview.url}
|
|
@@ -86,8 +86,8 @@ export function ExportDialog({ fileName = 'canvas' }: { readonly fileName?: stri
|
|
|
86
86
|
/>
|
|
87
87
|
)}
|
|
88
88
|
</div>
|
|
89
|
-
<div className="
|
|
90
|
-
<label className="
|
|
89
|
+
<div className="db-fields">
|
|
90
|
+
<label className="db-field">
|
|
91
91
|
<span>{t('export.format')}</span>
|
|
92
92
|
<select
|
|
93
93
|
value={format}
|
|
@@ -98,7 +98,7 @@ export function ExportDialog({ fileName = 'canvas' }: { readonly fileName?: stri
|
|
|
98
98
|
<option value="svg">SVG</option>
|
|
99
99
|
</select>
|
|
100
100
|
</label>
|
|
101
|
-
<label className="
|
|
101
|
+
<label className="db-check">
|
|
102
102
|
<input
|
|
103
103
|
type="checkbox"
|
|
104
104
|
checked={onlySelected}
|
|
@@ -107,7 +107,7 @@ export function ExportDialog({ fileName = 'canvas' }: { readonly fileName?: stri
|
|
|
107
107
|
/>
|
|
108
108
|
{t('export.selectionOnly')}
|
|
109
109
|
</label>
|
|
110
|
-
<label className="
|
|
110
|
+
<label className="db-check">
|
|
111
111
|
<input
|
|
112
112
|
type="checkbox"
|
|
113
113
|
checked={background}
|
|
@@ -116,7 +116,7 @@ export function ExportDialog({ fileName = 'canvas' }: { readonly fileName?: stri
|
|
|
116
116
|
/>
|
|
117
117
|
{t('export.background')}
|
|
118
118
|
</label>
|
|
119
|
-
<label className="
|
|
119
|
+
<label className="db-check">
|
|
120
120
|
<input
|
|
121
121
|
type="checkbox"
|
|
122
122
|
checked={grid}
|
|
@@ -124,7 +124,7 @@ export function ExportDialog({ fileName = 'canvas' }: { readonly fileName?: stri
|
|
|
124
124
|
/>
|
|
125
125
|
{t('export.grid')}
|
|
126
126
|
</label>
|
|
127
|
-
<label className="
|
|
127
|
+
<label className="db-field">
|
|
128
128
|
<span>{t('export.scale')}</span>
|
|
129
129
|
<select
|
|
130
130
|
value={scale}
|
|
@@ -136,7 +136,7 @@ export function ExportDialog({ fileName = 'canvas' }: { readonly fileName?: stri
|
|
|
136
136
|
<option value={3}>3×</option>
|
|
137
137
|
</select>
|
|
138
138
|
</label>
|
|
139
|
-
<label className="
|
|
139
|
+
<label className="db-field">
|
|
140
140
|
<span>{t('export.padding')}</span>
|
|
141
141
|
<input
|
|
142
142
|
type="number"
|
|
@@ -147,11 +147,11 @@ export function ExportDialog({ fileName = 'canvas' }: { readonly fileName?: stri
|
|
|
147
147
|
/>
|
|
148
148
|
</label>
|
|
149
149
|
{preview !== undefined && preview.warnings > 0 && (
|
|
150
|
-
<p className="
|
|
150
|
+
<p className="db-caption">{t('export.warnings', { count: preview.warnings })}</p>
|
|
151
151
|
)}
|
|
152
152
|
<button
|
|
153
153
|
type="button"
|
|
154
|
-
className="
|
|
154
|
+
className="db-primary"
|
|
155
155
|
data-testid="export-download"
|
|
156
156
|
onClick={() => void save()}
|
|
157
157
|
>
|