mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-06-26 18:26:38 +00:00
bug fix for Open preview in a new tab.
This commit is contained in:
parent
e19644268c
commit
b732f20233
27
README.md
27
README.md
@ -1,4 +1,5 @@
|
||||
# bolt.diy (Previously oTToDev)
|
||||
|
||||
[](https://bolt.diy)
|
||||
|
||||
Welcome to bolt.diy, the official open source version of Bolt.new (previously known as oTToDev and bolt.new ANY LLM), which allows you to choose the LLM that you use for each prompt! Currently, you can use OpenAI, Anthropic, Ollama, OpenRouter, Gemini, LMStudio, Mistral, xAI, HuggingFace, DeepSeek, or Groq models - and it is easily extended to use any other model supported by the Vercel AI SDK! See the instructions below for running this locally and extending it to include more models.
|
||||
@ -65,7 +66,7 @@ project, please check the [project management guide](./PROJECT.md) to get starte
|
||||
- ✅ Together Integration (@mouimet-infinisoft)
|
||||
- ✅ Mobile friendly (@qwikode)
|
||||
- ✅ Better prompt enhancing (@SujalXplores)
|
||||
- ✅ Attach images to prompts (@atrokhym)
|
||||
- ✅ Attach images to prompts (@atrokhym)(@stijnus)
|
||||
- ✅ Added Git Clone button (@thecodacus)
|
||||
- ✅ Git Import from url (@thecodacus)
|
||||
- ✅ PromptLibrary to have different variations of prompts for different use cases (@thecodacus)
|
||||
@ -87,7 +88,8 @@ project, please check the [project management guide](./PROJECT.md) to get starte
|
||||
- ⬜ Azure Open AI API Integration
|
||||
- ⬜ Vertex AI Integration
|
||||
- ⬜ Granite Integration
|
||||
- ⬜ Popout Window for Web Container
|
||||
- ✅ Popout Window for Web Container(@stijnus)
|
||||
- ✅ Ability to change Popout window size (@stijnus)
|
||||
|
||||
## Features
|
||||
|
||||
@ -111,9 +113,6 @@ Let's get you up and running with the stable version of Bolt.DIY!
|
||||
|
||||
- Next **click source.zip**
|
||||
|
||||
|
||||
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before you begin, you'll need to install two important pieces of software:
|
||||
@ -146,16 +145,19 @@ You have two options for running Bolt.DIY: directly on your machine or using Doc
|
||||
### Option 1: Direct Installation (Recommended for Beginners)
|
||||
|
||||
1. **Install Package Manager (pnpm)**:
|
||||
|
||||
```bash
|
||||
npm install -g pnpm
|
||||
```
|
||||
|
||||
2. **Install Project Dependencies**:
|
||||
|
||||
```bash
|
||||
pnpm install
|
||||
```
|
||||
|
||||
3. **Start the Application**:
|
||||
|
||||
```bash
|
||||
pnpm run dev
|
||||
```
|
||||
@ -167,11 +169,13 @@ You have two options for running Bolt.DIY: directly on your machine or using Doc
|
||||
This option requires some familiarity with Docker but provides a more isolated environment.
|
||||
|
||||
#### Additional Prerequisite
|
||||
|
||||
- Install Docker: [Download Docker](https://www.docker.com/)
|
||||
|
||||
#### Steps:
|
||||
|
||||
1. **Build the Docker Image**:
|
||||
|
||||
```bash
|
||||
# Using npm script:
|
||||
npm run dockerbuild
|
||||
@ -185,9 +189,6 @@ This option requires some familiarity with Docker but provides a more isolated e
|
||||
docker-compose --profile development up
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## Configuring API Keys and Providers
|
||||
|
||||
### Adding Your API Keys
|
||||
@ -216,6 +217,7 @@ For providers that support custom base URLs (such as Ollama or LM Studio), follo
|
||||
> **Note**: Custom base URLs are particularly useful when running local instances of AI models or using custom API endpoints.
|
||||
|
||||
### Supported Providers
|
||||
|
||||
- Ollama
|
||||
- LM Studio
|
||||
- OpenAILike
|
||||
@ -223,23 +225,27 @@ For providers that support custom base URLs (such as Ollama or LM Studio), follo
|
||||
## Setup Using Git (For Developers only)
|
||||
|
||||
This method is recommended for developers who want to:
|
||||
|
||||
- Contribute to the project
|
||||
- Stay updated with the latest changes
|
||||
- Switch between different versions
|
||||
- Create custom modifications
|
||||
|
||||
#### Prerequisites
|
||||
|
||||
1. Install Git: [Download Git](https://git-scm.com/downloads)
|
||||
|
||||
#### Initial Setup
|
||||
|
||||
1. **Clone the Repository**:
|
||||
|
||||
```bash
|
||||
# Using HTTPS
|
||||
git clone https://github.com/stackblitz-labs/bolt.diy.git
|
||||
```
|
||||
|
||||
2. **Navigate to Project Directory**:
|
||||
|
||||
```bash
|
||||
cd bolt.diy
|
||||
```
|
||||
@ -249,6 +255,7 @@ This method is recommended for developers who want to:
|
||||
git checkout main
|
||||
```
|
||||
4. **Install Dependencies**:
|
||||
|
||||
```bash
|
||||
pnpm install
|
||||
```
|
||||
@ -263,16 +270,19 @@ This method is recommended for developers who want to:
|
||||
To get the latest changes from the repository:
|
||||
|
||||
1. **Save Your Local Changes** (if any):
|
||||
|
||||
```bash
|
||||
git stash
|
||||
```
|
||||
|
||||
2. **Pull Latest Updates**:
|
||||
|
||||
```bash
|
||||
git pull origin main
|
||||
```
|
||||
|
||||
3. **Update Dependencies**:
|
||||
|
||||
```bash
|
||||
pnpm install
|
||||
```
|
||||
@ -287,6 +297,7 @@ To get the latest changes from the repository:
|
||||
If you encounter issues:
|
||||
|
||||
1. **Clean Installation**:
|
||||
|
||||
```bash
|
||||
# Remove node modules and lock files
|
||||
rm -rf node_modules pnpm-lock.yaml
|
||||
|
||||
@ -11,13 +11,14 @@ interface WindowSize {
|
||||
name: string;
|
||||
width: number;
|
||||
height: number;
|
||||
icon: string;
|
||||
}
|
||||
|
||||
const WINDOW_SIZES: WindowSize[] = [
|
||||
{ name: 'Mobile (375x667)', width: 375, height: 667 },
|
||||
{ name: 'Tablet (768x1024)', width: 768, height: 1024 },
|
||||
{ name: 'Laptop (1366x768)', width: 1366, height: 768 },
|
||||
{ name: 'Desktop (1920x1080)', width: 1920, height: 1080 },
|
||||
{ name: 'Mobile', width: 375, height: 667, icon: 'i-ph:device-mobile' },
|
||||
{ name: 'Tablet', width: 768, height: 1024, icon: 'i-ph:device-tablet' },
|
||||
{ name: 'Laptop', width: 1366, height: 768, icon: 'i-ph:laptop' },
|
||||
{ name: 'Desktop', width: 1920, height: 1080, icon: 'i-ph:monitor' },
|
||||
];
|
||||
|
||||
export const Preview = memo(() => {
|
||||
@ -249,14 +250,17 @@ export const Preview = memo(() => {
|
||||
{isPortDropdownOpen && (
|
||||
<div className="z-iframe-overlay w-full h-full absolute" onClick={() => setIsPortDropdownOpen(false)} />
|
||||
)}
|
||||
<div className="bg-bolt-elements-background-depth-2 p-2 flex items-center gap-1.5">
|
||||
<div className="bg-bolt-elements-background-depth-2 p-2 flex items-center gap-2">
|
||||
<div className="flex items-center gap-2">
|
||||
<IconButton icon="i-ph:arrow-clockwise" onClick={reloadPreview} />
|
||||
<IconButton
|
||||
icon="i-ph:selection"
|
||||
onClick={() => setIsSelectionMode(!isSelectionMode)}
|
||||
className={isSelectionMode ? 'bg-bolt-elements-background-depth-3' : ''}
|
||||
/>
|
||||
<div className="flex items-center gap-1 flex-grow bg-bolt-elements-preview-addressBar-background border border-bolt-elements-borderColor text-bolt-elements-preview-addressBar-text rounded-full px-3 py-1 text-sm hover:bg-bolt-elements-preview-addressBar-backgroundHover hover:focus-within:bg-bolt-elements-preview-addressBar-backgroundActive focus-within:bg-bolt-elements-preview-addressBar-backgroundActive focus-within-border-bolt-elements-borderColorActive focus-within:text-bolt-elements-preview-addressBar-textActive">
|
||||
</div>
|
||||
|
||||
<div className="flex-grow flex items-center gap-1 bg-bolt-elements-preview-addressBar-background border border-bolt-elements-borderColor text-bolt-elements-preview-addressBar-text rounded-full px-3 py-1 text-sm hover:bg-bolt-elements-preview-addressBar-backgroundHover hover:focus-within:bg-bolt-elements-preview-addressBar-backgroundActive focus-within:bg-bolt-elements-preview-addressBar-backgroundActive focus-within-border-bolt-elements-borderColorActive focus-within:text-bolt-elements-preview-addressBar-textActive">
|
||||
<input
|
||||
title="URL"
|
||||
ref={inputRef}
|
||||
@ -278,6 +282,7 @@ export const Preview = memo(() => {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2">
|
||||
{previews.length > 1 && (
|
||||
<PortDropdown
|
||||
activePreviewIndex={activePreviewIndex}
|
||||
@ -307,7 +312,7 @@ export const Preview = memo(() => {
|
||||
title={isFullscreen ? 'Exit Full Screen' : 'Full Screen'}
|
||||
/>
|
||||
|
||||
<div className="relative">
|
||||
<div className="flex items-center relative">
|
||||
<IconButton
|
||||
icon="i-ph:arrow-square-out"
|
||||
onClick={() => openInNewWindow(selectedWindowSize)}
|
||||
@ -323,18 +328,28 @@ export const Preview = memo(() => {
|
||||
{isWindowSizeDropdownOpen && (
|
||||
<>
|
||||
<div className="fixed inset-0 z-50" onClick={() => setIsWindowSizeDropdownOpen(false)} />
|
||||
<div className="absolute right-0 top-full mt-1 z-50 bg-bolt-elements-background-depth-2 rounded-lg shadow-lg border border-bolt-elements-borderColor overflow-hidden">
|
||||
<div className="absolute right-0 top-full mt-2 z-50 min-w-[240px] bg-bolt-elements-background-depth-2 rounded-xl shadow-2xl border border-bolt-elements-borderColor overflow-hidden">
|
||||
{WINDOW_SIZES.map((size) => (
|
||||
<button
|
||||
key={size.name}
|
||||
className="w-full px-4 py-2 text-left hover:bg-bolt-elements-background-depth-3 text-sm whitespace-nowrap"
|
||||
className="w-full px-4 py-3.5 text-left hover:bg-bolt-elements-item-backgroundAccent text-bolt-elements-textSecondary text-sm whitespace-nowrap transition-all duration-200 flex items-center gap-3 group"
|
||||
onClick={() => {
|
||||
setSelectedWindowSize(size);
|
||||
setIsWindowSizeDropdownOpen(false);
|
||||
openInNewWindow(size);
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className={`${size.icon} w-5 h-5 text-bolt-elements-textSecondary group-hover:text-bolt-elements-item-contentAccent transition-colors duration-200`}
|
||||
/>
|
||||
<div className="flex flex-col">
|
||||
<span className="font-medium text-bolt-elements-textPrimary group-hover:text-bolt-elements-item-contentAccent transition-colors duration-200">
|
||||
{size.name}
|
||||
</span>
|
||||
<span className="text-xs text-bolt-elements-textSecondary group-hover:text-bolt-elements-textPrimary transition-colors duration-200">
|
||||
{size.width} × {size.height}
|
||||
</span>
|
||||
</div>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
@ -342,6 +357,7 @@ export const Preview = memo(() => {
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex-1 border-t border-bolt-elements-borderColor flex justify-center items-center overflow-auto">
|
||||
<div
|
||||
|
||||
@ -11,6 +11,7 @@ export default class GithubProvider extends BaseProvider {
|
||||
config = {
|
||||
apiTokenKey: 'GITHUB_API_KEY',
|
||||
};
|
||||
|
||||
// find more in https://github.com/marketplace?type=models
|
||||
staticModels: ModelInfo[] = [
|
||||
{ name: 'gpt-4o', label: 'GPT-4o', provider: 'Github', maxTokenAllowed: 8000 },
|
||||
|
||||
Loading…
Reference in New Issue
Block a user