vintage-frames 0.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/LICENSE +21 -0
- package/README.md +262 -0
- package/custom-elements.json +19807 -0
- package/dist/_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js +9 -0
- package/dist/chrome.d.ts +73 -0
- package/dist/chrome.js +94 -0
- package/dist/components/vf-button-group.d.ts +50 -0
- package/dist/components/vf-button-group.js +68 -0
- package/dist/components/vf-button.d.ts +169 -0
- package/dist/components/vf-button.js +234 -0
- package/dist/components/vf-checkbox.d.ts +60 -0
- package/dist/components/vf-checkbox.js +135 -0
- package/dist/components/vf-container.d.ts +95 -0
- package/dist/components/vf-container.js +86 -0
- package/dist/components/vf-desktop.d.ts +243 -0
- package/dist/components/vf-desktop.js +310 -0
- package/dist/components/vf-dialog.d.ts +105 -0
- package/dist/components/vf-dialog.js +280 -0
- package/dist/components/vf-fieldset.d.ts +34 -0
- package/dist/components/vf-fieldset.js +76 -0
- package/dist/components/vf-grid.d.ts +124 -0
- package/dist/components/vf-grid.js +133 -0
- package/dist/components/vf-icon.d.ts +356 -0
- package/dist/components/vf-icon.js +507 -0
- package/dist/components/vf-img.d.ts +63 -0
- package/dist/components/vf-img.js +65 -0
- package/dist/components/vf-label.d.ts +117 -0
- package/dist/components/vf-label.js +151 -0
- package/dist/components/vf-list-item.d.ts +48 -0
- package/dist/components/vf-list-item.js +98 -0
- package/dist/components/vf-list.d.ts +77 -0
- package/dist/components/vf-list.js +256 -0
- package/dist/components/vf-menu-bar.d.ts +64 -0
- package/dist/components/vf-menu-bar.js +236 -0
- package/dist/components/vf-menu-item.d.ts +91 -0
- package/dist/components/vf-menu-item.js +252 -0
- package/dist/components/vf-menu.d.ts +95 -0
- package/dist/components/vf-menu.js +346 -0
- package/dist/components/vf-number-field.d.ts +60 -0
- package/dist/components/vf-number-field.js +248 -0
- package/dist/components/vf-option.d.ts +49 -0
- package/dist/components/vf-option.js +119 -0
- package/dist/components/vf-paragraph.d.ts +73 -0
- package/dist/components/vf-paragraph.js +66 -0
- package/dist/components/vf-progress-bar.d.ts +69 -0
- package/dist/components/vf-progress-bar.js +272 -0
- package/dist/components/vf-radio-group.d.ts +109 -0
- package/dist/components/vf-radio-group.js +105 -0
- package/dist/components/vf-radio.d.ts +59 -0
- package/dist/components/vf-radio.js +135 -0
- package/dist/components/vf-scroll-area.d.ts +75 -0
- package/dist/components/vf-scroll-area.js +124 -0
- package/dist/components/vf-select.d.ts +334 -0
- package/dist/components/vf-select.js +658 -0
- package/dist/components/vf-separator.d.ts +38 -0
- package/dist/components/vf-separator.js +55 -0
- package/dist/components/vf-slider.d.ts +80 -0
- package/dist/components/vf-slider.js +255 -0
- package/dist/components/vf-stack.d.ts +188 -0
- package/dist/components/vf-stack.js +168 -0
- package/dist/components/vf-swatch.d.ts +98 -0
- package/dist/components/vf-swatch.js +201 -0
- package/dist/components/vf-text-area.d.ts +77 -0
- package/dist/components/vf-text-area.js +121 -0
- package/dist/components/vf-text-field.d.ts +53 -0
- package/dist/components/vf-text-field.js +79 -0
- package/dist/components/vf-window.d.ts +157 -0
- package/dist/components/vf-window.js +377 -0
- package/dist/cursor-art.d.ts +37 -0
- package/dist/cursor-art.js +41 -0
- package/dist/cursor.d.ts +49 -0
- package/dist/cursor.js +171 -0
- package/dist/define.d.ts +45 -0
- package/dist/define.js +15 -0
- package/dist/document-listeners.d.ts +62 -0
- package/dist/document-listeners.js +29 -0
- package/dist/drag.d.ts +49 -0
- package/dist/drag.js +30 -0
- package/dist/events.d.ts +79 -0
- package/dist/events.js +25 -0
- package/dist/focus-modality.d.ts +94 -0
- package/dist/focus-modality.js +56 -0
- package/dist/form-control.d.ts +247 -0
- package/dist/form-control.js +127 -0
- package/dist/glyphs.d.ts +117 -0
- package/dist/glyphs.js +100 -0
- package/dist/grid-snap.d.ts +73 -0
- package/dist/grid-snap.js +135 -0
- package/dist/index.d.ts +145 -0
- package/dist/index.js +71 -0
- package/dist/menu-press.d.ts +60 -0
- package/dist/menu-press.js +97 -0
- package/dist/modal-dialog.d.ts +148 -0
- package/dist/modal-dialog.js +155 -0
- package/dist/motion.d.ts +72 -0
- package/dist/motion.js +22 -0
- package/dist/number.d.ts +24 -0
- package/dist/number.js +12 -0
- package/dist/open-art.d.ts +40 -0
- package/dist/open-art.js +35 -0
- package/dist/pixel-frame.d.ts +102 -0
- package/dist/pixel-frame.js +77 -0
- package/dist/popup-overflow.d.ts +157 -0
- package/dist/popup-overflow.js +45 -0
- package/dist/position.d.ts +187 -0
- package/dist/position.js +74 -0
- package/dist/scale.d.ts +259 -0
- package/dist/scale.js +133 -0
- package/dist/scroll-rail.d.ts +112 -0
- package/dist/scroll-rail.js +194 -0
- package/dist/scroll-state.d.ts +113 -0
- package/dist/scroll-state.js +55 -0
- package/dist/size.d.ts +47 -0
- package/dist/size.js +30 -0
- package/dist/styles/base.d.ts +38 -0
- package/dist/styles/body-font.d.ts +7 -0
- package/dist/styles/body-font.js +9 -0
- package/dist/styles/display-font.d.ts +7 -0
- package/dist/styles/display-font.js +9 -0
- package/dist/styles/recipes/body-face.d.ts +14 -0
- package/dist/styles/recipes/body-face.js +6 -0
- package/dist/styles/recipes/display-face.d.ts +23 -0
- package/dist/styles/recipes/display-face.js +10 -0
- package/dist/styles/recipes/field.d.ts +20 -0
- package/dist/styles/recipes/field.js +68 -0
- package/dist/styles/recipes/focus.d.ts +76 -0
- package/dist/styles/recipes/focus.js +39 -0
- package/dist/styles/recipes/host.d.ts +5 -0
- package/dist/styles/recipes/host.js +62 -0
- package/dist/styles/recipes/pattern.d.ts +80 -0
- package/dist/styles/recipes/pattern.js +82 -0
- package/dist/styles/recipes/scroll-rail.d.ts +69 -0
- package/dist/styles/recipes/scroll-rail.js +222 -0
- package/dist/styles/recipes/shadow.d.ts +13 -0
- package/dist/styles/recipes/shadow.js +5 -0
- package/dist/styles/recipes/static-text.d.ts +24 -0
- package/dist/styles/recipes/static-text.js +17 -0
- package/dist/styles/recipes/surface.d.ts +28 -0
- package/dist/styles/recipes/surface.js +27 -0
- package/dist/styles/recipes/tile.d.ts +122 -0
- package/dist/styles/recipes/tile.js +40 -0
- package/dist/styles/recipes/title-bar.d.ts +49 -0
- package/dist/styles/recipes/title-bar.js +134 -0
- package/dist/styles/recipes/toggle.d.ts +10 -0
- package/dist/styles/recipes/toggle.js +20 -0
- package/dist/styles/register-embedded-font.d.ts +64 -0
- package/dist/styles/register-embedded-font.js +30 -0
- package/dist/text-control.d.ts +131 -0
- package/dist/text-control.js +83 -0
- package/dist/tile-grid.d.ts +111 -0
- package/dist/tile-grid.js +53 -0
- package/dist/toggle-control.d.ts +60 -0
- package/dist/toggle-control.js +41 -0
- package/dist/track-width.d.ts +42 -0
- package/dist/track-width.js +30 -0
- package/dist/type-ahead.d.ts +35 -0
- package/dist/type-ahead.js +20 -0
- package/dist/zoom.d.ts +204 -0
- package/dist/zoom.js +105 -0
- package/docs/SPEC.md +2471 -0
- package/editor/vscode.html-custom-data.json +1320 -0
- package/editor/web-types.json +3237 -0
- package/package.json +118 -0
package/dist/glyphs.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { html as e } from "lit";
|
|
2
|
+
//#region src/glyphs.ts
|
|
3
|
+
var t = {
|
|
4
|
+
w: 12,
|
|
5
|
+
h: 12,
|
|
6
|
+
d: "M1 1h1v1h-1zM10 1h1v1h-1zM2 2h1v1h-1zM9 2h1v1h-1zM3 3h1v1h-1zM8 3h1v1h-1zM4 4h1v1h-1zM7 4h1v1h-1zM5 5h2v1h-2zM5 6h2v1h-2zM4 7h1v1h-1zM7 7h1v1h-1zM3 8h1v1h-1zM8 8h1v1h-1zM2 9h1v1h-1zM9 9h1v1h-1zM1 10h1v1h-1zM10 10h1v1h-1z"
|
|
7
|
+
}, n = {
|
|
8
|
+
w: 12,
|
|
9
|
+
h: 12,
|
|
10
|
+
d: "M4 0h4v1h-4zM2 1h8v1h-8zM1 2h10v1h-10zM1 3h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86
|
+
d: "M7 2h1v1h-1zM7 3h2v1h-2zM7 4h3v1h-3zM3 5h8v1h-8zM3 6h9v1h-9zM3 7h10v1h-10zM3 8h10v1h-10zM3 9h9v1h-9zM3 10h8v1h-8zM7 11h3v1h-3zM7 12h2v1h-2zM7 13h1v1h-1z"
|
|
87
|
+
};
|
|
88
|
+
function S(t, n) {
|
|
89
|
+
return e`<svg
|
|
90
|
+
class=${n}
|
|
91
|
+
viewBox="0 0 ${t.w} ${t.h}"
|
|
92
|
+
fill="currentColor"
|
|
93
|
+
shape-rendering="crispEdges"
|
|
94
|
+
aria-hidden="true"
|
|
95
|
+
>
|
|
96
|
+
<path d=${t.d}></path>
|
|
97
|
+
</svg>`;
|
|
98
|
+
}
|
|
99
|
+
//#endregion
|
|
100
|
+
export { s as CARET_DOWN, c as CARET_UP, t as CHECKBOX_X, o as CHECKMARK, a as RADIO_DOT, n as RADIO_FACE, r as RADIO_RING, i as RADIO_RING_PRESSED, g as SCROLL_ARROW_DOWN, _ as SCROLL_ARROW_DOWN_FILL, v as SCROLL_ARROW_LEFT, y as SCROLL_ARROW_LEFT_FILL, b as SCROLL_ARROW_RIGHT, x as SCROLL_ARROW_RIGHT_FILL, m as SCROLL_ARROW_UP, h as SCROLL_ARROW_UP_FILL, u as SLIDER_THUMB, d as SLIDER_THUMB_FACE, l as STEPPER, p as STEPPER_DOWN_FILL, f as STEPPER_UP_FILL, S as glyphSvg };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Snap this component's paint to the device-pixel grid. One line per
|
|
4
|
+
* component, alongside `ScaleController`:
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* private readonly gridSnap = new GridSnapController(this)
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* The component's template must put the `vf-snap` class (see `vfBase`) on its
|
|
11
|
+
* top-level painted element(s); the host box is what gets measured, so an
|
|
12
|
+
* authored offset inside it (a toggle's centered box) stays put. Dormant
|
|
13
|
+
* until the app calls {@link applyGridSnap}, and skipped per-element by a
|
|
14
|
+
* `nosnap` attribute on the host.
|
|
15
|
+
*/
|
|
16
|
+
export declare class GridSnapController implements ReactiveController {
|
|
17
|
+
readonly host: ReactiveControllerHost & HTMLElement;
|
|
18
|
+
/** vf-* ancestors above this host; the sweep runs in ascending order. */
|
|
19
|
+
depth: number;
|
|
20
|
+
/** Our current correction, in CSS px. */
|
|
21
|
+
private applied;
|
|
22
|
+
/** Exactly what we last wrote, so an externally rewritten style attribute
|
|
23
|
+
* (a consumer framework re-templating `style`) is detected and rebased. */
|
|
24
|
+
private written;
|
|
25
|
+
constructor(host: ReactiveControllerHost & HTMLElement);
|
|
26
|
+
hostConnected(): void;
|
|
27
|
+
hostDisconnected(): void;
|
|
28
|
+
/** A render can change the host's size, and therefore where its edges land. */
|
|
29
|
+
hostUpdated(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Measure and correct. Runs from the shared sweep only.
|
|
32
|
+
*
|
|
33
|
+
* The HOST is what gets measured: its origin is the page's contribution,
|
|
34
|
+
* and the page's fraction is the whole fault being canceled. The paint
|
|
35
|
+
* roots consuming the variables sit at *authored* offsets inside the host —
|
|
36
|
+
* including deliberate half-pixel ones like a toggle's centered box — and
|
|
37
|
+
* measuring one of them would make the controller "correct" the component's
|
|
38
|
+
* own design. Because the host never moves from its own correction, the
|
|
39
|
+
* applied offset is folded into the error arithmetically rather than being
|
|
40
|
+
* expected in the measured rect; an ancestor's correction, which does move
|
|
41
|
+
* this host, is picked up the normal way.
|
|
42
|
+
*/
|
|
43
|
+
correct(dpr: number): void;
|
|
44
|
+
/** Drop the correction: delete the two variables and forget everything. */
|
|
45
|
+
reset(): void;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Opt the page into automatic device-pixel-grid snapping: every mounted
|
|
49
|
+
* component (and every one mounted afterwards) holds its paint on whole device
|
|
50
|
+
* pixels, whatever the surrounding layout does. Returns a cleanup function
|
|
51
|
+
* that turns it back off. Calls share one switch: snapping stays on until
|
|
52
|
+
* every caller's cleanup has run, and running a cleanup twice releases only
|
|
53
|
+
* once — so two widgets on one page can each opt in and out without turning
|
|
54
|
+
* the other's snapping off.
|
|
55
|
+
*
|
|
56
|
+
* ```ts
|
|
57
|
+
* import { applyGridSnap } from 'vintage-frames'
|
|
58
|
+
* applyGridSnap()
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* The whole footprint on your DOM is two reserved custom properties
|
|
62
|
+
* (`--vf-snap-dx`/`--vf-snap-dy`) on each corrected host's inline style; the
|
|
63
|
+
* offset they drive is applied inside the component's own shadow root. Worth
|
|
64
|
+
* knowing: a component's painted box can sit up to half a device pixel outside
|
|
65
|
+
* its layout box while corrected.
|
|
66
|
+
*/
|
|
67
|
+
export declare function applyGridSnap(): () => void;
|
|
68
|
+
/**
|
|
69
|
+
* Re-check every component before the next paint. Call it after moving
|
|
70
|
+
* components in a way nothing observable changed size — the one case the
|
|
71
|
+
* built-in triggers can't see. Free when nothing has actually moved.
|
|
72
|
+
*/
|
|
73
|
+
export declare function requestGridSnap(): void;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { truePixelRatio as e } from "./zoom.js";
|
|
2
|
+
import { onScaleChange as t } from "./scale.js";
|
|
3
|
+
//#region src/grid-snap.ts
|
|
4
|
+
var n = .05, r = 1 / 64, i = () => e() || 1, a = (e, t) => {
|
|
5
|
+
let n = e * t;
|
|
6
|
+
return n - Math.round(n);
|
|
7
|
+
}, o = (e) => Math.round(e / r) * r, s = new class {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.controllers = /* @__PURE__ */ new Set(), this.enabled = !1, this.frame = 0, this.teardown = [];
|
|
10
|
+
}
|
|
11
|
+
register(e) {
|
|
12
|
+
if (this.controllers.add(e), !this.enabled) {
|
|
13
|
+
e.reset();
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
this.resizes?.observe(e.host), this.request();
|
|
17
|
+
}
|
|
18
|
+
unregister(e) {
|
|
19
|
+
this.controllers.delete(e), this.resizes?.unobserve(e.host);
|
|
20
|
+
}
|
|
21
|
+
enable() {
|
|
22
|
+
this.enabled || typeof window > "u" || (this.enabled = !0, this.install(), this.request());
|
|
23
|
+
}
|
|
24
|
+
disable() {
|
|
25
|
+
if (this.enabled) {
|
|
26
|
+
this.enabled = !1, this.frame && cancelAnimationFrame(this.frame), this.frame = 0;
|
|
27
|
+
for (let e of this.teardown.splice(0)) e();
|
|
28
|
+
this.resizes?.disconnect(), this.resizes = void 0;
|
|
29
|
+
for (let e of this.controllers) e.reset();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
request() {
|
|
33
|
+
!this.enabled || this.frame || typeof window > "u" || (this.frame = requestAnimationFrame(() => {
|
|
34
|
+
this.frame = 0, this.sweep();
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
sweep() {
|
|
38
|
+
let e = i(), t = [...this.controllers].sort((e, t) => e.depth - t.depth);
|
|
39
|
+
for (let n of t) n.correct(e);
|
|
40
|
+
}
|
|
41
|
+
install() {
|
|
42
|
+
this.resizes = new ResizeObserver(() => this.request()), this.resizes.observe(document.documentElement);
|
|
43
|
+
for (let e of this.controllers) this.resizes.observe(e.host);
|
|
44
|
+
let e = () => this.request();
|
|
45
|
+
window.addEventListener("resize", e), window.addEventListener("orientationchange", e), window.addEventListener("scroll", e, {
|
|
46
|
+
capture: !0,
|
|
47
|
+
passive: !0
|
|
48
|
+
}), this.teardown.push(() => {
|
|
49
|
+
window.removeEventListener("resize", e), window.removeEventListener("orientationchange", e), window.removeEventListener("scroll", e, { capture: !0 });
|
|
50
|
+
});
|
|
51
|
+
let n = document.fonts;
|
|
52
|
+
n && (n.addEventListener("loadingdone", e), this.teardown.push(() => n.removeEventListener("loadingdone", e)), n.ready.then(e)), this.teardown.push(t(e));
|
|
53
|
+
let r = new MutationObserver(e);
|
|
54
|
+
r.observe(document.documentElement, {
|
|
55
|
+
subtree: !0,
|
|
56
|
+
attributes: !0,
|
|
57
|
+
attributeFilter: ["nosnap"]
|
|
58
|
+
}), this.teardown.push(() => r.disconnect());
|
|
59
|
+
}
|
|
60
|
+
}(), c = class {
|
|
61
|
+
constructor(e) {
|
|
62
|
+
this.host = e, this.depth = 0, this.applied = {
|
|
63
|
+
x: 0,
|
|
64
|
+
y: 0
|
|
65
|
+
}, this.written = {
|
|
66
|
+
x: "",
|
|
67
|
+
y: ""
|
|
68
|
+
}, e.addController(this);
|
|
69
|
+
}
|
|
70
|
+
hostConnected() {
|
|
71
|
+
this.depth = u(this.host), s.register(this);
|
|
72
|
+
}
|
|
73
|
+
hostDisconnected() {
|
|
74
|
+
s.unregister(this);
|
|
75
|
+
}
|
|
76
|
+
hostUpdated() {
|
|
77
|
+
s.request();
|
|
78
|
+
}
|
|
79
|
+
correct(e) {
|
|
80
|
+
let t = this.host;
|
|
81
|
+
if (t.hasAttribute("nosnap")) {
|
|
82
|
+
(this.written.x || this.written.y) && this.reset();
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
let r = t.getBoundingClientRect();
|
|
86
|
+
if (!r.width && !r.height) return;
|
|
87
|
+
let i = t.style;
|
|
88
|
+
(i.getPropertyValue("--vf-snap-dx") !== this.written.x || i.getPropertyValue("--vf-snap-dy") !== this.written.y) && (this.applied = {
|
|
89
|
+
x: 0,
|
|
90
|
+
y: 0
|
|
91
|
+
}, this.written = {
|
|
92
|
+
x: "",
|
|
93
|
+
y: ""
|
|
94
|
+
});
|
|
95
|
+
let s = a(r.left + this.applied.x, e), c = a(r.top + this.applied.y, e);
|
|
96
|
+
if (Math.abs(s) <= n && Math.abs(c) <= n) return;
|
|
97
|
+
let l = {
|
|
98
|
+
x: o(this.applied.x - s / e),
|
|
99
|
+
y: o(this.applied.y - c / e)
|
|
100
|
+
};
|
|
101
|
+
(l.x !== this.applied.x || l.y !== this.applied.y) && (this.applied = l, this.written = {
|
|
102
|
+
x: `${l.x}px`,
|
|
103
|
+
y: `${l.y}px`
|
|
104
|
+
}, i.setProperty("--vf-snap-dx", this.written.x), i.setProperty("--vf-snap-dy", this.written.y));
|
|
105
|
+
}
|
|
106
|
+
reset() {
|
|
107
|
+
this.host.style.removeProperty("--vf-snap-dx"), this.host.style.removeProperty("--vf-snap-dy"), this.applied = {
|
|
108
|
+
x: 0,
|
|
109
|
+
y: 0
|
|
110
|
+
}, this.written = {
|
|
111
|
+
x: "",
|
|
112
|
+
y: ""
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}, l = (e) => {
|
|
116
|
+
if (e.parentElement) return e.parentElement;
|
|
117
|
+
let t = e.getRootNode();
|
|
118
|
+
return t instanceof ShadowRoot ? t.host : null;
|
|
119
|
+
}, u = (e) => {
|
|
120
|
+
let t = 0;
|
|
121
|
+
for (let n = l(e); n; n = l(n)) n.tagName.toLowerCase().startsWith("vf-") && t++;
|
|
122
|
+
return t;
|
|
123
|
+
}, d = 0;
|
|
124
|
+
function f() {
|
|
125
|
+
d++, s.enable();
|
|
126
|
+
let e = !1;
|
|
127
|
+
return () => {
|
|
128
|
+
e || (e = !0, --d === 0 && s.disable());
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function p() {
|
|
132
|
+
s.request();
|
|
133
|
+
}
|
|
134
|
+
//#endregion
|
|
135
|
+
export { c as GridSnapController, f as applyGridSnap, p as requestGridSnap };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vintage Frames — Lit web components in the style of classic Mac OS System 7.
|
|
3
|
+
*
|
|
4
|
+
* Importing this module registers every element. Individual components can be
|
|
5
|
+
* imported from their own modules for finer-grained loading.
|
|
6
|
+
*
|
|
7
|
+
* Alongside the elements, the shared toolkit the components are built from is
|
|
8
|
+
* re-exported below: display scaling (`applyScale` and friends), the 1-bit
|
|
9
|
+
* style recipes, glyph sprites, pixel-stepped corner profiles, the behavior
|
|
10
|
+
* controllers, and the base classes — so an app can scale a page and author
|
|
11
|
+
* matching custom controls without reaching into `dist/` paths.
|
|
12
|
+
*/
|
|
13
|
+
export { VfDesktop } from './components/vf-desktop.js';
|
|
14
|
+
export { VfWindow } from './components/vf-window.js';
|
|
15
|
+
export { VfDialog } from './components/vf-dialog.js';
|
|
16
|
+
export { VfSeparator } from './components/vf-separator.js';
|
|
17
|
+
export { VfButton } from './components/vf-button.js';
|
|
18
|
+
export { VfButtonGroup } from './components/vf-button-group.js';
|
|
19
|
+
export { VfSwatch } from './components/vf-swatch.js';
|
|
20
|
+
export { VfCheckbox } from './components/vf-checkbox.js';
|
|
21
|
+
export { VfRadio } from './components/vf-radio.js';
|
|
22
|
+
export { VfRadioGroup } from './components/vf-radio-group.js';
|
|
23
|
+
export { VfTextField } from './components/vf-text-field.js';
|
|
24
|
+
export { VfTextArea } from './components/vf-text-area.js';
|
|
25
|
+
export { VfNumberField } from './components/vf-number-field.js';
|
|
26
|
+
export { VfSelect } from './components/vf-select.js';
|
|
27
|
+
export { VfOption } from './components/vf-option.js';
|
|
28
|
+
export { VfProgressBar } from './components/vf-progress-bar.js';
|
|
29
|
+
export { VfSlider } from './components/vf-slider.js';
|
|
30
|
+
export { VfLabel } from './components/vf-label.js';
|
|
31
|
+
export { VfParagraph } from './components/vf-paragraph.js';
|
|
32
|
+
export { VfImg } from './components/vf-img.js';
|
|
33
|
+
export { VfIcon } from './components/vf-icon.js';
|
|
34
|
+
export type { VfIconSize } from './components/vf-icon.js';
|
|
35
|
+
export { VfMenuBar } from './components/vf-menu-bar.js';
|
|
36
|
+
export { VfMenu } from './components/vf-menu.js';
|
|
37
|
+
export { VfMenuItem } from './components/vf-menu-item.js';
|
|
38
|
+
export { VfList } from './components/vf-list.js';
|
|
39
|
+
export { VfListItem } from './components/vf-list-item.js';
|
|
40
|
+
export { VfScrollArea } from './components/vf-scroll-area.js';
|
|
41
|
+
export { VfFieldset } from './components/vf-fieldset.js';
|
|
42
|
+
export { VfGrid } from './components/vf-grid.js';
|
|
43
|
+
export type { VfGridRules } from './components/vf-grid.js';
|
|
44
|
+
export { VfStack } from './components/vf-stack.js';
|
|
45
|
+
export type { VfStackDirection, VfStackPlace, } from './components/vf-stack.js';
|
|
46
|
+
export { VfContainer } from './components/vf-container.js';
|
|
47
|
+
/**
|
|
48
|
+
* Display scaling. `applyScale(document.documentElement)` is the one call an
|
|
49
|
+
* app makes to opt into true classic size (the whole device-px count nearest
|
|
50
|
+
* 1/72 inch on this display); the rest
|
|
51
|
+
* is the system↔CSS px conversion custom components need so their JS geometry
|
|
52
|
+
* stays in the same coordinate system as CSS.
|
|
53
|
+
*/
|
|
54
|
+
export { applyScale, ScaleController, effectiveScale, getScale, onScaleChange, sys, sysLength, sysLengths, toSys, snapToDevicePx, snapToSystemPx, snapSys, systemPxQuantum, toSysExact, CLASSIC_DPI, CSS_REFERENCE_DPI, SYSTEM_PX_IN_CSS_PX, } from './scale.js';
|
|
55
|
+
/**
|
|
56
|
+
* Browser-zoom tracking, the zoom half of display scaling: the kit follows the
|
|
57
|
+
* user's zoom by default (zoom multiplies the density the target is computed
|
|
58
|
+
* from), and these are the readouts a page or custom control needs to stay on
|
|
59
|
+
* the same grid —
|
|
60
|
+
* `truePixelRatio()` is device px per CSS px *including* zoom, the number
|
|
61
|
+
* `window.devicePixelRatio` stops being in Safari at any non-100% zoom.
|
|
62
|
+
* `resetZoomBaseline()` declares the current state to be 100%, for the one
|
|
63
|
+
* change the tracker cannot classify (a display-mode switch at an identical
|
|
64
|
+
* logical size).
|
|
65
|
+
*/
|
|
66
|
+
export { getZoom, truePixelRatio, onZoomChange, devicePxPerSystemPx, resetZoomBaseline, } from './zoom.js';
|
|
67
|
+
/**
|
|
68
|
+
* Automatic device-pixel-grid snapping. `applyGridSnap()` is the one call an
|
|
69
|
+
* app makes to have every component hold its own origin on whole device pixels
|
|
70
|
+
* whatever the surrounding layout does — the half of the layout contract the
|
|
71
|
+
* components can keep for you.
|
|
72
|
+
*/
|
|
73
|
+
export { applyGridSnap, requestGridSnap, GridSnapController, } from './grid-snap.js';
|
|
74
|
+
/**
|
|
75
|
+
* The page-drawn cursor. `applyCursor()` is the one call an app makes to
|
|
76
|
+
* replace the native pointer with the embedded System 7 set — arrow, I-beam,
|
|
77
|
+
* crosshair and wristwatch as pixel art locked to the system-pixel grid,
|
|
78
|
+
* with the classic XOR draw and an `aria-busy`-driven wait state — hiding
|
|
79
|
+
* the native pointer everywhere via the page blanket plus the `--vf-cursor`
|
|
80
|
+
* token (SPEC §3). Each kind's art is overridable with the consumer's own;
|
|
81
|
+
* the embedded set is exported alongside for remixing.
|
|
82
|
+
*/
|
|
83
|
+
export { applyCursor } from './cursor.js';
|
|
84
|
+
export type { VfCursorArt, VfCursorKind, VfCursorOptions } from './cursor.js';
|
|
85
|
+
export { CURSOR_ARROW, CURSOR_I_BEAM, CURSOR_CROSSHAIR, CURSOR_WAIT, } from './cursor-art.js';
|
|
86
|
+
/**
|
|
87
|
+
* The 1-bit style recipes. Compose them into a custom element's
|
|
88
|
+
* `static styles` to inherit the kit's type, panel frame, window chrome, focus
|
|
89
|
+
* ring, field well and System 7 scroll-rail skin.
|
|
90
|
+
*/
|
|
91
|
+
export { vfBase, vfBodyDecls, vfDisplay, vfDisplayDecls, vfStaticText, vfPanel, vfChromeFrame, vfModalFrame, vfTitleBar, vfWindowWidgets, vfHardShadowDecls, vfStripes, vfDots, vfFocus, vfFocusRing, vfFocusUnderline, vfToggle, vfField, vfScrollRail, vfTileSize, vfTileMaskSize, tileImage, tileRaster, tileRects, tileSpan, TILE_LATTICE, } from './styles/base.js';
|
|
92
|
+
export type { TileRect } from './styles/base.js';
|
|
93
|
+
/**
|
|
94
|
+
* The exact tiled fill (TILE-GRID-PLAN.md): a surface's own art as one
|
|
95
|
+
* whole-surface raster (`tileRaster` + the `vf-tile-raster` rules), and a
|
|
96
|
+
* consumer pattern token as a flat grid of absolutely placed tiles
|
|
97
|
+
* (`tileGrid()`), each box paint-snapped to the device grid on its own — so
|
|
98
|
+
* the fill stays 1-bit at the zoom-minted scales a CSS `background-repeat`
|
|
99
|
+
* length cannot hold. `vfTileGrid` carries the container and tile rules;
|
|
100
|
+
* `patternOverride` reads whether a token is in play; `TileRasterCache`
|
|
101
|
+
* memoizes the encoded raster against its size.
|
|
102
|
+
*/
|
|
103
|
+
export { vfTileGrid, tileGrid, patternOverride, TileRasterCache } from './tile-grid.js';
|
|
104
|
+
/** Glyph sprites (`glyphSvg(CHECKMARK, 'check')`) and their pixel geometry. */
|
|
105
|
+
export { glyphSvg, CHECKBOX_X, RADIO_FACE, RADIO_RING, RADIO_RING_PRESSED, RADIO_DOT, CHECKMARK, CARET_DOWN, STEPPER, STEPPER_UP_FILL, STEPPER_DOWN_FILL, SLIDER_THUMB, SLIDER_THUMB_FACE, } from './glyphs.js';
|
|
106
|
+
export type { Glyph } from './glyphs.js';
|
|
107
|
+
/** Pixel-stepped corner profiles and the clip-paths traced from them. */
|
|
108
|
+
export { steppedRectClip, steppedRingClip, steppedCornerClip, BUTTON_FRAME, BUTTON_FACE, RING_FRAME, RING_HOLE, RING_INSET, SCREEN_CORNER, } from './pixel-frame.js';
|
|
109
|
+
export type { SteppedProfile } from './pixel-frame.js';
|
|
110
|
+
/** Behavior helpers: pointer drag, overflow reporting, event dispatch, motion. */
|
|
111
|
+
export { DragController } from './drag.js';
|
|
112
|
+
export type { DragTarget } from './drag.js';
|
|
113
|
+
export { ScrollStateController } from './scroll-state.js';
|
|
114
|
+
export { ScrollRailController, renderScrollRail } from './scroll-rail.js';
|
|
115
|
+
export type { RailAxis, ScrollRailOptions } from './scroll-rail.js';
|
|
116
|
+
export { TrackWidthController } from './track-width.js';
|
|
117
|
+
export { DocumentListenersController } from './document-listeners.js';
|
|
118
|
+
export type { DocumentListenerSpec } from './document-listeners.js';
|
|
119
|
+
export { focusModality, trackFocusModality, FocusRuleController } from './focus-modality.js';
|
|
120
|
+
export type { FocusModality } from './focus-modality.js';
|
|
121
|
+
export { emit } from './events.js';
|
|
122
|
+
export { prefersReducedMotion, runSelectionBlink, BLINK_INTERVAL_MS, BLINK_FLIPS, PRESS_HOLD_MS, RENAME_DELAY_MS, } from './motion.js';
|
|
123
|
+
export type { BlinkHandle } from './motion.js';
|
|
124
|
+
/**
|
|
125
|
+
* Element registration. `vfElement` is the kit's `@customElement`: it registers
|
|
126
|
+
* through `defineElement`, which skips (and warns) rather than throwing when a
|
|
127
|
+
* second copy of the library claims a tag the page already has.
|
|
128
|
+
*/
|
|
129
|
+
export { defineElement, vfElement } from './define.js';
|
|
130
|
+
/** Base classes — extend these to author a custom `vf-*` control. */
|
|
131
|
+
export { VfFormControl } from './form-control.js';
|
|
132
|
+
export { VfTextControlBase } from './text-control.js';
|
|
133
|
+
export { VfToggleControl } from './toggle-control.js';
|
|
134
|
+
export type { VfToggleControlInterface } from './toggle-control.js';
|
|
135
|
+
export { PlacementController, VfPositioned } from './position.js';
|
|
136
|
+
export type { PlacementBounds, PlacementClamp, VfPositionedInterface } from './position.js';
|
|
137
|
+
export { VfSized } from './size.js';
|
|
138
|
+
export type { VfSizedInterface } from './size.js';
|
|
139
|
+
export { VfModalDialog, modalDialogStyles } from './modal-dialog.js';
|
|
140
|
+
export type { VfCloseReason } from './modal-dialog.js';
|
|
141
|
+
/** The embedded System 7 bitmap faces and the registration helper. */
|
|
142
|
+
export { registerEmbeddedFont, PIXEL_GRID_METRICS } from './styles/register-embedded-font.js';
|
|
143
|
+
export type { EmbeddedFontMetrics } from './styles/register-embedded-font.js';
|
|
144
|
+
export { registerDisplayFace, VF_DISPLAY_FAMILY } from './styles/display-font.js';
|
|
145
|
+
export { registerBodyFace, VF_BODY_FAMILY } from './styles/body-font.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { defineElement as e, vfElement as t } from "./define.js";
|
|
2
|
+
import { CLASSIC_DPI as n, CSS_REFERENCE_DPI as r, SYSTEM_PX_IN_CSS_PX as i, devicePxPerSystemPx as a, getZoom as o, onZoomChange as s, resetZoomBaseline as c, truePixelRatio as l } from "./zoom.js";
|
|
3
|
+
import { ScaleController as u, applyScale as d, effectiveScale as f, getScale as p, onScaleChange as m, snapSys as h, snapToDevicePx as g, snapToSystemPx as _, sys as v, sysLength as y, sysLengths as b, systemPxQuantum as x, toSys as S, toSysExact as C } from "./scale.js";
|
|
4
|
+
import { PlacementController as w, VfPositioned as T } from "./position.js";
|
|
5
|
+
import { PIXEL_GRID_METRICS as E, registerEmbeddedFont as D } from "./styles/register-embedded-font.js";
|
|
6
|
+
import { VF_BODY_FAMILY as O, registerBodyFace as k } from "./styles/body-font.js";
|
|
7
|
+
import { vfBodyDecls as A } from "./styles/recipes/body-face.js";
|
|
8
|
+
import { VF_DISPLAY_FAMILY as j, registerDisplayFace as M } from "./styles/display-font.js";
|
|
9
|
+
import { vfDisplay as N, vfDisplayDecls as P } from "./styles/recipes/display-face.js";
|
|
10
|
+
import { vfBase as F } from "./styles/recipes/host.js";
|
|
11
|
+
import { vfStaticText as I } from "./styles/recipes/static-text.js";
|
|
12
|
+
import { TILE_LATTICE as L, tileImage as R, tileRaster as z, tileRects as B, tileSpan as V, vfTileMaskSize as H, vfTileSize as U } from "./styles/recipes/tile.js";
|
|
13
|
+
import { vfDots as W, vfStripes as G } from "./styles/recipes/pattern.js";
|
|
14
|
+
import { vfHardShadowDecls as K } from "./styles/recipes/shadow.js";
|
|
15
|
+
import { vfChromeFrame as q, vfModalFrame as J, vfPanel as Y } from "./styles/recipes/surface.js";
|
|
16
|
+
import { vfTitleBar as X, vfWindowWidgets as Z } from "./styles/recipes/title-bar.js";
|
|
17
|
+
import { vfFocus as Q, vfFocusRing as $, vfFocusUnderline as ee } from "./styles/recipes/focus.js";
|
|
18
|
+
import { vfToggle as te } from "./styles/recipes/toggle.js";
|
|
19
|
+
import { vfField as ne } from "./styles/recipes/field.js";
|
|
20
|
+
import { vfScrollRail as re } from "./styles/recipes/scroll-rail.js";
|
|
21
|
+
import { TileRasterCache as ie, patternOverride as ae, tileGrid as oe, vfTileGrid as se } from "./tile-grid.js";
|
|
22
|
+
import { GridSnapController as ce, applyGridSnap as le, requestGridSnap as ue } from "./grid-snap.js";
|
|
23
|
+
import { DocumentListenersController as de } from "./document-listeners.js";
|
|
24
|
+
import { BUTTON_FACE as fe, BUTTON_FRAME as pe, RING_FRAME as me, RING_HOLE as he, RING_INSET as ge, SCREEN_CORNER as _e, steppedCornerClip as ve, steppedRectClip as ye, steppedRingClip as be } from "./pixel-frame.js";
|
|
25
|
+
import { VfDesktop as xe } from "./components/vf-desktop.js";
|
|
26
|
+
import { VfSized as Se } from "./size.js";
|
|
27
|
+
import { DragController as Ce } from "./drag.js";
|
|
28
|
+
import { emit as we } from "./events.js";
|
|
29
|
+
import { ScrollStateController as Te } from "./scroll-state.js";
|
|
30
|
+
import { BLINK_FLIPS as Ee, BLINK_INTERVAL_MS as De, PRESS_HOLD_MS as Oe, RENAME_DELAY_MS as ke, prefersReducedMotion as Ae, runSelectionBlink as je } from "./motion.js";
|
|
31
|
+
import { CARET_DOWN as Me, CHECKBOX_X as Ne, CHECKMARK as Pe, RADIO_DOT as Fe, RADIO_FACE as Ie, RADIO_RING as Le, RADIO_RING_PRESSED as Re, SLIDER_THUMB as ze, SLIDER_THUMB_FACE as Be, STEPPER as Ve, STEPPER_DOWN_FILL as He, STEPPER_UP_FILL as Ue, glyphSvg as We } from "./glyphs.js";
|
|
32
|
+
import { ScrollRailController as Ge, renderScrollRail as Ke } from "./scroll-rail.js";
|
|
33
|
+
import { VfScrollArea as qe } from "./components/vf-scroll-area.js";
|
|
34
|
+
import { VfWindow as Je } from "./components/vf-window.js";
|
|
35
|
+
import { VfModalDialog as Ye, modalDialogStyles as Xe } from "./modal-dialog.js";
|
|
36
|
+
import { VfButtonGroup as Ze } from "./components/vf-button-group.js";
|
|
37
|
+
import { VfDialog as Qe } from "./components/vf-dialog.js";
|
|
38
|
+
import { VfSeparator as $e } from "./components/vf-separator.js";
|
|
39
|
+
import { VfFormControl as et } from "./form-control.js";
|
|
40
|
+
import { VfButton as tt } from "./components/vf-button.js";
|
|
41
|
+
import { VfSwatch as nt } from "./components/vf-swatch.js";
|
|
42
|
+
import { VfToggleControl as rt } from "./toggle-control.js";
|
|
43
|
+
import { VfCheckbox as it } from "./components/vf-checkbox.js";
|
|
44
|
+
import { VfRadio as at } from "./components/vf-radio.js";
|
|
45
|
+
import { VfRadioGroup as ot } from "./components/vf-radio-group.js";
|
|
46
|
+
import { FocusRuleController as st, focusModality as ct, trackFocusModality as lt } from "./focus-modality.js";
|
|
47
|
+
import { VfTextControlBase as ut } from "./text-control.js";
|
|
48
|
+
import { VfTextField as dt } from "./components/vf-text-field.js";
|
|
49
|
+
import { VfTextArea as ft } from "./components/vf-text-area.js";
|
|
50
|
+
import { VfNumberField as pt } from "./components/vf-number-field.js";
|
|
51
|
+
import { VfOption as mt } from "./components/vf-option.js";
|
|
52
|
+
import { VfSelect as ht } from "./components/vf-select.js";
|
|
53
|
+
import { TrackWidthController as gt } from "./track-width.js";
|
|
54
|
+
import { VfProgressBar as _t } from "./components/vf-progress-bar.js";
|
|
55
|
+
import { VfSlider as vt } from "./components/vf-slider.js";
|
|
56
|
+
import { VfLabel as yt } from "./components/vf-label.js";
|
|
57
|
+
import { VfParagraph as bt } from "./components/vf-paragraph.js";
|
|
58
|
+
import { VfImg as xt } from "./components/vf-img.js";
|
|
59
|
+
import { VfIcon as St } from "./components/vf-icon.js";
|
|
60
|
+
import { VfMenuBar as Ct } from "./components/vf-menu-bar.js";
|
|
61
|
+
import { VfMenu as wt } from "./components/vf-menu.js";
|
|
62
|
+
import { VfMenuItem as Tt } from "./components/vf-menu-item.js";
|
|
63
|
+
import { VfList as Et } from "./components/vf-list.js";
|
|
64
|
+
import { VfListItem as Dt } from "./components/vf-list-item.js";
|
|
65
|
+
import { VfFieldset as Ot } from "./components/vf-fieldset.js";
|
|
66
|
+
import { VfGrid as kt } from "./components/vf-grid.js";
|
|
67
|
+
import { VfStack as At } from "./components/vf-stack.js";
|
|
68
|
+
import { VfContainer as jt } from "./components/vf-container.js";
|
|
69
|
+
import { CURSOR_ARROW as Mt, CURSOR_CROSSHAIR as Nt, CURSOR_I_BEAM as Pt, CURSOR_WAIT as Ft } from "./cursor-art.js";
|
|
70
|
+
import { applyCursor as It } from "./cursor.js";
|
|
71
|
+
export { Ee as BLINK_FLIPS, De as BLINK_INTERVAL_MS, fe as BUTTON_FACE, pe as BUTTON_FRAME, Me as CARET_DOWN, Ne as CHECKBOX_X, Pe as CHECKMARK, n as CLASSIC_DPI, r as CSS_REFERENCE_DPI, Mt as CURSOR_ARROW, Nt as CURSOR_CROSSHAIR, Pt as CURSOR_I_BEAM, Ft as CURSOR_WAIT, de as DocumentListenersController, Ce as DragController, st as FocusRuleController, ce as GridSnapController, E as PIXEL_GRID_METRICS, Oe as PRESS_HOLD_MS, w as PlacementController, Fe as RADIO_DOT, Ie as RADIO_FACE, Le as RADIO_RING, Re as RADIO_RING_PRESSED, ke as RENAME_DELAY_MS, me as RING_FRAME, he as RING_HOLE, ge as RING_INSET, _e as SCREEN_CORNER, ze as SLIDER_THUMB, Be as SLIDER_THUMB_FACE, Ve as STEPPER, He as STEPPER_DOWN_FILL, Ue as STEPPER_UP_FILL, i as SYSTEM_PX_IN_CSS_PX, u as ScaleController, Ge as ScrollRailController, Te as ScrollStateController, L as TILE_LATTICE, ie as TileRasterCache, gt as TrackWidthController, O as VF_BODY_FAMILY, j as VF_DISPLAY_FAMILY, tt as VfButton, Ze as VfButtonGroup, it as VfCheckbox, jt as VfContainer, xe as VfDesktop, Qe as VfDialog, Ot as VfFieldset, et as VfFormControl, kt as VfGrid, St as VfIcon, xt as VfImg, yt as VfLabel, Et as VfList, Dt as VfListItem, wt as VfMenu, Ct as VfMenuBar, Tt as VfMenuItem, Ye as VfModalDialog, pt as VfNumberField, mt as VfOption, bt as VfParagraph, T as VfPositioned, _t as VfProgressBar, at as VfRadio, ot as VfRadioGroup, qe as VfScrollArea, ht as VfSelect, $e as VfSeparator, Se as VfSized, vt as VfSlider, At as VfStack, nt as VfSwatch, ft as VfTextArea, ut as VfTextControlBase, dt as VfTextField, rt as VfToggleControl, Je as VfWindow, It as applyCursor, le as applyGridSnap, d as applyScale, e as defineElement, a as devicePxPerSystemPx, f as effectiveScale, we as emit, ct as focusModality, p as getScale, o as getZoom, We as glyphSvg, Xe as modalDialogStyles, m as onScaleChange, s as onZoomChange, ae as patternOverride, Ae as prefersReducedMotion, k as registerBodyFace, M as registerDisplayFace, D as registerEmbeddedFont, Ke as renderScrollRail, ue as requestGridSnap, c as resetZoomBaseline, je as runSelectionBlink, h as snapSys, g as snapToDevicePx, _ as snapToSystemPx, ve as steppedCornerClip, ye as steppedRectClip, be as steppedRingClip, v as sys, y as sysLength, b as sysLengths, x as systemPxQuantum, oe as tileGrid, R as tileImage, z as tileRaster, B as tileRects, V as tileSpan, S as toSys, C as toSysExact, lt as trackFocusModality, l as truePixelRatio, F as vfBase, A as vfBodyDecls, q as vfChromeFrame, N as vfDisplay, P as vfDisplayDecls, W as vfDots, t as vfElement, ne as vfField, Q as vfFocus, $ as vfFocusRing, ee as vfFocusUnderline, K as vfHardShadowDecls, J as vfModalFrame, Y as vfPanel, re as vfScrollRail, I as vfStaticText, G as vfStripes, se as vfTileGrid, H as vfTileMaskSize, U as vfTileSize, X as vfTitleBar, te as vfToggle, Z as vfWindowWidgets };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
import type { VfMenu } from './components/vf-menu.js';
|
|
3
|
+
/**
|
|
4
|
+
* The coordinating side of a menu press — supplied by whoever owns the set of
|
|
5
|
+
* menus the gesture may travel across: `vf-menu-bar` for a bar of menus, the
|
|
6
|
+
* `vf-menu` itself when it stands alone. The controller never reaches for a
|
|
7
|
+
* parent or a sibling itself, so the bar keeps owning open state exactly as it
|
|
8
|
+
* does for click and keyboard input.
|
|
9
|
+
*/
|
|
10
|
+
export interface MenuPressTarget {
|
|
11
|
+
/** The menus the press may travel between, in bar order. */
|
|
12
|
+
menus(): readonly VfMenu[];
|
|
13
|
+
/** Drop `menu`'s panel, closing any sibling (the bar's single-open rule). */
|
|
14
|
+
open(menu: VfMenu): void;
|
|
15
|
+
/** Close the open menu with no selection. */
|
|
16
|
+
close(): void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The System 7 press-drag-release gesture for pull-down menus — the same
|
|
20
|
+
* mechanic `vf-select` uses for its popup, and the way the real menu bar was
|
|
21
|
+
* driven: **press a title, keep the button down, slide onto a command, release
|
|
22
|
+
* over it to run it.** Sliding sideways onto another title switches menus
|
|
23
|
+
* mid-press; releasing over a disabled row, a separator, the title, or off the
|
|
24
|
+
* menu entirely closes with nothing chosen (the classic "release outside"
|
|
25
|
+
* cancel).
|
|
26
|
+
*
|
|
27
|
+
* The modern click-to-open style coexists, disambiguated by the gesture itself
|
|
28
|
+
* and resolved at the first release: a quick in-place tap on a title (under
|
|
29
|
+
* {@link PRESS_HOLD_MS}) leaves the menu dropped for a second, independent
|
|
30
|
+
* click, while a held in-place press closes it. Time is consulted *only* for an
|
|
31
|
+
* in-place release — any press that travels to another title or row is a
|
|
32
|
+
* drag-pick however long it took.
|
|
33
|
+
*
|
|
34
|
+
* Everything is hit-tested by **coordinates**, not by event target, for the
|
|
35
|
+
* same reason `vf-select` is: under touch, the pointer is implicitly captured
|
|
36
|
+
* by the element the gesture started on, so every move and the release itself
|
|
37
|
+
* are delivered to the pressed title no matter what they are actually over.
|
|
38
|
+
*
|
|
39
|
+
* The host binds {@link onPointerDown} to a `pointerdown` on itself — presses
|
|
40
|
+
* on titles and rows both bubble up composed — and supplies a
|
|
41
|
+
* {@link MenuPressTarget}. Everything else (tracking to the release anywhere on
|
|
42
|
+
* the page, the row highlight, classification) lives here.
|
|
43
|
+
*/
|
|
44
|
+
export declare class MenuPressController implements ReactiveController {
|
|
45
|
+
#private;
|
|
46
|
+
private readonly target;
|
|
47
|
+
constructor(host: ReactiveControllerHost, target: MenuPressTarget);
|
|
48
|
+
/**
|
|
49
|
+
* Host torn down mid-gesture. The listener controller detaches itself; drop
|
|
50
|
+
* the press state and any highlight it stamped on a row, which the normal
|
|
51
|
+
* close path is no longer going to run for.
|
|
52
|
+
*/
|
|
53
|
+
hostDisconnected(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Starts a press: drops the menu under the pointer if it isn't already, then
|
|
56
|
+
* tracks the press to its release. Both interaction styles begin here; the
|
|
57
|
+
* gesture is classified in {@link #onPointerUp}.
|
|
58
|
+
*/
|
|
59
|
+
onPointerDown: (event: PointerEvent) => void;
|
|
60
|
+
}
|