@protobase/cli 0.119.3 → 0.119.5

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.3";
2
+ var version = "0.119.5";
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.3",
3
+ "version": "0.119.5",
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.3",
47
- "@protobase/layout": "0.119.3",
48
- "@protobase/query": "0.119.3",
49
- "@protobase/schema": "0.119.3",
50
- "@protobase/server": "0.119.3",
51
- "@protobase/ui": "0.119.3",
52
- "@protobase/workflows": "0.119.3",
46
+ "@protobase/config": "0.119.5",
47
+ "@protobase/layout": "0.119.5",
48
+ "@protobase/query": "0.119.5",
49
+ "@protobase/schema": "0.119.5",
50
+ "@protobase/server": "0.119.5",
51
+ "@protobase/ui": "0.119.5",
52
+ "@protobase/workflows": "0.119.5",
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