Merge branch 'main' into SaaS

This commit is contained in:
Anthony Stirling
2026-06-10 11:42:25 +01:00
committed by GitHub
131 changed files with 17211 additions and 1451 deletions
@@ -0,0 +1,31 @@
/**
* Feature detection for the File System Access API.
*
* Browser support matrix (as of 2026):
* Chrome/Edge: full support — showDirectoryPicker, createWritable, queryPermission
* Firefox: showDirectoryPicker + read-only iteration only; no createWritable, no queryPermission
* Safari 15.2+: showDirectoryPicker + read only; no createWritable
*/
/** True when the browser can pick a directory and read files from it. */
export const canReadLocalFolder: boolean =
typeof window !== "undefined" &&
typeof (window as any).showDirectoryPicker === "function";
/** True when the browser supports writing files (createWritable). Requires Chrome/Edge. */
export const canWriteLocalFolder: boolean =
canReadLocalFolder &&
typeof FileSystemFileHandle !== "undefined" &&
typeof (FileSystemFileHandle.prototype as any).createWritable === "function";
/** True when the browser supports permission querying across sessions (queryPermission). */
export const canPersistFsPermission: boolean =
canReadLocalFolder &&
typeof FileSystemHandle !== "undefined" &&
typeof (FileSystemHandle.prototype as any).queryPermission === "function";
export const FS_READ_UNSUPPORTED_MSG =
"Your browser does not support the File System Access API. Use Chrome or Edge.";
export const FS_WRITE_UNSUPPORTED_MSG =
"Your browser cannot write to local folders. Use Chrome or Edge for this feature.";