@protobase/cli 0.46.1 → 0.46.3

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,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.46.1";
2
+ var version = "0.46.3";
3
3
  //#endregion
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/cli",
3
- "version": "0.46.1",
3
+ "version": "0.46.3",
4
4
  "description": "The protobase command: scaffold, doctor, dev, build and serve a Protobase project.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -36,11 +36,11 @@
36
36
  "@better-auth/core": "^1.7.12",
37
37
  "@hono/node-server": "^2.1.3",
38
38
  "@hono/vite-dev-server": "^0.26.1",
39
- "@protobase/layout": "0.46.1",
40
- "@protobase/query": "0.46.1",
41
- "@protobase/schema": "0.46.1",
42
- "@protobase/server": "0.46.1",
43
- "@protobase/ui": "0.46.1",
39
+ "@protobase/layout": "0.46.3",
40
+ "@protobase/query": "0.46.3",
41
+ "@protobase/schema": "0.46.3",
42
+ "@protobase/server": "0.46.3",
43
+ "@protobase/ui": "0.46.3",
44
44
  "@react-email/render": "^2.1.0",
45
45
  "@scalar/hono-api-reference": "^0.12.10",
46
46
  "@tailwindcss/vite": "^4.3.3",
@@ -11,6 +11,7 @@ React components, field types, pages and handlers of your own, loaded as plugins
11
11
  - [Custom field types](../reference/plugins.md#field-types): Register how a kind of value is shown and edited, and pick it per field in a view.
12
12
  - [Custom create pages](../reference/custom-components.md#create-pages): Replace a resource's create form with your own page, such as a booking flow.
13
13
  - [Form parts](../reference/custom-components.md#form-parts): Build your own forms from the app's fields, pickers, switches, buttons and dialogs.
14
+ - [Image carousel](../reference/custom-components.md#image-carousel): Step through screenshots or a record's files in your own components by swiping or with arrows, as cards step through photos.
14
15
  - [Assistant parts](../reference/assistant.md#in-the-ui): The assistant's panel, chat messages, composer and action cards for your own components, with a frameless action card for a page that is already framed.
15
16
  - [Action handlers](../reference/custom-components.md#action-handlers): Your own code for a named action, with the record, the API client and the action's inputs.
16
17
  - [Shell slots](../reference/custom-components.md#shell-slots): Your own components in the top bar, in a panel beside every page, or as the sidebar logo.
@@ -163,6 +163,20 @@ createAuth({ ..., mailer: false })
163
163
  - The link is on the origin the reset was asked on, when that is one of the app's.
164
164
  - While the [sign-in policy](#sign-in-policy) turns passwords off, reset is off too (`403`).
165
165
 
166
+ ## Name, password and devices
167
+
168
+ The signed-in person changes their own name and password, and signs out their other devices, with Better Auth's own endpoints. The client has them in `session.account`, each rejecting with `AuthError`:
169
+
170
+ | Client | Endpoint |
171
+ | --- | --- |
172
+ | `updateName(name)` | `POST /api/auth/update-user` with `{ name }` |
173
+ | `changePassword(current, next, signOutOthers)` | `POST /api/auth/change-password` with `{ currentPassword, newPassword, revokeOtherSessions }`, for an account that has a password (a wrong one is `INVALID_PASSWORD`) |
174
+ | `sessions()` | `GET /api/auth/list-sessions`: the devices signed in now, each `{ token, current, userAgent?, ipAddress?, createdAt, updatedAt, expiresAt, staff? }`, with `current` for this one and `staff` for a [staff session](#staff-sign-in) |
175
+ | `revokeSession(token)` | `POST /api/auth/revoke-session` with `{ token }`: signs out that device |
176
+ | `revokeOtherSessions()` | `POST /api/auth/revoke-other-sessions`: signs out every device but this one |
177
+
178
+ Signing out a device, or a new password with `signOutOthers`, stops that device's API token at its next request (see [When a token stops working](#when-a-token-stops-working)); this device stays signed in. A [staff session](#staff-sign-in) cannot change the password or sign out the other devices (`STAFF_CANNOT_CHANGE_SIGN_IN`).
179
+
166
180
  ## Emailed sign-in codes
167
181
 
168
182
  With mail configured, the sign-in page offers "Email me a sign-in code": the person enters their address, gets a 6-digit code, and signs in with it instead of a password. It is Better Auth's [email OTP](https://www.better-auth.com/docs/plugins/email-otp) plugin: `POST /api/auth/email-otp/send-verification-otp` with `{ email, type: "sign-in" }`, then `POST /api/auth/sign-in/email-otp` with `{ email, otp }`.
@@ -240,6 +240,34 @@ export const BookRepair = () => {
240
240
  }
241
241
  ```
242
242
 
243
+ ## Image carousel
244
+
245
+ `Carousel` from `@protobase/ui` steps through images the way a card steps through a record's [photos](ui-config.md#card-photos), outside a card too: a row that snaps image by image, swiped on a touch screen or moved by arrows that show on hover, with dots marking the image in view. One image shows without arrows or dots.
246
+
247
+ | | |
248
+ | --- | --- |
249
+ | `images` | The images in order: `{ src, alt }`, a link with what it shows, or a file field's value as records carry it, with an optional `alt`. A file's smallest [variant](files.md#image-variants-and-placeholders) that is sharp enough is drawn; a missing file or one that is no raster image is left out. |
250
+ | `label` | What the images are, read out with the carousel. |
251
+ | `fit` | `cover`, the default, fills the frame and crops what overflows it; `contain` shows each image whole. |
252
+ | `swipe` | Off, a swipe scrolls what the carousel sits in, such as a row that scrolls sideways, and the arrows always show on a touch screen. On by default. |
253
+ | `className` | The frame's classes, such as its aspect ratio, border and rounding; it has none of its own. |
254
+
255
+ ```tsx
256
+ import { Carousel } from '@protobase/ui'
257
+
258
+ export const PresetShots = () => (
259
+ <Carousel
260
+ label="Bike repairs"
261
+ fit="contain"
262
+ className="aspect-[8/5] rounded-lg border border-border"
263
+ images={[
264
+ { src: '/shots/repairs-board.png', alt: 'The repairs board' },
265
+ { src: '/shots/repair.png', alt: 'A repair' },
266
+ ]}
267
+ />
268
+ )
269
+ ```
270
+
243
271
  ## Components in the chat
244
272
 
245
273
  The same components draw the assistant's [widget parts](assistant.md#widget-parts): a part names a component, and the dock draws it with the part's props, so one component can sit on a page and in the chat. In the chat there is no record around it, so a component that needs `useLayoutRecord()` works only on pages; take ids as props instead. Besides the API hooks, a widget can read the assistant backend with [`useBackendData`](assistant.md#reading-the-backend-from-a-widget).