@protobase/cli 0.119.2 → 0.119.4

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.2";
2
+ var version = "0.119.4";
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.2",
3
+ "version": "0.119.4",
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.2",
47
- "@protobase/layout": "0.119.2",
48
- "@protobase/query": "0.119.2",
49
- "@protobase/schema": "0.119.2",
50
- "@protobase/server": "0.119.2",
51
- "@protobase/ui": "0.119.2",
52
- "@protobase/workflows": "0.119.2",
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",
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",
@@ -9,6 +9,7 @@ The changes of each record, comments on it, and pages that refresh as records ch
9
9
  - [Activity](../reference/history.md#activity): Admins see all changes across resources in one list.
10
10
  - [History retention](../reference/history.md#keeping-it): Changes older than a set number of days are removed by a daily job.
11
11
  - [Comments](../reference/comments.md#on-the-record-page): Anyone who can read a record can read and add comments on it.
12
+ - [Comment formatting](../reference/comments.md#formatting): Comments show bold, italic, strikethrough, code, code blocks, lists and quotes, and web addresses become links that open in a new tab.
12
13
  - [Mentions](../reference/comments.md#mentions): Mentioning a colleague in a comment sends them an email with a link to the record.
13
14
  - [Comment moderation](../reference/comments.md#moderation): Admins find and delete comments across the app.
14
15
  - [Live updates](../reference/live.md#what-a-page-hears): Open lists and record pages refresh within seconds when a record changes, including changes made outside the API.
@@ -4,7 +4,7 @@
4
4
 
5
5
  Comments on a resource's records by anyone who may read them, with @mentions that email the people named, shown on the record page and listed for admins.
6
6
 
7
- A resource with [`.comments()`](https://docs.protobase.net/api/schema/interfaces/resourcebuilder/#comments) takes comments on its records: plain text, each with its author and time. Typing `@` in a comment mentions someone, who gets an email with a link to the record. <gap>Comments cannot be edited.</gap> <gap>Comments have no replies.</gap> <gap>Comments have no reactions.</gap>
7
+ A resource with [`.comments()`](https://docs.protobase.net/api/schema/interfaces/resourcebuilder/#comments) takes comments on its records: text with [formatting](#formatting), each with its author and time. Typing `@` in a comment mentions someone, who gets an email with a link to the record. <gap>Comments cannot be edited.</gap> <gap>Comments have no replies.</gap> <gap>Comments have no reactions.</gap>
8
8
 
9
9
  ```ts title="config/tickets.ts"
10
10
  import { f, l, resource, view } from '@protobase/schema'
@@ -36,11 +36,17 @@ export const ticketsView = view<typeof tickets>('tickets')
36
36
 
37
37
  [`l.comments(title?, { when })`](https://docs.protobase.net/api/schema/variables/l/#comments) shows the record's comments oldest first, the newest just above the box to write one; Show earlier comments loads those before. ⌘/Ctrl+Enter or the Comment button posts. A view without a layout shows Comments last by itself. A view that names `l.comments()` for a resource without `.comments()` stops startup. A visitor who is not signed in sees the comments but no box.
38
38
 
39
+ ## Formatting
40
+
41
+ A comment is stored as written and shown with a chat's markdown: `**bold**`, `_italic_`, `~~strikethrough~~`, `` `code` ``, code blocks between ```` ``` ```` lines, `-` and `1.` lists and `> ` quotes, with each line break kept. Web addresses, `www.` ones included, and `[text](address)` links open in a new tab; a link whose text names another web address than the one it opens shows the address it opens. A mention is picked out inside formatted text too, but not inside code.
42
+
43
+ It follows chat habits where markdown would surprise: a line under a quote or a list item is no part of it, a quote needs the space after `>` (`>5 failed logins` stays as typed), bold comes only from `**` (`__init__` stays as typed), and only fences make code blocks, not indented lines. What a message rarely means stays as typed too: `#` headings, `---` rules, tables, images and link definitions. Raw HTML shows as text, and a link goes only to an `http(s)`, `mailto` or `tel` address or a relative one, so a `javascript:` link shows as its text; the result is sanitised again before it reaches the page.
44
+
39
45
  ## Mentions
40
46
 
41
47
  Typing `@` and part of a name lists up to 8 people to mention: the arrows move, Enter, Tab or a click picks, Escape closes. Only people who may read the record themselves are listed, never one who is banned or has no name, and the server refuses a mention of anyone else, so a mention email never shows a record to someone who cannot open it. The comment keeps `@Name` as written, and the record page picks it out.
42
48
 
43
- Each person mentioned gets one email from the app's own mail: who mentioned them on which record, the comment, and a button that opens the record. The emails are sent by the job `comments.mention`, enqueued with the comment, so mentions need:
49
+ Each person mentioned gets one email from the app's own mail: who mentioned them on which record, the comment, and a button that opens the record. <gap>Mention emails cannot show a comment's formatting because rendering markdown in email is not implemented.</gap> The emails are sent by the job `comments.mention`, enqueued with the comment, so mentions need:
44
50
 
45
51
  - the project's [Better Auth](auth.md), whose users are the people listed; without it, comments work and nobody can be mentioned;
46
52
  - [mail](email.md#configuration); without it, the job sends nothing;
@@ -424,7 +424,7 @@ A chat between people, such as a team's channels, is built from the parts the [a
424
424
  | `ChatMessage` | One message. `author` (`{ id, name }`) draws it on the left beside the author's avatar, under their name and `time`, an ISO timestamp shown on the viewer's clock; `avatar` replaces the initials, such as with a photo, and `continued` leaves out avatar, name and time for a message that follows the same author's. `from: 'user' \| 'assistant'` draws an assistant chat's sides instead. `footer` adds a small line under either, such as whether it was read. |
425
425
  | `ChatDivider` | A line across the chat with a label: `label` for a day, such as `chatDayLabel(time)` ("Today", "Yesterday" or the date, on the viewer's calendar) between two messages for which `sameChatDay(a, b)` is false; `tone="new"` for the red **New messages** line. |
426
426
  | `Composer` | The box under the chat, which grows with its text: Enter or the button sends, Shift+Enter starts a new line. `onSend` gets the trimmed text and the ids of the people it mentions. With `searchPeople`, a function that returns the `{ id, name }` people whose name matches the text typed after `@`, such as a channel's members, typing `@` lists them above the box: the arrows move, Enter or Tab picks, Escape closes. `busy` keeps the text from being sent. For a message that carries files, `actions` draws an attach button left of the box and `attachments` a tray of the picked files above it, `canSendEmpty` lets Enter and the button send with no text, `onSend('', [])`, and `onFiles` gets the files pasted into the box or dropped on the composer, which uploads nothing itself; a paste that holds text stays text. |
427
- | `MentionBox`, `MentionedText` | The text box with `@` mentions that the composer and [comments](comments.md) are built from, for a box of your own: `value` and `onChange` hold the text and the people picked (`emptyDraft` to start), and `mentionedIds(text, picked)` the ids still mentioned. `MentionedText` shows a message's `text` with each `@name` of its `mentions` picked out. |
427
+ | `MentionBox`, `MentionedText` | The text box with `@` mentions that the composer and [comments](comments.md) are built from, for a box of your own: `value` and `onChange` hold the text and the people picked (`emptyDraft` to start), and `mentionedIds(text, picked)` the ids still mentioned. `MentionedText` shows a message's `text` with comments' [formatting](comments.md#formatting): bold, italic, strikethrough, code, code blocks, lists, quotes and web addresses as links, each `@name` of its `mentions` picked out. |
428
428
 
429
429
  The messages' author comes from the server: give the resource [`.author()`](data-config.md#resource), and each create stores the signed-in user's id, never a value the client sends.
430
430
 
@@ -52,7 +52,7 @@ The app keeps what someone signed in last saw, from the moment they sign in, and
52
52
  - When the fresh data lands it replaces the cached data in place, and nothing moves.
53
53
  - When the refresh fails, such as without a network, the cached data stays, muted, and a warning replaces the spinner.
54
54
 
55
- The start cache holds who is signed in, the app's `/meta` and the latest answer of each query the app read. It has no time limit, only a soft limit of 4 MB: once the answers pass it, those used least recently are dropped, oldest first, until they are back under it. Who is signed in, `/meta` and the answers of the page on screen when it saves are never dropped, so the next start draws that page whole: the cache can pass 4 MB by that one page. A table embedded in a page reads only the fields it shows, which keeps the page small, unless its actions run on selected rows: those get whole records. It lives in the browser's IndexedDB for the app's origin, or in the app's own storage on a phone. It is emptied when someone signs out, when the session ends and the API answers 401, and when a new Protobase version of the app opens. Visitors and staff signed in as someone keep nothing.
55
+ The start cache holds who is signed in, the app's `/meta` and the latest answer of each query the app read. It has no time limit, only a soft limit of 4 MB: once the answers pass it, those used least recently are dropped, oldest first, until they are back under it. Who is signed in, `/meta` and the answers of the page on screen when it saves are never dropped, so the next start draws that page whole: the cache can pass 4 MB by that one page. A table embedded in a page reads only the fields it shows, which keeps the page small, unless its actions run on selected rows: those get whole records. It lives in the browser's IndexedDB for the app's origin, or in the app's own storage on a phone. It is emptied when someone signs out, when the session ends and the API answers 401, and when a new Protobase version of the app opens. Visitors and staff signed in as someone keep nothing. <gap>The first frame after someone switches, creates or joins an organization cannot draw that organization's sidebar because keeping `/meta` per organization in the start cache is not implemented, so it draws the last one's, muted, until `/meta` is read again.</gap>
56
56
 
57
57
  ### When the UI is ready
58
58
 
@@ -69,6 +69,7 @@ export const channelsView = view<typeof channels>('channels').nav({ recent: { or
69
69
  - The filter is AIP-160 text, as `?filter=` on the list API takes it, so it reads only `.filterable()` fields, which are indexed. `orderBy` picks among several matches; the list's sort when omitted.
70
70
  - The record is read with the caller's token: their access rules apply, and an entry they do not see names no start. When several entries name one, the first in the sidebar's order does.
71
71
  - When nothing matches, or the list is refused, `/` opens the first sidebar entry. Until the answer comes, `/` draws nothing, so no list shows first; the answer is kept for the next start.
72
+ - With organizations, `/` also waits for the app's `/meta` read in this page load, as the one the [start cache](installable-app.md#starting-from-the-last-pages-seen) holds may be from another organization or from none, such as right after someone creates or joins their first.
72
73
  - A [named list](ui-config.md#more-than-one-list) names no start of its own.
73
74
 
74
75
  `createAdmin` refuses a filter or order that does not fit the resource; `/meta` leaves out a start whose filter or order reads a field the caller cannot read.