vintage-frames 0.12.1 → 0.12.3

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.
@@ -65,7 +65,10 @@ declare const VfDesktop_base: (new (...args: any[]) => import("../position.js").
65
65
  * icon reaches it without an import, the menu-handshake idiom: on a drag's
66
66
  * first step it dispatches `vf-drag-surface-request` (bubbles, non-composed,
67
67
  * `detail.surface` null), and the nearest desktop on its light-DOM path
68
- * fills the detail with the layer. Not the top layer: stable Safari cannot
68
+ * fills the detail with the layer. A window asks the same way and draws
69
+ * there with the same pen: its zoom rects when it opens from a rect
70
+ * (`vf-window.show({ from })`), its outline under an `outline-drag`. Not the
71
+ * top layer: stable Safari cannot
69
72
  * blend an element there against the page (src/cursor.ts), and a second
70
73
  * kit entry in the top layer would need a re-promotion handshake.
71
74
  *
@@ -307,10 +310,11 @@ export declare class VfDesktop extends VfDesktop_base {
307
310
  */
308
311
  private _onGestureEnd;
309
312
  /**
310
- * A dragged icon asking for the screen's drag surface (see the class
311
- * doc). Non-composed, so it reaches here only through the light-DOM path
312
- * the icon is slotted on — a window body included. The nearest desktop
313
- * answers; an outer one leaves a filled detail alone.
313
+ * A dragged icon, or a window opening from a rect, asking for the screen's
314
+ * drag surface (see the class doc). Non-composed, so it reaches here only
315
+ * through the light-DOM path the asker is slotted on — a window body
316
+ * included. The nearest desktop answers; an outer one leaves a filled
317
+ * detail alone.
314
318
  */
315
319
  private _onDragSurfaceRequest;
316
320
  /**
@@ -7,13 +7,13 @@ import { vfBase as o } from "../styles/recipes/host.js";
7
7
  import { DocumentListenersController as s } from "../document-listeners.js";
8
8
  import { VfSized as c } from "../size.js";
9
9
  import "../motion.js";
10
- import { paintSelectionRect as l, penPhase as u } from "../open-art.js";
11
- import { LitElement as d, css as f, html as p } from "lit";
12
- import { property as m } from "lit/decorators.js";
10
+ import { paintSelectionRect as l, penPhase as u, xorPenCanvas as d } from "../open-art.js";
11
+ import { LitElement as f, css as p, html as m } from "lit";
12
+ import { property as h } from "lit/decorators.js";
13
13
  //#region src/components/vf-icon-field.ts
14
- var h = (e, t, n) => Math.min(Math.max(e, t), n), g = class extends c(a(d)) {
14
+ var g = (e, t, n) => Math.min(Math.max(e, t), n), _ = class extends c(a(f)) {
15
15
  static {
16
- this.styles = [o, f`
16
+ this.styles = [o, p`
17
17
  :host {
18
18
  /* A block that shrink-wraps: the field is exactly as big as what it
19
19
  holds in flow — nothing, for a field of placed icons — so it can
@@ -137,8 +137,8 @@ var h = (e, t, n) => Math.min(Math.max(e, t), n), g = class extends c(a(d)) {
137
137
  }
138
138
  #h(e, t, n, r) {
139
139
  return {
140
- x: h(Math.round((e.clientX - t.left) / n), r.minX, r.maxX),
141
- y: h(Math.round((e.clientY - t.top) / n), r.minY, r.maxY)
140
+ x: g(Math.round((e.clientX - t.left) / n), r.minX, r.maxX),
141
+ y: g(Math.round((e.clientY - t.top) / n), r.minY, r.maxY)
142
142
  };
143
143
  }
144
144
  #g(e, t) {
@@ -172,10 +172,8 @@ var h = (e, t, n) => Math.min(Math.max(e, t), n), g = class extends c(a(d)) {
172
172
  };
173
173
  }
174
174
  #v() {
175
- let e = document.createElement("canvas");
176
- e.className = "selection-rect";
177
- let t = e.style;
178
- return t.position = "fixed", t.display = "block", t.pointerEvents = "none", t.filter = "invert(1)", t.mixBlendMode = "difference", t.imageRendering = "pixelated", e;
175
+ let e = d("selection-rect");
176
+ return e.style.position = "fixed", e;
179
177
  }
180
178
  #y(e, t) {
181
179
  let { rect: n, canvas: r } = e;
@@ -238,9 +236,9 @@ var h = (e, t, n) => Math.min(Math.max(e, t), n), g = class extends c(a(d)) {
238
236
  e.finished || (e.finished = !0, this.#r === e && (this.#r = null, this.#i.detach()), e.settle());
239
237
  }
240
238
  render() {
241
- return p`<slot @slotchange=${this.#s}></slot>`;
239
+ return m`<slot @slotchange=${this.#s}></slot>`;
242
240
  }
243
241
  };
244
- i([m()], g.prototype, "label", void 0), i([m({ reflect: !0 })], g.prototype, "size", void 0), g = i([t("vf-icon-field")], g);
242
+ i([h()], _.prototype, "label", void 0), i([h({ reflect: !0 })], _.prototype, "size", void 0), _ = i([t("vf-icon-field")], _);
245
243
  //#endregion
246
- export { g as VfIconField };
244
+ export { _ as VfIconField };
@@ -220,8 +220,9 @@ declare const VfIcon_base: (new (...args: any[]) => import("../position.js").VfP
220
220
  * The kit ships no filing semantics — folders are the page's own catalog —
221
221
  * so a drag is a stream of events and a cancelable commit, on the icon:
222
222
  *
223
- * - `vf-drag-start` `{ left, top }` on the first lattice step away from the
224
- * press (a plain click never starts one, and never fires a drop);
223
+ * - `vf-drag-start` `{ left, top }` on the first lattice step past the drag
224
+ * slop (a click or a tap never starts one, and never fires a drop — see
225
+ * "Mouse, finger and pen" below);
225
226
  * - `vf-drag` `{ clientX, clientY, left, top, x, y }` on every step that
226
227
  * changed the snapped proposal;
227
228
  * - `vf-drop`, the same shape at the release, **cancelable**: its default
@@ -304,6 +305,38 @@ declare const VfIcon_base: (new (...args: any[]) => import("../position.js").VfP
304
305
  * Finder's Return renamed, never opened, so on an editable icon it starts the
305
306
  * edit and on a non-editable one it does nothing at all.
306
307
  *
308
+ * ### Mouse, finger and pen
309
+ *
310
+ * The instrument never changes what the icon means: a tap is a click, two
311
+ * taps are a double-click, a drag is a drag. Two things are measured per
312
+ * instrument so that holds, both added by the kit — System 7 had the mouse
313
+ * alone.
314
+ *
315
+ * **The open gesture.** The mouse opens on the platform's `dblclick`, which
316
+ * follows the user's own double-click setting. A finger or a pen opens on a
317
+ * *tap pair* the icon classifies from its own pointer events: two taps on
318
+ * the icon, the second pressed within `TAP_PAIR_MS` (500) of the first and
319
+ * no further than `TAP_PAIR_SLOP_PX` (24 CSS px) from it, `vf-open` firing
320
+ * on the second release. A platform reserves the double-tap for its zoom
321
+ * and may deliver no `dblclick` for one, and a movable icon's press is
322
+ * `preventDefault()`ed for the drag, which can suppress it too; the pair
323
+ * depends on neither. A tap is a press released where it landed — one that
324
+ * became a drag, or that the platform cancelled, is not half of a pair —
325
+ * and a pair does not chain: a third tap starts the next one. Each press
326
+ * takes exactly one of the two routes, so a platform that does deliver a
327
+ * `dblclick` for a double-tap opens the icon once. The frame sets
328
+ * `touch-action: manipulation`, which takes the double-tap zoom off the
329
+ * icon and leaves panning and pinching to the page.
330
+ *
331
+ * **The drag slop.** A drag begins once the pointer has travelled from its
332
+ * press by `DRAG_SLOP_PX` (4 CSS px) for the mouse or `DRAG_SLOP_COARSE_PX`
333
+ * (10) for a finger or pen, which never lands still. Inside it the press is
334
+ * a click or a tap: the icon stays on its spot, a rename the press armed
335
+ * stays armed, and no drag event fires. The delta is measured from the
336
+ * press all the same, so the outline begins under the pointer. The numbers
337
+ * are CSS px rather than system px because they measure the hand, not the
338
+ * art (src/motion.ts).
339
+ *
307
340
  * ### The name and the art are one target, and the second click decides
308
341
  *
309
342
  * A double-click opens the icon *wherever it lands* — the name is as much the
@@ -313,8 +346,8 @@ declare const VfIcon_base: (new (...args: any[]) => import("../position.js").VfP
313
346
  *
314
347
  * So the rename waits for it. A press on the plate of an already-selected icon
315
348
  * arms the field rather than opening it, and the next press inside
316
- * {@link RENAME_DELAY_MS} calls it off — leaving the double-click to open, with
317
- * no rename box flashing up behind it. Nothing needs to *undo* an edit that
349
+ * {@link RENAME_DELAY_MS} calls it off — leaving the double-click, or a
350
+ * finger's tap pair, to open, with no rename box flashing up behind it. Nothing needs to *undo* an edit that
318
351
  * began: the press that starts one and the press that opens are the same
319
352
  * press, so the only thing that can be got right is not committing early.
320
353
  *
@@ -417,9 +450,9 @@ declare const VfIcon_base: (new (...args: any[]) => import("../position.js").VfP
417
450
  * @fires vf-select - Selection changed by user interaction. `detail: { selected: boolean }`.
418
451
  * @fires vf-change - The name was committed. `detail: { label: string, previous: string }`.
419
452
  * @fires vf-open - The icon was opened — double-clicked anywhere on it, its
420
- * name included, or ⌘O / ⌘↓ from the keyboard (Ctrl off the Mac), the
421
- * System 7 shortcuts. Return renames instead, as the Finder's did.
422
- * `detail: {}`.
453
+ * name included; tapped twice with a finger or pen; or ⌘O / ⌘↓ from the
454
+ * keyboard (Ctrl off the Mac), the System 7 shortcuts. Return renames
455
+ * instead, as the Finder's did. `detail: {}`.
423
456
  * @fires vf-name-too-long - A rename was typed or pasted past `maxlength`, and
424
457
  * the field refused the excess. `detail: { attempted, accepted, limit }` —
425
458
  * enough to raise the alert System 7 raised rather than drop the characters
@@ -429,9 +462,10 @@ declare const VfIcon_base: (new (...args: any[]) => import("../position.js").VfP
429
462
  * edit was dropped and the old name put back.
430
463
  * `detail: { attempted, kept, reason: 'empty' }`. A `vf-change` is *not*
431
464
  * fired alongside it — nothing changed.
432
- * @fires vf-drag-start - A drag began: the first lattice step away from the
433
- * press. `detail: { left, top, icons }` — the origin, whole system px in
434
- * the icon's container, and every icon the drag carries (this one first).
465
+ * @fires vf-drag-start - A drag began: the first lattice step past the drag
466
+ * slop, 4 CSS px from the press for the mouse and 10 for a finger or pen.
467
+ * `detail: { left, top, icons }` — the origin, whole system px in the
468
+ * icon's container, and every icon the drag carries (this one first).
435
469
  * @fires vf-drag - A step that changed the proposal. `detail: { clientX,
436
470
  * clientY, left, top, x, y, icons }` — the pointer in viewport CSS px, the
437
471
  * proposed origin in the container (whole system px on the lattice), the
@@ -592,6 +626,17 @@ export declare class VfIcon extends VfIcon_base {
592
626
  right: number;
593
627
  bottom: number;
594
628
  }): boolean;
629
+ /**
630
+ * The reserved art cell's box in the viewport, CSS px: 32×32 system px, or
631
+ * 16×16 under `size="small"`, centered at the top of the frame — the same
632
+ * box whatever the art, the name, `width`, `open` or `selected`. The
633
+ * slotted art is no stand-in for it: `open` hides the slot, so the art
634
+ * measures nothing. The box to hand anything that opens from the icon or
635
+ * closes to it. Null while the icon is not rendered — out of the
636
+ * document, or under `display: none`, inside a hidden window say. Before
637
+ * the first render, the host's box.
638
+ */
639
+ cellRect(): DOMRect | null;
595
640
  /**
596
641
  * Place the icon as a drop would: the stated pair — the origin point
597
642
  * under an `origin`, the corner without one — clamped whole in the