@domicile-desktop/manganese-window-management 1.2.0 → 2.0.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/package.json +29 -19
- package/src/AppPopup.tsx +22 -10
- package/src/AppWindow.tsx +146 -68
- package/src/BrowserWindow.tsx +393 -33
- package/src/FocusGlow.tsx +5 -1
- package/src/GroupTitleBar.tsx +80 -0
- package/src/GroupWell.tsx +5 -1
- package/src/SelectionTint.tsx +5 -1
- package/src/Stage.tsx +381 -106
- package/src/StripEnd.tsx +1 -1
- package/src/TabStrip.tsx +16 -1
- package/src/TitleBar.tsx +277 -124
- package/src/WindowFrame.tsx +106 -26
- package/src/WindowTitleBar.tsx +11 -2
- package/src/browser/AddressBar.tsx +46 -37
- package/src/browser/AppMenuBar.tsx +106 -0
- package/src/browser/AppPopupMenu.tsx +45 -0
- package/src/browser/ConnectionIndicator.tsx +2 -2
- package/src/browser/HistoryButton.tsx +150 -0
- package/src/browser/PageMenu.tsx +20 -6
- package/src/browser/PageProblem.tsx +280 -0
- package/src/browser/PageTooltip.tsx +76 -0
- package/src/browser/PageViews.tsx +101 -0
- package/src/browser/ProfileMenu.tsx +332 -0
- package/src/browser/app-window-shape.ts +33 -0
- package/src/browser/page-history.ts +54 -0
- package/src/browser/page-menu.ts +85 -9
- package/src/browser/profile-ink.ts +17 -0
- package/src/browser/useAppMenuBar.ts +51 -0
- package/src/browser/useAppMessageBox.ts +47 -0
- package/src/browser/useAppPopupMenu.ts +49 -0
- package/src/browser/useAppWindowLooks.ts +49 -0
- package/src/browser/useAppWindowState.ts +59 -0
- package/src/browser/useBrowserProfile.ts +230 -0
- package/src/browser/useLongPress.ts +66 -0
- package/src/captured-element.ts +18 -0
- package/src/closing.ts +33 -15
- package/src/crossing.ts +64 -0
- package/src/floating/FloatGrab.tsx +10 -0
- package/src/floating/FloatShadow.tsx +5 -1
- package/src/floating/useFloatBorderDrag.ts +17 -59
- package/src/floating/useFloatDrag.ts +3 -2
- package/src/follow-press.ts +55 -0
- package/src/handed-drag.ts +57 -0
- package/src/keyboard/command.ts +160 -9
- package/src/keyboard/commands.ts +62 -6
- package/src/keyboard/query.ts +94 -0
- package/src/keyboard/useKeybindings.ts +69 -13
- package/src/overview/OverviewBackdrop.tsx +246 -0
- package/src/overview/OverviewPicker.tsx +453 -0
- package/src/overview/fixture.ts +76 -0
- package/src/overview/overview.ts +112 -0
- package/src/overview/seen-styles.ts +132 -0
- package/src/overview/sight.ts +86 -0
- package/src/overview/steering.ts +85 -0
- package/src/overview/tiles.ts +209 -0
- package/src/overview/useOverviewPhase.ts +35 -0
- package/src/own-animation.ts +24 -0
- package/src/panda-preset.ts +91 -3
- package/src/picture-in-picture/PictureInPictureFloats.tsx +865 -0
- package/src/picture-in-picture/page-of.ts +25 -0
- package/src/picture-in-picture/pip-box.ts +156 -0
- package/src/picture-in-picture/playhead.ts +33 -0
- package/src/placement.ts +20 -11
- package/src/pointer-confinement.ts +107 -0
- package/src/pointer-lock.ts +113 -0
- package/src/popup.ts +25 -37
- package/src/recorded-settles.ts +6 -2
- package/src/restacking.ts +4 -3
- package/src/screens/popup-scene.ts +38 -0
- package/src/screens/reading-order.ts +29 -0
- package/src/shown.ts +10 -0
- package/src/sliding-screen.ts +12 -0
- package/src/tab-drop.ts +43 -0
- package/src/tab-switch.ts +5 -1
- package/src/tiled/TileGrab.tsx +11 -1
- package/src/tiled/aim.ts +77 -39
- package/src/tiled/borders.ts +10 -2
- package/src/tiled/tab-targets.ts +37 -0
- package/src/tiled/useBorderDrag.ts +18 -42
- package/src/tiled/useTileDrag.ts +8 -7
- package/src/tree/drop.ts +118 -23
- package/src/tree/frames.ts +2 -2
- package/src/tree/layout.ts +71 -11
- package/src/tree/move.ts +8 -27
- package/src/useHandedPress.ts +25 -0
- package/src/usePageProblem.ts +80 -0
- package/src/usePageTooltip.ts +48 -0
- package/src/usePointerConfinement.ts +103 -0
- package/src/usePointerLock.ts +12 -0
- package/src/useSettling.ts +38 -9
- package/src/useTabDrop.ts +65 -0
- package/src/useWindowMotion.ts +109 -10
- package/src/useWindows.ts +112 -19
- package/src/window-changes.ts +13 -3
- package/src/window-log.ts +106 -0
- package/src/window-motion.ts +34 -0
- package/src/window-state.ts +629 -66
- package/src/window-styles.ts +96 -4
- package/src/window.ts +14 -0
- package/src/workspace.ts +11 -5
- package/src/workspaces-context.ts +6 -1
- package/styled-system/patterns/aspect-ratio.mjs +2 -2
- package/styled-system/patterns/bleed.mjs +1 -2
- package/styled-system/patterns/float.mjs +5 -11
- package/styled-system/patterns/grid-item.mjs +1 -2
- package/styled-system/patterns/grid.mjs +1 -2
- package/styled-system/patterns/link-overlay.mjs +1 -1
- package/styled-system/patterns/spacer.mjs +3 -3
- package/styled-system/patterns/visually-hidden.mjs +1 -1
- package/styled-system/styles.css +2885 -2108
- package/styled-system/tokens/index.mjs +7 -3
- package/styled-system/tokens/tokens.d.ts +2 -2
- package/styled-system/types/prop-type.d.ts +2 -2
package/src/FocusGlow.tsx
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { useRef } from "react";
|
|
1
|
+
import { useContext, useRef } from "react";
|
|
2
2
|
|
|
3
3
|
import { css, cva, cx } from "../styled-system/css";
|
|
4
4
|
import type { Rect } from "./rect";
|
|
5
5
|
import type { Restack } from "./restacking";
|
|
6
|
+
import { SlidingScreen } from "./sliding-screen";
|
|
6
7
|
import { useLowered } from "./useLowered";
|
|
7
8
|
import type { Settler } from "./useSettling";
|
|
8
9
|
import { useSettling } from "./useSettling";
|
|
9
10
|
import type { WindowMotion } from "./window-motion";
|
|
10
11
|
import { isMoving } from "./window-motion";
|
|
11
12
|
import {
|
|
13
|
+
clippedAlong,
|
|
12
14
|
heldStyles,
|
|
13
15
|
movingStyles,
|
|
14
16
|
originOf,
|
|
@@ -67,6 +69,7 @@ export const FocusGlow = ({
|
|
|
67
69
|
}: Props) => {
|
|
68
70
|
const element = useRef<HTMLDivElement>(null);
|
|
69
71
|
const lowered = useLowered(depth);
|
|
72
|
+
const sliding = useContext(SlidingScreen);
|
|
70
73
|
useSettling({
|
|
71
74
|
element,
|
|
72
75
|
origin: originOf(rect, rect),
|
|
@@ -93,6 +96,7 @@ export const FocusGlow = ({
|
|
|
93
96
|
ref={element}
|
|
94
97
|
style={{
|
|
95
98
|
...placedAt(rect, depth),
|
|
99
|
+
...clippedAlong(sliding, rect),
|
|
96
100
|
...scaledAbout(rect, rect),
|
|
97
101
|
...shuffledBy(restack),
|
|
98
102
|
}}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
|
|
3
|
+
import { TitleBar } from "./TitleBar";
|
|
4
|
+
import type { Aim, DropTargets } from "./tiled/aim";
|
|
5
|
+
import { useTileDrag } from "./tiled/useTileDrag";
|
|
6
|
+
import type { Layout } from "./tree/node";
|
|
7
|
+
import type { NodeRef } from "./tree/path";
|
|
8
|
+
|
|
9
|
+
/** The primary button, as `PointerEvent.button` numbers it. */
|
|
10
|
+
const PRIMARY_BUTTON = 0;
|
|
11
|
+
|
|
12
|
+
type Props = Omit<
|
|
13
|
+
ComponentProps<typeof TitleBar>,
|
|
14
|
+
"grabbing" | "group" | "onPointerDown"
|
|
15
|
+
> & {
|
|
16
|
+
/** The group's layout and the windows it holds. */
|
|
17
|
+
group: { layout: Layout; windows: readonly string[] };
|
|
18
|
+
/** The group. */
|
|
19
|
+
node: NodeRef;
|
|
20
|
+
/** Where the dragged group would land if dropped now. */
|
|
21
|
+
onAim: (aim: Aim | undefined) => void;
|
|
22
|
+
onDrop: () => void;
|
|
23
|
+
/** The group dropped where it was aimed. See `useTileDrag`. */
|
|
24
|
+
onDropOn: (aim: Aim) => void;
|
|
25
|
+
/** The group taken hold of. */
|
|
26
|
+
onGrab: () => void;
|
|
27
|
+
/** A press on the tab, which shows the group. */
|
|
28
|
+
onPress: () => void;
|
|
29
|
+
/** A move of the group was pulled. See `useTileDrag`. */
|
|
30
|
+
onPull: () => void;
|
|
31
|
+
/** What the group can be dropped on, on every screen. */
|
|
32
|
+
targets: DropTargets;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The tab of a group nested in another group's strip. A press shows the
|
|
37
|
+
* group, and a drag with the primary button moves it as a tiled window's tab
|
|
38
|
+
* moves: along its strip, or out to another strip, window or screen.
|
|
39
|
+
*/
|
|
40
|
+
export const GroupTitleBar = ({
|
|
41
|
+
node,
|
|
42
|
+
onAim,
|
|
43
|
+
onDrop,
|
|
44
|
+
onDropOn,
|
|
45
|
+
onGrab,
|
|
46
|
+
onPress,
|
|
47
|
+
onPull,
|
|
48
|
+
targets,
|
|
49
|
+
...bar
|
|
50
|
+
}: Props) => {
|
|
51
|
+
const { drag, onPointerDown } = useTileDrag({
|
|
52
|
+
dragged: { node, windows: bar.group.windows },
|
|
53
|
+
frame: bar.rect,
|
|
54
|
+
onAim,
|
|
55
|
+
onDrop,
|
|
56
|
+
onDropOn,
|
|
57
|
+
onGrab,
|
|
58
|
+
onPull,
|
|
59
|
+
onStretch: doesNotStretch,
|
|
60
|
+
resizes: false,
|
|
61
|
+
targets,
|
|
62
|
+
});
|
|
63
|
+
return (
|
|
64
|
+
<TitleBar
|
|
65
|
+
{...bar}
|
|
66
|
+
grabbing={drag?.pulled === true}
|
|
67
|
+
onPointerDown={(event) => {
|
|
68
|
+
onPress();
|
|
69
|
+
if (event.button === PRIMARY_BUTTON) {
|
|
70
|
+
onPointerDown(event);
|
|
71
|
+
}
|
|
72
|
+
}}
|
|
73
|
+
/>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/** Never called: a tab only moves its group. */
|
|
78
|
+
const doesNotStretch = () => {
|
|
79
|
+
throw new Error("group title bar: a tab does not resize its group");
|
|
80
|
+
};
|
package/src/GroupWell.tsx
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { useRef } from "react";
|
|
1
|
+
import { useContext, useRef } from "react";
|
|
2
2
|
|
|
3
3
|
import { cva, cx } from "../styled-system/css";
|
|
4
4
|
import type { Rect } from "./rect";
|
|
5
5
|
import type { Restack } from "./restacking";
|
|
6
|
+
import { SlidingScreen } from "./sliding-screen";
|
|
6
7
|
import { useLowered } from "./useLowered";
|
|
7
8
|
import { useSettling } from "./useSettling";
|
|
8
9
|
import type { WindowMotion } from "./window-motion";
|
|
9
10
|
import { isMoving } from "./window-motion";
|
|
10
11
|
import {
|
|
12
|
+
clippedAlong,
|
|
11
13
|
heldStyles,
|
|
12
14
|
movingStyles,
|
|
13
15
|
originOf,
|
|
@@ -58,6 +60,7 @@ export const GroupWell = ({
|
|
|
58
60
|
}: Props) => {
|
|
59
61
|
const element = useRef<HTMLDivElement>(null);
|
|
60
62
|
const lowered = useLowered(depth);
|
|
63
|
+
const sliding = useContext(SlidingScreen);
|
|
61
64
|
useSettling({
|
|
62
65
|
element,
|
|
63
66
|
origin: originOf(rect, rect),
|
|
@@ -76,6 +79,7 @@ export const GroupWell = ({
|
|
|
76
79
|
ref={element}
|
|
77
80
|
style={{
|
|
78
81
|
...placedAt(rect, depth),
|
|
82
|
+
...clippedAlong(sliding, rect),
|
|
79
83
|
...scaledAbout(rect, rect),
|
|
80
84
|
...shuffledBy(restack),
|
|
81
85
|
}}
|
package/src/SelectionTint.tsx
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { useRef } from "react";
|
|
1
|
+
import { useContext, useRef } from "react";
|
|
2
2
|
|
|
3
3
|
import { css, cx } from "../styled-system/css";
|
|
4
4
|
import type { Rect } from "./rect";
|
|
5
5
|
import type { Restack } from "./restacking";
|
|
6
|
+
import { SlidingScreen } from "./sliding-screen";
|
|
6
7
|
import { useLowered } from "./useLowered";
|
|
7
8
|
import type { Settler } from "./useSettling";
|
|
8
9
|
import { useSettling } from "./useSettling";
|
|
9
10
|
import type { WindowMotion } from "./window-motion";
|
|
10
11
|
import { isMoving } from "./window-motion";
|
|
11
12
|
import {
|
|
13
|
+
clippedAlong,
|
|
12
14
|
heldStyles,
|
|
13
15
|
movingStyles,
|
|
14
16
|
originOf,
|
|
@@ -52,6 +54,7 @@ export const SelectionTint = ({
|
|
|
52
54
|
}: Props) => {
|
|
53
55
|
const element = useRef<HTMLDivElement>(null);
|
|
54
56
|
const lowered = useLowered(depth);
|
|
57
|
+
const sliding = useContext(SlidingScreen);
|
|
55
58
|
useSettling({
|
|
56
59
|
element,
|
|
57
60
|
origin: originOf(rect, rect),
|
|
@@ -71,6 +74,7 @@ export const SelectionTint = ({
|
|
|
71
74
|
ref={element}
|
|
72
75
|
style={{
|
|
73
76
|
...placedAt(rect, depth),
|
|
77
|
+
...clippedAlong(sliding, rect),
|
|
74
78
|
...scaledAbout(rect, rect),
|
|
75
79
|
...shuffledBy(restack),
|
|
76
80
|
}}
|