@domicile-desktop/manganese-window-management 0.0.0-alpha-eac3e9ed1998 → 0.0.0-alpha-e781b22caeee
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 +8 -8
- package/src/TabStrip.tsx +9 -1
- package/src/TitleBar.tsx +20 -3
- package/src/tree/frames.ts +3 -3
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
3
|
"@cprussin/option-result": "^2.0.1",
|
|
4
|
-
"@domicile-desktop/component-library": "0.0.0-alpha-
|
|
5
|
-
"@domicile-desktop/manganese-address": "0.0.0-alpha-
|
|
6
|
-
"@domicile-desktop/manganese-bar": "0.0.0-alpha-
|
|
7
|
-
"@domicile-desktop/manganese-host": "0.0.0-alpha-
|
|
8
|
-
"@domicile-desktop/manganese-page-requests": "0.0.0-alpha-
|
|
9
|
-
"@domicile-desktop/sdk": "0.0.0-alpha-
|
|
10
|
-
"@domicile-desktop/system-apps": "0.0.0-alpha-
|
|
4
|
+
"@domicile-desktop/component-library": "0.0.0-alpha-e781b22caeee",
|
|
5
|
+
"@domicile-desktop/manganese-address": "0.0.0-alpha-e781b22caeee",
|
|
6
|
+
"@domicile-desktop/manganese-bar": "0.0.0-alpha-e781b22caeee",
|
|
7
|
+
"@domicile-desktop/manganese-host": "0.0.0-alpha-e781b22caeee",
|
|
8
|
+
"@domicile-desktop/manganese-page-requests": "0.0.0-alpha-e781b22caeee",
|
|
9
|
+
"@domicile-desktop/sdk": "0.0.0-alpha-e781b22caeee",
|
|
10
|
+
"@domicile-desktop/system-apps": "0.0.0-alpha-e781b22caeee",
|
|
11
11
|
"@pandacss/dev": "^1.12.1",
|
|
12
12
|
"@phosphor-icons/react": "^2.1.10",
|
|
13
13
|
"react": "^19.2.8",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"test:unit": "bun test"
|
|
86
86
|
},
|
|
87
87
|
"type": "module",
|
|
88
|
-
"version": "0.0.0-alpha-
|
|
88
|
+
"version": "0.0.0-alpha-e781b22caeee"
|
|
89
89
|
}
|
package/src/TabStrip.tsx
CHANGED
|
@@ -88,8 +88,16 @@ type Props = {
|
|
|
88
88
|
* the group's open window, and moves and settles with it. A tab switch hands
|
|
89
89
|
* it to the next open window, which takes over where it is drawn (see
|
|
90
90
|
* `useSettling`).
|
|
91
|
+
*
|
|
92
|
+
* A window moved into or out of a nested group draws a strip at another depth
|
|
93
|
+
* next. That is a new strip, which takes over from the one at its depth.
|
|
91
94
|
*/
|
|
92
|
-
export const TabStrip = (
|
|
95
|
+
export const TabStrip = (props: Props) => (
|
|
96
|
+
<PlacedStrip key={props.group.wells} {...props} />
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
/** The strip {@link TabStrip} draws at one depth. */
|
|
100
|
+
const PlacedStrip = ({
|
|
93
101
|
box,
|
|
94
102
|
depth,
|
|
95
103
|
dragging,
|
package/src/TitleBar.tsx
CHANGED
|
@@ -69,9 +69,9 @@ type Props = {
|
|
|
69
69
|
focus: TitleFocus;
|
|
70
70
|
/**
|
|
71
71
|
* For a tab standing for a nested container, that container's layout and
|
|
72
|
-
*
|
|
72
|
+
* the windows it holds.
|
|
73
73
|
*/
|
|
74
|
-
group?: { layout: Layout; windows:
|
|
74
|
+
group?: { layout: Layout; windows: readonly string[] } | undefined;
|
|
75
75
|
/**
|
|
76
76
|
* The window's whole box, which bar and contents both scale about. See
|
|
77
77
|
* {@link scaledAbout}. For a tab, this is the tab's own box.
|
|
@@ -186,6 +186,7 @@ export const TitleBar = ({
|
|
|
186
186
|
origin,
|
|
187
187
|
rect,
|
|
188
188
|
settler,
|
|
189
|
+
shared: groupTabKeysOf(group, strip),
|
|
189
190
|
still: dragging || isMoving(motion),
|
|
190
191
|
});
|
|
191
192
|
return (
|
|
@@ -266,7 +267,7 @@ export const TitleBar = ({
|
|
|
266
267
|
>
|
|
267
268
|
<span className={leadStyles} {...{ [UPRIGHT]: "" }}>
|
|
268
269
|
{group !== undefined && (
|
|
269
|
-
<GroupMark layout={group.layout} windows={group.windows} />
|
|
270
|
+
<GroupMark layout={group.layout} windows={group.windows.length} />
|
|
270
271
|
)}
|
|
271
272
|
{/* Keyed so a new icon gets another try after one fails to load. */}
|
|
272
273
|
<WindowIcon icon={icon} key={icon} />
|
|
@@ -366,6 +367,22 @@ const alongStrip = (motion: WindowMotion): boolean =>
|
|
|
366
367
|
/** The `transform-origin` of a tab moving along its strip. */
|
|
367
368
|
const STRIP_START = { x: 0, y: 0 };
|
|
368
369
|
|
|
370
|
+
/**
|
|
371
|
+
* The keys a group's tab shares with every window in the group, so a new
|
|
372
|
+
* element drawing the tab, as when the window it is named after moves out,
|
|
373
|
+
* takes over from the one before. Keyed by its strip's depth too, as
|
|
374
|
+
* `TabStrip` keys a strip.
|
|
375
|
+
*/
|
|
376
|
+
const groupTabKeysOf = (
|
|
377
|
+
group: Props["group"],
|
|
378
|
+
strip: StripPlace | undefined,
|
|
379
|
+
): readonly string[] | undefined =>
|
|
380
|
+
group === undefined || strip === undefined
|
|
381
|
+
? undefined
|
|
382
|
+
: group.windows.map(
|
|
383
|
+
(window) => `tab:${strip.group.wells.toString()}:${window}`,
|
|
384
|
+
);
|
|
385
|
+
|
|
369
386
|
/**
|
|
370
387
|
* The layout of the group a tab stands for, and its size, so a group in a tab
|
|
371
388
|
* reads as a group rather than as the window it is named after.
|
package/src/tree/frames.ts
CHANGED
|
@@ -125,8 +125,8 @@ export type Tab = {
|
|
|
125
125
|
* {@link WELL_MARGIN} around it. `undefined` for a hidden tab.
|
|
126
126
|
*/
|
|
127
127
|
well: Rect | undefined;
|
|
128
|
-
/**
|
|
129
|
-
windows:
|
|
128
|
+
/** The windows the nested container holds. */
|
|
129
|
+
windows: readonly string[];
|
|
130
130
|
};
|
|
131
131
|
|
|
132
132
|
/**
|
|
@@ -426,7 +426,7 @@ const titled = (
|
|
|
426
426
|
strip,
|
|
427
427
|
tabbed: layout,
|
|
428
428
|
well: showing ? contents : undefined,
|
|
429
|
-
windows: windowsIn(child)
|
|
429
|
+
windows: windowsIn(child),
|
|
430
430
|
};
|
|
431
431
|
const inside = showing
|
|
432
432
|
? placed(
|