@protobase/cli 0.100.12 → 0.100.14
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.100.
|
|
3
|
+
"version": "0.100.14",
|
|
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.100.
|
|
47
|
-
"@protobase/layout": "0.100.
|
|
48
|
-
"@protobase/query": "0.100.
|
|
49
|
-
"@protobase/schema": "0.100.
|
|
50
|
-
"@protobase/server": "0.100.
|
|
51
|
-
"@protobase/ui": "0.100.
|
|
52
|
-
"@protobase/workflows": "0.100.
|
|
46
|
+
"@protobase/config": "0.100.14",
|
|
47
|
+
"@protobase/layout": "0.100.14",
|
|
48
|
+
"@protobase/query": "0.100.14",
|
|
49
|
+
"@protobase/schema": "0.100.14",
|
|
50
|
+
"@protobase/server": "0.100.14",
|
|
51
|
+
"@protobase/ui": "0.100.14",
|
|
52
|
+
"@protobase/workflows": "0.100.14",
|
|
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",
|
|
@@ -19,6 +19,7 @@ Pages of your own, built from blocks in a JSX layout.
|
|
|
19
19
|
- [Full-width pages](../reference/blocks.md#page): A page fills the whole area beside the sidebar instead of a centred column, for a dashboard with many blocks.
|
|
20
20
|
- [Data blocks](../reference/blocks.md#data): Counts, tables, single records, rows of cards, field values and progress bars.
|
|
21
21
|
- [Related records](../reference/layouts.md#related-records) (beta): Layouts repeat over a record's related records, the records a JSON list of keys points at and the items of a JSON list with `ReferenceManyField`, `ReferenceArrayField`, `ArrayField`, `RecordsIterator` and `ReferenceField`, nested as deep as needed, and a table draws such a list.
|
|
22
|
+
- [Actions in a list](../reference/layouts.md#actions-in-a-list) (beta): An action placed in a list of related records runs on every record of that list, with one confirmation that counts them.
|
|
22
23
|
- [Read plans](../reference/layouts.md#how-a-page-reads-its-data) (beta): The build plans one read per data block ahead of time, derives the fields each read needs, and checks every nested read's indexes. Every read of a page's records, card rows, record rows, tables, threads, charts, counts, related lists and the custom components that declare their reads starts at once when it opens, those inside the records of another block included, and a data block's [text form](../reference/layouts.md#a-pages-text-with-its-records) lists its records; record rows of favorites or saved searches, record rows inside the records of another block, and custom components that fetch their own data, still load on their own.
|
|
23
24
|
- [Table columns on a phone](../reference/blocks.md#columns-on-a-phone): Table blocks choose which columns show at mobile width by priority, with a sensible default, and fall back to a Markdown table.
|
|
24
25
|
- [Row buttons](../reference/blocks.md#row-buttons) (experimental): A table's rows carry a button labelled by a field of the row, such as its next step; the row decides where it goes: a record tab a field names, a list with a filter built from its fields, a list whose resource and filter its fields hold, or an outside https link a field holds. On mobile width the button sits under the row's first cell.
|
|
@@ -714,12 +714,12 @@ A text box that grows with its text: Enter or the send button creates a record o
|
|
|
714
714
|
|
|
715
715
|
### Action
|
|
716
716
|
|
|
717
|
-
A button for a [named action](layouts.md#named-actions) of the view, on the record around it.
|
|
717
|
+
A button for a [named action](layouts.md#named-actions) of the view, on the record around it, or, directly in a `ReferenceManyField` or `ReferenceArrayField`, on every record of that list ([actions in a list](layouts.md#actions-in-a-list)).
|
|
718
718
|
|
|
719
719
|
| Prop | |
|
|
720
720
|
| --- | --- |
|
|
721
721
|
| `name` | The action's name in the view. Required. |
|
|
722
|
-
| `resource` | Outside a record: the resource whose view declares it. |
|
|
722
|
+
| `resource` | Outside a record and a list: the resource whose view declares it. |
|
|
723
723
|
| `label` | Default: the action's label. |
|
|
724
724
|
| `variant` | `primary`, `secondary` (default), `danger` or `ghost`. |
|
|
725
725
|
|
|
@@ -133,7 +133,7 @@ A `RecordCard` (its first match), a `ReferenceField`, each card of a `CardRow` a
|
|
|
133
133
|
## Related records
|
|
134
134
|
|
|
135
135
|
:::caution[Beta]
|
|
136
|
-
A list's next pages, with `pagination="more"`, are a read of the list's own.
|
|
136
|
+
A list's next pages, with `pagination="more"`, are a read of the list's own.
|
|
137
137
|
:::
|
|
138
138
|
|
|
139
139
|
A record's related records repeat under it as a list: a `ReferenceManyField` holds the records of another resource that point at it, a `ReferenceArrayField` the records whose keys a JSON field of it lists, and an `ArrayField` the items of a JSON list it holds. A `RecordsIterator` inside one draws its children once for each entry, with nothing around them, and a `Table` without `resource` draws the list as a table. A `ReferenceField` draws the one record a field points at. They take the names, props and defaults of the [react-admin](../features/compatibility.md#react-admin) components of the same names.
|
|
@@ -161,7 +161,7 @@ Each entry is a record of the stack while its children draw, so `Field`, `Show`,
|
|
|
161
161
|
## How a page reads its data
|
|
162
162
|
|
|
163
163
|
:::caution[Beta]
|
|
164
|
-
On the web, a `RecordRow` of a view with `listOf` or `searchesOf`,
|
|
164
|
+
On the web, a `RecordRow` of a view with `listOf` or `searchesOf`, or one inside the records of another block, still reads once it draws, as the marked limits below say.
|
|
165
165
|
:::
|
|
166
166
|
|
|
167
167
|
The build compiles each page into a read plan: one ordinary API read per data block, each known before any record is read, so all of them start together when the page opens and none waits for another's rows. There is no combined page query: each read is a request of its own. `/api/meta` sends each user the plan of the page as they see it, so it holds no read of a resource they cannot read and no field they cannot read.
|
|
@@ -179,7 +179,7 @@ Each read in the plan (`page.reads.reads`) names its block by a JSON Pointer int
|
|
|
179
179
|
|
|
180
180
|
A [custom component](custom-components.md#reads) is planned when it declares its reads: the page starts them with the others, each of several a part of its own named by its resource prop (`/children/0#edges`), and the component draws from them. One that declares none is outside the plan (`page.reads.outside`): whatever it reads, it reads by itself once it draws, and `protobase doctor` lists it.
|
|
181
181
|
|
|
182
|
-
<gap>A `RecordRow` of a view with `listOf` or `searchesOf` cannot start its read when the page opens because starting the user's saved records or searches ahead of it is not implemented, so it reads once it draws, under a `Show` or `Match` once its condition holds.</gap> <gap>A `RecordRow` inside the records of another block cannot start its read when the page opens because a planned first page per record is not implemented, so it reads once it draws.</gap> <gap>A `Chart` cannot sit inside a repeated record because grouping a chart per record is not implemented.</gap>
|
|
182
|
+
<gap>A `RecordRow` of a view with `listOf` or `searchesOf` cannot start its read when the page opens because starting the user's saved records or searches ahead of it is not implemented, so it reads once it draws, under a `Show` or `Match` once its condition holds.</gap> <gap>A `RecordRow` inside the records of another block cannot start its read when the page opens because a planned first page per record is not implemented, so it reads once it draws.</gap> <gap>A `Chart` cannot sit inside a repeated record because grouping a chart per record is not implemented.</gap> <gap>A `Table` or `RecordCards` tied by a JSON list of keys cannot show every record all its rows and its total when the lists around it hold more than 500 keys or rows in all because paging such a read is not implemented.</gap>
|
|
183
183
|
|
|
184
184
|
## Field values
|
|
185
185
|
|
|
@@ -312,6 +312,27 @@ Record pages take the same conditions in the `when` of `l.section`, `l.related`
|
|
|
312
312
|
|
|
313
313
|
`icon` is one of `archive`, `arrow-right-left`, `ban`, `bath`, `bed`, `bell`, `bookmark`, `calendar`, `camera`, `copy`, `cpu`, `door-open`, `download`, `external-link`, `file-text`, `hard-drive`, `heart`, `history`, `house`, `key`, `land-plot`, `leaf`, `memory`, `network`, `play`, `plug`, `plus`, `power`, `restart`, `ruler`, `send`, `server`, `stop`, `table`, `tag`, `terminal`, `upload`, `wallet` or `wrench`; another name shows a lightning bolt. With `confirm` the button asks first. Every builder also takes `when`, `otherwise` and `reason`, which limit the action to the records it [applies to](ui-config.md#where-an-action-applies), and `variant: 'danger'`, which draws it in red. The button is disabled, with the reason as its tooltip, when the user may not update or delete the record (or, for an AI action, the field it writes), when an `a.action` has no handler, or when an update, delete or AI action has no record. After an action, everything shown of that resource reloads. The record page's action rail runs the same actions the same way; there an `a.link` is a real link that looks like the rail's buttons, which the browser can preview, copy or open in a new tab, while a disabled one is a disabled button with its reason. <gap>An `<Action>` block for an `a.link` cannot be opened in a new tab or copied as a link because drawing link actions as links is not implemented for the block.</gap>
|
|
314
314
|
|
|
315
|
+
### Actions in a list
|
|
316
|
+
|
|
317
|
+
:::caution[Beta]
|
|
318
|
+
It runs only on the records the list has loaded, up to its `perPage` and any pages read with `pagination="more"`, and its dialog shows no progress, as for [signing several records off](blocks.md#signing-several-records-off).
|
|
319
|
+
:::
|
|
320
|
+
|
|
321
|
+
Where an `Action` sits decides what it runs on. Directly in a `ReferenceManyField` or `ReferenceArrayField`, outside its `RecordsIterator`, it runs on every record of that list; inside the `RecordsIterator`, it runs on the one record of its entry:
|
|
322
|
+
|
|
323
|
+
```tsx
|
|
324
|
+
<ReferenceManyField reference="approvals" target="release_id">
|
|
325
|
+
<Action name="approve" />
|
|
326
|
+
<RecordsIterator>
|
|
327
|
+
<Card title="{{title}}"><Action name="approve" /></Card>
|
|
328
|
+
</RecordsIterator>
|
|
329
|
+
</ReferenceManyField>
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
The list's button counts the records the action applies to, such as **Approve (3)**, and runs as a [selection in a list](blocks.md#signing-several-records-off) does, whether or not the action has `bulk`: it asks its question or inputs once, a checklist shows each box once however many records hold it, and a record the person may not change is refused and named while the others run. It is not offered when the list holds no record the action applies to, and an `a.link` is not offered there. An `Action` with `resource` naming another resource keeps working as outside the list. In the [text form](#text-form), the list's action reads as its label with the count, `Approve (3)`.
|
|
333
|
+
|
|
334
|
+
<gap>An `Action` in a list cannot run on records past the pages the list has loaded because reading the rest of a list for an action is not implemented.</gap>
|
|
335
|
+
|
|
315
336
|
### Links to a record's URL
|
|
316
337
|
|
|
317
338
|
A link whose `href` is a single `{{field}}` opens the address that field holds, such as the page a listing came from:
|