vintage-frames 0.8.0 → 0.10.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/dist/index.d.ts CHANGED
@@ -33,6 +33,7 @@ export { VfImg } from './components/vf-img.js';
33
33
  export { VfIcon } from './components/vf-icon.js';
34
34
  export type { VfIconSize, VfIconDragDetail, VfIconDragFollower, } from './components/vf-icon.js';
35
35
  export { VfIconField } from './components/vf-icon-field.js';
36
+ export type { VfIconMove } from './components/vf-icon-field.js';
36
37
  export { VfMenuBar } from './components/vf-menu-bar.js';
37
38
  export { VfMenu } from './components/vf-menu.js';
38
39
  export { VfMenuItem } from './components/vf-menu-item.js';
@@ -141,8 +142,8 @@ export type { DocumentListenerSpec } from './document-listeners.js';
141
142
  export { focusModality, trackFocusModality, FocusRuleController } from './focus-modality.js';
142
143
  export type { FocusModality } from './focus-modality.js';
143
144
  export { emit } from './events.js';
144
- export { prefersReducedMotion, runSelectionBlink, BLINK_INTERVAL_MS, BLINK_FLIPS, PRESS_HOLD_MS, RENAME_DELAY_MS, } from './motion.js';
145
- export type { BlinkHandle } from './motion.js';
145
+ export { prefersReducedMotion, runSelectionBlink, runOutlineTravel, BLINK_INTERVAL_MS, BLINK_FLIPS, PRESS_HOLD_MS, RENAME_DELAY_MS, WALK_STEP_PX, WALK_STEP_MS, WALK_BEAT_MS, } from './motion.js';
146
+ export type { BlinkHandle, TravelHandle } from './motion.js';
146
147
  /**
147
148
  * Element registration. `vfElement` is the kit's `@customElement`: it registers
148
149
  * through `defineElement`, which skips (and warns) rather than throwing when a
package/dist/index.js CHANGED
@@ -31,45 +31,45 @@ import { VfDesktop as Fe } from "./components/vf-desktop.js";
31
31
  import { VfSized as Ie } from "./size.js";
32
32
  import { DragController as Le } from "./drag.js";
33
33
  import { ScrollStateController as Re } from "./scroll-state.js";
34
- import { BLINK_FLIPS as ze, BLINK_INTERVAL_MS as Be, PRESS_HOLD_MS as Ve, RENAME_DELAY_MS as He, prefersReducedMotion as Ue, runSelectionBlink as We } from "./motion.js";
35
- import { CARET_DOWN as Ge, CHECKBOX_X as Ke, CHECKMARK as qe, RADIO_DOT as Je, RADIO_FACE as Ye, RADIO_RING as Xe, RADIO_RING_PRESSED as Ze, SLIDER_THUMB as Qe, SLIDER_THUMB_FACE as $e, STEPPER as et, STEPPER_DOWN_FILL as tt, STEPPER_UP_FILL as nt, glyphSvg as rt } from "./glyphs.js";
36
- import { ScrollRailController as it, renderScrollRail as at } from "./scroll-rail.js";
37
- import { VfScrollArea as ot } from "./components/vf-scroll-area.js";
38
- import { VfWindow as st } from "./components/vf-window.js";
39
- import { VfModalDialog as ct, modalDialogStyles as lt } from "./modal-dialog.js";
40
- import { VfDialog as ut } from "./components/vf-dialog.js";
41
- import { VfSeparator as dt } from "./components/vf-separator.js";
42
- import { VfFormControl as ft } from "./form-control.js";
43
- import { VfButton as pt } from "./components/vf-button.js";
44
- import { VfButtonGroup as mt } from "./components/vf-button-group.js";
45
- import { VfSwatch as ht } from "./components/vf-swatch.js";
46
- import { VfToggleControl as gt } from "./toggle-control.js";
47
- import { VfCheckbox as _t } from "./components/vf-checkbox.js";
48
- import { VfRadio as vt } from "./components/vf-radio.js";
49
- import { VfRadioGroup as yt } from "./components/vf-radio-group.js";
50
- import { FocusRuleController as bt, focusModality as xt, trackFocusModality as St } from "./focus-modality.js";
51
- import { VfTextControlBase as Ct } from "./text-control.js";
52
- import { VfTextField as wt } from "./components/vf-text-field.js";
53
- import { VfTextArea as Tt } from "./components/vf-text-area.js";
54
- import { VfNumberField as Et } from "./components/vf-number-field.js";
55
- import { VfOption as Dt } from "./components/vf-option.js";
56
- import { VfSelect as Ot } from "./components/vf-select.js";
57
- import { VfProgressBar as kt } from "./components/vf-progress-bar.js";
58
- import { VfSlider as At } from "./components/vf-slider.js";
59
- import { VfLabel as jt } from "./components/vf-label.js";
60
- import { VfParagraph as Mt } from "./components/vf-paragraph.js";
61
- import { VfImg as Nt } from "./components/vf-img.js";
62
- import { VfIcon as Pt } from "./components/vf-icon.js";
63
- import { VfIconField as Ft } from "./components/vf-icon-field.js";
64
- import { VfMenuBar as It } from "./components/vf-menu-bar.js";
65
- import { VfMenu as Lt } from "./components/vf-menu.js";
66
- import { VfMenuItem as Rt } from "./components/vf-menu-item.js";
67
- import { VfList as zt } from "./components/vf-list.js";
68
- import { VfListItem as Bt } from "./components/vf-list-item.js";
69
- import { VfFieldset as Vt } from "./components/vf-fieldset.js";
70
- import { VfGrid as Ht } from "./components/vf-grid.js";
71
- import { VfStack as Ut } from "./components/vf-stack.js";
72
- import { VfContainer as Wt } from "./components/vf-container.js";
73
- import { CURSOR_ARROW as Gt, CURSOR_CROSSHAIR as Kt, CURSOR_I_BEAM as qt, CURSOR_WAIT as Jt } from "./cursor-art.js";
74
- import { applyCursor as Yt } from "./cursor.js";
75
- export { ze as BLINK_FLIPS, Be as BLINK_INTERVAL_MS, Ee as BUTTON_FACE, De as BUTTON_FRAME, Ge as CARET_DOWN, Ke as CHECKBOX_X, qe as CHECKMARK, r as CLASSIC_DPI, i as CSS_REFERENCE_DPI, Gt as CURSOR_ARROW, Kt as CURSOR_CROSSHAIR, qt as CURSOR_I_BEAM, Jt as CURSOR_WAIT, Te as DocumentListenersController, Le as DragController, bt as FocusRuleController, Ce as GridSnapController, G as PATTERNS, K as PATTERN_NAMES, q as PATTERN_SIZE, D as PIXEL_GRID_METRICS, Ve as PRESS_HOLD_MS, xe as PatternFillController, T as PlacementController, Je as RADIO_DOT, Ye as RADIO_FACE, Xe as RADIO_RING, Ze as RADIO_RING_PRESSED, He as RENAME_DELAY_MS, Oe as RING_FRAME, ke as RING_HOLE, Ae as RING_INSET, ie as RULE_EDGES, je as SCREEN_CORNER, Qe as SLIDER_THUMB, $e as SLIDER_THUMB_FACE, et as STEPPER, tt as STEPPER_DOWN_FILL, nt as STEPPER_UP_FILL, a as SYSTEM_PX_IN_CSS_PX, d as ScaleController, it as ScrollRailController, Re as ScrollStateController, R as TILE_LATTICE, ge as TileRasterCache, be as TrackWidthController, k as VF_BODY_FAMILY, M as VF_DISPLAY_FAMILY, pt as VfButton, mt as VfButtonGroup, _t as VfCheckbox, Wt as VfContainer, Fe as VfDesktop, ut as VfDialog, Vt as VfFieldset, ft as VfFormControl, Ht as VfGrid, Pt as VfIcon, Ft as VfIconField, Nt as VfImg, jt as VfLabel, zt as VfList, Bt as VfListItem, Lt as VfMenu, It as VfMenuBar, Rt as VfMenuItem, ct as VfModalDialog, Et as VfNumberField, Dt as VfOption, Mt as VfParagraph, E as VfPositioned, kt as VfProgressBar, vt as VfRadio, yt as VfRadioGroup, ot as VfScrollArea, Ot as VfSelect, dt as VfSeparator, Ie as VfSized, At as VfSlider, Ut as VfStack, ht as VfSwatch, Tt as VfTextArea, Ct as VfTextControlBase, wt as VfTextField, gt as VfToggleControl, st as VfWindow, Yt as applyCursor, f as applyScale, t as defineElement, o as devicePxPerSystemPx, p as effectiveScale, e as emit, xt as focusModality, m as getScale, s as getZoom, rt as glyphSvg, lt as modalDialogStyles, h as onScaleChange, c as onZoomChange, J as parsePattern, ae as parseRule, Y as patternHex, X as patternMotif, _e as patternOverride, Z as patternRects, Ue as prefersReducedMotion, A as registerBodyFace, N as registerDisplayFace, O as registerEmbeddedFont, at as renderScrollRail, we as requestGridSnap, l as resetZoomBaseline, oe as ruleClasses, We as runSelectionBlink, g as snapSys, _ as snapToDevicePx, v as snapToSystemPx, Me as steppedCornerClip, Ne as steppedRectClip, Pe as steppedRingClip, y as sys, b as sysLength, x as sysLengths, S as systemPxQuantum, ve as tileGrid, z as tileImage, B as tileRaster, V as tileRects, H as tileSpan, C as toSys, w as toSysExact, St as trackFocusModality, u as truePixelRatio, I as vfBase, j as vfBodyDecls, te as vfChromeFrame, P as vfDisplay, F as vfDisplayDecls, Q as vfDots, n as vfElement, me as vfField, ue as vfFocus, de as vfFocusRing, fe as vfFocusUnderline, ee as vfHardShadowDecls, ne as vfModalFrame, re as vfPanel, Se as vfPatternFill, se as vfRule, he as vfScrollRail, L as vfStaticText, $ as vfStripes, ye as vfTileGrid, U as vfTileMaskSize, W as vfTileSize, ce as vfTitleBar, pe as vfToggle, le as vfWindowWidgets };
34
+ import { BLINK_FLIPS as ze, BLINK_INTERVAL_MS as Be, PRESS_HOLD_MS as Ve, RENAME_DELAY_MS as He, WALK_BEAT_MS as Ue, WALK_STEP_MS as We, WALK_STEP_PX as Ge, prefersReducedMotion as Ke, runOutlineTravel as qe, runSelectionBlink as Je } from "./motion.js";
35
+ import { CARET_DOWN as Ye, CHECKBOX_X as Xe, CHECKMARK as Ze, RADIO_DOT as Qe, RADIO_FACE as $e, RADIO_RING as et, RADIO_RING_PRESSED as tt, SLIDER_THUMB as nt, SLIDER_THUMB_FACE as rt, STEPPER as it, STEPPER_DOWN_FILL as at, STEPPER_UP_FILL as ot, glyphSvg as st } from "./glyphs.js";
36
+ import { ScrollRailController as ct, renderScrollRail as lt } from "./scroll-rail.js";
37
+ import { VfScrollArea as ut } from "./components/vf-scroll-area.js";
38
+ import { VfWindow as dt } from "./components/vf-window.js";
39
+ import { VfModalDialog as ft, modalDialogStyles as pt } from "./modal-dialog.js";
40
+ import { VfDialog as mt } from "./components/vf-dialog.js";
41
+ import { VfSeparator as ht } from "./components/vf-separator.js";
42
+ import { VfFormControl as gt } from "./form-control.js";
43
+ import { VfButton as _t } from "./components/vf-button.js";
44
+ import { VfButtonGroup as vt } from "./components/vf-button-group.js";
45
+ import { VfSwatch as yt } from "./components/vf-swatch.js";
46
+ import { VfToggleControl as bt } from "./toggle-control.js";
47
+ import { VfCheckbox as xt } from "./components/vf-checkbox.js";
48
+ import { VfRadio as St } from "./components/vf-radio.js";
49
+ import { VfRadioGroup as Ct } from "./components/vf-radio-group.js";
50
+ import { FocusRuleController as wt, focusModality as Tt, trackFocusModality as Et } from "./focus-modality.js";
51
+ import { VfTextControlBase as Dt } from "./text-control.js";
52
+ import { VfTextField as Ot } from "./components/vf-text-field.js";
53
+ import { VfTextArea as kt } from "./components/vf-text-area.js";
54
+ import { VfNumberField as At } from "./components/vf-number-field.js";
55
+ import { VfOption as jt } from "./components/vf-option.js";
56
+ import { VfSelect as Mt } from "./components/vf-select.js";
57
+ import { VfProgressBar as Nt } from "./components/vf-progress-bar.js";
58
+ import { VfSlider as Pt } from "./components/vf-slider.js";
59
+ import { VfLabel as Ft } from "./components/vf-label.js";
60
+ import { VfParagraph as It } from "./components/vf-paragraph.js";
61
+ import { VfImg as Lt } from "./components/vf-img.js";
62
+ import { VfIcon as Rt } from "./components/vf-icon.js";
63
+ import { VfIconField as zt } from "./components/vf-icon-field.js";
64
+ import { VfMenuBar as Bt } from "./components/vf-menu-bar.js";
65
+ import { VfMenu as Vt } from "./components/vf-menu.js";
66
+ import { VfMenuItem as Ht } from "./components/vf-menu-item.js";
67
+ import { VfList as Ut } from "./components/vf-list.js";
68
+ import { VfListItem as Wt } from "./components/vf-list-item.js";
69
+ import { VfFieldset as Gt } from "./components/vf-fieldset.js";
70
+ import { VfGrid as Kt } from "./components/vf-grid.js";
71
+ import { VfStack as qt } from "./components/vf-stack.js";
72
+ import { VfContainer as Jt } from "./components/vf-container.js";
73
+ import { CURSOR_ARROW as Yt, CURSOR_CROSSHAIR as Xt, CURSOR_I_BEAM as Zt, CURSOR_WAIT as Qt } from "./cursor-art.js";
74
+ import { applyCursor as $t } from "./cursor.js";
75
+ export { ze as BLINK_FLIPS, Be as BLINK_INTERVAL_MS, Ee as BUTTON_FACE, De as BUTTON_FRAME, Ye as CARET_DOWN, Xe as CHECKBOX_X, Ze as CHECKMARK, r as CLASSIC_DPI, i as CSS_REFERENCE_DPI, Yt as CURSOR_ARROW, Xt as CURSOR_CROSSHAIR, Zt as CURSOR_I_BEAM, Qt as CURSOR_WAIT, Te as DocumentListenersController, Le as DragController, wt as FocusRuleController, Ce as GridSnapController, G as PATTERNS, K as PATTERN_NAMES, q as PATTERN_SIZE, D as PIXEL_GRID_METRICS, Ve as PRESS_HOLD_MS, xe as PatternFillController, T as PlacementController, Qe as RADIO_DOT, $e as RADIO_FACE, et as RADIO_RING, tt as RADIO_RING_PRESSED, He as RENAME_DELAY_MS, Oe as RING_FRAME, ke as RING_HOLE, Ae as RING_INSET, ie as RULE_EDGES, je as SCREEN_CORNER, nt as SLIDER_THUMB, rt as SLIDER_THUMB_FACE, it as STEPPER, at as STEPPER_DOWN_FILL, ot as STEPPER_UP_FILL, a as SYSTEM_PX_IN_CSS_PX, d as ScaleController, ct as ScrollRailController, Re as ScrollStateController, R as TILE_LATTICE, ge as TileRasterCache, be as TrackWidthController, k as VF_BODY_FAMILY, M as VF_DISPLAY_FAMILY, _t as VfButton, vt as VfButtonGroup, xt as VfCheckbox, Jt as VfContainer, Fe as VfDesktop, mt as VfDialog, Gt as VfFieldset, gt as VfFormControl, Kt as VfGrid, Rt as VfIcon, zt as VfIconField, Lt as VfImg, Ft as VfLabel, Ut as VfList, Wt as VfListItem, Vt as VfMenu, Bt as VfMenuBar, Ht as VfMenuItem, ft as VfModalDialog, At as VfNumberField, jt as VfOption, It as VfParagraph, E as VfPositioned, Nt as VfProgressBar, St as VfRadio, Ct as VfRadioGroup, ut as VfScrollArea, Mt as VfSelect, ht as VfSeparator, Ie as VfSized, Pt as VfSlider, qt as VfStack, yt as VfSwatch, kt as VfTextArea, Dt as VfTextControlBase, Ot as VfTextField, bt as VfToggleControl, dt as VfWindow, Ue as WALK_BEAT_MS, We as WALK_STEP_MS, Ge as WALK_STEP_PX, $t as applyCursor, f as applyScale, t as defineElement, o as devicePxPerSystemPx, p as effectiveScale, e as emit, Tt as focusModality, m as getScale, s as getZoom, st as glyphSvg, pt as modalDialogStyles, h as onScaleChange, c as onZoomChange, J as parsePattern, ae as parseRule, Y as patternHex, X as patternMotif, _e as patternOverride, Z as patternRects, Ke as prefersReducedMotion, A as registerBodyFace, N as registerDisplayFace, O as registerEmbeddedFont, lt as renderScrollRail, we as requestGridSnap, l as resetZoomBaseline, oe as ruleClasses, qe as runOutlineTravel, Je as runSelectionBlink, g as snapSys, _ as snapToDevicePx, v as snapToSystemPx, Me as steppedCornerClip, Ne as steppedRectClip, Pe as steppedRingClip, y as sys, b as sysLength, x as sysLengths, S as systemPxQuantum, ve as tileGrid, z as tileImage, B as tileRaster, V as tileRects, H as tileSpan, C as toSys, w as toSysExact, Et as trackFocusModality, u as truePixelRatio, I as vfBase, j as vfBodyDecls, te as vfChromeFrame, P as vfDisplay, F as vfDisplayDecls, Q as vfDots, n as vfElement, me as vfField, ue as vfFocus, de as vfFocusRing, fe as vfFocusUnderline, ee as vfHardShadowDecls, ne as vfModalFrame, re as vfPanel, Se as vfPatternFill, se as vfRule, he as vfScrollRail, L as vfStaticText, $ as vfStripes, ye as vfTileGrid, U as vfTileMaskSize, W as vfTileSize, ce as vfTitleBar, pe as vfToggle, le as vfWindowWidgets };
package/dist/motion.d.ts CHANGED
@@ -70,3 +70,34 @@ export interface BlinkHandle {
70
70
  * handle. `setPhase` is never called after `onDone()`.
71
71
  */
72
72
  export declare function runSelectionBlink(setPhase: (on: boolean) => void, onDone: () => void): BlinkHandle;
73
+ /**
74
+ * The walk: an icon's drag outline travelling to where a page sends it
75
+ * (`vf-icon.dragTo`), the Finder's own Clean Up. System px the outline
76
+ * advances per step, milliseconds between steps, and the beat after one
77
+ * icon lands before the next of a field sets off (`vf-icon-field.dragIcons`).
78
+ *
79
+ * Constant speed rather than a fixed frame count: the walk is the drag's
80
+ * outline moved by the kit instead of the hand, and most of a Clean Up's
81
+ * moves are short — a fixed count would crawl a one-pixel correction across
82
+ * as many frames as a trip across the screen. Set by eye; nothing in the
83
+ * verify suite asserts them.
84
+ */
85
+ export declare const WALK_STEP_PX = 16;
86
+ export declare const WALK_STEP_MS = 25;
87
+ export declare const WALK_BEAT_MS = 50;
88
+ /** Handle for an in-flight {@link runOutlineTravel}; {@link finish} lands it now. */
89
+ export interface TravelHandle {
90
+ finish(): void;
91
+ }
92
+ /**
93
+ * The walk's cadence. `setProgress(t)` is called once per step with the
94
+ * fraction of `distance` (system px) covered — whole steps of
95
+ * {@link WALK_STEP_PX}, the last exactly 1 — and one interval after the last
96
+ * step `onDone()`, so the outline rests where it arrived before the icon
97
+ * lands. A timer chain at {@link WALK_STEP_MS}, not `requestAnimationFrame`,
98
+ * so a 120 Hz display does not double the speed. `finish()` clears the
99
+ * timer and calls `onDone()` at once — a walk is finished, never cancelled.
100
+ * `onDone` runs exactly once, and never before this returns except under
101
+ * `prefers-reduced-motion`, where it runs at once and the handle is a no-op.
102
+ */
103
+ export declare function runOutlineTravel(distance: number, setProgress: (t: number) => void, onDone: () => void): TravelHandle;
package/dist/motion.js CHANGED
@@ -18,5 +18,19 @@ function a(t, n) {
18
18
  window.clearInterval(i);
19
19
  } };
20
20
  }
21
+ var o = 16, s = 25, c = 50;
22
+ function l(t, n, r) {
23
+ if (e()) return r(), { finish() {} };
24
+ let i = Math.max(1, Math.ceil(t / 16)), a = 0, o = !1, s = 0, c = () => {
25
+ o || (o = !0, window.clearTimeout(s), r());
26
+ }, l = () => {
27
+ if (a >= i) {
28
+ c();
29
+ return;
30
+ }
31
+ a += 1, n(a / i), s = window.setTimeout(l, 25);
32
+ };
33
+ return s = window.setTimeout(l, 25), { finish: c };
34
+ }
21
35
  //#endregion
22
- export { i as BLINK_FLIPS, r as BLINK_INTERVAL_MS, t as PRESS_HOLD_MS, n as RENAME_DELAY_MS, e as prefersReducedMotion, a as runSelectionBlink };
36
+ export { i as BLINK_FLIPS, r as BLINK_INTERVAL_MS, t as PRESS_HOLD_MS, n as RENAME_DELAY_MS, c as WALK_BEAT_MS, s as WALK_STEP_MS, o as WALK_STEP_PX, e as prefersReducedMotion, l as runOutlineTravel, a as runSelectionBlink };
@@ -24,6 +24,8 @@
24
24
  * where the source is opaque, so intersecting the silhouette with itself
25
25
  * shifted one pixel each way leaves exactly the pixels whose neighbors are
26
26
  * all opaque — the interior. The ring the erosion removes is the outline.
27
+ * The ghost erodes with the four edge neighbors; the drag outline with all
28
+ * eight, a region inset — {@link deriveDragOutline} says why it matters.
27
29
  */
28
30
  /**
29
31
  * Derive the open ghost from an icon's art: a canvas at the art's natural
@@ -39,7 +41,7 @@
39
41
  * an environment refusing a 2d context.
40
42
  */
41
43
  export declare function deriveOpenArt(art: HTMLImageElement | HTMLCanvasElement): HTMLCanvasElement | null;
42
- /** A box inside an icon's frame, in system px. */
44
+ /** A box inside the outline's box, in system px. */
43
45
  export interface DragOutlineBox {
44
46
  x: number;
45
47
  y: number;
@@ -47,11 +49,12 @@ export interface DragOutlineBox {
47
49
  height: number;
48
50
  }
49
51
  /**
50
- * Where an icon's parts sit inside its frame, in system px — measured by the
51
- * icon, so the outline lands on the same pixels the frame paints.
52
+ * Where an icon's parts sit inside the outline's box, in system px —
53
+ * measured by the icon, so the outline lands on the same pixels the frame
54
+ * paints.
52
55
  */
53
56
  export interface DragOutlineGeometry {
54
- /** The frame. */
57
+ /** The outline's box: the frame, widened to a name plate that overhangs it. */
55
58
  width: number;
56
59
  height: number;
57
60
  /**
@@ -66,18 +69,28 @@ export interface DragOutlineGeometry {
66
69
  plate: DragOutlineBox | null;
67
70
  }
68
71
  /**
69
- * Derive the outline an icon drags as: the mask's boundary — the same
70
- * one-pixel ring the open ghost finds, by the same erosion — and the name
71
- * plate's rectangle, solid black on transparent, one canvas the size of the
72
- * icon's frame at one image px per system px. Not yet dotted: the ring is
73
- * derived once per drag, and {@link dotOutline} re-applies the checker at
74
- * each step's phase.
72
+ * Derive the outline an icon drags as: the boundary of the mask united with
73
+ * the name plate's rectangle — one shape, the one-pixel ring a 3×3 box
74
+ * erosion removes from it, so where the art and the plate abut the outline
75
+ * wraps around both — solid black on transparent, one canvas the size of
76
+ * the outline's box (the icon's frame, widened to a plate that overhangs
77
+ * it) at one image px per system px. Not yet dotted: the ring is derived
78
+ * once per drag, and {@link dotOutline} re-applies the checker at each
79
+ * step's phase.
80
+ *
81
+ * The box, not the ghost's four-neighbor plus: it is the region inset
82
+ * `FrameRgn` painted a frame from, and the difference shows on a 45° edge.
83
+ * A one-pixel diagonal is all one parity of the checker, so the pen would
84
+ * keep all of it or none — and over the dither "none" is the dither's own
85
+ * ink diagonal, no line at all. Under the box a 45° edge is two pixels
86
+ * wide and carries both parities, so one full diagonal of dots survives at
87
+ * either phase.
75
88
  *
76
89
  * Art the pipeline cannot draw falls back to the cell's rectangle — the
77
90
  * ghost's rule: never a blank where a state cannot show. Compositing only,
78
91
  * never a readback, so cross-origin art derives too.
79
92
  *
80
- * Returns null for a frame with no size, or an environment refusing a 2d
93
+ * Returns null for a box with no size, or an environment refusing a 2d
81
94
  * context.
82
95
  */
83
96
  export declare function deriveDragOutline(art: HTMLImageElement | HTMLCanvasElement | null, geometry: DragOutlineGeometry): HTMLCanvasElement | null;
package/dist/open-art.js CHANGED
@@ -44,22 +44,24 @@ var i = null, a = () => {
44
44
  function s(t, n) {
45
45
  let { width: r, height: i } = n;
46
46
  if (!r || !i) return null;
47
- let a = e(r, i);
48
- if (!a) return null;
49
- let s = t ? n.art : null;
50
- if (t && s && s.width > 0 && s.height > 0) {
51
- let n = e(r, i), o = e(r, i);
52
- if (!n || !o) return null;
53
- n.ctx.drawImage(t, s.x, s.y, s.width, s.height), n.ctx.globalCompositeOperation = "source-in", n.ctx.fillStyle = "#000", n.ctx.fillRect(0, 0, r, i), o.ctx.drawImage(n.canvas, 0, 0), o.ctx.globalCompositeOperation = "destination-in";
54
- for (let [e, t] of [
55
- [1, 0],
56
- [-1, 0],
57
- [0, 1],
58
- [0, -1]
59
- ]) o.ctx.drawImage(n.canvas, e, t);
60
- a.ctx.drawImage(n.canvas, 0, 0), a.ctx.globalCompositeOperation = "destination-out", a.ctx.drawImage(o.canvas, 0, 0), a.ctx.globalCompositeOperation = "source-over";
61
- } else o(a.ctx, n.cell);
62
- return n.plate && o(a.ctx, n.plate), a.canvas;
47
+ let a = e(r, i), o = e(r, i), s = e(r, i);
48
+ if (!a || !o || !s) return null;
49
+ let c = t ? n.art : null;
50
+ if (t && c && c.width > 0 && c.height > 0 ? (a.ctx.drawImage(t, c.x, c.y, c.width, c.height), a.ctx.globalCompositeOperation = "source-in", a.ctx.fillStyle = "#000", a.ctx.fillRect(0, 0, r, i), a.ctx.globalCompositeOperation = "destination-in", a.ctx.fillRect(n.cell.x, n.cell.y, n.cell.width, n.cell.height), a.ctx.globalCompositeOperation = "source-over") : (a.ctx.fillStyle = "#000", a.ctx.fillRect(n.cell.x, n.cell.y, n.cell.width, n.cell.height)), n.plate) {
51
+ let e = n.plate;
52
+ a.ctx.fillStyle = "#000", a.ctx.fillRect(e.x, e.y, e.width, e.height);
53
+ }
54
+ o.ctx.drawImage(a.canvas, 0, 0), o.ctx.globalCompositeOperation = "destination-in";
55
+ for (let e of [
56
+ -1,
57
+ 0,
58
+ 1
59
+ ]) for (let t of [
60
+ -1,
61
+ 0,
62
+ 1
63
+ ]) (e || t) && o.ctx.drawImage(a.canvas, e, t);
64
+ return s.ctx.drawImage(a.canvas, 0, 0), s.ctx.globalCompositeOperation = "destination-out", s.ctx.drawImage(o.canvas, 0, 0), s.ctx.globalCompositeOperation = "source-over", s.canvas;
63
65
  }
64
66
  function c(e, t) {
65
67
  return +(((e + t) % 2 + 2) % 2 == 0);
@@ -272,6 +272,16 @@ export declare class PlacementController {
272
272
  * and a dragged title stays centered on wherever it was dropped.
273
273
  */
274
274
  moveTo(x: number, y: number): void;
275
+ /**
276
+ * The pair {@link moveTo} would write for a requested origin — clamped by
277
+ * the host's own rule against the box {@link seed} measured and snapped
278
+ * onto the lattice — without writing it. A move that shows where it is
279
+ * going before it goes (`vf-icon.dragTo`) reads its landing here first.
280
+ */
281
+ resolve(x: number, y: number): {
282
+ x: number;
283
+ y: number;
284
+ };
275
285
  }
276
286
  /**
277
287
  * The movable contract, as a one-time console warning.
package/dist/position.js CHANGED
@@ -182,8 +182,15 @@ var _ = class {
182
182
  };
183
183
  }
184
184
  moveTo(e, t) {
185
+ let { x: n, y: r } = this.resolve(e, t);
186
+ this.#e.left = n, this.#e.top = r, this.#n = !0;
187
+ }
188
+ resolve(e, t) {
185
189
  let r = this.#e, { x: i, y: a } = this.offset, o = this.#t(e - i, t - a, this.#r ?? this.#i());
186
- r.left = n(o.x + i, r), r.top = n(o.y + a, r), this.#n = !0;
190
+ return {
191
+ x: n(o.x + i, r),
192
+ y: n(o.y + a, r)
193
+ };
187
194
  }
188
195
  #i() {
189
196
  let e = this.#e, t = e.offsetParent, n = t && t.clientWidth > 0 && t.clientHeight > 0 ? t : null;
package/docs/SPEC.md CHANGED
@@ -13,7 +13,7 @@ The System 7 look, distilled:
13
13
  - **Racing-stripe title bars** — 6 horizontal 1px black pinstripes on the white title bar; the title text and window widgets sit on solid white patches that interrupt the stripes.
14
14
  - **Chicago-style type** — bold, dark, tight. One size for almost everything.
15
15
  - **1-bit monochrome palette** — black and white only, plus two grays: light gray (`#C0C0C0`, the kit's dim tone) for dimmed/disabled chrome, and mid gray (`#808080`) as the base tone under the desktop's 50% dither. Scroll troughs use a looser 25% black-on-white dot dither. Surfaces are flat solid white — no bevels.
16
- - **No gradients, no border-radius, no CSS transitions** — interactions are instant. The single sanctioned animation is the classic menu-item "blink" on selection and the indeterminate progress stripes — both suppressed under `prefers-reduced-motion: reduce` (the blink selects immediately). Even the button's rounded corners are not `border-radius` arcs: they are stepped `clip-path` silhouettes traced pixel-for-pixel from the reference sheet (`src/pixel-frame.ts`), so the 1-bit staircase renders with no antialiasing.
16
+ - **No gradients, no border-radius, no CSS transitions** — interactions are instant. The sanctioned animations are the classic menu-item "blink" on selection, the indeterminate progress stripes, and the walk — an icon's drag outline travelling to where a page sends it (`vf-icon.dragTo`, `vf-icon-field.dragIcons`), the Finder's own Clean Up. All three are suppressed under `prefers-reduced-motion: reduce` (the blink selects immediately, the walk lands immediately). Even the button's rounded corners are not `border-radius` arcs: they are stepped `clip-path` silhouettes traced pixel-for-pixel from the reference sheet (`src/pixel-frame.ts`), so the 1-bit staircase renders with no antialiasing.
17
17
  - **Selection inverts** — selected/active states are white-on-black inversion, not tinted highlights.
18
18
 
19
19
  Modern requirements that we deliberately keep (accessibility over purity):
@@ -90,7 +90,7 @@ Every length in this doc is a **system pixel** value; components multiply it by
90
90
  | `--vf-label-line-height` | follows the face | `vf-label`'s own line box, above the face tokens: unset, the box is the face's native line (`--vf-line-height-display` / `--vf-line-height`); set, it overrides both faces for captions alone — keep an override even, or the baseline lands on a half pixel |
91
91
  | `--vf-paragraph-line-height` | follows the face | `vf-paragraph`'s own line box, above the face tokens — same contract as the label's, for paragraphs alone |
92
92
  | `--vf-icon-label-height` | `12px` | `vf-icon`'s name plate line box — the Finder's own plate height, tighter than the face's 16px em, which centers in it (keep an override even, or the baseline lands on a half pixel) |
93
- | `--vf-icon-gap` | `2px` | space between a `vf-icon`'s art cell and its name plate |
93
+ | `--vf-icon-gap` | `0px` | space between a `vf-icon`'s art cell and its name plate — none: the plate sits directly under the cell |
94
94
  | `--vf-select-gutter` | `16px` | checkmark column: `vf-select` left inset / `vf-option` + `vf-menu-item` ✓ column (shared so the value doesn't shift on open) |
95
95
  | `--vf-field-width` | `180px` | default width of `vf-text-field` / `vf-text-area` |
96
96
  | `--vf-field-placeholder` | `#767676` | placeholder text in the editable fields — kept off `--vf-disabled`: a placeholder sits in an *enabled* well and holds AA contrast (4.54:1 on white), where the disabled gray's 1.82:1 is exempt as an inactive control |
@@ -475,19 +475,20 @@ A raster image — the reference art's pixel icons — on the kit's grid, treati
475
475
  #### `vf-icon` (`VfIcon`, vf-icon.ts)
476
476
  The Finder icon — pixel art in a reserved cell with its name on a plate below, as one selectable, movable, renameable unit. `vf-img` puts a picture on the grid; this makes it the thing the Finder manipulates.
477
477
  - **Attributes/props:** `label`: string (the name; empty draws no plate — that is the "no label" setting, rather than a second attribute that could disagree with it). `size`: `large` (default, 32×32) | `small` (16×16) — picks the slot that paints *and* the cell it paints in. `selectable`, `selected`, `movable`, `editable`: boolean. `color`: boolean — declares the art a **color icon**, so selection darkens instead of inverting (see Visual). `open`: boolean — the icon's window is on screen, and the art paints as the derived open ghost (below). `target`: boolean (reflected) — the destination highlight under a drag: the selected treatment of the *art* alone (`invert(1)`, or `brightness(0.5)` under `color`) with none of `selected`'s semantics — no `vf-select`, no outside listener, no `aria-selected`, the plate untouched; the page sets it on the folder a `vf-drag` reports the pointer over. `width`: number (system px, **even**; the cell/grid pitch, which a longer name overflows rather than being bound by). `maxlength`: number (31).
478
- - **Visual:** `display: inline-block`. A column: the art cell (`--_cell` system px square, `overflow: hidden`, art centered), `--vf-icon-gap` (2px), then the name plate — body face on a `--vf-icon-label-height` (12px) line box, the Finder's own plate height: the face's 16px em centers in it, 3px above the ascenders and descenders on the bottom edge, exactly as the Finder drew it — 1px horizontal padding, **opaque `--vf-white`** in its own right rather than `--vf-surface`: on the desktop dither the name reads because it sits on a plate, and `--vf-surface` is unset out there (`Example screen (1-bit).png`, the "Macintosh HD" icon). Selected: the plate takes the `--vf-highlight` pair and the art takes `filter: invert(1)` — a System 7 icon is ink and opaque white on a transparent surround, i.e. precisely an image plus its mask, so inverting flips the two and leaves the surround alone. That is the complete classic selected appearance for 1-bit art. Color art would invert into a photographic negative, which System 7 never showed: declare `color` and selection **darkens** instead — Icon Utilities' ttSelected transform, every color blended halfway toward black (`filter: brightness(0.5)`), whites going gray, the surround still untouched. The declaration is the consumer's, since the component cannot tell color art from a mask by looking at a slotted image; it covers whatever the cell shows (the open ghost included, so a color icon has one selected treatment open or closed), and the plate inverts either way — the selected name was inverted whatever the art.
478
+ - **Visual:** `display: inline-block`. A column: the art cell (`--_cell` system px square, `overflow: hidden`, art centered), then, directly under it (`--vf-icon-gap`, 0 by default), the name plate — body face on a `--vf-icon-label-height` (12px) line box, the Finder's own plate height: the face's 16px em centers in it, 3px above the ascenders and descenders on the bottom edge, exactly as the Finder drew it — 1px horizontal padding, **opaque `--vf-white`** in its own right rather than `--vf-surface`: on the desktop dither the name reads because it sits on a plate, and `--vf-surface` is unset out there (`Example screen (1-bit).png`, the "Macintosh HD" icon). Selected: the plate takes the `--vf-highlight` pair and the art takes `filter: invert(1)` — a System 7 icon is ink and opaque white on a transparent surround, i.e. precisely an image plus its mask, so inverting flips the two and leaves the surround alone. That is the complete classic selected appearance for 1-bit art. Color art would invert into a photographic negative, which System 7 never showed: declare `color` and selection **darkens** instead — Icon Utilities' ttSelected transform, every color blended halfway toward black (`filter: brightness(0.5)`), whites going gray, the surround still untouched. The declaration is the consumer's, since the component cannot tell color art from a mask by looking at a slotted image; it covers whatever the cell shows (the open ghost included, so a color icon has one selected treatment open or closed), and the plate inverts either way — the selected name was inverted whatever the art.
479
479
  - **The open ghost is derived, not shipped** (`open`; `open-art.ts`). The art redraws as the Finder's open-window ghost — outline held in solid black, interior re-filled with the scrollbar trough's 4×2 dot lattice (a dot at (0,0) and (2,1), 25%) on opaque white, surround untouched — derived from the slotted art itself, by compositing alone: a silhouette via `source-in`; a 1px 4-neighborhood erosion via four `destination-in` draws of the silhouette shifted one pixel each way (off-canvas composites as transparent, so the raster's own edge erodes too and an interior hole rings itself); the lattice via `createPattern` anchored at the art's top-left, where 32 and 16 being whole multiples of the tile keeps a field of icons in one phase; then the fill composed over the un-eroded silhouette, so the ring the erosion removed reads as the outline. Never `getImageData` — a canvas that drew a cross-origin image is tainted, which forbids *reading* pixels but not drawing or displaying them, so the ghost works for CORS-less sources too — and never `ctx.filter` (Safari's shaky corner; compositing operators are universal). Keeping the interior *opaque white* is what lets a selected open icon invert under the same `filter: invert(1)` with no second treatment. The slot stays in the tree while the ghost paints, hidden via a class gated on a successful derivation — art the pipeline cannot draw (nothing slotted, a failed load, an inline `<svg>`) keeps rendering as itself. The ghost re-derives on slotchange, the art's `load`/`error`, and `open`/`size` changes, keyed by `currentSrc` so a refresh that changed nothing is a string compare; the source's `alt` is carried onto the ghost (`role="img"` + `aria-label`) so a graphic that names its icon keeps doing so while its slot is hidden. The ghost displays on `vf-img`'s terms: natural raster size in system px, `image-rendering: pixelated`, one image pixel per system pixel.
480
480
  - **Behavior:** clicking selects, Shift/⌘ toggles, and a press outside every icon clears — a `DocumentListenersController` capture-phase listener attached only while selectable *and* selected, which is what makes single-selection work with no container owning the set. Double-click fires `vf-open`, and its keyboard route is ⌘O / ⌘↓ (Ctrl off the Mac) — the System 7 Open shortcuts, added because a double-click is a pointer-only gesture (§1). Return is deliberately not one: the Finder's Return renamed, never opened, so it starts the edit on an editable icon and does nothing on a non-editable one. A double-click opens the icon **wherever it lands, the name included** — the handler is on the frame, and the name is as much the icon as the art is. `editable`: a press on the plate of an ALREADY-selected icon opens a rename field overlaying it (the press that does the selecting never does); the whole name starts selected, Return commits, Escape reverts, and the hidden plate keeps rendering the draft so the box widens as you type. **The two pointer gestures on a name are the same press**, and only the second one tells them apart, so the rename *waits*: the press arms a field that opens `RENAME_DELAY_MS` (800ms, `src/motion.ts`) later, and a press landing inside that window — wherever in the icon it falls — calls it off, leaving the double-click to open with no rename flashing up behind it. The window is long deliberately: no API reports what the browser counts as a double-click (it follows a user-movable platform setting), and reading a lone click as a pair costs only a wait, while reading a pair as a lone click renames when the user meant to open. A press that travels into a drag, a press outside, and any key call it off too — so a name drags like the art does, and Return opens the field at once, having no second half to wait for. `movable` — **not `draggable`**, which is a global HTML attribute and an `HTMLElement` accessor (the same trap as `align`, §5 Group G) — drags via `DragController` on the `vf-window` delegate shape (the frame is the handle and sets `touch-action: none` while movable, as the title bars do), plus arrow-key nudging (1 system px, 8 with Shift) because a pointer-only gesture is the kind of gap the kit closes (§1). Focus is the dashed rule below the plate, gated on `FocusRuleController` rather than `:focus-visible`: the host focuses itself so the press-drag can own the pointer.
481
- - **The drag reports, the page files.** The kit ships no filing semantics — folders are the page's own catalog — so a drag is a stream of events on the icon and a cancelable commit, all bubbling and composed: `vf-drag-start` `{ left, top }` on the first lattice step away from the press (the jitter test: a stationary press snaps back onto the same system px and never starts a drag, so a plain click never fires a drop); `vf-drag` `{ clientX, clientY, left, top, x, y }` on every step that changed the snapped proposal — the pointer in viewport CSS px for the page's hit test, the proposal in the icon's own container in whole system px on the lattice, and the frame's box at the press translated by the delta in viewport CSS px, so a drop that lands in another container converts with that container's `placementAt` and lands where it was let go, the press offset already inside it; `vf-drop`, the same shape at the release, **cancelable**, whose default action is the move — `PlacementController.moveTo` with the proposal, clamped whole by `#keepWhole` against the box measured at the press — and whose `preventDefault()` writes nothing, the page re-parenting or placing the icon itself; `vf-drag-cancel` `{}` on Escape or a `pointercancel`, nothing written. `left`/`top` in the detail are the proposal *unclamped* (the origin plus the lattice-snapped delta); only the default action clamps, so a page that cancels gets the raw gesture. The drop is dispatched with the outline gone, the drag state cleared and the pointer capture released, so re-parenting inside the handler is safe (Chromium drops the `click` of a press whose node was re-inserted at `pointerup`; the icon listens for no click and times its double-click on presses).
482
- - **The drag is an outline; the icon stays put** (`deriveDragOutline` / `dotOutline`, `open-art.ts`). The Finder dragged an icon as a dotted outline — the mask's boundary and the name's rectangle — drawn over everything with the XOR pen, the icon itself unmoved until the drop. Derived from the slotted art like the open ghost: the silhouette from the art's alpha (drawn at the box the art paints in, so magnified art outlines at its magnified size), the one-pixel erosion by four `destination-in` draws on a frame-sized layer (the frame is transparent around the art, so its edge erodes as the off-canvas edge did), the ring the erosion removes via `destination-out`, plus the plate's rectangle as fills (a 1px stroke straddles the pixel); compositing only, so cross-origin art derives too. Art the pipeline cannot draw falls back to the cell's rectangle — never a blank. One canvas the size of the frame at one image px per system px; the ring is derived once per drag, and each step re-dots it against a 2×2 checker (`destination-in`) at the pen's phase for where it lands on the *screen* (`penPhase`): ink where `x + y` is odd in screen coordinates, the diagonal the desktop dither (`gray-50`, ink at even) leaves white, so the dots fall between the dither's ink wherever the outline lands, as QuickDraw's screen-anchored pattern pen did — over a white body a dotted black line, over the dither a black line, each dot flipping a white pixel with the dither's own ink filling in between. Painted with the cursor's XOR recipe, `filter: invert(1)` under `mix-blend-mode: difference`, `image-rendering: pixelated`, `pointer-events: none`, sized and placed as live `sysLength()`s so a scale change mid-gesture cannot smear it; its origin is the frame's whole-system-px offset from the surface plus the delta. **The surface is the desktop's, not the top layer:** the icon dispatches `vf-drag-surface-request` (bubbles, `composed: false`, `detail.surface` null) on the first step, and the nearest `vf-desktop` on its light-DOM path fills it with its drag surface (§5 vf-desktop); a non-composed event from a slotted icon still travels through the slots it is assigned to, so the handshake works from inside a window body. Without a desktop the canvas is appended to the icon's own `.frame` (the vf-snap box, `position: relative`), translated by the delta alone and clipped by whatever clips the icon — the honest fallback, with the same gesture and events. Not `position: fixed` inside the icon: a `vf-window` is a stacking context, so a fixed outline inside it would paint at the window's z, under every other window (KNOWN-BUGS.md #1 in another costume). One drag, no opt-in: the Finder never moved the icon itself, the drop lands where it always did, and the kit ships no taste knobs. Escape is heard by a document `keydown` listener scoped to the gesture (`DocumentListenersController`, capture phase, the key stopped there so an enclosing `vf-dialog` never reads it as a dismissal) rather than the icon's own handler, because a `movable`-only icon never takes focus — an addition in the kit's idiom (§1), not a claim about the Finder. `DragController` gained the two trailing parameters this needs (`onDrag(x, y, event)`, `onDragEnd(event, cancelled)`) and a `cancel()`; `vf-window` and `vf-dialog` ignore them. A selected icon re-parented at the drop keeps its outside-press listener: it re-attaches on connect, since the controller detaches on disconnect and `updated()` does not re-run for an unchanged property. `npm run verify:icon-drag`.
481
+ - **The drag reports, the page files.** The kit ships no filing semantics — folders are the page's own catalog — so a drag is a stream of events on the icon and a cancelable commit, all bubbling and composed: `vf-drag-start` `{ left, top }` on the first lattice step away from the press (the jitter test: a stationary press snaps back onto the same system px and never starts a drag, so a plain click never fires a drop); `vf-drag` `{ clientX, clientY, left, top, x, y }` on every step that changed the snapped proposal — the pointer in viewport CSS px for the page's hit test, the proposal in the icon's own container in whole system px on the lattice, and the frame's box at the press translated by the delta in viewport CSS px, so a drop that lands in another container converts with that container's `placementAt` and lands where it was let go, the press offset already inside it; `vf-drop`, the same shape at the release, **cancelable**, whose default action is the move — `PlacementController.moveTo` with the proposal, clamped whole by `#keepWhole` against the box measured at the press; in a box that *scrolls* (a `vf-scroll-area`'s plane, which a window body is under `scrollbars`) only the origin holds, since the rails reach anything placed past it and the Finder put an icon below a window's fold and scrolled to it — `#anchorScrolls`, a flat-tree walk from the icon toward its positioning parent through the slots it is assigned to, true when a scroll area is met before the parent — and whose `preventDefault()` writes nothing, the page re-parenting or placing the icon itself; `vf-drag-cancel` `{}` on Escape or a `pointercancel`, nothing written. `left`/`top` in the detail are the proposal *unclamped* (the origin plus the lattice-snapped delta); only the default action clamps, so a page that cancels gets the raw gesture. The drop is dispatched with the outline gone, the drag state cleared and the pointer capture released, so re-parenting inside the handler is safe (Chromium drops the `click` of a press whose node was re-inserted at `pointerup`; the icon listens for no click and times its double-click on presses).
482
+ - **The drag is an outline; the icon stays put** (`deriveDragOutline` / `dotOutline`, `open-art.ts`). The Finder dragged an icon as a dotted outline — the mask's boundary and the name's rectangle — drawn over everything with the XOR pen, the icon itself unmoved until the drop. Derived from the slotted art like the open ghost: the silhouette from the art's alpha (drawn at the box the art paints in, so magnified art outlines at its magnified size), the silhouette clipped to the cell as the cell clips the art, the one-pixel erosion by eight `destination-in` draws on a layer the outline's size (the layer is transparent around the art, so its edge erodes as the off-canvas edge did) — the 3×3 box, the region inset `FrameRgn` painted a frame from, rather than the ghost's four-neighbor plus: a 45° edge comes out two pixels wide with both parities of the checker, where a one-pixel diagonal is all one parity and the pen would keep all of it or none, and over the dither "none" is the dither's own ink diagonal — the plate's rectangle filled solid into the same silhouette before the erosion (the Finder's drag region was the mask united with the name's rect, framed once — where the two abut, the outline wraps around both and no edge runs between them; apart, each is ringed on its own), the ring the erosion removes via `destination-out`; compositing only, so cross-origin art derives too. Art the pipeline cannot draw falls back to the cell's rectangle — never a blank. One canvas the size of the frame widened to the plate — a name wider than a declared `width` overhangs the frame on both sides — at one image px per system px; the ring is derived once per drag, and each step re-dots it against a 2×2 checker (`destination-in`) at the pen's phase for where it lands on the *screen* (`penPhase`): ink where `x + y` is odd in screen coordinates, the diagonal the desktop dither (`gray-50`, ink at even) leaves white, so the dots fall between the dither's ink wherever the outline lands, as QuickDraw's screen-anchored pattern pen did — over a white body a dotted black line, over the dither a black line, each dot flipping a white pixel with the dither's own ink filling in between. Painted with the cursor's XOR recipe, `filter: invert(1)` under `mix-blend-mode: difference`, `image-rendering: pixelated`, `pointer-events: none`, sized and placed as live `sysLength()`s so a scale change mid-gesture cannot smear it; its origin is that box's whole-system-px offset from the surface plus the delta. **The surface is the desktop's, not the top layer:** the icon dispatches `vf-drag-surface-request` (bubbles, `composed: false`, `detail.surface` null) on the first step, and the nearest `vf-desktop` on its light-DOM path fills it with its drag surface (§5 vf-desktop); a non-composed event from a slotted icon still travels through the slots it is assigned to, so the handshake works from inside a window body. Without a desktop the canvas is appended to the icon's own `.frame` (the vf-snap box, `position: relative`), translated by the delta alone and clipped by whatever clips the icon — the honest fallback, with the same gesture and events. Not `position: fixed` inside the icon: a `vf-window` is a stacking context, so a fixed outline inside it would paint at the window's z, under every other window (KNOWN-BUGS.md #1 in another costume). One drag, no opt-in: the Finder never moved the icon itself, the drop lands where it always did, and the kit ships no taste knobs. Escape is heard by a document `keydown` listener scoped to the gesture (`DocumentListenersController`, capture phase, the key stopped there so an enclosing `vf-dialog` never reads it as a dismissal) rather than the icon's own handler, because a `movable`-only icon never takes focus — an addition in the kit's idiom (§1), not a claim about the Finder. `DragController` gained the two trailing parameters this needs (`onDrag(x, y, event)`, `onDragEnd(event, cancelled)`) and a `cancel()`; `vf-window` and `vf-dialog` ignore them. A selected icon re-parented at the drop keeps its outside-press listener: it re-attaches on connect, since the controller detaches on disconnect and `updated()` does not re-run for an unchanged property. `npm run verify:icon-drag`.
483
483
  - **The selection travels.** A drag that begins on a *selected* icon carries every other selected, movable icon of its field (`closest('vf-icon-field, [role="listbox"]')`, document order) — the Finder outlined the whole selection under a drag on any member. Each follower is joined through `vf-icon.followDrag(surface)` (internal to the group drag): it seeds its own origin, builds its own outline on the surface the leader's handshake found (or in its own frame), and hands back a handle `{ icon, origin, size, move(dx, dy), drop(dx, dy), end() }`. The leader moves every outline by its lattice delta on each step; every event's detail carries the set as `icons`, the leader first (`VfIconDragDetail`). The drop's default action clamps the delta **once for the whole group** — per axis, the tightest of every member's room to its edges, so the arrangement is kept and the group stops when its outermost icon meets the container (a group no edge can hold is held off the near edge only, the single-icon rule; `PlacementController.bounds` is the box, measured at the press) — then writes each member's origin plus that delta through its own `moveTo`. A cancel, or a cancelled drop, takes every outline down and writes nothing for anyone. **The press keeps the selection:** an icon's outside-press listener leaves the selection alone when a plain press lands on an icon already selected in the same field (document capture runs before the pressed icon's own handler, so `selected` reads as the press found it); a click on such an icon, released with no drag, collapses the selection to it on the `pointerup` — so a click still single-selects, and the same press could have dragged them all. A press on an unselected icon makes it the selection first, so it drags alone; a Shift press that deselects the pressed icon drags it alone too; a selected icon in another field, or one that cannot move, stays. `npm run verify:icon-drag` (GROUP).
484
+ - **The page drags it too** (`moveTo`, `dragTo`; `vf-icon-field.dragIcons` below). The Finder's Clean Up walked a container's icons one at a time, each icon's outline travelling from where it sat to its cell and the icon landing when the outline arrived — the drag's vocabulary, with the Finder for a hand. `dragTo(left, top)` → `Promise<boolean>`: the landing is resolved first (`PlacementController.resolve` — the pair `moveTo` would write, clamped whole and snapped, without writing it — so the outline goes where the icon will land, not where a pair past the edge pointed), the outline built and placed as a drag's is (`#buildOutline`, on the desktop's surface through the handshake or in the frame), then stepped from the origin to the landing by `runOutlineTravel` (`src/motion.ts`): whole steps of `WALK_STEP_PX` (16) every `WALK_STEP_MS` (25), each re-dotted at the screen's phase through `#placeOutlineAt`, the last step exactly the landing, and one interval later the outline down and the icon written through `PlacementController.moveTo` — one `vf-placement-change`, no drag event (the page is the mover and already knows). Constant speed rather than a fixed frame count: most of a Clean Up's moves are short, and a fixed count would crawl a one-pixel correction across as many frames as a trip across the screen. A timer chain, not `requestAnimationFrame`, so a 120 Hz display does not double the speed. Resolves to whether the outline travelled — false when the icon landed at once: already at its landing, `prefers-reduced-motion` (the blink's posture), nothing to draw with, mid-rename or under the hand's own press, or not in the DOM (nothing written then). Not gated on `movable`, which says the hand may drag; the page may always place its icon. **Finished, never cancelled:** a document `pointerdown` or Escape (capture, scoped to the travel, the key stopped so a dialog never dismisses) lands the icon at once — the user wants the machine back, and the move was the page's; so does a second `dragTo`, a `moveTo`, or disconnecting (outline down, nothing written). `moveTo(left, top)` is the landing alone — the drop's write: the container measured now (`seed()`), clamped whole, snapped, announced once; a `left`/`top` write stays the authored, unclamped pair (the `selected` / `setSelected()` line). The three cadence numbers are set by eye against the Finder and asserted nowhere. `npm run verify:icon-drag` (WALK).
484
485
  - **An icon alone is a picture; an icon in a field is an option.** `option` is invalid without a `listbox` that owns it — written unconditionally the browser drops the role *and* `aria-selected`, which is how a `selectable` icon reached AT as a bare generic in every configuration the kit shipped. So the role follows the container: `role="option"` + `aria-selected` when a `vf-icon-field` or a `[role="listbox"]` ancestor claims it (`closest('vf-icon-field, [role="listbox"]')` — the field's role lives in internals and never lands as an attribute), otherwise `role="img"` named from `label` (else the art's `alt`), since `img` is not a name-from-content role. Not `button` — that promises Enter/Space activate, while here Return renames and the open route is ⌘O / ⌘↓. Re-derived on every connect, so re-parenting between the two contexts re-grades the icon. **The container for a field of icons is `vf-icon-field`** (below); a consumer's own element carrying `role="listbox"` still owns an icon the same way. `vf-desktop` cannot be it, since it also holds windows and a menu bar and a non-`option` child of a listbox is invalid the same way. Divergence from APG, recorded: its listbox options share one roving tab stop, the kit's stay one stop each.
485
486
  - **`selectable` is what makes an icon focusable** — `movable` and `editable` require it, as the Finder did (you cannot move or rename what you have not selected; the rename already opens only on an ALREADY-selected icon). A `movable`-only icon is draggable but not a tab stop, rather than a tab stop that announces nothing.
486
487
  - **A name is never abbreviated, and never folded:** no ellipsis, no clipping, no wrapping — `white-space: nowrap`, one line always. System 7 solved the long-name problem at the other end — HFS capped a filename at 31 characters — so the Finder always drew the name in full. Wider than its cell, it overflows it, centered. `width` is therefore the cell (the grid pitch), not a bound on the name.
487
488
  - **Every centered offset is whole, by parity.** The frame centers two things over one axis, and a centered child sits at `(box − child) / 2` — whole exactly when box and child share a parity. Half a system pixel is what fringes 1-bit art: glyph stems smear across two device columns and go gray while the plate behind them stays sharp, since backgrounds are pixel-snapped by the compositor and glyphs are not (hence a crisp plate under a gray name). So the component makes the parities agree rather than correcting afterwards. The cell is 32 or 16; `#measurePlate()` measures the text with a `Range` over the plate's own contents — the plate already carries the width this last computed, so reading the element back would only return it — and sizes the plate (an `inline-block`) to that plus its 1px padding, rounded UP to a whole **even** number of system px, so it never clips the run it was measured from. The measurement is in system px and therefore scale-invariant, which is why nothing re-runs on a density change; it re-runs on `label`, `_draft`, `_editing`, and once on `document.fonts.ready`, since a name measured against the fallback face is a different width. The text is NOT centered inside its own plate (`text-align: left` against the block's `center`) — that would re-introduce the half pixel one level down; it starts at the 1px padding edge, so its x is the plate's plus one whole pixel, and the rounding slack lands after it as a hairline of extra plate. The rename field puts its run exactly where the plate's is, so the name does not shift when editing starts; its 1px border and 1px white well are a wrapper around the input rather than the input's own border and padding, because the selection behind a highlighted name paints at the face's full 16px em and is clipped only at the input's own edge — split, the input stands the plate's 12px line box (clipping the selection to it) and the well stays white, for an edit box 16 system px tall in all, not the em plus trim. Staying on one line is part of the same argument: one run, one measured width, one parity. Nothing is snapped and nothing leans on the rasterizer — the kit's normal antialiasing stays on, and `verify:icon` asserts both the geometry and zero gray pixels across a field of names at dpr 1/2/3, declared width and auto, with a control that forces an odd plate and requires the fringe to return. The one thing the component cannot round is a `width` the consumer chose, so that must be even.
488
489
  - **The 31-char cap** is `maxlength` on the rename field, and exceeding it fires `vf-name-too-long` rather than dropping characters silently. Detected in `beforeinput`, not `input`: with `maxlength` set, a blocked keystroke fires `beforeinput` and then *no* `input` at all, while an overshooting paste reaches `input` already trimmed — only the "about to change" event still knows what was attempted. `input` carries a trimming backstop for any route that skips it. The cap bounds typing only; a `label` set from consumer code is displayed as given and fires nothing (the name is the consumer's data).
489
490
  - **An empty name is refused, not applied.** A file has to be called something, and System 7 would not commit a nameless one: a rename committed empty — or as nothing but spaces, which would read as blank either way — drops the edit and restores the previous name, firing `vf-name-rejected` and deliberately no `vf-change`. An empty `label` remains a valid *starting* state (a freshly made icon has no name yet): it draws no plate but stays selectable, focusable and renameable. The caption element is therefore rendered whenever there is a name **or** an edit is open — without that an unnamed icon has nowhere to put the field and could never be named at all. The plate hugs its text in BOTH states, which is what keeps a commit from moving the name: it is the same box either side, so the glyphs do not shift. The single exception is an edit with no text in it at all, which reserves the cell width so the field is usable rather than a 2px sliver, and goes back to hugging on the first character. That floor is the cell, which is even, so the parity rule holds.
490
- - **Methods:** `startEditing()`, `commitEditing()`, `cancelEditing()` — the rename field's three routes. `setSelected(next)` → select or deselect as a press would, `vf-select` included (a `selected` write from code is silent, the way a value set fires no `vf-change`); the route a container's gesture takes — `vf-icon-field`'s rubber band. `touches(box)` → whether a viewport box (CSS px `left/top/right/bottom`) reaches the icon's art cell or its name plate — the Finder's selection-rectangle test, in which the empty cell around narrower art and the frame's margin beside the plate count for nothing; the rubber band reads it.
491
+ - **Methods:** `startEditing()`, `commitEditing()`, `cancelEditing()` — the rename field's three routes. `setSelected(next)` → select or deselect as a press would, `vf-select` included (a `selected` write from code is silent, the way a value set fires no `vf-change`); the route a container's gesture takes — `vf-icon-field`'s rubber band. `touches(box)` → whether a viewport box (CSS px `left/top/right/bottom`) reaches the icon's art cell or its name plate — the Finder's selection-rectangle test, in which the empty cell around narrower art and the frame's margin beside the plate count for nothing; the rubber band reads it. `moveTo(left, top)` → place as a drop would: clamped whole in the container, snapped, one `vf-placement-change`. `dragTo(left, top)` → the outline travels and the icon lands, a promise — the walk, above.
491
492
  - **Slots:** `large` (32×32 art, normally a `vf-img`), `small` (16×16). **Parts:** `frame`, `icon`, `label`, `plate`, `input`.
492
493
  - **Events:** `vf-select` `{ selected }`, `vf-change` `{ label, previous }`, `vf-open` `{}`, `vf-name-too-long` `{ attempted, accepted, limit }`, `vf-name-rejected` `{ attempted, kept, reason }`, `vf-drag-start` `{ left, top, icons }`, `vf-drag` and `vf-drop` `{ clientX, clientY, left, top, x, y, icons }` (`vf-drop` cancelable), `vf-drag-cancel` `{}`.
493
494
 
@@ -497,6 +498,7 @@ The container a field of `vf-icon`s sits in — a desktop's icons, a folder wind
497
498
  - **Semantics through internals:** `role="listbox"` and `aria-multiselectable="true"` always — the Finder was always multi-select, so there is no attribute for it — so a consumer's own `role`/`aria-*` on the tag wins (SPEC §2). A `selectable` icon inside is an `option` carrying `aria-selected`.
498
499
  - **Visual:** none. `display: block; width: fit-content` — an in-flow block with no size, no inset and no position of its own, painting nothing (the `vf-stack` posture, with its typographic-transparency reset). A field whose icons are all placed is a zero-height block, so the icons keep anchoring to the desktop's raster or the window's plane, stored coordinates mean what they meant, and a press on the bare dither still reaches the desktop. Stated `top`/`left` and `width`/`height` make it a box and the anchor its icons place against — the placement working, as documented for everything. No `GridSnapController`: it paints nothing and its icons correct their own origins. Carries a `ScaleController` for a declared size on a plain page (the `vf-stack` reasoning).
499
500
  - **The rubber band** — the kit's first piece of a container-level selection model. A `pointerdown` on the host whose `target` is the host itself (nothing slotted was hit; a press on an icon arrives with the icon as target and is the icon's own gesture), button 0, on a field with a box: the pointer is captured on the host, the press's default suppressed (no text selection across the page), and the **anchor** read — the icons selected *as the press found them*; the icons' outside-press listeners are document capture, so they have already run: a plain press cleared everything (an empty anchor), Shift or ⌘ kept the selection. The first move whose point (whole system px from the field's box) differs from the press starts the band; each changed rectangle — press to point, both held inside the band's *reach* — is repainted (`paintSelectionRect`, `open-art.ts`: the drag outline's dotted one-pixel ring at the rectangle's size, a degenerate axis as a one-pixel line, phased on the rectangle's corner on the *screen* — the field's offset from the desktop's drag surface, read at the press through the same `vf-drag-surface-request` handshake the outline uses, plus the corner in the field; the field's own box with no desktop — so over the dither the band reads as a black line whatever the field's offset, `penPhase`) and the icons re-read by the Finder's one rule: **a `selectable` icon is selected exactly when it is in the anchor XOR the rectangle touches it** — so a plain band selects what it touches and releases what it leaves, and a Shift band *toggles*: a selected icon it covers deselects while covered and comes back when it leaves, an unselected one selects. "Touches" is the icon's own reading (`vf-icon.touches(box)`: its art cell or its name plate, not the empty cell around narrower art or the frame's margin beside the plate, so a rectangle through the gap between two icons selects neither). Each change goes through `vf-icon.setSelected()` so it fires `vf-select` as a press would; the release keeps the result, a cancel restores the anchor. **The reach** is the field's own box intersected with every ancestor that clips (`overflow` other than `visible` on either axis — a window body, a scroll viewport, the desktop's raster), found by walking the flat tree through assigned slots and shadow hosts, rounded inward to whole system px; so the band never paints outside the region the icons are visible in. **Where it draws:** a canvas in the field's own shadow, `position: fixed` against the viewport (a layout-neutral field has no positioned box to anchor to; the field's box sits on the device grid, so whole system px from it land on the grid too), carrying the drag outline's XOR pen inline (`filter: invert(1)`, `mix-blend-mode: difference`, `image-rendering: pixelated`, `pointer-events: none`). That is the field's own stacking level, which is where the Finder drew its marquee: on the desktop, under the windows (the field precedes them in flow and takes no z-index) and over the dither and icons; in a window body, inside that window's stacking context — over its content, under any window above it — not the desktop's drag surface, which would put a window's marquee over every other window. Escape (a gesture-scoped document capture listener, stopped so a dialog never dismisses) and `pointercancel` cancel: the canvas goes and the selection is put back to the kept set; a release keeps what the band made. `touch-action` is deliberately left alone: a touch drag on a scrolling window's background pans it as before, and the `pointercancel` the browser then sends cancels the band. A field with no box (unplaced, unfilled) receives no press and draws none. `npm run verify:icon-drag` (BAND).
501
+ - **The walk** — `dragIcons(moves: { icon, left, top }[])` → `Promise<void>`: the Finder's Clean Up, the icons walked one at a time in the array's order — the order is the page's, a statement about its lattice, which the kit does not ship; the cadence is the kit's — each through `vf-icon.dragTo`, then `WALK_BEAT_MS` (50, `src/motion.ts`) after every landing that showed; a landing that showed nothing (the icon already there, reduced motion, gone from the DOM) takes no beat, so a tidy field resolves at once. Resolves when the last has landed. One walk per field: a second call finishes the first. Finished, never cancelled: a document `pointerdown` or Escape (capture, scoped to the walk, the key stopped) lands every icon still to go at its target through `moveTo` — the one travelling included, whose `moveTo` finishes its own travel — cuts the beat and resolves; the field disconnecting does the same; an icon gone from the DOM by its turn is skipped. The icons are the page's list, not checked against the field's own: the walk is a set gesture the container runs on its icons' behalf, where the band already lives, and "one at a time" is a claim about the container — the Finder cleaned up one window, or the desktop. `npm run verify:icon-drag` (WALK).
500
502
  - **The desktop uses it and renders none.** Desktop icons sit in a field slotted into `vf-desktop` beside the windows, written by the page; a folder window's icons in one slotted into the window body. `vf-desktop` builds no field of its own: its furniture is slotted light DOM and the page decides what it is (the `clearActive` rule), a desktop with no icons should carry no empty listbox, and a field inside the desktop's shadow is one `closest()` could not reach.
501
503
  - **Slots:** default (the icons). `npm run verify:icon-drag` (FIELD); `verify:position`'s UNIVERSAL group counts it as the 32nd element.
502
504