@protobase/cli 0.94.20 → 0.94.22
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/cli/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/cli",
|
|
3
|
-
"version": "0.94.
|
|
3
|
+
"version": "0.94.22",
|
|
4
4
|
"description": "The protobase command: scaffold, doctor, dev, build and serve a Protobase project.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@better-auth/core": "^1.7.12",
|
|
45
45
|
"@hono/node-server": "^2.1.3",
|
|
46
|
-
"@protobase/config": "0.94.
|
|
47
|
-
"@protobase/layout": "0.94.
|
|
48
|
-
"@protobase/query": "0.94.
|
|
49
|
-
"@protobase/schema": "0.94.
|
|
50
|
-
"@protobase/server": "0.94.
|
|
51
|
-
"@protobase/ui": "0.94.
|
|
52
|
-
"@protobase/workflows": "0.94.
|
|
46
|
+
"@protobase/config": "0.94.22",
|
|
47
|
+
"@protobase/layout": "0.94.22",
|
|
48
|
+
"@protobase/query": "0.94.22",
|
|
49
|
+
"@protobase/schema": "0.94.22",
|
|
50
|
+
"@protobase/server": "0.94.22",
|
|
51
|
+
"@protobase/ui": "0.94.22",
|
|
52
|
+
"@protobase/workflows": "0.94.22",
|
|
53
53
|
"@react-email/render": "^2.1.0",
|
|
54
54
|
"@scalar/hono-api-reference": "^0.12.10",
|
|
55
55
|
"@sentry/vite-plugin": "^11.10.0",
|
|
@@ -33,6 +33,7 @@ The page of one record, with its sections, related records, galleries, charts an
|
|
|
33
33
|
- [Record lines](../reference/ui-config.md#record-lines): The related table a record's view marks as its lines, such as an invoice's, shows all of them on its page, where you edit, add, remove and reorder them, and Save writes the record and its lines together.
|
|
34
34
|
- [Custom section fallbacks](../reference/custom-components.md#record-section-fallbacks) (experimental): Where your own component on a record page cannot be drawn, such as on a watch, what you declare shows in its place: any main-column item in the main column, conversations included, and sidebar maps and sidebar custom components in the sidebar.
|
|
35
35
|
- [Conversations](../reference/ui-config.md#conversations): A record page holds a chat about the record, such as a task's, with its messages in markdown and a box that sends one, declared in its layout with no component of the app's own.
|
|
36
|
+
- [Message status and a working indicator](../reference/ui-config.md#message-status-and-a-working-indicator) (experimental): Threads can show each message's status and when a reply is being written.
|
|
36
37
|
- [Charts of samples](../reference/ui-config.md#charts-of-related-records): A record page graphs numeric samples over the last hour, day or week, such as a server's CPU use.
|
|
37
38
|
- [Trends of related records](../reference/ui-config.md#trends-of-related-records) (experimental): Record pages can chart their related records over time.
|
|
38
39
|
- [Fresh data on return](../reference/ui-config.md#the-record-page): Records and lists reload when the browser tab is focused again, keeping unsaved edits.
|
|
@@ -465,6 +465,8 @@ The latest messages that match `filter`, oldest first, each under its sender's n
|
|
|
465
465
|
| `sender` | Who wrote each message: a relation, named as the record it points at, or a text field. Required. |
|
|
466
466
|
| `time` | When each was sent: a date or timestamp field the API can sort by, which orders them. Required. |
|
|
467
467
|
| `text` | The message; shown rendered when the message resource's view marks it [`.markdown()`](ui-config.md#names-and-columns). Required. |
|
|
468
|
+
| `status` | A short line under each message, such as whether it was delivered: a text or enum field, shown with its view's value labels, in red for a value it colours `red`; a message without a value shows none. Left out for a user who cannot read it. Experimental, see [Message status and a working indicator](ui-config.md#message-status-and-a-working-indicator). |
|
|
469
|
+
| `working` | A condition on the record around the thread, as [`Show`](#show) takes, such as `state = 'working'`: while it holds, the thread ends in a working indicator. Left out for a user who cannot read what it names. Experimental. |
|
|
468
470
|
| `limit` | How many of the latest it shows at first, and how many each **Load earlier messages** adds: 1 to 500, the API's largest page; default 50. |
|
|
469
471
|
| `title`, `description`, `actions` | The heading; no card is drawn around the thread, so it can sit in a `Card` with its composer. |
|
|
470
472
|
| `empty` | Text while there are no messages. |
|
|
@@ -683,7 +683,7 @@ export const repairsView = filtered
|
|
|
683
683
|
| `l.custom(Component, { title?, props?, sidebar?, when?, fallback? })` | A [custom component](custom-components.md#record-sections) where it is listed: in the main column under `title`, or with `sidebar: true` as a sidebar card. [`fallback`](custom-components.md#record-section-fallbacks) shows in its place where it cannot be drawn. |
|
|
684
684
|
| `l.map(title, { latitude, longitude, zoom?, sidebar?, when? })` | A map with a pin at the record's position, in the main column or with `sidebar: true` as a sidebar card. See [Maps](#maps). |
|
|
685
685
|
| `l.chart(title, { resource, field, at, series, range?, help?, when? })` | Line graphs of numbers of the records that point at this one, such as a machine's samples, over the last hour, day or week. See [Charts of related records](#charts-of-related-records). |
|
|
686
|
-
| `l.thread(title, { resource, field, sender, time, text, limit?, empty?, help?, when? })` | The record's conversation: the latest messages that point at it, oldest first, under each sender's name and time. See [Conversations](#conversations). |
|
|
686
|
+
| `l.thread(title, { resource, field, sender, time, text, status?, working?, limit?, empty?, help?, when? })` | The record's conversation: the latest messages that point at it, oldest first, under each sender's name and time. See [Conversations](#conversations). |
|
|
687
687
|
| `l.composer({ resource, field, text, placeholder?, when? })` | A box that sends a message about the record, which the thread then shows. See [Conversations](#conversations). |
|
|
688
688
|
| `l.gallery(title, { image?, photos?, when? })` | The record's photos as tiles, opening a lightbox. See [Galleries](#galleries). |
|
|
689
689
|
| `l.history(title?, { limit?, when? })` | The record's changes, newest first, with who made each and the fields before and after; needs `.history()` on the resource, and a view without a layout shows it last by itself. See [Record history](history.md#on-the-record-page). |
|
|
@@ -1188,6 +1188,8 @@ The thread shows the latest messages oldest first, each under its sender's name
|
|
|
1188
1188
|
| `sender` | Who wrote each message: a relation, named as the record it points at, or a text field. Required. |
|
|
1189
1189
|
| `time` | When each was sent: a date or timestamp field the API can sort by, which orders them. Required. |
|
|
1190
1190
|
| `text` | The message, a text field. Required. |
|
|
1191
|
+
| `status` | A short line under each message, such as whether it was delivered: a text or enum field. See [Message status and a working indicator](#message-status-and-a-working-indicator). |
|
|
1192
|
+
| `working` | A condition on this record, such as `state = 'working'`, while which the thread ends in a working indicator. |
|
|
1191
1193
|
| `limit` | How many of the latest it shows at first, and how many each **Load earlier messages** adds: 1 to 500, the API's largest page; default 50. |
|
|
1192
1194
|
| `empty` | Text while there are no messages. |
|
|
1193
1195
|
| `help`, `when` | A line under the title, and whether it shows on the form, the read view or both. |
|
|
@@ -1212,6 +1214,25 @@ view<typeof tasks>('tasks').layout((r) => [
|
|
|
1212
1214
|
|
|
1213
1215
|
The messages are read with `field = <this record's key>` as the filter, newest first by `time`, so the user's access applies as on the list. That read needs an index on `(field, time)`, such as `create index on task_messages (task_id, sent_at)`, which [`protobase doctor`](cli.md#doctor) checks. A user who cannot read `field`, `sender`, `time` or `text` gets no thread, and one who may not create a message with `field` and `text` gets no composer. A `field` that is no relation to this resource, a `time` that is no date or timestamp the API can sort by, a `sender` that is no relation or text field, a thread `text` that is no text field, a sensitive field in the thread, or a composer `text` that is no writable text field stops the server at startup. As with a related section, the record page's count of the records that point at it leaves out the messages its thread shows.
|
|
1214
1216
|
|
|
1217
|
+
#### Message status and a working indicator
|
|
1218
|
+
|
|
1219
|
+
:::caution[Experimental]
|
|
1220
|
+
<gap>A message cannot show more than one status line because combining several status fields is not implemented.</gap> <gap>The working indicator cannot say who is writing because naming the writer is not implemented.</gap>
|
|
1221
|
+
:::
|
|
1222
|
+
|
|
1223
|
+
A thread can say whether each message arrived and whether a reply is on its way, as a chat with an assistant or a teammate does. `status` names a text or enum field of the messages, such as `delivery`, shown in small type under each message that has a value, with the labels the message resource's view gives its enum values; a message without one shows no line, and a value the view colours `red` with [`.valueColors()`](#value-tones-and-currencies), such as a failed send, shows in red beside an alert icon. `working` is a condition on the record the thread belongs to, written as for [conditional sections](#form-and-read-view), such as `state = 'working'`: while it holds, the thread ends in three pulsing dots and "Writing a reply…", which screen readers announce, and a reader at the end of the thread keeps seeing them.
|
|
1224
|
+
|
|
1225
|
+
```ts
|
|
1226
|
+
view<typeof chat_messages>('chat_messages').fields((r) => ({ delivery: r.delivery.valueLabels({ sent: 'Sent', delivered: 'Delivered', failed: 'Not sent' }).valueColors({ failed: 'red' }) }))
|
|
1227
|
+
|
|
1228
|
+
view<typeof chats>('chats').layout((r) => [
|
|
1229
|
+
l.thread('Conversation', { resource: 'chat_messages', field: 'chat_id', sender: 'sender', time: 'sent_at', text: 'body', status: 'delivery', working: "state = 'working'" }),
|
|
1230
|
+
l.composer({ resource: 'chat_messages', field: 'chat_id', text: 'body' }),
|
|
1231
|
+
])
|
|
1232
|
+
```
|
|
1233
|
+
|
|
1234
|
+
Both change without a reload when their resources are [live](live.md): a status as its message changes, and the indicator as the record does. A user who cannot read the status field sees the thread without the line, and one who cannot read what `working` names sees it without the indicator. A `status` that is no text or enum field, or is sensitive, and a `working` that does not parse or names a field the record does not have, stop the server at startup.
|
|
1235
|
+
|
|
1215
1236
|
## Actions and views per role
|
|
1216
1237
|
|
|
1217
1238
|
```ts title="docs-examples/bike-shop/step-5.ts"
|