vintage-frames 0.4.0 → 0.5.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/custom-elements.json +134 -30
- package/dist/components/vf-container.d.ts +37 -3
- package/dist/components/vf-container.js +32 -10
- package/dist/components/vf-desktop.d.ts +52 -19
- package/dist/components/vf-desktop.js +74 -104
- package/dist/components/vf-dialog.d.ts +19 -15
- package/dist/components/vf-dialog.js +45 -53
- package/dist/components/vf-progress-bar.js +3 -3
- package/dist/components/vf-slider.js +11 -11
- package/dist/components/vf-window.js +47 -47
- package/dist/index.d.ts +14 -0
- package/dist/index.js +60 -58
- package/dist/pattern-fill.d.ts +91 -0
- package/dist/pattern-fill.js +74 -0
- package/dist/patterns.d.ts +80 -0
- package/dist/patterns.js +477 -0
- package/dist/scroll-rail.js +37 -37
- package/dist/styles/recipes/pattern.d.ts +2 -12
- package/dist/styles/recipes/pattern.js +11 -15
- package/dist/styles/recipes/scroll-rail.d.ts +3 -12
- package/dist/styles/recipes/scroll-rail.js +7 -15
- package/dist/styles/recipes/surface.d.ts +18 -7
- package/dist/styles/recipes/surface.js +15 -0
- package/dist/tile-grid.d.ts +4 -2
- package/dist/tile-grid.js +3 -3
- package/dist/track-width.d.ts +7 -0
- package/dist/track-width.js +6 -3
- package/docs/SPEC.md +11 -9
- package/editor/vscode.html-custom-data.json +14 -4
- package/editor/web-types.json +29 -6
- package/package.json +2 -1
package/dist/patterns.js
ADDED
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
//#region src/patterns.ts
|
|
2
|
+
var e = {
|
|
3
|
+
black: [
|
|
4
|
+
255,
|
|
5
|
+
255,
|
|
6
|
+
255,
|
|
7
|
+
255,
|
|
8
|
+
255,
|
|
9
|
+
255,
|
|
10
|
+
255,
|
|
11
|
+
255
|
|
12
|
+
],
|
|
13
|
+
"gray-50": [
|
|
14
|
+
170,
|
|
15
|
+
85,
|
|
16
|
+
170,
|
|
17
|
+
85,
|
|
18
|
+
170,
|
|
19
|
+
85,
|
|
20
|
+
170,
|
|
21
|
+
85
|
|
22
|
+
],
|
|
23
|
+
white: [
|
|
24
|
+
0,
|
|
25
|
+
0,
|
|
26
|
+
0,
|
|
27
|
+
0,
|
|
28
|
+
0,
|
|
29
|
+
0,
|
|
30
|
+
0,
|
|
31
|
+
0
|
|
32
|
+
],
|
|
33
|
+
"gray-88": [
|
|
34
|
+
119,
|
|
35
|
+
255,
|
|
36
|
+
221,
|
|
37
|
+
255,
|
|
38
|
+
119,
|
|
39
|
+
255,
|
|
40
|
+
221,
|
|
41
|
+
255
|
|
42
|
+
],
|
|
43
|
+
"gray-75": [
|
|
44
|
+
221,
|
|
45
|
+
119,
|
|
46
|
+
221,
|
|
47
|
+
119,
|
|
48
|
+
221,
|
|
49
|
+
119,
|
|
50
|
+
221,
|
|
51
|
+
119
|
|
52
|
+
],
|
|
53
|
+
"gray-75-striped": [
|
|
54
|
+
85,
|
|
55
|
+
255,
|
|
56
|
+
85,
|
|
57
|
+
255,
|
|
58
|
+
85,
|
|
59
|
+
255,
|
|
60
|
+
85,
|
|
61
|
+
255
|
|
62
|
+
],
|
|
63
|
+
"gray-75-diagonal": [
|
|
64
|
+
187,
|
|
65
|
+
119,
|
|
66
|
+
238,
|
|
67
|
+
221,
|
|
68
|
+
187,
|
|
69
|
+
119,
|
|
70
|
+
238,
|
|
71
|
+
221
|
|
72
|
+
],
|
|
73
|
+
dots: [
|
|
74
|
+
170,
|
|
75
|
+
0,
|
|
76
|
+
170,
|
|
77
|
+
0,
|
|
78
|
+
170,
|
|
79
|
+
0,
|
|
80
|
+
170,
|
|
81
|
+
0
|
|
82
|
+
],
|
|
83
|
+
pinpoint: [
|
|
84
|
+
0,
|
|
85
|
+
0,
|
|
86
|
+
128,
|
|
87
|
+
0,
|
|
88
|
+
0,
|
|
89
|
+
0,
|
|
90
|
+
0,
|
|
91
|
+
0
|
|
92
|
+
],
|
|
93
|
+
"dots-sparse": [
|
|
94
|
+
8,
|
|
95
|
+
0,
|
|
96
|
+
128,
|
|
97
|
+
0,
|
|
98
|
+
8,
|
|
99
|
+
0,
|
|
100
|
+
128,
|
|
101
|
+
0
|
|
102
|
+
],
|
|
103
|
+
speckle: [
|
|
104
|
+
64,
|
|
105
|
+
4,
|
|
106
|
+
128,
|
|
107
|
+
16,
|
|
108
|
+
2,
|
|
109
|
+
32,
|
|
110
|
+
1,
|
|
111
|
+
8
|
|
112
|
+
],
|
|
113
|
+
"gray-12": [
|
|
114
|
+
34,
|
|
115
|
+
0,
|
|
116
|
+
136,
|
|
117
|
+
0,
|
|
118
|
+
34,
|
|
119
|
+
0,
|
|
120
|
+
136,
|
|
121
|
+
0
|
|
122
|
+
],
|
|
123
|
+
"gray-25": [
|
|
124
|
+
136,
|
|
125
|
+
34,
|
|
126
|
+
136,
|
|
127
|
+
34,
|
|
128
|
+
136,
|
|
129
|
+
34,
|
|
130
|
+
136,
|
|
131
|
+
34
|
|
132
|
+
],
|
|
133
|
+
"stripes-vertical": [
|
|
134
|
+
170,
|
|
135
|
+
170,
|
|
136
|
+
170,
|
|
137
|
+
170,
|
|
138
|
+
170,
|
|
139
|
+
170,
|
|
140
|
+
170,
|
|
141
|
+
170
|
|
142
|
+
],
|
|
143
|
+
"stripes-horizontal": [
|
|
144
|
+
255,
|
|
145
|
+
0,
|
|
146
|
+
255,
|
|
147
|
+
0,
|
|
148
|
+
255,
|
|
149
|
+
0,
|
|
150
|
+
255,
|
|
151
|
+
0
|
|
152
|
+
],
|
|
153
|
+
diagonal: [
|
|
154
|
+
68,
|
|
155
|
+
136,
|
|
156
|
+
17,
|
|
157
|
+
34,
|
|
158
|
+
68,
|
|
159
|
+
136,
|
|
160
|
+
17,
|
|
161
|
+
34
|
|
162
|
+
],
|
|
163
|
+
grid: [
|
|
164
|
+
136,
|
|
165
|
+
136,
|
|
166
|
+
255,
|
|
167
|
+
136,
|
|
168
|
+
136,
|
|
169
|
+
136,
|
|
170
|
+
255,
|
|
171
|
+
136
|
|
172
|
+
],
|
|
173
|
+
weave: [
|
|
174
|
+
12,
|
|
175
|
+
141,
|
|
176
|
+
177,
|
|
177
|
+
48,
|
|
178
|
+
3,
|
|
179
|
+
27,
|
|
180
|
+
216,
|
|
181
|
+
192
|
|
182
|
+
],
|
|
183
|
+
"lines-vertical": [
|
|
184
|
+
136,
|
|
185
|
+
136,
|
|
186
|
+
136,
|
|
187
|
+
136,
|
|
188
|
+
136,
|
|
189
|
+
136,
|
|
190
|
+
136,
|
|
191
|
+
136
|
|
192
|
+
],
|
|
193
|
+
"lines-horizontal": [
|
|
194
|
+
0,
|
|
195
|
+
0,
|
|
196
|
+
255,
|
|
197
|
+
0,
|
|
198
|
+
0,
|
|
199
|
+
0,
|
|
200
|
+
255,
|
|
201
|
+
0
|
|
202
|
+
],
|
|
203
|
+
"diagonal-wide": [
|
|
204
|
+
64,
|
|
205
|
+
128,
|
|
206
|
+
1,
|
|
207
|
+
2,
|
|
208
|
+
4,
|
|
209
|
+
8,
|
|
210
|
+
16,
|
|
211
|
+
32
|
|
212
|
+
],
|
|
213
|
+
"grid-wide": [
|
|
214
|
+
128,
|
|
215
|
+
128,
|
|
216
|
+
255,
|
|
217
|
+
128,
|
|
218
|
+
128,
|
|
219
|
+
128,
|
|
220
|
+
128,
|
|
221
|
+
128
|
|
222
|
+
],
|
|
223
|
+
zigzag: [
|
|
224
|
+
8,
|
|
225
|
+
0,
|
|
226
|
+
128,
|
|
227
|
+
64,
|
|
228
|
+
32,
|
|
229
|
+
0,
|
|
230
|
+
2,
|
|
231
|
+
4
|
|
232
|
+
],
|
|
233
|
+
arrows: [
|
|
234
|
+
5,
|
|
235
|
+
2,
|
|
236
|
+
32,
|
|
237
|
+
80,
|
|
238
|
+
136,
|
|
239
|
+
136,
|
|
240
|
+
136,
|
|
241
|
+
136
|
|
242
|
+
],
|
|
243
|
+
chevrons: [
|
|
244
|
+
170,
|
|
245
|
+
0,
|
|
246
|
+
136,
|
|
247
|
+
20,
|
|
248
|
+
34,
|
|
249
|
+
65,
|
|
250
|
+
136,
|
|
251
|
+
0
|
|
252
|
+
],
|
|
253
|
+
shingles: [
|
|
254
|
+
4,
|
|
255
|
+
8,
|
|
256
|
+
16,
|
|
257
|
+
32,
|
|
258
|
+
84,
|
|
259
|
+
170,
|
|
260
|
+
255,
|
|
261
|
+
2
|
|
262
|
+
],
|
|
263
|
+
"dotted-grid": [
|
|
264
|
+
128,
|
|
265
|
+
0,
|
|
266
|
+
170,
|
|
267
|
+
0,
|
|
268
|
+
128,
|
|
269
|
+
0,
|
|
270
|
+
136,
|
|
271
|
+
0
|
|
272
|
+
],
|
|
273
|
+
birds: [
|
|
274
|
+
0,
|
|
275
|
+
0,
|
|
276
|
+
64,
|
|
277
|
+
160,
|
|
278
|
+
0,
|
|
279
|
+
0,
|
|
280
|
+
4,
|
|
281
|
+
10
|
|
282
|
+
],
|
|
283
|
+
waves: [
|
|
284
|
+
1,
|
|
285
|
+
1,
|
|
286
|
+
3,
|
|
287
|
+
132,
|
|
288
|
+
72,
|
|
289
|
+
48,
|
|
290
|
+
12,
|
|
291
|
+
2
|
|
292
|
+
],
|
|
293
|
+
bricks: [
|
|
294
|
+
8,
|
|
295
|
+
8,
|
|
296
|
+
255,
|
|
297
|
+
128,
|
|
298
|
+
128,
|
|
299
|
+
128,
|
|
300
|
+
255,
|
|
301
|
+
8
|
|
302
|
+
],
|
|
303
|
+
scales: [
|
|
304
|
+
2,
|
|
305
|
+
4,
|
|
306
|
+
8,
|
|
307
|
+
28,
|
|
308
|
+
34,
|
|
309
|
+
193,
|
|
310
|
+
128,
|
|
311
|
+
1
|
|
312
|
+
],
|
|
313
|
+
"basket-weave": [
|
|
314
|
+
176,
|
|
315
|
+
176,
|
|
316
|
+
191,
|
|
317
|
+
0,
|
|
318
|
+
191,
|
|
319
|
+
191,
|
|
320
|
+
176,
|
|
321
|
+
176
|
|
322
|
+
],
|
|
323
|
+
lattice: [
|
|
324
|
+
1,
|
|
325
|
+
1,
|
|
326
|
+
130,
|
|
327
|
+
68,
|
|
328
|
+
57,
|
|
329
|
+
68,
|
|
330
|
+
130,
|
|
331
|
+
1
|
|
332
|
+
],
|
|
333
|
+
twigs: [
|
|
334
|
+
16,
|
|
335
|
+
16,
|
|
336
|
+
85,
|
|
337
|
+
130,
|
|
338
|
+
1,
|
|
339
|
+
1,
|
|
340
|
+
85,
|
|
341
|
+
40
|
|
342
|
+
],
|
|
343
|
+
hexagons: [
|
|
344
|
+
20,
|
|
345
|
+
227,
|
|
346
|
+
128,
|
|
347
|
+
128,
|
|
348
|
+
65,
|
|
349
|
+
62,
|
|
350
|
+
8,
|
|
351
|
+
8
|
|
352
|
+
],
|
|
353
|
+
pyramids: [
|
|
354
|
+
34,
|
|
355
|
+
113,
|
|
356
|
+
248,
|
|
357
|
+
116,
|
|
358
|
+
34,
|
|
359
|
+
71,
|
|
360
|
+
143,
|
|
361
|
+
23
|
|
362
|
+
],
|
|
363
|
+
mesh: [
|
|
364
|
+
20,
|
|
365
|
+
8,
|
|
366
|
+
0,
|
|
367
|
+
8,
|
|
368
|
+
20,
|
|
369
|
+
42,
|
|
370
|
+
85,
|
|
371
|
+
42
|
|
372
|
+
],
|
|
373
|
+
stones: [
|
|
374
|
+
248,
|
|
375
|
+
248,
|
|
376
|
+
119,
|
|
377
|
+
137,
|
|
378
|
+
143,
|
|
379
|
+
143,
|
|
380
|
+
119,
|
|
381
|
+
152
|
|
382
|
+
]
|
|
383
|
+
}, t = Object.keys(e), n = 8;
|
|
384
|
+
function r(t) {
|
|
385
|
+
if (t == null) return null;
|
|
386
|
+
let n = t.trim();
|
|
387
|
+
if (n === "") return null;
|
|
388
|
+
if (Object.prototype.hasOwnProperty.call(e, n)) return e[n];
|
|
389
|
+
let r = n.replace(/\s+/g, "");
|
|
390
|
+
if (!/^[0-9a-f]{16}$/i.test(r)) return null;
|
|
391
|
+
let i = [];
|
|
392
|
+
for (let e = 0; e < 8; e++) i.push(parseInt(r.slice(2 * e, 2 * e + 2), 16));
|
|
393
|
+
return i;
|
|
394
|
+
}
|
|
395
|
+
function i(e) {
|
|
396
|
+
return e.map((e) => e.toString(16).padStart(2, "0").toUpperCase()).join("");
|
|
397
|
+
}
|
|
398
|
+
var a = (e, t, n) => !!((e[n % 8] ?? 0) & 128 >> t % 8);
|
|
399
|
+
function o(e) {
|
|
400
|
+
let t = 8, n = 8;
|
|
401
|
+
for (let n of [
|
|
402
|
+
1,
|
|
403
|
+
2,
|
|
404
|
+
4
|
|
405
|
+
]) {
|
|
406
|
+
let r = !0;
|
|
407
|
+
for (let t = 0; t < 8 && r; t++) for (let i = 0; i < 8 - n; i++) if (a(e, i, t) !== a(e, i + n, t)) {
|
|
408
|
+
r = !1;
|
|
409
|
+
break;
|
|
410
|
+
}
|
|
411
|
+
if (r) {
|
|
412
|
+
t = n;
|
|
413
|
+
break;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
for (let t of [
|
|
417
|
+
1,
|
|
418
|
+
2,
|
|
419
|
+
4
|
|
420
|
+
]) {
|
|
421
|
+
let r = !0;
|
|
422
|
+
for (let n = 0; n < 8 - t; n++) if (e[n] !== e[n + t]) {
|
|
423
|
+
r = !1;
|
|
424
|
+
break;
|
|
425
|
+
}
|
|
426
|
+
if (r) {
|
|
427
|
+
n = t;
|
|
428
|
+
break;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
return {
|
|
432
|
+
x: t,
|
|
433
|
+
y: n
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
function s(e, t, n, r, i) {
|
|
437
|
+
let o = [];
|
|
438
|
+
i !== void 0 && o.push([
|
|
439
|
+
0,
|
|
440
|
+
0,
|
|
441
|
+
t,
|
|
442
|
+
n,
|
|
443
|
+
i
|
|
444
|
+
]);
|
|
445
|
+
for (let i = 0; i < n; i++) {
|
|
446
|
+
let n = 0;
|
|
447
|
+
for (; n < t;) {
|
|
448
|
+
if (!a(e, n, i)) {
|
|
449
|
+
n++;
|
|
450
|
+
continue;
|
|
451
|
+
}
|
|
452
|
+
let s = 1;
|
|
453
|
+
for (; n + s < t && a(e, n + s, i);) s++;
|
|
454
|
+
o.push([
|
|
455
|
+
n,
|
|
456
|
+
i,
|
|
457
|
+
s,
|
|
458
|
+
1,
|
|
459
|
+
r
|
|
460
|
+
]), n += s;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
return o;
|
|
464
|
+
}
|
|
465
|
+
function c(e, t = "#000000", n) {
|
|
466
|
+
let { x: r, y: i } = o(e);
|
|
467
|
+
return {
|
|
468
|
+
width: r,
|
|
469
|
+
height: i,
|
|
470
|
+
rects: s(e, r, i, t, n)
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
function l(e, t = "#000000", n) {
|
|
474
|
+
return s(e, 8, 8, t, n);
|
|
475
|
+
}
|
|
476
|
+
//#endregion
|
|
477
|
+
export { e as PATTERNS, t as PATTERN_NAMES, n as PATTERN_SIZE, r as parsePattern, i as patternHex, c as patternMotif, l as patternRects };
|
package/dist/scroll-rail.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { effectiveScale as e, sysLength as t } from "./scale.js";
|
|
2
|
-
import {
|
|
3
|
-
import { TileRasterCache as
|
|
2
|
+
import { TROUGH_MOTIF_X as n, TROUGH_MOTIF_Y as r, TROUGH_RECTS as i } from "./styles/recipes/scroll-rail.js";
|
|
3
|
+
import { TileRasterCache as a } from "./tile-grid.js";
|
|
4
4
|
import "./motion.js";
|
|
5
|
-
import { SCROLL_ARROW_DOWN as
|
|
6
|
-
import { html as
|
|
5
|
+
import { SCROLL_ARROW_DOWN as o, SCROLL_ARROW_DOWN_FILL as s, SCROLL_ARROW_LEFT as c, SCROLL_ARROW_LEFT_FILL as l, SCROLL_ARROW_RIGHT as u, SCROLL_ARROW_RIGHT_FILL as d, SCROLL_ARROW_UP as f, SCROLL_ARROW_UP_FILL as p } from "./glyphs.js";
|
|
6
|
+
import { html as m } from "lit";
|
|
7
7
|
//#region src/scroll-rail.ts
|
|
8
|
-
var
|
|
8
|
+
var h = 16, g = 16, _ = 14, v = 66, y = class {
|
|
9
9
|
constructor(t, n) {
|
|
10
10
|
this.host = t, this.opts = n, this.scroller = null, this.press = null, this.troughCache = {
|
|
11
|
-
vertical: new
|
|
12
|
-
horizontal: new
|
|
11
|
+
vertical: new a(),
|
|
12
|
+
horizontal: new a()
|
|
13
13
|
}, this.onScroll = () => this.sync(), this.onPointerDown = (t) => {
|
|
14
14
|
if (t.button !== 0 || this.press !== null) return;
|
|
15
15
|
let n = t.currentTarget, r = this.opts.getScroll();
|
|
16
16
|
if (!r) return;
|
|
17
|
-
let i =
|
|
17
|
+
let i = b(n), a = i === "vertical" ? "data-overflow-y" : "data-overflow-x";
|
|
18
18
|
if (r.getAttribute(a) === "false" || r.hasAttribute("data-window-inactive") || n.getAttribute("data-degenerate") === "rail") return;
|
|
19
19
|
let o = t.target, s = i === "vertical" ? t.clientY : t.clientX, c = e(this.host) || 1, l = o.closest(".vf-rail-thumb"), u = o.closest(".vf-rail-button--decrement"), d = o.closest(".vf-rail-button--increment");
|
|
20
20
|
if (l) {
|
|
@@ -30,7 +30,7 @@ var p = 16, m = 16, h = 14, g = 66, _ = class {
|
|
|
30
30
|
button: null,
|
|
31
31
|
startCoord: s,
|
|
32
32
|
startScroll: i === "vertical" ? r.scrollTop : r.scrollLeft,
|
|
33
|
-
travelCss: o -
|
|
33
|
+
travelCss: o - g * c,
|
|
34
34
|
lastCoord: s
|
|
35
35
|
};
|
|
36
36
|
} else if (u || d) {
|
|
@@ -98,17 +98,17 @@ var p = 16, m = 16, h = 14, g = 66, _ = class {
|
|
|
98
98
|
let e = this.scroller ?? this.opts.getScroll(), t = this.host.renderRoot;
|
|
99
99
|
if (!(!e || !t)) for (let n of t.querySelectorAll(".vf-rail")) this.syncRail(n, e);
|
|
100
100
|
}
|
|
101
|
-
syncRail(
|
|
102
|
-
let
|
|
103
|
-
if (!
|
|
104
|
-
let
|
|
105
|
-
if (
|
|
106
|
-
let
|
|
107
|
-
|
|
108
|
-
let
|
|
109
|
-
if (
|
|
110
|
-
let e = Math.ceil((
|
|
111
|
-
|
|
101
|
+
syncRail(a, o) {
|
|
102
|
+
let s = b(a), c = a.querySelector(".vf-rail-track"), l = a.querySelector(".vf-rail-thumb");
|
|
103
|
+
if (!c || !l) return;
|
|
104
|
+
let u = e(this.host) || 1, d = c.getBoundingClientRect(), f = (s === "vertical" ? d.height : d.width) / u, p = f < 1 ? "rail" : f < g ? "thumb" : null;
|
|
105
|
+
if (p ? a.setAttribute("data-degenerate", p) : a.removeAttribute("data-degenerate"), p === "rail") return;
|
|
106
|
+
let m = this.scrollRange(o, s), h = s === "vertical" ? o.scrollTop : o.scrollLeft, v = f - g, y = m > 0 && v > 0 ? Math.max(0, Math.min(Math.floor(v), Math.round(h / m * v))) : 0;
|
|
107
|
+
l.style.translate = s === "vertical" ? `0 ${t(y)}` : `${t(y)} 0`;
|
|
108
|
+
let x = a.querySelector(".vf-rail-trough-art");
|
|
109
|
+
if (x) {
|
|
110
|
+
let e = Math.ceil((f + (s === "vertical" ? r : n)) / (s === "vertical" ? r : n)) * (s === "vertical" ? r : n), a = s === "vertical" ? _ : e, o = s === "vertical" ? e : _;
|
|
111
|
+
x.style.width = t(a), x.style.height = t(o), x.style.backgroundImage = this.troughCache[s].for(n, r, i, a, o);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
scrollRange(e, t) {
|
|
@@ -117,13 +117,13 @@ var p = 16, m = 16, h = 14, g = 66, _ = class {
|
|
|
117
117
|
stepBy(t, n) {
|
|
118
118
|
let r = this.opts.getScroll();
|
|
119
119
|
if (!r) return;
|
|
120
|
-
let i = t *
|
|
120
|
+
let i = t * h * (e(this.host) || 1);
|
|
121
121
|
n === "vertical" ? r.scrollTop += i : r.scrollLeft += i;
|
|
122
122
|
}
|
|
123
123
|
pageBy(t, n) {
|
|
124
124
|
let r = this.opts.getScroll();
|
|
125
125
|
if (!r) return;
|
|
126
|
-
let i =
|
|
126
|
+
let i = h * (e(this.host) || 1), a = n === "vertical" ? r.clientHeight : r.clientWidth, o = Math.max(i, a - i);
|
|
127
127
|
n === "vertical" ? r.scrollTop += t * o : r.scrollLeft += t * o;
|
|
128
128
|
}
|
|
129
129
|
pageTowardPointer() {
|
|
@@ -138,13 +138,13 @@ var p = 16, m = 16, h = 14, g = 66, _ = class {
|
|
|
138
138
|
}
|
|
139
139
|
armRepeat(e) {
|
|
140
140
|
this.clearRepeat(), this.holdTimer = window.setTimeout(() => {
|
|
141
|
-
this.repeatTimer = window.setInterval(e,
|
|
141
|
+
this.repeatTimer = window.setInterval(e, v);
|
|
142
142
|
}, 200);
|
|
143
143
|
}
|
|
144
144
|
clearRepeat() {
|
|
145
145
|
this.holdTimer !== void 0 && window.clearTimeout(this.holdTimer), this.repeatTimer !== void 0 && window.clearInterval(this.repeatTimer), this.holdTimer = void 0, this.repeatTimer = void 0;
|
|
146
146
|
}
|
|
147
|
-
},
|
|
147
|
+
}, b = (e) => e.classList.contains("vf-rail--horizontal") ? "horizontal" : "vertical", x = (e, t) => m`<svg
|
|
148
148
|
class="vf-rail-arrow vf-rail-arrow--${t}"
|
|
149
149
|
viewBox="1 1 14 14"
|
|
150
150
|
fill="currentColor"
|
|
@@ -153,19 +153,19 @@ var p = 16, m = 16, h = 14, g = 66, _ = class {
|
|
|
153
153
|
>
|
|
154
154
|
<path d=${e.d}></path>
|
|
155
155
|
</svg>`;
|
|
156
|
-
function
|
|
157
|
-
let [n, r,
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
i,
|
|
161
|
-
a
|
|
162
|
-
] : [
|
|
156
|
+
function S(e, t) {
|
|
157
|
+
let [n, r, i, a] = t === "vertical" ? [
|
|
158
|
+
f,
|
|
159
|
+
p,
|
|
163
160
|
o,
|
|
164
|
-
s
|
|
161
|
+
s
|
|
162
|
+
] : [
|
|
165
163
|
c,
|
|
166
|
-
l
|
|
164
|
+
l,
|
|
165
|
+
u,
|
|
166
|
+
d
|
|
167
167
|
];
|
|
168
|
-
return
|
|
168
|
+
return m`
|
|
169
169
|
<div
|
|
170
170
|
class="vf-rail vf-rail--${t}"
|
|
171
171
|
aria-hidden="true"
|
|
@@ -176,7 +176,7 @@ function b(e, t) {
|
|
|
176
176
|
@lostpointercapture=${e.onPointerUp}
|
|
177
177
|
>
|
|
178
178
|
<div class="vf-rail-button vf-rail-button--decrement">
|
|
179
|
-
${
|
|
179
|
+
${x(n, "rest")}${x(r, "fill")}
|
|
180
180
|
</div>
|
|
181
181
|
<div class="vf-rail-track">
|
|
182
182
|
<div class="vf-rail-trough">
|
|
@@ -185,10 +185,10 @@ function b(e, t) {
|
|
|
185
185
|
<div class="vf-rail-thumb"></div>
|
|
186
186
|
</div>
|
|
187
187
|
<div class="vf-rail-button vf-rail-button--increment">
|
|
188
|
-
${
|
|
188
|
+
${x(i, "rest")}${x(a, "fill")}
|
|
189
189
|
</div>
|
|
190
190
|
</div>
|
|
191
191
|
`;
|
|
192
192
|
}
|
|
193
193
|
//#endregion
|
|
194
|
-
export {
|
|
194
|
+
export { y as ScrollRailController, S as renderScrollRail };
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* The windoid bar's dither: a 2-system-px motif with a single black pixel at
|
|
4
|
-
* its origin, stated once as rect data. Transparent ground, because the layer
|
|
5
|
-
* floats over the bar and the same art doubles as the forced-colors mask,
|
|
6
|
-
* where the ground would be opacity rather than paint. The SVG tile below is
|
|
7
|
-
* the CSS-repeated form (the no-declared-width fallback and the forced-colors
|
|
8
|
-
* mask); `vf-window` renders the exact fill — the whole-surface raster or a
|
|
9
|
-
* consumer token's placed tile grid — from the same data (src/tile-grid.ts).
|
|
10
|
-
*/
|
|
11
|
-
export declare const DOT_MOTIF = 2;
|
|
12
|
-
export declare const DOT_RECTS: readonly TileRect[];
|
|
1
|
+
export declare const DOT_MOTIF: number;
|
|
2
|
+
export declare const DOT_RECTS: readonly import("./tile.js").TileRect[];
|
|
13
3
|
/** The dots' tile size in system px (30) — the consumer token's documented box. */
|
|
14
4
|
export declare const DOT_SPAN: number;
|
|
15
5
|
/**
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { tileImage as e, tileRects as t, tileSpan as n, vfTileMaskSize as r, vfTileSize as i } from "./tile.js";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
1,
|
|
7
|
-
1,
|
|
8
|
-
"#000000"
|
|
9
|
-
]], c = e(2, 2, t(s)), l = n(2), u = a`
|
|
2
|
+
import { PATTERNS as a, patternMotif as o } from "../../patterns.js";
|
|
3
|
+
import { css as s, unsafeCSS as c } from "lit";
|
|
4
|
+
//#region src/styles/recipes/pattern.ts
|
|
5
|
+
var l = o(a.dots), u = l.width, d = l.rects, f = e(u, u, t(d)), p = n(u), m = s`
|
|
10
6
|
.vf-stripes {
|
|
11
7
|
position: absolute;
|
|
12
8
|
inset: calc(var(--vf-scale, 1) * 3px) calc(var(--vf-scale, 1) * 1px);
|
|
@@ -44,15 +40,15 @@ var s = [[
|
|
|
44
40
|
background: var(--vf-black, #000000);
|
|
45
41
|
}
|
|
46
42
|
}
|
|
47
|
-
`,
|
|
43
|
+
`, h = s`
|
|
48
44
|
.vf-dots {
|
|
49
45
|
position: absolute;
|
|
50
46
|
inset: calc(var(--vf-scale, 1) * 2px) 0;
|
|
51
|
-
background-image: var(--vf-dots-pattern, ${
|
|
52
|
-
${i(
|
|
47
|
+
background-image: var(--vf-dots-pattern, ${c(f)});
|
|
48
|
+
${i(u)}
|
|
53
49
|
pointer-events: none;
|
|
54
50
|
/* The consumer-token art channel for the placed tile grid. */
|
|
55
|
-
--_vf-tile-image: var(--vf-dots-pattern, ${
|
|
51
|
+
--_vf-tile-image: var(--vf-dots-pattern, ${c(f)});
|
|
56
52
|
}
|
|
57
53
|
.vf-dots.vf-tile-grid {
|
|
58
54
|
background-image: none;
|
|
@@ -69,8 +65,8 @@ var s = [[
|
|
|
69
65
|
.vf-dots {
|
|
70
66
|
background-image: none;
|
|
71
67
|
background-color: var(--vf-black, #000);
|
|
72
|
-
mask-image: var(--vf-dots-pattern, ${
|
|
73
|
-
${r(
|
|
68
|
+
mask-image: var(--vf-dots-pattern, ${c(f)});
|
|
69
|
+
${r(u)}
|
|
74
70
|
}
|
|
75
71
|
.vf-dots .vf-tile,
|
|
76
72
|
.vf-dots .vf-tile-raster {
|
|
@@ -79,4 +75,4 @@ var s = [[
|
|
|
79
75
|
}
|
|
80
76
|
`;
|
|
81
77
|
//#endregion
|
|
82
|
-
export {
|
|
78
|
+
export { u as DOT_MOTIF, d as DOT_RECTS, p as DOT_SPAN, h as vfDots, m as vfStripes };
|
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* (2,1), traced from the UI kit's "Scroll bg" sprite — stated once as rect
|
|
5
|
-
* data. The DOM trough renders it as a whole-surface raster
|
|
6
|
-
* (`tileRaster`, written by `ScrollRailController` — 1-bit at every scale,
|
|
7
|
-
* zoom-minted ones included); the SVG span tile below is the forced-colors
|
|
8
|
-
* mask, which repaints the same art in the remapped ink token.
|
|
9
|
-
*/
|
|
10
|
-
export declare const TROUGH_MOTIF_X = 4;
|
|
11
|
-
export declare const TROUGH_MOTIF_Y = 2;
|
|
12
|
-
export declare const TROUGH_RECTS: readonly TileRect[];
|
|
1
|
+
export declare const TROUGH_MOTIF_X: number;
|
|
2
|
+
export declare const TROUGH_MOTIF_Y: number;
|
|
3
|
+
export declare const TROUGH_RECTS: readonly import("./tile.js").TileRect[];
|
|
13
4
|
/**
|
|
14
5
|
* System 7 scroll rails, drawn by the kit as ordinary shadow DOM — the skin
|
|
15
6
|
* for the subtree `renderScrollRail()` (src/scroll-rail.ts) produces. The
|