magic-pill 9.4.0-rc.2 → 9.4.0-rc.3
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/CHANGELOG.md +4 -1
- package/dist/MagicPill/MagicPill.js +6 -3
- package/dist/MagicPill/MagicPill.mjs +6 -3
- package/dist/satellites/Actions.js +21 -6
- package/dist/satellites/Actions.mjs +21 -6
- package/dist/satellites/Satellites.js +36 -11
- package/dist/satellites/Satellites.mjs +36 -12
- package/dist/satellites/types.d.mts +2 -0
- package/dist/satellites/types.d.ts +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
- An electron (or the page's actions) going back into the pill as the group gathers again goes to the pill's end where it now is, instead of where it was when it set off: it ended inside the pill, over its last item, with a doubled shadow at its end
|
|
77
77
|
- With electrons or actions out, a pill changing placement goes there through the circle in one movement, from and to any placement: it used to jump across the screen as it closed (to or from the top and bottom, the start and end placements, between the bottom and a side), laid out for its new placement while still at its old one. Next to another pill of the same side, it no longer flashes aside as it sets off
|
|
78
78
|
- A satellite going into the pill (or coming out of it) does so inside the pill: the page's actions standing upright beside it went in level with their own middle, above the pill, by the electron, and came out there too
|
|
79
|
-
- **Beta:** leaving a page, its actions
|
|
79
|
+
- **Beta:** leaving a page, its actions keep their size as they close to a circle and go into the pill: they turned into a circle in one frame first
|
|
80
80
|
- **Beta:** a satellite told to go back in while it's still coming out goes in from where it's drawn: the page's actions, switched into the pill as they came out, went in as a dot off to the side of the pill, showing where they had waited
|
|
81
81
|
- **Beta:** the page's actions opening in the pill: the pill re-centres in step with them, so its far end (and an electron beside it) moves once, by the difference. Its slide ran ahead of its growth: its far end went 25 px in, then back
|
|
82
82
|
- **Beta:** the page's actions in the pill resize their row for another list (two, then four), the pill and the satellites following, and a shorter list shrinks over the ones leaving before they go, as their own pill does: it changed in one frame
|
|
@@ -89,6 +89,9 @@
|
|
|
89
89
|
- **Beta:** the page's actions in a row of their own above or below the pill (`actionsSide="beside"`) resize for another list from the end lined up with the pill: their new size jumped in at once
|
|
90
90
|
- **Beta:** the page's actions in the pill, cut short by their wheel, no longer grow for a moment the first time another list comes: their row resized from the length it had before the wheel cut it, then shrank back
|
|
91
91
|
- **Beta:** the page's actions switched into the pill, left behind by a page change, or going in for a panel that has no room for them beside it, close to a circle where they stand, then go in as one (the pill waits for them before it takes the next page's shape, and the panel before it opens); switched out, or back on their page, they come out as a circle and open to their pill, then their content shows. The circle is at the pill's level: a column of actions beside a bottom pill closes down to it and goes in from there. They went in as a small pill, at their own proportions
|
|
92
|
+
- **Beta:** the page's actions going to the other side of the pill (their side changed, or another list) close to a circle at the pill's level first, then go in, as everywhere else: they shrank as a pill, at their own proportions
|
|
93
|
+
- **Beta:** the page's actions in the pill, moving to its other side (`actionsSide`), fold away where they are, the pill shrinking with them, then open on the other side: they vanished at once, then opened there
|
|
94
|
+
- **Beta:** a panel closing: the satellites come out of the pill once, at their spot beside it as it will be. Planned beside the closing panel's height, they came out of its top edge, went back into the pill, and came out again
|
|
92
95
|
|
|
93
96
|
### Changed
|
|
94
97
|
- **Beta:** `actionsWheel` is on by default for the page's actions in the pill (`actionsStyle="inside"`): short of room, they show what fits next to the navbar and turn the rest in their wheel; `false` shows them all. Still off by default for a pill of their own
|
|
@@ -300,13 +300,16 @@ const MagicPill = (0, react.forwardRef)(function MagicPill({ name = "main", chil
|
|
|
300
300
|
avoidPills,
|
|
301
301
|
actionsLabel
|
|
302
302
|
} : void 0;
|
|
303
|
-
const inside = satellites && satelliteHost ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(satellites.Inside, {
|
|
303
|
+
const inside = (side) => satellites && satelliteHost ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(satellites.Inside, {
|
|
304
|
+
host: satelliteHost,
|
|
305
|
+
side
|
|
306
|
+
}) : null;
|
|
304
307
|
const renderScene = (shownScene) => {
|
|
305
308
|
switch (shownScene.kind) {
|
|
306
309
|
case "base": return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react.Fragment, { children: [
|
|
307
|
-
|
|
310
|
+
inside("start"),
|
|
308
311
|
lastScenes.current.get(shownScene.key)?.children ?? lastBase.current,
|
|
309
|
-
|
|
312
|
+
inside("end")
|
|
310
313
|
] }, shownScene.key);
|
|
311
314
|
case "idle": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_parts.PillIcon, { children: idleIcon });
|
|
312
315
|
case "notification": {
|
|
@@ -300,13 +300,16 @@ const MagicPill = forwardRef(function MagicPill({ name = "main", children, scene
|
|
|
300
300
|
avoidPills,
|
|
301
301
|
actionsLabel
|
|
302
302
|
} : void 0;
|
|
303
|
-
const inside = satellites && satelliteHost ? /* @__PURE__ */ jsx(satellites.Inside, {
|
|
303
|
+
const inside = (side) => satellites && satelliteHost ? /* @__PURE__ */ jsx(satellites.Inside, {
|
|
304
|
+
host: satelliteHost,
|
|
305
|
+
side
|
|
306
|
+
}) : null;
|
|
304
307
|
const renderScene = (shownScene) => {
|
|
305
308
|
switch (shownScene.kind) {
|
|
306
309
|
case "base": return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
307
|
-
|
|
310
|
+
inside("start"),
|
|
308
311
|
lastScenes.current.get(shownScene.key)?.children ?? lastBase.current,
|
|
309
|
-
|
|
312
|
+
inside("end")
|
|
310
313
|
] }, shownScene.key);
|
|
311
314
|
case "idle": return /* @__PURE__ */ jsx(PillIcon, { children: idleIcon });
|
|
312
315
|
case "notification": {
|
|
@@ -398,9 +398,12 @@ const stopInside = (...elements) => {
|
|
|
398
398
|
* the pill, they wait for their own pill to go back into it; switching away, their own pill waits
|
|
399
399
|
* for them to have gone (handoff.ts).
|
|
400
400
|
*/
|
|
401
|
-
function InsideActions({ host }) {
|
|
401
|
+
function InsideActions({ host, side }) {
|
|
402
402
|
const items = useHostActions(host);
|
|
403
403
|
const handoff = require_handoff.useHandoff(host.store);
|
|
404
|
+
const placeOf = (actionsSide) => actionsSide === "end" ? "end" : "start";
|
|
405
|
+
const here = side ?? placeOf(host.actionsSide);
|
|
406
|
+
const mine = placeOf(host.actionsSide) === here;
|
|
404
407
|
const inside = host.actionsStyle === "inside";
|
|
405
408
|
const [style, setStyle] = (0, react.useState)(host.actionsStyle);
|
|
406
409
|
const [waiting, setWaiting] = (0, react.useState)(false);
|
|
@@ -412,7 +415,17 @@ function InsideActions({ host }) {
|
|
|
412
415
|
(0, react.useEffect)(() => {
|
|
413
416
|
if (waiting) setWaiting(false);
|
|
414
417
|
}, [waiting]);
|
|
415
|
-
const
|
|
418
|
+
const [sideSeen, setSideSeen] = (0, react.useState)(host.actionsSide);
|
|
419
|
+
const [sideWaiting, setSideWaiting] = (0, react.useState)(false);
|
|
420
|
+
const sideWaits = sideSeen !== host.actionsSide ? inside && mine && placeOf(sideSeen) !== here && !!items : sideWaiting;
|
|
421
|
+
if (sideSeen !== host.actionsSide) {
|
|
422
|
+
setSideSeen(host.actionsSide);
|
|
423
|
+
setSideWaiting(sideWaits);
|
|
424
|
+
}
|
|
425
|
+
(0, react.useEffect)(() => {
|
|
426
|
+
if (sideWaiting) setSideWaiting(false);
|
|
427
|
+
}, [sideWaiting]);
|
|
428
|
+
const wanted = inside && mine && handoff !== "in" && handoff !== "side" && !waits && !sideWaits ? items : null;
|
|
416
429
|
const [shown, setShown] = (0, react.useState)(wanted);
|
|
417
430
|
if (wanted && wanted !== shown) setShown(wanted);
|
|
418
431
|
const listed = wanted ?? shown;
|
|
@@ -420,12 +433,13 @@ function InsideActions({ host }) {
|
|
|
420
433
|
const divider = (0, react.useRef)(null);
|
|
421
434
|
const store = host.store;
|
|
422
435
|
const handingOut = leaving && !inside && !!items;
|
|
436
|
+
const movingOver = leaving && inside && !mine && !!items;
|
|
423
437
|
const open = !!listed && !leaving;
|
|
424
438
|
const sideOf = () => {
|
|
425
439
|
const line = divider.current;
|
|
426
440
|
return {
|
|
427
441
|
line,
|
|
428
|
-
list: (
|
|
442
|
+
list: (here === "end" ? line?.nextElementSibling : line?.previousElementSibling) ?? null
|
|
429
443
|
};
|
|
430
444
|
};
|
|
431
445
|
require_react.useIsomorphicLayoutEffect(() => {
|
|
@@ -458,12 +472,13 @@ function InsideActions({ host }) {
|
|
|
458
472
|
require_react.useIsomorphicLayoutEffect(() => {
|
|
459
473
|
if (!leaving) return;
|
|
460
474
|
if (handingOut) require_handoff.setHandoff(store, "out");
|
|
475
|
+
if (movingOver) require_handoff.setHandoff(store, "side");
|
|
461
476
|
const { line, list } = sideOf();
|
|
462
477
|
let cancelled = false;
|
|
463
478
|
const gone = () => {
|
|
464
479
|
if (cancelled) return;
|
|
465
480
|
setShown(null);
|
|
466
|
-
if (require_handoff.getHandoff(store) === "out") require_handoff.setHandoff(store, void 0);
|
|
481
|
+
if (require_handoff.getHandoff(store) === "out" || require_handoff.getHandoff(store) === "side") require_handoff.setHandoff(store, void 0);
|
|
467
482
|
};
|
|
468
483
|
stopInside(list, line);
|
|
469
484
|
const animation = list && line ? playInside(list, line, "out") : void 0;
|
|
@@ -473,7 +488,7 @@ function InsideActions({ host }) {
|
|
|
473
488
|
cancelled = true;
|
|
474
489
|
stopInside(list, line);
|
|
475
490
|
list?.style.removeProperty("overflow");
|
|
476
|
-
if (require_handoff.getHandoff(store) === "out") require_handoff.setHandoff(store, void 0);
|
|
491
|
+
if (require_handoff.getHandoff(store) === "out" || require_handoff.getHandoff(store) === "side") require_handoff.setHandoff(store, void 0);
|
|
477
492
|
};
|
|
478
493
|
}, [leaving]);
|
|
479
494
|
if (!listed) return null;
|
|
@@ -487,7 +502,7 @@ function InsideActions({ host }) {
|
|
|
487
502
|
ref: divider,
|
|
488
503
|
"data-leaving": leaving ? "" : void 0
|
|
489
504
|
});
|
|
490
|
-
return
|
|
505
|
+
return here === "end" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [line, list] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [list, line] });
|
|
491
506
|
}
|
|
492
507
|
|
|
493
508
|
exports.ActionList = ActionList;
|
|
@@ -398,9 +398,12 @@ const stopInside = (...elements) => {
|
|
|
398
398
|
* the pill, they wait for their own pill to go back into it; switching away, their own pill waits
|
|
399
399
|
* for them to have gone (handoff.ts).
|
|
400
400
|
*/
|
|
401
|
-
function InsideActions({ host }) {
|
|
401
|
+
function InsideActions({ host, side }) {
|
|
402
402
|
const items = useHostActions(host);
|
|
403
403
|
const handoff = useHandoff(host.store);
|
|
404
|
+
const placeOf = (actionsSide) => actionsSide === "end" ? "end" : "start";
|
|
405
|
+
const here = side ?? placeOf(host.actionsSide);
|
|
406
|
+
const mine = placeOf(host.actionsSide) === here;
|
|
404
407
|
const inside = host.actionsStyle === "inside";
|
|
405
408
|
const [style, setStyle] = useState(host.actionsStyle);
|
|
406
409
|
const [waiting, setWaiting] = useState(false);
|
|
@@ -412,7 +415,17 @@ function InsideActions({ host }) {
|
|
|
412
415
|
useEffect(() => {
|
|
413
416
|
if (waiting) setWaiting(false);
|
|
414
417
|
}, [waiting]);
|
|
415
|
-
const
|
|
418
|
+
const [sideSeen, setSideSeen] = useState(host.actionsSide);
|
|
419
|
+
const [sideWaiting, setSideWaiting] = useState(false);
|
|
420
|
+
const sideWaits = sideSeen !== host.actionsSide ? inside && mine && placeOf(sideSeen) !== here && !!items : sideWaiting;
|
|
421
|
+
if (sideSeen !== host.actionsSide) {
|
|
422
|
+
setSideSeen(host.actionsSide);
|
|
423
|
+
setSideWaiting(sideWaits);
|
|
424
|
+
}
|
|
425
|
+
useEffect(() => {
|
|
426
|
+
if (sideWaiting) setSideWaiting(false);
|
|
427
|
+
}, [sideWaiting]);
|
|
428
|
+
const wanted = inside && mine && handoff !== "in" && handoff !== "side" && !waits && !sideWaits ? items : null;
|
|
416
429
|
const [shown, setShown] = useState(wanted);
|
|
417
430
|
if (wanted && wanted !== shown) setShown(wanted);
|
|
418
431
|
const listed = wanted ?? shown;
|
|
@@ -420,12 +433,13 @@ function InsideActions({ host }) {
|
|
|
420
433
|
const divider = useRef(null);
|
|
421
434
|
const store = host.store;
|
|
422
435
|
const handingOut = leaving && !inside && !!items;
|
|
436
|
+
const movingOver = leaving && inside && !mine && !!items;
|
|
423
437
|
const open = !!listed && !leaving;
|
|
424
438
|
const sideOf = () => {
|
|
425
439
|
const line = divider.current;
|
|
426
440
|
return {
|
|
427
441
|
line,
|
|
428
|
-
list: (
|
|
442
|
+
list: (here === "end" ? line?.nextElementSibling : line?.previousElementSibling) ?? null
|
|
429
443
|
};
|
|
430
444
|
};
|
|
431
445
|
useIsomorphicLayoutEffect(() => {
|
|
@@ -458,12 +472,13 @@ function InsideActions({ host }) {
|
|
|
458
472
|
useIsomorphicLayoutEffect(() => {
|
|
459
473
|
if (!leaving) return;
|
|
460
474
|
if (handingOut) setHandoff(store, "out");
|
|
475
|
+
if (movingOver) setHandoff(store, "side");
|
|
461
476
|
const { line, list } = sideOf();
|
|
462
477
|
let cancelled = false;
|
|
463
478
|
const gone = () => {
|
|
464
479
|
if (cancelled) return;
|
|
465
480
|
setShown(null);
|
|
466
|
-
if (getHandoff(store) === "out") setHandoff(store, void 0);
|
|
481
|
+
if (getHandoff(store) === "out" || getHandoff(store) === "side") setHandoff(store, void 0);
|
|
467
482
|
};
|
|
468
483
|
stopInside(list, line);
|
|
469
484
|
const animation = list && line ? playInside(list, line, "out") : void 0;
|
|
@@ -473,7 +488,7 @@ function InsideActions({ host }) {
|
|
|
473
488
|
cancelled = true;
|
|
474
489
|
stopInside(list, line);
|
|
475
490
|
list?.style.removeProperty("overflow");
|
|
476
|
-
if (getHandoff(store) === "out") setHandoff(store, void 0);
|
|
491
|
+
if (getHandoff(store) === "out" || getHandoff(store) === "side") setHandoff(store, void 0);
|
|
477
492
|
};
|
|
478
493
|
}, [leaving]);
|
|
479
494
|
if (!listed) return null;
|
|
@@ -487,7 +502,7 @@ function InsideActions({ host }) {
|
|
|
487
502
|
ref: divider,
|
|
488
503
|
"data-leaving": leaving ? "" : void 0
|
|
489
504
|
});
|
|
490
|
-
return
|
|
505
|
+
return here === "end" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [line, list] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [list, line] });
|
|
491
506
|
}
|
|
492
507
|
|
|
493
508
|
export { ActionList, InsideActions, useActionsWheel, useHostActions, usePillActions };
|
|
@@ -158,6 +158,22 @@ function settlesIn(root) {
|
|
|
158
158
|
return left;
|
|
159
159
|
}
|
|
160
160
|
/**
|
|
161
|
+
* The host's height once its morph is over (a panel closing, ms after the satellites come out): they're
|
|
162
|
+
* planned beside the host as it will be. From its height as drawn, the ones coming out above a closing
|
|
163
|
+
* panel came out of its top edge, waited there, then went back in and out again at their spot once it
|
|
164
|
+
* had shrunk (round 5, V6).
|
|
165
|
+
*/
|
|
166
|
+
function settledHeight(root) {
|
|
167
|
+
for (const animation of root.getAnimations?.() ?? []) {
|
|
168
|
+
if (animation.id !== "mp-morph" || animation.playState !== "running") continue;
|
|
169
|
+
const frames = animation.effect?.getKeyframes?.() ?? [];
|
|
170
|
+
const last = frames[frames.length - 1];
|
|
171
|
+
const height = Number.parseFloat(String(last?.height ?? ""));
|
|
172
|
+
if (Number.isFinite(height) && height > 0) return height;
|
|
173
|
+
}
|
|
174
|
+
return root.offsetHeight;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
161
177
|
* Places a satellite, fixed: beside a host at the bottom of the screen, held by its bottom edge as the
|
|
162
178
|
* host is. Safari's toolbar moves the host as the page scrolls (or as a new page comes): they move
|
|
163
179
|
* with it at once, with no pass. Held by their top, they stayed where they were, under the address
|
|
@@ -443,6 +459,8 @@ function SatellitesLayer({ host }) {
|
|
|
443
459
|
const gap = require_measure.toPixels(style.getPropertyValue("--mp-electron-gap"), root, Number.parseFloat(style.columnGap) || 16);
|
|
444
460
|
const offset = require_measure.toPixels(style.getPropertyValue("--_mp-offset"), root, 24);
|
|
445
461
|
const out = entries.filter((entry) => entry.presence !== "hidden" && elements.current.get(entry.electron.id));
|
|
462
|
+
const hostHeight = vertical ? root.offsetHeight : settledHeight(root);
|
|
463
|
+
const hostTop = placement.startsWith("bottom") ? root.offsetTop + root.offsetHeight - hostHeight : root.offsetTop;
|
|
446
464
|
if (animate && !vertical) {
|
|
447
465
|
hostMin.current = require_room.foldedWidth(root);
|
|
448
466
|
hostOpen.current = require_room.unfoldedWidth(root);
|
|
@@ -475,12 +493,12 @@ function SatellitesLayer({ host }) {
|
|
|
475
493
|
},
|
|
476
494
|
host: squeezed ? alignedBox(root, placement, vertical, style.direction === "rtl", {
|
|
477
495
|
width: hostMin.current,
|
|
478
|
-
height:
|
|
496
|
+
height: hostHeight
|
|
479
497
|
}) : {
|
|
480
498
|
left: root.offsetLeft,
|
|
481
|
-
top:
|
|
499
|
+
top: hostTop,
|
|
482
500
|
width: root.offsetWidth,
|
|
483
|
-
height:
|
|
501
|
+
height: hostHeight
|
|
484
502
|
},
|
|
485
503
|
hostMin: vertical ? void 0 : hostMin.current,
|
|
486
504
|
placement,
|
|
@@ -502,11 +520,11 @@ function SatellitesLayer({ host }) {
|
|
|
502
520
|
const canFold = !vertical && open !== void 0 && least !== void 0 && least < open - .5;
|
|
503
521
|
const openBox = canFold ? alignedBox(root, placement, vertical, rtl, {
|
|
504
522
|
width: open,
|
|
505
|
-
height:
|
|
523
|
+
height: hostHeight
|
|
506
524
|
}) : void 0;
|
|
507
525
|
const foldedBox = canFold ? alignedBox(root, placement, vertical, rtl, {
|
|
508
526
|
width: least,
|
|
509
|
-
height:
|
|
527
|
+
height: hostHeight
|
|
510
528
|
}) : void 0;
|
|
511
529
|
const asOpen = canFold ? require_layout.planSatellites({
|
|
512
530
|
...input,
|
|
@@ -534,7 +552,7 @@ function SatellitesLayer({ host }) {
|
|
|
534
552
|
if (whole > 0) {
|
|
535
553
|
panelBox = alignedBox(root, placement, vertical, rtl, {
|
|
536
554
|
width: whole,
|
|
537
|
-
height:
|
|
555
|
+
height: hostHeight
|
|
538
556
|
});
|
|
539
557
|
panelPlan = require_layout.planSatellites({
|
|
540
558
|
...input,
|
|
@@ -579,7 +597,7 @@ function SatellitesLayer({ host }) {
|
|
|
579
597
|
actions: actionsInput(detached && !!actions && !!atomElement)
|
|
580
598
|
}) : layout;
|
|
581
599
|
if (animate && host.actionsStyle === "inside") {
|
|
582
|
-
const track = root.querySelector("[data-mp=\"actions\"][data-inside]");
|
|
600
|
+
const track = root.querySelector("[data-mp=\"actions\"][data-inside]:not([data-leaving])");
|
|
583
601
|
if (track) {
|
|
584
602
|
const hostLength = hostOpen.current ?? (hostMin.current !== void 0 ? Math.min(root.offsetWidth, hostMin.current) : void 0);
|
|
585
603
|
const length = host.actionsWheel ? insideWheelLength(track, root, vertical, mainRoom(vertical, offset) - layout.reserve, hostLength, vertical ? void 0 : require_room.foldedWidth(root, { content: true })) : void 0;
|
|
@@ -611,9 +629,9 @@ function SatellitesLayer({ host }) {
|
|
|
611
629
|
const spotOf = (box) => `${alongOf(box) < hostAlong ? "before" : "after"} ${rowOf(box)}`;
|
|
612
630
|
const hostAt = () => ({
|
|
613
631
|
left: root.offsetLeft + (vertical ? 0 : applied.current.shift),
|
|
614
|
-
top:
|
|
632
|
+
top: hostTop + (vertical ? applied.current.shift : 0),
|
|
615
633
|
width: root.offsetWidth,
|
|
616
|
-
height:
|
|
634
|
+
height: hostHeight
|
|
617
635
|
});
|
|
618
636
|
const along = !vertical && trip === layout ? plannedHost : void 0;
|
|
619
637
|
const splitAt = () => along ? {
|
|
@@ -793,13 +811,19 @@ function SatellitesLayer({ host }) {
|
|
|
793
811
|
duration: 6e4,
|
|
794
812
|
fill: "forwards"
|
|
795
813
|
}) : void 0;
|
|
796
|
-
|
|
814
|
+
const timings = require_measure.durations(atomElement);
|
|
815
|
+
const closing = require_circle.closingTime(timings);
|
|
816
|
+
rejoining.current.add(ACTIONS);
|
|
817
|
+
drop(root, atomElement, "join", closing, timings.exit, void 0, void 0, 0, require_circle.circleSpot(level));
|
|
818
|
+
require_circle.closeToCircle(atomElement, old?.width ?? atomElement.offsetWidth, old?.height ?? atomElement.offsetHeight, timings.exit, level, timings);
|
|
819
|
+
setTimeout(() => {
|
|
820
|
+
rejoining.current.delete(ACTIONS);
|
|
797
821
|
hold?.cancel();
|
|
798
822
|
presences.current.set(ACTIONS, "hidden");
|
|
799
823
|
spots.current.delete(ACTIONS);
|
|
800
824
|
setActionsAcross(turnTo);
|
|
801
825
|
refresh();
|
|
802
|
-
});
|
|
826
|
+
}, closing + timings.exit + 20);
|
|
803
827
|
} else if (animate && atomOut && !settled && !rejoining.current.has(ACTIONS) && !spotHold) setActionsAcross(layout.actionsAcross);
|
|
804
828
|
const from = turnFrom.current;
|
|
805
829
|
if (turnPhase.current === "closing" && from) {
|
|
@@ -1165,4 +1189,5 @@ function SatellitesLayer({ host }) {
|
|
|
1165
1189
|
|
|
1166
1190
|
exports.SatellitesLayer = SatellitesLayer;
|
|
1167
1191
|
exports.drop = drop;
|
|
1192
|
+
exports.settledHeight = settledHeight;
|
|
1168
1193
|
exports.settlesIn = settlesIn;
|
|
@@ -158,6 +158,22 @@ function settlesIn(root) {
|
|
|
158
158
|
return left;
|
|
159
159
|
}
|
|
160
160
|
/**
|
|
161
|
+
* The host's height once its morph is over (a panel closing, ms after the satellites come out): they're
|
|
162
|
+
* planned beside the host as it will be. From its height as drawn, the ones coming out above a closing
|
|
163
|
+
* panel came out of its top edge, waited there, then went back in and out again at their spot once it
|
|
164
|
+
* had shrunk (round 5, V6).
|
|
165
|
+
*/
|
|
166
|
+
function settledHeight(root) {
|
|
167
|
+
for (const animation of root.getAnimations?.() ?? []) {
|
|
168
|
+
if (animation.id !== "mp-morph" || animation.playState !== "running") continue;
|
|
169
|
+
const frames = animation.effect?.getKeyframes?.() ?? [];
|
|
170
|
+
const last = frames[frames.length - 1];
|
|
171
|
+
const height = Number.parseFloat(String(last?.height ?? ""));
|
|
172
|
+
if (Number.isFinite(height) && height > 0) return height;
|
|
173
|
+
}
|
|
174
|
+
return root.offsetHeight;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
161
177
|
* Places a satellite, fixed: beside a host at the bottom of the screen, held by its bottom edge as the
|
|
162
178
|
* host is. Safari's toolbar moves the host as the page scrolls (or as a new page comes): they move
|
|
163
179
|
* with it at once, with no pass. Held by their top, they stayed where they were, under the address
|
|
@@ -443,6 +459,8 @@ function SatellitesLayer({ host }) {
|
|
|
443
459
|
const gap = toPixels(style.getPropertyValue("--mp-electron-gap"), root, Number.parseFloat(style.columnGap) || 16);
|
|
444
460
|
const offset = toPixels(style.getPropertyValue("--_mp-offset"), root, 24);
|
|
445
461
|
const out = entries.filter((entry) => entry.presence !== "hidden" && elements.current.get(entry.electron.id));
|
|
462
|
+
const hostHeight = vertical ? root.offsetHeight : settledHeight(root);
|
|
463
|
+
const hostTop = placement.startsWith("bottom") ? root.offsetTop + root.offsetHeight - hostHeight : root.offsetTop;
|
|
446
464
|
if (animate && !vertical) {
|
|
447
465
|
hostMin.current = foldedWidth(root);
|
|
448
466
|
hostOpen.current = unfoldedWidth(root);
|
|
@@ -475,12 +493,12 @@ function SatellitesLayer({ host }) {
|
|
|
475
493
|
},
|
|
476
494
|
host: squeezed ? alignedBox(root, placement, vertical, style.direction === "rtl", {
|
|
477
495
|
width: hostMin.current,
|
|
478
|
-
height:
|
|
496
|
+
height: hostHeight
|
|
479
497
|
}) : {
|
|
480
498
|
left: root.offsetLeft,
|
|
481
|
-
top:
|
|
499
|
+
top: hostTop,
|
|
482
500
|
width: root.offsetWidth,
|
|
483
|
-
height:
|
|
501
|
+
height: hostHeight
|
|
484
502
|
},
|
|
485
503
|
hostMin: vertical ? void 0 : hostMin.current,
|
|
486
504
|
placement,
|
|
@@ -502,11 +520,11 @@ function SatellitesLayer({ host }) {
|
|
|
502
520
|
const canFold = !vertical && open !== void 0 && least !== void 0 && least < open - .5;
|
|
503
521
|
const openBox = canFold ? alignedBox(root, placement, vertical, rtl, {
|
|
504
522
|
width: open,
|
|
505
|
-
height:
|
|
523
|
+
height: hostHeight
|
|
506
524
|
}) : void 0;
|
|
507
525
|
const foldedBox = canFold ? alignedBox(root, placement, vertical, rtl, {
|
|
508
526
|
width: least,
|
|
509
|
-
height:
|
|
527
|
+
height: hostHeight
|
|
510
528
|
}) : void 0;
|
|
511
529
|
const asOpen = canFold ? planSatellites({
|
|
512
530
|
...input,
|
|
@@ -534,7 +552,7 @@ function SatellitesLayer({ host }) {
|
|
|
534
552
|
if (whole > 0) {
|
|
535
553
|
panelBox = alignedBox(root, placement, vertical, rtl, {
|
|
536
554
|
width: whole,
|
|
537
|
-
height:
|
|
555
|
+
height: hostHeight
|
|
538
556
|
});
|
|
539
557
|
panelPlan = planSatellites({
|
|
540
558
|
...input,
|
|
@@ -579,7 +597,7 @@ function SatellitesLayer({ host }) {
|
|
|
579
597
|
actions: actionsInput(detached && !!actions && !!atomElement)
|
|
580
598
|
}) : layout;
|
|
581
599
|
if (animate && host.actionsStyle === "inside") {
|
|
582
|
-
const track = root.querySelector("[data-mp=\"actions\"][data-inside]");
|
|
600
|
+
const track = root.querySelector("[data-mp=\"actions\"][data-inside]:not([data-leaving])");
|
|
583
601
|
if (track) {
|
|
584
602
|
const hostLength = hostOpen.current ?? (hostMin.current !== void 0 ? Math.min(root.offsetWidth, hostMin.current) : void 0);
|
|
585
603
|
const length = host.actionsWheel ? insideWheelLength(track, root, vertical, mainRoom(vertical, offset) - layout.reserve, hostLength, vertical ? void 0 : foldedWidth(root, { content: true })) : void 0;
|
|
@@ -611,9 +629,9 @@ function SatellitesLayer({ host }) {
|
|
|
611
629
|
const spotOf = (box) => `${alongOf(box) < hostAlong ? "before" : "after"} ${rowOf(box)}`;
|
|
612
630
|
const hostAt = () => ({
|
|
613
631
|
left: root.offsetLeft + (vertical ? 0 : applied.current.shift),
|
|
614
|
-
top:
|
|
632
|
+
top: hostTop + (vertical ? applied.current.shift : 0),
|
|
615
633
|
width: root.offsetWidth,
|
|
616
|
-
height:
|
|
634
|
+
height: hostHeight
|
|
617
635
|
});
|
|
618
636
|
const along = !vertical && trip === layout ? plannedHost : void 0;
|
|
619
637
|
const splitAt = () => along ? {
|
|
@@ -793,13 +811,19 @@ function SatellitesLayer({ host }) {
|
|
|
793
811
|
duration: 6e4,
|
|
794
812
|
fill: "forwards"
|
|
795
813
|
}) : void 0;
|
|
796
|
-
|
|
814
|
+
const timings = durations(atomElement);
|
|
815
|
+
const closing = closingTime(timings);
|
|
816
|
+
rejoining.current.add(ACTIONS);
|
|
817
|
+
drop(root, atomElement, "join", closing, timings.exit, void 0, void 0, 0, circleSpot(level));
|
|
818
|
+
closeToCircle(atomElement, old?.width ?? atomElement.offsetWidth, old?.height ?? atomElement.offsetHeight, timings.exit, level, timings);
|
|
819
|
+
setTimeout(() => {
|
|
820
|
+
rejoining.current.delete(ACTIONS);
|
|
797
821
|
hold?.cancel();
|
|
798
822
|
presences.current.set(ACTIONS, "hidden");
|
|
799
823
|
spots.current.delete(ACTIONS);
|
|
800
824
|
setActionsAcross(turnTo);
|
|
801
825
|
refresh();
|
|
802
|
-
});
|
|
826
|
+
}, closing + timings.exit + 20);
|
|
803
827
|
} else if (animate && atomOut && !settled && !rejoining.current.has(ACTIONS) && !spotHold) setActionsAcross(layout.actionsAcross);
|
|
804
828
|
const from = turnFrom.current;
|
|
805
829
|
if (turnPhase.current === "closing" && from) {
|
|
@@ -1163,4 +1187,4 @@ function SatellitesLayer({ host }) {
|
|
|
1163
1187
|
] });
|
|
1164
1188
|
}
|
|
1165
1189
|
|
|
1166
|
-
export { SatellitesLayer, drop, settlesIn };
|
|
1190
|
+
export { SatellitesLayer, drop, settledHeight, settlesIn };
|
|
@@ -73,7 +73,9 @@ export interface PillSatellites {
|
|
|
73
73
|
host: SatelliteHost;
|
|
74
74
|
}>;
|
|
75
75
|
/** The page's actions in the pill itself, after a divider (`actionsStyle="inside"`) */
|
|
76
|
+
/** `side`: which of its two places in the pill this one is (before the content, or after it) */
|
|
76
77
|
Inside: ComponentType<{
|
|
77
78
|
host: SatelliteHost;
|
|
79
|
+
side?: "start" | "end";
|
|
78
80
|
}>;
|
|
79
81
|
}
|
|
@@ -73,7 +73,9 @@ export interface PillSatellites {
|
|
|
73
73
|
host: SatelliteHost;
|
|
74
74
|
}>;
|
|
75
75
|
/** The page's actions in the pill itself, after a divider (`actionsStyle="inside"`) */
|
|
76
|
+
/** `side`: which of its two places in the pill this one is (before the content, or after it) */
|
|
76
77
|
Inside: ComponentType<{
|
|
77
78
|
host: SatelliteHost;
|
|
79
|
+
side?: "start" | "end";
|
|
78
80
|
}>;
|
|
79
81
|
}
|