@protobase/cli 0.99.6 → 0.99.7
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.99.
|
|
3
|
+
"version": "0.99.7",
|
|
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.99.
|
|
47
|
-
"@protobase/layout": "0.99.
|
|
48
|
-
"@protobase/query": "0.99.
|
|
49
|
-
"@protobase/schema": "0.99.
|
|
50
|
-
"@protobase/server": "0.99.
|
|
51
|
-
"@protobase/ui": "0.99.
|
|
52
|
-
"@protobase/workflows": "0.99.
|
|
46
|
+
"@protobase/config": "0.99.7",
|
|
47
|
+
"@protobase/layout": "0.99.7",
|
|
48
|
+
"@protobase/query": "0.99.7",
|
|
49
|
+
"@protobase/schema": "0.99.7",
|
|
50
|
+
"@protobase/server": "0.99.7",
|
|
51
|
+
"@protobase/ui": "0.99.7",
|
|
52
|
+
"@protobase/workflows": "0.99.7",
|
|
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",
|
|
@@ -24,6 +24,7 @@ Pages of your own, built from blocks in a JSX layout.
|
|
|
24
24
|
- [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, or an outside https link a field holds. On mobile width the button sits under the row's first cell.
|
|
25
25
|
- [Record rows](../reference/blocks.md#recordrow): A sideways row of cards for a filter, favorites or saved searches, with a count and new-record marks.
|
|
26
26
|
- [Record cards](../reference/blocks.md#recordcards): Full-width cards with fields and buttons, stacked or in a carousel.
|
|
27
|
+
- [Diff block](../reference/blocks.md#diff) (beta): A `Diff` block shows a unified patch the record holds, side by side on wide screens and in one column on a phone; it shows stored patches and does not compute them.
|
|
27
28
|
- [Image block](../reference/blocks.md#image): A picture one of the app's API functions draws for the reader, such as a system map, at the size and theme the client asks, refreshed on a timer; a client that draws no images shows its alt text, or nothing.
|
|
28
29
|
- [Chart block](../reference/blocks.md#chart): Counts, sums or averages by value or by date, as bars, lines or a donut, and over time split by a second field.
|
|
29
30
|
- [Conversations](../reference/blocks.md#conversation): A chat declared in the layout: a thread of a resource's messages under each sender's name and time, following new ones as they arrive, and a box that sends one as the signed-in user.
|
|
@@ -441,6 +441,29 @@ A bar for `value` out of `max`, with both numbers. It turns amber from 90%.
|
|
|
441
441
|
<Progress label="Seats" value="seats_used" max="plan.seats" />
|
|
442
442
|
```
|
|
443
443
|
|
|
444
|
+
### Diff
|
|
445
|
+
|
|
446
|
+
:::caution[Beta]
|
|
447
|
+
`Diff` may still change.
|
|
448
|
+
:::
|
|
449
|
+
|
|
450
|
+
A unified patch the record holds in a text field, as `diff -u` and `git diff` write it: each file under its name with the counts of added and removed lines, then its changes, numbered by the patch's `@@` lines. From the `md` breakpoint (768px) up, the old lines stand on the left and the new ones beside them; below it, both run in one column. Text that is not a unified patch shows as it is, in a code font, and text before the first file, such as a mailed patch's message, is left out.
|
|
451
|
+
|
|
452
|
+
| Prop | |
|
|
453
|
+
| --- | --- |
|
|
454
|
+
| `source` | The text field holding the patch, a [path](layouts.md#paths-and-scopes) as a [field component](#field-components)'s `source` is. Required. |
|
|
455
|
+
| `emptyText` | Shown when the field is empty; nothing is shown without it. |
|
|
456
|
+
|
|
457
|
+
```tsx
|
|
458
|
+
<RecordCard resource="changes" recordKey="42" title="Proposed change">
|
|
459
|
+
<Diff source="patch" emptyText="No changes yet" />
|
|
460
|
+
</RecordCard>
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
In the [text form](layouts.md#text-form) it reads as the patch in a fenced `diff` code block, its fence longer than any run of backticks the patch holds, so a patch of a Markdown file cannot end it early.
|
|
464
|
+
|
|
465
|
+
<gap>A Diff block cannot compare two versions of a field because computing a diff is not implemented; it shows a patch the record already holds.</gap>
|
|
466
|
+
|
|
444
467
|
### Image
|
|
445
468
|
|
|
446
469
|
A fixed picture at `src`, or one an [API function](../guides/api-functions.md) draws.
|
|
@@ -71,7 +71,7 @@ renderText(<Page title="Order"><Field source="status" /></Page>, {
|
|
|
71
71
|
|
|
72
72
|
| Option | |
|
|
73
73
|
| --- | --- |
|
|
74
|
-
| `record` | The record around the tree. `Field`, the [field components](#field-values), `Stat field`, `Progress`, `Show` conditions and the `{{field}}`s of addresses read it, through relations as nested objects (`plan.name`); a count a condition names, such as `billing_profiles.count`, is a key of its own. The `{{path}}`s of props read it too. Without it, a field reads as its label alone, a condition as holding (a `Show` reads as its children, a `Switch` as its first `Match`), a prop's `{{path}}`s as empty, and addresses keep their `{{field}}`s. |
|
|
74
|
+
| `record` | The record around the tree. `Field`, the [field components](#field-values), `Diff`, `Stat field`, `Progress`, `Show` conditions and the `{{field}}`s of addresses read it, through relations as nested objects (`plan.name`); a count a condition names, such as `billing_profiles.count`, is a key of its own. The `{{path}}`s of props read it too. Without it, a field reads as its label alone, a condition as holding (a `Show` reads as its children, a `Switch` as its first `Match`), a prop's `{{path}}`s as empty, and addresses keep their `{{field}}`s. |
|
|
75
75
|
| `fields` | Per field path, its `label` and the `valueLabels` its enum values read as; a field without a label reads under its path. |
|
|
76
76
|
| `records` | Per `ReferenceManyField`, `ReferenceArrayField` or `ReferenceField` element and the record around it, the records it holds, which you loaded; its `RecordsIterator` then reads as its children once per record, in that record, and an empty list as its `empty`. Without it, the block reads as a link to its records. An `ArrayField` reads its items from the record around it. For a `RecordCard`, its record, which its children read; for a `CardRow`, its records, its children once per record. For a `Table` with `select`, the row chosen, whose record its children read; without it they read as nothing. It gets the element, the record around it and the element's place in the tree, the pointer the [read plan](#how-a-page-reads-its-data) names its block by. |
|
|
77
77
|
| `params` | The [page parameters](#page-parameters) the page's address holds, such as `{ window: '30d' }`, which `@params` and the `SelectInput`s read, each held to its choices. |
|
|
@@ -126,7 +126,7 @@ Behaviour comes from [named actions](#named-actions); React code from [custom co
|
|
|
126
126
|
|
|
127
127
|
`Stat`, `RecordCard`, `Table`, `CardRow`, `RecordRow`, `RecordCards` and `Thread` read records of a `resource`. `filter` is AIP-160 and `sort` AIP-132, exactly as the list API's `filter` and `order_by`, so a filter that works in the list's URL works here. `Thread` takes no `sort`: it orders its messages by its `time` field, newest first. `ReferenceManyField`, `ReferenceArrayField` and `ReferenceField` read records of their `reference` that the record around them points to or is pointed at by: see [related records](#related-records).
|
|
128
128
|
|
|
129
|
-
A `RecordCard` (its first match), a `ReferenceField`, each card of a `CardRow` and each entry of a `RecordsIterator` hold a **record**. Inside one, `Field`, `Progress`, `Stat field`, `Show`, `Action` and `ModalForm mode="edit"` work on that record, and a `RecordCard`'s header `actions` do too. A field name may follow relations: `company_id.city` is the city of the record's company, fetched like the record page fetches it and cached.
|
|
129
|
+
A `RecordCard` (its first match), a `ReferenceField`, each card of a `CardRow` and each entry of a `RecordsIterator` hold a **record**. Inside one, `Field`, `Diff`, `Progress`, `Stat field`, `Show`, `Action` and `ModalForm mode="edit"` work on that record, and a `RecordCard`'s header `actions` do too. A field name may follow relations: `company_id.city` is the city of the record's company, fetched like the record page fetches it and cached.
|
|
130
130
|
|
|
131
131
|
## Related records
|
|
132
132
|
|
|
@@ -238,7 +238,7 @@ A `RecordCard`, a `ReferenceField`, each card of a `CardRow` and each entry of a
|
|
|
238
238
|
| `@root.id` | The page's own record. <gap>A path cannot read `@root` because pages with a record of their own are not implemented.</gap> |
|
|
239
239
|
| `@params.window` | The [page parameter](#page-parameters) `window`, which a `SelectInput source="window"` on the page sets. |
|
|
240
240
|
|
|
241
|
-
`Field source`, a field component's `source`, `Stat field`, `Progress`, and the names in a [condition](#conditions) take a path. A string prop takes `{{path}}` placeholders in double braces, filled with the path's value where the element draws, and empty when it has none:
|
|
241
|
+
`Field source`, a field component's `source`, `Diff source`, `Stat field`, `Progress`, and the names in a [condition](#conditions) take a path. A string prop takes `{{path}}` placeholders in double braces, filled with the path's value where the element draws, and empty when it has none:
|
|
242
242
|
|
|
243
243
|
- `title`, `description`, `empty`, `label`, and a field component's `emptyText`, `content`, `valueLabelTrue` and `valueLabelFalse` read any path: `<Table resource="claim_steps" title="Steps of {{title}}" />`.
|
|
244
244
|
- `filter`, `recordKey` and `values` read a field of a record around them. A filter takes one only as a top-level `AND` equality, `claim_id = {{id}} AND done = false`, the shape a read can take for every row at once with a [`related()`](api.md#filtering-through-related-records) filter. A filter takes a page parameter anywhere.
|
|
@@ -378,7 +378,7 @@ Every block reads the regular API with the user's token, so the access rules app
|
|
|
378
378
|
|
|
379
379
|
- a page whose `roles` leave the user out is not sent;
|
|
380
380
|
- an element whose resource they cannot see, or whose filter or sort names a field they cannot read, is left out with everything inside it, and so is a `Tab` left with nothing in it;
|
|
381
|
-
- `Field`, `Progress` and `Stat field` on a field they cannot read are left out, and table columns are narrowed;
|
|
381
|
+
- `Field`, `Diff`, `Progress` and `Stat field` on a field they cannot read are left out, and table columns are narrowed;
|
|
382
382
|
- `ModalForm` needs create or update permission and keeps only the fields they may write;
|
|
383
383
|
- an `Action` missing from their view of the resource is left out, and so is a `Show` that names something they cannot see.
|
|
384
384
|
- an `Image` whose function they may not call is left out; a fixed one (`src`) is kept.
|