@terrafirmagreg-team/guide 1.2.4 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/components/book-switcher.tsx +2 -2
- package/src/components/mdx/guide-entry.tsx +1 -1
- package/src/components/mdx/multiblock.tsx +2 -2
- package/src/components/tree/children.tsx +1 -1
- package/src/components/tree/index.tsx +1 -1
- package/src/components/views/browser.tsx +1 -1
- package/src/components/views/entry/pages.tsx +2 -2
- package/src/components/views/kind/links.tsx +4 -4
- package/src/components/views/kind/media.tsx +3 -3
- package/src/components/views/kind/recipe.tsx +6 -6
- package/src/components/views/kind/table.tsx +2 -2
- package/src/components/views/page/category-body.tsx +2 -2
- package/src/components/views/page/entry-body.tsx +1 -1
- package/src/components/views/page/overview-body.tsx +2 -2
- package/src/components/views/page/view.tsx +4 -4
- package/src/components/views/text.tsx +2 -2
- package/src/hooks/use-left-sidebar-tree.ts +1 -1
- package/src/hooks/use-tree.ts +2 -2
- package/src/lib/{books.ts → book/list.ts} +1 -1
- package/src/lib/book/raw.ts +1 -1
- package/src/lib/client/{guides.ts → books.ts} +1 -1
- package/src/lib/{client-payload → client/payload}/extras.ts +5 -5
- package/src/lib/{client-payload → client/payload}/index.ts +5 -5
- package/src/lib/{client-payload → client/payload}/links.ts +4 -6
- package/src/lib/{recipe.ts → kind/recipe.ts} +1 -1
- package/src/lib/markdown/book.ts +1 -1
- package/src/lib/markdown/page.ts +5 -5
- package/src/lib/{markdown-page.ts → markdown/provider.ts} +2 -2
- package/src/lib/markdown/text.ts +1 -1
- package/src/lib/multiblock/url.ts +1 -1
- package/src/lib/{breadcrumb.ts → nav/breadcrumb.ts} +1 -1
- package/src/lib/preview.ts +2 -2
- package/src/lib/reference/resolver.ts +4 -4
- package/src/lib/search/index.ts +1 -1
- package/src/lib/source.ts +3 -3
- package/src/lib/embeds.ts +0 -12
- /package/src/lib/{format.ts → display/format.ts} +0 -0
- /package/src/lib/{messages.ts → display/messages.ts} +0 -0
- /package/src/lib/{names.ts → display/names.ts} +0 -0
- /package/src/lib/{sprites.ts → kind/sprites.ts} +0 -0
- /package/src/lib/{table.ts → kind/table.ts} +0 -0
- /package/src/lib/{meta.ts → multiblock/meta.ts} +0 -0
- /package/src/lib/{paths.ts → nav/paths.ts} +0 -0
- /package/src/lib/{query.ts → nav/query.ts} +0 -0
- /package/src/lib/{toc.ts → nav/toc.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@terrafirmagreg-team/guide",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Guide/books section",
|
|
6
6
|
"license": "LGPL-3.0-only",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@terrafirmagreg-team/search": "1.2.3",
|
|
33
33
|
"@terrafirmagreg-team/sites": "1.2.1",
|
|
34
34
|
"@terrafirmagreg-team/translate": "1.2.4",
|
|
35
|
-
"@terrafirmagreg-team/ui": "1.2.
|
|
35
|
+
"@terrafirmagreg-team/ui": "1.2.4",
|
|
36
36
|
"fumadocs-core": "16.17.10",
|
|
37
37
|
"lucide-react": "^1.63.0"
|
|
38
38
|
},
|
|
@@ -7,8 +7,8 @@ import { useAsyncValue } from '@terrafirmagreg-team/ui/hooks/use-async-value';
|
|
|
7
7
|
import { useTranslations } from '@terrafirmagreg-team/translate/hooks/use-translations';
|
|
8
8
|
import { useResolvedLang } from '@terrafirmagreg-team/translate/hooks/use-resolved-lang';
|
|
9
9
|
import { useLocationSearchParams } from '@terrafirmagreg-team/ui/hooks/page/use-location-search';
|
|
10
|
-
import { guideQueryFromParams } from '@terrafirmagreg-team/guide/lib/query';
|
|
11
|
-
import { listGuideBooks } from '@terrafirmagreg-team/guide/lib/
|
|
10
|
+
import { guideQueryFromParams } from '@terrafirmagreg-team/guide/lib/nav/query';
|
|
11
|
+
import { listGuideBooks } from '@terrafirmagreg-team/guide/lib/book/list';
|
|
12
12
|
import { guideHref } from '@terrafirmagreg-team/guide/lib/links';
|
|
13
13
|
import { parseSectionLocation } from '@terrafirmagreg-team/sites/location';
|
|
14
14
|
import { Switcher } from '@terrafirmagreg-team/ui/components/blocks/nav/switcher';
|
|
@@ -7,7 +7,7 @@ import { Entry } from '@terrafirmagreg-team/game/components/entry/entry';
|
|
|
7
7
|
import { useEntryContext } from '@terrafirmagreg-team/game/hooks/use-entry-context';
|
|
8
8
|
import { ResolvedLangContext } from '@terrafirmagreg-team/translate/hooks/use-resolved-lang';
|
|
9
9
|
import { useAsyncValue } from '@terrafirmagreg-team/ui/hooks/use-async-value';
|
|
10
|
-
import { findClientGuideEntry } from '@terrafirmagreg-team/guide/lib/client/
|
|
10
|
+
import { findClientGuideEntry } from '@terrafirmagreg-team/guide/lib/client/books';
|
|
11
11
|
import type { GuideDirectiveProps } from '@terrafirmagreg-team/game/types/entry';
|
|
12
12
|
|
|
13
13
|
export function GuideEntry({
|
|
@@ -10,9 +10,9 @@ import { useAsyncValue } from '@terrafirmagreg-team/ui/hooks/use-async-value';
|
|
|
10
10
|
import { useDumpLocation } from '@terrafirmagreg-team/game/hooks/use-dump-location';
|
|
11
11
|
import { ResolvedLangContext } from '@terrafirmagreg-team/translate/hooks/use-resolved-lang';
|
|
12
12
|
import { createDumpAssetResolver } from '@terrafirmagreg-team/dump/lib/dump/assets/urls';
|
|
13
|
-
import { asMultiblock } from '@terrafirmagreg-team/guide/lib/meta';
|
|
13
|
+
import { asMultiblock } from '@terrafirmagreg-team/guide/lib/multiblock/meta';
|
|
14
14
|
import { glbFor } from '@terrafirmagreg-team/guide/lib/multiblock/url';
|
|
15
|
-
import { loadMultiblockNameIndex } from '@terrafirmagreg-team/guide/lib/client/
|
|
15
|
+
import { loadMultiblockNameIndex } from '@terrafirmagreg-team/guide/lib/client/books';
|
|
16
16
|
import { multiblockKey } from '@terrafirmagreg-team/guide/lib/multiblock';
|
|
17
17
|
import { MultiblockVisual } from '@terrafirmagreg-team/guide/components/views/kind/media';
|
|
18
18
|
import type { GuideMultiblock } from '@terrafirmagreg-team/guide/types';
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
sectionUrl,
|
|
8
8
|
versionSuffix,
|
|
9
9
|
} from '@terrafirmagreg-team/sites/location';
|
|
10
|
-
import { bookOptionId, guideCategoryHref } from '@terrafirmagreg-team/guide/lib/paths';
|
|
10
|
+
import { bookOptionId, guideCategoryHref } from '@terrafirmagreg-team/guide/lib/nav/paths';
|
|
11
11
|
import type { GuideIndex } from '@terrafirmagreg-team/guide/types';
|
|
12
12
|
import type { TaggedReference } from '@terrafirmagreg-team/dump/lib/dump/contract/ref';
|
|
13
13
|
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
sectionUrl,
|
|
17
17
|
versionSuffix,
|
|
18
18
|
} from '@terrafirmagreg-team/sites/location';
|
|
19
|
-
import { bookOptionId } from '@terrafirmagreg-team/guide/lib/paths';
|
|
19
|
+
import { bookOptionId } from '@terrafirmagreg-team/guide/lib/nav/paths';
|
|
20
20
|
import { bookSlug, toBook } from '@terrafirmagreg-team/guide/lib/book';
|
|
21
21
|
import { sectionDatasets } from '@terrafirmagreg-team/kit/lib/datasets';
|
|
22
22
|
import type { GuideBookJson, GuideBookRef } from '@terrafirmagreg-team/guide/lib/data/dto';
|
|
@@ -13,7 +13,7 @@ import { GuidePageView } from '@terrafirmagreg-team/guide/components/views/page/
|
|
|
13
13
|
import {
|
|
14
14
|
firstGuideEntryId,
|
|
15
15
|
guideQueryFromParams,
|
|
16
|
-
} from '@terrafirmagreg-team/guide/lib/query';
|
|
16
|
+
} from '@terrafirmagreg-team/guide/lib/nav/query';
|
|
17
17
|
import { getGuideSource } from '@terrafirmagreg-team/guide/lib/source';
|
|
18
18
|
import { guideHref } from '@terrafirmagreg-team/guide/lib/links';
|
|
19
19
|
import { guideConfig } from '@terrafirmagreg-team/guide/lib/config';
|
|
@@ -22,7 +22,7 @@ import { UnknownPage } from '@terrafirmagreg-team/guide/components/views/kind/un
|
|
|
22
22
|
import type { PageRendererProps } from '@terrafirmagreg-team/guide/types';
|
|
23
23
|
import type { AtlasBundle } from '@terrafirmagreg-team/dump/lib/dump/assets/atlas/dto';
|
|
24
24
|
import type { Lang } from '@terrafirmagreg-team/translate/types/locale';
|
|
25
|
-
import { guideMessage } from '@terrafirmagreg-team/guide/lib/messages';
|
|
25
|
+
import { guideMessage } from '@terrafirmagreg-team/guide/lib/display/messages';
|
|
26
26
|
import type { PagePreviewData } from '@terrafirmagreg-team/ui/types/preview';
|
|
27
27
|
import type { GuideBookMeta } from '@terrafirmagreg-team/guide/types';
|
|
28
28
|
import type {
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
pageAnchors,
|
|
38
38
|
pageIcons,
|
|
39
39
|
repeatedTitle,
|
|
40
|
-
} from '@terrafirmagreg-team/guide/lib/toc';
|
|
40
|
+
} from '@terrafirmagreg-team/guide/lib/nav/toc';
|
|
41
41
|
import { classify, isIndexPage, type PageKind, pageTexts } from '@terrafirmagreg-team/guide/lib/page-kind';
|
|
42
42
|
import {
|
|
43
43
|
EntryGroup,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { LinkPreview } from '@terrafirmagreg-team/ui/components/blocks/link/link-preview';
|
|
2
2
|
import { Entry } from '@terrafirmagreg-team/game/components/entry/entry';
|
|
3
|
-
import {
|
|
4
|
-
import { guideMessage } from '@terrafirmagreg-team/guide/lib/messages';
|
|
3
|
+
import { sectionEmbeds } from '@terrafirmagreg-team/kit/lib/embeds';
|
|
4
|
+
import { guideMessage } from '@terrafirmagreg-team/guide/lib/display/messages';
|
|
5
5
|
import {
|
|
6
6
|
entryLabel,
|
|
7
7
|
entryRef,
|
|
8
8
|
spriteName,
|
|
9
|
-
} from '@terrafirmagreg-team/guide/lib/names';
|
|
9
|
+
} from '@terrafirmagreg-team/guide/lib/display/names';
|
|
10
10
|
import { referenceHref } from '@terrafirmagreg-team/guide/lib/reference';
|
|
11
11
|
import { parseGuideReference } from '@terrafirmagreg-team/guide/lib/reference/resolver';
|
|
12
12
|
import type { PageRendererProps } from '@terrafirmagreg-team/guide/types';
|
|
@@ -92,7 +92,7 @@ export function QuestPage({
|
|
|
92
92
|
const id = page.trigger || page.quest || page.link;
|
|
93
93
|
const hit = id ? questLinks?.[parseGuideReference(id).id] : undefined;
|
|
94
94
|
const href = hit
|
|
95
|
-
?
|
|
95
|
+
? sectionEmbeds().quest?.href(dataset, lang, { category: hit.filename, id: hit.questId })
|
|
96
96
|
: undefined;
|
|
97
97
|
const name = id ? spriteName(dataset, langMap, atlases, id) : '—';
|
|
98
98
|
const label = id && name !== id ? name : <code>{name}</code>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import { GuideText } from '@terrafirmagreg-team/guide/components/views/text';
|
|
3
3
|
import { useDumpLocation } from '@terrafirmagreg-team/game/hooks/use-dump-location';
|
|
4
|
-
import { asMultiblock } from '@terrafirmagreg-team/guide/lib/meta';
|
|
4
|
+
import { asMultiblock } from '@terrafirmagreg-team/guide/lib/multiblock/meta';
|
|
5
5
|
import {
|
|
6
6
|
createDumpAssetResolver,
|
|
7
7
|
texturePublicUrl,
|
|
@@ -12,8 +12,8 @@ import { langString } from '@terrafirmagreg-team/dump/lib/dump/assets/lang/names
|
|
|
12
12
|
import { matchVariant } from '@terrafirmagreg-team/dump/lib/dump/data/registry/parse';
|
|
13
13
|
import { GlbViewer } from '@terrafirmagreg-team/ui/components/blocks/media/glb/viewer';
|
|
14
14
|
import { multiblockKey } from '@terrafirmagreg-team/guide/lib/multiblock';
|
|
15
|
-
import { guideFormatOpts } from '@terrafirmagreg-team/guide/lib/format';
|
|
16
|
-
import { spriteName } from '@terrafirmagreg-team/guide/lib/names';
|
|
15
|
+
import { guideFormatOpts } from '@terrafirmagreg-team/guide/lib/display/format';
|
|
16
|
+
import { spriteName } from '@terrafirmagreg-team/guide/lib/display/names';
|
|
17
17
|
import type { PageRendererProps } from '@terrafirmagreg-team/guide/types';
|
|
18
18
|
import { GlbPlaceholder } from '@terrafirmagreg-team/ui/components/blocks/media/glb/viewer';
|
|
19
19
|
import { Slideshow } from '@terrafirmagreg-team/ui/components/blocks/media/slideshow';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { Card } from '@terrafirmagreg-team/ui/components/ui/card';
|
|
3
3
|
import { EmptyState } from '@terrafirmagreg-team/ui/components/blocks/page/empty-state';
|
|
4
|
-
import {
|
|
4
|
+
import { sectionEmbeds } from '@terrafirmagreg-team/kit/lib/embeds';
|
|
5
5
|
import { Entry } from '@terrafirmagreg-team/game/components/entry/entry';
|
|
6
6
|
import { EntryList } from '@terrafirmagreg-team/game/components/entry/list';
|
|
7
|
-
import { guideMessage } from '@terrafirmagreg-team/guide/lib/messages';
|
|
7
|
+
import { guideMessage } from '@terrafirmagreg-team/guide/lib/display/messages';
|
|
8
8
|
import { collectItemIds } from '@terrafirmagreg-team/guide/lib/data/parse';
|
|
9
|
-
import { pageTitle } from '@terrafirmagreg-team/guide/lib/toc';
|
|
10
|
-
import { spriteName } from '@terrafirmagreg-team/guide/lib/names';
|
|
11
|
-
import { recipeIds, recipeNameScope } from '@terrafirmagreg-team/guide/lib/recipe';
|
|
9
|
+
import { pageTitle } from '@terrafirmagreg-team/guide/lib/nav/toc';
|
|
10
|
+
import { spriteName } from '@terrafirmagreg-team/guide/lib/display/names';
|
|
11
|
+
import { recipeIds, recipeNameScope } from '@terrafirmagreg-team/guide/lib/kind/recipe';
|
|
12
12
|
|
|
13
13
|
import type { PageRendererProps } from '@terrafirmagreg-team/guide/types';
|
|
14
14
|
|
|
@@ -29,7 +29,7 @@ export function RecipePage({
|
|
|
29
29
|
</EmptyState>
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
|
-
const RecipeCard =
|
|
32
|
+
const RecipeCard = sectionEmbeds().recipe?.Card;
|
|
33
33
|
return (
|
|
34
34
|
<div className="space-y-4">
|
|
35
35
|
{ids.map((id) => {
|
|
@@ -10,8 +10,8 @@ import {
|
|
|
10
10
|
TableRow,
|
|
11
11
|
} from '@terrafirmagreg-team/ui/components/ui/table';
|
|
12
12
|
import { collectItemIds } from '@terrafirmagreg-team/guide/lib/data/parse';
|
|
13
|
-
import { cssColor, cellTexts } from '@terrafirmagreg-team/guide/lib/table';
|
|
14
|
-
import { guideFormatOpts } from '@terrafirmagreg-team/guide/lib/format';
|
|
13
|
+
import { cssColor, cellTexts } from '@terrafirmagreg-team/guide/lib/kind/table';
|
|
14
|
+
import { guideFormatOpts } from '@terrafirmagreg-team/guide/lib/display/format';
|
|
15
15
|
import type { GuideTableCell, PageRendererProps } from '@terrafirmagreg-team/guide/types';
|
|
16
16
|
|
|
17
17
|
export function TablePage(props: PageRendererProps) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { DatasetRef } from '@terrafirmagreg-team/sites/location';
|
|
2
2
|
import { Entry } from '@terrafirmagreg-team/game/components/entry/entry';
|
|
3
3
|
import { ItemRow } from '@terrafirmagreg-team/ui/components/blocks/list/row';
|
|
4
|
-
import { guideBookHref } from '@terrafirmagreg-team/guide/lib/paths';
|
|
5
|
-
import { guideMessage } from '@terrafirmagreg-team/guide/lib/messages';
|
|
4
|
+
import { guideBookHref } from '@terrafirmagreg-team/guide/lib/nav/paths';
|
|
5
|
+
import { guideMessage } from '@terrafirmagreg-team/guide/lib/display/messages';
|
|
6
6
|
import type { GuideIndex, GuideMessages } from '@terrafirmagreg-team/guide/types';
|
|
7
7
|
|
|
8
8
|
type GuideCategoryBodyProps = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DatasetRef } from '@terrafirmagreg-team/sites/location';
|
|
2
2
|
import { EmptyState } from '@terrafirmagreg-team/ui/components/blocks/page/empty-state';
|
|
3
3
|
import { EntryView } from '@terrafirmagreg-team/guide/components/views/entry/view';
|
|
4
|
-
import { guideMessage } from '@terrafirmagreg-team/guide/lib/messages';
|
|
4
|
+
import { guideMessage } from '@terrafirmagreg-team/guide/lib/display/messages';
|
|
5
5
|
import type { PagePreviewData } from '@terrafirmagreg-team/ui/types/preview';
|
|
6
6
|
import type { Lang } from '@terrafirmagreg-team/translate/types/locale';
|
|
7
7
|
import type {
|
|
@@ -5,11 +5,11 @@ import { GuideText } from '@terrafirmagreg-team/guide/components/views/text';
|
|
|
5
5
|
import {
|
|
6
6
|
guideCategoryHref,
|
|
7
7
|
isRootCategory,
|
|
8
|
-
} from '@terrafirmagreg-team/guide/lib/paths';
|
|
8
|
+
} from '@terrafirmagreg-team/guide/lib/nav/paths';
|
|
9
9
|
import { texturePublicUrl } from '@terrafirmagreg-team/dump/lib/dump/assets/urls';
|
|
10
10
|
import { useDumpLocation } from '@terrafirmagreg-team/game/hooks/use-dump-location';
|
|
11
11
|
import type { DatasetRef } from '@terrafirmagreg-team/sites/location';
|
|
12
|
-
import { guideMessage } from '@terrafirmagreg-team/guide/lib/messages';
|
|
12
|
+
import { guideMessage } from '@terrafirmagreg-team/guide/lib/display/messages';
|
|
13
13
|
import type { PagePreviewData } from '@terrafirmagreg-team/ui/types/preview';
|
|
14
14
|
import type { Lang } from '@terrafirmagreg-team/translate/types/locale';
|
|
15
15
|
import type { GuideIndex, GuideMessages } from '@terrafirmagreg-team/guide/types';
|
|
@@ -14,18 +14,18 @@ import {
|
|
|
14
14
|
import { guideConfig } from '@terrafirmagreg-team/guide/lib/config';
|
|
15
15
|
import { GithubInfo } from '@terrafirmagreg-team/ui/components/blocks/git/github-info';
|
|
16
16
|
import { sectionConfig } from '@terrafirmagreg-team/kit/lib/config';
|
|
17
|
-
import { categoryMap, guideBreadcrumbItems } from '@terrafirmagreg-team/guide/lib/breadcrumb';
|
|
18
|
-
import { guideToc } from '@terrafirmagreg-team/guide/lib/toc';
|
|
17
|
+
import { categoryMap, guideBreadcrumbItems } from '@terrafirmagreg-team/guide/lib/nav/breadcrumb';
|
|
18
|
+
import { guideToc } from '@terrafirmagreg-team/guide/lib/nav/toc';
|
|
19
19
|
import { GuideText } from '@terrafirmagreg-team/guide/components/views/text';
|
|
20
20
|
import { GuideOverviewBody } from '@terrafirmagreg-team/guide/components/views/page/overview-body';
|
|
21
21
|
import { GuideCategoryBody } from '@terrafirmagreg-team/guide/components/views/page/category-body';
|
|
22
22
|
import { GuideEntryBody } from '@terrafirmagreg-team/guide/components/views/page/entry-body';
|
|
23
|
-
import { guideMessage } from '@terrafirmagreg-team/guide/lib/messages';
|
|
23
|
+
import { guideMessage } from '@terrafirmagreg-team/guide/lib/display/messages';
|
|
24
24
|
import { CommentsSlot } from '@terrafirmagreg-team/discussions/components/comments';
|
|
25
25
|
import {
|
|
26
26
|
guideBookHref,
|
|
27
27
|
guideCategoryHref,
|
|
28
|
-
} from '@terrafirmagreg-team/guide/lib/paths';
|
|
28
|
+
} from '@terrafirmagreg-team/guide/lib/nav/paths';
|
|
29
29
|
import type { GuideIndex, GuidePagePayload } from '@terrafirmagreg-team/guide/types';
|
|
30
30
|
|
|
31
31
|
type NavItem = { name: string; url: string };
|
|
@@ -2,8 +2,8 @@ import type { DatasetRef } from '@terrafirmagreg-team/sites/location';
|
|
|
2
2
|
import { Fragment, type ReactNode } from 'react';
|
|
3
3
|
import { LinkPreview } from '@terrafirmagreg-team/ui/components/blocks/link/link-preview';
|
|
4
4
|
import { guideLink } from '@terrafirmagreg-team/guide/lib/reference';
|
|
5
|
-
import { formatGuide } from '@terrafirmagreg-team/guide/lib/format';
|
|
6
|
-
import { keybindLabels } from '@terrafirmagreg-team/guide/lib/format';
|
|
5
|
+
import { formatGuide } from '@terrafirmagreg-team/guide/lib/display/format';
|
|
6
|
+
import { keybindLabels } from '@terrafirmagreg-team/guide/lib/display/format';
|
|
7
7
|
import { Kbd } from '@terrafirmagreg-team/ui/components/ui/kbd';
|
|
8
8
|
import {
|
|
9
9
|
Tooltip,
|
|
@@ -6,7 +6,7 @@ import { useLocationSearchParams } from '@terrafirmagreg-team/ui/hooks/page/use-
|
|
|
6
6
|
import { useResolvedLang } from '@terrafirmagreg-team/translate/hooks/use-resolved-lang';
|
|
7
7
|
import { useLastValue } from '@terrafirmagreg-team/ui/hooks/use-last-value';
|
|
8
8
|
import { useGuideTree } from '@terrafirmagreg-team/guide/hooks/use-tree';
|
|
9
|
-
import { guideQueryFromParams } from '@terrafirmagreg-team/guide/lib/query';
|
|
9
|
+
import { guideQueryFromParams } from '@terrafirmagreg-team/guide/lib/nav/query';
|
|
10
10
|
import { parseSectionLocation } from '@terrafirmagreg-team/sites/location';
|
|
11
11
|
|
|
12
12
|
export function useGuideLeftSidebarTree(tree: PageTree.Root): PageTree.Root {
|
package/src/hooks/use-tree.ts
CHANGED
|
@@ -3,8 +3,8 @@ import type { DatasetRef } from '@terrafirmagreg-team/sites/location';
|
|
|
3
3
|
|
|
4
4
|
import type * as PageTree from 'fumadocs-core/page-tree';
|
|
5
5
|
import { useAsyncValue } from '@terrafirmagreg-team/ui/hooks/use-async-value';
|
|
6
|
-
import { loadClientGuideBook } from '@terrafirmagreg-team/guide/lib/client/
|
|
7
|
-
import { listGuideBooks } from '@terrafirmagreg-team/guide/lib/
|
|
6
|
+
import { loadClientGuideBook } from '@terrafirmagreg-team/guide/lib/client/books';
|
|
7
|
+
import { listGuideBooks } from '@terrafirmagreg-team/guide/lib/book/list';
|
|
8
8
|
import { guideTreeChildren } from '@terrafirmagreg-team/guide/components/tree/children';
|
|
9
9
|
import type { Lang } from '@terrafirmagreg-team/translate/types/locale';
|
|
10
10
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DatasetRef } from '@terrafirmagreg-team/sites/location';
|
|
2
2
|
import { sectionConfig } from '@terrafirmagreg-team/kit/lib/config';
|
|
3
|
-
import { listClientGuideBookSummaries } from '@terrafirmagreg-team/guide/lib/client/
|
|
3
|
+
import { listClientGuideBookSummaries } from '@terrafirmagreg-team/guide/lib/client/books';
|
|
4
4
|
import type { Lang } from '@terrafirmagreg-team/translate/types/locale';
|
|
5
5
|
|
|
6
6
|
type GuideBookSummary = Awaited<
|
package/src/lib/book/raw.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { asTaggedReference } from '@terrafirmagreg-team/dump/lib/dump/contract/r
|
|
|
2
2
|
import { asDumpTextList } from '@terrafirmagreg-team/dump/lib/dump/contract/text';
|
|
3
3
|
import type { DumpText } from '@terrafirmagreg-team/dump/lib/dump/contract/text';
|
|
4
4
|
import type { TaggedReference } from '@terrafirmagreg-team/dump/lib/dump/contract/ref';
|
|
5
|
-
import { bareId } from '@terrafirmagreg-team/guide/lib/paths';
|
|
5
|
+
import { bareId } from '@terrafirmagreg-team/guide/lib/nav/paths';
|
|
6
6
|
|
|
7
7
|
export type RawRecord = Record<string, unknown>;
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DatasetRef } from '@terrafirmagreg-team/sites/location';
|
|
2
2
|
import { asRecord, asString } from '@terrafirmagreg-team/dump/lib/dump/contract/read';
|
|
3
3
|
import { joinDumpRel } from '@terrafirmagreg-team/dump/lib/dump/paths';
|
|
4
|
-
import { bareId } from '@terrafirmagreg-team/guide/lib/paths';
|
|
4
|
+
import { bareId } from '@terrafirmagreg-team/guide/lib/nav/paths';
|
|
5
5
|
import type { GuideEntry } from '@terrafirmagreg-team/guide/types';
|
|
6
6
|
import type { GuideMultiblock } from '@terrafirmagreg-team/guide/lib/data/dto';
|
|
7
7
|
import type {
|
|
@@ -2,12 +2,12 @@ import type { DatasetRef } from '@terrafirmagreg-team/sites/location';
|
|
|
2
2
|
import { stackDisplayName } from '@terrafirmagreg-team/dump/lib/dump/assets/lang/names';
|
|
3
3
|
import { loadClientModAtlases } from '@terrafirmagreg-team/dump/lib/dump/client/atlases';
|
|
4
4
|
import { loadClientKeybinds } from '@terrafirmagreg-team/dump/lib/dump/client/keybinds';
|
|
5
|
-
import {
|
|
5
|
+
import { sectionEmbeds } from '@terrafirmagreg-team/kit/lib/embeds';
|
|
6
6
|
import { loadClientRegistry } from '@terrafirmagreg-team/dump/lib/dump/client/registry';
|
|
7
7
|
import { parseStackId } from '@terrafirmagreg-team/dump/lib/dump/contract/ref';
|
|
8
|
-
import { spriteIdsFromEntry } from '@terrafirmagreg-team/guide/lib/sprites';
|
|
9
|
-
import { recipeIds } from '@terrafirmagreg-team/guide/lib/recipe';
|
|
10
|
-
import { asMultiblock } from '@terrafirmagreg-team/guide/lib/meta';
|
|
8
|
+
import { spriteIdsFromEntry } from '@terrafirmagreg-team/guide/lib/kind/sprites';
|
|
9
|
+
import { recipeIds } from '@terrafirmagreg-team/guide/lib/kind/recipe';
|
|
10
|
+
import { asMultiblock } from '@terrafirmagreg-team/guide/lib/multiblock/meta';
|
|
11
11
|
import { glbFor } from '@terrafirmagreg-team/guide/lib/multiblock/url';
|
|
12
12
|
import { multiblockKey } from '@terrafirmagreg-team/guide/lib/multiblock';
|
|
13
13
|
import type { Lang } from '@terrafirmagreg-team/translate/types/locale';
|
|
@@ -36,7 +36,7 @@ export async function entryExtras(
|
|
|
36
36
|
pages.map(async (page) => {
|
|
37
37
|
await Promise.all(
|
|
38
38
|
recipeIds(page).map(async (id) => {
|
|
39
|
-
const recipe = await
|
|
39
|
+
const recipe = await sectionEmbeds().recipe?.load(dataset, id);
|
|
40
40
|
if (recipe) recipes[id] = recipe;
|
|
41
41
|
}),
|
|
42
42
|
);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { DatasetRef } from '@terrafirmagreg-team/sites/location';
|
|
2
|
-
import { loadClientGuideBook } from '@terrafirmagreg-team/guide/lib/client/
|
|
2
|
+
import { loadClientGuideBook } from '@terrafirmagreg-team/guide/lib/client/books';
|
|
3
3
|
import { uiConfig } from '@terrafirmagreg-team/ui/lib/config';
|
|
4
|
-
import { categoryMap } from '@terrafirmagreg-team/guide/lib/breadcrumb';
|
|
5
|
-
import { bareId, guideBookHref } from '@terrafirmagreg-team/guide/lib/paths';
|
|
6
|
-
import {
|
|
4
|
+
import { categoryMap } from '@terrafirmagreg-team/guide/lib/nav/breadcrumb';
|
|
5
|
+
import { bareId, guideBookHref } from '@terrafirmagreg-team/guide/lib/nav/paths';
|
|
6
|
+
import { sectionEmbeds } from '@terrafirmagreg-team/kit/lib/embeds';
|
|
7
7
|
import type { Lang } from '@terrafirmagreg-team/translate/types/locale';
|
|
8
8
|
import type {
|
|
9
9
|
GuideMessages,
|
|
@@ -76,7 +76,7 @@ export async function loadClientGuidePayload(
|
|
|
76
76
|
)
|
|
77
77
|
: undefined;
|
|
78
78
|
for (const hit of Object.values(questLinks)) {
|
|
79
|
-
const url =
|
|
79
|
+
const url = sectionEmbeds().quest?.href(dataset, undefined, {
|
|
80
80
|
category: hit.filename,
|
|
81
81
|
id: hit.questId,
|
|
82
82
|
});
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { DatasetRef } from '@terrafirmagreg-team/sites/location';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
type EmbedQuestLocation,
|
|
5
|
-
} from '@terrafirmagreg-team/guide/lib/embeds';
|
|
2
|
+
import { sectionEmbeds } from '@terrafirmagreg-team/kit/lib/embeds';
|
|
3
|
+
import type { EmbedQuestLocation } from '@terrafirmagreg-team/kit/types/embeds';
|
|
6
4
|
import { classify, pageTexts } from '@terrafirmagreg-team/guide/lib/page-kind';
|
|
7
|
-
import { formatGuide } from '@terrafirmagreg-team/guide/lib/format';
|
|
5
|
+
import { formatGuide } from '@terrafirmagreg-team/guide/lib/display/format';
|
|
8
6
|
import {
|
|
9
7
|
parseGuideReference,
|
|
10
8
|
resolveGuideReference,
|
|
@@ -24,7 +22,7 @@ async function collectQuestLink(
|
|
|
24
22
|
const ref = parseGuideReference(target);
|
|
25
23
|
if (!force && ref.kind !== 'quest') return;
|
|
26
24
|
if (questLinks[ref.id]) return;
|
|
27
|
-
const hit = await
|
|
25
|
+
const hit = await sectionEmbeds().quest?.findLocation(dataset, ref.id);
|
|
28
26
|
if (hit) questLinks[ref.id] = hit;
|
|
29
27
|
}
|
|
30
28
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { GuidePage } from '@terrafirmagreg-team/guide/types';
|
|
2
|
-
import type { EmbedRecipe } from '@terrafirmagreg-team/
|
|
2
|
+
import type { EmbedRecipe } from '@terrafirmagreg-team/kit/types/embeds';
|
|
3
3
|
import { stackDisplayName } from '@terrafirmagreg-team/game/lib/entry/display';
|
|
4
4
|
|
|
5
5
|
export function recipeIds(page: GuidePage): string[] {
|
package/src/lib/markdown/book.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type {
|
|
|
3
3
|
GuidePage,
|
|
4
4
|
GuidePagePayload,
|
|
5
5
|
} from '@terrafirmagreg-team/guide/types';
|
|
6
|
-
import { guideBookHref } from '@terrafirmagreg-team/guide/lib/paths';
|
|
6
|
+
import { guideBookHref } from '@terrafirmagreg-team/guide/lib/nav/paths';
|
|
7
7
|
import type { GuideMarkdownCtx } from './ctx';
|
|
8
8
|
import { guidePageMarkdown } from './page';
|
|
9
9
|
import { guideTextMarkdown } from './text';
|
package/src/lib/markdown/page.ts
CHANGED
|
@@ -4,8 +4,8 @@ import type {
|
|
|
4
4
|
} from '@terrafirmagreg-team/guide/types';
|
|
5
5
|
import { classify, isIndexPage, pageTexts } from '@terrafirmagreg-team/guide/lib/page-kind';
|
|
6
6
|
import { guideLink } from '@terrafirmagreg-team/guide/lib/reference';
|
|
7
|
-
import { bareId } from '@terrafirmagreg-team/guide/lib/paths';
|
|
8
|
-
import {
|
|
7
|
+
import { bareId } from '@terrafirmagreg-team/guide/lib/nav/paths';
|
|
8
|
+
import { sectionEmbeds } from '@terrafirmagreg-team/kit/lib/embeds';
|
|
9
9
|
import { texturePublicUrl } from '@terrafirmagreg-team/dump/lib/dump/assets/urls';
|
|
10
10
|
import { collectItemIds } from '@terrafirmagreg-team/guide/lib/data/parse';
|
|
11
11
|
import { stackDisplayName } from '@terrafirmagreg-team/dump/lib/dump/assets/lang/names';
|
|
@@ -68,8 +68,8 @@ export function guidePageMarkdown(
|
|
|
68
68
|
];
|
|
69
69
|
for (const id of ids) {
|
|
70
70
|
const recipe = payload?.extras?.recipes[id];
|
|
71
|
-
const label = recipe ?
|
|
72
|
-
parts.push(`- [${label}](${
|
|
71
|
+
const label = recipe ? sectionEmbeds().recipe?.title(recipe, ctx.langMap) : id;
|
|
72
|
+
parts.push(`- [${label}](${sectionEmbeds().recipe?.href(ctx.dataset, undefined, { id })})`);
|
|
73
73
|
}
|
|
74
74
|
for (const raw of pageTexts(page)) parts.push(guideTextMarkdown(raw, ctx));
|
|
75
75
|
break;
|
|
@@ -129,7 +129,7 @@ export function guidePageMarkdown(
|
|
|
129
129
|
const url =
|
|
130
130
|
href ??
|
|
131
131
|
(hit
|
|
132
|
-
?
|
|
132
|
+
? sectionEmbeds().quest?.href(ctx.dataset, undefined, {
|
|
133
133
|
category: hit.filename,
|
|
134
134
|
id: hit.questId,
|
|
135
135
|
})
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { DatasetRef } from '@terrafirmagreg-team/sites/location';
|
|
2
2
|
import { registerMarkdownProvider } from '@terrafirmagreg-team/mdx/lib/markdown';
|
|
3
|
-
import { loadClientGuidePayload } from '@terrafirmagreg-team/guide/lib/client
|
|
3
|
+
import { loadClientGuidePayload } from '@terrafirmagreg-team/guide/lib/client/payload';
|
|
4
4
|
import { clientDumpLang } from '@terrafirmagreg-team/dump/lib/dump/client/dump';
|
|
5
|
-
import { categoryMap } from '@terrafirmagreg-team/guide/lib/breadcrumb';
|
|
5
|
+
import { categoryMap } from '@terrafirmagreg-team/guide/lib/nav/breadcrumb';
|
|
6
6
|
import {
|
|
7
7
|
guideCategoryMarkdown,
|
|
8
8
|
guideEntryMarkdown,
|
package/src/lib/markdown/text.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { GuideFormatNode } from '@terrafirmagreg-team/guide/types';
|
|
2
|
-
import { formatGuide, keybindLabels } from '@terrafirmagreg-team/guide/lib/format';
|
|
2
|
+
import { formatGuide, keybindLabels } from '@terrafirmagreg-team/guide/lib/display/format';
|
|
3
3
|
import { guideLink } from '@terrafirmagreg-team/guide/lib/reference';
|
|
4
4
|
import { type GuideMarkdownCtx, refCtx } from './ctx';
|
|
5
5
|
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from '@terrafirmagreg-team/dump/lib/dump/client/dump';
|
|
9
9
|
import { loadDatasetDump } from '@terrafirmagreg-team/dump/lib/dump/mods/load';
|
|
10
10
|
import { createDatasetCache } from '@terrafirmagreg-team/dump/lib/dump/reader';
|
|
11
|
-
import { loadMultiblockNameIndex } from '@terrafirmagreg-team/guide/lib/client/
|
|
11
|
+
import { loadMultiblockNameIndex } from '@terrafirmagreg-team/guide/lib/client/books';
|
|
12
12
|
import type { Lang } from '@terrafirmagreg-team/translate/types/locale';
|
|
13
13
|
import type { GuideMultiblock } from '@terrafirmagreg-team/guide/types';
|
|
14
14
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DatasetRef } from '@terrafirmagreg-team/sites/location';
|
|
2
|
-
import { guideBookHref, guideCategoryHref } from '@terrafirmagreg-team/guide/lib/paths';
|
|
2
|
+
import { guideBookHref, guideCategoryHref } from '@terrafirmagreg-team/guide/lib/nav/paths';
|
|
3
3
|
import type { GuideCategory, GuideIndex, GuidePageKind } from '@terrafirmagreg-team/guide/types';
|
|
4
4
|
|
|
5
5
|
export function categoryMap(
|
package/src/lib/preview.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { registerPreviewResolver } from '@terrafirmagreg-team/preview/lib';
|
|
2
|
-
import { loadClientGuideBook } from '@terrafirmagreg-team/guide/lib/client/
|
|
3
|
-
import { guidePlainText } from '@terrafirmagreg-team/guide/lib/format';
|
|
2
|
+
import { loadClientGuideBook } from '@terrafirmagreg-team/guide/lib/client/books';
|
|
3
|
+
import { guidePlainText } from '@terrafirmagreg-team/guide/lib/display/format';
|
|
4
4
|
import { entryPreviewIcon } from '@terrafirmagreg-team/game/lib/preview';
|
|
5
5
|
import type { PreviewResolverCtx } from '@terrafirmagreg-team/preview/lib';
|
|
6
6
|
import type { PagePreviewData } from '@terrafirmagreg-team/ui/types/preview';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { sectionEmbeds } from '@terrafirmagreg-team/kit/lib/embeds';
|
|
2
2
|
import {
|
|
3
3
|
bareId,
|
|
4
4
|
guideBookHref,
|
|
5
|
-
} from '@terrafirmagreg-team/guide/lib/paths';
|
|
5
|
+
} from '@terrafirmagreg-team/guide/lib/nav/paths';
|
|
6
6
|
import type {
|
|
7
7
|
GuideReference,
|
|
8
8
|
GuideReferenceContext,
|
|
@@ -66,13 +66,13 @@ export function resolveGuideReference(
|
|
|
66
66
|
case 'recipe': {
|
|
67
67
|
const href =
|
|
68
68
|
context.targets?.recipe?.(reference.id) ??
|
|
69
|
-
|
|
69
|
+
sectionEmbeds().recipe?.href(context.dataset, undefined, { id: reference.id });
|
|
70
70
|
return { ...reference, href, available: Boolean(href) };
|
|
71
71
|
}
|
|
72
72
|
case 'quest': {
|
|
73
73
|
const hit = context.questLinks?.[reference.id];
|
|
74
74
|
const href = hit
|
|
75
|
-
?
|
|
75
|
+
? sectionEmbeds().quest?.href(context.dataset, undefined, {
|
|
76
76
|
category: hit.filename,
|
|
77
77
|
id: hit.questId,
|
|
78
78
|
})
|
package/src/lib/search/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DatasetRef } from '@terrafirmagreg-team/sites/location';
|
|
2
2
|
import type { AdvancedIndex } from 'fumadocs-core/search/server';
|
|
3
3
|
import { dumpTextString, langString } from '@terrafirmagreg-team/dump/lib/dump/assets/lang/names';
|
|
4
|
-
import { formatGuide } from '@terrafirmagreg-team/guide/lib/format';
|
|
4
|
+
import { formatGuide } from '@terrafirmagreg-team/guide/lib/display/format';
|
|
5
5
|
import { isIndexPage } from '@terrafirmagreg-team/guide/lib/page-kind';
|
|
6
6
|
import type { DumpIndex } from '@terrafirmagreg-team/dump/lib/dump/mods/dto';
|
|
7
7
|
|
package/src/lib/source.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { listGuideBooks } from '@terrafirmagreg-team/guide/lib/
|
|
2
|
-
import { loadClientGuideBook } from '@terrafirmagreg-team/guide/lib/client/
|
|
3
|
-
import { loadClientGuidePayload } from '@terrafirmagreg-team/guide/lib/client
|
|
1
|
+
import { listGuideBooks } from '@terrafirmagreg-team/guide/lib/book/list';
|
|
2
|
+
import { loadClientGuideBook } from '@terrafirmagreg-team/guide/lib/client/books';
|
|
3
|
+
import { loadClientGuidePayload } from '@terrafirmagreg-team/guide/lib/client/payload';
|
|
4
4
|
|
|
5
5
|
export function getGuideSource() {
|
|
6
6
|
return {
|
package/src/lib/embeds.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { createConfig } from '@terrafirmagreg-team/kit/lib/config';
|
|
2
|
-
import type { SectionEmbeds } from '@terrafirmagreg-team/kit/types/embeds';
|
|
3
|
-
|
|
4
|
-
export type {
|
|
5
|
-
EmbedRecipe,
|
|
6
|
-
EmbedRecipeCardProps,
|
|
7
|
-
EmbedQuestLocation,
|
|
8
|
-
SectionEmbeds,
|
|
9
|
-
} from '@terrafirmagreg-team/kit/types/embeds';
|
|
10
|
-
|
|
11
|
-
export const { register: registerGuideEmbeds, get: guideEmbeds } =
|
|
12
|
-
createConfig<SectionEmbeds>('GuideEmbeds');
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|