diff --git a/README.md b/README.md index a08cbf5dd..c2f77baff 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ 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) diff --git a/docs/docs/features/ai.md b/docs/docs/features/ai.md new file mode 100644 index 000000000..02a59c8ea --- /dev/null +++ b/docs/docs/features/ai.md @@ -0,0 +1,37 @@ +# AI Code Assistant 🪄 + +LiveCodes supports AI-powered code completion, totally for **free**, using [Codeium](https://codeium.com/), the ultrafast Copilot alternative. + +The large generative machine learning model is capable of understanding the context of your code and comments in order to generate suggestions on what you might want to type next. + +It has a wide range of language support, and it works everywhere (in the [standalone app](../getting-started#standalone-app), [embedded playgrounds](./embeds) and [self-hosted](./self-hosting) apps). + +## Examples: + +JavaScript: + + + +Python: + + + +## Instructions + +1. Install [Codeium chrome extension](https://codeium.com/chrome_tutorial). +2. Login to Codeium. +3. Enjoy the magic! + +Currently, only [Monaco editor](./editor-settings.md#code-editor) on desktop Chrome browser is supported. Wider editor and browser support is planned. + +:::caution Note + +Please note that codeium extension sends your code to their servers for code completion. However, your code is not used for training their model. Check codeium [FAQ](https://codeium.com/faq#Will-Codeium-regurgitate-private-code%3F) and [privacy policy](https://codeium.com/privacy-policy) for more details. + +::: diff --git a/docs/docs/features/index.md b/docs/docs/features/index.md index ccbc0c8c0..a44da20be 100644 --- a/docs/docs/features/index.md +++ b/docs/docs/features/index.md @@ -16,6 +16,10 @@ 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.md). It supports [keyboard shortcuts](./keyboard-shortcuts.md), [code formatting](./code-format.md), [Emmet abbreviations](./editor-settings#emmet) and even [Vim and Emacs bindings](./editor-settings.md#editor-modes). +## AI Code Assistant + +LiveCodes supports AI-powered code completion, totally for **free**, using [Codeium](https://codeium.com/), the ultrafast Copilot alternative. Install the [Codeium chrome extension](https://codeium.com/chrome_tutorial) 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. diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index d0659cff0..7f2d90f02 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -144,6 +144,10 @@ const config = { label: 'Import...', href: 'pathname:///../?screen=import', }, + { + label: 'AI Code Assistant 🪄', + to: '/features/ai', + }, { label: 'Bookmarklet', to: '/bookmarklet', diff --git a/docs/sidebars.js b/docs/sidebars.js index 82b7edfbf..f03bf65ef 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -33,6 +33,7 @@ const sidebars = { 'features/tests', 'features/module-resolution', 'features/intellisense', + 'features/ai', 'features/code-format', 'features/keyboard-shortcuts', 'features/user-settings', diff --git a/docs/src/components/HomepageFeatures.tsx b/docs/src/components/HomepageFeatures.tsx index df334a88a..0f7e99db0 100644 --- a/docs/src/components/HomepageFeatures.tsx +++ b/docs/src/components/HomepageFeatures.tsx @@ -73,9 +73,12 @@ const FeatureList2: FeatureItem[] = [ image: './img/star.svg', description: ( <> - Use the standalone app for quick prototyping, testing new ideas or learning a new - framework/language. The app remembers your settings. Organize your projects and assets. - Share code with friends. Deploy projects to public URLs. + Use the standalone app for quick + prototyping, testing new ideas or learning a new framework/language. The app remembers your{' '} + settings. Organize your{' '} + projects and{' '} + assets. Share code + with friends. Deploy projects to public URLs. ), }, @@ -126,14 +129,16 @@ const FeatureList3: FeatureItem[] = [ ), }, { - title: 'Focused on Privacy', - image: './img/data-privacy.svg', + title: 'AI Code Assistant', + image: './img/magic-wand.svg', description: ( <> - Projects are private by default. The code you write in LiveCodes never leaves your device, - unless you choose to share, export or sync it. User data is stored in the browser. User code - runs in a sandboxed environment. Security is taken - seriously. + Leverage the power of AI to help you write/learn code, using + the free 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 standalone app,{' '} + embedded playgrounds and{' '} + self-hosted apps). ), }, @@ -154,6 +159,18 @@ const FeatureList3: FeatureItem[] = [ ]; const FeatureList4: FeatureItem[] = [ + { + title: 'Focused on Privacy', + image: './img/data-privacy.svg', + description: ( + <> + Projects are private by default. The code you write in LiveCodes never leaves your device, + unless you choose to share, export or sync it. User data is stored in the browser. User code + runs in a sandboxed environment. Security is taken + seriously. + + ), + }, { title: 'Free and Open-Source', image: './img/oss.svg', diff --git a/docs/static/img/magic-wand.svg b/docs/static/img/magic-wand.svg new file mode 100644 index 000000000..3021d4888 --- /dev/null +++ b/docs/static/img/magic-wand.svg @@ -0,0 +1 @@ + diff --git a/docs/static/vid/LiveCodes-AI-py.mp4 b/docs/static/vid/LiveCodes-AI-py.mp4 new file mode 100644 index 000000000..85df4b93e Binary files /dev/null and b/docs/static/vid/LiveCodes-AI-py.mp4 differ diff --git a/docs/static/vid/LiveCodes-AI-py.webm b/docs/static/vid/LiveCodes-AI-py.webm new file mode 100644 index 000000000..55bbddcd8 Binary files /dev/null and b/docs/static/vid/LiveCodes-AI-py.webm differ diff --git a/docs/static/vid/LiveCodes-AI.mp4 b/docs/static/vid/LiveCodes-AI.mp4 new file mode 100644 index 000000000..61c525721 Binary files /dev/null and b/docs/static/vid/LiveCodes-AI.mp4 differ diff --git a/docs/static/vid/LiveCodes-AI.webm b/docs/static/vid/LiveCodes-AI.webm new file mode 100644 index 000000000..b2f4feed7 Binary files /dev/null and b/docs/static/vid/LiveCodes-AI.webm differ diff --git a/e2e/specs/import.spec.ts b/e2e/specs/import.spec.ts index cfa5d2ca6..182292d6a 100644 --- a/e2e/specs/import.spec.ts +++ b/e2e/specs/import.spec.ts @@ -12,7 +12,7 @@ const sources = { 'GitLab snippet': 'https://gitlab.com/-/snippets/2199319', 'GitLab dir': 'https://gitlab.com/hatemhosny/typescript-demo-for-testing-import-/-/tree/gh-pages/src', - JsBin: 'https://jsbin.com/mikunebofa/edit?html,css,js,output', + JsBin: 'https://jsbin.com/jikojak/edit?html,css,js,output', }; const githubRepo = 'https://github.com/hatemhosny/typescript-demo-for-testing-import-'; diff --git a/scripts/build.js b/scripts/build.js index 4559ba031..9b3c72109 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -78,6 +78,10 @@ const prepareDir = async () => { path.resolve(__dirname + '/../src/index.html'), path.resolve(outDir + '/index.html'), ); + await fs.promises.copyFile( + path.resolve(__dirname + '/../src/livecodes/html/app-base.html'), + path.resolve(outDir + '/livecodes/app.html'), + ); }; try { diff --git a/src/livecodes/html/app-base.html b/src/livecodes/html/app-base.html new file mode 100644 index 000000000..e299c55f4 --- /dev/null +++ b/src/livecodes/html/app-base.html @@ -0,0 +1,22 @@ + + + + + + + LiveCodes + + + + diff --git a/src/livecodes/html/app.html b/src/livecodes/html/app.html index a9ee5a35a..617a29f87 100644 --- a/src/livecodes/html/app.html +++ b/src/livecodes/html/app.html @@ -3,6 +3,7 @@ + LiveCodes