@liberation-data/desk 0.43.0 → 0.45.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 +238 -10
- package/dist/core/desk.d.ts +2 -0
- package/dist/core/desk.d.ts.map +1 -1
- package/dist/core/desk.js +11 -2
- package/dist/core/desk.js.map +1 -1
- package/dist/core/hosted.d.ts +222 -0
- package/dist/core/hosted.d.ts.map +1 -0
- package/dist/core/hosted.js +166 -0
- package/dist/core/hosted.js.map +1 -0
- package/dist/core/index.d.ts +9 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +5 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/location.d.ts +8 -1
- package/dist/core/location.d.ts.map +1 -1
- package/dist/core/location.js +18 -2
- package/dist/core/location.js.map +1 -1
- package/dist/core/preferences.d.ts +27 -0
- package/dist/core/preferences.d.ts.map +1 -0
- package/dist/core/preferences.js +121 -0
- package/dist/core/preferences.js.map +1 -0
- package/dist/core/scheme.d.ts +9 -3
- package/dist/core/scheme.d.ts.map +1 -1
- package/dist/core/scheme.js +13 -4
- package/dist/core/scheme.js.map +1 -1
- package/dist/core/theme.d.ts +41 -0
- package/dist/core/theme.d.ts.map +1 -0
- package/dist/core/theme.js +56 -0
- package/dist/core/theme.js.map +1 -0
- package/dist/core/themeChange.d.ts +25 -0
- package/dist/core/themeChange.d.ts.map +1 -0
- package/dist/core/themeChange.js +49 -0
- package/dist/core/themeChange.js.map +1 -0
- package/dist/core/types.d.ts +5 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/css/apps.css +52 -1
- package/dist/css/shell.css +100 -0
- package/dist/css/tokens.css +10 -0
- package/dist/css/windows.css +28 -0
- package/dist/desk.css +90 -1
- package/dist/fx/fx.d.ts.map +1 -1
- package/dist/fx/fx.js +7 -31
- package/dist/fx/fx.js.map +1 -1
- package/dist/host/checkChrome.d.ts +20 -0
- package/dist/host/checkChrome.d.ts.map +1 -0
- package/dist/host/checkChrome.js +219 -0
- package/dist/host/checkChrome.js.map +1 -0
- package/dist/host/checkTheme.d.ts +35 -0
- package/dist/host/checkTheme.d.ts.map +1 -0
- package/dist/host/checkTheme.js +128 -0
- package/dist/host/checkTheme.js.map +1 -0
- package/dist/host/index.d.ts +7 -0
- package/dist/host/index.d.ts.map +1 -0
- package/dist/host/index.js +8 -0
- package/dist/host/index.js.map +1 -0
- package/dist/host/router.d.ts +99 -0
- package/dist/host/router.d.ts.map +1 -0
- package/dist/host/router.js +279 -0
- package/dist/host/router.js.map +1 -0
- package/dist/react/Desktop.d.ts.map +1 -1
- package/dist/react/Desktop.js +11 -14
- package/dist/react/Desktop.js.map +1 -1
- package/dist/react/Dock.d.ts +23 -4
- package/dist/react/Dock.d.ts.map +1 -1
- package/dist/react/Dock.js +17 -29
- package/dist/react/Dock.js.map +1 -1
- package/dist/react/MenuBar.d.ts +1 -1
- package/dist/react/MenuBar.d.ts.map +1 -1
- package/dist/react/MenuBar.js +20 -4
- package/dist/react/MenuBar.js.map +1 -1
- package/dist/react/app.d.ts +65 -12
- package/dist/react/app.d.ts.map +1 -1
- package/dist/react/app.js +79 -21
- package/dist/react/app.js.map +1 -1
- package/dist/react/appFrame.d.ts +11 -7
- package/dist/react/appFrame.d.ts.map +1 -1
- package/dist/react/appFrame.js +24 -6
- package/dist/react/appFrame.js.map +1 -1
- package/dist/react/appPanels.d.ts +4 -1
- package/dist/react/appPanels.d.ts.map +1 -1
- package/dist/react/appPanels.js +76 -28
- package/dist/react/appPanels.js.map +1 -1
- package/dist/react/appearance.d.ts +7 -1
- package/dist/react/appearance.d.ts.map +1 -1
- package/dist/react/appearance.js +32 -53
- package/dist/react/appearance.js.map +1 -1
- package/dist/react/context.d.ts +25 -1
- package/dist/react/context.d.ts.map +1 -1
- package/dist/react/context.js +73 -14
- package/dist/react/context.js.map +1 -1
- package/dist/react/dockStatus.d.ts +19 -0
- package/dist/react/dockStatus.d.ts.map +1 -0
- package/dist/react/dockStatus.js +25 -0
- package/dist/react/dockStatus.js.map +1 -0
- package/dist/react/frameMenus.d.ts +28 -0
- package/dist/react/frameMenus.d.ts.map +1 -0
- package/dist/react/frameMenus.js +85 -0
- package/dist/react/frameMenus.js.map +1 -0
- package/dist/react/hostApp.d.ts +15 -0
- package/dist/react/hostApp.d.ts.map +1 -0
- package/dist/react/hostApp.js +77 -0
- package/dist/react/hostApp.js.map +1 -0
- package/dist/react/hostDock.d.ts +25 -0
- package/dist/react/hostDock.d.ts.map +1 -0
- package/dist/react/hostDock.js +98 -0
- package/dist/react/hostDock.js.map +1 -0
- package/dist/react/hostMenu.d.ts +2 -36
- package/dist/react/hostMenu.d.ts.map +1 -1
- package/dist/react/hostMenu.js.map +1 -1
- package/dist/react/hosted.d.ts +28 -0
- package/dist/react/hosted.d.ts.map +1 -0
- package/dist/react/hosted.js +53 -0
- package/dist/react/hosted.js.map +1 -0
- package/dist/react/index.d.ts +10 -5
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +6 -3
- package/dist/react/index.js.map +1 -1
- package/dist/react/mediaQuery.d.ts +3 -0
- package/dist/react/mediaQuery.d.ts.map +1 -0
- package/dist/react/mediaQuery.js +11 -0
- package/dist/react/mediaQuery.js.map +1 -0
- package/dist/react/shell.d.ts +13 -1
- package/dist/react/shell.d.ts.map +1 -1
- package/dist/react/shell.js +19 -3
- package/dist/react/shell.js.map +1 -1
- package/dist/react/sidebar.d.ts +6 -1
- package/dist/react/sidebar.d.ts.map +1 -1
- package/dist/react/sidebar.js +6 -3
- package/dist/react/sidebar.js.map +1 -1
- package/dist/react/windowDescription.d.ts +7 -0
- package/dist/react/windowDescription.d.ts.map +1 -1
- package/dist/react/windowDescription.js +9 -0
- package/dist/react/windowDescription.js.map +1 -1
- package/dist/react/windowMenus.d.ts +19 -0
- package/dist/react/windowMenus.d.ts.map +1 -0
- package/dist/react/windowMenus.js +88 -0
- package/dist/react/windowMenus.js.map +1 -0
- package/dist/shell/HostShell.d.ts +53 -0
- package/dist/shell/HostShell.d.ts.map +1 -0
- package/dist/shell/HostShell.js +116 -0
- package/dist/shell/HostShell.js.map +1 -0
- package/dist/shell/index.d.ts +7 -0
- package/dist/shell/index.d.ts.map +1 -0
- package/dist/shell/index.js +9 -0
- package/dist/shell/index.js.map +1 -0
- package/dist/shell/keys.d.ts +47 -0
- package/dist/shell/keys.d.ts.map +1 -0
- package/dist/shell/keys.js +68 -0
- package/dist/shell/keys.js.map +1 -0
- package/dist/shell/motion.d.ts +72 -0
- package/dist/shell/motion.d.ts.map +1 -0
- package/dist/shell/motion.js +118 -0
- package/dist/shell/motion.js.map +1 -0
- package/llms.txt +57 -20
- package/package.json +10 -1
- package/src/core/desk.ts +11 -2
- package/src/core/hosted.ts +351 -0
- package/src/core/index.ts +28 -1
- package/src/core/location.ts +23 -3
- package/src/core/preferences.ts +132 -0
- package/src/core/scheme.ts +16 -5
- package/src/core/theme.ts +91 -0
- package/src/core/themeChange.ts +59 -0
- package/src/core/types.ts +5 -0
- package/src/css/apps.css +52 -1
- package/src/css/shell.css +99 -0
- package/src/css/tokens.css +10 -0
- package/src/css/windows.css +28 -0
- package/src/fx/fx.ts +7 -25
- package/src/host/checkChrome.ts +257 -0
- package/src/host/checkTheme.ts +134 -0
- package/src/host/index.ts +10 -0
- package/src/host/router.ts +374 -0
- package/src/react/Desktop.tsx +16 -21
- package/src/react/Dock.tsx +34 -28
- package/src/react/MenuBar.tsx +22 -4
- package/src/react/app.tsx +116 -22
- package/src/react/appFrame.tsx +39 -14
- package/src/react/appPanels.tsx +102 -31
- package/src/react/appearance.tsx +36 -45
- package/src/react/context.tsx +99 -13
- package/src/react/dockStatus.ts +42 -0
- package/src/react/frameMenus.ts +100 -0
- package/src/react/hostApp.tsx +89 -0
- package/src/react/hostDock.tsx +118 -0
- package/src/react/hostMenu.ts +3 -38
- package/src/react/hosted.tsx +65 -0
- package/src/react/index.ts +12 -4
- package/src/react/mediaQuery.ts +18 -0
- package/src/react/shell.tsx +30 -3
- package/src/react/sidebar.tsx +10 -3
- package/src/react/windowDescription.ts +12 -1
- package/src/react/windowMenus.ts +107 -0
- package/src/shell/HostShell.tsx +220 -0
- package/src/shell/index.ts +11 -0
- package/src/shell/keys.ts +101 -0
- package/src/shell/motion.ts +163 -0
package/dist/react/app.d.ts
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { Desk } from '../core/desk.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { Keymap } from '../core/shortcuts.js';
|
|
4
|
+
import type { Size, WindowId, WindowLimits } from '../core/types.js';
|
|
4
5
|
import type { AppearanceRows } from './appearance.js';
|
|
5
|
-
import type { DockEntry } from './Dock.js';
|
|
6
|
+
import type { DockEntry, DockItem } from './Dock.js';
|
|
6
7
|
import type { Menu } from './MenuBar.js';
|
|
7
8
|
/** A link on the About panel: the website, the source, where to report an issue. */
|
|
8
9
|
export interface AppLink {
|
|
9
10
|
readonly label: string;
|
|
10
11
|
readonly url: string;
|
|
12
|
+
/** A heading the link is listed under on About, such as "Social". Links with none come first, unheaded. */
|
|
13
|
+
readonly group?: string;
|
|
11
14
|
}
|
|
12
15
|
/** One line of the About panel's facts: what something is, and its value. */
|
|
13
16
|
export interface AboutFact {
|
|
14
17
|
readonly name: string;
|
|
15
18
|
readonly value: string;
|
|
19
|
+
/** What Copy copies in place of `value`, which is what is shown: a short commit shown, the full one copied. */
|
|
20
|
+
readonly copyValue?: string;
|
|
16
21
|
/** What the person might want to know of it. Shown under the value, never copied. */
|
|
17
22
|
readonly note?: ReactNode;
|
|
18
23
|
/** Where to read more, shown after the note as a link: the guide to a setup that could be faster. Never copied. */
|
|
@@ -27,6 +32,11 @@ export interface AboutFact {
|
|
|
27
32
|
export interface AboutSection {
|
|
28
33
|
readonly title?: string;
|
|
29
34
|
readonly facts: readonly AboutFact[];
|
|
35
|
+
/**
|
|
36
|
+
* Still being worked out: the section shows "Checking" under its title, while the others are shown,
|
|
37
|
+
* and Copy leaves it out until it is ready.
|
|
38
|
+
*/
|
|
39
|
+
readonly pending?: boolean;
|
|
30
40
|
}
|
|
31
41
|
/** One section of Settings: a heading and the controls under it. */
|
|
32
42
|
export interface SettingsSection {
|
|
@@ -38,6 +48,11 @@ export interface SettingsSection {
|
|
|
38
48
|
/** In the sidebar layout, beside its name. */
|
|
39
49
|
readonly icon?: ReactNode;
|
|
40
50
|
readonly badge?: ReactNode;
|
|
51
|
+
/**
|
|
52
|
+
* A line about the section as a whole: what it changes, or that a change waits for a restart. In the
|
|
53
|
+
* sidebar layout it is the Settings window's note while the section is open; on one page, under its heading.
|
|
54
|
+
*/
|
|
55
|
+
readonly note?: ReactNode;
|
|
41
56
|
readonly content: ReactNode;
|
|
42
57
|
}
|
|
43
58
|
/** What an app with settings declares: Desk's Appearance, its own sections, and how Settings is laid out and opened. */
|
|
@@ -55,6 +70,11 @@ export interface AppSettings {
|
|
|
55
70
|
* `sidebar`: a list of sections beside the one chosen, in a bigger window, for many.
|
|
56
71
|
*/
|
|
57
72
|
readonly layout?: 'panel' | 'sidebar';
|
|
73
|
+
/**
|
|
74
|
+
* How big the sidebar layout may be. Left out, it is any size from 600 × 400, opens at 720 × 640, and can be
|
|
75
|
+
* resized and filled like any window. The one-page panel always fits its content.
|
|
76
|
+
*/
|
|
77
|
+
readonly limits?: WindowLimits;
|
|
58
78
|
/** A count on the gear in the dock, as any dock item's badge: updates waiting, a plugin to finish setting up. */
|
|
59
79
|
readonly badge?: ReactNode;
|
|
60
80
|
/**
|
|
@@ -70,6 +90,11 @@ export interface DeskApp {
|
|
|
70
90
|
readonly name: string;
|
|
71
91
|
/** The app's mark, drawn large on the About panel. */
|
|
72
92
|
readonly icon?: ReactNode;
|
|
93
|
+
/**
|
|
94
|
+
* The app's name as a wide mark, for a brand that is a wordmark: drawn under the icon at its own width
|
|
95
|
+
* rather than squeezed into a square, in place of the name as text, which stays for screen readers.
|
|
96
|
+
*/
|
|
97
|
+
readonly wordmark?: ReactNode;
|
|
73
98
|
readonly version?: string;
|
|
74
99
|
/** A line under the name: what the app is for. */
|
|
75
100
|
readonly description?: ReactNode;
|
|
@@ -103,6 +128,7 @@ export declare const SETTINGS_WINDOW = "settings";
|
|
|
103
128
|
export declare const ABOUT_WINDOW = "about";
|
|
104
129
|
/** The command "Settings…" and ⌘, perform. It answers at the top of the chain while the app has settings. */
|
|
105
130
|
export declare const SettingsCommand = "desk.settings";
|
|
131
|
+
export declare const DESK_SHORTCUTS: Keymap;
|
|
106
132
|
/** Whether a menu item's shortcut is one Desk binds on the command already, so the menu only shows it. */
|
|
107
133
|
export declare const boundByDesk: (shortcut: string, command: string) => boolean;
|
|
108
134
|
/** Binds Desk's own shortcuts on this desk, less those a host's menu bar owns. Returns a function that unbinds them. */
|
|
@@ -111,8 +137,10 @@ export declare const bindDeskShortcuts: (desk: Desk) => (() => void);
|
|
|
111
137
|
export declare function hostOwnsShortcuts(desk: Desk, owns: (shortcut: string) => boolean): () => void;
|
|
112
138
|
/** Panels have one size: the desk centres them, filled or not. About is one, and Settings on one page. */
|
|
113
139
|
export declare const PANEL_LIMITS: WindowLimits;
|
|
114
|
-
/** The sidebar layout of Settings is
|
|
140
|
+
/** The sidebar layout of Settings is a window like any other, for many sections and the list of them: no bigger than the desk, no smaller than this. */
|
|
115
141
|
export declare const SIDEBAR_LIMITS: WindowLimits;
|
|
142
|
+
/** The size the sidebar layout opens at, before the person makes it another. */
|
|
143
|
+
export declare const SIDEBAR_SIZE: Size;
|
|
116
144
|
/** Gives the declaration, with Appearance in place, to everything inside `DeskProvider`. */
|
|
117
145
|
export declare const AppProvider: import("react").Provider<DeskApp | null>;
|
|
118
146
|
/** What the app declared about itself, or null when it declared nothing. */
|
|
@@ -136,28 +164,53 @@ export declare const appWindowLimits: (app: DeskApp | null, which: 'about' | 'se
|
|
|
136
164
|
* Opens one of Desk's panels: filled, so it sits centred at its one size. A panel already open is brought
|
|
137
165
|
* forward where it is, and moved to `route` if one is given.
|
|
138
166
|
*/
|
|
139
|
-
export declare function openPanel(desk: Desk, id: WindowId, route?: string): void;
|
|
167
|
+
export declare function openPanel(desk: Desk, id: WindowId, route?: string, size?: Size): void;
|
|
140
168
|
/**
|
|
141
169
|
* Opens About as the dock and the menu do: a centred panel, or brought forward where it is. For a link or a
|
|
142
170
|
* query string that names it, so the app need not know how a panel is opened.
|
|
143
171
|
*/
|
|
144
172
|
export declare const openAbout: (desk: Desk) => void;
|
|
145
|
-
/** Opens Settings, in the app's own window if it has one, on `route` if given. */
|
|
146
|
-
export declare function
|
|
173
|
+
/** Opens Settings for this declaration, in the app's own window if it has one, on `route` if given. */
|
|
174
|
+
export declare function openAppSettings(desk: Desk, app: DeskApp | null, route?: string): void;
|
|
175
|
+
/** The provider says what the app on this desk declared. Returns a function that forgets it. */
|
|
176
|
+
export declare function declareOn(desk: Desk, app: () => DeskApp | null): () => void;
|
|
177
|
+
/**
|
|
178
|
+
* Opens Settings as the gear, the menu item and ⌘, do, on the section `route` names: Desk's panel, or the
|
|
179
|
+
* app's own window. For a caller outside React, such as a search result or a link handler; inside, use
|
|
180
|
+
* `useOpenSettings()`. Nothing when the app has no Settings to show, or no provider has declared it.
|
|
181
|
+
*/
|
|
182
|
+
export declare const openSettings: (desk: Desk, route?: string) => void;
|
|
147
183
|
/**
|
|
148
184
|
* Where the gear goes, when the app wants it somewhere other than just before About: put this among its own
|
|
149
|
-
* system items. It is dropped when the app has no settings.
|
|
185
|
+
* system items, or among the items of a stack, a System stack. It is dropped when the app has no settings.
|
|
186
|
+
*/
|
|
187
|
+
export declare const dockSettings: () => AppDockMarker;
|
|
188
|
+
/**
|
|
189
|
+
* Where About goes, when the app wants it somewhere other than last in the system group: among its own items,
|
|
190
|
+
* or in a stack. Placed either way, the app's own place is the only one: Desk adds no loose About.
|
|
191
|
+
*/
|
|
192
|
+
export declare const dockAbout: () => AppDockMarker;
|
|
193
|
+
/**
|
|
194
|
+
* The marker `dockSettings()` and `dockAbout()` give: a dock entry, and a stack item too, so either can stand
|
|
195
|
+
* in a stack's items. Desk puts the real item in its place.
|
|
150
196
|
*/
|
|
151
|
-
export
|
|
197
|
+
export type AppDockMarker = {
|
|
198
|
+
readonly type: 'settings' | 'about';
|
|
199
|
+
readonly id: string;
|
|
200
|
+
} & DockItem;
|
|
152
201
|
/** The separator the system group starts after. An app that has none gets one before Settings and About. */
|
|
153
202
|
export declare const SYSTEM_GROUP = "system";
|
|
154
203
|
type Placed = Exclude<DockEntry, {
|
|
155
|
-
readonly type: 'settings';
|
|
204
|
+
readonly type: 'settings' | 'about';
|
|
156
205
|
}>;
|
|
206
|
+
type Marker = AppDockMarker['type'];
|
|
207
|
+
/** Which marker an entry or stack item is, `dockSettings()` or `dockAbout()`, or null for any other. */
|
|
208
|
+
export declare const markerOf: (entry: object) => Marker | null;
|
|
157
209
|
/**
|
|
158
|
-
* The app's dock entries with Settings and About in place
|
|
159
|
-
*
|
|
160
|
-
*
|
|
210
|
+
* The app's dock entries with Settings and About in place. Where the app put `dockSettings()` or `dockAbout()`,
|
|
211
|
+
* among its entries or in a stack, each goes there. What it did not place goes at the end of the system group
|
|
212
|
+
* (the entries after the separator with id `system`, up to the next separator): Settings, then About. The
|
|
213
|
+
* app's own items keep their order. Without a declaration, only the markers go, and a stack they leave empty.
|
|
161
214
|
*/
|
|
162
215
|
export declare function placeAppDockItems(entries: readonly DockEntry[], app: DeskApp | null, open: {
|
|
163
216
|
settings: () => void;
|
package/dist/react/app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/react/app.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/react/app.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,O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,EAAE,UAAU,GAAG,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,QAAQ,CAAA;AAEnG,4GAA4G;AAC5G,eAAO,MAAM,YAAY,WAAW,CAAA;AAEpC,KAAK,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAA;CAAE,CAAC,CAAA;AACzE,KAAK,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAAA;AAEnC,wGAAwG;AACxG,eAAO,MAAM,QAAQ,UAAW,MAAM,KAAG,MAAM,GAAG,IAGjD,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,SAAS,SAAS,EAAE,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI,EAAE,IAAI,EAAE;IAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,IAAI,CAAA;CAAE,GAAG,MAAM,EAAE,CAgCjJ;AAID;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI,EAAE,SAAS,EAAE,MAAM,IAAI,GAAG,IAAI,EAAE,CAa5G"}
|
package/dist/react/app.js
CHANGED
|
@@ -13,7 +13,7 @@ export const SettingsCommand = 'desk.settings';
|
|
|
13
13
|
* these shows the shortcut and leaves the binding to this, so one press is one command. A host's native menu
|
|
14
14
|
* bar that gives the shortcut a key of its own takes it over while it is up, so the page does not do it too.
|
|
15
15
|
*/
|
|
16
|
-
const DESK_SHORTCUTS = { 'mod+comma': SettingsCommand };
|
|
16
|
+
export const DESK_SHORTCUTS = { 'mod+comma': SettingsCommand };
|
|
17
17
|
const hostOwns = new WeakMap();
|
|
18
18
|
/** Whether a menu item's shortcut is one Desk binds on the command already, so the menu only shows it. */
|
|
19
19
|
export const boundByDesk = (shortcut, command) => DESK_SHORTCUTS[shortcut] === command;
|
|
@@ -29,8 +29,10 @@ export function hostOwnsShortcuts(desk, owns) {
|
|
|
29
29
|
}
|
|
30
30
|
/** Panels have one size: the desk centres them, filled or not. About is one, and Settings on one page. */
|
|
31
31
|
export const PANEL_LIMITS = { minWidth: 360, minHeight: 200, maxWidth: 560, maxHeight: 560, fitContent: true };
|
|
32
|
-
/** The sidebar layout of Settings is
|
|
33
|
-
export const SIDEBAR_LIMITS = { minWidth: 600, minHeight: 400
|
|
32
|
+
/** The sidebar layout of Settings is a window like any other, for many sections and the list of them: no bigger than the desk, no smaller than this. */
|
|
33
|
+
export const SIDEBAR_LIMITS = { minWidth: 600, minHeight: 400 };
|
|
34
|
+
/** The size the sidebar layout opens at, before the person makes it another. */
|
|
35
|
+
export const SIDEBAR_SIZE = { width: 720, height: 640 };
|
|
34
36
|
const AppContext = createContext(null);
|
|
35
37
|
/** Gives the declaration, with Appearance in place, to everything inside `DeskProvider`. */
|
|
36
38
|
export const AppProvider = AppContext.Provider;
|
|
@@ -61,57 +63,113 @@ export function appWindowTitle(app, id) {
|
|
|
61
63
|
return which === 'about' ? 'About' : which === 'settings' ? 'Settings' : null;
|
|
62
64
|
}
|
|
63
65
|
/** How big Desk's own window may be: a panel, or the bigger sidebar layout of Settings. */
|
|
64
|
-
export const appWindowLimits = (app, which) => which === 'settings' && app?.settings?.layout === 'sidebar' ? SIDEBAR_LIMITS : PANEL_LIMITS;
|
|
66
|
+
export const appWindowLimits = (app, which) => which === 'settings' && app?.settings?.layout === 'sidebar' ? (app.settings.limits ?? SIDEBAR_LIMITS) : PANEL_LIMITS;
|
|
67
|
+
const clamp = (n, min = 0, max = Infinity) => Math.min(Math.max(n, min), max);
|
|
68
|
+
/** Where the sidebar layout opens: its usual size, within the app's limits. */
|
|
69
|
+
function sidebarSize(limits) {
|
|
70
|
+
return {
|
|
71
|
+
width: clamp(SIDEBAR_SIZE.width, limits.minWidth, limits.maxWidth),
|
|
72
|
+
height: clamp(SIDEBAR_SIZE.height, limits.minHeight, limits.maxHeight),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
65
75
|
/**
|
|
66
76
|
* Opens one of Desk's panels: filled, so it sits centred at its one size. A panel already open is brought
|
|
67
77
|
* forward where it is, and moved to `route` if one is given.
|
|
68
78
|
*/
|
|
69
|
-
export function openPanel(desk, id, route) {
|
|
79
|
+
export function openPanel(desk, id, route, size) {
|
|
70
80
|
const at = route === undefined ? {} : { route };
|
|
71
81
|
if (isOpen(desk.getState(), id))
|
|
72
82
|
desk.open(id, at);
|
|
83
|
+
// Given a size, a window rather than a panel: free at that size, or as the person left it, able to fill the desk.
|
|
73
84
|
else
|
|
74
|
-
desk.open(id, { mode: 'filled', ...at });
|
|
85
|
+
desk.open(id, size ? { size, ...at } : { mode: 'filled', ...at });
|
|
75
86
|
}
|
|
76
87
|
/**
|
|
77
88
|
* Opens About as the dock and the menu do: a centred panel, or brought forward where it is. For a link or a
|
|
78
89
|
* query string that names it, so the app need not know how a panel is opened.
|
|
79
90
|
*/
|
|
80
91
|
export const openAbout = (desk) => openPanel(desk, ABOUT_WINDOW);
|
|
81
|
-
/** Opens Settings, in the app's own window if it has one, on `route` if given. */
|
|
82
|
-
export function
|
|
92
|
+
/** Opens Settings for this declaration, in the app's own window if it has one, on `route` if given. */
|
|
93
|
+
export function openAppSettings(desk, app, route) {
|
|
83
94
|
if (!hasSettings(app))
|
|
84
95
|
return;
|
|
85
|
-
|
|
86
|
-
|
|
96
|
+
const settings = app?.settings;
|
|
97
|
+
if (settings?.open)
|
|
98
|
+
settings.open(route);
|
|
87
99
|
else
|
|
88
|
-
openPanel(desk, SETTINGS_WINDOW, route);
|
|
100
|
+
openPanel(desk, SETTINGS_WINDOW, route, settings?.layout === 'sidebar' ? sidebarSize(appWindowLimits(app, 'settings')) : undefined);
|
|
101
|
+
}
|
|
102
|
+
/* The declaration each desk's provider holds, as shown (Appearance in place, less what a host themes). */
|
|
103
|
+
const declarations = new WeakMap();
|
|
104
|
+
/** The provider says what the app on this desk declared. Returns a function that forgets it. */
|
|
105
|
+
export function declareOn(desk, app) {
|
|
106
|
+
declarations.set(desk, app);
|
|
107
|
+
return () => {
|
|
108
|
+
if (declarations.get(desk) === app)
|
|
109
|
+
declarations.delete(desk);
|
|
110
|
+
};
|
|
89
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Opens Settings as the gear, the menu item and ⌘, do, on the section `route` names: Desk's panel, or the
|
|
114
|
+
* app's own window. For a caller outside React, such as a search result or a link handler; inside, use
|
|
115
|
+
* `useOpenSettings()`. Nothing when the app has no Settings to show, or no provider has declared it.
|
|
116
|
+
*/
|
|
117
|
+
export const openSettings = (desk, route) => openAppSettings(desk, declarations.get(desk)?.() ?? null, route);
|
|
90
118
|
const glyph = (path) => (_jsx("svg", { viewBox: "0 0 24 24", width: "22", height: "22", fill: "none", stroke: "currentColor", strokeWidth: "1.7", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: path }) }));
|
|
91
119
|
const GEAR = glyph('M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z');
|
|
92
120
|
const INFO = glyph('M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM12 11v5M12 8h.01');
|
|
93
121
|
/**
|
|
94
122
|
* Where the gear goes, when the app wants it somewhere other than just before About: put this among its own
|
|
95
|
-
* system items. It is dropped when the app has no settings.
|
|
123
|
+
* system items, or among the items of a stack, a System stack. It is dropped when the app has no settings.
|
|
124
|
+
*/
|
|
125
|
+
export const dockSettings = () => ({ type: 'settings', id: SETTINGS_WINDOW, label: 'Settings', icon: GEAR });
|
|
126
|
+
/**
|
|
127
|
+
* Where About goes, when the app wants it somewhere other than last in the system group: among its own items,
|
|
128
|
+
* or in a stack. Placed either way, the app's own place is the only one: Desk adds no loose About.
|
|
96
129
|
*/
|
|
97
|
-
export const
|
|
130
|
+
export const dockAbout = () => ({ type: 'about', id: ABOUT_WINDOW, label: 'About', icon: INFO });
|
|
98
131
|
/** The separator the system group starts after. An app that has none gets one before Settings and About. */
|
|
99
132
|
export const SYSTEM_GROUP = 'system';
|
|
133
|
+
/** Which marker an entry or stack item is, `dockSettings()` or `dockAbout()`, or null for any other. */
|
|
134
|
+
export const markerOf = (entry) => {
|
|
135
|
+
const type = entry.type;
|
|
136
|
+
return type === 'settings' || type === 'about' ? type : null;
|
|
137
|
+
};
|
|
100
138
|
/**
|
|
101
|
-
* The app's dock entries with Settings and About in place
|
|
102
|
-
*
|
|
103
|
-
*
|
|
139
|
+
* The app's dock entries with Settings and About in place. Where the app put `dockSettings()` or `dockAbout()`,
|
|
140
|
+
* among its entries or in a stack, each goes there. What it did not place goes at the end of the system group
|
|
141
|
+
* (the entries after the separator with id `system`, up to the next separator): Settings, then About. The
|
|
142
|
+
* app's own items keep their order. Without a declaration, only the markers go, and a stack they leave empty.
|
|
104
143
|
*/
|
|
105
144
|
export function placeAppDockItems(entries, app, open) {
|
|
106
145
|
const settings = hasSettings(app)
|
|
107
146
|
? { id: SETTINGS_WINDOW, label: 'Settings', icon: GEAR, onSelect: open.settings, ...(app?.settings?.badge != null ? { badge: app.settings.badge } : {}) }
|
|
108
147
|
: null;
|
|
109
|
-
const
|
|
110
|
-
const
|
|
111
|
-
|
|
148
|
+
const about = app ? { id: ABOUT_WINDOW, label: 'About', icon: INFO, onSelect: open.about } : null;
|
|
149
|
+
const marked = new Set();
|
|
150
|
+
// A marker placed twice gives one item, where it first stands.
|
|
151
|
+
const replace = (marker) => {
|
|
152
|
+
const item = marked.has(marker) ? null : marker === 'settings' ? settings : about;
|
|
153
|
+
marked.add(marker);
|
|
154
|
+
return item ? [item] : [];
|
|
155
|
+
};
|
|
156
|
+
const placed = entries.flatMap((entry) => {
|
|
157
|
+
const marker = markerOf(entry);
|
|
158
|
+
if (marker)
|
|
159
|
+
return replace(marker).map(item => ({ type: 'item', ...item }));
|
|
160
|
+
if (entry.type !== 'stack')
|
|
161
|
+
return [entry];
|
|
162
|
+
if (!entry.items.some(markerOf))
|
|
163
|
+
return [entry];
|
|
164
|
+
const items = entry.items.flatMap(item => {
|
|
165
|
+
const inStack = markerOf(item);
|
|
166
|
+
return inStack ? replace(inStack) : [item];
|
|
167
|
+
});
|
|
168
|
+
return items.length ? [{ ...entry, items }] : [];
|
|
169
|
+
});
|
|
170
|
+
const ending = [...(settings && !marked.has('settings') ? [settings] : []), ...(about && !marked.has('about') ? [about] : [])].map(item => ({ type: 'item', ...item }));
|
|
171
|
+
if (!ending.length)
|
|
112
172
|
return placed;
|
|
113
|
-
const about = { type: 'item', id: ABOUT_WINDOW, label: 'About', icon: INFO, onSelect: open.about };
|
|
114
|
-
const ending = [...(settings && !marked ? [{ type: 'item', ...settings }] : []), about];
|
|
115
173
|
const start = placed.findIndex(e => e.type === 'separator' && e.id === SYSTEM_GROUP);
|
|
116
174
|
if (start < 0)
|
|
117
175
|
return [...placed, ...(placed.length ? [{ type: 'separator', id: SYSTEM_GROUP }] : []), ...ending];
|
package/dist/react/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/react/app.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEjD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/react/app.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEjD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAgJpD,4HAA4H;AAC5H,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAA;AACzC,0FAA0F;AAC1F,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAA;AAEnC,6GAA6G;AAC7G,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAA;AAE9C;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAW,EAAE,WAAW,EAAE,eAAe,EAAE,CAAA;AACtE,MAAM,QAAQ,GAAG,IAAI,OAAO,EAAuC,CAAA;AAEnE,0GAA0G;AAC1G,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAgB,EAAE,OAAe,EAAW,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,KAAK,OAAO,CAAA;AAE/G,wHAAwH;AACxH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,IAAU,EAAgB,EAAE,CAC5D,aAAa,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CA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AAG,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,GAAG,KAAK,CAAC,CAAA;IAC1F,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;QAC3B,IAAI,CAAC,KAAK,EAAE;YAAE,OAAO,IAAI,CAAA;QACzB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAA;QACtB,OAAO,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAA;IACpG,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
package/dist/react/appFrame.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
+
import type { AppTheme } from '../core/theme.js';
|
|
1
2
|
import type { Accepts } from './dnd.js';
|
|
2
|
-
export interface AppTheme {
|
|
3
|
-
readonly mode: 'light' | 'dark';
|
|
4
|
-
/** Custom properties, named as they will be set: `{ '--sb-bg-dark': '#0b0f1a' }`. */
|
|
5
|
-
readonly tokens: Readonly<Record<string, string>>;
|
|
6
|
-
}
|
|
7
3
|
export interface AppFrameProps {
|
|
8
4
|
/** The accessible name of the frame: what the app is. */
|
|
9
5
|
readonly title: string;
|
|
@@ -20,6 +16,12 @@ export interface AppFrameProps {
|
|
|
20
16
|
readonly accepts?: Accepts;
|
|
21
17
|
/** Windows the app may ask to open. Default: none. */
|
|
22
18
|
readonly opens?: readonly string[];
|
|
19
|
+
/**
|
|
20
|
+
* The app may add menus to the bar, which join it while this frame's window is in front. Its items
|
|
21
|
+
* go back to it alone when chosen, and never take a shortcut the page uses, nor one without a modifier
|
|
22
|
+
* (only `mod`, `ctrl`, `alt` or F1–F24 bind). Default: false.
|
|
23
|
+
*/
|
|
24
|
+
readonly menus?: boolean;
|
|
23
25
|
/**
|
|
24
26
|
* The frame's sandbox. The default lets the app run its own scripts and forms, and
|
|
25
27
|
* nothing more: no same-origin access, no top-level navigation, no pop-ups.
|
|
@@ -27,7 +29,7 @@ export interface AppFrameProps {
|
|
|
27
29
|
readonly sandbox?: string;
|
|
28
30
|
readonly className?: string;
|
|
29
31
|
}
|
|
30
|
-
export declare function AppFrame({ title, src, srcDoc, listens, says, theme, accepts, opens, sandbox, className, }: AppFrameProps): import("react").JSX.Element;
|
|
32
|
+
export declare function AppFrame({ title, src, srcDoc, listens, says, theme, accepts, opens, menus: addsMenus, sandbox, className, }: AppFrameProps): import("react").JSX.Element;
|
|
31
33
|
/**
|
|
32
34
|
* The app's half of the bridge, as a script to put in its page. It gives the page a
|
|
33
35
|
* small `desk` object:
|
|
@@ -36,9 +38,11 @@ export declare function AppFrame({ title, src, srcDoc, listens, says, theme, acc
|
|
|
36
38
|
* desk.onDrop(drop => …) take what is dropped on the window
|
|
37
39
|
* desk.publish('ride.selected', ride) say something, if it was granted
|
|
38
40
|
* desk.open('map') ask for a window, if it was granted
|
|
41
|
+
* desk.setMenus([{ id, label, items }]) add menus to the bar, if it was granted
|
|
42
|
+
* desk.onCommand(id => …) hear which of its menu items was chosen
|
|
39
43
|
* desk.window which window this is, once connected
|
|
40
44
|
*/
|
|
41
|
-
export declare const APP_BRIDGE_SCRIPT = "(() => {\n const handlers = new Map();\n const drops = [];\n const send = message => parent.postMessage(Object.assign({ desk: 1 }, message), '*');\n const applyTheme = theme => {\n if (!theme) return;\n desk.theme = theme;\n const root = document.documentElement;\n root.dataset.theme = theme.mode;\n root.style.colorScheme = theme.mode;\n for (const [name, value] of Object.entries(theme.tokens || {})) root.style.setProperty(name, value);\n themed.forEach(h => h(theme));\n };\n const themed = [];\n const desk = {\n window: null,\n listens: [],\n says: [],\n theme: null,\n onTheme(handler) { themed.push(handler); if (desk.theme) handler(desk.theme); },\n on(topic, handler) { (handlers.get(topic) || handlers.set(topic, []).get(topic)).push(handler); },\n onDrop(handler) { drops.push(handler); },\n publish(topic, payload) { send({ kind: 'publish', topic, payload }); },\n open(window) { send({ kind: 'open', window }); },\n };\n const matches = (pattern, topic) =>\n pattern === '*' || pattern === topic || (pattern.endsWith('.*') && (topic === pattern.slice(0, -2) || topic.startsWith(pattern.slice(0, -1))));\n addEventListener('message', event => {\n if (event.source !== parent || !event.data || event.data.desk !== 1) return;\n const message = event.data;\n if (message.kind === 'hello') { desk.window = message.window; desk.listens = message.listens; desk.says = message.says; applyTheme(message.theme); }\n if (message.kind === 'theme') applyTheme(message.theme);\n if (message.kind === 'event') for (const [pattern, list] of handlers) if (matches(pattern, message.topic)) list.forEach(h => h(message));\n if (message.kind === 'drop') drops.forEach(h => h(message));\n });\n window.desk = desk;\n send({ kind: 'ready' });\n})();";
|
|
45
|
+
export declare const APP_BRIDGE_SCRIPT = "(() => {\n const handlers = new Map();\n const drops = [];\n const commands = [];\n const send = message => parent.postMessage(Object.assign({ desk: 1 }, message), '*');\n const applyTheme = theme => {\n if (!theme) return;\n desk.theme = theme;\n const root = document.documentElement;\n root.dataset.theme = theme.mode;\n root.style.colorScheme = theme.mode;\n for (const [name, value] of Object.entries(theme.tokens || {})) root.style.setProperty(name, value);\n themed.forEach(h => h(theme));\n };\n const themed = [];\n const desk = {\n window: null,\n listens: [],\n says: [],\n theme: null,\n onTheme(handler) { themed.push(handler); if (desk.theme) handler(desk.theme); },\n on(topic, handler) { (handlers.get(topic) || handlers.set(topic, []).get(topic)).push(handler); },\n onDrop(handler) { drops.push(handler); },\n publish(topic, payload) { send({ kind: 'publish', topic, payload }); },\n open(window) { send({ kind: 'open', window }); },\n setMenus(menus) { send({ kind: 'chrome', chrome: { menus } }); },\n onCommand(handler) { commands.push(handler); },\n };\n const matches = (pattern, topic) =>\n pattern === '*' || pattern === topic || (pattern.endsWith('.*') && (topic === pattern.slice(0, -2) || topic.startsWith(pattern.slice(0, -1))));\n addEventListener('message', event => {\n if (event.source !== parent || !event.data || event.data.desk !== 1) return;\n const message = event.data;\n if (message.kind === 'hello') { desk.window = message.window; desk.listens = message.listens; desk.says = message.says; applyTheme(message.theme); }\n if (message.kind === 'theme') applyTheme(message.theme);\n if (message.kind === 'event') for (const [pattern, list] of handlers) if (matches(pattern, message.topic)) list.forEach(h => h(message));\n if (message.kind === 'drop') drops.forEach(h => h(message));\n if (message.kind === 'command' && message.target === 'menu') commands.forEach(h => h(message.id));\n });\n window.desk = desk;\n send({ kind: 'ready' });\n})();";
|
|
42
46
|
/** Puts the bridge into a page of HTML, so a generated app needs nothing added by hand. */
|
|
43
47
|
export declare function withAppBridge(html: string): string;
|
|
44
48
|
//# sourceMappingURL=appFrame.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appFrame.d.ts","sourceRoot":"","sources":["../../src/react/appFrame.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"appFrame.d.ts","sourceRoot":"","sources":["../../src/react/appFrame.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAGhD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAqDvC,MAAM,WAAW,aAAa;IAC5B,yDAAyD;IACzD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,gEAAgE;IAChE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,wFAAwF;IACxF,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACpC,oFAAoF;IACpF,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACjC,sGAAsG;IACtG,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAA;IACzB,mDAAmD;IACnD,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,sDAAsD;IACtD,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAClC;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;IACxB;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,GAAG,EACH,MAAM,EACN,OAAY,EACZ,IAAS,EACT,KAAK,EACL,OAAO,EACP,KAAU,EACV,KAAK,EAAE,SAAiB,EACxB,OAAqC,EACrC,SAAS,GACV,EAAE,aAAa,+BA0Ff;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,iiEAyCxB,CAAA;AAEN,2FAA2F;AAC3F,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGlD"}
|
package/dist/react/appFrame.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useRef } from 'react';
|
|
2
|
+
import { useEffect, useId, useRef, useState } from 'react';
|
|
3
3
|
import { topicMatches } from '../core/events.js';
|
|
4
|
+
import { DESK_PROTOCOL } from '../core/hosted.js';
|
|
4
5
|
import { useDragging, useDropTarget } from './dnd.js';
|
|
5
6
|
import { useDesk, useWindowId } from './context.js';
|
|
6
7
|
import { useBus } from './events.js';
|
|
8
|
+
import { frameMenus, useFrameMenus } from './frameMenus.js';
|
|
7
9
|
/*
|
|
8
10
|
* A generated app — a self-contained page — running inside a window, and taking
|
|
9
11
|
* part in the desk as a native window does: hearing events, saying things, and
|
|
@@ -13,10 +15,10 @@ import { useBus } from './events.js';
|
|
|
13
15
|
* only through messages. The host decides, per app, which topics it may hear,
|
|
14
16
|
* which it may say, and what may be dropped on it. Nothing else crosses.
|
|
15
17
|
*/
|
|
16
|
-
/**
|
|
17
|
-
const PROTOCOL =
|
|
18
|
+
/** Every message carries the protocol version, shared with hosted mode, so a mismatch is ignored rather than misread. */
|
|
19
|
+
const PROTOCOL = DESK_PROTOCOL;
|
|
18
20
|
const isAppMessage = (data) => typeof data === 'object' && data !== null && data.desk === PROTOCOL && typeof data.kind === 'string';
|
|
19
|
-
export function AppFrame({ title, src, srcDoc, listens = [], says = [], theme, accepts, opens = [], sandbox = 'allow-scripts allow-forms', className, }) {
|
|
21
|
+
export function AppFrame({ title, src, srcDoc, listens = [], says = [], theme, accepts, opens = [], menus: addsMenus = false, sandbox = 'allow-scripts allow-forms', className, }) {
|
|
20
22
|
const desk = useDesk();
|
|
21
23
|
const bus = useBus();
|
|
22
24
|
const windowId = useWindowId();
|
|
@@ -28,8 +30,12 @@ export function AppFrame({ title, src, srcDoc, listens = [], says = [], theme, a
|
|
|
28
30
|
// window and no other.
|
|
29
31
|
frame.current?.contentWindow?.postMessage(message, '*');
|
|
30
32
|
};
|
|
31
|
-
const latest = useRef({ listens, says, opens, windowId, theme });
|
|
32
|
-
latest.current = { listens, says, opens, windowId, theme };
|
|
33
|
+
const latest = useRef({ listens, says, opens, windowId, theme, addsMenus });
|
|
34
|
+
latest.current = { listens, says, opens, windowId, theme, addsMenus };
|
|
35
|
+
// The app's menus, named for this frame so they never meet the page's or another frame's.
|
|
36
|
+
const prefix = `frame${useId()}`;
|
|
37
|
+
const [menus, setMenus] = useState(null);
|
|
38
|
+
useFrameMenus(desk, addsMenus ? windowId : null, menus, id => post({ desk: PROTOCOL, kind: 'command', target: 'menu', id }));
|
|
33
39
|
// What the app says: only from this frame, only on topics it was granted.
|
|
34
40
|
useEffect(() => {
|
|
35
41
|
const onMessage = (event) => {
|
|
@@ -38,6 +44,8 @@ export function AppFrame({ title, src, srcDoc, listens = [], says = [], theme, a
|
|
|
38
44
|
const message = event.data;
|
|
39
45
|
const granted = latest.current;
|
|
40
46
|
if (message.kind === 'ready') {
|
|
47
|
+
// A page loading in the frame, perhaps a new one: the menus it had are gone with the old.
|
|
48
|
+
setMenus(null);
|
|
41
49
|
post({ desk: PROTOCOL, kind: 'hello', window: granted.windowId, listens: granted.listens, says: granted.says, theme: granted.theme ?? null });
|
|
42
50
|
}
|
|
43
51
|
else if (message.kind === 'publish') {
|
|
@@ -45,6 +53,10 @@ export function AppFrame({ title, src, srcDoc, listens = [], says = [], theme, a
|
|
|
45
53
|
bus.publish(message.topic, message.payload, { from: granted.windowId });
|
|
46
54
|
}
|
|
47
55
|
}
|
|
56
|
+
else if (message.kind === 'chrome') {
|
|
57
|
+
if (granted.addsMenus)
|
|
58
|
+
setMenus(frameMenus(message.chrome?.menus, prefix));
|
|
59
|
+
}
|
|
48
60
|
else if (message.kind === 'open') {
|
|
49
61
|
if (typeof message.window === 'string' && granted.opens.includes(message.window))
|
|
50
62
|
desk.open(message.window);
|
|
@@ -92,11 +104,14 @@ export function AppFrame({ title, src, srcDoc, listens = [], says = [], theme, a
|
|
|
92
104
|
* desk.onDrop(drop => …) take what is dropped on the window
|
|
93
105
|
* desk.publish('ride.selected', ride) say something, if it was granted
|
|
94
106
|
* desk.open('map') ask for a window, if it was granted
|
|
107
|
+
* desk.setMenus([{ id, label, items }]) add menus to the bar, if it was granted
|
|
108
|
+
* desk.onCommand(id => …) hear which of its menu items was chosen
|
|
95
109
|
* desk.window which window this is, once connected
|
|
96
110
|
*/
|
|
97
111
|
export const APP_BRIDGE_SCRIPT = `(() => {
|
|
98
112
|
const handlers = new Map();
|
|
99
113
|
const drops = [];
|
|
114
|
+
const commands = [];
|
|
100
115
|
const send = message => parent.postMessage(Object.assign({ desk: ${PROTOCOL} }, message), '*');
|
|
101
116
|
const applyTheme = theme => {
|
|
102
117
|
if (!theme) return;
|
|
@@ -118,6 +133,8 @@ export const APP_BRIDGE_SCRIPT = `(() => {
|
|
|
118
133
|
onDrop(handler) { drops.push(handler); },
|
|
119
134
|
publish(topic, payload) { send({ kind: 'publish', topic, payload }); },
|
|
120
135
|
open(window) { send({ kind: 'open', window }); },
|
|
136
|
+
setMenus(menus) { send({ kind: 'chrome', chrome: { menus } }); },
|
|
137
|
+
onCommand(handler) { commands.push(handler); },
|
|
121
138
|
};
|
|
122
139
|
const matches = (pattern, topic) =>
|
|
123
140
|
pattern === '*' || pattern === topic || (pattern.endsWith('.*') && (topic === pattern.slice(0, -2) || topic.startsWith(pattern.slice(0, -1))));
|
|
@@ -128,6 +145,7 @@ export const APP_BRIDGE_SCRIPT = `(() => {
|
|
|
128
145
|
if (message.kind === 'theme') applyTheme(message.theme);
|
|
129
146
|
if (message.kind === 'event') for (const [pattern, list] of handlers) if (matches(pattern, message.topic)) list.forEach(h => h(message));
|
|
130
147
|
if (message.kind === 'drop') drops.forEach(h => h(message));
|
|
148
|
+
if (message.kind === 'command' && message.target === 'menu') commands.forEach(h => h(message.id));
|
|
131
149
|
});
|
|
132
150
|
window.desk = desk;
|
|
133
151
|
send({ kind: 'ready' });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appFrame.js","sourceRoot":"","sources":["../../src/react/appFrame.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"appFrame.js","sourceRoot":"","sources":["../../src/react/appFrame.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAIjD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAErD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,UAAU,EAAE,aAAa,EAA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AAE,KAAK,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,IAAI,EAAE,CAAA;AACpH,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { AboutSection, DeskApp, SettingsSection } from './app.js';
|
|
2
2
|
import type { SidebarSection } from './sidebar.js';
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* The app's name and version, then every fact that may be copied, by section, each as its `copyValue` if it
|
|
5
|
+
* has one: what About's Copy copies. A section still pending is left out.
|
|
6
|
+
*/
|
|
4
7
|
export declare function aboutText(app: Pick<DeskApp, 'name' | 'version'>, sections: readonly AboutSection[]): string;
|
|
5
8
|
/**
|
|
6
9
|
* Opens Settings as the gear, the menu item and ⌘, do, on the section `route` names: Desk's panel, or the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appPanels.d.ts","sourceRoot":"","sources":["../../src/react/appPanels.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"appPanels.d.ts","sourceRoot":"","sources":["../../src/react/appPanels.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAQtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AASlD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC,EAAE,QAAQ,EAAE,SAAS,YAAY,EAAE,GAAG,MAAM,CAQ3G;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAM1D;AAID,+GAA+G;AAC/G,wBAAgB,YAAY,uCAI3B;AAqGD,0GAA0G;AAC1G,wBAAgB,cAAc,CAAC,QAAQ,EAAE,SAAS,eAAe,EAAE,GAAG,cAAc,EAAE,CAMrF;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,uCA+D9B"}
|