@terrafirmagreg-team/guide 0.1.0 → 1.2.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.
Files changed (68) hide show
  1. package/package.json +18 -19
  2. package/src/components/book-switcher.tsx +12 -6
  3. package/src/components/mdx/guide-entry.tsx +48 -0
  4. package/src/components/mdx/multiblock.tsx +86 -0
  5. package/src/{lib/tree/children.ts → components/tree/children.tsx} +13 -8
  6. package/src/{lib/tree/index.ts → components/tree/index.tsx} +25 -15
  7. package/src/components/views/browser.tsx +26 -17
  8. package/src/components/views/entry/pages.tsx +4 -2
  9. package/src/components/views/entry/view.tsx +3 -1
  10. package/src/components/views/kind/links.tsx +3 -2
  11. package/src/components/views/kind/media.tsx +6 -5
  12. package/src/components/views/kind/recipe.tsx +6 -51
  13. package/src/components/views/kind/table.tsx +4 -2
  14. package/src/components/views/kind/unknown.tsx +1 -0
  15. package/src/components/views/page/category-body.tsx +3 -1
  16. package/src/components/views/page/entry-body.tsx +3 -1
  17. package/src/components/views/page/overview-body.tsx +4 -2
  18. package/src/components/views/page/text.tsx +1 -0
  19. package/src/components/views/page/view.tsx +6 -6
  20. package/src/components/views/text.tsx +4 -2
  21. package/src/hooks/use-left-sidebar-tree.ts +15 -6
  22. package/src/hooks/use-tree.ts +5 -3
  23. package/src/lib/book/convert.ts +2 -1
  24. package/src/lib/book/index-rows.ts +3 -1
  25. package/src/lib/book/index.ts +1 -0
  26. package/src/lib/book/localize.ts +3 -2
  27. package/src/lib/book/raw.ts +5 -4
  28. package/src/lib/books.ts +4 -2
  29. package/src/lib/breadcrumb.ts +3 -1
  30. package/src/lib/client/guides.ts +86 -13
  31. package/src/lib/client-payload/extras.ts +10 -8
  32. package/src/lib/client-payload/index.ts +9 -8
  33. package/src/lib/client-payload/links.ts +10 -8
  34. package/src/lib/config.ts +1 -0
  35. package/src/lib/data/dto.ts +5 -4
  36. package/src/lib/data/parse.ts +4 -3
  37. package/src/lib/dump.ts +4 -3
  38. package/src/lib/embeds.ts +12 -0
  39. package/src/lib/format.ts +3 -2
  40. package/src/lib/links.ts +1 -1
  41. package/src/lib/markdown/book.ts +1 -0
  42. package/src/lib/markdown/ctx.ts +3 -1
  43. package/src/lib/markdown/index.ts +1 -0
  44. package/src/lib/markdown/page.ts +7 -8
  45. package/src/lib/markdown/table.ts +1 -0
  46. package/src/lib/markdown/text.ts +1 -0
  47. package/src/lib/markdown-page.ts +6 -4
  48. package/src/lib/messages.ts +1 -0
  49. package/src/lib/meta.ts +1 -0
  50. package/src/lib/multiblock/index.ts +1 -0
  51. package/src/lib/multiblock/url.ts +24 -10
  52. package/src/lib/names.ts +5 -3
  53. package/src/lib/page-kind.ts +2 -1
  54. package/src/lib/paths.ts +4 -2
  55. package/src/lib/preview.ts +8 -4
  56. package/src/lib/query.ts +1 -0
  57. package/src/lib/recipe.ts +3 -2
  58. package/src/lib/reference/index.ts +1 -0
  59. package/src/lib/reference/resolver.ts +4 -4
  60. package/src/lib/search/filter.ts +2 -1
  61. package/src/lib/search/index.ts +41 -14
  62. package/src/lib/sprites.ts +1 -0
  63. package/src/lib/table.ts +1 -0
  64. package/src/lib/toc.ts +3 -2
  65. package/src/locales/en_us.json +12 -20
  66. package/src/locales/ru_ru.json +12 -20
  67. package/src/locales.ts +1 -0
  68. package/src/types/index.ts +12 -10
@@ -1,22 +1,14 @@
1
1
  {
2
- "guide": {
3
- "entry_count": "Записей: {count}",
4
- "page_count": "Страниц: {count}",
5
- "entry_missing": "Запись не найдена",
6
- "entity_unavailable": "Превью сущности недоступно",
7
- "link": "Открыть",
8
- "objective": "Задача",
9
- "quest": "Квест",
10
- "recipe_empty": "Нет рецептов",
11
- "related": "Связанное"
12
- },
13
- "ui": {
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
@@ -3,3 +3,4 @@ import { createLocaleCatalog } from '@terrafirmagreg-team/translate/lib/locales'
3
3
  export const locales = createLocaleCatalog(
4
4
  import.meta.glob('./locales/*.json', { eager: true, import: 'default' }),
5
5
  );
6
+
@@ -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/game/lib/dump/contract/text';
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/game/lib/dump/contract/ref';
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/game/lib/dump/assets/atlas/dto';
10
- import type { Recipe } from '@terrafirmagreg-team/recipe/lib/data/dto';
11
- import type { DumpEntityEntry } from '@terrafirmagreg-team/game/lib/dump/data/registry/dto';
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?: string;
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: string;
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: string;
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, Recipe>;
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: string;
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
+