@bigbinary/neeto-image-uploader-frontend 2.3.18 → 2.3.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -2
- package/app/javascript/src/translations/en.json +11 -1
- package/dist/AssetLibrary.js +1 -1
- package/dist/ImageUploader.js +1 -1
- package/dist/cjs/AssetLibrary.js +1 -1
- package/dist/cjs/ImageUploader.js +1 -1
- package/dist/cjs/index.js +251 -13
- package/dist/cjs/index.js.map +1 -1
- package/dist/{index-BWdSmwr2.js → index-DQC5j8GS.js} +26 -59
- package/dist/index-DQC5j8GS.js.map +1 -0
- package/dist/{index-74vOALRs.js → index-DspO4oaA.js} +25 -58
- package/dist/index-DspO4oaA.js.map +1 -0
- package/dist/index.js +255 -14
- package/dist/index.js.map +1 -1
- package/package.json +43 -40
- package/types.d.ts +54 -0
- package/dist/index-74vOALRs.js.map +0 -1
- package/dist/index-BWdSmwr2.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,28 +1,35 @@
|
|
|
1
1
|
export { default as BasicImageUploader } from './BasicImageUploader.js';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
|
+
import { useField, useFormikContext, getIn } from 'formik';
|
|
4
|
+
import { isEmpty, isNil } from 'ramda';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import { hyphenate, noop } from '@bigbinary/neeto-cist';
|
|
7
|
+
import Input from '@bigbinary/neetoui/formik/Input';
|
|
8
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
9
|
+
import Button from '@bigbinary/neetoui/Button';
|
|
10
|
+
import Typography from '@bigbinary/neetoui/Typography';
|
|
11
|
+
import { t } from 'i18next';
|
|
12
|
+
import LeftAlign from '@bigbinary/neeto-icons/LeftAlign';
|
|
13
|
+
import CenterAlign from '@bigbinary/neeto-icons/CenterAlign';
|
|
14
|
+
import RightAlign from '@bigbinary/neeto-icons/RightAlign';
|
|
15
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
16
|
+
import { createElement } from 'react';
|
|
17
|
+
import classnames from 'classnames';
|
|
18
|
+
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
19
|
+
import ImageUploader from './ImageUploader.js';
|
|
20
|
+
import Slider from '@bigbinary/neetoui/Slider';
|
|
21
|
+
export { M as AssetLibrary } from './index-DQC5j8GS.js';
|
|
4
22
|
export { u as useImageUpload, a as useProfileImageUpload } from './useProfileImageUpload-BDGk2PWz.js';
|
|
5
23
|
export { u as useImageUploader } from './useImageUploader-BfrsCPBL.js';
|
|
6
24
|
export { refetchImageLibraryAssetList } from './utils.js';
|
|
7
|
-
import '@babel/runtime/helpers/defineProperty';
|
|
8
25
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
9
|
-
import 'classnames';
|
|
10
|
-
import '@bigbinary/neeto-cist';
|
|
11
26
|
import '@bigbinary/neeto-icons/Delete';
|
|
12
|
-
import '@bigbinary/neetoui/Button';
|
|
13
27
|
import './utils-Bb1hqKhN.js';
|
|
14
|
-
import '@bigbinary/neetoui/Typography';
|
|
15
28
|
import '@bigbinary/neetoui/ProgressBar';
|
|
16
|
-
import 'ramda';
|
|
17
|
-
import 'react-i18next';
|
|
18
29
|
import '@bigbinary/neeto-commons-frontend/initializers';
|
|
19
|
-
import '@babel/runtime/helpers/slicedToArray';
|
|
20
|
-
import 'react';
|
|
21
30
|
import 'react-dropzone';
|
|
22
|
-
import 'i18next';
|
|
23
31
|
import '@bigbinary/neetoui/Toastr';
|
|
24
32
|
import './index-B1JijZPf.js';
|
|
25
|
-
import 'react/jsx-runtime';
|
|
26
33
|
import './ImageWithFallback-Csv6Oivd.js';
|
|
27
34
|
import '@babel/runtime/helpers/asyncToGenerator';
|
|
28
35
|
import '@babel/runtime/regenerator';
|
|
@@ -30,7 +37,6 @@ import '@bigbinary/neeto-icons/MenuHorizontal';
|
|
|
30
37
|
import '@bigbinary/neetoui/Dropdown';
|
|
31
38
|
import '@bigbinary/neetoui/Modal';
|
|
32
39
|
import '@bigbinary/neetoui/Tab';
|
|
33
|
-
import '@bigbinary/neetoui/Spinner';
|
|
34
40
|
import '@bigbinary/neeto-icons/LeftArrow';
|
|
35
41
|
import '@tanstack/react-query';
|
|
36
42
|
import 'axios';
|
|
@@ -43,4 +49,239 @@ import './query-DMtOS6FM.js';
|
|
|
43
49
|
import '@bigbinary/neeto-team-members-frontend/constants';
|
|
44
50
|
import '@bigbinary/neetoui/Alert';
|
|
45
51
|
import '@rails/activestorage';
|
|
52
|
+
|
|
53
|
+
var ALIGNMENTS = [{
|
|
54
|
+
label: t("neetoImageUploader.labels.leftAlign"),
|
|
55
|
+
value: "left",
|
|
56
|
+
icon: LeftAlign,
|
|
57
|
+
dataCy: "left-alignment"
|
|
58
|
+
}, {
|
|
59
|
+
label: t("neetoImageUploader.labels.centerAlign"),
|
|
60
|
+
value: "center",
|
|
61
|
+
icon: CenterAlign,
|
|
62
|
+
dataCy: "center-alignment"
|
|
63
|
+
}, {
|
|
64
|
+
label: t("neetoImageUploader.labels.rightAlign"),
|
|
65
|
+
value: "right",
|
|
66
|
+
icon: RightAlign,
|
|
67
|
+
dataCy: "right-alignment"
|
|
68
|
+
}];
|
|
69
|
+
var MINIMUM_LOGO_HEIGHT = 64;
|
|
70
|
+
var MAXIMUM_LOGO_HEIGHT = 100;
|
|
71
|
+
var DEFAULT_LOGO_HEIGHT = 64;
|
|
72
|
+
var DEFAULT_LOGO_POSITION = "left";
|
|
73
|
+
var ONE_MEGABYTE = 1;
|
|
74
|
+
|
|
75
|
+
var AlignmentBlock = function AlignmentBlock(_ref) {
|
|
76
|
+
var name = _ref.name,
|
|
77
|
+
title = _ref.title,
|
|
78
|
+
_ref$onChange = _ref.onChange,
|
|
79
|
+
onChange = _ref$onChange === void 0 ? noop : _ref$onChange;
|
|
80
|
+
var _useField = useField(name),
|
|
81
|
+
_useField2 = _slicedToArray(_useField, 3);
|
|
82
|
+
_useField2[0];
|
|
83
|
+
var _useField2$1$value = _useField2[1].value,
|
|
84
|
+
alignment = _useField2$1$value === void 0 ? DEFAULT_LOGO_POSITION : _useField2$1$value,
|
|
85
|
+
setValue = _useField2[2].setValue;
|
|
86
|
+
var handleChange = function handleChange(newAlignment) {
|
|
87
|
+
if (alignment === newAlignment) return;
|
|
88
|
+
setValue(newAlignment, false);
|
|
89
|
+
onChange(name, newAlignment);
|
|
90
|
+
};
|
|
91
|
+
return /*#__PURE__*/jsxs("div", {
|
|
92
|
+
dataCy: "".concat(hyphenate(title), "-block"),
|
|
93
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
94
|
+
lineHeight: "normal",
|
|
95
|
+
style: "body2",
|
|
96
|
+
weight: "medium",
|
|
97
|
+
children: title
|
|
98
|
+
}), /*#__PURE__*/jsx("div", {
|
|
99
|
+
className: "mt-2 flex items-center gap-3",
|
|
100
|
+
children: ALIGNMENTS.map(function (_ref2) {
|
|
101
|
+
var label = _ref2.label,
|
|
102
|
+
value = _ref2.value,
|
|
103
|
+
icon = _ref2.icon,
|
|
104
|
+
dataCy = _ref2.dataCy;
|
|
105
|
+
return /*#__PURE__*/createElement(Button, {
|
|
106
|
+
icon: icon,
|
|
107
|
+
"data-cy": dataCy,
|
|
108
|
+
key: value,
|
|
109
|
+
size: "large",
|
|
110
|
+
style: alignment === value ? "primary" : "text",
|
|
111
|
+
tooltipProps: {
|
|
112
|
+
content: label,
|
|
113
|
+
position: "bottom"
|
|
114
|
+
},
|
|
115
|
+
onClick: function onClick() {
|
|
116
|
+
return handleChange(value);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
})
|
|
120
|
+
})]
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
var Block = function Block(_ref) {
|
|
125
|
+
var title = _ref.title,
|
|
126
|
+
children = _ref.children,
|
|
127
|
+
dataCy = _ref.dataCy,
|
|
128
|
+
_ref$className = _ref.className,
|
|
129
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
|
130
|
+
_ref$childrenClassNam = _ref.childrenClassName,
|
|
131
|
+
childrenClassName = _ref$childrenClassNam === void 0 ? "" : _ref$childrenClassNam,
|
|
132
|
+
_ref$isLoading = _ref.isLoading,
|
|
133
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading;
|
|
134
|
+
return /*#__PURE__*/jsxs("div", {
|
|
135
|
+
className: classnames("space-y-4", className),
|
|
136
|
+
"data-cy": dataCy,
|
|
137
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
138
|
+
className: "flex items-center justify-between",
|
|
139
|
+
"data-cy": "properties-header",
|
|
140
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
141
|
+
lineHeight: "normal",
|
|
142
|
+
style: "body1",
|
|
143
|
+
weight: "semibold",
|
|
144
|
+
children: title
|
|
145
|
+
}), isLoading && /*#__PURE__*/jsx(Spinner, {})]
|
|
146
|
+
}), /*#__PURE__*/jsx("div", {
|
|
147
|
+
className: classnames("space-y-4", childrenClassName),
|
|
148
|
+
children: children
|
|
149
|
+
})]
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
var ImageUpload = function ImageUpload(_ref) {
|
|
154
|
+
var name = _ref.name,
|
|
155
|
+
handleUpdate = _ref.handleUpdate,
|
|
156
|
+
_ref$maxSize = _ref.maxSize,
|
|
157
|
+
maxSize = _ref$maxSize === void 0 ? ONE_MEGABYTE : _ref$maxSize;
|
|
158
|
+
var _useTranslation = useTranslation(),
|
|
159
|
+
t = _useTranslation.t;
|
|
160
|
+
var _useField = useField(name),
|
|
161
|
+
_useField2 = _slicedToArray(_useField, 3);
|
|
162
|
+
_useField2[0];
|
|
163
|
+
var image = _useField2[1].value,
|
|
164
|
+
setValue = _useField2[2].setValue;
|
|
165
|
+
var handleImageChange = function handleImageChange(changedImage) {
|
|
166
|
+
if (isEmpty(changedImage === null || changedImage === void 0 ? void 0 : changedImage.url)) {
|
|
167
|
+
setValue(null, false);
|
|
168
|
+
handleUpdate(null);
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
setValue(changedImage, false);
|
|
172
|
+
handleUpdate(changedImage);
|
|
173
|
+
};
|
|
174
|
+
return /*#__PURE__*/jsx(Block, {
|
|
175
|
+
dataCy: "add-image-card",
|
|
176
|
+
title: t("neetoImageUploader.labels.addImage"),
|
|
177
|
+
children: /*#__PURE__*/jsx(ImageUploader, {
|
|
178
|
+
className: "w-full",
|
|
179
|
+
src: image === null || image === void 0 ? void 0 : image.url,
|
|
180
|
+
uploadConfig: {
|
|
181
|
+
maxImageSize: maxSize
|
|
182
|
+
},
|
|
183
|
+
onUploadComplete: handleImageChange
|
|
184
|
+
}, image === null || image === void 0 ? void 0 : image.url)
|
|
185
|
+
});
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
var SliderBlock = function SliderBlock(_ref) {
|
|
189
|
+
var title = _ref.title,
|
|
190
|
+
name = _ref.name,
|
|
191
|
+
_ref$onChange = _ref.onChange,
|
|
192
|
+
onChange = _ref$onChange === void 0 ? noop : _ref$onChange,
|
|
193
|
+
defaultValue = _ref.defaultValue,
|
|
194
|
+
min = _ref.min,
|
|
195
|
+
max = _ref.max;
|
|
196
|
+
var _useField = useField(name),
|
|
197
|
+
_useField2 = _slicedToArray(_useField, 3);
|
|
198
|
+
_useField2[0];
|
|
199
|
+
var value = _useField2[1].value,
|
|
200
|
+
setValue = _useField2[2].setValue;
|
|
201
|
+
var handleChange = function handleChange(newValue) {
|
|
202
|
+
if (value === newValue) return;
|
|
203
|
+
setValue(newValue, false);
|
|
204
|
+
onChange(newValue);
|
|
205
|
+
};
|
|
206
|
+
return /*#__PURE__*/jsx("div", {
|
|
207
|
+
"data-cy": "".concat(hyphenate(title), "-slider-block"),
|
|
208
|
+
children: /*#__PURE__*/jsx(Slider, {
|
|
209
|
+
defaultValue: defaultValue,
|
|
210
|
+
max: max,
|
|
211
|
+
min: min,
|
|
212
|
+
value: value,
|
|
213
|
+
label: title,
|
|
214
|
+
onChange: handleChange
|
|
215
|
+
})
|
|
216
|
+
});
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
var root = document.querySelector(":root");
|
|
220
|
+
var setLogoHeight = function setLogoHeight(value, variableName) {
|
|
221
|
+
return root.style.setProperty(variableName, "".concat(Number(value) || DEFAULT_LOGO_HEIGHT, "px"));
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
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; }
|
|
225
|
+
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; }
|
|
226
|
+
var ImageForm = function ImageForm(_ref) {
|
|
227
|
+
var _ref$onChange = _ref.onChange,
|
|
228
|
+
onChange = _ref$onChange === void 0 ? noop : _ref$onChange,
|
|
229
|
+
_ref$imageUploaderPro = _ref.imageUploaderProps,
|
|
230
|
+
imageUploaderProps = _ref$imageUploaderPro === void 0 ? {} : _ref$imageUploaderPro,
|
|
231
|
+
_ref$className = _ref.className,
|
|
232
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
|
233
|
+
_ref$names = _ref.names,
|
|
234
|
+
names = _ref$names === void 0 ? {} : _ref$names,
|
|
235
|
+
_ref$logoHeight = _ref.logoHeight,
|
|
236
|
+
logoHeight = _ref$logoHeight === void 0 ? {
|
|
237
|
+
"default": DEFAULT_LOGO_HEIGHT,
|
|
238
|
+
min: MINIMUM_LOGO_HEIGHT,
|
|
239
|
+
max: MAXIMUM_LOGO_HEIGHT
|
|
240
|
+
} : _ref$logoHeight,
|
|
241
|
+
logoSizeVariableName = _ref.logoSizeVariableName;
|
|
242
|
+
var _useFormikContext = useFormikContext(),
|
|
243
|
+
values = _useFormikContext.values,
|
|
244
|
+
setFieldValue = _useFormikContext.setFieldValue;
|
|
245
|
+
var _useTranslation = useTranslation(),
|
|
246
|
+
t = _useTranslation.t;
|
|
247
|
+
var imageValue = getIn(values, names.image);
|
|
248
|
+
var handleImageChange = function handleImageChange(image) {
|
|
249
|
+
if (isNil(image)) {
|
|
250
|
+
setLogoHeight(logoHeight["default"], logoSizeVariableName);
|
|
251
|
+
setFieldValue(names.height, logoHeight["default"]);
|
|
252
|
+
}
|
|
253
|
+
onChange === null || onChange === void 0 || onChange(names.image, image);
|
|
254
|
+
};
|
|
255
|
+
var handleSliderChange = function handleSliderChange(value) {
|
|
256
|
+
setLogoHeight(value, logoSizeVariableName);
|
|
257
|
+
onChange === null || onChange === void 0 || onChange(names.height, value);
|
|
258
|
+
};
|
|
259
|
+
return /*#__PURE__*/jsxs("div", {
|
|
260
|
+
className: "space-y-4 ".concat(className),
|
|
261
|
+
children: [/*#__PURE__*/jsx(ImageUpload, _objectSpread({
|
|
262
|
+
handleUpdate: handleImageChange,
|
|
263
|
+
name: names.image
|
|
264
|
+
}, imageUploaderProps)), imageValue && /*#__PURE__*/jsxs("div", {
|
|
265
|
+
className: "space-y-4 px-2",
|
|
266
|
+
children: [/*#__PURE__*/jsx(SliderBlock, {
|
|
267
|
+
defaultValue: logoHeight["default"],
|
|
268
|
+
max: logoHeight.max,
|
|
269
|
+
min: logoHeight.min,
|
|
270
|
+
name: names.height,
|
|
271
|
+
title: t("neetoImageUploader.labels.logoSize"),
|
|
272
|
+
onChange: handleSliderChange
|
|
273
|
+
}), /*#__PURE__*/jsx(AlignmentBlock, {
|
|
274
|
+
name: names.alignment,
|
|
275
|
+
title: t("neetoImageUploader.labels.alignment"),
|
|
276
|
+
onChange: onChange
|
|
277
|
+
}), /*#__PURE__*/jsx(Input, {
|
|
278
|
+
name: "altText",
|
|
279
|
+
helpText: t("neetoImageUploader.tooltips.logoAltText"),
|
|
280
|
+
placeholder: t("neetoImageUploader.labels.logoAltText")
|
|
281
|
+
})]
|
|
282
|
+
})]
|
|
283
|
+
});
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
export { ImageForm, ImageUploader };
|
|
46
287
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../app/javascript/src/components/ImageForm/constants.js","../app/javascript/src/components/ImageForm/AlignmentBlock.jsx","../app/javascript/src/components/ImageForm/Block.jsx","../app/javascript/src/components/ImageForm/ImageUpload.jsx","../app/javascript/src/components/ImageForm/SliderBlock.jsx","../app/javascript/src/components/ImageForm/utils.js","../app/javascript/src/components/ImageForm/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport { LeftAlign, CenterAlign, RightAlign } from \"neetoicons\";\n\nexport const ALIGNMENTS = [\n {\n label: t(\"neetoImageUploader.labels.leftAlign\"),\n value: \"left\",\n icon: LeftAlign,\n dataCy: \"left-alignment\",\n },\n {\n label: t(\"neetoImageUploader.labels.centerAlign\"),\n value: \"center\",\n icon: CenterAlign,\n dataCy: \"center-alignment\",\n },\n {\n label: t(\"neetoImageUploader.labels.rightAlign\"),\n value: \"right\",\n icon: RightAlign,\n dataCy: \"right-alignment\",\n },\n];\n\nexport const MINIMUM_LOGO_HEIGHT = 64;\nexport const MAXIMUM_LOGO_HEIGHT = 100;\nexport const DEFAULT_LOGO_HEIGHT = 64;\nexport const DEFAULT_LOGO_POSITION = \"left\";\nexport const ONE_MEGABYTE = 1;\n","import { useField } from \"formik\";\nimport { hyphenate, noop } from \"neetocist\";\nimport { Button, Typography } from \"neetoui\";\n\nimport { ALIGNMENTS, DEFAULT_LOGO_POSITION } from \"./constants\";\n\nconst AlignmentBlock = ({ name, title, onChange = noop }) => {\n const [_, { value: alignment = DEFAULT_LOGO_POSITION }, { setValue }] =\n useField(name);\n\n const handleChange = newAlignment => {\n if (alignment === newAlignment) return;\n\n setValue(newAlignment, false);\n onChange(name, newAlignment);\n };\n\n return (\n <div dataCy={`${hyphenate(title)}-block`}>\n <Typography lineHeight=\"normal\" style=\"body2\" weight=\"medium\">\n {title}\n </Typography>\n <div className=\"mt-2 flex items-center gap-3\">\n {ALIGNMENTS.map(({ label, value, icon, dataCy }) => (\n <Button\n {...{ icon }}\n data-cy={dataCy}\n key={value}\n size=\"large\"\n style={alignment === value ? \"primary\" : \"text\"}\n tooltipProps={{ content: label, position: \"bottom\" }}\n onClick={() => handleChange(value)}\n />\n ))}\n </div>\n </div>\n );\n};\n\nexport default AlignmentBlock;\n","import classnames from \"classnames\";\nimport { Spinner, Typography } from \"neetoui\";\n\nconst Block = ({\n title,\n children,\n dataCy,\n className = \"\",\n childrenClassName = \"\",\n isLoading = false,\n}) => (\n <div className={classnames(\"space-y-4\", className)} data-cy={dataCy}>\n <div\n className=\"flex items-center justify-between\"\n data-cy=\"properties-header\"\n >\n <Typography lineHeight=\"normal\" style=\"body1\" weight=\"semibold\">\n {title}\n </Typography>\n {isLoading && <Spinner />}\n </div>\n <div className={classnames(\"space-y-4\", childrenClassName)}>{children}</div>\n </div>\n);\n\nexport default Block;\n","import { useField } from \"formik\";\nimport { isEmpty } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport Block from \"./Block\";\nimport { ONE_MEGABYTE } from \"./constants\";\n\nimport ImageUploader from \"../ImageUploader\";\n\nconst ImageUpload = ({ name, handleUpdate, maxSize = ONE_MEGABYTE }) => {\n const { t } = useTranslation();\n const [_, { value: image }, { setValue }] = useField(name);\n\n const handleImageChange = changedImage => {\n if (isEmpty(changedImage?.url)) {\n setValue(null, false);\n handleUpdate(null);\n\n return;\n }\n setValue(changedImage, false);\n handleUpdate(changedImage);\n };\n\n return (\n <Block\n dataCy=\"add-image-card\"\n title={t(\"neetoImageUploader.labels.addImage\")}\n >\n <ImageUploader\n className=\"w-full\"\n key={image?.url}\n src={image?.url}\n uploadConfig={{ maxImageSize: maxSize }}\n onUploadComplete={handleImageChange}\n />\n </Block>\n );\n};\n\nexport default ImageUpload;\n","import { useField } from \"formik\";\nimport { hyphenate, noop } from \"neetocist\";\nimport { Slider } from \"neetoui\";\n\nconst SliderBlock = ({\n title,\n name,\n onChange = noop,\n defaultValue,\n min,\n max,\n}) => {\n const [_, { value }, { setValue }] = useField(name);\n\n const handleChange = newValue => {\n if (value === newValue) return;\n\n setValue(newValue, false);\n onChange(newValue);\n };\n\n return (\n <div data-cy={`${hyphenate(title)}-slider-block`}>\n <Slider\n {...{ defaultValue, max, min, value }}\n label={title}\n onChange={handleChange}\n />\n </div>\n );\n};\n\nexport default SliderBlock;\n","import { DEFAULT_LOGO_HEIGHT } from \"./constants\";\n\nconst root = document.querySelector(\":root\");\n\nexport const setLogoHeight = (value, variableName) =>\n root.style.setProperty(\n variableName,\n `${Number(value) || DEFAULT_LOGO_HEIGHT}px`\n );\n","import { useFormikContext, getIn } from \"formik\";\nimport { isNil } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\nimport { noop } from \"neetocist\";\nimport { Input } from \"neetoui/formik\";\n\nimport AlignmentBlock from \"./AlignmentBlock\";\nimport {\n DEFAULT_LOGO_HEIGHT,\n MAXIMUM_LOGO_HEIGHT,\n MINIMUM_LOGO_HEIGHT,\n} from \"./constants\";\nimport ImageUpload from \"./ImageUpload\";\nimport SliderBlock from \"./SliderBlock\";\nimport { setLogoHeight } from \"./utils\";\n\nconst ImageForm = ({\n onChange = noop,\n imageUploaderProps = {},\n className = \"\",\n names = {},\n logoHeight = {\n default: DEFAULT_LOGO_HEIGHT,\n min: MINIMUM_LOGO_HEIGHT,\n max: MAXIMUM_LOGO_HEIGHT,\n },\n logoSizeVariableName,\n}) => {\n const { values, setFieldValue } = useFormikContext();\n\n const { t } = useTranslation();\n\n const imageValue = getIn(values, names.image);\n\n const handleImageChange = image => {\n if (isNil(image)) {\n setLogoHeight(logoHeight.default, logoSizeVariableName);\n setFieldValue(names.height, logoHeight.default);\n }\n\n onChange?.(names.image, image);\n };\n\n const handleSliderChange = value => {\n setLogoHeight(value, logoSizeVariableName);\n onChange?.(names.height, value);\n };\n\n return (\n <div className={`space-y-4 ${className}`}>\n <ImageUpload\n handleUpdate={handleImageChange}\n name={names.image}\n {...imageUploaderProps}\n />\n {imageValue && (\n <div className=\"space-y-4 px-2\">\n <SliderBlock\n defaultValue={logoHeight.default}\n max={logoHeight.max}\n min={logoHeight.min}\n name={names.height}\n title={t(\"neetoImageUploader.labels.logoSize\")}\n onChange={handleSliderChange}\n />\n <AlignmentBlock\n name={names.alignment}\n title={t(\"neetoImageUploader.labels.alignment\")}\n {...{ onChange }}\n />\n <Input\n name=\"altText\"\n helpText={t(\"neetoImageUploader.tooltips.logoAltText\")}\n placeholder={t(\"neetoImageUploader.labels.logoAltText\")}\n />\n </div>\n )}\n </div>\n );\n};\n\nexport default ImageForm;\n"],"names":["ALIGNMENTS","label","t","value","icon","LeftAlign","dataCy","CenterAlign","RightAlign","MINIMUM_LOGO_HEIGHT","MAXIMUM_LOGO_HEIGHT","DEFAULT_LOGO_HEIGHT","DEFAULT_LOGO_POSITION","ONE_MEGABYTE","AlignmentBlock","_ref","name","title","_ref$onChange","onChange","noop","_useField","useField","_useField2","_slicedToArray","_","_useField2$1$value","alignment","setValue","handleChange","newAlignment","_jsxs","concat","hyphenate","children","_jsx","Typography","lineHeight","style","weight","className","map","_ref2","_createElement","Button","key","size","tooltipProps","content","position","onClick","Block","_ref$className","_ref$childrenClassNam","childrenClassName","_ref$isLoading","isLoading","classnames","Spinner","ImageUpload","handleUpdate","_ref$maxSize","maxSize","_useTranslation","useTranslation","image","handleImageChange","changedImage","isEmpty","url","ImageUploader","src","uploadConfig","maxImageSize","onUploadComplete","SliderBlock","defaultValue","min","max","newValue","Slider","root","document","querySelector","setLogoHeight","variableName","setProperty","Number","ImageForm","_ref$imageUploaderPro","imageUploaderProps","_ref$names","names","_ref$logoHeight","logoHeight","logoSizeVariableName","_useFormikContext","useFormikContext","values","setFieldValue","imageValue","getIn","isNil","height","handleSliderChange","_objectSpread","Input","helpText","placeholder"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAMA,UAAU,GAAG,CACxB;AACEC,EAAAA,KAAK,EAAEC,CAAC,CAAC,qCAAqC,CAAC;AAC/CC,EAAAA,KAAK,EAAE,MAAM;AACbC,EAAAA,IAAI,EAAEC,SAAS;AACfC,EAAAA,MAAM,EAAE;AACV,CAAC,EACD;AACEL,EAAAA,KAAK,EAAEC,CAAC,CAAC,uCAAuC,CAAC;AACjDC,EAAAA,KAAK,EAAE,QAAQ;AACfC,EAAAA,IAAI,EAAEG,WAAW;AACjBD,EAAAA,MAAM,EAAE;AACV,CAAC,EACD;AACEL,EAAAA,KAAK,EAAEC,CAAC,CAAC,sCAAsC,CAAC;AAChDC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,IAAI,EAAEI,UAAU;AAChBF,EAAAA,MAAM,EAAE;AACV,CAAC,CACF;AAEM,IAAMG,mBAAmB,GAAG,EAAE;AAC9B,IAAMC,mBAAmB,GAAG,GAAG;AAC/B,IAAMC,mBAAmB,GAAG,EAAE;AAC9B,IAAMC,qBAAqB,GAAG,MAAM;AACpC,IAAMC,YAAY,GAAG,CAAC;;ACtB7B,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CAAAC,IAAA,EAAyC;AAAA,EAAA,IAAnCC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IAAEC,KAAK,GAAAF,IAAA,CAALE,KAAK;IAAAC,aAAA,GAAAH,IAAA,CAAEI,QAAQ;AAARA,IAAAA,QA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,CAAC,oCAAoC,CAAE;AAC/CiB,QAAAA,QAAQ,EAAEqF;AAAmB,OAC9B,CAAC,eACFrE,GAAA,CAACrB,cAAc,EAAA;QACbE,IAAI,EAAE4E,KAAK,CAACjE,SAAU;AACtBV,QAAAA,KAAK,EAAEf,CAAC,CAAC,qCAAqC,CAAE;AAC1CiB,QAAAA,QAAQ,EAARA;AAAQ,OACf,CAAC,eACFgB,GAAA,CAACuE,KAAK,EAAA;AACJ1F,QAAAA,IAAI,EAAC,SAAS;AACd2F,QAAAA,QAAQ,EAAEzG,CAAC,CAAC,yCAAyC,CAAE;QACvD0G,WAAW,EAAE1G,CAAC,CAAC,uCAAuC;AAAE,OACzD,CAAC;AAAA,KACC,CACN;AAAA,GACE,CAAC;AAEV;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-image-uploader-frontend",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.20",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/bigbinary/neeto-image-uploader-nano/issues"
|
|
@@ -27,21 +27,21 @@
|
|
|
27
27
|
],
|
|
28
28
|
"app/**/*.{html,md,js,css,jsx,json,yml}": [
|
|
29
29
|
"prettier --write",
|
|
30
|
-
"eslint --cache --fix"
|
|
30
|
+
"eslint --cache --fix --no-warn-ignored"
|
|
31
31
|
],
|
|
32
32
|
"app/views/**/*.html.erb": [
|
|
33
33
|
"bundle exec erblint --lint-all --format compact -a"
|
|
34
34
|
],
|
|
35
35
|
"cypress-tests/**/*.{html,md,js,css,jsx,json,yml}": [
|
|
36
36
|
"prettier --write",
|
|
37
|
-
"eslint --cache --fix"
|
|
37
|
+
"eslint --cache --fix --no-warn-ignored"
|
|
38
38
|
],
|
|
39
39
|
"{Gemfile,Rakefile,config.ru}": [
|
|
40
40
|
"bundle exec rubocop -a --force-exclusion"
|
|
41
41
|
],
|
|
42
42
|
"{package.json,.eslintrc.js,.prettierrc.js}": [
|
|
43
43
|
"prettier --write",
|
|
44
|
-
"eslint --cache --fix"
|
|
44
|
+
"eslint --cache --fix --no-warn-ignored"
|
|
45
45
|
]
|
|
46
46
|
},
|
|
47
47
|
"exports": {
|
|
@@ -66,15 +66,15 @@
|
|
|
66
66
|
"@babel/preset-typescript": "7.26.0",
|
|
67
67
|
"@babel/runtime": "7.26.10",
|
|
68
68
|
"@bigbinary/babel-preset-neeto": "^1.0.3",
|
|
69
|
-
"@bigbinary/eslint-plugin-neeto": "1.
|
|
69
|
+
"@bigbinary/eslint-plugin-neeto": "1.6.4",
|
|
70
70
|
"@bigbinary/neeto-cist": "1.0.17",
|
|
71
|
-
"@bigbinary/neeto-commons-frontend": "4.13.
|
|
72
|
-
"@bigbinary/neeto-editor": "1.
|
|
73
|
-
"@bigbinary/neeto-filters-frontend": "4.3.
|
|
74
|
-
"@bigbinary/neeto-icons": "1.20.
|
|
75
|
-
"@bigbinary/neeto-molecules": "3.16.
|
|
76
|
-
"@bigbinary/neeto-team-members-frontend": "4.5.
|
|
77
|
-
"@bigbinary/neetoui": "8.3.
|
|
71
|
+
"@bigbinary/neeto-commons-frontend": "4.13.45",
|
|
72
|
+
"@bigbinary/neeto-editor": "1.47.20",
|
|
73
|
+
"@bigbinary/neeto-filters-frontend": "4.3.22",
|
|
74
|
+
"@bigbinary/neeto-icons": "1.20.53",
|
|
75
|
+
"@bigbinary/neeto-molecules": "3.16.77",
|
|
76
|
+
"@bigbinary/neeto-team-members-frontend": "4.5.20",
|
|
77
|
+
"@bigbinary/neetoui": "8.3.12",
|
|
78
78
|
"@emotion/is-prop-valid": "1.2.0",
|
|
79
79
|
"@faker-js/faker": "8.2.0",
|
|
80
80
|
"@honeybadger-io/js": "6.10.1",
|
|
@@ -109,22 +109,23 @@
|
|
|
109
109
|
"css-loader": "^6.7.1",
|
|
110
110
|
"dompurify": "^3.2.4",
|
|
111
111
|
"dotenv-webpack": "^8.0.1",
|
|
112
|
-
"eslint": "
|
|
113
|
-
"eslint-config-prettier": "
|
|
114
|
-
"eslint-plugin-cypress": "
|
|
115
|
-
"eslint-plugin-import": "2.31.0",
|
|
116
|
-
"eslint-plugin-jam3": "0.2.3",
|
|
117
|
-
"eslint-plugin-json": "
|
|
112
|
+
"eslint": "^9.25.1",
|
|
113
|
+
"eslint-config-prettier": "^10.1.2",
|
|
114
|
+
"eslint-plugin-cypress": "^4.3.0",
|
|
115
|
+
"eslint-plugin-import": "^2.31.0",
|
|
116
|
+
"eslint-plugin-jam3": "^0.2.3",
|
|
117
|
+
"eslint-plugin-json": "^4.0.1",
|
|
118
118
|
"eslint-plugin-no-unsanitized": "4.1.2",
|
|
119
|
-
"eslint-plugin-prettier": "
|
|
120
|
-
"eslint-plugin-promise": "
|
|
121
|
-
"eslint-plugin-react": "7.37.
|
|
122
|
-
"eslint-plugin-react-hooks": "
|
|
123
|
-
"eslint-plugin-security": "^
|
|
124
|
-
"eslint-plugin-sonarjs": "^0.
|
|
125
|
-
"eslint-plugin-unused-imports": "
|
|
119
|
+
"eslint-plugin-prettier": "^5.2.6",
|
|
120
|
+
"eslint-plugin-promise": "^7.2.1",
|
|
121
|
+
"eslint-plugin-react": "^7.37.5",
|
|
122
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
123
|
+
"eslint-plugin-security": "^3.0.1",
|
|
124
|
+
"eslint-plugin-sonarjs": "^3.0.2",
|
|
125
|
+
"eslint-plugin-unused-imports": "^4.1.4",
|
|
126
126
|
"eslint-plugin-xss": "^0.1.12",
|
|
127
127
|
"formik": "2.4.6",
|
|
128
|
+
"globals": "16.0.0",
|
|
128
129
|
"html-webpack-plugin": "5.5.0",
|
|
129
130
|
"https-browserify": "1.0.0",
|
|
130
131
|
"husky": "7.0.4",
|
|
@@ -142,13 +143,13 @@
|
|
|
142
143
|
"postcss-import": "^15.0.0",
|
|
143
144
|
"postcss-loader": "^7.0.1",
|
|
144
145
|
"postcss-preset-env": "7.8.2",
|
|
145
|
-
"prettier": "
|
|
146
|
+
"prettier": "3",
|
|
146
147
|
"prettier-plugin-tailwindcss": "0.1.10",
|
|
147
148
|
"process": "^0.11.10",
|
|
148
149
|
"qs": "^6.11.2",
|
|
149
150
|
"ramda": "0.29.0",
|
|
150
|
-
"react": "18.
|
|
151
|
-
"react-dom": "18.
|
|
151
|
+
"react": "18.3.1",
|
|
152
|
+
"react-dom": "18.3.1",
|
|
152
153
|
"react-dropzone": "14.3.8",
|
|
153
154
|
"react-helmet": "^6.1.0",
|
|
154
155
|
"react-i18next": "12.3.1",
|
|
@@ -164,7 +165,7 @@
|
|
|
164
165
|
"rollup-plugin-copy": "3.5.0",
|
|
165
166
|
"rollup-plugin-peer-deps-external": "2.2.4",
|
|
166
167
|
"rollup-plugin-styles": "4.0.0",
|
|
167
|
-
"sass": "
|
|
168
|
+
"sass": "1.89.0",
|
|
168
169
|
"sass-loader": "^13.0.2",
|
|
169
170
|
"shakapacker": "6.5.2",
|
|
170
171
|
"source-map-loader": "4.0.1",
|
|
@@ -179,20 +180,20 @@
|
|
|
179
180
|
"webpack": "5.94.0",
|
|
180
181
|
"webpack-assets-manifest": "^5.1.0",
|
|
181
182
|
"webpack-cli": "4.10.0",
|
|
182
|
-
"webpack-dev-server": "^
|
|
183
|
+
"webpack-dev-server": "^5.2.1",
|
|
183
184
|
"yup": "0.32.11",
|
|
184
185
|
"zustand": "4.4.2"
|
|
185
186
|
},
|
|
186
187
|
"peerDependencies": {
|
|
187
188
|
"@babel/runtime": "7.26.10",
|
|
188
189
|
"@bigbinary/neeto-cist": "1.0.17",
|
|
189
|
-
"@bigbinary/neeto-commons-frontend": "4.13.
|
|
190
|
-
"@bigbinary/neeto-editor": "1.
|
|
191
|
-
"@bigbinary/neeto-filters-frontend": "4.3.
|
|
192
|
-
"@bigbinary/neeto-icons": "1.20.
|
|
193
|
-
"@bigbinary/neeto-molecules": "3.16.
|
|
194
|
-
"@bigbinary/neeto-team-members-frontend": "4.5.
|
|
195
|
-
"@bigbinary/neetoui": "8.3.
|
|
190
|
+
"@bigbinary/neeto-commons-frontend": "4.13.45",
|
|
191
|
+
"@bigbinary/neeto-editor": "1.47.20",
|
|
192
|
+
"@bigbinary/neeto-filters-frontend": "4.3.22",
|
|
193
|
+
"@bigbinary/neeto-icons": "1.20.53",
|
|
194
|
+
"@bigbinary/neeto-molecules": "3.16.77",
|
|
195
|
+
"@bigbinary/neeto-team-members-frontend": "4.5.20",
|
|
196
|
+
"@bigbinary/neetoui": "8.3.12",
|
|
196
197
|
"@honeybadger-io/js": "6.10.1",
|
|
197
198
|
"@honeybadger-io/react": "6.1.25",
|
|
198
199
|
"@rails/activestorage": "7.0.8-3",
|
|
@@ -213,8 +214,8 @@
|
|
|
213
214
|
"path-browserify": "^1.0.1",
|
|
214
215
|
"qs": "^6.11.2",
|
|
215
216
|
"ramda": "0.29.0",
|
|
216
|
-
"react": "18.
|
|
217
|
-
"react-dom": "18.
|
|
217
|
+
"react": "18.3.1",
|
|
218
|
+
"react-dom": "18.3.1",
|
|
218
219
|
"react-dropzone": "14.3.8",
|
|
219
220
|
"react-helmet": "^6.1.0",
|
|
220
221
|
"react-i18next": "12.3.1",
|
|
@@ -235,7 +236,9 @@
|
|
|
235
236
|
"resolutions": {
|
|
236
237
|
"postcss": "^8",
|
|
237
238
|
"wrap-ansi": "7.0.0",
|
|
238
|
-
"string-width": "4.1.0"
|
|
239
|
+
"string-width": "4.1.0",
|
|
240
|
+
"react": "18.3.1",
|
|
241
|
+
"react-dom": "18.3.1"
|
|
239
242
|
},
|
|
240
243
|
"engines": {
|
|
241
244
|
"node": ">=22.13",
|
package/types.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { QueryClient } from "react-query";
|
|
3
|
+
|
|
2
4
|
interface AssetLibraryProps {
|
|
3
5
|
isOpen?: boolean;
|
|
4
6
|
onClose?: () => void;
|
|
@@ -40,6 +42,56 @@ interface BasicImageUploaderProps {
|
|
|
40
42
|
};
|
|
41
43
|
}
|
|
42
44
|
|
|
45
|
+
interface ImageFormProps {
|
|
46
|
+
onChange?: (name: string, value: any) => void;
|
|
47
|
+
imageUploaderProps?: {
|
|
48
|
+
maxSize?: number;
|
|
49
|
+
[key: string]: any;
|
|
50
|
+
};
|
|
51
|
+
className?: string;
|
|
52
|
+
names?: {
|
|
53
|
+
image?: string;
|
|
54
|
+
height?: string;
|
|
55
|
+
alignment?: string;
|
|
56
|
+
};
|
|
57
|
+
logoHeight?: {
|
|
58
|
+
default: number;
|
|
59
|
+
min: number;
|
|
60
|
+
max: number;
|
|
61
|
+
};
|
|
62
|
+
logoSizeVariableName: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
interface ImageUploadProps {
|
|
66
|
+
name: string;
|
|
67
|
+
handleUpdate: (image: any) => void;
|
|
68
|
+
maxSize?: number;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
interface SliderBlockProps {
|
|
72
|
+
title: string;
|
|
73
|
+
name: string;
|
|
74
|
+
onChange?: (value: number) => void;
|
|
75
|
+
defaultValue: number;
|
|
76
|
+
min: number;
|
|
77
|
+
max: number;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
interface AlignmentBlockProps {
|
|
81
|
+
name: string;
|
|
82
|
+
title: string;
|
|
83
|
+
onChange?: (name: string, value: string) => void;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
interface BlockProps {
|
|
87
|
+
title: string;
|
|
88
|
+
children: React.ReactNode;
|
|
89
|
+
dataCy?: string;
|
|
90
|
+
className?: string;
|
|
91
|
+
childrenClassName?: string;
|
|
92
|
+
isLoading?: boolean;
|
|
93
|
+
}
|
|
94
|
+
|
|
43
95
|
export function useImageUpload(): {
|
|
44
96
|
uploadImage: (file: File, onUploadComplete: (url: string) => void) => void;
|
|
45
97
|
uploadProgress: number;
|
|
@@ -68,4 +120,6 @@ export function ImageUploader(props: ImageUploaderProps): JSX.Element;
|
|
|
68
120
|
|
|
69
121
|
export function AssetLibrary(props: AssetLibraryProps): JSX.Element;
|
|
70
122
|
|
|
123
|
+
export function ImageForm(props: ImageFormProps): JSX.Element;
|
|
124
|
+
|
|
71
125
|
export function refetchImageLibraryAssetList(queryClient: QueryClient): void;
|