vintage-frames 0.16.0 → 0.16.2

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.
@@ -9,7 +9,7 @@
9
9
  * Its API may change in any minor release while it is experimental.
10
10
  * docs/SHELL.md is the guide.
11
11
  */
12
- export { createShell, defineApp, appIdOf, APP_KIND } from './shell.js';
12
+ export { createShell, defineApp } from './shell.js';
13
13
  export type { AppContext, AppDefinition, CatalogSetup, KindDefinition, Shell, ShellOptions } from './shell.js';
14
14
  export { createWindowManager, focusInto } from './windows.js';
15
15
  export type { AdoptOptions, ArrangeGroup, BoxInput, CloseHandler, FocusHome, HomeBox, OpenOptions, PlacePolicy, Placed, WindowManager, WindowManagerOptions, } from './windows.js';
@@ -17,7 +17,7 @@ export { finder, FINDER } from './finder.js';
17
17
  export type { FinderAlert, FinderAlertHandler, FinderAlerts, FinderApi, FinderArt, FinderCommand, FinderCommandSpec, FinderFailedAction, FinderMenu, FinderOpen, FinderOptions, } from './finder.js';
18
18
  export { fileByDrag } from './filing.js';
19
19
  export type { FilingOptions } from './filing.js';
20
- export { createCatalog, memoryStorage, childrenOf, containerOf, copyName, descendantsOf, enclosingFolders, isContainerKind, isInside, isTrashed, isVolume, itemCount, itemOf, nextFolderName, DISK, FOLDER, TRASH, UNTITLED_FOLDER, } from './catalog.js';
20
+ export { createCatalog, memoryStorage, appIdOf, childrenOf, containerOf, copyName, descendantsOf, enclosingFolders, isContainerKind, isInside, isTrashed, isVolume, itemCount, itemOf, nextFolderName, APP_KIND, DISK, FOLDER, TRASH, UNTITLED_FOLDER, } from './catalog.js';
21
21
  export type { Catalog, CatalogArchive, CatalogOptions, CatalogState, CatalogStorage, Item, KindHooks, NewItem, Volumes, } from './catalog.js';
22
22
  export { indexedDbStorage } from './storage.js';
23
23
  export { localStorageState, mergeSession, openWindowsOf, readSession } from './state.js';
@@ -1,10 +1,10 @@
1
- import { DISK as e, FOLDER as t, TRASH as n, UNTITLED_FOLDER as r, childrenOf as i, containerOf as a, copyName as o, createCatalog as s, descendantsOf as c, enclosingFolders as l, isContainerKind as u, isInside as d, isTrashed as f, isVolume as p, itemCount as m, itemOf as h, memoryStorage as g, nextFolderName as _ } from "./catalog.js";
2
- import { BAND as v, CASCADE_SLOTS as y, CASCADE_STEP as b, ICON_CELL as x, ICON_COLUMN as S, ICON_INSET as C, ICON_ROW as w, NEAR as T, WINDOW_ORIGIN as E, cascadeFrom as D, cascadeSlot as O, cascadedBox as k, centeredBox as A, cleanUp as j, collisions as M, desktopLattice as N, fieldExtent as P, fillOrder as F, folderLattice as I, frameOf as L, isPin as R, latticeCell as z, latticeSlot as B, nearBox as V, nextFreeCell as H, pinOf as U, pinTo as W, trashCell as G, windowOrigin as K } from "./geometry.js";
3
- import { createWindowManager as q, focusInto as J } from "./windows.js";
4
- import { localStorageState as Y, mergeSession as X, openWindowsOf as Z, readSession as Q } from "./state.js";
5
- import { DATE_HOLD_MS as $, formatDate as ee, formatTime as te, startClock as ne } from "./clock.js";
6
- import { APP_KIND as re, appIdOf as ie, createShell as ae, defineApp as oe } from "./shell.js";
1
+ import { APP_KIND as e, DISK as t, FOLDER as n, TRASH as r, UNTITLED_FOLDER as i, appIdOf as a, childrenOf as o, containerOf as s, copyName as c, createCatalog as l, descendantsOf as u, enclosingFolders as d, isContainerKind as f, isInside as p, isTrashed as m, isVolume as h, itemCount as g, itemOf as _, memoryStorage as v, nextFolderName as y } from "./catalog.js";
2
+ import { BAND as b, CASCADE_SLOTS as x, CASCADE_STEP as S, ICON_CELL as C, ICON_COLUMN as w, ICON_INSET as T, ICON_ROW as E, NEAR as D, WINDOW_ORIGIN as O, cascadeFrom as k, cascadeSlot as A, cascadedBox as j, centeredBox as M, cleanUp as N, collisions as P, desktopLattice as F, fieldExtent as I, fillOrder as L, folderLattice as R, frameOf as z, isPin as B, latticeCell as V, latticeSlot as H, nearBox as U, nextFreeCell as W, pinOf as G, pinTo as K, trashCell as q, windowOrigin as J } from "./geometry.js";
3
+ import { createWindowManager as Y, focusInto as X } from "./windows.js";
4
+ import { localStorageState as Z, mergeSession as Q, openWindowsOf as $, readSession as ee } from "./state.js";
5
+ import { DATE_HOLD_MS as te, formatDate as ne, formatTime as re, startClock as ie } from "./clock.js";
6
+ import { createShell as ae, defineApp as oe } from "./shell.js";
7
7
  import { fileByDrag as se } from "./filing.js";
8
8
  import { FINDER as ce, finder as le } from "./finder.js";
9
9
  import { indexedDbStorage as ue } from "./storage.js";
10
- export { re as APP_KIND, v as BAND, y as CASCADE_SLOTS, b as CASCADE_STEP, $ as DATE_HOLD_MS, e as DISK, ce as FINDER, t as FOLDER, x as ICON_CELL, S as ICON_COLUMN, C as ICON_INSET, w as ICON_ROW, T as NEAR, n as TRASH, r as UNTITLED_FOLDER, E as WINDOW_ORIGIN, ie as appIdOf, D as cascadeFrom, O as cascadeSlot, k as cascadedBox, A as centeredBox, i as childrenOf, j as cleanUp, M as collisions, a as containerOf, o as copyName, s as createCatalog, ae as createShell, q as createWindowManager, oe as defineApp, c as descendantsOf, N as desktopLattice, l as enclosingFolders, P as fieldExtent, se as fileByDrag, F as fillOrder, le as finder, J as focusInto, I as folderLattice, ee as formatDate, te as formatTime, L as frameOf, ue as indexedDbStorage, u as isContainerKind, d as isInside, R as isPin, f as isTrashed, p as isVolume, m as itemCount, h as itemOf, z as latticeCell, B as latticeSlot, Y as localStorageState, g as memoryStorage, X as mergeSession, V as nearBox, _ as nextFolderName, H as nextFreeCell, Z as openWindowsOf, U as pinOf, W as pinTo, Q as readSession, ne as startClock, G as trashCell, K as windowOrigin };
10
+ export { e as APP_KIND, b as BAND, x as CASCADE_SLOTS, S as CASCADE_STEP, te as DATE_HOLD_MS, t as DISK, ce as FINDER, n as FOLDER, C as ICON_CELL, w as ICON_COLUMN, T as ICON_INSET, E as ICON_ROW, D as NEAR, r as TRASH, i as UNTITLED_FOLDER, O as WINDOW_ORIGIN, a as appIdOf, k as cascadeFrom, A as cascadeSlot, j as cascadedBox, M as centeredBox, o as childrenOf, N as cleanUp, P as collisions, s as containerOf, c as copyName, l as createCatalog, ae as createShell, Y as createWindowManager, oe as defineApp, u as descendantsOf, F as desktopLattice, d as enclosingFolders, I as fieldExtent, se as fileByDrag, L as fillOrder, le as finder, X as focusInto, R as folderLattice, ne as formatDate, re as formatTime, z as frameOf, ue as indexedDbStorage, f as isContainerKind, p as isInside, B as isPin, m as isTrashed, h as isVolume, g as itemCount, _ as itemOf, V as latticeCell, H as latticeSlot, Z as localStorageState, v as memoryStorage, Q as mergeSession, U as nearBox, y as nextFolderName, W as nextFreeCell, $ as openWindowsOf, G as pinOf, K as pinTo, ee as readSession, ie as startClock, q as trashCell, J as windowOrigin };
@@ -1,4 +1,4 @@
1
- import { DISK as e, FOLDER as t, TRASH as n, UNTITLED_FOLDER as r, childrenOf as i, containerOf as a, copyName as o, createCatalog as s, descendantsOf as c, enclosingFolders as l, isContainerKind as u, isInside as d, isTrashed as f, isVolume as p, itemCount as m, itemOf as h, memoryStorage as g, nextFolderName as _ } from "./catalog.js";
2
- import { BAND as v, CASCADE_SLOTS as y, CASCADE_STEP as b, ICON_CELL as x, ICON_COLUMN as S, ICON_INSET as C, ICON_ROW as w, NEAR as T, WINDOW_ORIGIN as E, cascadeFrom as D, cascadeSlot as O, cascadedBox as k, centeredBox as A, cleanUp as j, collisions as M, desktopLattice as N, fieldExtent as P, fillOrder as F, folderLattice as I, frameOf as L, isPin as R, latticeCell as z, latticeSlot as B, nearBox as V, nextFreeCell as H, pinOf as U, pinTo as W, trashCell as G, windowOrigin as K } from "./geometry.js";
3
- import { localStorageState as q, mergeSession as J, openWindowsOf as Y, readSession as X } from "./state.js";
4
- export { v as BAND, y as CASCADE_SLOTS, b as CASCADE_STEP, e as DISK, t as FOLDER, x as ICON_CELL, S as ICON_COLUMN, C as ICON_INSET, w as ICON_ROW, T as NEAR, n as TRASH, r as UNTITLED_FOLDER, E as WINDOW_ORIGIN, D as cascadeFrom, O as cascadeSlot, k as cascadedBox, A as centeredBox, i as childrenOf, j as cleanUp, M as collisions, a as containerOf, o as copyName, s as createCatalog, c as descendantsOf, N as desktopLattice, l as enclosingFolders, P as fieldExtent, F as fillOrder, I as folderLattice, L as frameOf, u as isContainerKind, d as isInside, R as isPin, f as isTrashed, p as isVolume, m as itemCount, h as itemOf, z as latticeCell, B as latticeSlot, q as localStorageState, g as memoryStorage, J as mergeSession, V as nearBox, _ as nextFolderName, H as nextFreeCell, Y as openWindowsOf, U as pinOf, W as pinTo, X as readSession, G as trashCell, K as windowOrigin };
1
+ import { APP_KIND as e, DISK as t, FOLDER as n, TRASH as r, UNTITLED_FOLDER as i, appIdOf as a, childrenOf as o, containerOf as s, copyName as c, createCatalog as l, descendantsOf as u, enclosingFolders as d, isContainerKind as f, isInside as p, isTrashed as m, isVolume as h, itemCount as g, itemOf as _, memoryStorage as v, nextFolderName as y } from "./catalog.js";
2
+ import { BAND as b, CASCADE_SLOTS as x, CASCADE_STEP as S, ICON_CELL as C, ICON_COLUMN as w, ICON_INSET as T, ICON_ROW as E, NEAR as D, WINDOW_ORIGIN as O, cascadeFrom as k, cascadeSlot as A, cascadedBox as j, centeredBox as M, cleanUp as N, collisions as P, desktopLattice as F, fieldExtent as I, fillOrder as L, folderLattice as R, frameOf as z, isPin as B, latticeCell as V, latticeSlot as H, nearBox as U, nextFreeCell as W, pinOf as G, pinTo as K, trashCell as q, windowOrigin as J } from "./geometry.js";
3
+ import { localStorageState as Y, mergeSession as X, openWindowsOf as Z, readSession as Q } from "./state.js";
4
+ export { e as APP_KIND, b as BAND, x as CASCADE_SLOTS, S as CASCADE_STEP, t as DISK, n as FOLDER, C as ICON_CELL, w as ICON_COLUMN, T as ICON_INSET, E as ICON_ROW, D as NEAR, r as TRASH, i as UNTITLED_FOLDER, O as WINDOW_ORIGIN, a as appIdOf, k as cascadeFrom, A as cascadeSlot, j as cascadedBox, M as centeredBox, o as childrenOf, N as cleanUp, P as collisions, s as containerOf, c as copyName, l as createCatalog, u as descendantsOf, F as desktopLattice, d as enclosingFolders, I as fieldExtent, L as fillOrder, R as folderLattice, z as frameOf, f as isContainerKind, p as isInside, B as isPin, m as isTrashed, h as isVolume, g as itemCount, _ as itemOf, V as latticeCell, H as latticeSlot, Y as localStorageState, v as memoryStorage, X as mergeSession, U as nearBox, y as nextFolderName, W as nextFreeCell, Z as openWindowsOf, G as pinOf, K as pinTo, Q as readSession, q as trashCell, J as windowOrigin };
@@ -169,9 +169,5 @@ export interface Shell {
169
169
  readonly ready: Promise<void>;
170
170
  dispose(): void;
171
171
  }
172
- /** The kind the shell registers: an application's icon, which opens it. */
173
- export declare const APP_KIND = "app";
174
172
  /** Start the shell over `desktop`. The page has imported `vintage-frames` first. */
175
173
  export declare function createShell(desktop: VfDesktop, options: ShellOptions): Shell;
176
- /** The application an `app` item stands for. */
177
- export declare function appIdOf(item: Item): string | null;
@@ -1,31 +1,31 @@
1
1
  import { onScaleChange as e } from "../scale.js";
2
2
  import { VfWindow as t } from "../components/vf-window.js";
3
3
  import "../index.js";
4
- import { createCatalog as n } from "./catalog.js";
5
- import { createWindowManager as r, deepActiveElement as i, desktopRendered as a } from "./windows.js";
6
- import { openWindowsOf as o } from "./state.js";
7
- import { startClock as s } from "./clock.js";
4
+ import { appIdOf as n, createCatalog as r } from "./catalog.js";
5
+ import { createWindowManager as i, deepActiveElement as a, desktopRendered as o } from "./windows.js";
6
+ import { openWindowsOf as s } from "./state.js";
7
+ import { startClock as c } from "./clock.js";
8
8
  //#region src/shell/shell.ts
9
- function c(e) {
9
+ function l(e) {
10
10
  return e;
11
11
  }
12
- var l = "app", u = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e?.isContentEditable === !0;
13
- function d(c, l) {
14
- let d = l.apps, p = d.find((e) => e.catalog), m = l.defaultApp ?? p?.id ?? d[0]?.id ?? "", h = l.state ?? null, g = l.services ?? {}, _ = [], v = c.querySelector(":scope > vf-menu-bar");
12
+ var u = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e?.isContentEditable === !0;
13
+ function d(l, d) {
14
+ let f = d.apps, p = f.find((e) => e.catalog), m = d.defaultApp ?? p?.id ?? f[0]?.id ?? "", h = d.state ?? null, g = d.services ?? {}, _ = [], v = l.querySelector(":scope > vf-menu-bar");
15
15
  if (!v) throw Error("vintage-frames/shell: the desktop has no vf-menu-bar");
16
16
  let y = v.querySelector(":scope > vf-menu");
17
17
  if (!y) throw Error("vintage-frames/shell: the menu bar has no system menu");
18
18
  v.shortcuts = !0;
19
19
  let b = h?.saved?.pattern;
20
- b && (c.pattern = b);
20
+ b && (l.pattern = b);
21
21
  let x = null;
22
- if (l.fit === "viewport") {
22
+ if (d.fit === "viewport") {
23
23
  let t = () => {
24
24
  let e = {
25
- width: c.width,
26
- height: c.height
25
+ width: l.width,
26
+ height: l.height
27
27
  };
28
- c.fitWithin(document.documentElement.clientWidth, document.documentElement.clientHeight), x?.resized(e);
28
+ l.fitWithin(document.documentElement.clientWidth, document.documentElement.clientHeight), x?.resized(e);
29
29
  };
30
30
  t(), window.addEventListener("resize", t);
31
31
  let n = e(t);
@@ -33,34 +33,34 @@ function d(c, l) {
33
33
  window.removeEventListener("resize", t), n();
34
34
  });
35
35
  }
36
- let S = r(c, {
36
+ let S = i(l, {
37
37
  defaultApp: m,
38
38
  savedPin: (e) => h?.pin(e) ?? null
39
39
  });
40
40
  x = S;
41
41
  let C = (e) => {
42
- e.target === c && c.clearActive();
42
+ e.target === l && l.clearActive();
43
43
  };
44
- c.addEventListener("pointerdown", C), _.push(() => c.removeEventListener("pointerdown", C));
44
+ l.addEventListener("pointerdown", C), _.push(() => l.removeEventListener("pointerdown", C));
45
45
  let w = {}, T = /* @__PURE__ */ new Map();
46
46
  T.set("app", {
47
- art: (e) => d.find((t) => t.id === f(e))?.icon ?? "",
48
- open: (e, t) => void w[f(e) ?? ""]?.open?.({ from: t }),
47
+ art: (e) => f.find((t) => t.id === n(e))?.icon ?? "",
48
+ open: (e, t) => void w[n(e) ?? ""]?.open?.({ from: t }),
49
49
  editable: !1
50
50
  });
51
- for (let e of d) for (let [t, n] of Object.entries(e.kinds ?? {})) T.set(t, n);
52
- let E = p?.catalog ? n({
51
+ for (let e of f) for (let [t, n] of Object.entries(e.kinds ?? {})) T.set(t, n);
52
+ let E = p?.catalog ? r({
53
53
  storage: p.catalog.storage,
54
54
  volumes: p.catalog.volumes,
55
55
  listed: (e) => T.has(e),
56
56
  hooks: (e) => T.get(e)
57
- }) : null, D = () => !!document.querySelector("vf-dialog[open]"), O = () => u(i()), k = /* @__PURE__ */ new Map(), A = () => {
57
+ }) : null, D = () => !!document.querySelector("vf-dialog[open]"), O = () => u(a()), k = /* @__PURE__ */ new Map(), A = () => {
58
58
  for (let [e, t] of k) {
59
59
  let n = !t();
60
60
  e.disabled !== n && (e.disabled = n);
61
61
  }
62
62
  };
63
- document.addEventListener("pointerdown", A, !0), document.addEventListener("keydown", A, !0), c.addEventListener("vf-select", A), c.addEventListener("vf-activate", A), _.push(() => document.removeEventListener("pointerdown", A, !0), () => document.removeEventListener("keydown", A, !0), () => c.removeEventListener("vf-select", A), () => c.removeEventListener("vf-activate", A), S.onWindows(A), S.onLayout(A)), E && _.push(E.subscribe(A));
63
+ document.addEventListener("pointerdown", A, !0), document.addEventListener("keydown", A, !0), l.addEventListener("vf-select", A), l.addEventListener("vf-activate", A), _.push(() => document.removeEventListener("pointerdown", A, !0), () => document.removeEventListener("keydown", A, !0), () => l.removeEventListener("vf-select", A), () => l.removeEventListener("vf-activate", A), S.onWindows(A), S.onLayout(A)), E && _.push(E.subscribe(A));
64
64
  let j = (e) => {
65
65
  if (!e) return [];
66
66
  let t = document.createElement("div");
@@ -68,7 +68,7 @@ function d(c, l) {
68
68
  let n = [...t.children].filter((e) => e instanceof HTMLElement);
69
69
  for (let e of n) e.remove();
70
70
  return n;
71
- }, M = d.map((e) => ({
71
+ }, M = f.map((e) => ({
72
72
  def: e,
73
73
  menus: j(e.menus).filter((e) => e.localName === "vf-menu"),
74
74
  dialogs: j(e.dialogs).filter((e) => e.dataset.dialog != null),
@@ -85,7 +85,7 @@ function d(c, l) {
85
85
  o.clear();
86
86
  });
87
87
  let s = {
88
- desktop: c,
88
+ desktop: l,
89
89
  windows: S,
90
90
  menus: t,
91
91
  systemMenu: y,
@@ -95,7 +95,7 @@ function d(c, l) {
95
95
  state: h,
96
96
  kinds: T,
97
97
  kind: (e) => T.get(e),
98
- app: (e) => d.find((t) => t.id === e),
98
+ app: (e) => f.find((t) => t.id === e),
99
99
  menu(e) {
100
100
  let n = t.find((t) => t.dataset.menu === e);
101
101
  if (!n) throw Error(`${a}: missing menu ${e}`);
@@ -163,8 +163,8 @@ function d(c, l) {
163
163
  onDispose(e) {
164
164
  i.push(e);
165
165
  }
166
- }, l = e.init(s);
167
- l && (w[e.id] = l), N.push(() => {
166
+ }, c = e.init(s);
167
+ c && (w[e.id] = c), N.push(() => {
168
168
  for (let e of i.splice(0).reverse()) e();
169
169
  });
170
170
  }
@@ -175,16 +175,16 @@ function d(c, l) {
175
175
  y.after(...t.menus), v.label = t.def.name, P = t, A();
176
176
  }
177
177
  };
178
- if (_.push(S.onFront(F), S.onDialogs(F)), F(), l.clock !== !1) {
178
+ if (_.push(S.onFront(F), S.onDialogs(F)), F(), d.clock !== !1) {
179
179
  let e = v.querySelector(":scope > [slot=\"end\"]"), t = !e;
180
180
  e || (e = document.createElement("vf-label"), e.slot = "end", v.append(e));
181
- let n = s(e);
181
+ let n = c(e);
182
182
  _.push(() => {
183
183
  n(), t && e.remove();
184
184
  });
185
185
  }
186
186
  let I = /* @__PURE__ */ new WeakSet(), L = () => {
187
- if (E) for (let e of c.stackingOrder) {
187
+ if (E) for (let e of l.stackingOrder) {
188
188
  if (!(e instanceof t)) continue;
189
189
  let n = S.itemOf(e);
190
190
  if (n == null) continue;
@@ -193,39 +193,39 @@ function d(c, l) {
193
193
  }
194
194
  };
195
195
  return E && _.push(E.subscribe(L), S.onWindows(L)), h?.hold(), {
196
- desktop: c,
196
+ desktop: l,
197
197
  windows: S,
198
198
  catalog: E,
199
199
  apps: w,
200
200
  ready: (async () => {
201
201
  try {
202
- await a(c), E && (await E.refresh(), p?.catalog?.seed && await E.seed(p.catalog.seed));
203
- for (let { item: e, app: t } of o(h?.saved ?? null)) await w[t]?.open?.({ item: e });
202
+ await o(l), E && (await E.refresh(), p?.catalog?.seed && await E.seed(p.catalog.seed));
203
+ for (let { item: e, app: t } of s(h?.saved ?? null)) await w[t]?.open?.({ item: e });
204
204
  let e = h?.saved?.active;
205
205
  if (e) {
206
206
  let t = S.windowFor(e);
207
- t && c.bringToFront(t);
207
+ t && l.bringToFront(t);
208
208
  }
209
209
  } finally {
210
210
  if (h) {
211
211
  let e = h.start(() => ({
212
212
  windows: S.snapshot(),
213
- active: S.itemOf(c.activeWindow),
214
- pattern: c.pattern ?? null
213
+ active: S.itemOf(l.activeWindow),
214
+ pattern: l.pattern ?? null
215
215
  }), (e) => {
216
216
  let t = [
217
217
  S.onLayout(e),
218
218
  S.onWindows(e),
219
219
  ...E ? [E.subscribe(e)] : []
220
220
  ];
221
- c.addEventListener("vf-activate", e);
221
+ l.addEventListener("vf-activate", e);
222
222
  let n = new MutationObserver(e);
223
- return n.observe(c, {
223
+ return n.observe(l, {
224
224
  attributes: !0,
225
225
  attributeFilter: ["pattern"]
226
226
  }), () => {
227
227
  for (let e of t) e();
228
- c.removeEventListener("vf-activate", e), n.disconnect();
228
+ l.removeEventListener("vf-activate", e), n.disconnect();
229
229
  };
230
230
  });
231
231
  _.push(e), h.release();
@@ -241,9 +241,5 @@ function d(c, l) {
241
241
  }
242
242
  };
243
243
  }
244
- function f(e) {
245
- let t = e.data;
246
- return typeof t?.app == "string" ? t.app : null;
247
- }
248
244
  //#endregion
249
- export { l as APP_KIND, f as appIdOf, d as createShell, c as defineApp };
245
+ export { d as createShell, l as defineApp };
@@ -17,7 +17,8 @@
17
17
  * none is active. `beforeFront` runs before a change, `onFront` reports it.
18
18
  * - Palettes are an application's utility windows: shown while it is front
19
19
  * and hidden otherwise, never closed or removed.
20
- * - Opening a window moves keyboard focus into it; closing the active one
20
+ * - Opening a window moves keyboard focus into it, and a new window's field
21
+ * marked `autoselect` opens with its text selected; closing the active one
21
22
  * moves focus to the window that becomes active, else to the closed
22
23
  * window's icon, else to the desktop's icons. Focus left behind in a
23
24
  * window that is no longer active — a title-bar press moves none — goes
@@ -128,16 +129,20 @@ export declare function desktopRendered(desktop: VfDesktop): Promise<void>;
128
129
  export declare function deepActiveElement(): Element | null;
129
130
  /**
130
131
  * Move keyboard focus into `win`'s content once that content has rendered —
131
- * and then only if `when`, read at that point, still holds: to a descendant
132
- * marked `autofocus`, else to the first thing that takes the focus. An
133
- * element whose `tabindex` is negative is passed over: a roving cell parked
134
- * off the tab order, a disabled control. A kit host with no `tabindex` goes
135
- * through, since it hands the focus on inside itself. Resolves whether the
136
- * focus moved: a window with nothing focusable in its content keeps the
137
- * focus where it was.
132
+ * and then only if `when`, read at that point, still holds: to the first
133
+ * descendant marked `autofocus` or `autoselect`, else to the first thing that
134
+ * takes the focus. With `select`, a control marked `autoselect` has its text
135
+ * selected too; the window manager passes it on a window's first open only,
136
+ * so a caret placed in the window survives a return to it. An element whose
137
+ * `tabindex` is negative is passed over: a roving cell parked off the tab
138
+ * order, a disabled control. A kit host with no `tabindex` goes through,
139
+ * since it hands the focus on inside itself. Resolves whether the focus
140
+ * moved: a window with nothing focusable in its content keeps the focus where
141
+ * it was.
138
142
  */
139
- export declare function focusInto(win: Element, { when }?: {
143
+ export declare function focusInto(win: Element, { when, select }?: {
140
144
  when?: () => boolean;
145
+ select?: boolean;
141
146
  }): Promise<boolean>;
142
147
  /** The window manager over a desktop. */
143
148
  export declare function createWindowManager(desktop: VfDesktop, options: WindowManagerOptions): {
@@ -155,7 +160,8 @@ export declare function createWindowManager(desktop: VfDesktop, options: WindowM
155
160
  * Open the window for `item`: raise it if one is open, else make it,
156
161
  * append it, adopt it and place it — this session's pin, then the saved
157
162
  * one, then `place`, by default the first free cascade slot — and show it
158
- * out of `from`. Keyboard focus moves into it. Returns the window.
163
+ * out of `from`. Keyboard focus moves into it, and a new window's field
164
+ * marked `autoselect` has its text selected. Returns the window.
159
165
  */
160
166
  open(opts: OpenOptions): VfWindow;
161
167
  /**