@bigbinary/neeto-image-uploader-frontend 2.0.1 → 2.2.0
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 +5 -0
- package/dist/AssetLibrary.js +10231 -0
- package/dist/AssetLibrary.js.map +1 -0
- package/dist/BasicImageUploader.js +66 -0
- package/dist/BasicImageUploader.js.map +1 -0
- package/dist/ImageUploader.js +228 -0
- package/dist/ImageUploader.js.map +1 -0
- package/dist/ImageWithFallback-7492935f.js +167 -0
- package/dist/ImageWithFallback-7492935f.js.map +1 -0
- package/dist/ImageWithFallback-e6b44c73.js +158 -0
- package/dist/ImageWithFallback-e6b44c73.js.map +1 -0
- package/dist/cjs/AssetLibrary.js +10303 -0
- package/dist/cjs/AssetLibrary.js.map +1 -0
- package/dist/cjs/BasicImageUploader.js +74 -0
- package/dist/cjs/BasicImageUploader.js.map +1 -0
- package/dist/cjs/ImageUploader.js +237 -0
- package/dist/cjs/ImageUploader.js.map +1 -0
- package/dist/cjs/hooks.js +24 -0
- package/dist/cjs/hooks.js.map +1 -0
- package/dist/cjs/index.js +95 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/hooks.js +14 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index-7f064861.js +663 -0
- package/dist/index-7f064861.js.map +1 -0
- package/dist/index-b9963255.js +658 -0
- package/dist/index-b9963255.js.map +1 -0
- package/dist/index.js +81 -3908
- package/dist/index.js.map +1 -1
- package/dist/useImageUploader-36a03350.js +598 -0
- package/dist/useImageUploader-36a03350.js.map +1 -0
- package/dist/useImageUploader-550a5fdc.js +616 -0
- package/dist/useImageUploader-550a5fdc.js.map +1 -0
- package/dist/useProfileImageUpload-837e76b8.js +256 -0
- package/dist/useProfileImageUpload-837e76b8.js.map +1 -0
- package/dist/useProfileImageUpload-f0088c2a.js +263 -0
- package/dist/useProfileImageUpload-f0088c2a.js.map +1 -0
- package/dist/utils-88cce499.js +277 -0
- package/dist/utils-88cce499.js.map +1 -0
- package/dist/utils-96eacd77.js +248 -0
- package/dist/utils-96eacd77.js.map +1 -0
- package/package.json +45 -31
- package/dist/index.cjs.js +0 -3934
- package/dist/index.cjs.js.map +0 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('../index-7f064861.js');
|
|
4
|
+
var utils = require('../utils-88cce499.js');
|
|
5
|
+
require('react');
|
|
6
|
+
var classnames = require('classnames');
|
|
7
|
+
var neetoCist = require('@bigbinary/neeto-cist');
|
|
8
|
+
var Delete$1 = require('@bigbinary/neeto-icons/Delete');
|
|
9
|
+
var Button = require('@bigbinary/neetoui/Button');
|
|
10
|
+
var ImageWithFallback = require('../ImageWithFallback-7492935f.js');
|
|
11
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
12
|
+
require('@bigbinary/neeto-commons-frontend/initializers');
|
|
13
|
+
require('react-dropzone');
|
|
14
|
+
require('i18next');
|
|
15
|
+
require('@bigbinary/neetoui/Toastr');
|
|
16
|
+
require('ramda');
|
|
17
|
+
require('@bigbinary/neetoui/Typography');
|
|
18
|
+
require('react-i18next');
|
|
19
|
+
|
|
20
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
21
|
+
|
|
22
|
+
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
23
|
+
var Delete$1__default = /*#__PURE__*/_interopDefaultLegacy(Delete$1);
|
|
24
|
+
var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
|
|
25
|
+
|
|
26
|
+
var _excluded = ["src", "className", "imageFallbackProps", "onDrop", "isDisabled", "onRemove"];
|
|
27
|
+
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; }
|
|
28
|
+
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) { index._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; }
|
|
29
|
+
var BasicImageUploader = function BasicImageUploader(_ref) {
|
|
30
|
+
var _ref$src = _ref.src,
|
|
31
|
+
src = _ref$src === void 0 ? "" : _ref$src,
|
|
32
|
+
_ref$className = _ref.className,
|
|
33
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
|
34
|
+
_ref$imageFallbackPro = _ref.imageFallbackProps,
|
|
35
|
+
imageFallbackProps = _ref$imageFallbackPro === void 0 ? {
|
|
36
|
+
alt: "Uplaoded Image",
|
|
37
|
+
className: "h-full w-full"
|
|
38
|
+
} : _ref$imageFallbackPro,
|
|
39
|
+
_ref$onDrop = _ref.onDrop,
|
|
40
|
+
onDrop = _ref$onDrop === void 0 ? neetoCist.noop : _ref$onDrop,
|
|
41
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
42
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
43
|
+
_ref$onRemove = _ref.onRemove,
|
|
44
|
+
onRemove = _ref$onRemove === void 0 ? neetoCist.noop : _ref$onRemove,
|
|
45
|
+
props = utils._objectWithoutProperties(_ref, _excluded);
|
|
46
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
47
|
+
className: classnames__default["default"](className, {
|
|
48
|
+
"cursor-pointer": true,
|
|
49
|
+
"cursor-not-allowed": isDisabled,
|
|
50
|
+
"opacity-70": isDisabled && utils.isNilOrEmpty(src)
|
|
51
|
+
}),
|
|
52
|
+
children: utils.isNotNilOrEmpty(src) ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
53
|
+
className: utils.IMAGE_WRAPPER_CLASSNAME,
|
|
54
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(ImageWithFallback.ImageWithFallback, _objectSpread(_objectSpread({}, _objectSpread(_objectSpread({}, imageFallbackProps), {}, {
|
|
55
|
+
src: src
|
|
56
|
+
})), {}, {
|
|
57
|
+
"data-cy": "uploaded-image"
|
|
58
|
+
})), /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
59
|
+
className: "absolute right-3 top-3",
|
|
60
|
+
"data-cy": "basic-image-uploader-remove-button",
|
|
61
|
+
disabled: isDisabled,
|
|
62
|
+
icon: Delete$1__default["default"],
|
|
63
|
+
size: "small",
|
|
64
|
+
onClick: onRemove
|
|
65
|
+
})]
|
|
66
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(ImageWithFallback.ImageDirectUpload, _objectSpread({}, _objectSpread(_objectSpread({}, props), {}, {
|
|
67
|
+
isDisabled: isDisabled,
|
|
68
|
+
onDrop: onDrop
|
|
69
|
+
})))
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
module.exports = BasicImageUploader;
|
|
74
|
+
//# sourceMappingURL=BasicImageUploader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BasicImageUploader.js","sources":["../../app/javascript/src/components/BasicImageUploader.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport { noop } from \"neetocist\";\nimport { Delete } from \"neetoicons\";\nimport { Button } from \"neetoui\";\n\nimport ImageDirectUpload from \"./common/ImageDirectUpload\";\nimport ImageWithFallback from \"./common/ImageWithFallback\";\nimport { IMAGE_WRAPPER_CLASSNAME } from \"./constants\";\nimport { isNilOrEmpty, isNotNilOrEmpty } from \"./ImageEditor/utils\";\n\nconst BasicImageUploader = ({\n src = \"\",\n className = \"\",\n imageFallbackProps = { alt: \"Uplaoded Image\", className: \"h-full w-full\" },\n onDrop = noop,\n isDisabled = false,\n onRemove = noop,\n ...props\n}) => (\n <div\n className={classnames(className, {\n \"cursor-pointer\": true,\n \"cursor-not-allowed\": isDisabled,\n \"opacity-70\": isDisabled && isNilOrEmpty(src),\n })}\n >\n {isNotNilOrEmpty(src) ? (\n <div className={IMAGE_WRAPPER_CLASSNAME}>\n <ImageWithFallback\n {...{ ...imageFallbackProps, src }}\n data-cy=\"uploaded-image\"\n />\n <Button\n className=\"absolute right-3 top-3\"\n data-cy=\"basic-image-uploader-remove-button\"\n disabled={isDisabled}\n icon={Delete}\n size=\"small\"\n onClick={onRemove}\n />\n </div>\n ) : (\n <ImageDirectUpload {...{ ...props, isDisabled, onDrop }} />\n )}\n </div>\n);\n\nexport default BasicImageUploader;\n"],"names":["BasicImageUploader","_ref","_ref$src","src","_ref$className","className","_ref$imageFallbackPro","imageFallbackProps","alt","_ref$onDrop","onDrop","noop","_ref$isDisabled","isDisabled","_ref$onRemove","onRemove","props","_objectWithoutProperties","_excluded","_jsx","classnames","isNilOrEmpty","children","isNotNilOrEmpty","_jsxs","IMAGE_WRAPPER_CLASSNAME","ImageWithFallback","_objectSpread","Button","disabled","icon","Delete","size","onClick","ImageDirectUpload"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAAC,QAAA,GAAAD,IAAA,CACtBE,GAAG;AAAHA,IAAAA,GAAG,GAAAD,QAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,QAAA;IAAAE,cAAA,GAAAH,IAAA,CACRI,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,cAAA;IAAAE,qBAAA,GAAAL,IAAA,CACdM,kBAAkB;IAAlBA,kBAAkB,GAAAD,qBAAA,KAAG,KAAA,CAAA,GAAA;AAAEE,MAAAA,GAAG,EAAE,gBAAgB;AAAEH,MAAAA,SAAS,EAAE,eAAA;AAAgB,KAAC,GAAAC,qBAAA;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EhB,UAAW;AACrBiB,QAAAA,IAAI,EAAEC,4BAAO;AACbC,QAAAA,IAAI,EAAC,OAAO;AACZC,QAAAA,OAAO,EAAElB,QAAAA;AAAS,OACnB,CAAC,CAAA;AAAA,KACC,CAAC,gBAENI,cAAA,CAACe,mCAAiB,EAAAP,aAAA,CAAA,EAAA,EAAAA,aAAA,CAAAA,aAAA,CAAA,EAAA,EAAUX,KAAK,CAAA,EAAA,EAAA,EAAA;AAAEH,MAAAA,UAAU,EAAVA,UAAU;AAAEH,MAAAA,MAAM,EAANA,MAAAA;KAAW,CAAA,CAAA,CAAA;AAC3D,GACE,CAAC,CAAA;AAAA;;;;"}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('../index-7f064861.js');
|
|
4
|
+
var utils = require('../utils-88cce499.js');
|
|
5
|
+
var require$$0 = require('react');
|
|
6
|
+
var classnames = require('classnames');
|
|
7
|
+
var neetoCist = require('@bigbinary/neeto-cist');
|
|
8
|
+
var MenuHorizontal = require('@bigbinary/neeto-icons/MenuHorizontal');
|
|
9
|
+
var Dropdown = require('@bigbinary/neetoui/Dropdown');
|
|
10
|
+
var Toastr = require('@bigbinary/neetoui/Toastr');
|
|
11
|
+
var ramda = require('ramda');
|
|
12
|
+
var reactI18next = require('react-i18next');
|
|
13
|
+
var ImageWithFallback = require('../ImageWithFallback-7492935f.js');
|
|
14
|
+
var AssetLibrary = require('./AssetLibrary.js');
|
|
15
|
+
var useImageUploader = require('../useImageUploader-550a5fdc.js');
|
|
16
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
17
|
+
require('@bigbinary/neeto-commons-frontend/initializers');
|
|
18
|
+
require('react-dropzone');
|
|
19
|
+
require('i18next');
|
|
20
|
+
require('@bigbinary/neetoui/Button');
|
|
21
|
+
require('@bigbinary/neetoui/Typography');
|
|
22
|
+
require('@bigbinary/neetoui/Modal');
|
|
23
|
+
require('@bigbinary/neetoui/Tab');
|
|
24
|
+
require('@bigbinary/neetoui/Spinner');
|
|
25
|
+
require('@bigbinary/neeto-icons/LeftArrow');
|
|
26
|
+
require('@tanstack/react-query');
|
|
27
|
+
require('axios');
|
|
28
|
+
require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
29
|
+
require('@bigbinary/neeto-commons-frontend/utils');
|
|
30
|
+
require('@bigbinary/neetoui/Input');
|
|
31
|
+
require('@bigbinary/neetoui/Switch');
|
|
32
|
+
require('@bigbinary/neeto-icons/index');
|
|
33
|
+
require('@bigbinary/neeto-molecules/Container');
|
|
34
|
+
require('@bigbinary/neeto-molecules/Header');
|
|
35
|
+
require('@bigbinary/neeto-commons-frontend/constants');
|
|
36
|
+
require('@bigbinary/neetoui/Pane');
|
|
37
|
+
require('@bigbinary/neetoui/formik/ActionBlock');
|
|
38
|
+
require('@bigbinary/neetoui/formik/Form');
|
|
39
|
+
require('@bigbinary/neetoui/formik/Input');
|
|
40
|
+
require('@bigbinary/neetoui/formik/Select');
|
|
41
|
+
require('@bigbinary/neetoui/formik/Textarea');
|
|
42
|
+
require('yup');
|
|
43
|
+
require('formik');
|
|
44
|
+
require('@bigbinary/neeto-molecules/MoreDropdown');
|
|
45
|
+
require('@bigbinary/neetoui/Avatar');
|
|
46
|
+
require('@bigbinary/neetoui/Alert');
|
|
47
|
+
require('@bigbinary/neeto-molecules/PageLoader');
|
|
48
|
+
require('@bigbinary/neeto-molecules/SubHeader');
|
|
49
|
+
require('@bigbinary/neeto-molecules/TableWrapper');
|
|
50
|
+
require('@bigbinary/neetoui/Table');
|
|
51
|
+
require('@bigbinary/neetoui/NoData');
|
|
52
|
+
require('@bigbinary/neetoui/Tooltip');
|
|
53
|
+
require('@bigbinary/neeto-image-uploader-frontend');
|
|
54
|
+
require('@bigbinary/neeto-icons/ExternalLink');
|
|
55
|
+
require('@bigbinary/neetoui/Callout');
|
|
56
|
+
require('@bigbinary/neetoui/Label');
|
|
57
|
+
require('@bigbinary/neetoui/Radio');
|
|
58
|
+
require('@bigbinary/neeto-icons/Delete');
|
|
59
|
+
require('@bigbinary/neeto-commons-frontend/react-utils/withImmutableActions');
|
|
60
|
+
require('zustand');
|
|
61
|
+
require('zustand/shallow');
|
|
62
|
+
require('@bigbinary/neetoui/Checkbox');
|
|
63
|
+
require('@bigbinary/neeto-icons/Search');
|
|
64
|
+
require('@bigbinary/neeto-icons/Down');
|
|
65
|
+
require('@bigbinary/neeto-icons/Up');
|
|
66
|
+
require('@bigbinary/neeto-filters-frontend');
|
|
67
|
+
require('@bigbinary/neeto-molecules/Columns');
|
|
68
|
+
require('react-router-dom');
|
|
69
|
+
require('util');
|
|
70
|
+
require('@bigbinary/neetoui/Tag');
|
|
71
|
+
require('@bigbinary/neeto-icons/Right');
|
|
72
|
+
require('@bigbinary/neeto-icons/Info');
|
|
73
|
+
require('@bigbinary/neeto-commons-frontend/react-utils/useFetchNeetoApps');
|
|
74
|
+
require('@bigbinary/neetoui/formik/Switch');
|
|
75
|
+
require('@bigbinary/neetoui/formik/MultiEmailInput');
|
|
76
|
+
require('@bigbinary/neetoui/formik/Radio');
|
|
77
|
+
require('@bigbinary/neeto-icons/Warning');
|
|
78
|
+
require('@bigbinary/neetoui/formik/Checkbox');
|
|
79
|
+
require('@bigbinary/neeto-icons/UserCircle');
|
|
80
|
+
require('@rails/activestorage');
|
|
81
|
+
|
|
82
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
83
|
+
|
|
84
|
+
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
85
|
+
var MenuHorizontal__default = /*#__PURE__*/_interopDefaultLegacy(MenuHorizontal);
|
|
86
|
+
var Dropdown__default = /*#__PURE__*/_interopDefaultLegacy(Dropdown);
|
|
87
|
+
var Toastr__default = /*#__PURE__*/_interopDefaultLegacy(Toastr);
|
|
88
|
+
|
|
89
|
+
var _excluded = ["key", "label"];
|
|
90
|
+
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; }
|
|
91
|
+
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) { index._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; }
|
|
92
|
+
var Menu = Dropdown__default["default"].Menu,
|
|
93
|
+
MenuItem = Dropdown__default["default"].MenuItem;
|
|
94
|
+
var ImageUploader = function ImageUploader(_ref) {
|
|
95
|
+
var _ref$onUploadComplete = _ref.onUploadComplete,
|
|
96
|
+
onUploadComplete = _ref$onUploadComplete === void 0 ? neetoCist.noop : _ref$onUploadComplete,
|
|
97
|
+
_ref$className = _ref.className,
|
|
98
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
|
99
|
+
_ref$src = _ref.src,
|
|
100
|
+
src = _ref$src === void 0 ? "" : _ref$src,
|
|
101
|
+
_ref$uploadConfig = _ref.uploadConfig,
|
|
102
|
+
uploadConfig = _ref$uploadConfig === void 0 ? {} : _ref$uploadConfig,
|
|
103
|
+
_ref$fixedAspectRatio = _ref.fixedAspectRatio,
|
|
104
|
+
fixedAspectRatio = _ref$fixedAspectRatio === void 0 ? {} : _ref$fixedAspectRatio;
|
|
105
|
+
var _useState = require$$0.useState(false),
|
|
106
|
+
_useState2 = index._slicedToArray(_useState, 2),
|
|
107
|
+
isAssetLibraryOpen = _useState2[0],
|
|
108
|
+
setIsAssetLibraryOpen = _useState2[1];
|
|
109
|
+
var _useState3 = require$$0.useState({
|
|
110
|
+
url: src
|
|
111
|
+
}),
|
|
112
|
+
_useState4 = index._slicedToArray(_useState3, 2),
|
|
113
|
+
image = _useState4[0],
|
|
114
|
+
setImage = _useState4[1];
|
|
115
|
+
var _useTranslation = reactI18next.useTranslation(),
|
|
116
|
+
t = _useTranslation.t;
|
|
117
|
+
var _useCreateBlob = useImageUploader.useCreateBlob(),
|
|
118
|
+
createBlob = _useCreateBlob.mutate;
|
|
119
|
+
var uploadConfigWithDefaults = ramda.mergeRight(utils.DEFAULT_UPLOAD_CONFIG, uploadConfig);
|
|
120
|
+
var handleDelete = function handleDelete() {
|
|
121
|
+
setImage({});
|
|
122
|
+
onChange({
|
|
123
|
+
url: "",
|
|
124
|
+
signedId: "",
|
|
125
|
+
key: "",
|
|
126
|
+
filename: "",
|
|
127
|
+
size: "",
|
|
128
|
+
type: ""
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
var onChange = function onChange(file) {
|
|
132
|
+
return onUploadComplete(file);
|
|
133
|
+
};
|
|
134
|
+
var handleSuccess = function handleSuccess(attachedImage) {
|
|
135
|
+
setImage(ramda.mergeRight(image, {
|
|
136
|
+
url: attachedImage.metadata.url
|
|
137
|
+
}));
|
|
138
|
+
onChange({
|
|
139
|
+
filename: attachedImage.filename,
|
|
140
|
+
key: attachedImage.key,
|
|
141
|
+
url: attachedImage.blobUrl,
|
|
142
|
+
signedId: attachedImage.signedId,
|
|
143
|
+
size: attachedImage.byteSize,
|
|
144
|
+
type: attachedImage.contentType
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
var handleImageSelectionFromLibrary = function handleImageSelectionFromLibrary(image) {
|
|
148
|
+
setImage(image);
|
|
149
|
+
onChange(image);
|
|
150
|
+
};
|
|
151
|
+
var handleUploadComplete = function handleUploadComplete(image) {
|
|
152
|
+
if (index.IS_DEVELOPMENT_OR_HEROKU_ENV) {
|
|
153
|
+
handleSuccess(ramda.mergeRight(image, {
|
|
154
|
+
metadata: {
|
|
155
|
+
url: image.url
|
|
156
|
+
}
|
|
157
|
+
}));
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
var payload = {
|
|
161
|
+
filename: image.name,
|
|
162
|
+
byte_size: image.size,
|
|
163
|
+
content_type: image.fileType,
|
|
164
|
+
checksum: image.fileId,
|
|
165
|
+
metadata: image,
|
|
166
|
+
service_name: "imagekitio"
|
|
167
|
+
};
|
|
168
|
+
createBlob(payload, {
|
|
169
|
+
onSuccess: handleSuccess,
|
|
170
|
+
onError: Toastr__default["default"].error
|
|
171
|
+
});
|
|
172
|
+
};
|
|
173
|
+
var _useImageUploader = useImageUploader.useImageUploader({
|
|
174
|
+
onUploadComplete: handleUploadComplete
|
|
175
|
+
}),
|
|
176
|
+
uploadFile = _useImageUploader.uploadFile;
|
|
177
|
+
var options = [{
|
|
178
|
+
key: utils.OPTION_KEYS.asset,
|
|
179
|
+
label: t("neetoImageUploader.imageUpload.imageLibrary"),
|
|
180
|
+
onClick: function onClick() {
|
|
181
|
+
return setIsAssetLibraryOpen(true);
|
|
182
|
+
},
|
|
183
|
+
"data-cy": "image-uploader-open-image-library-button"
|
|
184
|
+
}, {
|
|
185
|
+
key: utils.OPTION_KEYS.remove,
|
|
186
|
+
label: t("neetoImageUploader.imageUpload.remove"),
|
|
187
|
+
onClick: handleDelete,
|
|
188
|
+
"data-cy": "image-uploader-remove-button"
|
|
189
|
+
}];
|
|
190
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
191
|
+
className: classnames__default["default"](className, {
|
|
192
|
+
"cursor-pointer": true
|
|
193
|
+
}),
|
|
194
|
+
children: [utils.isNotNilOrEmpty(image.url) ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
195
|
+
className: utils.IMAGE_WRAPPER_CLASSNAME,
|
|
196
|
+
"data-cy": "image-uploader-wrapper",
|
|
197
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(ImageWithFallback.ImageWithFallback, {
|
|
198
|
+
className: "h-full w-full",
|
|
199
|
+
"data-cy": "uploaded-image",
|
|
200
|
+
src: image.url
|
|
201
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Dropdown__default["default"], {
|
|
202
|
+
buttonProps: {
|
|
203
|
+
className: "absolute right-3 top-3"
|
|
204
|
+
},
|
|
205
|
+
buttonSize: "small",
|
|
206
|
+
buttonStyle: "primary",
|
|
207
|
+
icon: MenuHorizontal__default["default"],
|
|
208
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Menu, {
|
|
209
|
+
children: options.map(function (_ref2) {
|
|
210
|
+
var key = _ref2.key,
|
|
211
|
+
label = _ref2.label,
|
|
212
|
+
otherProps = utils._objectWithoutProperties(_ref2, _excluded);
|
|
213
|
+
return /*#__PURE__*/require$$0.createElement(MenuItem.Button, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
214
|
+
key: key
|
|
215
|
+
}), label);
|
|
216
|
+
})
|
|
217
|
+
})
|
|
218
|
+
})]
|
|
219
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(ImageWithFallback.ImageDirectUpload, {
|
|
220
|
+
setIsAssetLibraryOpen: setIsAssetLibraryOpen,
|
|
221
|
+
isDisabled: neetoCist.isPresent(fixedAspectRatio),
|
|
222
|
+
uploadConfig: uploadConfigWithDefaults,
|
|
223
|
+
onDrop: uploadFile
|
|
224
|
+
}), /*#__PURE__*/jsxRuntime.jsx(AssetLibrary, {
|
|
225
|
+
fixedAspectRatio: fixedAspectRatio,
|
|
226
|
+
isOpen: isAssetLibraryOpen,
|
|
227
|
+
uploadConfig: uploadConfigWithDefaults,
|
|
228
|
+
onClose: function onClose() {
|
|
229
|
+
return setIsAssetLibraryOpen(false);
|
|
230
|
+
},
|
|
231
|
+
onUploadComplete: handleImageSelectionFromLibrary
|
|
232
|
+
})]
|
|
233
|
+
});
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
module.exports = ImageUploader;
|
|
237
|
+
//# sourceMappingURL=ImageUploader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageUploader.js","sources":["../../app/javascript/src/components/ImageUploader/index.jsx"],"sourcesContent":["import React, { useState } from \"react\";\n\nimport classnames from \"classnames\";\nimport { isPresent, noop } from \"neetocist\";\nimport { MenuHorizontal } from \"neetoicons\";\nimport { Dropdown, Toastr } from \"neetoui\";\nimport { mergeRight } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport ImageDirectUpload from \"components/common/ImageDirectUpload\";\nimport ImageWithFallback from \"components/common/ImageWithFallback\";\nimport { IMAGE_WRAPPER_CLASSNAME } from \"components/constants\";\nimport { isNotNilOrEmpty } from \"components/ImageEditor/utils\";\nimport AssetLibrary from \"components/Modal\";\nimport { useCreateBlob } from \"hooks/useDirectUploads\";\nimport useImageUploader from \"hooks/useImageUploader\";\nimport { IS_DEVELOPMENT_OR_HEROKU_ENV } from \"src/constants\";\n\nimport { DEFAULT_UPLOAD_CONFIG, OPTION_KEYS } from \"./constants\";\n\nconst { Menu, MenuItem } = Dropdown;\n\nconst ImageUploader = ({\n onUploadComplete = noop,\n className = \"\",\n src = \"\",\n uploadConfig = {},\n fixedAspectRatio = {},\n}) => {\n const [isAssetLibraryOpen, setIsAssetLibraryOpen] = useState(false);\n const [image, setImage] = useState({ url: src });\n\n const { t } = useTranslation();\n\n const { mutate: createBlob } = useCreateBlob();\n\n const uploadConfigWithDefaults = mergeRight(\n DEFAULT_UPLOAD_CONFIG,\n uploadConfig\n );\n\n const handleDelete = () => {\n setImage({});\n onChange({\n url: \"\",\n signedId: \"\",\n key: \"\",\n filename: \"\",\n size: \"\",\n type: \"\",\n });\n };\n\n const onChange = file => onUploadComplete(file);\n\n const handleSuccess = attachedImage => {\n setImage(mergeRight(image, { url: attachedImage.metadata.url }));\n onChange({\n filename: attachedImage.filename,\n key: attachedImage.key,\n url: attachedImage.blobUrl,\n signedId: attachedImage.signedId,\n size: attachedImage.byteSize,\n type: attachedImage.contentType,\n });\n };\n\n const handleImageSelectionFromLibrary = image => {\n setImage(image);\n onChange(image);\n };\n\n const handleUploadComplete = image => {\n if (IS_DEVELOPMENT_OR_HEROKU_ENV) {\n handleSuccess(mergeRight(image, { metadata: { url: image.url } }));\n\n return;\n }\n\n const payload = {\n filename: image.name,\n byte_size: image.size,\n content_type: image.fileType,\n checksum: image.fileId,\n metadata: image,\n service_name: \"imagekitio\",\n };\n\n createBlob(payload, {\n onSuccess: handleSuccess,\n onError: Toastr.error,\n });\n };\n\n const { uploadFile } = useImageUploader({\n onUploadComplete: handleUploadComplete,\n });\n\n const options = [\n {\n key: OPTION_KEYS.asset,\n label: t(\"neetoImageUploader.imageUpload.imageLibrary\"),\n onClick: () => setIsAssetLibraryOpen(true),\n \"data-cy\": \"image-uploader-open-image-library-button\",\n },\n {\n key: OPTION_KEYS.remove,\n label: t(\"neetoImageUploader.imageUpload.remove\"),\n onClick: handleDelete,\n \"data-cy\": \"image-uploader-remove-button\",\n },\n ];\n\n return (\n <div className={classnames(className, { \"cursor-pointer\": true })}>\n {isNotNilOrEmpty(image.url) ? (\n <div\n className={IMAGE_WRAPPER_CLASSNAME}\n data-cy=\"image-uploader-wrapper\"\n >\n <ImageWithFallback\n className=\"h-full w-full\"\n data-cy=\"uploaded-image\"\n src={image.url}\n />\n <Dropdown\n buttonProps={{ className: \"absolute right-3 top-3\" }}\n buttonSize=\"small\"\n buttonStyle=\"primary\"\n icon={MenuHorizontal}\n >\n <Menu>\n {options.map(({ key, label, ...otherProps }) => (\n <MenuItem.Button {...otherProps} key={key}>\n {label}\n </MenuItem.Button>\n ))}\n </Menu>\n </Dropdown>\n </div>\n ) : (\n <ImageDirectUpload\n {...{ setIsAssetLibraryOpen }}\n isDisabled={isPresent(fixedAspectRatio)}\n uploadConfig={uploadConfigWithDefaults}\n onDrop={uploadFile}\n />\n )}\n <AssetLibrary\n {...{ fixedAspectRatio }}\n isOpen={isAssetLibraryOpen}\n uploadConfig={uploadConfigWithDefaults}\n onClose={() => setIsAssetLibraryOpen(false)}\n onUploadComplete={handleImageSelectionFromLibrary}\n />\n </div>\n );\n};\n\nexport default ImageUploader;\n"],"names":["Menu","Dropdown","MenuItem","ImageUploader","_ref","_ref$onUploadComplete","onUploadComplete","noop","_ref$className","className","_ref$src","src","_ref$uploadConfig","uploadConfig","_ref$fixedAspectRatio","fixedAspectRatio","_useState","useState","_useState2","_slicedToArray","isAssetLibraryOpen","setIsAssetLibraryOpen","_useState3","url","_useState4","image","setImage","_useTranslation","useTranslation","t","_useCreateBlob","useCreateBlob","createBlob","mutate","uploadConfigWithDefaults","mergeRight","DEFAULT_UPLOAD_CONFIG","handleDelete","onChange","signedId","key","filename","size","type","file","handleSuccess","attachedImage","metadata","blobUrl","byteSize","contentType","handleImageSelectionFromLibrary","handleUploadComplete","IS_DEVELOPMENT_OR_HEROKU_ENV","payload","name","byte_size","content_type","fileType","checksum","fileId","service_name","onSuccess","onError","Toastr","error","_useImageUploader","useImageUploader","uploadFile","options","OPTION_KEYS","asset","label","onClick","remove","_jsxs","classnames","children","isNotNilOrEmpty","IMAGE_WRAPPER_CLASSNAME","_jsx","ImageWithFallback","buttonProps","buttonSize","buttonStyle","icon","MenuHorizontal","map","_ref2","otherProps","_objectWithoutProperties","_excluded","_createElement","Button","_objectSpread","ImageDirectUpload","isDisabled","isPresent","onDrop","AssetLibrary","isOpen","onClose"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,IAAQA,IAAI,GAAeC,4BAAQ,CAA3BD,IAAI;EAAEE,QAAQ,GAAKD,4BAAQ,CAArBC,QAAQ,CAAA;AAEtB,IAAMC,aAAa,GAAG,SAAhBA,aAAaA,CAAAC,IAAA,EAMb;AAAA,EAAA,IAAAC,qBAAA,GAAAD,IAAA,CALJE,gBAAgB;AAAhBA,IAAAA,gBAAgB,GAAAD,qBAAA,KAAGE,KAAAA,CAAAA,GAAAA,cAAI,GAAAF,qBAAA;IAAAG,cAAA,GAAAJ,IAAA,CACvBK,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,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e,mCAAiB,EAAA;AACV1E,MAAAA,qBAAqB,EAArBA,qBAAqB;AAC3B2E,MAAAA,UAAU,EAAEC,mBAAS,CAAClF,gBAAgB,CAAE;AACxCF,MAAAA,YAAY,EAAEqB,wBAAyB;AACvCgE,MAAAA,MAAM,EAAE9B,UAAAA;AAAW,KACpB,CACF,eACDY,cAAA,CAACmB,YAAY,EAAA;AACLpF,MAAAA,gBAAgB,EAAhBA,gBAAgB;AACtBqF,MAAAA,MAAM,EAAEhF,kBAAmB;AAC3BP,MAAAA,YAAY,EAAEqB,wBAAyB;MACvCmE,OAAO,EAAE,SAAAA,OAAA,GAAA;QAAA,OAAMhF,qBAAqB,CAAC,KAAK,CAAC,CAAA;OAAC;AAC5Cf,MAAAA,gBAAgB,EAAE6C,+BAAAA;AAAgC,KACnD,CAAC,CAAA;AAAA,GACC,CAAC,CAAA;AAEV;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var useProfileImageUpload = require('../useProfileImageUpload-f0088c2a.js');
|
|
6
|
+
var useImageUploader = require('../useImageUploader-550a5fdc.js');
|
|
7
|
+
require('../index-7f064861.js');
|
|
8
|
+
require('react');
|
|
9
|
+
require('@rails/activestorage');
|
|
10
|
+
require('@bigbinary/neeto-cist');
|
|
11
|
+
require('@bigbinary/neeto-commons-frontend/initializers');
|
|
12
|
+
require('@bigbinary/neetoui/Toastr');
|
|
13
|
+
require('ramda');
|
|
14
|
+
require('i18next');
|
|
15
|
+
require('@tanstack/react-query');
|
|
16
|
+
require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
17
|
+
require('axios');
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
exports.useImageUpload = useProfileImageUpload.useImageUpload;
|
|
22
|
+
exports.useProfileImageUpload = useProfileImageUpload.useProfileImageUpload;
|
|
23
|
+
exports.useImageUploader = useImageUploader.useImageUploader;
|
|
24
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var BasicImageUploader = require('./BasicImageUploader.js');
|
|
6
|
+
var ImageUploader = require('./ImageUploader.js');
|
|
7
|
+
var AssetLibrary = require('./AssetLibrary.js');
|
|
8
|
+
var useProfileImageUpload = require('../useProfileImageUpload-f0088c2a.js');
|
|
9
|
+
var useImageUploader = require('../useImageUploader-550a5fdc.js');
|
|
10
|
+
require('../index-7f064861.js');
|
|
11
|
+
require('../utils-88cce499.js');
|
|
12
|
+
require('@bigbinary/neeto-commons-frontend/initializers');
|
|
13
|
+
require('react');
|
|
14
|
+
require('react-dropzone');
|
|
15
|
+
require('i18next');
|
|
16
|
+
require('@bigbinary/neetoui/Toastr');
|
|
17
|
+
require('@bigbinary/neeto-cist');
|
|
18
|
+
require('ramda');
|
|
19
|
+
require('classnames');
|
|
20
|
+
require('@bigbinary/neeto-icons/Delete');
|
|
21
|
+
require('@bigbinary/neetoui/Button');
|
|
22
|
+
require('../ImageWithFallback-7492935f.js');
|
|
23
|
+
require('@bigbinary/neetoui/Typography');
|
|
24
|
+
require('react-i18next');
|
|
25
|
+
require('react/jsx-runtime');
|
|
26
|
+
require('@bigbinary/neeto-icons/MenuHorizontal');
|
|
27
|
+
require('@bigbinary/neetoui/Dropdown');
|
|
28
|
+
require('@bigbinary/neetoui/Modal');
|
|
29
|
+
require('@bigbinary/neetoui/Tab');
|
|
30
|
+
require('@bigbinary/neetoui/Spinner');
|
|
31
|
+
require('@bigbinary/neeto-icons/LeftArrow');
|
|
32
|
+
require('@tanstack/react-query');
|
|
33
|
+
require('axios');
|
|
34
|
+
require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
35
|
+
require('@bigbinary/neeto-commons-frontend/utils');
|
|
36
|
+
require('@bigbinary/neetoui/Input');
|
|
37
|
+
require('@bigbinary/neetoui/Switch');
|
|
38
|
+
require('@bigbinary/neeto-icons/index');
|
|
39
|
+
require('@bigbinary/neeto-molecules/Container');
|
|
40
|
+
require('@bigbinary/neeto-molecules/Header');
|
|
41
|
+
require('@bigbinary/neeto-commons-frontend/constants');
|
|
42
|
+
require('@bigbinary/neetoui/Pane');
|
|
43
|
+
require('@bigbinary/neetoui/formik/ActionBlock');
|
|
44
|
+
require('@bigbinary/neetoui/formik/Form');
|
|
45
|
+
require('@bigbinary/neetoui/formik/Input');
|
|
46
|
+
require('@bigbinary/neetoui/formik/Select');
|
|
47
|
+
require('@bigbinary/neetoui/formik/Textarea');
|
|
48
|
+
require('yup');
|
|
49
|
+
require('formik');
|
|
50
|
+
require('@bigbinary/neeto-molecules/MoreDropdown');
|
|
51
|
+
require('@bigbinary/neetoui/Avatar');
|
|
52
|
+
require('@bigbinary/neetoui/Alert');
|
|
53
|
+
require('@bigbinary/neeto-molecules/PageLoader');
|
|
54
|
+
require('@bigbinary/neeto-molecules/SubHeader');
|
|
55
|
+
require('@bigbinary/neeto-molecules/TableWrapper');
|
|
56
|
+
require('@bigbinary/neetoui/Table');
|
|
57
|
+
require('@bigbinary/neetoui/NoData');
|
|
58
|
+
require('@bigbinary/neetoui/Tooltip');
|
|
59
|
+
require('@bigbinary/neeto-image-uploader-frontend');
|
|
60
|
+
require('@bigbinary/neeto-icons/ExternalLink');
|
|
61
|
+
require('@bigbinary/neetoui/Callout');
|
|
62
|
+
require('@bigbinary/neetoui/Label');
|
|
63
|
+
require('@bigbinary/neetoui/Radio');
|
|
64
|
+
require('@bigbinary/neeto-commons-frontend/react-utils/withImmutableActions');
|
|
65
|
+
require('zustand');
|
|
66
|
+
require('zustand/shallow');
|
|
67
|
+
require('@bigbinary/neetoui/Checkbox');
|
|
68
|
+
require('@bigbinary/neeto-icons/Search');
|
|
69
|
+
require('@bigbinary/neeto-icons/Down');
|
|
70
|
+
require('@bigbinary/neeto-icons/Up');
|
|
71
|
+
require('@bigbinary/neeto-filters-frontend');
|
|
72
|
+
require('@bigbinary/neeto-molecules/Columns');
|
|
73
|
+
require('react-router-dom');
|
|
74
|
+
require('util');
|
|
75
|
+
require('@bigbinary/neetoui/Tag');
|
|
76
|
+
require('@bigbinary/neeto-icons/Right');
|
|
77
|
+
require('@bigbinary/neeto-icons/Info');
|
|
78
|
+
require('@bigbinary/neeto-commons-frontend/react-utils/useFetchNeetoApps');
|
|
79
|
+
require('@bigbinary/neetoui/formik/Switch');
|
|
80
|
+
require('@bigbinary/neetoui/formik/MultiEmailInput');
|
|
81
|
+
require('@bigbinary/neetoui/formik/Radio');
|
|
82
|
+
require('@bigbinary/neeto-icons/Warning');
|
|
83
|
+
require('@bigbinary/neetoui/formik/Checkbox');
|
|
84
|
+
require('@bigbinary/neeto-icons/UserCircle');
|
|
85
|
+
require('@rails/activestorage');
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
exports.BasicImageUploader = BasicImageUploader;
|
|
90
|
+
exports.ImageUploader = ImageUploader;
|
|
91
|
+
exports.AssetLibrary = AssetLibrary;
|
|
92
|
+
exports.useImageUpload = useProfileImageUpload.useImageUpload;
|
|
93
|
+
exports.useProfileImageUpload = useProfileImageUpload.useProfileImageUpload;
|
|
94
|
+
exports.useImageUploader = useImageUploader.useImageUploader;
|
|
95
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/hooks.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { u as useImageUpload, a as useProfileImageUpload } from './useProfileImageUpload-837e76b8.js';
|
|
2
|
+
export { e as useImageUploader } from './useImageUploader-36a03350.js';
|
|
3
|
+
import './index-b9963255.js';
|
|
4
|
+
import 'react';
|
|
5
|
+
import '@rails/activestorage';
|
|
6
|
+
import '@bigbinary/neeto-cist';
|
|
7
|
+
import '@bigbinary/neeto-commons-frontend/initializers';
|
|
8
|
+
import '@bigbinary/neetoui/Toastr';
|
|
9
|
+
import 'ramda';
|
|
10
|
+
import 'i18next';
|
|
11
|
+
import '@tanstack/react-query';
|
|
12
|
+
import '@bigbinary/neeto-commons-frontend/react-utils';
|
|
13
|
+
import 'axios';
|
|
14
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|