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:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user