vintage-frames 0.14.1 → 0.16.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/custom-elements.json +770 -74
- package/dist/chrome.d.ts +10 -1
- package/dist/chrome.js +8 -3
- package/dist/components/vf-button.d.ts +5 -1
- package/dist/components/vf-button.js +1 -1
- package/dist/components/vf-desktop.d.ts +5 -2
- package/dist/components/vf-desktop.js +5 -5
- package/dist/components/vf-dialog.d.ts +13 -2
- package/dist/components/vf-dialog.js +27 -27
- package/dist/components/vf-menu-bar.js +9 -10
- package/dist/components/vf-menu-item.js +18 -13
- package/dist/components/vf-menu.d.ts +8 -3
- package/dist/components/vf-menu.js +85 -61
- package/dist/components/vf-number-field.d.ts +4 -0
- package/dist/components/vf-number-field.js +28 -25
- package/dist/components/vf-paragraph.d.ts +3 -1
- package/dist/components/vf-paragraph.js +7 -0
- package/dist/components/vf-scroll-area.d.ts +16 -1
- package/dist/components/vf-scroll-area.js +39 -29
- package/dist/components/vf-select.d.ts +5 -4
- package/dist/components/vf-select.js +26 -17
- package/dist/components/vf-text-field.d.ts +5 -5
- package/dist/components/vf-text-field.js +1 -1
- package/dist/components/vf-window.d.ts +22 -5
- package/dist/components/vf-window.js +113 -98
- package/dist/cursor.d.ts +8 -0
- package/dist/cursor.js +70 -73
- package/dist/events.d.ts +3 -2
- package/dist/events.js +3 -3
- package/dist/index.d.ts +2 -1
- package/dist/modal-dialog.d.ts +49 -4
- package/dist/modal-dialog.js +115 -87
- package/dist/position.js +25 -20
- package/dist/shell/alert.d.ts +17 -9
- package/dist/shell/alert.js +25 -28
- package/dist/shell/catalog.d.ts +1 -1
- package/dist/shell/catalog.js +32 -18
- package/dist/shell/finder.d.ts +46 -1
- package/dist/shell/finder.js +166 -126
- package/dist/shell/index.d.ts +2 -4
- package/dist/shell/index.js +5 -6
- package/dist/shell/pure.d.ts +10 -0
- package/dist/shell/pure.js +4 -0
- package/dist/shell/shell.d.ts +40 -13
- package/dist/shell/shell.js +87 -51
- package/dist/shell/windows.d.ts +69 -12
- package/dist/shell/windows.js +245 -144
- package/dist/text-control.d.ts +30 -1
- package/dist/text-control.js +27 -6
- package/dist/top-layer.d.ts +13 -0
- package/dist/top-layer.js +16 -0
- package/docs/SPEC.md +25 -24
- package/editor/vscode.html-custom-data.json +22 -12
- package/editor/web-types.json +58 -25
- package/package.json +5 -1
package/dist/shell/finder.d.ts
CHANGED
|
@@ -23,6 +23,9 @@
|
|
|
23
23
|
* View (Arrange Windows), Special (Clean Up, Empty Trash…), each disabled
|
|
24
24
|
* while it has nothing to act on. A site switches commands off and adds
|
|
25
25
|
* its own.
|
|
26
|
+
* - Alerts are the Finder's own, composed with the site's caution art and
|
|
27
|
+
* held by it while they are up. A site answers any of them with its own
|
|
28
|
+
* dialog through `alertWith`.
|
|
26
29
|
*/
|
|
27
30
|
import type { VfIcon, VfMenuItem, VfViewportBox } from '../index.js';
|
|
28
31
|
import type { Catalog, CatalogStorage, Item, Volumes } from './catalog.js';
|
|
@@ -43,7 +46,40 @@ export interface FinderArt {
|
|
|
43
46
|
disk?: string;
|
|
44
47
|
/** 12×12: the mark before the item count in the Trash's window and trashed folders. */
|
|
45
48
|
trashMark?: string;
|
|
49
|
+
/** 32×32: beside the message in the Finder's alerts. Without it they have no art. */
|
|
50
|
+
caution?: string;
|
|
46
51
|
}
|
|
52
|
+
/** What a failed command was, in the `failed` alert. */
|
|
53
|
+
export type FinderFailedAction = 'new-folder' | 'empty-trash' | 'paste' | 'add-file';
|
|
54
|
+
/** The Finder's alerts, by id, with the details each one's handler gets. */
|
|
55
|
+
export interface FinderAlerts {
|
|
56
|
+
/** Special → Empty Trash…: an answer of `'ok'` empties the Trash. */
|
|
57
|
+
'empty-trash': {
|
|
58
|
+
count: number;
|
|
59
|
+
bytes: number;
|
|
60
|
+
};
|
|
61
|
+
/** New Folder, Paste, a dropped file or `storageReady()`, without storage. */
|
|
62
|
+
'storage-unavailable': Record<string, never>;
|
|
63
|
+
/** A rename past the limit. */
|
|
64
|
+
'name-too-long': {
|
|
65
|
+
limit: number;
|
|
66
|
+
};
|
|
67
|
+
/** A rename to nothing. */
|
|
68
|
+
'name-rejected': Record<string, never>;
|
|
69
|
+
/** A filing storage refused. */
|
|
70
|
+
'move-failed': {
|
|
71
|
+
error: Error;
|
|
72
|
+
};
|
|
73
|
+
/** New Folder, Empty Trash, Paste or a dropped file failed. */
|
|
74
|
+
failed: {
|
|
75
|
+
action: FinderFailedAction;
|
|
76
|
+
error: Error;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/** One of the Finder's alerts. */
|
|
80
|
+
export type FinderAlert = keyof FinderAlerts;
|
|
81
|
+
/** Answers one of the Finder's alerts: resolves the answer, or null. */
|
|
82
|
+
export type FinderAlertHandler<K extends FinderAlert> = (details: FinderAlerts[K]) => string | null | Promise<string | null>;
|
|
47
83
|
/** The Finder's own commands, each of which a site can switch off. */
|
|
48
84
|
export type FinderCommand = 'open' | 'new-folder' | 'close' | 'copy' | 'paste' | 'select-all' | 'arrange' | 'clean-up' | 'empty-trash';
|
|
49
85
|
/** The Finder's menus, by `data-menu`. */
|
|
@@ -85,6 +121,13 @@ export interface FinderApi {
|
|
|
85
121
|
iconFor(id: string): VfIcon | null;
|
|
86
122
|
/** Add a command to the Finder's menus. Call it from `extend`, before the menus first reach the bar. */
|
|
87
123
|
addCommand(spec: FinderCommandSpec): VfMenuItem;
|
|
124
|
+
/** Answer one of the Finder's alerts with the site's own dialog. Call it from `extend`. */
|
|
125
|
+
alertWith<K extends FinderAlert>(id: K, handler: FinderAlertHandler<K>): void;
|
|
126
|
+
/**
|
|
127
|
+
* Whether storage answers. When it doesn't, raises Storage Unavailable —
|
|
128
|
+
* the site's answer to it, where `alertWith` gave one — and returns false.
|
|
129
|
+
*/
|
|
130
|
+
storageReady(): boolean;
|
|
88
131
|
}
|
|
89
132
|
export interface FinderOptions {
|
|
90
133
|
/** Where the catalog is kept: `memoryStorage()`, `indexedDbStorage(name)`, the site's own, or null for nothing. */
|
|
@@ -107,7 +150,9 @@ export interface FinderOptions {
|
|
|
107
150
|
cleanUpAfterResize?: boolean;
|
|
108
151
|
/** Switch commands off: `{ 'empty-trash': false }`. */
|
|
109
152
|
commands?: Partial<Record<FinderCommand, boolean>>;
|
|
110
|
-
/**
|
|
153
|
+
/** The site's dialogs for the Finder, each with a `data-dialog` name, held by it: `ctx.dialog(name)` in `extend`. */
|
|
154
|
+
dialogs?: string;
|
|
155
|
+
/** Add the site's own commands, and answer the Finder's alerts. */
|
|
111
156
|
extend?(finder: FinderApi, ctx: AppContext): void;
|
|
112
157
|
/** A folder window's size, system px. Default 320 × 223: three columns and two rows of icons. */
|
|
113
158
|
window?: Size;
|