@bagelink/vue 1.20.9 → 1.20.17
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/assets.d.ts +9 -0
- package/dist/assets.d.ts.map +1 -1
- package/dist/components/form/inputs/CodeEditor/Index.vue.d.ts +1 -1
- package/dist/components/form/inputs/Upload/AssetFileRow.vue.d.ts +37 -0
- package/dist/components/form/inputs/Upload/AssetFileRow.vue.d.ts.map +1 -0
- package/dist/components/form/inputs/Upload/AssetUploadInput.vue.d.ts +33 -3
- package/dist/components/form/inputs/Upload/AssetUploadInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/Upload/ImageCropper.vue.d.ts +33 -0
- package/dist/components/form/inputs/Upload/ImageCropper.vue.d.ts.map +1 -0
- package/dist/components/form/inputs/Upload/UploadInput.vue.d.ts +13 -79
- package/dist/components/form/inputs/Upload/UploadInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/Upload/upload.types.d.ts +14 -0
- package/dist/components/form/inputs/Upload/upload.types.d.ts.map +1 -1
- package/dist/components/lightbox/index.d.ts.map +1 -1
- package/dist/core.css +2 -2
- package/dist/i18n/index.d.ts +108 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/index.cjs +99 -99
- package/dist/index.css +1 -1
- package/dist/index.mjs +15677 -14427
- package/dist/style.css +2 -2
- package/dist/types/BagelForm.d.ts +34 -0
- package/dist/types/BagelForm.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/assets.ts +27 -3
- package/src/components/dataTable/DataTable.vue +3 -3
- package/src/components/form/inputs/Upload/AssetFileRow.vue +150 -0
- package/src/components/form/inputs/Upload/AssetUploadInput.vue +694 -37
- package/src/components/form/inputs/Upload/ImageCropper.vue +525 -0
- package/src/components/form/inputs/Upload/UploadInput.vue +18 -3
- package/src/components/form/inputs/Upload/upload.css +109 -1
- package/src/components/form/inputs/Upload/upload.types.ts +15 -0
- package/src/components/lightbox/index.ts +6 -3
- package/src/i18n/locales/en.json +19 -1
- package/src/i18n/locales/es.json +19 -1
- package/src/i18n/locales/fr.json +21 -2
- package/src/i18n/locales/he.json +19 -1
- package/src/i18n/locales/it.json +19 -1
- package/src/i18n/locales/ru.json +19 -1
- package/src/styles/inputs.css +4 -0
- package/src/types/BagelForm.ts +34 -0
|
@@ -44,6 +44,21 @@ export interface QueueFile {
|
|
|
44
44
|
namespace?: string
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
/**
|
|
48
|
+
* Lab / documentation preview only — pins one of the transient upload visuals so
|
|
49
|
+
* every preview variant can be inspected without a real transfer. Application code
|
|
50
|
+
* must never set this; the state is otherwise owned by the upload queue.
|
|
51
|
+
*/
|
|
52
|
+
export interface UploadPreviewState {
|
|
53
|
+
state: 'uploading' | 'success'
|
|
54
|
+
/** Name shown on the synthetic in-flight row. */
|
|
55
|
+
label?: string
|
|
56
|
+
/** Local thumbnail for the synthetic in-flight row. */
|
|
57
|
+
thumb?: string
|
|
58
|
+
/** 0–100 shown on the synthetic progress bar. @default 62 */
|
|
59
|
+
progress?: number
|
|
60
|
+
}
|
|
61
|
+
|
|
47
62
|
// ---------------------------------------------------------------------------
|
|
48
63
|
// Attachments
|
|
49
64
|
// ---------------------------------------------------------------------------
|
|
@@ -100,7 +100,10 @@ function getLightboxInstance(binding: DirectiveBinding): InstanceType<typeof Lig
|
|
|
100
100
|
const element = document.createElement('div')
|
|
101
101
|
document.body.prepend(element)
|
|
102
102
|
const child = createApp(Lightbox)
|
|
103
|
-
|
|
103
|
+
// Resolve from the app context first, then from the directive host's own
|
|
104
|
+
// provides — an asset client may be provided by a component (e.g. a lab
|
|
105
|
+
// page or an embedded widget) rather than globally by `app.provide`.
|
|
106
|
+
const client = owner.runWithContext(() => injectAssetClient(binding.instance?.$.provides))
|
|
104
107
|
if (client) child.provide(ASSET_CLIENT_KEY, client)
|
|
105
108
|
const instance = child.mount(element) as InstanceType<typeof Lightbox>
|
|
106
109
|
instances.set(owner, instance)
|
|
@@ -116,8 +119,8 @@ function getLightboxInstance(binding: DirectiveBinding): InstanceType<typeof Lig
|
|
|
116
119
|
return lightboxInstance
|
|
117
120
|
}
|
|
118
121
|
|
|
119
|
-
function injectAssetClient(): AssetClient | undefined {
|
|
120
|
-
return inject(ASSET_CLIENT_KEY, undefined)
|
|
122
|
+
function injectAssetClient(provides?: Record<symbol | string, unknown>): AssetClient | undefined {
|
|
123
|
+
return inject(ASSET_CLIENT_KEY, undefined) ?? provides?.[ASSET_CLIENT_KEY] as AssetClient | undefined
|
|
121
124
|
}
|
|
122
125
|
|
|
123
126
|
const lightboxPlugin: Plugin = {
|
package/src/i18n/locales/en.json
CHANGED
|
@@ -12,7 +12,25 @@
|
|
|
12
12
|
"dropPlaceholder": "Drag and Drop files here or click to upload",
|
|
13
13
|
"delete": "Delete",
|
|
14
14
|
"replace": "Replace",
|
|
15
|
-
"download": "Download"
|
|
15
|
+
"download": "Download",
|
|
16
|
+
"cancel": "Cancel",
|
|
17
|
+
"crop": "Crop",
|
|
18
|
+
"cropTitle": "Crop image",
|
|
19
|
+
"cropApply": "Crop and upload",
|
|
20
|
+
"cropReset": "Reset",
|
|
21
|
+
"cropExisting": "Crop",
|
|
22
|
+
"cropApplyExisting": "Apply crop",
|
|
23
|
+
"cropOriginal": "Original",
|
|
24
|
+
"cropFree": "Free",
|
|
25
|
+
"cropSize": "Crop size",
|
|
26
|
+
"cropPixels": "Size in pixels",
|
|
27
|
+
"cropWidth": "Width",
|
|
28
|
+
"cropHeight": "Height",
|
|
29
|
+
"cropMax": "Max {w}×{h} px",
|
|
30
|
+
"cropHint": "Drag to move · drag a corner to resize",
|
|
31
|
+
"tooMany": "Too many files (max {max})",
|
|
32
|
+
"tooLarge": "File is too large (max {max} MB)",
|
|
33
|
+
"failed": "Upload failed. Please try again."
|
|
16
34
|
},
|
|
17
35
|
"pagination": {
|
|
18
36
|
"of": "of",
|
package/src/i18n/locales/es.json
CHANGED
|
@@ -12,7 +12,25 @@
|
|
|
12
12
|
"dropPlaceholder": "Arrastra y suelta archivos aquí o haz clic para subir",
|
|
13
13
|
"delete": "Eliminar",
|
|
14
14
|
"replace": "Reemplazar",
|
|
15
|
-
"download": "Descargar"
|
|
15
|
+
"download": "Descargar",
|
|
16
|
+
"cancel": "Cancelar",
|
|
17
|
+
"crop": "Recortar",
|
|
18
|
+
"cropTitle": "Recortar imagen",
|
|
19
|
+
"cropApply": "Recortar y subir",
|
|
20
|
+
"cropReset": "Restablecer",
|
|
21
|
+
"cropExisting": "Recortar",
|
|
22
|
+
"cropApplyExisting": "Aplicar recorte",
|
|
23
|
+
"cropOriginal": "Original",
|
|
24
|
+
"cropFree": "Libre",
|
|
25
|
+
"cropSize": "Tamaño del recorte",
|
|
26
|
+
"cropPixels": "Tamaño en píxeles",
|
|
27
|
+
"cropWidth": "Ancho",
|
|
28
|
+
"cropHeight": "Alto",
|
|
29
|
+
"cropMax": "Máx. {w}×{h} px",
|
|
30
|
+
"cropHint": "Arrastra para mover · arrastra una esquina para cambiar el tamaño",
|
|
31
|
+
"tooMany": "Demasiados archivos (máx. {max})",
|
|
32
|
+
"tooLarge": "El archivo es demasiado grande (máx. {max} MB)",
|
|
33
|
+
"failed": "Error al subir. Inténtalo de nuevo."
|
|
16
34
|
},
|
|
17
35
|
"pagination": {
|
|
18
36
|
"of": "de",
|
package/src/i18n/locales/fr.json
CHANGED
|
@@ -12,7 +12,25 @@
|
|
|
12
12
|
"dropPlaceholder": "Glissez-déposez des fichiers ici ou cliquez pour télécharger",
|
|
13
13
|
"delete": "Supprimer",
|
|
14
14
|
"replace": "Remplacer",
|
|
15
|
-
"download": "Télécharger"
|
|
15
|
+
"download": "Télécharger",
|
|
16
|
+
"cancel": "Annuler",
|
|
17
|
+
"crop": "Recadrer",
|
|
18
|
+
"cropTitle": "Recadrer l'image",
|
|
19
|
+
"cropApply": "Recadrer et téléverser",
|
|
20
|
+
"cropReset": "Réinitialiser",
|
|
21
|
+
"cropExisting": "Recadrer",
|
|
22
|
+
"cropApplyExisting": "Appliquer le recadrage",
|
|
23
|
+
"cropOriginal": "Original",
|
|
24
|
+
"cropFree": "Libre",
|
|
25
|
+
"cropSize": "Taille du recadrage",
|
|
26
|
+
"cropPixels": "Taille en pixels",
|
|
27
|
+
"cropWidth": "Largeur",
|
|
28
|
+
"cropHeight": "Hauteur",
|
|
29
|
+
"cropMax": "Max. {w}×{h} px",
|
|
30
|
+
"cropHint": "Glissez pour déplacer · glissez un coin pour redimensionner",
|
|
31
|
+
"tooMany": "Trop de fichiers (max {max})",
|
|
32
|
+
"tooLarge": "Fichier trop volumineux (max {max} Mo)",
|
|
33
|
+
"failed": "Échec du téléversement. Réessayez."
|
|
16
34
|
},
|
|
17
35
|
"pagination": {
|
|
18
36
|
"of": "de",
|
|
@@ -256,7 +274,8 @@
|
|
|
256
274
|
"inviteError": "Erreur lors de l'envoi de l'invitation",
|
|
257
275
|
"deleteInviteConfirm": "Supprimer l'invitation ?",
|
|
258
276
|
"deleteInviteError": "Erreur lors de la suppression de l'invitation",
|
|
259
|
-
"removeUserConfirm": "Retirer {email} ?"
|
|
277
|
+
"removeUserConfirm": "Retirer {email} ?"
|
|
278
|
+
},
|
|
260
279
|
"calendar": {
|
|
261
280
|
"today": "Aujourd'hui",
|
|
262
281
|
"views": {
|
package/src/i18n/locales/he.json
CHANGED
|
@@ -12,7 +12,25 @@
|
|
|
12
12
|
"dropPlaceholder": "גרור ושחרר קבצים כאן או לחץ להעלאה",
|
|
13
13
|
"delete": "מחק",
|
|
14
14
|
"replace": "החלף",
|
|
15
|
-
"download": "הורד"
|
|
15
|
+
"download": "הורד",
|
|
16
|
+
"cancel": "ביטול",
|
|
17
|
+
"crop": "חיתוך",
|
|
18
|
+
"cropTitle": "חיתוך תמונה",
|
|
19
|
+
"cropApply": "חתוך והעלה",
|
|
20
|
+
"cropReset": "איפוס",
|
|
21
|
+
"cropExisting": "חיתוך",
|
|
22
|
+
"cropApplyExisting": "החל חיתוך",
|
|
23
|
+
"cropOriginal": "מקורי",
|
|
24
|
+
"cropFree": "חופשי",
|
|
25
|
+
"cropSize": "גודל החיתוך",
|
|
26
|
+
"cropPixels": "גודל בפיקסלים",
|
|
27
|
+
"cropWidth": "רוחב",
|
|
28
|
+
"cropHeight": "גובה",
|
|
29
|
+
"cropMax": "מקסימום {w}×{h} px",
|
|
30
|
+
"cropHint": "גרור להזזה · גרור פינה לשינוי הגודל",
|
|
31
|
+
"tooMany": "יותר מדי קבצים (מקסימום {max})",
|
|
32
|
+
"tooLarge": "הקובץ גדול מדי (מקסימום {max}MB)",
|
|
33
|
+
"failed": "ההעלאה נכשלה. נסה שוב."
|
|
16
34
|
},
|
|
17
35
|
"pagination": {
|
|
18
36
|
"of": "מתוך",
|
package/src/i18n/locales/it.json
CHANGED
|
@@ -12,7 +12,25 @@
|
|
|
12
12
|
"dropPlaceholder": "Trascina e rilascia i file qui o clicca per caricare",
|
|
13
13
|
"delete": "Elimina",
|
|
14
14
|
"replace": "Sostituisci",
|
|
15
|
-
"download": "Scarica"
|
|
15
|
+
"download": "Scarica",
|
|
16
|
+
"cancel": "Annulla",
|
|
17
|
+
"crop": "Ritaglia",
|
|
18
|
+
"cropTitle": "Ritaglia immagine",
|
|
19
|
+
"cropApply": "Ritaglia e carica",
|
|
20
|
+
"cropReset": "Reimposta",
|
|
21
|
+
"cropExisting": "Ritaglia",
|
|
22
|
+
"cropApplyExisting": "Applica ritaglio",
|
|
23
|
+
"cropOriginal": "Originale",
|
|
24
|
+
"cropFree": "Libero",
|
|
25
|
+
"cropSize": "Dimensione del ritaglio",
|
|
26
|
+
"cropPixels": "Dimensione in pixel",
|
|
27
|
+
"cropWidth": "Larghezza",
|
|
28
|
+
"cropHeight": "Altezza",
|
|
29
|
+
"cropMax": "Max {w}×{h} px",
|
|
30
|
+
"cropHint": "Trascina per spostare · trascina un angolo per ridimensionare",
|
|
31
|
+
"tooMany": "Troppi file (max {max})",
|
|
32
|
+
"tooLarge": "File troppo grande (max {max}MB)",
|
|
33
|
+
"failed": "Caricamento non riuscito. Riprova."
|
|
16
34
|
},
|
|
17
35
|
"pagination": {
|
|
18
36
|
"of": "di",
|
package/src/i18n/locales/ru.json
CHANGED
|
@@ -12,7 +12,25 @@
|
|
|
12
12
|
"dropPlaceholder": "Перетащите файлы сюда или нажмите для загрузки",
|
|
13
13
|
"delete": "Удалить",
|
|
14
14
|
"replace": "Заменить",
|
|
15
|
-
"download": "Скачать"
|
|
15
|
+
"download": "Скачать",
|
|
16
|
+
"cancel": "Отмена",
|
|
17
|
+
"crop": "Обрезать",
|
|
18
|
+
"cropTitle": "Обрезать изображение",
|
|
19
|
+
"cropApply": "Обрезать и загрузить",
|
|
20
|
+
"cropReset": "Сбросить",
|
|
21
|
+
"cropExisting": "Обрезать",
|
|
22
|
+
"cropApplyExisting": "Применить обрезку",
|
|
23
|
+
"cropOriginal": "Оригинал",
|
|
24
|
+
"cropFree": "Свободно",
|
|
25
|
+
"cropSize": "Размер обрезки",
|
|
26
|
+
"cropPixels": "Размер в пикселях",
|
|
27
|
+
"cropWidth": "Ширина",
|
|
28
|
+
"cropHeight": "Высота",
|
|
29
|
+
"cropMax": "Макс. {w}×{h} px",
|
|
30
|
+
"cropHint": "Перетащите, чтобы переместить · потяните за угол, чтобы изменить размер",
|
|
31
|
+
"tooMany": "Слишком много файлов (макс. {max})",
|
|
32
|
+
"tooLarge": "Файл слишком большой (макс. {max} МБ)",
|
|
33
|
+
"failed": "Не удалось загрузить. Попробуйте снова."
|
|
16
34
|
},
|
|
17
35
|
"pagination": {
|
|
18
36
|
"of": "из",
|
package/src/styles/inputs.css
CHANGED
|
@@ -100,6 +100,10 @@ select {
|
|
|
100
100
|
width: 100%;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
.bg-input-bg {
|
|
104
|
+
background: var(--bgl-input-bg);
|
|
105
|
+
}
|
|
106
|
+
|
|
103
107
|
/* A multiline textarea is a tall box, not a single input row — a pill/large
|
|
104
108
|
`--bgl-input-border-radius` (e.g. an app that rounds inputs into pills) looks
|
|
105
109
|
wrong on it (the huge corners bite into the top/bottom lines). Use a dedicated
|
package/src/types/BagelForm.ts
CHANGED
|
@@ -231,4 +231,38 @@ export interface UploadInputProps extends BagelInputShellProps {
|
|
|
231
231
|
icon?: string
|
|
232
232
|
iconSize?: number | string
|
|
233
233
|
iconMobileSize?: number | string
|
|
234
|
+
/** Stroke weight of the leading icon (Material Symbols `wght` axis, 100–700). @default 300 */
|
|
235
|
+
iconWeight?: number | string
|
|
236
|
+
/**
|
|
237
|
+
* Dropzone theme — render the inner upload button; the whole area stays clickable.
|
|
238
|
+
* `auto` hides it for `oval`, where the circle is the affordance. @default 'auto'
|
|
239
|
+
*/
|
|
240
|
+
showButton?: boolean | 'auto'
|
|
241
|
+
/** Show a short-lived success check over a file once its upload finishes. */
|
|
242
|
+
showSuccess?: boolean
|
|
243
|
+
/** Cap the preview area; requires `scroll` to scroll instead of growing. */
|
|
244
|
+
maxHeight?: string
|
|
245
|
+
scroll?: boolean
|
|
246
|
+
/** `inside` renders previews in the drop frame; `below` keeps the frame empty and lists files under it. */
|
|
247
|
+
previewLayout?: 'inside' | 'below'
|
|
248
|
+
/** Multiple-image preview arrangement. */
|
|
249
|
+
previewType?: 'list' | 'grid'
|
|
250
|
+
/** Largest accepted file count for `multiple`. */
|
|
251
|
+
maxFiles?: number
|
|
252
|
+
/** Largest accepted file size in megabytes. */
|
|
253
|
+
maxSize?: number
|
|
254
|
+
/** Return false (or throw) to reject a file before it is queued. */
|
|
255
|
+
beforeUpload?: (file: File) => boolean | Promise<boolean>
|
|
256
|
+
/** Let the user crop picked images before they are uploaded (asset mode). */
|
|
257
|
+
crop?: boolean
|
|
258
|
+
/** Crop frame ratio, e.g. `'1'`, `'16-9'`, `'3-4'`; omit for a free frame. */
|
|
259
|
+
cropAspect?: string
|
|
260
|
+
/**
|
|
261
|
+
* Let the user re-crop an image that is already stored (single, list and grid previews).
|
|
262
|
+
* On by default — the crop action is hidden only while a file is still uploading, so
|
|
263
|
+
* pass `false` to remove it entirely. @default true
|
|
264
|
+
*/
|
|
265
|
+
cropExisting?: boolean
|
|
266
|
+
/** Longest side of the cropped output in pixels. @default 2048 */
|
|
267
|
+
cropOutputSize?: number
|
|
234
268
|
}
|