for-humanity 0.6.0 → 0.7.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/CHANGELOG.md +7 -0
- package/LICENSE +1 -1
- package/README.md +3 -3
- package/dist/browser.js +9 -9
- package/dist/cli.css +25 -310
- package/dist/cli.js +120 -314
- package/package.json +4 -3
- package/src/asset/font/{jetbrains-mono/LICENSE → monoplex-kr/LICENSE.md} +61 -8
- package/src/asset/font/monoplex-kr/MonoplexKR-Regular.woff2 +0 -0
- package/src/asset/font/monoplex-kr/MonoplexKR-SemiBold.woff2 +0 -0
- package/src/asset/font/monoplex-kr/monoplex-kr.css +20 -0
- package/src/component/widget/navigation/_constant/navigation-data-schema.ts +0 -3
- package/src/component/widget/navigation/_function/to-navigation-data/_to-navigation-document.ts +2 -3
- package/src/component/widget/navigation/_function/to-navigation-data/_to-navigation-group.ts +3 -4
- package/src/component/widget/navigation/_function/to-navigation-data/to-navigation-data.ts +6 -14
- package/src/component/widget/navigation/_type/navigation-data.ts +0 -12
- package/src/component/widget/navigation/_type/navigation-focus-snapshot.ts +0 -4
- package/src/component/widget/navigation/_wg-navigation-nav-list.css +5 -136
- package/src/component/widget/navigation/_wg-navigation-nav-list.tsx +10 -55
- package/src/component/widget/navigation/_wg-navigation-nav.css +2 -8
- package/src/component/widget/navigation/_wg-navigation-nav.tsx +1 -11
- package/src/component/widget/navigation/_wg-navigation-toc.css +12 -207
- package/src/component/widget/navigation/_wg-navigation-toc.tsx +39 -80
- package/src/component/widget/navigation/wg-navigation.tsx +10 -69
- package/src/component/widget/prose/wg-prose.css +0 -3
- package/src/component/widget/shell/wg-shell.css +1 -1
- package/src/constant/copy.ts +0 -5
- package/src/constant/font.ts +2 -12
- package/src/entry/browser/browser.tsx +1 -1
- package/src/entry/cli/cli.test.ts +6 -8
- package/src/entry/cli/cli.ts +6 -18
- package/src/store/navigation/create-navigation-stores.test.ts +10 -28
- package/src/store/navigation/create-navigation-stores.ts +4 -18
- package/src/store/navigation/navigation-state.ts +0 -10
- package/src/store/navigation/navigation-storage.ts +0 -5
- package/src/style/token.css +11 -14
- package/src/util/font/to-font-css.test.ts +2 -2
- package/src/util/mermaid/render-flow.js +2 -2
- package/src/asset/font/jetbrains-mono/jetbrains-mono-latin-wght-normal.woff2 +0 -0
- package/src/asset/font/jetbrains-mono/jetbrains-mono.css +0 -11
- package/src/asset/font/pretendard/LICENSE.txt +0 -94
- package/src/asset/font/pretendard/pretendardvariable-dynamic-subset.css +0 -1008
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.0.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.1.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.10.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.11.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.12.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.13.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.14.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.15.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.16.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.17.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.18.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.19.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.2.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.20.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.21.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.22.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.23.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.24.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.25.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.26.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.27.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.28.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.29.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.3.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.30.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.31.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.32.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.33.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.34.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.35.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.36.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.37.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.38.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.39.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.4.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.40.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.41.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.42.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.43.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.44.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.45.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.46.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.47.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.48.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.49.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.5.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.50.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.51.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.52.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.53.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.54.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.55.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.56.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.57.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.58.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.59.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.6.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.60.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.61.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.62.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.63.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.64.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.65.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.66.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.67.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.68.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.69.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.7.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.70.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.71.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.72.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.73.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.74.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.75.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.76.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.77.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.78.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.79.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.8.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.80.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.81.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.82.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.83.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.84.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.85.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.86.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.87.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.88.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.89.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.9.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.90.woff2 +0 -0
- package/src/asset/font/pretendard/woff2-dynamic-subset/PretendardVariable.subset.91.woff2 +0 -0
- package/src/component/widget/navigation/_function/to-navigation-branch-id.ts +0 -6
- package/src/component/widget/navigation/_wg-navigation-branch-toggle.css +0 -28
- package/src/component/widget/navigation/_wg-navigation-branch-toggle.tsx +0 -48
- package/src/store/navigation/_constant/tree.ts +0 -6
- package/src/store/navigation/to-navigation-tree-state.ts +0 -19
- package/src/store/navigation/use-navigation-tree-store.ts +0 -12
package/dist/cli.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { EventEmitter } from "node:events";
|
|
5
5
|
import { existsSync as existsSync3, readFileSync as readFileSync3, watch } from "node:fs";
|
|
6
6
|
import { copyFile, mkdir, rm, writeFile } from "node:fs/promises";
|
|
7
|
-
import {
|
|
7
|
+
import { dirname as dirname4, extname as extname4, join as join4, relative as relative4, resolve as resolve3, sep as sep3 } from "node:path";
|
|
8
8
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
9
9
|
import { serve } from "@hono/node-server";
|
|
10
10
|
import { serveStatic } from "@hono/node-server/serve-static";
|
|
@@ -48,7 +48,6 @@ var copy_home_missing = "\uBB38\uC11C \uD3F4\uB354\uC5D0 README.md\uB97C \uCD94\
|
|
|
48
48
|
var copy_nav_toc_label = "On this page";
|
|
49
49
|
var copy_error_home_clash = "\uD648 README\uAC00 \uACB9\uCE5C\uB2E4";
|
|
50
50
|
var copy_error_prefix = "for-humanity";
|
|
51
|
-
var copy_error_font_preload = "Missing bundled font for preload";
|
|
52
51
|
var copy_error_unknown_command = "\uBAA8\uB974\uB294 \uBA85\uB839\uC774\uB2E4";
|
|
53
52
|
var copy_error_config = "\uC124\uC815\uC774 \uD2C0\uB838\uB2E4";
|
|
54
53
|
var copy_error_site_url = "url\uC740 \uC0AC\uC6A9\uC790 \uC815\uBCF4\xB7\uD558\uC704 \uACBD\uB85C\xB7query\xB7hash\uAC00 \uC5C6\uB294 HTTP(S) \uC0AC\uC774\uD2B8 \uB8E8\uD2B8\uC5EC\uC57C \uD55C\uB2E4";
|
|
@@ -67,10 +66,8 @@ var copy_warn_unknown_status = "\uC124\uC815\uC5D0 \uC5C6\uB294 \uC0C1\uD0DC \uB
|
|
|
67
66
|
var copy_error_asset = "\uC790\uC6D0\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uB2E4";
|
|
68
67
|
|
|
69
68
|
// src/constant/font.ts
|
|
70
|
-
var
|
|
71
|
-
var font_mono_css = "src/asset/font/jetbrains-mono/jetbrains-mono.css";
|
|
69
|
+
var font_mono_css = "src/asset/font/monoplex-kr/monoplex-kr.css";
|
|
72
70
|
var font_brand_css = "src/asset/font/architects-daughter/architects-daughter.css";
|
|
73
|
-
var font_sans_preload_file = "PretendardVariable.subset.91.woff2";
|
|
74
71
|
var font_display_strategy = "optional";
|
|
75
72
|
var font_hash_length = 12;
|
|
76
73
|
var font_cache_control = "public, max-age=31536000, immutable";
|
|
@@ -110,7 +107,7 @@ var WgProse = (props) => {
|
|
|
110
107
|
};
|
|
111
108
|
|
|
112
109
|
// src/component/widget/shell/wg-shell.tsx
|
|
113
|
-
import
|
|
110
|
+
import clsx9 from "clsx";
|
|
114
111
|
|
|
115
112
|
// src/component/widget/navigation/_constant/locale.ts
|
|
116
113
|
var locale_doc_name = "en";
|
|
@@ -171,7 +168,6 @@ var toNavigationDocument = (options) => ({
|
|
|
171
168
|
name: options.doc.data.name,
|
|
172
169
|
label: options.doc.data.label,
|
|
173
170
|
active: options.doc.id === options.current,
|
|
174
|
-
current: options.doc.id === options.current || options.ancestors.has(options.doc.id),
|
|
175
171
|
children: options.doc.children === void 0 ? [] : options.doc.children.map((doc) => toNavigationDocument({ ...options, doc }))
|
|
176
172
|
});
|
|
177
173
|
|
|
@@ -179,8 +175,7 @@ var toNavigationDocument = (options) => ({
|
|
|
179
175
|
var toNavigationGroup = (options) => ({
|
|
180
176
|
name: options.group.name,
|
|
181
177
|
path: options.group.path,
|
|
182
|
-
|
|
183
|
-
docs: options.group.docs.map((doc) => toNavigationDocument({ doc, current: options.current, ancestors: options.ancestors })),
|
|
178
|
+
docs: options.group.docs.map((doc) => toNavigationDocument({ doc, current: options.current })),
|
|
184
179
|
groups: options.group.groups.map((group) => toNavigationGroup({ ...options, group }))
|
|
185
180
|
});
|
|
186
181
|
|
|
@@ -218,19 +213,12 @@ var toTocGroups = (outline) => {
|
|
|
218
213
|
};
|
|
219
214
|
|
|
220
215
|
// src/component/widget/navigation/_function/to-navigation-data/to-navigation-data.ts
|
|
221
|
-
var toNavigationData = (options) => {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
(group) => toNavigationGroup({ group, current: options.current, ancestors, currentGroup: currentDoc?.data.group })
|
|
228
|
-
),
|
|
229
|
-
outline: options.outline === void 0 ? [] : toTocGroups(options.outline),
|
|
230
|
-
pageId: options.current === void 0 ? "/" : options.current,
|
|
231
|
-
home: options.current === void 0
|
|
232
|
-
};
|
|
233
|
-
};
|
|
216
|
+
var toNavigationData = (options) => ({
|
|
217
|
+
title: options.site.title,
|
|
218
|
+
groups: toDocGroups({ docs: options.docs, navigation: options.site.navigation }).map((group) => toNavigationGroup({ group, current: options.current })),
|
|
219
|
+
outline: options.outline === void 0 ? [] : toTocGroups(options.outline),
|
|
220
|
+
home: options.current === void 0
|
|
221
|
+
});
|
|
234
222
|
|
|
235
223
|
// src/component/widget/navigation/_function/to-navigation-json.ts
|
|
236
224
|
var toNavigationJson = (data) => {
|
|
@@ -238,7 +226,7 @@ var toNavigationJson = (data) => {
|
|
|
238
226
|
};
|
|
239
227
|
|
|
240
228
|
// src/component/widget/shell-controls/wg-shell-controls.tsx
|
|
241
|
-
import
|
|
229
|
+
import clsx8 from "clsx";
|
|
242
230
|
import { Fragment as Fragment3, useEffect, useLayoutEffect as useLayoutEffect5, useRef as useRef4 } from "hono/jsx";
|
|
243
231
|
|
|
244
232
|
// src/component/widget/cursor-face/wg-cursor-face.tsx
|
|
@@ -348,7 +336,7 @@ var WgCursorFace = (props) => {
|
|
|
348
336
|
};
|
|
349
337
|
|
|
350
338
|
// src/component/widget/navigation/wg-navigation.tsx
|
|
351
|
-
import
|
|
339
|
+
import clsx7 from "clsx";
|
|
352
340
|
import { Fragment as Fragment2, useLayoutEffect as useLayoutEffect4, useRef as useRef3, useState as useState3 } from "hono/jsx";
|
|
353
341
|
import { flushSync } from "hono/jsx/dom";
|
|
354
342
|
|
|
@@ -379,119 +367,51 @@ var restoreNavigationScroll = (options) => {
|
|
|
379
367
|
};
|
|
380
368
|
|
|
381
369
|
// src/component/widget/navigation/_wg-navigation-nav.tsx
|
|
382
|
-
import
|
|
383
|
-
|
|
384
|
-
// src/component/widget/navigation/_wg-navigation-branch-toggle.tsx
|
|
385
|
-
import clsx3 from "clsx";
|
|
386
|
-
|
|
387
|
-
// src/component/widget/navigation/_function/to-navigation-branch-id.ts
|
|
388
|
-
var toNavigationBranchId = (key) => {
|
|
389
|
-
return `fh-branch-${encodeURIComponent(key)}`;
|
|
390
|
-
};
|
|
391
|
-
|
|
392
|
-
// src/component/widget/navigation/_wg-navigation-branch-toggle.tsx
|
|
393
|
-
import { jsx as jsx3 } from "hono/jsx/jsx-runtime";
|
|
394
|
-
var WgNavigationBranchToggle = (props) => {
|
|
395
|
-
const handleToggleClick = () => props.onToggle?.(props.branchKey);
|
|
396
|
-
return /* @__PURE__ */ jsx3(
|
|
397
|
-
"button",
|
|
398
|
-
{
|
|
399
|
-
className: clsx3("wg_navigationBranchToggle__root"),
|
|
400
|
-
type: "button",
|
|
401
|
-
"aria-label": `${props.collapsed[props.branchKey] === true ? "Expand" : "Collapse"} ${props.label}`,
|
|
402
|
-
"aria-expanded": String(props.collapsed[props.branchKey] !== true),
|
|
403
|
-
"aria-controls": toNavigationBranchId(props.branchKey),
|
|
404
|
-
"data-navigation-toggle": props.branchKey,
|
|
405
|
-
"data-navigation-label": props.label,
|
|
406
|
-
hidden: props.onToggle === void 0,
|
|
407
|
-
onClick: handleToggleClick,
|
|
408
|
-
children: props.collapsed[props.branchKey] === true ? "+" : "\u2212"
|
|
409
|
-
}
|
|
410
|
-
);
|
|
411
|
-
};
|
|
370
|
+
import clsx4 from "clsx";
|
|
412
371
|
|
|
413
372
|
// src/component/widget/navigation/_wg-navigation-nav-list.tsx
|
|
414
|
-
import
|
|
373
|
+
import clsx3 from "clsx";
|
|
415
374
|
import { Fragment } from "hono/jsx";
|
|
416
|
-
import { jsx as
|
|
375
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "hono/jsx/jsx-runtime";
|
|
417
376
|
var WgNavigationNavList = (props) => {
|
|
418
377
|
const entries = [
|
|
419
|
-
...props.group.docs.map((doc) => {
|
|
420
|
-
|
|
421
|
-
return { kind: "document", key: `doc:${doc.id}`, doc, active, current: doc.current };
|
|
422
|
-
}),
|
|
423
|
-
...props.group.groups.map((group) => ({
|
|
424
|
-
kind: "group",
|
|
425
|
-
key: `group:${JSON.stringify(group.path)}`,
|
|
426
|
-
group,
|
|
427
|
-
current: group.current
|
|
428
|
-
}))
|
|
378
|
+
...props.group.docs.map((doc) => ({ kind: "document", key: `doc:${doc.id}`, doc })),
|
|
379
|
+
...props.group.groups.map((group) => ({ kind: "group", key: `group:${JSON.stringify(group.path)}`, group }))
|
|
429
380
|
];
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
className: clsx4("wg_navigationNavList__root"),
|
|
435
|
-
"aria-label": props.group.name,
|
|
436
|
-
id: toNavigationBranchId(props.branchKey),
|
|
437
|
-
hidden: props.collapsed[props.branchKey] === true,
|
|
438
|
-
children: entries.map((entry, index) => /* @__PURE__ */ jsxs2(
|
|
439
|
-
"li",
|
|
381
|
+
return /* @__PURE__ */ jsx3("ul", { className: clsx3("wg_navigationNavList__root"), "aria-label": props.group.name, children: entries.map((entry) => /* @__PURE__ */ jsxs2("li", { className: clsx3("wg_navigationNavList__item"), children: [
|
|
382
|
+
entry.kind === "document" && /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
383
|
+
/* @__PURE__ */ jsx3(
|
|
384
|
+
"a",
|
|
440
385
|
{
|
|
441
|
-
className:
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
children:
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
}
|
|
456
|
-
),
|
|
457
|
-
entry.doc.children.length > 0 && /* @__PURE__ */ jsx4(WgNavigationBranchToggle, { branchKey: entry.key, label: entry.doc.name, collapsed: props.collapsed, onToggle: props.onToggle }),
|
|
458
|
-
entry.doc.children.length > 0 && /* @__PURE__ */ jsx4(
|
|
459
|
-
WgNavigationNavList,
|
|
460
|
-
{
|
|
461
|
-
group: { name: entry.doc.name, path: props.group.path, current: entry.current, docs: entry.doc.children, groups: [] },
|
|
462
|
-
collapsed: props.collapsed,
|
|
463
|
-
onToggle: props.onToggle,
|
|
464
|
-
branchKey: entry.key
|
|
465
|
-
}
|
|
466
|
-
)
|
|
467
|
-
] }),
|
|
468
|
-
entry.kind === "group" && /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
469
|
-
/* @__PURE__ */ jsx4("span", { className: clsx4("wg_navigationNavList__branch"), children: entry.group.name }),
|
|
470
|
-
/* @__PURE__ */ jsx4(WgNavigationBranchToggle, { branchKey: entry.key, label: entry.group.name, collapsed: props.collapsed, onToggle: props.onToggle }),
|
|
471
|
-
/* @__PURE__ */ jsx4(WgNavigationNavList, { group: entry.group, collapsed: props.collapsed, onToggle: props.onToggle, branchKey: entry.key })
|
|
472
|
-
] })
|
|
473
|
-
]
|
|
474
|
-
},
|
|
475
|
-
entry.key
|
|
476
|
-
))
|
|
477
|
-
}
|
|
478
|
-
);
|
|
386
|
+
className: clsx3("wg_navigationNavList__link", { "wg_navigationNavList__link--active": entry.doc.active }),
|
|
387
|
+
href: `/${entry.doc.id}/`,
|
|
388
|
+
title: entry.doc.label,
|
|
389
|
+
"aria-current": entry.doc.active ? "page" : void 0,
|
|
390
|
+
children: entry.doc.name
|
|
391
|
+
}
|
|
392
|
+
),
|
|
393
|
+
entry.doc.children.length > 0 && /* @__PURE__ */ jsx3(WgNavigationNavList, { group: { name: entry.doc.name, path: props.group.path, docs: entry.doc.children, groups: [] } })
|
|
394
|
+
] }),
|
|
395
|
+
entry.kind === "group" && /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
396
|
+
/* @__PURE__ */ jsx3("span", { className: clsx3("wg_navigationNavList__branch"), children: entry.group.name }),
|
|
397
|
+
/* @__PURE__ */ jsx3(WgNavigationNavList, { group: entry.group })
|
|
398
|
+
] })
|
|
399
|
+
] }, entry.key)) });
|
|
479
400
|
};
|
|
480
401
|
|
|
481
402
|
// src/component/widget/navigation/_wg-navigation-nav.tsx
|
|
482
|
-
import { jsx as
|
|
403
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "hono/jsx/jsx-runtime";
|
|
483
404
|
var WgNavigationNav = (props) => {
|
|
484
|
-
return /* @__PURE__ */
|
|
485
|
-
/* @__PURE__ */
|
|
486
|
-
/* @__PURE__ */
|
|
487
|
-
/* @__PURE__ */ jsx5(WgNavigationNavList, { group, branchKey: `group:${JSON.stringify(group.path)}`, collapsed: props.collapsed, onToggle: props.onToggle })
|
|
405
|
+
return /* @__PURE__ */ jsx4("nav", { className: clsx4("wg_navigationNav__root"), "aria-label": copy_nav_aria_label, children: /* @__PURE__ */ jsx4("div", { className: clsx4("wg_navigationNav__docs"), children: props.groups.map((group) => /* @__PURE__ */ jsxs3("section", { className: clsx4("wg_navigationNav__docGroup"), "aria-label": group.name, children: [
|
|
406
|
+
/* @__PURE__ */ jsx4("div", { className: clsx4("wg_navigationNav__group"), children: group.name }),
|
|
407
|
+
/* @__PURE__ */ jsx4(WgNavigationNavList, { group })
|
|
488
408
|
] }, JSON.stringify(group.path))) }) });
|
|
489
409
|
};
|
|
490
410
|
|
|
491
411
|
// src/component/widget/navigation/_wg-navigation-scroll.tsx
|
|
492
|
-
import
|
|
412
|
+
import clsx5 from "clsx";
|
|
493
413
|
import { useLayoutEffect as useLayoutEffect2, useRef as useRef2, useState } from "hono/jsx";
|
|
494
|
-
import { jsx as
|
|
414
|
+
import { jsx as jsx5 } from "hono/jsx/jsx-runtime";
|
|
495
415
|
var WgNavigationScroll = (props) => {
|
|
496
416
|
const [overflow, setOverflow] = useState({ above: false, below: false });
|
|
497
417
|
const frameRef = useRef2(0);
|
|
@@ -536,11 +456,11 @@ var WgNavigationScroll = (props) => {
|
|
|
536
456
|
}, [props.children, props.ready]);
|
|
537
457
|
return (
|
|
538
458
|
// biome-ignore lint/a11y/noStaticElementInteractions lint/a11y/useKeyWithClickEvents: 부모의 링크 이벤트 위임이며 자식 a·button의 네이티브 키보드 동작을 그대로 소비한다
|
|
539
|
-
/* @__PURE__ */
|
|
459
|
+
/* @__PURE__ */ jsx5(
|
|
540
460
|
"div",
|
|
541
461
|
{
|
|
542
462
|
ref: props.ready ? props.portRef : void 0,
|
|
543
|
-
className:
|
|
463
|
+
className: clsx5(
|
|
544
464
|
"wg_navigation__scroll",
|
|
545
465
|
props.kind === "documents" && "wg_navigation__documents",
|
|
546
466
|
props.kind === "outline" && "wg_navigation__headings",
|
|
@@ -558,7 +478,7 @@ var WgNavigationScroll = (props) => {
|
|
|
558
478
|
};
|
|
559
479
|
|
|
560
480
|
// src/component/widget/navigation/_wg-navigation-toc.tsx
|
|
561
|
-
import
|
|
481
|
+
import clsx6 from "clsx";
|
|
562
482
|
import { useLayoutEffect as useLayoutEffect3, useState as useState2 } from "hono/jsx";
|
|
563
483
|
|
|
564
484
|
// src/component/widget/navigation/_constant/reading-line.ts
|
|
@@ -580,7 +500,7 @@ var findHashTarget = (hash) => {
|
|
|
580
500
|
};
|
|
581
501
|
|
|
582
502
|
// src/component/widget/navigation/_wg-navigation-toc.tsx
|
|
583
|
-
import { jsx as
|
|
503
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "hono/jsx/jsx-runtime";
|
|
584
504
|
var WgNavigationToc = (props) => {
|
|
585
505
|
const [currentSlug, setCurrentSlug] = useState2();
|
|
586
506
|
useLayoutEffect3(() => {
|
|
@@ -613,75 +533,37 @@ var WgNavigationToc = (props) => {
|
|
|
613
533
|
document.removeEventListener("DOMContentLoaded", handleReadingPositionChange);
|
|
614
534
|
};
|
|
615
535
|
}, [props.groups]);
|
|
616
|
-
return /* @__PURE__ */ jsxs4("nav", { className:
|
|
617
|
-
/* @__PURE__ */
|
|
618
|
-
props.groups.map((group) => {
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
href: `#${section.heading.slug}`,
|
|
644
|
-
"data-toc-link": "",
|
|
645
|
-
"aria-current": section.heading.slug === currentSlug ? "location" : void 0,
|
|
646
|
-
children: section.heading.text
|
|
647
|
-
}
|
|
648
|
-
),
|
|
649
|
-
section.subs.length > 0 && /* @__PURE__ */ jsx7(WgNavigationBranchToggle, { branchKey: sectionKey, label: section.heading.text, collapsed: props.collapsed, onToggle: props.onToggle }),
|
|
650
|
-
section.subs.length > 0 && /* @__PURE__ */ jsx7("ul", { className: clsx7("wg_navigationToc__sub"), id: toNavigationBranchId(sectionKey), hidden: props.collapsed[sectionKey] === true, children: section.subs.map((sub, subIndex) => /* @__PURE__ */ jsx7(
|
|
651
|
-
"li",
|
|
652
|
-
{
|
|
653
|
-
className: clsx7("wg_navigationToc__subItem", {
|
|
654
|
-
"wg_navigationToc__subItem--trail": subIndex < currentSubIndex,
|
|
655
|
-
"wg_navigationToc__subItem--current": subIndex === currentSubIndex
|
|
656
|
-
}),
|
|
657
|
-
children: /* @__PURE__ */ jsx7(
|
|
658
|
-
"a",
|
|
659
|
-
{
|
|
660
|
-
className: clsx7("wg_navigationToc__subLink", { "wg_navigationToc__subLink--active": sub.heading.slug === currentSlug }),
|
|
661
|
-
href: `#${sub.heading.slug}`,
|
|
662
|
-
"data-toc-sub-link": "",
|
|
663
|
-
"aria-current": sub.heading.slug === currentSlug ? "location" : void 0,
|
|
664
|
-
children: sub.heading.text
|
|
665
|
-
}
|
|
666
|
-
)
|
|
667
|
-
},
|
|
668
|
-
sub.heading.slug
|
|
669
|
-
)) })
|
|
670
|
-
]
|
|
671
|
-
},
|
|
672
|
-
section.heading.slug
|
|
673
|
-
);
|
|
674
|
-
}) })
|
|
675
|
-
]
|
|
676
|
-
},
|
|
677
|
-
group.sections[0].heading.slug
|
|
678
|
-
);
|
|
679
|
-
})
|
|
536
|
+
return /* @__PURE__ */ jsxs4("nav", { className: clsx6("wg_navigationToc__root"), "aria-label": copy_nav_toc_label, children: [
|
|
537
|
+
/* @__PURE__ */ jsx6("div", { className: clsx6("wg_navigationToc__label"), children: copy_nav_toc_label }),
|
|
538
|
+
props.groups.map((group) => /* @__PURE__ */ jsxs4("div", { className: clsx6("wg_navigationToc__groupSection", { "wg_navigationToc__groupSection--named": group.part !== void 0 }), children: [
|
|
539
|
+
group.part !== void 0 && /* @__PURE__ */ jsx6("div", { className: clsx6("wg_navigationToc__group"), children: group.part }),
|
|
540
|
+
/* @__PURE__ */ jsx6("ul", { className: clsx6("wg_navigationToc__list"), children: group.sections.map((section) => /* @__PURE__ */ jsxs4("li", { className: clsx6("wg_navigationToc__item"), children: [
|
|
541
|
+
/* @__PURE__ */ jsx6(
|
|
542
|
+
"a",
|
|
543
|
+
{
|
|
544
|
+
className: clsx6("wg_navigationToc__link", { "wg_navigationToc__link--active": section.heading.slug === currentSlug }),
|
|
545
|
+
href: `#${section.heading.slug}`,
|
|
546
|
+
"data-toc-link": "",
|
|
547
|
+
"aria-current": section.heading.slug === currentSlug ? "location" : void 0,
|
|
548
|
+
children: section.heading.text
|
|
549
|
+
}
|
|
550
|
+
),
|
|
551
|
+
section.subs.length > 0 && /* @__PURE__ */ jsx6("ul", { className: clsx6("wg_navigationToc__sub"), children: section.subs.map((sub) => /* @__PURE__ */ jsx6("li", { className: clsx6("wg_navigationToc__subItem"), children: /* @__PURE__ */ jsx6(
|
|
552
|
+
"a",
|
|
553
|
+
{
|
|
554
|
+
className: clsx6("wg_navigationToc__subLink", { "wg_navigationToc__subLink--active": sub.heading.slug === currentSlug }),
|
|
555
|
+
href: `#${sub.heading.slug}`,
|
|
556
|
+
"data-toc-sub-link": "",
|
|
557
|
+
"aria-current": sub.heading.slug === currentSlug ? "location" : void 0,
|
|
558
|
+
children: sub.heading.text
|
|
559
|
+
}
|
|
560
|
+
) }, sub.heading.slug)) })
|
|
561
|
+
] }, section.heading.slug)) })
|
|
562
|
+
] }, group.sections[0].heading.slug))
|
|
680
563
|
] });
|
|
681
564
|
};
|
|
682
565
|
|
|
683
566
|
// src/store/navigation/navigation-storage.ts
|
|
684
|
-
var navigation_tree_storage_key = "for-humanity:navigation-tree";
|
|
685
567
|
var navigation_storage_version = 1;
|
|
686
568
|
var navigation_scroll_storage_key = "for-humanity:navigation-scroll";
|
|
687
569
|
|
|
@@ -704,20 +586,6 @@ var toNavigationScrollState = (value) => {
|
|
|
704
586
|
return { positions: Object.fromEntries(Object.entries(positions).filter((entry) => entry[1] !== void 0)) };
|
|
705
587
|
};
|
|
706
588
|
|
|
707
|
-
// src/store/navigation/use-navigation-tree-store.ts
|
|
708
|
-
import { useSyncExternalStore } from "hono/jsx";
|
|
709
|
-
|
|
710
|
-
// src/store/navigation/_constant/tree.ts
|
|
711
|
-
var tree_server_state = { collapsed: {} };
|
|
712
|
-
|
|
713
|
-
// src/store/navigation/use-navigation-tree-store.ts
|
|
714
|
-
var useNavigationTreeStore = (tree) => {
|
|
715
|
-
const subscribe = tree === void 0 ? () => () => {
|
|
716
|
-
} : tree.subscribe;
|
|
717
|
-
const getSnapshot = tree === void 0 ? () => tree_server_state : tree.getState;
|
|
718
|
-
return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
719
|
-
};
|
|
720
|
-
|
|
721
589
|
// src/util/dom/reveal-hash-target.ts
|
|
722
590
|
var revealHashTarget = (hash) => {
|
|
723
591
|
const target = findHashTarget(hash);
|
|
@@ -728,9 +596,8 @@ var revealHashTarget = (hash) => {
|
|
|
728
596
|
};
|
|
729
597
|
|
|
730
598
|
// src/component/widget/navigation/wg-navigation.tsx
|
|
731
|
-
import { jsx as
|
|
599
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "hono/jsx/jsx-runtime";
|
|
732
600
|
var WgNavigation = (props) => {
|
|
733
|
-
const navigationTreeStore = useNavigationTreeStore(props.stores?.tree);
|
|
734
601
|
const [layout, setLayout] = useState3(() => {
|
|
735
602
|
if (props.stores === void 0) return "desktop";
|
|
736
603
|
if (matchMedia(navigation_mobile_query).matches) return "drawer";
|
|
@@ -809,9 +676,6 @@ var WgNavigation = (props) => {
|
|
|
809
676
|
documents.dispatchEvent(new Event("scroll"));
|
|
810
677
|
outlineRef.current.dispatchEvent(new Event("scroll"));
|
|
811
678
|
};
|
|
812
|
-
const handleBranchToggle = (key) => {
|
|
813
|
-
props.stores?.tree.setState((state) => ({ collapsed: { ...state.collapsed, [key]: state.collapsed[key] !== true } }));
|
|
814
|
-
};
|
|
815
679
|
const handleDrawerClose = (_event) => {
|
|
816
680
|
if (dialogRef.current?.open === true) return;
|
|
817
681
|
document.body.classList.remove("wg_shell__root--drawerOpen");
|
|
@@ -865,7 +729,6 @@ var WgNavigation = (props) => {
|
|
|
865
729
|
focusRef.current = {
|
|
866
730
|
navigation: document.activeElement.closest("[data-navigation]") !== null,
|
|
867
731
|
drawer: document.activeElement === openButtonRef.current || document.activeElement.closest("[data-navigation-drawer]") !== null,
|
|
868
|
-
branch: document.activeElement.getAttribute("data-navigation-toggle"),
|
|
869
732
|
href: document.activeElement.getAttribute("href")
|
|
870
733
|
};
|
|
871
734
|
}
|
|
@@ -877,28 +740,10 @@ var WgNavigation = (props) => {
|
|
|
877
740
|
const handlePageShow = (event) => {
|
|
878
741
|
if (!event.persisted || props.stores === void 0) return;
|
|
879
742
|
restorePendingRef.current = true;
|
|
880
|
-
flushSync(() =>
|
|
881
|
-
props.stores?.tree.persist.rehydrate();
|
|
882
|
-
props.stores?.scroll.persist.rehydrate();
|
|
883
|
-
});
|
|
743
|
+
flushSync(() => props.stores?.scroll.persist.rehydrate());
|
|
884
744
|
handleLayoutChange();
|
|
885
745
|
restoreScroll();
|
|
886
746
|
};
|
|
887
|
-
const handleStorageChange = (event) => {
|
|
888
|
-
if (event.key === navigation_tree_storage_key || event.key === null) {
|
|
889
|
-
flushSync(() => props.stores?.tree.persist.rehydrate());
|
|
890
|
-
}
|
|
891
|
-
};
|
|
892
|
-
const handleTreeChange = (state) => {
|
|
893
|
-
if (!(document.activeElement instanceof HTMLElement)) return;
|
|
894
|
-
for (const button of document.querySelectorAll("[data-navigation-toggle]")) {
|
|
895
|
-
const key = button.dataset.navigationToggle;
|
|
896
|
-
const controls = button.getAttribute("aria-controls");
|
|
897
|
-
if (key === void 0 || controls === null || state.collapsed[key] !== true) continue;
|
|
898
|
-
const branch = document.getElementById(controls);
|
|
899
|
-
if (branch?.contains(document.activeElement)) button.focus({ preventScroll: true });
|
|
900
|
-
}
|
|
901
|
-
};
|
|
902
747
|
useLayoutEffect4(() => {
|
|
903
748
|
if (props.stores === void 0) return;
|
|
904
749
|
mobileRef.current = matchMedia(navigation_mobile_query);
|
|
@@ -907,8 +752,6 @@ var WgNavigation = (props) => {
|
|
|
907
752
|
wideRef.current.addEventListener("change", handleLayoutChange);
|
|
908
753
|
addEventListener("pagehide", saveScroll);
|
|
909
754
|
addEventListener("pageshow", handlePageShow);
|
|
910
|
-
addEventListener("storage", handleStorageChange);
|
|
911
|
-
const unsubscribeTree = props.stores.tree.subscribe(handleTreeChange);
|
|
912
755
|
return () => {
|
|
913
756
|
mobileRef.current?.removeEventListener("change", handleLayoutChange);
|
|
914
757
|
wideRef.current?.removeEventListener("change", handleLayoutChange);
|
|
@@ -916,8 +759,6 @@ var WgNavigation = (props) => {
|
|
|
916
759
|
wideRef.current = null;
|
|
917
760
|
removeEventListener("pagehide", saveScroll);
|
|
918
761
|
removeEventListener("pageshow", handlePageShow);
|
|
919
|
-
removeEventListener("storage", handleStorageChange);
|
|
920
|
-
unsubscribeTree();
|
|
921
762
|
document.body.classList.remove("wg_shell__root--drawerOpen");
|
|
922
763
|
};
|
|
923
764
|
}, [props.stores]);
|
|
@@ -932,10 +773,8 @@ var WgNavigation = (props) => {
|
|
|
932
773
|
if (layout === "drawer") {
|
|
933
774
|
if (focusRef.current.navigation) openButtonRef.current?.focus({ preventScroll: true });
|
|
934
775
|
} else if (focusRef.current.navigation && navigation !== null) {
|
|
935
|
-
const
|
|
936
|
-
|
|
937
|
-
return focusRef.current.branch !== null ? element.getAttribute("data-navigation-toggle") === focusRef.current.branch : focusRef.current.href !== null && element.getAttribute("href") === focusRef.current.href;
|
|
938
|
-
});
|
|
776
|
+
const href = focusRef.current.href;
|
|
777
|
+
const target = [...navigation.querySelectorAll("a[href]")].find((element) => element.getAttribute("href") === href);
|
|
939
778
|
target?.focus({ preventScroll: true });
|
|
940
779
|
} else if (focusRef.current.drawer) {
|
|
941
780
|
brandRef.current?.focus({ preventScroll: true });
|
|
@@ -952,56 +791,41 @@ var WgNavigation = (props) => {
|
|
|
952
791
|
};
|
|
953
792
|
}, [layout, props.stores]);
|
|
954
793
|
return /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
955
|
-
/* @__PURE__ */ jsxs5("div", { className:
|
|
956
|
-
/* @__PURE__ */ jsxs5("div", { className:
|
|
957
|
-
/* @__PURE__ */
|
|
794
|
+
/* @__PURE__ */ jsxs5("div", { className: clsx7("wg_navigation__sidebar", props.stores !== void 0 && "wg_navigation__sidebar--navigationReady"), children: [
|
|
795
|
+
/* @__PURE__ */ jsxs5("div", { className: clsx7("wg_navigation__brandRow"), children: [
|
|
796
|
+
/* @__PURE__ */ jsx7(
|
|
958
797
|
"a",
|
|
959
798
|
{
|
|
960
799
|
ref: props.stores === void 0 ? void 0 : brandRef,
|
|
961
|
-
className:
|
|
800
|
+
className: clsx7("wg_navigation__brand"),
|
|
962
801
|
href: "/",
|
|
963
802
|
"aria-current": props.data.home ? "page" : void 0,
|
|
964
803
|
children: props.data.title
|
|
965
804
|
}
|
|
966
805
|
),
|
|
967
|
-
/* @__PURE__ */
|
|
806
|
+
/* @__PURE__ */ jsx7(
|
|
968
807
|
"button",
|
|
969
808
|
{
|
|
970
809
|
ref: props.stores === void 0 ? void 0 : openButtonRef,
|
|
971
|
-
className:
|
|
810
|
+
className: clsx7("wg_navigation__menuToggle", props.stores !== void 0 && layout === "drawer" && "wg_navigation__menuToggle--visible"),
|
|
972
811
|
type: "button",
|
|
973
812
|
"aria-label": copy_nav_open,
|
|
974
813
|
"aria-controls": "fh-navigation-drawer",
|
|
975
814
|
"aria-expanded": String(drawerOpen),
|
|
976
815
|
"data-navigation-open": "",
|
|
977
816
|
onClick: handleOpenButtonClick,
|
|
978
|
-
children: /* @__PURE__ */
|
|
817
|
+
children: /* @__PURE__ */ jsx7("svg", { className: clsx7("wg_navigation__menuIcon"), viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ jsx7("path", { d: "M4 6h16M4 12h16M4 18h16" }) })
|
|
979
818
|
}
|
|
980
819
|
)
|
|
981
820
|
] }),
|
|
982
|
-
layout !== "drawer" && /* @__PURE__ */
|
|
983
|
-
WgNavigationNav,
|
|
984
|
-
{
|
|
985
|
-
groups: props.data.groups,
|
|
986
|
-
collapsed: navigationTreeStore.collapsed,
|
|
987
|
-
onToggle: props.stores === void 0 ? void 0 : handleBranchToggle
|
|
988
|
-
}
|
|
989
|
-
) }) })
|
|
821
|
+
layout !== "drawer" && /* @__PURE__ */ jsx7("div", { ref: props.stores === void 0 ? void 0 : navigationRef, className: clsx7("wg_navigation__navigation"), "data-navigation": "", children: /* @__PURE__ */ jsx7(WgNavigationScroll, { portRef: documentsRef, kind: "documents", ready: props.stores !== void 0, onScroll: saveScroll, onClick: handleNavigationClick, children: /* @__PURE__ */ jsx7(WgNavigationNav, { groups: props.data.groups }) }) })
|
|
990
822
|
] }),
|
|
991
|
-
/* @__PURE__ */
|
|
992
|
-
WgNavigationToc,
|
|
993
|
-
{
|
|
994
|
-
groups: props.data.outline,
|
|
995
|
-
pageId: props.data.pageId,
|
|
996
|
-
collapsed: navigationTreeStore.collapsed,
|
|
997
|
-
onToggle: props.stores === void 0 ? void 0 : handleBranchToggle
|
|
998
|
-
}
|
|
999
|
-
) }) }) }),
|
|
823
|
+
/* @__PURE__ */ jsx7("aside", { className: clsx7("wg_navigation__tocRail"), "data-navigation-rail": "", children: /* @__PURE__ */ jsx7("div", { className: clsx7("wg_navigation__outline"), "data-navigation-outline": "", children: /* @__PURE__ */ jsx7(WgNavigationScroll, { portRef: outlineRef, kind: "outline", ready: props.stores !== void 0, onScroll: saveScroll, onClick: handleNavigationClick, children: props.data.outline.length > 0 && /* @__PURE__ */ jsx7(WgNavigationToc, { groups: props.data.outline }) }) }) }),
|
|
1000
824
|
/* @__PURE__ */ jsxs5(
|
|
1001
825
|
"dialog",
|
|
1002
826
|
{
|
|
1003
827
|
ref: props.stores === void 0 ? void 0 : dialogRef,
|
|
1004
|
-
className:
|
|
828
|
+
className: clsx7("wg_navigation__drawer"),
|
|
1005
829
|
id: "fh-navigation-drawer",
|
|
1006
830
|
"aria-labelledby": "fh-navigation-title",
|
|
1007
831
|
"data-navigation-drawer": "",
|
|
@@ -1009,11 +833,11 @@ var WgNavigation = (props) => {
|
|
|
1009
833
|
onCancel: handleDrawerCancel,
|
|
1010
834
|
onClick: handleDrawerClick,
|
|
1011
835
|
children: [
|
|
1012
|
-
/* @__PURE__ */ jsxs5("div", { className:
|
|
1013
|
-
/* @__PURE__ */
|
|
1014
|
-
/* @__PURE__ */
|
|
836
|
+
/* @__PURE__ */ jsxs5("div", { className: clsx7("wg_navigation__drawerHeader"), children: [
|
|
837
|
+
/* @__PURE__ */ jsx7("h2", { className: clsx7("wg_navigation__drawerTitle"), id: "fh-navigation-title", children: copy_nav_title }),
|
|
838
|
+
/* @__PURE__ */ jsx7("button", { className: clsx7("wg_navigation__drawerClose"), type: "button", "aria-label": copy_nav_close, "data-navigation-close": "", onClick: handleCloseButtonClick, children: /* @__PURE__ */ jsx7("svg", { className: clsx7("wg_navigation__menuIcon"), viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ jsx7("path", { d: "m6 6 12 12M18 6 6 18" }) }) })
|
|
1015
839
|
] }),
|
|
1016
|
-
/* @__PURE__ */
|
|
840
|
+
/* @__PURE__ */ jsx7("div", { className: clsx7("wg_navigation__drawerContent"), "data-navigation-content": "", children: layout === "drawer" && /* @__PURE__ */ jsx7("div", { ref: props.stores === void 0 ? void 0 : drawerNavigationRef, className: clsx7("wg_navigation__navigation"), "data-navigation": "", children: /* @__PURE__ */ jsx7(
|
|
1017
841
|
WgNavigationScroll,
|
|
1018
842
|
{
|
|
1019
843
|
portRef: drawerDocumentsRef,
|
|
@@ -1021,14 +845,7 @@ var WgNavigation = (props) => {
|
|
|
1021
845
|
ready: props.stores !== void 0,
|
|
1022
846
|
onScroll: saveScroll,
|
|
1023
847
|
onClick: handleNavigationClick,
|
|
1024
|
-
children: /* @__PURE__ */
|
|
1025
|
-
WgNavigationNav,
|
|
1026
|
-
{
|
|
1027
|
-
groups: props.data.groups,
|
|
1028
|
-
collapsed: navigationTreeStore.collapsed,
|
|
1029
|
-
onToggle: props.stores === void 0 ? void 0 : handleBranchToggle
|
|
1030
|
-
}
|
|
1031
|
-
)
|
|
848
|
+
children: /* @__PURE__ */ jsx7(WgNavigationNav, { groups: props.data.groups })
|
|
1032
849
|
}
|
|
1033
850
|
) }) })
|
|
1034
851
|
]
|
|
@@ -1041,7 +858,7 @@ var WgNavigation = (props) => {
|
|
|
1041
858
|
var heading_highlight_hold_ms = 3e3;
|
|
1042
859
|
|
|
1043
860
|
// src/component/widget/shell-controls/wg-shell-controls.tsx
|
|
1044
|
-
import { jsx as
|
|
861
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "hono/jsx/jsx-runtime";
|
|
1045
862
|
var WgShellControls = (props) => {
|
|
1046
863
|
const headingRef = useRef4(null);
|
|
1047
864
|
const timerRef = useRef4(0);
|
|
@@ -1136,61 +953,61 @@ var WgShellControls = (props) => {
|
|
|
1136
953
|
return () => source.close();
|
|
1137
954
|
}, [props.reload]);
|
|
1138
955
|
return /* @__PURE__ */ jsxs6(Fragment3, { children: [
|
|
1139
|
-
/* @__PURE__ */
|
|
1140
|
-
/* @__PURE__ */
|
|
956
|
+
/* @__PURE__ */ jsx8("div", { className: clsx8("wg_shellControls__navigation"), children: /* @__PURE__ */ jsx8(WgNavigation, { data: props.data, stores: props.stores }) }),
|
|
957
|
+
/* @__PURE__ */ jsx8(WgCursorFace, { ready: props.stores !== void 0 })
|
|
1141
958
|
] });
|
|
1142
959
|
};
|
|
1143
960
|
|
|
1144
961
|
// src/component/widget/shell/wg-shell.tsx
|
|
1145
|
-
import { jsx as
|
|
962
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "hono/jsx/jsx-runtime";
|
|
1146
963
|
var WgShell = (props) => {
|
|
1147
964
|
const navigationData = toNavigationData({ site: props.site, docs: props.docs, current: props.current, outline: props.outline });
|
|
1148
965
|
return /* @__PURE__ */ jsxs7("html", { lang: "ko", children: [
|
|
1149
966
|
/* @__PURE__ */ jsxs7("head", { children: [
|
|
1150
|
-
/* @__PURE__ */
|
|
1151
|
-
/* @__PURE__ */
|
|
1152
|
-
props.site.description !== void 0 && /* @__PURE__ */
|
|
1153
|
-
/* @__PURE__ */
|
|
1154
|
-
/* @__PURE__ */
|
|
1155
|
-
/* @__PURE__ */
|
|
1156
|
-
props.assets.preload.map((href) => /* @__PURE__ */
|
|
1157
|
-
/* @__PURE__ */
|
|
967
|
+
/* @__PURE__ */ jsx9("meta", { charSet: "utf-8" }),
|
|
968
|
+
/* @__PURE__ */ jsx9("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }),
|
|
969
|
+
props.site.description !== void 0 && /* @__PURE__ */ jsx9("meta", { name: "description", content: props.site.description }),
|
|
970
|
+
/* @__PURE__ */ jsx9("title", { children: props.title === void 0 ? props.site.title : `${props.title} \xB7 ${props.site.title}` }),
|
|
971
|
+
/* @__PURE__ */ jsx9("link", { rel: "icon", href: asset_favicon_path, type: "image/svg+xml" }),
|
|
972
|
+
/* @__PURE__ */ jsx9("style", { dangerouslySetInnerHTML: { __html: props.assets.fontCss } }),
|
|
973
|
+
props.assets.preload.map((href) => /* @__PURE__ */ jsx9("link", { rel: "preload", href, as: "font", type: "font/woff2", crossOrigin: "" }, href)),
|
|
974
|
+
/* @__PURE__ */ jsx9("link", { rel: "stylesheet", href: props.assets.stylePath })
|
|
1158
975
|
] }),
|
|
1159
|
-
/* @__PURE__ */ jsxs7("body", { className:
|
|
1160
|
-
/* @__PURE__ */
|
|
1161
|
-
/* @__PURE__ */
|
|
1162
|
-
/* @__PURE__ */
|
|
1163
|
-
/* @__PURE__ */
|
|
976
|
+
/* @__PURE__ */ jsxs7("body", { className: clsx9("wg_shell__root"), children: [
|
|
977
|
+
/* @__PURE__ */ jsx9("div", { className: clsx9("wg_shell__browserRoot"), "data-shell-browser-root": "", "data-shell-reload": props.assets.reload ? "" : void 0, children: /* @__PURE__ */ jsx9(WgShellControls, { data: navigationData, reload: props.assets.reload }) }),
|
|
978
|
+
/* @__PURE__ */ jsx9("script", { type: "application/json", id: "fh-navigation-data", dangerouslySetInnerHTML: { __html: toNavigationJson(navigationData) } }),
|
|
979
|
+
/* @__PURE__ */ jsx9("script", { dangerouslySetInnerHTML: { __html: props.assets.browserScript } }),
|
|
980
|
+
/* @__PURE__ */ jsx9("main", { className: clsx9("wg_shell__main"), children: props.children })
|
|
1164
981
|
] })
|
|
1165
982
|
] });
|
|
1166
983
|
};
|
|
1167
984
|
|
|
1168
985
|
// src/page/doc/pg-doc.tsx
|
|
1169
|
-
import { jsx as
|
|
986
|
+
import { jsx as jsx10 } from "hono/jsx/jsx-runtime";
|
|
1170
987
|
var PgDoc = (props) => {
|
|
1171
|
-
return /* @__PURE__ */
|
|
988
|
+
return /* @__PURE__ */ jsx10(WgShell, { site: props.site, docs: props.docs, assets: props.assets, title: props.doc.data.name, current: props.doc.id, outline: props.doc.outline, children: /* @__PURE__ */ jsx10(WgProse, { html: props.doc.html }) });
|
|
1172
989
|
};
|
|
1173
990
|
|
|
1174
991
|
// src/page/home/pg-home.tsx
|
|
1175
|
-
import { jsx as
|
|
992
|
+
import { jsx as jsx11 } from "hono/jsx/jsx-runtime";
|
|
1176
993
|
var PgHome = (props) => {
|
|
1177
|
-
return /* @__PURE__ */
|
|
994
|
+
return /* @__PURE__ */ jsx11(WgShell, { site: props.site, docs: props.docs, assets: props.assets, outline: props.home?.outline, children: props.home === void 0 ? /* @__PURE__ */ jsx11(WgProse, { head: { title: props.site.title, lead: copy_home_missing } }) : /* @__PURE__ */ jsx11(WgProse, { html: props.home.html }) });
|
|
1178
995
|
};
|
|
1179
996
|
|
|
1180
997
|
// src/entry/cli/_function/create-app.tsx
|
|
1181
|
-
import { jsx as
|
|
998
|
+
import { jsx as jsx12 } from "hono/jsx/jsx-runtime";
|
|
1182
999
|
var toHtml = (page) => {
|
|
1183
1000
|
return html`<!DOCTYPE html>${page}`;
|
|
1184
1001
|
};
|
|
1185
1002
|
var createApp = (options) => {
|
|
1186
1003
|
const app = new Hono();
|
|
1187
|
-
app.get("/", (c) => c.html(toHtml(/* @__PURE__ */
|
|
1004
|
+
app.get("/", (c) => c.html(toHtml(/* @__PURE__ */ jsx12(PgHome, { site: options.site, docs: options.store.docs, assets: options.assets, home: options.store.home }))));
|
|
1188
1005
|
app.get(
|
|
1189
1006
|
"/:slug{.+}/",
|
|
1190
1007
|
ssgParams(() => options.store.docs.map((doc) => ({ slug: doc.id }))),
|
|
1191
1008
|
(c) => {
|
|
1192
1009
|
const doc = options.store.docs.find((entry) => entry.id === c.req.param("slug"));
|
|
1193
|
-
return doc === void 0 ? c.notFound() : c.html(toHtml(/* @__PURE__ */
|
|
1010
|
+
return doc === void 0 ? c.notFound() : c.html(toHtml(/* @__PURE__ */ jsx12(PgDoc, { site: options.site, docs: options.store.docs, assets: options.assets, doc })));
|
|
1194
1011
|
}
|
|
1195
1012
|
);
|
|
1196
1013
|
return app;
|
|
@@ -1506,14 +1323,14 @@ function widenLabelGaps(rows) {
|
|
|
1506
1323
|
});
|
|
1507
1324
|
}
|
|
1508
1325
|
function gridToSvg(ascii) {
|
|
1509
|
-
const cw =
|
|
1326
|
+
const cw = 6.336, ch = 17, fs = 12;
|
|
1510
1327
|
const rows = widenLabelGaps(ascii.replace(/\s+$/, "").split("\n"));
|
|
1511
1328
|
const cols = Math.max.apply(null, rows.map((r) => r.length));
|
|
1512
1329
|
const f = (n) => n.toFixed(1);
|
|
1513
1330
|
let path = "", bold = "", dashed = "", arcs = "", tris = "", marks = "", dots = "", texts = "";
|
|
1514
1331
|
const isText = (chr) => chr !== void 0 && chr !== " " && chr !== ZW && LINES[chr] === void 0 && ARROWS[chr] === void 0 && chr !== "\u25C7";
|
|
1515
1332
|
const center = (c) => c * cw + cw / 2;
|
|
1516
|
-
const textWidth = (chars) => chars.reduce((w, chr) => w + (WIDE.test(chr) ?
|
|
1333
|
+
const textWidth = (chars) => chars.reduce((w, chr) => w + (WIDE.test(chr) ? cw * 2 : cw), 0);
|
|
1517
1334
|
rows.forEach((row, r) => {
|
|
1518
1335
|
const cy = r * ch + ch / 2, y0 = r * ch, y1 = y0 + ch;
|
|
1519
1336
|
let run = null;
|
|
@@ -2237,23 +2054,12 @@ var main = async () => {
|
|
|
2237
2054
|
throw new Error(`${copy_error_config}: ${parsedConfig.error.issues.map((issue) => `${issue.path.join(".")} ${issue.message}`).join(", ")}`);
|
|
2238
2055
|
}
|
|
2239
2056
|
const siteConfig = parsedConfig.data;
|
|
2240
|
-
const sans = toFontCss({ css: join4(kitRoot, font_sans_css), fontDir: asset_font_dir });
|
|
2241
2057
|
const mono = toFontCss({ css: join4(kitRoot, font_mono_css), fontDir: asset_font_dir });
|
|
2242
2058
|
const brand = toFontCss({ css: join4(kitRoot, font_brand_css), fontDir: asset_font_dir });
|
|
2243
|
-
const
|
|
2244
|
-
if (sansPreload === void 0) {
|
|
2245
|
-
throw new Error(`${copy_error_font_preload}: ${font_sans_preload_file}`);
|
|
2246
|
-
}
|
|
2247
|
-
const fontCss = [sans.css, mono.css, brand.css].join("\n");
|
|
2059
|
+
const fontCss = [mono.css, brand.css].join("\n");
|
|
2248
2060
|
const stylePath = toAssetPath({ path: asset_style_path, file: join4(kitRoot, "dist/cli.css") });
|
|
2249
2061
|
const browserScript = readFileSync3(join4(kitRoot, "dist/browser.js"), "utf8");
|
|
2250
|
-
const kitFiles = new Map([
|
|
2251
|
-
[stylePath, join4(kitRoot, "dist/cli.css")],
|
|
2252
|
-
[asset_favicon_path, join4(kitRoot, "src/asset/favicon.svg")],
|
|
2253
|
-
...sans.files,
|
|
2254
|
-
...mono.files,
|
|
2255
|
-
...brand.files
|
|
2256
|
-
]);
|
|
2062
|
+
const kitFiles = new Map([[stylePath, join4(kitRoot, "dist/cli.css")], [asset_favicon_path, join4(kitRoot, "src/asset/favicon.svg")], ...mono.files, ...brand.files]);
|
|
2257
2063
|
const files = new Map(kitFiles);
|
|
2258
2064
|
const processor = createProcessor({ site: siteConfig, root: docsRoot, files });
|
|
2259
2065
|
const [docs, home] = await Promise.all([
|
|
@@ -2265,7 +2071,7 @@ var main = async () => {
|
|
|
2265
2071
|
const app = createApp({
|
|
2266
2072
|
site: siteConfig,
|
|
2267
2073
|
store,
|
|
2268
|
-
assets: { stylePath, browserScript, fontCss, preload: [...brand.files.keys(),
|
|
2074
|
+
assets: { stylePath, browserScript, fontCss, preload: [...brand.files.keys(), ...mono.files.keys()], reload: command === "dev" }
|
|
2269
2075
|
});
|
|
2270
2076
|
if (command === "build") {
|
|
2271
2077
|
await rm(outDir, { recursive: true, force: true });
|