Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ Add this code to your page:
- [Dev Tools](https://livecodes.io/docs/features/tools-pane) ([console](https://livecodes.io/docs/features/console), [compiled code viewer](https://livecodes.io/docs/features/compiled-code), [test runner](https://livecodes.io/docs/features/tests))
- [Code formatting](https://livecodes.io/docs/features/code-format)
- [Intellisense](https://livecodes.io/docs/features/intellisense)
- [AI Code Assistant 🪄](https://livecodes.io/docs/features/ai)
- [Lite mode](https://livecodes.io/docs/features/lite)
- [Read-only mode](https://livecodes.io/docs/features/read-only)
- [Broadcast](https://livecodes.io/docs/features/broadcast)
Expand Down Expand Up @@ -270,11 +269,6 @@ LiveCodes uses services that are generously provided by:
</img></a><br /><br />
</p>
<p>
<a href="https://windsurf.com/" target="_blank" title="Windsurf">
<img alt="Windsurf" width="200" src="https://dev.livecodes.io/docs/img/credits/windsurf.svg">
</img></a><br /><br />
</p>
<p>
<a href="https://m.do.co/c/fb8c00b45b91" target="_blank" title="DigitalOcean">
<img alt="DigitalOcean" width="200" src="https://dev.livecodes.io/docs/img/credits/digital-ocean.svg">
</img></a><br /><br />
Expand Down Expand Up @@ -310,11 +304,6 @@ LiveCodes uses services that are generously provided by:
</img></a><br /><br />
</p>
<p>
<a href="https://bundlewatch.io/" target="_blank" title="BundleWatch">
<img alt="BundleWatch" width="200" src="https://dev.livecodes.io/docs/img/credits/bundlewatch.svg">
</img></a><br /><br />
</p>
<p>
<a href="https://www.browserstack.com/" target="_blank" title="BrowserStack">
<img alt="BrowserStack" width="200" src="https://dev.livecodes.io/docs/img/credits/browserstack.svg">
</img></a><br /><br />
Expand Down
3 changes: 2 additions & 1 deletion docs/docs/configuration/configuration-object.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -451,14 +451,15 @@ Sets result page [zoom level](../features/result.mdx#result-page-zoom).
## User Settings

These are properties that define the [user settings](./../features/user-settings.mdx), including [editor settings](../features/editor-settings.mdx).

{/*
### `enableAI`

Type: [`boolean`](../api/interfaces/Config.md#enableai)

Default: `false`

If `true`, [AI code assistant](../features/ai.mdx) is enabled.
*/}

### `autoupdate`

Expand Down
18 changes: 0 additions & 18 deletions docs/docs/credits.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,6 @@ LiveCodes uses services that are generously provided by:
></img>
</a>
</p>
<p>
<a href="https://windsurf.com/" target="_blank" title="Windsurf">
<img
alt="Windsurf"
width="200"
src="/docs/img/credits/windsurf.svg"
></img>
</a>
</p>
<p>
<a href="https://m.do.co/c/fb8c00b45b91" target="_blank" title="DigitalOcean">
<img
Expand Down Expand Up @@ -122,15 +113,6 @@ LiveCodes uses services that are generously provided by:
></img>
</a>
</p>
<p>
<a href="https://bundlewatch.io/" target="_blank" title="BundleWatch">
<img
alt="BundleWatch"
width="200"
src="/docs/img/credits/bundlewatch.svg"
></img>
</a>
</p>
<p>
<a href="https://www.browserstack.com/" target="_blank" title="BrowserStack">
<img
Expand Down
74 changes: 0 additions & 74 deletions docs/docs/features/ai.mdx

This file was deleted.

2 changes: 1 addition & 1 deletion docs/docs/features/command-menu.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ It can be triggered from the keyboard by pressing <kbd>Ctrl</kbd> + <kbd>K</kbd>
![Open Command Menu from UI](../../static/img/screenshots/command-menu-1.jpg)

The available commands cover a wide range of functionality, like showing and hiding UI elements (e.g. different editors, the [result page](./result.mdx), [console](./console.mdx), [compiled code viewer](./compiled-code.mdx), and [tests](./tests.mdx)), changing [languages](../languages), loading [starter templates](./templates.mdx), opening different screens (e.g. new project, opening saved projects, [import](./import.mdx), [embeds](./embeds.mdx), [deploy](./deploy.mdx), [share](./share.mdx) and more).
In addition many commands can be executed from the command menu, such as running code, formatting code, changing settings (e.g. autorun, autosave, [AI code assistant](./ai.mdx), changing [themes](./themes.mdx), [editor settings](./editor-settings.mdx), and more).
In addition many commands can be executed from the command menu, such as running code, formatting code, changing settings (e.g. autorun, autosave, changing [themes](./themes.mdx), [editor settings](./editor-settings.mdx), and more).

![LiveCodes Command Menu](../../static/img/screenshots/command-menu-2.jpg)

Expand Down
3 changes: 2 additions & 1 deletion docs/docs/features/editor-settings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ import RunInLiveCodes from '../../src/components/RunInLiveCodes.tsx';
A preview code editor is displayed to preview the settings in real time.

The settings selected in the `Editor Settings` screen are saved locally to [user settings](./user-settings.mdx) and are used subsequently. These include:

{/*
### Enable AI Code Assistant

Enables the [AI code assistant](./ai.mdx). (Free and no account required)
*/}

### Code Editor

Expand Down
4 changes: 0 additions & 4 deletions docs/docs/features/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ In this page, a quick overview of the important features are presented. A more d

The default code editor is the powerful editor that powers [VS Code](https://code.visualstudio.com/), featuring code-completion, go-to-definition, multi-cursor support and other powerful features you got used to. The editor is very [customizable](./editor-settings.mdx). It supports [keyboard shortcuts](./keyboard-shortcuts.mdx), [code formatting](./code-format.mdx), [Emmet abbreviations](./editor-settings.mdx#emmet) and even [Vim and Emacs bindings](./editor-settings.mdx#editor-modes).

## AI Code Assistant

LiveCodes supports AI-powered code completion, totally for **free**, using [Windsurf](https://windsurf.com/). No account or tokens required. Enable from [editor settings](./ai.mdx#ui) and enjoy the magic!

## Mobile-friendly

The responsive layout allows working on devices with different screen sizes. On mobile, a lighter-weight touch-friendly code editor (CodeMirror 6) is used, so that you can experiment your ideas on the go.
Expand Down
8 changes: 4 additions & 4 deletions docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ const config: Config = {
label: 'Import...',
href: 'pathname:///../?screen=import',
},
{
label: 'AI Code Assistant 🪄',
to: '/features/ai',
},
// {
// label: 'AI Code Assistant 🪄',
// to: '/features/ai',
// },
{
label: 'Bookmarklet',
to: '/bookmarklet',
Expand Down
2 changes: 1 addition & 1 deletion docs/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const sidebars: SidebarsConfig = {
'features/tests',
'features/module-resolution',
'features/intellisense',
'features/ai',
// 'features/ai',
'features/code-format',
'features/command-menu',
'features/keyboard-shortcuts',
Expand Down
8 changes: 4 additions & 4 deletions docs/src/components/HomepageCarousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ const screenshots = [
label: 'IntelliSense (autocomplete)',
url: './img/screenshots/intellisense-3.jpg',
},
{
label: 'AI Code Assistant',
url: './img/screenshots/ai-1.jpg',
},
// {
// label: 'AI Code Assistant',
// url: './img/screenshots/ai-1.jpg',
// },
{
label: 'Console for quick inspection',
url: './img/screenshots/console-1.jpg',
Expand Down
28 changes: 14 additions & 14 deletions docs/src/components/HomepageFeatures.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,20 @@ const FeatureList2: FeatureItem[] = [
),
},

{
title: 'AI Code Assistant',
image: './img/magic-wand.svg',
description: (
<>
Leverage the <Link to="./features/ai">power of AI</Link> to help you write/learn code, using
the <strong>free</strong> Copilot alternative. It understands the context of your code and
comments to generate suggestions. It has a wide range of language support, and it works
everywhere (in the <Link to="./getting-started#standalone-app">standalone app</Link>,{' '}
<Link to="./features/embeds">embedded playgrounds</Link> and{' '}
<Link to="./features/self-hosting">self-hosted</Link> apps).
</>
),
},
// {
// title: 'AI Code Assistant',
// image: './img/magic-wand.svg',
// description: (
// <>
// Leverage the <Link to="./features/ai">power of AI</Link> to help you write/learn code, using
// the <strong>free</strong> Copilot alternative. It understands the context of your code and
// comments to generate suggestions. It has a wide range of language support, and it works
// everywhere (in the <Link to="./getting-started#standalone-app">standalone app</Link>,{' '}
// <Link to="./features/embeds">embedded playgrounds</Link> and{' '}
// <Link to="./features/self-hosting">self-hosted</Link> apps).
// </>
// ),
// },
Comment on lines +83 to +96
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Layout imbalance: FeatureList2 now has only 2 items in a 3-column grid.

With the AI Code Assistant card removed, FeatureList2 renders 2 items using col col--4 (33% width each), leaving a noticeable gap. All other feature lists have 3 items. Consider either adding a replacement feature card or adjusting the column class for this section (e.g., col col--6) so the two remaining cards are centered and evenly distributed.

🤖 Prompt for AI Agents
In `@docs/src/components/HomepageFeatures.tsx` around lines 83 - 96, The two-item
imbalance in FeatureList2 is caused by removing the AI Code Assistant card while
the JSX still renders each item with className="col col--4"; update the
FeatureList2 rendering so the two cards occupy half width each (change className
to "col col--6" when FeatureList2.length === 2) or restore/add a replacement
entry to the FeatureList2 array so it has three items; locate the FeatureList2
constant and the mapping that renders items (look for FeatureList2 and the JSX
that assigns className="col col--4") and implement the conditional class or add
the new feature card.

{
title: 'Mobile-Friendly',
image: './img/responsive.svg',
Expand Down
36 changes: 18 additions & 18 deletions src/livecodes/UI/command-menu-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -600,24 +600,24 @@ export const getCommandMenuActions = ({
UI.getEditorSettingsLink()?.click();
},
},
{
id: 'Enable AI Code Assistant',
title: window.deps.translateString('commandMenu.enableAI', 'Enable AI Code Assistant'),
content: getContent('Enable AI Code Assistant'),
mdIcon: 'toggle_on',
handler: () => {
changeEditorSettings({ enableAI: true });
},
},
{
id: 'Disable AI Code Assistant',
title: window.deps.translateString('commandMenu.disableAI', 'Disable AI Code Assistant'),
content: getContent('Disable AI Code Assistant'),
mdIcon: 'toggle_off',
handler: () => {
changeEditorSettings({ enableAI: false });
},
},
// {
// id: 'Enable AI Code Assistant',
// title: window.deps.translateString('commandMenu.enableAI', 'Enable AI Code Assistant'),
// content: getContent('Enable AI Code Assistant'),
// mdIcon: 'toggle_on',
// handler: () => {
// changeEditorSettings({ enableAI: true });
// },
// },
// {
// id: 'Disable AI Code Assistant',
// title: window.deps.translateString('commandMenu.disableAI', 'Disable AI Code Assistant'),
// content: getContent('Disable AI Code Assistant'),
// mdIcon: 'toggle_off',
// handler: () => {
// changeEditorSettings({ enableAI: false });
// },
// },
{
id: 'Enable Auto Update',
title: window.deps.translateString('commandMenu.enableAutoUpdate', 'Enable Auto Update'),
Expand Down
46 changes: 23 additions & 23 deletions src/livecodes/UI/editor-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,23 +70,23 @@ export const createEditorSettingsUI = async ({
note?: string;
}
const formFields: FormField[] = [
{
title: window.deps.translateString(
'editorSettings.enableAI.heading',
'Enable AI Code Assistant',
),
name: 'enableAI',
options: [{ value: 'true' }],
help: `${process.env.DOCS_BASE_URL}features/ai`,
note: window.deps.translateString(
'editorSettings.enableAI.note',
'Powered by <a href="https://windsurf.com/" rel="noopener noreferrer" target="_blank"><img id="windsurf-logo" src="{{baseUrl}}assets/images/windsurf.svg" style="height: 3em; translate: 0 40%; margin-top: -2em;" alt="Windsurf" /></a>',
{
isHTML: true,
baseUrl,
},
),
},
// {
// title: window.deps.translateString(
// 'editorSettings.enableAI.heading',
// 'Enable AI Code Assistant',
// ),
// name: 'enableAI',
// options: [{ value: 'true' }],
// help: `${process.env.DOCS_BASE_URL}features/ai`,
// note: window.deps.translateString(
// 'editorSettings.enableAI.note',
// 'Powered by <a href="https://windsurf.com/" rel="noopener noreferrer" target="_blank"><img id="windsurf-logo" src="{{baseUrl}}assets/images/windsurf.svg" style="height: 3em; translate: 0 40%; margin-top: -2em;" alt="Windsurf" /></a>',
// {
// isHTML: true,
// baseUrl,
// },
// ),
// },
{
title: window.deps.translateString('editorSettings.editor.heading', 'Editor'),
name: 'editor',
Expand Down Expand Up @@ -532,12 +532,12 @@ export const createEditorSettingsUI = async ({
});
}

const windsurfLogo = document.getElementById('windsurf-logo')!;
if (formData.theme === 'light') {
windsurfLogo.style.filter = 'invert(1)';
} else {
windsurfLogo.style.filter = 'unset';
}
// const windsurfLogo = document.getElementById('windsurf-logo')!;
// if (formData.theme === 'light') {
// windsurfLogo.style.filter = 'invert(1)';
// } else {
// windsurfLogo.style.filter = 'unset';
// }

if (!init) {
deps.changeSettings(formData);
Expand Down
2 changes: 1 addition & 1 deletion src/livecodes/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const getEditorConfig = (config: Config | UserConfig): EditorConfig =>
closeBrackets: config.closeBrackets,
foldRegions: config.foldRegions,
emmet: config.emmet,
enableAI: config.enableAI,
// enableAI: config.enableAI,
editorMode: config.editorMode,
});

Expand Down
2 changes: 1 addition & 1 deletion src/livecodes/config/default-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const defaultConfig: Config = {
singleQuote: false,
trailingComma: true,
emmet: true,
enableAI: false,
// enableAI: false,
editorMode: undefined,
version: process.env.VERSION as string,
};
2 changes: 1 addition & 1 deletion src/livecodes/config/validate-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export const validateConfig = (config: Partial<Config>): Partial<Config> => {
...(is(config.singleQuote, 'boolean') ? { singleQuote: config.singleQuote } : {}),
...(is(config.trailingComma, 'boolean') ? { trailingComma: config.trailingComma } : {}),
...(is(config.emmet, 'boolean') ? { emmet: config.emmet } : {}),
...(is(config.enableAI, 'boolean') ? { enableAI: config.enableAI } : {}),
// ...(is(config.enableAI, 'boolean') ? { enableAI: config.enableAI } : {}),
...(includes(editorModes, config.editorMode) ? { editorMode: config.editorMode } : {}),
...(is(config.imports, 'object') ? { imports: config.imports } : {}),
...(is(config.types, 'object') ? { types: config.types } : {}),
Expand Down
Loading