@protobase/ui 0.15.4 → 0.15.5

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 CHANGED
@@ -169,6 +169,7 @@ const Routes = ({ workspace, sidebarMode, assistant, runtime }) => {
169
169
  recordKey: address.key
170
170
  }, `${address.resource}/${address.key}`) : /* @__PURE__ */ jsx(ListPage, { address }, address.resource);
171
171
  const appShell = /* @__PURE__ */ jsx(AppShell, {
172
+ pageScroll: true,
172
173
  sidebarMode: sidebarMode ?? "text-small",
173
174
  activeItem: place ?? "",
174
175
  breadcrumb,
@@ -6,7 +6,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
6
6
  //#region src/app/create/create-record-form.tsx
7
7
  /** The presentation of "New <thing>": the view's sections, each field with its editor, and Create or Cancel. */
8
8
  const CreateRecordForm = ({ noun, collection, sections, saving, message, onSubmit, onCancel }) => /* @__PURE__ */ jsx("form", {
9
- className: "min-h-0 flex-1 overflow-y-auto",
9
+ className: "flex-1",
10
10
  onSubmit: (event) => {
11
11
  event.preventDefault();
12
12
  onSubmit();
@@ -20,7 +20,7 @@ const CustomDisplay = ({ display, list }) => {
20
20
  return /* @__PURE__ */ jsx(ListDisplayProvider, {
21
21
  value: list,
22
22
  children: /* @__PURE__ */ jsx("div", {
23
- className: "min-h-0 flex-1 overflow-y-auto",
23
+ className: "min-w-0 flex-1 overflow-x-auto",
24
24
  children: /* @__PURE__ */ jsx(CustomBoundary, {
25
25
  name: display.component,
26
26
  children: /* @__PURE__ */ jsx(Component, { ...unmarkFieldRefs(display.props ?? {}) })
@@ -16,8 +16,8 @@
16
16
  </script>
17
17
  </head>
18
18
  <body>
19
- <!-- The page reaches under the iPhone home indicator, which the bottom bar keeps clear of; the sides keep clear of the notch. -->
20
- <div id="root" class="h-screen" style="padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right)"></div>
19
+ <!-- As tall as the screen shows, browser toolbars aside, so a page that fills it, such as a map, keeps the bottom bar in view. The page reaches under the iPhone home indicator, which the bottom bar keeps clear of; the sides keep clear of the notch. -->
20
+ <div id="root" class="h-dvh" style="padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right)"></div>
21
21
  <script type="module" src="./main"></script>
22
22
  </body>
23
23
  </html>
@@ -141,7 +141,7 @@ const LoadedList = ({ model, address, scope, heading }) => {
141
141
  orderBy
142
142
  });
143
143
  const display = shownDisplay(view, address.display);
144
- const pageScroll = !display || display.kind === "cards";
144
+ const pageScroll = display?.kind !== "map";
145
145
  usePageScroll(pageScroll);
146
146
  const displayRows = useDisplayRows(model, rows.page, rows.key, display?.kind === "custom");
147
147
  const scroll = useListScroll();
@@ -15,7 +15,7 @@ const useAdminMeta = () => {
15
15
  return meta;
16
16
  };
17
17
  const Notice = ({ title, children }) => /* @__PURE__ */ jsx("div", {
18
- className: "flex h-full min-h-48 items-center justify-center p-8",
18
+ className: "flex h-full min-h-48 flex-1 items-center justify-center p-8",
19
19
  children: /* @__PURE__ */ jsxs("div", {
20
20
  className: "max-w-md text-center",
21
21
  children: [/* @__PURE__ */ jsx("h1", {
@@ -5,7 +5,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
5
5
  const PageBlock = ({ node, children, slots }) => {
6
6
  const { title, description } = propsOf(node);
7
7
  return /* @__PURE__ */ jsx("div", {
8
- className: "min-h-0 flex-1 overflow-y-auto",
8
+ className: "flex-1",
9
9
  children: /* @__PURE__ */ jsxs("div", {
10
10
  className: "mx-auto flex max-w-[1200px] flex-col gap-6 px-4 pb-16 pt-6 md:px-10 md:py-8",
11
11
  children: [/* @__PURE__ */ jsx(PageHeader, {
@@ -234,11 +234,11 @@ const LoadedRecord = ({ model, recordKey, stored }) => {
234
234
  })
235
235
  ] });
236
236
  return /* @__PURE__ */ jsxs("div", {
237
- className: "flex min-h-0 flex-1 flex-col",
237
+ className: "flex flex-1 flex-col",
238
238
  children: [
239
239
  remove.dialogs,
240
240
  /* @__PURE__ */ jsx("div", {
241
- className: "min-h-0 flex-1 overflow-y-auto",
241
+ className: "flex-1",
242
242
  children: /* @__PURE__ */ jsxs("div", {
243
243
  className: "mx-auto max-w-[1100px] px-4 pb-8 pt-6 md:px-10 md:py-8",
244
244
  children: [
@@ -364,7 +364,7 @@ const LoadedRecord = ({ model, recordKey, stored }) => {
364
364
  })
365
365
  }),
366
366
  (editor.dirty || canDelete || canUpdate) && /* @__PURE__ */ jsx("div", {
367
- className: "flex shrink-0 items-center gap-2 border-t bg-background p-3 md:hidden",
367
+ className: "sticky bottom-[var(--pb-sticky-bottom,0px)] z-20 flex shrink-0 items-center gap-2 border-t bg-background p-3 md:hidden",
368
368
  children: saveControls
369
369
  })
370
370
  ]
@@ -14,7 +14,7 @@ const reason = (error) => {
14
14
  const SourceNotice = ({ status }) => {
15
15
  const queryClient = useQueryClient();
16
16
  if (status.state !== "error") return /* @__PURE__ */ jsxs("div", {
17
- className: "flex h-full min-h-48 items-center justify-center gap-2 text-[13px] text-muted-foreground",
17
+ className: "flex h-full min-h-48 flex-1 items-center justify-center gap-2 text-[13px] text-muted-foreground",
18
18
  children: [
19
19
  /* @__PURE__ */ jsx(Spinner, {}),
20
20
  " Loading from ",
@@ -22,7 +22,7 @@ const SourceNotice = ({ status }) => {
22
22
  ]
23
23
  });
24
24
  return /* @__PURE__ */ jsx("div", {
25
- className: "flex h-full min-h-48 items-center justify-center p-8",
25
+ className: "flex h-full min-h-48 flex-1 items-center justify-center p-8",
26
26
  children: /* @__PURE__ */ jsxs("div", {
27
27
  className: "max-w-md text-center",
28
28
  children: [
@@ -9,14 +9,15 @@ import { useEffect, useRef, useState } from "react";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
10
  //#region src/app-shell/app-shell.tsx
11
11
  const drawerId = "app-drawer";
12
- const AppShell = ({ sidebarMode, activeItem, breadcrumb, user, workspace, actions, rightPanel, forceExpanded, profileMenuOpen, navGroups, userMenu, bottomBar, onNavigate, onSignOut, onSignIn, organizations, roles, theme, search, className, children }) => {
12
+ const AppShell = ({ sidebarMode, activeItem, breadcrumb, user, workspace, actions, rightPanel, forceExpanded, profileMenuOpen, navGroups, userMenu, bottomBar, onNavigate, onSignOut, onSignIn, organizations, roles, theme, search, pageScroll: scrollsByDefault = false, className, children }) => {
13
13
  const desktop = useIsDesktop();
14
14
  const [drawerOpen, setDrawerOpen] = useState(false);
15
15
  useEffect(() => {
16
16
  if (desktop) setDrawerOpen(false);
17
17
  }, [desktop]);
18
18
  const tabs = !desktop && bottomBar && bottomBar.length > 0 ? bottomBar : void 0;
19
- const [pageScroll, setPageScroll] = useState(false);
19
+ const [chosen, setPageScroll] = useState();
20
+ const pageScroll = chosen ?? scrollsByDefault;
20
21
  const topBarRef = useRef(null);
21
22
  const bottomBarRef = useRef(null);
22
23
  usePageInsets(pageScroll, topBarRef, bottomBarRef, Boolean(tabs));
@@ -1,18 +1,19 @@
1
1
  import { createContext, useContext, useLayoutEffect } from "react";
2
2
  //#region src/app-shell/page-scroll.ts
3
- /** Turns the shell's page scrolling on or off; pages use `usePageScroll`. */
3
+ /** Turns the shell's page scrolling on or off, or back to its `pageScroll` with `undefined`; pages use `usePageScroll`. */
4
4
  const PageScrollContext = createContext(() => {});
5
5
  /**
6
6
  * While the calling page is shown and `on`, the document scrolls instead of a box of the screen's height: the top and
7
7
  * bottom bars and the sidebar stick, and the page grows with its content, so the browser's own scrolling applies
8
8
  * throughout, scrolling to the top included, as tapping the status bar on an iPhone does. Sticky content in the page
9
- * stays clear of the bars with `--pb-sticky-top` and `--pb-sticky-bottom`.
9
+ * stays clear of the bars with `--pb-sticky-top` and `--pb-sticky-bottom`. Not `on`, the page fills the box instead,
10
+ * as a map does. Once the page is gone the shell's `pageScroll` applies again.
10
11
  */
11
12
  const usePageScroll = (on) => {
12
13
  const set = useContext(PageScrollContext);
13
14
  useLayoutEffect(() => {
14
15
  set(on);
15
- return () => set(false);
16
+ return () => set(void 0);
16
17
  }, [set, on]);
17
18
  };
18
19
  const properties = [
package/dist/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.15.4";
2
+ var version = "0.15.5";
3
3
  var protobase = { "pluginApi": 1 };
4
4
  //#endregion
5
5
  export { protobase, version };