@protobase/cli 0.99.14 → 0.99.15
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 +2 -1
- package/skills/protobase/references/features/your-own-code.md +1 -0
- package/skills/protobase/references/reference/custom-components.md +35 -2
- package/skills/protobase/references/reference/layouts.md +4 -2
- package/skills/protobase/references/reference/plugins.md +69 -2
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.15",
|
|
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.15",
|
|
47
|
+
"@protobase/layout": "0.99.15",
|
|
48
|
+
"@protobase/query": "0.99.15",
|
|
49
|
+
"@protobase/schema": "0.99.15",
|
|
50
|
+
"@protobase/server": "0.99.15",
|
|
51
|
+
"@protobase/ui": "0.99.15",
|
|
52
|
+
"@protobase/workflows": "0.99.15",
|
|
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,7 +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
|
-
- [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, counts
|
|
22
|
+
- [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, counts, related lists and the custom components that declare their reads starts at once when it opens, and a data block's [text form](../reference/layouts.md#a-pages-text-with-its-records) lists its records; tables, threads, charts and custom components that fetch their own data still load on their own.
|
|
23
23
|
- [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
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, 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.
|
|
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.
|
|
@@ -28,6 +28,7 @@ Pages of your own, built from blocks in a JSX layout.
|
|
|
28
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.
|
|
29
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.
|
|
30
30
|
- [Timeline block](../reference/blocks.md#timeline) (beta): A `Timeline` block draws records as bars in lanes over time, each bar's parts coloured by a status field and its waits striped, with the chosen bar's details under it.
|
|
31
|
+
- [Graph plugin](../reference/plugins.md#graph) (beta): The graph plugin draws records as nodes and the records that link them as edges, grouped by a field and coloured by status, with the chosen node's details beside it.
|
|
31
32
|
- [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.
|
|
32
33
|
- [Tool calls in threads](../reference/blocks.md#tool-calls): Conversation threads show tool calls in time order, with a status and an expandable input and result.
|
|
33
34
|
- [Buttons and forms](../reference/blocks.md#behaviour): Buttons for named actions, and create or edit forms in a dialog.
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
React components, field types, pages and handlers of your own, loaded as plugins.
|
|
6
6
|
|
|
7
7
|
- [Custom components](../reference/custom-components.md#components): Your own React components used by name in layouts, reading data under the user's access.
|
|
8
|
+
- [Component reads](../reference/custom-components.md#reads) (beta): A custom component declares which of its props name what it reads, one resource or several, and the page reads them with the rest as it opens, so the component only draws, its children in the record its `select` chose.
|
|
8
9
|
- [Custom list displays](../reference/custom-components.md#list-displays): Draw a list with your own component while the list page keeps loading, filters, search and paging.
|
|
9
10
|
- [Custom record sections](../reference/custom-components.md#record-sections): Your own component on a record page, beside its sections, with sections to show instead where it cannot be drawn.
|
|
10
11
|
- [Custom record cards](../reference/custom-components.md#record-cards): Draw each card with your own component, with the built-in card as the fallback.
|
|
@@ -92,7 +92,11 @@ The admin app draws the fallback too when the component is missing or throws whi
|
|
|
92
92
|
|
|
93
93
|
### Reads
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
:::caution[Beta]
|
|
96
|
+
Several reads and `select` may still change. On a record page, which has no read plan, a component's reads are made where it draws instead of as the page opens.
|
|
97
|
+
:::
|
|
98
|
+
|
|
99
|
+
A component that reads records says which of its props name what it reads, so its read is in the page's [read plan](layouts.md#how-a-page-reads-its-data) with the other blocks', starts with them as the page opens, and `protobase doctor` checks its indexes. The component then only draws: `useComponentReads()` from `@protobase/ui` gives it what each read holds, and it fetches nothing itself.
|
|
96
100
|
|
|
97
101
|
```tsx
|
|
98
102
|
export const TaskBoard = component<{ resource: string; filter?: string; limit?: number }>('TaskBoard', {
|
|
@@ -100,7 +104,36 @@ export const TaskBoard = component<{ resource: string; filter?: string; limit?:
|
|
|
100
104
|
})
|
|
101
105
|
```
|
|
102
106
|
|
|
103
|
-
|
|
107
|
+
```tsx
|
|
108
|
+
// protobase.ui.tsx
|
|
109
|
+
import { useComponentReads } from '@protobase/ui'
|
|
110
|
+
|
|
111
|
+
export const TaskBoard = () => {
|
|
112
|
+
const { resource } = useComponentReads()
|
|
113
|
+
if (!resource || resource.isPending) return null
|
|
114
|
+
return <ul>{resource.rows.map((row) => <li key={String(row.id)}>{String(row.title)}</li>)}</ul>
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
`reads` takes `resource`, the one prop it needs, and `filter`, `sort`, `fields` and `limit`. `fields` is a prop holding a list of field names, or a list of props, each holding one field name or a list of them; the read asks for those fields and the key, and every field without `fields`. Without a `limit`, a read holds as many records as one read of the API does, 500. A list declares several reads, each named by the prop of its resource, which may not be `calls`, `chosen` or `condition`:
|
|
119
|
+
|
|
120
|
+
```tsx
|
|
121
|
+
export const Board = component<{ cards: string; lanes: string; title: string; lane: string; select?: string }>('Board', {
|
|
122
|
+
reads: [
|
|
123
|
+
{ resource: 'cards', fields: ['title', 'lane'], select: 'select' },
|
|
124
|
+
{ resource: 'lanes' },
|
|
125
|
+
],
|
|
126
|
+
})
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
The build checks that each of those props names a resource and each field prop a field of it, and refuses a `{{path}}` in any of them, or in `sort` or `limit`: a read's shape is fixed in the layout, and only its `filter` takes values from the records around it. `select`, in one read at most, is the prop naming the [page parameter](layouts.md#page-parameters) that holds the key of the record chosen among that read's records, as a `Table`'s `select` does: the element's children draw inside that record, and nothing while none is chosen.
|
|
130
|
+
|
|
131
|
+
| From `@protobase/ui` | |
|
|
132
|
+
| --- | --- |
|
|
133
|
+
| `useComponentReads()` | Each read the component declares, by the prop of its resource (`resource`, `cards`): `{ model, view, rows, isPending, error }`. A read comes from the page's plan; where the page plans none, such as in a record view, it is read here, its filter's `{{path}}`s filled from the records around it. |
|
|
134
|
+
| `useComponentSelect()` | `{ chosen, linkTo }` for the component's `select`: the chosen record's key as the address holds it, and `linkTo(key)`, the page with another chosen, for a `RouteLink`; `undefined` without `select` or outside a composed page. |
|
|
135
|
+
|
|
136
|
+
A component without `reads` is outside the plan, which lists it as such (`page.reads.outside`), and doctor does not check its reads.
|
|
104
137
|
|
|
105
138
|
### Fields and resources in props
|
|
106
139
|
|
|
@@ -79,6 +79,8 @@ renderText(<Page title="Order"><Field source="status" /></Page>, {
|
|
|
79
79
|
| `locale` | The reader's locale, such as `nl-NL`, in which [field components](#field-values) without `locales` format numbers and dates; the runtime's default when omitted. |
|
|
80
80
|
| `basePath` | What links start with, such as `https://example.com/admin`. |
|
|
81
81
|
| `forms` | Text forms by block type, over the built-in ones. |
|
|
82
|
+
| `models`, `labels` | The app's resources by name, and per resource its fields' labels and value labels, which a custom component's text form reads its records with, such as the graph plugin's [`graphText`](plugins.md#graph). |
|
|
83
|
+
| `planned` | Per read of the page's plan, by its block's place in the tree with `#<part>` for a block's other reads (`/children/0#edges`), and the record around it, the records it holds; `pageText` gives it, so a custom component's text form reads its own reads' records. |
|
|
82
84
|
|
|
83
85
|
A heading reads at its level: a `Page` title as `#`, a `Tab` label as `##`, and the title of a `Card` and of a data block as `###`, the data block's linked to its records' list as it filters them. A field's value reads as its enum label, a list as its items, and JSON as a code block. A table's records read as a Markdown table: a header row of labels, a separator row and a row per record, its columns most important first by the same rule a [phone](blocks.md#columns-on-a-phone) uses, each cell on one line with its pipes escaped. `tableMarkdown` gives the same table for records you hold yourself.
|
|
84
86
|
|
|
@@ -109,7 +111,7 @@ const text = await pageText(page.tree, page.reads, {
|
|
|
109
111
|
})
|
|
110
112
|
```
|
|
111
113
|
|
|
112
|
-
It takes the options of `renderText` but `records` and `
|
|
114
|
+
It takes the options of `renderText` but `records`, `tables` and `planned`, and `labels`: per resource, its fields' labels and value labels, which its tables' headers and cells read. A count's `read` gives `{ rows: [], total }`, and a count per record around it, an `:aggregate`, its groups as rows `{ value, count }`.
|
|
113
115
|
|
|
114
116
|
<gap>A `Stat` count, a `Chart`, a `RecordCards`, a `RecordRow` or a `Thread` cannot read its records in `pageText` because their text forms for planned records are not implemented.</gap> <gap>A path in the text form cannot read a record further out than the nearest, such as `../id`, because a stack of records in the text form is not implemented.</gap> A `Thread` holding the elements of [`threadItemNodes`](blocks.md#tool-calls) reads as its messages and calls. <gap>A data block other than a `Table`, a `RecordCard`, a `CardRow`, a `Thread` or a list block cannot list records you pass because its text form for records is not implemented.</gap> <gap>A field's text form cannot apply its `format`, such as a relative time, because formatting in the text form is not implemented.</gap> <gap>MCP clients cannot read a page's text form because a tool that serves it is not implemented.</gap>
|
|
115
117
|
|
|
@@ -175,7 +177,7 @@ When a page opens, the web starts every read of its plan at once, with the page'
|
|
|
175
177
|
|
|
176
178
|
Each read in the plan (`page.reads.reads`) names its block by a JSON Pointer into the page's tree, such as `/children/0/children/2`, which `elementAt(tree, pointer)` finds. It gives the read's `resource`, its `kind` (`list`, `count` or `aggregate`), `filter`, `orderBy`, `pageSize`, `limitPer`, `groupBy`, `fields` (absent for every field), `etag`, and for a read inside the records of another its `split`: the `field` its rows hold the value `source`, a path, reads where the block draws, and the `parent` read, by `planReadId(read)`. `compileReadPlan(tree, { models })` makes the same plan from a tree of your own. `runReadPlan(plan, read, { params })` starts every read at once through `read` and gives each outcome by `planReadId`, and `plannedRows(read, rows, scope)` the rows of one record around a block.
|
|
177
179
|
|
|
178
|
-
A [custom component](custom-components.md#reads) is planned when it declares its reads. 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.
|
|
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.
|
|
179
181
|
|
|
180
182
|
<gap>A `Table`, `Thread`, `Chart`, `RecordCards` or `RecordRow` cannot start its read when the page opens because drawing those blocks from their planned read is not implemented; each still reads once it draws, under a `Show` or `Match` once its condition holds.</gap> <gap>A read without an ETag cannot read only its fields from the database because skipping ETags in the list API is not implemented; it still sends only its fields.</gap> <gap>A `Chart` cannot sit inside a repeated record because grouping a chart per record is not implemented.</gap>
|
|
181
183
|
|
|
@@ -35,7 +35,7 @@ Each place a plugin can fill is an extension point. The config names it, or a pl
|
|
|
35
35
|
|
|
36
36
|
| Extension point | Named by | Registered as | Gets | Missing, off or throwing |
|
|
37
37
|
| --- | --- | --- | --- | --- |
|
|
38
|
-
| View: [list display](custom-components.md#list-displays), [record section](custom-components.md#record-sections), [page element](custom-components.md#components) | `component('Name')` in `d.custom`, `l.custom` or a layout | A PascalCase export of `protobase.ui.tsx` | Its props, field references as names; `useListDisplay()`, `useLayoutRecord()` | A warning in its place: "No component is registered as *Name*" or "*Name* could not be drawn." |
|
|
38
|
+
| View: [list display](custom-components.md#list-displays), [record section](custom-components.md#record-sections), [page element](custom-components.md#components) | `component('Name')` in `d.custom`, `l.custom` or a layout | A PascalCase export of `protobase.ui.tsx` | Its props, field references as names; `useListDisplay()`, `useLayoutRecord()`, `useComponentReads()` | A warning in its place: "No component is registered as *Name*" or "*Name* could not be drawn." |
|
|
39
39
|
| [Record card](custom-components.md#record-cards) | `d.cards(fields, { card: component('Name') })` | A PascalCase export | `{ row }` | The built-in card: title, subtitle, badge, meta fields |
|
|
40
40
|
| [Field type](#field-types) | `r.field.widget('name', props)` in a view's `fields` | `fields: { name: { of, display, editor?, cell? } }` | `{ field, value, props }`, and `onChange`, `invalid` for the editor | The field as it shows without one |
|
|
41
41
|
| Widget part (the [assistant](assistant.md#widget-parts)) | A widget part's name | A PascalCase export | The part's props | The part's fallback card |
|
|
@@ -205,6 +205,70 @@ export default definePlugin({ fileViewers: { 'application/vnd.example.report+jso
|
|
|
205
205
|
|
|
206
206
|
`useFileText(file)` reads the file's text once, as a TanStack Query result kept while the file stays the same. It reads through the API that serves the record, whatever store holds the file and wherever its link points, up to 10 MB. The viewer draws on the page below the file's bar, which scrolls as the page does. The file's link is a download link served with a sandboxing CSP, so a viewer reads the file and draws it itself rather than framing it; a page of HTML it draws in an [`HtmlFrame`](files.md#html-files).
|
|
207
207
|
|
|
208
|
+
## Graph
|
|
209
|
+
|
|
210
|
+
:::caution[Beta]
|
|
211
|
+
A graph is read-only, and its positions are laid out automatically: you cannot move, add or connect nodes in it.
|
|
212
|
+
:::
|
|
213
|
+
|
|
214
|
+
`@protobase/graph` is a plugin with a `Graph` layout block: it draws the records of one resource as nodes and the records of another as edges between them, each node in the box of its group and coloured by its status, and with `select` the chosen node's details beside the graph. It draws with the `@xyflow/react` package and lays the graph out with the `@dagrejs/dagre` package, so an app that does not attach it carries neither. An app installs it and extends its `protobase.ui.tsx` with it:
|
|
215
|
+
|
|
216
|
+
```sh
|
|
217
|
+
npm install @protobase/graph
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
```tsx
|
|
221
|
+
// protobase.ui.tsx
|
|
222
|
+
import { defineUi } from '@protobase/ui'
|
|
223
|
+
import graph from '@protobase/graph'
|
|
224
|
+
|
|
225
|
+
export default defineUi({ extends: [graph] })
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Its layout uses the block from `@protobase/graph/layout`, which carries no drawing code:
|
|
229
|
+
|
|
230
|
+
```tsx
|
|
231
|
+
/** @jsxImportSource @protobase/layout */
|
|
232
|
+
import { Card, Field, page, Page } from '@protobase/layout'
|
|
233
|
+
import { Graph } from '@protobase/graph/layout'
|
|
234
|
+
|
|
235
|
+
export const serviceMap = page(
|
|
236
|
+
'service-map',
|
|
237
|
+
<Page title="Services" width="full">
|
|
238
|
+
<Card title="Service map">
|
|
239
|
+
<Graph nodes="services" edges="links" label="name" group="area" status="health" source="from_id" target="to_id" select="service">
|
|
240
|
+
<Field source="name" />
|
|
241
|
+
<Field source="health" />
|
|
242
|
+
</Graph>
|
|
243
|
+
</Card>
|
|
244
|
+
</Page>,
|
|
245
|
+
)
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
| Prop | |
|
|
249
|
+
| --- | --- |
|
|
250
|
+
| `nodes` | The resource whose records are the nodes, each by its key, which is one field: a resource with a key of several fields draws the fallback. |
|
|
251
|
+
| `edges` | The resource whose records are the edges. An edge whose `source` or `target` is not among the nodes is left out. |
|
|
252
|
+
| `label` | The field of a node that labels it. |
|
|
253
|
+
| `group` | The field of a node whose value puts it in a box with the nodes that hold the same; a node without one stands outside every box. |
|
|
254
|
+
| `status` | The enum field of a node shown under its label, and colouring its left edge, as the view's `valueColors` give each value. |
|
|
255
|
+
| `source`, `target` | The fields of an edge that hold the keys of the nodes it runs from and to. |
|
|
256
|
+
| `select` | The [page parameter](layouts.md#page-parameters) that holds the chosen node's key: each node's label links to the page with it chosen, and the `Graph`'s children draw beside the graph, inside that node's record, or under it on a narrow screen. |
|
|
257
|
+
| `empty` | What it shows without nodes. |
|
|
258
|
+
|
|
259
|
+
The block declares its [reads](custom-components.md#reads): the page's [read plan](layouts.md#how-a-page-reads-its-data) reads the nodes and the edges, up to 500 of each, with the rest of the page as it opens, and the plugin only draws them. The same records always make the same picture: edges run top to bottom, and groups, nodes and edges are laid out in the order of their keys. The graph is as wide as its place and as tall as its shape asks, up to most of the screen; it fits in that box unless that would make it too small to read, as on a phone, where you drag to pan. Pinch or the zoom buttons zoom it, the fit button shows all of it, and the mouse wheel scrolls the page past it. <gap>A group cannot show the title of the record its field points at because reading related records' titles in the graph is not implemented, so a relation groups by its key.</gap>
|
|
260
|
+
|
|
261
|
+
Where it cannot be drawn, a client draws its fallback. `graph({ fallback })` declares the block with one, such as the [picture](blocks.md#image) one of the app's API functions draws of the same graph:
|
|
262
|
+
|
|
263
|
+
```tsx
|
|
264
|
+
import { Image } from '@protobase/layout'
|
|
265
|
+
import { graph } from '@protobase/graph/layout'
|
|
266
|
+
|
|
267
|
+
export const Graph = graph({ fallback: <Image function="service_map" alt="The services and the links between them" /> })
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
Its [text form](layouts.md#text-form), `graphText` from `@protobase/graph/layout`, lists each group with its nodes and their status, then each edge as `a → b`, from the records of the page's plan: pass it as `forms: { Graph: graphText }` to `pageText`, with the app's `models` and `labels`.
|
|
271
|
+
|
|
208
272
|
## Building
|
|
209
273
|
|
|
210
274
|
```sh
|
|
@@ -379,6 +443,9 @@ From `@protobase/ui`:
|
|
|
379
443
|
| `SearchPicker` | A searchable list to pick from, for a panel or a dialog (see [focus pages](custom-components.md#focus-pages)). |
|
|
380
444
|
| `useCreateForm`, `InPlaceForm` | A create form that stays where it is (see [focus pages](custom-components.md#focus-pages)). |
|
|
381
445
|
| `RecordCardProps` | The props of a [record card](custom-components.md#record-cards), `{ row }`. |
|
|
446
|
+
| `useComponentReads`, `useComponentSelect`, `ComponentRead`, `ComponentReads`, `ComponentSelect` | The records a page element's declared [reads](custom-components.md#reads) hold, and the record its `select` chose. |
|
|
447
|
+
| `RouteLink`, `RouteTarget` | An ordinary link to a target's `href`, which a plain click follows in the app, as `useComponentSelect().linkTo(key)` gives it. |
|
|
448
|
+
| `FieldBadge`, `ToneEdge` | A record's value of a field as a badge in its view's words and colour, and a card's left edge in that colour, as the app's related cards draw them. |
|
|
382
449
|
| `AuthLayout`, `CodeForm`, `ResendCodeButton`, `Button`, `buttonClass`, `Input`, `Spinner`, `LogoMark` | The pieces of the app's sign-in pages, for a page of a plugin or a host's own that looks like them. Outside the app, `@protobase/ui/styles.css` is the stylesheet that draws them, for a Vite build with Tailwind. |
|
|
383
450
|
| `isFramed`, `useArmedAfterFocus`, `useGuardedPress`, `allowDelayMs` | The connect page's guard against clickjacking and click-through, for a host's own consent screen: it refuses to render when `isFramed()`, and its Allow button spreads `useGuardedPress(armed, onAllow)`, so a press counts only once the page has been in front for `allowDelayMs`, and a press anywhere on the page before then starts that wait again. |
|
|
384
451
|
| `pluginApi` | The plugin API of the app's `@protobase/ui`. |
|
|
@@ -388,4 +455,4 @@ From `@protobase/ui`:
|
|
|
388
455
|
|
|
389
456
|
The modules of `@protobase/ui` that the table leaves out are reached one by one at `@protobase/ui/unstable/<module>`, by the module's path in `packages/ui/src` without its extension, such as `@protobase/ui/unstable/primitives/skeleton`. They come with no promise: any release may change or remove them, outside the plugin API. They are for UI that a bundler of its own builds on `@protobase/ui`, such as a host's own pages, so it imports a component rather than copying it; a plugin, or a project's `protobase.ui.tsx`, cannot import them, like any other file inside `@protobase/ui` (see [imports](#writing-a-plugin)). A module an app needs to rely on can become a stable export: see [versioning](versioning.md#plugins).
|
|
390
457
|
|
|
391
|
-
From `@protobase/layout`: `component(name, { plugin })` (see [above](#declaring-its-components-in-the-config)). From `@protobase/schema`: `.widget(name, props)` on a view's fields and `d.cards(fields, { card })` (see [Views](ui-config.md)). From the config: `plugins`; from the environment: `PROTOBASE_PLUGINS` and `PROTOBASE_PLUGINS_BEFORE_SIGN_IN` (see [loading](#loading)). The tokens a plugin's utilities read are in [Theme](theme.md).
|
|
458
|
+
From `@protobase/layout`: `component(name, { plugin, reads })` (see [above](#declaring-its-components-in-the-config) and [reads](custom-components.md#reads)). From `@protobase/schema`: `.widget(name, props)` on a view's fields and `d.cards(fields, { card })` (see [Views](ui-config.md)). From the config: `plugins`; from the environment: `PROTOBASE_PLUGINS` and `PROTOBASE_PLUGINS_BEFORE_SIGN_IN` (see [loading](#loading)). The tokens a plugin's utilities read are in [Theme](theme.md).
|