@bigbinary/neeto-image-uploader-frontend 2.3.10 → 2.3.11
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/app/javascript/src/translations/en.json +1 -1
- package/dist/AssetLibrary.js +6 -5
- package/dist/AssetLibrary.js.map +1 -1
- package/dist/BasicImageUploader.js +3 -3
- package/dist/ImageUploader.js +4 -3
- package/dist/ImageUploader.js.map +1 -1
- package/dist/ImageWithFallback-Csv6Oivd.js +51 -0
- package/dist/ImageWithFallback-Csv6Oivd.js.map +1 -0
- package/dist/ImageWithFallback-DeznMgbx.js +53 -0
- package/dist/ImageWithFallback-DeznMgbx.js.map +1 -0
- package/dist/cjs/AssetLibrary.js +6 -5
- package/dist/cjs/AssetLibrary.js.map +1 -1
- package/dist/cjs/BasicImageUploader.js +4 -4
- package/dist/cjs/BasicImageUploader.js.map +1 -1
- package/dist/cjs/ImageUploader.js +5 -4
- package/dist/cjs/ImageUploader.js.map +1 -1
- package/dist/cjs/index.js +5 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/{index-By7BkNOh.js → index-BkKE5xo-.js} +124 -131
- package/dist/index-BkKE5xo-.js.map +1 -0
- package/dist/{index-vkjNhoF3.js → index-FbPHXCzL.js} +102 -109
- package/dist/index-FbPHXCzL.js.map +1 -0
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/{utils-tPaqWDxV.js → utils-BxC_k1lu.js} +100 -16
- package/dist/utils-BxC_k1lu.js.map +1 -0
- package/dist/{utils-B5WMTXlT.js → utils-WEbpTEyB.js} +100 -15
- package/dist/utils-WEbpTEyB.js.map +1 -0
- package/package.json +19 -18
- package/dist/ImageWithFallback-Dz9cyV2n.js +0 -144
- package/dist/ImageWithFallback-Dz9cyV2n.js.map +0 -1
- package/dist/ImageWithFallback-c9ANE1IE.js +0 -141
- package/dist/ImageWithFallback-c9ANE1IE.js.map +0 -1
- package/dist/index-By7BkNOh.js.map +0 -1
- package/dist/index-vkjNhoF3.js.map +0 -1
- package/dist/utils-B5WMTXlT.js.map +0 -1
- package/dist/utils-tPaqWDxV.js.map +0 -1
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import _objectWithoutProperties$1 from '@babel/runtime/helpers/objectWithoutProperties';
|
|
2
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
2
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
3
|
import require$$0, { useState, useEffect, useRef, useCallback, createElement } from 'react';
|
|
5
|
-
import {
|
|
4
|
+
import { isPresent, noop } from '@bigbinary/neeto-cist';
|
|
6
5
|
import { globalProps } from '@bigbinary/neeto-commons-frontend/initializers';
|
|
7
6
|
import NeetoUIModal from '@bigbinary/neetoui/Modal';
|
|
8
|
-
import Button from '@bigbinary/neetoui/Button';
|
|
9
7
|
import Tab from '@bigbinary/neetoui/Tab';
|
|
10
8
|
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
11
9
|
import Toastr from '@bigbinary/neetoui/Toastr';
|
|
12
10
|
import Typography from '@bigbinary/neetoui/Typography';
|
|
13
|
-
import {
|
|
11
|
+
import { mergeRight, identity, prop, equals } from 'ramda';
|
|
14
12
|
import { useTranslation, Trans } from 'react-i18next';
|
|
15
|
-
import {
|
|
13
|
+
import { b as isNilOrEmpty, c as DEFAULT_CROP_CONFIG, d as isItemsCenter, o as onImageLoaded, g as getCloudFlareCroppedURL, e as getImageKitCroppedURL, f as getCropValues, h as IMAGES_PER_PAGE, j as INFINITE_SCROLLER_SIZES, k as INFINITE_SCROLLER_STYLE, T as TABS, A as ASSETS_DESTROY_URL, l as ASSETS_FETCH_URL, U as UNSPLASH_DEFAULT_NAME, m as UNSPLASH_DEFAULT_REQUEST_CONFIG, D as DEFAULT_UPLOAD_CONFIG, u as useUploadDropzone, n as UNSPLASH_URL, a as ImageDirectUpload } from './utils-WEbpTEyB.js';
|
|
16
14
|
import { a as useCreateBlob, u as useImageUploader, g as generateASCIIFileName } from './useImageUploader-RX88_Cp-.js';
|
|
17
15
|
import { I as IS_DEVELOPMENT_OR_HEROKU_ENV, C as CLOUD_FLARE } from './index-CZjb2iXB.js';
|
|
18
16
|
import classnames from 'classnames';
|
|
19
17
|
import LeftArrow from '@bigbinary/neeto-icons/LeftArrow';
|
|
18
|
+
import Button from '@bigbinary/neetoui/Button';
|
|
20
19
|
import { useMutation, useInfiniteQuery, useQueryClient, keepPreviousData } from '@tanstack/react-query';
|
|
21
20
|
import axios from 'axios';
|
|
22
21
|
import { useDebounce } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
23
22
|
import { withEventTargetValue, hasPermission } from '@bigbinary/neeto-commons-frontend/utils';
|
|
24
23
|
import Input from '@bigbinary/neetoui/Input';
|
|
25
24
|
import Switch from '@bigbinary/neetoui/Switch';
|
|
25
|
+
import Label from '@bigbinary/neetoui/Label';
|
|
26
26
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
27
27
|
import { Q as QUERY_KEYS, A as ASSETS_STALE_TIME, U as UNSPLASH_STALE_TIME } from './query-B0eDmse7.js';
|
|
28
28
|
import MenuHorizontal from '@bigbinary/neeto-icons/MenuHorizontal';
|
|
@@ -42,15 +42,6 @@ var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r
|
|
|
42
42
|
var css$2 = ".niu-modal {\n width: 95vw !important;\n height: 75vh !important;\n max-width: 1152px !important;\n max-height: 576px !important;\n position: relative !important;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvX21vZGFsLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBR0E7RUFDRSxzQkFBQTtFQUNBLHVCQUFBO0VBQ0EsNEJBQUE7RUFDQSw0QkFBQTtFQUNBLDZCQUFBO0FBRkYiLCJzb3VyY2VzQ29udGVudCI6WyIvL0Fic3RyYWN0c1xuQGltcG9ydCBcIi4uL2Fic3RyYWN0cy92YXJpYWJsZXNcIjtcblxuLm5pdS1tb2RhbCB7XG4gIHdpZHRoOiAkbml1LW1vZGFsLXdpZHRoICFpbXBvcnRhbnQ7XG4gIGhlaWdodDogJG5pdS1tb2RhbC1oZWlnaHQgIWltcG9ydGFudDtcbiAgbWF4LXdpZHRoOiAkbml1LW1vZGFsLW1heC13aWR0aCAhaW1wb3J0YW50O1xuICBtYXgtaGVpZ2h0OiAkbml1LW1vZGFsLW1heC1oZWlnaHQgIWltcG9ydGFudDtcbiAgcG9zaXRpb246IHJlbGF0aXZlICFpbXBvcnRhbnQ7XG59XG4iXX0= */";
|
|
43
43
|
n(css$2,{});
|
|
44
44
|
|
|
45
|
-
var createOptions = function createOptions() {
|
|
46
|
-
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
47
|
-
return OPTIONS.map(function (option) {
|
|
48
|
-
return mergeLeft(findBy({
|
|
49
|
-
key: option.key
|
|
50
|
-
}, options), option);
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
|
|
54
45
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
55
46
|
|
|
56
47
|
function getDefaultExportFromCjs (x) {
|
|
@@ -281,11 +272,11 @@ var Controls = function Controls(_ref) {
|
|
|
281
272
|
setWidth(getActualCropWidth(crop.width));
|
|
282
273
|
}, [crop]);
|
|
283
274
|
return /*#__PURE__*/jsxs("div", {
|
|
284
|
-
className: "flex flex-col p-4 md:w-2/6
|
|
275
|
+
className: "flex flex-col space-y-6 p-4 md:w-2/6",
|
|
285
276
|
children: [!hideControls && /*#__PURE__*/jsxs(Fragment, {
|
|
286
277
|
children: [/*#__PURE__*/jsx(Switch, {
|
|
287
278
|
checked: isFullImage,
|
|
288
|
-
className: "
|
|
279
|
+
className: "w-full",
|
|
289
280
|
label: t("neetoImageUploader.labels.selectOriginalImage"),
|
|
290
281
|
onChange: function onChange() {
|
|
291
282
|
return setIsFullImage(function (isFullImage) {
|
|
@@ -294,48 +285,60 @@ var Controls = function Controls(_ref) {
|
|
|
294
285
|
}
|
|
295
286
|
}), /*#__PURE__*/jsx(Switch, {
|
|
296
287
|
checked: isAspectRatioLocked,
|
|
297
|
-
className: "
|
|
288
|
+
className: "w-full",
|
|
298
289
|
disabled: isFullImage,
|
|
299
290
|
label: t("neetoImageUploader.labels.lockAspectRatio"),
|
|
300
291
|
onChange: onToggleAspectRatioLock
|
|
301
|
-
}), /*#__PURE__*/jsx(Typography, {
|
|
302
|
-
className: "mb-2 mt-6",
|
|
303
|
-
style: "body2",
|
|
304
|
-
children: t("neetoImageUploader.imageEditor.aspectRatio")
|
|
305
292
|
}), /*#__PURE__*/jsxs("div", {
|
|
306
|
-
className: "flex
|
|
307
|
-
children: [/*#__PURE__*/jsx(
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
293
|
+
className: "flex w-full items-start gap-2",
|
|
294
|
+
children: [/*#__PURE__*/jsx(Label, {
|
|
295
|
+
className: "w-24 pt-2",
|
|
296
|
+
children: t("neetoImageUploader.imageEditor.aspectRatio")
|
|
297
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
298
|
+
className: "flex w-32 justify-between gap-1 self-start",
|
|
299
|
+
children: [/*#__PURE__*/jsx(Input, {
|
|
300
|
+
className: "w-12",
|
|
301
|
+
"data-cy": "aspect-ratio-width-input",
|
|
302
|
+
disabled: isFullImage,
|
|
303
|
+
type: "number",
|
|
304
|
+
value: aspectRatio.width,
|
|
305
|
+
onChange: withEventTargetValue(handleAspectWidthChange)
|
|
306
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
307
|
+
children: ":"
|
|
308
|
+
}), /*#__PURE__*/jsx(Input, {
|
|
309
|
+
className: "w-12",
|
|
310
|
+
"data-cy": "aspect-ratio-height-input",
|
|
311
|
+
disabled: isFullImage,
|
|
312
|
+
type: "number",
|
|
313
|
+
value: aspectRatio.height,
|
|
314
|
+
onChange: withEventTargetValue(handleAspectHeightChange)
|
|
315
|
+
})]
|
|
323
316
|
})]
|
|
324
317
|
})]
|
|
325
|
-
}), /*#__PURE__*/
|
|
326
|
-
className: "
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
318
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
319
|
+
className: "flex w-full items-start gap-2",
|
|
320
|
+
children: [/*#__PURE__*/jsx(Label, {
|
|
321
|
+
className: "w-24 pt-2",
|
|
322
|
+
children: t("neetoImageUploader.labels.width")
|
|
323
|
+
}), /*#__PURE__*/jsx(Input, {
|
|
324
|
+
className: "w-32 flex-grow-0",
|
|
325
|
+
disabled: isFullImage,
|
|
326
|
+
type: "number",
|
|
327
|
+
value: Math.round(width),
|
|
328
|
+
onChange: withEventTargetValue(setWidth)
|
|
329
|
+
})]
|
|
330
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
331
|
+
className: "flex w-full items-start gap-2",
|
|
332
|
+
children: [/*#__PURE__*/jsx(Label, {
|
|
333
|
+
className: "w-24 pt-2",
|
|
334
|
+
children: t("neetoImageUploader.labels.height")
|
|
335
|
+
}), /*#__PURE__*/jsx(Input, {
|
|
336
|
+
className: "w-32 flex-grow-0",
|
|
337
|
+
disabled: isFullImage,
|
|
338
|
+
type: "number",
|
|
339
|
+
value: Math.round(height),
|
|
340
|
+
onChange: withEventTargetValue(setHeight)
|
|
341
|
+
})]
|
|
339
342
|
}), /*#__PURE__*/jsx(Button, {
|
|
340
343
|
className: "mt-6 self-start",
|
|
341
344
|
"data-cy": "neeto-image-uploader-crop-submit-button",
|
|
@@ -1469,7 +1472,7 @@ var InfiniteScroller = function InfiniteScroller(_ref) {
|
|
|
1469
1472
|
className: "neeto-ui-rounded-sm neeto-ui-bg-gray-100 group absolute h-full w-full",
|
|
1470
1473
|
"data-cy": "library-image-card",
|
|
1471
1474
|
id: "unsplashImage".concat(image.id),
|
|
1472
|
-
children: [tab === TABS[
|
|
1475
|
+
children: [tab === TABS[2].key && /*#__PURE__*/jsxs(Fragment, {
|
|
1473
1476
|
children: [/*#__PURE__*/jsx("img", {
|
|
1474
1477
|
"data-cy": "niu-unsplash-image-".concat(index),
|
|
1475
1478
|
src: image === null || image === void 0 ? void 0 : (_image$urls = image.urls) === null || _image$urls === void 0 ? void 0 : _image$urls.regular,
|
|
@@ -1483,7 +1486,7 @@ var InfiniteScroller = function InfiniteScroller(_ref) {
|
|
|
1483
1486
|
target: "_blank",
|
|
1484
1487
|
children: [image === null || image === void 0 ? void 0 : (_image$user2 = image.user) === null || _image$user2 === void 0 ? void 0 : _image$user2.name, " | ", " ", t("neetoImageUploader.labels.unsplash")]
|
|
1485
1488
|
})]
|
|
1486
|
-
}), tab === TABS[
|
|
1489
|
+
}), tab === TABS[1].key && /*#__PURE__*/jsxs(Fragment, {
|
|
1487
1490
|
children: [hasPermission(VIEW_ROLES_PERMISSION) && isMenuButtonEnabled && /*#__PURE__*/jsx(Dropdown, {
|
|
1488
1491
|
buttonSize: "small",
|
|
1489
1492
|
buttonStyle: "tertiary",
|
|
@@ -1572,7 +1575,7 @@ var Images = function Images(_ref) {
|
|
|
1572
1575
|
images: results,
|
|
1573
1576
|
key: debouncedQuery,
|
|
1574
1577
|
loadMore: fetchNextPage,
|
|
1575
|
-
tab: TABS[
|
|
1578
|
+
tab: TABS[1].key
|
|
1576
1579
|
});
|
|
1577
1580
|
};
|
|
1578
1581
|
|
|
@@ -1684,7 +1687,7 @@ var UnsplashLibrary = function UnsplashLibrary(_ref) {
|
|
|
1684
1687
|
_context.prev = 9;
|
|
1685
1688
|
_context.t0 = _context["catch"](0);
|
|
1686
1689
|
Toastr.error(_context.t0);
|
|
1687
|
-
setActiveTab(TABS[
|
|
1690
|
+
setActiveTab(TABS[1].key);
|
|
1688
1691
|
setIsUploading(false);
|
|
1689
1692
|
case 14:
|
|
1690
1693
|
case "end":
|
|
@@ -1729,7 +1732,7 @@ var UnsplashLibrary = function UnsplashLibrary(_ref) {
|
|
|
1729
1732
|
images: results,
|
|
1730
1733
|
key: debouncedQuery,
|
|
1731
1734
|
loadMore: fetchNextPage,
|
|
1732
|
-
tab: TABS[
|
|
1735
|
+
tab: TABS[2].key
|
|
1733
1736
|
});
|
|
1734
1737
|
};
|
|
1735
1738
|
|
|
@@ -1745,15 +1748,15 @@ var ImageLibrary = function ImageLibrary(_ref) {
|
|
|
1745
1748
|
var _useTranslation = useTranslation(),
|
|
1746
1749
|
t = _useTranslation.t;
|
|
1747
1750
|
var debouncedQuery = useDebounce(query, 400);
|
|
1748
|
-
var inputPlaceHolder = equals(tab, TABS[
|
|
1751
|
+
var inputPlaceHolder = equals(tab, TABS[2].key) ? t("neetoImageUploader.placeholders.searchImageFromWeb") : t("neetoImageUploader.placeholders.searchImage");
|
|
1749
1752
|
useEffect(function () {
|
|
1750
1753
|
setQuery("");
|
|
1751
1754
|
}, [tab]);
|
|
1752
1755
|
return /*#__PURE__*/jsxs("div", {
|
|
1753
|
-
className: "w-full pb-2
|
|
1756
|
+
className: "w-full px-6 pb-2 pt-1",
|
|
1754
1757
|
children: [/*#__PURE__*/jsx(Input, {
|
|
1755
1758
|
autoFocus: true,
|
|
1756
|
-
className: "mb-4
|
|
1759
|
+
className: "mb-4",
|
|
1757
1760
|
"data-cy": "niu-unsplash-image-picker-search-input",
|
|
1758
1761
|
name: "text",
|
|
1759
1762
|
placeholder: inputPlaceHolder,
|
|
@@ -1762,7 +1765,7 @@ var ImageLibrary = function ImageLibrary(_ref) {
|
|
|
1762
1765
|
var value = _ref2.target.value;
|
|
1763
1766
|
return setQuery(value);
|
|
1764
1767
|
}
|
|
1765
|
-
}), tab === TABS[
|
|
1768
|
+
}), tab === TABS[1].key ? /*#__PURE__*/jsx(Images, {
|
|
1766
1769
|
debouncedQuery: debouncedQuery,
|
|
1767
1770
|
query: query,
|
|
1768
1771
|
setSelectedImage: setSelectedImage
|
|
@@ -1776,7 +1779,6 @@ var ImageLibrary = function ImageLibrary(_ref) {
|
|
|
1776
1779
|
});
|
|
1777
1780
|
};
|
|
1778
1781
|
|
|
1779
|
-
var _excluded = ["key"];
|
|
1780
1782
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1781
1783
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1782
1784
|
var Modal = function Modal(_ref) {
|
|
@@ -1873,19 +1875,31 @@ var Modal = function Modal(_ref) {
|
|
|
1873
1875
|
}),
|
|
1874
1876
|
getRootProps = _useUploadDropzone.getRootProps,
|
|
1875
1877
|
getInputProps = _useUploadDropzone.getInputProps,
|
|
1876
|
-
isDragActive = _useUploadDropzone.isDragActive
|
|
1877
|
-
inputRef = _useUploadDropzone.inputRef;
|
|
1878
|
-
var openFileUploadDialog = function openFileUploadDialog() {
|
|
1879
|
-
var _inputRef$current;
|
|
1880
|
-
return (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.click();
|
|
1881
|
-
};
|
|
1882
|
-
var options = createOptions([{
|
|
1883
|
-
key: "local",
|
|
1884
|
-
onClick: openFileUploadDialog
|
|
1885
|
-
}]);
|
|
1878
|
+
isDragActive = _useUploadDropzone.isDragActive;
|
|
1886
1879
|
useEffect(function () {
|
|
1887
1880
|
setActiveTab(TABS[0].key);
|
|
1888
1881
|
}, [isOpen]);
|
|
1882
|
+
var renderContent = function renderContent() {
|
|
1883
|
+
if (activeTab === "upload") {
|
|
1884
|
+
return /*#__PURE__*/jsx("div", {
|
|
1885
|
+
className: "flex-grow px-6 pb-6",
|
|
1886
|
+
children: /*#__PURE__*/jsx("div", {
|
|
1887
|
+
className: "h-full w-full overflow-y-auto",
|
|
1888
|
+
children: /*#__PURE__*/jsx(ImageDirectUpload, {
|
|
1889
|
+
isDisabled: isPresent(fixedAspectRatio),
|
|
1890
|
+
uploadConfig: uploadConfigWithDefaults,
|
|
1891
|
+
onDrop: uploadFile
|
|
1892
|
+
})
|
|
1893
|
+
})
|
|
1894
|
+
});
|
|
1895
|
+
}
|
|
1896
|
+
return /*#__PURE__*/jsx(ImageLibrary, {
|
|
1897
|
+
setActiveTab: setActiveTab,
|
|
1898
|
+
setIsUploading: setIsUploading,
|
|
1899
|
+
setSelectedImage: setSelectedImage,
|
|
1900
|
+
tab: activeTab
|
|
1901
|
+
});
|
|
1902
|
+
};
|
|
1889
1903
|
return /*#__PURE__*/jsxs(NeetoUIModal, {
|
|
1890
1904
|
isOpen: isOpen,
|
|
1891
1905
|
className: "niu-modal",
|
|
@@ -1909,7 +1923,7 @@ var Modal = function Modal(_ref) {
|
|
|
1909
1923
|
image: selectedImage,
|
|
1910
1924
|
signedId: selectedImage === null || selectedImage === void 0 ? void 0 : selectedImage.signedId
|
|
1911
1925
|
}) : /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
|
|
1912
|
-
className: "h-full flex-col"
|
|
1926
|
+
className: "flex h-full flex-col"
|
|
1913
1927
|
}, getRootProps({
|
|
1914
1928
|
onClick: function onClick(event) {
|
|
1915
1929
|
return event.stopPropagation();
|
|
@@ -1921,42 +1935,21 @@ var Modal = function Modal(_ref) {
|
|
|
1921
1935
|
children: t("neetoImageUploader.common.imageLibrary")
|
|
1922
1936
|
})
|
|
1923
1937
|
}), /*#__PURE__*/jsx("div", {
|
|
1924
|
-
className: "px-6 py-2",
|
|
1925
|
-
children: /*#__PURE__*/
|
|
1926
|
-
|
|
1927
|
-
children:
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
return
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
},
|
|
1938
|
-
children: tab.label
|
|
1939
|
-
}, tab.key);
|
|
1940
|
-
})
|
|
1941
|
-
})
|
|
1942
|
-
}), /*#__PURE__*/jsx("div", {
|
|
1943
|
-
className: "flex gap-2",
|
|
1944
|
-
children: options.map(function (_ref2) {
|
|
1945
|
-
var key = _ref2.key,
|
|
1946
|
-
otherProps = _objectWithoutProperties$1(_ref2, _excluded);
|
|
1947
|
-
return /*#__PURE__*/createElement(Button, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
1948
|
-
key: key,
|
|
1949
|
-
size: "small"
|
|
1950
|
-
}));
|
|
1951
|
-
})
|
|
1952
|
-
})]
|
|
1938
|
+
className: "flex gap-2 px-6 py-2",
|
|
1939
|
+
children: /*#__PURE__*/jsx(Tab, {
|
|
1940
|
+
size: "small",
|
|
1941
|
+
children: TABS.map(function (tab) {
|
|
1942
|
+
return /*#__PURE__*/jsx(Tab.Item, {
|
|
1943
|
+
active: activeTab === tab.key,
|
|
1944
|
+
"data-cy": tab.dataCy,
|
|
1945
|
+
onClick: function onClick() {
|
|
1946
|
+
return setActiveTab(tab.key);
|
|
1947
|
+
},
|
|
1948
|
+
children: tab.label
|
|
1949
|
+
}, tab.key);
|
|
1950
|
+
})
|
|
1953
1951
|
})
|
|
1954
|
-
}), /*#__PURE__*/jsx(
|
|
1955
|
-
setActiveTab: setActiveTab,
|
|
1956
|
-
setIsUploading: setIsUploading,
|
|
1957
|
-
setSelectedImage: setSelectedImage,
|
|
1958
|
-
tab: activeTab
|
|
1959
|
-
}), equals(activeTab, TABS[1].key) && /*#__PURE__*/jsx(NeetoUIModal.Footer, {
|
|
1952
|
+
}), renderContent(), equals(activeTab, TABS[2].key) && /*#__PURE__*/jsx(NeetoUIModal.Footer, {
|
|
1960
1953
|
className: "flex items-center justify-center gap-2",
|
|
1961
1954
|
children: /*#__PURE__*/jsx(Typography, {
|
|
1962
1955
|
style: "body2",
|
|
@@ -1977,4 +1970,4 @@ var Modal = function Modal(_ref) {
|
|
|
1977
1970
|
};
|
|
1978
1971
|
|
|
1979
1972
|
export { Modal as M, constructCloudflareImageURL as c };
|
|
1980
|
-
//# sourceMappingURL=index-
|
|
1973
|
+
//# sourceMappingURL=index-FbPHXCzL.js.map
|