vintage-frames 0.12.7 → 0.13.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 +19 -19
- package/dist/chrome.d.ts +1 -1
- package/dist/components/vf-container.d.ts +5 -7
- package/dist/components/vf-container.js +1 -5
- package/dist/components/vf-desktop.d.ts +4 -5
- package/dist/components/vf-desktop.js +13 -18
- package/dist/components/vf-progress-bar.d.ts +2 -2
- package/dist/components/vf-progress-bar.js +55 -41
- package/dist/components/vf-slider.js +11 -11
- package/dist/components/vf-swatch.d.ts +2 -2
- package/dist/components/vf-swatch.js +37 -38
- package/dist/components/vf-window.d.ts +6 -9
- package/dist/components/vf-window.js +76 -77
- package/dist/index.d.ts +10 -9
- package/dist/index.js +62 -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/recipes/pattern.d.ts +19 -10
- package/dist/styles/recipes/pattern.js +27 -18
- package/dist/styles/recipes/scroll-rail.d.ts +14 -7
- package/dist/styles/recipes/scroll-rail.js +14 -24
- package/dist/styles/recipes/tile.d.ts +11 -3
- package/dist/styles/recipes/tile.js +12 -12
- package/dist/tile-grid.d.ts +98 -64
- package/dist/tile-grid.js +63 -30
- package/dist/track-width.d.ts +1 -2
- package/docs/SPEC.md +11 -11
- package/editor/vscode.html-custom-data.json +2 -2
- package/editor/web-types.json +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11,65 +11,65 @@ import { vfDisplay as P, vfDisplayDecls as F } from "./styles/recipes/display-fa
|
|
|
11
11
|
import { vfBase as I } from "./styles/recipes/host.js";
|
|
12
12
|
import { vfStaticText as L } from "./styles/recipes/static-text.js";
|
|
13
13
|
import { TILE_LATTICE as R, tileImage as z, tileRaster as B, tileRects as V, tileSpan as H, vfTileMaskSize as U, vfTileSize as W } from "./styles/recipes/tile.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import { VfProgressBar as
|
|
58
|
-
import { VfSlider as
|
|
59
|
-
import { VfLabel as
|
|
60
|
-
import { VfParagraph as
|
|
61
|
-
import { VfImg as
|
|
62
|
-
import { VfIcon as
|
|
63
|
-
import { VfIconField as
|
|
64
|
-
import { VfMenuBar as
|
|
65
|
-
import { VfMenu as
|
|
66
|
-
import { VfMenuItem as
|
|
67
|
-
import { VfList as
|
|
68
|
-
import { VfListItem as
|
|
69
|
-
import { VfFieldset as
|
|
70
|
-
import { VfGrid as
|
|
71
|
-
import { VfStack as
|
|
72
|
-
import { VfContainer as
|
|
73
|
-
import { CURSOR_ARROW as
|
|
74
|
-
import { applyCursor as
|
|
75
|
-
export {
|
|
14
|
+
import { REPEAT_TILE as G, RepeatTileController as K, devicePxAt as q, patternOverride as J, repeatTile as Y, tileGrid as X, vfRepeatTileSize as Z, vfTileGrid as Q } from "./tile-grid.js";
|
|
15
|
+
import { PATTERNS as $, PATTERN_NAMES as ee, PATTERN_SIZE as te, parsePattern as ne, patternHex as re, patternMotif as ie, patternRects as ae } from "./patterns.js";
|
|
16
|
+
import { vfDots as oe, vfStripes as se } from "./styles/recipes/pattern.js";
|
|
17
|
+
import { vfHardShadowDecls as ce } from "./styles/recipes/shadow.js";
|
|
18
|
+
import { vfChromeFrame as le, vfModalFrame as ue, vfPanel as de } from "./styles/recipes/surface.js";
|
|
19
|
+
import { RULE_EDGES as fe, parseRule as pe, ruleClasses as me, vfRule as he } from "./styles/recipes/rule.js";
|
|
20
|
+
import { vfTitleBar as ge, vfWindowWidgets as _e } from "./styles/recipes/title-bar.js";
|
|
21
|
+
import { vfFocus as ve, vfFocusRing as ye, vfFocusUnderline as be } from "./styles/recipes/focus.js";
|
|
22
|
+
import { vfToggle as xe } from "./styles/recipes/toggle.js";
|
|
23
|
+
import { vfField as Se } from "./styles/recipes/field.js";
|
|
24
|
+
import { vfScrollRail as Ce } from "./styles/recipes/scroll-rail.js";
|
|
25
|
+
import { PatternFillController as we, vfPatternFill as Te } from "./pattern-fill.js";
|
|
26
|
+
import { GridSnapController as Ee, requestGridSnap as De } from "./grid-snap.js";
|
|
27
|
+
import { DocumentListenersController as Oe } from "./document-listeners.js";
|
|
28
|
+
import { BUTTON_FACE as ke, BUTTON_FRAME as Ae, RING_FRAME as je, RING_HOLE as Me, RING_INSET as Ne, SCREEN_CORNER as Pe, steppedCornerClip as Fe, steppedRectClip as Ie, steppedRingClip as Le } from "./pixel-frame.js";
|
|
29
|
+
import { VfDesktop as Re } from "./components/vf-desktop.js";
|
|
30
|
+
import { VfSized as ze } from "./size.js";
|
|
31
|
+
import { DragController as Be } from "./drag.js";
|
|
32
|
+
import { BLINK_FLIPS as Ve, BLINK_INTERVAL_MS as He, DRAG_SLOP_COARSE_PX as Ue, DRAG_SLOP_PX as We, PRESS_HOLD_MS as Ge, RENAME_DELAY_MS as Ke, TAP_PAIR_MS as qe, TAP_PAIR_SLOP_PX as Je, WALK_BEAT_MS as Ye, WALK_STEP_MS as Xe, WALK_STEP_PX as Ze, WINDOW_RECTS_VISIBLE as Qe, WINDOW_RECT_RATIO as $e, WINDOW_RECT_STEPS as et, WINDOW_RECT_STEP_MS as tt, dragSlop as nt, prefersReducedMotion as rt, runOutlineTravel as it, runSelectionBlink as at, windowRectFraction as ot } from "./motion.js";
|
|
33
|
+
import { ScrollStateController as st } from "./scroll-state.js";
|
|
34
|
+
import { CARET_DOWN as ct, CARET_DOWN_SMALL as lt, CHECKBOX_X as ut, CHECKMARK as dt, RADIO_DOT as ft, RADIO_FACE as pt, RADIO_RING as mt, RADIO_RING_PRESSED as ht, SLIDER_THUMB as gt, SLIDER_THUMB_FACE as _t, STEPPER as vt, STEPPER_DOWN_FILL as yt, STEPPER_UP_FILL as bt, glyphSvg as xt } from "./glyphs.js";
|
|
35
|
+
import { ScrollRailController as St, renderScrollRail as Ct } from "./scroll-rail.js";
|
|
36
|
+
import { VfScrollArea as wt } from "./components/vf-scroll-area.js";
|
|
37
|
+
import { VfWindow as Tt } from "./components/vf-window.js";
|
|
38
|
+
import { VfModalDialog as Et, modalDialogStyles as Dt } from "./modal-dialog.js";
|
|
39
|
+
import { VfDialog as Ot } from "./components/vf-dialog.js";
|
|
40
|
+
import { VfSeparator as kt } from "./components/vf-separator.js";
|
|
41
|
+
import { VfFormControl as At } from "./form-control.js";
|
|
42
|
+
import { VfButton as jt } from "./components/vf-button.js";
|
|
43
|
+
import { VfButtonGroup as Mt } from "./components/vf-button-group.js";
|
|
44
|
+
import { VfSwatch as Nt } from "./components/vf-swatch.js";
|
|
45
|
+
import { VfToggleControl as Pt } from "./toggle-control.js";
|
|
46
|
+
import { VfCheckbox as Ft } from "./components/vf-checkbox.js";
|
|
47
|
+
import { VfRadio as It } from "./components/vf-radio.js";
|
|
48
|
+
import { VfRadioGroup as Lt } from "./components/vf-radio-group.js";
|
|
49
|
+
import { FocusRuleController as Rt, focusModality as zt, trackFocusModality as Bt } from "./focus-modality.js";
|
|
50
|
+
import { VfTextControlBase as Vt } from "./text-control.js";
|
|
51
|
+
import { VfTextField as Ht } from "./components/vf-text-field.js";
|
|
52
|
+
import { VfTextArea as Ut } from "./components/vf-text-area.js";
|
|
53
|
+
import { VfNumberField as Wt } from "./components/vf-number-field.js";
|
|
54
|
+
import { VfOption as Gt } from "./components/vf-option.js";
|
|
55
|
+
import { VfSelect as Kt } from "./components/vf-select.js";
|
|
56
|
+
import { TrackWidthController as qt } from "./track-width.js";
|
|
57
|
+
import { VfProgressBar as Jt } from "./components/vf-progress-bar.js";
|
|
58
|
+
import { VfSlider as Yt } from "./components/vf-slider.js";
|
|
59
|
+
import { VfLabel as Xt } from "./components/vf-label.js";
|
|
60
|
+
import { VfParagraph as Zt } from "./components/vf-paragraph.js";
|
|
61
|
+
import { VfImg as Qt } from "./components/vf-img.js";
|
|
62
|
+
import { VfIcon as $t } from "./components/vf-icon.js";
|
|
63
|
+
import { VfIconField as en } from "./components/vf-icon-field.js";
|
|
64
|
+
import { VfMenuBar as tn } from "./components/vf-menu-bar.js";
|
|
65
|
+
import { VfMenu as nn } from "./components/vf-menu.js";
|
|
66
|
+
import { VfMenuItem as rn } from "./components/vf-menu-item.js";
|
|
67
|
+
import { VfList as an } from "./components/vf-list.js";
|
|
68
|
+
import { VfListItem as on } from "./components/vf-list-item.js";
|
|
69
|
+
import { VfFieldset as sn } from "./components/vf-fieldset.js";
|
|
70
|
+
import { VfGrid as cn } from "./components/vf-grid.js";
|
|
71
|
+
import { VfStack as ln } from "./components/vf-stack.js";
|
|
72
|
+
import { VfContainer as un } from "./components/vf-container.js";
|
|
73
|
+
import { CURSOR_ARROW as dn, CURSOR_CROSSHAIR as fn, CURSOR_I_BEAM as pn, CURSOR_WAIT as mn } from "./cursor-art.js";
|
|
74
|
+
import { applyCursor as hn } from "./cursor.js";
|
|
75
|
+
export { Ve as BLINK_FLIPS, He as BLINK_INTERVAL_MS, ke as BUTTON_FACE, Ae as BUTTON_FRAME, ct as CARET_DOWN, lt as CARET_DOWN_SMALL, ut as CHECKBOX_X, dt as CHECKMARK, r as CLASSIC_DPI, i as CSS_REFERENCE_DPI, dn as CURSOR_ARROW, fn as CURSOR_CROSSHAIR, pn as CURSOR_I_BEAM, mn as CURSOR_WAIT, Ue as DRAG_SLOP_COARSE_PX, We as DRAG_SLOP_PX, Oe as DocumentListenersController, Be as DragController, Rt as FocusRuleController, Ee as GridSnapController, $ as PATTERNS, ee as PATTERN_NAMES, te as PATTERN_SIZE, D as PIXEL_GRID_METRICS, Ge as PRESS_HOLD_MS, we as PatternFillController, T as PlacementController, ft as RADIO_DOT, pt as RADIO_FACE, mt as RADIO_RING, ht as RADIO_RING_PRESSED, Ke as RENAME_DELAY_MS, G as REPEAT_TILE, je as RING_FRAME, Me as RING_HOLE, Ne as RING_INSET, fe as RULE_EDGES, K as RepeatTileController, Pe as SCREEN_CORNER, gt as SLIDER_THUMB, _t as SLIDER_THUMB_FACE, vt as STEPPER, yt as STEPPER_DOWN_FILL, bt as STEPPER_UP_FILL, a as SYSTEM_PX_IN_CSS_PX, d as ScaleController, St as ScrollRailController, st as ScrollStateController, qe as TAP_PAIR_MS, Je as TAP_PAIR_SLOP_PX, R as TILE_LATTICE, qt as TrackWidthController, k as VF_BODY_FAMILY, M as VF_DISPLAY_FAMILY, jt as VfButton, Mt as VfButtonGroup, Ft as VfCheckbox, un as VfContainer, Re as VfDesktop, Ot as VfDialog, sn as VfFieldset, At as VfFormControl, cn as VfGrid, $t as VfIcon, en as VfIconField, Qt as VfImg, Xt as VfLabel, an as VfList, on as VfListItem, nn as VfMenu, tn as VfMenuBar, rn as VfMenuItem, Et as VfModalDialog, Wt as VfNumberField, Gt as VfOption, Zt as VfParagraph, E as VfPositioned, Jt as VfProgressBar, It as VfRadio, Lt as VfRadioGroup, wt as VfScrollArea, Kt as VfSelect, kt as VfSeparator, ze as VfSized, Yt as VfSlider, ln as VfStack, Nt as VfSwatch, Ut as VfTextArea, Vt as VfTextControlBase, Ht as VfTextField, Pt as VfToggleControl, Tt as VfWindow, Ye as WALK_BEAT_MS, Xe as WALK_STEP_MS, Ze as WALK_STEP_PX, Qe as WINDOW_RECTS_VISIBLE, $e as WINDOW_RECT_RATIO, et as WINDOW_RECT_STEPS, tt as WINDOW_RECT_STEP_MS, hn as applyCursor, f as applyScale, t as defineElement, q as devicePxAt, o as devicePxPerSystemPx, nt as dragSlop, p as effectiveScale, e as emit, zt as focusModality, m as getScale, s as getZoom, xt as glyphSvg, Dt as modalDialogStyles, h as onScaleChange, c as onZoomChange, ne as parsePattern, pe as parseRule, re as patternHex, ie as patternMotif, J as patternOverride, ae as patternRects, rt as prefersReducedMotion, A as registerBodyFace, N as registerDisplayFace, O as registerEmbeddedFont, Ct as renderScrollRail, Y as repeatTile, De as requestGridSnap, l as resetZoomBaseline, me as ruleClasses, it as runOutlineTravel, at as runSelectionBlink, g as snapSys, _ as snapToDevicePx, v as snapToSystemPx, Fe as steppedCornerClip, Ie as steppedRectClip, Le as steppedRingClip, y as sys, b as sysLength, x as sysLengths, S as systemPxQuantum, X as tileGrid, z as tileImage, B as tileRaster, V as tileRects, H as tileSpan, C as toSys, w as toSysExact, Bt as trackFocusModality, u as truePixelRatio, I as vfBase, j as vfBodyDecls, le as vfChromeFrame, P as vfDisplay, F as vfDisplayDecls, oe as vfDots, n as vfElement, Se as vfField, ve as vfFocus, ye as vfFocusRing, be as vfFocusUnderline, ce as vfHardShadowDecls, ue as vfModalFrame, de as vfPanel, Te as vfPatternFill, Z as vfRepeatTileSize, he as vfRule, Ce as vfScrollRail, L as vfStaticText, se as vfStripes, Q as vfTileGrid, U as vfTileMaskSize, W as vfTileSize, ge as vfTitleBar, xe as vfToggle, _e as vfWindowWidgets, ot as windowRectFraction };
|
package/dist/pattern-fill.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type CSSResult, type
|
|
1
|
+
import { type CSSResult, type ReactiveControllerHost } from 'lit';
|
|
2
|
+
import { RepeatTileController } from './tile-grid.js';
|
|
2
3
|
import { type Pattern } from './patterns.js';
|
|
3
4
|
/** What a component hands the controller. */
|
|
4
5
|
export interface PatternFillOptions {
|
|
@@ -8,31 +9,14 @@ export interface PatternFillOptions {
|
|
|
8
9
|
/** The resolved pattern, or null to paint nothing ({@link parsePattern}
|
|
9
10
|
* turns an attribute value into one). */
|
|
10
11
|
getPattern: () => Pattern | null | undefined;
|
|
11
|
-
/**
|
|
12
|
-
* The box's declared size in system px, per axis. A declared axis is used
|
|
13
|
-
* as it is — exact, and free of any measurement; an axis left `null` or
|
|
14
|
-
* `undefined` is measured off the box instead (a `ResizeObserver`,
|
|
15
|
-
* `toSys`-rounded). Omit the whole option to measure both.
|
|
16
|
-
*/
|
|
17
|
-
getSize?: () => {
|
|
18
|
-
width?: number | null;
|
|
19
|
-
height?: number | null;
|
|
20
|
-
} | null | undefined;
|
|
21
12
|
}
|
|
22
13
|
/**
|
|
23
14
|
* Paints a {@link Pattern} as a box's own background — the fill behind
|
|
24
|
-
* `vf-container pattern="…"` and `vf-desktop pattern="…"
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* ceiled up to whole pattern cells plus one cell of overdraw, and stretched
|
|
30
|
-
* onto that stated size under `image-rendering: pixelated`. Nearest-neighbor
|
|
31
|
-
* sampling can only emit source colors and one image has no interior seams,
|
|
32
|
-
* so the fill is 1-bit at every density and zoom — the same argument the
|
|
33
|
-
* desktop dither rests on. A `background-size` stated in system px is one
|
|
34
|
-
* stored length quantized once over the whole image (≤ 1/128 CSS px), not a
|
|
35
|
-
* repeat, and the box's background painting area crops the overdraw.
|
|
15
|
+
* `vf-container pattern="…"` and `vf-desktop pattern="…"`: the pattern's
|
|
16
|
+
* motif as a repeating tile drawn at the display's resolution
|
|
17
|
+
* ({@link RepeatTileController}, src/tile-grid.ts), 1-bit at every density
|
|
18
|
+
* and zoom, and the same cost for a box of any size — a resize encodes
|
|
19
|
+
* nothing.
|
|
36
20
|
*
|
|
37
21
|
* A background rather than a child element, on purpose: it paints below all
|
|
38
22
|
* content by definition — no `isolation: isolate` + `z-index: -1`, so a
|
|
@@ -44,46 +28,33 @@ export interface PatternFillOptions {
|
|
|
44
28
|
* on the box only while patterned and hands `auto` back to the slot, so
|
|
45
29
|
* slotted content renders as it did.
|
|
46
30
|
*
|
|
47
|
-
* What it writes,
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* out-cascade them without `!important` — an inline `background-image`
|
|
52
|
-
* could not be overridden from a stylesheet. The paper is the recipe's, a
|
|
53
|
-
* token: `var(--vf-white)` behind ink that is literal black, like every kit
|
|
54
|
-
* raster. Density and zoom re-encode nothing: the raster is keyed on system
|
|
55
|
-
* px, and the stated lengths are live against `--vf-scale`.
|
|
31
|
+
* What it writes, on the box's inline style and removed the moment there is
|
|
32
|
+
* nothing to paint: `--_vf-pattern-image`, the tile. The paper is the
|
|
33
|
+
* recipe's, a token: `var(--vf-white)` behind ink that is literal black,
|
|
34
|
+
* like every kit raster.
|
|
56
35
|
*
|
|
57
36
|
* Phase is anchored at the box's top-left — where the desktop, trough and
|
|
58
37
|
* swatch anchor theirs. Two same-pattern boxes meeting at an offset that is
|
|
59
38
|
* not a multiple of 8 show a phase seam; a port-anchored phase would be a
|
|
60
39
|
* contained follow-up, not a change here.
|
|
61
40
|
*/
|
|
62
|
-
export declare class PatternFillController
|
|
63
|
-
#private;
|
|
41
|
+
export declare class PatternFillController extends RepeatTileController {
|
|
64
42
|
constructor(host: ReactiveControllerHost & HTMLElement, opts: PatternFillOptions);
|
|
65
|
-
/** The raster's current box in system px (overdraw included), or null
|
|
66
|
-
* while nothing is painted. */
|
|
67
|
-
get size(): {
|
|
68
|
-
width: number;
|
|
69
|
-
height: number;
|
|
70
|
-
} | null;
|
|
71
|
-
hostUpdated(): void;
|
|
72
43
|
}
|
|
73
44
|
/**
|
|
74
45
|
* The rules behind {@link PatternFillController}, for the box it paints:
|
|
75
46
|
* give the box the `vf-pattern-fill` class always, and `vf-patterned` while
|
|
76
47
|
* a pattern is resolved (the component's template knows).
|
|
77
48
|
*
|
|
78
|
-
* Painting: the
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
49
|
+
* Painting: the tile the controller wrote, repeated from the padding box's
|
|
50
|
+
* corner at {@link vfRepeatTileSize}, nearest-neighbor. The paper and the
|
|
51
|
+
* pixelation ride the `vf-patterned` state so an unpatterned box paints
|
|
52
|
+
* exactly nothing and inherits nothing new. `image-rendering` inherits, so
|
|
53
|
+
* the slot hands `auto` back to slotted content: a consumer's own `<img>`
|
|
54
|
+
* renders as it would anywhere else, and a kit element that wants
|
|
55
|
+
* nearest-neighbor (`vf-img`, a `vf-icon`) says so itself. A page that set
|
|
56
|
+
* `pixelated` on an ancestor gets `auto` inside a patterned box — its own
|
|
57
|
+
* declaration on the child still wins, as everywhere.
|
|
87
58
|
*
|
|
88
59
|
* Forced colors: the image goes, the paper is the remapped Canvas — the
|
|
89
60
|
* desktop's posture, a backdrop being decoration.
|
package/dist/pattern-fill.js
CHANGED
|
@@ -1,61 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { TrackWidthController as a } from "./track-width.js";
|
|
5
|
-
import { css as o } from "lit";
|
|
1
|
+
import { RepeatTileController as e, vfRepeatTileSize as t } from "./tile-grid.js";
|
|
2
|
+
import { patternMotif as n } from "./patterns.js";
|
|
3
|
+
import { css as r } from "lit";
|
|
6
4
|
//#region src/pattern-fill.ts
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
#r;
|
|
12
|
-
#i = null;
|
|
13
|
-
#a = "";
|
|
14
|
-
#o = "";
|
|
15
|
-
#s = null;
|
|
5
|
+
var i = /* @__PURE__ */ new WeakMap(), a = (e) => {
|
|
6
|
+
let t = i.get(e);
|
|
7
|
+
return t || (t = n(e), i.set(e, t)), t;
|
|
8
|
+
}, o = class extends e {
|
|
16
9
|
constructor(e, t) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
super(e, {
|
|
11
|
+
getBox: t.getBox,
|
|
12
|
+
getArt: () => {
|
|
13
|
+
let e = t.getPattern();
|
|
14
|
+
return e ? a(e) : null;
|
|
15
|
+
},
|
|
16
|
+
property: "--_vf-pattern-image"
|
|
17
|
+
});
|
|
22
18
|
}
|
|
23
|
-
|
|
24
|
-
return this.#s;
|
|
25
|
-
}
|
|
26
|
-
hostUpdated() {
|
|
27
|
-
this.#c();
|
|
28
|
-
}
|
|
29
|
-
#c() {
|
|
30
|
-
let t = this.#t.getBox() ?? null;
|
|
31
|
-
t !== this.#i && (this.#u(), this.#i = t);
|
|
32
|
-
let i = this.#t.getPattern() ?? null;
|
|
33
|
-
if (!t || !i) {
|
|
34
|
-
this.#u();
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
let a = this.#t.getSize?.() ?? null, o = c(a?.width) ?? this.#l(this.#r.width), s = c(a?.height) ?? this.#l(this.#r.height);
|
|
38
|
-
if (!o || !s) {
|
|
39
|
-
this.#u();
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
let l = (e) => Math.ceil((e + 8) / 8) * 8, u = l(o), d = l(s), f = r(i), p = this.#n.for(f.width, f.height, f.rects, u, d, n(i)), m = `${e(u)} ${e(d)}`;
|
|
43
|
-
this.#s = {
|
|
44
|
-
width: u,
|
|
45
|
-
height: d
|
|
46
|
-
}, (p !== this.#a || m !== this.#o) && (this.#a = p, this.#o = m, t.style.setProperty("--_vf-pattern-image", p), t.style.setProperty("--_vf-pattern-size", m));
|
|
47
|
-
}
|
|
48
|
-
#l(e) {
|
|
49
|
-
return e > 0 ? t(e, this.#e) : 0;
|
|
50
|
-
}
|
|
51
|
-
#u() {
|
|
52
|
-
this.#s = null, !(!this.#a && !this.#o) && (this.#a = "", this.#o = "", this.#i?.style.removeProperty("--_vf-pattern-image"), this.#i?.style.removeProperty("--_vf-pattern-size"));
|
|
53
|
-
}
|
|
54
|
-
}, c = (e) => typeof e == "number" && Number.isFinite(e) && e > 0 ? Math.trunc(e) : null, l = o`
|
|
19
|
+
}, s = r`
|
|
55
20
|
.vf-pattern-fill {
|
|
56
21
|
background-image: var(--_vf-pattern-image, none);
|
|
57
|
-
|
|
58
|
-
background-repeat:
|
|
22
|
+
${t}
|
|
23
|
+
background-repeat: repeat;
|
|
59
24
|
}
|
|
60
25
|
.vf-pattern-fill.vf-patterned {
|
|
61
26
|
background-color: var(--vf-white, #fff);
|
|
@@ -71,4 +36,4 @@ var s = class {
|
|
|
71
36
|
}
|
|
72
37
|
`;
|
|
73
38
|
//#endregion
|
|
74
|
-
export {
|
|
39
|
+
export { o as PatternFillController, s as vfPatternFill };
|
package/dist/scroll-rail.d.ts
CHANGED
|
@@ -30,9 +30,10 @@ export interface ScrollRailOptions {
|
|
|
30
30
|
* whole-system-px translate, so the art is crisp mid-scroll; accepts the
|
|
31
31
|
* ≤1-frame lag behind compositor wheel scrolling every scripted scrollbar
|
|
32
32
|
* has (at 1-bit there is no smooth motion to betray it — no rAF loop, no
|
|
33
|
-
* polling). The same pass
|
|
34
|
-
*
|
|
35
|
-
* state the recipe's
|
|
33
|
+
* polling). The same pass writes the trough's repeating dither tile for
|
|
34
|
+
* the density at the rail (`repeatTile`, src/tile-grid.ts — again on a
|
|
35
|
+
* zoom or display change) and the degenerate-track state the recipe's
|
|
36
|
+
* decision table styles.
|
|
36
37
|
* - **Thumb drag** — pointer-captured and axis-locked, live scrolling (the
|
|
37
38
|
* modern expectation; System 7's dotted-outline drag is a possible later
|
|
38
39
|
* opt-in). The thumb's paint position always snaps to whole system px.
|
|
@@ -59,8 +60,7 @@ export declare class ScrollRailController implements ReactiveController {
|
|
|
59
60
|
private press;
|
|
60
61
|
private holdTimer;
|
|
61
62
|
private repeatTimer;
|
|
62
|
-
|
|
63
|
-
private readonly troughCache;
|
|
63
|
+
private stopScale?;
|
|
64
64
|
constructor(host: ReactiveControllerHost & HTMLElement & {
|
|
65
65
|
readonly renderRoot: HTMLElement | DocumentFragment;
|
|
66
66
|
}, opts: ScrollRailOptions);
|
|
@@ -81,7 +81,7 @@ export declare class ScrollRailController implements ReactiveController {
|
|
|
81
81
|
private unwire;
|
|
82
82
|
private readonly onScroll;
|
|
83
83
|
/**
|
|
84
|
-
* Re-derive every measured output: thumb position, trough
|
|
84
|
+
* Re-derive every measured output: thumb position, trough tile,
|
|
85
85
|
* degenerate state. Safe to call any time; components hit it imperatively
|
|
86
86
|
* when content changes without a box resize (a `<textarea>` on input —
|
|
87
87
|
* the same moments they call `ScrollStateController.measure()`).
|
package/dist/scroll-rail.js
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import { effectiveScale as e,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { effectiveScale as e, onScaleChange as t, sysLength as n } from "./scale.js";
|
|
2
|
+
import { devicePxAt as r, repeatTile as i } from "./tile-grid.js";
|
|
3
|
+
import { TROUGH as a } from "./styles/recipes/scroll-rail.js";
|
|
4
4
|
import "./motion.js";
|
|
5
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
6
|
import { html as m } from "lit";
|
|
7
7
|
//#region src/scroll-rail.ts
|
|
8
|
-
var h = 16, g = 16, _ =
|
|
8
|
+
var h = 16, g = 16, _ = 66, v = class {
|
|
9
9
|
constructor(t, n) {
|
|
10
|
-
this.host = t, this.opts = n, this.scroller = null, this.press = null, this.
|
|
11
|
-
vertical: new a(),
|
|
12
|
-
horizontal: new a()
|
|
13
|
-
}, this.onScroll = () => this.sync(), this.onPointerDown = (t) => {
|
|
10
|
+
this.host = t, this.opts = n, this.scroller = null, this.press = null, this.onScroll = () => this.sync(), this.onPointerDown = (t) => {
|
|
14
11
|
if (t.button !== 0 || this.press !== null) return;
|
|
15
12
|
let n = t.currentTarget, r = this.opts.getScroll();
|
|
16
13
|
if (!r) return;
|
|
17
|
-
let i =
|
|
14
|
+
let i = y(n), a = i === "vertical" ? "data-overflow-y" : "data-overflow-x";
|
|
18
15
|
if (r.getAttribute(a) === "false" || r.hasAttribute("data-window-inactive") || n.getAttribute("data-degenerate") === "rail") return;
|
|
19
16
|
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
17
|
if (l) {
|
|
@@ -78,13 +75,13 @@ var h = 16, g = 16, _ = 14, v = 66, y = class {
|
|
|
78
75
|
}, t.addController(this);
|
|
79
76
|
}
|
|
80
77
|
hostConnected() {
|
|
81
|
-
this.wire(), this.sync();
|
|
78
|
+
this.wire(), this.sync(), this.stopScale = t(() => this.sync());
|
|
82
79
|
}
|
|
83
80
|
hostUpdated() {
|
|
84
81
|
this.wire(), this.sync();
|
|
85
82
|
}
|
|
86
83
|
hostDisconnected() {
|
|
87
|
-
this.clearRepeat(), this.press = null, this.unwire();
|
|
84
|
+
this.clearRepeat(), this.press = null, this.unwire(), this.stopScale?.(), this.stopScale = void 0;
|
|
88
85
|
}
|
|
89
86
|
wire() {
|
|
90
87
|
let e = this.opts.getScroll() ?? null;
|
|
@@ -101,17 +98,17 @@ var h = 16, g = 16, _ = 14, v = 66, y = class {
|
|
|
101
98
|
let e = this.scroller ?? this.opts.getScroll(), t = this.host.renderRoot;
|
|
102
99
|
if (!(!e || !t)) for (let n of t.querySelectorAll(".vf-rail")) this.syncRail(n, e);
|
|
103
100
|
}
|
|
104
|
-
syncRail(
|
|
105
|
-
let s =
|
|
101
|
+
syncRail(t, o) {
|
|
102
|
+
let s = y(t), c = t.querySelector(".vf-rail-track"), l = t.querySelector(".vf-rail-thumb");
|
|
106
103
|
if (!c || !l) return;
|
|
107
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;
|
|
108
|
-
if (p ?
|
|
109
|
-
let m = this.scrollRange(o, s), h = s === "vertical" ? o.scrollTop : o.scrollLeft,
|
|
110
|
-
l.style.translate = s === "vertical" ? `0 ${
|
|
111
|
-
let
|
|
112
|
-
if (
|
|
113
|
-
let e =
|
|
114
|
-
|
|
105
|
+
if (p ? t.setAttribute("data-degenerate", p) : t.removeAttribute("data-degenerate"), p === "rail") return;
|
|
106
|
+
let m = this.scrollRange(o, s), h = s === "vertical" ? o.scrollTop : o.scrollLeft, _ = f - g, v = m > 0 && _ > 0 ? Math.max(0, Math.min(Math.floor(_), Math.round(h / m * _))) : 0;
|
|
107
|
+
l.style.translate = s === "vertical" ? `0 ${n(v)}` : `${n(v)} 0`;
|
|
108
|
+
let b = t.querySelector(".vf-rail-trough");
|
|
109
|
+
if (b) {
|
|
110
|
+
let e = i(a, r(b));
|
|
111
|
+
b.style.getPropertyValue("--_vf-trough-tile") !== e && b.style.setProperty("--_vf-trough-tile", e);
|
|
115
112
|
}
|
|
116
113
|
}
|
|
117
114
|
scrollRange(e, t) {
|
|
@@ -141,13 +138,13 @@ var h = 16, g = 16, _ = 14, v = 66, y = class {
|
|
|
141
138
|
}
|
|
142
139
|
armRepeat(e) {
|
|
143
140
|
this.clearRepeat(), this.holdTimer = window.setTimeout(() => {
|
|
144
|
-
this.repeatTimer = window.setInterval(e,
|
|
141
|
+
this.repeatTimer = window.setInterval(e, _);
|
|
145
142
|
}, 200);
|
|
146
143
|
}
|
|
147
144
|
clearRepeat() {
|
|
148
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;
|
|
149
146
|
}
|
|
150
|
-
},
|
|
147
|
+
}, y = (e) => e.classList.contains("vf-rail--horizontal") ? "horizontal" : "vertical", b = (e, t) => m`<svg
|
|
151
148
|
class="vf-rail-arrow vf-rail-arrow--${t}"
|
|
152
149
|
viewBox="1 1 14 14"
|
|
153
150
|
fill="currentColor"
|
|
@@ -156,7 +153,7 @@ var h = 16, g = 16, _ = 14, v = 66, y = class {
|
|
|
156
153
|
>
|
|
157
154
|
<path d=${e.d}></path>
|
|
158
155
|
</svg>`;
|
|
159
|
-
function
|
|
156
|
+
function x(e, t) {
|
|
160
157
|
let [n, r, i, a] = t === "vertical" ? [
|
|
161
158
|
f,
|
|
162
159
|
p,
|
|
@@ -179,19 +176,17 @@ function S(e, t) {
|
|
|
179
176
|
@lostpointercapture=${e.onPointerUp}
|
|
180
177
|
>
|
|
181
178
|
<div class="vf-rail-button vf-rail-button--decrement">
|
|
182
|
-
${
|
|
179
|
+
${b(n, "rest")}${b(r, "fill")}
|
|
183
180
|
</div>
|
|
184
181
|
<div class="vf-rail-track">
|
|
185
|
-
<div class="vf-rail-trough">
|
|
186
|
-
<div class="vf-rail-trough-art"></div>
|
|
187
|
-
</div>
|
|
182
|
+
<div class="vf-rail-trough"></div>
|
|
188
183
|
<div class="vf-rail-thumb"></div>
|
|
189
184
|
</div>
|
|
190
185
|
<div class="vf-rail-button vf-rail-button--increment">
|
|
191
|
-
${
|
|
186
|
+
${b(i, "rest")}${b(a, "fill")}
|
|
192
187
|
</div>
|
|
193
188
|
</div>
|
|
194
189
|
`;
|
|
195
190
|
}
|
|
196
191
|
//#endregion
|
|
197
|
-
export {
|
|
192
|
+
export { v as ScrollRailController, x as renderScrollRail };
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The windoid bar's dither is the library's `dots` on its minimal cell: a
|
|
3
|
+
* 2-system-px motif with a single black pixel at its origin. Transparent
|
|
4
|
+
* ground, because the layer floats over the bar and the same art doubles as
|
|
5
|
+
* the forced-colors mask, where the ground would be opacity rather than
|
|
6
|
+
* paint. `vf-window` keeps the layer's repeating tile drawn from this motif
|
|
7
|
+
* (src/tile-grid.ts); the SVG tile below is the forced-colors mask and the
|
|
8
|
+
* consumer token's documented geometry.
|
|
9
|
+
*/
|
|
10
|
+
export declare const DOTS: import("../../patterns.js").PatternMotif;
|
|
3
11
|
/** The dots' tile size in system px (30) — the consumer token's documented box. */
|
|
4
12
|
export declare const DOT_SPAN: number;
|
|
5
13
|
/**
|
|
@@ -58,13 +66,14 @@ export declare const vfStripes: import("lit").CSSResult;
|
|
|
58
66
|
* runs the dots all the way into the side borders (the Windows/ sheet hand-
|
|
59
67
|
* insets them 2px, which the close-up shows is not the bar's own geometry).
|
|
60
68
|
*
|
|
61
|
-
* The layer's own
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
+
* The kit dots are the layer's own background: the repeating tile
|
|
70
|
+
* `vf-window` writes as `--_vf-dots-tile` (src/tile-grid.ts), at any window
|
|
71
|
+
* width. A consumer `--vf-dots-pattern` takes over in one of two ways. A
|
|
72
|
+
* window that knows its width renders the token's placed tile grid INTO the
|
|
73
|
+
* layer and marks it `vf-tile-grid`, which switches the layer's background
|
|
74
|
+
* off: the dot art is transparent-grounded, so a drifting CSS-repeated copy
|
|
75
|
+
* underneath would show through between the exactly placed dots. A window
|
|
76
|
+
* with no declared width marks the layer `vf-dots-token`, and the token
|
|
77
|
+
* repeats in CSS on its documented 30-system-px span.
|
|
69
78
|
*/
|
|
70
79
|
export declare const vfDots: import("lit").CSSResult;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { tileImage as e, tileRects as t, tileSpan as n, vfTileMaskSize as r, vfTileSize as i } from "./tile.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { vfRepeatTileSize as a } from "../../tile-grid.js";
|
|
3
|
+
import { PATTERNS as o, patternMotif as s } from "../../patterns.js";
|
|
4
|
+
import { css as c, unsafeCSS as l } from "lit";
|
|
4
5
|
//#region src/styles/recipes/pattern.ts
|
|
5
|
-
var
|
|
6
|
+
var u = s(o.dots), d = u.width, f = e(d, d, t(u.rects)), p = n(d), m = c`
|
|
6
7
|
.vf-stripes {
|
|
7
8
|
position: absolute;
|
|
8
9
|
inset: calc(var(--vf-scale, 1) * 3px) calc(var(--vf-scale, 1) * 1px);
|
|
@@ -40,15 +41,21 @@ var l = o(a.dots), u = l.width, d = l.rects, f = e(u, u, t(d)), p = n(u), m = s`
|
|
|
40
41
|
background: var(--vf-black, #000000);
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
|
-
`, h =
|
|
44
|
+
`, h = c`
|
|
44
45
|
.vf-dots {
|
|
45
46
|
position: absolute;
|
|
46
47
|
inset: calc(var(--vf-scale, 1) * 2px) 0;
|
|
47
|
-
background-image: var(--
|
|
48
|
-
${
|
|
48
|
+
background-image: var(--_vf-dots-tile, none);
|
|
49
|
+
${a}
|
|
50
|
+
image-rendering: pixelated;
|
|
49
51
|
pointer-events: none;
|
|
50
52
|
/* The consumer-token art channel for the placed tile grid. */
|
|
51
|
-
--_vf-tile-image: var(--vf-dots-pattern, ${
|
|
53
|
+
--_vf-tile-image: var(--vf-dots-pattern, ${l(f)});
|
|
54
|
+
}
|
|
55
|
+
.vf-dots.vf-dots-token {
|
|
56
|
+
background-image: var(--vf-dots-pattern);
|
|
57
|
+
${i(d)}
|
|
58
|
+
image-rendering: auto;
|
|
52
59
|
}
|
|
53
60
|
.vf-dots.vf-tile-grid {
|
|
54
61
|
background-image: none;
|
|
@@ -56,23 +63,25 @@ var l = o(a.dots), u = l.width, d = l.rects, f = e(u, u, t(d)), p = n(u), m = s`
|
|
|
56
63
|
/* Forced colors preserves url() tiles verbatim, so the dots would stay
|
|
57
64
|
literal black — invisible on a dark high-contrast theme. Repainted as the
|
|
58
65
|
ink token through the same tile as a mask (the vf-grid rules idiom), so
|
|
59
|
-
the windoid bar's signature follows the user's palette. The
|
|
60
|
-
|
|
61
|
-
rasterizes exactly at a zoom-minted scale anyway
|
|
62
|
-
not reach masks), so forced
|
|
63
|
-
caveat
|
|
66
|
+
the windoid bar's signature follows the user's palette. The tile and the
|
|
67
|
+
token's placed tiles hide here and the span mask takes over — no mask
|
|
68
|
+
pipeline rasterizes exactly at a zoom-minted scale anyway
|
|
69
|
+
(image-rendering does not reach masks), so forced colors keeps the span
|
|
70
|
+
approach and its zoom caveat. */
|
|
64
71
|
@media (forced-colors: active) {
|
|
65
|
-
.vf-dots
|
|
72
|
+
.vf-dots,
|
|
73
|
+
.vf-dots.vf-dots-token {
|
|
66
74
|
background-image: none;
|
|
75
|
+
}
|
|
76
|
+
.vf-dots {
|
|
67
77
|
background-color: var(--vf-black, #000);
|
|
68
|
-
mask-image: var(--vf-dots-pattern, ${
|
|
69
|
-
${r(
|
|
78
|
+
mask-image: var(--vf-dots-pattern, ${l(f)});
|
|
79
|
+
${r(d)}
|
|
70
80
|
}
|
|
71
|
-
.vf-dots .vf-tile
|
|
72
|
-
.vf-dots .vf-tile-raster {
|
|
81
|
+
.vf-dots .vf-tile {
|
|
73
82
|
display: none;
|
|
74
83
|
}
|
|
75
84
|
}
|
|
76
85
|
`;
|
|
77
86
|
//#endregion
|
|
78
|
-
export { u as
|
|
87
|
+
export { u as DOTS, p as DOT_SPAN, h as vfDots, m as vfStripes };
|