@broberg/app-shell 0.20.1 → 0.21.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/README.md +3 -0
- package/dist/preact.cjs +5 -2
- package/dist/preact.cjs.map +1 -1
- package/dist/preact.d.cts +6 -2
- package/dist/preact.d.ts +6 -2
- package/dist/preact.js +5 -2
- package/dist/preact.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -176,6 +176,9 @@ const [open, setOpen] = useState(false);
|
|
|
176
176
|
testids: `<prefix>-menu`, `<prefix>-action-<id>`, `<prefix>-back`, `<prefix>-input`, `<prefix>-save` — so the
|
|
177
177
|
anchor's own testid must not be `<prefix>-menu`.
|
|
178
178
|
|
|
179
|
+
**0.21.0** — `placement: "up-start"` (F092.31): above the anchor, left edge = the anchor's left edge (clamped
|
|
180
|
+
8px inside the viewport); below if there is no room above. For a «+» in a composer. `auto`/`down` unchanged.
|
|
181
|
+
|
|
179
182
|
## 0.11.1 — the palette list floats over the menu (F001.25)
|
|
180
183
|
|
|
181
184
|
Christian 10/10: «Kunne denne ikke være en pop-over ting så dialogen ikke bliver
|
package/dist/preact.cjs
CHANGED
|
@@ -579,9 +579,12 @@ function ItemActionsMenu(props) {
|
|
|
579
579
|
const vw = window.innerWidth, vh = window.innerHeight, m = 8;
|
|
580
580
|
const w = Math.min(240, vw - 2 * m);
|
|
581
581
|
const h = menu.current?.offsetHeight ?? 0;
|
|
582
|
-
const
|
|
582
|
+
const start = props.placement === "up-start";
|
|
583
|
+
const left = Math.max(m, Math.min(start ? r.left : r.right - w, vw - w - m));
|
|
583
584
|
const fitsBelow = r.bottom + 4 + h <= vh - m;
|
|
584
|
-
const
|
|
585
|
+
const fitsAbove = r.top - 4 - h >= m;
|
|
586
|
+
const below = start ? !fitsAbove : props.placement === "down" || fitsBelow || !fitsAbove;
|
|
587
|
+
const top = below ? Math.min(r.bottom + 4, vh - m - h) : r.top - 4 - h;
|
|
585
588
|
setPos({ position: "fixed", left: `${left}px`, top: `${Math.max(m, top)}px`, width: `${w}px` });
|
|
586
589
|
}, [stack.length]);
|
|
587
590
|
hooks.useLayoutEffect(() => {
|