Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore update #5536

Closed
wants to merge 166 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
166 commits
Select commit Hold shift + click to select a range
c2cb5cc
prompt revision
Rami9237 Nov 2, 2024
a4c2550
Use latest Anthropic Sonnet 3.5 model
elie222 Nov 14, 2024
87de744
Remove unnecessary convertToCoreMessages
elie222 Nov 14, 2024
99fc3c0
feat: add download to zip button
codewithtyler Nov 19, 2024
62aa2a7
Fixing Typo in System Prompt
fauzulkc Nov 24, 2024
cb20b6b
fix: fixed typos and optimized code
mnsdojo Nov 25, 2024
43d6701
feat: add Docker and Docker Compose support
codewithtyler Nov 29, 2024
b86c6d4
Remove accidentally committed file
codewithtyler Dec 8, 2024
3fbb931
Merge pull request #1 from elie222/patch-1
dustinwloring1988 Jan 15, 2025
4719d36
Merge pull request #2 from codewithtyler/feature/download
dustinwloring1988 Jan 15, 2025
d6525af
Merge pull request #3 from codewithtyler/feature/docker
dustinwloring1988 Jan 15, 2025
90a5c2b
Merge pull request #4 from Rami9237/main
dustinwloring1988 Jan 15, 2025
372a739
Merge pull request #5 from elie222/patch-2
dustinwloring1988 Jan 15, 2025
fa02511
Merge pull request #6 from mnsdojo/chore/fix-typos-and-improve-code
dustinwloring1988 Jan 15, 2025
acf2ac6
Merge pull request #7 from fauzulkc/patch-1
dustinwloring1988 Jan 15, 2025
9f1558f
feat: improved sidebar options
dustinwloring1988 Jan 15, 2025
52a6108
feat: improved sidebar options
dustinwloring1988 Jan 15, 2025
905c722
Create dependabot.yml
dustinwloring1988 Jan 15, 2025
6270fe2
chore(deps): bump @uiw/codemirror-theme-vscode from 4.23.0 to 4.23.7
dependabot[bot] Jan 15, 2025
97a7711
chore(deps): bump @codemirror/commands from 6.6.0 to 6.8.0
dependabot[bot] Jan 15, 2025
c8955bd
chore(deps-dev): bump vitest from 2.0.1 to 2.1.8
dependabot[bot] Jan 15, 2025
e4e85fa
chore(deps): bump @codemirror/search from 6.5.6 to 6.5.8
dependabot[bot] Jan 15, 2025
0a1d102
chore(deps): bump react-toastify from 10.0.5 to 11.0.3
dependabot[bot] Jan 15, 2025
ef1c184
Merge pull request #13 from ollama-agent/dependabot/npm_and_yarn/reac…
dustinwloring1988 Jan 15, 2025
b118c16
Merge pull request #12 from ollama-agent/dependabot/npm_and_yarn/code…
dustinwloring1988 Jan 15, 2025
1055c3b
Merge pull request #11 from ollama-agent/dependabot/npm_and_yarn/vite…
dustinwloring1988 Jan 15, 2025
3869919
chore(deps): bump rollup from 4.18.0 to 4.30.1
dependabot[bot] Jan 15, 2025
b31ac9d
Merge pull request #10 from ollama-agent/dependabot/npm_and_yarn/code…
dustinwloring1988 Jan 15, 2025
f8df091
Merge pull request #9 from ollama-agent/dependabot/npm_and_yarn/uiw/c…
dustinwloring1988 Jan 15, 2025
6457e00
Merge pull request #17 from ollama-agent/dependabot/npm_and_yarn/roll…
dustinwloring1988 Jan 15, 2025
ee01bd9
chore(deps-dev): bump vite from 5.3.1 to 5.3.6
dependabot[bot] Jan 15, 2025
824e68f
chore(deps): bump elliptic from 6.5.6 to 6.6.1
dependabot[bot] Jan 15, 2025
8b0a33c
Merge pull request #15 from ollama-agent/dependabot/npm_and_yarn/elli…
dustinwloring1988 Jan 15, 2025
06b2a29
Merge pull request #14 from ollama-agent/dependabot/npm_and_yarn/vite…
dustinwloring1988 Jan 15, 2025
3b04d45
chore(deps): bump cross-spawn from 7.0.3 to 7.0.6
dependabot[bot] Jan 15, 2025
6bb49d8
Merge pull request #16 from ollama-agent/dependabot/npm_and_yarn/cros…
dustinwloring1988 Jan 15, 2025
18ef31a
chore(deps): bump micromatch from 4.0.7 to 4.0.8
dependabot[bot] Jan 15, 2025
7be0082
Merge pull request #19 from ollama-agent/dependabot/npm_and_yarn/micr…
dustinwloring1988 Jan 15, 2025
1c83c68
chore(deps): bump express from 4.19.2 to 4.21.2
dependabot[bot] Jan 15, 2025
1ca7937
Merge pull request #18 from ollama-agent/dependabot/npm_and_yarn/expr…
dustinwloring1988 Jan 15, 2025
d9668f2
Delete package-lock.json
dustinwloring1988 Jan 15, 2025
fd35e5b
feat: env-example
dustinwloring1988 Jan 15, 2025
7313080
Update package.json
dustinwloring1988 Jan 15, 2025
b8901ef
Update vite.config.ts
dustinwloring1988 Jan 15, 2025
797ce73
fix: ui change
dustinwloring1988 Jan 15, 2025
77ebb76
fix: ui change
dustinwloring1988 Jan 15, 2025
e9866a8
Update BaseChat.tsx
dustinwloring1988 Jan 15, 2025
f4fdf2b
chore: update ai to 3.4.9
dustinwloring1988 Jan 15, 2025
7c9d131
chore: pnpm update
dustinwloring1988 Jan 15, 2025
f5b628d
chore: pnpm update
dustinwloring1988 Jan 15, 2025
2456260
fix: missing icon
dustinwloring1988 Jan 15, 2025
d1713e4
chore(deps-dev): bump @blitz/eslint-plugin from 0.1.0 to 0.1.3
dependabot[bot] Jan 15, 2025
a4911dd
chore(deps): bump @unocss/reset from 0.61.9 to 65.4.0
dependabot[bot] Jan 15, 2025
4945a0a
chore(deps): bump date-fns from 3.6.0 to 4.1.0
dependabot[bot] Jan 15, 2025
e47eb6f
chore(deps): bump nanostores from 0.10.3 to 0.11.3
dependabot[bot] Jan 15, 2025
98dec2b
Merge pull request #1 from openaisoftware/dependabot/npm_and_yarn/bli…
dustinwloring1988 Jan 15, 2025
a3357fe
chore(deps): bump isbot from 4.4.0 to 5.1.21
dependabot[bot] Jan 15, 2025
8484ba2
Merge pull request #5 from openaisoftware/dependabot/npm_and_yarn/isb…
dustinwloring1988 Jan 15, 2025
96f7a7e
Merge pull request #3 from openaisoftware/dependabot/npm_and_yarn/dat…
dustinwloring1988 Jan 15, 2025
2bf139e
Merge pull request #4 from openaisoftware/dependabot/npm_and_yarn/nan…
dustinwloring1988 Jan 15, 2025
8b4c63f
Merge pull request #2 from openaisoftware/dependabot/npm_and_yarn/uno…
dustinwloring1988 Jan 15, 2025
63cba68
feat: image support
dustinwloring1988 Jan 15, 2025
f4046d3
feat: image support
dustinwloring1988 Jan 15, 2025
471f5bf
chore: updated ai package
dustinwloring1988 Jan 16, 2025
8468310
chore: pnpm 6 updates
dustinwloring1988 Jan 16, 2025
d55a584
chore: pnpm 6 updates
dustinwloring1988 Jan 16, 2025
0bf3caf
chore: pnpm lint fix
dustinwloring1988 Jan 16, 2025
bc5b798
chore: pnpm lint fix
dustinwloring1988 Jan 16, 2025
af5f076
chore(deps): bump @nanostores/react from 0.7.3 to 0.8.4
dependabot[bot] Jan 16, 2025
2c99611
chore(deps): bump ai from 4.0.38 to 4.0.39
dependabot[bot] Jan 16, 2025
a780e91
chore(deps): bump remix-utils from 7.7.0 to 8.0.0
dependabot[bot] Jan 16, 2025
74ea60f
chore(deps-dev): bump vitest from 2.1.8 to 3.0.0
dependabot[bot] Jan 16, 2025
76268b0
chore(deps-dev): bump unocss from 0.61.9 to 65.4.2
dependabot[bot] Jan 16, 2025
4971fb2
fix:coep
dustinwloring1988 Jan 16, 2025
5361057
feat: open preview in new tab
dustinwloring1988 Jan 16, 2025
43ab272
feat: open preview in new tab
dustinwloring1988 Jan 16, 2025
f095d76
fix: cors issues
dustinwloring1988 Jan 16, 2025
5491389
chore: friendlier ui
dustinwloring1988 Jan 16, 2025
bf590d8
chore: friendlier ui
dustinwloring1988 Jan 16, 2025
a459aac
Merge pull request #12 from open-bolt/dependabot/npm_and_yarn/unocss-…
dustinwloring1988 Jan 16, 2025
58d8502
Merge pull request #14 from open-bolt/dependabot/npm_and_yarn/nanosto…
dustinwloring1988 Jan 16, 2025
b6438b2
Merge pull request #13 from open-bolt/dependabot/npm_and_yarn/ai-4.0.39
dustinwloring1988 Jan 16, 2025
7414f41
Merge pull request #11 from open-bolt/dependabot/npm_and_yarn/vitest-…
dustinwloring1988 Jan 16, 2025
234b9c2
Merge pull request #10 from open-bolt/dependabot/npm_and_yarn/remix-u…
dustinwloring1988 Jan 16, 2025
d98ce1c
chore(deps): bump diff and @types/diff
dependabot[bot] Jan 16, 2025
ca5deeb
chore(deps-dev): bump vite-tsconfig-paths from 4.3.2 to 5.1.4
dependabot[bot] Jan 16, 2025
188410d
chore(deps-dev): bump is-ci from 3.0.1 to 4.1.0
dependabot[bot] Jan 16, 2025
cad5974
Merge pull request #5 from open-bolt/dependabot/npm_and_yarn/is-ci-4.1.0
dustinwloring1988 Jan 16, 2025
307a0d2
Merge pull request #2 from open-bolt/dependabot/npm_and_yarn/multi-4b…
dustinwloring1988 Jan 16, 2025
1d07249
Merge pull request #18 from open-bolt/dependabot/npm_and_yarn/vite-ts…
dustinwloring1988 Jan 16, 2025
4ce3800
Merge pull request #23 from open-bolt/main
dustinwloring1988 Jan 16, 2025
0cc0b61
chore(deps): bump @ai-sdk/anthropic from 0.0.39 to 1.0.9
dependabot[bot] Jan 16, 2025
85e827d
Merge pull request #24 from open-bolt/dependabot/npm_and_yarn/ai-sdk/…
dustinwloring1988 Jan 16, 2025
438a047
chore: update webcontaienr package
dustinwloring1988 Jan 16, 2025
15ec1db
chore: update webcontainer package
dustinwloring1988 Jan 16, 2025
b5bc39b
feat: codemirror vue support
dustinwloring1988 Jan 16, 2025
c659b21
feat: codemirror vue support
dustinwloring1988 Jan 16, 2025
49f75ae
fix: for open in new tab
dustinwloring1988 Jan 16, 2025
42d2fdb
fix: for open in new tab
dustinwloring1988 Jan 16, 2025
b01f420
feat: add icons
dustinwloring1988 Jan 16, 2025
e3511ba
feat: add icons
dustinwloring1988 Jan 16, 2025
c7992bd
chore(deps-dev): bump wrangler from 3.103.0 to 3.103.1
dependabot[bot] Jan 16, 2025
cfdb96e
Merge pull request #29 from open-bolt/dependabot/npm_and_yarn/wrangle…
dustinwloring1988 Jan 16, 2025
99d587e
feat: push to github
dustinwloring1988 Jan 16, 2025
d7c4248
feat: push to github
dustinwloring1988 Jan 16, 2025
c099f66
chore: vitest update
dustinwloring1988 Jan 17, 2025
9392e50
chore: vitest update
dustinwloring1988 Jan 17, 2025
f4694d5
feat: more codemirror support
dustinwloring1988 Jan 17, 2025
caf4e47
feat: more codemirror support
dustinwloring1988 Jan 17, 2025
bf724ac
chore: sourcemap codec fix
dustinwloring1988 Jan 17, 2025
0d8ae3f
chore: sourcemap codec fix
dustinwloring1988 Jan 17, 2025
d98695f
chore: update types
dustinwloring1988 Jan 17, 2025
6d12e44
chore: update types
dustinwloring1988 Jan 17, 2025
5795b0e
feat: git clone support
dustinwloring1988 Jan 17, 2025
c8820ad
feat: git clone support
dustinwloring1988 Jan 17, 2025
f99bc3d
chore: pnpm update
dustinwloring1988 Jan 17, 2025
99feeec
chore: pnpm update
dustinwloring1988 Jan 17, 2025
ea3eed4
chore: update docker base image
dustinwloring1988 Jan 17, 2025
e312b8c
chore: update docker base image
dustinwloring1988 Jan 17, 2025
855121a
feat: git clone by url
dustinwloring1988 Jan 17, 2025
576d28d
feat: git clone by url
dustinwloring1988 Jan 17, 2025
0066a6f
feat: starter templates
dustinwloring1988 Jan 17, 2025
0e5d877
feat: starter templates
dustinwloring1988 Jan 17, 2025
532f517
chore: issue with current wrangler
dustinwloring1988 Jan 17, 2025
df945fc
chore: issue with current wrangler
dustinwloring1988 Jan 17, 2025
03ef417
feat: import folder
dustinwloring1988 Jan 17, 2025
5715a04
feat: import folder
dustinwloring1988 Jan 17, 2025
f54535e
chore: reused ignore patterns
dustinwloring1988 Jan 17, 2025
5615738
chore: reused ignore patterns
dustinwloring1988 Jan 17, 2025
46616cd
chore: pnpm update
dustinwloring1988 Jan 17, 2025
f0d2faa
chore: pnpm update
dustinwloring1988 Jan 17, 2025
ff11121
feat: auto sync
dustinwloring1988 Jan 17, 2025
18fd89e
feat: auto sync
dustinwloring1988 Jan 17, 2025
8707d01
chore: lint fix
dustinwloring1988 Jan 17, 2025
d84ae2a
chore: lint fix
dustinwloring1988 Jan 17, 2025
d892b78
chore: typecheck
dustinwloring1988 Jan 17, 2025
79ee759
chore: typecheck
dustinwloring1988 Jan 17, 2025
39db075
chore(deps-dev): bump wrangler from 3.99.0 to 3.103.2
dependabot[bot] Jan 17, 2025
47db554
feat: add private repo cloning
dustinwloring1988 Jan 17, 2025
4c5efcc
feat: add private repo cloning
dustinwloring1988 Jan 17, 2025
3c15db9
Merge pull request #51 from openaisoftware/dependabot/npm_and_yarn/wr…
dustinwloring1988 Jan 18, 2025
99666d7
feat: bolt terminal
dustinwloring1988 Jan 18, 2025
47b7abb
feat: bolt terminal
dustinwloring1988 Jan 18, 2025
6f7571c
chore: pnpm update
dustinwloring1988 Jan 18, 2025
8a51990
chore: pnpm update
dustinwloring1988 Jan 18, 2025
e2c3cef
chore: lint fix
dustinwloring1988 Jan 18, 2025
adf0cbc
chore: lint fix
dustinwloring1988 Jan 18, 2025
fe53959
feat: chat restore
dustinwloring1988 Jan 18, 2025
adcd697
feat: chat restore
dustinwloring1988 Jan 18, 2025
bf7a031
chore: pnpm update
dustinwloring1988 Jan 18, 2025
ef6592b
chore: pnpm update
dustinwloring1988 Jan 18, 2025
13d0ee4
chore: lint fix
dustinwloring1988 Jan 18, 2025
0f4f859
chore: lint fix
dustinwloring1988 Jan 18, 2025
61d6338
feat: improved popout
dustinwloring1988 Jan 18, 2025
963f3f8
feat: improved popout
dustinwloring1988 Jan 18, 2025
1de0c55
chore: ui updates
dustinwloring1988 Jan 18, 2025
8960bb8
chore: ui updates
dustinwloring1988 Jan 18, 2025
14a815c
chore: lint fix
dustinwloring1988 Jan 18, 2025
dcf5a04
chore: lint fix
dustinwloring1988 Jan 18, 2025
7d92db0
feat: layout change
dustinwloring1988 Jan 18, 2025
ed78fa2
feat: layout change
dustinwloring1988 Jan 18, 2025
d1b6820
chore(deps-dev): bump vite-plugin-node-polyfills from 0.22.0 to 0.23.0
dependabot[bot] Jan 20, 2025
773ea74
chore(deps): bump framer-motion from 11.18.1 to 12.0.0
dependabot[bot] Jan 20, 2025
5f6a035
Merge pull request #71 from openaisoftware/dependabot/npm_and_yarn/fr…
dustinwloring1988 Jan 21, 2025
331c61a
Merge pull request #70 from openaisoftware/dependabot/npm_and_yarn/vi…
dustinwloring1988 Jan 21, 2025
58b4a3d
chore: update
dustinwloring1988 Jan 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
.git
.gitignore
Dockerfile
docker-compose.yml
.env
.env.local
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Application
VITE_LOG_LEVEL=debug

# API Keys (replace these with your actual keys)
ANTHROPIC_API_KEY=XXX

11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ dist-ssr
/.cache
/build
.env*
!.env.example
*.vars
.wrangler
_worker.bundle
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM node:20.18.1-bookworm-slim

WORKDIR /app

# Install pnpm (matches packageManager in package.json)
RUN npm install -g [email protected]

# Copy package files first
COPY package.json pnpm-lock.yaml ./

# Clean install dependencies with legacy peer deps
RUN rm -rf node_modules
RUN pnpm install --no-frozen-lockfile
RUN pnpm rebuild

# Copy source code
COPY . .

# Create empty .env.local if it doesn't exist
RUN touch .env.local

# Expose Vite's default port
EXPOSE 5173

# Required for WebContainer API
ENV NODE_ENV=development
ENV VITE_LOG_LEVEL=debug

# Start Vite directly instead of through Remix
CMD ["pnpm", "exec", "vite", "dev", "--host"]
16 changes: 8 additions & 8 deletions app/components/chat/Artifact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface ArtifactProps {

export const Artifact = memo(({ messageId }: ArtifactProps) => {
const userToggledActions = useRef(false);
const [showActions, setShowActions] = useState(false);
const [showActions, setShowActions] = useState<boolean>(false);

const artifacts = useStore(workbenchStore.artifacts);
const artifact = artifacts[messageId];
Expand All @@ -43,10 +43,10 @@ export const Artifact = memo(({ messageId }: ArtifactProps) => {
};

useEffect(() => {
if (actions.length && !showActions && !userToggledActions.current) {
if (actions.length > 0 && !showActions && !userToggledActions.current) {
setShowActions(true);
}
}, [actions]);
}, [actions, showActions]);

return (
<div className="artifact border border-bolt-elements-borderColor flex flex-col overflow-hidden rounded-lg w-full transition-border duration-150">
Expand All @@ -60,7 +60,7 @@ export const Artifact = memo(({ messageId }: ArtifactProps) => {
>
<div className="px-5 p-3.5 w-full text-left">
<div className="w-full text-bolt-elements-textPrimary font-medium leading-5 text-sm">{artifact?.title}</div>
<div className="w-full w-full text-bolt-elements-textSecondary text-xs mt-0.5">Click to open Workbench</div>
<div className=" w-full text-bolt-elements-textSecondary text-xs mt-0.5">Click to open Workbench</div>
</div>
</button>
<div className="bg-bolt-elements-artifacts-borderColor w-[1px]" />
Expand Down Expand Up @@ -102,14 +102,14 @@ export const Artifact = memo(({ messageId }: ArtifactProps) => {
});

interface ShellCodeBlockProps {
classsName?: string;
className?: string;
code: string;
}

function ShellCodeBlock({ classsName, code }: ShellCodeBlockProps) {
function ShellCodeBlock({ className, code }: ShellCodeBlockProps) {
return (
<div
className={classNames('text-xs', classsName)}
className={classNames('text-xs', className)}
dangerouslySetInnerHTML={{
__html: shellHighlighter.codeToHtml(code, {
lang: 'shell',
Expand Down Expand Up @@ -175,7 +175,7 @@ const ActionList = memo(({ actions }: ActionListProps) => {
</div>
{type === 'shell' && (
<ShellCodeBlock
classsName={classNames('mt-1', {
className={classNames('mt-1', {
'mb-3.5': !isLast,
})}
code={content}
Expand Down
22 changes: 22 additions & 0 deletions app/components/chat/BaseChat.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,30 @@
opacity: 0;
}
}

@media (max-width: 768px) {
position: fixed;
top: var(--header-height);
left: 0;
right: 0;
bottom: 0;
z-index: 999;
background: var(--bolt-elements-bg-depth-1);

&[data-chat-visible='false'] {
display: none;
}
}
}

.Chat {
opacity: 1;

@media (max-width: 768px) {
width: 100%;
height: 100%;
max-width: none;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
}
110 changes: 87 additions & 23 deletions app/components/chat/BaseChat.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import type { Message } from 'ai';
import React, { type RefCallback } from 'react';
import { ClientOnly } from 'remix-utils/client-only';
import styles from './BaseChat.module.scss';
import { ChatHistory } from './ChatHistory.client';
import FilePreview from './FilePreview';
import GitCloneButton from './GitCloneButton';
import { ImportFolderButton } from './ImportFolderButton';
import { Messages } from './Messages.client';
import { SendButton } from './SendButton.client';
import StarterTemplates from './StarterTemplates';
import { Menu } from '~/components/sidebar/Menu.client';
import { IconButton } from '~/components/ui/IconButton';
import { Workbench } from '~/components/workbench/Workbench.client';
import { classNames } from '~/utils/classNames';
import { Messages } from './Messages.client';
import { SendButton } from './SendButton.client';

import styles from './BaseChat.module.scss';

interface BaseChatProps {
textareaRef?: React.RefObject<HTMLTextAreaElement> | undefined;
textareaRef?: React.RefObject<HTMLTextAreaElement | null> | undefined;
messageRef?: RefCallback<HTMLDivElement> | undefined;
scrollRef?: RefCallback<HTMLDivElement> | undefined;
showChat?: boolean;
Expand All @@ -21,16 +25,20 @@ interface BaseChatProps {
enhancingPrompt?: boolean;
promptEnhanced?: boolean;
input?: string;
files?: File[];
imageDataList?: string[];
handleStop?: () => void;
sendMessage?: (event: React.UIEvent, messageInput?: string) => void;
handleInputChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;
enhancePrompt?: () => void;
onFileUpload?: (files: FileList) => void;
onRemoveFile?: (index: number) => void;
}

const EXAMPLE_PROMPTS = [
{ text: 'Build a todo app in React using Tailwind' },
{ text: 'Build a simple blog using Astro' },
{ text: 'Create a cookie consent form using Material UI' },
{ text: 'Make a login form using React' },
{ text: 'Make a space invaders game' },
{ text: 'How do I center a div?' },
];
Expand All @@ -54,6 +62,10 @@ export const BaseChat = React.forwardRef<HTMLDivElement, BaseChatProps>(
handleInputChange,
enhancePrompt,
handleStop,
files,
imageDataList,
onFileUpload,
onRemoveFile,
},
ref,
) => {
Expand All @@ -72,7 +84,7 @@ export const BaseChat = React.forwardRef<HTMLDivElement, BaseChatProps>(
<div ref={scrollRef} className="flex overflow-y-auto w-full h-full">
<div className={classNames(styles.Chat, 'flex flex-col flex-grow min-w-[var(--chat-min-width)] h-full')}>
{!chatStarted && (
<div id="intro" className="mt-[26vh] max-w-chat mx-auto">
<div id="intro" className="mt-[10vh] max-w-chat mx-auto">
<h1 className="text-5xl text-center font-bold text-bolt-elements-textPrimary mb-2">
Where ideas begin
</h1>
Expand Down Expand Up @@ -173,34 +185,86 @@ export const BaseChat = React.forwardRef<HTMLDivElement, BaseChatProps>(
</>
)}
</IconButton>
<input
type="file"
id="image-upload"
accept="image/*"
multiple
className="hidden"
onChange={(e) => onFileUpload?.(e.target.files!)}
/>
<IconButton
title="Upload images"
onClick={() => document.getElementById('image-upload')?.click()}
>
<div className="i-ph:image text-xl" />
</IconButton>
<ClientOnly>{() => <ChatHistory />}</ClientOnly>
</div>
{input.length > 3 ? (
<div className="text-xs text-bolt-elements-textTertiary">
Use <kbd className="kdb">Shift</kbd> + <kbd className="kdb">Return</kbd> for a new line
</div>
) : null}
</div>
{files && files.length > 0 && (
<div className="px-4 pb-4">
<FilePreview
files={files}
imageDataList={imageDataList || []}
onRemove={
onRemoveFile ||
function noop() {
/* no-op */
}
}
/>
</div>
)}
</div>
<div className="bg-bolt-elements-background-depth-1 pb-6">{/* Ghost Element */}</div>
</div>
</div>
{!chatStarted && (
<div id="examples" className="relative w-full max-w-xl mx-auto mt-8 flex justify-center">
<div className="flex flex-col space-y-2 [mask-image:linear-gradient(to_bottom,black_0%,transparent_180%)] hover:[mask-image:none]">
{EXAMPLE_PROMPTS.map((examplePrompt, index) => {
return (
<button
key={index}
onClick={(event) => {
sendMessage?.(event, examplePrompt.text);
}}
className="group flex items-center w-full gap-2 justify-center bg-transparent text-bolt-elements-textTertiary hover:text-bolt-elements-textPrimary transition-theme"
>
{examplePrompt.text}
<div className="i-ph:arrow-bend-down-left" />
</button>
);
})}
<div id="examples" className="relative w-full max-w-4xl mx-auto mt-8 flex flex-col items-center px-4">
<div className="flex gap-4 mb-8">
<GitCloneButton
importChat={async (description, messages) => {
sendMessage?.(new Event('click') as any, description);
messages.forEach((message) => {
sendMessage?.(new Event('click') as any, message.content);
});
}}
/>
<ImportFolderButton
importChat={async (description, messages) => {
sendMessage?.(new Event('click') as any, description);
messages.forEach((message) => {
sendMessage?.(new Event('click') as any, message.content);
});
}}
/>
</div>
<div className="text-center mb-4 text-bolt-elements-textSecondary">
or start a blank app with your favorite stack
</div>
<div className="flex flex-col space-y-2 w-full">
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-2 mb-6">
{EXAMPLE_PROMPTS.map((examplePrompt, index) => {
return (
<button
key={index}
onClick={(event) => {
sendMessage?.(event, examplePrompt.text);
}}
className="group flex items-center justify-center px-3 py-2 rounded-full bg-[#1A1A1A] hover:bg-[#252525] text-sm text-bolt-elements-textSecondary hover:text-bolt-elements-textPrimary transition-all duration-200"
>
<span>{examplePrompt.text}</span>
</button>
);
})}
</div>
<StarterTemplates />
</div>
</div>
)}
Expand Down
Loading
Loading