vintage-frames 0.19.1 → 0.20.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/README.md +1 -18
- package/custom-elements.json +8 -8
- package/dist/text-control.d.ts +3 -3
- package/docs/SPEC.md +3 -3
- package/editor/vscode.html-custom-data.json +3 -3
- package/editor/web-types.json +7 -7
- package/package.json +4 -34
- package/dist/build/app-file.d.ts +0 -21
- package/dist/build/app-file.js +0 -42
- package/dist/build/box.d.ts +0 -57
- package/dist/build/box.js +0 -93
- package/dist/build/client.d.ts +0 -12
- package/dist/build/frame-picture.d.ts +0 -6
- package/dist/build/frame-picture.js +0 -4
- package/dist/build/frame.d.ts +0 -11
- package/dist/build/frame.js +0 -44
- package/dist/build/index.d.ts +0 -14
- package/dist/build/index.js +0 -4
- package/dist/build/plugins.d.ts +0 -41
- package/dist/build/plugins.js +0 -134
- package/dist/build/png.d.ts +0 -24
- package/dist/build/png.js +0 -116
- package/dist/shell/alert.d.ts +0 -40
- package/dist/shell/alert.js +0 -41
- package/dist/shell/app-file.d.ts +0 -115
- package/dist/shell/app-file.js +0 -189
- package/dist/shell/catalog.d.ts +0 -250
- package/dist/shell/catalog.js +0 -349
- package/dist/shell/clock.d.ts +0 -16
- package/dist/shell/clock.js +0 -36
- package/dist/shell/filing.d.ts +0 -39
- package/dist/shell/filing.js +0 -68
- package/dist/shell/finder.d.ts +0 -180
- package/dist/shell/finder.js +0 -676
- package/dist/shell/geometry.d.ts +0 -203
- package/dist/shell/geometry.js +0 -257
- package/dist/shell/index.d.ts +0 -30
- package/dist/shell/index.js +0 -12
- package/dist/shell/pure.d.ts +0 -13
- package/dist/shell/pure.js +0 -6
- package/dist/shell/shell.d.ts +0 -177
- package/dist/shell/shell.js +0 -277
- package/dist/shell/state.d.ts +0 -88
- package/dist/shell/state.js +0 -103
- package/dist/shell/storage.d.ts +0 -14
- package/dist/shell/storage.js +0 -41
- package/dist/shell/version.d.ts +0 -2
- package/dist/shell/version.js +0 -4
- package/dist/shell/windows.d.ts +0 -278
- package/dist/shell/windows.js +0 -447
- package/dist/styles/body-strike.d.ts +0 -12
- package/dist/styles/body-strike.js +0 -3961
- package/dist/styles/display-strike.d.ts +0 -12
- package/dist/styles/display-strike.js +0 -4343
- package/dist/styles/strike.d.ts +0 -30
package/dist/shell/geometry.d.ts
DELETED
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The shell's geometry, pure and DOM-free: boxes in whole system px, the
|
|
3
|
-
* window cascade, the nine-slice pin that carries windows and icons through
|
|
4
|
-
* a raster resize, and the icon lattices that new items and Clean Up place
|
|
5
|
-
* on. Every function takes the area it works in — a desktop's work area, a
|
|
6
|
-
* folder's plane — so nothing here knows a menu bar's height.
|
|
7
|
-
*/
|
|
8
|
-
/** A point in whole system px. */
|
|
9
|
-
export interface Point {
|
|
10
|
-
left: number;
|
|
11
|
-
top: number;
|
|
12
|
-
}
|
|
13
|
-
/** A size in whole system px. */
|
|
14
|
-
export interface Size {
|
|
15
|
-
width: number;
|
|
16
|
-
height: number;
|
|
17
|
-
}
|
|
18
|
-
/** A box in whole system px. */
|
|
19
|
-
export interface Box extends Point, Size {
|
|
20
|
-
}
|
|
21
|
-
/** How far each cascaded window steps down and right, system px. */
|
|
22
|
-
export declare const CASCADE_STEP = 24;
|
|
23
|
-
/** How many slots a cascade has before it wraps. */
|
|
24
|
-
export declare const CASCADE_SLOTS = 5;
|
|
25
|
-
/** A cascade's step and slot count. */
|
|
26
|
-
export interface CascadeOptions {
|
|
27
|
-
step?: number;
|
|
28
|
-
slots?: number;
|
|
29
|
-
}
|
|
30
|
-
/** Where a desktop's first window opens: this far in from its window area's corner. */
|
|
31
|
-
export declare const WINDOW_ORIGIN: Point;
|
|
32
|
-
/** The first cascade slot in a window area: {@link WINDOW_ORIGIN} in from its corner. */
|
|
33
|
-
export declare function windowOrigin(area: Box): Point;
|
|
34
|
-
/** Cascade slot `i` from `base`, wrapping past the slot count. */
|
|
35
|
-
export declare function cascadeSlot(base: Point, i: number, { step, slots }?: CascadeOptions): Point & {
|
|
36
|
-
slot: number;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* The first cascade slot from `base` that no window in `occupied` (their
|
|
40
|
-
* top-lefts) holds. A window within half a step of a slot holds it, which
|
|
41
|
-
* absorbs snapping and clamping. Every slot held wraps rather than walking
|
|
42
|
-
* off the screen.
|
|
43
|
-
*/
|
|
44
|
-
export declare function cascadeFrom(base: Point, occupied: readonly Point[], options?: CascadeOptions): Point & {
|
|
45
|
-
slot: number;
|
|
46
|
-
};
|
|
47
|
-
/** A box of `size` centered in `area`, its top-left held at the area's. */
|
|
48
|
-
export declare function centeredBox(area: Box, size: Size): Box;
|
|
49
|
-
/**
|
|
50
|
-
* A box of `size` on cascade slot `n` from `origin`, pulled in to fit `area`
|
|
51
|
-
* but never past its top-left.
|
|
52
|
-
*/
|
|
53
|
-
export declare function cascadedBox(area: Box, size: Size, origin: Point, n?: number, options?: CascadeOptions): Box;
|
|
54
|
-
/** {@link nearBox}'s tolerance: more than a lattice snap, less than a real move. */
|
|
55
|
-
export declare const NEAR = 10;
|
|
56
|
-
/** Whether every edge of `box` is within `tol` of `target`'s. */
|
|
57
|
-
export declare function nearBox(box: Box, target: Box, tol?: number): boolean;
|
|
58
|
-
/** The least thickness of an outer slice, system px. The middle is the remainder. */
|
|
59
|
-
export declare const BAND = 100;
|
|
60
|
-
/** Each outer slice's thickness, system px. */
|
|
61
|
-
export interface Bands {
|
|
62
|
-
left: number;
|
|
63
|
-
top: number;
|
|
64
|
-
right: number;
|
|
65
|
-
bottom: number;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* The frame a pin is read in: `reserve` is the band above the open area — a
|
|
69
|
-
* desktop's work area top, the pin's y = 0 line — and `bands` each outer
|
|
70
|
-
* slice's thickness.
|
|
71
|
-
*/
|
|
72
|
-
export interface Frame {
|
|
73
|
-
reserve: number;
|
|
74
|
-
bands: Bands;
|
|
75
|
-
}
|
|
76
|
-
/** A frame below `reserve`, its bands at least {@link BAND}, any of them wider. */
|
|
77
|
-
export declare function frameOf(reserve?: number, bands?: Partial<Bands>): Frame;
|
|
78
|
-
/**
|
|
79
|
-
* A resize policy per axis ({@link pinTo}): `size` fixes an axis at a size,
|
|
80
|
-
* `min` floors a resizable one.
|
|
81
|
-
*/
|
|
82
|
-
export interface Policy {
|
|
83
|
-
size?: {
|
|
84
|
-
width?: number;
|
|
85
|
-
height?: number;
|
|
86
|
-
};
|
|
87
|
-
min?: {
|
|
88
|
-
width?: number;
|
|
89
|
-
height?: number;
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* One edge's pin. `near`: the offset from the span's start; `far`: from its
|
|
94
|
-
* end; `spring`: the unrounded fraction of the middle.
|
|
95
|
-
*/
|
|
96
|
-
export interface EdgePin {
|
|
97
|
-
kind: 'near' | 'far' | 'spring';
|
|
98
|
-
v: number;
|
|
99
|
-
}
|
|
100
|
-
/** A box's pin: per axis, the near edge (left or top), then the far edge. */
|
|
101
|
-
export interface Pin {
|
|
102
|
-
x: [EdgePin, EdgePin];
|
|
103
|
-
y: [EdgePin, EdgePin];
|
|
104
|
-
}
|
|
105
|
-
/** Whether `p` has a pin's shape — a stored or garbled record reads as none, so pinTo never throws. */
|
|
106
|
-
export declare function isPin(p: unknown): p is Pin;
|
|
107
|
-
/** A box's pin on `raster` in `frame`: each edge a strut or a spring. */
|
|
108
|
-
export declare function pinOf(box: Box, raster: Size, frame: Frame): Pin;
|
|
109
|
-
/**
|
|
110
|
-
* A pin back on `raster` as a box, in the frame it was read in, rounded to
|
|
111
|
-
* whole system px. The policy applies per axis: `size` fixes it, `min`
|
|
112
|
-
* floors it. Callers snap to their lattice and cap an oversize box.
|
|
113
|
-
*/
|
|
114
|
-
export declare function pinTo(pin: Pin, raster: Size, frame: Frame, { size, min }?: Policy): Box;
|
|
115
|
-
/** An icon's cell, system px: the 64px plate, name included. Two icons collide where their cells overlap. */
|
|
116
|
-
export declare const ICON_CELL = 64;
|
|
117
|
-
/** The lattice's pitches and its inset from the container, system px. */
|
|
118
|
-
export declare const ICON_ROW = 72;
|
|
119
|
-
export declare const ICON_COLUMN = 80;
|
|
120
|
-
export declare const ICON_INSET = 16;
|
|
121
|
-
/**
|
|
122
|
-
* A container's icon grid. `left`/`top` locate cell (0,0); `dx` is negative
|
|
123
|
-
* where columns run left; `cols` or `rows` is `Infinity` when unbounded;
|
|
124
|
-
* `down` fills a column at a time, otherwise a row at a time.
|
|
125
|
-
*/
|
|
126
|
-
export interface Lattice {
|
|
127
|
-
left: number;
|
|
128
|
-
top: number;
|
|
129
|
-
dx: number;
|
|
130
|
-
dy: number;
|
|
131
|
-
cols: number;
|
|
132
|
-
rows: number;
|
|
133
|
-
down: boolean;
|
|
134
|
-
}
|
|
135
|
-
/** A lattice's cell, pitches and inset from its container's edges, system px. */
|
|
136
|
-
export interface LatticeOptions {
|
|
137
|
-
cell?: number;
|
|
138
|
-
column?: number;
|
|
139
|
-
row?: number;
|
|
140
|
-
inset?: Partial<{
|
|
141
|
-
top: number;
|
|
142
|
-
right: number;
|
|
143
|
-
bottom: number;
|
|
144
|
-
left: number;
|
|
145
|
-
}>;
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* The desktop's lattice in its work area: cell (0,0) at the top right, rows
|
|
149
|
-
* running down to the bottom inset, columns running left. At least one row
|
|
150
|
-
* and one column. Insets default to 16 on the top, right and bottom.
|
|
151
|
-
*/
|
|
152
|
-
export declare function desktopLattice(area: Box, options?: LatticeOptions): Lattice;
|
|
153
|
-
/**
|
|
154
|
-
* The Trash's place in a desktop's work area: the bottom-right cell, inset
|
|
155
|
-
* as the desktop's lattice is, held inside the area's top-left.
|
|
156
|
-
*/
|
|
157
|
-
export declare function trashCell(area: Box, options?: LatticeOptions): Point;
|
|
158
|
-
/**
|
|
159
|
-
* A folder plane's lattice for a plane `width` wide: rows from the top left,
|
|
160
|
-
* wrapping at the width, unbounded downward. At least one column. Insets
|
|
161
|
-
* default to 16 on the top and left.
|
|
162
|
-
*/
|
|
163
|
-
export declare function folderLattice(width: number, options?: LatticeOptions): Lattice;
|
|
164
|
-
/** The top-left of cell (`col`, `row`), whether or not the lattice reaches it. */
|
|
165
|
-
export declare function latticeCell(grid: Lattice, col: number, row: number): Point;
|
|
166
|
-
/** Cell number `slot` in the lattice's fill order. */
|
|
167
|
-
export declare function latticeSlot(grid: Lattice, slot: number): Point;
|
|
168
|
-
/**
|
|
169
|
-
* Two positions in the lattice's fill order, negative when `a` comes first.
|
|
170
|
-
* Each rounds to its nearest cell, so a pixel of drift still sorts right.
|
|
171
|
-
*/
|
|
172
|
-
export declare function fillOrder(grid: Lattice, a: Point, b: Point): number;
|
|
173
|
-
/**
|
|
174
|
-
* Clean Up: each position's cell on the lattice. Each icon takes the free
|
|
175
|
-
* cell nearest it, searching square rings outward from its own rounded,
|
|
176
|
-
* clamped cell; icons past the last free cell share their own. One position
|
|
177
|
-
* per input, in input order.
|
|
178
|
-
*/
|
|
179
|
-
export declare function cleanUp(grid: Lattice, positions: readonly Point[]): Point[];
|
|
180
|
-
/**
|
|
181
|
-
* The first cell, in fill order, that no icon at `taken` overlaps — an icon
|
|
182
|
-
* off the lattice blocks every cell its own cell touches. The home cell when
|
|
183
|
-
* a bounded lattice is full.
|
|
184
|
-
*/
|
|
185
|
-
export declare function nextFreeCell(grid: Lattice, taken: readonly Point[], cell?: number): Point;
|
|
186
|
-
/**
|
|
187
|
-
* The free cell nearest `at`: square rings out from its rounded, clamped
|
|
188
|
-
* cell, as Clean Up searches, a cell free where no icon at `taken` overlaps
|
|
189
|
-
* it. Of two as near, the later in fill order. The next free cell when the
|
|
190
|
-
* rings find none.
|
|
191
|
-
*/
|
|
192
|
-
export declare function freeCellNear(grid: Lattice, at: Point, taken: readonly Point[], cell?: number): Point;
|
|
193
|
-
/**
|
|
194
|
-
* A folder's field: at least its viewport, grown to hold every icon at
|
|
195
|
-
* `positions` (their top-lefts) plus the inset past it. The field's size is
|
|
196
|
-
* the window's scroll range.
|
|
197
|
-
*/
|
|
198
|
-
export declare function fieldExtent(positions: readonly Point[], viewport: Size, { cell, inset }?: {
|
|
199
|
-
cell?: number;
|
|
200
|
-
inset?: number;
|
|
201
|
-
}): Size;
|
|
202
|
-
/** The pairs of `boxes` that overlap, as `"i,j"` with i < j. Boxes sharing only an edge do not. */
|
|
203
|
-
export declare function collisions(boxes: readonly Box[]): Set<string>;
|
package/dist/shell/geometry.js
DELETED
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
//#region src/shell/geometry.ts
|
|
2
|
-
var e = 24, t = 5, n = {
|
|
3
|
-
left: 40,
|
|
4
|
-
top: 20
|
|
5
|
-
};
|
|
6
|
-
function r(e) {
|
|
7
|
-
return {
|
|
8
|
-
left: e.left + n.left,
|
|
9
|
-
top: e.top + n.top
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
function i(e, t, { step: n = 24, slots: r = 5 } = {}) {
|
|
13
|
-
let i = (t % r + r) % r;
|
|
14
|
-
return {
|
|
15
|
-
left: e.left + n * i,
|
|
16
|
-
top: e.top + n * i,
|
|
17
|
-
slot: i
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
function a(e, t, n = {}) {
|
|
21
|
-
let { step: r = 24, slots: a = 5 } = n, o = r / 2;
|
|
22
|
-
for (let r = 0; r < a; r++) {
|
|
23
|
-
let a = i(e, r, n);
|
|
24
|
-
if (!t.some((e) => Math.abs(e.left - a.left) < o && Math.abs(e.top - a.top) < o)) return a;
|
|
25
|
-
}
|
|
26
|
-
return i(e, t.length % a, n);
|
|
27
|
-
}
|
|
28
|
-
function o(e, t) {
|
|
29
|
-
return {
|
|
30
|
-
left: Math.max(e.left, e.left + Math.floor((e.width - t.width) / 2)),
|
|
31
|
-
top: Math.max(e.top, e.top + Math.floor((e.height - t.height) / 2)),
|
|
32
|
-
width: t.width,
|
|
33
|
-
height: t.height
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
function s(e, t, n, r = 0, a = {}) {
|
|
37
|
-
let o = i(n, r, a);
|
|
38
|
-
return {
|
|
39
|
-
left: Math.max(e.left, Math.min(o.left, e.left + e.width - t.width)),
|
|
40
|
-
top: Math.max(e.top, Math.min(o.top, e.top + e.height - t.height)),
|
|
41
|
-
width: t.width,
|
|
42
|
-
height: t.height
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
var c = 10;
|
|
46
|
-
function l(e, t, n = 10) {
|
|
47
|
-
return Math.abs(e.left - t.left) <= n && Math.abs(e.top - t.top) <= n && Math.abs(e.left + e.width - (t.left + t.width)) <= n && Math.abs(e.top + e.height - (t.top + t.height)) <= n;
|
|
48
|
-
}
|
|
49
|
-
var u = 100;
|
|
50
|
-
function d(e = 0, t = {}) {
|
|
51
|
-
let n = (e) => Math.max(100, e ?? 100);
|
|
52
|
-
return {
|
|
53
|
-
reserve: e,
|
|
54
|
-
bands: {
|
|
55
|
-
left: n(t.left),
|
|
56
|
-
top: n(t.top),
|
|
57
|
-
right: n(t.right),
|
|
58
|
-
bottom: n(t.bottom)
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
function f(e) {
|
|
63
|
-
let t = (e) => {
|
|
64
|
-
let t = e;
|
|
65
|
-
return !!t && (t.kind === "near" || t.kind === "far" || t.kind === "spring") && Number.isFinite(t.v);
|
|
66
|
-
}, n = (e) => Array.isArray(e) && e.length === 2 && t(e[0]) && t(e[1]), r = e;
|
|
67
|
-
return !!r && typeof r == "object" && n(r.x) && n(r.y);
|
|
68
|
-
}
|
|
69
|
-
function p(e, t, n, r) {
|
|
70
|
-
return e < n ? {
|
|
71
|
-
kind: "near",
|
|
72
|
-
v: e
|
|
73
|
-
} : e >= t - r ? {
|
|
74
|
-
kind: "far",
|
|
75
|
-
v: t - e
|
|
76
|
-
} : {
|
|
77
|
-
kind: "spring",
|
|
78
|
-
v: (e - n) / Math.max(1, t - n - r)
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
function m(e, t, n, r) {
|
|
82
|
-
return e.kind === "near" ? e.v : e.kind === "far" ? t - e.v : n + e.v * Math.max(0, t - n - r);
|
|
83
|
-
}
|
|
84
|
-
function h(e, t, n, r, { size: i, min: a = 0 }) {
|
|
85
|
-
let o = m(e[0], t, n, r), s = m(e[1], t, n, r), c = i;
|
|
86
|
-
if (c == null) {
|
|
87
|
-
if (s - o >= a) return {
|
|
88
|
-
a: o,
|
|
89
|
-
size: s - o
|
|
90
|
-
};
|
|
91
|
-
c = a;
|
|
92
|
-
}
|
|
93
|
-
return e[0].kind === "spring" ? e[1].kind === "spring" ? {
|
|
94
|
-
a: (o + s) / 2 - c / 2,
|
|
95
|
-
size: c
|
|
96
|
-
} : {
|
|
97
|
-
a: s - c,
|
|
98
|
-
size: c
|
|
99
|
-
} : {
|
|
100
|
-
a: o,
|
|
101
|
-
size: c
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
function g(e, t, n) {
|
|
105
|
-
let { reserve: r, bands: i } = n, a = t.width, o = t.height - r, s = e.top - r;
|
|
106
|
-
return {
|
|
107
|
-
x: [p(e.left, a, i.left, i.right), p(e.left + e.width, a, i.left, i.right)],
|
|
108
|
-
y: [p(s, o, i.top, i.bottom), p(s + e.height, o, i.top, i.bottom)]
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
function _(e, t, n, { size: r, min: i } = {}) {
|
|
112
|
-
let { reserve: a, bands: o } = n, s = h(e.x, t.width, o.left, o.right, {
|
|
113
|
-
size: r?.width,
|
|
114
|
-
min: i?.width
|
|
115
|
-
}), c = h(e.y, t.height - a, o.top, o.bottom, {
|
|
116
|
-
size: r?.height,
|
|
117
|
-
min: i?.height
|
|
118
|
-
});
|
|
119
|
-
return {
|
|
120
|
-
left: Math.round(s.a),
|
|
121
|
-
top: Math.round(a + c.a),
|
|
122
|
-
width: Math.round(s.size),
|
|
123
|
-
height: Math.round(c.size)
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
var v = 64, y = 72, b = 80, x = 16;
|
|
127
|
-
function S(e, t = {}) {
|
|
128
|
-
let { cell: n = 64, column: r = 80, row: i = 72 } = t, a = {
|
|
129
|
-
top: 16,
|
|
130
|
-
right: 16,
|
|
131
|
-
bottom: 16,
|
|
132
|
-
left: 0,
|
|
133
|
-
...t.inset
|
|
134
|
-
}, o = e.top + e.height, s = Math.max(e.left + a.left, e.left + e.width - a.right - n), c = e.top + a.top;
|
|
135
|
-
return {
|
|
136
|
-
left: s,
|
|
137
|
-
top: c,
|
|
138
|
-
dx: -r,
|
|
139
|
-
dy: i,
|
|
140
|
-
cols: Math.floor((s - e.left - a.left) / r) + 1,
|
|
141
|
-
rows: Math.max(1, Math.floor((o - a.bottom - n - c) / i) + 1),
|
|
142
|
-
down: !0
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
function C(e, t = {}) {
|
|
146
|
-
let { cell: n = 64 } = t, r = {
|
|
147
|
-
right: 16,
|
|
148
|
-
bottom: 16,
|
|
149
|
-
left: 0,
|
|
150
|
-
...t.inset
|
|
151
|
-
};
|
|
152
|
-
return {
|
|
153
|
-
left: Math.max(e.left + r.left, e.left + e.width - r.right - n),
|
|
154
|
-
top: Math.max(e.top, e.top + e.height - r.bottom - n)
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
function w(e, t = {}) {
|
|
158
|
-
let { cell: n = 64, column: r = 80, row: i = 72 } = t, a = {
|
|
159
|
-
top: 16,
|
|
160
|
-
right: 0,
|
|
161
|
-
bottom: 0,
|
|
162
|
-
left: 16,
|
|
163
|
-
...t.inset
|
|
164
|
-
};
|
|
165
|
-
return {
|
|
166
|
-
left: a.left,
|
|
167
|
-
top: a.top,
|
|
168
|
-
dx: r,
|
|
169
|
-
dy: i,
|
|
170
|
-
cols: Math.max(1, Math.floor((e - a.left - a.right - n) / r) + 1),
|
|
171
|
-
rows: Infinity,
|
|
172
|
-
down: !1
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
function T(e, t, n) {
|
|
176
|
-
return {
|
|
177
|
-
left: e.left + t * e.dx,
|
|
178
|
-
top: e.top + n * e.dy
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
function E(e, t) {
|
|
182
|
-
let n = e.down ? e.rows : e.cols, r = Math.floor(t / n), i = t % n;
|
|
183
|
-
return e.down ? T(e, r, i) : T(e, i, r);
|
|
184
|
-
}
|
|
185
|
-
function D(e, t, n) {
|
|
186
|
-
let r = (t) => Math.round((t.left - e.left) / e.dx), i = (t) => Math.round((t.top - e.top) / e.dy);
|
|
187
|
-
return e.down ? r(t) - r(n) || i(t) - i(n) : i(t) - i(n) || r(t) - r(n);
|
|
188
|
-
}
|
|
189
|
-
var O = (e, t) => Math.min(Math.max(Math.round(e), 0), t - 1);
|
|
190
|
-
function k(e, t) {
|
|
191
|
-
let { cols: n, rows: r } = e, i = t.map((t) => ({
|
|
192
|
-
col: O((t.left - e.left) / e.dx, n),
|
|
193
|
-
row: O((t.top - e.top) / e.dy, r)
|
|
194
|
-
})), a = (e) => i[e], o = t.map((e, t) => t).sort((e, t) => a(e).row - a(t).row || a(e).col - a(t).col || e - t), s = /* @__PURE__ */ new Set(), c = Math.min(n, t.length + 1) + Math.min(r, t.length + 1), l = [];
|
|
195
|
-
for (let i of o) {
|
|
196
|
-
let o = a(i), u = t[i], d = o;
|
|
197
|
-
for (let t = 0; t <= c; t++) {
|
|
198
|
-
let i = null, a = Infinity;
|
|
199
|
-
for (let c = o.col - t; c <= o.col + t; c++) for (let l = o.row - t; l <= o.row + t; l++) {
|
|
200
|
-
if (Math.max(Math.abs(c - o.col), Math.abs(l - o.row)) !== t || c < 0 || l < 0 || c >= n || l >= r || s.has(`${c},${l}`)) continue;
|
|
201
|
-
let d = T(e, c, l), f = (d.left - u.left) ** 2 + (d.top - u.top) ** 2;
|
|
202
|
-
f < a && (a = f, i = {
|
|
203
|
-
col: c,
|
|
204
|
-
row: l
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
if (i) {
|
|
208
|
-
d = i;
|
|
209
|
-
break;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
s.add(`${d.col},${d.row}`), l[i] = T(e, d.col, d.row);
|
|
213
|
-
}
|
|
214
|
-
return l;
|
|
215
|
-
}
|
|
216
|
-
function A(e, t, n = 64) {
|
|
217
|
-
let r = e.cols * e.rows, i = Number.isFinite(r) ? r : 4 * t.length + 1;
|
|
218
|
-
for (let r = 0; r < i; r++) {
|
|
219
|
-
let i = E(e, r);
|
|
220
|
-
if (!t.some((e) => Math.abs(e.left - i.left) < n && Math.abs(e.top - i.top) < n)) return i;
|
|
221
|
-
}
|
|
222
|
-
return E(e, 0);
|
|
223
|
-
}
|
|
224
|
-
function j(e, t, n, r = 64) {
|
|
225
|
-
let i = {
|
|
226
|
-
col: O((t.left - e.left) / e.dx, e.cols),
|
|
227
|
-
row: O((t.top - e.top) / e.dy, e.rows)
|
|
228
|
-
}, a = (e) => !n.some((t) => Math.abs(t.left - e.left) < r && Math.abs(t.top - e.top) < r), o = Math.min(e.cols, 2 * n.length + 1) + Math.min(e.rows, 2 * n.length + 1);
|
|
229
|
-
for (let n = 0; n <= o; n++) {
|
|
230
|
-
let r = null, o = Infinity;
|
|
231
|
-
for (let s = i.col - n; s <= i.col + n; s++) for (let c = i.row - n; c <= i.row + n; c++) {
|
|
232
|
-
if (Math.max(Math.abs(s - i.col), Math.abs(c - i.row)) !== n || s < 0 || c < 0 || s >= e.cols || c >= e.rows) continue;
|
|
233
|
-
let l = T(e, s, c), u = (l.left - t.left) ** 2 + (l.top - t.top) ** 2;
|
|
234
|
-
(u < o || u === o && D(e, l, r) > 0) && a(l) && (o = u, r = l);
|
|
235
|
-
}
|
|
236
|
-
if (r) return r;
|
|
237
|
-
}
|
|
238
|
-
return A(e, n, r);
|
|
239
|
-
}
|
|
240
|
-
function M(e, t, { cell: n = 64, inset: r = 16 } = {}) {
|
|
241
|
-
let i = t.width, a = t.height;
|
|
242
|
-
for (let t of e) i = Math.max(i, t.left + n + r), a = Math.max(a, t.top + n + r);
|
|
243
|
-
return {
|
|
244
|
-
width: i,
|
|
245
|
-
height: a
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
function N(e) {
|
|
249
|
-
let t = /* @__PURE__ */ new Set();
|
|
250
|
-
for (let n = 0; n < e.length; n++) for (let r = n + 1; r < e.length; r++) {
|
|
251
|
-
let i = e[n], a = e[r];
|
|
252
|
-
i.left < a.left + a.width && a.left < i.left + i.width && i.top < a.top + a.height && a.top < i.top + i.height && t.add(`${n},${r}`);
|
|
253
|
-
}
|
|
254
|
-
return t;
|
|
255
|
-
}
|
|
256
|
-
//#endregion
|
|
257
|
-
export { u as BAND, t as CASCADE_SLOTS, e as CASCADE_STEP, v as ICON_CELL, b as ICON_COLUMN, x as ICON_INSET, y as ICON_ROW, c as NEAR, n as WINDOW_ORIGIN, a as cascadeFrom, i as cascadeSlot, s as cascadedBox, o as centeredBox, k as cleanUp, N as collisions, S as desktopLattice, M as fieldExtent, D as fillOrder, w as folderLattice, d as frameOf, j as freeCellNear, f as isPin, T as latticeCell, E as latticeSlot, l as nearBox, A as nextFreeCell, g as pinOf, _ as pinTo, C as trashCell, r as windowOrigin };
|
package/dist/shell/index.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `vintage-frames/shell` — experimental. Applications over one desktop: a
|
|
3
|
-
* window manager, a menu bar that shows the front application's menus, a
|
|
4
|
-
* catalog of what is where, and the stock Finder that shows it. Plain
|
|
5
|
-
* modules over the kit's elements: it registers no elements, writes no
|
|
6
|
-
* styles and ships no art, and it reaches the kit only through the
|
|
7
|
-
* package's own exports, so the page imports `vintage-frames` first.
|
|
8
|
-
*
|
|
9
|
-
* Its API may change in any minor release while it is experimental.
|
|
10
|
-
* docs/SHELL.md is the guide.
|
|
11
|
-
*/
|
|
12
|
-
export { createShell, defineApp } from './shell.js';
|
|
13
|
-
export type { AppContext, AppDefinition, CatalogSetup, KindDefinition, Shell, ShellOptions } from './shell.js';
|
|
14
|
-
export { createWindowManager, focusInto } from './windows.js';
|
|
15
|
-
export type { AdoptOptions, ArrangeGroup, BoxInput, CloseHandler, FocusHome, HomeBox, OpenOptions, PlacePolicy, Placed, WindowManager, WindowManagerOptions, } from './windows.js';
|
|
16
|
-
export { finder, FINDER } from './finder.js';
|
|
17
|
-
export type { FinderAlert, FinderAlertHandler, FinderAlerts, FinderApi, FinderArt, FinderCommand, FinderCommandSpec, FinderFailedAction, FinderMenu, FinderOpen, FinderOptions, } from './finder.js';
|
|
18
|
-
export { fileByDrag } from './filing.js';
|
|
19
|
-
export type { FilingOptions } from './filing.js';
|
|
20
|
-
export { createCatalog, memoryStorage, aliasName, appIdOf, appleMenuItemsOf, appleMenuOf, canAlias, childrenOf, containerOf, copyName, descendantsOf, dropTargetOf, enclosingFolders, isContainerKind, isInside, isKept, isTrashed, isVolume, itemCount, itemOf, nextFolderName, originalOf, resolve, startupItemsOf, ALIAS_KIND, APPLE_MENU_ITEMS, APP_KIND, DISK, FOLDER, STARTUP_ITEMS, SYSTEM_FOLDER, TRASH, UNTITLED_FOLDER, } from './catalog.js';
|
|
21
|
-
export type { AppleMenuEntry, Catalog, CatalogArchive, CatalogOptions, CatalogState, CatalogStorage, DropTarget, Item, KindHooks, NewItem, SystemFolders, Volumes, } from './catalog.js';
|
|
22
|
-
export { indexedDbStorage } from './storage.js';
|
|
23
|
-
export { localStorageState, mergeSession, openWindowsOf, readSession } from './state.js';
|
|
24
|
-
export type { LocalStorageStateOptions, SavedSession, SavedWindow, SessionSnapshot, ShellState } from './state.js';
|
|
25
|
-
export { BAND, CASCADE_SLOTS, CASCADE_STEP, ICON_CELL, ICON_COLUMN, ICON_INSET, ICON_ROW, NEAR, WINDOW_ORIGIN, cascadedBox, cascadeFrom, cascadeSlot, centeredBox, cleanUp, collisions, desktopLattice, fieldExtent, fillOrder, folderLattice, frameOf, freeCellNear, isPin, latticeCell, latticeSlot, nearBox, nextFreeCell, pinOf, pinTo, trashCell, windowOrigin, } from './geometry.js';
|
|
26
|
-
export type { Bands, Box, CascadeOptions, EdgePin, Frame, Lattice, LatticeOptions, Pin, Point, Policy, Size, } from './geometry.js';
|
|
27
|
-
export { startClock, formatDate, formatTime, DATE_HOLD_MS } from './clock.js';
|
|
28
|
-
export { APP_API, APP_API_OLDEST, APP_FILE_FORMAT, BOX_SCALE, appRuns, compareVersions, inspectAppFile, readAppFile, satisfies, } from './app-file.js';
|
|
29
|
-
export type { AppFile, AppManifest } from './app-file.js';
|
|
30
|
-
export { VERSION } from './version.js';
|
package/dist/shell/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ALIAS_KIND as e, APPLE_MENU_ITEMS as t, APP_KIND as n, DISK as r, FOLDER as i, STARTUP_ITEMS as a, SYSTEM_FOLDER as o, TRASH as s, UNTITLED_FOLDER as c, aliasName as l, appIdOf as u, appleMenuItemsOf as d, appleMenuOf as f, canAlias as p, childrenOf as m, containerOf as h, copyName as g, createCatalog as _, descendantsOf as v, dropTargetOf as y, enclosingFolders as b, isContainerKind as x, isInside as S, isKept as C, isTrashed as w, isVolume as T, itemCount as E, itemOf as D, memoryStorage as O, nextFolderName as k, originalOf as A, resolve as j, startupItemsOf as M } from "./catalog.js";
|
|
2
|
-
import { BAND as N, CASCADE_SLOTS as P, CASCADE_STEP as F, ICON_CELL as I, ICON_COLUMN as L, ICON_INSET as R, ICON_ROW as z, NEAR as B, WINDOW_ORIGIN as V, cascadeFrom as H, cascadeSlot as U, cascadedBox as W, centeredBox as G, cleanUp as K, collisions as q, desktopLattice as J, fieldExtent as Y, fillOrder as X, folderLattice as Z, frameOf as Q, freeCellNear as $, isPin as ee, latticeCell as te, latticeSlot as ne, nearBox as re, nextFreeCell as ie, pinOf as ae, pinTo as oe, trashCell as se, windowOrigin as ce } from "./geometry.js";
|
|
3
|
-
import { createWindowManager as le, focusInto as ue } from "./windows.js";
|
|
4
|
-
import { localStorageState as de, mergeSession as fe, openWindowsOf as pe, readSession as me } from "./state.js";
|
|
5
|
-
import { DATE_HOLD_MS as he, formatDate as ge, formatTime as _e, startClock as ve } from "./clock.js";
|
|
6
|
-
import { createShell as ye, defineApp as be } from "./shell.js";
|
|
7
|
-
import { fileByDrag as xe } from "./filing.js";
|
|
8
|
-
import { FINDER as Se, finder as Ce } from "./finder.js";
|
|
9
|
-
import { indexedDbStorage as we } from "./storage.js";
|
|
10
|
-
import { VERSION as Te } from "./version.js";
|
|
11
|
-
import { APP_API as Ee, APP_API_OLDEST as De, APP_FILE_FORMAT as Oe, BOX_SCALE as ke, appRuns as Ae, compareVersions as je, inspectAppFile as Me, readAppFile as Ne, satisfies as Pe } from "./app-file.js";
|
|
12
|
-
export { e as ALIAS_KIND, t as APPLE_MENU_ITEMS, Ee as APP_API, De as APP_API_OLDEST, Oe as APP_FILE_FORMAT, n as APP_KIND, N as BAND, ke as BOX_SCALE, P as CASCADE_SLOTS, F as CASCADE_STEP, he as DATE_HOLD_MS, r as DISK, Se as FINDER, i as FOLDER, I as ICON_CELL, L as ICON_COLUMN, R as ICON_INSET, z as ICON_ROW, B as NEAR, a as STARTUP_ITEMS, o as SYSTEM_FOLDER, s as TRASH, c as UNTITLED_FOLDER, Te as VERSION, V as WINDOW_ORIGIN, l as aliasName, u as appIdOf, Ae as appRuns, d as appleMenuItemsOf, f as appleMenuOf, p as canAlias, H as cascadeFrom, U as cascadeSlot, W as cascadedBox, G as centeredBox, m as childrenOf, K as cleanUp, q as collisions, je as compareVersions, h as containerOf, g as copyName, _ as createCatalog, ye as createShell, le as createWindowManager, be as defineApp, v as descendantsOf, J as desktopLattice, y as dropTargetOf, b as enclosingFolders, Y as fieldExtent, xe as fileByDrag, X as fillOrder, Ce as finder, ue as focusInto, Z as folderLattice, ge as formatDate, _e as formatTime, Q as frameOf, $ as freeCellNear, we as indexedDbStorage, Me as inspectAppFile, x as isContainerKind, S as isInside, C as isKept, ee as isPin, w as isTrashed, T as isVolume, E as itemCount, D as itemOf, te as latticeCell, ne as latticeSlot, de as localStorageState, O as memoryStorage, fe as mergeSession, re as nearBox, k as nextFolderName, ie as nextFreeCell, pe as openWindowsOf, A as originalOf, ae as pinOf, oe as pinTo, Ne as readAppFile, me as readSession, j as resolve, Pe as satisfies, ve as startClock, M as startupItemsOf, se as trashCell, ce as windowOrigin };
|
package/dist/shell/pure.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `vintage-frames/shell/pure` — the shell's pure modules on their own: the
|
|
3
|
-
* catalog, the geometry, the saved session, the app file reader and the
|
|
4
|
-
* kit's version. They import nothing from the kit and touch no DOM at
|
|
5
|
-
* import, so a site's own pure modules and their tests import them under
|
|
6
|
-
* Node. `vintage-frames/shell` exports the same names.
|
|
7
|
-
*/
|
|
8
|
-
export * from './catalog.js';
|
|
9
|
-
export * from './geometry.js';
|
|
10
|
-
export * from './state.js';
|
|
11
|
-
export { APP_API, APP_API_OLDEST, APP_FILE_FORMAT, BOX_SCALE, appRuns, compareVersions, inspectAppFile, readAppFile, satisfies, } from './app-file.js';
|
|
12
|
-
export type { AppFile, AppManifest } from './app-file.js';
|
|
13
|
-
export { VERSION } from './version.js';
|
package/dist/shell/pure.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ALIAS_KIND as e, APPLE_MENU_ITEMS as t, APP_KIND as n, DISK as r, FOLDER as i, STARTUP_ITEMS as a, SYSTEM_FOLDER as o, TRASH as s, UNTITLED_FOLDER as c, aliasName as l, appIdOf as u, appleMenuItemsOf as d, appleMenuOf as f, canAlias as p, childrenOf as m, containerOf as h, copyName as g, createCatalog as _, descendantsOf as v, dropTargetOf as y, enclosingFolders as b, isContainerKind as x, isInside as S, isKept as C, isTrashed as w, isVolume as T, itemCount as E, itemOf as D, memoryStorage as O, nextFolderName as k, originalOf as A, resolve as j, startupItemsOf as M } from "./catalog.js";
|
|
2
|
-
import { BAND as N, CASCADE_SLOTS as P, CASCADE_STEP as F, ICON_CELL as I, ICON_COLUMN as L, ICON_INSET as R, ICON_ROW as z, NEAR as B, WINDOW_ORIGIN as V, cascadeFrom as H, cascadeSlot as U, cascadedBox as W, centeredBox as G, cleanUp as K, collisions as q, desktopLattice as J, fieldExtent as Y, fillOrder as X, folderLattice as Z, frameOf as Q, freeCellNear as $, isPin as ee, latticeCell as te, latticeSlot as ne, nearBox as re, nextFreeCell as ie, pinOf as ae, pinTo as oe, trashCell as se, windowOrigin as ce } from "./geometry.js";
|
|
3
|
-
import { localStorageState as le, mergeSession as ue, openWindowsOf as de, readSession as fe } from "./state.js";
|
|
4
|
-
import { VERSION as pe } from "./version.js";
|
|
5
|
-
import { APP_API as me, APP_API_OLDEST as he, APP_FILE_FORMAT as ge, BOX_SCALE as _e, appRuns as ve, compareVersions as ye, inspectAppFile as be, readAppFile as xe, satisfies as Se } from "./app-file.js";
|
|
6
|
-
export { e as ALIAS_KIND, t as APPLE_MENU_ITEMS, me as APP_API, he as APP_API_OLDEST, ge as APP_FILE_FORMAT, n as APP_KIND, N as BAND, _e as BOX_SCALE, P as CASCADE_SLOTS, F as CASCADE_STEP, r as DISK, i as FOLDER, I as ICON_CELL, L as ICON_COLUMN, R as ICON_INSET, z as ICON_ROW, B as NEAR, a as STARTUP_ITEMS, o as SYSTEM_FOLDER, s as TRASH, c as UNTITLED_FOLDER, pe as VERSION, V as WINDOW_ORIGIN, l as aliasName, u as appIdOf, ve as appRuns, d as appleMenuItemsOf, f as appleMenuOf, p as canAlias, H as cascadeFrom, U as cascadeSlot, W as cascadedBox, G as centeredBox, m as childrenOf, K as cleanUp, q as collisions, ye as compareVersions, h as containerOf, g as copyName, _ as createCatalog, v as descendantsOf, J as desktopLattice, y as dropTargetOf, b as enclosingFolders, Y as fieldExtent, X as fillOrder, Z as folderLattice, Q as frameOf, $ as freeCellNear, be as inspectAppFile, x as isContainerKind, S as isInside, C as isKept, ee as isPin, w as isTrashed, T as isVolume, E as itemCount, D as itemOf, te as latticeCell, ne as latticeSlot, le as localStorageState, O as memoryStorage, ue as mergeSession, re as nearBox, k as nextFolderName, ie as nextFreeCell, de as openWindowsOf, A as originalOf, ae as pinOf, oe as pinTo, xe as readAppFile, fe as readSession, j as resolve, Se as satisfies, M as startupItemsOf, se as trashCell, ce as windowOrigin };
|