vintage-frames 0.12.8 → 0.14.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 +26 -26
- package/dist/chrome.d.ts +1 -1
- package/dist/components/vf-checkbox.d.ts +6 -5
- package/dist/components/vf-checkbox.js +41 -37
- package/dist/components/vf-container.d.ts +16 -20
- package/dist/components/vf-container.js +25 -17
- package/dist/components/vf-desktop.d.ts +4 -5
- package/dist/components/vf-desktop.js +13 -18
- package/dist/components/vf-fieldset.js +30 -22
- package/dist/components/vf-icon.js +55 -55
- package/dist/components/vf-list.js +30 -29
- package/dist/components/vf-menu.js +24 -22
- package/dist/components/vf-number-field.js +32 -30
- package/dist/components/vf-progress-bar.d.ts +2 -2
- package/dist/components/vf-progress-bar.js +65 -52
- package/dist/components/vf-radio.js +3 -4
- package/dist/components/vf-scroll-area.js +27 -26
- package/dist/components/vf-select.js +108 -90
- package/dist/components/vf-separator.d.ts +5 -5
- package/dist/components/vf-separator.js +36 -10
- package/dist/components/vf-slider.js +11 -11
- package/dist/components/vf-swatch.d.ts +2 -2
- package/dist/components/vf-swatch.js +73 -72
- package/dist/components/vf-text-area.js +37 -35
- package/dist/components/vf-text-field.js +20 -18
- package/dist/components/vf-window.d.ts +6 -9
- package/dist/components/vf-window.js +106 -87
- package/dist/index.d.ts +20 -10
- package/dist/index.js +63 -62
- package/dist/pattern-fill.d.ts +21 -50
- package/dist/pattern-fill.js +19 -54
- package/dist/scroll-rail.d.ts +6 -6
- package/dist/scroll-rail.js +24 -29
- package/dist/styles/base.d.ts +3 -1
- package/dist/styles/recipes/field.d.ts +10 -6
- package/dist/styles/recipes/field.js +8 -7
- package/dist/styles/recipes/focus.d.ts +7 -3
- package/dist/styles/recipes/pattern.d.ts +19 -10
- package/dist/styles/recipes/pattern.js +27 -18
- package/dist/styles/recipes/rule.d.ts +11 -8
- package/dist/styles/recipes/rule.js +31 -13
- package/dist/styles/recipes/scroll-rail.d.ts +21 -13
- package/dist/styles/recipes/scroll-rail.js +27 -37
- package/dist/styles/recipes/shadow.d.ts +10 -6
- package/dist/styles/recipes/shadow.js +4 -2
- package/dist/styles/recipes/stroke.d.ts +85 -0
- package/dist/styles/recipes/stroke.js +53 -0
- package/dist/styles/recipes/surface.d.ts +8 -4
- package/dist/styles/recipes/surface.js +23 -17
- package/dist/styles/recipes/tile.d.ts +11 -3
- package/dist/styles/recipes/tile.js +12 -12
- package/dist/styles/recipes/title-bar.d.ts +7 -0
- package/dist/styles/recipes/title-bar.js +25 -22
- package/dist/styles/recipes/toggle.js +3 -3
- package/dist/tile-grid.d.ts +98 -64
- package/dist/tile-grid.js +63 -30
- package/dist/track-width.d.ts +1 -2
- package/dist/zoom.d.ts +9 -9
- package/docs/SPEC.md +33 -32
- package/editor/vscode.html-custom-data.json +5 -5
- package/editor/web-types.json +8 -8
- package/package.json +1 -1
|
@@ -4,40 +4,48 @@ import n from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js
|
|
|
4
4
|
import { VfPositioned as r } from "../position.js";
|
|
5
5
|
import { vfDisplayDecls as i } from "../styles/recipes/display-face.js";
|
|
6
6
|
import { vfBase as a } from "../styles/recipes/host.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
7
|
+
import { vfStrokeDecls as o, vfStrokeInset as s } from "../styles/recipes/stroke.js";
|
|
8
|
+
import { GridSnapController as c } from "../grid-snap.js";
|
|
9
|
+
import { LitElement as l, css as u, html as d, nothing as f } from "lit";
|
|
10
|
+
import { property as p, state as m } from "lit/decorators.js";
|
|
11
|
+
import { classMap as h } from "lit/directives/class-map.js";
|
|
11
12
|
//#region src/components/vf-fieldset.ts
|
|
12
|
-
var
|
|
13
|
+
var g = class extends r(l) {
|
|
13
14
|
constructor(...e) {
|
|
14
|
-
super(...e), this.scale = new t(this), this.gridSnap = new
|
|
15
|
+
super(...e), this.scale = new t(this), this.gridSnap = new c(this), this.legend = "", this._hasSlottedLegend = !1;
|
|
15
16
|
}
|
|
16
17
|
static {
|
|
17
|
-
this.styles = [a,
|
|
18
|
+
this.styles = [a, u`
|
|
18
19
|
:host {
|
|
19
20
|
display: block;
|
|
20
21
|
}
|
|
21
22
|
.fieldset {
|
|
22
23
|
position: relative;
|
|
23
|
-
|
|
24
|
+
margin-top: calc(var(--vf-scale, 1) * 8px);
|
|
25
|
+
${o()}
|
|
26
|
+
}
|
|
27
|
+
/* The rule is a stroke, so the box's own padding box runs under it: the
|
|
28
|
+
slot is the box inside it, where the content sits 14/12/10px in and
|
|
29
|
+
children placed with top/left measure from the rule's inner edge. */
|
|
30
|
+
.fieldset > slot {
|
|
31
|
+
display: block;
|
|
32
|
+
position: relative;
|
|
24
33
|
padding: calc(var(--vf-scale, 1) * 14px) calc(var(--vf-scale, 1) * 12px)
|
|
25
34
|
calc(var(--vf-scale, 1) * 10px);
|
|
26
|
-
margin-top: calc(var(--vf-scale, 1) * 8px);
|
|
27
35
|
}
|
|
28
36
|
.legend {
|
|
29
37
|
/* Chicago-style legend (chrome); grouped content keeps the body face. */
|
|
30
38
|
${i}
|
|
31
39
|
position: absolute;
|
|
32
|
-
/* Whole system px like every other length here
|
|
33
|
-
|
|
34
|
-
at every scale, and it took
|
|
35
|
-
|
|
36
|
-
lower. */
|
|
37
|
-
top:
|
|
38
|
-
left:
|
|
40
|
+
/* Whole system px like every other length here, measured from the
|
|
41
|
+
rule's inner edge. Authored as -0.7em this was 11.2px against the
|
|
42
|
+
16px display face — off the device grid at every scale, and it took
|
|
43
|
+
a slotted legend with it (verify:grid). 11 keeps the legend
|
|
44
|
+
straddling the rule, a fifth of a system px lower. */
|
|
45
|
+
top: ${s(-11)};
|
|
46
|
+
left: ${s(8)};
|
|
39
47
|
padding: 0 calc(var(--vf-scale, 1) * 5px);
|
|
40
|
-
/* Punches through the
|
|
48
|
+
/* Punches through the rule, matching the surface behind it. */
|
|
41
49
|
background: var(--vf-surface, var(--vf-white, #fff));
|
|
42
50
|
white-space: nowrap;
|
|
43
51
|
}
|
|
@@ -48,16 +56,16 @@ var m = class extends r(s) {
|
|
|
48
56
|
}
|
|
49
57
|
render() {
|
|
50
58
|
let e = !this.legend && !this._hasSlottedLegend;
|
|
51
|
-
return
|
|
59
|
+
return d`
|
|
52
60
|
<div
|
|
53
61
|
class="fieldset vf-snap"
|
|
54
62
|
part="fieldset"
|
|
55
63
|
role="group"
|
|
56
|
-
aria-labelledby=${e ?
|
|
64
|
+
aria-labelledby=${e ? f : "legend"}
|
|
57
65
|
>
|
|
58
66
|
<span
|
|
59
67
|
id="legend"
|
|
60
|
-
class=${
|
|
68
|
+
class=${h({
|
|
61
69
|
legend: !0,
|
|
62
70
|
empty: e
|
|
63
71
|
})}
|
|
@@ -76,6 +84,6 @@ var m = class extends r(s) {
|
|
|
76
84
|
this._hasSlottedLegend = t.assignedNodes({ flatten: !0 }).length > 0;
|
|
77
85
|
}
|
|
78
86
|
};
|
|
79
|
-
n([
|
|
87
|
+
n([p()], g.prototype, "legend", void 0), n([m()], g.prototype, "_hasSlottedLegend", void 0), g = n([e("vf-fieldset")], g);
|
|
80
88
|
//#endregion
|
|
81
|
-
export {
|
|
89
|
+
export { g as VfFieldset };
|
|
@@ -5,25 +5,26 @@ import o from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js
|
|
|
5
5
|
import { PlacementController as s, VfPositioned as c, warnMovableContract as l } from "../position.js";
|
|
6
6
|
import { vfBodyDecls as u } from "../styles/recipes/body-face.js";
|
|
7
7
|
import { vfBase as d } from "../styles/recipes/host.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
8
|
+
import { vfStrokeDecls as f } from "../styles/recipes/stroke.js";
|
|
9
|
+
import { vfFocusUnderline as p } from "../styles/recipes/focus.js";
|
|
10
|
+
import { GridSnapController as m } from "../grid-snap.js";
|
|
11
|
+
import { DocumentListenersController as h } from "../document-listeners.js";
|
|
12
|
+
import { DragController as g } from "../drag.js";
|
|
13
|
+
import { dragSlop as _, prefersReducedMotion as v, runOutlineTravel as y } from "../motion.js";
|
|
14
|
+
import { deriveDragOutline as b, deriveOpenArt as x, dotOutline as S, penPhase as C, xorPenCanvas as w } from "../open-art.js";
|
|
15
|
+
import { FocusRuleController as T } from "../focus-modality.js";
|
|
16
|
+
import { LitElement as E, css as D, html as O, nothing as k } from "lit";
|
|
17
|
+
import { property as A, state as j } from "lit/decorators.js";
|
|
17
18
|
//#region src/components/vf-icon.ts
|
|
18
|
-
var
|
|
19
|
+
var M, N = {
|
|
19
20
|
large: 32,
|
|
20
21
|
small: 16
|
|
21
|
-
},
|
|
22
|
+
}, P = 1, F = 8, I = (e, t) => t <= 0 ? Math.max(e, 0) : Math.min(Math.max(e, 0), t), L = class extends c(E) {
|
|
22
23
|
static {
|
|
23
|
-
|
|
24
|
+
M = this;
|
|
24
25
|
}
|
|
25
26
|
constructor(...t) {
|
|
26
|
-
super(...t), this.label = "", this.size = "large", this.selectable = !1, this.selected = !1, this.target = !1, this.color = !1, this.open = !1, this.movable = !1, this.editable = !1, this.maxlength = 31, this.scale = new n(this), this.gridSnap = new
|
|
27
|
+
super(...t), this.label = "", this.size = "large", this.selectable = !1, this.selected = !1, this.target = !1, this.color = !1, this.open = !1, this.movable = !1, this.editable = !1, this.maxlength = 31, this.scale = new n(this), this.gridSnap = new m(this), this.focusRule = new T(this), this._editing = !1, this._draft = "", this.#e = 0, this._ghost = null, this.#t = null, this.#n = this.attachInternals(), this.#a = !1, this.#o = "", this.#s = "", this.#c = 0, this.#l = -Infinity, this.#u = !1, this.#d = null, this.#f = null, this.#p = new h(this, () => [[
|
|
27
28
|
document,
|
|
28
29
|
"pointerdown",
|
|
29
30
|
this.#te,
|
|
@@ -32,9 +33,9 @@ var j, M = {
|
|
|
32
33
|
x: Math.max(e, 0),
|
|
33
34
|
y: Math.max(t, 0)
|
|
34
35
|
} : {
|
|
35
|
-
x:
|
|
36
|
-
y:
|
|
37
|
-
}, this.#g = new s(this, (e, t, n) => this.#m(e, t, n)), this.#_ = null, this.#v = new
|
|
36
|
+
x: I(e, n.width - a(this.offsetWidth, this)),
|
|
37
|
+
y: I(t, n.height - a(this.offsetHeight, this))
|
|
38
|
+
}, this.#g = new s(this, (e, t, n) => this.#m(e, t, n)), this.#_ = null, this.#v = new g(this, {
|
|
38
39
|
onDragStart: (e) => {
|
|
39
40
|
if (!this.movable || e.button !== 0 || this._editing) return null;
|
|
40
41
|
this.#L();
|
|
@@ -50,7 +51,7 @@ var j, M = {
|
|
|
50
51
|
clientX: e.clientX,
|
|
51
52
|
clientY: e.clientY
|
|
52
53
|
},
|
|
53
|
-
slop:
|
|
54
|
+
slop: _(e),
|
|
54
55
|
proposal: null,
|
|
55
56
|
outline: null,
|
|
56
57
|
followers: [],
|
|
@@ -63,14 +64,14 @@ var j, M = {
|
|
|
63
64
|
onDragEnd: (e, t) => {
|
|
64
65
|
this.#A(e, t);
|
|
65
66
|
}
|
|
66
|
-
}), this.#y = new
|
|
67
|
+
}), this.#y = new h(this, () => [[
|
|
67
68
|
document,
|
|
68
69
|
"keydown",
|
|
69
70
|
this.#b,
|
|
70
71
|
!0
|
|
71
72
|
]]), this.#b = (e) => {
|
|
72
73
|
e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), this.#v.cancel());
|
|
73
|
-
}, this.#x = null, this.#S = new
|
|
74
|
+
}, this.#x = null, this.#S = new h(this, () => [[
|
|
74
75
|
document,
|
|
75
76
|
"pointerdown",
|
|
76
77
|
this.#C,
|
|
@@ -119,7 +120,7 @@ var j, M = {
|
|
|
119
120
|
if (t.includes(this) || (this.#G(), this.#f = null, e.shiftKey || e.metaKey)) return;
|
|
120
121
|
let n = this.#i;
|
|
121
122
|
if (n !== null) {
|
|
122
|
-
let e = t.find((e) => e instanceof
|
|
123
|
+
let e = t.find((e) => e instanceof M);
|
|
123
124
|
if (e?.selected && e.#i === n) return;
|
|
124
125
|
}
|
|
125
126
|
this.#X(!1);
|
|
@@ -158,7 +159,7 @@ var j, M = {
|
|
|
158
159
|
case "ArrowDown": {
|
|
159
160
|
if (!this.movable) return;
|
|
160
161
|
t.preventDefault(), this.focusRule.reveal();
|
|
161
|
-
let e = t.shiftKey ?
|
|
162
|
+
let e = t.shiftKey ? F : P, n = t.key === "ArrowLeft" ? -e : t.key === "ArrowRight" ? e : 0, r = t.key === "ArrowUp" ? -e : t.key === "ArrowDown" ? e : 0;
|
|
162
163
|
this.#L();
|
|
163
164
|
let i = this.#g.seed();
|
|
164
165
|
this.#g.moveTo(i.x + n, i.y + r);
|
|
@@ -168,7 +169,7 @@ var j, M = {
|
|
|
168
169
|
};
|
|
169
170
|
}
|
|
170
171
|
static {
|
|
171
|
-
this.styles = [d,
|
|
172
|
+
this.styles = [d, D`
|
|
172
173
|
:host {
|
|
173
174
|
display: inline-block;
|
|
174
175
|
cursor: var(--vf-cursor, default);
|
|
@@ -333,8 +334,7 @@ var j, M = {
|
|
|
333
334
|
position: absolute;
|
|
334
335
|
inset: calc(var(--vf-scale, 1) * -2px) calc(var(--vf-scale, 1) * -1px);
|
|
335
336
|
background: var(--vf-white, #fff);
|
|
336
|
-
|
|
337
|
-
padding: calc(var(--vf-scale, 1) * 1px);
|
|
337
|
+
${f({ padding: 1 })}
|
|
338
338
|
}
|
|
339
339
|
.rename {
|
|
340
340
|
display: block;
|
|
@@ -386,12 +386,12 @@ var j, M = {
|
|
|
386
386
|
as a visible focus (see focus-modality.ts). */
|
|
387
387
|
.caption.focus-rule .label::after {
|
|
388
388
|
--vf-focus-underline-offset: -2px;
|
|
389
|
-
${
|
|
389
|
+
${p}
|
|
390
390
|
}
|
|
391
391
|
/* No name, no plate — the rule falls back to the art cell. */
|
|
392
392
|
.art.focus-rule::after {
|
|
393
393
|
--vf-focus-underline-offset: -2px;
|
|
394
|
-
${
|
|
394
|
+
${p}
|
|
395
395
|
}
|
|
396
396
|
:host(:focus) {
|
|
397
397
|
outline: none;
|
|
@@ -553,7 +553,7 @@ var j, M = {
|
|
|
553
553
|
y: Math.round((e.top - u) / o),
|
|
554
554
|
width: Math.round(e.width / o),
|
|
555
555
|
height: Math.round(e.height / o)
|
|
556
|
-
}), m = Math.round((d - l) / o), h = Math.round((f - u) / o), g = this.open && this._ghost ? this._ghost : this.#t, _ = g != null && (g instanceof HTMLCanvasElement ? g.width > 0 : g.complete && g.naturalWidth > 0), v = _ ? g.getBoundingClientRect() : null,
|
|
556
|
+
}), m = Math.round((d - l) / o), h = Math.round((f - u) / o), g = this.open && this._ghost ? this._ghost : this.#t, _ = g != null && (g instanceof HTMLCanvasElement ? g.width > 0 : g.complete && g.naturalWidth > 0), v = _ ? g.getBoundingClientRect() : null, y = b(_ ? g : null, {
|
|
557
557
|
width: m,
|
|
558
558
|
height: h,
|
|
559
559
|
art: v && v.width > 0 ? p(v) : null,
|
|
@@ -565,15 +565,15 @@ var j, M = {
|
|
|
565
565
|
},
|
|
566
566
|
plate: c ? p(c) : null
|
|
567
567
|
});
|
|
568
|
-
if (!
|
|
569
|
-
let x =
|
|
570
|
-
S.position = "absolute", S.width = i(
|
|
571
|
-
let
|
|
568
|
+
if (!y) return null;
|
|
569
|
+
let x = w("drag-outline"), S = x.style;
|
|
570
|
+
S.position = "absolute", S.width = i(y.width), S.height = i(y.height);
|
|
571
|
+
let C = t ?? a, T = t ? t.getBoundingClientRect() : e, E = {
|
|
572
572
|
x: Math.round((l - T.left) / o),
|
|
573
573
|
y: Math.round((u - T.top) / o)
|
|
574
574
|
};
|
|
575
|
-
return
|
|
576
|
-
ring:
|
|
575
|
+
return C.append(x), {
|
|
576
|
+
ring: y,
|
|
577
577
|
canvas: x,
|
|
578
578
|
base: E,
|
|
579
579
|
phase: -1
|
|
@@ -582,8 +582,8 @@ var j, M = {
|
|
|
582
582
|
#P(e, t, n) {
|
|
583
583
|
let r = e.base.x + t, a = e.base.y + n;
|
|
584
584
|
e.canvas.style.left = i(r), e.canvas.style.top = i(a);
|
|
585
|
-
let o =
|
|
586
|
-
o !== e.phase && (e.phase = o,
|
|
585
|
+
let o = C(r, a);
|
|
586
|
+
o !== e.phase && (e.phase = o, S(e.ring, e.canvas, o));
|
|
587
587
|
}
|
|
588
588
|
#F(e) {
|
|
589
589
|
let { left: t, top: n } = e.proposal ?? {
|
|
@@ -634,7 +634,7 @@ var j, M = {
|
|
|
634
634
|
n.selectNodeContents(e), t = n.getBoundingClientRect().width, n.detach();
|
|
635
635
|
}
|
|
636
636
|
let n = t / r(this) + 2, i = Math.max(2, Math.ceil(n / 2) * 2);
|
|
637
|
-
this.#e = this._editing && t === 0 ? Math.max(i,
|
|
637
|
+
this.#e = this._editing && t === 0 ? Math.max(i, N[this.size]) : i, e.style.width = this.#z;
|
|
638
638
|
}
|
|
639
639
|
get #z() {
|
|
640
640
|
return this.#e ? `calc(var(--vf-scale, 1) * ${this.#e}px)` : "";
|
|
@@ -660,7 +660,7 @@ var j, M = {
|
|
|
660
660
|
}
|
|
661
661
|
let n = e instanceof HTMLImageElement ? `${this.size} ${e.currentSrc}` : "";
|
|
662
662
|
if (n !== "" && n === this.#o && this._ghost) return;
|
|
663
|
-
let r =
|
|
663
|
+
let r = x(e);
|
|
664
664
|
if (r) {
|
|
665
665
|
r.className = "ghost", r.style.width = `calc(var(--vf-scale, 1) * ${r.width}px)`, r.style.height = `calc(var(--vf-scale, 1) * ${r.height}px)`;
|
|
666
666
|
let t = e instanceof HTMLImageElement ? e.alt : "";
|
|
@@ -701,7 +701,7 @@ var j, M = {
|
|
|
701
701
|
}
|
|
702
702
|
render() {
|
|
703
703
|
let e = this._editing, t = e ? this._draft : this.label, n = this.focusRule.marked && !e, r = t !== "" || e, i = `caption${e ? " editing" : ""}${n && t ? " focus-rule" : ""}`, a = `art${this.open && this._ghost ? " open" : ""}${n && !t ? " focus-rule" : ""}`, o = this.width ? `width: calc(var(--vf-scale, 1) * ${this.width}px)` : "";
|
|
704
|
-
return
|
|
704
|
+
return O`<div
|
|
705
705
|
class="frame vf-snap"
|
|
706
706
|
part="frame"
|
|
707
707
|
style=${o}
|
|
@@ -713,9 +713,9 @@ var j, M = {
|
|
|
713
713
|
@dblclick=${this.#Q}
|
|
714
714
|
>
|
|
715
715
|
<div class=${a} part="icon">
|
|
716
|
-
${this.size === "small" ?
|
|
716
|
+
${this.size === "small" ? O`<slot name="small" @slotchange=${this.#B}></slot>` : O`<slot name="large" @slotchange=${this.#B}></slot>`}${this._ghost ?? k}
|
|
717
717
|
</div>
|
|
718
|
-
${r ?
|
|
718
|
+
${r ? O`<div class=${i}>
|
|
719
719
|
<!-- No whitespace around the span: it is the measured run, and a
|
|
720
720
|
stray space would widen it. -->
|
|
721
721
|
<div class="label" part="label"><span
|
|
@@ -724,7 +724,7 @@ var j, M = {
|
|
|
724
724
|
style=${this.#e ? `width: ${this.#z}` : ""}
|
|
725
725
|
>${t}</span
|
|
726
726
|
></div>
|
|
727
|
-
${e ?
|
|
727
|
+
${e ? O`<div class="rename-box">
|
|
728
728
|
<input
|
|
729
729
|
class="rename"
|
|
730
730
|
part="input"
|
|
@@ -736,8 +736,8 @@ var j, M = {
|
|
|
736
736
|
@keydown=${this.#ae}
|
|
737
737
|
@blur=${this.commitEditing}
|
|
738
738
|
/>
|
|
739
|
-
</div>` :
|
|
740
|
-
</div>` :
|
|
739
|
+
</div>` : k}
|
|
740
|
+
</div>` : k}
|
|
741
741
|
</div>`;
|
|
742
742
|
}
|
|
743
743
|
#K() {
|
|
@@ -786,10 +786,10 @@ var j, M = {
|
|
|
786
786
|
async dragTo(e, t) {
|
|
787
787
|
if (this.#x?.finish(), await this.updateComplete, this.#x?.finish(), !this.isConnected) return !1;
|
|
788
788
|
this.#L();
|
|
789
|
-
let n = this.#g.seed(), r = this.#g.resolve(e, t), i = r.x - n.x, a = r.y - n.y, o = i === 0 && a === 0 ||
|
|
789
|
+
let n = this.#g.seed(), r = this.#g.resolve(e, t), i = r.x - n.x, a = r.y - n.y, o = i === 0 && a === 0 || v() || this._editing || this.#_ !== null ? null : this.#N(this.#T(), this.#M());
|
|
790
790
|
return o ? (this.#P(o, 0, 0), new Promise((e) => {
|
|
791
791
|
let t = null;
|
|
792
|
-
t =
|
|
792
|
+
t = y(Math.hypot(i, a), (e) => this.#P(o, Math.round(i * e), Math.round(a * e)), () => {
|
|
793
793
|
this.#x === t && (this.#x = null, this.#S.detach()), o.canvas.remove(), this.isConnected && this.#g.moveTo(r.x, r.y), e(!0);
|
|
794
794
|
}), this.#x = t, this.#S.attach();
|
|
795
795
|
})) : (this.#g.moveTo(r.x, r.y), !1);
|
|
@@ -799,7 +799,7 @@ var j, M = {
|
|
|
799
799
|
#$;
|
|
800
800
|
#ee(e, t) {
|
|
801
801
|
let n = this.#d;
|
|
802
|
-
return !n || n.pointerId !== e.pointerId || (this.#d = null, !(e.type !== "pointercancel" && !t && !this._editing && Math.hypot(e.clientX - n.x, e.clientY - n.y) <
|
|
802
|
+
return !n || n.pointerId !== e.pointerId || (this.#d = null, !(e.type !== "pointercancel" && !t && !this._editing && Math.hypot(e.clientX - n.x, e.clientY - n.y) < _(e))) ? !1 : n.second ? !0 : (this.#f = {
|
|
803
803
|
time: n.time,
|
|
804
804
|
x: n.x,
|
|
805
805
|
y: n.y
|
|
@@ -818,27 +818,27 @@ var j, M = {
|
|
|
818
818
|
#ae;
|
|
819
819
|
#oe;
|
|
820
820
|
};
|
|
821
|
-
o([
|
|
821
|
+
o([A()], L.prototype, "label", void 0), o([A({ reflect: !0 })], L.prototype, "size", void 0), o([A({
|
|
822
822
|
type: Boolean,
|
|
823
823
|
reflect: !0
|
|
824
|
-
})],
|
|
824
|
+
})], L.prototype, "selectable", void 0), o([A({
|
|
825
825
|
type: Boolean,
|
|
826
826
|
reflect: !0
|
|
827
|
-
})],
|
|
827
|
+
})], L.prototype, "selected", void 0), o([A({
|
|
828
828
|
type: Boolean,
|
|
829
829
|
reflect: !0
|
|
830
|
-
})],
|
|
830
|
+
})], L.prototype, "target", void 0), o([A({
|
|
831
831
|
type: Boolean,
|
|
832
832
|
reflect: !0
|
|
833
|
-
})],
|
|
833
|
+
})], L.prototype, "color", void 0), o([A({
|
|
834
834
|
type: Boolean,
|
|
835
835
|
reflect: !0
|
|
836
|
-
})],
|
|
836
|
+
})], L.prototype, "open", void 0), o([A({
|
|
837
837
|
type: Boolean,
|
|
838
838
|
reflect: !0
|
|
839
|
-
})],
|
|
839
|
+
})], L.prototype, "movable", void 0), o([A({
|
|
840
840
|
type: Boolean,
|
|
841
841
|
reflect: !0
|
|
842
|
-
})],
|
|
842
|
+
})], L.prototype, "editable", void 0), o([A({ type: Number })], L.prototype, "width", void 0), o([A({ type: Number })], L.prototype, "maxlength", void 0), o([j()], L.prototype, "_editing", void 0), o([j()], L.prototype, "_draft", void 0), o([j()], L.prototype, "_ghost", void 0), L = M = o([t("vf-icon")], L);
|
|
843
843
|
//#endregion
|
|
844
|
-
export {
|
|
844
|
+
export { L as VfIcon };
|
|
@@ -4,21 +4,22 @@ import { ScaleController as n } from "../scale.js";
|
|
|
4
4
|
import r from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
|
|
5
5
|
import { VfPositioned as i } from "../position.js";
|
|
6
6
|
import { vfBase as a } from "../styles/recipes/host.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
7
|
+
import { vfStrokeDecls as o } from "../styles/recipes/stroke.js";
|
|
8
|
+
import { vfFocusRing as s } from "../styles/recipes/focus.js";
|
|
9
|
+
import { vfScrollRail as c } from "../styles/recipes/scroll-rail.js";
|
|
10
|
+
import { GridSnapController as l } from "../grid-snap.js";
|
|
11
|
+
import { ScrollStateController as u } from "../scroll-state.js";
|
|
12
|
+
import { ScrollRailController as d, renderScrollRail as f } from "../scroll-rail.js";
|
|
13
|
+
import { TypeAheadBuffer as p } from "../type-ahead.js";
|
|
14
|
+
import { LitElement as m, css as h, html as g, nothing as _ } from "lit";
|
|
15
|
+
import { property as v, query as y, queryAssignedElements as b, state as x } from "lit/decorators.js";
|
|
15
16
|
//#region src/components/vf-list.ts
|
|
16
|
-
var
|
|
17
|
+
var S = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), C = class extends i(m) {
|
|
17
18
|
static {
|
|
18
19
|
this.styles = [
|
|
19
20
|
a,
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
c,
|
|
22
|
+
h`
|
|
22
23
|
:host {
|
|
23
24
|
display: block;
|
|
24
25
|
}
|
|
@@ -26,21 +27,21 @@ var x = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), S = cl
|
|
|
26
27
|
:host([disabled]) {
|
|
27
28
|
color: var(--vf-disabled, #c0c0c0);
|
|
28
29
|
}
|
|
29
|
-
/* The snapped wrapper:
|
|
30
|
+
/* The snapped wrapper: the 1px frame (the rail's outer line), the
|
|
30
31
|
[rows | rail] grid — the rail sizes itself to the 15px inside the
|
|
31
32
|
frame — and everything riding the grid-snap offset as one. */
|
|
32
33
|
.box {
|
|
33
|
-
border: calc(var(--vf-scale, 1) * 1px) solid var(--vf-black, #000);
|
|
34
34
|
background: var(--vf-white, #fff);
|
|
35
35
|
display: grid;
|
|
36
36
|
grid-template-columns: 1fr auto;
|
|
37
|
+
${o()}
|
|
37
38
|
}
|
|
38
39
|
.list {
|
|
39
40
|
grid-area: 1 / 1;
|
|
40
41
|
min-width: 0;
|
|
41
42
|
background: var(--vf-white, #fff);
|
|
42
|
-
/* The clamp is the content box's — the .box
|
|
43
|
-
|
|
43
|
+
/* The clamp is the content box's — the .box frame adds its 2px on
|
|
44
|
+
top, keeping the clamped total where it always was. */
|
|
44
45
|
max-height: calc(var(--vf-scale, 1) * var(--vf-list-max-height, 200px));
|
|
45
46
|
/* Native scrolling; the bar itself is hidden by the recipe
|
|
46
47
|
(.vf-scroll) and the reservation is the rail element, not a native
|
|
@@ -55,7 +56,7 @@ var x = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), S = cl
|
|
|
55
56
|
render()); the ring keeps that stop visible, inset to stay in-box. */
|
|
56
57
|
.list:focus-visible {
|
|
57
58
|
--vf-focus-offset: -2px;
|
|
58
|
-
${
|
|
59
|
+
${s}
|
|
59
60
|
}
|
|
60
61
|
`
|
|
61
62
|
];
|
|
@@ -66,12 +67,12 @@ var x = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), S = cl
|
|
|
66
67
|
#r;
|
|
67
68
|
#i;
|
|
68
69
|
constructor() {
|
|
69
|
-
super(), this.scale = new n(this), this.gridSnap = new
|
|
70
|
+
super(), this.scale = new n(this), this.gridSnap = new l(this), this.scrollState = new u(this, () => this.viewport, () => this.content, (e) => {
|
|
70
71
|
this._scrollable = e.x || e.y;
|
|
71
|
-
}), this.rail = new
|
|
72
|
+
}), this.rail = new d(this, {
|
|
72
73
|
getScroll: () => this.viewport,
|
|
73
74
|
getContent: () => this.content
|
|
74
|
-
}), this._scrollable = !1, this.multiple = !1, this.value = "", this.values = [], this.disabled = !1, this.label = "", this.#e = -1, this.#t = -1, this.#n = new
|
|
75
|
+
}), this._scrollable = !1, this.multiple = !1, this.value = "", this.values = [], this.disabled = !1, this.label = "", this.#e = -1, this.#t = -1, this.#n = new p(), this.#r = [], this.#i = this.attachInternals(), this.#l = (e) => {
|
|
75
76
|
if (this.disabled) return;
|
|
76
77
|
let t = e.target?.closest("vf-list-item") ?? null;
|
|
77
78
|
if (!t || t.disabled) return;
|
|
@@ -156,21 +157,21 @@ var x = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), S = cl
|
|
|
156
157
|
e.has("multiple") && (this.#i.ariaMultiSelectable = this.multiple ? "true" : null), e.has("disabled") && (this.#i.ariaDisabled = this.disabled ? "true" : null, this.#c()), e.has("label") && (this.#i.ariaLabel = this.label || null), e.has("values") ? (e.get("values") !== void 0 || this.values.length > 0) && this.#a(this.values) : e.has("value") && (e.get("value") !== void 0 || this.value !== "") && this.#a(this.value ? [this.value] : []);
|
|
157
158
|
}
|
|
158
159
|
#a(e) {
|
|
159
|
-
|
|
160
|
+
S(e, this.#r) || this.#s(e, !1);
|
|
160
161
|
}
|
|
161
162
|
render() {
|
|
162
|
-
return
|
|
163
|
+
return g`
|
|
163
164
|
<div class="box vf-snap">
|
|
164
165
|
<div
|
|
165
166
|
class="list vf-scroll"
|
|
166
167
|
part="list"
|
|
167
|
-
tabindex=${this.disabled && this._scrollable ? "0" :
|
|
168
|
+
tabindex=${this.disabled && this._scrollable ? "0" : _}
|
|
168
169
|
>
|
|
169
170
|
<div class="list-content">
|
|
170
171
|
<slot @slotchange=${this.#o}></slot>
|
|
171
172
|
</div>
|
|
172
173
|
</div>
|
|
173
|
-
${
|
|
174
|
+
${f(this.rail, "vertical")}
|
|
174
175
|
</div>
|
|
175
176
|
`;
|
|
176
177
|
}
|
|
@@ -187,7 +188,7 @@ var x = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), S = cl
|
|
|
187
188
|
let o = r.filter((e) => e.selected).map((e) => e.value);
|
|
188
189
|
this.#r = [...o];
|
|
189
190
|
let s = o[0] ?? "";
|
|
190
|
-
this.value !== s && (this.value = s),
|
|
191
|
+
this.value !== s && (this.value = s), S(this.values, o) || (this.values = o), this.#c(), n && !S(a, o) && e(this, "vf-change", {
|
|
191
192
|
value: this.value,
|
|
192
193
|
values: [...o]
|
|
193
194
|
});
|
|
@@ -231,15 +232,15 @@ var x = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), S = cl
|
|
|
231
232
|
!t || t.disabled || (t.focus(), t.scrollIntoView({ block: "nearest" }));
|
|
232
233
|
}
|
|
233
234
|
};
|
|
234
|
-
r([
|
|
235
|
+
r([y(".list")], C.prototype, "viewport", void 0), r([y(".list-content")], C.prototype, "content", void 0), r([x()], C.prototype, "_scrollable", void 0), r([v({
|
|
235
236
|
type: Boolean,
|
|
236
237
|
reflect: !0
|
|
237
|
-
})],
|
|
238
|
+
})], C.prototype, "multiple", void 0), r([v()], C.prototype, "value", void 0), r([v({ attribute: !1 })], C.prototype, "values", void 0), r([v({
|
|
238
239
|
type: Boolean,
|
|
239
240
|
reflect: !0
|
|
240
|
-
})],
|
|
241
|
+
})], C.prototype, "disabled", void 0), r([v()], C.prototype, "label", void 0), r([b({
|
|
241
242
|
selector: "vf-list-item",
|
|
242
243
|
flatten: !0
|
|
243
|
-
})],
|
|
244
|
+
})], C.prototype, "_items", void 0), C = r([t("vf-list")], C);
|
|
244
245
|
//#endregion
|
|
245
|
-
export {
|
|
246
|
+
export { C as VfList };
|
|
@@ -125,22 +125,23 @@ var T = class extends a(_) {
|
|
|
125
125
|
@media (forced-colors: active) {
|
|
126
126
|
forced-color-adjust: none;
|
|
127
127
|
}
|
|
128
|
-
background: var(--vf-highlight, #000);
|
|
129
128
|
color: var(--vf-highlight-text, #fff);
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
129
|
+
}
|
|
130
|
+
/* The hilite leaves the bar's top row white: System 7's plate is rows
|
|
131
|
+
1..18 of the 20px bar (the Label specimen in Menus.png is 18px of
|
|
132
|
+
plate, and InfiniteMac shows the white row above it). So the plate is
|
|
133
|
+
a layer inset a row top and bottom rather than the label's own
|
|
134
|
+
background: the top row shows the bar's white through, the bottom row
|
|
135
|
+
the bar's own black rule, and the hit rect stays the full bar height
|
|
136
|
+
so a click slammed against the screen top still opens the menu. The
|
|
137
|
+
title doesn't move. The label is positioned (vf-snap), and the title
|
|
138
|
+
is too, so the plate paints under it in tree order. */
|
|
139
|
+
:host([open]) .label::before,
|
|
140
|
+
.label.flash-on::before {
|
|
141
|
+
content: '';
|
|
142
|
+
position: absolute;
|
|
143
|
+
inset: calc(var(--vf-scale, 1) * 1px) 0;
|
|
144
|
+
background: var(--vf-highlight, #000);
|
|
144
145
|
}
|
|
145
146
|
/* The title rides in its own box so the focus rule spans the title and
|
|
146
147
|
not the bar cell's 10px padding — the same reason vf-button wraps its
|
|
@@ -198,13 +199,14 @@ var T = class extends a(_) {
|
|
|
198
199
|
from. (The nowrap rows make min-content the widest row, so the
|
|
199
200
|
shrink-to-fit abspos width IS the MDEF width.) */
|
|
200
201
|
min-width: 100%;
|
|
201
|
-
/* No
|
|
202
|
-
|
|
203
|
-
the
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
202
|
+
/* No inset of its own beyond the frame, whose 1px stroke is the
|
|
203
|
+
panel's padding (vfPanel): every panel in Menus.png — both
|
|
204
|
+
pulldowns, the open popup and the closed pill — puts its first
|
|
205
|
+
row's ink at +4 from the border box, which is the 1px frame plus
|
|
206
|
+
the row's own 3px ✓ bias. The bottom line likewise sits
|
|
207
|
+
immediately after the last row. A 2px inset here displaced every
|
|
208
|
+
row by 2px against the art; it was invisible while the rows
|
|
209
|
+
themselves were 6px too tall. */
|
|
208
210
|
z-index: 1000;
|
|
209
211
|
/* As on the title: the held press, not the browser, owns touch moves
|
|
210
212
|
over the dropped panel. */
|