2026-02-20 12:27:52 +01:00
|
|
|
/**
|
|
|
|
|
* OxiCloud - App state container
|
|
|
|
|
* Centralized mutable state for app and cached DOM references.
|
|
|
|
|
*/
|
|
|
|
|
|
2026-05-07 23:40:02 +02:00
|
|
|
/** @import {FileItem, FolderItem, LightItem} from '../core/types.js' */
|
2026-04-30 02:02:27 +02:00
|
|
|
|
2026-04-13 15:09:10 +02:00
|
|
|
export const app = {
|
2026-02-20 12:27:52 +01:00
|
|
|
currentView: 'grid',
|
2026-04-30 02:02:27 +02:00
|
|
|
|
|
|
|
|
/** @type {string | null} */
|
2026-02-20 12:27:52 +01:00
|
|
|
currentPath: '',
|
2026-05-07 23:40:02 +02:00
|
|
|
|
|
|
|
|
/** @type {string | null} */
|
2026-02-20 12:27:52 +01:00
|
|
|
currentFolder: null,
|
2026-04-30 02:02:27 +02:00
|
|
|
|
2026-05-07 23:40:02 +02:00
|
|
|
/** @type {FolderItem | null} */
|
2026-03-22 22:55:42 +01:00
|
|
|
currentFolderInfo: null,
|
2026-04-30 02:02:27 +02:00
|
|
|
|
2026-05-07 23:40:02 +02:00
|
|
|
/** @type {FolderItem | null} */
|
2026-02-20 12:27:52 +01:00
|
|
|
contextMenuTargetFolder: null,
|
2026-04-30 02:02:27 +02:00
|
|
|
|
2026-05-07 23:40:02 +02:00
|
|
|
/** @type {FileItem | null} */
|
2026-02-20 12:27:52 +01:00
|
|
|
contextMenuTargetFile: null,
|
|
|
|
|
selectedTargetFolderId: '',
|
|
|
|
|
moveDialogMode: 'file',
|
2026-04-30 02:02:27 +02:00
|
|
|
|
2026-05-07 23:40:02 +02:00
|
|
|
/** @type {string | null} */
|
|
|
|
|
moveDialogItemId: null,
|
|
|
|
|
|
|
|
|
|
/** @type {'file' | 'folder' | null} */
|
|
|
|
|
moveDialogItemMode: null,
|
|
|
|
|
|
|
|
|
|
/** @type {string | null} */
|
|
|
|
|
moveDialogCurrentFolderId: null,
|
|
|
|
|
|
|
|
|
|
/** @type {Array<{id: string, name: string}>} */
|
|
|
|
|
moveDialogBreadcrumb: [],
|
|
|
|
|
|
|
|
|
|
/** @type {FileItem[] | null} */
|
|
|
|
|
playlistDialogFiles: null,
|
|
|
|
|
|
2026-04-30 02:02:27 +02:00
|
|
|
/** @type {String | null} */
|
2026-04-15 22:18:42 +02:00
|
|
|
currentSection: null, // will be defined on first call
|
2026-02-20 12:27:52 +01:00
|
|
|
isSearchMode: false,
|
2026-05-07 23:40:02 +02:00
|
|
|
|
|
|
|
|
/** @type {FileItem | FolderItem | null} */
|
2026-02-20 12:27:52 +01:00
|
|
|
shareDialogItem: null,
|
2026-05-07 23:40:02 +02:00
|
|
|
|
|
|
|
|
/** @type {'file' | 'folder' | null} */
|
2026-02-20 12:27:52 +01:00
|
|
|
shareDialogItemType: null,
|
2026-05-07 23:40:02 +02:00
|
|
|
|
|
|
|
|
/** @type {String | null} */
|
2026-02-21 00:19:04 +01:00
|
|
|
notificationShareUrl: null,
|
2026-05-07 23:40:02 +02:00
|
|
|
|
|
|
|
|
/** @type {string | null} */
|
2026-02-22 20:20:00 -08:00
|
|
|
userHomeFolderId: null,
|
2026-05-07 23:40:02 +02:00
|
|
|
|
|
|
|
|
/** @type {string | null} */
|
2026-02-22 20:20:00 -08:00
|
|
|
userHomeFolderName: null,
|
2026-05-07 23:40:02 +02:00
|
|
|
|
|
|
|
|
/** @type {Array<{id: string, name: string}>} */
|
2026-04-06 10:59:46 +02:00
|
|
|
breadcrumbPath: [], // Array of {id, name} tracking folder navigation hierarchy
|
2026-04-30 02:02:27 +02:00
|
|
|
|
|
|
|
|
/** @type {String | null} */
|
2026-05-07 23:40:02 +02:00
|
|
|
viewFile: null, // current file in inline view
|
|
|
|
|
|
|
|
|
|
/** @type {LightItem[] | null} */
|
|
|
|
|
batchMoveItems: null
|
2026-02-20 12:27:52 +01:00
|
|
|
};
|
|
|
|
|
|
2026-04-30 02:02:27 +02:00
|
|
|
export const appElements = {
|
|
|
|
|
/** @type {HTMLElement | null} */
|
|
|
|
|
uploadBtn: null,
|
|
|
|
|
/** @type {HTMLElement | null} */
|
|
|
|
|
dropzone: null,
|
|
|
|
|
/** @type {HTMLInputElement | null} */
|
|
|
|
|
fileInput: null,
|
|
|
|
|
/** @type {HTMLElement | null} */
|
|
|
|
|
filesList: null,
|
|
|
|
|
/** @type {HTMLElement | null} */
|
|
|
|
|
newFolderBtn: null,
|
|
|
|
|
/** @type {HTMLElement | null} */
|
|
|
|
|
gridViewBtn: null,
|
|
|
|
|
/** @type {HTMLElement | null} */
|
|
|
|
|
listViewBtn: null,
|
|
|
|
|
/** @type {HTMLElement | null} */
|
|
|
|
|
breadcrumb: null,
|
|
|
|
|
/** @type {HTMLElement | null} */
|
|
|
|
|
pageTitle: null,
|
|
|
|
|
/** @type {HTMLElement | null} */
|
|
|
|
|
actionsBar: null,
|
|
|
|
|
/** @type {NodeListOf<HTMLElement> | null} */
|
|
|
|
|
navItems: null,
|
|
|
|
|
/** @type {HTMLInputElement | null} */
|
|
|
|
|
searchInput: null
|
|
|
|
|
};
|