@synopackageland/ui 0.25.14 → 0.25.16

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.
@@ -1,8 +1,40 @@
1
- /** Whether this page runs in the phone app and may go back to its App list. */
2
- export declare function canCloseToShell(): boolean;
3
1
  /**
4
- * Asks the phone app to go back to its App list. Call it from a tap: the app
2
+ * The Package Land launcher (the "shell") as seen from an App page in it. Its
3
+ * Home request, `{ v: 1, type: 'close' }`, takes the user back to the
4
+ * launcher's home. Two shells offer it:
5
+ *
6
+ * - The phone app injects `window.SynoPkgNative` (SynoPkgNative v1) into a
7
+ * registered App's main frame only; its optional `features` lists the
8
+ * requests it understands beyond the v1 baseline, `close` among them. The
9
+ * request goes through the bridge's `post`.
10
+ * - The browser launcher opens each App in a same-origin frame named
11
+ * `synopkg-shell:1:<features>` (comma-separated, e.g. `synopkg-shell:1:close`).
12
+ * The request is posted to the parent window at this page's own origin.
13
+ *
14
+ * In a plain browser tab, a DSM window or any other frame there is no shell
15
+ * and nothing here offers anything. The shell honors a request only right
16
+ * after a tap, so call it from a click.
17
+ */
18
+ type CloseMessage = {
19
+ v: 1;
20
+ type: 'close';
21
+ };
22
+ type ShellBridge = {
23
+ protocol: number;
24
+ features?: readonly unknown[];
25
+ post(message: CloseMessage): void;
26
+ };
27
+ type ShellWindow = Pick<Window, 'name' | 'parent' | 'top' | 'location'> & {
28
+ SynoPkgNative?: Partial<ShellBridge>;
29
+ };
30
+ /** The name the browser launcher gives an App's frame, and the features it lists. */
31
+ export declare const SHELL_FRAME_PREFIX = "synopkg-shell:1:";
32
+ /** Whether this page runs in the launcher (phone app or browser) and may go back to its home. */
33
+ export declare function canCloseToShell(view?: ShellWindow | undefined): boolean;
34
+ /**
35
+ * Asks the launcher to go back to its home. Call it from a tap: the launcher
5
36
  * ignores a request without a recent user gesture. Returns false when there is
6
- * no phone app to ask.
37
+ * no launcher to ask.
7
38
  */
8
- export declare function closeToShell(): boolean;
39
+ export declare function closeToShell(view?: ShellWindow | undefined): boolean;
40
+ export {};
@@ -3,7 +3,7 @@
3
3
  "version": "2.11.0",
4
4
  "delivery": "bundled-patched-esm",
5
5
  "patchManifestSha256": "9c5b9c9a162fa584b4695a683368a4484b3ac6e70177fd063b77aa618c051627",
6
- "bundleSha256": "414632bf6f179e9856f560fa3d5c2cf03912cb5993cfc8491ff011f395eea148",
6
+ "bundleSha256": "0613c4649ba3a597c7c6d972e93541034089c6176d953a0a7d2426dc0fe6165a",
7
7
  "sourceHashes": {
8
8
  "shared/useBodyScrollLock.js": "287bfb604318c4202769e4b5191896eaf0e52a952e1de898967cbe09467fcfda",
9
9
  "DismissableLayer/DismissableLayer.js": "3c8d248f0a32e01f89ca1f6202b1bb691bf5d0e4012a92535e161c35e69cdc32",