@protobase/ui 0.12.6 → 0.12.7
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/app.js +4 -2
- package/dist/app/breadcrumb-for.js +8 -3
- package/dist/app/displays/cards-display.js +1 -1
- package/dist/app/pages/blocks/card-row.js +1 -1
- package/dist/app/pages/blocks/field.js +1 -1
- package/dist/app/pages/blocks/record-card.js +1 -1
- package/dist/app/pages/blocks/stat.js +1 -1
- package/dist/app/pages/blocks/table.js +1 -1
- package/dist/app/related-section.js +1 -1
- package/dist/app-shell/breadcrumb.js +11 -4
- package/dist/data-grid/grid-row.js +1 -1
- package/dist/package.js +1 -1
- package/dist/shell/assets/app-W6ms0mEo.js +65 -0
- package/dist/shell/assets/{index--KkbQgIT.js → index-tqpbOKxn.js} +1 -1
- package/dist/shell/assets/{shared-protobase-ui-DQxQC_dF.js → shared-protobase-ui-DEslmnKe.js} +1 -1
- package/dist/shell/index.html +3 -3
- package/dist/shell/protobase.shell.json +1 -1
- package/package.json +4 -4
- package/dist/shell/assets/app-DRkDxaX2.js +0 -65
package/dist/app/app.js
CHANGED
|
@@ -86,7 +86,8 @@ const Routes = ({ workspace, sidebarMode, assistant, runtime }) => {
|
|
|
86
86
|
const group = groups.find((entry) => entry.items.some((item) => item.id === place));
|
|
87
87
|
const model = resource ? meta.resources[resource] : void 0;
|
|
88
88
|
const record = useRecord(shown?.resource ?? "", shown?.key ?? "", Boolean(model && shown));
|
|
89
|
-
const title = model && shown && record.data ? recordTitle(model, view, record.data.record, shown.key) :
|
|
89
|
+
const title = model && shown && record.data ? recordTitle(model, view, record.data.record, shown.key) : void 0;
|
|
90
|
+
const titleLoading = Boolean(shown) && (record.isLoading || drawnFrom?.state === "loading");
|
|
90
91
|
const { shell } = useProjectUi();
|
|
91
92
|
const Actions = shell?.actions;
|
|
92
93
|
const RightPanel = shell?.rightPanel;
|
|
@@ -126,7 +127,8 @@ const Routes = ({ workspace, sidebarMode, assistant, runtime }) => {
|
|
|
126
127
|
group: group?.label,
|
|
127
128
|
page,
|
|
128
129
|
resourceLabel: view?.names?.plural ?? (resource && humanize(resource)),
|
|
129
|
-
recordTitle: title
|
|
130
|
+
recordTitle: title,
|
|
131
|
+
recordLoading: titleLoading
|
|
130
132
|
});
|
|
131
133
|
const content = path === "/-/account" ? /* @__PURE__ */ jsx(AccountSecurityPage, { email: user.email }) : path === "/-/sign-in-policy" ? admin ? /* @__PURE__ */ jsx(SignInPolicyPage, {}) : /* @__PURE__ */ jsx(Notice, {
|
|
132
134
|
title: "Admins only",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { appPath } from "@protobase/schema";
|
|
2
2
|
//#region src/app/breadcrumb-for.ts
|
|
3
3
|
/** Group, then the page or resource list, then the record (or "New"): each with a page of its own links to it. */
|
|
4
|
-
const breadcrumbFor = ({ basePath, address, group, page, resourceLabel, recordTitle }) => {
|
|
4
|
+
const breadcrumbFor = ({ basePath, address, group, page, resourceLabel, recordTitle, recordLoading }) => {
|
|
5
5
|
const groupCrumb = group ? [group] : [];
|
|
6
6
|
if (page) return [...groupCrumb, {
|
|
7
7
|
label: page.title,
|
|
@@ -19,12 +19,17 @@ const breadcrumbFor = ({ basePath, address, group, page, resourceLabel, recordTi
|
|
|
19
19
|
}, basePath)
|
|
20
20
|
}] : [];
|
|
21
21
|
if (address.kind === "list") return [...groupCrumb, ...resource];
|
|
22
|
+
const href = appPath(address, basePath);
|
|
22
23
|
const record = address.kind === "create" ? {
|
|
23
24
|
label: "New",
|
|
24
|
-
href
|
|
25
|
+
href
|
|
26
|
+
} : recordTitle === void 0 && recordLoading ? {
|
|
27
|
+
label: "Loading record",
|
|
28
|
+
href,
|
|
29
|
+
loading: true
|
|
25
30
|
} : {
|
|
26
31
|
label: recordTitle ?? address.key,
|
|
27
|
-
href
|
|
32
|
+
href
|
|
28
33
|
};
|
|
29
34
|
return [
|
|
30
35
|
...groupCrumb,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Badge } from "../../primitives/badge.js";
|
|
2
|
+
import { Skeleton } from "../../primitives/skeleton.js";
|
|
2
3
|
import { humanize } from "../../live/naming.js";
|
|
3
4
|
import { useProjectUi } from "../pages/project-ui.js";
|
|
4
5
|
import { cardFields } from "./list-displays.js";
|
|
@@ -7,7 +8,6 @@ import { displayValue } from "../../live/display-value.js";
|
|
|
7
8
|
import { shownWidget } from "../field-types/shown-widget.js";
|
|
8
9
|
import { CustomBoundary } from "../pages/custom-boundary.js";
|
|
9
10
|
import { WidgetPart } from "../field-types/widget-part.js";
|
|
10
|
-
import { Skeleton } from "../../primitives/skeleton.js";
|
|
11
11
|
import { toneFor } from "../../live/columns-from-model.js";
|
|
12
12
|
import { DisplayFooter, DisplayState } from "./display-frame.js";
|
|
13
13
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Skeleton } from "../../../primitives/skeleton.js";
|
|
1
2
|
import { useAdminMeta } from "../../meta-gate.js";
|
|
2
3
|
import { ErrorBanner } from "../../error-banner.js";
|
|
3
|
-
import { Skeleton } from "../../../primitives/skeleton.js";
|
|
4
4
|
import { RecordScope } from "../record-scope.js";
|
|
5
5
|
import { scopeOf, useListPage } from "../use-layout-data.js";
|
|
6
6
|
import { propsOf } from "./block-props.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Skeleton } from "../../../primitives/skeleton.js";
|
|
1
2
|
import { humanize } from "../../../live/naming.js";
|
|
2
3
|
import { useAdminMeta } from "../../meta-gate.js";
|
|
3
|
-
import { Skeleton } from "../../../primitives/skeleton.js";
|
|
4
4
|
import { useLayoutRecord } from "../record-scope.js";
|
|
5
5
|
import { propsOf } from "./block-props.js";
|
|
6
6
|
import { FieldValue } from "../field-value.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Skeleton } from "../../../primitives/skeleton.js";
|
|
1
2
|
import { useAdminMeta } from "../../meta-gate.js";
|
|
2
3
|
import { ErrorBanner } from "../../error-banner.js";
|
|
3
|
-
import { Skeleton } from "../../../primitives/skeleton.js";
|
|
4
4
|
import { RecordScope } from "../record-scope.js";
|
|
5
5
|
import { useFirstRecord } from "../use-layout-data.js";
|
|
6
6
|
import { propsOf } from "./block-props.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Skeleton } from "../../../primitives/skeleton.js";
|
|
1
2
|
import { useAdminMeta } from "../../meta-gate.js";
|
|
2
3
|
import { AppLink } from "../../use-app-address.js";
|
|
3
|
-
import { Skeleton } from "../../../primitives/skeleton.js";
|
|
4
4
|
import { useLayoutRecord } from "../record-scope.js";
|
|
5
5
|
import { useCount } from "../use-layout-data.js";
|
|
6
6
|
import { propsOf } from "./block-props.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Skeleton } from "../../../primitives/skeleton.js";
|
|
1
2
|
import { useAdminMeta } from "../../meta-gate.js";
|
|
2
3
|
import { ErrorBanner } from "../../error-banner.js";
|
|
3
|
-
import { Skeleton } from "../../../primitives/skeleton.js";
|
|
4
4
|
import { useListPage } from "../use-layout-data.js";
|
|
5
5
|
import { propsOf } from "./block-props.js";
|
|
6
6
|
import { CardFrame, Quiet } from "./card-frame.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { Skeleton } from "../primitives/skeleton.js";
|
|
1
2
|
import { keys } from "../data/query-keys.js";
|
|
2
3
|
import { useClient } from "../data/api-provider.js";
|
|
3
4
|
import { useAdminMeta } from "./meta-gate.js";
|
|
4
5
|
import { ErrorBanner } from "./error-banner.js";
|
|
5
6
|
import { Section } from "../record-view/section.js";
|
|
6
|
-
import { Skeleton } from "../primitives/skeleton.js";
|
|
7
7
|
import { RecordTable } from "./pages/record-table.js";
|
|
8
8
|
import { defaultColumns } from "./pages/blocks/table.js";
|
|
9
9
|
import { useState } from "react";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { cn } from "../lib/cn.js";
|
|
2
|
+
import { Skeleton } from "../primitives/skeleton.js";
|
|
2
3
|
import { ChevronRight } from "lucide-react";
|
|
3
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
//#region src/app-shell/breadcrumb.tsx
|
|
@@ -9,26 +10,32 @@ const Breadcrumb = ({ parts, onNavigate }) => /* @__PURE__ */ jsx("nav", {
|
|
|
9
10
|
className: "flex min-w-0 items-center gap-1.5 text-[13px]",
|
|
10
11
|
children: parts.map((part, index) => {
|
|
11
12
|
const last = index === parts.length - 1;
|
|
12
|
-
const { label, href } = typeof part === "string" ? {
|
|
13
|
+
const { label, href, loading } = typeof part === "string" ? {
|
|
13
14
|
label: part,
|
|
14
|
-
href: void 0
|
|
15
|
+
href: void 0,
|
|
16
|
+
loading: false
|
|
15
17
|
} : part;
|
|
18
|
+
const content = loading ? /* @__PURE__ */ jsx(Skeleton, { className: "w-24" }) : label;
|
|
16
19
|
const text = cn("truncate", last ? "font-semibold" : "text-muted-foreground");
|
|
17
20
|
return /* @__PURE__ */ jsxs("span", {
|
|
18
21
|
className: cn("min-w-0 items-center gap-1.5", last ? "flex" : "hidden md:flex"),
|
|
19
22
|
children: [index > 0 && /* @__PURE__ */ jsx(ChevronRight, { className: "hidden size-3.5 shrink-0 text-faint-foreground md:block" }), href ? /* @__PURE__ */ jsx("a", {
|
|
20
23
|
href,
|
|
21
24
|
"aria-current": last ? "page" : void 0,
|
|
25
|
+
"aria-label": loading ? label : void 0,
|
|
26
|
+
"aria-busy": loading || void 0,
|
|
22
27
|
onClick: (event) => {
|
|
23
28
|
if (!onNavigate || !inApp(event)) return;
|
|
24
29
|
event.preventDefault();
|
|
25
30
|
onNavigate(href);
|
|
26
31
|
},
|
|
27
32
|
className: cn(text, "rounded-sm hover:text-foreground hover:underline"),
|
|
28
|
-
children:
|
|
33
|
+
children: content
|
|
29
34
|
}) : /* @__PURE__ */ jsx("span", {
|
|
30
35
|
className: text,
|
|
31
|
-
|
|
36
|
+
"aria-label": loading ? label : void 0,
|
|
37
|
+
"aria-busy": loading || void 0,
|
|
38
|
+
children: content
|
|
32
39
|
})]
|
|
33
40
|
}, `${index}-${label}`);
|
|
34
41
|
})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { cn } from "../lib/cn.js";
|
|
2
|
+
import { Skeleton } from "../primitives/skeleton.js";
|
|
2
3
|
import { formatInt } from "../format/number.js";
|
|
3
4
|
import { Checkbox } from "../primitives/checkbox.js";
|
|
4
5
|
import { gridTemplate } from "./grid-template.js";
|
|
5
6
|
import { isRightAligned } from "./column-spec.js";
|
|
6
|
-
import { Skeleton } from "../primitives/skeleton.js";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
//#region src/data-grid/grid-row.tsx
|
|
9
9
|
const frameStyle = (frame) => ({
|
package/dist/package.js
CHANGED