Commit Graph

108 Commits

Author SHA1 Message Date
kachbit
521d9c584f configure dark mode styles for editor theme dropdown 2023-11-27 21:39:09 -08:00
Abi Raja
032d9943a8 add feedback link for hosted version 2023-11-27 17:42:21 -05:00
Abi Raja
2e6d4cd01a improve styles of drag and drop upload 2023-11-27 17:16:52 -05:00
Abi Raja
ce7a187e40 Merge branch 'pr/99' 2023-11-26 22:30:36 -05:00
Abi Raja
2eb98587b2 split code tab into separate component and clean up code 2023-11-26 22:30:11 -05:00
Abi Raja
b7b219b697 fix typo 2023-11-26 22:09:21 -05:00
Abi Raja
fb4dc08b4e update onboarding note 2023-11-26 21:59:44 -05:00
Abi Raja
e5ca11daef update copy on Settings Dialog for screenshotting a URL 2023-11-26 18:51:18 -05:00
Abi Raja
f9a30be761 update copy on URL input section 2023-11-26 18:49:33 -05:00
Abi Raja
e8f4bf1dea style fix 2023-11-26 15:31:59 -05:00
Abi Raja
0449fec242
Merge pull request #94 from dialmedu/fix/paste-from-clipboard
small fix, check that dataUrls are valid
2023-11-26 15:31:13 -05:00
Abi Raja
a178e316c4 make drag and drop area more obvious 2023-11-26 15:30:03 -05:00
Abi Raja
7ef6a0b205 collect emails on hosted version 2023-11-26 14:54:02 -05:00
dialmedu
d177ad30c8 small fix, check that dataUrls are valid, when there is only text on the clipboard 2023-11-24 01:57:29 -05:00
clean99
219b241a67
Merge branch 'main' into feat/add-image-comparison 2023-11-22 12:04:45 +08:00
Abi Raja
41b8f91cbc Merge branch 'main' into pr/65 2023-11-21 22:13:54 -05:00
clean99
cb1e7a39b9 feat: add switch and screenshot feature in fe 2023-11-21 21:16:26 +08:00
vagusx
9b9db3ac07 feat: use usePersistedState 2023-11-21 20:25:19 +08:00
vagusx
3bc2568052 feat: Add local storage functionality to track acceptance of terms of service 2023-11-21 16:55:46 +08:00
Nothing1024
e69269d844 Feat: OpenAI Base URL supported 2023-11-21 16:05:23 +08:00
clean99
d9a4abcbf1 feat: use memo to reduce editor state update 2023-11-21 11:40:20 +08:00
clean99
d10c793a60 fix: cursor didnt focus on right position 2023-11-21 11:33:33 +08:00
clean99
30ab9e384a feat: support edit code 2023-11-21 09:40:00 +08:00
clean99
9dfdc8683d fix: prevent flashing when updating code 2023-11-21 09:23:07 +08:00
Abi Raja
5b1303dc20 add TermsOfServiceDialog for hosted version 2023-11-20 12:38:40 -05:00
Abi Raja
72645512fe update copy re: key storage 2023-11-20 12:07:40 -05:00
Abi Raja
e7c05d7d23 fix screenshotone links 2023-11-20 11:54:31 -05:00
Abi Raja
bf23d3198a support screenshotting a URL with ScreenshotOne 2023-11-20 11:48:33 -05:00
Abi Raja
7d4389526c
Merge pull request #36 from kachbit/main
Update codemirror theme to match overall style/color scheme of the page
2023-11-19 21:14:00 -05:00
kacher
fa9124381c
minor fixes 2023-11-19 15:17:36 -08:00
kachbit
40c00fc12b added select component 2023-11-19 15:07:32 -08:00
kachbit
6f5c0cb063 editor theme selector 2023-11-19 14:30:10 -08:00
Ikko Eltociear Ashimine
fad46574fd
Update ImageUpload.tsx
seperate -> separate
2023-11-20 00:57:27 +09:00
kachbit
168d4b035b updated codemirror theme 2023-11-18 23:19:34 -08:00
Abi Raja
54bdcfdcfa Merge branch 'main' into pr/19 2023-11-18 15:38:44 -05:00
Abi Raja
6651b884bb minor fixes 2023-11-18 15:38:34 -05:00
Abi Raja
8ed1f61731 improve hosted version experience but disable these elements when running locally 2023-11-18 11:23:56 -05:00
Jirawat Boonkumnerd
3d2978f5d2
feat: add paste from clipboard
- add paste image from clipboard (ctrl+v)
- validate if the file is an image
2023-11-18 06:49:03 +07:00
Abi Raja
ee9b40d990 support setting openai api key on the client side 2023-11-16 18:12:07 -05:00
Abi Raja
e27c278a79 update copy for Placeholder Image Generation setting 2023-11-16 17:41:24 -05:00
Abi Raja
371dddda3f add a settings dialog to allow you to disable the image generation 2023-11-16 17:37:03 -05:00
Abi Raja
67f710521d support desktop and mobile preview 2023-11-16 11:56:54 -05:00
Abi Raja
7d6fde2dea make it easy to view code in the app 2023-11-15 20:12:30 -05:00
Abi Raja
6b1c5aecef fix bad gitignore and missing file 2023-11-15 19:42:47 -05:00
Abi Raja
a126c37ed3 improve sidebar visual style 2023-11-15 16:32:57 -05:00
Abi Raja
6f3c668c2f add shadcn and some components 2023-11-15 13:11:41 -05:00
Abi Raja
99508d8e03 throttle the iframe preview so that it doesn't stop updating at the end of code generation due to too many updates 2023-11-15 09:51:34 -05:00
Abi Raja
c4b99c125e make layout better 2023-11-14 23:33:06 -05:00
Abi Raja
3f071e7a68 make preview look better 2023-11-14 18:54:05 -05:00
Abi Raja
95ea486112 improve UI style 2023-11-14 18:21:57 -05:00
Abi Raja
126972bee0 move download button to main App 2023-11-14 17:18:04 -05:00
Abi Raja
c0d1c23145 add a download code button 2023-11-14 15:55:51 -05:00
Abi Raja
fdecb93ea6 aider: Add a button to download the code as index.html in frontend/src/components/Preview.tsx.
# Aider chat conversation:

USER: add previ

ASSISTANT:
^C KeyboardInterrupt

USER: add `frontend/src/components/Preview.tsx`

ASSISTANT: Sure, I can help with that. Could you please provide more details about the changes you want to make in `frontend/src/components/Preview.tsx`?

USER: add a button to download the code as index.html

ASSISTANT: To add a download button, we need to modify the `frontend/src/components/Preview.tsx` file. We will add a new button that, when clicked, will trigger a download of the generated code as an `index.html` file.

Here is the step-by-step plan:

1. Import the `useState` hook from React.
2. Create a new state variable `blobUrl` and a function `createBlobUrl` to update it.
3. In the `createBlobUrl` function, create a new Blob from the `code` prop, create a URL for the Blob, and set `blobUrl` to this URL.
4. Add a new button that triggers the `createBlobUrl` function when clicked.
5. Set the `href` attribute of the button to `blobUrl` and the `download` attribute to `index.html`.

Here is the *edit block* for these changes:

```jsx
frontend/src/components/Preview.tsx
<<<<<<< HEAD
interface Props {
  code: string;
}

function Preview({ code }: Props) {
  return (
    <div className="w-[704px]">
      <iframe
        title="Iframe Example"
        srcDoc={code}
        className="border-[5px] border-black rounded-[33px] p-4 shadow-lg
        transform scale-[0.8] origin-top-left w-[1280px] h-[832px]"
      ></iframe>
    </div>
  );
}
export default Preview;
=======
import { useState } from 'react';

interface Props {
  code: string;
}

function Preview({ code }: Props) {
  const [blobUrl, setBlobUrl] = useState('');

  const createBlobUrl = () => {
    const blob = new Blob([code], { type: 'text/html' });
    const url = URL.createObjectURL(blob);
    setBlobUrl(url);
  };

  return (
    <div className="w-[704px]">
      <iframe
        title="Iframe Example"
        srcDoc={code}
        className="border-[5px] border-black rounded-[33px] p-4 shadow-lg
        transform scale-[0.8] origin-top-left w-[1280px] h-[832px]"
      ></iframe>
      <button onClick={createBlobUrl} href={blobUrl} download="index.html">
        Download code
      </button>
    </div>
  );
}
export default Preview;
>>>>>>> updated
```
2023-11-14 15:48:18 -05:00
Abi Raja
444c16abe6 show generated code in preview 2023-11-14 14:49:05 -05:00
Abi Raja
209929d6b3 minor refactor and typescript checker 2023-11-14 14:47:03 -05:00
Abi Raja
169dd0a337 add a desktop preview 2023-11-14 13:36:34 -05:00
Abi Raja
5a8d7d9071 add a CodePreview element 2023-11-14 13:33:06 -05:00
Abi Raja
2bf4b62082 add a basic UI 2023-11-14 13:10:41 -05:00