@protobase/cli 0.53.3 → 0.53.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.
package/dist/cli/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/cli",
|
|
3
|
-
"version": "0.53.
|
|
3
|
+
"version": "0.53.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": {
|
|
@@ -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.53.
|
|
46
|
-
"@protobase/layout": "0.53.
|
|
47
|
-
"@protobase/query": "0.53.
|
|
48
|
-
"@protobase/schema": "0.53.
|
|
49
|
-
"@protobase/server": "0.53.
|
|
50
|
-
"@protobase/ui": "0.53.
|
|
45
|
+
"@protobase/config": "0.53.4",
|
|
46
|
+
"@protobase/layout": "0.53.4",
|
|
47
|
+
"@protobase/query": "0.53.4",
|
|
48
|
+
"@protobase/schema": "0.53.4",
|
|
49
|
+
"@protobase/server": "0.53.4",
|
|
50
|
+
"@protobase/ui": "0.53.4",
|
|
51
51
|
"@react-email/render": "^2.1.0",
|
|
52
52
|
"@scalar/hono-api-reference": "^0.12.10",
|
|
53
53
|
"@tailwindcss/vite": "^4.3.3",
|
|
@@ -12,6 +12,7 @@ The page of one record, with its sections, related records, galleries, charts an
|
|
|
12
12
|
- [Save conflicts](../reference/ui-config.md#editing-a-record): When someone else changed a record while you edited it, Save shows their value beside yours for each field you both changed, and you keep yours or take theirs.
|
|
13
13
|
- [Groups and tabs](../reference/ui-config.md#groups): Parts of a record page sit under headings that open on click, or in tabs, and the open ones are kept in the address.
|
|
14
14
|
- [Key facts](../reference/ui-config.md#key-facts): A section shows its values side by side with icons.
|
|
15
|
+
- [Confirming a change](../reference/ui-config.md#confirming-a-change): A field that is easy to set by mistake asks a question before a person changes it in a form or a list cell, and Cancel keeps its value.
|
|
15
16
|
- [Help while editing](../reference/ui-config.md#help-while-editing): Help lines meant for whoever changes a record show only on its form.
|
|
16
17
|
- [Conditional sections](../reference/ui-config.md#form-and-read-view): Sections and fields show only while editing, only while reading, or only when a condition on the record holds.
|
|
17
18
|
- [Galleries](../reference/ui-config.md#galleries): A record's photos show as tiles that open a full-screen lightbox, with keyboard and swipe navigation.
|
|
@@ -69,6 +69,7 @@ Field hints:
|
|
|
69
69
|
| --- | --- |
|
|
70
70
|
| `.label(text)` | Instead of the name in words (`customer_id` would be "Customer" anyway). |
|
|
71
71
|
| `.help(text, { when? })` | A line under the field on the record page and in forms. `when: 'editing'` shows it only while the record is edited; see [Help while editing](#help-while-editing). |
|
|
72
|
+
| `.confirm(question)` | Asks `question` before a person changes the value in a form or a list cell, and Cancel keeps it. See [Confirming a change](#confirming-a-change). |
|
|
72
73
|
| `.format(format)` | `badge` shows statuses as coloured badges, `code` sets identifiers in monospace, `percent` adds a % sign. On a text field, `email`, `phone` and `url` show the value as a link that writes to it (`mailto:`), calls it (`tel:`, its digits and a leading +) or opens it in a new tab (only an `http` or `https` address; anything else stays text), on the record page, in its sidebar and in the list's cells but the title's, which links to the record; forms edit it in an email, phone or web address input, which brings up the keyboard for it on a mobile screen and offers the browser's autofill. Another field type with one of them stops the server at startup. `relative` on a timestamp shows it as "5 minutes ago" or "in 2 hours" in lists and on the record page, with the exact time on hover; `absolute` and `compact` are accepted and carried in `/meta` for apps that render their own lists. <gap>The admin does not use the `absolute` and `compact` formats yet.</gap> |
|
|
73
74
|
| `.multiline()` | A text of several lines, such as a description: forms edit it in a box that grows with the text, so the page scrolls rather than the box, and the record page's sections, a page's field blocks and a card's subtitle keep its line breaks (a card shows the first three lines); the record's sidebar shows it on one line. On the record page and the create form it takes the whole width of its section. Only a text field takes it; the list's table shows the text on one line. |
|
|
74
75
|
| `.markdown()` | Markdown, such as a task's notes: forms edit its source in a box that grows with it, with a Write and Preview switch above it, and store it exactly as typed. The record page's sections and a page's field blocks show it rendered as GitHub does, line breaks kept; raw HTML shows as text, links and images keep only http(s), mailto, tel and relative addresses, and links open in a new tab. A card's subtitle shows its first three lines rendered, its links as text; the list's table, the record's sidebar and a card's other lines show its text on one line without the marks. On the record page and the create form it takes the whole width of its section. Only a text field takes it, and the renderer loads with the first markdown shown. |
|
|
@@ -682,6 +683,18 @@ view<typeof listings>('listings')
|
|
|
682
683
|
}))
|
|
683
684
|
```
|
|
684
685
|
|
|
686
|
+
### Confirming a change
|
|
687
|
+
|
|
688
|
+
A field that is easy to set by mistake, but that people may still need to change, can ask before it changes instead of being locked away with [access rules](access.md). `.confirm(question)` shows a dialog titled "Change" and the field's label, with the question under it, as the value first moves away from the saved one: when a switch is turned, a choice is picked or a record is chosen, and at the first key typed into a text or a number, not at every key after. Cancel, Escape or a click outside the dialog keeps the value; Change takes the new one, which saves as the editor saves it: with Save on the record page, at once for a switch or a choice in a list cell. A field set back to its saved value asks again when it is changed once more.
|
|
689
|
+
|
|
690
|
+
It asks on the record page's form, in a list's editable cells, on the create form and in a page's settings and form blocks. It only asks: the API writes the field as any other, so a rule that must hold belongs in the field's [access](access.md) or the resource's `.validate()`.
|
|
691
|
+
|
|
692
|
+
```ts
|
|
693
|
+
view<typeof tasks>('tasks').fields((r) => ({
|
|
694
|
+
researched: r.researched.confirm('The research job sets this once it is done. Set it by hand only to skip the research.'),
|
|
695
|
+
}))
|
|
696
|
+
```
|
|
697
|
+
|
|
685
698
|
### Form and read view
|
|
686
699
|
|
|
687
700
|
The read view and the form share the layout, so every item and field shows on both by default. `when` on an item, `l.related(title, { ..., when })` included, shows it only on one of them, and a field's `.when(...)` does so for the field wherever the record page shows it:
|