Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
41bb732
add multi file config
hatemhosny Nov 8, 2025
86dbd99
add multi-file UI
hatemhosny Nov 8, 2025
d48fea1
multi-file result page
hatemhosny Nov 8, 2025
cdc658a
scroll file tabs
hatemhosny Nov 8, 2025
a594166
add file
hatemhosny Nov 8, 2025
9ca7c30
allow `editorId` to have filename
hatemhosny Nov 8, 2025
07fee72
feat(Config): rename `Editor.hideTitle` to `Editor.hidden`
hatemhosny Nov 8, 2025
bc35c7b
add multi-file support in language specs
hatemhosny Nov 8, 2025
f7274d9
add file
hatemhosny Nov 8, 2025
c4b3983
fix types
hatemhosny Nov 9, 2025
2dc05ab
fix types
hatemhosny Nov 9, 2025
888bf05
fix jsx on typescript
hatemhosny Nov 9, 2025
e9efb1b
Merge branch 'develop' into multi-file-support
hatemhosny Dec 10, 2025
c14b948
Merge branch 'develop' into multi-file-support
hatemhosny Dec 30, 2025
3cad427
fix adding new file tab
hatemhosny Dec 31, 2025
cc3358f
Merge branch 'develop' into multi-file-support
hatemhosny Jan 3, 2026
44227d6
add file to config
hatemhosny Jan 3, 2026
49f7c94
validate file name
hatemhosny Jan 3, 2026
92b9d04
fix file types
hatemhosny Jan 3, 2026
2b73456
add responsive styles for multi file tabs
hatemhosny Jan 4, 2026
1b6bc9d
Merge branch 'develop' into multi-file-support
hatemhosny Jan 4, 2026
8570d09
Merge branch 'develop' into multi-file-support
hatemhosny Jan 4, 2026
806f055
improve file tab UI
hatemhosny Jan 5, 2026
a2c9d3a
set saved status for file changes
hatemhosny Jan 5, 2026
3048062
rename file on click outside tab
hatemhosny Jan 6, 2026
9648803
fix adding new file
hatemhosny Jan 8, 2026
7ed515c
set projectDir
hatemhosny Jan 8, 2026
999b937
fix monco formatting
hatemhosny Jan 8, 2026
fa6a278
fix showEditor
hatemhosny Jan 8, 2026
e79cc08
support multi-file in cache
hatemhosny Jan 8, 2026
1614cbf
load types for npm modules in multi-file projects
hatemhosny Jan 8, 2026
0639550
load TS types in codemirror in multi-file
hatemhosny Jan 9, 2026
5282bb5
show compiled code in multi-file projects
hatemhosny Jan 9, 2026
d8bdedf
fix style imports
hatemhosny Jan 9, 2026
f63a4a0
allow exporting multi-file projects
hatemhosny Jan 9, 2026
0def833
add multifile templates
hatemhosny Jan 10, 2026
a6ba81b
improve multifile tab styles
hatemhosny Jan 10, 2026
8c12638
fix undefined activeEditor
hatemhosny Jan 10, 2026
c4de3d9
show loading message in modal when loading templates
hatemhosny Jan 10, 2026
d141e4f
fix multifile stylesheet import
hatemhosny Jan 10, 2026
70477a1
allow importing images
hatemhosny Jan 10, 2026
937674a
handle changing content for new files
hatemhosny Jan 10, 2026
2784553
enable "Go to definition" in monaco
hatemhosny Jan 10, 2026
29a57dd
fix deleting file (remove tab)
hatemhosny Jan 10, 2026
2967e1d
fix undefined language
hatemhosny Jan 10, 2026
3896978
fix jsx
hatemhosny Jan 10, 2026
a43b3a8
fix types
hatemhosny Jan 11, 2026
79eea5b
fix relative imports with directories
hatemhosny Jan 11, 2026
4abe4c2
fix recursive css imports
hatemhosny Jan 11, 2026
a41e37a
hide irrelevant UI elements for multifile
hatemhosny Jan 11, 2026
e520e35
use replaceStyleImports for multifile result
hatemhosny Jan 11, 2026
73b9203
fix css and image imports
hatemhosny Jan 13, 2026
736ac63
add multifile react template
hatemhosny Jan 14, 2026
3b09d16
replace all file imports once
hatemhosny Jan 14, 2026
5d8c1c3
add multifile support for vue and svelte
hatemhosny Jan 14, 2026
6060d62
enable relative svg imports in multifile svelte
hatemhosny Jan 14, 2026
f381eef
add multifile vue and svelte templates
hatemhosny Jan 14, 2026
b058a3c
add multifile templates
hatemhosny Jan 14, 2026
ffa2e2b
fix saved status when loading multifile projects
hatemhosny Jan 16, 2026
898ff8f
feat(Config): add `fileLanguages` config option
hatemhosny Jan 16, 2026
a570e8f
fixed-height modals
hatemhosny Jan 16, 2026
d3edaff
edit templates
hatemhosny Jan 16, 2026
13ddd95
remove editor project dir
hatemhosny Jan 16, 2026
409b18e
add getFileExtension utility
hatemhosny Jan 16, 2026
0224a2b
edit templates
hatemhosny Jan 16, 2026
4c0889d
fix go to definition
hatemhosny Jan 16, 2026
0749d5d
fix multifile relative imports
hatemhosny Jan 16, 2026
08c4393
enable tailwind in multifile projects
hatemhosny Jan 18, 2026
cc36b00
add css modules support in multifile projects
hatemhosny Jan 18, 2026
649f7a5
drag and drop file tabs to re-order
hatemhosny Jan 19, 2026
d14cbf2
load monaco language before creating the model
hatemhosny Jan 20, 2026
8b3a25f
add editor tab scroll buttons
hatemhosny Jan 20, 2026
fa66765
fix multifile tab styles
hatemhosny Jan 21, 2026
39c619a
fixes
hatemhosny Jan 21, 2026
ef13860
feat(Compilers): add support for json/json5
hatemhosny Jan 23, 2026
224c694
fix handleChangeContent
hatemhosny Jan 23, 2026
0350cfc
add `lockFiles` config option
hatemhosny Jan 24, 2026
b58be32
allow running tests in multifile projects
hatemhosny Jan 25, 2026
0d7a343
import as multifile projects
hatemhosny Jan 26, 2026
453a8c4
add support for public folder in multifile projects
hatemhosny Jan 27, 2026
a3874d1
handle common dir
hatemhosny Jan 28, 2026
1adb544
fix importing files from github and gitlab dir
hatemhosny Jan 28, 2026
434fbe4
allow using binary files (e.g. images)
hatemhosny Jan 29, 2026
84c31bd
handle svg <use>
hatemhosny Jan 30, 2026
64cf310
improve loading files with drag and drop
hatemhosny Jan 30, 2026
b514c8d
fix replacing URLs in compiled files
hatemhosny Jan 30, 2026
4baeded
binary file editor
hatemhosny Jan 31, 2026
13b19c4
fix importing binary files
hatemhosny Jan 31, 2026
621c3d5
edit multi file template thumbnail styles
hatemhosny Jan 31, 2026
2bdb953
add basic multifile template
hatemhosny Jan 31, 2026
01ba69f
edit styles
hatemhosny Jan 31, 2026
1371e73
export binary files
hatemhosny Jan 31, 2026
8e50663
copy binary files as data urls
hatemhosny Jan 31, 2026
2b2c341
improve vue support in monaco
hatemhosny Jan 31, 2026
3a24106
load monaco languages from CDN
hatemhosny Jan 31, 2026
707af2a
Merge branch 'develop' into multi-file-support
hatemhosny Jan 31, 2026
5d39151
enable search in multifile templates
hatemhosny Jan 31, 2026
73a4ce8
cache result page output
hatemhosny Jan 31, 2026
108a1b7
fix
hatemhosny Jan 31, 2026
5fe1689
do not fail on docs broken links for now
hatemhosny Jan 31, 2026
a30451f
format
hatemhosny Jan 31, 2026
f7682da
fix img url
hatemhosny Jan 31, 2026
75ca515
do not replaceSFCImports in multifile projects
hatemhosny Feb 1, 2026
a6a6dca
fix svg use
hatemhosny Feb 1, 2026
709290b
fix config with empty files
hatemhosny Feb 1, 2026
fc47415
format
hatemhosny Feb 1, 2026
59bea01
fix tab scrollIntoView
hatemhosny Feb 1, 2026
0868399
select active file in params
hatemhosny Feb 1, 2026
2333604
support multifile projects in broadcast
hatemhosny Feb 3, 2026
390994c
resolve type files for vue compiler
hatemhosny Feb 3, 2026
3822251
get types in compiler
hatemhosny Feb 5, 2026
846e3c4
enable using defineProps<TYPE> in vue
hatemhosny Feb 7, 2026
7d74d1e
fix replaceImports
hatemhosny Feb 8, 2026
40c9de1
Merge branch 'develop' into multi-file-support
hatemhosny Feb 9, 2026
4715d48
truncate long tab titles while keeping filename visible
hatemhosny Feb 10, 2026
239b9b0
fix type
hatemhosny Feb 10, 2026
33ba8d7
fix handling content change
hatemhosny Feb 10, 2026
3361b7d
add `fileLanguages` to `Config.customSettings`
hatemhosny Feb 11, 2026
6b5c2ba
set `files` & `fileLanguages` in params
hatemhosny Feb 11, 2026
7be74f8
enable Vue to defineProps from types in .d.ts files
hatemhosny Feb 11, 2026
8021697
allow using `replaceSFCImports` in multifile projects
hatemhosny Feb 11, 2026
42d5548
fix applyConfig
hatemhosny Feb 12, 2026
a1a0405
hide export to codepen & jsfiddle in multifile projects
hatemhosny Feb 12, 2026
6373f49
update `createIframe` for multifile projects
hatemhosny Feb 12, 2026
c3fca6e
upgrade local typescript to v5.9.3
hatemhosny Feb 12, 2026
dbde43b
update SDK methods to support multifile projects
hatemhosny Feb 12, 2026
e17d92c
Merge branch 'develop' into multi-file-support
hatemhosny Feb 14, 2026
7205bc7
update package-lock
hatemhosny Feb 14, 2026
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A [feature-rich](https://livecodes.io/docs/features/), open-source, **client-sid
[![LiveCodes: npm version](https://img.shields.io/npm/v/livecodes)](https://www.npmjs.com/package/livecodes)
[![LiveCodes: npm downloads](https://img.shields.io/npm/dm/livecodes)](https://www.npmjs.com/package/livecodes)
[![LiveCodes: jsdelivr downloads](https://data.jsdelivr.com/v1/package/npm/livecodes/badge?style=rounded)](https://www.jsdelivr.com/package/npm/livecodes)
[![LiveCodes: languages](https://img.shields.io/badge/languages-98-blue)](https://livecodes.io/docs/languages/)
[![LiveCodes: languages](https://img.shields.io/badge/languages-99-blue)](https://livecodes.io/docs/languages/)
[![LiveCodes: docs](https://img.shields.io/badge/Documentation-575757?logo=gitbook&logoColor=white)](https://livecodes.io/docs/)
[![LiveCodes: llms.txt](https://img.shields.io/badge/llms.txt-575757?logo=googledocs&logoColor=white)](https://livecodes.io/docs/llms.txt)
[![LiveCodes: llms-full.txt](https://img.shields.io/badge/llms--full.txt-575757?logo=googledocs&logoColor=white)](https://livecodes.io/docs/llms-full.txt)
Expand Down
20 changes: 13 additions & 7 deletions docs/docs/configuration/configuration-object.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ An object that configures the language and content of the markup editor. This ca
A URL to load `content` from. It has to be a valid URL that is CORS-enabled.
The URL is only fetched if `content` property had no value.

- `hidden`:
Type: [`boolean | undefined`](../api/interfaces/Config.md#hidden)
Default: `""`
If `true`, the title of the code editor is hidden, however its code is still evaluated.
This can be useful in embedded playgrounds (e.g. for hiding unnecessary code).

- `hiddenContent`:
Type: [`string | undefined`](../api/interfaces/Config.md#hiddencontent)
Default: `undefined`
Expand All @@ -153,18 +159,12 @@ An object that configures the language and content of the markup editor. This ca
A URL to load `hiddenContent` from. It has to be a valid URL that is CORS-enabled.
The URL is only fetched if `hiddenContent` property had no value.

- `foldedLines`:
Type: [`Array<{ from: number; to: number }> | undefined`](../api/interfaces/Config.md#foldedlines)
Default: `undefined`
Lines that get folded when the editor loads. The code can be unfolded by clicking on arrow beside the line.
This can be useful for less relevant code in embedded playgrounds.

- `title`:
Type: [`string | undefined`](../api/interfaces/Config.md#title)
Default: `""`
If set, this is used as the title of the editor in the UI, overriding the default title set to the language name (e.g. "Python" can be used instead of "Py (Wasm)").

- `hideTitle`:
- `hideTitle` (**deprecated**, use `hidden` instead):
Type: [`boolean | undefined`](../api/interfaces/Config.md#hidetitle)
Default: `""`
If `true`, the title of the code editor is hidden, however its code is still evaluated.
Expand All @@ -186,6 +186,12 @@ An object that configures the language and content of the markup editor. This ca
The initial position of the cursor in the code editor.
Example: `{lineNumber: 5, column: 10}`

- `foldedLines`:
Type: [`Array<{ from: number; to: number }> | undefined`](../api/interfaces/Config.md#foldedlines)
Default: `undefined`
Lines that get folded when the editor loads. The code can be unfolded by clicking on arrow beside the line.
This can be useful for less relevant code in embedded playgrounds.

### `style`

Type: [`Editor`](../api/interfaces/Config.md#style)
Expand Down
38 changes: 26 additions & 12 deletions docs/docs/languages/cssmodules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The selector names are unique to avoid naming collision. They can then be import

CSS Modules can be enabled from the style editor menu.

Selectors added to the style editor (using any language e.g. CSS, SCSS, Less, etc.) are transformed to unique selectors. The transformed classes are then accessible in the script editor as a JSON object, and are injected into the HTML elements.
Selectors added to the style editor (using any language e.g. CSS, SCSS, Less, etc.) are transformed to unique selectors. The transformed classes are then accessible in the script editor as a JSON object, and can be injected into the HTML elements.

**Example:**

Expand Down Expand Up @@ -193,7 +193,7 @@ In addition, the following settings are available:

- `addClassesToHTML`

Type: `boolean`. Default: `true`.
Type: `boolean`. Default: `false`.

The generated classes are injected into the HTML elements, so the styles are applied without having to assign them using JavaScript.

Expand All @@ -212,7 +212,7 @@ Please note that custom settings should be valid JSON (i.e. functions are not al
"cssmodules": {
"exportGlobals": true,
"localsConvention": "camelCaseOnly",
"addClassesToHTML": false
"addClassesToHTML": true
}
}
```
Expand All @@ -234,16 +234,30 @@ If you get this working, [please create a pull request](https://github.com/live-

import LiveCodes from '../../src/components/LiveCodes.tsx';

export const params = {
export const config = {
activeEditor: 'style',
html: '<div class="page">\n <h1>Page Title</h1>\n <p class="small-text">Lorem, ipsum dolor sit amet consectetur adipisicing elit. Dolore earum blanditiis quidem non beatae ipsam autem maiores ut et delectus unde repudiandae, repellendus aut. Aspernatur similique facere facilis minima tempora.</p>\n</div>\n',
css: ':global .page {\n padding: 20px;\n}\n\n.text {\n color: black;\n font-family: sans-serif;\n}\n\n.small-text {\n composes: text;\n font-size: 20px;\n}\n\n.large-text {\n composes: text;\n font-size: 40px;\n}\n\n.large-text:hover {\n color: red;\n}\n\n.title {\n composes: large-text;\n color: green;\n}\n',
js: "import classes from './style.module.css';\n\ndocument.querySelector('h1').className = classes.title;\nconsole.log(classes);\n",
processors: 'cssmodules',
compiled: 'open',
};

<LiveCodes params={params} height="400"></LiveCodes>
markup: {
language: 'html',
content: '<div class="page">\n <h1>Page Title</h1>\n <p class="small-text">Lorem, ipsum dolor sit amet consectetur adipisicing elit. Dolore earum blanditiis quidem non beatae ipsam autem maiores ut et delectus unde repudiandae, repellendus aut. Aspernatur similique facere facilis minima tempora.</p>\n</div>\n',
},
style: {
language: 'css',
content: ':global .page {\n padding: 20px;\n}\n\n.text {\n color: black;\n font-family: sans-serif;\n}\n\n.small-text {\n composes: text;\n font-size: 20px;\n}\n\n.large-text {\n composes: text;\n font-size: 40px;\n}\n\n.large-text:hover {\n color: red;\n}\n\n.title {\n composes: large-text;\n color: green;\n}\n',
},
script: {
language: 'js',
content: "import classes from './style.module.css';\n\ndocument.querySelector('h1').className = classes.title;\nconsole.log(classes);\n",
},
processors: ['cssmodules'],
tools: { active: 'compiled' },
customSettings: {
cssmodules: {
addClassesToHTML: true,
},
}
}

<LiveCodes config={config} height="400"></LiveCodes>

## Links

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/languages/html.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ or adding JavaScript together with a different script editor language (e.g. see

### Extensions

`.html`, `.htm`
`.html`, `.htm`, `.svg`

### Editor

Expand Down
3 changes: 3 additions & 0 deletions docs/docs/languages/json.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# JSON

TODO ...
2 changes: 1 addition & 1 deletion docs/docs/languages/svelte.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ import Counter from './Counter.svelte';

<LiveCodes config={multi}></LiveCodes>

Please note that LiveCodes [does not have the concept of a file system](../features/projects.mdx). However, you can configure [editor options](../configuration/configuration-object.mdx#markup) like `title`, `order` and `hideTitle` to simulate multiple files, change editor order or even hide editors.
Please note that LiveCodes [does not have the concept of a file system](../features/projects.mdx). However, you can configure [editor options](../configuration/configuration-object.mdx#markup) like `title`, `order` and `hidden` to simulate multiple files, change editor order or even hide editors.

Example:

Expand Down
3 changes: 3 additions & 0 deletions docs/docs/languages/text.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Text

TODO ...
2 changes: 1 addition & 1 deletion docs/docs/languages/vue.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ import Counter from './Counter.vue';

<LiveCodes config={multi}></LiveCodes>

Please note that LiveCodes [does not have the concept of a file system](../features/projects.mdx). However, you can configure [editor options](../configuration/configuration-object.mdx#markup) like `title`, `order` and `hideTitle` to simulate multiple files, change editor order or even hide editors.
Please note that LiveCodes [does not have the concept of a file system](../features/projects.mdx). However, you can configure [editor options](../configuration/configuration-object.mdx#markup) like `title`, `order` and `hidden` to simulate multiple files, change editor order or even hide editors.

Example:

Expand Down
2 changes: 1 addition & 1 deletion docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const config: Config = {
tagline: 'A Code Playground That Just Works!',
url: 'https://livecodes.io/',
baseUrl,
onBrokenLinks: 'throw',
onBrokenLinks: 'warn',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
organizationName: 'LiveCodes',
Expand Down
Loading