img-upload-kit 0.0.0-stage → 1.1.1
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/CHANGELOG.md +74 -0
- package/LICENSE +21 -0
- package/README.md +258 -2
- package/dist/blur.cjs +413 -0
- package/dist/blur.cjs.map +1 -0
- package/dist/blur.d.cts +17 -0
- package/dist/blur.d.ts +17 -0
- package/dist/blur.js +395 -0
- package/dist/blur.js.map +1 -0
- package/dist/blurService-DqsnfPTd.d.cts +172 -0
- package/dist/blurService-DqsnfPTd.d.ts +172 -0
- package/dist/cli.cjs +1044 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.d.cts +99 -0
- package/dist/cli.d.ts +99 -0
- package/dist/cli.js +998 -0
- package/dist/cli.js.map +1 -0
- package/dist/headless.cjs +1899 -0
- package/dist/headless.cjs.map +1 -0
- package/dist/headless.d.cts +2 -0
- package/dist/headless.d.ts +2 -0
- package/dist/headless.js +1888 -0
- package/dist/headless.js.map +1 -0
- package/dist/index-FVXXKf2v.d.cts +712 -0
- package/dist/index-FVXXKf2v.d.ts +712 -0
- package/dist/index.cjs +533 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +40 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +506 -0
- package/dist/index.js.map +1 -0
- package/dist/memoryAdapter-BJjyLR-1.d.cts +24 -0
- package/dist/memoryAdapter-CBu7_3Pp.d.ts +24 -0
- package/dist/react.cjs +5084 -0
- package/dist/react.cjs.map +1 -0
- package/dist/react.d.cts +338 -0
- package/dist/react.d.ts +338 -0
- package/dist/react.js +5029 -0
- package/dist/react.js.map +1 -0
- package/dist/server.cjs +1237 -0
- package/dist/server.cjs.map +1 -0
- package/dist/server.d.cts +219 -0
- package/dist/server.d.ts +219 -0
- package/dist/server.js +1199 -0
- package/dist/server.js.map +1 -0
- package/dist/storage.cjs +440 -0
- package/dist/storage.cjs.map +1 -0
- package/dist/storage.d.cts +147 -0
- package/dist/storage.d.ts +147 -0
- package/dist/storage.js +427 -0
- package/dist/storage.js.map +1 -0
- package/dist/styles.css +1107 -0
- package/dist/types-CiLY0DwB.d.cts +180 -0
- package/dist/types-CiLY0DwB.d.ts +180 -0
- package/package.json +138 -4
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
type UploadLocale = 'en' | 'ar';
|
|
2
|
+
type ImageOutputFormat = 'avif' | 'webp' | 'jpeg' | 'png' | 'svg';
|
|
3
|
+
type ExplicitOutputFormat = 'avif' | 'webp' | 'jpeg' | 'png';
|
|
4
|
+
type QualityLevel = 'low' | 'medium' | 'high' | 'maximum';
|
|
5
|
+
interface QualityPreset {
|
|
6
|
+
label: string;
|
|
7
|
+
labelAr: string;
|
|
8
|
+
value: number;
|
|
9
|
+
description: string;
|
|
10
|
+
descriptionAr: string;
|
|
11
|
+
/** Rough fraction of original bytes after modern AVIF/WebP compression */
|
|
12
|
+
compressionRatio: number;
|
|
13
|
+
}
|
|
14
|
+
declare const QUALITY_PRESETS: Record<QualityLevel, QualityPreset>;
|
|
15
|
+
interface ImageDimensions {
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Universal visual role presets (project-agnostic).
|
|
22
|
+
* Consumers can define their own presets via `defineUploadPresets` / `createImageUploader({ presets })`
|
|
23
|
+
* or augment `UploadKitRegister` for global type-safety.
|
|
24
|
+
*/
|
|
25
|
+
type StandardPresetName = 'thumbnail' | 'avatar' | 'card' | 'cover' | 'hero' | 'logo' | 'original';
|
|
26
|
+
/**
|
|
27
|
+
* Module augmentation hook for global preset autocomplete across a project:
|
|
28
|
+
* ```ts
|
|
29
|
+
* declare module 'img-upload-kit' {
|
|
30
|
+
* interface UploadKitRegister {
|
|
31
|
+
* presets: 'product-main' | 'product-thumb' | 'user-avatar';
|
|
32
|
+
* }
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
interface UploadKitRegister {
|
|
37
|
+
}
|
|
38
|
+
type UploadPresetName = UploadKitRegister extends {
|
|
39
|
+
presets: infer TCustom extends string;
|
|
40
|
+
} ? TCustom : StandardPresetName | (string & {});
|
|
41
|
+
interface UploadPresetConfig {
|
|
42
|
+
/** Target storage bucket for this preset */
|
|
43
|
+
bucket?: string;
|
|
44
|
+
/** Default folder prefix within the bucket (e.g. 'avatars' or 'products/thumbnails') */
|
|
45
|
+
folder?: string;
|
|
46
|
+
/** Maximum bounding box dimensions (aspect ratio preserved, never enlarged) */
|
|
47
|
+
maxDimensions?: ImageDimensions;
|
|
48
|
+
/** Maximum allowed source file size in MB */
|
|
49
|
+
maxSizeMB?: number;
|
|
50
|
+
/** Allowed source MIME types */
|
|
51
|
+
allowedFormats?: string[];
|
|
52
|
+
/** Force a specific output format; omit for smart size-guarded AVIF/WebP optimization */
|
|
53
|
+
outputFormat?: ExplicitOutputFormat;
|
|
54
|
+
/** Default compression quality (1–100) */
|
|
55
|
+
quality?: number;
|
|
56
|
+
/** Recommended UI quality tab for React `<QualitySelector />` */
|
|
57
|
+
recommendedQualityLevel?: QualityLevel;
|
|
58
|
+
/** Optional guidance note shown in `<QualitySelector />` */
|
|
59
|
+
recommendationNote?: {
|
|
60
|
+
en: string;
|
|
61
|
+
ar?: string;
|
|
62
|
+
};
|
|
63
|
+
/** Generate compact BlurHash string alongside WebP LQIP data URL */
|
|
64
|
+
includeBlurHash?: boolean;
|
|
65
|
+
/** Optional local directory to mirror uploaded files into */
|
|
66
|
+
mirrorDir?: string;
|
|
67
|
+
/** Optional public URL prefix when `mirrorDir` is used */
|
|
68
|
+
publicUrlBase?: string;
|
|
69
|
+
}
|
|
70
|
+
declare const DEFAULT_ALLOWED_FORMATS: string[];
|
|
71
|
+
declare const RASTER_ALLOWED_FORMATS: string[];
|
|
72
|
+
declare const DEFAULT_IMAGE_DIMENSIONS: ImageDimensions;
|
|
73
|
+
declare const STANDARD_PRESETS: Record<StandardPresetName, UploadPresetConfig>;
|
|
74
|
+
/**
|
|
75
|
+
* Type-safe helper to define project-specific upload presets with full key inference.
|
|
76
|
+
*/
|
|
77
|
+
declare function defineUploadPresets<T extends Record<string, UploadPresetConfig>>(presets: T): T;
|
|
78
|
+
|
|
79
|
+
interface ImageUploadOptions<TPreset extends string = UploadPresetName> {
|
|
80
|
+
/** Optional preset key (e.g. 'avatar', 'hero', or a custom project preset) */
|
|
81
|
+
preset?: TPreset;
|
|
82
|
+
/** Target storage bucket (overrides preset & uploader defaultBucket) */
|
|
83
|
+
bucket?: string;
|
|
84
|
+
/** Target folder path inside the bucket (e.g. 'products/shoes' or 'users/42') */
|
|
85
|
+
folder?: string;
|
|
86
|
+
/** Maximum bounding box dimensions (overrides preset maxDimensions) */
|
|
87
|
+
maxDimensions?: ImageDimensions;
|
|
88
|
+
/** Maximum allowed input size in MB */
|
|
89
|
+
maxSizeMB?: number;
|
|
90
|
+
/** Allowed MIME types */
|
|
91
|
+
allowedFormats?: string[];
|
|
92
|
+
/** Explicit output format; omit for smart size-guarded AVIF/WebP selection */
|
|
93
|
+
outputFormat?: ExplicitOutputFormat;
|
|
94
|
+
/** 1–100 compression quality */
|
|
95
|
+
quality?: number;
|
|
96
|
+
/** Optional custom filename (automatically sanitized) */
|
|
97
|
+
customFilename?: string;
|
|
98
|
+
/** Alt text description for accessibility & SEO */
|
|
99
|
+
altText?: string;
|
|
100
|
+
/** Arbitrary project-specific context/metadata (e.g. { entityId: '42', scope: 'catalog' }) */
|
|
101
|
+
metadata?: Record<string, string>;
|
|
102
|
+
/** Generate compact BlurHash string alongside WebP LQIP data URL */
|
|
103
|
+
includeBlurHash?: boolean;
|
|
104
|
+
}
|
|
105
|
+
interface UploadedImageData {
|
|
106
|
+
url: string;
|
|
107
|
+
blurDataUrl: string;
|
|
108
|
+
blurColor: string;
|
|
109
|
+
blurHash?: string;
|
|
110
|
+
altText?: string;
|
|
111
|
+
width: number;
|
|
112
|
+
height: number;
|
|
113
|
+
format: ImageOutputFormat;
|
|
114
|
+
size: number;
|
|
115
|
+
originalSize?: number;
|
|
116
|
+
contentHash: string;
|
|
117
|
+
storagePath?: string;
|
|
118
|
+
bucket?: string;
|
|
119
|
+
preset?: string;
|
|
120
|
+
folder?: string;
|
|
121
|
+
metadata?: Record<string, string>;
|
|
122
|
+
uploadedAt: string;
|
|
123
|
+
}
|
|
124
|
+
interface ImageUploadRecord extends UploadedImageData {
|
|
125
|
+
quality: number;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
interface StorageUploadParams {
|
|
129
|
+
bucket: string;
|
|
130
|
+
path: string;
|
|
131
|
+
data: Buffer | Uint8Array;
|
|
132
|
+
contentType: string;
|
|
133
|
+
upsert?: boolean;
|
|
134
|
+
cacheControl?: string;
|
|
135
|
+
contentHash?: string;
|
|
136
|
+
metadata?: Record<string, string>;
|
|
137
|
+
}
|
|
138
|
+
interface StorageUploadResult {
|
|
139
|
+
bucket: string;
|
|
140
|
+
path: string;
|
|
141
|
+
url: string;
|
|
142
|
+
}
|
|
143
|
+
interface StorageFileEntry {
|
|
144
|
+
name: string;
|
|
145
|
+
id?: string;
|
|
146
|
+
createdAt?: string;
|
|
147
|
+
size?: number;
|
|
148
|
+
}
|
|
149
|
+
type StorageUploadOptions = StorageUploadParams;
|
|
150
|
+
type StorageFileMetadata = StorageFileEntry;
|
|
151
|
+
type StorageListResult = StorageFileEntry[];
|
|
152
|
+
interface StorageAdapter {
|
|
153
|
+
/**
|
|
154
|
+
* Upload optimized image bytes to your storage backend and return its public URL.
|
|
155
|
+
*/
|
|
156
|
+
upload(params: StorageUploadParams): Promise<StorageUploadResult>;
|
|
157
|
+
/**
|
|
158
|
+
* Delete an image from your storage backend by bucket and relative path.
|
|
159
|
+
*/
|
|
160
|
+
delete(bucket: string, path: string): Promise<void>;
|
|
161
|
+
/**
|
|
162
|
+
* Optional: Resolve a public URL for a bucket and path.
|
|
163
|
+
*/
|
|
164
|
+
getPublicUrl?(bucket: string, path: string): string | Promise<string>;
|
|
165
|
+
/**
|
|
166
|
+
* Optional: List files inside a bucket/folder.
|
|
167
|
+
*/
|
|
168
|
+
list?(bucket: string, folder?: string): Promise<StorageFileEntry[]>;
|
|
169
|
+
/**
|
|
170
|
+
* Optional: Delete an asset directly from its public URL.
|
|
171
|
+
*/
|
|
172
|
+
deleteByUrl?(url: string): Promise<boolean>;
|
|
173
|
+
}
|
|
174
|
+
type UploadRecordHook = (record: ImageUploadRecord) => void | Promise<void>;
|
|
175
|
+
/**
|
|
176
|
+
* Type-safe helper for authoring a custom StorageAdapter (S3, R2, Vercel Blob, Firebase, etc.).
|
|
177
|
+
*/
|
|
178
|
+
declare function createStorageAdapter(adapter: StorageAdapter): StorageAdapter;
|
|
179
|
+
|
|
180
|
+
export { DEFAULT_ALLOWED_FORMATS as D, type ExplicitOutputFormat as E, type ImageDimensions as I, type QualityLevel as Q, RASTER_ALLOWED_FORMATS as R, STANDARD_PRESETS as S, type UploadLocale as U, DEFAULT_IMAGE_DIMENSIONS as a, type ImageOutputFormat as b, type ImageUploadOptions as c, type ImageUploadRecord as d, QUALITY_PRESETS as e, type QualityPreset as f, type StandardPresetName as g, type StorageAdapter as h, type StorageFileEntry as i, type StorageFileMetadata as j, type StorageListResult as k, type StorageUploadOptions as l, type StorageUploadParams as m, type StorageUploadResult as n, type UploadKitRegister as o, type UploadPresetConfig as p, type UploadPresetName as q, type UploadedImageData as r, defineUploadPresets as s, type UploadRecordHook as t, createStorageAdapter as u };
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
type UploadLocale = 'en' | 'ar';
|
|
2
|
+
type ImageOutputFormat = 'avif' | 'webp' | 'jpeg' | 'png' | 'svg';
|
|
3
|
+
type ExplicitOutputFormat = 'avif' | 'webp' | 'jpeg' | 'png';
|
|
4
|
+
type QualityLevel = 'low' | 'medium' | 'high' | 'maximum';
|
|
5
|
+
interface QualityPreset {
|
|
6
|
+
label: string;
|
|
7
|
+
labelAr: string;
|
|
8
|
+
value: number;
|
|
9
|
+
description: string;
|
|
10
|
+
descriptionAr: string;
|
|
11
|
+
/** Rough fraction of original bytes after modern AVIF/WebP compression */
|
|
12
|
+
compressionRatio: number;
|
|
13
|
+
}
|
|
14
|
+
declare const QUALITY_PRESETS: Record<QualityLevel, QualityPreset>;
|
|
15
|
+
interface ImageDimensions {
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Universal visual role presets (project-agnostic).
|
|
22
|
+
* Consumers can define their own presets via `defineUploadPresets` / `createImageUploader({ presets })`
|
|
23
|
+
* or augment `UploadKitRegister` for global type-safety.
|
|
24
|
+
*/
|
|
25
|
+
type StandardPresetName = 'thumbnail' | 'avatar' | 'card' | 'cover' | 'hero' | 'logo' | 'original';
|
|
26
|
+
/**
|
|
27
|
+
* Module augmentation hook for global preset autocomplete across a project:
|
|
28
|
+
* ```ts
|
|
29
|
+
* declare module 'img-upload-kit' {
|
|
30
|
+
* interface UploadKitRegister {
|
|
31
|
+
* presets: 'product-main' | 'product-thumb' | 'user-avatar';
|
|
32
|
+
* }
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
interface UploadKitRegister {
|
|
37
|
+
}
|
|
38
|
+
type UploadPresetName = UploadKitRegister extends {
|
|
39
|
+
presets: infer TCustom extends string;
|
|
40
|
+
} ? TCustom : StandardPresetName | (string & {});
|
|
41
|
+
interface UploadPresetConfig {
|
|
42
|
+
/** Target storage bucket for this preset */
|
|
43
|
+
bucket?: string;
|
|
44
|
+
/** Default folder prefix within the bucket (e.g. 'avatars' or 'products/thumbnails') */
|
|
45
|
+
folder?: string;
|
|
46
|
+
/** Maximum bounding box dimensions (aspect ratio preserved, never enlarged) */
|
|
47
|
+
maxDimensions?: ImageDimensions;
|
|
48
|
+
/** Maximum allowed source file size in MB */
|
|
49
|
+
maxSizeMB?: number;
|
|
50
|
+
/** Allowed source MIME types */
|
|
51
|
+
allowedFormats?: string[];
|
|
52
|
+
/** Force a specific output format; omit for smart size-guarded AVIF/WebP optimization */
|
|
53
|
+
outputFormat?: ExplicitOutputFormat;
|
|
54
|
+
/** Default compression quality (1–100) */
|
|
55
|
+
quality?: number;
|
|
56
|
+
/** Recommended UI quality tab for React `<QualitySelector />` */
|
|
57
|
+
recommendedQualityLevel?: QualityLevel;
|
|
58
|
+
/** Optional guidance note shown in `<QualitySelector />` */
|
|
59
|
+
recommendationNote?: {
|
|
60
|
+
en: string;
|
|
61
|
+
ar?: string;
|
|
62
|
+
};
|
|
63
|
+
/** Generate compact BlurHash string alongside WebP LQIP data URL */
|
|
64
|
+
includeBlurHash?: boolean;
|
|
65
|
+
/** Optional local directory to mirror uploaded files into */
|
|
66
|
+
mirrorDir?: string;
|
|
67
|
+
/** Optional public URL prefix when `mirrorDir` is used */
|
|
68
|
+
publicUrlBase?: string;
|
|
69
|
+
}
|
|
70
|
+
declare const DEFAULT_ALLOWED_FORMATS: string[];
|
|
71
|
+
declare const RASTER_ALLOWED_FORMATS: string[];
|
|
72
|
+
declare const DEFAULT_IMAGE_DIMENSIONS: ImageDimensions;
|
|
73
|
+
declare const STANDARD_PRESETS: Record<StandardPresetName, UploadPresetConfig>;
|
|
74
|
+
/**
|
|
75
|
+
* Type-safe helper to define project-specific upload presets with full key inference.
|
|
76
|
+
*/
|
|
77
|
+
declare function defineUploadPresets<T extends Record<string, UploadPresetConfig>>(presets: T): T;
|
|
78
|
+
|
|
79
|
+
interface ImageUploadOptions<TPreset extends string = UploadPresetName> {
|
|
80
|
+
/** Optional preset key (e.g. 'avatar', 'hero', or a custom project preset) */
|
|
81
|
+
preset?: TPreset;
|
|
82
|
+
/** Target storage bucket (overrides preset & uploader defaultBucket) */
|
|
83
|
+
bucket?: string;
|
|
84
|
+
/** Target folder path inside the bucket (e.g. 'products/shoes' or 'users/42') */
|
|
85
|
+
folder?: string;
|
|
86
|
+
/** Maximum bounding box dimensions (overrides preset maxDimensions) */
|
|
87
|
+
maxDimensions?: ImageDimensions;
|
|
88
|
+
/** Maximum allowed input size in MB */
|
|
89
|
+
maxSizeMB?: number;
|
|
90
|
+
/** Allowed MIME types */
|
|
91
|
+
allowedFormats?: string[];
|
|
92
|
+
/** Explicit output format; omit for smart size-guarded AVIF/WebP selection */
|
|
93
|
+
outputFormat?: ExplicitOutputFormat;
|
|
94
|
+
/** 1–100 compression quality */
|
|
95
|
+
quality?: number;
|
|
96
|
+
/** Optional custom filename (automatically sanitized) */
|
|
97
|
+
customFilename?: string;
|
|
98
|
+
/** Alt text description for accessibility & SEO */
|
|
99
|
+
altText?: string;
|
|
100
|
+
/** Arbitrary project-specific context/metadata (e.g. { entityId: '42', scope: 'catalog' }) */
|
|
101
|
+
metadata?: Record<string, string>;
|
|
102
|
+
/** Generate compact BlurHash string alongside WebP LQIP data URL */
|
|
103
|
+
includeBlurHash?: boolean;
|
|
104
|
+
}
|
|
105
|
+
interface UploadedImageData {
|
|
106
|
+
url: string;
|
|
107
|
+
blurDataUrl: string;
|
|
108
|
+
blurColor: string;
|
|
109
|
+
blurHash?: string;
|
|
110
|
+
altText?: string;
|
|
111
|
+
width: number;
|
|
112
|
+
height: number;
|
|
113
|
+
format: ImageOutputFormat;
|
|
114
|
+
size: number;
|
|
115
|
+
originalSize?: number;
|
|
116
|
+
contentHash: string;
|
|
117
|
+
storagePath?: string;
|
|
118
|
+
bucket?: string;
|
|
119
|
+
preset?: string;
|
|
120
|
+
folder?: string;
|
|
121
|
+
metadata?: Record<string, string>;
|
|
122
|
+
uploadedAt: string;
|
|
123
|
+
}
|
|
124
|
+
interface ImageUploadRecord extends UploadedImageData {
|
|
125
|
+
quality: number;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
interface StorageUploadParams {
|
|
129
|
+
bucket: string;
|
|
130
|
+
path: string;
|
|
131
|
+
data: Buffer | Uint8Array;
|
|
132
|
+
contentType: string;
|
|
133
|
+
upsert?: boolean;
|
|
134
|
+
cacheControl?: string;
|
|
135
|
+
contentHash?: string;
|
|
136
|
+
metadata?: Record<string, string>;
|
|
137
|
+
}
|
|
138
|
+
interface StorageUploadResult {
|
|
139
|
+
bucket: string;
|
|
140
|
+
path: string;
|
|
141
|
+
url: string;
|
|
142
|
+
}
|
|
143
|
+
interface StorageFileEntry {
|
|
144
|
+
name: string;
|
|
145
|
+
id?: string;
|
|
146
|
+
createdAt?: string;
|
|
147
|
+
size?: number;
|
|
148
|
+
}
|
|
149
|
+
type StorageUploadOptions = StorageUploadParams;
|
|
150
|
+
type StorageFileMetadata = StorageFileEntry;
|
|
151
|
+
type StorageListResult = StorageFileEntry[];
|
|
152
|
+
interface StorageAdapter {
|
|
153
|
+
/**
|
|
154
|
+
* Upload optimized image bytes to your storage backend and return its public URL.
|
|
155
|
+
*/
|
|
156
|
+
upload(params: StorageUploadParams): Promise<StorageUploadResult>;
|
|
157
|
+
/**
|
|
158
|
+
* Delete an image from your storage backend by bucket and relative path.
|
|
159
|
+
*/
|
|
160
|
+
delete(bucket: string, path: string): Promise<void>;
|
|
161
|
+
/**
|
|
162
|
+
* Optional: Resolve a public URL for a bucket and path.
|
|
163
|
+
*/
|
|
164
|
+
getPublicUrl?(bucket: string, path: string): string | Promise<string>;
|
|
165
|
+
/**
|
|
166
|
+
* Optional: List files inside a bucket/folder.
|
|
167
|
+
*/
|
|
168
|
+
list?(bucket: string, folder?: string): Promise<StorageFileEntry[]>;
|
|
169
|
+
/**
|
|
170
|
+
* Optional: Delete an asset directly from its public URL.
|
|
171
|
+
*/
|
|
172
|
+
deleteByUrl?(url: string): Promise<boolean>;
|
|
173
|
+
}
|
|
174
|
+
type UploadRecordHook = (record: ImageUploadRecord) => void | Promise<void>;
|
|
175
|
+
/**
|
|
176
|
+
* Type-safe helper for authoring a custom StorageAdapter (S3, R2, Vercel Blob, Firebase, etc.).
|
|
177
|
+
*/
|
|
178
|
+
declare function createStorageAdapter(adapter: StorageAdapter): StorageAdapter;
|
|
179
|
+
|
|
180
|
+
export { DEFAULT_ALLOWED_FORMATS as D, type ExplicitOutputFormat as E, type ImageDimensions as I, type QualityLevel as Q, RASTER_ALLOWED_FORMATS as R, STANDARD_PRESETS as S, type UploadLocale as U, DEFAULT_IMAGE_DIMENSIONS as a, type ImageOutputFormat as b, type ImageUploadOptions as c, type ImageUploadRecord as d, QUALITY_PRESETS as e, type QualityPreset as f, type StandardPresetName as g, type StorageAdapter as h, type StorageFileEntry as i, type StorageFileMetadata as j, type StorageListResult as k, type StorageUploadOptions as l, type StorageUploadParams as m, type StorageUploadResult as n, type UploadKitRegister as o, type UploadPresetConfig as p, type UploadPresetName as q, type UploadedImageData as r, defineUploadPresets as s, type UploadRecordHook as t, createStorageAdapter as u };
|
package/package.json
CHANGED
|
@@ -1,6 +1,140 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "img-upload-kit",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
}
|
|
3
|
+
"version": "1.1.1",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"description": "Full-featured image upload, Sharp AVIF/WebP optimization, LQIP & BlurHash generation, dominant edge-color extraction, pluggable StorageAdapter, and customizable/headless React UI components.",
|
|
8
|
+
"author": "Mohamed Elsherbiny <mo@buildwithsherbo.com> (https://www.buildwithsherbo.com/)",
|
|
9
|
+
"homepage": "https://upload-kit.buildwithsherbo.com",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/MoElsherbiny/image-upload-kit.git"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/MoElsherbiny/image-upload-kit/issues"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"image-upload",
|
|
19
|
+
"headless-upload",
|
|
20
|
+
"blurhash",
|
|
21
|
+
"lqip",
|
|
22
|
+
"sharp",
|
|
23
|
+
"avif",
|
|
24
|
+
"webp",
|
|
25
|
+
"image-optimization",
|
|
26
|
+
"react-upload",
|
|
27
|
+
"dominant-color",
|
|
28
|
+
"storage-adapter"
|
|
29
|
+
],
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"type": "module",
|
|
32
|
+
"sideEffects": [
|
|
33
|
+
"**/*.css"
|
|
34
|
+
],
|
|
35
|
+
"files": [
|
|
36
|
+
"dist",
|
|
37
|
+
"README.md",
|
|
38
|
+
"CHANGELOG.md",
|
|
39
|
+
"LICENSE"
|
|
40
|
+
],
|
|
41
|
+
"main": "./dist/index.cjs",
|
|
42
|
+
"module": "./dist/index.js",
|
|
43
|
+
"types": "./dist/index.d.ts",
|
|
44
|
+
"bin": {
|
|
45
|
+
"img-upload-kit": "dist/cli.js",
|
|
46
|
+
"image-upload-kit": "dist/cli.js",
|
|
47
|
+
"blur-cli": "dist/cli.js"
|
|
48
|
+
},
|
|
49
|
+
"exports": {
|
|
50
|
+
".": {
|
|
51
|
+
"types": "./dist/index.d.ts",
|
|
52
|
+
"import": "./dist/index.js",
|
|
53
|
+
"require": "./dist/index.cjs"
|
|
54
|
+
},
|
|
55
|
+
"./server": {
|
|
56
|
+
"types": "./dist/server.d.ts",
|
|
57
|
+
"import": "./dist/server.js",
|
|
58
|
+
"require": "./dist/server.cjs"
|
|
59
|
+
},
|
|
60
|
+
"./storage": {
|
|
61
|
+
"types": "./dist/storage.d.ts",
|
|
62
|
+
"import": "./dist/storage.js",
|
|
63
|
+
"require": "./dist/storage.cjs"
|
|
64
|
+
},
|
|
65
|
+
"./blur": {
|
|
66
|
+
"types": "./dist/blur.d.ts",
|
|
67
|
+
"import": "./dist/blur.js",
|
|
68
|
+
"require": "./dist/blur.cjs"
|
|
69
|
+
},
|
|
70
|
+
"./react": {
|
|
71
|
+
"types": "./dist/react.d.ts",
|
|
72
|
+
"import": "./dist/react.js",
|
|
73
|
+
"require": "./dist/react.cjs"
|
|
74
|
+
},
|
|
75
|
+
"./headless": {
|
|
76
|
+
"types": "./dist/headless.d.ts",
|
|
77
|
+
"import": "./dist/headless.js",
|
|
78
|
+
"require": "./dist/headless.cjs"
|
|
79
|
+
},
|
|
80
|
+
"./cli": {
|
|
81
|
+
"types": "./dist/cli.d.ts",
|
|
82
|
+
"import": "./dist/cli.js",
|
|
83
|
+
"require": "./dist/cli.cjs"
|
|
84
|
+
},
|
|
85
|
+
"./styles.css": "./dist/styles.css",
|
|
86
|
+
"./package.json": "./package.json"
|
|
87
|
+
},
|
|
88
|
+
"scripts": {
|
|
89
|
+
"build": "tsup",
|
|
90
|
+
"dev": "tsup --watch",
|
|
91
|
+
"typecheck": "tsc --noEmit",
|
|
92
|
+
"lint": "eslint .",
|
|
93
|
+
"test": "vitest run",
|
|
94
|
+
"test:watch": "vitest",
|
|
95
|
+
"prepublishOnly": "npm run typecheck && npm run test && npm run build"
|
|
96
|
+
},
|
|
97
|
+
"pnpm": {
|
|
98
|
+
"onlyBuiltDependencies": [
|
|
99
|
+
"esbuild",
|
|
100
|
+
"sharp"
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
"dependencies": {
|
|
104
|
+
"blurhash": "^2.0.5",
|
|
105
|
+
"commander": "^14.0.0",
|
|
106
|
+
"lqip-modern": "^2.2.1",
|
|
107
|
+
"lucide-react": "^0.577.0",
|
|
108
|
+
"sharp": "^0.34.5"
|
|
109
|
+
},
|
|
110
|
+
"peerDependencies": {
|
|
111
|
+
"react": ">=18.0.0",
|
|
112
|
+
"react-dom": ">=18.0.0"
|
|
113
|
+
},
|
|
114
|
+
"peerDependenciesMeta": {
|
|
115
|
+
"react": {
|
|
116
|
+
"optional": true
|
|
117
|
+
},
|
|
118
|
+
"react-dom": {
|
|
119
|
+
"optional": true
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"devDependencies": {
|
|
123
|
+
"@eslint/js": "^9.26.0",
|
|
124
|
+
"@types/node": "^22.15.0",
|
|
125
|
+
"@types/react": "^19.1.0",
|
|
126
|
+
"@types/react-dom": "^19.1.0",
|
|
127
|
+
"eslint": "^9.26.0",
|
|
128
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
129
|
+
"prettier": "^3.5.3",
|
|
130
|
+
"react": "^19.1.0",
|
|
131
|
+
"react-dom": "^19.1.0",
|
|
132
|
+
"tsup": "^8.5.0",
|
|
133
|
+
"typescript": "^5.8.3",
|
|
134
|
+
"typescript-eslint": "^8.32.0",
|
|
135
|
+
"vitest": "^3.2.0"
|
|
136
|
+
},
|
|
137
|
+
"engines": {
|
|
138
|
+
"node": ">=18.17.0"
|
|
139
|
+
}
|
|
140
|
+
}
|