vintage-frames 0.18.0 → 0.19.1

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.
Files changed (47) hide show
  1. package/README.md +1 -1
  2. package/custom-elements.json +278 -51
  3. package/dist/build/app-file.d.ts +2 -2
  4. package/dist/build/app-file.js +1 -0
  5. package/dist/build/plugins.d.ts +2 -2
  6. package/dist/build/plugins.js +62 -59
  7. package/dist/components/vf-icon.d.ts +7 -0
  8. package/dist/components/vf-icon.js +101 -81
  9. package/dist/components/vf-menu-bar.d.ts +6 -4
  10. package/dist/components/vf-menu-bar.js +26 -56
  11. package/dist/components/vf-menu-item.d.ts +33 -5
  12. package/dist/components/vf-menu-item.js +128 -61
  13. package/dist/components/vf-menu.d.ts +35 -0
  14. package/dist/components/vf-menu.js +171 -111
  15. package/dist/glyphs.d.ts +6 -0
  16. package/dist/glyphs.js +18 -14
  17. package/dist/index.d.ts +1 -0
  18. package/dist/index.js +15 -14
  19. package/dist/menu-navigation.d.ts +34 -0
  20. package/dist/menu-navigation.js +53 -0
  21. package/dist/menu-press.d.ts +25 -7
  22. package/dist/menu-press.js +78 -44
  23. package/dist/motion.d.ts +10 -0
  24. package/dist/shell/app-file.d.ts +20 -4
  25. package/dist/shell/app-file.js +65 -53
  26. package/dist/shell/catalog.d.ts +79 -1
  27. package/dist/shell/catalog.js +206 -153
  28. package/dist/shell/finder.d.ts +28 -9
  29. package/dist/shell/finder.js +339 -267
  30. package/dist/shell/geometry.d.ts +7 -0
  31. package/dist/shell/geometry.js +19 -3
  32. package/dist/shell/index.d.ts +4 -4
  33. package/dist/shell/index.js +12 -12
  34. package/dist/shell/pure.d.ts +1 -1
  35. package/dist/shell/pure.js +6 -6
  36. package/dist/shell/shell.d.ts +14 -10
  37. package/dist/shell/shell.js +148 -116
  38. package/dist/shell/version.d.ts +1 -1
  39. package/dist/shell/version.js +1 -1
  40. package/dist/styles/body-italic-font.d.ts +2 -0
  41. package/dist/styles/body-italic-font.js +10 -0
  42. package/dist/styles/register-embedded-font.d.ts +5 -4
  43. package/dist/styles/register-embedded-font.js +11 -10
  44. package/docs/SPEC.md +11 -7
  45. package/editor/vscode.html-custom-data.json +15 -5
  46. package/editor/web-types.json +55 -9
  47. package/package.json +7 -3
@@ -1,289 +1,342 @@
1
1
  //#region src/shell/catalog.ts
2
- var e = "trash", t = "disk", n = "folder", r = "app", i = "untitled folder", a = "#seeded", o = (e) => e === "folder" || e === "trash" || e === "disk", s = (e) => e === "trash" || e === "disk";
3
- function c(e) {
2
+ var e = "trash", t = "disk", n = "system-folder", r = "apple-menu-items", i = "startup-items", a = "folder", o = "app", s = "alias", c = "untitled folder", l = "#seeded", u = (e) => e === "folder" || e === "trash" || e === "disk", d = (e) => e === "trash" || e === "disk", f = (e) => d(e) || e === "system-folder" || e === "apple-menu-items" || e === "startup-items";
3
+ function p(e) {
4
4
  let t = e.data;
5
5
  return typeof t?.app == "string" ? t.app : null;
6
6
  }
7
- function l(e, t) {
7
+ function m(e) {
8
+ if (e.kind !== "alias") return null;
9
+ let t = e.data;
10
+ return typeof t?.original == "string" ? t.original : null;
11
+ }
12
+ function h(e) {
13
+ if (e.kind !== "alias") return null;
14
+ let t = e.data;
15
+ return typeof t?.kind == "string" ? t.kind : null;
16
+ }
17
+ function g(e, t) {
8
18
  return t == null ? null : e.items.find((e) => e.id === t) ?? null;
9
19
  }
10
- function u(e, t) {
11
- let n = l(e, t);
12
- return n && o(n.kind) ? n.id : null;
20
+ function _(e, t) {
21
+ let n = /* @__PURE__ */ new Set(), r = g(e, t);
22
+ for (; r?.kind === s;) {
23
+ if (n.has(r.id)) return null;
24
+ n.add(r.id), r = g(e, m(r));
25
+ }
26
+ return r;
27
+ }
28
+ function v(e, t) {
29
+ let n = g(e, t);
30
+ return n && u(n.kind) ? n.id : null;
13
31
  }
14
- function d(e, t) {
15
- let n = u(e, t);
16
- return e.items.filter((t) => t.id !== n && u(e, t.parent) === n);
32
+ function y(e, t) {
33
+ let n = v(e, t);
34
+ return e.items.filter((t) => t.id !== n && v(e, t.parent) === n);
17
35
  }
18
- function f(e, t) {
19
- return d(e, t).length;
36
+ function b(e, t) {
37
+ return y(e, t).length;
20
38
  }
21
- var p = (e, t) => u(e, l(e, t)?.parent ?? null);
22
- function m(e, t, n) {
23
- let r = /* @__PURE__ */ new Set(), i = p(e, t);
39
+ var x = (e, t) => v(e, g(e, t)?.parent ?? null);
40
+ function S(e, t, n) {
41
+ let r = /* @__PURE__ */ new Set(), i = x(e, t);
24
42
  for (; i != null && !r.has(i);) {
25
43
  if (i === n) return !0;
26
- r.add(i), i = p(e, i);
44
+ r.add(i), i = x(e, i);
27
45
  }
28
46
  return !1;
29
47
  }
30
- function h(e, t) {
31
- let n = [], r = /* @__PURE__ */ new Set(), i = u(e, t ?? null);
32
- for (; i != null && !r.has(i);) n.push(i), r.add(i), i = p(e, i);
48
+ function C(e, t) {
49
+ let n = [], r = /* @__PURE__ */ new Set(), i = v(e, t ?? null);
50
+ for (; i != null && !r.has(i);) n.push(i), r.add(i), i = x(e, i);
33
51
  return n;
34
52
  }
35
- function g(e, t) {
36
- return t == null ? !1 : t === "trash" || m(e, t, "trash");
53
+ function w(e, t) {
54
+ return t == null ? !1 : t === "trash" || S(e, t, "trash");
37
55
  }
38
- function _(e, t) {
56
+ function T(e, t) {
57
+ let n = g(e, t);
58
+ if (!n || w(e, n.id)) return !1;
59
+ let r = _(e, n.id);
60
+ return r != null && r.id !== "trash";
61
+ }
62
+ function E(e, t) {
63
+ let n = g(e, t);
64
+ if (!n) return null;
65
+ let r = _(e, n.id);
66
+ if (r) return u(r.kind) ? { folder: r.id } : null;
67
+ let i = h(n);
68
+ return i != null && u(i) ? { missing: n } : null;
69
+ }
70
+ function D(e, t) {
39
71
  let n = [], r = /* @__PURE__ */ new Set(), i = (t) => {
40
- for (let a of d(e, t)) r.has(a.id) || (r.add(a.id), n.push(a), o(a.kind) && i(a.id));
72
+ for (let a of y(e, t)) r.has(a.id) || (r.add(a.id), n.push(a), u(a.kind) && i(a.id));
41
73
  };
42
- return i(u(e, t)), n;
74
+ return i(v(e, t)), n;
43
75
  }
44
- function v(e, t) {
45
- let r = new Set(d(e, t).filter((e) => e.kind === n).map((e) => e.name));
46
- if (!r.has("untitled folder")) return i;
76
+ function O(e, t) {
77
+ let n = new Set(y(e, t).filter((e) => e.kind === a).map((e) => e.name));
78
+ if (!n.has("untitled folder")) return c;
47
79
  for (let e = 2;; e++) {
48
- let t = `${i} ${e}`;
49
- if (!r.has(t)) return t;
80
+ let t = `${c} ${e}`;
81
+ if (!n.has(t)) return t;
50
82
  }
51
83
  }
52
- var y = (e) => e.replace(/ copy( \d+)?$/, "");
53
- function b(e, t, n, r) {
54
- let i = new Set(d(e, t).filter((e) => e.kind === r).map((e) => e.name));
84
+ var k = (e) => e.replace(/ copy( \d+)?$/, "");
85
+ function A(e, t, n, r) {
86
+ let i = new Set(y(e, t).filter((e) => e.kind === r).map((e) => e.name));
55
87
  if (!i.has(n)) return n;
56
- let a = y(n);
88
+ let a = k(n);
57
89
  if (!i.has(`${a} copy`)) return `${a} copy`;
58
90
  for (let e = 2;; e++) {
59
91
  let t = `${a} copy ${e}`;
60
92
  if (!i.has(t)) return t;
61
93
  }
62
94
  }
63
- var x = (e, t) => e.createdAt - t.createdAt || (e.id < t.id ? -1 : 1);
64
- function S(e, t) {
95
+ function j(e, t, n) {
96
+ let r = new Set(y(e, t).filter((e) => e.kind === s).map((e) => e.name)), i = `${n} alias`;
97
+ if (!r.has(i)) return i;
98
+ for (let e = 2;; e++) {
99
+ let t = `${i} ${e}`;
100
+ if (!r.has(t)) return t;
101
+ }
102
+ }
103
+ var M = new Intl.Collator("en"), N = (e, t) => y(e, t).sort((e, t) => M.compare(e.name, t.name) || z(e, t));
104
+ function P(e, t) {
105
+ return g(e, t) ? N(e, t) : [];
106
+ }
107
+ var F = (e) => P(e, r), I = (e) => P(e, i), L = 5;
108
+ function R(e) {
109
+ let t = (n, r, i) => N(e, n).map((n) => {
110
+ let a = _(e, n.id);
111
+ if (!a || !u(a.kind) || r.has(a.id) || i >= L) return { item: n };
112
+ let o = t(a.id, /* @__PURE__ */ new Set([...r, a.id]), i + 1);
113
+ return o.length ? {
114
+ item: n,
115
+ entries: o
116
+ } : { item: n };
117
+ });
118
+ return g(e, "apple-menu-items") ? t(r, /* @__PURE__ */ new Set([r]), 0) : [];
119
+ }
120
+ var z = (e, t) => e.createdAt - t.createdAt || (e.id < t.id ? -1 : 1);
121
+ function B(e, t) {
65
122
  let n = { ...e };
66
123
  return t ? (n.left = t.left, n.top = t.top) : (delete n.left, delete n.top), n;
67
124
  }
68
- function C(n) {
69
- let { storage: r, volumes: i = {}, listed: c = () => !0, hooks: d = () => void 0, placeDelay: f = 400 } = n, p = () => (n.now ?? Date.now)(), h = () => n.newId ? n.newId() : crypto.randomUUID(), y = [];
70
- i.disk && y.push({
71
- id: t,
72
- name: i.disk,
73
- kind: t,
74
- parent: null,
75
- createdAt: 0,
76
- modifiedAt: 0
77
- }), i.trash !== !1 && y.push({
125
+ function V(o) {
126
+ let { storage: s, volumes: c = {}, system: d, listed: p = () => !0, hooks: h = () => void 0, placeDelay: _ = 400 } = o, y = () => (o.now ?? Date.now)(), b = () => o.newId ? o.newId() : crypto.randomUUID(), x = [], C = (e, t, n, r) => x.push({
78
127
  id: e,
79
- name: i.trash ?? "Trash",
80
- kind: e,
81
- parent: null,
128
+ name: t,
129
+ kind: n,
130
+ parent: r,
82
131
  createdAt: 0,
83
132
  modifiedAt: 0
84
133
  });
85
- let C = /* @__PURE__ */ new Map(), w = !1, T = !1, E = O(), D = /* @__PURE__ */ new Set();
86
- function O() {
87
- let e = y.map((e) => {
88
- let t = C.get(e.id);
134
+ c.disk && C(t, c.disk, t, null), c.trash !== !1 && C(e, c.trash ?? "Trash", e, null), d && (C(n, d.folder, a, c.disk ? t : null), C(r, d.appleMenu, a, n), C(i, d.startup, a, n));
135
+ let T = /* @__PURE__ */ new Map(), E = !1, k = !1, j = N(), M = /* @__PURE__ */ new Set();
136
+ function N() {
137
+ let e = x.map((e) => {
138
+ let t = T.get(e.id);
89
139
  return t?.left != null && t.top != null ? {
90
140
  ...e,
91
141
  left: t.left,
92
142
  top: t.top
93
143
  } : e;
94
- }), t = [...C.values()].filter((e) => !s(e.id) && (e.kind === "folder" || c(e.kind))).sort(x);
144
+ }), t = [...T.values()].filter((e) => !f(e.id) && (e.kind === "folder" || p(e.kind))).sort(z);
95
145
  return {
96
- available: w,
146
+ available: E,
97
147
  items: [...e, ...t]
98
148
  };
99
149
  }
100
- function k() {
101
- E = O();
102
- for (let e of [...D]) e(E);
150
+ function P() {
151
+ j = N();
152
+ for (let e of [...M]) e(j);
103
153
  }
104
- let A = () => {
105
- if (!r) throw Error("storage is unavailable");
106
- return r;
154
+ let F = () => {
155
+ if (!s) throw Error("storage is unavailable");
156
+ return s;
107
157
  };
108
- async function j(e) {
109
- await A().put(e), C.set(e.id, e);
158
+ async function I(e) {
159
+ await F().put(e), T.set(e.id, e);
110
160
  }
111
- let M = /* @__PURE__ */ new Set(), N = null;
112
- async function P() {
113
- N && clearTimeout(N), N = null;
114
- let e = [...M];
115
- if (M.clear(), !(!r || !w)) for (let t of e) {
116
- let e = C.get(t);
117
- e && await r.put(e).catch(() => {});
161
+ let L = /* @__PURE__ */ new Set(), R = null;
162
+ async function V() {
163
+ R && clearTimeout(R), R = null;
164
+ let e = [...L];
165
+ if (L.clear(), !(!s || !E)) for (let t of e) {
166
+ let e = T.get(t);
167
+ e && await s.put(e).catch(() => {});
118
168
  }
119
169
  }
120
- let F = (e) => {
121
- let t = y.find((t) => t.id === e);
122
- return C.get(e) ?? {
170
+ let H = (e) => {
171
+ let t = x.find((t) => t.id === e);
172
+ return T.get(e) ?? {
123
173
  ...t,
124
174
  name: ""
125
175
  };
126
176
  };
127
- async function I() {
128
- M.clear();
129
- for (let e of await A().list()) e.id !== a && (await A().remove(e.id), C.delete(e.id));
130
- C = /* @__PURE__ */ new Map();
177
+ async function U() {
178
+ L.clear();
179
+ for (let e of await F().list()) e.id !== l && (await F().remove(e.id), T.delete(e.id));
180
+ T = /* @__PURE__ */ new Map();
131
181
  }
132
- let L = {
133
- get: () => E,
182
+ let W = {
183
+ get: () => j,
134
184
  subscribe(e) {
135
- return D.add(e), () => {
136
- D.delete(e);
185
+ return M.add(e), () => {
186
+ M.delete(e);
137
187
  };
138
188
  },
139
- item: (e) => l(E, e),
189
+ item: (e) => g(j, e),
140
190
  async refresh() {
141
- if (!r) {
142
- C = /* @__PURE__ */ new Map(), w = !1, k();
191
+ if (!s) {
192
+ T = /* @__PURE__ */ new Map(), E = !1, P();
143
193
  return;
144
194
  }
145
195
  try {
146
- let e = await r.list();
147
- C = /* @__PURE__ */ new Map(), T = !1;
148
- for (let t of e) t.id === a ? T = !0 : C.set(t.id, t);
149
- w = !0;
196
+ let e = await s.list();
197
+ T = /* @__PURE__ */ new Map(), k = !1;
198
+ for (let t of e) t.id === l ? k = !0 : T.set(t.id, t);
199
+ E = !0;
150
200
  } catch (e) {
151
- console.warn("vintage-frames/shell: the catalog could not be read —", e), C = /* @__PURE__ */ new Map(), w = !1;
201
+ console.warn("vintage-frames/shell: the catalog could not be read —", e), T = /* @__PURE__ */ new Map(), E = !1;
152
202
  }
153
- k();
203
+ P();
154
204
  },
155
205
  async seed(e) {
156
- return !r || !w || T ? !1 : (await e(L), await r.put({
157
- id: a,
206
+ return !s || !E || k ? !1 : (await e(W), await s.put({
207
+ id: l,
158
208
  name: "",
159
- kind: a,
209
+ kind: l,
160
210
  parent: null,
161
- createdAt: p(),
162
- modifiedAt: p()
163
- }), T = !0, !0);
211
+ createdAt: y(),
212
+ modifiedAt: y()
213
+ }), k = !0, !0);
164
214
  },
165
215
  async create(e = {}) {
166
- let t = u(E, e.parent ?? null);
167
- if (g(E, t)) return null;
168
- let n = e.kind ?? "folder", r = e.at ?? p(), i = {
169
- id: h(),
170
- name: e.name ?? (n === "folder" ? v(E, t) : "untitled"),
216
+ let t = v(j, e.parent ?? null);
217
+ if (w(j, t)) return null;
218
+ let n = e.kind ?? "folder", r = e.at ?? y(), i = {
219
+ id: b(),
220
+ name: e.name ?? (n === "folder" ? O(j, t) : "untitled"),
171
221
  kind: n,
172
222
  parent: t,
173
223
  createdAt: r,
174
224
  modifiedAt: r
175
225
  };
176
- return e.data !== void 0 && (i.data = e.data), e.left != null && e.top != null && (i = S(i, {
226
+ return e.data !== void 0 && (i.data = e.data), e.left != null && e.top != null && (i = B(i, {
177
227
  left: e.left,
178
228
  top: e.top
179
- })), await j(i), k(), i;
229
+ })), await I(i), P(), i;
180
230
  },
181
231
  async rename(e, t) {
182
- let n = C.get(e);
183
- return !n || s(e) || n.name === t ? !1 : (await j({
232
+ let n = T.get(e);
233
+ return !n || f(e) || n.name === t ? !1 : (await I({
184
234
  ...n,
185
235
  name: t,
186
- modifiedAt: p()
187
- }), k(), !0);
236
+ modifiedAt: y()
237
+ }), P(), !0);
188
238
  },
189
239
  async update(e, t) {
190
- let n = C.get(e);
191
- return !n || s(e) ? !1 : (await j({
240
+ let n = T.get(e);
241
+ return !n || f(e) ? !1 : (await I({
192
242
  ...n,
193
243
  data: t,
194
- modifiedAt: p()
195
- }), k(), !0);
244
+ modifiedAt: y()
245
+ }), P(), !0);
196
246
  },
197
247
  async move(e, t, n) {
198
- let r = u(E, t), i = [];
248
+ let r = v(j, t), i = [];
199
249
  for (let t of e) {
200
- let e = C.get(t);
201
- !e || s(t) || r === t || r != null && o(e.kind) && m(E, r, t) || u(E, e.parent) !== r && (M.delete(t), await j(S({
250
+ let e = T.get(t);
251
+ !e || f(t) || r === t || r != null && u(e.kind) && S(j, r, t) || v(j, e.parent) !== r && (L.delete(t), await I(B({
202
252
  ...e,
203
253
  parent: r
204
254
  }, n?.get(t) ?? null)), i.push(t));
205
255
  }
206
- return i.length && k(), i;
256
+ return i.length && P(), i;
207
257
  },
208
258
  place(e) {
209
259
  let t = !1;
210
260
  for (let [n, r] of e) {
211
- let e = s(n) ? y.some((e) => e.id === n) ? F(n) : null : C.get(n);
212
- !e || e.left === r.left && e.top === r.top || (C.set(n, S(e, r)), M.add(n), t = !0);
261
+ let e = f(n) ? x.some((e) => e.id === n) ? H(n) : null : T.get(n);
262
+ !e || e.left === r.left && e.top === r.top || (T.set(n, B(e, r)), L.add(n), t = !0);
213
263
  }
214
- t && (k(), N && clearTimeout(N), N = setTimeout(() => void P(), f));
264
+ t && (P(), R && clearTimeout(R), R = setTimeout(() => void V(), _));
215
265
  },
216
- flush: P,
266
+ flush: V,
217
267
  async copy(e, t) {
218
- let n = u(E, t);
219
- if (g(E, n)) return [];
268
+ let n = v(j, t);
269
+ if (w(j, n)) return [];
220
270
  let r = [];
221
271
  for (let t of e) {
222
- let e = l(E, t);
223
- if (!e || s(t)) continue;
224
- let i = o(e.kind) ? _(E, t) : [], a = /* @__PURE__ */ new Map(), c = async (e, t, n) => {
225
- let r = p(), i = {
272
+ let e = g(j, t);
273
+ if (!e || f(t)) continue;
274
+ let i = u(e.kind) ? D(j, t) : [], a = /* @__PURE__ */ new Map(), o = async (e, t, n) => {
275
+ let r = y(), i = {
226
276
  ...e,
227
- id: h(),
228
- name: n ? b(E, t, e.name, e.kind) : e.name,
277
+ id: b(),
278
+ name: n ? A(j, t, e.name, e.kind) : e.name,
229
279
  parent: t,
230
280
  createdAt: r,
231
281
  modifiedAt: r
232
282
  };
233
- return n && (i = S(i, null)), a.set(e.id, i.id), await j(i), await d(e.kind)?.copy?.(e, i), i;
283
+ return n && (i = B(i, null)), a.set(e.id, i.id), await I(i), await h(e.kind)?.copy?.(e, i), i;
234
284
  };
235
- r.push(await c(e, n, !0));
236
- for (let e of i) await c(e, a.get(u(E, e.parent) ?? "") ?? null, !1);
237
- k();
285
+ r.push(await o(e, n, !0));
286
+ for (let e of i) await o(e, a.get(v(j, e.parent) ?? "") ?? null, !1);
287
+ P();
238
288
  }
239
289
  return r;
240
290
  },
241
291
  async emptyTrash() {
242
- let t = _(E, e);
243
- for (let e of t) await A().remove(e.id), C.delete(e.id), M.delete(e.id), await d(e.kind)?.onRemove?.(e);
244
- return t.length && k(), t;
292
+ let t = D(j, e);
293
+ for (let e of t) await F().remove(e.id), T.delete(e.id), L.delete(e.id), await h(e.kind)?.onRemove?.(e);
294
+ return t.length && P(), t;
245
295
  },
246
296
  trashSize() {
247
- return _(E, e).reduce((e, t) => e + (d(t.kind)?.size?.(t) ?? 0), 0);
297
+ return D(j, e).reduce((e, t) => e + (h(t.kind)?.size?.(t) ?? 0), 0);
248
298
  },
249
299
  dump() {
250
- return { items: [...C.values()] };
300
+ return { items: [...T.values()] };
251
301
  },
252
302
  async clear() {
253
- if (r) try {
254
- await I();
303
+ if (s) try {
304
+ await U();
255
305
  } finally {
256
- k();
306
+ P();
257
307
  }
258
308
  },
259
309
  async import(e, { mode: t = "merge" } = {}) {
260
- let n = /* @__PURE__ */ new Map(), i = e.items.filter((e) => e.id !== a && !s(e.id));
261
- if (!i.length || !r) return n;
262
- let o = t === "replace", c = /* @__PURE__ */ new Map();
263
- for (let e of i) c.set(e.id, o ? e.id : h());
264
- let l = (e) => e == null || s(e) ? e : c.get(e) ?? null;
310
+ let n = /* @__PURE__ */ new Map(), r = e.items.filter((e) => e.id !== l && !f(e.id));
311
+ if (!r.length || !s) return n;
312
+ let i = t === "replace", a = /* @__PURE__ */ new Map();
313
+ for (let e of r) a.set(e.id, i ? e.id : b());
314
+ let o = (e) => e == null || f(e) ? e : a.get(e) ?? null;
265
315
  try {
266
- o && await I();
267
- for (let e of i) {
316
+ i && await U();
317
+ for (let e of r) {
268
318
  let t = {
269
319
  ...e,
270
- id: c.get(e.id),
271
- parent: l(e.parent)
272
- };
273
- await j(t), n.set(e.id, t);
320
+ id: a.get(e.id),
321
+ parent: o(e.parent)
322
+ }, r = m(e);
323
+ r != null && a.has(r) && (t.data = {
324
+ ...e.data,
325
+ original: a.get(r)
326
+ }), await I(t), n.set(e.id, t);
274
327
  }
275
328
  } finally {
276
- k();
329
+ P();
277
330
  }
278
331
  return n;
279
332
  },
280
333
  async dispose() {
281
- await P(), D.clear();
334
+ await V(), M.clear();
282
335
  }
283
336
  };
284
- return L;
337
+ return W;
285
338
  }
286
- function w(e = []) {
339
+ function H(e = []) {
287
340
  let t = new Map(e.map((e) => [e.id, e]));
288
341
  return {
289
342
  records: t,
@@ -293,4 +346,4 @@ function w(e = []) {
293
346
  };
294
347
  }
295
348
  //#endregion
296
- export { r as APP_KIND, t as DISK, n as FOLDER, e as TRASH, i as UNTITLED_FOLDER, c as appIdOf, d as childrenOf, u as containerOf, b as copyName, C as createCatalog, _ as descendantsOf, h as enclosingFolders, o as isContainerKind, m as isInside, g as isTrashed, s as isVolume, f as itemCount, l as itemOf, w as memoryStorage, v as nextFolderName };
349
+ export { s as ALIAS_KIND, r as APPLE_MENU_ITEMS, o as APP_KIND, t as DISK, a as FOLDER, i as STARTUP_ITEMS, n as SYSTEM_FOLDER, e as TRASH, c as UNTITLED_FOLDER, j as aliasName, p as appIdOf, F as appleMenuItemsOf, R as appleMenuOf, T as canAlias, y as childrenOf, v as containerOf, A as copyName, V as createCatalog, D as descendantsOf, E as dropTargetOf, C as enclosingFolders, u as isContainerKind, S as isInside, f as isKept, w as isTrashed, d as isVolume, b as itemCount, g as itemOf, H as memoryStorage, O as nextFolderName, m as originalOf, _ as resolve, I as startupItemsOf };
@@ -19,16 +19,20 @@
19
19
  * around it. An application's icon stands for the application: it is drawn
20
20
  * open while the application has a window open, and the application's own
21
21
  * windows close into it.
22
- * - Menus: File (Open, New Folder, Close), Edit (Copy, Paste, Select All),
23
- * View (Arrange Windows), Special (Clean Up, Empty Trash…), each disabled
24
- * while it has nothing to act on. A site switches commands off and adds
25
- * its own.
22
+ * - An alias wears its original's art with its name in italics, and opens
23
+ * its original; an alias of a folder or the disk also files a drop into
24
+ * it. With the original gone, an alert says so. Make Alias makes one
25
+ * beside each selected application, document, folder or disk.
26
+ * - Menus: File (Open, New Folder, Close, Make Alias), Edit (Copy, Paste,
27
+ * Select All), View (Arrange Windows), Special (Clean Up, Empty Trash…),
28
+ * each disabled while it has nothing to act on. A site switches commands
29
+ * off and adds its own.
26
30
  * - Alerts are the Finder's own, composed with the site's caution art and
27
31
  * held by it while they are up. A site answers any of them with its own
28
32
  * dialog through `alertWith`.
29
33
  */
30
34
  import type { VfIcon, VfMenuItem, VfViewportBox } from '../index.js';
31
- import type { Catalog, CatalogStorage, Item, Volumes } from './catalog.js';
35
+ import type { Catalog, CatalogStorage, Item, SystemFolders, Volumes } from './catalog.js';
32
36
  import type { LatticeOptions, Size } from './geometry.js';
33
37
  import type { AppContext, AppDefinition } from './shell.js';
34
38
  /** The Finder's application id. */
@@ -44,13 +48,17 @@ export interface FinderArt {
44
48
  document: string;
45
49
  /** The startup disk; the folder's art without it. */
46
50
  disk?: string;
51
+ /** The System Folder and its two folders; the folder's art without them. */
52
+ systemFolder?: string;
53
+ appleMenuItems?: string;
54
+ startupItems?: string;
47
55
  /** 12×12: the mark before the item count in the Trash's window and trashed folders. */
48
56
  trashMark?: string;
49
57
  /** 32×32: beside the message in the Finder's alerts. Without it they have no art. */
50
58
  caution?: string;
51
59
  }
52
60
  /** What a failed command was, in the `failed` alert. */
53
- export type FinderFailedAction = 'new-folder' | 'empty-trash' | 'paste' | 'add-file';
61
+ export type FinderFailedAction = 'new-folder' | 'empty-trash' | 'paste' | 'add-file' | 'make-alias';
54
62
  /** The Finder's alerts, by id, with the details each one's handler gets. */
55
63
  export interface FinderAlerts {
56
64
  /** Special → Empty Trash…: an answer of `'ok'` empties the Trash. */
@@ -70,7 +78,11 @@ export interface FinderAlerts {
70
78
  'move-failed': {
71
79
  error: Error;
72
80
  };
73
- /** New Folder, Empty Trash, Paste or a dropped file failed. */
81
+ /** Opening an alias whose original is gone, or a drop onto an alias of a folder whose original is gone. */
82
+ 'original-missing': {
83
+ alias: Item;
84
+ };
85
+ /** New Folder, Empty Trash, Paste, Make Alias or a dropped file failed. */
74
86
  failed: {
75
87
  action: FinderFailedAction;
76
88
  error: Error;
@@ -81,7 +93,7 @@ export type FinderAlert = keyof FinderAlerts;
81
93
  /** Answers one of the Finder's alerts: resolves the answer, or null. */
82
94
  export type FinderAlertHandler<K extends FinderAlert> = (details: FinderAlerts[K]) => string | null | Promise<string | null>;
83
95
  /** The Finder's own commands, each of which a site can switch off. */
84
- export type FinderCommand = 'open' | 'new-folder' | 'close' | 'copy' | 'paste' | 'select-all' | 'arrange' | 'clean-up' | 'empty-trash';
96
+ export type FinderCommand = 'open' | 'new-folder' | 'close' | 'make-alias' | 'copy' | 'paste' | 'select-all' | 'arrange' | 'clean-up' | 'empty-trash';
85
97
  /** The Finder's menus, by `data-menu`. */
86
98
  export type FinderMenu = 'file' | 'edit' | 'view' | 'special';
87
99
  /** A command a site adds to the Finder's menus. */
@@ -135,10 +147,17 @@ export interface FinderOptions {
135
147
  art: FinderArt;
136
148
  /** The volumes: the Trash by default, and a startup disk when named. */
137
149
  volumes?: Volumes;
150
+ /**
151
+ * The System Folder and its folders, named: what Apple Menu Items holds is
152
+ * the Apple menu, and what Startup Items holds opens at startup. Unset, none.
153
+ */
154
+ system?: SystemFolders;
138
155
  /**
139
156
  * What the catalog starts with, stored once per storage: `'markup'` reads
140
157
  * the `<vf-icon data-app>` and `<template data-folder="Name">` the page
141
- * put in the desktop's field; a function stores the site's defaults.
158
+ * put in the desktop's field, and a `<template data-system="apple-menu-items">`
159
+ * files what it holds in that folder of the System Folder; a function
160
+ * stores the site's defaults.
142
161
  */
143
162
  seed?: 'markup' | ((catalog: Catalog) => void | Promise<void>);
144
163
  /** The lattices' cells, pitches and insets (default: 64px cells, 80px columns, 72px rows, 16px insets). */