website-xp-phone 2.3.0 → 2.5.1
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/build/blogDirsPlugin.ts +100 -0
- package/package.json +15 -8
- package/public/blog/archive/eighth-post-lost-in-the-sauce.json +36 -0
- package/public/blog/archive/noise/eleventh-post-discussion-java-gist.md +5 -0
- package/public/blog/archive/noise/fifteenth-post-very-rare-windows-funny.md +8 -0
- package/public/blog/archive/noise/fourth-post-meta-blog.md +3 -0
- package/public/blog/archive/noise/sixteenth-post-meta-fantasy-blog.md +4 -0
- package/public/blog/archive/noise/tenth-post-meta-funny-redacted-and-timetravelled.md +3 -0
- package/public/blog/archive/noise/twelfth-post-mixing-phase-technique-audio-music.md +48 -0
- package/public/blog/archive/noise/welcome-back-ramble-meta.md +6 -0
- package/public/blog/archive/noise/welcome-to-my-blog-meta-blog-welcome-to-my-website.md +7 -0
- package/public/blog/archive/seventh-post-lie-theory-na2000.json +22 -0
- package/public/blog/archive/sophus-lie.json +36 -0
- package/public/blog/hlwm_and_herbstutil.md +74 -0
- package/public/blog/writing/hot-action-under-a-cold-moon.json +9 -0
- package/public/checksums.txt +90 -67
- package/public/documents/drift-report.json +13 -1
- package/scripts/refresh-soundcloud.mjs +54 -8
- package/sonar-project.properties +12 -0
- package/src/content/addons.json +2 -2
- package/src/content/blog.json +17 -365
- package/src/content/blogDirs.ts +197 -0
- package/src/content/configs.json +5 -3
- package/src/content/contacts.json +7 -5
- package/src/content/index.ts +155 -57
- package/src/content/music-ext.json +1 -1
- package/src/content/pages.json +2 -1
- package/src/content/projects/development.json +2 -2
- package/src/content/projects/doftiles.json +63 -7
- package/src/content/projects/frontend.json +2 -2
- package/src/content/projects/graphbrowser.json +2 -2
- package/src/content/projects/herbctl.json +213 -0
- package/src/content/projects/herbstutil.json +66 -36
- package/src/content/projects/lightdni-jssas-toggle.json +2 -2
- package/src/content/projects/on-deploy.json +67 -0
- package/src/content/projects/pagerts.json +4 -4
- package/src/content/projects/polyframes.json +83 -0
- package/src/content/projects/rarebert.json +2 -2
- package/src/content/projects/webuser.json +2 -2
- package/src/content/schema.ts +7 -4
- package/src/content/sections.json +20 -13
- package/src/content/soundcloud.json +61 -13
- package/src/lib/clippy.ts +29 -8
- package/src/lib/history.ts +152 -0
- package/src/lib/markdown.tsx +11 -1
- package/src/lib/scrollTo.ts +45 -0
- package/src/lib/signals.tsx +271 -0
- package/src/lib/slashes.ts +20 -0
- package/src/lib/tabNav.ts +192 -0
- package/src/main.tsx +20 -4
- package/src/pages/BlogDirPage.tsx +37 -0
- package/src/pages/BlogPostPage.tsx +78 -3
- package/src/pages/ProjectPage.tsx +9 -3
- package/src/pages/WowPage.tsx +8 -3
- package/src/pages/index.ts +2 -0
- package/src/shell/App.tsx +19 -8
- package/src/shell/Clippy.tsx +13 -3
- package/src/shell/MenuBar.tsx +7 -4
- package/src/shell/resolveRoute.ts +43 -3
- package/src/shell/routerSignals.ts +34 -0
- package/src/styles/extras.css +20 -0
- package/src/styles/layout.css +2 -3
- package/src/styles/menu.css +1 -1
- package/src/styles/window.css +20 -8
- package/src/themes/pageSlide/index.ts +120 -42
- package/src/themes/pageSlide/pageSlide.css +20 -9
- package/src/virtual.d.ts +14 -0
- package/src/window/MaximizedWindow.tsx +100 -64
- package/src/window/OkButton.tsx +42 -25
- package/src/window/PageWindows.tsx +7 -0
- package/src/window/TitleBar.tsx +3 -1
- package/src/window/Window.tsx +132 -87
- package/src/window/closeSounds.ts +27 -0
- package/src/window/model.ts +11 -0
- package/src/window/state.tsx +301 -54
- package/src/window/themes.ts +23 -2
- package/test/content.test.js +15 -10
- package/test/deploy-pipeline.test.js +11 -11
- package/test/markdown-tables.test.js +96 -0
- package/test/soundcloud-refresh.test.js +68 -0
- package/test/tabNav.test.js +137 -0
- package/tsconfig.node.tsbuildinfo +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/vite.config.ts +7 -1
- package/xp.css/dist/98.css +2 -0
- package/xp.css/dist/98.css.map +1 -0
- package/xp.css/dist/GUI.css +2 -0
- package/xp.css/dist/GUI.css.map +1 -0
- package/xp.css/dist/XP.css +2 -0
- package/xp.css/dist/XP.css.map +1 -0
- package/xp.css/dist/fonts/converted/PerfectDOSVGA437Win.woff +0 -0
- package/xp.css/dist/fonts/converted/PerfectDOSVGA437Win.woff2 +0 -0
- package/xp.css/dist/fonts/converted/ms_sans_serif.woff +0 -0
- package/xp.css/dist/fonts/converted/ms_sans_serif.woff2 +0 -0
- package/xp.css/dist/fonts/converted/ms_sans_serif_bold.woff +0 -0
- package/xp.css/dist/fonts/converted/ms_sans_serif_bold.woff2 +0 -0
- package/public/blog/4th.md +0 -28
- package/public/blog/wsl.1.md +0 -40
- package/src/window/hidden.ts +0 -22
- /package/public/blog/{ → archive/noise/}/321/200/321/203/320/275/320/270/321/201/321/207-/320/263/320/273/320/276/321/201/321/201/320/260/321/200/320/270/320/271.md" +0 -0
- /package/src/content/{characters.json → includes/characters.json} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useRef, useState, type ReactNode, type RefObject } from "react";
|
|
2
2
|
import type { WindowFlags } from "./state";
|
|
3
|
-
import {
|
|
3
|
+
import { scrollToId } from "@/lib/scrollTo";
|
|
4
|
+
import { dispatchSignal } from "@/lib/signals";
|
|
4
5
|
import { permalinkFor, useWindowStore } from "./state";
|
|
5
6
|
|
|
6
7
|
/** Machinery for maximized-foreground windows: the dimmed sibling layer,
|
|
@@ -12,8 +13,9 @@ import { permalinkFor, useWindowStore } from "./state";
|
|
|
12
13
|
* slot in both states and is never remounted. */
|
|
13
14
|
|
|
14
15
|
export type MaximizedController = {
|
|
15
|
-
/** Enters the maximized view:
|
|
16
|
-
*
|
|
16
|
+
/** Enters the maximized view: PUSHes the section's history entry (the
|
|
17
|
+
* bookmark the back button pops out of), reserves the flow slot
|
|
18
|
+
* (measured pre-lift) and lifts the window. Silent. */
|
|
17
19
|
maximize: () => void;
|
|
18
20
|
/** Silent, instant restore: ✕ on a maximized window, Escape and the
|
|
19
21
|
* out-of-bounds backdrop click all restore without sound (sounds
|
|
@@ -22,7 +24,7 @@ export type MaximizedController = {
|
|
|
22
24
|
/** OK entry: restore AND reveal the window's content on return. */
|
|
23
25
|
dismissRevealed: () => void;
|
|
24
26
|
/** Title-bar minimize only: restores with the slide-off ride. */
|
|
25
|
-
dismissWithSlide: () => void;
|
|
27
|
+
dismissWithSlide: (park?: boolean) => void;
|
|
26
28
|
backdropRef: RefObject<HTMLDivElement | null>;
|
|
27
29
|
parkedSize: { width: number; height: number } | null;
|
|
28
30
|
};
|
|
@@ -61,14 +63,36 @@ export function useMaximizedController(
|
|
|
61
63
|
].filter((candidate) => candidate !== backdropRef.current);
|
|
62
64
|
const topId = remaining[remaining.length - 1]?.dataset.windowId;
|
|
63
65
|
const topNode = topId ? windows.find((w) => w.id === topId) : undefined;
|
|
64
|
-
history
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
// The settle RIDES the history owner: the entry keeps the remaining
|
|
67
|
+
// maximized window's bookmark (or none, when the last one went) and
|
|
68
|
+
// lands on its permalink — pathname WITHOUT the query when none
|
|
69
|
+
// remain, so a stale ?post can't resurrect a maximized window after
|
|
70
|
+
// the last one was dismissed. The dismissed window's own backdrop is
|
|
71
|
+
// excluded via backdropRef, and ride-out clones carry no id to ever
|
|
72
|
+
// qualify.
|
|
73
|
+
dispatchSignal("history:anchor", {
|
|
74
|
+
id: topNode?.id,
|
|
75
|
+
url: topNode
|
|
76
|
+
? permalinkFor(topNode, permalinkMode)
|
|
77
|
+
: `${location.pathname}`,
|
|
78
|
+
mode: "replace",
|
|
79
|
+
});
|
|
69
80
|
};
|
|
70
81
|
|
|
71
|
-
|
|
82
|
+
/** The dismissal may hand the URL off ONLY when this window still
|
|
83
|
+
* owns the active entry — the one its maximize push created, whose
|
|
84
|
+
* state bookmark names it. An in-page dismissal (✕, Escape, backdrop,
|
|
85
|
+
* title-bar restore, stacked settle) rides that entry and settles it.
|
|
86
|
+
* A history-TRAVERSAL dismissal does not: the browser back already
|
|
87
|
+
* popped onto the DESTINATION entry — whose hash and state bookmark,
|
|
88
|
+
* when present, name the section to reveal and scroll to. Rewriting
|
|
89
|
+
* that entry would strip the hash, drop the bookmark and land the
|
|
90
|
+
* return un-revealed (the reveal is then unfixable: nothing in the
|
|
91
|
+
* URL names the section any more). */
|
|
92
|
+
const stillOwnsEntry = (): boolean =>
|
|
93
|
+
(history.state as { window?: unknown } | null)?.window === nodeId;
|
|
94
|
+
|
|
95
|
+
const dismiss = (slide: boolean, revealed = false, park = false) => {
|
|
72
96
|
const riders: HTMLElement[] = [];
|
|
73
97
|
const shell = backdropRef.current;
|
|
74
98
|
if (shell) {
|
|
@@ -112,51 +136,59 @@ export function useMaximizedController(
|
|
|
112
136
|
riders.push(riding);
|
|
113
137
|
shell.style.opacity = "0";
|
|
114
138
|
}
|
|
115
|
-
settleHashAfterDismiss();
|
|
116
|
-
//
|
|
117
|
-
//
|
|
118
|
-
//
|
|
119
|
-
//
|
|
120
|
-
//
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
139
|
+
if (stillOwnsEntry()) settleHashAfterDismiss();
|
|
140
|
+
// Every exit restores the window's OWN flags as they stood at
|
|
141
|
+
// maximize time — the minimize choreography (the click and the
|
|
142
|
+
// slide-off rider) is the departure ANIMATION. EXCEPT the parked
|
|
143
|
+
// minimize (the title-bar minimize button, and the double-click on
|
|
144
|
+
// the maximized title bar): the section underneath is minimized
|
|
145
|
+
// EXACTLY like the inline minimize handler does — collapsed
|
|
146
|
+
// (expanded:false), OK row bottom-right, the section's normal
|
|
147
|
+
// resting shape on the page. No third-state remnant: the maximized
|
|
148
|
+
// and inline minimize buttons land the window in the SAME state.
|
|
149
|
+
patch(nodeId, {
|
|
150
|
+
maximized: false,
|
|
151
|
+
minimized: false,
|
|
152
|
+
...(park ? { expanded: false } : (preFlags.current ?? {})),
|
|
153
|
+
});
|
|
154
|
+
if (revealed) {
|
|
155
|
+
// The reveal (lineage + direct content) rides the signal bus —
|
|
156
|
+
// the store's handler expands; the controller only restores.
|
|
157
|
+
dispatchSignal("window:reveal", { id: nodeId, descendants: "direct" });
|
|
135
158
|
}
|
|
136
159
|
if (riders.length) {
|
|
137
160
|
window.setTimeout(() => riders.forEach((rider) => rider.remove()), 400);
|
|
138
161
|
}
|
|
139
|
-
//
|
|
140
|
-
//
|
|
141
|
-
//
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
162
|
+
// NO landing scroll on dismissal: a close is not an arrival. Every
|
|
163
|
+
// exit restores the page at the exact place it was standing before
|
|
164
|
+
// the lift (the reserved flow slot keeps the layout still). Only
|
|
165
|
+
// arrivals land: history returns and permalink loads (pageSlide's
|
|
166
|
+
// scrollToHash and the store's confirm).
|
|
167
|
+
// EXCEPT the dismissal of a SEEDED landing: the maximized state
|
|
168
|
+
// came from the URL (a permalink opened the section maximized, or
|
|
169
|
+
// a refresh held it) — the reader never stood anywhere on this
|
|
170
|
+
// page, and the page rides at its arrival top with the section
|
|
171
|
+
// somewhere below the fold. The press that un-maximizes IS the
|
|
172
|
+
// reader's arrival at the section's inline resting place, so it
|
|
173
|
+
// lands the page on the section — the shared aiming scroll (the
|
|
174
|
+
// pageSlide theme's landing rules: smooth, on-screen-aware,
|
|
175
|
+
// re-aimed while the layout grows around the freshly revealed
|
|
176
|
+
// content). A snapshot exists ⇒ the lift happened in-page and the
|
|
177
|
+
// no-scroll rule stands.
|
|
178
|
+
if (preFlags.current === null) scrollToId(nodeId);
|
|
152
179
|
};
|
|
153
|
-
|
|
154
180
|
return {
|
|
155
181
|
maximize: () => {
|
|
156
182
|
// Snapshot the window's own flags first: the dismissal restores
|
|
157
183
|
// exactly these (never maximizes content, re-minimizes if it was
|
|
158
|
-
// minimized before the lift).
|
|
159
|
-
|
|
184
|
+
// minimized before the lift). The maximized key itself is
|
|
185
|
+
// stripped — a fresh-permalink landing seeds the window maximized
|
|
186
|
+
// with NO snapshot, and a later real maximize on such a window
|
|
187
|
+
// would otherwise spread the lifted flag straight back into the
|
|
188
|
+
// restore (dismissal un-maximizes, always).
|
|
189
|
+
const pre: WindowFlags = { ...flagsOf(nodeId) };
|
|
190
|
+
delete pre.maximized;
|
|
191
|
+
preFlags.current = pre;
|
|
160
192
|
// The hash anchors the maximized window so a refresh lands back on
|
|
161
193
|
// the revealed section. replaceState is untouched by the pageSlide
|
|
162
194
|
// pushState patch — no transition, no sound.
|
|
@@ -170,28 +202,29 @@ export function useMaximizedController(
|
|
|
170
202
|
}
|
|
171
203
|
// Anchor the URL so a refresh lands back on the revealed section —
|
|
172
204
|
// in the page's own permalink form (?post=slug on the blog, hash
|
|
173
|
-
// elsewhere).
|
|
174
|
-
//
|
|
175
|
-
//
|
|
176
|
-
//
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
//
|
|
205
|
+
// elsewhere). The anchor is a history PUSH, on every screen: the
|
|
206
|
+
// maximized view is one entry deep, so the browser back button
|
|
207
|
+
// (desktop and OS-mobile alike) pops INTO the pre-maximize entry —
|
|
208
|
+
// the page:returned repair sees the maximized window no longer
|
|
209
|
+
// named by the URL and performs the minimize choreography
|
|
210
|
+
// (window:minimize). Same-path pushes stay silent in the pageSlide
|
|
211
|
+
// wrapper — no transition, no sound.
|
|
212
|
+
const node = windows.find((w) => w.id === nodeId);
|
|
213
|
+
dispatchSignal("history:anchor", {
|
|
214
|
+
id: nodeId,
|
|
215
|
+
url: node ? permalinkFor(node, permalinkMode) : `#${nodeId}`,
|
|
216
|
+
mode: "push",
|
|
217
|
+
});
|
|
218
|
+
// A maximized window shows its body — a stale minimized flag would
|
|
219
|
+
// leave it title-bar-only in the foreground. DESCENDANTS keep the
|
|
220
|
+
// flags they hold: the maximized view is a framing, not a reveal —
|
|
221
|
+
// collapsed sections stay collapsed so the OK/Cancel/Permalink
|
|
222
|
+
// rail stays on screen instead of the content scrolling it away.
|
|
187
223
|
patch(nodeId, { maximized: true, minimized: false });
|
|
188
|
-
for (const id of descendantIds(windows, nodeId)) {
|
|
189
|
-
patch(id, { expanded: true, minimized: false });
|
|
190
|
-
}
|
|
191
224
|
},
|
|
192
225
|
dismiss: () => dismiss(false),
|
|
193
226
|
dismissRevealed: () => dismiss(false, true),
|
|
194
|
-
dismissWithSlide: () => dismiss(true),
|
|
227
|
+
dismissWithSlide: (park?: boolean) => dismiss(true, false, park),
|
|
195
228
|
backdropRef,
|
|
196
229
|
parkedSize,
|
|
197
230
|
};
|
|
@@ -233,6 +266,9 @@ export function MaximizedWindow({
|
|
|
233
266
|
ref={controller.backdropRef}
|
|
234
267
|
className={maximized ? "maximized-backdrop" : "maximized-shell"}
|
|
235
268
|
data-window-id={nodeId}
|
|
269
|
+
role={maximized ? "button" : undefined}
|
|
270
|
+
tabIndex={maximized ? 0 : undefined}
|
|
271
|
+
aria-label={maximized ? "Exit maximized view" : undefined}
|
|
236
272
|
onClick={
|
|
237
273
|
maximized
|
|
238
274
|
? (event) => {
|
package/src/window/OkButton.tsx
CHANGED
|
@@ -1,43 +1,60 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type
|
|
1
|
+
import { useSignals } from "@/lib/signals";
|
|
2
|
+
import { hasContent, type WindowNode } from "./model";
|
|
3
3
|
import { useWindowStore } from "./state";
|
|
4
4
|
|
|
5
|
-
/** OK follows the window's link if it has one, otherwise expands the
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}) {
|
|
17
|
-
const { expand, remember } = useWindowStore();
|
|
18
|
-
const navigate = useNavigate();
|
|
5
|
+
/** OK follows the window's link if it has one, otherwise expands the
|
|
6
|
+
* window. The OK middleware is all signals with no callback threading:
|
|
7
|
+
* on the maximized rail a link-less window MINIMIZES AND REVEALS
|
|
8
|
+
* (window:minimize plays the click + slide-off, window:reveal expands
|
|
9
|
+
* the section inline), an inline linked window whose section carries no
|
|
10
|
+
* content of its own lifts the maximized view on its first press
|
|
11
|
+
* (window:maximize), and once maximized the press passes through to the
|
|
12
|
+
* link below. A linked window with content navigates directly. */
|
|
13
|
+
export function OkButton({ node }: { node: WindowNode }) {
|
|
14
|
+
const { flagsOf, expand, remember } = useWindowStore();
|
|
15
|
+
const { dispatch } = useSignals();
|
|
19
16
|
|
|
20
17
|
const onClick = () => {
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
const maximized = flagsOf(node.id).maximized;
|
|
19
|
+
if (maximized && !node.link) {
|
|
20
|
+
// The maximized rail's OK on a link-less window: the minimize
|
|
21
|
+
// choreography (click + slide-off) takes the view down, then the
|
|
22
|
+
// section reveals inline — the OK button IS the back-out gesture.
|
|
23
|
+
dispatch("window:minimize", { id: node.id });
|
|
24
|
+
dispatch("window:reveal", { id: node.id, descendants: "direct" });
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
// OK middleware: intercept the first press on a linked window whose
|
|
28
|
+
// section carries no content of its own (hasContent): it opens the
|
|
29
|
+
// maximized view rather than leaving the page. A link-section WITH
|
|
30
|
+
// content navigates directly — the maximized view would only frame
|
|
31
|
+
// what the reader already has inline. Once the window IS maximized
|
|
32
|
+
// (a permalink landing also does that even content-free), the press
|
|
33
|
+
// falls through to the navigation.
|
|
34
|
+
if (node.link && !maximized && !hasContent(node)) {
|
|
35
|
+
dispatch("window:maximize", { id: node.id });
|
|
23
36
|
return;
|
|
24
37
|
}
|
|
25
38
|
const { link } = node;
|
|
26
|
-
// OK revealing a section
|
|
27
|
-
// the
|
|
39
|
+
// OK revealing a section never rewrites the URL-hash: the maximized
|
|
40
|
+
// view's push owns the URL while a window is up, and the off-site
|
|
41
|
+
// departure bookmarks its window into the entry's STATE instead.
|
|
28
42
|
if (!link) {
|
|
29
43
|
expand(node.id);
|
|
30
44
|
return;
|
|
31
45
|
}
|
|
32
46
|
if (/^https?:/.test(link) || node.externalLink || /\.\w+$/.test(link)) {
|
|
33
|
-
// Leaving the site: bookmark this window into the
|
|
34
|
-
//
|
|
35
|
-
//
|
|
47
|
+
// Leaving the site: bookmark this window into the history entry's
|
|
48
|
+
// state (history:remember) — the entry stays HASH-FREE, so
|
|
49
|
+
// returning via back, the external page or a reload lands on the
|
|
50
|
+
// section revealed and scrolled to (the store resolves the
|
|
51
|
+
// bookmark), never re-maximized.
|
|
36
52
|
remember(node.id);
|
|
37
|
-
history.replaceState(null, "", `#${node.id}`);
|
|
38
53
|
window.location.assign(link);
|
|
39
54
|
} else {
|
|
40
|
-
|
|
55
|
+
// Internal navigation is a signal: the shell's handler performs
|
|
56
|
+
// the route change, so the window system stays router-free.
|
|
57
|
+
dispatch("app:navigate", { to: link });
|
|
41
58
|
}
|
|
42
59
|
};
|
|
43
60
|
|
|
@@ -3,7 +3,9 @@ import type { Section } from "@/content";
|
|
|
3
3
|
import { buildWindows } from "./model";
|
|
4
4
|
import {
|
|
5
5
|
WindowProvider,
|
|
6
|
+
usePageReturn,
|
|
6
7
|
usePermalinkTarget,
|
|
8
|
+
useReveal,
|
|
7
9
|
useRememberLeave,
|
|
8
10
|
useWindowStore,
|
|
9
11
|
type PermalinkMode,
|
|
@@ -12,7 +14,12 @@ import { Window } from "./Window";
|
|
|
12
14
|
|
|
13
15
|
function Roots({ children }: { children?: ReactNode }) {
|
|
14
16
|
const { windows } = useWindowStore();
|
|
17
|
+
// The reveal handler subscribes FIRST (effects run in hook order):
|
|
18
|
+
// the permalink confirm below dispatches on mount and must not miss
|
|
19
|
+
// its handler.
|
|
20
|
+
useReveal();
|
|
15
21
|
usePermalinkTarget();
|
|
22
|
+
usePageReturn();
|
|
16
23
|
useRememberLeave();
|
|
17
24
|
return (
|
|
18
25
|
<>
|
package/src/window/TitleBar.tsx
CHANGED
|
@@ -6,6 +6,7 @@ type Props = {
|
|
|
6
6
|
onMinimize: () => void;
|
|
7
7
|
onMaximize: () => void;
|
|
8
8
|
onClose: () => void;
|
|
9
|
+
onDoubleClick?: (event: React.MouseEvent) => void;
|
|
9
10
|
};
|
|
10
11
|
|
|
11
12
|
export function TitleBar({
|
|
@@ -14,10 +15,11 @@ export function TitleBar({
|
|
|
14
15
|
onMinimize,
|
|
15
16
|
onMaximize,
|
|
16
17
|
onClose,
|
|
18
|
+
onDoubleClick,
|
|
17
19
|
}: Props) {
|
|
18
20
|
const heading = node.heading ?? "";
|
|
19
21
|
return (
|
|
20
|
-
<div className="title-bar">
|
|
22
|
+
<div className="title-bar" onDoubleClick={onDoubleClick}>
|
|
21
23
|
<div className="title-bar-text">
|
|
22
24
|
{node.link ? (
|
|
23
25
|
<a
|