@freeappstore/sdk 0.16.13 → 0.16.15

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 CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  Browser SDK for free apps published on **freeappstore.online**.
4
4
 
5
+ PWA lifecycle APIs live at `@freeappstore/sdk/pwa`, with Vite options at
6
+ `@freeappstore/sdk/pwa-config`. See [safe updates and offline capabilities](https://github.com/freeappstore-online/platform/blob/main/docs/pwa-lifecycle.md).
7
+
5
8
  ## Installation
6
9
 
7
10
  ```bash
@@ -229,7 +232,7 @@ const toast = useToast(); toast.show('Saved', { variant: 'success' });
229
232
 
230
233
  `onNavigate` makes nav clicks client-side (scroll and focus are handled on route changes); without it the items are ordinary links. `FasShell` is the same component under its older name. Full reference: [docs/ui.md](../../docs/ui.md#shell-the-standard-app-frame).
231
234
 
232
- Set `profileHref="/profile"` to make the signed-in avatar open your app's profile screen through the same navigation. Without it, the existing profile dropdown remains. Add Profile to `nav` for signed-out access, and render your account, preferences and connection controls on that screen.
235
+ Omit `profileHref` and the avatar opens the built-in `/profile` page (`ProfilePage`) in both auth states. Set `profileHref` for an app-owned route and render both states yourself. `ProfileMenu` is a legacy dropdown. `Shell` does not mount it. Layout ownership: [composable starter contract](../../docs/composable-starter-contract.md).
233
236
 
234
237
  ### UI Components
235
238
 
package/dist/logger.d.ts CHANGED
@@ -35,7 +35,7 @@ export interface BuildMeta {
35
35
  viewport: string;
36
36
  theme?: string | undefined;
37
37
  }
38
- export declare const SDK_VERSION = "0.16.12";
38
+ export declare const SDK_VERSION = "0.16.15";
39
39
  export declare class Logger {
40
40
  private readonly appId;
41
41
  private readonly apiBase;
package/dist/logger.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // Must track package.json version — bumped on release. Guarded by version.test.ts
2
2
  // so a forgotten bump fails CI instead of silently misattributing telemetry.
3
- export const SDK_VERSION = '0.16.12';
3
+ export const SDK_VERSION = '0.16.15';
4
4
  const MEMORY_LIMIT = 200;
5
5
  const STORAGE_LIMIT = 500;
6
6
  const STORAGE_KEY_PREFIX = 'fas_logs:';
@@ -0,0 +1,4 @@
1
+ import type { VitePWAOptions } from 'vite-plugin-pwa';
2
+ /** Shared vite-plugin-pwa options. App manifest/icons remain app-owned. */
3
+ export declare function pwaOptions(overrides?: Partial<VitePWAOptions>): Partial<VitePWAOptions>;
4
+ //# sourceMappingURL=pwa-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pwa-config.d.ts","sourceRoot":"","sources":["../src/pwa-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,2EAA2E;AAC3E,wBAAgB,UAAU,CAAC,SAAS,GAAE,OAAO,CAAC,cAAc,CAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAsB3F"}
@@ -0,0 +1,25 @@
1
+ /** Shared vite-plugin-pwa options. App manifest/icons remain app-owned. */
2
+ export function pwaOptions(overrides = {}) {
3
+ if (overrides.strategies && overrides.strategies !== 'generateSW')
4
+ throw new Error('pwaOptions requires generateSW; review custom worker lifecycle separately.');
5
+ return {
6
+ manifest: false,
7
+ ...overrides,
8
+ // Runtime registration belongs to startPwa; never inject another reloader.
9
+ registerType: 'prompt',
10
+ injectRegister: false,
11
+ workbox: {
12
+ globPatterns: ['**/*.{js,css,html,png,svg,ico,woff2}'],
13
+ navigateFallback: '/index.html',
14
+ ...overrides.workbox,
15
+ navigateFallbackDenylist: [
16
+ /^\/api(?:\/|$)/,
17
+ /^\/v1(?:\/|$)/,
18
+ ...(overrides.workbox?.navigateFallbackDenylist ?? []),
19
+ ],
20
+ skipWaiting: false,
21
+ clientsClaim: true,
22
+ },
23
+ };
24
+ }
25
+ //# sourceMappingURL=pwa-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pwa-config.js","sourceRoot":"","sources":["../src/pwa-config.ts"],"names":[],"mappings":"AAEA,2EAA2E;AAC3E,MAAM,UAAU,UAAU,CAAC,YAAqC,EAAE;IAChE,IAAI,SAAS,CAAC,UAAU,IAAI,SAAS,CAAC,UAAU,KAAK,YAAY;QAC/D,MAAM,IAAI,KAAK,CAAC,4EAA4E,CAAC,CAAC;IAChG,OAAO;QACL,QAAQ,EAAE,KAAc;QACxB,GAAG,SAAS;QACZ,2EAA2E;QAC3E,YAAY,EAAE,QAAiB;QAC/B,cAAc,EAAE,KAAc;QAC9B,OAAO,EAAE;YACP,YAAY,EAAE,CAAC,sCAAsC,CAAC;YACtD,gBAAgB,EAAE,aAAa;YAC/B,GAAG,SAAS,CAAC,OAAO;YACpB,wBAAwB,EAAE;gBACxB,gBAAgB;gBAChB,eAAe;gBACf,GAAG,CAAC,SAAS,CAAC,OAAO,EAAE,wBAAwB,IAAI,EAAE,CAAC;aACvD;YACD,WAAW,EAAE,KAAK;YAClB,YAAY,EAAE,IAAI;SACnB;KACF,CAAC;AACJ,CAAC"}
package/dist/pwa.d.ts ADDED
@@ -0,0 +1,26 @@
1
+ /** Update activation and page reload are deliberately separate user actions. */
2
+ export interface PwaOptions {
3
+ swUrl?: string;
4
+ /** Describe only features which actually work without a server. */
5
+ offlineFeatures?: string[];
6
+ /** Called at the moment of each action. Throwing also blocks the action. */
7
+ isBusy?: () => boolean;
8
+ onError?: (error: unknown) => void;
9
+ reload?: () => void;
10
+ }
11
+ export declare function startPwa(options?: PwaOptions): {
12
+ ready: Promise<void>;
13
+ activate: () => boolean;
14
+ reload: () => boolean;
15
+ /** Register dirty forms, active recorders, transfers or other work. */
16
+ addBusyGuard(guard: () => boolean): () => void;
17
+ dispose(): void;
18
+ };
19
+ /** Optional public assets only. Readiness is checked against actual cached bytes. */
20
+ export declare function offlineAssets(id: string, paths: string[]): {
21
+ ready(): Promise<boolean>;
22
+ download(): Promise<void>;
23
+ read(path: string): Promise<Response | undefined>;
24
+ remove: () => Promise<boolean>;
25
+ };
26
+ //# sourceMappingURL=pwa.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pwa.d.ts","sourceRoot":"","sources":["../src/pwa.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAMD,wBAAgB,QAAQ,CAAC,OAAO,GAAE,UAAe;;;;IAmI7C,uEAAuE;wBACnD,MAAM,OAAO;;EAkBpC;AAED,qFAAqF;AACrF,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;;;eAkCpC,MAAM;;EAO1B"}
package/dist/pwa.js ADDED
@@ -0,0 +1,203 @@
1
+ export function startPwa(options = {}) {
2
+ const guards = new Set();
3
+ if (options.isBusy)
4
+ guards.add(options.isBusy);
5
+ let registration;
6
+ let disposed = false;
7
+ let activated = false;
8
+ let activating = false;
9
+ let installPrompt;
10
+ let controller = navigator.serviceWorker?.controller;
11
+ const panel = document.createElement('aside');
12
+ panel.setAttribute('aria-label', 'App installation and updates');
13
+ panel.style.cssText =
14
+ 'position:relative;margin:1rem;max-width:30rem;box-sizing:border-box;padding:1rem;padding-bottom:max(1rem,env(safe-area-inset-bottom));background:Canvas;color:CanvasText;border:1px solid;overflow-wrap:anywhere;font:inherit';
15
+ const status = document.createElement('p');
16
+ status.setAttribute('role', 'status');
17
+ const action = document.createElement('button');
18
+ action.type = 'button';
19
+ action.style.cssText = 'font:inherit;min-height:44px;max-width:100%;white-space:normal';
20
+ const install = document.createElement('button');
21
+ install.type = 'button';
22
+ install.textContent = 'Install app';
23
+ install.style.cssText = action.style.cssText;
24
+ install.onclick = () => {
25
+ const prompt = installPrompt;
26
+ installPrompt = undefined;
27
+ void prompt?.prompt().catch((error) => options.onError?.(error));
28
+ render();
29
+ };
30
+ panel.append(status, action, install);
31
+ document.body.append(panel);
32
+ const busy = () => {
33
+ try {
34
+ return [...guards].some((guard) => guard());
35
+ }
36
+ catch {
37
+ return true;
38
+ }
39
+ };
40
+ function render() {
41
+ if (disposed)
42
+ return;
43
+ const waiting = Boolean(registration?.waiting);
44
+ panel.hidden = !waiting && !activated && navigator.onLine && !installPrompt;
45
+ status.textContent = activated
46
+ ? 'Update activated. Reload when your work is saved.'
47
+ : waiting
48
+ ? 'An update is ready. Save edits and finish recordings before updating.'
49
+ : navigator.onLine
50
+ ? 'Install this app for easier access. Installation does not make cloud features available offline.'
51
+ : `Offline. ${options.offlineFeatures?.length ? `Available: ${options.offlineFeatures.join(', ')}.` : 'Only the downloaded app shell is available.'} Cloud, media and model features require a connection unless explicitly downloaded and verified by this app.`;
52
+ install.hidden = !installPrompt;
53
+ action.hidden = !waiting && !activated;
54
+ action.textContent = activated
55
+ ? 'Reload app'
56
+ : activating
57
+ ? 'Activating update…'
58
+ : 'Activate update';
59
+ action.disabled = activating;
60
+ }
61
+ function activate() {
62
+ if (disposed || activating || busy() || !registration?.waiting)
63
+ return false;
64
+ activating = true;
65
+ try {
66
+ registration.waiting.postMessage({ type: 'SKIP_WAITING' });
67
+ }
68
+ catch (error) {
69
+ activating = false;
70
+ options.onError?.(error);
71
+ render();
72
+ return false;
73
+ }
74
+ render();
75
+ return true;
76
+ }
77
+ function reload() {
78
+ if (disposed || !activated || busy())
79
+ return false;
80
+ (options.reload ?? (() => window.location.reload()))();
81
+ return true;
82
+ }
83
+ action.onclick = () => {
84
+ if (activated)
85
+ reload();
86
+ else
87
+ activate();
88
+ };
89
+ const changed = () => {
90
+ // Also handles an old autoUpdate worker taking control. Never reload here.
91
+ const next = navigator.serviceWorker.controller;
92
+ if (controller && next !== controller) {
93
+ activated = true;
94
+ activating = false;
95
+ }
96
+ controller = next;
97
+ render();
98
+ };
99
+ const watched = new Set();
100
+ const watch = () => {
101
+ const worker = registration?.installing;
102
+ if (worker && !watched.has(worker)) {
103
+ watched.add(worker);
104
+ worker.addEventListener('statechange', render);
105
+ }
106
+ render();
107
+ };
108
+ window.addEventListener('online', render);
109
+ window.addEventListener('offline', render);
110
+ const beforeInstall = (event) => {
111
+ event.preventDefault();
112
+ installPrompt = event;
113
+ render();
114
+ };
115
+ const installed = () => {
116
+ installPrompt = undefined;
117
+ render();
118
+ };
119
+ window.addEventListener('beforeinstallprompt', beforeInstall);
120
+ window.addEventListener('appinstalled', installed);
121
+ navigator.serviceWorker?.addEventListener('controllerchange', changed);
122
+ const ready = navigator.serviceWorker
123
+ ? navigator.serviceWorker
124
+ .register(options.swUrl ?? '/sw.js')
125
+ .then((value) => {
126
+ if (disposed)
127
+ return;
128
+ registration = value;
129
+ registration.addEventListener('updatefound', watch);
130
+ watch();
131
+ })
132
+ .catch((error) => {
133
+ options.onError?.(error);
134
+ })
135
+ : Promise.resolve();
136
+ render();
137
+ return {
138
+ ready,
139
+ activate,
140
+ reload,
141
+ /** Register dirty forms, active recorders, transfers or other work. */
142
+ addBusyGuard(guard) {
143
+ guards.add(guard);
144
+ return () => {
145
+ guards.delete(guard);
146
+ };
147
+ },
148
+ dispose() {
149
+ disposed = true;
150
+ panel.remove();
151
+ window.removeEventListener('online', render);
152
+ window.removeEventListener('offline', render);
153
+ window.removeEventListener('beforeinstallprompt', beforeInstall);
154
+ window.removeEventListener('appinstalled', installed);
155
+ navigator.serviceWorker?.removeEventListener('controllerchange', changed);
156
+ registration?.removeEventListener('updatefound', watch);
157
+ for (const worker of watched)
158
+ worker.removeEventListener('statechange', render);
159
+ },
160
+ };
161
+ }
162
+ /** Optional public assets only. Readiness is checked against actual cached bytes. */
163
+ export function offlineAssets(id, paths) {
164
+ const name = `fas-offline-${encodeURIComponent(id)}`;
165
+ const urls = paths.map((path) => {
166
+ const url = new URL(path, location.href);
167
+ if (url.origin !== location.origin || url.username || url.password || url.search || url.hash)
168
+ throw new Error('Offline assets must be public same-origin URLs without credentials or queries.');
169
+ return url.href;
170
+ });
171
+ if (!urls.length)
172
+ throw new Error('Declare at least one offline asset.');
173
+ return {
174
+ async ready() {
175
+ const cache = await caches.open(name);
176
+ return (await Promise.all(urls.map((url) => cache.match(url)))).every(Boolean);
177
+ },
178
+ async download() {
179
+ const cache = await caches.open(name);
180
+ for (const url of urls) {
181
+ const response = await fetch(url, {
182
+ credentials: 'omit',
183
+ redirect: 'error',
184
+ cache: 'no-store',
185
+ });
186
+ if (!response.ok ||
187
+ response.type === 'opaque' ||
188
+ /private|no-store/i.test(response.headers.get('cache-control') ?? '') ||
189
+ /cookie|authorization|\*/i.test(response.headers.get('vary') ?? ''))
190
+ throw new Error(`Asset is not publicly cacheable: ${url}`);
191
+ await cache.put(url, response);
192
+ }
193
+ },
194
+ async read(path) {
195
+ const url = new URL(path, location.href).href;
196
+ if (!urls.includes(url))
197
+ throw new Error('Undeclared offline asset.');
198
+ return (await caches.open(name)).match(url);
199
+ },
200
+ remove: () => caches.delete(name),
201
+ };
202
+ }
203
+ //# sourceMappingURL=pwa.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pwa.js","sourceRoot":"","sources":["../src/pwa.ts"],"names":[],"mappings":"AAeA,MAAM,UAAU,QAAQ,CAAC,UAAsB,EAAE;IAC/C,MAAM,MAAM,GAAG,IAAI,GAAG,EAAiB,CAAC;IACxC,IAAI,OAAO,CAAC,MAAM;QAAE,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/C,IAAI,YAAmD,CAAC;IACxD,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,IAAI,UAAU,GAAG,KAAK,CAAC;IACvB,IAAI,aAAwC,CAAC;IAC7C,IAAI,UAAU,GAAG,SAAS,CAAC,aAAa,EAAE,UAAU,CAAC;IACrD,MAAM,KAA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,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;YACjC,CAAC;QACH,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,IAAY;YACrB,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;YAC9C,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;YACtE,OAAO,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9C,CAAC;QACD,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;KAClC,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@freeappstore/sdk",
3
- "version": "0.16.13",
3
+ "version": "0.16.15",
4
4
  "description": "Browser SDK for FreeAppStore — auth, KV, collections, counters, rooms, proxy, encrypted user keys, roles, friends, email, push reminders, React hooks, and UI components.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -22,6 +22,14 @@
22
22
  "./push-sw": {
23
23
  "types": "./dist/push-sw.d.ts",
24
24
  "import": "./dist/push-sw.js"
25
+ },
26
+ "./pwa": {
27
+ "types": "./dist/pwa.d.ts",
28
+ "import": "./dist/pwa.js"
29
+ },
30
+ "./pwa-config": {
31
+ "types": "./dist/pwa-config.d.ts",
32
+ "import": "./dist/pwa-config.js"
25
33
  }
26
34
  },
27
35
  "homepage": "https://github.com/freeappstore-online/platform#readme",
@@ -50,11 +58,15 @@
50
58
  "README.md"
51
59
  ],
52
60
  "peerDependencies": {
53
- "react": "^18.0.0 || ^19.0.0"
61
+ "react": "^18.0.0 || ^19.0.0",
62
+ "vite-plugin-pwa": "^1.0.0"
54
63
  },
55
64
  "peerDependenciesMeta": {
56
65
  "react": {
57
66
  "optional": true
67
+ },
68
+ "vite-plugin-pwa": {
69
+ "optional": true
58
70
  }
59
71
  },
60
72
  "devDependencies": {
@@ -63,7 +75,8 @@
63
75
  "happy-dom": "^20.14.5",
64
76
  "react": "^19.3.0",
65
77
  "react-dom": "^19.3.0",
66
- "typescript": "^5.9.3"
78
+ "typescript": "^5.9.3",
79
+ "vite-plugin-pwa": "^1.3.0"
67
80
  },
68
81
  "sideEffects": false,
69
82
  "scripts": {