@bigbinary/neeto-image-uploader-frontend 2.3.19 → 2.3.21

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
@@ -1,5 +1,5 @@
1
1
  # neeto-image-uploader-nano
2
- The `neeto-image-uploader-nano` manages assets across neeto products. The nano exports the `@bigbinary/neeto-image-uploader-frontend` NPM package and `neeto-image-uploader-engine` Rails engine for development.
2
+ The `neeto-image-uploader-nano` manages assets across neeto products. The nano exports the `@bigbinary/neeto-image-uploader-frontend` NPM package and `neeto-image-uploader-engine` Rails engine for development.
3
3
 
4
4
  # Contents
5
5
  - [neeto-image-uploader-nano](#neeto-image-uploader-nano)
@@ -38,7 +38,7 @@ The engine is used to manage assets across neeto products.
38
38
  ```zsh
39
39
  bundle install
40
40
  ```
41
- 3. Add this line to your application's `config/routes.rb` file:
41
+ 3. Add this line to your application's `config/routes.rb` file:
42
42
  ```ruby
43
43
  mount NeetoImageUploaderEngine::Engine => "/neeto_image_uploader_engine"
44
44
  ```
@@ -165,6 +165,61 @@ const App = () => {
165
165
  export default App;
166
166
  ```
167
167
 
168
+ #### 4. `ImageForm` ([source code](https://github.com/bigbinary/neeto-image-uploader-nano/blob/main/app/javascript/src/components/ImageForm/index.jsx))
169
+
170
+ **Props**
171
+ - `onChange`: Callback function triggered when any form field changes.
172
+ - `imageUploaderProps`: Additional props to be passed to the ImageUpload component.
173
+ - `className`: Additional classes to be applied to the component.
174
+ - `names`: Object specifying field names for form integration:
175
+ - `image`: Name of the image field in the form (e.g., "properties.imageUrl")
176
+ - `height`: Name of the height field in the form (e.g., "height")
177
+ - `alignment`: Name of the alignment field in the form (e.g., "alignment")
178
+ - `logoHeight`: Object specifying height constraints for the logo slider:
179
+ - `default`: Default height value for the slider (default: 64)
180
+ - `min`: Minimum height value for the slider (default: 64)
181
+ - `max`: Maximum height value for the slider (default: 100)
182
+ - `logoSizeVariableName`: CSS variable name for controlling logo size (required)
183
+
184
+ **Usage**
185
+ ```jsx
186
+ import { Formik } from "formik";
187
+ import { ImageForm } from "@bigbinary/neeto-image-uploader-frontend";
188
+
189
+ const App = () => {
190
+ const handleUpdate = (fieldName, value) => {
191
+ console.log(`Field ${fieldName} changed to:`, value);
192
+ };
193
+
194
+ return (
195
+ <Formik
196
+ initialValues={{
197
+ properties: {
198
+ imageUrl: "",
199
+ height: 64,
200
+ alignment: "left"
201
+ },
202
+ altText: ""
203
+ }}
204
+ >
205
+ <ImageForm
206
+ className="logo-form"
207
+ imageUploaderProps={{ maxSize: 1048576 }}
208
+ names={{
209
+ image: "properties.imageUrl",
210
+ height: "height",
211
+ alignment: "alignment",
212
+ }}
213
+ logoSizeVariableName="--my-app-logo-size"
214
+ onChange={handleUpdate}
215
+ />
216
+ </Formik>
217
+ );
218
+ };
219
+
220
+ export default App;
221
+ ```
222
+
168
223
  ### Hooks
169
224
  #### 1. `useImageUpload` ([source code](https://github.com/bigbinary/neeto-image-uploader-nano/blob/0c060e75a32bc04308491a50b96c3b7d4d6f7c83/app/javascript/src/hooks/useImageUpload.js))
170
225
 
@@ -0,0 +1,79 @@
1
+ {
2
+ "neetoImageUploader": {
3
+ "common": {
4
+ "imageLibrary": "Bildbibliothek",
5
+ "image": "Bild",
6
+ "noImages": "Keine Bilder in der Bibliothek gefunden",
7
+ "dropHere": "Datei hier ablegen"
8
+ },
9
+ "unsplash": {
10
+ "errorMessage": "Etwas ist schiefgelaufen! Bitte versuche es später erneut.",
11
+ "poweredByUnsplash": "<a>Powered by <strong>Unsplash</strong></a>"
12
+ },
13
+ "labels": {
14
+ "back": "Zurück",
15
+ "done": "Fertig",
16
+ "height": "Höhe",
17
+ "lockAspectRatio": "Seitenverhältnis sperren",
18
+ "selectOriginalImage": "Originalbild auswählen",
19
+ "uploadImage": "Bild hochladen",
20
+ "myImages": "Meine Bilder",
21
+ "unsplash": "Unsplash",
22
+ "unsplashImages": "Unsplash Bilder",
23
+ "uploadFromLink": "Von Link hochladen",
24
+ "width": "Breite",
25
+ "imageQuality": "Bildqualität",
26
+ "searchTheWeb": "Im Web suchen",
27
+ "addImage": "Bild hinzufügen",
28
+ "logoSize": "Logo Größe",
29
+ "alignment": "Ausrichtung",
30
+ "logoAltText": "Alternativer Text für Logo",
31
+ "leftAlign": "Links ausrichten",
32
+ "centerAlign": "Zentriert ausrichten",
33
+ "rightAlign": "Rechts ausrichten"
34
+ },
35
+ "placeholders": {
36
+ "searchImage": "Nach Namen suchen",
37
+ "searchImageFromWeb": "Bilder im Web suchen"
38
+ },
39
+ "link": {
40
+ "cancel": "Abbrechen",
41
+ "error": "Ungültige URL",
42
+ "label": "Füge einen Link zu einem Bild ein",
43
+ "placeholder": "https://example.com/image.jpg",
44
+ "upload": "Hochladen"
45
+ },
46
+ "imageEditor": {
47
+ "aspectRatio": "Seitenverhältnis"
48
+ },
49
+ "imageUpload": {
50
+ "change": "Ändern",
51
+ "images": "Bilder",
52
+ "imageLibrary": "Bildbibliothek",
53
+ "remove": "Entfernen",
54
+ "dragAndDropOrBrowseFile": "Ziehen & fallen lassen oder <span>hochladen</span>.",
55
+ "selectImagefromImageLibrary": "Aus der <span>Bildbibliothek</span> auswählen.",
56
+ "edit": "Bearbeiten",
57
+ "genericError": "Etwas ist schiefgelaufen.",
58
+ "fileSizeError": "Dateigröße ist zu groß",
59
+ "fileTypeError": "Dateityp wird nicht unterstützt",
60
+ "fileDimensionError": "Bilddimension ist zu groß. Maximal sind 12000px x 12000px.",
61
+ "restrictionMessage": "{{fileTypes, anyCase}}. bis zu {{size}} MB.",
62
+ "uploadedImage": "Hochgeladenes Bild",
63
+ "dragDropOrBrowseOrImageLibrary": "Ziehen und ablegen oder <span>Durchsuchen</span> einer Datei oder aus der <span>Bildbibliothek</span> auswählen.",
64
+ "idealImageSizeInfo": "Optimale Bildgröße: {{width}}x{{height}}px."
65
+ },
66
+ "errors": {
67
+ "sdkKeysMissing": "Fehlender urlEndpoint während der SDK-Initialisierung",
68
+ "imagekitKeysMissing": "Initialisierungsschlüssel für ImageKit wurden nicht bereitgestellt"
69
+ },
70
+ "deleteConfirmation": {
71
+ "delete": "Löschen",
72
+ "title": "Bild dauerhaft löschen?",
73
+ "message": "Das Löschen dieses Bildes entfernt es dauerhaft aus all deinen Arbeitsbereichen. Diese Aktion kann nicht rückgängig gemacht werden und führt zu Datenverlust, wo immer das Bild verwendet wird."
74
+ },
75
+ "tooltips": {
76
+ "logoAltText": "Füge alternativen Text für das Logo hinzu."
77
+ }
78
+ }
79
+ }
@@ -23,7 +23,14 @@
23
23
  "uploadFromLink": "Upload from link",
24
24
  "width": "Width",
25
25
  "imageQuality": "Image quality",
26
- "searchTheWeb": "Search the web"
26
+ "searchTheWeb": "Search the web",
27
+ "addImage": "Add image",
28
+ "logoSize": "Logo size",
29
+ "alignment": "Alignment",
30
+ "logoAltText": "Logo alt text",
31
+ "leftAlign": "Left align",
32
+ "centerAlign": "Center align",
33
+ "rightAlign": "Right align"
27
34
  },
28
35
  "placeholders": {
29
36
  "searchImage": "Search by name",
@@ -64,6 +71,9 @@
64
71
  "delete": "Delete",
65
72
  "title": "Delete image permanently?",
66
73
  "message": "Deleting this image will permanently remove it from all your workspaces. This action cannot be undone and will result in data loss wherever the image is being used."
74
+ },
75
+ "tooltips": {
76
+ "logoAltText": "Add alternative text for the logo."
67
77
  }
68
78
  }
69
79
  }
@@ -0,0 +1,79 @@
1
+ {
2
+ "neetoImageUploader": {
3
+ "common": {
4
+ "imageLibrary": "Biblioteca de imágenes",
5
+ "image": "Imagen",
6
+ "noImages": "No se encontraron imágenes en la biblioteca",
7
+ "dropHere": "Suelta el archivo aquí"
8
+ },
9
+ "unsplash": {
10
+ "errorMessage": "¡Algo salió mal! Por favor, intenta de nuevo más tarde.",
11
+ "poweredByUnsplash": "<a>Impulsado por <strong>Unsplash</strong></a>"
12
+ },
13
+ "labels": {
14
+ "back": "Atrás",
15
+ "done": "Hecho",
16
+ "height": "Altura",
17
+ "lockAspectRatio": "Bloquear relación de aspecto",
18
+ "selectOriginalImage": "Seleccionar imagen original",
19
+ "uploadImage": "Subir imagen",
20
+ "myImages": "Mis imágenes",
21
+ "unsplash": "Unsplash",
22
+ "unsplashImages": "Imágenes de Unsplash",
23
+ "uploadFromLink": "Subir desde enlace",
24
+ "width": "Anchura",
25
+ "imageQuality": "Calidad de imagen",
26
+ "searchTheWeb": "Buscar en la web",
27
+ "addImage": "Agregar imagen",
28
+ "logoSize": "Tamaño del logo",
29
+ "alignment": "Alineación",
30
+ "logoAltText": "Texto alternativo del logo",
31
+ "leftAlign": "Alinear a la izquierda",
32
+ "centerAlign": "Alinear al centro",
33
+ "rightAlign": "Alinear a la derecha"
34
+ },
35
+ "placeholders": {
36
+ "searchImage": "Buscar por nombre",
37
+ "searchImageFromWeb": "Buscar imágenes en la web"
38
+ },
39
+ "link": {
40
+ "cancel": "Cancelar",
41
+ "error": "URL inválido",
42
+ "label": "Pega un enlace a una imagen",
43
+ "placeholder": "https://example.com/image.jpg",
44
+ "upload": "Subir"
45
+ },
46
+ "imageEditor": {
47
+ "aspectRatio": "Relación de aspecto"
48
+ },
49
+ "imageUpload": {
50
+ "change": "Cambiar",
51
+ "images": "Imágenes",
52
+ "imageLibrary": "Biblioteca de imágenes",
53
+ "remove": "Eliminar",
54
+ "dragAndDropOrBrowseFile": "Arrastrar y soltar o <span>subir</span>.",
55
+ "selectImagefromImageLibrary": "Seleccionar de la <span>biblioteca de imágenes</span>.",
56
+ "edit": "Editar",
57
+ "genericError": "¡Algo salió mal!",
58
+ "fileSizeError": "El tamaño del archivo es demasiado grande",
59
+ "fileTypeError": "El tipo de archivo no es compatible",
60
+ "fileDimensionError": "Las dimensiones de la imagen son demasiado grandes. El máximo es 12000px x 12000px.",
61
+ "restrictionMessage": "{{fileTypes, anyCase}}. hasta {{size}} MB.",
62
+ "uploadedImage": "Imagen subida",
63
+ "dragDropOrBrowseOrImageLibrary": "Arrastra y suelta o <span>Explora</span> un archivo o selecciona de la <span>Biblioteca de Imágenes</span>.",
64
+ "idealImageSizeInfo": "Tamaño óptimo de imagen: {{width}}x{{height}}px."
65
+ },
66
+ "errors": {
67
+ "sdkKeysMissing": "Falta el urlEndpoint durante la inicialización del SDK",
68
+ "imagekitKeysMissing": "Las claves de inicialización de ImageKit no están proporcionadas"
69
+ },
70
+ "deleteConfirmation": {
71
+ "delete": "Eliminar",
72
+ "title": "¿Eliminar la imagen permanentemente?",
73
+ "message": "Eliminar esta imagen la retirará permanentemente de todos tus espacios de trabajo. Esta acción no se puede deshacer y resultará en pérdida de datos donde sea que se esté usando la imagen."
74
+ },
75
+ "tooltips": {
76
+ "logoAltText": "Agrega texto alternativo para el logo."
77
+ }
78
+ }
79
+ }
@@ -0,0 +1,79 @@
1
+ {
2
+ "neetoImageUploader": {
3
+ "common": {
4
+ "imageLibrary": "Bibliothèque d'images",
5
+ "image": "Image",
6
+ "noImages": "Aucune image trouvée dans la bibliothèque",
7
+ "dropHere": "Déposez le fichier ici"
8
+ },
9
+ "unsplash": {
10
+ "errorMessage": " quelque chose a mal tourné ! Veuillez réessayer plus tard.",
11
+ "poweredByUnsplash": "<a>Alimenté par <strong>Unsplash</strong></a>"
12
+ },
13
+ "labels": {
14
+ "back": "Retour",
15
+ "done": "Terminé",
16
+ "height": "Hauteur",
17
+ "lockAspectRatio": "Verrouiller le rapport d'aspect",
18
+ "selectOriginalImage": "Sélectionner l'image originale",
19
+ "uploadImage": "Télécharger l'image",
20
+ "myImages": "Mes images",
21
+ "unsplash": "Unsplash",
22
+ "unsplashImages": "Images Unsplash",
23
+ "uploadFromLink": "Télécharger à partir d'un lien",
24
+ "width": "Largeur",
25
+ "imageQuality": "Qualité de l'image",
26
+ "searchTheWeb": "Rechercher sur le web",
27
+ "addImage": "Ajouter une image",
28
+ "logoSize": "Taille du logo",
29
+ "alignment": "Alignement",
30
+ "logoAltText": "Texte alternatif du logo",
31
+ "leftAlign": "Alignement à gauche",
32
+ "centerAlign": "Alignement au centre",
33
+ "rightAlign": "Alignement à droite"
34
+ },
35
+ "placeholders": {
36
+ "searchImage": "Rechercher par nom",
37
+ "searchImageFromWeb": "Rechercher des images sur le web"
38
+ },
39
+ "link": {
40
+ "cancel": "Annuler",
41
+ "error": "URL invalide",
42
+ "label": "Collez un lien vers une image",
43
+ "placeholder": "https://example.com/image.jpg",
44
+ "upload": "Télécharger"
45
+ },
46
+ "imageEditor": {
47
+ "aspectRatio": "Rapport d'aspect"
48
+ },
49
+ "imageUpload": {
50
+ "change": "Changer",
51
+ "images": "Images",
52
+ "imageLibrary": "Bibliothèque d'images",
53
+ "remove": "Supprimer",
54
+ "dragAndDropOrBrowseFile": "Glissez-déposez ou <span>téléchargez</span>.",
55
+ "selectImagefromImageLibrary": "Sélectionner dans <span>bibliothèque d'images</span>.",
56
+ "edit": "Éditer",
57
+ "genericError": "Quelque chose a mal tourné.",
58
+ "fileSizeError": "La taille du fichier est trop grande",
59
+ "fileTypeError": "Le type de fichier n'est pas pris en charge",
60
+ "fileDimensionError": "La dimension de l'image est trop grande. Maximum est 12000px x 12000px.",
61
+ "restrictionMessage": "{{fileTypes, anyCase}}. jusqu'à {{size}} Mo.",
62
+ "uploadedImage": "Image téléchargée",
63
+ "dragDropOrBrowseOrImageLibrary": "Faites glisser et déposez ou <span>Parcourir</span> un fichier ou sélectionnez dans <span>Bibliothèque d'images</span>.",
64
+ "idealImageSizeInfo": "Taille d'image optimale : {{width}}x{{height}}px."
65
+ },
66
+ "errors": {
67
+ "sdkKeysMissing": "URLEndpoint manquant lors de l'initialisation du SDK",
68
+ "imagekitKeysMissing": "Les clés d'initialisation d'ImageKit ne sont pas fournies"
69
+ },
70
+ "deleteConfirmation": {
71
+ "delete": "Supprimer",
72
+ "title": "Supprimer l'image de façon permanente ?",
73
+ "message": "La suppression de cette image l'enlèvera de tous vos espaces de travail de manière permanente. Cette action ne peut pas être annulée et entraînera une perte de données là où l'image est utilisée."
74
+ },
75
+ "tooltips": {
76
+ "logoAltText": "Ajouter un texte alternatif pour le logo."
77
+ }
78
+ }
79
+ }
@@ -11,7 +11,7 @@ import '@bigbinary/neetoui/Typography';
11
11
  import 'ramda';
12
12
  import 'react-i18next';
13
13
  import './utils-Bb1hqKhN.js';
14
- export { M as default } from './index-BSGhIrC8.js';
14
+ export { M as default } from './index-DQC5j8GS.js';
15
15
  import './useImageUploader-BfrsCPBL.js';
16
16
  import './index-B1JijZPf.js';
17
17
  import 'react/jsx-runtime';
@@ -13,7 +13,7 @@ import { mergeRight } from 'ramda';
13
13
  import { useTranslation } from 'react-i18next';
14
14
  import { D as DEFAULT_UPLOAD_CONFIG, O as OPTION_KEYS, i as isNotNilOrEmpty, I as IMAGE_WRAPPER_CLASSNAME, a as ImageDirectUpload } from './utils-Bb1hqKhN.js';
15
15
  import { I as ImageWithFallback } from './ImageWithFallback-Csv6Oivd.js';
16
- import { M as Modal, c as constructCloudflareImageURL } from './index-BSGhIrC8.js';
16
+ import { M as Modal, c as constructCloudflareImageURL } from './index-DQC5j8GS.js';
17
17
  import { a as useCreateBlob, u as useImageUploader, g as generateASCIIFileName } from './useImageUploader-BfrsCPBL.js';
18
18
  import { C as CLOUD_FLARE, I as IS_DEVELOPMENT_OR_HEROKU_ENV } from './index-B1JijZPf.js';
19
19
  import { jsxs, jsx } from 'react/jsx-runtime';
@@ -13,7 +13,7 @@ require('@bigbinary/neetoui/Typography');
13
13
  require('ramda');
14
14
  require('react-i18next');
15
15
  require('../utils-BoO2mwcq.js');
16
- var AssetLibrary = require('../index-dt1pENcE.js');
16
+ var AssetLibrary = require('../index-DspO4oaA.js');
17
17
  require('../useImageUploader-YWyed_UV.js');
18
18
  require('../index-CmR3zLng.js');
19
19
  require('react/jsx-runtime');
@@ -15,7 +15,7 @@ var ramda = require('ramda');
15
15
  var reactI18next = require('react-i18next');
16
16
  var utils = require('../utils-BoO2mwcq.js');
17
17
  var ImageWithFallback = require('../ImageWithFallback-DzT_N2Su.js');
18
- var AssetLibrary = require('../index-dt1pENcE.js');
18
+ var AssetLibrary = require('../index-DspO4oaA.js');
19
19
  var useImageUploader = require('../useImageUploader-YWyed_UV.js');
20
20
  var index = require('../index-CmR3zLng.js');
21
21
  var jsxRuntime = require('react/jsx-runtime');