feat(wiki): implement folder management features in wiki API

Add new API functions for managing wiki folders, including creating, updating, deleting, and listing folders. Introduce a new WikiFolder interface to represent folder structure and enhance the WikiBrowser component with folder actions. Update internationalization strings for folder-related actions in English, Korean, Russian, and Chinese locales. Refactor existing code to accommodate folder hierarchy and improve user experience in the wiki browser.
This commit is contained in:
wizardchen
2026-06-16 23:48:35 +08:00
committed by lyingbug
parent 83eeec0ddf
commit e76738d054
24 changed files with 1903 additions and 399 deletions
+5 -2
View File
@@ -47,9 +47,12 @@ const DEFAULT_VALID_TYPES = new Set(["pdf", "txt", "md", "docx", "doc", "pptx",
* @param validTypes - override the default extension whitelist with a dynamic set (e.g. from engine registry).
*/
export function kbFileTypeVerification(file: any, silent = false, validTypes?: Set<string> | string[]) {
const allowed = validTypes
const provided = validTypes
? (validTypes instanceof Set ? validTypes : new Set(validTypes))
: DEFAULT_VALID_TYPES;
: undefined;
// An empty whitelist means the engine registry hasn't loaded yet; fall back to
// the default set rather than rejecting every file.
const allowed = provided && provided.size > 0 ? provided : DEFAULT_VALID_TYPES;
const type = file.name.substring(file.name.lastIndexOf(".") + 1).toLowerCase();
if (!allowed.has(type)) {