@protobase/cli 0.55.5 → 0.55.6

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.55.5";
2
+ var version = "0.55.6";
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.55.5",
3
+ "version": "0.55.6",
4
4
  "description": "The protobase command: scaffold, doctor, dev, build and serve a Protobase project.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -42,12 +42,12 @@
42
42
  "dependencies": {
43
43
  "@better-auth/core": "^1.7.12",
44
44
  "@hono/node-server": "^2.1.3",
45
- "@protobase/config": "0.55.5",
46
- "@protobase/layout": "0.55.5",
47
- "@protobase/query": "0.55.5",
48
- "@protobase/schema": "0.55.5",
49
- "@protobase/server": "0.55.5",
50
- "@protobase/ui": "0.55.5",
45
+ "@protobase/config": "0.55.6",
46
+ "@protobase/layout": "0.55.6",
47
+ "@protobase/query": "0.55.6",
48
+ "@protobase/schema": "0.55.6",
49
+ "@protobase/server": "0.55.6",
50
+ "@protobase/ui": "0.55.6",
51
51
  "@react-email/render": "^2.1.0",
52
52
  "@scalar/hono-api-reference": "^0.12.10",
53
53
  "@tailwindcss/vite": "^4.3.3",
@@ -5,6 +5,7 @@
5
5
  The page of one record, with its sections, related records, galleries, charts and editing.
6
6
 
7
7
  - [Record page layout](../reference/ui-config.md#the-record-page): Sections, a summary sidebar, related tables, maps, charts, galleries, history, comments and your own components.
8
+ - [Full-area record pages](../reference/ui-config.md#full-area-record-pages) (beta): A view draws its record pages with a component of its own that fills the area beside the sidebar and under the top bar, such as a chat channel, and links to the standard page.
8
9
  - [Read view and edit](../reference/ui-config.md#read-view-and-edit): A record opens as a read-only fact sheet or a form, and Edit opens the form at its own address.
9
10
  - [Unsaved edits](../reference/ui-config.md#editing-a-record): Unsaved changes to a record stay in the browser and can be resumed, and leaving a form, a dialog or a comment with changes asks first.
10
11
  - [Record forms](../reference/ui-config.md#editing-a-record): Relations are picked from a list that narrows as you type, numbers are read as the browser's language writes them, and a refused save says under each field what is wrong.
@@ -140,6 +140,29 @@ export const CustomerRepairs = ({ limit }: { limit: number }) => {
140
140
 
141
141
  A list that should stay live polls: `useList('repairs', { refetchInterval: 5000 })` refetches every 5 seconds. It is TanStack Query's `refetchInterval`, so it also takes `false` to stop, or a function of the query, and pauses while the tab is in the background.
142
142
 
143
+ ## Full-area record pages
144
+
145
+ A view can make a component the whole record page with [`.record({ component })`](ui-config.md#full-area-record-pages). It gets the record from `useLayoutRecord()`, as a record section does, and fills the area beside the sidebar and under the top bar, where the page does not scroll: a list in it scrolls in a box of its own with `min-h-0 flex-1 overflow-y-auto`, and what follows the list stays at the bottom. It links to the record's standard page, which keeps the form, the related records, Edit and Delete:
146
+
147
+ ```tsx
148
+ // components/channel-chat.tsx, exported from protobase.ui.tsx: export { ChannelChat } from './components/channel-chat'
149
+ import { AppLink, useLayoutRecord } from '@protobase/ui'
150
+
151
+ export const ChannelChat = () => {
152
+ const { model, key, record } = useLayoutRecord()!
153
+ return (
154
+ <section className="flex min-h-0 flex-col">
155
+ <header className="flex justify-between border-b px-4 py-2">
156
+ {String(record.name)}
157
+ <AppLink to={{ kind: 'record', resource: model.name, key, standard: true }}>Details</AppLink>
158
+ </header>
159
+ <ol className="min-h-0 flex-1 overflow-y-auto">{/* the messages */}</ol>
160
+ {/* the composer */}
161
+ </section>
162
+ )
163
+ }
164
+ ```
165
+
143
166
  ## Record cards
144
167
 
145
168
  A cards display can draw each card's content with a component, declared in the view with `d.cards(fields, { card })`. The card stays a link to the record, with the display's frame; the component draws what is inside it from `row`, the record with the fields the display names, so name every field the card shows:
@@ -105,7 +105,7 @@ Every place in the app has an address, and the app writes and reads them in one
105
105
  | Address | Is |
106
106
  | --- | --- |
107
107
  | `{ kind: 'list', resource, filter?, orderBy?, display? }` | A resource's list, with the filter, order and [display](ui-config.md#list-displays) the list page would show. |
108
- | `{ kind: 'record', resource, key, edit?, open?, tab? }` | One record; `key` is its value, or its parts for a composite key. `edit: true` is its form (`?edit=true`), on a view whose record page opens as a [read view or locked](ui-config.md#read-view-and-edit). `open` lists the titles of the record page's collapsed [groups](ui-config.md#groups) that are open (`?open=<title>`, once per group), and `tab` the title of the [tab](ui-config.md#tabs) it shows (`?tab=<title>`). |
108
+ | `{ kind: 'record', resource, key, edit?, open?, tab?, standard? }` | One record; `key` is its value, or its parts for a composite key. `edit: true` is its form (`?edit=true`), on a view whose record page opens as a [read view or locked](ui-config.md#read-view-and-edit). `open` lists the titles of the record page's collapsed [groups](ui-config.md#groups) that are open (`?open=<title>`, once per group), and `tab` the title of the [tab](ui-config.md#tabs) it shows (`?tab=<title>`). `standard: true` is its standard page (`?standard=true`), on a view whose record page is a [component of the app's own](ui-config.md#full-area-record-pages). |
109
109
  | `{ kind: 'create', resource, values? }` | The form for a new record, with `values` filled in by field name, as text: `{ kind: 'create', resource: 'notes', values: { listing_id: '{id}' } }` on a listing's page starts a note about that listing. A relation shows the name of the record it points at. The values are a start the person can change, not a rule: what they may write is still up to the access rules. A view with a [create page](ui-config.md#create-pages) shows that page here instead, with the values in the address. |
110
110
  | `{ kind: 'page', page, tab? }` | A composed page; `tab` the name of one of its [tabs](blocks.md#tabs-and-tab) (`/<page>/<tab>`), the first when omitted. |
111
111
 
@@ -647,6 +647,18 @@ Without a layout the record page shows one section with every field the user may
647
647
 
648
648
  A record opened from a list, by its row or its card, shows the fields the list loaded at once, with placeholders for the others, and takes input once the whole record has loaded; actions, custom components, maps and galleries wait for it. What the page shows is read again whenever the browser tab or window regains focus, as are the lists, unless the record has unsaved changes, which keep the version they were made to.
649
649
 
650
+ ### Full-area record pages
651
+
652
+ `.record({ component })` makes the record page at `/<resource>/<key>` a [custom component](custom-components.md#full-area-record-pages) of the app's own, for a record that is used rather than filled in, such as a chat channel. The component fills the content area, at full width beside the sidebar and down to the bottom bar on a phone, and the page does not scroll, so the component scrolls its own parts, such as messages above a box that stays at the bottom. The sidebar, the top bar with its breadcrumb naming the record, the bottom bar and a right panel stay; the heading, Save, the action rail, the sections, the related records and the Details card are not drawn. A record that does not exist, or that the user may not read, shows the record page's usual notice, and the component is never drawn.
653
+
654
+ ```ts
655
+ export const ChannelChat = component('ChannelChat')
656
+
657
+ view<typeof channels>('channels').record({ component: ChannelChat })
658
+ ```
659
+
660
+ The standard record page, with the layout's sections, the related records, Edit and Delete, stays at the record's address with `?standard=true` (`{ kind: 'record', resource, key, standard: true }`), which the component links to. Links to the record, from relations, search and notifications, open the component's page. Without the component, from a plugin that is off for instance, and when it throws, the standard page shows instead. <gap>A full-area record component cannot take props from the view because props for `.record` are not implemented.</gap>
661
+
650
662
  ### Read view and edit
651
663
 
652
664
  `.recordMode(mode)` says how the record page opens to a user who may change the record: