@terrafirmagreg-team/recipe 0.0.0-stage → 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 +62 -3
- package/src/components/button-copy.tsx +43 -0
- package/src/components/cards/card/index.tsx +214 -0
- package/src/components/cards/card/scene.tsx +107 -0
- package/src/components/cards/card/strip.tsx +198 -0
- package/src/components/cards/card/text.tsx +46 -0
- package/src/components/cards/card/tips.tsx +63 -0
- package/src/components/cards/default-item.tsx +47 -0
- package/src/components/cards/glare-filter.tsx +29 -0
- package/src/components/cards/paged-card.tsx +222 -0
- package/src/components/cards/slot-hitbox.tsx +213 -0
- package/src/components/cards/strip-card/buttons.tsx +106 -0
- package/src/components/cards/strip-card/index.tsx +214 -0
- package/src/components/cards/strip-card/member-cell.tsx +167 -0
- package/src/components/cards/strip-card/sprite.tsx +36 -0
- package/src/components/embed-card.tsx +44 -0
- package/src/components/mdx/recipe.tsx +129 -0
- package/src/components/tool-list.tsx +49 -0
- package/src/components/tree.tsx +98 -0
- package/src/components/views/alloy/index.tsx +112 -0
- package/src/components/views/alloy/list.tsx +85 -0
- package/src/components/views/alloy/mix/index.tsx +35 -0
- package/src/components/views/alloy/mix/ratio.tsx +94 -0
- package/src/components/views/alloy/mix/rows.tsx +145 -0
- package/src/components/views/alloy/mix/status.tsx +122 -0
- package/src/components/views/alloy/mix/total.tsx +132 -0
- package/src/components/views/alloy/range-bar.tsx +65 -0
- package/src/components/views/alloy/stack-bar.tsx +88 -0
- package/src/components/views/browser/axis-switcher.tsx +54 -0
- package/src/components/views/browser/card-grid.tsx +275 -0
- package/src/components/views/browser/favorite-button.tsx +46 -0
- package/src/components/views/browser/frame.tsx +112 -0
- package/src/components/views/browser/index.tsx +114 -0
- package/src/components/views/browser/item-panel/index.tsx +229 -0
- package/src/components/views/browser/item-panel/skeleton.tsx +26 -0
- package/src/components/views/browser/item-panel-grid/cell.tsx +178 -0
- package/src/components/views/browser/item-panel-grid/favorite-cell.tsx +129 -0
- package/src/components/views/browser/item-panel-grid/index.tsx +105 -0
- package/src/components/views/browser/item-view/index.tsx +186 -0
- package/src/components/views/browser/item-view/tags.tsx +85 -0
- package/src/components/views/browser/item-view-header.tsx +131 -0
- package/src/components/views/browser/pane-tabs.tsx +61 -0
- package/src/components/views/browser/place-header.tsx +72 -0
- package/src/components/views/browser/query-controls.tsx +105 -0
- package/src/components/views/browser/recipe-item-header.tsx +60 -0
- package/src/components/views/browser/settings.tsx +52 -0
- package/src/components/views/browser/toolbar.tsx +54 -0
- package/src/components/views/browser/type-tabs.tsx +71 -0
- package/src/components/views/browser/type-view.tsx +184 -0
- package/src/components/views/browser/workstation-rail.tsx +43 -0
- package/src/components/views/calc/calculator/actions.tsx +47 -0
- package/src/components/views/calc/calculator/help.tsx +189 -0
- package/src/components/views/calc/calculator/index.tsx +172 -0
- package/src/components/views/calc/dot-overlay.tsx +80 -0
- package/src/components/views/calc/edge.tsx +152 -0
- package/src/components/views/calc/flow/index.tsx +305 -0
- package/src/components/views/calc/flow/picker-dialogs.tsx +146 -0
- package/src/components/views/calc/flow/toolbar.tsx +60 -0
- package/src/components/views/calc/flow/view-menu.tsx +117 -0
- package/src/components/views/calc/member-picker.tsx +120 -0
- package/src/components/views/calc/node-card/actions.tsx +90 -0
- package/src/components/views/calc/node-card/badges.tsx +59 -0
- package/src/components/views/calc/node-card/chips.tsx +187 -0
- package/src/components/views/calc/node-card/far.tsx +123 -0
- package/src/components/views/calc/node-card/full.tsx +332 -0
- package/src/components/views/calc/node-card/index.tsx +27 -0
- package/src/components/views/calc/node-card/menu.tsx +282 -0
- package/src/components/views/calc/node-card/port-cells.tsx +186 -0
- package/src/components/views/calc/node-card/port-rails.tsx +251 -0
- package/src/components/views/calc/node-card/ports.tsx +86 -0
- package/src/components/views/calc/recipe-picker/body.tsx +207 -0
- package/src/components/views/calc/recipe-picker/footer.tsx +131 -0
- package/src/components/views/calc/recipe-picker/index.tsx +52 -0
- package/src/components/views/calc/sidebar.tsx +171 -0
- package/src/components/views/calc/trees/icon-picker.tsx +97 -0
- package/src/components/views/calc/trees/index.tsx +134 -0
- package/src/components/views/calc/trees/label.tsx +67 -0
- package/src/components/views/calc/trees/rows.tsx +140 -0
- package/src/components/views/forge/gui.tsx +131 -0
- package/src/components/views/forge/index.tsx +112 -0
- package/src/components/views/forge/list.tsx +113 -0
- package/src/components/views/forge/workbench/controls.tsx +103 -0
- package/src/components/views/forge/workbench/index.tsx +85 -0
- package/src/components/views/forge/workbench/panel.tsx +228 -0
- package/src/components/views/forge/workbench/ruler.tsx +133 -0
- package/src/components/views/forge/workbench/status.tsx +55 -0
- package/src/components/views/forge/workbench/tape.tsx +70 -0
- package/src/hooks/alloy/use-fluid-colors.ts +125 -0
- package/src/hooks/alloy/use-mix-state.ts +240 -0
- package/src/hooks/calc/flow/use-engage.ts +129 -0
- package/src/hooks/calc/flow/use-handlers.ts +192 -0
- package/src/hooks/calc/flow/use-layout.ts +105 -0
- package/src/hooks/calc/flow/use-mount.ts +97 -0
- package/src/hooks/calc/flow/use-nodes.ts +260 -0
- package/src/hooks/calc/flow/use-pickers.ts +57 -0
- package/src/hooks/calc/flow/use-viewport.ts +141 -0
- package/src/hooks/calc/flow/use-window.ts +87 -0
- package/src/hooks/calc/use-actions.ts +355 -0
- package/src/hooks/calc/use-amounts.ts +64 -0
- package/src/hooks/calc/use-data.ts +203 -0
- package/src/hooks/calc/use-defaults.ts +40 -0
- package/src/hooks/calc/use-far-mode.ts +37 -0
- package/src/hooks/calc/use-focus.ts +31 -0
- package/src/hooks/calc/use-maps.ts +76 -0
- package/src/hooks/calc/use-reset.ts +15 -0
- package/src/hooks/calc/use-resolver.ts +70 -0
- package/src/hooks/calc/use-session.ts +13 -0
- package/src/hooks/calc/use-share.ts +64 -0
- package/src/hooks/calc/use-storage.ts +126 -0
- package/src/hooks/calc/use-tier.ts +13 -0
- package/src/hooks/calc/use-view-mode.ts +24 -0
- package/src/hooks/calc/use-worker.ts +204 -0
- package/src/hooks/forge/use-anvil-gui.ts +16 -0
- package/src/hooks/forge/use-forge-state.ts +135 -0
- package/src/hooks/forge/use-ruler.ts +100 -0
- package/src/hooks/use-add-to-calc.ts +51 -0
- package/src/hooks/use-categories-by-id.ts +18 -0
- package/src/hooks/use-favorite-hotkey.ts +39 -0
- package/src/hooks/use-favorites.ts +135 -0
- package/src/hooks/use-group-outlines.ts +65 -0
- package/src/hooks/use-hide-unused.ts +12 -0
- package/src/hooks/use-index.ts +72 -0
- package/src/hooks/use-item-feeds.ts +46 -0
- package/src/hooks/use-item-pane.ts +106 -0
- package/src/hooks/use-item-press.ts +89 -0
- package/src/hooks/use-item-tag-groups.ts +54 -0
- package/src/hooks/use-item-tooltips.ts +18 -0
- package/src/hooks/use-left-sidebar-tree.ts +34 -0
- package/src/hooks/use-mod-names.ts +17 -0
- package/src/hooks/use-mount-limit.ts +22 -0
- package/src/hooks/use-panel-cells.ts +117 -0
- package/src/hooks/use-panel-page.ts +54 -0
- package/src/hooks/use-panel-tabs.ts +43 -0
- package/src/hooks/use-query.ts +186 -0
- package/src/hooks/use-session.ts +88 -0
- package/src/hooks/use-sidebar-group.ts +16 -0
- package/src/hooks/use-tag-members.ts +16 -0
- package/src/hooks/use-tool-recipes.ts +26 -0
- package/src/hooks/use-type-filter.ts +73 -0
- package/src/lib/alloy/mix.ts +210 -0
- package/src/lib/alloy/parse.ts +37 -0
- package/src/lib/calc/defaults.ts +47 -0
- package/src/lib/calc/flow.ts +315 -0
- package/src/lib/calc/focus.ts +15 -0
- package/src/lib/calc/meta.ts +17 -0
- package/src/lib/calc/pack.ts +77 -0
- package/src/lib/calc/ports.ts +43 -0
- package/src/lib/calc/resolve.ts +198 -0
- package/src/lib/calc/route/buckets.ts +49 -0
- package/src/lib/calc/route/geometry.ts +51 -0
- package/src/lib/calc/route/index.ts +3 -0
- package/src/lib/calc/route/polyline.ts +103 -0
- package/src/lib/calc/route/router.ts +394 -0
- package/src/lib/calc/scheme.ts +226 -0
- package/src/lib/calc/storage/entry.ts +97 -0
- package/src/lib/calc/storage/index.ts +20 -0
- package/src/lib/calc/storage/keys.ts +38 -0
- package/src/lib/calc/storage/store.ts +198 -0
- package/src/lib/calc/tree/index.ts +4 -0
- package/src/lib/calc/tree/materials.ts +29 -0
- package/src/lib/calc/tree/recipe.ts +104 -0
- package/src/lib/calc/tree/share.ts +135 -0
- package/src/lib/calc/worker/api.ts +25 -0
- package/src/lib/calc/worker/fetch.ts +66 -0
- package/src/lib/calc/worker/flush.ts +39 -0
- package/src/lib/calc/worker/index.ts +8 -0
- package/src/lib/calc/worker/protocol.ts +35 -0
- package/src/lib/calc/worker/resolve.ts +49 -0
- package/src/lib/calc/worker/state.ts +48 -0
- package/src/lib/card-model.ts +65 -0
- package/src/lib/client/recipe-categories.ts +14 -0
- package/src/lib/client/recipe.ts +85 -0
- package/src/lib/client-index/catalog.ts +91 -0
- package/src/lib/client-index/chrome.ts +180 -0
- package/src/lib/client-index/index.ts +20 -0
- package/src/lib/client-index/registry.ts +121 -0
- package/src/lib/client-index/rows.ts +260 -0
- package/src/lib/client-index/tooltips.ts +74 -0
- package/src/lib/config.ts +18 -0
- package/src/lib/data/category/dto.ts +25 -0
- package/src/lib/data/category/load.ts +47 -0
- package/src/lib/data/category/parse.ts +71 -0
- package/src/lib/data/dto.ts +152 -0
- package/src/lib/data/grid.ts +40 -0
- package/src/lib/data/parse/entry.ts +85 -0
- package/src/lib/data/parse/index.ts +3 -0
- package/src/lib/data/parse/layout.ts +138 -0
- package/src/lib/data/parse/slots.ts +85 -0
- package/src/lib/data/parse/widgets.ts +81 -0
- package/src/lib/data/scene.ts +103 -0
- package/src/lib/data/slot-io.ts +44 -0
- package/src/lib/dump.ts +6 -0
- package/src/lib/embed.ts +22 -0
- package/src/lib/favorite-hover.ts +13 -0
- package/src/lib/fluid-outputs.ts +70 -0
- package/src/lib/forge/actions.ts +59 -0
- package/src/lib/forge/data.ts +51 -0
- package/src/lib/forge/solve.ts +80 -0
- package/src/lib/group.ts +23 -0
- package/src/lib/index-store.ts +70 -0
- package/src/lib/links.ts +131 -0
- package/src/lib/lookup.ts +119 -0
- package/src/lib/panel-outline.ts +86 -0
- package/src/lib/panel.ts +105 -0
- package/src/lib/preview.ts +32 -0
- package/src/lib/recipe-slots.ts +8 -0
- package/src/lib/search.ts +139 -0
- package/src/lib/sidebar.ts +47 -0
- package/src/lib/used-items.ts +25 -0
- package/src/locales/en_us.json +172 -0
- package/src/locales/ru_ru.json +172 -0
- package/src/locales.ts +6 -0
- package/src/types/alloy.ts +20 -0
- package/src/types/calc-flow-props.ts +44 -0
- package/src/types/calc.ts +92 -0
- package/src/types/forge.ts +21 -0
- package/src/types/index.ts +136 -0
- package/styles/calc.css +308 -0
- package/styles/strip.css +7 -0
- package/styles.css +2 -0
- package/README.md +0 -3
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import { groupOutlines } from '@terrafirmagreg-team/recipe/lib/panel-outline';
|
|
5
|
+
import type { ItemPanelCell } from '@terrafirmagreg-team/recipe/types';
|
|
6
|
+
|
|
7
|
+
const CELL = 36;
|
|
8
|
+
const GAP = 4;
|
|
9
|
+
|
|
10
|
+
export function useGroupOutlines(
|
|
11
|
+
shown: ItemPanelCell[],
|
|
12
|
+
cols: number,
|
|
13
|
+
rows: number,
|
|
14
|
+
) {
|
|
15
|
+
const gridRef = useRef<HTMLUListElement>(null);
|
|
16
|
+
const [size, setSize] = useState<{ w: number; h: number }>();
|
|
17
|
+
|
|
18
|
+
const indicesByGroup = useMemo(() => {
|
|
19
|
+
const map = new Map<string, number[]>();
|
|
20
|
+
shown.forEach((cell, index) => {
|
|
21
|
+
const id =
|
|
22
|
+
cell.kind === 'group'
|
|
23
|
+
? cell.expanded
|
|
24
|
+
? cell.id
|
|
25
|
+
: undefined
|
|
26
|
+
: cell.kind === 'stack'
|
|
27
|
+
? cell.groupId
|
|
28
|
+
: undefined;
|
|
29
|
+
if (!id) return;
|
|
30
|
+
const list = map.get(id);
|
|
31
|
+
if (list) list.push(index);
|
|
32
|
+
else map.set(id, [index]);
|
|
33
|
+
});
|
|
34
|
+
return map;
|
|
35
|
+
}, [shown]);
|
|
36
|
+
|
|
37
|
+
useLayoutEffect(() => {
|
|
38
|
+
const el = gridRef.current;
|
|
39
|
+
if (!el) return;
|
|
40
|
+
const observer = new ResizeObserver(() => {
|
|
41
|
+
const rect = el.getBoundingClientRect();
|
|
42
|
+
setSize((prev) =>
|
|
43
|
+
prev && prev.w === rect.width && prev.h === rect.height
|
|
44
|
+
? prev
|
|
45
|
+
: { w: rect.width, h: rect.height },
|
|
46
|
+
);
|
|
47
|
+
});
|
|
48
|
+
observer.observe(el);
|
|
49
|
+
return () => observer.disconnect();
|
|
50
|
+
}, []);
|
|
51
|
+
|
|
52
|
+
const outlines = useMemo(() => {
|
|
53
|
+
if (!size || !indicesByGroup.size) return [];
|
|
54
|
+
const cell = {
|
|
55
|
+
x: (size.w - (cols * CELL + (cols - 1) * GAP)) / 2,
|
|
56
|
+
y: (size.h - (rows * CELL + (rows - 1) * GAP)) / 2,
|
|
57
|
+
w: CELL,
|
|
58
|
+
h: CELL,
|
|
59
|
+
};
|
|
60
|
+
return groupOutlines(indicesByGroup, cols, cell, GAP, size, 1.5);
|
|
61
|
+
}, [size, indicesByGroup, cols, rows]);
|
|
62
|
+
|
|
63
|
+
return { gridRef, outlines };
|
|
64
|
+
}
|
|
65
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { boolCodec, createStoredValue } from '@terrafirmagreg-team/ui/lib/utils/stored-value';
|
|
2
|
+
|
|
3
|
+
const useStoredHideUnused = createStoredValue(
|
|
4
|
+
'wiki.recipe.hideUnused',
|
|
5
|
+
boolCodec(false),
|
|
6
|
+
);
|
|
7
|
+
|
|
8
|
+
export function useHideUnused() {
|
|
9
|
+
const [hideUnused, setHideUnused] = useStoredHideUnused();
|
|
10
|
+
return { hideUnused, setHideUnused };
|
|
11
|
+
}
|
|
12
|
+
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import type { DatasetRef } from '@terrafirmagreg-team/sites/location';
|
|
3
|
+
|
|
4
|
+
import { startTransition, useMemo, useState } from 'react';
|
|
5
|
+
import { useLang } from '@terrafirmagreg-team/translate/provider';
|
|
6
|
+
import { useAsyncEffect } from '@terrafirmagreg-team/ui/hooks/use-async-value';
|
|
7
|
+
import {
|
|
8
|
+
loadRecipeChromeClient,
|
|
9
|
+
loadRecipeCompactIndex,
|
|
10
|
+
loadRecipeSkeletonIndex,
|
|
11
|
+
} from '@terrafirmagreg-team/recipe/lib/client-index';
|
|
12
|
+
import { publishRecipeIndex } from '@terrafirmagreg-team/recipe/lib/index-store';
|
|
13
|
+
import type { RecipeCompactIndex } from '@terrafirmagreg-team/recipe/types';
|
|
14
|
+
|
|
15
|
+
type LoadedIndex = { key: string; index: RecipeCompactIndex };
|
|
16
|
+
|
|
17
|
+
function idle(): Promise<void> {
|
|
18
|
+
return new Promise((resolve) => {
|
|
19
|
+
if (typeof requestIdleCallback === 'function') {
|
|
20
|
+
requestIdleCallback(() => resolve(), { timeout: 4000 });
|
|
21
|
+
} else {
|
|
22
|
+
setTimeout(resolve, 1500);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function useRecipeIndex(dataset: DatasetRef | undefined, lang: string) {
|
|
28
|
+
const [loaded, setLoaded] = useState<LoadedIndex | null>(null);
|
|
29
|
+
const [complete, setComplete] = useState<string | null>(null);
|
|
30
|
+
const [lastFull, setLastFull] = useState<RecipeCompactIndex | null>(null);
|
|
31
|
+
const { locales: items } = useLang();
|
|
32
|
+
const locales = useMemo(
|
|
33
|
+
() => items?.map((item) => item.locale) ?? [lang],
|
|
34
|
+
[items, lang],
|
|
35
|
+
);
|
|
36
|
+
const key = `${dataset ? `${dataset.id}/${dataset.version ?? ''}` : ''} ${lang}`;
|
|
37
|
+
|
|
38
|
+
useAsyncEffect(async (isCancelled) => {
|
|
39
|
+
if (!dataset) return;
|
|
40
|
+
const skeleton = await loadRecipeSkeletonIndex(dataset);
|
|
41
|
+
if (isCancelled()) return;
|
|
42
|
+
setLoaded({ key, index: skeleton });
|
|
43
|
+
publishRecipeIndex(dataset, lang, skeleton);
|
|
44
|
+
const chrome = await loadRecipeChromeClient(dataset, lang);
|
|
45
|
+
const index = await loadRecipeCompactIndex(dataset, chrome);
|
|
46
|
+
if (isCancelled()) return;
|
|
47
|
+
startTransition(() => {
|
|
48
|
+
setLoaded({ key, index });
|
|
49
|
+
setComplete(key);
|
|
50
|
+
setLastFull(index);
|
|
51
|
+
});
|
|
52
|
+
publishRecipeIndex(dataset, lang, index);
|
|
53
|
+
}, [dataset, lang]);
|
|
54
|
+
|
|
55
|
+
useAsyncEffect(async (isCancelled) => {
|
|
56
|
+
if (!dataset) return;
|
|
57
|
+
const others = locales.filter((entry) => entry !== lang);
|
|
58
|
+
for (const entry of others) {
|
|
59
|
+
if (isCancelled()) return;
|
|
60
|
+
await idle();
|
|
61
|
+
if (isCancelled()) return;
|
|
62
|
+
const chrome = await loadRecipeChromeClient(dataset, entry);
|
|
63
|
+
if (isCancelled()) return;
|
|
64
|
+
await loadRecipeCompactIndex(dataset, chrome);
|
|
65
|
+
}
|
|
66
|
+
}, [dataset, lang, locales]);
|
|
67
|
+
|
|
68
|
+
const active = loaded?.key === key ? loaded.index : null;
|
|
69
|
+
const index = active?.items.length ? active : (lastFull ?? active);
|
|
70
|
+
return { index, indexLoading: complete !== key };
|
|
71
|
+
}
|
|
72
|
+
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import type { DatasetRef } from '@terrafirmagreg-team/sites/location';
|
|
3
|
+
|
|
4
|
+
import { useAsyncResult } from '@terrafirmagreg-team/ui/hooks/use-async-value';
|
|
5
|
+
import {
|
|
6
|
+
recipesForOutput,
|
|
7
|
+
usesForInput,
|
|
8
|
+
} from '@terrafirmagreg-team/recipe/lib/lookup';
|
|
9
|
+
import type { RecipeCompactIndex, RecipeCompactRow } from '@terrafirmagreg-team/recipe/types';
|
|
10
|
+
|
|
11
|
+
export const EMPTY_ROWS: RecipeCompactRow[] = [];
|
|
12
|
+
|
|
13
|
+
export function useItemFeeds({
|
|
14
|
+
dataset,
|
|
15
|
+
index,
|
|
16
|
+
indexLoading,
|
|
17
|
+
item,
|
|
18
|
+
kind,
|
|
19
|
+
}: {
|
|
20
|
+
dataset: DatasetRef;
|
|
21
|
+
index: RecipeCompactIndex | null;
|
|
22
|
+
indexLoading: boolean;
|
|
23
|
+
item: string;
|
|
24
|
+
kind: 'item' | 'fluid';
|
|
25
|
+
}) {
|
|
26
|
+
const recipesRes = useAsyncResult(
|
|
27
|
+
() =>
|
|
28
|
+
index
|
|
29
|
+
? recipesForOutput(dataset, index, item, { includeTagRows: false })
|
|
30
|
+
: Promise.resolve(EMPTY_ROWS),
|
|
31
|
+
[dataset, index, item],
|
|
32
|
+
);
|
|
33
|
+
const usesRes = useAsyncResult(
|
|
34
|
+
() =>
|
|
35
|
+
index
|
|
36
|
+
? usesForInput(dataset, index, item, kind)
|
|
37
|
+
: Promise.resolve(EMPTY_ROWS),
|
|
38
|
+
[dataset, index, item, kind],
|
|
39
|
+
);
|
|
40
|
+
return {
|
|
41
|
+
recipes: recipesRes.value,
|
|
42
|
+
uses: usesRes.value,
|
|
43
|
+
pending: indexLoading || !index || recipesRes.pending || usesRes.pending,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import type { DatasetRef } from '@terrafirmagreg-team/sites/location';
|
|
3
|
+
|
|
4
|
+
import { createElement, useMemo } from 'react';
|
|
5
|
+
import { ArrowDownToLine, ArrowUpFromLine, Tag } from 'lucide-react';
|
|
6
|
+
import { useTranslations } from '@terrafirmagreg-team/translate/hooks/use-translations';
|
|
7
|
+
import { usePaneKeys } from '@terrafirmagreg-team/ui/hooks/use-pane-keys';
|
|
8
|
+
import { recipeHref } from '@terrafirmagreg-team/recipe/lib/links';
|
|
9
|
+
import { replaceUrlState } from '@terrafirmagreg-team/ui/lib/utils/history';
|
|
10
|
+
import { EMPTY_ROWS } from '@terrafirmagreg-team/recipe/hooks/use-item-feeds';
|
|
11
|
+
import type { PaneTabOption } from '@terrafirmagreg-team/recipe/components/views/browser/pane-tabs';
|
|
12
|
+
import type { Lang } from '@terrafirmagreg-team/translate/types/locale';
|
|
13
|
+
import type {
|
|
14
|
+
RecipeCompactRow,
|
|
15
|
+
RecipeHrefOpts,
|
|
16
|
+
RecipeRelation,
|
|
17
|
+
} from '@terrafirmagreg-team/recipe/types';
|
|
18
|
+
|
|
19
|
+
export type ItemPane = 'recipes' | 'uses' | 'tags';
|
|
20
|
+
|
|
21
|
+
const inFeed = (id: string | undefined, rows: RecipeCompactRow[] | undefined) =>
|
|
22
|
+
id != null && (rows ?? EMPTY_ROWS).some((row) => row.id === id);
|
|
23
|
+
|
|
24
|
+
export function useItemPane({
|
|
25
|
+
dataset,
|
|
26
|
+
lang,
|
|
27
|
+
nav,
|
|
28
|
+
relation,
|
|
29
|
+
recipeId,
|
|
30
|
+
recipes,
|
|
31
|
+
uses,
|
|
32
|
+
tagCount,
|
|
33
|
+
feedsPending,
|
|
34
|
+
}: {
|
|
35
|
+
dataset: DatasetRef;
|
|
36
|
+
lang: Lang;
|
|
37
|
+
nav: RecipeHrefOpts;
|
|
38
|
+
relation?: RecipeRelation;
|
|
39
|
+
recipeId?: string;
|
|
40
|
+
recipes?: RecipeCompactRow[];
|
|
41
|
+
uses?: RecipeCompactRow[];
|
|
42
|
+
tagCount: number;
|
|
43
|
+
feedsPending: boolean;
|
|
44
|
+
}) {
|
|
45
|
+
const t = useTranslations();
|
|
46
|
+
const available = {
|
|
47
|
+
recipes: (recipes ?? EMPTY_ROWS).length > 0,
|
|
48
|
+
uses: (uses ?? EMPTY_ROWS).length > 0,
|
|
49
|
+
tags: tagCount > 0,
|
|
50
|
+
};
|
|
51
|
+
const fallback: ItemPane =
|
|
52
|
+
inFeed(recipeId, uses) && !inFeed(recipeId, recipes)
|
|
53
|
+
? 'uses'
|
|
54
|
+
: available.recipes
|
|
55
|
+
? 'recipes'
|
|
56
|
+
: available.uses
|
|
57
|
+
? 'uses'
|
|
58
|
+
: 'recipes';
|
|
59
|
+
const pane: ItemPane =
|
|
60
|
+
relation && (feedsPending || available[relation]) ? relation : fallback;
|
|
61
|
+
const select = (next: ItemPane) => {
|
|
62
|
+
replaceUrlState(
|
|
63
|
+
recipeHref(dataset, lang, {
|
|
64
|
+
...nav,
|
|
65
|
+
relation: next === 'recipes' ? undefined : next,
|
|
66
|
+
rpage: undefined,
|
|
67
|
+
}),
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
usePaneKeys<ItemPane>(
|
|
71
|
+
{
|
|
72
|
+
r: available.recipes ? 'recipes' : undefined,
|
|
73
|
+
u: available.uses ? 'uses' : undefined,
|
|
74
|
+
t: available.tags ? 'tags' : undefined,
|
|
75
|
+
},
|
|
76
|
+
select,
|
|
77
|
+
);
|
|
78
|
+
const options = useMemo<PaneTabOption<ItemPane>[]>(
|
|
79
|
+
() => [
|
|
80
|
+
{
|
|
81
|
+
id: 'recipes',
|
|
82
|
+
label: t('Recipes', { note: 'recipe.pane_recipes' }),
|
|
83
|
+
icon: createElement(ArrowDownToLine, { className: 'size-3.5' }),
|
|
84
|
+
help: 'R',
|
|
85
|
+
disabled: !available.recipes,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: 'uses',
|
|
89
|
+
label: t('Uses', { note: 'recipe.pane_uses' }),
|
|
90
|
+
icon: createElement(ArrowUpFromLine, { className: 'size-3.5' }),
|
|
91
|
+
help: 'U',
|
|
92
|
+
disabled: !available.uses,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
id: 'tags',
|
|
96
|
+
label: t('Tags', { note: 'recipe.pane_tags' }),
|
|
97
|
+
icon: createElement(Tag, { className: 'size-3.5' }),
|
|
98
|
+
help: 'T',
|
|
99
|
+
disabled: !available.tags,
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
[available.recipes, available.uses, available.tags, t],
|
|
103
|
+
);
|
|
104
|
+
return { pane, select, options };
|
|
105
|
+
}
|
|
106
|
+
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import type { DatasetRef } from '@terrafirmagreg-team/sites/location';
|
|
3
|
+
|
|
4
|
+
import { startTransition, useCallback, useEffect, useRef } from 'react';
|
|
5
|
+
import {
|
|
6
|
+
calcStorageKey,
|
|
7
|
+
readCalcStorage,
|
|
8
|
+
writeCalcStorage,
|
|
9
|
+
} from '@terrafirmagreg-team/recipe/lib/calc/storage';
|
|
10
|
+
import { requestCalcFocus } from '@terrafirmagreg-team/recipe/lib/calc/focus';
|
|
11
|
+
import { recipeHref } from '@terrafirmagreg-team/recipe/lib/links';
|
|
12
|
+
import { replaceUrlState } from '@terrafirmagreg-team/ui/lib/utils/history';
|
|
13
|
+
import type { Lang } from '@terrafirmagreg-team/translate/types/locale';
|
|
14
|
+
import type { RecipeHrefOpts } from '@terrafirmagreg-team/recipe/types';
|
|
15
|
+
|
|
16
|
+
export function useItemPress({
|
|
17
|
+
dataset,
|
|
18
|
+
lang,
|
|
19
|
+
nav,
|
|
20
|
+
isCalc,
|
|
21
|
+
}: {
|
|
22
|
+
dataset: DatasetRef;
|
|
23
|
+
lang: Lang;
|
|
24
|
+
nav: RecipeHrefOpts;
|
|
25
|
+
isCalc: boolean;
|
|
26
|
+
}) {
|
|
27
|
+
const pressRef = useRef<(id: string, ref?: 'item' | 'fluid') => void>(
|
|
28
|
+
() => {},
|
|
29
|
+
);
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
pressRef.current = (id: string, ref?: 'item' | 'fluid') => {
|
|
32
|
+
startTransition(() => {
|
|
33
|
+
if (isCalc) {
|
|
34
|
+
const key = calcStorageKey('recipe', dataset);
|
|
35
|
+
const parsed = readCalcStorage(key) ?? {
|
|
36
|
+
cards: [],
|
|
37
|
+
wires: [],
|
|
38
|
+
tagSelections: {},
|
|
39
|
+
};
|
|
40
|
+
const kind = ref === 'fluid' ? ('fluid' as const) : ('item' as const);
|
|
41
|
+
const same = parsed.cards.findIndex(
|
|
42
|
+
(row) => row.materialId === id && row.kind === kind,
|
|
43
|
+
);
|
|
44
|
+
const cards =
|
|
45
|
+
same >= 0
|
|
46
|
+
? parsed.cards.map((row, index) =>
|
|
47
|
+
index === same ? { ...row, crafts: row.crafts + 1 } : row,
|
|
48
|
+
)
|
|
49
|
+
: [
|
|
50
|
+
...parsed.cards,
|
|
51
|
+
{
|
|
52
|
+
id: `c${Date.now().toString(36)}${Math.random()
|
|
53
|
+
.toString(36)
|
|
54
|
+
.slice(2, 4)}`,
|
|
55
|
+
materialId: id,
|
|
56
|
+
kind,
|
|
57
|
+
recipeId: null,
|
|
58
|
+
crafts: 1,
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
writeCalcStorage(key, {
|
|
62
|
+
cards,
|
|
63
|
+
wires: parsed.wires,
|
|
64
|
+
tagSelections: parsed.tagSelections,
|
|
65
|
+
});
|
|
66
|
+
requestCalcFocus(id);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
replaceUrlState(
|
|
70
|
+
recipeHref(dataset, lang, {
|
|
71
|
+
...nav,
|
|
72
|
+
type: undefined,
|
|
73
|
+
tool: undefined,
|
|
74
|
+
item: ref === 'fluid' ? undefined : id,
|
|
75
|
+
fluid: ref === 'fluid' ? id : undefined,
|
|
76
|
+
id: undefined,
|
|
77
|
+
relation: undefined,
|
|
78
|
+
rpage: undefined,
|
|
79
|
+
}),
|
|
80
|
+
);
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
});
|
|
84
|
+
return useCallback(
|
|
85
|
+
(id: string, ref?: 'item' | 'fluid') => pressRef.current(id, ref),
|
|
86
|
+
[],
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import type { DatasetRef } from '@terrafirmagreg-team/sites/location';
|
|
3
|
+
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
|
+
import { useAsyncValue } from '@terrafirmagreg-team/ui/hooks/use-async-value';
|
|
6
|
+
import { loadTagSlice } from '@terrafirmagreg-team/recipe/lib/client-index';
|
|
7
|
+
import { registryId } from '@terrafirmagreg-team/recipe/lib/lookup';
|
|
8
|
+
import { splitDumpId } from '@terrafirmagreg-team/dump/lib/dump/paths';
|
|
9
|
+
import type { RecipeCompactIndex } from '@terrafirmagreg-team/recipe/types';
|
|
10
|
+
|
|
11
|
+
const EMPTY_TAGS: { id: string; kind: string }[] = [];
|
|
12
|
+
|
|
13
|
+
export function useItemTagGroups({
|
|
14
|
+
dataset,
|
|
15
|
+
index,
|
|
16
|
+
item,
|
|
17
|
+
kind,
|
|
18
|
+
}: {
|
|
19
|
+
dataset: DatasetRef;
|
|
20
|
+
index: RecipeCompactIndex | null;
|
|
21
|
+
item: string;
|
|
22
|
+
kind: 'item' | 'fluid';
|
|
23
|
+
}) {
|
|
24
|
+
const ids =
|
|
25
|
+
useAsyncValue(async () => {
|
|
26
|
+
const base = registryId(item);
|
|
27
|
+
const ns = splitDumpId(base)?.ns;
|
|
28
|
+
if (!index || !ns) return [] as { id: string; kind: string }[];
|
|
29
|
+
const kinds = kind === 'item' ? ['item', 'block'] : [kind];
|
|
30
|
+
const slices = await Promise.all(
|
|
31
|
+
kinds.map((tagKind) => loadTagSlice(dataset, tagKind, ns)),
|
|
32
|
+
);
|
|
33
|
+
return slices.flatMap((slice, i) =>
|
|
34
|
+
(slice[base] ?? slice[item] ?? []).map((id) => ({
|
|
35
|
+
id,
|
|
36
|
+
kind: kinds[i],
|
|
37
|
+
})),
|
|
38
|
+
);
|
|
39
|
+
}, [dataset, index, item, kind]) ?? EMPTY_TAGS;
|
|
40
|
+
const groups = useMemo(() => {
|
|
41
|
+
const order = ['item', 'block', 'fluid'];
|
|
42
|
+
const byKind = new Map<string, string[]>();
|
|
43
|
+
for (const { id, kind: tagKind } of ids) {
|
|
44
|
+
const list = byKind.get(tagKind);
|
|
45
|
+
if (list) list.push(id);
|
|
46
|
+
else byKind.set(tagKind, [id]);
|
|
47
|
+
}
|
|
48
|
+
return [...byKind.entries()].sort(
|
|
49
|
+
(a, b) => order.indexOf(a[0]) - order.indexOf(b[0]),
|
|
50
|
+
);
|
|
51
|
+
}, [ids]);
|
|
52
|
+
return { ids, groups };
|
|
53
|
+
}
|
|
54
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import type { DatasetRef } from '@terrafirmagreg-team/sites/location';
|
|
3
|
+
|
|
4
|
+
import { useAsyncValue } from '@terrafirmagreg-team/ui/hooks/use-async-value';
|
|
5
|
+
import { loadItemTooltips } from '@terrafirmagreg-team/recipe/lib/client-index';
|
|
6
|
+
import type { Lang } from '@terrafirmagreg-team/translate/types/locale';
|
|
7
|
+
|
|
8
|
+
export function useItemTooltips(
|
|
9
|
+
dataset: DatasetRef,
|
|
10
|
+
lang: Lang,
|
|
11
|
+
enabled: boolean,
|
|
12
|
+
): Record<string, string[]> | undefined {
|
|
13
|
+
return useAsyncValue(
|
|
14
|
+
enabled ? () => loadItemTooltips(dataset, lang) : false,
|
|
15
|
+
[dataset, lang, enabled],
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { usePathname } from 'next/navigation';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import type * as PageTree from 'fumadocs-core/page-tree';
|
|
5
|
+
import { useLocationSearchParams } from '@terrafirmagreg-team/ui/hooks/page/use-location-search';
|
|
6
|
+
import { useResolvedLang } from '@terrafirmagreg-team/translate/hooks/use-resolved-lang';
|
|
7
|
+
import { useLastValue } from '@terrafirmagreg-team/ui/hooks/use-last-value';
|
|
8
|
+
import { useRecipeModNames } from '@terrafirmagreg-team/recipe/hooks/use-mod-names';
|
|
9
|
+
import { useSidebarGroup } from '@terrafirmagreg-team/recipe/hooks/use-sidebar-group';
|
|
10
|
+
import { groupRecipeSidebarByMod } from '@terrafirmagreg-team/recipe/lib/sidebar';
|
|
11
|
+
import { parseSectionLocation } from '@terrafirmagreg-team/sites/location';
|
|
12
|
+
|
|
13
|
+
export function useRecipeLeftSidebarTree(tree: PageTree.Root): PageTree.Root {
|
|
14
|
+
const { dataset: datasetId } = parseSectionLocation(usePathname());
|
|
15
|
+
const lang = useResolvedLang();
|
|
16
|
+
const { sidebarGroup } = useSidebarGroup();
|
|
17
|
+
const scopeKey = datasetId ?? '';
|
|
18
|
+
const version = useLocationSearchParams().get('version') ?? undefined;
|
|
19
|
+
const dataset = useMemo(
|
|
20
|
+
() => (datasetId ? { id: datasetId, version } : undefined),
|
|
21
|
+
[datasetId, version],
|
|
22
|
+
);
|
|
23
|
+
const modNames = useLastValue(
|
|
24
|
+
useRecipeModNames(
|
|
25
|
+
sidebarGroup === 'mod' ? dataset : undefined,
|
|
26
|
+
lang,
|
|
27
|
+
),
|
|
28
|
+
scopeKey,
|
|
29
|
+
);
|
|
30
|
+
return sidebarGroup === 'mod' && modNames
|
|
31
|
+
? groupRecipeSidebarByMod(tree, modNames)
|
|
32
|
+
: tree;
|
|
33
|
+
}
|
|
34
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import type { DatasetRef } from '@terrafirmagreg-team/sites/location';
|
|
3
|
+
|
|
4
|
+
import { useAsyncValue } from '@terrafirmagreg-team/ui/hooks/use-async-value';
|
|
5
|
+
import { loadClientModNames } from '@terrafirmagreg-team/dump/lib/dump/client/mods';
|
|
6
|
+
import type { Lang } from '@terrafirmagreg-team/translate/types/locale';
|
|
7
|
+
|
|
8
|
+
export function useRecipeModNames(
|
|
9
|
+
dataset: DatasetRef | undefined,
|
|
10
|
+
lang: Lang,
|
|
11
|
+
): Record<string, string> | undefined {
|
|
12
|
+
return useAsyncValue(
|
|
13
|
+
dataset ? () => loadClientModNames(dataset, lang) : undefined,
|
|
14
|
+
[dataset, lang],
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
|
+
|
|
5
|
+
export function useMountLimit(length: number, resetKey: unknown): number {
|
|
6
|
+
const [limit, setLimit] = useState(40);
|
|
7
|
+
const [lastKey, setLastKey] = useState(resetKey);
|
|
8
|
+
if (lastKey !== resetKey) {
|
|
9
|
+
setLastKey(resetKey);
|
|
10
|
+
setLimit(40);
|
|
11
|
+
}
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (limit >= length) return;
|
|
14
|
+
const timer = setInterval(
|
|
15
|
+
() => setLimit((prev) => Math.min(prev + 40, length)),
|
|
16
|
+
16,
|
|
17
|
+
);
|
|
18
|
+
return () => clearInterval(timer);
|
|
19
|
+
}, [length, limit]);
|
|
20
|
+
return limit;
|
|
21
|
+
}
|
|
22
|
+
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import type { DatasetRef } from '@terrafirmagreg-team/sites/location';
|
|
3
|
+
|
|
4
|
+
import { useDeferredValue, useMemo } from 'react';
|
|
5
|
+
import { useItemTooltips } from '@terrafirmagreg-team/recipe/hooks/use-item-tooltips';
|
|
6
|
+
import { useTagMembers } from '@terrafirmagreg-team/recipe/hooks/use-tag-members';
|
|
7
|
+
import { filterCatalogItemIds } from '@terrafirmagreg-team/recipe/lib/search';
|
|
8
|
+
import {
|
|
9
|
+
buildPanelCells,
|
|
10
|
+
panelPool,
|
|
11
|
+
type ItemPanelMode,
|
|
12
|
+
} from '@terrafirmagreg-team/recipe/lib/panel';
|
|
13
|
+
import {
|
|
14
|
+
filterUsedIds,
|
|
15
|
+
hasRecipeUsage,
|
|
16
|
+
recipeUsedItems,
|
|
17
|
+
} from '@terrafirmagreg-team/recipe/lib/used-items';
|
|
18
|
+
import type { Lang } from '@terrafirmagreg-team/translate/types/locale';
|
|
19
|
+
import type {
|
|
20
|
+
FavoriteEntry,
|
|
21
|
+
ItemPanelCell,
|
|
22
|
+
RecipeCompactIndex,
|
|
23
|
+
} from '@terrafirmagreg-team/recipe/types';
|
|
24
|
+
|
|
25
|
+
export function usePanelCells({
|
|
26
|
+
dataset,
|
|
27
|
+
index,
|
|
28
|
+
names,
|
|
29
|
+
lang,
|
|
30
|
+
mode,
|
|
31
|
+
query,
|
|
32
|
+
tab,
|
|
33
|
+
hideUnused,
|
|
34
|
+
favorites,
|
|
35
|
+
expandedGroups,
|
|
36
|
+
}: {
|
|
37
|
+
dataset: DatasetRef;
|
|
38
|
+
index: RecipeCompactIndex | null;
|
|
39
|
+
names: Record<string, Record<string, string>>;
|
|
40
|
+
lang: Lang;
|
|
41
|
+
mode: ItemPanelMode;
|
|
42
|
+
query: string;
|
|
43
|
+
tab?: string;
|
|
44
|
+
hideUnused: boolean;
|
|
45
|
+
favorites: { entries: FavoriteEntry[] };
|
|
46
|
+
expandedGroups: ReadonlySet<string>;
|
|
47
|
+
}) {
|
|
48
|
+
const favoriteIds = useMemo(
|
|
49
|
+
() =>
|
|
50
|
+
favorites.entries.flatMap((entry) =>
|
|
51
|
+
entry.kind === 'stack' ? [entry.id] : [],
|
|
52
|
+
),
|
|
53
|
+
[favorites.entries],
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
const dIndex = useDeferredValue(index);
|
|
57
|
+
const dNames = useDeferredValue(names);
|
|
58
|
+
const dLang = useDeferredValue(lang);
|
|
59
|
+
|
|
60
|
+
const pool = useMemo(
|
|
61
|
+
() => panelPool(mode, favoriteIds, dIndex, tab),
|
|
62
|
+
[dIndex, mode, favoriteIds, tab],
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
const used = useMemo(() => recipeUsedItems(dIndex), [dIndex]);
|
|
66
|
+
const tooltips = useItemTooltips(dataset, dLang, query.includes('$'));
|
|
67
|
+
const tagMembers = useTagMembers(dataset, query.includes('#'));
|
|
68
|
+
const filtered = useMemo(() => {
|
|
69
|
+
const base =
|
|
70
|
+
mode === 'all' && hideUnused && hasRecipeUsage(used)
|
|
71
|
+
? filterUsedIds(pool, used)
|
|
72
|
+
: pool;
|
|
73
|
+
return filterCatalogItemIds(base, query, {
|
|
74
|
+
names: dNames,
|
|
75
|
+
lang: dLang,
|
|
76
|
+
tagMembers,
|
|
77
|
+
mods: dIndex?.mods,
|
|
78
|
+
tooltips,
|
|
79
|
+
});
|
|
80
|
+
}, [pool, mode, hideUnused, used, query, dNames, dLang, dIndex, tooltips, tagMembers]);
|
|
81
|
+
const deferredFiltered = useDeferredValue(filtered);
|
|
82
|
+
const cells = useMemo(() => {
|
|
83
|
+
if (mode === 'fav') {
|
|
84
|
+
const shown = new Set(deferredFiltered);
|
|
85
|
+
return favorites.entries.flatMap((entry): ItemPanelCell[] =>
|
|
86
|
+
entry.kind === 'recipe'
|
|
87
|
+
? [
|
|
88
|
+
{
|
|
89
|
+
kind: 'recipe',
|
|
90
|
+
fav: {
|
|
91
|
+
id: entry.id,
|
|
92
|
+
type: entry.type,
|
|
93
|
+
...(entry.icon ? { icon: entry.icon } : {}),
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
]
|
|
97
|
+
: shown.has(entry.id)
|
|
98
|
+
? [
|
|
99
|
+
{
|
|
100
|
+
kind: 'stack',
|
|
101
|
+
id: entry.id,
|
|
102
|
+
...(entry.ref ? { ref: entry.ref } : {}),
|
|
103
|
+
},
|
|
104
|
+
]
|
|
105
|
+
: [],
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
return buildPanelCells(
|
|
109
|
+
deferredFiltered,
|
|
110
|
+
dIndex?.groups,
|
|
111
|
+
expandedGroups,
|
|
112
|
+
);
|
|
113
|
+
}, [deferredFiltered, dIndex, mode, expandedGroups, favorites.entries]);
|
|
114
|
+
|
|
115
|
+
return { cells, filtered: deferredFiltered, favoriteIds, dIndex, dNames, dLang };
|
|
116
|
+
}
|
|
117
|
+
|