@capgo/capacitor-file-picker 8.0.0 → 8.1.0

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.
package/README.md CHANGED
@@ -21,10 +21,22 @@ A comprehensive file picker plugin with **full native support** for iOS and Andr
21
21
  - **Copy Files** - Copy files to new locations
22
22
  - **File Metadata** - Get size, dimensions, duration, and more
23
23
 
24
+
24
25
  ## Documentation
25
26
 
26
27
  The most complete doc is available here: https://capgo.app/docs/plugins/file-picker/
27
28
 
29
+ ## Compatibility
30
+
31
+ | Plugin version | Capacitor compatibility | Maintained |
32
+ | -------------- | ----------------------- | ---------- |
33
+ | v8.\*.\* | v8.\*.\* | ✅ |
34
+ | v7.\*.\* | v7.\*.\* | On demand |
35
+ | v6.\*.\* | v6.\*.\* | ❌ |
36
+ | v5.\*.\* | v5.\*.\* | ❌ |
37
+
38
+ > **Note:** The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation (e.g., plugin v8 for Capacitor 8). Only the latest major version is actively maintained.
39
+
28
40
  ## Install
29
41
 
30
42
  ```bash
@@ -50,7 +50,7 @@ import org.json.JSONException;
50
50
  )
51
51
  public class CapgoFilePickerPlugin extends Plugin {
52
52
 
53
- private final String pluginVersion = "8.0.0";
53
+ private final String pluginVersion = "8.1.0";
54
54
  private boolean readData = false;
55
55
 
56
56
  // MARK: - Pick Files
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\n/**\n * Options for picking files.\n *\n * @since 8.0.0\n */\nexport interface PickFilesOptions {\n /**\n * List of accepted MIME types or file extensions.\n * On iOS, only MIME types are supported.\n * Examples: ['image/*'], ['application/pdf'], ['.pdf', '.doc']\n */\n types?: string[];\n /**\n * Maximum number of files to pick.\n * Set to 0 for unlimited (platform default).\n * @default 0\n */\n limit?: number;\n /**\n * Whether to read the file data as base64.\n * Note: Reading large files may cause memory issues.\n * @default false\n */\n readData?: boolean;\n}\n\n/**\n * Options for picking media (images/videos).\n *\n * @since 8.0.0\n */\nexport interface PickMediaOptions {\n /**\n * Maximum number of files to pick.\n * Set to 0 for unlimited (platform default).\n * @default 0\n */\n limit?: number;\n /**\n * Whether to read the file data as base64.\n * Note: Reading large files may cause memory issues.\n * @default false\n */\n readData?: boolean;\n /**\n * iOS only: Skip transcoding of videos.\n * @default false\n */\n skipTranscoding?: boolean;\n /**\n * iOS 15+ only: Show ordered selection badges.\n * @default false\n */\n ordered?: boolean;\n}\n\n/**\n * Options for converting HEIC to JPEG.\n *\n * @since 8.0.0\n */\nexport interface ConvertHeicToJpegOptions {\n /** The path to the HEIC file to convert */\n path: string;\n /**\n * The compression quality for JPEG (0.0 - 1.0).\n * @default 0.9\n */\n quality?: number;\n}\n\n/**\n * Result of HEIC to JPEG conversion.\n *\n * @since 8.0.0\n */\nexport interface ConvertHeicToJpegResult {\n /** The path to the converted JPEG file */\n path: string;\n}\n\n/**\n * Options for copying a file.\n *\n * @since 8.0.0\n */\nexport interface CopyFileOptions {\n /** Source file path */\n from: string;\n /** Destination file path */\n to: string;\n /**\n * Whether to overwrite if destination exists.\n * @default false\n */\n overwrite?: boolean;\n}\n\n/**\n * Represents a picked file.\n *\n * @since 8.0.0\n */\nexport interface PickedFile {\n /** The name of the file */\n name: string;\n /** The path to the file */\n path?: string;\n /** The MIME type of the file */\n mimeType: string;\n /** The size of the file in bytes */\n size: number;\n /**\n * The base64 encoded data of the file.\n * Only present if readData was true.\n */\n data?: string;\n /**\n * The Blob instance of the file.\n * Web only.\n */\n blob?: Blob;\n /** Width in pixels (images/videos only) */\n width?: number;\n /** Height in pixels (images/videos only) */\n height?: number;\n /** Duration in seconds (videos only) */\n duration?: number;\n /** Last modified timestamp in milliseconds */\n modifiedAt?: number;\n}\n\n/**\n * Result of picking files.\n *\n * @since 8.0.0\n */\nexport interface PickFilesResult {\n /** Array of picked files */\n files: PickedFile[];\n}\n\n/**\n * Result of picking a directory.\n *\n * @since 8.0.0\n */\nexport interface PickDirectoryResult {\n /** The path to the selected directory */\n path: string;\n}\n\n/**\n * Permission status for file access.\n *\n * @since 8.0.0\n */\nexport interface PermissionStatus {\n /** Whether permission to read media files is granted */\n readExternalStorage: PermissionState;\n /** Whether permission to access media location is granted */\n accessMediaLocation?: PermissionState;\n}\n\n/**\n * Permission state values.\n *\n * @since 8.0.0\n */\nexport type PermissionState = 'prompt' | 'prompt-with-rationale' | 'granted' | 'denied';\n\n/**\n * Listener callback for picker dismissed event.\n *\n * @since 8.0.0\n */\nexport type PickerDismissedListener = (event: null) => void;\n\n/**\n * Capacitor File Picker Plugin interface for selecting files, images, videos, and directories.\n *\n * @since 8.0.0\n */\nexport interface CapgoFilePickerPlugin {\n /**\n * Pick one or more files from the device.\n *\n * @param options - Options for picking files\n * @returns Promise that resolves with the picked files\n * @since 8.0.0\n * @example\n * ```typescript\n * const result = await CapgoFilePicker.pickFiles({\n * types: ['application/pdf', 'image/*'],\n * limit: 5,\n * readData: false\n * });\n * console.log('Picked files:', result.files);\n * ```\n */\n pickFiles(options?: PickFilesOptions): Promise<PickFilesResult>;\n\n /**\n * Pick one or more images from the gallery.\n * Android/iOS only.\n *\n * @param options - Options for picking images\n * @returns Promise that resolves with the picked images\n * @since 8.0.0\n * @example\n * ```typescript\n * const result = await CapgoFilePicker.pickImages({\n * limit: 10,\n * readData: false\n * });\n * console.log('Picked images:', result.files);\n * ```\n */\n pickImages(options?: PickMediaOptions): Promise<PickFilesResult>;\n\n /**\n * Pick one or more videos from the gallery.\n * Android/iOS only.\n *\n * @param options - Options for picking videos\n * @returns Promise that resolves with the picked videos\n * @since 8.0.0\n * @example\n * ```typescript\n * const result = await CapgoFilePicker.pickVideos({\n * limit: 3,\n * skipTranscoding: true\n * });\n * console.log('Picked videos:', result.files);\n * ```\n */\n pickVideos(options?: PickMediaOptions): Promise<PickFilesResult>;\n\n /**\n * Pick one or more images or videos from the gallery.\n * Android/iOS only.\n *\n * @param options - Options for picking media\n * @returns Promise that resolves with the picked media files\n * @since 8.0.0\n * @example\n * ```typescript\n * const result = await CapgoFilePicker.pickMedia({\n * limit: 5,\n * readData: true\n * });\n * console.log('Picked media:', result.files);\n * ```\n */\n pickMedia(options?: PickMediaOptions): Promise<PickFilesResult>;\n\n /**\n * Pick a directory from the device.\n * Android/iOS only.\n *\n * @returns Promise that resolves with the picked directory path\n * @since 8.0.0\n * @example\n * ```typescript\n * const result = await CapgoFilePicker.pickDirectory();\n * console.log('Selected directory:', result.path);\n * ```\n */\n pickDirectory(): Promise<PickDirectoryResult>;\n\n /**\n * Convert a HEIC image to JPEG format.\n * iOS only.\n *\n * @param options - Options for the conversion\n * @returns Promise that resolves with the converted file path\n * @since 8.0.0\n * @example\n * ```typescript\n * const result = await CapgoFilePicker.convertHeicToJpeg({\n * path: '/path/to/image.heic',\n * quality: 0.9\n * });\n * console.log('Converted file:', result.path);\n * ```\n */\n convertHeicToJpeg(options: ConvertHeicToJpegOptions): Promise<ConvertHeicToJpegResult>;\n\n /**\n * Copy a file to a new location.\n *\n * @param options - Options for copying the file\n * @returns Promise that resolves when the copy is complete\n * @since 8.0.0\n * @example\n * ```typescript\n * await CapgoFilePicker.copyFile({\n * from: '/source/file.pdf',\n * to: '/destination/file.pdf',\n * overwrite: true\n * });\n * ```\n */\n copyFile(options: CopyFileOptions): Promise<void>;\n\n /**\n * Check permissions for reading files.\n * Android only.\n *\n * @returns Promise that resolves with the permission status\n * @since 8.0.0\n * @example\n * ```typescript\n * const status = await CapgoFilePicker.checkPermissions();\n * console.log('Read permission:', status.readExternalStorage);\n * ```\n */\n checkPermissions(): Promise<PermissionStatus>;\n\n /**\n * Request permissions for reading files.\n * Android only.\n *\n * @returns Promise that resolves with the permission status\n * @since 8.0.0\n * @example\n * ```typescript\n * const status = await CapgoFilePicker.requestPermissions();\n * if (status.readExternalStorage === 'granted') {\n * console.log('Permission granted');\n * }\n * ```\n */\n requestPermissions(): Promise<PermissionStatus>;\n\n /**\n * Add a listener for the picker dismissed event.\n * iOS only.\n *\n * @param eventName - The event name\n * @param listenerFunc - The listener function\n * @returns Promise that resolves with the listener handle\n * @since 8.0.0\n */\n addListener(\n eventName: 'pickerDismissed',\n listenerFunc: PickerDismissedListener,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Remove all listeners for this plugin.\n *\n * @since 8.0.0\n */\n removeAllListeners(): Promise<void>;\n\n /**\n * Get the native Capacitor plugin version.\n *\n * @returns Promise that resolves with the plugin version\n * @since 8.0.0\n * @example\n * ```typescript\n * const { version } = await CapgoFilePicker.getPluginVersion();\n * console.log('Plugin version:', version);\n * ```\n */\n getPluginVersion(): Promise<{ version: string }>;\n}\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\n/**\n * Options for picking files.\n *\n * @since 8.0.0\n */\nexport interface PickFilesOptions {\n /**\n * List of accepted MIME types or file extensions.\n * On iOS, only MIME types are supported.\n * Examples: ['image/*'], ['application/pdf'], ['.pdf', '.doc']\n */\n types?: string[];\n /**\n * Maximum number of files to pick.\n * Set to 0 for unlimited (platform default).\n * @default 0\n */\n limit?: number;\n /**\n * Whether to read the file data as base64.\n * Note: Reading large files may cause memory issues.\n * @default false\n */\n readData?: boolean;\n}\n\n/**\n * Options for picking media (images/videos).\n *\n * @since 8.0.0\n */\nexport interface PickMediaOptions {\n /**\n * Maximum number of files to pick.\n * Set to 0 for unlimited (platform default).\n * @default 0\n */\n limit?: number;\n /**\n * Whether to read the file data as base64.\n * Note: Reading large files may cause memory issues.\n * @default false\n */\n readData?: boolean;\n /**\n * iOS only: Skip transcoding of videos.\n * @default false\n */\n skipTranscoding?: boolean;\n /**\n * iOS 15+ only: Show ordered selection badges.\n * @default false\n */\n ordered?: boolean;\n}\n\n/**\n * Options for converting HEIC to JPEG.\n *\n * @since 8.0.0\n */\nexport interface ConvertHeicToJpegOptions {\n /** The path to the HEIC file to convert */\n path: string;\n /**\n * The compression quality for JPEG (0.0 - 1.0).\n * @default 0.9\n */\n quality?: number;\n}\n\n/**\n * Result of HEIC to JPEG conversion.\n *\n * @since 8.0.0\n */\nexport interface ConvertHeicToJpegResult {\n /** The path to the converted JPEG file */\n path: string;\n}\n\n/**\n * Options for copying a file.\n *\n * @since 8.0.0\n */\nexport interface CopyFileOptions {\n /** Source file path */\n from: string;\n /** Destination file path */\n to: string;\n /**\n * Whether to overwrite if destination exists.\n * @default false\n */\n overwrite?: boolean;\n}\n\n/**\n * Represents a picked file.\n *\n * @since 8.0.0\n */\nexport interface PickedFile {\n /** The name of the file */\n name: string;\n /** The path to the file */\n path?: string;\n /** The MIME type of the file */\n mimeType: string;\n /** The size of the file in bytes */\n size: number;\n /**\n * The base64 encoded data of the file.\n * Only present if readData was true.\n */\n data?: string;\n /**\n * The Blob instance of the file.\n * Web only.\n */\n blob?: Blob;\n /** Width in pixels (images/videos only) */\n width?: number;\n /** Height in pixels (images/videos only) */\n height?: number;\n /** Duration in seconds (videos only) */\n duration?: number;\n /** Last modified timestamp in milliseconds */\n modifiedAt?: number;\n}\n\n/**\n * Result of picking files.\n *\n * @since 8.0.0\n */\nexport interface PickFilesResult {\n /** Array of picked files */\n files: PickedFile[];\n}\n\n/**\n * Result of picking a directory.\n *\n * @since 8.0.0\n */\nexport interface PickDirectoryResult {\n /** The path to the selected directory */\n path: string;\n}\n\n/**\n * Permission status for file access.\n *\n * @since 8.0.0\n */\nexport interface PermissionStatus {\n /** Whether permission to read media files is granted */\n readExternalStorage: PermissionState;\n /** Whether permission to access media location is granted */\n accessMediaLocation?: PermissionState;\n}\n\n/**\n * Permission state values.\n *\n * @since 8.0.0\n */\nexport type PermissionState = 'prompt' | 'prompt-with-rationale' | 'granted' | 'denied';\n\n/**\n * Listener callback for picker dismissed event.\n *\n * @since 8.0.0\n */\nexport type PickerDismissedListener = (event: null) => void;\n\n/**\n * Capacitor File Picker Plugin interface for selecting files, images, videos, and directories.\n *\n * @since 8.0.0\n */\nexport interface CapgoFilePickerPlugin {\n /**\n * Pick one or more files from the device.\n *\n * @param options - Options for picking files\n * @returns Promise that resolves with the picked files\n * @since 8.0.0\n * @example\n * ```typescript\n * const result = await CapgoFilePicker.pickFiles({\n * types: ['application/pdf', 'image/*'],\n * limit: 5,\n * readData: false\n * });\n * console.log('Picked files:', result.files);\n * ```\n */\n pickFiles(options?: PickFilesOptions): Promise<PickFilesResult>;\n\n /**\n * Pick one or more images from the gallery.\n * Android/iOS only.\n *\n * @param options - Options for picking images\n * @returns Promise that resolves with the picked images\n * @since 8.0.0\n * @example\n * ```typescript\n * const result = await CapgoFilePicker.pickImages({\n * limit: 10,\n * readData: false\n * });\n * console.log('Picked images:', result.files);\n * ```\n */\n pickImages(options?: PickMediaOptions): Promise<PickFilesResult>;\n\n /**\n * Pick one or more videos from the gallery.\n * Android/iOS only.\n *\n * @param options - Options for picking videos\n * @returns Promise that resolves with the picked videos\n * @since 8.0.0\n * @example\n * ```typescript\n * const result = await CapgoFilePicker.pickVideos({\n * limit: 3,\n * skipTranscoding: true\n * });\n * console.log('Picked videos:', result.files);\n * ```\n */\n pickVideos(options?: PickMediaOptions): Promise<PickFilesResult>;\n\n /**\n * Pick one or more images or videos from the gallery.\n * Android/iOS only.\n *\n * @param options - Options for picking media\n * @returns Promise that resolves with the picked media files\n * @since 8.0.0\n * @example\n * ```typescript\n * const result = await CapgoFilePicker.pickMedia({\n * limit: 5,\n * readData: true\n * });\n * console.log('Picked media:', result.files);\n * ```\n */\n pickMedia(options?: PickMediaOptions): Promise<PickFilesResult>;\n\n /**\n * Pick a directory from the device.\n * Android/iOS only.\n *\n * @returns Promise that resolves with the picked directory path\n * @since 8.0.0\n * @example\n * ```typescript\n * const result = await CapgoFilePicker.pickDirectory();\n * console.log('Selected directory:', result.path);\n * ```\n */\n pickDirectory(): Promise<PickDirectoryResult>;\n\n /**\n * Convert a HEIC image to JPEG format.\n * iOS only.\n *\n * @param options - Options for the conversion\n * @returns Promise that resolves with the converted file path\n * @since 8.0.0\n * @example\n * ```typescript\n * const result = await CapgoFilePicker.convertHeicToJpeg({\n * path: '/path/to/image.heic',\n * quality: 0.9\n * });\n * console.log('Converted file:', result.path);\n * ```\n */\n convertHeicToJpeg(options: ConvertHeicToJpegOptions): Promise<ConvertHeicToJpegResult>;\n\n /**\n * Copy a file to a new location.\n *\n * @param options - Options for copying the file\n * @returns Promise that resolves when the copy is complete\n * @since 8.0.0\n * @example\n * ```typescript\n * await CapgoFilePicker.copyFile({\n * from: '/source/file.pdf',\n * to: '/destination/file.pdf',\n * overwrite: true\n * });\n * ```\n */\n copyFile(options: CopyFileOptions): Promise<void>;\n\n /**\n * Check permissions for reading files.\n * Android only.\n *\n * @returns Promise that resolves with the permission status\n * @since 8.0.0\n * @example\n * ```typescript\n * const status = await CapgoFilePicker.checkPermissions();\n * console.log('Read permission:', status.readExternalStorage);\n * ```\n */\n checkPermissions(): Promise<PermissionStatus>;\n\n /**\n * Request permissions for reading files.\n * Android only.\n *\n * @returns Promise that resolves with the permission status\n * @since 8.0.0\n * @example\n * ```typescript\n * const status = await CapgoFilePicker.requestPermissions();\n * if (status.readExternalStorage === 'granted') {\n * console.log('Permission granted');\n * }\n * ```\n */\n requestPermissions(): Promise<PermissionStatus>;\n\n /**\n * Add a listener for the picker dismissed event.\n * iOS only.\n *\n * @param eventName - The event name\n * @param listenerFunc - The listener function\n * @returns Promise that resolves with the listener handle\n * @since 8.0.0\n */\n addListener(eventName: 'pickerDismissed', listenerFunc: PickerDismissedListener): Promise<PluginListenerHandle>;\n\n /**\n * Remove all listeners for this plugin.\n *\n * @since 8.0.0\n */\n removeAllListeners(): Promise<void>;\n\n /**\n * Get the native Capacitor plugin version.\n *\n * @returns Promise that resolves with the plugin version\n * @since 8.0.0\n * @example\n * ```typescript\n * const { version } = await CapgoFilePicker.getPluginVersion();\n * console.log('Plugin version:', version);\n * ```\n */\n getPluginVersion(): Promise<{ version: string }>;\n}\n"]}
package/dist/esm/web.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- import { WebPlugin } from '@capacitor/core';
2
- import type { PluginListenerHandle } from '@capacitor/core';
1
+ import { WebPlugin, type PluginListenerHandle } from '@capacitor/core';
3
2
  import type { CapgoFilePickerPlugin, ConvertHeicToJpegOptions, ConvertHeicToJpegResult, CopyFileOptions, PermissionStatus, PickDirectoryResult, PickFilesOptions, PickFilesResult, PickMediaOptions, PickerDismissedListener } from './definitions';
4
3
  export declare class CapgoFilePickerWeb extends WebPlugin implements CapgoFilePickerPlugin {
5
4
  pickFiles(options?: PickFilesOptions): Promise<PickFilesResult>;
package/dist/esm/web.js CHANGED
@@ -51,9 +51,11 @@ export class CapgoFilePickerWeb extends WebPlugin {
51
51
  throw this.unimplemented('pickDirectory is not supported on web');
52
52
  }
53
53
  async convertHeicToJpeg(_options) {
54
+ void _options;
54
55
  throw this.unimplemented('convertHeicToJpeg is not supported on web');
55
56
  }
56
57
  async copyFile(_options) {
58
+ void _options;
57
59
  throw this.unimplemented('copyFile is not supported on web');
58
60
  }
59
61
  async checkPermissions() {
@@ -67,6 +69,8 @@ export class CapgoFilePickerWeb extends WebPlugin {
67
69
  };
68
70
  }
69
71
  async addListener(_eventName, _listenerFunc) {
72
+ void _eventName;
73
+ void _listenerFunc;
70
74
  return {
71
75
  remove: async () => {
72
76
  // No-op on web
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAkB5C,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IAC/C,KAAK,CAAC,SAAS,CAAC,OAA0B;QACxC,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC;YACtC,KAAK,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK;YACrB,QAAQ,EAAE,CAAA,OAAO,aAAP,OAAO,u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AAC,MAAM,EAAE,CAAC,CAAC;YACpD,CAAC,CAAC;YACF,GAAG,CAAC,OAAO,GAAG,GAAG,EAAE;gBACjB,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;gBAC7B,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;YACnC,CAAC,CAAC;YACF,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { PluginListenerHandle } from '@capacitor/core';\n\nimport type {\n CapgoFilePickerPlugin,\n ConvertHeicToJpegOptions,\n ConvertHeicToJpegResult,\n CopyFileOptions,\n PermissionStatus,\n PickedFile,\n PickDirectoryResult,\n PickFilesOptions,\n PickFilesResult,\n PickMediaOptions,\n PickerDismissedListener,\n} from './definitions';\n\nexport class CapgoFilePickerWeb extends WebPlugin implements CapgoFilePickerPlugin {\n async pickFiles(options?: PickFilesOptions): Promise<PickFilesResult> {\n const files = await this.openFilePicker({\n types: options?.types,\n multiple: options?.limit !== 1,\n });\n const pickedFiles: PickedFile[] = [];\n for (const file of files) {\n const pickedFile: PickedFile = {\n name: file.name,\n mimeType: file.type || 'application/octet-stream',\n size: file.size,\n blob: file,\n modifiedAt: file.lastModified,\n };\n if (options?.readData) {\n pickedFile.data = await this.getDataFromFile(file);\n }\n if (file.type.startsWith('image/')) {\n const dimensions = await this.getImageDimensions(file);\n pickedFile.width = dimensions.width;\n pickedFile.height = dimensions.height;\n }\n pickedFiles.push(pickedFile);\n }\n return { files: pickedFiles };\n }\n\n async pickImages(options?: PickMediaOptions): Promise<PickFilesResult> {\n return this.pickFiles({\n types: ['image/*'],\n limit: options?.limit,\n readData: options?.readData,\n });\n }\n\n async pickVideos(options?: PickMediaOptions): Promise<PickFilesResult> {\n return this.pickFiles({\n types: ['video/*'],\n limit: options?.limit,\n readData: options?.readData,\n });\n }\n\n async pickMedia(options?: PickMediaOptions): Promise<PickFilesResult> {\n return this.pickFiles({\n types: ['image/*', 'video/*'],\n limit: options?.limit,\n readData: options?.readData,\n });\n }\n\n async pickDirectory(): Promise<PickDirectoryResult> {\n throw this.unimplemented('pickDirectory is not supported on web');\n }\n\n async convertHeicToJpeg(_options: ConvertHeicToJpegOptions): Promise<ConvertHeicToJpegResult> {\n throw this.unimplemented('convertHeicToJpeg is not supported on web');\n }\n\n async copyFile(_options: CopyFileOptions): Promise<void> {\n throw this.unimplemented('copyFile is not supported on web');\n }\n\n async checkPermissions(): Promise<PermissionStatus> {\n return {\n readExternalStorage: 'granted',\n };\n }\n\n async requestPermissions(): Promise<PermissionStatus> {\n return {\n readExternalStorage: 'granted',\n };\n }\n\n async addListener(\n _eventName: 'pickerDismissed',\n _listenerFunc: PickerDismissedListener,\n ): Promise<PluginListenerHandle> {\n return {\n remove: async () => {\n // No-op on web\n },\n };\n }\n\n async removeAllListeners(): Promise<void> {\n // No-op on web\n }\n\n async getPluginVersion(): Promise<{ version: string }> {\n return { version: 'web' };\n }\n\n private openFilePicker(options: { types?: string[]; multiple?: boolean }): Promise<File[]> {\n return new Promise((resolve) => {\n const input = document.createElement('input');\n input.type = 'file';\n input.multiple = options.multiple ?? true;\n if (options.types && options.types.length > 0) {\n input.accept = options.types.join(',');\n }\n input.style.display = 'none';\n document.body.appendChild(input);\n\n let resolved = false;\n\n const handleChange = () => {\n resolved = true;\n const files = Array.from(input.files || []);\n cleanup();\n resolve(files);\n };\n\n const handleCancel = () => {\n // Small delay to ensure change event fires first if files were selected\n setTimeout(() => {\n if (!resolved) {\n cleanup();\n resolve([]);\n }\n }, 300);\n };\n\n const cleanup = () => {\n input.removeEventListener('change', handleChange);\n window.removeEventListener('focus', handleCancel);\n document.body.removeChild(input);\n };\n\n input.addEventListener('change', handleChange);\n window.addEventListener('focus', handleCancel);\n\n input.click();\n });\n }\n\n private getDataFromFile(file: File): Promise<string> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => {\n const result = reader.result as string;\n // Remove data URL prefix to get pure base64\n const base64 = result.split(',')[1] || '';\n resolve(base64);\n };\n reader.onerror = () => reject(new Error('Failed to read file'));\n reader.readAsDataURL(file);\n });\n }\n\n private getImageDimensions(file: File): Promise<{ width: number; height: number }> {\n return new Promise((resolve) => {\n const img = new Image();\n img.onload = () => {\n URL.revokeObjectURL(img.src);\n resolve({ width: img.width, height: img.height });\n };\n img.onerror = () => {\n URL.revokeObjectURL(img.src);\n resolve({ width: 0, height: 0 });\n };\n img.src = URL.createObjectURL(file);\n });\n }\n}\n"]}
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA6B,MAAM,iBAAiB,CAAC;AAgBvE,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IAC/C,KAAK,CAAC,SAAS,CAAC,OAA0B;QACxC,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC;YACtC,KAAK,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK;YACrB,QAAQ,EAAE,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,MAAK,CAAC;SAC/B,CAAC,CAAC;QACH,MAAM,WAAW,GAAiB,EAAE,CAAC;QACrC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,UAAU,GAAe;gBAC7B,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,QAAQ,EAAE,IAAI,CAAC,IAAI,IAAI,0BAA0B;gBACjD,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,IAAI,EAAE,IAAI;gBACV,UAAU,EAAE,IAAI,CAAC,YAAY;aAC9B,CAAC;YACF,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,EAAE,CAAC;gBACtB,UAAU,CAAC,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AAC;CACF","sourcesContent":["import { WebPlugin, type PluginListenerHandle } from '@capacitor/core';\n\nimport type {\n CapgoFilePickerPlugin,\n ConvertHeicToJpegOptions,\n ConvertHeicToJpegResult,\n CopyFileOptions,\n PermissionStatus,\n PickedFile,\n PickDirectoryResult,\n PickFilesOptions,\n PickFilesResult,\n PickMediaOptions,\n PickerDismissedListener,\n} from './definitions';\n\nexport class CapgoFilePickerWeb extends WebPlugin implements CapgoFilePickerPlugin {\n async pickFiles(options?: PickFilesOptions): Promise<PickFilesResult> {\n const files = await this.openFilePicker({\n types: options?.types,\n multiple: options?.limit !== 1,\n });\n const pickedFiles: PickedFile[] = [];\n for (const file of files) {\n const pickedFile: PickedFile = {\n name: file.name,\n mimeType: file.type || 'application/octet-stream',\n size: file.size,\n blob: file,\n modifiedAt: file.lastModified,\n };\n if (options?.readData) {\n pickedFile.data = await this.getDataFromFile(file);\n }\n if (file.type.startsWith('image/')) {\n const dimensions = await this.getImageDimensions(file);\n pickedFile.width = dimensions.width;\n pickedFile.height = dimensions.height;\n }\n pickedFiles.push(pickedFile);\n }\n return { files: pickedFiles };\n }\n\n async pickImages(options?: PickMediaOptions): Promise<PickFilesResult> {\n return this.pickFiles({\n types: ['image/*'],\n limit: options?.limit,\n readData: options?.readData,\n });\n }\n\n async pickVideos(options?: PickMediaOptions): Promise<PickFilesResult> {\n return this.pickFiles({\n types: ['video/*'],\n limit: options?.limit,\n readData: options?.readData,\n });\n }\n\n async pickMedia(options?: PickMediaOptions): Promise<PickFilesResult> {\n return this.pickFiles({\n types: ['image/*', 'video/*'],\n limit: options?.limit,\n readData: options?.readData,\n });\n }\n\n async pickDirectory(): Promise<PickDirectoryResult> {\n throw this.unimplemented('pickDirectory is not supported on web');\n }\n\n async convertHeicToJpeg(_options: ConvertHeicToJpegOptions): Promise<ConvertHeicToJpegResult> {\n void _options;\n throw this.unimplemented('convertHeicToJpeg is not supported on web');\n }\n\n async copyFile(_options: CopyFileOptions): Promise<void> {\n void _options;\n throw this.unimplemented('copyFile is not supported on web');\n }\n\n async checkPermissions(): Promise<PermissionStatus> {\n return {\n readExternalStorage: 'granted',\n };\n }\n\n async requestPermissions(): Promise<PermissionStatus> {\n return {\n readExternalStorage: 'granted',\n };\n }\n\n async addListener(\n _eventName: 'pickerDismissed',\n _listenerFunc: PickerDismissedListener,\n ): Promise<PluginListenerHandle> {\n void _eventName;\n void _listenerFunc;\n return {\n remove: async () => {\n // No-op on web\n },\n };\n }\n\n async removeAllListeners(): Promise<void> {\n // No-op on web\n }\n\n async getPluginVersion(): Promise<{ version: string }> {\n return { version: 'web' };\n }\n\n private openFilePicker(options: { types?: string[]; multiple?: boolean }): Promise<File[]> {\n return new Promise((resolve) => {\n const input = document.createElement('input');\n input.type = 'file';\n input.multiple = options.multiple ?? true;\n if (options.types && options.types.length > 0) {\n input.accept = options.types.join(',');\n }\n input.style.display = 'none';\n document.body.appendChild(input);\n\n let resolved = false;\n\n const handleChange = () => {\n resolved = true;\n const files = Array.from(input.files || []);\n cleanup();\n resolve(files);\n };\n\n const handleCancel = () => {\n // Small delay to ensure change event fires first if files were selected\n setTimeout(() => {\n if (!resolved) {\n cleanup();\n resolve([]);\n }\n }, 300);\n };\n\n const cleanup = () => {\n input.removeEventListener('change', handleChange);\n window.removeEventListener('focus', handleCancel);\n document.body.removeChild(input);\n };\n\n input.addEventListener('change', handleChange);\n window.addEventListener('focus', handleCancel);\n\n input.click();\n });\n }\n\n private getDataFromFile(file: File): Promise<string> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => {\n const result = reader.result as string;\n // Remove data URL prefix to get pure base64\n const base64 = result.split(',')[1] || '';\n resolve(base64);\n };\n reader.onerror = () => reject(new Error('Failed to read file'));\n reader.readAsDataURL(file);\n });\n }\n\n private getImageDimensions(file: File): Promise<{ width: number; height: number }> {\n return new Promise((resolve) => {\n const img = new Image();\n img.onload = () => {\n URL.revokeObjectURL(img.src);\n resolve({ width: img.width, height: img.height });\n };\n img.onerror = () => {\n URL.revokeObjectURL(img.src);\n resolve({ width: 0, height: 0 });\n };\n img.src = URL.createObjectURL(file);\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CapgoFilePicker = registerPlugin('CapgoFilePicker', {\n web: () => import('./web').then((m) => new m.CapgoFilePickerWeb()),\n});\nexport * from './definitions';\nexport { CapgoFilePicker };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapgoFilePickerWeb extends WebPlugin {\n async pickFiles(options) {\n const files = await this.openFilePicker({\n types: options === null || options === void 0 ? void 0 : options.types,\n multiple: (options === null || options === void 0 ? void 0 : options.limit) !== 1,\n });\n const pickedFiles = [];\n for (const file of files) {\n const pickedFile = {\n name: file.name,\n mimeType: file.type || 'application/octet-stream',\n size: file.size,\n blob: file,\n modifiedAt: file.lastModified,\n };\n if (options === null || options === void 0 ? void 0 : options.readData) {\n pickedFile.data = await this.getDataFromFile(file);\n }\n if (file.type.startsWith('image/')) {\n const dimensions = await this.getImageDimensions(file);\n pickedFile.width = dimensions.width;\n pickedFile.height = dimensions.height;\n }\n pickedFiles.push(pickedFile);\n }\n return { files: pickedFiles };\n }\n async pickImages(options) {\n return this.pickFiles({\n types: ['image/*'],\n limit: options === null || options === void 0 ? void 0 : options.limit,\n readData: options === null || options === void 0 ? void 0 : options.readData,\n });\n }\n async pickVideos(options) {\n return this.pickFiles({\n types: ['video/*'],\n limit: options === null || options === void 0 ? void 0 : options.limit,\n readData: options === null || options === void 0 ? void 0 : options.readData,\n });\n }\n async pickMedia(options) {\n return this.pickFiles({\n types: ['image/*', 'video/*'],\n limit: options === null || options === void 0 ? void 0 : options.limit,\n readData: options === null || options === void 0 ? void 0 : options.readData,\n });\n }\n async pickDirectory() {\n throw this.unimplemented('pickDirectory is not supported on web');\n }\n async convertHeicToJpeg(_options) {\n throw this.unimplemented('convertHeicToJpeg is not supported on web');\n }\n async copyFile(_options) {\n throw this.unimplemented('copyFile is not supported on web');\n }\n async checkPermissions() {\n return {\n readExternalStorage: 'granted',\n };\n }\n async requestPermissions() {\n return {\n readExternalStorage: 'granted',\n };\n }\n async addListener(_eventName, _listenerFunc) {\n return {\n remove: async () => {\n // No-op on web\n },\n };\n }\n async removeAllListeners() {\n // No-op on web\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n openFilePicker(options) {\n return new Promise((resolve) => {\n var _a;\n const input = document.createElement('input');\n input.type = 'file';\n input.multiple = (_a = options.multiple) !== null && _a !== void 0 ? _a : true;\n if (options.types && options.types.length > 0) {\n input.accept = options.types.join(',');\n }\n input.style.display = 'none';\n document.body.appendChild(input);\n let resolved = false;\n const handleChange = () => {\n resolved = true;\n const files = Array.from(input.files || []);\n cleanup();\n resolve(files);\n };\n const handleCancel = () => {\n // Small delay to ensure change event fires first if files were selected\n setTimeout(() => {\n if (!resolved) {\n cleanup();\n resolve([]);\n }\n }, 300);\n };\n const cleanup = () => {\n input.removeEventListener('change', handleChange);\n window.removeEventListener('focus', handleCancel);\n document.body.removeChild(input);\n };\n input.addEventListener('change', handleChange);\n window.addEventListener('focus', handleCancel);\n input.click();\n });\n }\n getDataFromFile(file) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => {\n const result = reader.result;\n // Remove data URL prefix to get pure base64\n const base64 = result.split(',')[1] || '';\n resolve(base64);\n };\n reader.onerror = () => reject(new Error('Failed to read file'));\n reader.readAsDataURL(file);\n });\n }\n getImageDimensions(file) {\n return new Promise((resolve) => {\n const img = new Image();\n img.onload = () => {\n URL.revokeObjectURL(img.src);\n resolve({ width: img.width, height: img.height });\n };\n img.onerror = () => {\n URL.revokeObjectURL(img.src);\n resolve({ width: 0, height: 0 });\n };\n img.src = URL.createObjectURL(file);\n });\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,eAAe,GAAGA,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,CAAC;AAC5C,gBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;AAChD,YAAY,CAAC;AACb,YAAY,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC;AAC/C,QAAQ,CAAC,CAAC;AACV,IAAI;AACJ;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CapgoFilePicker = registerPlugin('CapgoFilePicker', {\n web: () => import('./web').then((m) => new m.CapgoFilePickerWeb()),\n});\nexport * from './definitions';\nexport { CapgoFilePicker };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapgoFilePickerWeb extends WebPlugin {\n async pickFiles(options) {\n const files = await this.openFilePicker({\n types: options === null || options === void 0 ? void 0 : options.types,\n multiple: (options === null || options === void 0 ? void 0 : options.limit) !== 1,\n });\n const pickedFiles = [];\n for (const file of files) {\n const pickedFile = {\n name: file.name,\n mimeType: file.type || 'application/octet-stream',\n size: file.size,\n blob: file,\n modifiedAt: file.lastModified,\n };\n if (options === null || options === void 0 ? void 0 : options.readData) {\n pickedFile.data = await this.getDataFromFile(file);\n }\n if (file.type.startsWith('image/')) {\n const dimensions = await this.getImageDimensions(file);\n pickedFile.width = dimensions.width;\n pickedFile.height = dimensions.height;\n }\n pickedFiles.push(pickedFile);\n }\n return { files: pickedFiles };\n }\n async pickImages(options) {\n return this.pickFiles({\n types: ['image/*'],\n limit: options === null || options === void 0 ? void 0 : options.limit,\n readData: options === null || options === void 0 ? void 0 : options.readData,\n });\n }\n async pickVideos(options) {\n return this.pickFiles({\n types: ['video/*'],\n limit: options === null || options === void 0 ? void 0 : options.limit,\n readData: options === null || options === void 0 ? void 0 : options.readData,\n });\n }\n async pickMedia(options) {\n return this.pickFiles({\n types: ['image/*', 'video/*'],\n limit: options === null || options === void 0 ? void 0 : options.limit,\n readData: options === null || options === void 0 ? void 0 : options.readData,\n });\n }\n async pickDirectory() {\n throw this.unimplemented('pickDirectory is not supported on web');\n }\n async convertHeicToJpeg(_options) {\n void _options;\n throw this.unimplemented('convertHeicToJpeg is not supported on web');\n }\n async copyFile(_options) {\n void _options;\n throw this.unimplemented('copyFile is not supported on web');\n }\n async checkPermissions() {\n return {\n readExternalStorage: 'granted',\n };\n }\n async requestPermissions() {\n return {\n readExternalStorage: 'granted',\n };\n }\n async addListener(_eventName, _listenerFunc) {\n void _eventName;\n void _listenerFunc;\n return {\n remove: async () => {\n // No-op on web\n },\n };\n }\n async removeAllListeners() {\n // No-op on web\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n openFilePicker(options) {\n return new Promise((resolve) => {\n var _a;\n const input = document.createElement('input');\n input.type = 'file';\n input.multiple = (_a = options.multiple) !== null && _a !== void 0 ? _a : true;\n if (options.types && options.types.length > 0) {\n input.accept = options.types.join(',');\n }\n input.style.display = 'none';\n document.body.appendChild(input);\n let resolved = false;\n const handleChange = () => {\n resolved = true;\n const files = Array.from(input.files || []);\n cleanup();\n resolve(files);\n };\n const handleCancel = () => {\n // Small delay to ensure change event fires first if files were selected\n setTimeout(() => {\n if (!resolved) {\n cleanup();\n resolve([]);\n }\n }, 300);\n };\n const cleanup = () => {\n input.removeEventListener('change', handleChange);\n window.removeEventListener('focus', handleCancel);\n document.body.removeChild(input);\n };\n input.addEventListener('change', handleChange);\n window.addEventListener('focus', handleCancel);\n input.click();\n });\n }\n getDataFromFile(file) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => {\n const result = reader.result;\n // Remove data URL prefix to get pure base64\n const base64 = result.split(',')[1] || '';\n resolve(base64);\n };\n reader.onerror = () => reject(new Error('Failed to read file'));\n reader.readAsDataURL(file);\n });\n }\n getImageDimensions(file) {\n return new Promise((resolve) => {\n const img = new Image();\n img.onload = () => {\n URL.revokeObjectURL(img.src);\n resolve({ width: img.width, height: img.height });\n };\n img.onerror = () => {\n URL.revokeObjectURL(img.src);\n resolve({ width: 0, height: 0 });\n };\n img.src = URL.createObjectURL(file);\n });\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,eAAe,GAAGA,mBAAc,CAAC,iBAAiB,EAAE;AAC1D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,kBAAkB,EAAE,CAAC;AACtE,CAAC;;ACFM,MAAM,kBAAkB,SAASC,cAAS,CAAC;AAClD,IAAI,MAAM,SAAS,CAAC,OAAO,EAAE;AAC7B,QAAQ,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC;AAChD,YAAY,KAAK,EAAE,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,KAAK;AAClF,YAAY,QAAQ,EAAE,CAAC,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,KAAK,MAAM,CAAC;AAC7F,SAAS,CAAC;AACV,QAAQ,MAAM,WAAW,GAAG,EAAE;AAC9B,QAAQ,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;AAClC,YAAY,MAAM,UAAU,GAAG;AAC/B,gBAAgB,IAAI,EAAE,IAAI,CAAC,IAAI;AAC/B,gBAAgB,QAAQ,EAAE,IAAI,CAAC,IAAI,IAAI,0BAA0B;AACjE,gBAAgB,IAAI,EAAE,IAAI,CAAC,IAAI;AAC/B,gBAAgB,IAAI,EAAE,IAAI;AAC1B,gBAAgB,UAAU,EAAE,IAAI,CAAC,YAAY;AAC7C,aAAa;AACb,YAAY,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE;AACpF,gBAAgB,UAAU,CAAC,IAAI,GAAG,MAAM,IAAI,C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AAG,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC;AACjE,YAAY,CAAC;AACb,YAAY,GAAG,CAAC,OAAO,GAAG,MAAM;AAChC,gBAAgB,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC;AAC5C,gBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;AAChD,YAAY,CAAC;AACb,YAAY,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC;AAC/C,QAAQ,CAAC,CAAC;AACV,IAAI;AACJ;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CapgoFilePicker = registerPlugin('CapgoFilePicker', {\n web: () => import('./web').then((m) => new m.CapgoFilePickerWeb()),\n});\nexport * from './definitions';\nexport { CapgoFilePicker };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapgoFilePickerWeb extends WebPlugin {\n async pickFiles(options) {\n const files = await this.openFilePicker({\n types: options === null || options === void 0 ? void 0 : options.types,\n multiple: (options === null || options === void 0 ? void 0 : options.limit) !== 1,\n });\n const pickedFiles = [];\n for (const file of files) {\n const pickedFile = {\n name: file.name,\n mimeType: file.type || 'application/octet-stream',\n size: file.size,\n blob: file,\n modifiedAt: file.lastModified,\n };\n if (options === null || options === void 0 ? void 0 : options.readData) {\n pickedFile.data = await this.getDataFromFile(file);\n }\n if (file.type.startsWith('image/')) {\n const dimensions = await this.getImageDimensions(file);\n pickedFile.width = dimensions.width;\n pickedFile.height = dimensions.height;\n }\n pickedFiles.push(pickedFile);\n }\n return { files: pickedFiles };\n }\n async pickImages(options) {\n return this.pickFiles({\n types: ['image/*'],\n limit: options === null || options === void 0 ? void 0 : options.limit,\n readData: options === null || options === void 0 ? void 0 : options.readData,\n });\n }\n async pickVideos(options) {\n return this.pickFiles({\n types: ['video/*'],\n limit: options === null || options === void 0 ? void 0 : options.limit,\n readData: options === null || options === void 0 ? void 0 : options.readData,\n });\n }\n async pickMedia(options) {\n return this.pickFiles({\n types: ['image/*', 'video/*'],\n limit: options === null || options === void 0 ? void 0 : options.limit,\n readData: options === null || options === void 0 ? void 0 : options.readData,\n });\n }\n async pickDirectory() {\n throw this.unimplemented('pickDirectory is not supported on web');\n }\n async convertHeicToJpeg(_options) {\n throw this.unimplemented('convertHeicToJpeg is not supported on web');\n }\n async copyFile(_options) {\n throw this.unimplemented('copyFile is not supported on web');\n }\n async checkPermissions() {\n return {\n readExternalStorage: 'granted',\n };\n }\n async requestPermissions() {\n return {\n readExternalStorage: 'granted',\n };\n }\n async addListener(_eventName, _listenerFunc) {\n return {\n remove: async () => {\n // No-op on web\n },\n };\n }\n async removeAllListeners() {\n // No-op on web\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n openFilePicker(options) {\n return new Promise((resolve) => {\n var _a;\n const input = document.createElement('input');\n input.type = 'file';\n input.multiple = (_a = options.multiple) !== null && _a !== void 0 ? _a : true;\n if (options.types && options.types.length > 0) {\n input.accept = options.types.join(',');\n }\n input.style.display = 'none';\n document.body.appendChild(input);\n let resolved = false;\n const handleChange = () => {\n resolved = true;\n const files = Array.from(input.files || []);\n cleanup();\n resolve(files);\n };\n const handleCancel = () => {\n // Small delay to ensure change event fires first if files were selected\n setTimeout(() => {\n if (!resolved) {\n cleanup();\n resolve([]);\n }\n }, 300);\n };\n const cleanup = () => {\n input.removeEventListener('change', handleChange);\n window.removeEventListener('focus', handleCancel);\n document.body.removeChild(input);\n };\n input.addEventListener('change', handleChange);\n window.addEventListener('focus', handleCancel);\n input.click();\n });\n }\n getDataFromFile(file) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => {\n const result = reader.result;\n // Remove data URL prefix to get pure base64\n const base64 = result.split(',')[1] || '';\n resolve(base64);\n };\n reader.onerror = () => reject(new Error('Failed to read file'));\n reader.readAsDataURL(file);\n });\n }\n getImageDimensions(file) {\n return new Promise((resolve) => {\n const img = new Image();\n img.onload = () => {\n URL.revokeObjectURL(img.src);\n resolve({ width: img.width, height: img.height });\n };\n img.onerror = () => {\n URL.revokeObjectURL(img.src);\n resolve({ width: 0, height: 0 });\n };\n img.src = URL.createObjectURL(file);\n });\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,eAAe,GAAGA,mBAAc,CAAC,iBAAiB,EAAE;IAC1D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,kBAAkB,EAAE,CAAC;IACtE,CAAC;;ICFM,MAAM,kBAAkB,SAASC,cAAS,CAAC;IAClD,IAAI,MAAM,SAAS,CAAC,OAAO,EAAE;IAC7B,QAAQ,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC;IAChD,YAAY,KAAK,EAAE,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,KAAK;IAClF,YAAY,QAAQ,EAAE,CAAC,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,KAAK,MAAM,CAAC;IAC7F,SAAS,CAAC;IACV,QAAQ,MAAM,WAAW,GAAG,EAAE;IAC9B,QAAQ,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;IAClC,YAAY,MAAM,UAAU,GAAG;IAC/B,gBAAgB,IAAI,EAAE,IAAI,CAAC,IAAI;IAC/B,gBAAgB,QAAQ,EAAE,IAAI,CAAC,IAAI,IAAI,0BAA0B;IACjE,gBAAgB,IAAI,EAAE,IAAI,CAAC,IAAI;IAC/B,gBAAgB,IAAI,EAAE,IAAI;IAC1B,gBAAgB,UAAU,EAAE,IAAI,CAAC,YAAY;IAC7C,aAAa;IACb,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YAAY,GAAG,CAAC,MAAM,GAAG,MAAM;IAC/B,gBAAgB,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC;IAC5C,gBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC;IACjE,YAAY,CAAC;IACb,YAAY,GAAG,CAAC,OAAO,GAAG,MAAM;IAChC,gBAAgB,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC;IAC5C,gBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAChD,YAAY,CAAC;IACb,YAAY,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC;IAC/C,QAAQ,CAAC,CAAC;IACV,IAAI;IACJ;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CapgoFilePicker = registerPlugin('CapgoFilePicker', {\n web: () => import('./web').then((m) => new m.CapgoFilePickerWeb()),\n});\nexport * from './definitions';\nexport { CapgoFilePicker };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapgoFilePickerWeb extends WebPlugin {\n async pickFiles(options) {\n const files = await this.openFilePicker({\n types: options === null || options === void 0 ? void 0 : options.types,\n multiple: (options === null || options === void 0 ? void 0 : options.limit) !== 1,\n });\n const pickedFiles = [];\n for (const file of files) {\n const pickedFile = {\n name: file.name,\n mimeType: file.type || 'application/octet-stream',\n size: file.size,\n blob: file,\n modifiedAt: file.lastModified,\n };\n if (options === null || options === void 0 ? void 0 : options.readData) {\n pickedFile.data = await this.getDataFromFile(file);\n }\n if (file.type.startsWith('image/')) {\n const dimensions = await this.getImageDimensions(file);\n pickedFile.width = dimensions.width;\n pickedFile.height = dimensions.height;\n }\n pickedFiles.push(pickedFile);\n }\n return { files: pickedFiles };\n }\n async pickImages(options) {\n return this.pickFiles({\n types: ['image/*'],\n limit: options === null || options === void 0 ? void 0 : options.limit,\n readData: options === null || options === void 0 ? void 0 : options.readData,\n });\n }\n async pickVideos(options) {\n return this.pickFiles({\n types: ['video/*'],\n limit: options === null || options === void 0 ? void 0 : options.limit,\n readData: options === null || options === void 0 ? void 0 : options.readData,\n });\n }\n async pickMedia(options) {\n return this.pickFiles({\n types: ['image/*', 'video/*'],\n limit: options === null || options === void 0 ? void 0 : options.limit,\n readData: options === null || options === void 0 ? void 0 : options.readData,\n });\n }\n async pickDirectory() {\n throw this.unimplemented('pickDirectory is not supported on web');\n }\n async convertHeicToJpeg(_options) {\n void _options;\n throw this.unimplemented('convertHeicToJpeg is not supported on web');\n }\n async copyFile(_options) {\n void _options;\n throw this.unimplemented('copyFile is not supported on web');\n }\n async checkPermissions() {\n return {\n readExternalStorage: 'granted',\n };\n }\n async requestPermissions() {\n return {\n readExternalStorage: 'granted',\n };\n }\n async addListener(_eventName, _listenerFunc) {\n void _eventName;\n void _listenerFunc;\n return {\n remove: async () => {\n // No-op on web\n },\n };\n }\n async removeAllListeners() {\n // No-op on web\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n openFilePicker(options) {\n return new Promise((resolve) => {\n var _a;\n const input = document.createElement('input');\n input.type = 'file';\n input.multiple = (_a = options.multiple) !== null && _a !== void 0 ? _a : true;\n if (options.types && options.types.length > 0) {\n input.accept = options.types.join(',');\n }\n input.style.display = 'none';\n document.body.appendChild(input);\n let resolved = false;\n const handleChange = () => {\n resolved = true;\n const files = Array.from(input.files || []);\n cleanup();\n resolve(files);\n };\n const handleCancel = () => {\n // Small delay to ensure change event fires first if files were selected\n setTimeout(() => {\n if (!resolved) {\n cleanup();\n resolve([]);\n }\n }, 300);\n };\n const cleanup = () => {\n input.removeEventListener('change', handleChange);\n window.removeEventListener('focus', handleCancel);\n document.body.removeChild(input);\n };\n input.addEventListener('change', handleChange);\n window.addEventListener('focus', handleCancel);\n input.click();\n });\n }\n getDataFromFile(file) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => {\n const result = reader.result;\n // Remove data URL prefix to get pure base64\n const base64 = result.split(',')[1] || '';\n resolve(base64);\n };\n reader.onerror = () => reject(new Error('Failed to read file'));\n reader.readAsDataURL(file);\n });\n }\n getImageDimensions(file) {\n return new Promise((resolve) => {\n const img = new Image();\n img.onload = () => {\n URL.revokeObjectURL(img.src);\n resolve({ width: img.width, height: img.height });\n };\n img.onerror = () => {\n URL.revokeObjectURL(img.src);\n resolve({ width: 0, height: 0 });\n };\n img.src = URL.createObjectURL(file);\n });\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,eAAe,GAAGA,mBAAc,CAAC,iBAAiB,EAAE;IAC1D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,kBAAkB,EAAE,CAAC;IACtE,CAAC;;ICFM,MAAM,kBAAkB,SAASC,cAAS,CAAC;IAClD,IAAI,MAAM,SAAS,CAAC,OAAO,EAAE;IAC7B,QAAQ,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC;IAChD,YAAY,KAAK,EAAE,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,KAAK;IAClF,YAAY,QAAQ,EAAE,CAAC,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,KAAK,MAAM,CAAC;IAC7F,SAAS,CAAC;IACV,QAAQ,MAAM,WAAW,GAAG,EAAE;IAC9B,QAAQ,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;IAClC,YAAY,MAAM,UAAU,GAAG;IAC/B,gBAAgB,IAAI,EAAE,IAAI,CAAC,IAAI;IAC/B,gBAAgB,QAAQ,EA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,QAAQ,CAAC,CAAC;IACV,IAAI;IACJ,IAAI,kBAAkB,CAAC,IAAI,EAAE;IAC7B,QAAQ,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK;IACxC,YAAY,MAAM,GAAG,GAAG,IAAI,KAAK,EAAE;IACnC,YAAY,GAAG,CAAC,MAAM,GAAG,MAAM;IAC/B,gBAAgB,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC;IAC5C,gBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC;IACjE,YAAY,CAAC;IACb,YAAY,GAAG,CAAC,OAAO,GAAG,MAAM;IAChC,gBAAgB,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC;IAC5C,gBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAChD,YAAY,CAAC;IACb,YAAY,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC;IAC/C,QAAQ,CAAC,CAAC;IACV,IAAI;IACJ;;;;;;;;;;;;;;;"}
@@ -11,7 +11,7 @@ import UniformTypeIdentifiers
11
11
  */
12
12
  @objc(CapgoFilePickerPlugin)
13
13
  public class CapgoFilePickerPlugin: CAPPlugin, CAPBridgedPlugin {
14
- private let pluginVersion: String = "8.0.0"
14
+ private let pluginVersion: String = "8.1.0"
15
15
  public let identifier = "CapgoFilePickerPlugin"
16
16
  public let jsName = "CapgoFilePicker"
17
17
  public let pluginMethods: [CAPPluginMethod] = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-file-picker",
3
- "version": "8.0.0",
3
+ "version": "8.1.0",
4
4
  "description": "File picker Capacitor plugin - Pick files, images, videos, and directories",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -24,6 +24,7 @@
24
24
  "bugs": {
25
25
  "url": "https://github.com/Cap-go/capacitor-file-picker/issues"
26
26
  },
27
+ "homepage": "https://capgo.app/docs/plugins/file-picker/",
27
28
  "keywords": [
28
29
  "capacitor",
29
30
  "plugin",
@@ -43,7 +44,7 @@
43
44
  "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
44
45
  "fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
45
46
  "eslint": "eslint . --ext ts",
46
- "prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
47
+ "prettier": "prettier-pretty-check \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
47
48
  "swiftlint": "node-swiftlint",
48
49
  "docgen": "docgen --api CapgoFilePickerPlugin --output-readme README.md --output-json dist/docs.json",
49
50
  "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
@@ -67,7 +68,8 @@
67
68
  "rimraf": "^6.1.0",
68
69
  "rollup": "^4.53.2",
69
70
  "swiftlint": "^2.0.0",
70
- "typescript": "^5.9.3"
71
+ "typescript": "^5.9.3",
72
+ "prettier-pretty-check": "^0.2.0"
71
73
  },
72
74
  "peerDependencies": {
73
75
  "@capacitor/core": ">=8.0.0"