@protobase/cli 0.94.15 → 0.94.17
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
|
@@ -121,7 +121,7 @@ const recordChartShapes = (item, owner, models) => {
|
|
|
121
121
|
return [{
|
|
122
122
|
resource: target.name,
|
|
123
123
|
request: `GET /${target.name}:aggregate?group_by=${item.at}&filter=${field.name} = …`,
|
|
124
|
-
from:
|
|
124
|
+
from: `${item.kind} "${item.title}" on the ${owner} record page`,
|
|
125
125
|
query: {
|
|
126
126
|
filter: compare(field),
|
|
127
127
|
groupBy: item.at
|
|
@@ -286,7 +286,7 @@ const viewShapes = (view, models) => {
|
|
|
286
286
|
return [
|
|
287
287
|
...listShapes(model, view, list, models),
|
|
288
288
|
...(view.lists ?? []).flatMap((named) => listShapes(model, viewOfList(view, named.name), `${list} "${named.name}"`, models)),
|
|
289
|
-
...layoutItems(view.layout).flatMap((item) => item.kind === "related" ? relatedShapes(item, model.name, models) : item.kind === "gallery" ? galleryShapes(item, model.name, models) : item.kind === "chart" ? recordChartShapes(item, model.name, models) : item.kind === "thread" ? threadShapes(item, model.name, models) : []),
|
|
289
|
+
...layoutItems(view.layout).flatMap((item) => item.kind === "related" ? relatedShapes(item, model.name, models) : item.kind === "gallery" ? galleryShapes(item, model.name, models) : item.kind === "chart" || item.kind === "trend" ? recordChartShapes(item, model.name, models) : item.kind === "thread" ? threadShapes(item, model.name, models) : []),
|
|
290
290
|
...recentShapes(model, view),
|
|
291
291
|
...searchesShapes(view, models),
|
|
292
292
|
...handOrderShapes(model, view, list, models)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/cli",
|
|
3
|
-
"version": "0.94.
|
|
3
|
+
"version": "0.94.17",
|
|
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.17",
|
|
47
|
+
"@protobase/layout": "0.94.17",
|
|
48
|
+
"@protobase/query": "0.94.17",
|
|
49
|
+
"@protobase/schema": "0.94.17",
|
|
50
|
+
"@protobase/server": "0.94.17",
|
|
51
|
+
"@protobase/ui": "0.94.17",
|
|
52
|
+
"@protobase/workflows": "0.94.17",
|
|
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",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
The page of one record, with its sections, related records, galleries, charts and editing.
|
|
6
6
|
|
|
7
|
-
- [Record page layout](../reference/ui-config.md#the-record-page): Sections, a summary sidebar, related tables, maps, charts, galleries, history, comments, conversations and your own components.
|
|
7
|
+
- [Record page layout](../reference/ui-config.md#the-record-page): Sections, a summary sidebar, related tables, maps, charts, trends, galleries, history, comments, conversations and your own components.
|
|
8
8
|
- [Full-width record pages](../reference/ui-config.md#page-width): A view's record pages and create form fill the whole area beside the sidebar instead of a centred column, with the sidebar cards still beside the sections.
|
|
9
9
|
- [Focus pages](../reference/ui-config.md#focus-pages) (beta): A record whose page is one big surface, such as a graph or a board, fills the page under a thin bar with its Save, actions and panels, its form a link away.
|
|
10
10
|
- [A create address that opens a page](../reference/ui-config.md#focus-pages) (beta): `.createOpens(to)` sends a resource's create address to a page in place of its form, such as a record's focus page with a panel open, filled from the address's values.
|
|
@@ -34,5 +34,6 @@ The page of one record, with its sections, related records, galleries, charts an
|
|
|
34
34
|
- [Custom section fallbacks](../reference/custom-components.md#record-section-fallbacks) (experimental): Where your own component on a record page cannot be drawn, such as on a watch, what you declare shows in its place: any main-column item in the main column, conversations included, and sidebar maps and sidebar custom components in the sidebar.
|
|
35
35
|
- [Conversations](../reference/ui-config.md#conversations): A record page holds a chat about the record, such as a task's, with its messages in markdown and a box that sends one, declared in its layout with no component of the app's own.
|
|
36
36
|
- [Charts of samples](../reference/ui-config.md#charts-of-related-records): A record page graphs numeric samples over the last hour, day or week, such as a server's CPU use.
|
|
37
|
+
- [Trends of related records](../reference/ui-config.md#trends-of-related-records) (experimental): Record pages can chart their related records over time.
|
|
37
38
|
- [Fresh data on return](../reference/ui-config.md#the-record-page): Records and lists reload when the browser tab is focused again, keeping unsaved edits.
|
|
38
39
|
- [Safe deletes](../reference/ui-config.md#deleting-a-record): Deleting asks first, or offers Undo for a soft delete, offers a review when the record changed since it was opened, and names the records that still point at it.
|
|
@@ -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
|
|
|
@@ -766,7 +766,7 @@ The open groups are in the address, as `?open=<title>` once per group, so a link
|
|
|
766
766
|
|
|
767
767
|
### Tabs
|
|
768
768
|
|
|
769
|
-
`l.tab(title, items)` splits the record page into tabs. A tab holds any main-column item: sections, groups, related tables, custom components, maps, charts, galleries, history and comments. It refuses a sidebar item, another tab, and a custom component or map with `sidebar: true`, since the sidebar stays beside the tabs on every tab.
|
|
769
|
+
`l.tab(title, items)` splits the record page into tabs. A tab holds any main-column item: sections, groups, related tables, custom components, maps, charts, trends, galleries, history and comments. It refuses a sidebar item, another tab, and a custom component or map with `sidebar: true`, since the sidebar stays beside the tabs on every tab.
|
|
770
770
|
|
|
771
771
|
A view's tabs stand together in the layout and show as one strip; items before them show above the strip and items after them below it, on every tab. Tab titles are unique among a view's tabs, and group titles are unique across the whole layout, groups inside tabs too. The read view and the form show the same tabs.
|
|
772
772
|
|
|
@@ -1127,6 +1127,33 @@ view<typeof hosts>('hosts').layout((r) => [
|
|
|
1127
1127
|
|
|
1128
1128
|
Each series is read through [`:aggregate`](api.md), grouped by `at` with `field = <this record's key>` as its filter, so the user's access applies as on the list, and a user who cannot read `field`, `at` or any series gets no chart (one who cannot read some series gets the others). That filter and grouping need an index on `(field, at)`, such as `create index on host_samples (host_id, sampled_at)`, which [`protobase doctor`](cli.md#doctor) checks. A `field` that is no relation to this resource, an `at` that is no timestamp or not filterable, or a series that is no number or is sensitive stops the server at startup. Keeping the samples, and removing old ones, is the app's own work.
|
|
1129
1129
|
|
|
1130
|
+
### Trends of related records
|
|
1131
|
+
|
|
1132
|
+
:::caution[Experimental]
|
|
1133
|
+
<gap>A reader cannot switch a trend's range or bar length, or open the records a bar counts, because neither is implemented.</gap>
|
|
1134
|
+
:::
|
|
1135
|
+
|
|
1136
|
+
`l.trend(title, options)` draws bars of how many records point at the record on the page, per day, week or month of a date of theirs, as a list's [chart](#filters-and-the-chart) counts them, such as an objective's shipped tasks per week over the last 90 days. It takes the options of a list's chart, `range` and `granularity`, and counts only this record's records. Records without a value in `at`, such as tasks not shipped yet, are not counted. A line over the bars gives their total over the range, such as **4 in the last 90 days**, or **None in the last 90 days** over flat bars, and a chart that could not load offers **Try again**. Name what `at` means in the title or the help, such as "Shipped per week".
|
|
1137
|
+
|
|
1138
|
+
| Option | |
|
|
1139
|
+
| --- | --- |
|
|
1140
|
+
| `resource` | The records counted, such as `tasks`. Required. |
|
|
1141
|
+
| `field` | The filterable relation on `resource` that holds this record's key. Required. |
|
|
1142
|
+
| `at` | The filterable date or timestamp field of `resource` the records are counted by. Required. |
|
|
1143
|
+
| `range` | How far back it reaches: `7d`, `30d`, `90d`, `1y` or `all`. Required. |
|
|
1144
|
+
| `granularity` | How long each bar is: `hour`, `day`, `week` (from Monday) or `month`. Required. |
|
|
1145
|
+
| `help`, `when` | A line under the title, and whether it shows on the form, the read view or both. |
|
|
1146
|
+
|
|
1147
|
+
```ts
|
|
1148
|
+
view<typeof objectives>('objectives').layout((r) => [
|
|
1149
|
+
l.section('Objective', [r.name]),
|
|
1150
|
+
l.trend('Shipped per week', { resource: 'tasks', field: 'objective_id', at: 'shipped_at', range: '90d', granularity: 'week' }),
|
|
1151
|
+
l.related('Tasks', { resource: 'tasks', field: 'objective_id' }),
|
|
1152
|
+
])
|
|
1153
|
+
```
|
|
1154
|
+
|
|
1155
|
+
The counts are read through [`:aggregate`](api.md), grouped by `at` with `field = <this record's key>` as its filter, so the user's access applies as on the list, and a user who cannot read `field` or `at` gets no trend. They are read again when the user adds, changes or deletes such a record, and, for a [live](live.md) resource, when anyone does. An index on `(field, at)`, such as `create index on tasks (objective_id, shipped_at)`, keeps it fast, which [`protobase doctor`](cli.md#doctor) checks. A `field` that is no relation to this resource, or an `at` that is no date or timestamp or is not filterable, stops the server at startup.
|
|
1156
|
+
|
|
1130
1157
|
### Conversations
|
|
1131
1158
|
|
|
1132
1159
|
`l.thread(title, options)` shows the messages that point at the record on the page, as a task's chat between the people working on it, and `l.composer(options)` below it writes one. They are the record page's form of the [Thread and Composer blocks](blocks.md#conversation) of composed pages, scoped to the record by a relation of the messages: the thread reads only the messages whose `field` holds this record's key, and each message the composer sends gets that key in `field`. [`/meta`](api.md#meta-and-openapi-per-caller) describes both as data, so every client can draw the conversation with no component of the app's own.
|