@softr/sdk 1.7.5 → 1.7.6-alpha.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/dist/formatting.d.ts +3 -3
- package/dist/package.js +1 -1
- package/dist/pwa.d.ts +2 -2
- package/dist/pwa.js +10 -1
- package/package.json +1 -1
- package/skills/softr-sdk/SKILL.md +1 -1
- package/skills/softr-sdk/ai/SKILL.md +1 -1
- package/skills/softr-sdk/auth/SKILL.md +1 -1
- package/skills/softr-sdk/charts-and-metrics/SKILL.md +1 -1
- package/skills/softr-sdk/current-user/SKILL.md +1 -1
- package/skills/softr-sdk/email/SKILL.md +1 -1
- package/skills/softr-sdk/file-uploads/SKILL.md +1 -1
- package/skills/softr-sdk/formatting/SKILL.md +1 -1
- package/skills/softr-sdk/integrations/SKILL.md +1 -1
- package/skills/softr-sdk/mcp/SKILL.md +1 -1
- package/skills/softr-sdk/push-notifications/SKILL.md +1 -1
- package/skills/softr-sdk/pwa/SKILL.md +1 -1
- package/skills/softr-sdk/record-mutations/SKILL.md +1 -1
- package/skills/softr-sdk/record-queries/SKILL.md +1 -1
- package/skills/softr-sdk/region-visibility/SKILL.md +1 -1
- package/skills/softr-sdk/routes-and-visibility/SKILL.md +1 -1
- package/skills/softr-sdk/workflows/SKILL.md +1 -1
package/dist/formatting.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react2 from "react";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/formatting.d.ts
|
|
@@ -96,7 +96,7 @@ declare function FormattingScope({
|
|
|
96
96
|
/** A BCP 47 locale, such as `de-DE`. It drops the app's fixed date format inside the scope. */
|
|
97
97
|
locale?: string;
|
|
98
98
|
children?: ReactNode;
|
|
99
|
-
}):
|
|
99
|
+
}): react2.FunctionComponentElement<react2.ProviderProps<Scope>>;
|
|
100
100
|
/**
|
|
101
101
|
* A date in the app's format, in a `<span>`, safe to render on the server. A
|
|
102
102
|
* timestamp whose zone is not known yet renders `fallback` until the browser
|
|
@@ -118,7 +118,7 @@ declare function FormattedDate({
|
|
|
118
118
|
time?: boolean;
|
|
119
119
|
/** What renders while the visitor's zone is unknown. */
|
|
120
120
|
fallback?: ReactNode;
|
|
121
|
-
}):
|
|
121
|
+
}): react2.FunctionComponentElement<react2.FragmentProps> | react2.DetailedReactHTMLElement<{
|
|
122
122
|
suppressHydrationWarning: true;
|
|
123
123
|
}, HTMLElement> | null;
|
|
124
124
|
//#endregion
|
package/dist/package.js
CHANGED
package/dist/pwa.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react0 from "react";
|
|
2
2
|
import "@tanstack/react-start";
|
|
3
3
|
|
|
4
4
|
//#region src/pwa.d.ts
|
|
@@ -24,7 +24,7 @@ import "@tanstack/react-start";
|
|
|
24
24
|
* )
|
|
25
25
|
* }
|
|
26
26
|
*/
|
|
27
|
-
declare function SoftrPwaHead():
|
|
27
|
+
declare function SoftrPwaHead(): react0.FunctionComponentElement<react0.FragmentProps>;
|
|
28
28
|
type PwaPlatform = "ios" | "android" | "desktop";
|
|
29
29
|
type PwaInstall = {
|
|
30
30
|
available: false;
|
package/dist/pwa.js
CHANGED
|
@@ -11,6 +11,7 @@ import { createMiddleware } from "@tanstack/react-start";
|
|
|
11
11
|
const MANIFEST_PATH = "/manifest.webmanifest";
|
|
12
12
|
const ICON_PATH = "/apple-touch-icon.png";
|
|
13
13
|
const INSTALL_PATH = "/_softr/pwa.json";
|
|
14
|
+
const STANDALONE_QUERY = "(display-mode: standalone)";
|
|
14
15
|
const TTL_MS = 6e4;
|
|
15
16
|
const CACHE_CONTROL = "public, max-age=60";
|
|
16
17
|
const pwaSchema = z.object({
|
|
@@ -157,6 +158,13 @@ function usePwaInstall() {
|
|
|
157
158
|
useEffect(() => {
|
|
158
159
|
if (isStandalone()) return;
|
|
159
160
|
let cancelled = false;
|
|
161
|
+
const standaloneQuery = window.matchMedia(STANDALONE_QUERY);
|
|
162
|
+
const hideOnceStandalone = () => {
|
|
163
|
+
if (!standaloneQuery.matches) return;
|
|
164
|
+
cancelled = true;
|
|
165
|
+
setInstall({ available: false });
|
|
166
|
+
};
|
|
167
|
+
standaloneQuery.addEventListener("change", hideOnceStandalone);
|
|
160
168
|
fetchInstallInfo().then((installInfo) => {
|
|
161
169
|
const parsed = installSchema.safeParse(installInfo);
|
|
162
170
|
if (!parsed.success || cancelled) return;
|
|
@@ -168,6 +176,7 @@ function usePwaInstall() {
|
|
|
168
176
|
});
|
|
169
177
|
return () => {
|
|
170
178
|
cancelled = true;
|
|
179
|
+
standaloneQuery.removeEventListener("change", hideOnceStandalone);
|
|
171
180
|
};
|
|
172
181
|
}, []);
|
|
173
182
|
return install;
|
|
@@ -179,7 +188,7 @@ function detectPlatform() {
|
|
|
179
188
|
return "desktop";
|
|
180
189
|
}
|
|
181
190
|
function isStandalone() {
|
|
182
|
-
return window.matchMedia(
|
|
191
|
+
return window.matchMedia(STANDALONE_QUERY).matches || "standalone" in navigator && navigator.standalone === true;
|
|
183
192
|
}
|
|
184
193
|
|
|
185
194
|
//#endregion
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@ description: >-
|
|
|
13
13
|
metadata:
|
|
14
14
|
type: sub-skill
|
|
15
15
|
library: softr-sdk
|
|
16
|
-
library_version: 1.7.
|
|
16
|
+
library_version: 1.7.6-alpha.0
|
|
17
17
|
---
|
|
18
18
|
|
|
19
19
|
**Boundary.** `ai` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build. `defineAiAction` and every type come from `@softr/sdk` and can be imported anywhere.
|
|
@@ -10,7 +10,7 @@ description: >-
|
|
|
10
10
|
metadata:
|
|
11
11
|
type: sub-skill
|
|
12
12
|
library: softr-sdk
|
|
13
|
-
library_version: 1.7.
|
|
13
|
+
library_version: 1.7.6-alpha.0
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
**Boundary.** `auth` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build.
|
|
@@ -10,7 +10,7 @@ description: >-
|
|
|
10
10
|
metadata:
|
|
11
11
|
type: sub-skill
|
|
12
12
|
library: softr-sdk
|
|
13
|
-
library_version: 1.7.
|
|
13
|
+
library_version: 1.7.6-alpha.0
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
**Boundary.** `ds` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build. A helper that calls `ds` outside a handler goes in `createServerOnlyFn` from `@tanstack/react-start` (the `record-queries` boundary). `defineQuery` and every type come from `@softr/sdk` and can be imported anywhere.
|
|
@@ -12,7 +12,7 @@ description: >-
|
|
|
12
12
|
metadata:
|
|
13
13
|
type: sub-skill
|
|
14
14
|
library: softr-sdk
|
|
15
|
-
library_version: 1.7.
|
|
15
|
+
library_version: 1.7.6-alpha.0
|
|
16
16
|
---
|
|
17
17
|
|
|
18
18
|
**Boundary.** `email` and `EmailError` live on `@softr/sdk/server` and run only inside a `createServerFn` handler — importing them into a component fails the build. `defineEmailAction` and every type come from `@softr/sdk` and can be imported anywhere.
|
|
@@ -7,7 +7,7 @@ description: >-
|
|
|
7
7
|
metadata:
|
|
8
8
|
type: sub-skill
|
|
9
9
|
library: softr-sdk
|
|
10
|
-
library_version: 1.7.
|
|
10
|
+
library_version: 1.7.6-alpha.0
|
|
11
11
|
---
|
|
12
12
|
|
|
13
13
|
**Boundary.** `upload` lives on `@softr/sdk/server` and runs inside server functions. `useFileUpload` and `FileItem` live on `@softr/sdk` and run in components. `FileAttachment` comes from `@softr/sdk` and can be imported anywhere.
|
|
@@ -7,7 +7,7 @@ description: >-
|
|
|
7
7
|
metadata:
|
|
8
8
|
type: sub-skill
|
|
9
9
|
library: softr-sdk
|
|
10
|
-
library_version: 1.7.
|
|
10
|
+
library_version: 1.7.6-alpha.0
|
|
11
11
|
---
|
|
12
12
|
|
|
13
13
|
**Boundary.** `integration` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build. `defineIntegration` and every type come from `@softr/sdk` and can be imported anywhere.
|
|
@@ -9,7 +9,7 @@ description: >-
|
|
|
9
9
|
metadata:
|
|
10
10
|
type: sub-skill
|
|
11
11
|
library: softr-sdk
|
|
12
|
-
library_version: 1.7.
|
|
12
|
+
library_version: 1.7.6-alpha.0
|
|
13
13
|
---
|
|
14
14
|
|
|
15
15
|
**Boundary.** `softrMcpMiddleware` lives on `@softr/sdk` and is registered once, in `src/start.ts`. The actions you hand it are the same `defineQuery` / `defineMutation` values the app's own pages use — declared wherever they already live, not duplicated for MCP.
|
|
@@ -10,7 +10,7 @@ description: >-
|
|
|
10
10
|
metadata:
|
|
11
11
|
type: sub-skill
|
|
12
12
|
library: softr-sdk
|
|
13
|
-
library_version: 1.7.
|
|
13
|
+
library_version: 1.7.6-alpha.0
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
**Boundary.** `ds` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build. `defineMutation` and every type come from `@softr/sdk` and can be imported anywhere.
|
|
@@ -11,7 +11,7 @@ description: >-
|
|
|
11
11
|
metadata:
|
|
12
12
|
type: sub-skill
|
|
13
13
|
library: softr-sdk
|
|
14
|
-
library_version: 1.7.
|
|
14
|
+
library_version: 1.7.6-alpha.0
|
|
15
15
|
---
|
|
16
16
|
|
|
17
17
|
**Boundary.** `ds` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build. A route `loader` also runs in the browser, so it calls a server function, never `ds`. A helper that calls `ds` outside a handler, in this file or in another one, goes in `createServerOnlyFn` from `@tanstack/react-start`, or inside the handler. An exported helper without it keeps the server-only import in the browser bundle, and every page stops loading until it moves. Do not make such a helper a server function when it takes an id: any visitor can call a server function with any id. `defineQuery` and every type come from `@softr/sdk` and can be imported anywhere.
|
|
@@ -9,7 +9,7 @@ description: >-
|
|
|
9
9
|
metadata:
|
|
10
10
|
type: sub-skill
|
|
11
11
|
library: softr-sdk
|
|
12
|
-
library_version: 1.7.
|
|
12
|
+
library_version: 1.7.6-alpha.0
|
|
13
13
|
---
|
|
14
14
|
|
|
15
15
|
**Boundary.** `definePage`, `pageHead`, the access functions and the error predicates come from `@softr/sdk` and work anywhere.
|
|
@@ -9,7 +9,7 @@ description: >-
|
|
|
9
9
|
metadata:
|
|
10
10
|
type: sub-skill
|
|
11
11
|
library: softr-sdk
|
|
12
|
-
library_version: 1.7.
|
|
12
|
+
library_version: 1.7.6-alpha.0
|
|
13
13
|
---
|
|
14
14
|
|
|
15
15
|
**Boundary.** `workflow` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build. `defineWorkflow` and every type come from `@softr/sdk` and can be imported anywhere.
|