@protobase/cli 0.119.4 → 0.119.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.119.4";
2
+ var version = "0.119.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.119.4",
3
+ "version": "0.119.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": {
@@ -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.119.4",
47
- "@protobase/layout": "0.119.4",
48
- "@protobase/query": "0.119.4",
49
- "@protobase/schema": "0.119.4",
50
- "@protobase/server": "0.119.4",
51
- "@protobase/ui": "0.119.4",
52
- "@protobase/workflows": "0.119.4",
46
+ "@protobase/config": "0.119.6",
47
+ "@protobase/layout": "0.119.6",
48
+ "@protobase/query": "0.119.6",
49
+ "@protobase/schema": "0.119.6",
50
+ "@protobase/server": "0.119.6",
51
+ "@protobase/ui": "0.119.6",
52
+ "@protobase/workflows": "0.119.6",
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",
@@ -11,10 +11,11 @@ The page of one record, with its sections, related records, galleries, charts an
11
11
  - [Record pages that open another](../reference/ui-config.md#a-record-page-that-opens-another): A record's page opens another address built from its fields in its place, such as a workflow run opening its workflow's page with the run shown.
12
12
  - [Record page opens elsewhere](../reference/ui-config.md#open-elsewhere) (beta): A view can send its record's address to another page its fields name, such as a message opening in its conversation, so search results and links land where the record is read.
13
13
  - [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.
14
+ - [Conversation pages](../reference/ui-config.md#conversation-pages) (beta): A record's page is its conversation, configured with no component of your own: a header with its title, topic and details, its messages grouped by day and author with mentions and edits shown, and a box that sends one, opening on a New messages line at the reader's place, on the web and at mobile width.
14
15
  - [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.
15
16
  - [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.
16
17
  - [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.
17
- - [Titles per reader](../reference/ui-config.md#titles-per-reader): A record without a name of its own, such as a direct message, is titled for each reader from its fields, such as after the other members, in the sidebar, heading, browser tab, relation links, list columns, relation pickers, filters and search.
18
+ - [Titles per reader](../reference/ui-config.md#titles-per-reader): A record without a name of its own, such as a direct message, is titled for each reader from its fields, such as after the other members with the built-in `members` rule, in the sidebar, heading, browser tab, relation links, list columns, relation pickers, filters and search.
18
19
  - [JSON fields on forms](../reference/plugins.md#json) (beta): A JSON field, such as a workflow run's input, is edited on forms as JSON text and shown written out on several lines.
19
20
  - [Member fields](../reference/plugins.md#members): A field that holds a list of people, such as a private channel's members, picks the organization's members by name on forms and shows them by avatar and name.
20
21
  - [Save feedback](../reference/ui-config.md#the-record-page): A view shows saving on the Save button instead of in a toast.
@@ -85,6 +85,8 @@ export default defineUi({
85
85
  })
86
86
  ```
87
87
 
88
+ The rule `members` is built in and needs no function: `.titleFrom('members', (r) => [r.member_ids])` names the record after the people in a JSON field of user ids other than the reader, in the order they were added, joined by commas. A [conversation page](#conversation-pages) with `members` titles its record this way unless the view sets its own `.titleFrom`.
89
+
88
90
  The derived title names the record wherever `.title` would: the sidebar's [recent records](sidebar.md#recent-records), whose list request reads the picked fields too, the record page's heading, the browser tab, the links of a record page's relation fields, related cards, the global search, unless the view's `.searchResult` gives a title, and every relation that points at such a record: a list's relation column and a card's relation field, which read the picked fields of a page's records in one request, the relation picker's options and a relation filter's values. The picker's typed text still matches the resource's search fields, or, without any, the derived titles of the records it loads. The record's key shows while the function returns nothing, such as while the members' names load, and when the reader cannot read a field it picks, or the UI config registers no function of that name. It is presentation only: no field, filter or sort reads it, and the search does not match it. Other members' names come only with organizations; without them, `member` finds no one.
89
91
 
90
92
  <gap>An export of shown values and a chart grouped by a relation cannot name a record by its derived title because titling them per reader is not implemented.</gap>
@@ -770,6 +772,52 @@ view<typeof channels>('channels').record({ component: ChannelChat })
770
772
 
771
773
  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>
772
774
 
775
+ ### Conversation pages
776
+
777
+ :::caution[Beta]
778
+ A conversation page shows each message's text with its mentions and keeps line breaks, without markdown; it has no replies in threads, reactions, editing, deleting, files or calls yet.
779
+ :::
780
+
781
+ `.record({ conversation })` makes the record page the record's conversation, for a record that holds one, such as a chat channel, a direct message or a support case, with no component of the app's own. It fills the content area as a [full-area record page](#full-area-record-pages) does, on the web and at mobile width: a header row, the messages that point at the record, and a box that sends one, which stays in view while the messages scroll above it.
782
+
783
+ ```ts
784
+ view<typeof channels>('channels').record({
785
+ conversation: {
786
+ resource: 'messages',
787
+ field: 'channel_id',
788
+ sender: 'author_id',
789
+ time: 'sent_at',
790
+ text: 'body',
791
+ edited: 'edited_at',
792
+ mentions: 'mentions',
793
+ subtitle: 'topic',
794
+ readPosition: { resource: 'read_positions', field: 'channel_id', message: 'last_read_id' },
795
+ placeholder: 'Message the channel',
796
+ },
797
+ })
798
+ ```
799
+
800
+ | `conversation` option | |
801
+ | --- | --- |
802
+ | `resource` | The message resource. |
803
+ | `field` | The filterable relation of the messages that holds the record's key; each message sent gets it too. |
804
+ | `sender` | Who wrote each message: a relation, named as the record it points at, or a text field of user ids, such as the resource's `.author()`, named after the organization's members. |
805
+ | `time` | When each message was sent: a sortable date or timestamp field. |
806
+ | `text` | The message: a text field the sender may set. |
807
+ | `edited` | A date or timestamp field set when a message changes: a changed message says "(edited)", with the time on hover. |
808
+ | `mentions` | A JSON field for the user ids a message mentions: `@` in the box lists the organization's members by name, the ids of those picked land in it, and the text shows each mention picked out. |
809
+ | `subtitle` | A text field of the record shown beside its title, such as a channel's topic. |
810
+ | `members` | A JSON field of the record holding user ids: the header names the other people in it, each with their presence and [status](status.md#in-the-app), the status text in full beside one person and on hover beside several. The record is titled after them everywhere, as the [`members` title rule](#titles-per-reader) does. |
811
+ | `readPosition` | Where each reader's read position is kept: `{ resource, field, message }`. |
812
+ | `placeholder` | The hint in the empty box. |
813
+ | `empty` | What the conversation says while it has no messages. |
814
+
815
+ The header shows the record's title, which the top bar repeats at mobile width and so shows there only with `members`, the subtitle, and *Details*, a link to the record's standard page at `?standard=true`, with its sections, Edit and Delete. The latest 50 messages show oldest first, with *Load earlier messages* at the top for more. A day divider opens each day, and one person's messages sent within five minutes of each other show under their name once. A message resource with [`.live()`](live.md) shows new, changed and deleted messages as they happen. Every read goes through the reader's own access: a message they may not read never shows, and a reader who may not read the messages or a field each one needs gets the standard page. The box shows for a reader who may create messages.
816
+
817
+ With `readPosition`, the conversation opens on a *New messages* line above the first message someone else wrote since the reader's position, and moves the position to the newest message whenever they read to the end. The read position resource keeps one record per reader and record: its `.author()` is the reader, `field` is a relation to the record and `message` an integer field holding the key of the newest message read, so the message resource's key is one integer column that grows as messages arrive. The page reads and writes only the reader's own position. Without `readPosition`, there is no line and nothing is written.
818
+
819
+ <gap>A conversation page cannot open at a given message, such as a search result, because opening a conversation at a message is not implemented.</gap> <gap>A conversation page cannot show a message's markdown because rendering markdown together with mentions is not implemented.</gap>
820
+
773
821
  ### Focus pages
774
822
 
775
823
  :::caution[Beta]