Skip to content

Commit ba74ec9

Browse files
committed
chore: update dependencies
1 parent c3b234a commit ba74ec9

File tree

14 files changed

+724
-817
lines changed

14 files changed

+724
-817
lines changed

code/components/actions/images-tool/images-tool.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ export class ImagesToolAction extends WeaveAction {
252252
fill: "#c9c9c9",
253253
stroke: "#000000",
254254
strokeWidth: 0,
255-
strokeScaleEnabled: false,
255+
strokeScaleEnabled: true,
256256
});
257257

258258
this.tempImageNode.add(bgNode);
@@ -315,7 +315,7 @@ export class ImagesToolAction extends WeaveAction {
315315
imageURL: imageInfo.imageURL,
316316
stroke: "#000000ff",
317317
strokeWidth: 0,
318-
strokeScaleEnabled: false,
318+
strokeScaleEnabled: true,
319319
imageId: imageInfo.imageId,
320320
imageWidth: imageInfo.info.width,
321321
imageHeight: imageInfo.info.height,
@@ -417,7 +417,5 @@ export class ImagesToolAction extends WeaveAction {
417417
private setCursor() {
418418
const stage = this.instance.getStage();
419419
stage.container().style.cursor = "crosshair";
420-
stage.container().blur();
421-
stage.container().focus();
422420
}
423421
}

code/components/actions/mask-tool/mask-tool.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export class MaskToolAction extends WeaveAction {
140140
id: this.maskId,
141141
nodeType: "mask",
142142
name: "node",
143-
strokeScaleEnabled: false,
143+
strokeScaleEnabled: true,
144144
x: this.clickPoint?.x ?? 0,
145145
y: this.clickPoint?.y ?? 0,
146146
points: [0, 0],
@@ -163,7 +163,7 @@ export class MaskToolAction extends WeaveAction {
163163
x: this.clickPoint?.x ?? 0,
164164
y: this.clickPoint?.y ?? 0,
165165
radius: 5 / stage.scaleX(),
166-
strokeScaleEnabled: false,
166+
strokeScaleEnabled: true,
167167
stroke: "#cccccc",
168168
strokeWidth: 0,
169169
fill: "#cccccc",
@@ -175,7 +175,7 @@ export class MaskToolAction extends WeaveAction {
175175
id: this.tempLineId,
176176
x: this.clickPoint?.x ?? 0,
177177
y: this.clickPoint?.y ?? 0,
178-
strokeScaleEnabled: false,
178+
strokeScaleEnabled: true,
179179
points: [0, 0],
180180
});
181181
utilityLayer?.add(this.tempLine);
@@ -184,7 +184,7 @@ export class MaskToolAction extends WeaveAction {
184184
x: this.clickPoint?.x ?? 0,
185185
y: this.clickPoint?.y ?? 0,
186186
radius: 5 / stage.scaleX(),
187-
strokeScaleEnabled: false,
187+
strokeScaleEnabled: true,
188188
stroke: "#cccccc",
189189
strokeWidth: 0,
190190
fill: "#cccccc",

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,4 +548,25 @@ export function useKeyboardHandler() {
548548
useKeyDown(() => {
549549
setShowMinimap(!showMinimap);
550550
}, ["KeyN"]);
551+
552+
// useKeyDown(
553+
// () => {
554+
// if (!instance) {
555+
// return;
556+
// }
557+
558+
// const { finishUploadCallback } = instance.triggerAction(
559+
// "videoTool"
560+
// // eslint-disable-next-line @typescript-eslint/no-explicit-any
561+
// ) as any;
562+
563+
// instance.updatePropsAction("videoTool", { videoId: "testJesus" });
564+
565+
// const videoURLUploaded =
566+
// "https://upload.wikimedia.org/wikipedia/commons/transcoded/c/c4/Physicsworks.ogv/Physicsworks.ogv.240p.vp9.webm";
567+
// finishUploadCallback?.(videoURLUploaded);
568+
// },
569+
// ["KeyV"],
570+
// (e) => !(e.ctrlKey || e.metaKey)
571+
// );
551572
}

code/components/room-components/hooks/use-tools-events.tsx

Lines changed: 101 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,115 @@ import { WeaveActionPropsChangeEvent } from "@inditextech/weave-sdk";
1010
import { useIsTouchDevice } from "./use-is-touch-device";
1111
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
1212
import { RectangleHorizontal, RectangleVertical } from "lucide-react";
13+
import {
14+
DropdownMenu,
15+
DropdownMenuContent,
16+
DropdownMenuTrigger,
17+
} from "@/components/ui/dropdown-menu";
18+
import { WEAVE_STORE_CONNECTION_STATUS } from "@inditextech/weave-types";
19+
import { cn } from "@/lib/utils";
20+
import { ToolbarButton } from "../toolbar/toolbar-button";
21+
import { ColorPickerInput } from "../inputs/color-picker";
22+
import { Button } from "@/components/ui/button";
1323

1424
const AddFrameToast = () => {
1525
const instance = useWeave((state) => state.instance);
26+
const weaveConnectionStatus = useWeave((state) => state.connection.status);
27+
1628
const [frameKind, setFrameKind] = React.useState<"horizontal" | "vertical">(
1729
"horizontal"
1830
);
31+
const [selectBackgroundColor, setSelectBackgroundColor] =
32+
React.useState(false);
33+
const [backgroundColor, setBackgroundColor] = React.useState("#ffffffff");
1934

2035
const isTouchDevice = useIsTouchDevice();
2136

2237
return (
2338
<div className="w-full flex flex-col gap-1 justify-between items-center">
24-
<div className="w-full">{`Select the frame orientation and then ${isTouchDevice ? "tap" : "click"} to add the frame.`}</div>
25-
<div className="w-full flex gap-1 justify-end items-center pt-2">
39+
<div className="w-full">{`Select the frame background color and orientation and finally ${isTouchDevice ? "tap" : "click"} on the room to add the frame.`}</div>
40+
<div className="w-full flex flex-col gap-1 justify-end items-end pt-2">
41+
<div className="flex gap-1 justify-start items-center">
42+
<div className="text-[10px] font-inter uppercase px-3">Color</div>
43+
<DropdownMenu modal={false} open={selectBackgroundColor}>
44+
<DropdownMenuTrigger
45+
disabled={
46+
weaveConnectionStatus !==
47+
WEAVE_STORE_CONNECTION_STATUS.CONNECTED
48+
}
49+
className={cn(
50+
"relative rounded-full cursor-pointer h-[40px] hover:text-[#666666] focus:outline-none",
51+
{
52+
["disabled:cursor-default disabled:opacity-50"]:
53+
weaveConnectionStatus !==
54+
WEAVE_STORE_CONNECTION_STATUS.CONNECTED,
55+
}
56+
)}
57+
asChild
58+
>
59+
<ToolbarButton
60+
className="rounded-full min-w-[32px] !w-[32px] !h-[32px]"
61+
icon={
62+
<div
63+
className="border border-[#c9c9c9c] w-[16px] h-[16px]"
64+
style={{
65+
background: backgroundColor,
66+
}}
67+
/>
68+
}
69+
disabled={
70+
weaveConnectionStatus !==
71+
WEAVE_STORE_CONNECTION_STATUS.CONNECTED
72+
}
73+
active={selectBackgroundColor}
74+
onClick={(e) => {
75+
e.preventDefault();
76+
setSelectBackgroundColor((prev) => !prev);
77+
}}
78+
label={
79+
<div className="flex gap-3 justify-start items-center">
80+
<p>Background color</p>
81+
</div>
82+
}
83+
tooltipSide="right"
84+
tooltipAlign="center"
85+
/>
86+
</DropdownMenuTrigger>
87+
<DropdownMenuContent
88+
align="end"
89+
side="left"
90+
alignOffset={0}
91+
sideOffset={8}
92+
className="min-w-auto font-inter rounded-none shadow-none flex flex-row !z-[1000000000]"
93+
>
94+
<div
95+
className="flex !flex-col gap-0 w-[300px] p-4"
96+
onClick={(e) => e.preventDefault()}
97+
>
98+
<ColorPickerInput
99+
value={backgroundColor}
100+
onChange={(color: string) => {
101+
setBackgroundColor(color);
102+
103+
if (!instance) return;
104+
105+
instance.updatePropsAction("frameTool", {
106+
frameBackground: color,
107+
});
108+
}}
109+
/>
110+
<Button
111+
onClick={() => {
112+
setSelectBackgroundColor(false);
113+
}}
114+
className="cursor-pointer font-inter font-light rounded-none w-full"
115+
>
116+
CLOSE
117+
</Button>
118+
</div>
119+
</DropdownMenuContent>
120+
</DropdownMenu>
121+
</div>
26122
<ToggleGroup
27123
variant="outline"
28124
type="single"
@@ -47,14 +143,14 @@ const AddFrameToast = () => {
47143
>
48144
<ToggleGroupItem
49145
value="horizontal"
50-
className="font-inter font-light text-xs !px-5 pointer-cursor"
146+
className="text-[10px] font-inter uppercase !px-5 pointer-cursor"
51147
aria-label="Frame is horizontal"
52148
>
53149
Horizontal <RectangleHorizontal size={32} strokeWidth={1} />
54150
</ToggleGroupItem>
55151
<ToggleGroupItem
56152
value="vertical"
57-
className="font-inter font-light text-xs !px-5 pointer-cursor"
153+
className="text-[10px] font-inter uppercase !px-5 pointer-cursor"
58154
aria-label="Frame is vertical"
59155
>
60156
Vertical <RectangleVertical size={32} strokeWidth={1} />
@@ -474,6 +570,7 @@ export const useToolsEvents = () => {
474570
const handleFrameAdding = () => {
475571
toast("Add a frame", {
476572
description: AddFrameToast,
573+
477574
duration: Infinity,
478575
});
479576
};

code/components/room-components/overlay/hooks/use-node-action-name.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ export const useNodeActionName = () => {
3939
return "Vector path";
4040
case "text":
4141
return "Text";
42+
case "video":
43+
return "Video";
4244
case "image":
4345
return imagesLLMPopupVisible ? "Unknown" : "Image";
4446
case "star":

0 commit comments

Comments
 (0)