@tinycloud/web-sdk 3.8.0-beta.8 → 3.8.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.
@@ -9,5 +9,5 @@ export interface PendingPanel {
9
9
  showLoading(): void;
10
10
  showError(retry: () => void): void;
11
11
  }
12
- export declare function createPendingPanel(onEscape: () => void): PendingPanel;
12
+ export declare function createPendingPanel(onClose: () => void): PendingPanel;
13
13
  //# sourceMappingURL=pending.d.ts.map
@@ -35,6 +35,11 @@ export declare const DELEGATIONS_STRINGS: {
35
35
  readonly "delegations.ask.openkey": " You'll approve it in OpenKey.";
36
36
  readonly "delegations.ask.button": "Allow delegation list";
37
37
  readonly "delegations.ask.declined": "That wasn't allowed, so nothing changed.";
38
+ readonly "delegations.ask.scope": "This shows every app and link that can reach your data across your whole account, and the names of what each can reach. It doesn't show keys or contents.";
39
+ readonly "delegations.ask.busy": "Waiting for your answer…";
40
+ readonly "delegations.ask.error": "The request didn't go through. Try again.";
41
+ readonly "delegations.ask.signin": "Sign in again to allow it.";
42
+ readonly "delegations.ask.native": "This app can't ask for this permission from here.";
38
43
  readonly "delegations.kind.app": "This app";
39
44
  readonly "delegations.kind.others": "Granted by you";
40
45
  readonly "delegations.kind.received": "Shared with you by {who}";
@@ -8,6 +8,7 @@ import type { ShellLayout } from "./panel";
8
8
  import type { ReceiptRequest } from "./panel-toasts";
9
9
  import type { IconName } from "./sections/ui";
10
10
  import type { StringKey } from "./strings";
11
+ import type { UiPlatform } from "./config";
11
12
  import type { ToastRequest } from "./toast-store";
12
13
  /** Panel sections, in nav order. Ids match the full-page and sidebar mockup. */
13
14
  export type SectionId = "account" | "local-tinycloud" | "local-copy" | "delegations" | "nodes" | "storage" | "activity";
@@ -55,6 +56,8 @@ export interface HostContext {
55
56
  canHideButton(): boolean;
56
57
  /** Hides the launcher button, persists it, and closes the panel. */
57
58
  hideButton(): void;
59
+ /** Fires when the button's presence changes (`setButtonVisible`), so an open section can follow `canHideButton()`. Optional: a context without it never changes. */
60
+ onButtonChange?(cb: () => void): () => void;
58
61
  }
59
62
  /** Views the shell reads for statuses. `account` is read by Overview itself. */
60
63
  export interface DataViews {
@@ -198,11 +201,20 @@ export interface PanelClient {
198
201
  subscribe(cb: () => void): () => void;
199
202
  subscribeDelegated(cb: () => void): () => void;
200
203
  } | undefined;
201
- /** Authority request for storage and sync prompts. Undefined when the client does not expose it. */
204
+ /**
205
+ * Asks for the read-only permission a tab is missing. Defined only when the page can show the SDK's permission prompt
206
+ * (a page signer and a manifest exist); undefined otherwise. Resolves `{ approved: false, code: "declined" }` when
207
+ * the user declines or closes the prompt and `code: "failed"` when the request errors. One request at a time:
208
+ * a second call while one is open returns the open one.
209
+ */
202
210
  readonly requestAuthority?: ((kind: AuthorityKind) => Promise<{
203
211
  approved: boolean;
204
212
  code?: FacadeErrorCode;
205
213
  }>) | undefined;
214
+ /** False when `requestAuthority` has no entry for `kind`, so a tab has no button for it. Absent: unknown. */
215
+ readonly canRequest?: ((kind: AuthorityKind) => boolean) | undefined;
216
+ /** Where the app runs (`ui.platform`). Absent: web. */
217
+ readonly platform?: UiPlatform | undefined;
206
218
  /** E: request log, present only in developer mode. */
207
219
  readonly requests?: RequestLogReader | undefined;
208
220
  /** Panel data for the views. Undefined unless the host supplied a data factory (harness or preview); production panels show placeholders. */
@@ -5,5 +5,5 @@
5
5
  * adoptedStyleSheets. Neutral palette only. Offsets are CSS custom properties
6
6
  * so an app can reserve space without an API.
7
7
  */
8
- export declare const HOST_CSS = "\n[hidden]{display:none!important}\n.layer{--b:calc(env(safe-area-inset-bottom,0px) + var(--tinycloud-ui-offset-bottom,12px));position:fixed;inset:0;pointer-events:none;font:14px/1.4 system-ui,-apple-system,\"Segoe UI\",sans-serif;color:#111827}\n.button{position:fixed;bottom:var(--b);width:44px;height:44px;padding:0;display:inline-flex;align-items:center;justify-content:center;border:1px solid #71717a;border-radius:50%;background:#fff;color:#111827;box-shadow:0 1px 3px rgba(0,0,0,.16);cursor:pointer;pointer-events:auto}\n.button svg{width:20px;height:20px}\n.button:focus-visible{outline:2px solid #111827;outline-offset:2px;box-shadow:0 0 0 6px #fafafa}\n.dot{position:absolute;top:6px;right:6px;width:8px;height:8px;border-radius:50%;background:#4b5563;border:2px solid #fff}\n.layer[data-position=\"bottom-right\"] .button{right:var(--tinycloud-ui-offset-inline,12px)}\n.layer[data-position=\"bottom-left\"] .button{left:var(--tinycloud-ui-offset-inline,12px)}\n.layer[data-position=\"bottom-center\"] .button{left:50%;transform:translateX(-50%)}\n.pending{position:fixed;top:0;bottom:0;right:0;box-sizing:border-box;width:min(420px,100%);padding:20px;overflow:auto;border-left:1px solid #e4e4e7;background:#fff;color:#111827;box-shadow:-18px 0 48px -18px rgba(0,0,0,.35);pointer-events:auto}\n.layer[data-position=\"bottom-left\"] .pending{right:auto;left:0;border-left:0;border-right:1px solid #e4e4e7}\n.pending p{margin:0 0 12px;color:#71717a}\n.pending button{min-height:44px;padding:0 16px;border:1px solid #71717a;border-radius:12px;background:transparent;color:inherit;font:inherit;cursor:pointer}\n.pending button:focus-visible{outline:2px solid #111827;outline-offset:2px;box-shadow:0 0 0 6px #fafafa}\n@media (prefers-color-scheme: dark){\n.layer{color:#fafafa}\n.button{border-color:#71717a;background:#151517;color:#fafafa}\n.button:focus-visible{outline-color:#fafafa;box-shadow:0 0 0 6px #111827}\n.dot{background:#a1a1aa;border-color:#151517}\n.pending{border-left-color:#69696b;background:#151517;color:#fafafa;box-shadow:-18px 0 48px -18px rgba(0,0,0,.6)}\n.layer[data-position=\"bottom-left\"] .pending{border-right-color:#69696b}\n.pending p{color:#a1a1aa}\n.pending button:focus-visible{outline-color:#fafafa;box-shadow:0 0 0 6px #111827}\n}\n";
8
+ export declare const HOST_CSS = "\n[hidden]{display:none!important}\n.layer{--b:calc(env(safe-area-inset-bottom,0px) + var(--tinycloud-ui-offset-bottom,12px));position:fixed;inset:0;pointer-events:none;font:14px/1.4 system-ui,-apple-system,\"Segoe UI\",sans-serif;color:#111827}\n.button{position:fixed;bottom:var(--b);width:44px;height:44px;padding:0;display:inline-flex;align-items:center;justify-content:center;border:1px solid #71717a;border-radius:50%;background:#fff;color:#111827;box-shadow:0 1px 3px rgba(0,0,0,.16);cursor:pointer;pointer-events:auto}\n.button svg{width:20px;height:20px}\n.button:focus-visible{outline:2px solid #111827;outline-offset:2px;box-shadow:0 0 0 6px #fafafa}\n.dot{position:absolute;top:6px;right:6px;width:8px;height:8px;border-radius:50%;background:#4b5563;border:2px solid #fff}\n.layer[data-position=\"bottom-right\"] .button{right:var(--tinycloud-ui-offset-inline,12px)}\n.layer[data-position=\"bottom-left\"] .button{left:var(--tinycloud-ui-offset-inline,12px)}\n.layer[data-position=\"bottom-center\"] .button{left:50%;transform:translateX(-50%)}\n.pending{position:fixed;top:0;bottom:0;right:0;box-sizing:border-box;width:min(420px,100%);padding:max(20px,env(safe-area-inset-top,0px)) max(20px,env(safe-area-inset-right,0px)) max(20px,env(safe-area-inset-bottom,0px)) max(20px,env(safe-area-inset-left,0px));overflow:auto;border-left:1px solid #e4e4e7;background:#fff;color:#111827;box-shadow:-18px 0 48px -18px rgba(0,0,0,.35);pointer-events:auto}\n.layer[data-position=\"bottom-left\"] .pending{right:auto;left:0;border-left:0;border-right:1px solid #e4e4e7}\n.pending p{margin:0 0 12px;color:#71717a}\n.pending button{min-height:44px;padding:0 16px;border:1px solid #71717a;border-radius:12px;background:transparent;color:inherit;font:inherit;cursor:pointer}\n.pending .pclose{display:flex;align-items:center;justify-content:center;width:44px;padding:0;margin:0 0 8px auto;border-radius:50%}\n.pending .pclose svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}\n.pending button:focus-visible{outline:2px solid #111827;outline-offset:2px;box-shadow:0 0 0 6px #fafafa}\n@media (prefers-color-scheme: dark){\n.layer{color:#fafafa}\n.button{border-color:#71717a;background:#151517;color:#fafafa}\n.button:focus-visible{outline-color:#fafafa;box-shadow:0 0 0 6px #111827}\n.dot{background:#a1a1aa;border-color:#151517}\n.pending{border-left-color:#69696b;background:#151517;color:#fafafa;box-shadow:-18px 0 48px -18px rgba(0,0,0,.6)}\n.layer[data-position=\"bottom-left\"] .pending{border-right-color:#69696b}\n.pending p{color:#a1a1aa}\n.pending button:focus-visible{outline-color:#fafafa;box-shadow:0 0 0 6px #111827}\n}\n";
9
9
  //# sourceMappingURL=styles.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinycloud/web-sdk",
3
- "version": "3.8.0-beta.8",
3
+ "version": "3.8.0",
4
4
  "description": "A set of tools and utilities to help you build your app with TinyCloud.",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -66,11 +66,11 @@
66
66
  "@multiformats/multiaddr": "^13.0.1",
67
67
  "@multiformats/multiaddr-to-uri": "^12.0.0",
68
68
  "@noble/curves": "^1.9.7",
69
- "@tinycloud/node-sdk": "3.8.0-beta.7",
70
- "@tinycloud/replica": "0.4.0-beta.2",
71
- "@tinycloud/sdk-core": "3.8.0-beta.5",
72
- "@tinycloud/share-envelope": "1.3.1-beta.0",
73
- "@tinycloud/share-sdk": "1.4.1-beta.0",
69
+ "@tinycloud/node-sdk": "3.8.0",
70
+ "@tinycloud/replica": "0.4.0",
71
+ "@tinycloud/sdk-core": "3.8.0",
72
+ "@tinycloud/share-envelope": "1.4.0",
73
+ "@tinycloud/share-sdk": "1.4.1",
74
74
  "@tinycloud/web-sdk-wasm": "1.7.7",
75
75
  "axios": "^1.7.9",
76
76
  "viem": "^2.45.0",