@bigbinary/neeto-image-uploader-frontend 2.3.9 → 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 +9 -8
- package/dist/AssetLibrary.js.map +1 -1
- package/dist/BasicImageUploader.js +4 -4
- package/dist/ImageUploader.js +7 -6
- 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 +9 -8
- package/dist/cjs/AssetLibrary.js.map +1 -1
- package/dist/cjs/BasicImageUploader.js +10 -18
- package/dist/cjs/BasicImageUploader.js.map +1 -1
- package/dist/cjs/ImageUploader.js +19 -29
- package/dist/cjs/ImageUploader.js.map +1 -1
- package/dist/cjs/hooks.js +4 -6
- package/dist/cjs/hooks.js.map +1 -1
- package/dist/cjs/index.js +8 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/utils.js +1 -3
- package/dist/cjs/utils.js.map +1 -1
- package/dist/hooks.js +4 -4
- package/dist/{index-9fdcdfac.js → index-BkKE5xo-.js} +179 -213
- package/dist/index-BkKE5xo-.js.map +1 -0
- package/dist/{index-cf7e4b89.js → index-BtHfh_eu.js} +2 -3
- package/dist/{index-cf7e4b89.js.map → index-BtHfh_eu.js.map} +1 -1
- package/dist/{index-8605e11c.js → index-CZjb2iXB.js} +2 -3
- package/dist/{index-8605e11c.js.map → index-CZjb2iXB.js.map} +1 -1
- package/dist/{index-a3668c72.js → index-FbPHXCzL.js} +107 -118
- package/dist/index-FbPHXCzL.js.map +1 -0
- package/dist/index.js +8 -7
- package/dist/index.js.map +1 -1
- package/dist/{query-dcc7b81b.js → query-B0eDmse7.js} +1 -1
- package/dist/{query-dcc7b81b.js.map → query-B0eDmse7.js.map} +1 -1
- package/dist/{query-3c31bf92.js → query-B7ahlELA.js} +1 -1
- package/dist/{query-3c31bf92.js.map → query-B7ahlELA.js.map} +1 -1
- package/dist/{useImageUploader-49fd1436.js → useImageUploader-Bm9TukCy.js} +16 -24
- package/dist/useImageUploader-Bm9TukCy.js.map +1 -0
- package/dist/{useImageUploader-9c1a27d0.js → useImageUploader-RX88_Cp-.js} +4 -4
- package/dist/{useImageUploader-9c1a27d0.js.map → useImageUploader-RX88_Cp-.js.map} +1 -1
- package/dist/{useProfileImageUpload-faa539d7.js → useProfileImageUpload-KpvcwEqx.js} +3 -3
- package/dist/{useProfileImageUpload-faa539d7.js.map → useProfileImageUpload-KpvcwEqx.js.map} +1 -1
- package/dist/{useProfileImageUpload-9c1d2b0f.js → useProfileImageUpload-UUrg2Lkw.js} +19 -26
- package/dist/useProfileImageUpload-UUrg2Lkw.js.map +1 -0
- package/dist/{utils-ede1695e.js → utils-BxC_k1lu.js} +105 -27
- package/dist/utils-BxC_k1lu.js.map +1 -0
- package/dist/{utils-fa0fa918.js → utils-WEbpTEyB.js} +101 -16
- package/dist/utils-WEbpTEyB.js.map +1 -0
- package/dist/utils.js +1 -1
- package/package.json +21 -20
- package/dist/ImageWithFallback-1ddf3f25.js +0 -154
- package/dist/ImageWithFallback-1ddf3f25.js.map +0 -1
- package/dist/ImageWithFallback-933ea4b1.js +0 -141
- package/dist/ImageWithFallback-933ea4b1.js.map +0 -1
- package/dist/index-9fdcdfac.js.map +0 -1
- package/dist/index-a3668c72.js.map +0 -1
- package/dist/useImageUploader-49fd1436.js.map +0 -1
- package/dist/useProfileImageUpload-9c1d2b0f.js.map +0 -1
- package/dist/utils-ede1695e.js.map +0 -1
- package/dist/utils-fa0fa918.js.map +0 -1
|
@@ -1,30 +1,30 @@
|
|
|
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 {
|
|
16
|
-
import {
|
|
17
|
-
import { I as IS_DEVELOPMENT_OR_HEROKU_ENV, C as CLOUD_FLARE } from './index-
|
|
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';
|
|
14
|
+
import { a as useCreateBlob, u as useImageUploader, g as generateASCIIFileName } from './useImageUploader-RX88_Cp-.js';
|
|
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
|
-
import { Q as QUERY_KEYS, A as ASSETS_STALE_TIME, U as UNSPLASH_STALE_TIME } from './query-
|
|
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';
|
|
29
29
|
import { VIEW_ROLES_PERMISSION } from '@bigbinary/neeto-team-members-frontend/constants';
|
|
30
30
|
import Alert from '@bigbinary/neetoui/Alert';
|
|
@@ -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) {
|
|
@@ -84,11 +75,9 @@ function getAugmentedNamespace(n) {
|
|
|
84
75
|
|
|
85
76
|
var ReactCrop_min = {exports: {}};
|
|
86
77
|
|
|
87
|
-
ReactCrop_min.exports;
|
|
88
|
-
|
|
89
78
|
(function (module, exports) {
|
|
90
79
|
!function(e,t){module.exports=t(require$$0);}(commonjsGlobal,(e=>(()=>{var t={899:t=>{t.exports=e;}},n={};function o(e){var r=n[e];if(void 0!==r)return r.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]});},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});};var r={};return (()=>{o.r(r),o.d(r,{Component:()=>u,areCropsEqual:()=>h,centerCrop:()=>d,clamp:()=>a,containCrop:()=>p,convertToPercentCrop:()=>c,convertToPixelCrop:()=>l,default:()=>u,defaultCrop:()=>i,makeAspectCrop:()=>s,nudgeCrop:()=>g});var e=o(899),t=o.n(e);function n(e){var t,o,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(o=n(e[t]))&&(r&&(r+=" "),r+=o);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}const i={x:0,y:0,width:0,height:0,unit:"px"};function a(e,t,n){return Math.min(Math.max(e,t),n)}function h(e,t){return e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit}function s(e,t,n,o){const r=l(e,n,o);return e.width&&(r.height=r.width/t),e.height&&(r.width=r.height*t),r.y+r.height>o&&(r.height=o-r.y,r.width=r.height*t),r.x+r.width>n&&(r.width=n-r.x,r.height=r.width/t),"%"===e.unit?c(r,n,o):r}function d(e,t,n){const o=l(e,t,n);return o.x=(t-o.width)/2,o.y=(n-o.height)/2,"%"===e.unit?c(o,t,n):o}function c(e,t,n){return "%"===e.unit?{...i,...e,unit:"%"}:{unit:"%",x:e.x?e.x/t*100:0,y:e.y?e.y/n*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/n*100:0}}function l(e,t,n){return e.unit?"px"===e.unit?{...i,...e,unit:"px"}:{unit:"px",x:e.x?e.x*t/100:0,y:e.y?e.y*n/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*n/100:0}:{...i,...e,unit:"px"}}function p(e,t,n,o,r,i=0,a=0,h=o,s=r){const d={...e};let c=Math.min(i,o),l=Math.min(a,r),p=Math.min(h,o),g=Math.min(s,r);t&&(t>1?(c=a?a*t:c,l=c/t,p=h*t):(l=i?i/t:l,c=l*t,g=s/t)),d.y<0&&(d.height=Math.max(d.height+d.y,l),d.y=0),d.x<0&&(d.width=Math.max(d.width+d.x,c),d.x=0);const w=o-(d.x+d.width);w<0&&(d.x=Math.min(d.x,o-c),d.width+=w);const u=r-(d.y+d.height);if(u<0&&(d.y=Math.min(d.y,r-l),d.height+=u),d.width<c&&("sw"!==n&&"nw"!=n||(d.x-=c-d.width),d.width=c),d.height<l&&("nw"!==n&&"ne"!=n||(d.y-=l-d.height),d.height=l),d.width>p&&("sw"!==n&&"nw"!=n||(d.x-=p-d.width),d.width=p),d.height>g&&("nw"!==n&&"ne"!=n||(d.y-=g-d.height),d.height=g),t){const e=d.width/d.height;if(e<t){const e=Math.max(d.width/t,l);"nw"!==n&&"ne"!=n||(d.y-=e-d.height),d.height=e;}else if(e>t){const e=Math.max(d.height*t,c);"sw"!==n&&"nw"!=n||(d.x-=e-d.width),d.width=e;}}return d}function g(e,t,n,o){const r={...e};return "ArrowLeft"===t?"nw"===o?(r.x-=n,r.y-=n,r.width+=n,r.height+=n):"w"===o?(r.x-=n,r.width+=n):"sw"===o?(r.x-=n,r.width+=n,r.height+=n):"ne"===o?(r.y+=n,r.width-=n,r.height-=n):"e"===o?r.width-=n:"se"===o&&(r.width-=n,r.height-=n):"ArrowRight"===t&&("nw"===o?(r.x+=n,r.y+=n,r.width-=n,r.height-=n):"w"===o?(r.x+=n,r.width-=n):"sw"===o?(r.x+=n,r.width-=n,r.height-=n):"ne"===o?(r.y-=n,r.width+=n,r.height+=n):"e"===o?r.width+=n:"se"===o&&(r.width+=n,r.height+=n)),"ArrowUp"===t?"nw"===o?(r.x-=n,r.y-=n,r.width+=n,r.height+=n):"n"===o?(r.y-=n,r.height+=n):"ne"===o?(r.y-=n,r.width+=n,r.height+=n):"sw"===o?(r.x+=n,r.width-=n,r.height-=n):"s"===o?r.height-=n:"se"===o&&(r.width-=n,r.height-=n):"ArrowDown"===t&&("nw"===o?(r.x+=n,r.y+=n,r.width-=n,r.height-=n):"n"===o?(r.y+=n,r.height-=n):"ne"===o?(r.y+=n,r.width-=n,r.height-=n):"sw"===o?(r.x-=n,r.width+=n,r.height+=n):"s"===o?r.height+=n:"se"===o&&(r.width+=n,r.height+=n)),r}const w={capture:!0,passive:!1};class u extends e.PureComponent{constructor(){super(...arguments),this.docMoveBound=!1,this.mouseDownOnCrop=!1,this.dragStarted=!1,this.evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0},this.componentRef=(0, e.createRef)(),this.mediaRef=(0, e.createRef)(),this.initChangeCalled=!1,this.state={cropIsActive:!1,newCropIsBeingDrawn:!1},this.onCropPointerDown=e=>{const{crop:t,disabled:n}=this.props,o=this.getBox();if(!t)return;const r=l(t,o.width,o.height);if(n)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});const i=e.target.dataset.ord,a=Boolean(i);let h=e.clientX,s=e.clientY,d=r.x,c=r.y;if(i){const t=e.clientX-o.x,n=e.clientY-o.y;let a=0,l=0;"ne"===i||"e"==i?(a=t-(r.x+r.width),l=n-r.y,d=r.x,c=r.y+r.height):"se"===i||"s"===i?(a=t-(r.x+r.width),l=n-(r.y+r.height),d=r.x,c=r.y):"sw"===i||"w"==i?(a=t-r.x,l=n-(r.y+r.height),d=r.x+r.width,c=r.y):"nw"!==i&&"n"!=i||(a=t-r.x,l=n-r.y,d=r.x+r.width,c=r.y+r.height),h=d+o.x+a,s=c+o.y+l;}this.evData={startClientX:h,startClientY:s,startCropX:d,startCropY:c,clientX:e.clientX,clientY:e.clientY,isResize:a,ord:i},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0});},this.onComponentPointerDown=e=>{const{crop:t,disabled:n,locked:o,keepSelection:r,onChange:i}=this.props,a=this.getBox();if(n||o||r&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});const h=e.clientX-a.x,s=e.clientY-a.y,d={unit:"px",x:h,y:s,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:h,startCropY:s,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,i(l(d,a.width,a.height),c(d,a.width,a.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0});},this.onDocPointerMove=e=>{const{crop:t,disabled:n,onChange:o,onDragStart:r}=this.props,i=this.getBox();if(n||!t||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,r&&r(e));const{evData:a}=this;let s;a.clientX=e.clientX,a.clientY=e.clientY,s=a.isResize?this.resizeCrop():this.dragCrop(),h(t,s)||o(l(s,i.width,i.height),c(s,i.width,i.height));},this.onComponentKeyDown=e=>{const{crop:t,disabled:n,onChange:o,onComplete:r}=this.props,i=this.getBox();if(n)return;const h=e.key;let s=!1;if(!t)return;const d=this.makePixelCrop(),p=(navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)?u.nudgeStepLarge:e.shiftKey?u.nudgeStepMedium:u.nudgeStep;if("ArrowLeft"===h?(d.x-=p,s=!0):"ArrowRight"===h?(d.x+=p,s=!0):"ArrowUp"===h?(d.y-=p,s=!0):"ArrowDown"===h&&(d.y+=p,s=!0),s){e.cancelable&&e.preventDefault(),d.x=a(d.x,0,i.width-d.width),d.y=a(d.y,0,i.height-d.height);const t=l(d,i.width,i.height),n=c(d,i.width,i.height);o(t,n),r&&r(t,n);}},this.onHandlerKeyDown=(e,t)=>{const{aspect:n=0,crop:o,disabled:r,minWidth:i=0,minHeight:a=0,maxWidth:s,maxHeight:d,onChange:w,onComplete:m}=this.props,y=this.getBox();if(r||!o)return;if("ArrowUp"!==e.key&&"ArrowDown"!==e.key&&"ArrowLeft"!==e.key&&"ArrowRight"!==e.key)return;e.stopPropagation(),e.preventDefault();const x=(navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)?u.nudgeStepLarge:e.shiftKey?u.nudgeStepMedium:u.nudgeStep,C=p(g(l(o,y.width,y.height),e.key,x,t),n,t,y.width,y.height,i,a,s,d);if(!h(o,C)){const e=c(C,y.width,y.height);w(C,e),m&&m(C,e);}},this.onDocPointerDone=e=>{const{crop:t,disabled:n,onComplete:o,onDragEnd:r}=this.props,i=this.getBox();this.unbindDocMove(),!n&&t&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,r&&r(e),o&&o(l(t,i.width,i.height),c(t,i.width,i.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}));},this.onDragFocus=e=>{var t;null===(t=this.componentRef.current)||void 0===t||t.scrollTo(0,0);};}get document(){return document}getBox(){const e=this.mediaRef.current;if(!e)return {x:0,y:0,width:0,height:0};const{x:t,y:n,width:o,height:r}=e.getBoundingClientRect();return {x:t,y:n,width:o,height:r}}componentDidUpdate(e){const{crop:t,onComplete:n}=this.props;if(n&&!e.crop&&t){const{width:e,height:o}=this.getBox();e&&o&&n(l(t,e,o),c(t,e,o));}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect();}bindDocMove(){this.docMoveBound||(this.document.addEventListener("pointermove",this.onDocPointerMove,w),this.document.addEventListener("pointerup",this.onDocPointerDone,w),this.document.addEventListener("pointercancel",this.onDocPointerDone,w),this.docMoveBound=!0);}unbindDocMove(){this.docMoveBound&&(this.document.removeEventListener("pointermove",this.onDocPointerMove,w),this.document.removeEventListener("pointerup",this.onDocPointerDone,w),this.document.removeEventListener("pointercancel",this.onDocPointerDone,w),this.docMoveBound=!1);}getCropStyle(){const{crop:e}=this.props;if(e)return {top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){const{evData:e}=this,t=this.getBox(),n=this.makePixelCrop(),o=e.clientX-e.startClientX,r=e.clientY-e.startClientY;return n.x=a(e.startCropX+o,0,t.width-n.width),n.y=a(e.startCropY+r,0,t.height-n.height),n}getPointRegion(e){const{evData:t}=this,n=t.clientX-e.x,o=t.clientY-e.y<t.startCropY;return n<t.startCropX?o?"nw":"sw":o?"ne":"se"}resizeCrop(){const{evData:e}=this,t=this.getBox(),{aspect:n=0,minWidth:o=0,minHeight:r=0,maxWidth:i,maxHeight:a}=this.props,h=this.getPointRegion(t),s=this.makePixelCrop(),d=e.ord?e.ord:h,c=e.clientX-e.startClientX,l=e.clientY-e.startClientY,g={unit:"px",x:0,y:0,width:0,height:0};"ne"===h?(g.x=e.startCropX,g.width=c,n?(g.height=g.width/n,g.y=e.startCropY-g.height):(g.height=Math.abs(l),g.y=e.startCropY-g.height)):"se"===h?(g.x=e.startCropX,g.y=e.startCropY,g.width=c,g.height=n?g.width/n:l):"sw"===h?(g.x=e.startCropX+c,g.y=e.startCropY,g.width=Math.abs(c),g.height=n?g.width/n:l):"nw"===h&&(g.x=e.startCropX+c,g.width=Math.abs(c),n?(g.height=g.width/n,g.y=e.startCropY-g.height):(g.height=Math.abs(l),g.y=e.startCropY+l));const w=p(g,n,h,t.width,t.height,o,r,i,a);return n||u.xyOrds.indexOf(d)>-1?(s.x=w.x,s.y=w.y,s.width=w.width,s.height=w.height):u.xOrds.indexOf(d)>-1?(s.x=w.x,s.width=w.width):u.yOrds.indexOf(d)>-1&&(s.y=w.y,s.height=w.height),s}createCropSelection(){const{ariaLabels:e=u.defaultProps.ariaLabels,disabled:n,locked:o,renderSelectionAddon:r,ruleOfThirds:i,crop:a}=this.props,h=this.getCropStyle();if(a)return t().createElement("div",{style:h,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":e.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!n&&!o&&t().createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},t().createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),t().createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),t().createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),t().createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),t().createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":e.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"nw"),role:"button"}),t().createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":e.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"n"),role:"button"}),t().createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":e.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"ne"),role:"button"}),t().createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":e.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"e"),role:"button"}),t().createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":e.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"se"),role:"button"}),t().createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":e.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"s"),role:"button"}),t().createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":e.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"sw"),role:"button"}),t().createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":e.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"w"),role:"button"})),r&&t().createElement("div",{className:"ReactCrop__selection-addon",onMouseDown:e=>e.stopPropagation()},r(this.state)),i&&t().createElement(t().Fragment,null,t().createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),t().createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(){const e={...i,...this.props.crop||{}},t=this.getBox();return l(e,t.width,t.height)}render(){const{aspect:e,children:o,circularCrop:r,className:i,crop:a,disabled:h,locked:s,style:d,ruleOfThirds:c}=this.props,{cropIsActive:l,newCropIsBeingDrawn:p}=this.state,g=a?this.createCropSelection():null,w=function(){for(var e,t,o=0,r="";o<arguments.length;)(e=arguments[o++])&&(t=n(e))&&(r&&(r+=" "),r+=t);return r}("ReactCrop",i,{"ReactCrop--active":l,"ReactCrop--disabled":h,"ReactCrop--locked":s,"ReactCrop--new-crop":p,"ReactCrop--fixed-aspect":a&&e,"ReactCrop--circular-crop":a&&r,"ReactCrop--rule-of-thirds":a&&c,"ReactCrop--invisible-crop":!this.dragStarted&&a&&!a.width&&!a.height});return t().createElement("div",{ref:this.componentRef,className:w,style:d},t().createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},o),g)}}u.xOrds=["e","w"],u.yOrds=["n","s"],u.xyOrds=["nw","ne","se","sw"],u.nudgeStep=1,u.nudgeStepMedium=10,u.nudgeStepLarge=100,u.defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};})(),r})()));
|
|
91
|
-
} (ReactCrop_min
|
|
80
|
+
} (ReactCrop_min));
|
|
92
81
|
|
|
93
82
|
var ReactCrop_minExports = ReactCrop_min.exports;
|
|
94
83
|
var ReactCrop = /*@__PURE__*/getDefaultExportFromCjs(ReactCrop_minExports);
|
|
@@ -283,11 +272,11 @@ var Controls = function Controls(_ref) {
|
|
|
283
272
|
setWidth(getActualCropWidth(crop.width));
|
|
284
273
|
}, [crop]);
|
|
285
274
|
return /*#__PURE__*/jsxs("div", {
|
|
286
|
-
className: "flex flex-col p-4 md:w-2/6
|
|
275
|
+
className: "flex flex-col space-y-6 p-4 md:w-2/6",
|
|
287
276
|
children: [!hideControls && /*#__PURE__*/jsxs(Fragment, {
|
|
288
277
|
children: [/*#__PURE__*/jsx(Switch, {
|
|
289
278
|
checked: isFullImage,
|
|
290
|
-
className: "
|
|
279
|
+
className: "w-full",
|
|
291
280
|
label: t("neetoImageUploader.labels.selectOriginalImage"),
|
|
292
281
|
onChange: function onChange() {
|
|
293
282
|
return setIsFullImage(function (isFullImage) {
|
|
@@ -296,48 +285,60 @@ var Controls = function Controls(_ref) {
|
|
|
296
285
|
}
|
|
297
286
|
}), /*#__PURE__*/jsx(Switch, {
|
|
298
287
|
checked: isAspectRatioLocked,
|
|
299
|
-
className: "
|
|
288
|
+
className: "w-full",
|
|
300
289
|
disabled: isFullImage,
|
|
301
290
|
label: t("neetoImageUploader.labels.lockAspectRatio"),
|
|
302
291
|
onChange: onToggleAspectRatioLock
|
|
303
|
-
}), /*#__PURE__*/jsx(Typography, {
|
|
304
|
-
className: "mb-2 mt-6",
|
|
305
|
-
style: "body2",
|
|
306
|
-
children: t("neetoImageUploader.imageEditor.aspectRatio")
|
|
307
292
|
}), /*#__PURE__*/jsxs("div", {
|
|
308
|
-
className: "flex
|
|
309
|
-
children: [/*#__PURE__*/jsx(
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
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
|
+
})]
|
|
325
316
|
})]
|
|
326
317
|
})]
|
|
327
|
-
}), /*#__PURE__*/
|
|
328
|
-
className: "
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
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
|
+
})]
|
|
341
342
|
}), /*#__PURE__*/jsx(Button, {
|
|
342
343
|
className: "mt-6 self-start",
|
|
343
344
|
"data-cy": "neeto-image-uploader-crop-submit-button",
|
|
@@ -926,15 +927,13 @@ var bricks = function bricks() {
|
|
|
926
927
|
|
|
927
928
|
var bricks_module = /*#__PURE__*/Object.freeze({
|
|
928
929
|
__proto__: null,
|
|
929
|
-
|
|
930
|
+
default: bricks
|
|
930
931
|
});
|
|
931
932
|
|
|
932
933
|
var require$$2 = /*@__PURE__*/getAugmentedNamespace(bricks_module);
|
|
933
934
|
|
|
934
935
|
var InfiniteScroll = {exports: {}};
|
|
935
936
|
|
|
936
|
-
InfiniteScroll.exports;
|
|
937
|
-
|
|
938
937
|
(function (module, exports) {
|
|
939
938
|
|
|
940
939
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -1473,7 +1472,7 @@ var InfiniteScroller = function InfiniteScroller(_ref) {
|
|
|
1473
1472
|
className: "neeto-ui-rounded-sm neeto-ui-bg-gray-100 group absolute h-full w-full",
|
|
1474
1473
|
"data-cy": "library-image-card",
|
|
1475
1474
|
id: "unsplashImage".concat(image.id),
|
|
1476
|
-
children: [tab === TABS[
|
|
1475
|
+
children: [tab === TABS[2].key && /*#__PURE__*/jsxs(Fragment, {
|
|
1477
1476
|
children: [/*#__PURE__*/jsx("img", {
|
|
1478
1477
|
"data-cy": "niu-unsplash-image-".concat(index),
|
|
1479
1478
|
src: image === null || image === void 0 ? void 0 : (_image$urls = image.urls) === null || _image$urls === void 0 ? void 0 : _image$urls.regular,
|
|
@@ -1487,7 +1486,7 @@ var InfiniteScroller = function InfiniteScroller(_ref) {
|
|
|
1487
1486
|
target: "_blank",
|
|
1488
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")]
|
|
1489
1488
|
})]
|
|
1490
|
-
}), tab === TABS[
|
|
1489
|
+
}), tab === TABS[1].key && /*#__PURE__*/jsxs(Fragment, {
|
|
1491
1490
|
children: [hasPermission(VIEW_ROLES_PERMISSION) && isMenuButtonEnabled && /*#__PURE__*/jsx(Dropdown, {
|
|
1492
1491
|
buttonSize: "small",
|
|
1493
1492
|
buttonStyle: "tertiary",
|
|
@@ -1576,7 +1575,7 @@ var Images = function Images(_ref) {
|
|
|
1576
1575
|
images: results,
|
|
1577
1576
|
key: debouncedQuery,
|
|
1578
1577
|
loadMore: fetchNextPage,
|
|
1579
|
-
tab: TABS[
|
|
1578
|
+
tab: TABS[1].key
|
|
1580
1579
|
});
|
|
1581
1580
|
};
|
|
1582
1581
|
|
|
@@ -1688,7 +1687,7 @@ var UnsplashLibrary = function UnsplashLibrary(_ref) {
|
|
|
1688
1687
|
_context.prev = 9;
|
|
1689
1688
|
_context.t0 = _context["catch"](0);
|
|
1690
1689
|
Toastr.error(_context.t0);
|
|
1691
|
-
setActiveTab(TABS[
|
|
1690
|
+
setActiveTab(TABS[1].key);
|
|
1692
1691
|
setIsUploading(false);
|
|
1693
1692
|
case 14:
|
|
1694
1693
|
case "end":
|
|
@@ -1733,7 +1732,7 @@ var UnsplashLibrary = function UnsplashLibrary(_ref) {
|
|
|
1733
1732
|
images: results,
|
|
1734
1733
|
key: debouncedQuery,
|
|
1735
1734
|
loadMore: fetchNextPage,
|
|
1736
|
-
tab: TABS[
|
|
1735
|
+
tab: TABS[2].key
|
|
1737
1736
|
});
|
|
1738
1737
|
};
|
|
1739
1738
|
|
|
@@ -1749,15 +1748,15 @@ var ImageLibrary = function ImageLibrary(_ref) {
|
|
|
1749
1748
|
var _useTranslation = useTranslation(),
|
|
1750
1749
|
t = _useTranslation.t;
|
|
1751
1750
|
var debouncedQuery = useDebounce(query, 400);
|
|
1752
|
-
var inputPlaceHolder = equals(tab, TABS[
|
|
1751
|
+
var inputPlaceHolder = equals(tab, TABS[2].key) ? t("neetoImageUploader.placeholders.searchImageFromWeb") : t("neetoImageUploader.placeholders.searchImage");
|
|
1753
1752
|
useEffect(function () {
|
|
1754
1753
|
setQuery("");
|
|
1755
1754
|
}, [tab]);
|
|
1756
1755
|
return /*#__PURE__*/jsxs("div", {
|
|
1757
|
-
className: "w-full pb-2
|
|
1756
|
+
className: "w-full px-6 pb-2 pt-1",
|
|
1758
1757
|
children: [/*#__PURE__*/jsx(Input, {
|
|
1759
1758
|
autoFocus: true,
|
|
1760
|
-
className: "mb-4
|
|
1759
|
+
className: "mb-4",
|
|
1761
1760
|
"data-cy": "niu-unsplash-image-picker-search-input",
|
|
1762
1761
|
name: "text",
|
|
1763
1762
|
placeholder: inputPlaceHolder,
|
|
@@ -1766,7 +1765,7 @@ var ImageLibrary = function ImageLibrary(_ref) {
|
|
|
1766
1765
|
var value = _ref2.target.value;
|
|
1767
1766
|
return setQuery(value);
|
|
1768
1767
|
}
|
|
1769
|
-
}), tab === TABS[
|
|
1768
|
+
}), tab === TABS[1].key ? /*#__PURE__*/jsx(Images, {
|
|
1770
1769
|
debouncedQuery: debouncedQuery,
|
|
1771
1770
|
query: query,
|
|
1772
1771
|
setSelectedImage: setSelectedImage
|
|
@@ -1780,7 +1779,6 @@ var ImageLibrary = function ImageLibrary(_ref) {
|
|
|
1780
1779
|
});
|
|
1781
1780
|
};
|
|
1782
1781
|
|
|
1783
|
-
var _excluded = ["key"];
|
|
1784
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; }
|
|
1785
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; }
|
|
1786
1784
|
var Modal = function Modal(_ref) {
|
|
@@ -1877,19 +1875,31 @@ var Modal = function Modal(_ref) {
|
|
|
1877
1875
|
}),
|
|
1878
1876
|
getRootProps = _useUploadDropzone.getRootProps,
|
|
1879
1877
|
getInputProps = _useUploadDropzone.getInputProps,
|
|
1880
|
-
isDragActive = _useUploadDropzone.isDragActive
|
|
1881
|
-
inputRef = _useUploadDropzone.inputRef;
|
|
1882
|
-
var openFileUploadDialog = function openFileUploadDialog() {
|
|
1883
|
-
var _inputRef$current;
|
|
1884
|
-
return (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.click();
|
|
1885
|
-
};
|
|
1886
|
-
var options = createOptions([{
|
|
1887
|
-
key: "local",
|
|
1888
|
-
onClick: openFileUploadDialog
|
|
1889
|
-
}]);
|
|
1878
|
+
isDragActive = _useUploadDropzone.isDragActive;
|
|
1890
1879
|
useEffect(function () {
|
|
1891
1880
|
setActiveTab(TABS[0].key);
|
|
1892
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
|
+
};
|
|
1893
1903
|
return /*#__PURE__*/jsxs(NeetoUIModal, {
|
|
1894
1904
|
isOpen: isOpen,
|
|
1895
1905
|
className: "niu-modal",
|
|
@@ -1913,7 +1923,7 @@ var Modal = function Modal(_ref) {
|
|
|
1913
1923
|
image: selectedImage,
|
|
1914
1924
|
signedId: selectedImage === null || selectedImage === void 0 ? void 0 : selectedImage.signedId
|
|
1915
1925
|
}) : /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
|
|
1916
|
-
className: "h-full flex-col"
|
|
1926
|
+
className: "flex h-full flex-col"
|
|
1917
1927
|
}, getRootProps({
|
|
1918
1928
|
onClick: function onClick(event) {
|
|
1919
1929
|
return event.stopPropagation();
|
|
@@ -1925,42 +1935,21 @@ var Modal = function Modal(_ref) {
|
|
|
1925
1935
|
children: t("neetoImageUploader.common.imageLibrary")
|
|
1926
1936
|
})
|
|
1927
1937
|
}), /*#__PURE__*/jsx("div", {
|
|
1928
|
-
className: "px-6 py-2",
|
|
1929
|
-
children: /*#__PURE__*/
|
|
1930
|
-
|
|
1931
|
-
children:
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
return
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
},
|
|
1942
|
-
children: tab.label
|
|
1943
|
-
}, tab.key);
|
|
1944
|
-
})
|
|
1945
|
-
})
|
|
1946
|
-
}), /*#__PURE__*/jsx("div", {
|
|
1947
|
-
className: "flex gap-2",
|
|
1948
|
-
children: options.map(function (_ref2) {
|
|
1949
|
-
var key = _ref2.key,
|
|
1950
|
-
otherProps = _objectWithoutProperties$1(_ref2, _excluded);
|
|
1951
|
-
return /*#__PURE__*/createElement(Button, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
1952
|
-
key: key,
|
|
1953
|
-
size: "small"
|
|
1954
|
-
}));
|
|
1955
|
-
})
|
|
1956
|
-
})]
|
|
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
|
+
})
|
|
1957
1951
|
})
|
|
1958
|
-
}), /*#__PURE__*/jsx(
|
|
1959
|
-
setActiveTab: setActiveTab,
|
|
1960
|
-
setIsUploading: setIsUploading,
|
|
1961
|
-
setSelectedImage: setSelectedImage,
|
|
1962
|
-
tab: activeTab
|
|
1963
|
-
}), equals(activeTab, TABS[1].key) && /*#__PURE__*/jsx(NeetoUIModal.Footer, {
|
|
1952
|
+
}), renderContent(), equals(activeTab, TABS[2].key) && /*#__PURE__*/jsx(NeetoUIModal.Footer, {
|
|
1964
1953
|
className: "flex items-center justify-center gap-2",
|
|
1965
1954
|
children: /*#__PURE__*/jsx(Typography, {
|
|
1966
1955
|
style: "body2",
|
|
@@ -1981,4 +1970,4 @@ var Modal = function Modal(_ref) {
|
|
|
1981
1970
|
};
|
|
1982
1971
|
|
|
1983
1972
|
export { Modal as M, constructCloudflareImageURL as c };
|
|
1984
|
-
//# sourceMappingURL=index-
|
|
1973
|
+
//# sourceMappingURL=index-FbPHXCzL.js.map
|