@broberg/app-shell 0.22.0 → 0.22.2

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/preact.js CHANGED
@@ -576,7 +576,7 @@ function ItemActionsMenu(props) {
576
576
  useLayoutEffect(() => {
577
577
  const r = props.anchor.getBoundingClientRect();
578
578
  const vw = window.innerWidth, vh = window.innerHeight, m = 8;
579
- const w = Math.min(240, vw - 2 * m);
579
+ const w = Math.min(Math.max(240, menu.current?.offsetWidth ?? 0), vw - 2 * m);
580
580
  const h = menu.current?.offsetHeight ?? 0;
581
581
  const start = props.placement === "up-start";
582
582
  const left = Math.max(m, Math.min(start ? r.left : r.right - w, vw - w - m));
@@ -584,7 +584,7 @@ function ItemActionsMenu(props) {
584
584
  const fitsAbove = r.top - 4 - h >= m;
585
585
  const below = start ? !fitsAbove : props.placement === "down" || fitsBelow || !fitsAbove;
586
586
  const top = below ? Math.min(r.bottom + 4, vh - m - h) : r.top - 4 - h;
587
- setPos({ position: "fixed", left: `${left}px`, top: `${Math.max(m, top)}px`, width: `${w}px` });
587
+ setPos({ position: "fixed", left: `${left}px`, top: `${Math.max(m, top)}px` });
588
588
  }, [stack.length]);
589
589
  useLayoutEffect(() => {
590
590
  if (!pos) return;
@@ -668,7 +668,7 @@ function ItemActionsMenu(props) {
668
668
  tabIndex: -1,
669
669
  "aria-label": view.kind === "list" && view.title ? view.title : props.label,
670
670
  "data-testid": `${pre}-menu`,
671
- style: pos ?? { position: "fixed", visibility: "hidden" },
671
+ style: pos ?? { position: "fixed", left: "0px", top: "0px", visibility: "hidden" },
672
672
  onKeyDown,
673
673
  children: [
674
674
  stack.length > 1 ? /* @__PURE__ */ jsxs("button", { type: "button", class: "bas-rowmenu__back", "data-testid": `${pre}-back`, "aria-label": t.back, onClick: back, children: [
@@ -1482,13 +1482,16 @@ function UserMenu(p) {
1482
1482
  ] })
1483
1483
  ] }) })
1484
1484
  ] }) : null,
1485
- p.onSignOut ? /* @__PURE__ */ jsxs(Fragment, { children: [
1486
- /* @__PURE__ */ jsx("div", { class: "bas-sep" }),
1487
- /* @__PURE__ */ jsxs("button", { type: "button", class: "bas-mi is-danger", role: "menuitem", "data-testid": "topbar-sign-out", disabled: busy, onClick: () => void signOut(), children: [
1488
- /* @__PURE__ */ jsx(IconLogOut, {}),
1489
- /* @__PURE__ */ jsx("span", { children: t.signOut })
1485
+ p.onSignOut ? (
1486
+ // F092.34 — its own block, so the sidebar menu can pin it to the bottom while the middle scrolls.
1487
+ /* @__PURE__ */ jsxs("div", { class: "bas-menu__foot", children: [
1488
+ /* @__PURE__ */ jsx("div", { class: "bas-sep" }),
1489
+ /* @__PURE__ */ jsxs("button", { type: "button", class: "bas-mi is-danger", role: "menuitem", "data-testid": "topbar-sign-out", disabled: busy, onClick: () => void signOut(), children: [
1490
+ /* @__PURE__ */ jsx(IconLogOut, {}),
1491
+ /* @__PURE__ */ jsx("span", { children: t.signOut })
1492
+ ] })
1490
1493
  ] })
1491
- ] }) : null
1494
+ ) : null
1492
1495
  ] }) : null
1493
1496
  ] });
1494
1497
  }