@templatical/media-library 0.0.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/dist/de-1v2LO7XG.js +89 -0
- package/dist/en-mipcUdaJ.js +89 -0
- package/dist/index.d.ts +342 -0
- package/dist/templatical-media-library.css +1 -0
- package/dist/templatical-media-library.js +3424 -0
- package/dist/templatical-media-library.umd.cjs +13 -0
- package/package.json +47 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
mediaLibrary: {
|
|
3
|
+
title: "Medienbibliothek",
|
|
4
|
+
searchPlaceholder: "Dateien suchen...",
|
|
5
|
+
allFiles: "Alle Dateien",
|
|
6
|
+
filterAll: "Alle Typen",
|
|
7
|
+
filterImages: "Bilder",
|
|
8
|
+
filterDocuments: "Dokumente",
|
|
9
|
+
filterVideos: "Videos",
|
|
10
|
+
filterAudio: "Audio",
|
|
11
|
+
newFolder: "Neuer Ordner",
|
|
12
|
+
folderName: "Ordnername",
|
|
13
|
+
noFiles: "Keine Dateien gefunden",
|
|
14
|
+
dropOrClick: "Dateien hierher ziehen oder klicken zum Hochladen",
|
|
15
|
+
acceptedFormats: "Bilder, PDF, Video, Audio, Dokumente (max. 10 MB)",
|
|
16
|
+
uploading: "Wird hochgeladen...",
|
|
17
|
+
uploadingProgress: "{current} von {total} wird hochgeladen...",
|
|
18
|
+
selectImage: "Bild auswählen",
|
|
19
|
+
selectFile: "Datei auswählen",
|
|
20
|
+
deleteSelected: "Löschen",
|
|
21
|
+
copyUrl: "URL kopieren",
|
|
22
|
+
copied: "Kopiert!",
|
|
23
|
+
browseMedia: "Medienbibliothek durchsuchen",
|
|
24
|
+
renameFolder: "Ordner umbenennen",
|
|
25
|
+
addSubfolder: "Unterordner hinzufügen",
|
|
26
|
+
subfolderName: "Unterordnername",
|
|
27
|
+
sortNewest: "Neueste zuerst",
|
|
28
|
+
sortOldest: "Älteste zuerst",
|
|
29
|
+
sortNameAsc: "Name A-Z",
|
|
30
|
+
sortNameDesc: "Name Z-A",
|
|
31
|
+
sortSizeAsc: "Kleinste zuerst",
|
|
32
|
+
sortSizeDesc: "Größte zuerst",
|
|
33
|
+
moveSelected: "Verschieben",
|
|
34
|
+
moveToRoot: "Alle Dateien",
|
|
35
|
+
currentFolder: "(aktuell)",
|
|
36
|
+
confirmDelete: "Bestätigen?",
|
|
37
|
+
renameFile: "Umbenennen",
|
|
38
|
+
editFile: "Datei bearbeiten",
|
|
39
|
+
fileName: "Dateiname",
|
|
40
|
+
altText: "Alternativtext",
|
|
41
|
+
altTextPlaceholder: "Bildbeschreibung für Barrierefreiheit",
|
|
42
|
+
saveChanges: "Speichern",
|
|
43
|
+
cancel: "Abbrechen",
|
|
44
|
+
frequentlyUsed: "Häufig verwendet",
|
|
45
|
+
deleteWarningTitle: "Datei löschen",
|
|
46
|
+
deleteWarningMessage: "Sind Sie sicher? Diese Aktion kann nicht rückgängig gemacht werden.",
|
|
47
|
+
deleteWarningUsageNote: "Die folgenden Dateien werden in Vorlagen verwendet. Das Löschen kann diese Vorlagen beschädigen.",
|
|
48
|
+
deleteAnyway: "Löschen",
|
|
49
|
+
usedInTemplates: "In {count} Vorlage(n) verwendet",
|
|
50
|
+
viewGrid: "Rasteransicht",
|
|
51
|
+
viewList: "Listenansicht",
|
|
52
|
+
showFolders: "Ordner anzeigen",
|
|
53
|
+
hideFolders: "Ordner ausblenden",
|
|
54
|
+
importFromUrl: "Von URL importieren",
|
|
55
|
+
importUrlPlaceholder: "https://example.com/image.jpg",
|
|
56
|
+
import: "Importieren",
|
|
57
|
+
importing: "Wird importiert...",
|
|
58
|
+
importError: "Import von URL fehlgeschlagen",
|
|
59
|
+
conversionLabel: "Groesse",
|
|
60
|
+
conversionOriginal: "Original",
|
|
61
|
+
conversionSmall: "Klein (150px)",
|
|
62
|
+
conversionMedium: "Mittel (600px)",
|
|
63
|
+
conversionLarge: "Gross (1200px)",
|
|
64
|
+
replaceFile: "Datei ersetzen",
|
|
65
|
+
replaceWarningTitle: "Datei ersetzen",
|
|
66
|
+
replaceWarningMessage: "Sie sind dabei, diese Datei zu ersetzen. Die Ersatzdatei muss dieselbe Dateierweiterung haben ({extension}).",
|
|
67
|
+
replaceWarningUsageNote: "Diese Datei wird in {count} Vorlage(n) verwendet. Das Ersetzen aktualisiert alle Verweise.",
|
|
68
|
+
replaceSelectFile: "Ersatzdatei auswählen",
|
|
69
|
+
replace: "Ersetzen",
|
|
70
|
+
replacing: "Wird ersetzt...",
|
|
71
|
+
replaceError: "Ersetzen der Datei fehlgeschlagen",
|
|
72
|
+
saving: "Wird gespeichert...",
|
|
73
|
+
cropAspectRatio: "Seitenverhältnis",
|
|
74
|
+
cropFree: "Frei",
|
|
75
|
+
cropSquare: "1:1",
|
|
76
|
+
cropLandscape43: "4:3",
|
|
77
|
+
cropLandscape169: "16:9",
|
|
78
|
+
cropOriginal: "Original",
|
|
79
|
+
cropMaxWidth: "Max. Breite",
|
|
80
|
+
cropMaxHeight: "Max. Höhe",
|
|
81
|
+
cropOutputSize: "Ausgabegröße",
|
|
82
|
+
cropPixels: "px",
|
|
83
|
+
cropOptional: "(optional)",
|
|
84
|
+
storageTooltip: "{used} von {total} verwendet ({remaining} verfügbar)"
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
export {
|
|
88
|
+
e as default
|
|
89
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
mediaLibrary: {
|
|
3
|
+
title: "Media Library",
|
|
4
|
+
searchPlaceholder: "Search files...",
|
|
5
|
+
allFiles: "All Files",
|
|
6
|
+
filterAll: "All Types",
|
|
7
|
+
filterImages: "Images",
|
|
8
|
+
filterDocuments: "Documents",
|
|
9
|
+
filterVideos: "Videos",
|
|
10
|
+
filterAudio: "Audio",
|
|
11
|
+
newFolder: "New Folder",
|
|
12
|
+
folderName: "Folder name",
|
|
13
|
+
noFiles: "No files found",
|
|
14
|
+
dropOrClick: "Drop files here or click to upload",
|
|
15
|
+
acceptedFormats: "Images, PDF, Video, Audio, Documents (max 10MB)",
|
|
16
|
+
uploading: "Uploading...",
|
|
17
|
+
uploadingProgress: "Uploading {current} of {total}...",
|
|
18
|
+
selectImage: "Select Image",
|
|
19
|
+
selectFile: "Select File",
|
|
20
|
+
deleteSelected: "Delete",
|
|
21
|
+
copyUrl: "Copy URL",
|
|
22
|
+
copied: "Copied!",
|
|
23
|
+
browseMedia: "Browse Media Library",
|
|
24
|
+
renameFolder: "Rename folder",
|
|
25
|
+
addSubfolder: "Add subfolder",
|
|
26
|
+
subfolderName: "Subfolder name",
|
|
27
|
+
sortNewest: "Newest First",
|
|
28
|
+
sortOldest: "Oldest First",
|
|
29
|
+
sortNameAsc: "Name A-Z",
|
|
30
|
+
sortNameDesc: "Name Z-A",
|
|
31
|
+
sortSizeAsc: "Smallest First",
|
|
32
|
+
sortSizeDesc: "Largest First",
|
|
33
|
+
moveSelected: "Move",
|
|
34
|
+
moveToRoot: "All Files",
|
|
35
|
+
currentFolder: "(current)",
|
|
36
|
+
confirmDelete: "Confirm?",
|
|
37
|
+
renameFile: "Rename",
|
|
38
|
+
editFile: "Edit File",
|
|
39
|
+
fileName: "Filename",
|
|
40
|
+
altText: "Alt Text",
|
|
41
|
+
altTextPlaceholder: "Describe this image for accessibility",
|
|
42
|
+
saveChanges: "Save",
|
|
43
|
+
cancel: "Cancel",
|
|
44
|
+
frequentlyUsed: "Frequently Used",
|
|
45
|
+
deleteWarningTitle: "Delete File",
|
|
46
|
+
deleteWarningMessage: "Are you sure? This action is irreversible.",
|
|
47
|
+
deleteWarningUsageNote: "The following files are used in templates. Deleting them may break those templates.",
|
|
48
|
+
deleteAnyway: "Delete",
|
|
49
|
+
usedInTemplates: "Used in {count} template(s)",
|
|
50
|
+
viewGrid: "Grid view",
|
|
51
|
+
viewList: "List view",
|
|
52
|
+
showFolders: "Show folders",
|
|
53
|
+
hideFolders: "Hide folders",
|
|
54
|
+
importFromUrl: "Import from URL",
|
|
55
|
+
importUrlPlaceholder: "https://example.com/image.jpg",
|
|
56
|
+
import: "Import",
|
|
57
|
+
importing: "Importing...",
|
|
58
|
+
importError: "Failed to import from URL",
|
|
59
|
+
conversionLabel: "Size",
|
|
60
|
+
conversionOriginal: "Original",
|
|
61
|
+
conversionSmall: "Small (150px)",
|
|
62
|
+
conversionMedium: "Medium (600px)",
|
|
63
|
+
conversionLarge: "Large (1200px)",
|
|
64
|
+
replaceFile: "Replace File",
|
|
65
|
+
replaceWarningTitle: "Replace File",
|
|
66
|
+
replaceWarningMessage: "You are about to replace this file. The replacement must have the same file extension ({extension}).",
|
|
67
|
+
replaceWarningUsageNote: "This file is used in {count} template(s). Replacing it will update all references.",
|
|
68
|
+
replaceSelectFile: "Select replacement file",
|
|
69
|
+
replace: "Replace",
|
|
70
|
+
replacing: "Replacing...",
|
|
71
|
+
replaceError: "Failed to replace file",
|
|
72
|
+
saving: "Saving...",
|
|
73
|
+
cropAspectRatio: "Aspect Ratio",
|
|
74
|
+
cropFree: "Free",
|
|
75
|
+
cropSquare: "1:1",
|
|
76
|
+
cropLandscape43: "4:3",
|
|
77
|
+
cropLandscape169: "16:9",
|
|
78
|
+
cropOriginal: "Original",
|
|
79
|
+
cropMaxWidth: "Max Width",
|
|
80
|
+
cropMaxHeight: "Max Height",
|
|
81
|
+
cropOutputSize: "Output Size",
|
|
82
|
+
cropPixels: "px",
|
|
83
|
+
cropOptional: "(optional)",
|
|
84
|
+
storageTooltip: "{used} of {total} used ({remaining} remaining)"
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
export {
|
|
88
|
+
e as default
|
|
89
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import { AuthManager } from '../../core/src/cloud/index.ts';
|
|
2
|
+
import { ComponentOptionsMixin } from 'vue';
|
|
3
|
+
import { ComponentProvideOptions } from 'vue';
|
|
4
|
+
import { ComputedRef } from 'vue';
|
|
5
|
+
import { DefineComponent } from 'vue';
|
|
6
|
+
import { PublicProps } from 'vue';
|
|
7
|
+
import { Ref } from 'vue';
|
|
8
|
+
import { SdkAuthConfig } from '../../../core/src/cloud/index.ts';
|
|
9
|
+
|
|
10
|
+
declare type __VLS_Props = {
|
|
11
|
+
visible: boolean;
|
|
12
|
+
accept?: MediaCategory[];
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
declare const en: {
|
|
16
|
+
mediaLibrary: {
|
|
17
|
+
title: string;
|
|
18
|
+
searchPlaceholder: string;
|
|
19
|
+
allFiles: string;
|
|
20
|
+
filterAll: string;
|
|
21
|
+
filterImages: string;
|
|
22
|
+
filterDocuments: string;
|
|
23
|
+
filterVideos: string;
|
|
24
|
+
filterAudio: string;
|
|
25
|
+
newFolder: string;
|
|
26
|
+
folderName: string;
|
|
27
|
+
noFiles: string;
|
|
28
|
+
dropOrClick: string;
|
|
29
|
+
acceptedFormats: string;
|
|
30
|
+
uploading: string;
|
|
31
|
+
uploadingProgress: string;
|
|
32
|
+
selectImage: string;
|
|
33
|
+
selectFile: string;
|
|
34
|
+
deleteSelected: string;
|
|
35
|
+
copyUrl: string;
|
|
36
|
+
copied: string;
|
|
37
|
+
browseMedia: string;
|
|
38
|
+
renameFolder: string;
|
|
39
|
+
addSubfolder: string;
|
|
40
|
+
subfolderName: string;
|
|
41
|
+
sortNewest: string;
|
|
42
|
+
sortOldest: string;
|
|
43
|
+
sortNameAsc: string;
|
|
44
|
+
sortNameDesc: string;
|
|
45
|
+
sortSizeAsc: string;
|
|
46
|
+
sortSizeDesc: string;
|
|
47
|
+
moveSelected: string;
|
|
48
|
+
moveToRoot: string;
|
|
49
|
+
currentFolder: string;
|
|
50
|
+
confirmDelete: string;
|
|
51
|
+
renameFile: string;
|
|
52
|
+
editFile: string;
|
|
53
|
+
fileName: string;
|
|
54
|
+
altText: string;
|
|
55
|
+
altTextPlaceholder: string;
|
|
56
|
+
saveChanges: string;
|
|
57
|
+
cancel: string;
|
|
58
|
+
frequentlyUsed: string;
|
|
59
|
+
deleteWarningTitle: string;
|
|
60
|
+
deleteWarningMessage: string;
|
|
61
|
+
deleteWarningUsageNote: string;
|
|
62
|
+
deleteAnyway: string;
|
|
63
|
+
usedInTemplates: string;
|
|
64
|
+
viewGrid: string;
|
|
65
|
+
viewList: string;
|
|
66
|
+
showFolders: string;
|
|
67
|
+
hideFolders: string;
|
|
68
|
+
importFromUrl: string;
|
|
69
|
+
importUrlPlaceholder: string;
|
|
70
|
+
import: string;
|
|
71
|
+
importing: string;
|
|
72
|
+
importError: string;
|
|
73
|
+
conversionLabel: string;
|
|
74
|
+
conversionOriginal: string;
|
|
75
|
+
conversionSmall: string;
|
|
76
|
+
conversionMedium: string;
|
|
77
|
+
conversionLarge: string;
|
|
78
|
+
replaceFile: string;
|
|
79
|
+
replaceWarningTitle: string;
|
|
80
|
+
replaceWarningMessage: string;
|
|
81
|
+
replaceWarningUsageNote: string;
|
|
82
|
+
replaceSelectFile: string;
|
|
83
|
+
replace: string;
|
|
84
|
+
replacing: string;
|
|
85
|
+
replaceError: string;
|
|
86
|
+
saving: string;
|
|
87
|
+
cropAspectRatio: string;
|
|
88
|
+
cropFree: string;
|
|
89
|
+
cropSquare: string;
|
|
90
|
+
cropLandscape43: string;
|
|
91
|
+
cropLandscape169: string;
|
|
92
|
+
cropOriginal: string;
|
|
93
|
+
cropMaxWidth: string;
|
|
94
|
+
cropMaxHeight: string;
|
|
95
|
+
cropOutputSize: string;
|
|
96
|
+
cropPixels: string;
|
|
97
|
+
cropOptional: string;
|
|
98
|
+
storageTooltip: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export declare function init(config: MediaLibraryConfig): Promise<MediaLibraryInstance>;
|
|
103
|
+
|
|
104
|
+
export declare class MediaApiClient {
|
|
105
|
+
private readonly authManager;
|
|
106
|
+
constructor(authManager: AuthManager);
|
|
107
|
+
private get projectId();
|
|
108
|
+
private get tenantSlug();
|
|
109
|
+
private get baseParams();
|
|
110
|
+
private request;
|
|
111
|
+
browseMedia(params: Omit<MediaBrowseParams, "project_id">): Promise<MediaBrowseResponse>;
|
|
112
|
+
uploadMedia(file: File, folderId?: string | null): Promise<MediaItem>;
|
|
113
|
+
updateMedia(mediaId: string, filename: string, altText?: string): Promise<MediaItem>;
|
|
114
|
+
deleteMedia(ids: string[]): Promise<void>;
|
|
115
|
+
moveMedia(ids: string[], folderId: string | null): Promise<MediaItem[]>;
|
|
116
|
+
getMediaFolders(): Promise<MediaFolder[]>;
|
|
117
|
+
createMediaFolder(name: string, parentId?: string | null): Promise<MediaFolder>;
|
|
118
|
+
renameMediaFolder(folderId: string, name: string): Promise<MediaFolder>;
|
|
119
|
+
deleteMediaFolder(folderId: string): Promise<void>;
|
|
120
|
+
checkMediaUsage(ids: string[]): Promise<MediaUsageResponse>;
|
|
121
|
+
getFrequentlyUsed(): Promise<MediaItem[]>;
|
|
122
|
+
importFromUrl(url: string, folderId?: string | null): Promise<MediaItem>;
|
|
123
|
+
replaceMedia(mediaId: string, file: File): Promise<MediaItem>;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export declare interface MediaBrowseParams {
|
|
127
|
+
folder_id?: string | null;
|
|
128
|
+
search?: string;
|
|
129
|
+
category?: string;
|
|
130
|
+
sort?: string;
|
|
131
|
+
cursor?: string;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export declare interface MediaBrowseResponse {
|
|
135
|
+
data: MediaItem[];
|
|
136
|
+
meta: {
|
|
137
|
+
path: string;
|
|
138
|
+
per_page: number;
|
|
139
|
+
next_cursor: string | null;
|
|
140
|
+
prev_cursor: string | null;
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export declare type MediaCategory = "images" | "documents" | "videos" | "audio";
|
|
145
|
+
|
|
146
|
+
export declare interface MediaCategoryData {
|
|
147
|
+
mime_types: string[];
|
|
148
|
+
extensions: string[];
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export declare interface MediaConfig {
|
|
152
|
+
use_media_library: boolean;
|
|
153
|
+
categories: Record<string, MediaCategoryData>;
|
|
154
|
+
max_file_size: number;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export declare type MediaConversion = "original" | "small" | "medium" | "large";
|
|
158
|
+
|
|
159
|
+
export declare interface MediaFolder {
|
|
160
|
+
id: string;
|
|
161
|
+
project_id: string;
|
|
162
|
+
parent_id: string | null;
|
|
163
|
+
name: string;
|
|
164
|
+
children?: MediaFolder[];
|
|
165
|
+
created_at: string;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export declare interface MediaItem {
|
|
169
|
+
id: string;
|
|
170
|
+
filename: string;
|
|
171
|
+
mime_type: string;
|
|
172
|
+
size: number;
|
|
173
|
+
url: string;
|
|
174
|
+
small_url: string | null;
|
|
175
|
+
medium_url: string | null;
|
|
176
|
+
large_url: string | null;
|
|
177
|
+
folder_id: string | null;
|
|
178
|
+
conversions_generated: boolean;
|
|
179
|
+
width: number | null;
|
|
180
|
+
height: number | null;
|
|
181
|
+
alt_text: string;
|
|
182
|
+
created_at: string;
|
|
183
|
+
updated_at: string;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export declare interface MediaLibraryConfig {
|
|
187
|
+
container: string | HTMLElement;
|
|
188
|
+
auth: SdkAuthConfig;
|
|
189
|
+
baseUrl?: string;
|
|
190
|
+
locale?: string;
|
|
191
|
+
theme?: {
|
|
192
|
+
primaryColor?: string;
|
|
193
|
+
borderRadius?: number;
|
|
194
|
+
};
|
|
195
|
+
onSelect?: (item: MediaItem) => void;
|
|
196
|
+
onError?: (error: Error) => void;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export declare interface MediaLibraryInstance {
|
|
200
|
+
setTheme(theme: {
|
|
201
|
+
primaryColor?: string;
|
|
202
|
+
borderRadius?: number;
|
|
203
|
+
}): void;
|
|
204
|
+
unmount(): void;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export declare const MediaLibraryModal: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
208
|
+
select: (item: MediaItem) => any;
|
|
209
|
+
close: () => any;
|
|
210
|
+
}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
211
|
+
onSelect?: ((item: MediaItem) => any) | undefined;
|
|
212
|
+
onClose?: (() => any) | undefined;
|
|
213
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
214
|
+
|
|
215
|
+
export declare interface MediaRequestContext {
|
|
216
|
+
accept?: MediaCategory[];
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
declare type MediaTranslations = typeof en;
|
|
220
|
+
|
|
221
|
+
export declare interface MediaUsageInfo {
|
|
222
|
+
template_count: number;
|
|
223
|
+
template_names: string[];
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export declare interface MediaUsageResponse {
|
|
227
|
+
data: Record<string, MediaUsageInfo>;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export declare type MediaViewMode = "files" | "frequently-used";
|
|
231
|
+
|
|
232
|
+
export declare interface StorageInfo {
|
|
233
|
+
used_bytes: number;
|
|
234
|
+
limit_bytes: number;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export declare function unmount(): void;
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Composable for internationalization.
|
|
241
|
+
* Provides access to the current locale's translations.
|
|
242
|
+
*
|
|
243
|
+
* @param translationsOverride - Optional translations to use instead of injected value
|
|
244
|
+
*/
|
|
245
|
+
export declare function useI18n(translationsOverride?: MediaTranslations): UseI18nReturn;
|
|
246
|
+
|
|
247
|
+
declare interface UseI18nReturn {
|
|
248
|
+
/** Current translations object */
|
|
249
|
+
t: MediaTranslations;
|
|
250
|
+
/** Format a string with placeholders */
|
|
251
|
+
format: (template: string, values: Record<string, string | number>) => string;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export declare function useMediaCategories(): UseMediaCategoriesReturn;
|
|
255
|
+
|
|
256
|
+
export declare interface UseMediaCategoriesReturn {
|
|
257
|
+
isMediaLibraryEnabled: ComputedRef<boolean>;
|
|
258
|
+
allAcceptedMimeTypes: ComputedRef<string[]>;
|
|
259
|
+
allAcceptedInputString: ComputedRef<string>;
|
|
260
|
+
maxFileSize: ComputedRef<number>;
|
|
261
|
+
availableCategories: ComputedRef<MediaCategory[]>;
|
|
262
|
+
isAcceptedMimeType: (mimeType: string, filterCategories?: MediaCategory[]) => boolean;
|
|
263
|
+
isImageMimeType: (mimeType: string) => boolean;
|
|
264
|
+
getCategoryForMimeType: (mimeType: string) => MediaCategory | null;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export declare function useMediaLibrary(options: UseMediaLibraryOptions): {
|
|
268
|
+
items: Ref<MediaItem[], MediaItem[]>;
|
|
269
|
+
folders: Ref<MediaFolder[], MediaFolder[]>;
|
|
270
|
+
currentFolderId: Ref<string | null, string | null>;
|
|
271
|
+
viewMode: Ref<MediaViewMode, MediaViewMode>;
|
|
272
|
+
searchQuery: Ref<string, string>;
|
|
273
|
+
categoryFilter: Ref<string | null, string | null>;
|
|
274
|
+
sortOption: Ref<string, string>;
|
|
275
|
+
isLoading: Ref<boolean, boolean>;
|
|
276
|
+
isUploading: Ref<boolean, boolean>;
|
|
277
|
+
uploadProgress: Ref<{
|
|
278
|
+
current: number;
|
|
279
|
+
total: number;
|
|
280
|
+
} | null, {
|
|
281
|
+
current: number;
|
|
282
|
+
total: number;
|
|
283
|
+
} | null>;
|
|
284
|
+
hasMore: Ref<boolean, boolean>;
|
|
285
|
+
selectedItems: Ref<Set<string>, Set<string>>;
|
|
286
|
+
previewItem: Ref<MediaItem | null, MediaItem | null>;
|
|
287
|
+
frequentlyUsedItems: Ref<MediaItem[], MediaItem[]>;
|
|
288
|
+
deleteUsageInfo: Ref<Record<string, MediaUsageInfo>, Record<string, MediaUsageInfo>>;
|
|
289
|
+
showDeleteWarning: Ref<boolean, boolean>;
|
|
290
|
+
loadItems: () => Promise<void>;
|
|
291
|
+
loadMore: () => Promise<void>;
|
|
292
|
+
search: (query: string) => Promise<void>;
|
|
293
|
+
filterByCategory: (category: string | null) => Promise<void>;
|
|
294
|
+
sortBy: (option: string) => Promise<void>;
|
|
295
|
+
navigateToFolder: (folderId: string | null) => Promise<void>;
|
|
296
|
+
showFrequentlyUsed: () => Promise<void>;
|
|
297
|
+
uploadFile: (file: File) => Promise<MediaItem | null>;
|
|
298
|
+
uploadFiles: (files: File[]) => Promise<void>;
|
|
299
|
+
moveSelected: (targetFolderId: string | null) => Promise<void>;
|
|
300
|
+
updateFile: (mediaId: string, filename: string, altText?: string) => Promise<void>;
|
|
301
|
+
deleteSelected: () => Promise<void>;
|
|
302
|
+
isImportingFromUrl: Ref<boolean, boolean>;
|
|
303
|
+
importFromUrlError: Ref<string | null, string | null>;
|
|
304
|
+
importFromUrl: (url: string) => Promise<MediaItem | null>;
|
|
305
|
+
toggleSelection: (id: string) => void;
|
|
306
|
+
clearSelection: () => void;
|
|
307
|
+
selectItem: (item: MediaItem) => void;
|
|
308
|
+
loadFolders: () => Promise<void>;
|
|
309
|
+
createFolder: (name: string, parentId?: string | null) => Promise<MediaFolder | null>;
|
|
310
|
+
renameFolder: (folderId: string, name: string) => Promise<void>;
|
|
311
|
+
deleteFolder: (folderId: string) => Promise<void>;
|
|
312
|
+
findFolderInTree: (folderList: MediaFolder[], id: string) => MediaFolder | null;
|
|
313
|
+
loadFrequentlyUsed: () => Promise<void>;
|
|
314
|
+
checkUsageBeforeDelete: () => Promise<boolean>;
|
|
315
|
+
confirmDelete: () => Promise<void>;
|
|
316
|
+
cancelDelete: () => void;
|
|
317
|
+
isReplacing: Ref<boolean, boolean>;
|
|
318
|
+
replaceError: Ref<string | null, string | null>;
|
|
319
|
+
showReplaceWarning: Ref<boolean, boolean>;
|
|
320
|
+
pendingReplaceItem: Ref<MediaItem | null, MediaItem | null>;
|
|
321
|
+
replaceUsageInfo: Ref<MediaUsageInfo | null, MediaUsageInfo | null>;
|
|
322
|
+
checkUsageBeforeReplace: (item: MediaItem) => Promise<void>;
|
|
323
|
+
cancelReplace: () => void;
|
|
324
|
+
replaceFile: (file: File) => Promise<MediaItem | null>;
|
|
325
|
+
replaceMediaDirectly: (mediaId: string, file: File) => Promise<MediaItem | null>;
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
export declare interface UseMediaLibraryOptions {
|
|
329
|
+
projectId: string;
|
|
330
|
+
authManager: AuthManager;
|
|
331
|
+
onError?: (error: Error) => void;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export declare function useMediaPicker(): UseMediaPickerReturn;
|
|
335
|
+
|
|
336
|
+
declare interface UseMediaPickerReturn {
|
|
337
|
+
isPluggableMediaEnabled: ComputedRef<boolean>;
|
|
338
|
+
isRequesting: Ref<boolean>;
|
|
339
|
+
requestMedia: (context?: MediaRequestContext) => Promise<MediaItem | null>;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
export { }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import"https://fonts.bunny.net/css?family=geist:400,500,600";.vue-advanced-cropper{text-align:center;position:relative;-webkit-user-select:none;user-select:none;max-height:100%;max-width:100%;direction:ltr}.vue-advanced-cropper__stretcher{pointer-events:none;position:relative;max-width:100%;max-height:100%}.vue-advanced-cropper__image{-webkit-user-select:none;user-select:none;position:absolute;transform-origin:center;max-width:none!important}.vue-advanced-cropper__background,.vue-advanced-cropper__foreground{opacity:1;background:#000;transform:translate(-50%,-50%);position:absolute;top:50%;left:50%}.vue-advanced-cropper__foreground{opacity:.5}.vue-advanced-cropper__boundaries{opacity:1;transform:translate(-50%,-50%);position:absolute;left:50%;top:50%}.vue-advanced-cropper__cropper-wrapper{width:100%;height:100%}.vue-advanced-cropper__image-wrapper{overflow:hidden;position:absolute;width:100%;height:100%}.vue-advanced-cropper__stencil-wrapper{position:absolute}.vue-simple-handler{display:block;background:#fff;height:10px;width:10px}.vue-handler-wrapper{position:absolute;transform:translate(-50%,-50%);width:30px;height:30px}.vue-handler-wrapper__draggable{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.vue-handler-wrapper--west-north{cursor:nw-resize}.vue-handler-wrapper--north{cursor:n-resize}.vue-handler-wrapper--east-north{cursor:ne-resize}.vue-handler-wrapper--east{cursor:e-resize}.vue-handler-wrapper--east-south{cursor:se-resize}.vue-handler-wrapper--south{cursor:s-resize}.vue-handler-wrapper--west-south{cursor:sw-resize}.vue-handler-wrapper--west{cursor:w-resize}.vue-handler-wrapper--disabled{cursor:auto}.vue-line-wrapper{background:none;position:absolute;display:flex;align-items:center;justify-content:center}.vue-line-wrapper--north,.vue-line-wrapper--south{height:12px;width:100%;left:0;transform:translateY(-50%)}.vue-line-wrapper--north{top:0;cursor:n-resize}.vue-line-wrapper--south{top:100%;cursor:s-resize}.vue-line-wrapper--east,.vue-line-wrapper--west{width:12px;height:100%;transform:translate(-50%);top:0}.vue-line-wrapper--east{left:100%;cursor:e-resize}.vue-line-wrapper--west{left:0;cursor:w-resize}.vue-line-wrapper--disabled{cursor:auto}.vue-bounding-box{position:relative;height:100%;width:100%}.vue-bounding-box__handler{position:absolute}.vue-bounding-box__handler--west-north{left:0;top:0}.vue-bounding-box__handler--north{left:50%;top:0}.vue-bounding-box__handler--east-north{left:100%;top:0}.vue-bounding-box__handler--east{left:100%;top:50%}.vue-bounding-box__handler--east-south{left:100%;top:100%}.vue-bounding-box__handler--south{left:50%;top:100%}.vue-bounding-box__handler--west-south{left:0;top:100%}.vue-bounding-box__handler--west{left:0;top:50%}.vue-draggable-area{position:relative}.vue-preview-result{overflow:hidden;box-sizing:border-box;position:absolute;height:100%;width:100%}.vue-preview-result__wrapper{position:absolute}.vue-preview-result__image{pointer-events:none;position:relative;-webkit-user-select:none;user-select:none;transform-origin:center;max-width:none!important}.vue-rectangle-stencil{position:absolute;height:100%;width:100%;box-sizing:border-box}.vue-rectangle-stencil__preview{position:absolute;width:100%;height:100%}.vue-rectangle-stencil--movable{cursor:move}.vue-circle-stencil{position:absolute;height:100%;width:100%;box-sizing:content-box;cursor:move}.vue-circle-stencil__preview{border-radius:50%;position:absolute;width:100%;height:100%}.vue-circle-stencil--movable{cursor:move}.vue-preview{overflow:hidden;box-sizing:border-box;position:relative}.vue-preview--fill{width:100%;height:100%;position:absolute}.vue-preview__wrapper{position:absolute;height:100%;width:100%}.vue-preview__image{pointer-events:none;position:absolute;-webkit-user-select:none;user-select:none;transform-origin:center;max-width:none!important}.vue-simple-line{background:none;transition:border .5s;border-color:#ffffff4d;border-width:0;border-style:solid}.vue-simple-line--south,.vue-simple-line--north{height:0;width:100%}.vue-simple-line--east,.vue-simple-line--west{height:100%;width:0}.vue-simple-line--east{border-right-width:1px}.vue-simple-line--west{border-left-width:1px}.vue-simple-line--south{border-bottom-width:1px}.vue-simple-line--north{border-top-width:1px}.vue-simple-line--hover{opacity:1;border-color:#fff}[data-v-4d303952] .tpl-cropper-background{background-color:var(--tpl-bg)!important}[data-v-4d303952] .vue-advanced-cropper{background-color:transparent!important}[data-v-4d303952] .vue-advanced-cropper__background{background-color:var(--tpl-bg)!important}[data-v-4d303952] .vue-advanced-cropper__foreground{background-color:var(--tpl-overlay)!important}.tpl-media-item[data-v-1c1258ec]:not(.tpl-media-item--selected):hover{border-color:var(--tpl-border)!important}.tpl-media-list-item[data-v-1c1258ec]:hover{background-color:var(--tpl-bg-hover)!important}.tpl-list-icon[data-v-1c1258ec]{transform:scale(.35);transform-origin:center}.tpl-preview-icon[data-v-3c9c60c7]{transform:scale(.45);transform-origin:center}@layer theme,base,components;@theme inline{ --font-sans: "Geist", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; }@source "../**/*.vue";@source "../**/*.ts";.tpl{--tpl-bg: oklch(99.5% .002 60);--tpl-bg-elevated: oklch(98% .004 60);--tpl-bg-hover: oklch(96% .006 60);--tpl-bg-active: oklch(93.5% .008 60);--tpl-border: oklch(92% .006 60);--tpl-border-light: oklch(86% .01 60);--tpl-text: oklch(18% .01 60);--tpl-text-muted: oklch(50% .015 60);--tpl-text-dim: oklch(68% .012 60);--tpl-primary: oklch(70% .16 55);--tpl-primary-hover: oklch(63% .17 55);--tpl-primary-light: oklch(95% .04 55);--tpl-secondary: oklch(60% .118 184.71);--tpl-secondary-hover: oklch(53.2% .105 186.39);--tpl-secondary-light: oklch(93.8% .03 186.82);--tpl-success: oklch(62.8% .194 155.1);--tpl-success-light: oklch(93.6% .043 163.51);--tpl-warning: oklch(76.9% .168 70.08);--tpl-warning-light: oklch(95% .038 73.59);--tpl-danger: oklch(63.7% .237 25.33);--tpl-danger-light: oklch(93.6% .032 17.72);--tpl-radius: 10px;--tpl-radius-sm: 7px;--tpl-radius-lg: 14px;--tpl-font-family: "Geist", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--tpl-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 3px rgba(0, 0, 0, .03);--tpl-shadow-md: 0 2px 8px rgba(0, 0, 0, .06), 0 1px 3px rgba(0, 0, 0, .04);--tpl-shadow-lg: 0 4px 16px rgba(0, 0, 0, .08), 0 2px 6px rgba(0, 0, 0, .04);--tpl-shadow-xl: 0 8px 32px rgba(0, 0, 0, .1), 0 4px 12px rgba(0, 0, 0, .06);--tpl-ring: 0 0 0 3px var(--tpl-primary-light);--tpl-transition: .12s cubic-bezier(.16, 1, .3, 1)}.tpl{@apply tpl:font-sans tpl:text-sm tpl:leading-normal tpl:antialiased;background-color:var(--tpl-bg);color:var(--tpl-text);font-family:var(--tpl-font-family)}.tpl button,.tpl input,.tpl select,.tpl textarea{font-family:inherit}.tpl button{border:none;outline:none;background:none;cursor:pointer}.tpl ::-webkit-scrollbar{width:6px;height:6px}.tpl ::-webkit-scrollbar-track{background:transparent}.tpl ::-webkit-scrollbar-thumb{background-color:color-mix(in srgb,var(--tpl-border-light) 60%,transparent);@apply tpl:rounded;}.tpl ::-webkit-scrollbar-thumb:hover{background-color:var(--tpl-border-light)}@keyframes tpl-pulse{0%,to{opacity:1}50%{opacity:.5}}@keyframes tpl-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes tpl-scale-in{0%{opacity:0;transform:scale(.97)}to{opacity:1;transform:scale(1)}}.tpl-pulse{animation:tpl-pulse 2s infinite}.tpl-spinner{animation:tpl-spin 1s linear infinite}.tpl-scale-in{animation:tpl-scale-in .15s cubic-bezier(.16,1,.3,1)}
|