@homefile/components-v2 2.14.21 → 2.14.22

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.
@@ -19,6 +19,7 @@ export const AIGridField = ({ children, onAISend, onRemove, onUpload, }) => {
19
19
  : undefined,
20
20
  };
21
21
  const imageField = children === null || children === void 0 ? void 0 : children.find(({ type }) => type === 'ai-image');
22
+ console.log('image field', imageField);
22
23
  const imageProps = {
23
24
  id: (_d = imageField === null || imageField === void 0 ? void 0 : imageField.id) !== null && _d !== void 0 ? _d : '',
24
25
  value: (_e = imageField === null || imageField === void 0 ? void 0 : imageField.value) !== null && _e !== void 0 ? _e : '',
@@ -43,5 +44,5 @@ export const AIGridField = ({ children, onAISend, onRemove, onUpload, }) => {
43
44
  }
44
45
  onAISend === null || onAISend === void 0 ? void 0 : onAISend(form);
45
46
  };
46
- return (_jsxs(Flex, { align: "flex-end", gap: "base", children: [_jsxs(Flex, { align: "center", gap: "base", children: [_jsx(SingleImage, Object.assign({}, imageProps, { onUpload: handleUpload, onRemove: onRemove })), _jsx(Text, { fontFamily: "secondary", textAlign: "center", children: "OR" })] }), _jsx(TextField, Object.assign({}, textProps)), _jsx(IconButton, { "aria-label": "Add new address line", variant: "iconOutlined", icon: _jsx(Plus, { size: 28, stroke: colors.blue[3] }), onClick: handleAISend, h: "input.md", disabled: !(model === null || model === void 0 ? void 0 : model.length) && !(imageField === null || imageField === void 0 ? void 0 : imageField.value) })] }));
47
+ return (_jsxs(Flex, { align: "flex-end", gap: "base", children: [_jsxs(Flex, { align: "center", gap: "base", children: [_jsx(SingleImage, Object.assign({}, imageProps, { onUpload: handleUpload, onRemove: onRemove, value: imageField === null || imageField === void 0 ? void 0 : imageField.value })), _jsx(Text, { fontFamily: "secondary", textAlign: "center", children: "OR" })] }), _jsx(TextField, Object.assign({}, textProps)), _jsx(IconButton, { "aria-label": "Add new address line", variant: "iconOutlined", icon: _jsx(Plus, { size: 28, stroke: colors.blue[3] }), onClick: handleAISend, h: "input.md", disabled: !(model === null || model === void 0 ? void 0 : model.length) && !(imageField === null || imageField === void 0 ? void 0 : imageField.value) })] }));
47
48
  };
@@ -13,5 +13,6 @@ export const SingleImage = ({ onRemove, onUpload, uploading = false, value, }) =
13
13
  onUpload === null || onUpload === void 0 ? void 0 : onUpload(selectedFiles);
14
14
  }
15
15
  };
16
+ console.log('img', value);
16
17
  return (_jsxs(Flex, { gap: "2", align: "center", h: "input.md", children: [_jsx(MobileFileUploader, { handleInputChange: handleInputChange, "aria-label": "upload image", minW: "72px" }), value && (_jsxs(Box, { position: "relative", minW: "30px", children: [_jsx(IconButton, { variant: "ghost", "aria-label": "close", maxW: "fit-content", onClick: () => onRemove === null || onRemove === void 0 ? void 0 : onRemove(value), icon: _jsx(Close, { size: 11, stroke: colors.error['2'] }), disabled: uploading, position: "absolute", bg: "neutral.white", p: "0.5", borderRadius: "full", top: "-2", right: "-2", zIndex: "1" }), _jsx(AspectRatio, { maxW: "100%", ratio: 1, children: _jsx(Image, { src: value, objectFit: "cover", alt: "image" }) })] }))] }));
17
18
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.14.21",
3
+ "version": "2.14.22",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",
@@ -29,10 +29,10 @@ export const AIGridField = ({
29
29
  }
30
30
 
31
31
  const imageField = children?.find(({ type }) => type === 'ai-image')
32
-
32
+ console.log('image field', imageField)
33
33
  const imageProps = {
34
34
  id: imageField?.id ?? '',
35
- value: imageField?.value as string ?? '',
35
+ value: imageField?.value ?? '',
36
36
  placeholder: imageField?.name ?? imageField?.description,
37
37
  icon: imageField?.icon
38
38
  ? (fieldIcons[imageField.icon] as IconTypes)
@@ -65,7 +65,7 @@ export const AIGridField = ({
65
65
  {...imageProps}
66
66
  onUpload={handleUpload}
67
67
  onRemove={onRemove}
68
- // value={imageField?.value as string}
68
+ value={imageField?.value as string}
69
69
  />
70
70
  <Text fontFamily="secondary" textAlign="center">
71
71
  OR
@@ -20,6 +20,8 @@ export const SingleImage = ({
20
20
  }
21
21
  }
22
22
 
23
+ console.log('img', value)
24
+
23
25
  return (
24
26
  <Flex gap="2" align="center" h="input.md">
25
27
  <MobileFileUploader