@protobase/ui 0.64.0 → 0.65.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/app/bottom-bar-from-meta.js +2 -3
- package/dist/app/menu-icons.js +10 -3
- package/dist/app/nav-from-meta.js +6 -7
- package/dist/app/user-menu-from-meta.js +2 -3
- package/dist/package.js +1 -1
- package/dist/shell/assets/app-BOuBCV1m.js +8 -0
- package/dist/shell/assets/{calls-D5RK7EJu.js → calls-C22bYKio.js} +2 -2
- package/dist/shell/assets/{index-DMaCBpbN.js → index-G0fdUd70.js} +2 -2
- package/dist/shell/assets/{records-map-WFMHgKdf.js → records-map-BtWK38Kn.js} +2 -2
- package/dist/shell/assets/{shared-protobase-ui-CP2mMFbh.js → shared-protobase-ui-xqMMtr7u.js} +2 -2
- package/dist/shell/index.html +3 -3
- package/dist/shell/protobase.shell.json +2 -2
- package/dist/shell/protobase.sw.js +2 -2
- package/dist/shell-source-maps/assets/app-BOuBCV1m.js.map +1 -0
- package/dist/shell-source-maps/assets/{calls-D5RK7EJu.js.map → calls-C22bYKio.js.map} +1 -1
- package/dist/shell-source-maps/assets/{index-DMaCBpbN.js.map → index-G0fdUd70.js.map} +1 -1
- package/dist/shell-source-maps/assets/{records-map-WFMHgKdf.js.map → records-map-BtWK38Kn.js.map} +1 -1
- package/dist/shell-source-maps/assets/{shared-protobase-ui-CP2mMFbh.js.map → shared-protobase-ui-xqMMtr7u.js.map} +1 -1
- package/package.json +4 -4
- package/dist/app/icons.js +0 -27
- package/dist/shell/assets/app-CN_7en9q.js +0 -8
- package/dist/shell-source-maps/assets/app-CN_7en9q.js.map +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { menuIcon } from "./menu-icons.js";
|
|
1
|
+
import { menuIcon, resourceIcon } from "./menu-icons.js";
|
|
3
2
|
import { ExternalLink, LayoutDashboard } from "lucide-react";
|
|
4
3
|
import { appPath } from "@protobase/schema";
|
|
5
4
|
//#region src/app/bottom-bar-from-meta.ts
|
|
@@ -25,7 +24,7 @@ const bottomBarFromMeta = (meta, basePath, activeResource) => (meta.bottomBar?.i
|
|
|
25
24
|
return {
|
|
26
25
|
id: item.resource,
|
|
27
26
|
label: item.label,
|
|
28
|
-
icon: menuIcon(item.icon,
|
|
27
|
+
icon: menuIcon(item.icon, resourceIcon(meta, item.resource)),
|
|
29
28
|
href: appPath({
|
|
30
29
|
kind: "list",
|
|
31
30
|
resource: item.resource
|
package/dist/app/menu-icons.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Bell, BookOpen, Bookmark, Building2, CreditCard, ExternalLink, FileText, Heart, KeyRound, LayoutDashboard, LifeBuoy, Mail, Receipt, Settings, ShieldCheck, Users } from "lucide-react";
|
|
1
|
+
import { Bell, BookOpen, Bookmark, Building2, CreditCard, ExternalLink, FileText, Globe2, Heart, KeyRound, LayoutDashboard, LifeBuoy, Mail, Package, Receipt, Settings, ShieldCheck, ShoppingCart, Table2, Tags, Users, Warehouse } from "lucide-react";
|
|
2
2
|
//#region src/app/menu-icons.ts
|
|
3
3
|
const byName = {
|
|
4
4
|
bell: Bell,
|
|
@@ -8,17 +8,24 @@ const byName = {
|
|
|
8
8
|
"credit-card": CreditCard,
|
|
9
9
|
"external-link": ExternalLink,
|
|
10
10
|
"file-text": FileText,
|
|
11
|
+
globe: Globe2,
|
|
11
12
|
heart: Heart,
|
|
12
13
|
key: KeyRound,
|
|
13
14
|
"layout-dashboard": LayoutDashboard,
|
|
14
15
|
"life-buoy": LifeBuoy,
|
|
15
16
|
mail: Mail,
|
|
17
|
+
package: Package,
|
|
16
18
|
receipt: Receipt,
|
|
17
19
|
settings: Settings,
|
|
18
20
|
shield: ShieldCheck,
|
|
19
|
-
|
|
21
|
+
"shopping-cart": ShoppingCart,
|
|
22
|
+
tags: Tags,
|
|
23
|
+
users: Users,
|
|
24
|
+
warehouse: Warehouse
|
|
20
25
|
};
|
|
21
26
|
Object.keys(byName);
|
|
22
27
|
const menuIcon = (name, fallback) => name ? byName[name] ?? fallback : fallback;
|
|
28
|
+
/** A resource's icon in the sidebar, bottom bar and user menu: the one its view names, or a visitor's sign-in prompt's view, else a table. */
|
|
29
|
+
const resourceIcon = (meta, resource) => menuIcon(meta.views[resource]?.icon ?? meta.signIn?.[resource]?.icon, Table2);
|
|
23
30
|
//#endregion
|
|
24
|
-
export { menuIcon };
|
|
31
|
+
export { menuIcon, resourceIcon };
|
|
@@ -2,11 +2,10 @@ import { allowEverything } from "../data/meta-data.js";
|
|
|
2
2
|
import { humanize } from "../live/naming.js";
|
|
3
3
|
import { text } from "./messages.js";
|
|
4
4
|
import { text as text$1 } from "./create/messages.js";
|
|
5
|
-
import {
|
|
6
|
-
import { menuIcon } from "./menu-icons.js";
|
|
5
|
+
import { menuIcon, resourceIcon } from "./menu-icons.js";
|
|
7
6
|
import { createOffered } from "./create/create-offered.js";
|
|
8
7
|
import { userMenuResources } from "./user-menu-from-meta.js";
|
|
9
|
-
import { LayoutDashboard } from "lucide-react";
|
|
8
|
+
import { LayoutDashboard, Table2 } from "lucide-react";
|
|
10
9
|
import { appPath } from "@protobase/schema";
|
|
11
10
|
//#region src/app/nav-from-meta.ts
|
|
12
11
|
/** The sidebar item of a resource's list, or of one of its named lists. */
|
|
@@ -82,7 +81,7 @@ const navFromMeta = (meta, basePath = "", recent = {}) => {
|
|
|
82
81
|
if (!view.nav?.hidden) add(defaultGroup, {
|
|
83
82
|
id: navItemId(model.name),
|
|
84
83
|
label: view.names?.plural ?? humanize(model.name),
|
|
85
|
-
icon:
|
|
84
|
+
icon: resourceIcon(meta, model.name),
|
|
86
85
|
href: appPath({
|
|
87
86
|
kind: "list",
|
|
88
87
|
resource: model.name
|
|
@@ -95,7 +94,7 @@ const navFromMeta = (meta, basePath = "", recent = {}) => {
|
|
|
95
94
|
add(named.nav?.group ?? defaultGroup, {
|
|
96
95
|
id: navItemId(model.name, named.name),
|
|
97
96
|
label: named.names.plural,
|
|
98
|
-
icon:
|
|
97
|
+
icon: resourceIcon(meta, model.name),
|
|
99
98
|
href: appPath({
|
|
100
99
|
kind: "list",
|
|
101
100
|
resource: model.name,
|
|
@@ -115,7 +114,7 @@ const navFromMeta = (meta, basePath = "", recent = {}) => {
|
|
|
115
114
|
group.items.push({
|
|
116
115
|
id: entry.resource,
|
|
117
116
|
label: entry.names?.plural ?? humanize(entry.resource),
|
|
118
|
-
icon:
|
|
117
|
+
icon: resourceIcon(meta, entry.resource),
|
|
119
118
|
href: appPath({
|
|
120
119
|
kind: "list",
|
|
121
120
|
resource: entry.resource
|
|
@@ -133,7 +132,7 @@ const navFromMeta = (meta, basePath = "", recent = {}) => {
|
|
|
133
132
|
for (const resource of status.source.resources) group.items.push({
|
|
134
133
|
id: resource,
|
|
135
134
|
label: humanize(resource),
|
|
136
|
-
icon:
|
|
135
|
+
icon: Table2,
|
|
137
136
|
href: appPath({
|
|
138
137
|
kind: "list",
|
|
139
138
|
resource
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { humanize } from "../live/naming.js";
|
|
2
|
-
import {
|
|
3
|
-
import { menuIcon } from "./menu-icons.js";
|
|
2
|
+
import { menuIcon, resourceIcon } from "./menu-icons.js";
|
|
4
3
|
import { ExternalLink, LayoutDashboard } from "lucide-react";
|
|
5
4
|
import { appPath } from "@protobase/schema";
|
|
6
5
|
//#region src/app/user-menu-from-meta.ts
|
|
@@ -31,7 +30,7 @@ const userMenuFromMeta = (meta, basePath, activeResource) => (meta.userMenu?.ite
|
|
|
31
30
|
return {
|
|
32
31
|
id: item.resource,
|
|
33
32
|
label: item.label ?? meta.views[item.resource]?.names?.plural ?? humanize(item.resource),
|
|
34
|
-
icon: menuIcon(item.icon,
|
|
33
|
+
icon: menuIcon(item.icon, resourceIcon(meta, item.resource)),
|
|
35
34
|
href: appPath({
|
|
36
35
|
kind: "list",
|
|
37
36
|
resource: item.resource
|
package/dist/package.js
CHANGED