@mocanvas/mocanvas 4.0.2 → 4.1.0
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/ARCHITECTURE.md +8 -2
- package/MIGRATION.md +46 -22
- package/README.md +27 -2
- package/UI.md +24 -2
- package/dist/{chunk-TWCVRVK2.js → chunk-3F2HKY37.js} +3 -3
- package/dist/{chunk-TWCVRVK2.js.map → chunk-3F2HKY37.js.map} +1 -1
- package/dist/{chunk-DMCI6V5Y.js → chunk-HRUFJLK5.js} +3 -3
- package/dist/{chunk-DMCI6V5Y.js.map → chunk-HRUFJLK5.js.map} +1 -1
- package/dist/{chunk-OCYJAMXT.js → chunk-S7FPGQAA.js} +22 -3
- package/dist/chunk-S7FPGQAA.js.map +1 -0
- package/dist/{chunk-QDUQZXE4.js → chunk-YMUR46N6.js} +456 -19
- package/dist/chunk-YMUR46N6.js.map +1 -0
- package/dist/{export-VQGOVONC.js → export-UA6X35ZW.js} +4 -4
- package/dist/{export-VQGOVONC.js.map → export-UA6X35ZW.js.map} +1 -1
- package/dist/index.d.ts +279 -35
- package/dist/index.js +404 -410
- package/dist/index.js.map +1 -1
- package/dist/{ui-4C5V5GYT.css → mocanvas.css} +73 -241
- package/dist/mocanvas.css.map +1 -0
- package/dist/panel-shortcuts-4GIFCQQR.js +4 -0
- package/dist/{panel-shortcuts-R2PDTDUN.js.map → panel-shortcuts-4GIFCQQR.js.map} +1 -1
- package/dist/urlContent-WYYVQYYN.js +4 -0
- package/dist/{urlContent-GC44EU52.js.map → urlContent-WYYVQYYN.js.map} +1 -1
- package/package.json +8 -4
- package/dist/chunk-OCYJAMXT.js.map +0 -1
- package/dist/chunk-QDUQZXE4.js.map +0 -1
- package/dist/panel-shortcuts-R2PDTDUN.js +0 -4
- package/dist/urlContent-GC44EU52.js +0 -4
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Default UI theme.
|
|
3
|
-
*
|
|
4
|
-
* Everything is driven by custom properties declared on the editor container
|
|
5
|
-
* (`.mocanvas`), so an app can restyle the whole UI — chrome drawn on the
|
|
6
|
-
* canvas included — by overriding a handful of variables. See `docs/UI.md`.
|
|
7
|
-
*
|
|
8
|
-
* Every text/background pair below is at or above 4.5:1 in both palettes, and
|
|
9
|
-
* every icon or canvas-chrome stroke is at or above 3:1 against the surface it
|
|
10
|
-
* sits on.
|
|
11
|
-
*/
|
|
12
|
-
|
|
1
|
+
/* src/ui/ui.css */
|
|
13
2
|
.mocanvas,
|
|
14
3
|
.mocanvas-panel,
|
|
15
4
|
.mocanvas-layer {
|
|
16
|
-
/* surfaces */
|
|
17
5
|
--mocanvas-ui-panel: #ffffff;
|
|
18
6
|
--mocanvas-ui-panel-border: #d6d9e0;
|
|
19
7
|
--mocanvas-ui-control: rgba(16, 24, 40, 0.06);
|
|
@@ -28,8 +16,6 @@
|
|
|
28
16
|
--mocanvas-ui-tip-bg: #16181d;
|
|
29
17
|
--mocanvas-ui-tip-fg: #f6f7f9;
|
|
30
18
|
--mocanvas-ui-tip-muted: #a9aeb9;
|
|
31
|
-
|
|
32
|
-
/* metrics */
|
|
33
19
|
--mocanvas-ui-radius: 12px;
|
|
34
20
|
--mocanvas-ui-radius-sm: 8px;
|
|
35
21
|
--mocanvas-ui-btn: 40px;
|
|
@@ -38,31 +24,23 @@
|
|
|
38
24
|
--mocanvas-ui-pad: 4px;
|
|
39
25
|
--mocanvas-ui-pad-lg: 10px;
|
|
40
26
|
--mocanvas-ui-inset: 12px;
|
|
41
|
-
/*
|
|
42
|
-
* Width the bottom-left and bottom-right docks (zoom bar, stats chip) reserve
|
|
43
|
-
* on either side of the centred toolbar. The toolbar wraps rather than grow
|
|
44
|
-
* into that reservation, so the three can never collide.
|
|
45
|
-
*/
|
|
46
27
|
--mocanvas-ui-dock: 300px;
|
|
47
|
-
/* Height the bottom edge occupies; the style panel stops above it. */
|
|
48
28
|
--mocanvas-ui-bottom-dock: 62px;
|
|
49
|
-
--mocanvas-ui-font:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
*/
|
|
29
|
+
--mocanvas-ui-font:
|
|
30
|
+
system-ui,
|
|
31
|
+
-apple-system,
|
|
32
|
+
"Segoe UI",
|
|
33
|
+
sans-serif;
|
|
34
|
+
--mocanvas-ui-mono:
|
|
35
|
+
ui-monospace,
|
|
36
|
+
SFMono-Regular,
|
|
37
|
+
Menlo,
|
|
38
|
+
monospace;
|
|
60
39
|
--mocanvas-selection: #2f6fe4;
|
|
61
40
|
--mocanvas-selection-fg: #ffffff;
|
|
62
41
|
--mocanvas-brush-fill: rgba(47, 111, 228, 0.12);
|
|
63
42
|
--mocanvas-snap: #cf3fe0;
|
|
64
43
|
}
|
|
65
|
-
|
|
66
44
|
@media (prefers-color-scheme: dark) {
|
|
67
45
|
.mocanvas,
|
|
68
46
|
.mocanvas-panel,
|
|
@@ -83,9 +61,6 @@
|
|
|
83
61
|
--mocanvas-ui-tip-muted: #b9bec9;
|
|
84
62
|
}
|
|
85
63
|
}
|
|
86
|
-
|
|
87
|
-
/* --- surfaces ----------------------------------------------------------- */
|
|
88
|
-
|
|
89
64
|
.mocanvas-panel {
|
|
90
65
|
position: absolute;
|
|
91
66
|
z-index: 10;
|
|
@@ -105,13 +80,6 @@
|
|
|
105
80
|
user-select: none;
|
|
106
81
|
-webkit-user-select: none;
|
|
107
82
|
}
|
|
108
|
-
|
|
109
|
-
/*
|
|
110
|
-
* `left: 50%` alone caps an absolutely positioned box at half the container
|
|
111
|
-
* width (shrink-to-fit uses `container - left`), which made the toolbar wrap on
|
|
112
|
-
* any viewport narrower than twice its own width. Anchoring both edges and
|
|
113
|
-
* letting the margins centre a `max-content` box has no such cap.
|
|
114
|
-
*/
|
|
115
83
|
.mocanvas-toolbar {
|
|
116
84
|
left: var(--mocanvas-ui-inset);
|
|
117
85
|
right: var(--mocanvas-ui-inset);
|
|
@@ -122,19 +90,13 @@
|
|
|
122
90
|
flex-wrap: wrap;
|
|
123
91
|
justify-content: center;
|
|
124
92
|
}
|
|
125
|
-
|
|
126
93
|
.mocanvas-zoombar {
|
|
127
94
|
left: var(--mocanvas-ui-inset);
|
|
128
95
|
bottom: var(--mocanvas-ui-inset);
|
|
129
96
|
}
|
|
130
|
-
|
|
131
97
|
.mocanvas-stylepanel {
|
|
132
98
|
right: var(--mocanvas-ui-inset);
|
|
133
99
|
top: var(--mocanvas-ui-inset);
|
|
134
|
-
/*
|
|
135
|
-
* Sized so the content column still holds two 3-button groups side by side
|
|
136
|
-
* (2 × 124 + 4) with a classic 17px scrollbar taking its share of the width.
|
|
137
|
-
*/
|
|
138
100
|
width: 292px;
|
|
139
101
|
max-height: calc(100% - 2 * var(--mocanvas-ui-inset) - var(--mocanvas-ui-bottom-dock));
|
|
140
102
|
overflow-y: auto;
|
|
@@ -144,22 +106,34 @@
|
|
|
144
106
|
align-items: stretch;
|
|
145
107
|
gap: var(--mocanvas-ui-pad-lg);
|
|
146
108
|
padding: var(--mocanvas-ui-pad-lg);
|
|
147
|
-
/*
|
|
148
|
-
* Scroll affordance: two fixed gradients painted against the panel and two
|
|
149
|
-
* scrolling shadows behind them. The shadow only shows while content is
|
|
150
|
-
* clipped in that direction, so a short panel looks flat.
|
|
151
|
-
*/
|
|
152
109
|
background-image:
|
|
153
110
|
linear-gradient(var(--mocanvas-ui-panel) 30%, rgba(0, 0, 0, 0)),
|
|
154
111
|
linear-gradient(rgba(0, 0, 0, 0), var(--mocanvas-ui-panel) 70%),
|
|
155
|
-
radial-gradient(
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
112
|
+
radial-gradient(
|
|
113
|
+
farthest-side at 50% 0,
|
|
114
|
+
rgba(15, 18, 25, 0.22),
|
|
115
|
+
rgba(0, 0, 0, 0)),
|
|
116
|
+
radial-gradient(
|
|
117
|
+
farthest-side at 50% 100%,
|
|
118
|
+
rgba(15, 18, 25, 0.22),
|
|
119
|
+
rgba(0, 0, 0, 0));
|
|
120
|
+
background-position:
|
|
121
|
+
0 0,
|
|
122
|
+
0 100%,
|
|
123
|
+
0 0,
|
|
124
|
+
0 100%;
|
|
125
|
+
background-size:
|
|
126
|
+
100% 26px,
|
|
127
|
+
100% 26px,
|
|
128
|
+
100% 9px,
|
|
129
|
+
100% 9px;
|
|
159
130
|
background-repeat: no-repeat;
|
|
160
|
-
background-attachment:
|
|
131
|
+
background-attachment:
|
|
132
|
+
local,
|
|
133
|
+
local,
|
|
134
|
+
scroll,
|
|
135
|
+
scroll;
|
|
161
136
|
}
|
|
162
|
-
|
|
163
137
|
.mocanvas-stats {
|
|
164
138
|
right: var(--mocanvas-ui-inset);
|
|
165
139
|
bottom: var(--mocanvas-ui-inset);
|
|
@@ -173,12 +147,10 @@
|
|
|
173
147
|
color: var(--mocanvas-ui-muted);
|
|
174
148
|
border-radius: var(--mocanvas-ui-radius-sm);
|
|
175
149
|
}
|
|
176
|
-
|
|
177
150
|
.mocanvas-stats b {
|
|
178
151
|
color: var(--mocanvas-ui-text);
|
|
179
152
|
font-weight: 600;
|
|
180
153
|
}
|
|
181
|
-
|
|
182
154
|
.mocanvas-divider {
|
|
183
155
|
flex: 0 0 auto;
|
|
184
156
|
align-self: stretch;
|
|
@@ -186,40 +158,23 @@
|
|
|
186
158
|
margin: 4px 3px;
|
|
187
159
|
background: var(--mocanvas-ui-panel-border);
|
|
188
160
|
}
|
|
189
|
-
|
|
190
|
-
/*
|
|
191
|
-
* Narrow layouts. The bottom edge holds three panels — zoom bar, toolbar,
|
|
192
|
-
* stats — whose natural widths add up to about 1290px. Below that the toolbar
|
|
193
|
-
* takes a row of its own and stops reserving the docks; below 560px the stats
|
|
194
|
-
* chip moves out of the bottom edge altogether.
|
|
195
|
-
*/
|
|
196
161
|
@media (max-width: 1290px) {
|
|
197
162
|
.mocanvas,
|
|
198
163
|
.mocanvas-panel {
|
|
199
|
-
/* the toolbar now has a row of its own above the zoom bar */
|
|
200
164
|
--mocanvas-ui-bottom-dock: 124px;
|
|
201
165
|
}
|
|
202
|
-
|
|
203
166
|
.mocanvas-toolbar {
|
|
204
167
|
--mocanvas-ui-dock: 0px;
|
|
205
168
|
bottom: calc(2 * var(--mocanvas-ui-inset) + 50px);
|
|
206
169
|
}
|
|
207
170
|
}
|
|
208
|
-
|
|
209
|
-
/*
|
|
210
|
-
* Phone-width: the bottom edge cannot hold the zoom bar and the stats chip side
|
|
211
|
-
* by side, so each takes a row of its own and the style panel keeps the top,
|
|
212
|
-
* spanning the width and capped at a share of the height.
|
|
213
|
-
*/
|
|
214
171
|
@media (max-width: 560px) {
|
|
215
172
|
.mocanvas-stats {
|
|
216
173
|
bottom: calc(2 * var(--mocanvas-ui-inset) + 50px);
|
|
217
174
|
}
|
|
218
|
-
|
|
219
175
|
.mocanvas-toolbar {
|
|
220
176
|
bottom: calc(3 * var(--mocanvas-ui-inset) + 112px);
|
|
221
177
|
}
|
|
222
|
-
|
|
223
178
|
.mocanvas-stylepanel {
|
|
224
179
|
left: var(--mocanvas-ui-inset);
|
|
225
180
|
right: var(--mocanvas-ui-inset);
|
|
@@ -227,9 +182,6 @@
|
|
|
227
182
|
max-height: 42%;
|
|
228
183
|
}
|
|
229
184
|
}
|
|
230
|
-
|
|
231
|
-
/* --- buttons ------------------------------------------------------------ */
|
|
232
|
-
|
|
233
185
|
.mocanvas-btn {
|
|
234
186
|
position: relative;
|
|
235
187
|
flex: 0 0 auto;
|
|
@@ -251,59 +203,47 @@
|
|
|
251
203
|
font-weight: 600;
|
|
252
204
|
line-height: 1;
|
|
253
205
|
cursor: pointer;
|
|
254
|
-
transition:
|
|
206
|
+
transition:
|
|
207
|
+
background-color 0.12s ease,
|
|
208
|
+
color 0.12s ease,
|
|
209
|
+
transform 0.08s ease;
|
|
255
210
|
}
|
|
256
|
-
|
|
257
211
|
.mocanvas-btn--wide {
|
|
258
212
|
width: auto;
|
|
259
213
|
min-width: 56px;
|
|
260
214
|
padding: 0 10px;
|
|
261
215
|
font-variant-numeric: tabular-nums;
|
|
262
216
|
}
|
|
263
|
-
|
|
264
217
|
.mocanvas-btn:hover:not(:disabled) {
|
|
265
218
|
background: var(--mocanvas-ui-hover);
|
|
266
219
|
}
|
|
267
|
-
|
|
268
220
|
.mocanvas-btn:active:not(:disabled) {
|
|
269
221
|
background: var(--mocanvas-ui-active);
|
|
270
222
|
transform: scale(0.94);
|
|
271
223
|
}
|
|
272
|
-
|
|
273
|
-
.mocanvas-btn[aria-
|
|
274
|
-
.mocanvas-btn[aria-checked="true"] {
|
|
224
|
+
.mocanvas-btn[aria-pressed=true],
|
|
225
|
+
.mocanvas-btn[aria-checked=true] {
|
|
275
226
|
background: var(--mocanvas-ui-accent);
|
|
276
227
|
color: var(--mocanvas-ui-accent-fg);
|
|
277
228
|
}
|
|
278
|
-
|
|
279
|
-
.mocanvas-btn[aria-
|
|
280
|
-
.mocanvas-btn[aria-
|
|
281
|
-
.mocanvas-btn[aria-
|
|
282
|
-
.mocanvas-btn[aria-checked="true"]:active {
|
|
229
|
+
.mocanvas-btn[aria-pressed=true]:hover,
|
|
230
|
+
.mocanvas-btn[aria-checked=true]:hover,
|
|
231
|
+
.mocanvas-btn[aria-pressed=true]:active,
|
|
232
|
+
.mocanvas-btn[aria-checked=true]:active {
|
|
283
233
|
background: var(--mocanvas-ui-accent);
|
|
284
|
-
/* The accent already reads as "on"; darkening it would break its contrast
|
|
285
|
-
with the label, so pressed buttons signal hover with the ring instead. */
|
|
286
234
|
box-shadow: inset 0 0 0 2px var(--mocanvas-ui-panel), inset 0 0 0 3px var(--mocanvas-ui-accent);
|
|
287
235
|
}
|
|
288
|
-
|
|
289
|
-
/* The tint carries the "open" signal on its own; tinting the icon as well
|
|
290
|
-
would drop it to 4.37:1 against that tint in the light palette. */
|
|
291
|
-
.mocanvas-btn[aria-expanded="true"]:not([aria-pressed="true"]):not([aria-checked="true"]) {
|
|
236
|
+
.mocanvas-btn[aria-expanded=true]:not([aria-pressed=true]):not([aria-checked=true]) {
|
|
292
237
|
background: var(--mocanvas-ui-accent-soft);
|
|
293
238
|
}
|
|
294
|
-
|
|
295
239
|
.mocanvas-btn:disabled {
|
|
296
240
|
opacity: 0.35;
|
|
297
241
|
cursor: default;
|
|
298
242
|
}
|
|
299
|
-
|
|
300
243
|
.mocanvas-btn:focus,
|
|
301
244
|
.mocanvas-swatch:focus {
|
|
302
245
|
outline: none;
|
|
303
246
|
}
|
|
304
|
-
|
|
305
|
-
/* The 2px offset keeps a ring of panel colour between an accent-filled button
|
|
306
|
-
and its accent ring, so focus stays visible on a pressed control. */
|
|
307
247
|
.mocanvas-btn:focus-visible,
|
|
308
248
|
.mocanvas-swatch:focus-visible,
|
|
309
249
|
.mocanvas-slider:focus-visible {
|
|
@@ -311,47 +251,35 @@
|
|
|
311
251
|
outline-offset: 2px;
|
|
312
252
|
z-index: 1;
|
|
313
253
|
}
|
|
314
|
-
|
|
315
|
-
/* Buttons take their icon size from the token; icons used as inline marks
|
|
316
|
-
(the "mixed" badge, the picker chevron) keep the size they ask for. */
|
|
317
254
|
.mocanvas-btn > .mocanvas-icon {
|
|
318
255
|
width: var(--mocanvas-ui-icon);
|
|
319
256
|
height: var(--mocanvas-ui-icon);
|
|
320
257
|
}
|
|
321
|
-
|
|
322
|
-
/* --- style panel groups ------------------------------------------------- */
|
|
323
|
-
|
|
324
258
|
.mocanvas-group {
|
|
325
259
|
display: flex;
|
|
326
260
|
flex-direction: column;
|
|
327
261
|
gap: 8px;
|
|
328
262
|
}
|
|
329
|
-
|
|
330
263
|
.mocanvas-group + .mocanvas-group {
|
|
331
264
|
padding-top: var(--mocanvas-ui-pad-lg);
|
|
332
265
|
border-top: 1px solid var(--mocanvas-ui-panel-border);
|
|
333
266
|
}
|
|
334
|
-
|
|
335
267
|
.mocanvas-seg {
|
|
336
268
|
display: flex;
|
|
337
269
|
flex-wrap: wrap;
|
|
338
270
|
gap: var(--mocanvas-ui-gap);
|
|
339
271
|
}
|
|
340
|
-
|
|
341
|
-
.mocanvas-seg .mocanvas-btn:not([aria-checked="true"]):not([aria-pressed="true"]) {
|
|
272
|
+
.mocanvas-seg .mocanvas-btn:not([aria-checked=true]):not([aria-pressed=true]) {
|
|
342
273
|
background: var(--mocanvas-ui-control);
|
|
343
274
|
}
|
|
344
|
-
|
|
345
|
-
.mocanvas-seg .mocanvas-btn:hover:not([aria-checked="true"]):not([aria-pressed="true"]) {
|
|
275
|
+
.mocanvas-seg .mocanvas-btn:hover:not([aria-checked=true]):not([aria-pressed=true]) {
|
|
346
276
|
background: var(--mocanvas-ui-accent-soft);
|
|
347
277
|
}
|
|
348
|
-
|
|
349
278
|
.mocanvas-seg--split {
|
|
350
279
|
flex-wrap: nowrap;
|
|
351
280
|
justify-content: space-between;
|
|
352
281
|
gap: 4px;
|
|
353
282
|
}
|
|
354
|
-
|
|
355
283
|
.mocanvas-row-label {
|
|
356
284
|
display: flex;
|
|
357
285
|
align-items: center;
|
|
@@ -364,7 +292,6 @@
|
|
|
364
292
|
letter-spacing: 0.5px;
|
|
365
293
|
text-transform: uppercase;
|
|
366
294
|
}
|
|
367
|
-
|
|
368
295
|
.mocanvas-mixed {
|
|
369
296
|
display: inline-flex;
|
|
370
297
|
align-items: center;
|
|
@@ -375,9 +302,6 @@
|
|
|
375
302
|
letter-spacing: 0;
|
|
376
303
|
text-transform: none;
|
|
377
304
|
}
|
|
378
|
-
|
|
379
|
-
/* --- the shape picker --------------------------------------------------- */
|
|
380
|
-
|
|
381
305
|
.mocanvas-picker {
|
|
382
306
|
display: flex;
|
|
383
307
|
align-items: center;
|
|
@@ -395,37 +319,27 @@
|
|
|
395
319
|
cursor: pointer;
|
|
396
320
|
transition: background-color 0.12s ease;
|
|
397
321
|
}
|
|
398
|
-
|
|
399
322
|
.mocanvas-picker:hover {
|
|
400
323
|
background: var(--mocanvas-ui-accent-soft);
|
|
401
324
|
}
|
|
402
|
-
|
|
403
325
|
.mocanvas-picker:active {
|
|
404
326
|
background: var(--mocanvas-ui-active);
|
|
405
327
|
}
|
|
406
|
-
|
|
407
328
|
.mocanvas-picker:focus {
|
|
408
329
|
outline: none;
|
|
409
330
|
}
|
|
410
|
-
|
|
411
331
|
.mocanvas-picker:focus-visible {
|
|
412
332
|
outline: 2px solid var(--mocanvas-ui-accent);
|
|
413
333
|
outline-offset: 2px;
|
|
414
334
|
}
|
|
415
|
-
|
|
416
335
|
.mocanvas-picker > span {
|
|
417
336
|
display: inline-flex;
|
|
418
337
|
align-items: center;
|
|
419
338
|
gap: 8px;
|
|
420
339
|
}
|
|
421
|
-
|
|
422
340
|
.mocanvas-picker .mocanvas-icon:last-child {
|
|
423
341
|
color: var(--mocanvas-ui-muted);
|
|
424
342
|
}
|
|
425
|
-
|
|
426
|
-
/* --- swatches ----------------------------------------------------------- */
|
|
427
|
-
|
|
428
|
-
/* The button is a full 40×40 target; the disc inside it is the visual mark. */
|
|
429
343
|
.mocanvas-swatch {
|
|
430
344
|
display: inline-flex;
|
|
431
345
|
align-items: center;
|
|
@@ -440,7 +354,6 @@
|
|
|
440
354
|
cursor: pointer;
|
|
441
355
|
transition: background-color 0.12s ease, transform 0.08s ease;
|
|
442
356
|
}
|
|
443
|
-
|
|
444
357
|
.mocanvas-swatch > span {
|
|
445
358
|
display: block;
|
|
446
359
|
width: 22px;
|
|
@@ -450,28 +363,24 @@
|
|
|
450
363
|
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
|
|
451
364
|
transition: box-shadow 0.12s ease;
|
|
452
365
|
}
|
|
453
|
-
|
|
454
366
|
.mocanvas-swatch:hover {
|
|
455
367
|
background: var(--mocanvas-ui-hover);
|
|
456
368
|
}
|
|
457
|
-
|
|
458
369
|
.mocanvas-swatch:active {
|
|
459
370
|
transform: scale(0.92);
|
|
460
371
|
background: var(--mocanvas-ui-active);
|
|
461
372
|
}
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
373
|
+
.mocanvas-swatch[aria-checked=true] > span {
|
|
374
|
+
box-shadow:
|
|
375
|
+
0 0 0 2px var(--mocanvas-ui-panel),
|
|
376
|
+
0 0 0 4px var(--mocanvas-ui-accent),
|
|
377
|
+
inset 0 0 0 1px rgba(0, 0, 0, 0.18);
|
|
465
378
|
}
|
|
466
|
-
|
|
467
379
|
.mocanvas-swatches {
|
|
468
380
|
display: grid;
|
|
469
381
|
grid-template-columns: repeat(6, minmax(var(--mocanvas-ui-btn), 1fr));
|
|
470
382
|
gap: var(--mocanvas-ui-gap);
|
|
471
383
|
}
|
|
472
|
-
|
|
473
|
-
/* --- slider ------------------------------------------------------------- */
|
|
474
|
-
|
|
475
384
|
.mocanvas-slider {
|
|
476
385
|
width: 100%;
|
|
477
386
|
height: 24px;
|
|
@@ -479,14 +388,6 @@
|
|
|
479
388
|
accent-color: var(--mocanvas-ui-accent);
|
|
480
389
|
cursor: pointer;
|
|
481
390
|
}
|
|
482
|
-
|
|
483
|
-
/* --- popovers ----------------------------------------------------------- */
|
|
484
|
-
|
|
485
|
-
/*
|
|
486
|
-
* Fixed, not absolute: a popover anchored inside `.mocanvas-stylepanel` would
|
|
487
|
-
* otherwise be clipped by that panel's own scroll container. Placement is
|
|
488
|
-
* computed against the viewport in `overlays.tsx`.
|
|
489
|
-
*/
|
|
490
391
|
.mocanvas-popover {
|
|
491
392
|
position: fixed;
|
|
492
393
|
z-index: 30;
|
|
@@ -502,13 +403,6 @@
|
|
|
502
403
|
font-family: var(--mocanvas-ui-font);
|
|
503
404
|
pointer-events: auto;
|
|
504
405
|
}
|
|
505
|
-
|
|
506
|
-
/* --- tooltip ------------------------------------------------------------ */
|
|
507
|
-
|
|
508
|
-
/*
|
|
509
|
-
* One shared, viewport-clamped tooltip. A CSS-only `::after` version cannot
|
|
510
|
-
* avoid the viewport edge, and is clipped outright inside a scrolling panel.
|
|
511
|
-
*/
|
|
512
406
|
.mocanvas-tooltip {
|
|
513
407
|
position: fixed;
|
|
514
408
|
z-index: 40;
|
|
@@ -528,12 +422,10 @@
|
|
|
528
422
|
white-space: nowrap;
|
|
529
423
|
pointer-events: none;
|
|
530
424
|
}
|
|
531
|
-
|
|
532
425
|
.mocanvas-tooltip kbd {
|
|
533
426
|
color: var(--mocanvas-ui-tip-muted);
|
|
534
427
|
font: inherit;
|
|
535
428
|
}
|
|
536
|
-
|
|
537
429
|
@media (prefers-reduced-motion: reduce) {
|
|
538
430
|
.mocanvas-btn,
|
|
539
431
|
.mocanvas-swatch,
|
|
@@ -542,24 +434,20 @@
|
|
|
542
434
|
transition: none;
|
|
543
435
|
}
|
|
544
436
|
}
|
|
545
|
-
|
|
437
|
+
[data-reduce-motion=true] .mocanvas-btn,
|
|
438
|
+
[data-reduce-motion=true] .mocanvas-swatch,
|
|
439
|
+
[data-reduce-motion=true] .mocanvas-swatch > span,
|
|
440
|
+
[data-reduce-motion=true] .mocanvas-picker,
|
|
441
|
+
[data-reduce-motion=true] .mocanvas-menu-item,
|
|
442
|
+
[data-reduce-motion=true] .mocanvas-layer {
|
|
443
|
+
transition: none !important;
|
|
444
|
+
animation: none !important;
|
|
445
|
+
}
|
|
546
446
|
.mocanvas-more {
|
|
547
447
|
position: relative;
|
|
548
448
|
display: inline-flex;
|
|
549
449
|
flex: 0 0 auto;
|
|
550
450
|
}
|
|
551
|
-
|
|
552
|
-
/* ==========================================================================
|
|
553
|
-
* The tldraw-shaped UI layer
|
|
554
|
-
* --------------------------------------------------------------------------
|
|
555
|
-
* Everything below styles the components in `ui-*.tsx`, `menu-items.tsx` and
|
|
556
|
-
* `panel-*.tsx`. They use the same custom properties as the panels above, so
|
|
557
|
-
* a host that has restyled the editor by setting `--mocanvas-ui-*` on the
|
|
558
|
-
* container gets these for free.
|
|
559
|
-
* ========================================================================== */
|
|
560
|
-
|
|
561
|
-
/* --- screen-reader-only text -------------------------------------------- */
|
|
562
|
-
|
|
563
451
|
.sr-only {
|
|
564
452
|
position: absolute;
|
|
565
453
|
width: 1px;
|
|
@@ -571,9 +459,6 @@
|
|
|
571
459
|
white-space: nowrap;
|
|
572
460
|
border: 0;
|
|
573
461
|
}
|
|
574
|
-
|
|
575
|
-
/* --- menus --------------------------------------------------------------- */
|
|
576
|
-
|
|
577
462
|
.mocanvas-menu {
|
|
578
463
|
position: fixed;
|
|
579
464
|
z-index: 400;
|
|
@@ -589,19 +474,16 @@
|
|
|
589
474
|
font-family: var(--mocanvas-ui-font);
|
|
590
475
|
font-size: 13px;
|
|
591
476
|
}
|
|
592
|
-
|
|
593
477
|
.mocanvas-menu--icons .mocanvas-menu-icon-group {
|
|
594
478
|
display: grid;
|
|
595
479
|
grid-template-columns: repeat(3, var(--mocanvas-ui-btn));
|
|
596
480
|
gap: var(--mocanvas-ui-gap);
|
|
597
481
|
}
|
|
598
|
-
|
|
599
482
|
.mocanvas-menu-group + .mocanvas-menu-group {
|
|
600
483
|
margin-top: var(--mocanvas-ui-pad);
|
|
601
484
|
padding-top: var(--mocanvas-ui-pad);
|
|
602
485
|
border-top: 1px solid var(--mocanvas-ui-panel-border);
|
|
603
486
|
}
|
|
604
|
-
|
|
605
487
|
.mocanvas-menu-item {
|
|
606
488
|
display: flex;
|
|
607
489
|
align-items: center;
|
|
@@ -617,42 +499,32 @@
|
|
|
617
499
|
text-align: start;
|
|
618
500
|
cursor: pointer;
|
|
619
501
|
}
|
|
620
|
-
|
|
621
502
|
.mocanvas-menu-item:hover:not(:disabled) {
|
|
622
503
|
background: var(--mocanvas-ui-hover);
|
|
623
504
|
}
|
|
624
|
-
|
|
625
505
|
.mocanvas-menu-item:focus-visible {
|
|
626
506
|
outline: 2px solid var(--mocanvas-ui-accent);
|
|
627
507
|
outline-offset: -2px;
|
|
628
508
|
}
|
|
629
|
-
|
|
630
509
|
.mocanvas-menu-item:disabled {
|
|
631
510
|
opacity: 0.4;
|
|
632
511
|
cursor: default;
|
|
633
512
|
}
|
|
634
|
-
|
|
635
513
|
.mocanvas-menu-item-label {
|
|
636
514
|
flex: 1 1 auto;
|
|
637
515
|
}
|
|
638
|
-
|
|
639
516
|
.mocanvas-menu-item-note,
|
|
640
517
|
.mocanvas-shortcut-label {
|
|
641
518
|
color: var(--mocanvas-ui-muted);
|
|
642
519
|
}
|
|
643
|
-
|
|
644
520
|
.mocanvas-menu-item--sub::after {
|
|
645
521
|
content: "";
|
|
646
522
|
}
|
|
647
|
-
|
|
648
|
-
/* --- keyboard shortcuts -------------------------------------------------- */
|
|
649
|
-
|
|
650
523
|
.mocanvas-kbd {
|
|
651
524
|
display: inline-flex;
|
|
652
525
|
gap: 2px;
|
|
653
526
|
color: var(--mocanvas-ui-muted);
|
|
654
527
|
}
|
|
655
|
-
|
|
656
528
|
.mocanvas-kbd kbd {
|
|
657
529
|
min-width: 16px;
|
|
658
530
|
padding: 1px 4px;
|
|
@@ -662,7 +534,6 @@
|
|
|
662
534
|
font-size: 11px;
|
|
663
535
|
text-align: center;
|
|
664
536
|
}
|
|
665
|
-
|
|
666
537
|
.mocanvas-shortcut-row {
|
|
667
538
|
display: flex;
|
|
668
539
|
align-items: center;
|
|
@@ -670,13 +541,11 @@
|
|
|
670
541
|
gap: 16px;
|
|
671
542
|
min-height: 26px;
|
|
672
543
|
}
|
|
673
|
-
|
|
674
544
|
.mocanvas-shortcuts {
|
|
675
545
|
display: grid;
|
|
676
546
|
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
|
|
677
547
|
gap: 16px;
|
|
678
548
|
}
|
|
679
|
-
|
|
680
549
|
.mocanvas-shortcut-section h3 {
|
|
681
550
|
margin: 0 0 6px;
|
|
682
551
|
font-size: 12px;
|
|
@@ -684,9 +553,6 @@
|
|
|
684
553
|
letter-spacing: 0.4px;
|
|
685
554
|
color: var(--mocanvas-ui-muted);
|
|
686
555
|
}
|
|
687
|
-
|
|
688
|
-
/* --- dialogs ------------------------------------------------------------- */
|
|
689
|
-
|
|
690
556
|
.mocanvas-dialog-backdrop {
|
|
691
557
|
position: absolute;
|
|
692
558
|
inset: 0;
|
|
@@ -695,7 +561,6 @@
|
|
|
695
561
|
place-items: center;
|
|
696
562
|
background: rgba(15, 18, 25, 0.35);
|
|
697
563
|
}
|
|
698
|
-
|
|
699
564
|
.mocanvas-dialog {
|
|
700
565
|
position: relative;
|
|
701
566
|
max-width: min(560px, calc(100% - 32px));
|
|
@@ -706,7 +571,6 @@
|
|
|
706
571
|
align-items: stretch;
|
|
707
572
|
padding: 0;
|
|
708
573
|
}
|
|
709
|
-
|
|
710
574
|
.mocanvas-dialog-header {
|
|
711
575
|
display: flex;
|
|
712
576
|
align-items: center;
|
|
@@ -714,18 +578,15 @@
|
|
|
714
578
|
gap: 8px;
|
|
715
579
|
padding: 12px 12px 8px;
|
|
716
580
|
}
|
|
717
|
-
|
|
718
581
|
.mocanvas-dialog-title {
|
|
719
582
|
margin: 0;
|
|
720
583
|
font-size: 15px;
|
|
721
584
|
font-weight: 600;
|
|
722
585
|
}
|
|
723
|
-
|
|
724
586
|
.mocanvas-dialog-body {
|
|
725
587
|
overflow-y: auto;
|
|
726
588
|
padding: 0 12px 12px;
|
|
727
589
|
}
|
|
728
|
-
|
|
729
590
|
.mocanvas-dialog-footer {
|
|
730
591
|
display: flex;
|
|
731
592
|
align-items: center;
|
|
@@ -733,7 +594,6 @@
|
|
|
733
594
|
gap: 8px;
|
|
734
595
|
padding: 8px 12px 12px;
|
|
735
596
|
}
|
|
736
|
-
|
|
737
597
|
.mocanvas-dialog-checkbox {
|
|
738
598
|
margin-inline-end: auto;
|
|
739
599
|
display: inline-flex;
|
|
@@ -741,9 +601,6 @@
|
|
|
741
601
|
gap: 6px;
|
|
742
602
|
color: var(--mocanvas-ui-muted);
|
|
743
603
|
}
|
|
744
|
-
|
|
745
|
-
/* --- toasts -------------------------------------------------------------- */
|
|
746
|
-
|
|
747
604
|
.mocanvas-toasts {
|
|
748
605
|
position: absolute;
|
|
749
606
|
right: var(--mocanvas-ui-inset);
|
|
@@ -754,26 +611,20 @@
|
|
|
754
611
|
gap: 8px;
|
|
755
612
|
max-width: min(360px, calc(100% - 2 * var(--mocanvas-ui-inset)));
|
|
756
613
|
}
|
|
757
|
-
|
|
758
614
|
.mocanvas-toast {
|
|
759
615
|
position: relative;
|
|
760
616
|
gap: 8px;
|
|
761
617
|
padding: 10px;
|
|
762
618
|
}
|
|
763
|
-
|
|
764
619
|
.mocanvas-toast-body {
|
|
765
620
|
display: flex;
|
|
766
621
|
flex-direction: column;
|
|
767
622
|
gap: 2px;
|
|
768
623
|
flex: 1 1 auto;
|
|
769
624
|
}
|
|
770
|
-
|
|
771
625
|
.mocanvas-toast-desc {
|
|
772
626
|
color: var(--mocanvas-ui-muted);
|
|
773
627
|
}
|
|
774
|
-
|
|
775
|
-
/* --- inputs and sliders --------------------------------------------------- */
|
|
776
|
-
|
|
777
628
|
.mocanvas-input {
|
|
778
629
|
display: flex;
|
|
779
630
|
align-items: center;
|
|
@@ -782,7 +633,6 @@
|
|
|
782
633
|
background: var(--mocanvas-ui-control);
|
|
783
634
|
border-radius: var(--mocanvas-ui-radius-sm);
|
|
784
635
|
}
|
|
785
|
-
|
|
786
636
|
.mocanvas-input input,
|
|
787
637
|
.mocanvas-textarea {
|
|
788
638
|
flex: 1 1 auto;
|
|
@@ -793,20 +643,15 @@
|
|
|
793
643
|
color: inherit;
|
|
794
644
|
font: inherit;
|
|
795
645
|
}
|
|
796
|
-
|
|
797
646
|
.mocanvas-input input:focus-visible,
|
|
798
647
|
.mocanvas-textarea:focus-visible {
|
|
799
648
|
outline: 2px solid var(--mocanvas-ui-accent);
|
|
800
649
|
outline-offset: 1px;
|
|
801
650
|
}
|
|
802
|
-
|
|
803
|
-
/* --- panels --------------------------------------------------------------- */
|
|
804
|
-
|
|
805
651
|
.mocanvas-menu-panel {
|
|
806
652
|
left: var(--mocanvas-ui-inset);
|
|
807
653
|
top: var(--mocanvas-ui-inset);
|
|
808
654
|
}
|
|
809
|
-
|
|
810
655
|
.mocanvas-navigation-panel {
|
|
811
656
|
left: var(--mocanvas-ui-inset);
|
|
812
657
|
bottom: var(--mocanvas-ui-inset);
|
|
@@ -814,18 +659,15 @@
|
|
|
814
659
|
align-items: stretch;
|
|
815
660
|
min-width: 140px;
|
|
816
661
|
}
|
|
817
|
-
|
|
818
662
|
.mocanvas-navigation-row {
|
|
819
663
|
display: flex;
|
|
820
664
|
align-items: center;
|
|
821
665
|
gap: var(--mocanvas-ui-gap);
|
|
822
666
|
}
|
|
823
|
-
|
|
824
667
|
.mocanvas-share-panel {
|
|
825
668
|
right: var(--mocanvas-ui-inset);
|
|
826
669
|
top: var(--mocanvas-ui-inset);
|
|
827
670
|
}
|
|
828
|
-
|
|
829
671
|
.mocanvas-quick-actions,
|
|
830
672
|
.mocanvas-helper-buttons {
|
|
831
673
|
position: absolute;
|
|
@@ -836,14 +678,12 @@
|
|
|
836
678
|
gap: var(--mocanvas-ui-gap);
|
|
837
679
|
z-index: 10;
|
|
838
680
|
}
|
|
839
|
-
|
|
840
681
|
.mocanvas-contextual-toolbar .mocanvas-toolbar {
|
|
841
682
|
position: relative;
|
|
842
683
|
inset: auto;
|
|
843
684
|
margin: 0;
|
|
844
685
|
max-width: none;
|
|
845
686
|
}
|
|
846
|
-
|
|
847
687
|
.mocanvas-following-indicator {
|
|
848
688
|
position: absolute;
|
|
849
689
|
inset: 0;
|
|
@@ -852,50 +692,49 @@
|
|
|
852
692
|
border: 3px solid var(--mocanvas-selection);
|
|
853
693
|
border-radius: 4px;
|
|
854
694
|
}
|
|
855
|
-
|
|
856
695
|
.mocanvas-following-indicator > * {
|
|
857
696
|
pointer-events: auto;
|
|
858
697
|
}
|
|
859
|
-
|
|
860
698
|
.mocanvas-offline {
|
|
861
699
|
left: 50%;
|
|
862
700
|
top: var(--mocanvas-ui-inset);
|
|
863
701
|
transform: translateX(-50%);
|
|
864
702
|
padding: 4px 10px;
|
|
865
703
|
}
|
|
866
|
-
|
|
867
|
-
/* --- pickers -------------------------------------------------------------- */
|
|
868
|
-
|
|
869
704
|
.mocanvas-style-row + .mocanvas-style-row {
|
|
870
705
|
margin-top: var(--mocanvas-ui-pad-lg);
|
|
871
706
|
}
|
|
872
|
-
|
|
873
707
|
.mocanvas-popover-grid {
|
|
874
708
|
display: grid;
|
|
875
709
|
grid-template-columns: repeat(var(--mocanvas-popover-cols, 5), var(--mocanvas-ui-btn));
|
|
876
710
|
gap: var(--mocanvas-ui-gap);
|
|
877
711
|
}
|
|
878
|
-
|
|
879
712
|
.mocanvas-select-value {
|
|
880
713
|
overflow: hidden;
|
|
881
714
|
text-overflow: ellipsis;
|
|
882
715
|
white-space: nowrap;
|
|
883
716
|
}
|
|
884
|
-
|
|
885
|
-
/* --- people --------------------------------------------------------------- */
|
|
886
|
-
|
|
887
717
|
.mocanvas-people-list,
|
|
888
718
|
.mocanvas-page-list {
|
|
889
719
|
display: flex;
|
|
890
720
|
flex-direction: column;
|
|
891
721
|
}
|
|
892
|
-
|
|
893
722
|
.mocanvas-page-row {
|
|
894
723
|
display: flex;
|
|
895
724
|
align-items: center;
|
|
896
725
|
gap: 4px;
|
|
897
726
|
}
|
|
898
|
-
|
|
727
|
+
.mocanvas-page-row-name,
|
|
728
|
+
.mocanvas-page-rename {
|
|
729
|
+
flex: 1 1 auto;
|
|
730
|
+
min-width: 0;
|
|
731
|
+
}
|
|
732
|
+
.mocanvas-page-row-actions {
|
|
733
|
+
flex: 0 0 auto;
|
|
734
|
+
width: var(--mocanvas-ui-btn);
|
|
735
|
+
justify-content: center;
|
|
736
|
+
padding: 0;
|
|
737
|
+
}
|
|
899
738
|
.mocanvas-presence-editor {
|
|
900
739
|
display: flex;
|
|
901
740
|
align-items: center;
|
|
@@ -903,15 +742,11 @@
|
|
|
903
742
|
padding-bottom: var(--mocanvas-ui-pad);
|
|
904
743
|
border-bottom: 1px solid var(--mocanvas-ui-panel-border);
|
|
905
744
|
}
|
|
906
|
-
|
|
907
745
|
.mocanvas-face-pile-more {
|
|
908
746
|
align-self: center;
|
|
909
747
|
margin-left: 4px;
|
|
910
748
|
color: var(--mocanvas-ui-muted);
|
|
911
749
|
}
|
|
912
|
-
|
|
913
|
-
/* --- debug ---------------------------------------------------------------- */
|
|
914
|
-
|
|
915
750
|
.mocanvas-debug-flags {
|
|
916
751
|
display: flex;
|
|
917
752
|
flex-direction: column;
|
|
@@ -919,17 +754,14 @@
|
|
|
919
754
|
font-family: var(--mocanvas-ui-mono);
|
|
920
755
|
font-size: 11px;
|
|
921
756
|
}
|
|
922
|
-
|
|
923
757
|
.mocanvas-debug-flag {
|
|
924
758
|
display: flex;
|
|
925
759
|
align-items: center;
|
|
926
760
|
gap: 6px;
|
|
927
761
|
}
|
|
928
|
-
|
|
929
|
-
/* --- images --------------------------------------------------------------- */
|
|
930
|
-
|
|
931
762
|
.mocanvas-image,
|
|
932
763
|
.mocanvas-image > svg {
|
|
933
764
|
max-width: 100%;
|
|
934
765
|
height: auto;
|
|
935
766
|
}
|
|
767
|
+
/*# sourceMappingURL=mocanvas.css.map */
|