-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve merge conflicts and expand layout section when flex or grid i…
…s selected
- Loading branch information
Showing
36 changed files
with
909 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import type { RequirementsResponse } from '@onlook/models/requirements'; | ||
import { execSync } from 'child_process'; | ||
|
||
export function checkSystemRequirements(): RequirementsResponse { | ||
return { | ||
git: checkGitInstallation(), | ||
node: checkNodeInstallation(), | ||
}; | ||
} | ||
|
||
// Note: Test by passing empty PATH | ||
// execSync('git --version', { stdio: 'ignore', env: { ...process.env, PATH: '' }}); | ||
|
||
function checkGitInstallation(): boolean { | ||
try { | ||
execSync('git --version', { stdio: 'ignore' }); | ||
return true; | ||
} catch (error) { | ||
console.error('Git check failed:', error); | ||
return false; | ||
} | ||
} | ||
|
||
function checkNodeInstallation(): boolean { | ||
try { | ||
execSync('node --version', { stdio: 'ignore' }); | ||
return true; | ||
} catch (error) { | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import dunesDark from '@/assets/dunes-login-dark.png'; | ||
import dunesLight from '@/assets/dunes-login-light.png'; | ||
|
||
export function Dunes() { | ||
return ( | ||
<div className="hidden w-full lg:block md:block m-6"> | ||
<img | ||
className="w-full h-full object-cover rounded-xl hidden dark:flex" | ||
src={dunesDark} | ||
alt="Onlook dunes dark" | ||
/> | ||
<img | ||
className="w-full h-full object-cover rounded-xl flex dark:hidden" | ||
src={dunesLight} | ||
alt="Onlook dunes light" | ||
/> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { MainChannels } from '@onlook/models/constants'; | ||
import type { RequirementsResponse } from '@onlook/models/requirements'; | ||
import { makeAutoObservable } from 'mobx'; | ||
import { invokeMainChannel } from '../utils'; | ||
|
||
export class RequirementsManager { | ||
nodeEnabled: boolean | null = null; | ||
gitEnabled: boolean | null = null; | ||
interval: Timer | null = null; | ||
|
||
constructor() { | ||
makeAutoObservable(this); | ||
this.listen(); | ||
} | ||
|
||
get loaded() { | ||
return this.nodeEnabled !== null && this.gitEnabled !== null; | ||
} | ||
|
||
get requirementsMet() { | ||
return this.nodeEnabled && this.gitEnabled; | ||
} | ||
|
||
async listen() { | ||
this.checkRequirements(); | ||
this.interval = setInterval(() => { | ||
this.checkRequirements(); | ||
}, 3000); | ||
} | ||
|
||
async checkRequirements() { | ||
if (this.requirementsMet && this.interval) { | ||
clearInterval(this.interval); | ||
return; | ||
} | ||
const requirements: RequirementsResponse | null = await invokeMainChannel( | ||
MainChannels.CHECK_REQUIREMENTS, | ||
); | ||
|
||
if (!requirements) { | ||
console.error('Failed to check requirements'); | ||
return; | ||
} | ||
|
||
this.nodeEnabled = requirements.node; | ||
this.gitEnabled = requirements.git; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.