@colixsystems/widget-sdk 0.243.0 → 0.244.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/README.md +34 -3
- package/dist/contract.cjs +5 -1
- package/dist/contract.js +5 -1
- package/dist/hooks.js +5 -2
- package/dist/index.d.ts +4 -0
- package/package.json +1 -1
- package/src/contract.js +5 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ The data layer lives in **four separate domain-client packages**, each instantia
|
|
|
24
24
|
| **CORE** | `useUser()` | `{ id, email, displayName, photoUrl, roles, groupIds }` | `ctx.user` (host-built context, **camelCase** — not a wire payload; `id` null when anonymous) — no scope. `photoUrl` is the user's own profile photo as an absolute URL, or `null`. |
|
|
25
25
|
| **CORE** | `useUserPhoto()` | `{ url, canEdit, upload, remove, uploading, error }` | `ctx.user` + the optional `ctx.account` — no scope. Changes the signed-in user's OWN profile photo. `canEdit` is false when nobody is signed in or the host cannot change it; `upload` / `remove` then reject. |
|
|
26
26
|
| **CORE** | `useAnonymousAccount()` | `{ supported, canCreate, creating, error, create }` | The optional `ctx.account.anonymous` — no scope. Offers an account with a generated login code and password and no email. `create()` opens the app's own dialog, which confirms, creates the account, shows the pair once and signs the visitor in; the widget never receives the pair and `create()` resolves `{ created: true }`. `supported` is false where the workspace has not turned anonymous accounts on, on the Builder canvas, in a preview and for a badge counter; `canCreate` is false while someone is signed in. |
|
|
27
|
-
| **CORE** | `useNavigation()` | `{ goTo, goToStartPage, scrollToSection, goBack, push, replace, back, currentRoute, openLink }` | `ctx.navigation` — no scope. `goTo(pageIdOrSlug, params?)` accepts a page UUID (a `pageRef` prop) **or its slug** (a row's page-key field) — both hosts resolve either; `goToStartPage()` opens the signed-in user's own start page; `scrollToSection(id)` scrolls this page to a section picked with a `sectionRef` prop (`openLink` for a link of unknown shape; a known external URL can also use the `Linking` primitive) |
|
|
27
|
+
| **CORE** | `useNavigation()` | `{ goTo, goToStartPage, scrollToSection, scrollIntoView, goBack, push, replace, back, currentRoute, openLink }` | `ctx.navigation` — no scope. `goTo(pageIdOrSlug, params?)` accepts a page UUID (a `pageRef` prop) **or its slug** (a row's page-key field) — both hosts resolve either; `goToStartPage()` opens the signed-in user's own start page; `scrollToSection(id)` scrolls this page to a section picked with a `sectionRef` prop; `scrollIntoView(ref)` scrolls it to an element inside your widget (a heading your table of contents jumps to) (`openLink` for a link of unknown shape; a known external URL can also use the `Linking` primitive) |
|
|
28
28
|
| **CORE** | `useFilePreview(file)` | `{ uri }` | No scope. A temporary address an `<Image>` can show for a file the person picked but has not uploaded yet (a photo in a composer). Native picks use their own uri; on the web the SDK creates and releases an object URL, which widgets may not do themselves. `uri` is null for no file. |
|
|
29
29
|
| **CORE** | `usePageBadge(count)` | `{ supported }` | `ctx.navigation.setBadge` — no scope. Puts `count` on the menu entry or tab of the page the widget is on (a chat's unread messages). The host sums the page's widgets and keeps the last count after the widget leaves the screen, until it reports again; `0` clears this widget's share. `supported` is false where the host draws no page badges (the Builder canvas). |
|
|
30
30
|
| **CORE** | `useRouteParams()` | `{ [paramKey]: value }` | `ctx.navigation.currentRoute.params` — no scope. The nav params the previous page passed via `goTo(pageId, params)`; the flat accessor for master→detail (read `recordId` on a detail page). Empty object when none. |
|
|
@@ -84,7 +84,38 @@ See the design reference for the full architecture: [`docs/architecture/widget-m
|
|
|
84
84
|
|
|
85
85
|
## Status
|
|
86
86
|
|
|
87
|
-
`v0.
|
|
87
|
+
`v0.244.0` — pre-publish. The package surface (types, function names, export paths) is the v1 contract; runtime behaviour for some hooks is stubbed (each hook documents what's wired and what isn't). It is **not yet published to npm**.
|
|
88
|
+
|
|
89
|
+
### What's new in 0.244.0 (contract 1.198.0)
|
|
90
|
+
|
|
91
|
+
**A widget can scroll its page to an element inside itself — `useNavigation().scrollIntoView(ref)`.** A long article, FAQ or handbook widget can show a table of contents whose entries jump to its own headings. The page itself scrolls, so the widget keeps its full height and never needs a scroll box of its own. Attach a ref to the element and pass the ref:
|
|
92
|
+
|
|
93
|
+
```jsx
|
|
94
|
+
import { useRef } from "react";
|
|
95
|
+
import { useNavigation, Pressable, Text, View } from "@colixsystems/widget-sdk";
|
|
96
|
+
|
|
97
|
+
export default function Handbook({ sections }) {
|
|
98
|
+
const { scrollIntoView } = useNavigation();
|
|
99
|
+
const headings = useRef({});
|
|
100
|
+
return (
|
|
101
|
+
<View>
|
|
102
|
+
{sections.map((s) => (
|
|
103
|
+
<Pressable key={s.id} onPress={() => scrollIntoView({ current: headings.current[s.id] })}>
|
|
104
|
+
<Text>{s.title}</Text>
|
|
105
|
+
</Pressable>
|
|
106
|
+
))}
|
|
107
|
+
{sections.map((s) => (
|
|
108
|
+
<View key={s.id} ref={(el) => { headings.current[s.id] = el; }}>
|
|
109
|
+
<Text>{s.title}</Text>
|
|
110
|
+
<Text>{s.body}</Text>
|
|
111
|
+
</View>
|
|
112
|
+
))}
|
|
113
|
+
</View>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Both hosts use the same scroll as `scrollToSection`: smooth (instant under reduced motion), stopping with the element just below a pinned site header, on a normal page and on a Fit to screen page. A ref that is not mounted does nothing, and so does the Studio canvas. To jump to another part of the PAGE, keep using `scrollToSection` with a `sectionRef` prop. Additive.
|
|
88
119
|
|
|
89
120
|
### What's new in 0.243.0 (contract 1.197.0)
|
|
90
121
|
|
|
@@ -2985,7 +3016,7 @@ import { defineWidget, validateManifest, useDatastoreQuery, Text, View } from "@
|
|
|
2985
3016
|
|
|
2986
3017
|
- `defineWidget({ manifest, component })` — validates the manifest and produces a widget module the host can register.
|
|
2987
3018
|
- `validateManifest(m)` / `validatePropertySchema(s)` / `validateProps(schema, props)` — shape validation; no third-party deps.
|
|
2988
|
-
- `useDatastoreQuery`, `useDatastoreRecord`, `useDatastoreSchema`, `useDatastoreMutation`, `useDirectory`, `useUsers`, `useGroups`, `useRecordPermissions`, `useAsset`, `useWidgetEvent`, `useWidgetInput`, `usePayments`, `useSendNotification`, `useTheme`, `useI18n`, `useUser`, `useNavigation`, `useRouteParams`, `usePageContext`, `useWidgetRoute`, `useChildRenderer`, `useClipboard`, `useToast` — hooks that read from the host-provided `WidgetContext` (or, for `useClipboard`, the platform clipboard API directly). `useDirectory(query?)` returns `{ users, loading, error, refetch }` (each user `{ id, name, role }`) and requires the `directory.read:users` scope. `useUsers(query?)` returns `{ users, loading, error, refetch, invite, deactivate, reactivate, remove }` and requires `users.read:*` (mutations also need `users.write:*`); rejections are a `DirectoryError`. `useGroups(query?)` returns `{ groups, loading, error, refetch, create, remove, addMember, removeMember }` and requires `groups.read:*` (mutations also need `groups.write:*`). `usePayments()` returns `{ requestPayment, getPayment }` and requires the `payments.charge:appUser` scope; `requestPayment(...)` rejects with a `PaymentError` carrying `code`, the server's user-safe `message`, and `retryable` (`false` = this charge cannot succeed until the workspace, manifest, or amount changes — show the message, not a retry). `useSendNotification()` returns `{ send, sending, error }` and requires the `notifications.send:appUser` scope; `send({ recipient_user_id, title, body, link?, payload? })` notifies one app user in the same workspace (cross-workspace `recipient_user_id` is rejected), must be called from an event handler rather than render, and rejects with a `NotificationError`. `useUser()` returns the active end-user identity `{ id, email, displayName, roles, groupIds }` (camelCase — the host-built context object, not a wire payload; `id` is `null` for anonymous / preview). `useNavigation()` returns `{ goTo, goToStartPage, scrollToSection, goBack, push, replace, back, currentRoute, openLink }` for internal page navigation; `goToStartPage()` opens the signed-in user's own start page (the page the app opens on for them); `scrollToSection(sectionId)` scrolls the current page to one of its sections (bind the id with a `sectionRef` prop); `openLink(link)` follows an author- or data-supplied link of unknown shape through the host's shared resolver (in-app page → internal route, off-app http(s) → opened outside, unsafe → refused) and is the safe choice for any value your code did not construct, while `Linking.openURL(url)` is for an external URL you built yourself. `useRouteParams()` returns the current route's params object (`currentRoute.params`) — the flat master→detail accessor; read a param off it (e.g. `recordId`), never call it. `useDatastoreRecord(tableId, recordId)` returns `{ data, loading, error, refetch }` for a single record (data is one row or null). `useDatastoreSchema(tableId)` returns `{ schema, loading, error, refetch }` where `schema` is `{ id, name, columns: [{ id, name, data_type, required, relation_type, target_table_id, is_identification }] }` (structure only, no row data; snake_case verbatim) — use it to resolve a stored `columnId` to its column type at runtime; requires the `datastore.read:<table>` scope. `useAsset(fileId)` returns `{ url, file, loading, error, refetch }` — the `url` is an absolute URL composed against the host's API base. `useChildRenderer()` returns `{ renderNode(node) }` — container widgets call it to render arbitrary child page-tree nodes (prefer the `WidgetTree` component for the common case). `useWidgetInput(inputName)` returns the latest payload a sibling widget published on the event the page author wired to this widget's declared `inputs` entry (`undefined` when unwired or not yet published).
|
|
3019
|
+
- `useDatastoreQuery`, `useDatastoreRecord`, `useDatastoreSchema`, `useDatastoreMutation`, `useDirectory`, `useUsers`, `useGroups`, `useRecordPermissions`, `useAsset`, `useWidgetEvent`, `useWidgetInput`, `usePayments`, `useSendNotification`, `useTheme`, `useI18n`, `useUser`, `useNavigation`, `useRouteParams`, `usePageContext`, `useWidgetRoute`, `useChildRenderer`, `useClipboard`, `useToast` — hooks that read from the host-provided `WidgetContext` (or, for `useClipboard`, the platform clipboard API directly). `useDirectory(query?)` returns `{ users, loading, error, refetch }` (each user `{ id, name, role }`) and requires the `directory.read:users` scope. `useUsers(query?)` returns `{ users, loading, error, refetch, invite, deactivate, reactivate, remove }` and requires `users.read:*` (mutations also need `users.write:*`); rejections are a `DirectoryError`. `useGroups(query?)` returns `{ groups, loading, error, refetch, create, remove, addMember, removeMember }` and requires `groups.read:*` (mutations also need `groups.write:*`). `usePayments()` returns `{ requestPayment, getPayment }` and requires the `payments.charge:appUser` scope; `requestPayment(...)` rejects with a `PaymentError` carrying `code`, the server's user-safe `message`, and `retryable` (`false` = this charge cannot succeed until the workspace, manifest, or amount changes — show the message, not a retry). `useSendNotification()` returns `{ send, sending, error }` and requires the `notifications.send:appUser` scope; `send({ recipient_user_id, title, body, link?, payload? })` notifies one app user in the same workspace (cross-workspace `recipient_user_id` is rejected), must be called from an event handler rather than render, and rejects with a `NotificationError`. `useUser()` returns the active end-user identity `{ id, email, displayName, roles, groupIds }` (camelCase — the host-built context object, not a wire payload; `id` is `null` for anonymous / preview). `useNavigation()` returns `{ goTo, goToStartPage, scrollToSection, scrollIntoView, goBack, push, replace, back, currentRoute, openLink }` for internal page navigation; `goToStartPage()` opens the signed-in user's own start page (the page the app opens on for them); `scrollToSection(sectionId)` scrolls the current page to one of its sections (bind the id with a `sectionRef` prop); `scrollIntoView(ref)` scrolls it to an element inside the calling widget; `openLink(link)` follows an author- or data-supplied link of unknown shape through the host's shared resolver (in-app page → internal route, off-app http(s) → opened outside, unsafe → refused) and is the safe choice for any value your code did not construct, while `Linking.openURL(url)` is for an external URL you built yourself. `useRouteParams()` returns the current route's params object (`currentRoute.params`) — the flat master→detail accessor; read a param off it (e.g. `recordId`), never call it. `useDatastoreRecord(tableId, recordId)` returns `{ data, loading, error, refetch }` for a single record (data is one row or null). `useDatastoreSchema(tableId)` returns `{ schema, loading, error, refetch }` where `schema` is `{ id, name, columns: [{ id, name, data_type, required, relation_type, target_table_id, is_identification }] }` (structure only, no row data; snake_case verbatim) — use it to resolve a stored `columnId` to its column type at runtime; requires the `datastore.read:<table>` scope. `useAsset(fileId)` returns `{ url, file, loading, error, refetch }` — the `url` is an absolute URL composed against the host's API base. `useChildRenderer()` returns `{ renderNode(node) }` — container widgets call it to render arbitrary child page-tree nodes (prefer the `WidgetTree` component for the common case). `useWidgetInput(inputName)` returns the latest payload a sibling widget published on the event the page author wired to this widget's declared `inputs` entry (`undefined` when unwired or not yet published).
|
|
2989
3020
|
- `WidgetTree({ node })` — component that renders an author-authored child node through the host's renderer; used by Tabs / Card / custom containers to host arbitrary child widgets.
|
|
2990
3021
|
- `Text`, `View`, `Pressable`, `Image`, `ScrollView`, `TextInput`, `FlatList`, `SectionList`, `ActivityIndicator`, `Switch`, `StyleSheet`, `Linking`, `Icon`, `DateTimePicker` — re-exported from `react-native` (the RN primitives) or implemented in the SDK (`Icon` wraps `lucide-react-native`; `DateTimePicker` wraps `@react-native-community/datetimepicker` on native and renders `<input type="date|time|datetime-local">` directly on web because the RN library has no react-native-web mapping). The web build aliases `react-native` to `react-native-web` so the RN-re-exported primitives render in the browser without any per-platform code; the exported Expo app's Metro bundler resolves the real `react-native` library. `Linking` is a static API (`Linking.openURL(url)`) — use it for external URLs, and use `useNavigation().goTo(pageId)` for internal page navigation. See https://reactnative.dev/docs/ for per-component props.
|
|
2991
3022
|
- `Overlay` — the screen-level overlay (sc-6607). `<Overlay visible={!!preview} onRequestClose={() => setPreview(null)} size="full">…</Overlay>` renders its children OUTSIDE the widget's layout box on both hosts (web portals it to the document root, native uses the OS modal), so no clipping card, `ScrollView` or neighbouring widget can cut off a document/media preview, lightbox or confirm dialog — which absolute positioning inside the widget cannot achieve on either platform. Children stay in your own React tree, so state and hooks work normally. `onRequestClose` carries the backdrop press, Escape on web, and the Android back button; `size` is `sm` | `md` (default) | `lg` | `full`; the scrim, surface, radius, padding and elevation come from the workspace theme. An anchored dropdown still belongs inside your own root.
|
package/dist/contract.cjs
CHANGED
|
@@ -1205,6 +1205,8 @@ const HOOKS = [
|
|
|
1205
1205
|
"() => void — opens the signed-in user's own start page, the page the app opens on for them (it can differ per user, since page access is restricted per group). Use it for a 'back to start' or 'home' button instead of hard-coding a page. A no-op where there is no live router (the Studio canvas, a badge counter).",
|
|
1206
1206
|
scrollToSection:
|
|
1207
1207
|
"(sectionId: string) => void — scrolls THIS page to one of its sections (a root section or a layout container), landing its top just below any pinned site header; smooth unless the visitor prefers reduced motion. Take the id from a `sectionRef` prop the author picks; never hard-code a node id. An unknown, deleted or hidden section is a no-op, and so is the Studio canvas.",
|
|
1208
|
+
scrollIntoView:
|
|
1209
|
+
"(ref: { current }) => void — scrolls THIS page so an element inside the calling widget (the ref you attached to a View, Text or other primitive) lands just below any pinned site header; smooth unless the visitor prefers reduced motion. Use it for anchors within the widget's own content, such as a table of contents that jumps to one of its headings. Never fake page anchors with a height-capped inner ScrollView: the page itself scrolls. A ref that is not mounted is a no-op, and so is the Studio canvas.",
|
|
1208
1210
|
goBack: "() => void",
|
|
1209
1211
|
push: "(pageIdOrSlug: string, params?: object) => void",
|
|
1210
1212
|
replace: "(pageIdOrSlug: string, params?: object) => void",
|
|
@@ -6155,7 +6157,9 @@ const CONTRACT = deepFreeze({
|
|
|
6155
6157
|
// the link that opens BankID on this device. Signing hooks document
|
|
6156
6158
|
// polling, the two ways to start BankID and how to read a verdict;
|
|
6157
6159
|
// useFileSignatures is described as the caller's own signatures.
|
|
6158
|
-
|
|
6160
|
+
// 1.198.0: additive (sc-12088) — `useNavigation().scrollIntoView(ref)`
|
|
6161
|
+
// scrolls the page to an element inside the calling widget on both hosts.
|
|
6162
|
+
version: "1.198.0",
|
|
6159
6163
|
sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
|
|
6160
6164
|
hooks: HOOKS,
|
|
6161
6165
|
primitives: PRIMITIVES,
|
package/dist/contract.js
CHANGED
|
@@ -1205,6 +1205,8 @@ const HOOKS = [
|
|
|
1205
1205
|
"() => void — opens the signed-in user's own start page, the page the app opens on for them (it can differ per user, since page access is restricted per group). Use it for a 'back to start' or 'home' button instead of hard-coding a page. A no-op where there is no live router (the Studio canvas, a badge counter).",
|
|
1206
1206
|
scrollToSection:
|
|
1207
1207
|
"(sectionId: string) => void — scrolls THIS page to one of its sections (a root section or a layout container), landing its top just below any pinned site header; smooth unless the visitor prefers reduced motion. Take the id from a `sectionRef` prop the author picks; never hard-code a node id. An unknown, deleted or hidden section is a no-op, and so is the Studio canvas.",
|
|
1208
|
+
scrollIntoView:
|
|
1209
|
+
"(ref: { current }) => void — scrolls THIS page so an element inside the calling widget (the ref you attached to a View, Text or other primitive) lands just below any pinned site header; smooth unless the visitor prefers reduced motion. Use it for anchors within the widget's own content, such as a table of contents that jumps to one of its headings. Never fake page anchors with a height-capped inner ScrollView: the page itself scrolls. A ref that is not mounted is a no-op, and so is the Studio canvas.",
|
|
1208
1210
|
goBack: "() => void",
|
|
1209
1211
|
push: "(pageIdOrSlug: string, params?: object) => void",
|
|
1210
1212
|
replace: "(pageIdOrSlug: string, params?: object) => void",
|
|
@@ -6151,7 +6153,9 @@ const CONTRACT = deepFreeze({
|
|
|
6151
6153
|
// the link that opens BankID on this device. Signing hooks document
|
|
6152
6154
|
// polling, the two ways to start BankID and how to read a verdict;
|
|
6153
6155
|
// useFileSignatures is described as the caller's own signatures.
|
|
6154
|
-
|
|
6156
|
+
// 1.198.0: additive (sc-12088) — `useNavigation().scrollIntoView(ref)`
|
|
6157
|
+
// scrolls the page to an element inside the calling widget on both hosts.
|
|
6158
|
+
version: "1.198.0",
|
|
6155
6159
|
sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
|
|
6156
6160
|
hooks: HOOKS,
|
|
6157
6161
|
primitives: PRIMITIVES,
|
package/dist/hooks.js
CHANGED
|
@@ -744,11 +744,14 @@ export function useContainerWidth() {
|
|
|
744
744
|
}
|
|
745
745
|
|
|
746
746
|
/**
|
|
747
|
-
* Returns the host-provided navigation surface:
|
|
748
|
-
*
|
|
747
|
+
* Returns the host-provided navigation surface: `{ goTo, goToStartPage,
|
|
748
|
+
* scrollToSection, scrollIntoView, goBack, push, replace, back, currentRoute,
|
|
749
|
+
* openLink }`.
|
|
749
750
|
*
|
|
750
751
|
* `goTo(pageId, params?)` navigates to an internal app page. `goToStartPage()`
|
|
751
752
|
* opens the signed-in user's own start page, which can differ per user.
|
|
753
|
+
* `scrollToSection(id)` scrolls the page to one of its sections, and (sc-12088)
|
|
754
|
+
* `scrollIntoView(ref)` to an element inside the calling widget.
|
|
752
755
|
* `goBack()` pops the stack. `push` / `replace` / `back` are aliases that map to
|
|
753
756
|
* the platform's native navigator (react-router on web, react-navigation
|
|
754
757
|
* on native). Missing methods degrade to no-ops on the Studio canvas
|
package/dist/index.d.ts
CHANGED
|
@@ -850,6 +850,7 @@ export interface WidgetContext<TProps = unknown> {
|
|
|
850
850
|
goTo(pageId: string, params?: Record<string, string>): void;
|
|
851
851
|
goToStartPage(): void;
|
|
852
852
|
scrollToSection(sectionId: string): void;
|
|
853
|
+
scrollIntoView(ref: { readonly current: unknown } | object | null | undefined): void;
|
|
853
854
|
goBack(): void;
|
|
854
855
|
push(pageId: string, params?: Record<string, unknown>): void;
|
|
855
856
|
replace(pageId: string, params?: Record<string, unknown>): void;
|
|
@@ -2221,6 +2222,8 @@ export function useFitScreenInsets(): FitScreenInsets;
|
|
|
2221
2222
|
* opens the signed-in user's own start page, which can differ per user.
|
|
2222
2223
|
* `scrollToSection(sectionId)` scrolls this page to one of its sections (the
|
|
2223
2224
|
* id comes from a `sectionRef` prop); an unknown section is a no-op.
|
|
2225
|
+
* `scrollIntoView(ref)` scrolls this page to an element inside the calling
|
|
2226
|
+
* widget, such as a heading its table of contents jumps to.
|
|
2224
2227
|
* Missing methods degrade to no-ops on the Studio canvas preview where no
|
|
2225
2228
|
* live router is mounted. For external URLs use the `Linking` primitive.
|
|
2226
2229
|
*/
|
|
@@ -2228,6 +2231,7 @@ export function useNavigation(): {
|
|
|
2228
2231
|
goTo(pageId: string, params?: Record<string, unknown>): void;
|
|
2229
2232
|
goToStartPage(): void;
|
|
2230
2233
|
scrollToSection(sectionId: string): void;
|
|
2234
|
+
scrollIntoView(ref: { readonly current: unknown } | object | null | undefined): void;
|
|
2231
2235
|
goBack(): void;
|
|
2232
2236
|
push(pageId: string, params?: Record<string, unknown>): void;
|
|
2233
2237
|
replace(pageId: string, params?: Record<string, unknown>): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@colixsystems/widget-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.244.0",
|
|
4
4
|
"description": "Common widget interface for AppStudio. Implements WidgetManifest, WidgetContext, property schema, and helper hooks.",
|
|
5
5
|
"homepage": "https://github.com/Colix-AB/AppStudio",
|
|
6
6
|
"type": "module",
|
package/src/contract.js
CHANGED
|
@@ -1205,6 +1205,8 @@ const HOOKS = [
|
|
|
1205
1205
|
"() => void — opens the signed-in user's own start page, the page the app opens on for them (it can differ per user, since page access is restricted per group). Use it for a 'back to start' or 'home' button instead of hard-coding a page. A no-op where there is no live router (the Studio canvas, a badge counter).",
|
|
1206
1206
|
scrollToSection:
|
|
1207
1207
|
"(sectionId: string) => void — scrolls THIS page to one of its sections (a root section or a layout container), landing its top just below any pinned site header; smooth unless the visitor prefers reduced motion. Take the id from a `sectionRef` prop the author picks; never hard-code a node id. An unknown, deleted or hidden section is a no-op, and so is the Studio canvas.",
|
|
1208
|
+
scrollIntoView:
|
|
1209
|
+
"(ref: { current }) => void — scrolls THIS page so an element inside the calling widget (the ref you attached to a View, Text or other primitive) lands just below any pinned site header; smooth unless the visitor prefers reduced motion. Use it for anchors within the widget's own content, such as a table of contents that jumps to one of its headings. Never fake page anchors with a height-capped inner ScrollView: the page itself scrolls. A ref that is not mounted is a no-op, and so is the Studio canvas.",
|
|
1208
1210
|
goBack: "() => void",
|
|
1209
1211
|
push: "(pageIdOrSlug: string, params?: object) => void",
|
|
1210
1212
|
replace: "(pageIdOrSlug: string, params?: object) => void",
|
|
@@ -6151,7 +6153,9 @@ const CONTRACT = deepFreeze({
|
|
|
6151
6153
|
// the link that opens BankID on this device. Signing hooks document
|
|
6152
6154
|
// polling, the two ways to start BankID and how to read a verdict;
|
|
6153
6155
|
// useFileSignatures is described as the caller's own signatures.
|
|
6154
|
-
|
|
6156
|
+
// 1.198.0: additive (sc-12088) — `useNavigation().scrollIntoView(ref)`
|
|
6157
|
+
// scrolls the page to an element inside the calling widget on both hosts.
|
|
6158
|
+
version: "1.198.0",
|
|
6155
6159
|
sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
|
|
6156
6160
|
hooks: HOOKS,
|
|
6157
6161
|
primitives: PRIMITIVES,
|