@terrafirmagreg-team/guide 0.1.0 → 1.2.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/package.json +18 -19
- package/src/components/book-switcher.tsx +12 -6
- package/src/components/mdx/guide-entry.tsx +48 -0
- package/src/components/mdx/multiblock.tsx +86 -0
- package/src/{lib/tree/children.ts → components/tree/children.tsx} +13 -8
- package/src/{lib/tree/index.ts → components/tree/index.tsx} +25 -15
- package/src/components/views/browser.tsx +26 -17
- package/src/components/views/entry/pages.tsx +4 -2
- package/src/components/views/entry/view.tsx +3 -1
- package/src/components/views/kind/links.tsx +3 -2
- package/src/components/views/kind/media.tsx +6 -5
- package/src/components/views/kind/recipe.tsx +6 -51
- package/src/components/views/kind/table.tsx +4 -2
- package/src/components/views/kind/unknown.tsx +1 -0
- package/src/components/views/page/category-body.tsx +3 -1
- package/src/components/views/page/entry-body.tsx +3 -1
- package/src/components/views/page/overview-body.tsx +4 -2
- package/src/components/views/page/text.tsx +1 -0
- package/src/components/views/page/view.tsx +6 -6
- package/src/components/views/text.tsx +4 -2
- package/src/hooks/use-left-sidebar-tree.ts +15 -6
- package/src/hooks/use-tree.ts +5 -3
- package/src/lib/book/convert.ts +2 -1
- package/src/lib/book/index-rows.ts +3 -1
- package/src/lib/book/index.ts +1 -0
- package/src/lib/book/localize.ts +3 -2
- package/src/lib/book/raw.ts +5 -4
- package/src/lib/books.ts +4 -2
- package/src/lib/breadcrumb.ts +3 -1
- package/src/lib/client/guides.ts +86 -13
- package/src/lib/client-payload/extras.ts +10 -8
- package/src/lib/client-payload/index.ts +9 -8
- package/src/lib/client-payload/links.ts +10 -8
- package/src/lib/config.ts +1 -0
- package/src/lib/data/dto.ts +5 -4
- package/src/lib/data/parse.ts +4 -3
- package/src/lib/dump.ts +4 -3
- package/src/lib/embeds.ts +12 -0
- package/src/lib/format.ts +3 -2
- package/src/lib/links.ts +1 -1
- package/src/lib/markdown/book.ts +1 -0
- package/src/lib/markdown/ctx.ts +3 -1
- package/src/lib/markdown/index.ts +1 -0
- package/src/lib/markdown/page.ts +7 -8
- package/src/lib/markdown/table.ts +1 -0
- package/src/lib/markdown/text.ts +1 -0
- package/src/lib/markdown-page.ts +6 -4
- package/src/lib/messages.ts +1 -0
- package/src/lib/meta.ts +1 -0
- package/src/lib/multiblock/index.ts +1 -0
- package/src/lib/multiblock/url.ts +24 -10
- package/src/lib/names.ts +5 -3
- package/src/lib/page-kind.ts +2 -1
- package/src/lib/paths.ts +4 -2
- package/src/lib/preview.ts +8 -4
- package/src/lib/query.ts +1 -0
- package/src/lib/recipe.ts +3 -2
- package/src/lib/reference/index.ts +1 -0
- package/src/lib/reference/resolver.ts +4 -4
- package/src/lib/search/filter.ts +2 -1
- package/src/lib/search/index.ts +41 -14
- package/src/lib/sprites.ts +1 -0
- package/src/lib/table.ts +1 -0
- package/src/lib/toc.ts +3 -2
- package/src/locales/en_us.json +12 -20
- package/src/locales/ru_ru.json +12 -20
- package/src/locales.ts +1 -0
- package/src/types/index.ts +12 -10
package/src/locales/ru_ru.json
CHANGED
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
"guide":
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
"
|
|
14
|
-
"select_book": "Выберите книгу"
|
|
15
|
-
},
|
|
16
|
-
"sections": {
|
|
17
|
-
"guide": "Гайды",
|
|
18
|
-
"desc": {
|
|
19
|
-
"guide": "Игровой гайд"
|
|
20
|
-
}
|
|
21
|
-
}
|
|
2
|
+
"Entity preview unavailable(guide.entity_unavailable)": "Превью сущности недоступно",
|
|
3
|
+
"Entry not found(guide.entry_missing)": "Запись не найдена",
|
|
4
|
+
"Gameplay guide(sections.desc.guide)": "Игровой гайд",
|
|
5
|
+
"Guide(sections.guide)": "Гайды",
|
|
6
|
+
"No recipes(guide.recipe_empty)": "Нет рецептов",
|
|
7
|
+
"Objective(guide.objective)": "Задача",
|
|
8
|
+
"Open(guide.link)": "Открыть",
|
|
9
|
+
"Quest(guide.quest)": "Квест",
|
|
10
|
+
"Related(guide.related)": "Связанное",
|
|
11
|
+
"Select book(ui.select_book)": "Выберите книгу",
|
|
12
|
+
"{count} entries(guide.entry_count)": "Записей: {count}",
|
|
13
|
+
"{count} pages(guide.page_count)": "Страниц: {count}"
|
|
22
14
|
}
|
package/src/locales.ts
CHANGED
package/src/types/index.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import type { DatasetRef } from '@terrafirmagreg-team/sites/location';
|
|
1
2
|
import type { Lang } from '@terrafirmagreg-team/translate/types/locale';
|
|
2
3
|
import type { DatasetLanding } from '@terrafirmagreg-team/kit/types';
|
|
3
|
-
import type { DumpText } from '@terrafirmagreg-team/
|
|
4
|
+
import type { DumpText } from '@terrafirmagreg-team/dump/lib/dump/contract/text';
|
|
4
5
|
import type {
|
|
5
6
|
ReferenceKind,
|
|
6
7
|
TaggedReference,
|
|
7
|
-
} from '@terrafirmagreg-team/
|
|
8
|
+
} from '@terrafirmagreg-team/dump/lib/dump/contract/ref';
|
|
8
9
|
import type { GuidePage } from '@terrafirmagreg-team/guide/lib/data/dto';
|
|
9
|
-
import type { AtlasBundle } from '@terrafirmagreg-team/
|
|
10
|
-
import type {
|
|
11
|
-
import type { DumpEntityEntry } from '@terrafirmagreg-team/
|
|
10
|
+
import type { AtlasBundle } from '@terrafirmagreg-team/dump/lib/dump/assets/atlas/dto';
|
|
11
|
+
import type { EmbedRecipe } from '@terrafirmagreg-team/kit/types/embeds';
|
|
12
|
+
import type { DumpEntityEntry } from '@terrafirmagreg-team/dump/lib/dump/data/registry/dto';
|
|
12
13
|
import type { PagePreviewData } from '@terrafirmagreg-team/ui/types/preview';
|
|
13
14
|
|
|
14
15
|
export type {
|
|
@@ -112,7 +113,7 @@ export type GuideFormatNode =
|
|
|
112
113
|
| { type: 'command'; value: string; label?: string };
|
|
113
114
|
|
|
114
115
|
export type GuideFormatOptions = {
|
|
115
|
-
dataset?:
|
|
116
|
+
dataset?: DatasetRef;
|
|
116
117
|
lang?: Lang;
|
|
117
118
|
modId?: string;
|
|
118
119
|
bookPath?: string;
|
|
@@ -142,7 +143,7 @@ export type ResolvedGuideReference = GuideReference & {
|
|
|
142
143
|
};
|
|
143
144
|
|
|
144
145
|
export type GuideReferenceContext = {
|
|
145
|
-
dataset:
|
|
146
|
+
dataset: DatasetRef;
|
|
146
147
|
lang: Lang;
|
|
147
148
|
modId: string;
|
|
148
149
|
bookPath: string;
|
|
@@ -163,7 +164,7 @@ export type GuidePageKind = 'pack' | 'overview' | 'category' | 'entry';
|
|
|
163
164
|
export type GuidePageData = DatasetLanding;
|
|
164
165
|
|
|
165
166
|
export type PageRendererProps = {
|
|
166
|
-
dataset:
|
|
167
|
+
dataset: DatasetRef;
|
|
167
168
|
lang: Lang;
|
|
168
169
|
bookPath: string;
|
|
169
170
|
page: GuidePage;
|
|
@@ -186,7 +187,7 @@ export type GuideMessages = Record<string, string>;
|
|
|
186
187
|
export type GuideEntryExtras = {
|
|
187
188
|
atlases: Record<string, AtlasBundle>;
|
|
188
189
|
keybinds: Record<string, string>;
|
|
189
|
-
recipes: Record<string,
|
|
190
|
+
recipes: Record<string, EmbedRecipe>;
|
|
190
191
|
entities: Record<string, DumpEntityEntry>;
|
|
191
192
|
entityNames: Record<string, string>;
|
|
192
193
|
glbs: Record<string, string>;
|
|
@@ -194,7 +195,7 @@ export type GuideEntryExtras = {
|
|
|
194
195
|
|
|
195
196
|
export type GuidePagePayload = {
|
|
196
197
|
kind: GuidePageKind;
|
|
197
|
-
dataset:
|
|
198
|
+
dataset: DatasetRef;
|
|
198
199
|
lang: Lang;
|
|
199
200
|
title: string;
|
|
200
201
|
modId?: string;
|
|
@@ -213,3 +214,4 @@ export type GuidePagePayload = {
|
|
|
213
214
|
previews?: Record<string, PagePreviewData>;
|
|
214
215
|
messages: GuideMessages;
|
|
215
216
|
};
|
|
217
|
+
|