@raketa-builder/image-input 1.8.0 → 1.8.1
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/dist/MediaManager.js +1 -1
- package/dist/dialogs/Dialog.js +0 -1
- package/dist/lib/MediaRenderer.js +1 -8
- package/dist/lib/ProgressBar.js +0 -1
- package/dist/lists/index.js +1 -1
- package/dist/pickers/ImagePicker/BrowseTab.js +5 -4
- package/dist/pickers/ImagePicker/ImagePicker.js +10 -2
- package/package.json +7 -5
package/dist/MediaManager.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __spreadProps, __spreadValues } from './chunk-ORMEWXMH.js';
|
|
2
2
|
|
|
3
|
-
const serialize = (params) => Object.keys(params).map((k) => encodeURIComponent(k)
|
|
3
|
+
const serialize = (params) => Object.keys(params).map((k) => `${encodeURIComponent(k)}=${encodeURIComponent(params[k])}`).join("&");
|
|
4
4
|
const get = (url, params = {}, opts = {}) => fetch(`${url}?${serialize(params)}`, opts);
|
|
5
5
|
const patch = (url, params = {}, opts = {}) => fetch(
|
|
6
6
|
url,
|
package/dist/dialogs/Dialog.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { __objRest, __spreadValues } from '../chunk-ORMEWXMH.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import 'react';
|
|
4
3
|
import { Image } from '@raketa-builder/support';
|
|
5
4
|
import { DotLottieReact } from '@lottiefiles/dotlottie-react';
|
|
6
5
|
import { isLottieFile } from './mediaUtils';
|
|
@@ -20,13 +19,7 @@ const MediaRenderer = (_a) => {
|
|
|
20
19
|
}
|
|
21
20
|
);
|
|
22
21
|
}
|
|
23
|
-
return /* @__PURE__ */ jsx(
|
|
24
|
-
Image,
|
|
25
|
-
__spreadValues({
|
|
26
|
-
src,
|
|
27
|
-
variant
|
|
28
|
-
}, props)
|
|
29
|
-
);
|
|
22
|
+
return /* @__PURE__ */ jsx(Image, __spreadValues({ src, variant }, props));
|
|
30
23
|
};
|
|
31
24
|
var MediaRenderer_default = MediaRenderer;
|
|
32
25
|
|
package/dist/lib/ProgressBar.js
CHANGED
package/dist/lists/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../chunk-ORMEWXMH.js';
|
|
2
2
|
|
|
3
3
|
const add = (items, item) => [...items, item];
|
|
4
|
-
const addAt = (
|
|
4
|
+
const addAt = (_items, _item, _idx) => console.log("TODO: Implement me");
|
|
5
5
|
const removeByIndex = (items, idx) => [
|
|
6
6
|
...items.slice(0, idx),
|
|
7
7
|
...items.slice(idx + 1)
|
|
@@ -55,7 +55,7 @@ const ImageItem = ({ image, selected, onSelect, onFastSelect }) => /* @__PURE__
|
|
|
55
55
|
{
|
|
56
56
|
src: getPreviewImage(image),
|
|
57
57
|
variant: "thumb",
|
|
58
|
-
title: image
|
|
58
|
+
title: image == null ? void 0 : image.name,
|
|
59
59
|
alt: ""
|
|
60
60
|
}
|
|
61
61
|
) })
|
|
@@ -116,7 +116,8 @@ const ImagePreview = ({ image, onDelete }) => {
|
|
|
116
116
|
(image.size / 1024).toFixed(2),
|
|
117
117
|
" KB",
|
|
118
118
|
!isLottieFile(image) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
119
|
-
"
|
|
119
|
+
" ",
|
|
120
|
+
"/ ",
|
|
120
121
|
image.width,
|
|
121
122
|
"\xD7",
|
|
122
123
|
image.height
|
|
@@ -124,7 +125,7 @@ const ImagePreview = ({ image, onDelete }) => {
|
|
|
124
125
|
] })
|
|
125
126
|
] })
|
|
126
127
|
] }),
|
|
127
|
-
isImageEditable(image) && /* @__PURE__ */ jsx(
|
|
128
|
+
isImageEditable(image) && /* @__PURE__ */ jsx(
|
|
128
129
|
Button,
|
|
129
130
|
{
|
|
130
131
|
type: "button",
|
|
@@ -136,7 +137,7 @@ const ImagePreview = ({ image, onDelete }) => {
|
|
|
136
137
|
},
|
|
137
138
|
children: "Remove image"
|
|
138
139
|
}
|
|
139
|
-
)
|
|
140
|
+
)
|
|
140
141
|
] });
|
|
141
142
|
};
|
|
142
143
|
const BrowseTab = ({
|
|
@@ -42,7 +42,7 @@ const fetchImage = (value) => {
|
|
|
42
42
|
return false;
|
|
43
43
|
}
|
|
44
44
|
const type = typeof value;
|
|
45
|
-
if (type === "object" &&
|
|
45
|
+
if (type === "object" && Object.hasOwn(value, "image")) {
|
|
46
46
|
return value.image;
|
|
47
47
|
}
|
|
48
48
|
return value;
|
|
@@ -147,7 +147,15 @@ const ImagePicker = ({
|
|
|
147
147
|
const image = fetchImage(value);
|
|
148
148
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
149
149
|
/* @__PURE__ */ jsxs(ImageControl, { children: [
|
|
150
|
-
/* @__PURE__ */ jsx(ImageWrapper, { children: image ? /* @__PURE__ */ jsx(
|
|
150
|
+
/* @__PURE__ */ jsx(ImageWrapper, { children: image ? /* @__PURE__ */ jsx(
|
|
151
|
+
MediaRenderer,
|
|
152
|
+
{
|
|
153
|
+
src: image,
|
|
154
|
+
variant: "thumb",
|
|
155
|
+
title: image.name,
|
|
156
|
+
alt: ""
|
|
157
|
+
}
|
|
158
|
+
) : /* @__PURE__ */ jsx(ImagePlaceholder, {}) }),
|
|
151
159
|
/* @__PURE__ */ jsxs(FormGroup, { children: [
|
|
152
160
|
/* @__PURE__ */ jsx(Label, { children: label }),
|
|
153
161
|
/* @__PURE__ */ jsxs("div", { style: { marginBottom: "0.5rem" }, children: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raketa-builder/image-input",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -26,8 +26,10 @@
|
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "tsup",
|
|
28
28
|
"dev": "tsup --watch",
|
|
29
|
-
"format": "prettier --write .",
|
|
30
|
-
"
|
|
29
|
+
"format": "prettier --ignore-path ../../.prettierignore --write .",
|
|
30
|
+
"format:check": "prettier --ignore-path ../../.prettierignore --check .",
|
|
31
|
+
"lint": "biome lint --write --max-diagnostics=5000 .",
|
|
32
|
+
"lint:check": "biome lint --max-diagnostics=5000 ."
|
|
31
33
|
},
|
|
32
34
|
"peerDependencies": {
|
|
33
35
|
"react": ">=19.1.0 && <=19.3.0",
|
|
@@ -35,8 +37,8 @@
|
|
|
35
37
|
},
|
|
36
38
|
"dependencies": {
|
|
37
39
|
"react-dropzone": "14.3.8",
|
|
38
|
-
"@raketa-builder/support": "1.8.
|
|
39
|
-
"@raketa-builder/ui": "1.8.
|
|
40
|
+
"@raketa-builder/support": "1.8.1",
|
|
41
|
+
"@raketa-builder/ui": "1.8.1",
|
|
40
42
|
"@lottiefiles/dotlottie-react": "0.19.2"
|
|
41
43
|
},
|
|
42
44
|
"devDependencies": {
|