@protobase/cli 0.115.1 → 0.117.0
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/dist/mobile/package.js +1 -1
- package/dist/mobile/protobase-plugin.js +4 -3
- package/package.json +8 -8
- package/skills/protobase/references/features/navigation.md +3 -0
- package/skills/protobase/references/reference/bottom-bar.md +14 -1
- package/skills/protobase/references/reference/sidebar.md +5 -1
- package/skills/protobase/references/reference/theme.md +6 -6
- package/skills/protobase/references/reference/user-menu.md +1 -1
package/dist/cli/package.js
CHANGED
package/dist/mobile/package.js
CHANGED
|
@@ -48,14 +48,15 @@ const checkProtobasePlugin = async (ws) => {
|
|
|
48
48
|
};
|
|
49
49
|
/**
|
|
50
50
|
* The classes of Protobase's iOS plugin, by `@objc` name: the bounce Capacitor turns off, ProtobaseAuth, which keeps
|
|
51
|
-
* page script away from the session, ProtobaseExternal, which opens a url outside the app,
|
|
52
|
-
*
|
|
51
|
+
* page script away from the session, ProtobaseExternal, which opens a url outside the app, ProtobasePush, which names
|
|
52
|
+
* what the app registers its APNs token with, and ProtobaseTabBar, the shell's mobile bottom bar as the system tab bar.
|
|
53
53
|
*/
|
|
54
54
|
const protobaseIosPluginClasses = [
|
|
55
55
|
"ProtobaseBounce",
|
|
56
56
|
"ProtobaseAuthPlugin",
|
|
57
57
|
"ProtobaseExternal",
|
|
58
|
-
"ProtobasePush"
|
|
58
|
+
"ProtobasePush",
|
|
59
|
+
"ProtobaseTabBar"
|
|
59
60
|
];
|
|
60
61
|
/** The Swift package product `cap add ios` compiles @protobase/mobile into, by the name @capacitor/cli's fixName gives. */
|
|
61
62
|
const protobaseIosProduct = "ProtobaseMobile";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.117.0",
|
|
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.
|
|
47
|
-
"@protobase/layout": "0.
|
|
48
|
-
"@protobase/query": "0.
|
|
49
|
-
"@protobase/schema": "0.
|
|
50
|
-
"@protobase/server": "0.
|
|
51
|
-
"@protobase/ui": "0.
|
|
52
|
-
"@protobase/workflows": "0.
|
|
46
|
+
"@protobase/config": "0.117.0",
|
|
47
|
+
"@protobase/layout": "0.117.0",
|
|
48
|
+
"@protobase/query": "0.117.0",
|
|
49
|
+
"@protobase/schema": "0.117.0",
|
|
50
|
+
"@protobase/server": "0.117.0",
|
|
51
|
+
"@protobase/ui": "0.117.0",
|
|
52
|
+
"@protobase/workflows": "0.117.0",
|
|
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",
|
|
@@ -12,6 +12,9 @@ The sidebar, the user menu, the bottom bar on phones and the global search.
|
|
|
12
12
|
- [The current organization](../reference/sidebar.md#the-current-organization): A sidebar entry opens its list on the organization you work in, which you can clear to see every organization you are a member of.
|
|
13
13
|
- [User menu](../reference/user-menu.md): Account pages, help links, security settings, setting a status, the theme switch and Sign out.
|
|
14
14
|
- [Bottom bar](../reference/bottom-bar.md): On phones, tabs along the bottom for each role's main screens.
|
|
15
|
+
- [Phone app layout](../reference/bottom-bar.md#search-and-more): With a bottom bar, More opens the sidebar as a page of its own with search at its top, the top bar takes the app's brand color, and pages that are no tab lead back to More; search can join the bar with `m.search()`.
|
|
16
|
+
- [System tab bar](../reference/bottom-bar.md#in-the-ios-app): In the iOS app the bottom bar is the system's own tab bar.
|
|
17
|
+
- [Menus as sheets](../reference/sidebar.md#menus-and-drawers-on-phones): On phones, menus, select lists and the account menu open as a sheet from the bottom, and the sidebar drawer and sheets move under the finger as a native drawer does.
|
|
15
18
|
- [Global search](../reference/client.md#global-search): A search box, also on Cmd+K or Ctrl+K, finds records in every resource and jumps to pages and New forms.
|
|
16
19
|
- [Breadcrumbs](../reference/ui-config.md#breadcrumbs): The top bar shows the group and list you are on, each a link back, and on a phone a back button to the one before; a record page's heading names the record.
|
|
17
20
|
- [Tab titles](../reference/ui-config.md#names-and-columns): Browser tabs name the record, list or page they show, then the app.
|
|
@@ -25,16 +25,29 @@ export const warehouseBar = bottomBar({ label: 'Warehouse', roles: ['warehouse']
|
|
|
25
25
|
| `m.resource(name, { label, icon? })` | Opens the resource's list. Without `icon`, the resource's sidebar icon. |
|
|
26
26
|
| `m.page(name, { label, icon? })` | Opens a [composed page](layouts.md). Without `icon`, the page's own. |
|
|
27
27
|
| `m.link(label, href, { icon? })` | Opens `href` in a new tab. Only `https://`, `http://` and `mailto:` are accepted. |
|
|
28
|
+
| `m.search({ label? })` | Puts the app's search in the bar. Once at most, beside up to three tabs, as search takes a tab's place; without `label`, "Search" in the app's language. |
|
|
28
29
|
|
|
29
30
|
Every tab needs its `label`: tabs are narrow, so the bar does not borrow a view's or page's longer name. `icon` takes the names the [user menu](user-menu.md) does. Items keep their order. Unlike the user menu, a bar takes nothing out of the sidebar.
|
|
30
31
|
|
|
32
|
+
## Search and More
|
|
33
|
+
|
|
34
|
+
With a bottom bar, a phone works as a phone app does. "More" opens the sidebar as a page of its own, at `/-/menu`, with the bar still there and More the current tab; the app never starts on it, so a restart from More opens the first tab. The top bar takes the app's brand color, the theme's `--primary` with its text in `--primary-foreground`, up behind the status bar: the first tab's page leads with the app's logo and name, More is titled "More", and every page that is no tab leads back to More from its top bar. The top bar has no search button then: with `m.search()` search is part of the bar, and without it the More page has a search field whose results show in place of the sidebar's items.
|
|
35
|
+
|
|
36
|
+
The bar has five places at most: with search, three tabs, search and More. In the iOS app, where the bar is the system's own tab bar, search is the system's search item after the tabs.
|
|
37
|
+
|
|
38
|
+
On every phone page, with or without a bottom bar, the account is at the top right of the top bar, the person's avatar or, for a visitor, a guest icon that signs in, rather than at the foot of the sidebar.
|
|
39
|
+
|
|
40
|
+
## In the iOS app
|
|
41
|
+
|
|
42
|
+
The iOS app draws the bar as the system's tab bar, with the system's own material, through Protobase's `ProtobaseTabBar` plugin: the page sends the tabs it would draw, their icons and the current one each time they change, and the plugin hands a tap back as the tab the page then follows. The page keeps the place of its own bar, unseen, at the height the system bar reports, so nothing ends behind it. The page uses the plugin only where the app's bridge offers it, and draws its own bar otherwise.
|
|
43
|
+
|
|
31
44
|
## Which bar someone gets
|
|
32
45
|
|
|
33
46
|
Each bar names its roles, and a role belongs to one bar. A caller gets the bar that names their active role, through `/meta` as `bottomBar`, without the resources and pages they cannot see, except that a visitor keeps a resource whose view has a [sign-in prompt](ui-config.md#sign-in-prompts), which tells them to sign in; a bar with none left is not sent. Someone whose active role no bar names gets no bar. The active role is the one the session acts with, which the person [switches in the profile menu](auth.md#active-role); with an authenticator other than Better Auth's, the caller's first role.
|
|
34
47
|
|
|
35
48
|
## Checks
|
|
36
49
|
|
|
37
|
-
`createAdmin` refuses to start when a bar names a resource or page that does not exist, has no roles, no items or more than four, names a role the app does not have (the roles of [`auth.roles`](auth.md#roles) and [`defineRoles`](access.md); without either, any role is accepted), shares a role with another bar, or has the label of another bar. The checks are [`bottomBarErrors`](https://docs.protobase.net/api/schema/functions/bottombarerrors/) from `@protobase/schema`, a pure function of the bars and the app's names.
|
|
50
|
+
`createAdmin` refuses to start when a bar names a resource or page that does not exist, has no roles, no items or more than four tabs (three beside search), names a role the app does not have (the roles of [`auth.roles`](auth.md#roles) and [`defineRoles`](access.md); without either, any role is accepted), shares a role with another bar, or has the label of another bar. The checks are [`bottomBarErrors`](https://docs.protobase.net/api/schema/functions/bottombarerrors/) from `@protobase/schema`, a pure function of the bars and the app's names.
|
|
38
51
|
|
|
39
52
|
`protobase dev`, `protobase build` and `protobase serve` pick the bars up from `config/index.ts`. With `createAdmin` directly, pass them as `bottomBars`:
|
|
40
53
|
|
|
@@ -6,7 +6,11 @@ How sidebar entries are grouped and which icon each shows, how an entry lists re
|
|
|
6
6
|
|
|
7
7
|
The admin's sidebar has one entry per resource view, grouped by `nav.group` (default: the database schema, with no group name for `public`) and sorted by `nav.order`, then by the order `config/index.ts` exports them, in `protobase dev` and in a built bundle alike. The app opens on the first entry. A view's [named lists](ui-config.md#more-than-one-list) are entries of their own, placed by their own `nav`. `nav({ hidden: true })` leaves a resource out, for line and link tables; a resource in the [user menu](user-menu.md) is left out too. [Composed pages](layouts.md#setup) have entries of their own, and groups that hold pages come first. A [remote resource](remote-resources.md) has its entry where its source's view places it; while its source cannot be reached, it sits under the source's label, marked "Cannot reach" with the source's name.
|
|
8
8
|
|
|
9
|
-
Below the `md` breakpoint (768px) the sidebar is a drawer, which the top bar's menu button opens,
|
|
9
|
+
Below the `md` breakpoint (768px) the sidebar is a drawer, which the top bar's menu button opens, It is 88% of the screen wide, at most 384px. With a [bottom bar](bottom-bar.md#search-and-more), **More** opens the sidebar as a page of its own instead.
|
|
10
|
+
|
|
11
|
+
### Menus and drawers on phones
|
|
12
|
+
|
|
13
|
+
Below the `md` breakpoint every menu, select list and the account menu opens as a sheet from the bottom of the screen, its items at a phone's list size; from `md` up they open beside their button. Sheets and the sidebar drawer move under the finger as a native drawer does: a drag on them, or on the dim beside them, past a few pixels and close to their axis, moves them one to one, past open with a rubber band; let go, a fast release goes its way and a slow one past half closes them, and they settle without overshoot. Both open at the document's root, with the page's colors, wherever they open from.
|
|
10
14
|
|
|
11
15
|
## The logo
|
|
12
16
|
|
|
@@ -71,12 +71,12 @@ Every token, with the app's light and dark values. Colors take any CSS color.
|
|
|
71
71
|
| `--foreground` | `#18181b` | `#f4f4f5` |
|
|
72
72
|
| `--muted-foreground` | `#71717a` | `#a1a1aa` |
|
|
73
73
|
| `--faint-foreground` | `#a1a1aa` | `#71717a` |
|
|
74
|
-
| `--primary` | `#
|
|
75
|
-
| `--primary-hover` | `#
|
|
74
|
+
| `--primary` | `#3f434a` | `#5b616b` |
|
|
75
|
+
| `--primary-hover` | `#2c2f34` | `#6d747f` |
|
|
76
76
|
| `--primary-foreground` | `#ffffff` | `#ffffff` |
|
|
77
|
-
| `--primary-soft` | `#
|
|
78
|
-
| `--primary-border` | `#
|
|
79
|
-
| `--primary-text` | `#
|
|
77
|
+
| `--primary-soft` | `#f1f2f4` | `#23252a` |
|
|
78
|
+
| `--primary-border` | `#d3d6db` | `#3b3f46` |
|
|
79
|
+
| `--primary-text` | `#2c2f34` | `#c9ccd2` |
|
|
80
80
|
| `--success` | `#16a34a` | `#22c55e` |
|
|
81
81
|
| `--success-soft` | `#f0fdf4` | `#0f2418` |
|
|
82
82
|
| `--success-text` | `#15803d` | `#86efac` |
|
|
@@ -125,7 +125,7 @@ The list is `packages/ui/src/tokens.css`, and a test fails when one of its token
|
|
|
125
125
|
|
|
126
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. Its search field grows the same way, so it and its focus ring stay inside the bar. These caps
|
|
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 are in pixels and screen width, since a size in `rem` alone would grow past the screen; the bar's spacing is on the spacing scale.
|
|
129
129
|
|
|
130
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
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
The user menu at the bottom of the sidebar, with the app's own account pages and links.
|
|
6
6
|
|
|
7
|
-
The signed-in user sits at the bottom of the sidebar. Clicking them opens a menu with their name and email, which link to their account, "Set a status" in an app with [status](status.md), the app's own pages, the theme switch, and "Sign out". Account pages (organization, billing, users) and help links belong here rather than among the working resources.
|
|
7
|
+
The signed-in user sits at the bottom of the sidebar, and on a phone at the top right of the top bar, where the menu opens as a sheet from the bottom. Clicking them opens a menu with their name and email, which link to their account, "Set a status" in an app with [status](status.md), the app's own pages, the theme switch, and "Sign out". Account pages (organization, billing, users) and help links belong here rather than among the working resources.
|
|
8
8
|
|
|
9
9
|
Export one [`userMenu(...)`](https://docs.protobase.net/api/schema/functions/usermenu/) from `config/index.ts`:
|
|
10
10
|
|