Spaces:
				
			
			
	
			
			
					
		Running
		
	
	
	
			
			
	
	
	
	
		
		
					
		Running
		
	add more
Browse files- app/api/ask-ai/route.ts +9 -5
- app/api/re-design/route.ts +39 -0
- components/contexts/app-context.tsx +0 -1
- components/editor/ask-ai/index.tsx +40 -39
- components/editor/ask-ai/re-imagine.tsx +11 -18
- components/editor/ask-ai/selected-html-element.tsx +18 -3
- components/editor/deploy-button/index.tsx +2 -2
- components/editor/footer/index.tsx +1 -1
- components/editor/history/index.tsx +4 -3
- components/editor/index.tsx +2 -1
- components/editor/preview/index.tsx +2 -8
- components/providers/tanstack-query-provider.tsx +1 -2
- components/space/ask-ai/index.tsx +0 -3
- hooks/useUser.ts +0 -1
    	
        app/api/ask-ai/route.ts
    CHANGED
    
    | @@ -22,7 +22,7 @@ export async function POST(request: NextRequest) { | |
| 22 | 
             
              const userToken = request.cookies.get(MY_TOKEN_KEY())?.value;
         | 
| 23 |  | 
| 24 | 
             
              const body = await request.json();
         | 
| 25 | 
            -
              const { prompt, provider, model, redesignMarkdown } = body;
         | 
| 26 |  | 
| 27 | 
             
              if (!model || (!prompt && !redesignMarkdown)) {
         | 
| 28 | 
             
                return NextResponse.json(
         | 
| @@ -107,7 +107,6 @@ export async function POST(request: NextRequest) { | |
| 107 | 
             
                  },
         | 
| 108 | 
             
                });
         | 
| 109 |  | 
| 110 | 
            -
                // Process in background
         | 
| 111 | 
             
                (async () => {
         | 
| 112 | 
             
                  let completeResponse = "";
         | 
| 113 | 
             
                  try {
         | 
| @@ -125,6 +124,8 @@ export async function POST(request: NextRequest) { | |
| 125 | 
             
                            role: "user",
         | 
| 126 | 
             
                            content: redesignMarkdown
         | 
| 127 | 
             
                              ? `Here is my current design as a markdown:\n\n${redesignMarkdown}\n\nNow, please create a new design based on this markdown.`
         | 
|  | |
|  | |
| 128 | 
             
                              : prompt,
         | 
| 129 | 
             
                          },
         | 
| 130 | 
             
                        ],
         | 
| @@ -294,9 +295,12 @@ export async function PUT(request: NextRequest) { | |
| 294 | 
             
                      },
         | 
| 295 | 
             
                      {
         | 
| 296 | 
             
                        role: "assistant",
         | 
| 297 | 
            -
             | 
| 298 | 
            -
             | 
| 299 | 
            -
                           | 
|  | |
|  | |
|  | |
| 300 | 
             
                      },
         | 
| 301 | 
             
                      {
         | 
| 302 | 
             
                        role: "user",
         | 
|  | |
| 22 | 
             
              const userToken = request.cookies.get(MY_TOKEN_KEY())?.value;
         | 
| 23 |  | 
| 24 | 
             
              const body = await request.json();
         | 
| 25 | 
            +
              const { prompt, provider, model, redesignMarkdown, html } = body;
         | 
| 26 |  | 
| 27 | 
             
              if (!model || (!prompt && !redesignMarkdown)) {
         | 
| 28 | 
             
                return NextResponse.json(
         | 
|  | |
| 107 | 
             
                  },
         | 
| 108 | 
             
                });
         | 
| 109 |  | 
|  | |
| 110 | 
             
                (async () => {
         | 
| 111 | 
             
                  let completeResponse = "";
         | 
| 112 | 
             
                  try {
         | 
|  | |
| 124 | 
             
                            role: "user",
         | 
| 125 | 
             
                            content: redesignMarkdown
         | 
| 126 | 
             
                              ? `Here is my current design as a markdown:\n\n${redesignMarkdown}\n\nNow, please create a new design based on this markdown.`
         | 
| 127 | 
            +
                              : html
         | 
| 128 | 
            +
                              ? `Here is my current HTML code:\n\n\`\`\`html\n${html}\n\`\`\`\n\nNow, please create a new design based on this HTML.`
         | 
| 129 | 
             
                              : prompt,
         | 
| 130 | 
             
                          },
         | 
| 131 | 
             
                        ],
         | 
|  | |
| 295 | 
             
                      },
         | 
| 296 | 
             
                      {
         | 
| 297 | 
             
                        role: "assistant",
         | 
| 298 | 
            +
             | 
| 299 | 
            +
                        content: `The current code is: \n\`\`\`html\n${html}\n\`\`\` ${
         | 
| 300 | 
            +
                          selectedElementHtml
         | 
| 301 | 
            +
                            ? `\n\nYou have to update ONLY the following element, NOTHING ELSE: \n\n\`\`\`html\n${selectedElementHtml}\n\`\`\``
         | 
| 302 | 
            +
                            : ""
         | 
| 303 | 
            +
                        }`,
         | 
| 304 | 
             
                      },
         | 
| 305 | 
             
                      {
         | 
| 306 | 
             
                        role: "user",
         | 
    	
        app/api/re-design/route.ts
    ADDED
    
    | @@ -0,0 +1,39 @@ | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | 
|  | |
| 1 | 
            +
            import { NextRequest, NextResponse } from "next/server";
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            export async function PUT(request: NextRequest) {
         | 
| 4 | 
            +
              const body = await request.json();
         | 
| 5 | 
            +
              const { url } = body;
         | 
| 6 | 
            +
             | 
| 7 | 
            +
              if (!url) {
         | 
| 8 | 
            +
                return NextResponse.json({ error: "URL is required" }, { status: 400 });
         | 
| 9 | 
            +
              }
         | 
| 10 | 
            +
             | 
| 11 | 
            +
              try {
         | 
| 12 | 
            +
                const response = await fetch(
         | 
| 13 | 
            +
                  `https://r.jina.ai/${encodeURIComponent(url)}`,
         | 
| 14 | 
            +
                  {
         | 
| 15 | 
            +
                    method: "POST",
         | 
| 16 | 
            +
                  }
         | 
| 17 | 
            +
                );
         | 
| 18 | 
            +
                if (!response.ok) {
         | 
| 19 | 
            +
                  return NextResponse.json(
         | 
| 20 | 
            +
                    { error: "Failed to fetch redesign" },
         | 
| 21 | 
            +
                    { status: 500 }
         | 
| 22 | 
            +
                  );
         | 
| 23 | 
            +
                }
         | 
| 24 | 
            +
                const markdown = await response.text();
         | 
| 25 | 
            +
                return NextResponse.json(
         | 
| 26 | 
            +
                  {
         | 
| 27 | 
            +
                    ok: true,
         | 
| 28 | 
            +
                    markdown,
         | 
| 29 | 
            +
                  },
         | 
| 30 | 
            +
                  { status: 200 }
         | 
| 31 | 
            +
                );
         | 
| 32 | 
            +
                // eslint-disable-next-line @typescript-eslint/no-explicit-any
         | 
| 33 | 
            +
              } catch (error: any) {
         | 
| 34 | 
            +
                return NextResponse.json(
         | 
| 35 | 
            +
                  { error: error.message || "An error occurred" },
         | 
| 36 | 
            +
                  { status: 500 }
         | 
| 37 | 
            +
                );
         | 
| 38 | 
            +
              }
         | 
| 39 | 
            +
            }
         | 
    	
        components/contexts/app-context.tsx
    CHANGED
    
    | @@ -45,7 +45,6 @@ export default function AppContext({ | |
| 45 |  | 
| 46 | 
             
                if (!message.code) return;
         | 
| 47 | 
             
                if (message.type === "user-oauth" && message?.code && !events.code) {
         | 
| 48 | 
            -
                  console.log("Received code from broadcast channel:", message.code);
         | 
| 49 | 
             
                  loginFromCode(message.code);
         | 
| 50 | 
             
                }
         | 
| 51 | 
             
              });
         | 
|  | |
| 45 |  | 
| 46 | 
             
                if (!message.code) return;
         | 
| 47 | 
             
                if (message.type === "user-oauth" && message?.code && !events.code) {
         | 
|  | |
| 48 | 
             
                  loginFromCode(message.code);
         | 
| 49 | 
             
                }
         | 
| 50 | 
             
              });
         | 
    	
        components/editor/ask-ai/index.tsx
    CHANGED
    
    | @@ -283,44 +283,7 @@ export function AskAI({ | |
| 283 |  | 
| 284 | 
             
              return (
         | 
| 285 | 
             
                <>
         | 
| 286 | 
            -
                  <div className=" | 
| 287 | 
            -
                    <label
         | 
| 288 | 
            -
                      htmlFor="follow-up-checkbox"
         | 
| 289 | 
            -
                      className="flex items-center gap-1.5 cursor-pointer"
         | 
| 290 | 
            -
                    >
         | 
| 291 | 
            -
                      <Checkbox
         | 
| 292 | 
            -
                        id="follow-up-checkbox"
         | 
| 293 | 
            -
                        checked={isFollowUp}
         | 
| 294 | 
            -
                        onCheckedChange={(e) => {
         | 
| 295 | 
            -
                          setIsFollowUp(e === true);
         | 
| 296 | 
            -
                        }}
         | 
| 297 | 
            -
                      />
         | 
| 298 | 
            -
                      Follow-Up
         | 
| 299 | 
            -
                    </label>
         | 
| 300 | 
            -
                    <Popover>
         | 
| 301 | 
            -
                      <PopoverTrigger asChild>
         | 
| 302 | 
            -
                        <Info className="size-3 text-neutral-300 cursor-pointer" />
         | 
| 303 | 
            -
                      </PopoverTrigger>
         | 
| 304 | 
            -
                      <PopoverContent
         | 
| 305 | 
            -
                        align="start"
         | 
| 306 | 
            -
                        className="!rounded-2xl !p-0 min-w-xs text-center overflow-hidden"
         | 
| 307 | 
            -
                      >
         | 
| 308 | 
            -
                        <header className="bg-neutral-950 px-4 py-3 border-b border-neutral-700/70">
         | 
| 309 | 
            -
                          <p className="text-base text-neutral-200 font-semibold">
         | 
| 310 | 
            -
                            What is a Follow-Up?
         | 
| 311 | 
            -
                          </p>
         | 
| 312 | 
            -
                        </header>
         | 
| 313 | 
            -
                        <main className="p-4">
         | 
| 314 | 
            -
                          <p className="text-sm text-neutral-400">
         | 
| 315 | 
            -
                            A Follow-Up is a request to DeepSite to edit the current HTML
         | 
| 316 | 
            -
                            instead of starting from scratch. This is useful when you want
         | 
| 317 | 
            -
                            to make small changes or improvements to the existing design.
         | 
| 318 | 
            -
                          </p>
         | 
| 319 | 
            -
                        </main>
         | 
| 320 | 
            -
                      </PopoverContent>
         | 
| 321 | 
            -
                    </Popover>
         | 
| 322 | 
            -
                  </div>
         | 
| 323 | 
            -
                  <div className="bg-neutral-800 border border-neutral-700 rounded-2xl ring-[4px] focus-within:ring-neutral-500/30 focus-within:border-neutral-600 ring-transparent z-10 w-full group">
         | 
| 324 | 
             
                    {think && (
         | 
| 325 | 
             
                      <div className="w-full border-b border-neutral-700 relative overflow-hidden">
         | 
| 326 | 
             
                        <header
         | 
| @@ -358,10 +321,11 @@ export function AskAI({ | |
| 358 | 
             
                        </main>
         | 
| 359 | 
             
                      </div>
         | 
| 360 | 
             
                    )}
         | 
| 361 | 
            -
                    { | 
| 362 | 
             
                      <div className="px-4 pt-3">
         | 
| 363 | 
             
                        <SelectedHtmlElement
         | 
| 364 | 
             
                          element={selectedElement}
         | 
|  | |
| 365 | 
             
                          onDelete={() => setSelectedElement(null)}
         | 
| 366 | 
             
                        />
         | 
| 367 | 
             
                      </div>
         | 
| @@ -466,6 +430,43 @@ export function AskAI({ | |
| 466 | 
             
                      open={openProModal}
         | 
| 467 | 
             
                      onClose={() => setOpenProModal(false)}
         | 
| 468 | 
             
                    />
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 469 | 
             
                  </div>
         | 
| 470 | 
             
                  <audio ref={audio} id="audio" className="hidden">
         | 
| 471 | 
             
                    <source src="/success.mp3" type="audio/mpeg" />
         | 
|  | |
| 283 |  | 
| 284 | 
             
              return (
         | 
| 285 | 
             
                <>
         | 
| 286 | 
            +
                  <div className="relative bg-neutral-800 border border-neutral-700 rounded-2xl ring-[4px] focus-within:ring-neutral-500/30 focus-within:border-neutral-600 ring-transparent z-10 w-full group">
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 287 | 
             
                    {think && (
         | 
| 288 | 
             
                      <div className="w-full border-b border-neutral-700 relative overflow-hidden">
         | 
| 289 | 
             
                        <header
         | 
|  | |
| 321 | 
             
                        </main>
         | 
| 322 | 
             
                      </div>
         | 
| 323 | 
             
                    )}
         | 
| 324 | 
            +
                    {selectedElement && (
         | 
| 325 | 
             
                      <div className="px-4 pt-3">
         | 
| 326 | 
             
                        <SelectedHtmlElement
         | 
| 327 | 
             
                          element={selectedElement}
         | 
| 328 | 
            +
                          isAiWorking={isAiWorking}
         | 
| 329 | 
             
                          onDelete={() => setSelectedElement(null)}
         | 
| 330 | 
             
                        />
         | 
| 331 | 
             
                      </div>
         | 
|  | |
| 430 | 
             
                      open={openProModal}
         | 
| 431 | 
             
                      onClose={() => setOpenProModal(false)}
         | 
| 432 | 
             
                    />
         | 
| 433 | 
            +
                    <div className="absolute top-0 right-0 -translate-y-[calc(100%+8px)] select-none text-xs text-neutral-400 flex items-center justify-center gap-2 bg-neutral-800 border border-neutral-700 rounded-md p-1 pr-2.5">
         | 
| 434 | 
            +
                      <label
         | 
| 435 | 
            +
                        htmlFor="follow-up-checkbox"
         | 
| 436 | 
            +
                        className="flex items-center gap-1.5 cursor-pointer"
         | 
| 437 | 
            +
                      >
         | 
| 438 | 
            +
                        <Checkbox
         | 
| 439 | 
            +
                          id="follow-up-checkbox"
         | 
| 440 | 
            +
                          checked={isFollowUp}
         | 
| 441 | 
            +
                          onCheckedChange={(e) => {
         | 
| 442 | 
            +
                            setIsFollowUp(e === true);
         | 
| 443 | 
            +
                          }}
         | 
| 444 | 
            +
                        />
         | 
| 445 | 
            +
                        Follow-Up
         | 
| 446 | 
            +
                      </label>
         | 
| 447 | 
            +
                      <Popover>
         | 
| 448 | 
            +
                        <PopoverTrigger asChild>
         | 
| 449 | 
            +
                          <Info className="size-3 text-neutral-300 cursor-pointer" />
         | 
| 450 | 
            +
                        </PopoverTrigger>
         | 
| 451 | 
            +
                        <PopoverContent
         | 
| 452 | 
            +
                          align="start"
         | 
| 453 | 
            +
                          className="!rounded-2xl !p-0 min-w-xs text-center overflow-hidden"
         | 
| 454 | 
            +
                        >
         | 
| 455 | 
            +
                          <header className="bg-neutral-950 px-4 py-3 border-b border-neutral-700/70">
         | 
| 456 | 
            +
                            <p className="text-base text-neutral-200 font-semibold">
         | 
| 457 | 
            +
                              What is a Follow-Up?
         | 
| 458 | 
            +
                            </p>
         | 
| 459 | 
            +
                          </header>
         | 
| 460 | 
            +
                          <main className="p-4">
         | 
| 461 | 
            +
                            <p className="text-sm text-neutral-400">
         | 
| 462 | 
            +
                              A Follow-Up is a request to DeepSite to edit the current HTML
         | 
| 463 | 
            +
                              instead of starting from scratch. This is useful when you want
         | 
| 464 | 
            +
                              to make small changes or improvements to the existing design.
         | 
| 465 | 
            +
                            </p>
         | 
| 466 | 
            +
                          </main>
         | 
| 467 | 
            +
                        </PopoverContent>
         | 
| 468 | 
            +
                      </Popover>
         | 
| 469 | 
            +
                    </div>
         | 
| 470 | 
             
                  </div>
         | 
| 471 | 
             
                  <audio ref={audio} id="audio" className="hidden">
         | 
| 472 | 
             
                    <source src="/success.mp3" type="audio/mpeg" />
         | 
    	
        components/editor/ask-ai/re-imagine.tsx
    CHANGED
    
    | @@ -39,25 +39,18 @@ export function ReImagine({ | |
| 39 | 
             
                  toast.error("Please enter a valid URL.");
         | 
| 40 | 
             
                  return;
         | 
| 41 | 
             
                }
         | 
| 42 | 
            -
                // TODO implement the API call to redesign the site
         | 
| 43 | 
            -
                // Here you would typically handle the re-design logic
         | 
| 44 | 
             
                setIsLoading(true);
         | 
| 45 | 
            -
                 | 
| 46 | 
            -
             | 
| 47 | 
            -
                 | 
| 48 | 
            -
                 | 
| 49 | 
            -
             | 
| 50 | 
            -
             | 
| 51 | 
            -
             | 
| 52 | 
            -
             | 
| 53 | 
            -
                 | 
| 54 | 
            -
             | 
| 55 | 
            -
                 | 
| 56 | 
            -
                //   onRedesign(response.markdown);
         | 
| 57 | 
            -
                //   toast.success("DeepSite is redesigning your site! Let him cook... 🔥");
         | 
| 58 | 
            -
                // } else {
         | 
| 59 | 
            -
                //   toast.error(response.message || "Failed to redesign the site.");
         | 
| 60 | 
            -
                // }
         | 
| 61 | 
             
                setIsLoading(false);
         | 
| 62 | 
             
              };
         | 
| 63 |  | 
|  | |
| 39 | 
             
                  toast.error("Please enter a valid URL.");
         | 
| 40 | 
             
                  return;
         | 
| 41 | 
             
                }
         | 
|  | |
|  | |
| 42 | 
             
                setIsLoading(true);
         | 
| 43 | 
            +
                const response = await api.put("/re-design", {
         | 
| 44 | 
            +
                  url: url.trim(),
         | 
| 45 | 
            +
                });
         | 
| 46 | 
            +
                if (response?.data?.ok) {
         | 
| 47 | 
            +
                  setOpen(false);
         | 
| 48 | 
            +
                  setUrl("");
         | 
| 49 | 
            +
                  onRedesign(response.data.markdown);
         | 
| 50 | 
            +
                  toast.success("DeepSite is redesigning your site! Let him cook... 🔥");
         | 
| 51 | 
            +
                } else {
         | 
| 52 | 
            +
                  toast.error(response?.data?.error || "Failed to redesign the site.");
         | 
| 53 | 
            +
                }
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
| 54 | 
             
                setIsLoading(false);
         | 
| 55 | 
             
              };
         | 
| 56 |  | 
    	
        components/editor/ask-ai/selected-html-element.tsx
    CHANGED
    
    | @@ -1,12 +1,16 @@ | |
|  | |
|  | |
|  | |
| 1 | 
             
            import { Collapsible, CollapsibleTrigger } from "@/components/ui/collapsible";
         | 
| 2 | 
             
            import { htmlTagToText } from "@/lib/html-tag-to-text";
         | 
| 3 | 
            -
            import { Code, XCircle } from "lucide-react";
         | 
| 4 |  | 
| 5 | 
             
            export const SelectedHtmlElement = ({
         | 
| 6 | 
             
              element,
         | 
|  | |
| 7 | 
             
              onDelete,
         | 
| 8 | 
             
            }: {
         | 
| 9 | 
             
              element: HTMLElement | null;
         | 
|  | |
| 10 | 
             
              onDelete?: () => void;
         | 
| 11 | 
             
            }) => {
         | 
| 12 | 
             
              if (!element) return null;
         | 
| @@ -14,8 +18,19 @@ export const SelectedHtmlElement = ({ | |
| 14 | 
             
              const tagName = element.tagName.toLowerCase();
         | 
| 15 | 
             
              return (
         | 
| 16 | 
             
                <Collapsible
         | 
| 17 | 
            -
                  className= | 
| 18 | 
            -
             | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 19 | 
             
                >
         | 
| 20 | 
             
                  <CollapsibleTrigger className="flex items-center justify-start gap-2 cursor-pointer">
         | 
| 21 | 
             
                    <div className="rounded-lg bg-neutral-700 size-6 flex items-center justify-center">
         | 
|  | |
| 1 | 
            +
            import classNames from "classnames";
         | 
| 2 | 
            +
            import { Code, XCircle } from "lucide-react";
         | 
| 3 | 
            +
             | 
| 4 | 
             
            import { Collapsible, CollapsibleTrigger } from "@/components/ui/collapsible";
         | 
| 5 | 
             
            import { htmlTagToText } from "@/lib/html-tag-to-text";
         | 
|  | |
| 6 |  | 
| 7 | 
             
            export const SelectedHtmlElement = ({
         | 
| 8 | 
             
              element,
         | 
| 9 | 
            +
              isAiWorking = false,
         | 
| 10 | 
             
              onDelete,
         | 
| 11 | 
             
            }: {
         | 
| 12 | 
             
              element: HTMLElement | null;
         | 
| 13 | 
            +
              isAiWorking: boolean;
         | 
| 14 | 
             
              onDelete?: () => void;
         | 
| 15 | 
             
            }) => {
         | 
| 16 | 
             
              if (!element) return null;
         | 
|  | |
| 18 | 
             
              const tagName = element.tagName.toLowerCase();
         | 
| 19 | 
             
              return (
         | 
| 20 | 
             
                <Collapsible
         | 
| 21 | 
            +
                  className={classNames(
         | 
| 22 | 
            +
                    "border border-neutral-700 rounded-xl p-1.5 pr-3 max-w-max hover:brightness-110 transition-all duration-200 ease-in-out !cursor-pointer",
         | 
| 23 | 
            +
                    {
         | 
| 24 | 
            +
                      "!cursor-pointer": !isAiWorking,
         | 
| 25 | 
            +
                      "opacity-50 !cursor-not-allowed": isAiWorking,
         | 
| 26 | 
            +
                    }
         | 
| 27 | 
            +
                  )}
         | 
| 28 | 
            +
                  disabled={isAiWorking}
         | 
| 29 | 
            +
                  onClick={() => {
         | 
| 30 | 
            +
                    if (!isAiWorking && onDelete) {
         | 
| 31 | 
            +
                      onDelete();
         | 
| 32 | 
            +
                    }
         | 
| 33 | 
            +
                  }}
         | 
| 34 | 
             
                >
         | 
| 35 | 
             
                  <CollapsibleTrigger className="flex items-center justify-start gap-2 cursor-pointer">
         | 
| 36 | 
             
                    <div className="rounded-lg bg-neutral-700 size-6 flex items-center justify-center">
         | 
    	
        components/editor/deploy-button/index.tsx
    CHANGED
    
    | @@ -67,11 +67,11 @@ export function DeployButton({ | |
| 67 | 
             
                      <Popover>
         | 
| 68 | 
             
                        <PopoverTrigger asChild>
         | 
| 69 | 
             
                          <div>
         | 
| 70 | 
            -
                            <Button variant=" | 
| 71 | 
             
                              <MdSave className="size-4" />
         | 
| 72 | 
             
                              Save your Project
         | 
| 73 | 
             
                            </Button>
         | 
| 74 | 
            -
                            <Button variant=" | 
| 75 | 
             
                              Deploy
         | 
| 76 | 
             
                            </Button>
         | 
| 77 | 
             
                          </div>
         | 
|  | |
| 67 | 
             
                      <Popover>
         | 
| 68 | 
             
                        <PopoverTrigger asChild>
         | 
| 69 | 
             
                          <div>
         | 
| 70 | 
            +
                            <Button variant="default" className="max-lg:hidden !px-4">
         | 
| 71 | 
             
                              <MdSave className="size-4" />
         | 
| 72 | 
             
                              Save your Project
         | 
| 73 | 
             
                            </Button>
         | 
| 74 | 
            +
                            <Button variant="default" size="sm" className="lg:hidden">
         | 
| 75 | 
             
                              Deploy
         | 
| 76 | 
             
                            </Button>
         | 
| 77 | 
             
                          </div>
         | 
    	
        components/editor/footer/index.tsx
    CHANGED
    
    | @@ -83,7 +83,7 @@ export function Footer({ | |
| 83 | 
             
                        <span className="max-lg:hidden">DeepSite Gallery</span>
         | 
| 84 | 
             
                      </Button>
         | 
| 85 | 
             
                    </a>
         | 
| 86 | 
            -
                    <Button size="sm" variant=" | 
| 87 | 
             
                      <RefreshCcw className="size-3.5" />
         | 
| 88 | 
             
                      <span className="max-lg:hidden">Refresh Preview</span>
         | 
| 89 | 
             
                    </Button>
         | 
|  | |
| 83 | 
             
                        <span className="max-lg:hidden">DeepSite Gallery</span>
         | 
| 84 | 
             
                      </Button>
         | 
| 85 | 
             
                    </a>
         | 
| 86 | 
            +
                    <Button size="sm" variant="outline" onClick={handleRefreshIframe}>
         | 
| 87 | 
             
                      <RefreshCcw className="size-3.5" />
         | 
| 88 | 
             
                      <span className="max-lg:hidden">Refresh Preview</span>
         | 
| 89 | 
             
                    </Button>
         | 
    	
        components/editor/history/index.tsx
    CHANGED
    
    | @@ -51,14 +51,15 @@ export function History({ | |
| 51 | 
             
                                  })}
         | 
| 52 | 
             
                              </span>
         | 
| 53 | 
             
                            </div>
         | 
| 54 | 
            -
                            < | 
| 55 | 
            -
                               | 
|  | |
| 56 | 
             
                              onClick={() => {
         | 
| 57 | 
             
                                setHtml(item.html);
         | 
| 58 | 
             
                              }}
         | 
| 59 | 
             
                            >
         | 
| 60 | 
             
                              Select
         | 
| 61 | 
            -
                            </ | 
| 62 | 
             
                          </li>
         | 
| 63 | 
             
                        ))}
         | 
| 64 | 
             
                      </ul>
         | 
|  | |
| 51 | 
             
                                  })}
         | 
| 52 | 
             
                              </span>
         | 
| 53 | 
             
                            </div>
         | 
| 54 | 
            +
                            <Button
         | 
| 55 | 
            +
                              variant="sky"
         | 
| 56 | 
            +
                              size="xs"
         | 
| 57 | 
             
                              onClick={() => {
         | 
| 58 | 
             
                                setHtml(item.html);
         | 
| 59 | 
             
                              }}
         | 
| 60 | 
             
                            >
         | 
| 61 | 
             
                              Select
         | 
| 62 | 
            +
                            </Button>
         | 
| 63 | 
             
                          </li>
         | 
| 64 | 
             
                        ))}
         | 
| 65 | 
             
                      </ul>
         | 
    	
        components/editor/index.tsx
    CHANGED
    
    | @@ -197,7 +197,7 @@ export const AppEditor = ({ project }: { project?: Project | null }) => { | |
| 197 | 
             
                            language="html"
         | 
| 198 | 
             
                            theme="vs-dark"
         | 
| 199 | 
             
                            className={classNames(
         | 
| 200 | 
            -
                              " | 
| 201 | 
             
                              {
         | 
| 202 | 
             
                                "pointer-events-none": isAiWorking,
         | 
| 203 | 
             
                              }
         | 
| @@ -210,6 +210,7 @@ export const AppEditor = ({ project }: { project?: Project | null }) => { | |
| 210 | 
             
                              scrollbar: {
         | 
| 211 | 
             
                                horizontal: "hidden",
         | 
| 212 | 
             
                              },
         | 
|  | |
| 213 | 
             
                            }}
         | 
| 214 | 
             
                            value={html}
         | 
| 215 | 
             
                            onChange={(value) => {
         | 
|  | |
| 197 | 
             
                            language="html"
         | 
| 198 | 
             
                            theme="vs-dark"
         | 
| 199 | 
             
                            className={classNames(
         | 
| 200 | 
            +
                              "h-full bg-neutral-900 transition-all duration-200 absolute left-0 top-0",
         | 
| 201 | 
             
                              {
         | 
| 202 | 
             
                                "pointer-events-none": isAiWorking,
         | 
| 203 | 
             
                              }
         | 
|  | |
| 210 | 
             
                              scrollbar: {
         | 
| 211 | 
             
                                horizontal: "hidden",
         | 
| 212 | 
             
                              },
         | 
| 213 | 
            +
                              wordWrap: "on",
         | 
| 214 | 
             
                            }}
         | 
| 215 | 
             
                            value={html}
         | 
| 216 | 
             
                            onChange={(value) => {
         | 
    	
        components/editor/preview/index.tsx
    CHANGED
    
    | @@ -131,14 +131,8 @@ export const Preview = ({ | |
| 131 | 
             
                    <div
         | 
| 132 | 
             
                      className="cursor-pointer absolute bg-sky-500/10 border-[2px] border-dashed border-sky-500 rounded-r-lg rounded-b-lg p-3 z-10 pointer-events-none"
         | 
| 133 | 
             
                      style={{
         | 
| 134 | 
            -
                        top:
         | 
| 135 | 
            -
             | 
| 136 | 
            -
                          (iframeRef?.current?.contentWindow?.scrollY || 0) +
         | 
| 137 | 
            -
                          24,
         | 
| 138 | 
            -
                        left:
         | 
| 139 | 
            -
                          selectedElement.getBoundingClientRect().left +
         | 
| 140 | 
            -
                          (iframeRef?.current?.contentWindow?.scrollX || 0) +
         | 
| 141 | 
            -
                          24,
         | 
| 142 | 
             
                        width: selectedElement.getBoundingClientRect().width,
         | 
| 143 | 
             
                        height: selectedElement.getBoundingClientRect().height,
         | 
| 144 | 
             
                      }}
         | 
|  | |
| 131 | 
             
                    <div
         | 
| 132 | 
             
                      className="cursor-pointer absolute bg-sky-500/10 border-[2px] border-dashed border-sky-500 rounded-r-lg rounded-b-lg p-3 z-10 pointer-events-none"
         | 
| 133 | 
             
                      style={{
         | 
| 134 | 
            +
                        top: selectedElement.getBoundingClientRect().top + 24,
         | 
| 135 | 
            +
                        left: selectedElement.getBoundingClientRect().left + 24,
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 136 | 
             
                        width: selectedElement.getBoundingClientRect().width,
         | 
| 137 | 
             
                        height: selectedElement.getBoundingClientRect().height,
         | 
| 138 | 
             
                      }}
         | 
    	
        components/providers/tanstack-query-provider.tsx
    CHANGED
    
    | @@ -1,7 +1,6 @@ | |
| 1 | 
             
            "use client";
         | 
| 2 |  | 
| 3 | 
             
            import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
         | 
| 4 | 
            -
            import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
         | 
| 5 |  | 
| 6 | 
             
            export default function TanstackProvider({
         | 
| 7 | 
             
              children,
         | 
| @@ -13,7 +12,7 @@ export default function TanstackProvider({ | |
| 13 | 
             
              return (
         | 
| 14 | 
             
                <QueryClientProvider client={queryClient}>
         | 
| 15 | 
             
                  {children}
         | 
| 16 | 
            -
                  <ReactQueryDevtools initialIsOpen={false} />
         | 
| 17 | 
             
                </QueryClientProvider>
         | 
| 18 | 
             
              );
         | 
| 19 | 
             
            }
         | 
|  | |
| 1 | 
             
            "use client";
         | 
| 2 |  | 
| 3 | 
             
            import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
         | 
|  | |
| 4 |  | 
| 5 | 
             
            export default function TanstackProvider({
         | 
| 6 | 
             
              children,
         | 
|  | |
| 12 | 
             
              return (
         | 
| 13 | 
             
                <QueryClientProvider client={queryClient}>
         | 
| 14 | 
             
                  {children}
         | 
| 15 | 
            +
                  {/* <ReactQueryDevtools initialIsOpen={false} /> */}
         | 
| 16 | 
             
                </QueryClientProvider>
         | 
| 17 | 
             
              );
         | 
| 18 | 
             
            }
         | 
    	
        components/space/ask-ai/index.tsx
    CHANGED
    
    | @@ -9,9 +9,6 @@ import { Button } from "@/components/ui/button"; | |
| 9 | 
             
            export const AskAi = () => {
         | 
| 10 | 
             
              return (
         | 
| 11 | 
             
                <>
         | 
| 12 | 
            -
                  <div className="bg-red-500 flex items-center justify-end">
         | 
| 13 | 
            -
                    No Follow-up mode
         | 
| 14 | 
            -
                  </div>
         | 
| 15 | 
             
                  <div className="bg-neutral-800 border border-neutral-700 rounded-2xl ring-[4px] focus-within:ring-neutral-500/30 focus-within:border-neutral-600 ring-transparent group">
         | 
| 16 | 
             
                    <textarea
         | 
| 17 | 
             
                      rows={3}
         | 
|  | |
| 9 | 
             
            export const AskAi = () => {
         | 
| 10 | 
             
              return (
         | 
| 11 | 
             
                <>
         | 
|  | |
|  | |
|  | |
| 12 | 
             
                  <div className="bg-neutral-800 border border-neutral-700 rounded-2xl ring-[4px] focus-within:ring-neutral-500/30 focus-within:border-neutral-600 ring-transparent group">
         | 
| 13 | 
             
                    <textarea
         | 
| 14 | 
             
                      rows={3}
         | 
    	
        hooks/useUser.ts
    CHANGED
    
    | @@ -54,7 +54,6 @@ export const useUser = (initialData?: { | |
| 54 | 
             
              };
         | 
| 55 |  | 
| 56 | 
             
              const loginFromCode = async (code: string) => {
         | 
| 57 | 
            -
                console.log("Login from code => ", code);
         | 
| 58 | 
             
                setLoadingAuth(true);
         | 
| 59 | 
             
                if (loadingAuth) return;
         | 
| 60 | 
             
                await api
         | 
|  | |
| 54 | 
             
              };
         | 
| 55 |  | 
| 56 | 
             
              const loginFromCode = async (code: string) => {
         | 
|  | |
| 57 | 
             
                setLoadingAuth(true);
         | 
| 58 | 
             
                if (loadingAuth) return;
         | 
| 59 | 
             
                await api
         | 
