@softr/sdk 1.17.0-alpha.2 → 1.17.0-alpha.4

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,9 +1,9 @@
1
1
  import { User } from "./user.js";
2
2
  import { Formatting } from "../formatting.js";
3
3
  import { SoftrContext } from "./context.js";
4
- import * as react6 from "react";
4
+ import * as react7 from "react";
5
5
  import { ReactNode } from "react";
6
- import * as _tanstack_react_start2 from "@tanstack/react-start";
6
+ import * as _tanstack_react_start3 from "@tanstack/react-start";
7
7
 
8
8
  //#region src/auth/isomorphic.d.ts
9
9
 
@@ -21,7 +21,7 @@ import * as _tanstack_react_start2 from "@tanstack/react-start";
21
21
  * requestMiddleware: [softrAuthMiddleware()],
22
22
  * }))
23
23
  */
24
- declare function softrAuthMiddleware(): _tanstack_react_start2.RequestMiddlewareAfterServer<{}, readonly [_tanstack_react_start2.RequestMiddlewareAfterServer<{}, undefined, undefined>, _tanstack_react_start2.RequestMiddlewareAfterServer<{}, undefined, undefined>, _tanstack_react_start2.RequestMiddlewareAfterServer<{}, undefined, undefined>, _tanstack_react_start2.RequestMiddlewareAfterServer<{}, undefined, undefined>, _tanstack_react_start2.RequestMiddlewareAfterServer<{}, undefined, undefined>, _tanstack_react_start2.RequestMiddlewareAfterServer<{}, undefined, undefined>, _tanstack_react_start2.RequestMiddlewareAfterServer<{}, undefined, undefined>, _tanstack_react_start2.RequestMiddlewareAfterServer<{}, undefined, undefined>], {
24
+ declare function softrAuthMiddleware(): _tanstack_react_start3.RequestMiddlewareAfterServer<{}, readonly [_tanstack_react_start3.RequestMiddlewareAfterServer<{}, undefined, undefined>, _tanstack_react_start3.RequestMiddlewareAfterServer<{}, undefined, undefined>, _tanstack_react_start3.RequestMiddlewareAfterServer<{}, undefined, undefined>, _tanstack_react_start3.RequestMiddlewareAfterServer<{}, undefined, undefined>, _tanstack_react_start3.RequestMiddlewareAfterServer<{}, undefined, undefined>, _tanstack_react_start3.RequestMiddlewareAfterServer<{}, undefined, undefined>, _tanstack_react_start3.RequestMiddlewareAfterServer<{}, undefined, undefined>, _tanstack_react_start3.RequestMiddlewareAfterServer<{}, undefined, undefined>], {
25
25
  user: User | null;
26
26
  permissions: {
27
27
  datasources: {};
@@ -37,7 +37,7 @@ declare function softrAuthMiddleware(): _tanstack_react_start2.RequestMiddleware
37
37
  * beforeLoad: async () => await getSoftrContext(),
38
38
  * })
39
39
  */
40
- declare const getSoftrContext: _tanstack_react_start2.OptionalFetcher<undefined, undefined, Promise<SoftrContext>>;
40
+ declare const getSoftrContext: _tanstack_react_start3.OptionalFetcher<undefined, undefined, Promise<SoftrContext>>;
41
41
  /**
42
42
  * The context to hand `createRouter`, before any request has resolved one.
43
43
  *
@@ -92,7 +92,7 @@ type AuthOptions = {
92
92
  * staleTime: 60_000,
93
93
  * })
94
94
  */
95
- declare const getAuthSettings: _tanstack_react_start2.OptionalFetcher<undefined, undefined, Promise<AuthOptions>>;
95
+ declare const getAuthSettings: _tanstack_react_start3.OptionalFetcher<undefined, undefined, Promise<AuthOptions>>;
96
96
  /**
97
97
  * Makes the auth options readable with {@link useAuthSettings} anywhere below.
98
98
  *
@@ -112,7 +112,7 @@ declare function AuthSettingsProvider({
112
112
  }: {
113
113
  value: AuthOptions;
114
114
  children?: ReactNode;
115
- }): react6.JSX.Element;
115
+ }): react7.JSX.Element;
116
116
  /**
117
117
  * Which ways in this app offers. Requires an {@link AuthSettingsProvider}
118
118
  * above it.
@@ -1,4 +1,4 @@
1
- import * as react7 from "react";
1
+ import * as react6 from "react";
2
2
 
3
3
  //#region src/default-error-overlay.d.ts
4
4
  type Props = {
@@ -8,6 +8,6 @@ type Props = {
8
8
  declare function DefaultErrorOverlay({
9
9
  error,
10
10
  reset
11
- }: Props): react7.JSX.Element;
11
+ }: Props): react6.JSX.Element;
12
12
  //#endregion
13
13
  export { DefaultErrorOverlay };
package/dist/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "1.17.0-alpha.2";
2
+ var version = "1.17.0-alpha.4";
3
3
 
4
4
  //#endregion
5
5
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softr/sdk",
3
- "version": "1.17.0-alpha.2",
3
+ "version": "1.17.0-alpha.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" },
@@ -4,7 +4,7 @@ description: >-
4
4
  Let the published app open without internet and show the pages and data the
5
5
  visitor last loaded, read only: useOfflineMode, the OfflineMode type, the
6
6
  offline banner and saves made offline. The service worker is already served,
7
- never write one. Editing offline is not supported.
7
+ never write one. Saving offline is not built in.
8
8
  metadata:
9
9
  type: sub-skill
10
10
  library: softr-sdk
@@ -13,11 +13,11 @@ metadata:
13
13
 
14
14
  # Offline mode
15
15
 
16
- With offline mode on, the published app opens without internet and shows the pages and data the visitor already loaded while online, as they were then, sometimes a little older. Pages the visitor never opened are not there: a link to one shows the app's error page. Nothing can be saved offline: a save fails as it would on any network error, and the app tells the visitor.
16
+ With offline mode on, the published app opens without internet and shows the pages and data the visitor already loaded while online, as they were then, sometimes a little older. Pages the visitor never opened are not there: a link to one shows the app's error page. Offline mode keeps nothing to save later: a save made offline fails as it would on any network error, and the app tells the visitor, unless the app has its own offline saving.
17
17
 
18
- > **CRITICAL**: Never write a service worker, a `public/sw.js`, or any `navigator.serviceWorker`, `caches` or IndexedDB code for offline. The app already serves its service worker, shared with push notifications, and `useOfflineMode()` turns offline mode on. A worker of the app's own replaces it, and push notifications stop arriving.
18
+ > **CRITICAL**: Never write a service worker, a `public/sw.js`, or any `navigator.serviceWorker` or `caches` code for offline. The app already serves its service worker, shared with push notifications, and `useOfflineMode()` turns offline mode on. A worker of the app's own replaces it, and push notifications stop arriving.
19
19
  >
20
- > **CRITICAL**: Editing offline is not supported. Do not build a queue of changes to send later. When the builder asks for it, say plainly that the app shows the last loaded data offline, and saving needs a connection.
20
+ > **CRITICAL**: `useOfflineMode()` keeps reads only. Saving offline is app code, built only when the builder asks for it: the changes wait in IndexedDB in the page and are sent when the connection is back. It never goes into a service worker.
21
21
 
22
22
  ## Setup
23
23