@crowdin/app-project-module 3.2.0 → 3.2.2
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.
|
@@ -35515,14 +35515,12 @@ Defaulting to \`null\`.`;
|
|
|
35515
35515
|
const includedIds = new Set();
|
|
35516
35516
|
if (query) {
|
|
35517
35517
|
model.items.forEach((item) => {
|
|
35518
|
-
if (!matchesSearch(item, query)) {
|
|
35518
|
+
if (item.isLanguage || !matchesSearch(item, query)) {
|
|
35519
35519
|
return;
|
|
35520
35520
|
}
|
|
35521
35521
|
includedIds.add(item.id);
|
|
35522
35522
|
getAncestorIds(model, item.id).forEach((id) => includedIds.add(id));
|
|
35523
|
-
|
|
35524
|
-
getDescendantIds(model, item.id).forEach((id) => includedIds.add(id));
|
|
35525
|
-
}
|
|
35523
|
+
getDescendantIds(model, item.id).forEach((id) => includedIds.add(id));
|
|
35526
35524
|
});
|
|
35527
35525
|
}
|
|
35528
35526
|
const result = [];
|
|
@@ -35535,7 +35533,8 @@ Defaulting to \`null\`.`;
|
|
|
35535
35533
|
visited.add(item.id);
|
|
35536
35534
|
const children = (_a = model.childrenByParentId.get(item.id)) !== null && _a !== void 0 ? _a : [];
|
|
35537
35535
|
result.push({ item, level, hasChildren: children.length > 0 });
|
|
35538
|
-
|
|
35536
|
+
// search auto-expands folders, but language rows stay under user control
|
|
35537
|
+
if ((query && item.nodeType !== 'file') || openedIds.has(item.id)) {
|
|
35539
35538
|
children.forEach((child) => visit(child, level + 1));
|
|
35540
35539
|
}
|
|
35541
35540
|
};
|
|
@@ -35747,9 +35746,12 @@ Defaulting to \`null\`.`;
|
|
|
35747
35746
|
if (!queryActive) {
|
|
35748
35747
|
return [...openedFolderIds];
|
|
35749
35748
|
}
|
|
35749
|
+
const openedIds = new Set(openedFolderIds);
|
|
35750
35750
|
return visibleItems
|
|
35751
|
-
.filter(({ item, hasChildren }) =>
|
|
35752
|
-
|
|
35751
|
+
.filter(({ item, hasChildren }) => item.nodeType === 'file'
|
|
35752
|
+
? openedIds.has(item.id)
|
|
35753
|
+
: Boolean(hasChildren ||
|
|
35754
|
+
(assumeFoldersHaveChildren && (item.nodeType === 'branch' || item.nodeType === 'folder'))))
|
|
35753
35755
|
.map(({ item }) => item.id);
|
|
35754
35756
|
}, [assumeFoldersHaveChildren, openedFolderIds, queryActive, visibleItems]);
|
|
35755
35757
|
const expandedItemsRef = reactExports.useRef(expandedItems);
|
|
@@ -36386,7 +36388,7 @@ Defaulting to \`null\`.`;
|
|
|
36386
36388
|
if (!isFile(item)) {
|
|
36387
36389
|
return result;
|
|
36388
36390
|
}
|
|
36389
|
-
const languageIds =
|
|
36391
|
+
const languageIds = displayedLanguagesRef.current
|
|
36390
36392
|
.filter((language) => selected.has(`${item.id}__${language.id}`))
|
|
36391
36393
|
.map((language) => String(language.id));
|
|
36392
36394
|
if (languageIds.length) {
|