@protobase/cli 0.94.16 → 0.94.18
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 +1 -1
- package/package.json +8 -8
- package/skills/protobase/references/features/composed-pages.md +1 -1
- package/skills/protobase/references/reference/blocks.md +23 -1
- package/skills/protobase/references/reference/layouts.md +1 -1
- package/skills/protobase/references/reference/theme.md +4 -4
- package/skills/protobase/references/reference/ui-config.md +1 -1
package/dist/cli/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/cli",
|
|
3
|
-
"version": "0.94.
|
|
3
|
+
"version": "0.94.18",
|
|
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.94.
|
|
47
|
-
"@protobase/layout": "0.94.
|
|
48
|
-
"@protobase/query": "0.94.
|
|
49
|
-
"@protobase/schema": "0.94.
|
|
50
|
-
"@protobase/server": "0.94.
|
|
51
|
-
"@protobase/ui": "0.94.
|
|
52
|
-
"@protobase/workflows": "0.94.
|
|
46
|
+
"@protobase/config": "0.94.18",
|
|
47
|
+
"@protobase/layout": "0.94.18",
|
|
48
|
+
"@protobase/query": "0.94.18",
|
|
49
|
+
"@protobase/schema": "0.94.18",
|
|
50
|
+
"@protobase/server": "0.94.18",
|
|
51
|
+
"@protobase/ui": "0.94.18",
|
|
52
|
+
"@protobase/workflows": "0.94.18",
|
|
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",
|
|
@@ -14,7 +14,7 @@ Pages of your own, built from blocks in a JSX layout.
|
|
|
14
14
|
- [Tailwind classes](../reference/layouts.md#tailwind-classes) (experimental): Layouts can carry Tailwind classes, on plain elements and on blocks, for pages too custom for blocks.
|
|
15
15
|
- [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.
|
|
16
16
|
- [Data blocks](../reference/blocks.md#data): Counts, tables, single records, rows of cards, field values and progress bars.
|
|
17
|
-
- [Row buttons](../reference/blocks.md#row-buttons): A table's rows carry a button
|
|
17
|
+
- [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.
|
|
18
18
|
- [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.
|
|
19
19
|
- [Record cards](../reference/blocks.md#recordcards): Full-width cards with fields and buttons, stacked or in a carousel.
|
|
20
20
|
- [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.
|
|
@@ -226,7 +226,7 @@ The first records of a list, drawn the way the resource's list page draws them:
|
|
|
226
226
|
| --- | --- |
|
|
227
227
|
| `resource`, `filter`, `sort` | Which records, in which order. `resource` is required; `sort` defaults to the list's. |
|
|
228
228
|
| `columns` | Field names for the table; default the view's list columns. |
|
|
229
|
-
| `button` | A [button on each row](#row-buttons) to an address the row's fields name. |
|
|
229
|
+
| `button` | A [button on each row](#row-buttons) to an address the row's fields name, or to the outside page a field holds; a list of these gives each row the first whose fields it holds. |
|
|
230
230
|
| `limit` | How many records it shows; default 10. It has no pages: the rest are in the list. Before 0.13 this was `pageSize`, rows per page; rename it. |
|
|
231
231
|
| `display` | The display it opens in, such as `cards`; default the list's. |
|
|
232
232
|
| `title`, `description`, `actions` | The heading. |
|
|
@@ -251,8 +251,30 @@ The first records of a list, drawn the way the resource's list page draws them:
|
|
|
251
251
|
/>
|
|
252
252
|
```
|
|
253
253
|
|
|
254
|
+
Each row can decide where its button goes:
|
|
255
|
+
|
|
256
|
+
- **A record's tab from a field**: `tab: '{tab}'` opens the tab the row's `tab` field names; a name the record page has no tab for opens its first tab.
|
|
257
|
+
- **A filtered list**: `{ kind: 'list', resource: 'holds', filter: 'task_id = {task_id} AND state = "{state}"' }` opens the list with a filter built from the row. A text value goes in quotes, escaped so a title with quotes in it stays one value; a value outside quotes must be a number or `true`/`false`, and a row with any other value there shows no button. The filter's fields must be filterable, as in any address.
|
|
258
|
+
- **An outside page**: `{ label: 'Error report', href: '{report_url}' }` opens the page the row's `report_url` field holds, in a new tab without the referrer, and the button carries the outside-link mark, which screen readers hear as "opens in a new tab". The `href` is one field, never a URL put together from parts, and a row whose field holds no `https:` URL shows no button.
|
|
259
|
+
- **A different kind per row**: `button` takes a list of these, and each row shows the first whose fields it holds, so one list can hold items that each need a different act. A row whose first such choice leads nowhere, such as an `href` field without an `https:` URL, shows no button rather than the next choice. A caller who cannot read a choice's fields or follow its address gets the list without it.
|
|
260
|
+
|
|
261
|
+
```tsx
|
|
262
|
+
<Table
|
|
263
|
+
title="Needs attention"
|
|
264
|
+
resource="alerts"
|
|
265
|
+
columns={['summary']}
|
|
266
|
+
button={[
|
|
267
|
+
{ label: 'Open the error report', href: '{report_url}' },
|
|
268
|
+
{ label: '{verb}', to: { kind: 'record', resource: 'tasks', key: '{task_id}', tab: '{tab}' } },
|
|
269
|
+
{ label: 'See its failed jobs', to: { kind: 'list', resource: 'failed_jobs', filter: 'alert_id = {id}' } },
|
|
270
|
+
]}
|
|
271
|
+
/>
|
|
272
|
+
```
|
|
273
|
+
|
|
254
274
|
<gap>A row button cannot show when the table switches to a list display such as cards because drawing it on a display is not implemented.</gap>
|
|
255
275
|
|
|
276
|
+
<gap>A row button cannot show beside its row's first cell on a phone, where the table scrolls sideways to reach it, because a phone layout for table rows is not implemented.</gap>
|
|
277
|
+
|
|
256
278
|
### RecordCard
|
|
257
279
|
|
|
258
280
|
One record and what is inside it: the one `recordKey` names (the key as the record's URL has it), else the first that matches `filter` in `sort` order. Its children and its heading `actions` work on that record.
|
|
@@ -89,7 +89,7 @@ Record pages take the same conditions in the `when` of `l.section`, `l.related`
|
|
|
89
89
|
| --- | --- |
|
|
90
90
|
| `a.update(name, { label, set, confirm?, icon?, bulk?, inputs? })` | Updates the record with `set`, with its ETag; not offered on a record that holds those values already, unless it asks for `inputs`, whose answers it writes where `set` says `'{name}'`. |
|
|
91
91
|
| `a.remove(name, { label, confirm?, icon? })` | Deletes the record (soft delete when the resource has one). |
|
|
92
|
-
| `a.link(name, { label, to, icon? })` | Goes `to` an [address](#addresses) in the app, with `{field}` in its key, filter, order or create values replaced by the record's value, and its resource too when that is only `{field}`: see [links to a resource the record names](#links-to-a-resource-the-record-names). |
|
|
92
|
+
| `a.link(name, { label, to, icon? })` | Goes `to` an [address](#addresses) in the app, with `{field}` in its key, tab, filter, order or create values replaced by the record's value (one in quotes in a filter, `title = "{title}"`, with its quotes escaped, so any text stays one value), and its resource too when that is only `{field}`: see [links to a resource the record names](#links-to-a-resource-the-record-names). |
|
|
93
93
|
| `a.link(name, { label, href, icon? })` | Opens an `href` that leaves the app (`https:`, `mailto:`), with `{field}` replaced by the record's value (percent-encoded); an `https:` or `http:` link opens in a new tab without the referrer. An `href` that is only a field, `'{website}'`, opens the URL the record holds, as it is: see [links to a record's URL](#links-to-a-records-url). A path in the app is refused when the config loads: give it as `to`. |
|
|
94
94
|
| `a.ai(name, { label, prompt, writes, confirm?, icon? })` | Has the model write the field `writes` of the record from `prompt`, `{field}` replaced by the record's values, as the user, on the server; see [AI fields and actions](ai.md#ai-actions). |
|
|
95
95
|
| `a.action(name, { label, confirm?, icon?, bulk?, inputs? })` | Runs the handler the app registers under `name` in [`protobase.ui.tsx`](custom-components.md#action-handlers), after asking for its [`inputs`](ui-config.md#actions-that-ask-for-input) in a dialog when it has some. |
|
|
@@ -115,7 +115,7 @@ What they color:
|
|
|
115
115
|
| `--success`, `--warning`, `--danger`, `--violet` and their groups | Statuses and messages: the color itself, a soft background and readable text on it. |
|
|
116
116
|
| `--chart-1` to `--chart-8` | The series of a chart, in this order: a donut's values, and `--chart-1` for bars and lines. The defaults stay apart for colour-blind readers, so a theme that changes them should keep them as distinct. |
|
|
117
117
|
| `--shadow-pop` | The shadow of menus, popovers and the command palette. |
|
|
118
|
-
| `--backdrop` | The dim behind dialogs, sheets and the
|
|
118
|
+
| `--backdrop` | The dim behind dialogs, sheets and the mobile drawer, and the shade at a table's edge while it scrolls sideways; drawn see-through, so give it a solid color. |
|
|
119
119
|
| `--radius` | The corners: `rounded-md` is `--radius`, `rounded-lg` two pixels more, `rounded-sm` two less and `rounded-xl` six more. |
|
|
120
120
|
| `--font`, `--font-code` | The app's text, and identifiers and code. |
|
|
121
121
|
|
|
@@ -123,11 +123,11 @@ The list is `packages/ui/src/tokens.css`, and a test fails when one of its token
|
|
|
123
123
|
|
|
124
124
|
## Text size
|
|
125
125
|
|
|
126
|
-
The app's text follows the reader's text size: every size is in `rem`, so all of it grows with the root size. In a browser that is the browser's own text size; in the [iOS app](../guides/mobile-app.md) the phone's text size, Dynamic Type included, and in the Android app the phone's font size. The base size is 0.875rem, 14px at a browser's default. A plugin's text follows it too when its sizes are in `rem`, such as Tailwind's `text-xs`, rather than pixels.
|
|
126
|
+
The app's text follows the reader's text size: every size is in `rem`, so all of it grows with the root size, except the mobile top bar's controls described below. In a browser that is the browser's own text size; in the [iOS app](../guides/mobile-app.md) the phone's text size, Dynamic Type included, and in the Android app the phone's font size. The base size is 0.875rem, 14px at a browser's default. A plugin's text follows it too when its sizes are in `rem`, such as Tailwind's `text-xs`, rather than pixels.
|
|
127
127
|
|
|
128
|
-
On a phone the top bar's buttons and icons grow with the text only as far as the screen's width allows, as a native app's bar does, so the menu, back, search and record-menu buttons all fit at the largest accessibility sizes, about three times the default; its text keeps growing and the back button's label shortens with an ellipsis.
|
|
128
|
+
On a phone the top bar's buttons and icons grow with the text only as far as the screen's width allows, as a native app's bar does, so the menu, back, search and record-menu buttons all fit at the largest accessibility sizes, about three times the default; its text keeps growing and the back button's label shortens with an ellipsis. Its search field grows the same way, so it and its focus ring stay inside the bar. These caps and the bar's spacing are in pixels and screen width, since a size in `rem` alone would grow past the screen.
|
|
129
129
|
|
|
130
|
-
<gap>A list chart's Day and Week switch cannot fit a phone's width at the largest accessibility text sizes because a
|
|
130
|
+
<gap>A list chart's Day and Week switch cannot fit a phone's width at the largest accessibility text sizes because a mobile layout for it is not implemented.</gap>
|
|
131
131
|
|
|
132
132
|
## Logo and favicon
|
|
133
133
|
|
|
@@ -975,7 +975,7 @@ Without any configuration, the record page's rail has a **Related records** card
|
|
|
975
975
|
| `actions` | Named actions of `resource`'s view, by name, as buttons on each card; only with `presentation: 'cards'` or `'compact'`. |
|
|
976
976
|
| `time` | A date or timestamp field of `resource` each compact card shows beside its title, as its view formats it; only with `presentation: 'compact'`. |
|
|
977
977
|
| `tone` | An enum field of `resource` whose value colours each card's left edge, by its view's [`valueColors`](#value-tones-and-currencies); only with `presentation: 'cards'` or `'compact'`. |
|
|
978
|
-
| `button` | `{ label, to }
|
|
978
|
+
| `button` | `{ label, to }` or `{ label, href }`, or a list of them of which each row shows the first whose fields it holds: a [button on each row](blocks.md#row-buttons), or each card, to an address the row's fields name, its tab or list filter too, or to the outside page a field holds, such as `{ label: '{verb}', to: { kind: 'record', resource: 'tasks', key: '{task_id}', tab: 'Review' } }`; a row without a value for a field it names shows none. Not with `lines`. |
|
|
979
979
|
| `open` | The relation of `resource` whose record a row opens, for rows that link this record to another. By default the one relation in `resource`'s primary key besides `field`, when there is exactly one (a join resource such as `task_dependencies` keyed on `[task_id, type, depends_on_id]`); otherwise rows open their own records. The row's menu then has **Open** for the other record and **Edit** for the link itself. |
|
|
980
980
|
| `limit` | How many records it shows, 1 to 100; default 10. Not with `presentation: 'record'`. When there are more, the section says so beside View all, such as "The first 10 of 37.". Before 0.13 this was `pageSize`, rows per page; rename it. |
|
|
981
981
|
| `display` | The display of `resource`'s list it opens in, and View all opens, such as `cards`; default the list's. Not with `presentation: 'record'`. |
|