Skip to content

Commit 404b586

Browse files
committed
chore: update dependencies
1 parent 629cf09 commit 404b586

File tree

8 files changed

+69
-262
lines changed

8 files changed

+69
-262
lines changed

code/components/room-components/hooks/use-comments-handler.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export const useCommentsHandler = () => {
7575
instance.getNodeHandler<WeaveCommentNode<ThreadEntity>>("comment");
7676

7777
if (commentHandler && data.thread) {
78-
commentHandler.afterCreatePersist(node, data.thread);
78+
commentHandler.setCommentModel(node, data.thread);
7979

8080
eventBus.emit("onCommentsChanged");
8181
}

code/components/room-components/images-library/edit-image.image.tsx

Lines changed: 0 additions & 136 deletions
This file was deleted.

code/components/room-components/images-library/generated-image.image.tsx

Lines changed: 28 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
"use client";
66

77
import React from "react";
8-
// import { Badge } from "@/components/ui/badge";
9-
// import { Image } from "lucide-react";
108
import { useWeave } from "@inditextech/weave-react";
119
import { useCollaborationRoom } from "@/store/store";
1210
import { SIDEBAR_ELEMENTS } from "@/lib/constants";
@@ -15,11 +13,16 @@ import { useIACapabilities } from "@/store/ia";
1513
import { useIACapabilitiesV2 } from "@/store/ia-v2";
1614
import { cn } from "@/lib/utils";
1715

18-
type GeneratedImageProps = { image: ImageEntity; selected: boolean };
16+
type GeneratedImageProps = {
17+
image: ImageEntity;
18+
selected: boolean;
19+
operation: "background-removal" | "image-generation" | "image-edition";
20+
};
1921

2022
export const GeneratedImage = ({
2123
image,
2224
selected,
25+
operation,
2326
}: Readonly<GeneratedImageProps>) => {
2427
const instance = useWeave((state) => state.instance);
2528

@@ -73,67 +76,37 @@ export const GeneratedImage = ({
7376
height: "100%",
7477
aspectRatio: `${image.aspectRatio}`,
7578
}}
76-
>
77-
{/* eslint-disable-next-line jsx-a11y/alt-text */}
78-
{/* <Image strokeWidth={1} size={32} stroke="#000000" fill="#ffffff" /> */}
79-
</div>
79+
></div>
8080
)}
8181
{["completed"].includes(image.status) && (
82-
// eslint-disable-next-line @next/next/no-img-element
83-
<img
84-
className="w-full block object-cover relative transition-transform duration-500 group-hover:opacity-60"
85-
style={{
86-
aspectRatio: `${image.aspectRatio}`,
87-
}}
88-
id={image.imageId}
89-
data-image-id={image.imageId}
90-
draggable={
91-
imagesLLMPopupVisible || imagesLLMPopupVisibleV2 || selected
92-
? undefined
93-
: "true"
94-
}
95-
src={imageUrl}
96-
alt="An image"
97-
/>
82+
<>
83+
{operation === "background-removal" && (
84+
<div className="absolute inset-0 checkered transition-transform duration-500 group-hover:opacity-60"></div>
85+
)}
86+
{/* eslint-disable-next-line @next/next/no-img-element */}
87+
<img
88+
className="w-full block object-cover relative transition-transform duration-500 group-hover:opacity-60"
89+
style={{
90+
aspectRatio: `${image.aspectRatio}`,
91+
}}
92+
id={image.imageId}
93+
data-image-id={image.imageId}
94+
draggable={
95+
imagesLLMPopupVisible || imagesLLMPopupVisibleV2 || selected
96+
? undefined
97+
: "true"
98+
}
99+
src={imageUrl}
100+
alt="An image"
101+
/>
102+
</>
98103
)}
99104
{(["pending", "working"].includes(image.status) ||
100105
(image.removalJobId !== null &&
101106
image.removalStatus !== null &&
102107
["pending", "working"].includes(image.removalStatus))) && (
103108
<div className="pulseOverlay"></div>
104109
)}
105-
{/* {image.removalJobId === null && ["pending"].includes(image.status) && (
106-
<div className="absolute top-0 left-0 right-0 bottom-0 bg-black/50 text-white flex flex-col gap-1 justify-center items-center">
107-
<Badge
108-
className="px-1 font-inter tabular-nums rounded font-inter text-[11px]"
109-
variant="default"
110-
>
111-
WAITING
112-
</Badge>
113-
</div>
114-
)}
115-
{image.removalJobId === null && ["working"].includes(image.status) && (
116-
<div className="absolute top-0 left-0 right-0 bottom-0 bg-black/50 text-white flex flex-col gap-1 justify-center items-center">
117-
<Badge
118-
className="px-1 font-inter tabular-nums rounded font-inter text-[11px]"
119-
variant="default"
120-
>
121-
GENERATING
122-
</Badge>
123-
</div>
124-
)}
125-
{image.removalJobId !== null &&
126-
image.removalStatus !== null &&
127-
["pending", "working"].includes(image.removalStatus) && (
128-
<div className="absolute top-0 left-0 right-0 bottom-0 bg-black/50 text-white flex justify-center items-center">
129-
<Badge
130-
className="px-1 font-inter tabular-nums rounded font-inter text-[11px]"
131-
variant="default"
132-
>
133-
REMOVING
134-
</Badge>
135-
</div>
136-
)} */}
137110
</div>
138111
);
139112
};

code/components/room-components/images-library/images-library.tsx

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import Masonry from "react-responsive-masonry";
1212
import { Badge } from "@/components/ui/badge";
1313
import { Label } from "@/components/ui/label";
1414
import { Switch } from "@/components/ui/switch";
15-
// import { Button } from "@/components/ui/button";
1615
import { Checkbox } from "@/components/ui/checkbox";
1716
import { useMutation, useInfiniteQuery } from "@tanstack/react-query";
1817
import {
@@ -41,12 +40,10 @@ import { WeaveImageNode } from "@inditextech/weave-sdk";
4140
import { getImages } from "@/api/get-images";
4241
import { getImages as getImagesV2 } from "@/api/v2/get-images";
4342
import { postRemoveBackground as postRemoveBackgroundV2 } from "@/api/v2/post-remove-background";
44-
import { RemovedBackgroundImage } from "./removed-background.image";
4543
import { UploadedImage } from "./uploaded.image";
4644
import { useIACapabilities } from "@/store/ia";
4745
import { useIACapabilitiesV2 } from "@/store/ia-v2";
4846
import { GeneratedImage } from "./generated-image.image";
49-
import { EditImage } from "./edit-image.image";
5047
import {
5148
ContextMenu,
5249
ContextMenuContent,
@@ -626,32 +623,24 @@ export const ImagesLibrary = () => {
626623
/>
627624
);
628625

629-
if (image.operation === "background-removal") {
630-
imageComponent = (
631-
<RemovedBackgroundImage
632-
key={image.imageId}
633-
selected={isChecked}
634-
image={image}
635-
/>
636-
);
637-
}
638-
639-
if (image.operation === "image-generation") {
626+
if (
627+
[
628+
"background-removal",
629+
"image-generation",
630+
"image-edition",
631+
].includes(image.operation)
632+
) {
640633
imageComponent = (
641634
<GeneratedImage
642635
key={image.imageId}
643636
selected={isChecked}
644637
image={image}
645-
/>
646-
);
647-
}
648-
649-
if (image.operation === "image-edition") {
650-
imageComponent = (
651-
<EditImage
652-
key={image.imageId}
653-
selected={isChecked}
654-
image={image}
638+
operation={
639+
image.operation as
640+
| "background-removal"
641+
| "image-generation"
642+
| "image-edition"
643+
}
655644
/>
656645
);
657646
}

code/components/room-components/overlay/llm-popup-v2.tsx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ export function LLMGenerationPopupV2() {
227227

228228
const mutationGenerate = useMutation({
229229
mutationFn: async () => {
230-
// setImagesLLMPopupState("generating");
231230
return await postGenerateImageV2(
232231
{
233232
userId: user?.name ?? "",
@@ -243,14 +242,9 @@ export function LLMGenerationPopupV2() {
243242
}
244243
);
245244
},
246-
onSettled: () => {
247-
// setImagesLLMPopupState("idle");
248-
},
249245
onSuccess: (data) => {
250246
sidebarToggle(SIDEBAR_ELEMENTS.images);
251247

252-
// setImagesLLMPopupState("uploading");
253-
254248
setImagesLLMPredictions(data.data);
255249

256250
handleClose(false);
@@ -262,8 +256,6 @@ export function LLMGenerationPopupV2() {
262256

263257
const mutationEdit = useMutation({
264258
mutationFn: async () => {
265-
// setImagesLLMPopupState("generating");
266-
267259
if (!imagesLLMPopupImageBase64) {
268260
throw new Error("No reference image");
269261
}
@@ -297,14 +289,9 @@ export function LLMGenerationPopupV2() {
297289
}
298290
);
299291
},
300-
onSettled: () => {
301-
// setImagesLLMPopupState("idle");
302-
},
303292
onSuccess: (data) => {
304293
sidebarToggle(SIDEBAR_ELEMENTS.images);
305294

306-
// setImagesLLMPopupState("uploading");
307-
308295
setImagesLLMPredictions(data.data);
309296

310297
handleClose(false);

0 commit comments

Comments
 (0)