@protobase/cli 0.33.0 → 0.33.1
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
|
@@ -4,6 +4,7 @@ import { walkTree } from "@protobase/layout";
|
|
|
4
4
|
//#region src/doctor/page-shapes.ts
|
|
5
5
|
const listing = [
|
|
6
6
|
"RecordRow",
|
|
7
|
+
"RecordCards",
|
|
7
8
|
"Table",
|
|
8
9
|
"CardRow",
|
|
9
10
|
"RecordCard",
|
|
@@ -13,7 +14,7 @@ const text = (value) => typeof value === "string" ? value : void 0;
|
|
|
13
14
|
const blockSort = (node, model, view) => {
|
|
14
15
|
const given = configSort(model, text(node.props.sort));
|
|
15
16
|
if (given) return given;
|
|
16
|
-
return node.type === "RecordRow" ? listSort(model, view) : void 0;
|
|
17
|
+
return node.type === "RecordRow" || node.type === "RecordCards" ? listSort(model, view) : void 0;
|
|
17
18
|
};
|
|
18
19
|
const title = (node) => text(node.props.title) ?? text(node.props.label);
|
|
19
20
|
const chartShapes = (page, node, model) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/cli",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.1",
|
|
4
4
|
"description": "The protobase command: scaffold, doctor, dev, build and serve a Protobase project.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"@better-auth/core": "^1.7.7",
|
|
37
37
|
"@hono/node-server": "^2.1.3",
|
|
38
38
|
"@hono/vite-dev-server": "^0.26.1",
|
|
39
|
-
"@protobase/layout": "0.33.
|
|
40
|
-
"@protobase/query": "0.33.
|
|
41
|
-
"@protobase/schema": "0.33.
|
|
42
|
-
"@protobase/server": "0.33.
|
|
43
|
-
"@protobase/ui": "0.33.
|
|
39
|
+
"@protobase/layout": "0.33.1",
|
|
40
|
+
"@protobase/query": "0.33.1",
|
|
41
|
+
"@protobase/schema": "0.33.1",
|
|
42
|
+
"@protobase/server": "0.33.1",
|
|
43
|
+
"@protobase/ui": "0.33.1",
|
|
44
44
|
"@react-email/render": "^2.1.0",
|
|
45
45
|
"@scalar/hono-api-reference": "^0.12.10",
|
|
46
46
|
"@tailwindcss/vite": "^4.3.3",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Every built-in layout block, its props and what it does, with examples from the ERP's sales overview.
|
|
6
6
|
|
|
7
|
-
Blocks are imported from `@protobase/layout`. "Record" below means the record of the `RecordCard` or `CardRow` card around a block (see [Data](layouts.md#data))); `filter` is AIP-160 and `sort` AIP-132, as in the list API. Every block below but `RecordRow`, which the property portal's home uses, and `Users`, which the [Users page](auth.md#users-page)) uses, appears in the ERP example's sales overview:
|
|
7
|
+
Blocks are imported from `@protobase/layout`. "Record" below means the record of the `RecordCard` or `CardRow` card around a block (see [Data](layouts.md#data))); `filter` is AIP-160 and `sort` AIP-132, as in the list API. Every block below but `RecordRow`, which the property portal's home uses, `RecordCards`, and `Users`, which the [Users page](auth.md#users-page)) uses, appears in the ERP example's sales overview:
|
|
8
8
|
|
|
9
9
|
```tsx title="examples/erp/config/overview/page.tsx"
|
|
10
10
|
/** @jsxImportSource @protobase/layout */
|
|
@@ -234,6 +234,25 @@ It follows the resource's view as its list page does. Of a resource whose view h
|
|
|
234
234
|
<RecordRow title="For rent" resource="listings" filter="for_rent = true AND status = 'available'" sort="published_at desc" />
|
|
235
235
|
```
|
|
236
236
|
|
|
237
|
+
### RecordCards
|
|
238
|
+
|
|
239
|
+
What a filter finds as the cards of a record page's [related records as cards](ui-config.md#related-records-as-cards)), stacked full width under a heading that has no card around it, so the page shows no card inside another: each record's title linking to its page, its `fields` under their labels, a value taller than a few lines cut short with **Show more**, and a button for each of `cardActions`, run as on the record page. Below the cards, **View all** opens the list with the same filter and order, beside a note such as "The first 10 of 37." when there are more.
|
|
240
|
+
|
|
241
|
+
| Prop | |
|
|
242
|
+
| --- | --- |
|
|
243
|
+
| `resource`, `filter`, `sort` | Which records, in which order. `resource` is required; `sort` defaults to the list's. |
|
|
244
|
+
| `fields` | The fields each card shows, through relations too (`task_id.title`); default the list's columns. |
|
|
245
|
+
| `cardActions` | Named actions of the resource's view, as buttons on each card. |
|
|
246
|
+
| `limit` | How many; default 10. |
|
|
247
|
+
| `display` | The list display **View all** opens; default the list's. |
|
|
248
|
+
| `title`, `description`, `actions` | The heading. |
|
|
249
|
+
| `empty` | Text when nothing matches. |
|
|
250
|
+
| `span` | Width in a grid. |
|
|
251
|
+
|
|
252
|
+
```tsx
|
|
253
|
+
<RecordCards title="Waiting on you" resource="task_preconditions" filter="state = 'waiting'" fields={['task_id', 'plan']} cardActions={['approve', 'request_changes']} />
|
|
254
|
+
```
|
|
255
|
+
|
|
237
256
|
### Field
|
|
238
257
|
|
|
239
258
|
A label over a value of the record, formatted as on the record page: statuses as badges with the view's value labels, relations as the related record's name (linked), the view's prefix and decimals.
|
|
@@ -56,7 +56,7 @@ Behaviour comes from [named actions](#named-actions); React code from [custom co
|
|
|
56
56
|
|
|
57
57
|
## Data
|
|
58
58
|
|
|
59
|
-
`Stat`, `RecordCard`, `Table`, `CardRow` and `
|
|
59
|
+
`Stat`, `RecordCard`, `Table`, `CardRow`, `RecordRow` and `RecordCards` 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.
|
|
60
60
|
|
|
61
61
|
A `RecordCard` (its first match) and each card of a `CardRow` 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.
|
|
62
62
|
|