@appquality/unguess-design-system 3.1.85-beta-attachments → 3.1.86-beta-attachments

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/build/index.js CHANGED
@@ -2336,8 +2336,18 @@ const ChatContextProvider = ({ onSave, onFileUpload, setMentionableUsers, childr
2336
2336
  editor,
2337
2337
  setEditor,
2338
2338
  thumbnails,
2339
- setMediaStatus: (files, index) => {
2340
- files[index].isLoadingMedia = false;
2339
+ afterUploadCallback: (failed) => {
2340
+ setThumbnails(thumbnails.map((file) => {
2341
+ if (failed.includes(file.name)) {
2342
+ file.isLoadingMedia = false;
2343
+ //file.isError = true;
2344
+ }
2345
+ else {
2346
+ file.isLoadingMedia = false;
2347
+ //file.isError = false
2348
+ }
2349
+ return file;
2350
+ }));
2341
2351
  },
2342
2352
  //isMediaUploading, // Incluso nel valore del contesto
2343
2353
  //setIsMediaUploading, // Incluso nel valore del contesto
@@ -4325,9 +4335,7 @@ const ChatBoxContainer = styled__default["default"].div `
4325
4335
  const CommentBox = (_a) => {
4326
4336
  var { placeholderOptions } = _a, props = __rest(_a, ["placeholderOptions"]);
4327
4337
  const { children, hasFloatingMenu, hasButtonsMenu, bubbleOptions, i18n } = props;
4328
- const { editor, setEditor, mentionableUsers, triggerSave, thumbnails, addThumbnails, removeThumbnail, setMediaStatus,
4329
- //setIsMediaUploading,
4330
- } = useChatContext();
4338
+ const { editor, setEditor, mentionableUsers, triggerSave, thumbnails, addThumbnails } = useChatContext();
4331
4339
  const [isOpen, setIsOpen] = React.useState(false);
4332
4340
  const [selectedImage, setSelectedImage] = React.useState({});
4333
4341
  const [selectedImageIndex, setSelectedImageIndex] = React.useState(0);
@@ -17,9 +17,7 @@ export type ChatContextType = {
17
17
  mentionableUsers: (props: {
18
18
  query: string;
19
19
  }) => SuggestedUser[];
20
- setMediaStatus: (files: (File & {
21
- isLoadingMedia: boolean;
22
- })[], index: number) => void;
20
+ afterUploadCallback: (failed: string[]) => void;
23
21
  };
24
22
  export declare const ChatContext: React.Context<ChatContextType | null>;
25
23
  export declare const ChatContextProvider: ({ onSave, onFileUpload, setMentionableUsers, children, }: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appquality/unguess-design-system",
3
- "version": "3.1.85-beta-attachments",
3
+ "version": "3.1.86-beta-attachments",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",