for-humanity 0.6.0 → 0.7.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/CHANGELOG.md +13 -0
- package/LICENSE +1 -1
- package/README.md +3 -3
- package/dist/browser.js +9 -9
- package/dist/cli.css +39 -322
- package/dist/cli.js +123 -309
- package/package.json +4 -3
- package/src/asset/font/ibm-plex-sans-kr/IBMPlexSansKR-Regular.woff2 +0 -0
- package/src/asset/font/ibm-plex-sans-kr/IBMPlexSansKR-SemiBold.woff2 +0 -0
- package/src/asset/font/{pretendard → ibm-plex-sans-kr}/LICENSE.txt +4 -5
- package/src/asset/font/ibm-plex-sans-kr/ibm-plex-sans-kr.css +22 -0
- 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/_constant/navigation.ts +2 -2
- 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.css +1 -1
- package/src/component/widget/navigation/wg-navigation.tsx +10 -69
- package/src/component/widget/prose/wg-prose.css +7 -4
- package/src/component/widget/shell/wg-shell.css +7 -11
- package/src/constant/copy.ts +0 -5
- package/src/constant/font.ts +4 -9
- package/src/entry/browser/browser.tsx +1 -1
- package/src/entry/cli/cli.test.ts +6 -8
- package/src/entry/cli/cli.ts +7 -12
- 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 +21 -20
- 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/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,9 @@ 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
|
|
69
|
+
var font_mono_css = "src/asset/font/monoplex-kr/monoplex-kr.css";
|
|
70
|
+
var font_body_css = "src/asset/font/ibm-plex-sans-kr/ibm-plex-sans-kr.css";
|
|
72
71
|
var font_brand_css = "src/asset/font/architects-daughter/architects-daughter.css";
|
|
73
|
-
var font_sans_preload_file = "PretendardVariable.subset.91.woff2";
|
|
74
72
|
var font_display_strategy = "optional";
|
|
75
73
|
var font_hash_length = 12;
|
|
76
74
|
var font_cache_control = "public, max-age=31536000, immutable";
|
|
@@ -110,7 +108,7 @@ var WgProse = (props) => {
|
|
|
110
108
|
};
|
|
111
109
|
|
|
112
110
|
// src/component/widget/shell/wg-shell.tsx
|
|
113
|
-
import
|
|
111
|
+
import clsx9 from "clsx";
|
|
114
112
|
|
|
115
113
|
// src/component/widget/navigation/_constant/locale.ts
|
|
116
114
|
var locale_doc_name = "en";
|
|
@@ -171,7 +169,6 @@ var toNavigationDocument = (options) => ({
|
|
|
171
169
|
name: options.doc.data.name,
|
|
172
170
|
label: options.doc.data.label,
|
|
173
171
|
active: options.doc.id === options.current,
|
|
174
|
-
current: options.doc.id === options.current || options.ancestors.has(options.doc.id),
|
|
175
172
|
children: options.doc.children === void 0 ? [] : options.doc.children.map((doc) => toNavigationDocument({ ...options, doc }))
|
|
176
173
|
});
|
|
177
174
|
|
|
@@ -179,8 +176,7 @@ var toNavigationDocument = (options) => ({
|
|
|
179
176
|
var toNavigationGroup = (options) => ({
|
|
180
177
|
name: options.group.name,
|
|
181
178
|
path: options.group.path,
|
|
182
|
-
|
|
183
|
-
docs: options.group.docs.map((doc) => toNavigationDocument({ doc, current: options.current, ancestors: options.ancestors })),
|
|
179
|
+
docs: options.group.docs.map((doc) => toNavigationDocument({ doc, current: options.current })),
|
|
184
180
|
groups: options.group.groups.map((group) => toNavigationGroup({ ...options, group }))
|
|
185
181
|
});
|
|
186
182
|
|
|
@@ -218,19 +214,12 @@ var toTocGroups = (outline) => {
|
|
|
218
214
|
};
|
|
219
215
|
|
|
220
216
|
// 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
|
-
};
|
|
217
|
+
var toNavigationData = (options) => ({
|
|
218
|
+
title: options.site.title,
|
|
219
|
+
groups: toDocGroups({ docs: options.docs, navigation: options.site.navigation }).map((group) => toNavigationGroup({ group, current: options.current })),
|
|
220
|
+
outline: options.outline === void 0 ? [] : toTocGroups(options.outline),
|
|
221
|
+
home: options.current === void 0
|
|
222
|
+
});
|
|
234
223
|
|
|
235
224
|
// src/component/widget/navigation/_function/to-navigation-json.ts
|
|
236
225
|
var toNavigationJson = (data) => {
|
|
@@ -238,7 +227,7 @@ var toNavigationJson = (data) => {
|
|
|
238
227
|
};
|
|
239
228
|
|
|
240
229
|
// src/component/widget/shell-controls/wg-shell-controls.tsx
|
|
241
|
-
import
|
|
230
|
+
import clsx8 from "clsx";
|
|
242
231
|
import { Fragment as Fragment3, useEffect, useLayoutEffect as useLayoutEffect5, useRef as useRef4 } from "hono/jsx";
|
|
243
232
|
|
|
244
233
|
// src/component/widget/cursor-face/wg-cursor-face.tsx
|
|
@@ -348,13 +337,13 @@ var WgCursorFace = (props) => {
|
|
|
348
337
|
};
|
|
349
338
|
|
|
350
339
|
// src/component/widget/navigation/wg-navigation.tsx
|
|
351
|
-
import
|
|
340
|
+
import clsx7 from "clsx";
|
|
352
341
|
import { Fragment as Fragment2, useLayoutEffect as useLayoutEffect4, useRef as useRef3, useState as useState3 } from "hono/jsx";
|
|
353
342
|
import { flushSync } from "hono/jsx/dom";
|
|
354
343
|
|
|
355
344
|
// src/component/widget/navigation/_constant/navigation.ts
|
|
356
345
|
var navigation_mobile_query = "(width < 1024px)";
|
|
357
|
-
var navigation_wide_query = "(width >=
|
|
346
|
+
var navigation_wide_query = "(width >= 1360px)";
|
|
358
347
|
|
|
359
348
|
// src/component/widget/navigation/_function/restore-navigation-scroll.ts
|
|
360
349
|
var restoreNavigationScroll = (options) => {
|
|
@@ -379,119 +368,51 @@ var restoreNavigationScroll = (options) => {
|
|
|
379
368
|
};
|
|
380
369
|
|
|
381
370
|
// 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
|
-
};
|
|
371
|
+
import clsx4 from "clsx";
|
|
412
372
|
|
|
413
373
|
// src/component/widget/navigation/_wg-navigation-nav-list.tsx
|
|
414
|
-
import
|
|
374
|
+
import clsx3 from "clsx";
|
|
415
375
|
import { Fragment } from "hono/jsx";
|
|
416
|
-
import { jsx as
|
|
376
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "hono/jsx/jsx-runtime";
|
|
417
377
|
var WgNavigationNavList = (props) => {
|
|
418
378
|
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
|
-
}))
|
|
379
|
+
...props.group.docs.map((doc) => ({ kind: "document", key: `doc:${doc.id}`, doc })),
|
|
380
|
+
...props.group.groups.map((group) => ({ kind: "group", key: `group:${JSON.stringify(group.path)}`, group }))
|
|
429
381
|
];
|
|
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",
|
|
382
|
+
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: [
|
|
383
|
+
entry.kind === "document" && /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
384
|
+
/* @__PURE__ */ jsx3(
|
|
385
|
+
"a",
|
|
440
386
|
{
|
|
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
|
-
);
|
|
387
|
+
className: clsx3("wg_navigationNavList__link", { "wg_navigationNavList__link--active": entry.doc.active }),
|
|
388
|
+
href: `/${entry.doc.id}/`,
|
|
389
|
+
title: entry.doc.label,
|
|
390
|
+
"aria-current": entry.doc.active ? "page" : void 0,
|
|
391
|
+
children: entry.doc.name
|
|
392
|
+
}
|
|
393
|
+
),
|
|
394
|
+
entry.doc.children.length > 0 && /* @__PURE__ */ jsx3(WgNavigationNavList, { group: { name: entry.doc.name, path: props.group.path, docs: entry.doc.children, groups: [] } })
|
|
395
|
+
] }),
|
|
396
|
+
entry.kind === "group" && /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
397
|
+
/* @__PURE__ */ jsx3("span", { className: clsx3("wg_navigationNavList__branch"), children: entry.group.name }),
|
|
398
|
+
/* @__PURE__ */ jsx3(WgNavigationNavList, { group: entry.group })
|
|
399
|
+
] })
|
|
400
|
+
] }, entry.key)) });
|
|
479
401
|
};
|
|
480
402
|
|
|
481
403
|
// src/component/widget/navigation/_wg-navigation-nav.tsx
|
|
482
|
-
import { jsx as
|
|
404
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "hono/jsx/jsx-runtime";
|
|
483
405
|
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 })
|
|
406
|
+
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: [
|
|
407
|
+
/* @__PURE__ */ jsx4("div", { className: clsx4("wg_navigationNav__group"), children: group.name }),
|
|
408
|
+
/* @__PURE__ */ jsx4(WgNavigationNavList, { group })
|
|
488
409
|
] }, JSON.stringify(group.path))) }) });
|
|
489
410
|
};
|
|
490
411
|
|
|
491
412
|
// src/component/widget/navigation/_wg-navigation-scroll.tsx
|
|
492
|
-
import
|
|
413
|
+
import clsx5 from "clsx";
|
|
493
414
|
import { useLayoutEffect as useLayoutEffect2, useRef as useRef2, useState } from "hono/jsx";
|
|
494
|
-
import { jsx as
|
|
415
|
+
import { jsx as jsx5 } from "hono/jsx/jsx-runtime";
|
|
495
416
|
var WgNavigationScroll = (props) => {
|
|
496
417
|
const [overflow, setOverflow] = useState({ above: false, below: false });
|
|
497
418
|
const frameRef = useRef2(0);
|
|
@@ -536,11 +457,11 @@ var WgNavigationScroll = (props) => {
|
|
|
536
457
|
}, [props.children, props.ready]);
|
|
537
458
|
return (
|
|
538
459
|
// biome-ignore lint/a11y/noStaticElementInteractions lint/a11y/useKeyWithClickEvents: 부모의 링크 이벤트 위임이며 자식 a·button의 네이티브 키보드 동작을 그대로 소비한다
|
|
539
|
-
/* @__PURE__ */
|
|
460
|
+
/* @__PURE__ */ jsx5(
|
|
540
461
|
"div",
|
|
541
462
|
{
|
|
542
463
|
ref: props.ready ? props.portRef : void 0,
|
|
543
|
-
className:
|
|
464
|
+
className: clsx5(
|
|
544
465
|
"wg_navigation__scroll",
|
|
545
466
|
props.kind === "documents" && "wg_navigation__documents",
|
|
546
467
|
props.kind === "outline" && "wg_navigation__headings",
|
|
@@ -558,7 +479,7 @@ var WgNavigationScroll = (props) => {
|
|
|
558
479
|
};
|
|
559
480
|
|
|
560
481
|
// src/component/widget/navigation/_wg-navigation-toc.tsx
|
|
561
|
-
import
|
|
482
|
+
import clsx6 from "clsx";
|
|
562
483
|
import { useLayoutEffect as useLayoutEffect3, useState as useState2 } from "hono/jsx";
|
|
563
484
|
|
|
564
485
|
// src/component/widget/navigation/_constant/reading-line.ts
|
|
@@ -580,7 +501,7 @@ var findHashTarget = (hash) => {
|
|
|
580
501
|
};
|
|
581
502
|
|
|
582
503
|
// src/component/widget/navigation/_wg-navigation-toc.tsx
|
|
583
|
-
import { jsx as
|
|
504
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "hono/jsx/jsx-runtime";
|
|
584
505
|
var WgNavigationToc = (props) => {
|
|
585
506
|
const [currentSlug, setCurrentSlug] = useState2();
|
|
586
507
|
useLayoutEffect3(() => {
|
|
@@ -613,75 +534,37 @@ var WgNavigationToc = (props) => {
|
|
|
613
534
|
document.removeEventListener("DOMContentLoaded", handleReadingPositionChange);
|
|
614
535
|
};
|
|
615
536
|
}, [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
|
-
})
|
|
537
|
+
return /* @__PURE__ */ jsxs4("nav", { className: clsx6("wg_navigationToc__root"), "aria-label": copy_nav_toc_label, children: [
|
|
538
|
+
/* @__PURE__ */ jsx6("div", { className: clsx6("wg_navigationToc__label"), children: copy_nav_toc_label }),
|
|
539
|
+
props.groups.map((group) => /* @__PURE__ */ jsxs4("div", { className: clsx6("wg_navigationToc__groupSection", { "wg_navigationToc__groupSection--named": group.part !== void 0 }), children: [
|
|
540
|
+
group.part !== void 0 && /* @__PURE__ */ jsx6("div", { className: clsx6("wg_navigationToc__group"), children: group.part }),
|
|
541
|
+
/* @__PURE__ */ jsx6("ul", { className: clsx6("wg_navigationToc__list"), children: group.sections.map((section) => /* @__PURE__ */ jsxs4("li", { className: clsx6("wg_navigationToc__item"), children: [
|
|
542
|
+
/* @__PURE__ */ jsx6(
|
|
543
|
+
"a",
|
|
544
|
+
{
|
|
545
|
+
className: clsx6("wg_navigationToc__link", { "wg_navigationToc__link--active": section.heading.slug === currentSlug }),
|
|
546
|
+
href: `#${section.heading.slug}`,
|
|
547
|
+
"data-toc-link": "",
|
|
548
|
+
"aria-current": section.heading.slug === currentSlug ? "location" : void 0,
|
|
549
|
+
children: section.heading.text
|
|
550
|
+
}
|
|
551
|
+
),
|
|
552
|
+
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(
|
|
553
|
+
"a",
|
|
554
|
+
{
|
|
555
|
+
className: clsx6("wg_navigationToc__subLink", { "wg_navigationToc__subLink--active": sub.heading.slug === currentSlug }),
|
|
556
|
+
href: `#${sub.heading.slug}`,
|
|
557
|
+
"data-toc-sub-link": "",
|
|
558
|
+
"aria-current": sub.heading.slug === currentSlug ? "location" : void 0,
|
|
559
|
+
children: sub.heading.text
|
|
560
|
+
}
|
|
561
|
+
) }, sub.heading.slug)) })
|
|
562
|
+
] }, section.heading.slug)) })
|
|
563
|
+
] }, group.sections[0].heading.slug))
|
|
680
564
|
] });
|
|
681
565
|
};
|
|
682
566
|
|
|
683
567
|
// src/store/navigation/navigation-storage.ts
|
|
684
|
-
var navigation_tree_storage_key = "for-humanity:navigation-tree";
|
|
685
568
|
var navigation_storage_version = 1;
|
|
686
569
|
var navigation_scroll_storage_key = "for-humanity:navigation-scroll";
|
|
687
570
|
|
|
@@ -704,20 +587,6 @@ var toNavigationScrollState = (value) => {
|
|
|
704
587
|
return { positions: Object.fromEntries(Object.entries(positions).filter((entry) => entry[1] !== void 0)) };
|
|
705
588
|
};
|
|
706
589
|
|
|
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
590
|
// src/util/dom/reveal-hash-target.ts
|
|
722
591
|
var revealHashTarget = (hash) => {
|
|
723
592
|
const target = findHashTarget(hash);
|
|
@@ -728,9 +597,8 @@ var revealHashTarget = (hash) => {
|
|
|
728
597
|
};
|
|
729
598
|
|
|
730
599
|
// src/component/widget/navigation/wg-navigation.tsx
|
|
731
|
-
import { jsx as
|
|
600
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "hono/jsx/jsx-runtime";
|
|
732
601
|
var WgNavigation = (props) => {
|
|
733
|
-
const navigationTreeStore = useNavigationTreeStore(props.stores?.tree);
|
|
734
602
|
const [layout, setLayout] = useState3(() => {
|
|
735
603
|
if (props.stores === void 0) return "desktop";
|
|
736
604
|
if (matchMedia(navigation_mobile_query).matches) return "drawer";
|
|
@@ -809,9 +677,6 @@ var WgNavigation = (props) => {
|
|
|
809
677
|
documents.dispatchEvent(new Event("scroll"));
|
|
810
678
|
outlineRef.current.dispatchEvent(new Event("scroll"));
|
|
811
679
|
};
|
|
812
|
-
const handleBranchToggle = (key) => {
|
|
813
|
-
props.stores?.tree.setState((state) => ({ collapsed: { ...state.collapsed, [key]: state.collapsed[key] !== true } }));
|
|
814
|
-
};
|
|
815
680
|
const handleDrawerClose = (_event) => {
|
|
816
681
|
if (dialogRef.current?.open === true) return;
|
|
817
682
|
document.body.classList.remove("wg_shell__root--drawerOpen");
|
|
@@ -865,7 +730,6 @@ var WgNavigation = (props) => {
|
|
|
865
730
|
focusRef.current = {
|
|
866
731
|
navigation: document.activeElement.closest("[data-navigation]") !== null,
|
|
867
732
|
drawer: document.activeElement === openButtonRef.current || document.activeElement.closest("[data-navigation-drawer]") !== null,
|
|
868
|
-
branch: document.activeElement.getAttribute("data-navigation-toggle"),
|
|
869
733
|
href: document.activeElement.getAttribute("href")
|
|
870
734
|
};
|
|
871
735
|
}
|
|
@@ -877,28 +741,10 @@ var WgNavigation = (props) => {
|
|
|
877
741
|
const handlePageShow = (event) => {
|
|
878
742
|
if (!event.persisted || props.stores === void 0) return;
|
|
879
743
|
restorePendingRef.current = true;
|
|
880
|
-
flushSync(() =>
|
|
881
|
-
props.stores?.tree.persist.rehydrate();
|
|
882
|
-
props.stores?.scroll.persist.rehydrate();
|
|
883
|
-
});
|
|
744
|
+
flushSync(() => props.stores?.scroll.persist.rehydrate());
|
|
884
745
|
handleLayoutChange();
|
|
885
746
|
restoreScroll();
|
|
886
747
|
};
|
|
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
748
|
useLayoutEffect4(() => {
|
|
903
749
|
if (props.stores === void 0) return;
|
|
904
750
|
mobileRef.current = matchMedia(navigation_mobile_query);
|
|
@@ -907,8 +753,6 @@ var WgNavigation = (props) => {
|
|
|
907
753
|
wideRef.current.addEventListener("change", handleLayoutChange);
|
|
908
754
|
addEventListener("pagehide", saveScroll);
|
|
909
755
|
addEventListener("pageshow", handlePageShow);
|
|
910
|
-
addEventListener("storage", handleStorageChange);
|
|
911
|
-
const unsubscribeTree = props.stores.tree.subscribe(handleTreeChange);
|
|
912
756
|
return () => {
|
|
913
757
|
mobileRef.current?.removeEventListener("change", handleLayoutChange);
|
|
914
758
|
wideRef.current?.removeEventListener("change", handleLayoutChange);
|
|
@@ -916,8 +760,6 @@ var WgNavigation = (props) => {
|
|
|
916
760
|
wideRef.current = null;
|
|
917
761
|
removeEventListener("pagehide", saveScroll);
|
|
918
762
|
removeEventListener("pageshow", handlePageShow);
|
|
919
|
-
removeEventListener("storage", handleStorageChange);
|
|
920
|
-
unsubscribeTree();
|
|
921
763
|
document.body.classList.remove("wg_shell__root--drawerOpen");
|
|
922
764
|
};
|
|
923
765
|
}, [props.stores]);
|
|
@@ -932,10 +774,8 @@ var WgNavigation = (props) => {
|
|
|
932
774
|
if (layout === "drawer") {
|
|
933
775
|
if (focusRef.current.navigation) openButtonRef.current?.focus({ preventScroll: true });
|
|
934
776
|
} 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
|
-
});
|
|
777
|
+
const href = focusRef.current.href;
|
|
778
|
+
const target = [...navigation.querySelectorAll("a[href]")].find((element) => element.getAttribute("href") === href);
|
|
939
779
|
target?.focus({ preventScroll: true });
|
|
940
780
|
} else if (focusRef.current.drawer) {
|
|
941
781
|
brandRef.current?.focus({ preventScroll: true });
|
|
@@ -952,56 +792,41 @@ var WgNavigation = (props) => {
|
|
|
952
792
|
};
|
|
953
793
|
}, [layout, props.stores]);
|
|
954
794
|
return /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
955
|
-
/* @__PURE__ */ jsxs5("div", { className:
|
|
956
|
-
/* @__PURE__ */ jsxs5("div", { className:
|
|
957
|
-
/* @__PURE__ */
|
|
795
|
+
/* @__PURE__ */ jsxs5("div", { className: clsx7("wg_navigation__sidebar", props.stores !== void 0 && "wg_navigation__sidebar--navigationReady"), children: [
|
|
796
|
+
/* @__PURE__ */ jsxs5("div", { className: clsx7("wg_navigation__brandRow"), children: [
|
|
797
|
+
/* @__PURE__ */ jsx7(
|
|
958
798
|
"a",
|
|
959
799
|
{
|
|
960
800
|
ref: props.stores === void 0 ? void 0 : brandRef,
|
|
961
|
-
className:
|
|
801
|
+
className: clsx7("wg_navigation__brand"),
|
|
962
802
|
href: "/",
|
|
963
803
|
"aria-current": props.data.home ? "page" : void 0,
|
|
964
804
|
children: props.data.title
|
|
965
805
|
}
|
|
966
806
|
),
|
|
967
|
-
/* @__PURE__ */
|
|
807
|
+
/* @__PURE__ */ jsx7(
|
|
968
808
|
"button",
|
|
969
809
|
{
|
|
970
810
|
ref: props.stores === void 0 ? void 0 : openButtonRef,
|
|
971
|
-
className:
|
|
811
|
+
className: clsx7("wg_navigation__menuToggle", props.stores !== void 0 && layout === "drawer" && "wg_navigation__menuToggle--visible"),
|
|
972
812
|
type: "button",
|
|
973
813
|
"aria-label": copy_nav_open,
|
|
974
814
|
"aria-controls": "fh-navigation-drawer",
|
|
975
815
|
"aria-expanded": String(drawerOpen),
|
|
976
816
|
"data-navigation-open": "",
|
|
977
817
|
onClick: handleOpenButtonClick,
|
|
978
|
-
children: /* @__PURE__ */
|
|
818
|
+
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
819
|
}
|
|
980
820
|
)
|
|
981
821
|
] }),
|
|
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
|
-
) }) })
|
|
822
|
+
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
823
|
] }),
|
|
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
|
-
) }) }) }),
|
|
824
|
+
/* @__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
825
|
/* @__PURE__ */ jsxs5(
|
|
1001
826
|
"dialog",
|
|
1002
827
|
{
|
|
1003
828
|
ref: props.stores === void 0 ? void 0 : dialogRef,
|
|
1004
|
-
className:
|
|
829
|
+
className: clsx7("wg_navigation__drawer"),
|
|
1005
830
|
id: "fh-navigation-drawer",
|
|
1006
831
|
"aria-labelledby": "fh-navigation-title",
|
|
1007
832
|
"data-navigation-drawer": "",
|
|
@@ -1009,11 +834,11 @@ var WgNavigation = (props) => {
|
|
|
1009
834
|
onCancel: handleDrawerCancel,
|
|
1010
835
|
onClick: handleDrawerClick,
|
|
1011
836
|
children: [
|
|
1012
|
-
/* @__PURE__ */ jsxs5("div", { className:
|
|
1013
|
-
/* @__PURE__ */
|
|
1014
|
-
/* @__PURE__ */
|
|
837
|
+
/* @__PURE__ */ jsxs5("div", { className: clsx7("wg_navigation__drawerHeader"), children: [
|
|
838
|
+
/* @__PURE__ */ jsx7("h2", { className: clsx7("wg_navigation__drawerTitle"), id: "fh-navigation-title", children: copy_nav_title }),
|
|
839
|
+
/* @__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
840
|
] }),
|
|
1016
|
-
/* @__PURE__ */
|
|
841
|
+
/* @__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
842
|
WgNavigationScroll,
|
|
1018
843
|
{
|
|
1019
844
|
portRef: drawerDocumentsRef,
|
|
@@ -1021,14 +846,7 @@ var WgNavigation = (props) => {
|
|
|
1021
846
|
ready: props.stores !== void 0,
|
|
1022
847
|
onScroll: saveScroll,
|
|
1023
848
|
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
|
-
)
|
|
849
|
+
children: /* @__PURE__ */ jsx7(WgNavigationNav, { groups: props.data.groups })
|
|
1032
850
|
}
|
|
1033
851
|
) }) })
|
|
1034
852
|
]
|
|
@@ -1041,7 +859,7 @@ var WgNavigation = (props) => {
|
|
|
1041
859
|
var heading_highlight_hold_ms = 3e3;
|
|
1042
860
|
|
|
1043
861
|
// src/component/widget/shell-controls/wg-shell-controls.tsx
|
|
1044
|
-
import { jsx as
|
|
862
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "hono/jsx/jsx-runtime";
|
|
1045
863
|
var WgShellControls = (props) => {
|
|
1046
864
|
const headingRef = useRef4(null);
|
|
1047
865
|
const timerRef = useRef4(0);
|
|
@@ -1136,61 +954,61 @@ var WgShellControls = (props) => {
|
|
|
1136
954
|
return () => source.close();
|
|
1137
955
|
}, [props.reload]);
|
|
1138
956
|
return /* @__PURE__ */ jsxs6(Fragment3, { children: [
|
|
1139
|
-
/* @__PURE__ */
|
|
1140
|
-
/* @__PURE__ */
|
|
957
|
+
/* @__PURE__ */ jsx8("div", { className: clsx8("wg_shellControls__navigation"), children: /* @__PURE__ */ jsx8(WgNavigation, { data: props.data, stores: props.stores }) }),
|
|
958
|
+
/* @__PURE__ */ jsx8(WgCursorFace, { ready: props.stores !== void 0 })
|
|
1141
959
|
] });
|
|
1142
960
|
};
|
|
1143
961
|
|
|
1144
962
|
// src/component/widget/shell/wg-shell.tsx
|
|
1145
|
-
import { jsx as
|
|
963
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "hono/jsx/jsx-runtime";
|
|
1146
964
|
var WgShell = (props) => {
|
|
1147
965
|
const navigationData = toNavigationData({ site: props.site, docs: props.docs, current: props.current, outline: props.outline });
|
|
1148
966
|
return /* @__PURE__ */ jsxs7("html", { lang: "ko", children: [
|
|
1149
967
|
/* @__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__ */
|
|
968
|
+
/* @__PURE__ */ jsx9("meta", { charSet: "utf-8" }),
|
|
969
|
+
/* @__PURE__ */ jsx9("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }),
|
|
970
|
+
props.site.description !== void 0 && /* @__PURE__ */ jsx9("meta", { name: "description", content: props.site.description }),
|
|
971
|
+
/* @__PURE__ */ jsx9("title", { children: props.title === void 0 ? props.site.title : `${props.title} \xB7 ${props.site.title}` }),
|
|
972
|
+
/* @__PURE__ */ jsx9("link", { rel: "icon", href: asset_favicon_path, type: "image/svg+xml" }),
|
|
973
|
+
/* @__PURE__ */ jsx9("style", { dangerouslySetInnerHTML: { __html: props.assets.fontCss } }),
|
|
974
|
+
props.assets.preload.map((href) => /* @__PURE__ */ jsx9("link", { rel: "preload", href, as: "font", type: "font/woff2", crossOrigin: "" }, href)),
|
|
975
|
+
/* @__PURE__ */ jsx9("link", { rel: "stylesheet", href: props.assets.stylePath })
|
|
1158
976
|
] }),
|
|
1159
|
-
/* @__PURE__ */ jsxs7("body", { className:
|
|
1160
|
-
/* @__PURE__ */
|
|
1161
|
-
/* @__PURE__ */
|
|
1162
|
-
/* @__PURE__ */
|
|
1163
|
-
/* @__PURE__ */
|
|
977
|
+
/* @__PURE__ */ jsxs7("body", { className: clsx9("wg_shell__root"), children: [
|
|
978
|
+
/* @__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 }) }),
|
|
979
|
+
/* @__PURE__ */ jsx9("script", { type: "application/json", id: "fh-navigation-data", dangerouslySetInnerHTML: { __html: toNavigationJson(navigationData) } }),
|
|
980
|
+
/* @__PURE__ */ jsx9("script", { dangerouslySetInnerHTML: { __html: props.assets.browserScript } }),
|
|
981
|
+
/* @__PURE__ */ jsx9("main", { className: clsx9("wg_shell__main"), children: props.children })
|
|
1164
982
|
] })
|
|
1165
983
|
] });
|
|
1166
984
|
};
|
|
1167
985
|
|
|
1168
986
|
// src/page/doc/pg-doc.tsx
|
|
1169
|
-
import { jsx as
|
|
987
|
+
import { jsx as jsx10 } from "hono/jsx/jsx-runtime";
|
|
1170
988
|
var PgDoc = (props) => {
|
|
1171
|
-
return /* @__PURE__ */
|
|
989
|
+
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
990
|
};
|
|
1173
991
|
|
|
1174
992
|
// src/page/home/pg-home.tsx
|
|
1175
|
-
import { jsx as
|
|
993
|
+
import { jsx as jsx11 } from "hono/jsx/jsx-runtime";
|
|
1176
994
|
var PgHome = (props) => {
|
|
1177
|
-
return /* @__PURE__ */
|
|
995
|
+
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
996
|
};
|
|
1179
997
|
|
|
1180
998
|
// src/entry/cli/_function/create-app.tsx
|
|
1181
|
-
import { jsx as
|
|
999
|
+
import { jsx as jsx12 } from "hono/jsx/jsx-runtime";
|
|
1182
1000
|
var toHtml = (page) => {
|
|
1183
1001
|
return html`<!DOCTYPE html>${page}`;
|
|
1184
1002
|
};
|
|
1185
1003
|
var createApp = (options) => {
|
|
1186
1004
|
const app = new Hono();
|
|
1187
|
-
app.get("/", (c) => c.html(toHtml(/* @__PURE__ */
|
|
1005
|
+
app.get("/", (c) => c.html(toHtml(/* @__PURE__ */ jsx12(PgHome, { site: options.site, docs: options.store.docs, assets: options.assets, home: options.store.home }))));
|
|
1188
1006
|
app.get(
|
|
1189
1007
|
"/:slug{.+}/",
|
|
1190
1008
|
ssgParams(() => options.store.docs.map((doc) => ({ slug: doc.id }))),
|
|
1191
1009
|
(c) => {
|
|
1192
1010
|
const doc = options.store.docs.find((entry) => entry.id === c.req.param("slug"));
|
|
1193
|
-
return doc === void 0 ? c.notFound() : c.html(toHtml(/* @__PURE__ */
|
|
1011
|
+
return doc === void 0 ? c.notFound() : c.html(toHtml(/* @__PURE__ */ jsx12(PgDoc, { site: options.site, docs: options.store.docs, assets: options.assets, doc })));
|
|
1194
1012
|
}
|
|
1195
1013
|
);
|
|
1196
1014
|
return app;
|
|
@@ -1506,14 +1324,14 @@ function widenLabelGaps(rows) {
|
|
|
1506
1324
|
});
|
|
1507
1325
|
}
|
|
1508
1326
|
function gridToSvg(ascii) {
|
|
1509
|
-
const cw =
|
|
1327
|
+
const cw = 6.336, ch = 17, fs = 12;
|
|
1510
1328
|
const rows = widenLabelGaps(ascii.replace(/\s+$/, "").split("\n"));
|
|
1511
1329
|
const cols = Math.max.apply(null, rows.map((r) => r.length));
|
|
1512
1330
|
const f = (n) => n.toFixed(1);
|
|
1513
1331
|
let path = "", bold = "", dashed = "", arcs = "", tris = "", marks = "", dots = "", texts = "";
|
|
1514
1332
|
const isText = (chr) => chr !== void 0 && chr !== " " && chr !== ZW && LINES[chr] === void 0 && ARROWS[chr] === void 0 && chr !== "\u25C7";
|
|
1515
1333
|
const center = (c) => c * cw + cw / 2;
|
|
1516
|
-
const textWidth = (chars) => chars.reduce((w, chr) => w + (WIDE.test(chr) ?
|
|
1334
|
+
const textWidth = (chars) => chars.reduce((w, chr) => w + (WIDE.test(chr) ? cw * 2 : cw), 0);
|
|
1517
1335
|
rows.forEach((row, r) => {
|
|
1518
1336
|
const cy = r * ch + ch / 2, y0 = r * ch, y1 = y0 + ch;
|
|
1519
1337
|
let run = null;
|
|
@@ -2237,21 +2055,17 @@ var main = async () => {
|
|
|
2237
2055
|
throw new Error(`${copy_error_config}: ${parsedConfig.error.issues.map((issue) => `${issue.path.join(".")} ${issue.message}`).join(", ")}`);
|
|
2238
2056
|
}
|
|
2239
2057
|
const siteConfig = parsedConfig.data;
|
|
2240
|
-
const sans = toFontCss({ css: join4(kitRoot, font_sans_css), fontDir: asset_font_dir });
|
|
2241
2058
|
const mono = toFontCss({ css: join4(kitRoot, font_mono_css), fontDir: asset_font_dir });
|
|
2059
|
+
const body = toFontCss({ css: join4(kitRoot, font_body_css), fontDir: asset_font_dir });
|
|
2242
2060
|
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");
|
|
2061
|
+
const fontCss = [mono.css, body.css, brand.css].join("\n");
|
|
2248
2062
|
const stylePath = toAssetPath({ path: asset_style_path, file: join4(kitRoot, "dist/cli.css") });
|
|
2249
2063
|
const browserScript = readFileSync3(join4(kitRoot, "dist/browser.js"), "utf8");
|
|
2250
2064
|
const kitFiles = new Map([
|
|
2251
2065
|
[stylePath, join4(kitRoot, "dist/cli.css")],
|
|
2252
2066
|
[asset_favicon_path, join4(kitRoot, "src/asset/favicon.svg")],
|
|
2253
|
-
...sans.files,
|
|
2254
2067
|
...mono.files,
|
|
2068
|
+
...body.files,
|
|
2255
2069
|
...brand.files
|
|
2256
2070
|
]);
|
|
2257
2071
|
const files = new Map(kitFiles);
|
|
@@ -2265,7 +2079,7 @@ var main = async () => {
|
|
|
2265
2079
|
const app = createApp({
|
|
2266
2080
|
site: siteConfig,
|
|
2267
2081
|
store,
|
|
2268
|
-
assets: { stylePath, browserScript, fontCss, preload: [...brand.files.keys(),
|
|
2082
|
+
assets: { stylePath, browserScript, fontCss, preload: [...brand.files.keys(), ...mono.files.keys(), ...body.files.keys()], reload: command === "dev" }
|
|
2269
2083
|
});
|
|
2270
2084
|
if (command === "build") {
|
|
2271
2085
|
await rm(outDir, { recursive: true, force: true });
|