@bigbinary/neeto-image-uploader-frontend 3.0.2 → 3.0.4

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.
Files changed (71) hide show
  1. package/README.md +3 -0
  2. package/app/javascript/src/translations/ar.json +2 -1
  3. package/app/javascript/src/translations/bg.json +2 -1
  4. package/app/javascript/src/translations/ca.json +2 -1
  5. package/app/javascript/src/translations/cs.json +2 -1
  6. package/app/javascript/src/translations/da.json +2 -1
  7. package/app/javascript/src/translations/de.json +2 -1
  8. package/app/javascript/src/translations/en.json +2 -1
  9. package/app/javascript/src/translations/es-MX.json +2 -1
  10. package/app/javascript/src/translations/es.json +2 -1
  11. package/app/javascript/src/translations/et.json +2 -1
  12. package/app/javascript/src/translations/fi.json +2 -1
  13. package/app/javascript/src/translations/fil.json +2 -1
  14. package/app/javascript/src/translations/fr.json +2 -1
  15. package/app/javascript/src/translations/he.json +2 -1
  16. package/app/javascript/src/translations/hi.json +2 -1
  17. package/app/javascript/src/translations/hr.json +2 -1
  18. package/app/javascript/src/translations/hu.json +83 -0
  19. package/app/javascript/src/translations/id.json +2 -1
  20. package/app/javascript/src/translations/it.json +2 -1
  21. package/app/javascript/src/translations/ja.json +2 -1
  22. package/app/javascript/src/translations/ko.json +2 -1
  23. package/app/javascript/src/translations/nl.json +2 -1
  24. package/app/javascript/src/translations/pl.json +2 -1
  25. package/app/javascript/src/translations/pt-BR.json +2 -1
  26. package/app/javascript/src/translations/pt.json +2 -1
  27. package/app/javascript/src/translations/ro.json +2 -1
  28. package/app/javascript/src/translations/ru.json +2 -1
  29. package/app/javascript/src/translations/sk.json +2 -1
  30. package/app/javascript/src/translations/sl.json +2 -1
  31. package/app/javascript/src/translations/sv.json +2 -1
  32. package/app/javascript/src/translations/th.json +2 -1
  33. package/app/javascript/src/translations/tr.json +2 -1
  34. package/app/javascript/src/translations/uk.json +2 -1
  35. package/app/javascript/src/translations/vi.json +2 -1
  36. package/app/javascript/src/translations/zh-CN.json +2 -1
  37. package/app/javascript/src/translations/zh-TW.json +2 -1
  38. package/dist/AssetLibrary.js +3 -2
  39. package/dist/AssetLibrary.js.map +1 -1
  40. package/dist/BasicImageUploader.js +2 -2
  41. package/dist/ImageForm.js +3 -2
  42. package/dist/ImageForm.js.map +1 -1
  43. package/dist/ImageUploader.js +8 -5
  44. package/dist/ImageUploader.js.map +1 -1
  45. package/dist/cjs/AssetLibrary.js +3 -2
  46. package/dist/cjs/AssetLibrary.js.map +1 -1
  47. package/dist/cjs/BasicImageUploader.js +2 -2
  48. package/dist/cjs/ImageForm.js +3 -2
  49. package/dist/cjs/ImageForm.js.map +1 -1
  50. package/dist/cjs/ImageUploader.js +7 -4
  51. package/dist/cjs/ImageUploader.js.map +1 -1
  52. package/dist/cjs/index.js +4 -3
  53. package/dist/cjs/index.js.map +1 -1
  54. package/dist/{index-CSoe203Z.js → index-DxJCT8T_.js} +52 -28
  55. package/dist/index-DxJCT8T_.js.map +1 -0
  56. package/dist/{index-IvuywClK.js → index-bQG7L4n2.js} +51 -27
  57. package/dist/index-bQG7L4n2.js.map +1 -0
  58. package/dist/index.js +4 -3
  59. package/dist/index.js.map +1 -1
  60. package/dist/useProfileImageUpload-BOP54J2z.js.map +1 -1
  61. package/dist/useProfileImageUpload-kJjZSen1.js.map +1 -1
  62. package/dist/{utils-DIM-cAUF.js → utils-BvsL7SjN.js} +16 -6
  63. package/dist/utils-BvsL7SjN.js.map +1 -0
  64. package/dist/{utils-pG6icHxb.js → utils-C2UE2HoI.js} +16 -6
  65. package/dist/utils-C2UE2HoI.js.map +1 -0
  66. package/package.json +16 -16
  67. package/types.d.ts +4 -1
  68. package/dist/index-CSoe203Z.js.map +0 -1
  69. package/dist/index-IvuywClK.js.map +0 -1
  70. package/dist/utils-DIM-cAUF.js.map +0 -1
  71. package/dist/utils-pG6icHxb.js.map +0 -1
@@ -8,9 +8,9 @@ import Tab from '@bigbinary/neetoui/Tab';
8
8
  import Spinner from '@bigbinary/neetoui/Spinner';
9
9
  import Toastr from '@bigbinary/neetoui/Toastr';
10
10
  import Typography from '@bigbinary/neetoui/Typography';
11
- import { mergeRight, identity, prop, equals } from 'ramda';
11
+ import { mergeRight, identity, isEmpty, prop, equals } from 'ramda';
12
12
  import { useTranslation, Trans } from 'react-i18next';
13
- import { i as isNilOrEmpty, c as DEFAULT_CROP_CONFIG, g as getAspectRatio, d as getPixels, e as getHeightFromAspectRatio, f as getWidthFromAspectRatio, h as getInitialCropSize, j as getPercentage, k as isItemsCenter, l as getWrapperRefStyles, m as getCloudFlareCroppedURL, n as getImageKitCroppedURL, o as getCropValues, p as IMAGES_PER_PAGE, q as INFINITE_SCROLLER_SIZES, r as INFINITE_SCROLLER_STYLE, T as TABS, A as ASSETS_DESTROY_URL, s as ASSETS_FETCH_URL, U as UNSPLASH_DEFAULT_NAME, t as UNSPLASH_DEFAULT_REQUEST_CONFIG, D as DEFAULT_UPLOAD_CONFIG, u as useUploadDropzone, v as UNSPLASH_URL, b as ImageDirectUpload } from './utils-DIM-cAUF.js';
13
+ import { i as isNilOrEmpty, c as DEFAULT_CROP_CONFIG, g as getAspectRatio, d as getPixels, e as getHeightFromAspectRatio, f as getWidthFromAspectRatio, h as getInitialCropSize, j as getPercentage, k as isItemsCenter, l as getWrapperRefStyles, m as getCloudFlareCroppedURL, n as getImageKitCroppedURL, o as getCropValues, p as IMAGES_PER_PAGE, q as INFINITE_SCROLLER_SIZES, r as INFINITE_SCROLLER_STYLE, T as TABS, A as ASSETS_DESTROY_URL, s as ASSETS_FETCH_URL, U as UNSPLASH_DEFAULT_NAME, t as UNSPLASH_DEFAULT_REQUEST_CONFIG, D as DEFAULT_UPLOAD_CONFIG, u as useUploadDropzone, v as UNSPLASH_URL, b as ImageDirectUpload } from './utils-BvsL7SjN.js';
14
14
  import { u as useImageUploader, a as useCreateBlob, i as isGif, g as generateASCIIFileName } from './useImageUploader-Dgah80e0.js';
15
15
  import { b as IMAGE_UPLOADER_BASE_URL, I as IS_DEVELOPMENT_OR_HEROKU_ENV, C as CLOUD_FLARE } from './imagekit.esm-Bhjn2yWQ.js';
16
16
  import classnames from 'classnames';
@@ -24,6 +24,7 @@ import Input from '@bigbinary/neetoui/Input';
24
24
  import Switch from '@bigbinary/neetoui/Switch';
25
25
  import Label from '@bigbinary/neetoui/Label';
26
26
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
27
+ import NoData from '@bigbinary/neetoui/NoData';
27
28
  import { Q as QUERY_KEYS, A as ASSETS_STALE_TIME, U as UNSPLASH_STALE_TIME } from './query-DMtOS6FM.js';
28
29
  import MenuHorizontal from '@bigbinary/neeto-icons/MenuHorizontal';
29
30
  import { VIEW_ROLES_PERMISSION } from '@bigbinary/neeto-team-members-frontend/constants';
@@ -1876,7 +1877,7 @@ var InfiniteScroller = function InfiniteScroller(_ref) {
1876
1877
  children: /*#__PURE__*/jsx(Spinner, {})
1877
1878
  });
1878
1879
  return /*#__PURE__*/jsxs("div", {
1879
- className: "niu-unsplash-container me-2 max-w-full overflow-x-hidden overflow-y-scroll",
1880
+ className: "niu-unsplash-container grow max-w-full overflow-x-hidden overflow-y-scroll",
1880
1881
  children: [/*#__PURE__*/jsx(_default, {
1881
1882
  hasMore: hasMore,
1882
1883
  loadMore: loadMore,
@@ -1985,18 +1986,28 @@ var Images = function Images(_ref) {
1985
1986
  isLoading = _useFetchAssets.isLoading,
1986
1987
  isError = _useFetchAssets.isError;
1987
1988
  if (isError) {
1988
- return /*#__PURE__*/jsx(Typography, {
1989
- className: "mt-9 flex justify-center",
1990
- style: "body2",
1991
- children: t("neetoImageUploader.unsplash.errorMessage")
1989
+ return /*#__PURE__*/jsx("div", {
1990
+ className: "grow flex justify-center items-center",
1991
+ children: /*#__PURE__*/jsx(Typography, {
1992
+ style: "body2",
1993
+ children: t("neetoImageUploader.unsplash.errorMessage")
1994
+ })
1992
1995
  });
1993
1996
  }
1994
1997
  if (isLoading) {
1995
1998
  return /*#__PURE__*/jsx("div", {
1996
- className: "flex justify-around",
1999
+ className: "grow flex justify-center items-center",
1997
2000
  children: /*#__PURE__*/jsx(Spinner, {})
1998
2001
  });
1999
2002
  }
2003
+ if (isEmpty(results)) {
2004
+ return /*#__PURE__*/jsx("div", {
2005
+ className: "grow flex justify-center items-center",
2006
+ children: /*#__PURE__*/jsx(NoData, {
2007
+ title: t("neetoImageUploader.common.noImagesToShow")
2008
+ })
2009
+ });
2010
+ }
2000
2011
  return /*#__PURE__*/createElement(InfiniteScroller, {
2001
2012
  setSelectedImage: setSelectedImage,
2002
2013
  hasMore: hasNextPage,
@@ -2119,18 +2130,28 @@ var UnsplashLibrary = function UnsplashLibrary(_ref) {
2119
2130
  isError = _useFetchUnsplashImag.isError,
2120
2131
  isLoading = _useFetchUnsplashImag.isLoading;
2121
2132
  if (isError) {
2122
- return /*#__PURE__*/jsx(Typography, {
2123
- className: "mt-9 flex justify-center",
2124
- style: "body2",
2125
- children: t("neetoImageUploader.unsplash.errorMessage")
2133
+ return /*#__PURE__*/jsx("div", {
2134
+ className: "grow flex justify-center items-center",
2135
+ children: /*#__PURE__*/jsx(Typography, {
2136
+ style: "body2",
2137
+ children: t("neetoImageUploader.unsplash.errorMessage")
2138
+ })
2126
2139
  });
2127
2140
  }
2128
2141
  if (isLoading) {
2129
2142
  return /*#__PURE__*/jsx("div", {
2130
- className: "flex justify-around",
2143
+ className: "grow flex justify-center items-center",
2131
2144
  children: /*#__PURE__*/jsx(Spinner, {})
2132
2145
  });
2133
2146
  }
2147
+ if (isEmpty(results)) {
2148
+ return /*#__PURE__*/jsx("div", {
2149
+ className: "grow flex justify-center items-center",
2150
+ children: /*#__PURE__*/jsx(NoData, {
2151
+ title: t("neetoImageUploader.common.noImagesToShow")
2152
+ })
2153
+ });
2154
+ }
2134
2155
  return /*#__PURE__*/createElement(InfiniteScroller, {
2135
2156
  debouncedQuery: debouncedQuery,
2136
2157
  handleUnsplashImageSelect: handleUnsplashImageSelect,
@@ -2159,18 +2180,20 @@ var ImageLibrary = function ImageLibrary(_ref) {
2159
2180
  setQuery("");
2160
2181
  }, [tab]);
2161
2182
  return /*#__PURE__*/jsxs("div", {
2162
- className: "w-full px-6 pb-2 pt-1",
2163
- children: [/*#__PURE__*/jsx(Input, {
2164
- autoFocus: true,
2165
- className: "mb-4",
2166
- "data-testid": "niu-unsplash-image-picker-search-input",
2167
- name: "text",
2168
- placeholder: inputPlaceHolder,
2169
- value: query,
2170
- onChange: function onChange(_ref2) {
2171
- var value = _ref2.target.value;
2172
- return setQuery(value);
2173
- }
2183
+ className: "w-full px-6 py-4 grow flex flex-col",
2184
+ children: [/*#__PURE__*/jsx("div", {
2185
+ className: "mb-4 shrink-0",
2186
+ children: /*#__PURE__*/jsx(Input, {
2187
+ autoFocus: true,
2188
+ "data-testid": "niu-unsplash-image-picker-search-input",
2189
+ name: "text",
2190
+ placeholder: inputPlaceHolder,
2191
+ value: query,
2192
+ onChange: function onChange(_ref2) {
2193
+ var value = _ref2.target.value;
2194
+ return setQuery(value);
2195
+ }
2196
+ })
2174
2197
  }), tab === TABS[1].key ? /*#__PURE__*/jsx(Images, {
2175
2198
  debouncedQuery: debouncedQuery,
2176
2199
  query: query,
@@ -2295,7 +2318,7 @@ var Modal = function Modal(_ref) {
2295
2318
  var renderContent = function renderContent() {
2296
2319
  if (activeTab === "upload") {
2297
2320
  return /*#__PURE__*/jsx("div", {
2298
- className: "grow px-6 pb-6",
2321
+ className: "grow px-6 pb-6 pt-4",
2299
2322
  children: /*#__PURE__*/jsx("div", {
2300
2323
  className: "h-full w-full overflow-y-auto",
2301
2324
  children: /*#__PURE__*/jsx(ImageDirectUpload, {
@@ -2348,7 +2371,7 @@ var Modal = function Modal(_ref) {
2348
2371
  children: t("neetoImageUploader.common.imageLibrary")
2349
2372
  })
2350
2373
  }), /*#__PURE__*/jsx("div", {
2351
- className: "flex gap-2 px-6 py-2",
2374
+ className: "flex gap-2 px-6",
2352
2375
  children: /*#__PURE__*/jsx(Tab, {
2353
2376
  size: "small",
2354
2377
  children: TABS.map(function (tab) {
@@ -2365,6 +2388,7 @@ var Modal = function Modal(_ref) {
2365
2388
  }), renderContent(), equals(activeTab, TABS[2].key) && /*#__PURE__*/jsx(NeetoUIModal.Footer, {
2366
2389
  className: "flex items-center justify-center gap-2",
2367
2390
  children: /*#__PURE__*/jsx(Typography, {
2391
+ lineHeight: "none",
2368
2392
  style: "body2",
2369
2393
  children: /*#__PURE__*/jsx(Trans, {
2370
2394
  i18nKey: "neetoImageUploader.unsplash.poweredByUnsplash",
@@ -2383,4 +2407,4 @@ var Modal = function Modal(_ref) {
2383
2407
  };
2384
2408
 
2385
2409
  export { Modal as M, constructCloudflareImageURL as c };
2386
- //# sourceMappingURL=index-CSoe203Z.js.map
2410
+ //# sourceMappingURL=index-DxJCT8T_.js.map