Merge branch 'main' into mdx

This commit is contained in:
Henning Dieterichs 2023-07-07 16:44:51 +02:00 committed by GitHub
commit c46883da4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 124 additions and 61 deletions

View file

@ -7,17 +7,30 @@ on:
# enable users to manually trigger with workflow_dispatch # enable users to manually trigger with workflow_dispatch
workflow_dispatch: {} workflow_dispatch: {}
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: 'pages'
cancel-in-progress: false
jobs: jobs:
publish-website: deploy:
name: Publish Website environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@dc323e67f16fb5f7663d20ff7941f27f5809e9b6 # pin@v2 - name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561 # pin@v2 - uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561 # pin@v2
with: with:
node-version: 16 node-version: 16
- name: Cache node modules - name: Cache node modules
id: cacheNodeModules id: cacheNodeModules
uses: actions/cache@v2 uses: actions/cache@v2
@ -25,11 +38,9 @@ jobs:
path: '**/node_modules' path: '**/node_modules'
key: ${{ runner.os }}-cacheNodeModules2-${{ hashFiles('**/package-lock.json') }} key: ${{ runner.os }}-cacheNodeModules2-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-cacheNodeModules2- restore-keys: ${{ runner.os }}-cacheNodeModules2-
- name: execute `npm ci` (1) - name: execute `npm ci` (1)
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
run: npm ci run: npm ci
- name: Build - name: Build
run: npm run build-monaco-editor run: npm run build-monaco-editor
@ -45,8 +56,13 @@ jobs:
working-directory: website working-directory: website
run: yarn run build run: yarn run build
- name: Upload website to github pages - name: Setup Pages
uses: peaceiris/actions-gh-pages@bd8c6b06eba6b3d25d72b7a1767993c0aeee42e7 # pin@v3 uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }} # Upload entire repository
publish_dir: ./website/dist path: './website/dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

View file

@ -1,5 +1,13 @@
# Monaco Editor Changelog # Monaco Editor Changelog
## [0.40.0]
- Support for Glyph Margin Widgets
- Removes `getDiffLineInformationForOriginal` and `getDiffLineInformationForModified` from `IDiffEditor`
- `createTrustedTypesPolicy` is optional now
- New option `IModelDecorationOptions.shouldFillLineOnLineBreak`
- New option `EditorOptions.readOnlyMessage``
## [0.39.0] ## [0.39.0]
- New method `Environment.createTrustedTypesPolicy` to override trusted types handling. - New method `Environment.createTrustedTypesPolicy` to override trusted types handling.

View file

@ -9,7 +9,7 @@ Make sure every unassigned issue is labeled properly:
## Publishing a stable build monaco-editor build ## Publishing a stable build monaco-editor build
- Make sure there exists a nightly build from the VS Code commit the stable build should be built from - Make sure there exists a nightly build from the VS Code commit the stable build should be built from
- [Compare Last Stable With Nightly](https://microsoft.github.io/monaco-editor/playground.html?source=v0.39.0-dev.20230606#XQAAAAKzBQAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscw9ajfg2SGxNmVfIdymzfNMmpU96miXJZvs8c7gcyo98bKVzbks7HoMVAZiOQjzsGSo4vYRPplxTKh4qJ5_s9m1RB0u1a8RPwJXtmqrYtToAekuwuDQ2im8_QvtfSt1HbJIiHVd2zPiTBSeoC03JVOCBfBsHUM0AOblitxr0yoEKp5yCNj9Xx68iP2xX6l7R-oQQP0QegyE5JU_S6OAtnV--nu4J_lwqYHYrlBXuqsqRU-cKhSqrbrcWCxKMEmQyZkUHmM75vxSD8qepWmGk7BA4eU4YQI7tZ6g74Y0LXfIckS_2A-xIQYChatES1wLXoLosL4FhDqugt7bJg6Lelf09SdwM_NgJuVqmU8jOyMkHaKZ4nkZt61mFhR3Wa4KUfFUTCro6cKL3tIHInvgOfg8gpWdNOKy19pICfKSDYlWkn6rPgZxR0b-KCbY8K3_B6h8_TU8JfXlva5OmzfgvNBQcN_UE95r5zuBUua8JDaVLTOUKDRsOj5DYNx9KGGgicA2qjH3IlyyuOfgPTmNssWQv496rVgpqm4Zpt3DGSDY-1vxbGQe7m135DxLbACD70fgH8-C-ou2umXUKDrJbZJI2EFFMvzvZVBZVEp7Fa2j7161WJ_oyFj1HvHtTMvvrE_0P2g-u--1zh_9OHJ_ybwLAA) - [Compare Last Stable With Nightly](https://microsoft.github.io/monaco-editor/playground.html?source=v0.40.0-dev.20230704#XQAAAAJWBgAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscw_SM66BuzMt6m3zM8Thvb-XSMR_Da8IdBq3FOgly-7-xuaHSi_yUg58ZO9Mr-RKT7GyHzHoU8B9N7P-uTzmCdhT2Vv-4gNRbWSMQCUPrfmzFCkSH_WR2Vc8LGx2m0uRSFiJu82B1mS0RM-eriU9PTOqAgBrlPUMTU44VrHyVOqgs5BFrUuUHwGDzUHxeNuUk-kg2u70awQLQ83wD4o2EbSefqfIWkk2Yi0mnUS903tLA4V17MD_6OHIRArunMPL6E14ZCW0_Aql21F62Fmz--i_pNbqBIpSlBbZl6LzA1HzNsoDH7i2rn1qAw55L1MjwOU4QQMCJfffmJznAbGoZWkXK91OPYlOGNHNGG-MPUFsY5JSjLfvCWOvXypW9ZVkBZMo1qUbtE135CLqbaBiw52f3eOPBTru3IL_wT__ciAFI5NDiVOeN8V9zqkzbwiFNeQyZcjxmrDLjYTPJpao0dG61Um0w4FpVud8p77bjoAdEfG8JNO97W4cawj0HvMfvcZS81P7IsijZqA7KyVsdq79iCJQuMO31aS86cM4GTNT0TvdI7p62uiEmm9X6ZjF8oSLxW87Vt0oYAZ5wBePqdN6FwNO6BWACt2Ep9i5Q6h-mOy7_JWOiPTOH0Zz3v6SaNhjxJwZAqNG3FqvRTgLg-au-pfa8PD0No3U15UyWeqrVXSthGFghLJ16ppEwFCqFfQ6Vr0leZtSZXyk41-t5ZKMG-KQjzq1XE2PnuyOz60nV4GaYvGlMHrXz-XrEqb2kwNf_pBee0)
- Update [package.json](./package.json) - Update [package.json](./package.json)
- set `version` to next stable - set `version` to next stable
- set `vscodeRef` to _vscodeCommitId_ - set `vscodeRef` to _vscodeCommitId_
@ -17,7 +17,7 @@ Make sure every unassigned issue is labeled properly:
- Run `npm install` to update lockfile - Run `npm install` to update lockfile
- Update [CHANGELOG.md](./CHANGELOG.md) - Update [CHANGELOG.md](./CHANGELOG.md)
- API Changes / Breaking Changes / New and noteworthy - API Changes / Breaking Changes / New and noteworthy
- Thank you ([use this tool](https://vscode-tools.azurewebsites.net/acknowledgement/)) - Thank you ([use this tool](https://tools.code.visualstudio.com/acknowledgement))
- Commit - Commit
- [Trigger build](https://dev.azure.com/monacotools/Monaco/_build?definitionId=416) - [Trigger build](https://dev.azure.com/monacotools/Monaco/_build?definitionId=416)

View file

@ -37,6 +37,11 @@ export const typescriptVersion = "${typeScriptDependencyVersion}";\n`
let tsServices = fs.readFileSync(path.join(TYPESCRIPT_LIB_SOURCE, 'typescript.js')).toString(); let tsServices = fs.readFileSync(path.join(TYPESCRIPT_LIB_SOURCE, 'typescript.js')).toString();
tsServices = tsServices.replace(
'const path = matchedStar ? subst.replace("*", matchedStar) : subst;',
'const path = matchedStar ? subst.replace("*", matchedStar) : subst; // CodeQL [SM02383] This is a false positive, the code is from the TypeScript compiler'
);
// The output from this build will only be accessible via ESM; rather than removing // The output from this build will only be accessible via ESM; rather than removing
// references to require/module, define them as dummy variables that bundlers will ignore. // references to require/module, define them as dummy variables that bundlers will ignore.
// The TS code can figure out that it's not running under Node even with these defined. // The TS code can figure out that it's not running under Node even with these defined.

18
package-lock.json generated
View file

@ -1,12 +1,12 @@
{ {
"name": "monaco-editor", "name": "monaco-editor",
"version": "0.39.0", "version": "0.40.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "monaco-editor", "name": "monaco-editor",
"version": "0.39.0", "version": "0.40.0",
"hasInstallScript": true, "hasInstallScript": true,
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
@ -25,7 +25,7 @@
"jsdom": "^19.0.0", "jsdom": "^19.0.0",
"jsonc-parser": "^3.0.0", "jsonc-parser": "^3.0.0",
"mocha": "^9.2.0", "mocha": "^9.2.0",
"monaco-editor-core": "^0.39.0-dev.20230605", "monaco-editor-core": "^0.40.0-dev.20230629",
"parcel": "^2.7.0", "parcel": "^2.7.0",
"pin-github-action": "^1.8.0", "pin-github-action": "^1.8.0",
"playwright": "^1.32.2", "playwright": "^1.32.2",
@ -5326,9 +5326,9 @@
"dev": true "dev": true
}, },
"node_modules/monaco-editor-core": { "node_modules/monaco-editor-core": {
"version": "0.39.0-rc2", "version": "0.40.0-dev.20230707",
"resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.39.0-rc2.tgz", "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.40.0-dev.20230707.tgz",
"integrity": "sha512-PVOMjeVt17EvLIa27CmtVIqUz500mHPmsMJpKbVjV1fHCaRHoK38Qrk+lYWXM4MAHFOeUb1GNlj8Z1TnqlOJSw==", "integrity": "sha512-aKvvZjZYww+5KbyYq5L3aUjdRmVVXZrCXGO0A0GTISpx2PuqThDpEv7r4ZQkhHQxHSGCRZdLr2JAdgFLkNcmxg==",
"dev": true "dev": true
}, },
"node_modules/mri": { "node_modules/mri": {
@ -11020,9 +11020,9 @@
} }
}, },
"monaco-editor-core": { "monaco-editor-core": {
"version": "0.39.0-rc2", "version": "0.40.0-dev.20230707",
"resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.39.0-rc2.tgz", "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.40.0-dev.20230707.tgz",
"integrity": "sha512-PVOMjeVt17EvLIa27CmtVIqUz500mHPmsMJpKbVjV1fHCaRHoK38Qrk+lYWXM4MAHFOeUb1GNlj8Z1TnqlOJSw==", "integrity": "sha512-aKvvZjZYww+5KbyYq5L3aUjdRmVVXZrCXGO0A0GTISpx2PuqThDpEv7r4ZQkhHQxHSGCRZdLr2JAdgFLkNcmxg==",
"dev": true "dev": true
}, },
"mri": { "mri": {

View file

@ -1,7 +1,7 @@
{ {
"name": "monaco-editor", "name": "monaco-editor",
"version": "0.39.0", "version": "0.40.0",
"vscodeRef": "78390793536f5f43e17ff7c97b260bd2a5d1060c", "vscodeRef": "660393deaaa6d1996740ff4880f1bad43768c814",
"private": true, "private": true,
"description": "A browser based code editor", "description": "A browser based code editor",
"homepage": "https://github.com/microsoft/monaco-editor", "homepage": "https://github.com/microsoft/monaco-editor",
@ -52,7 +52,7 @@
"jsdom": "^19.0.0", "jsdom": "^19.0.0",
"jsonc-parser": "^3.0.0", "jsonc-parser": "^3.0.0",
"mocha": "^9.2.0", "mocha": "^9.2.0",
"monaco-editor-core": "^0.39.0-dev.20230605", "monaco-editor-core": "^0.40.0-dev.20230629",
"parcel": "^2.7.0", "parcel": "^2.7.0",
"pin-github-action": "^1.8.0", "pin-github-action": "^1.8.0",
"playwright": "^1.32.2", "playwright": "^1.32.2",

View file

@ -303,6 +303,17 @@ testTokenization('elixir', [
] ]
} }
], ],
// Sigils (multi-letter uppercase)
[
{
line: '~DX/foo/',
tokens: [
{ startIndex: 0, type: 'sigil.delimiter.elixir' },
{ startIndex: 4, type: 'sigil.elixir' },
{ startIndex: 7, type: 'sigil.delimiter.elixir' }
]
}
],
// Sigils (no interpolation) // Sigils (no interpolation)
[ [
{ {
@ -314,6 +325,17 @@ testTokenization('elixir', [
] ]
} }
], ],
// Sigils (multi-letter uppercase no interpolation)
[
{
line: '~WW/foo#{1}/',
tokens: [
{ startIndex: 0, type: 'sigil.delimiter.elixir' },
{ startIndex: 4, type: 'sigil.elixir' },
{ startIndex: 11, type: 'sigil.delimiter.elixir' }
]
}
],
// Sigils (modifiers) // Sigils (modifiers)
[ [
{ {
@ -325,6 +347,17 @@ testTokenization('elixir', [
] ]
} }
], ],
// Sigils (multi-letter uppercase with modifiers)
[
{
line: '~DX/custom/az09',
tokens: [
{ startIndex: 0, type: 'sigil.delimiter.elixir' },
{ startIndex: 4, type: 'sigil.elixir' },
{ startIndex: 10, type: 'sigil.delimiter.elixir' }
]
}
],
// Module attributes // Module attributes
[ [
{ {

View file

@ -333,7 +333,8 @@ export const language = <languages.IMonarchLanguage>{
// See https://elixir-lang.org/getting-started/sigils.html // See https://elixir-lang.org/getting-started/sigils.html
// Sigils allow for typing values using their textual representation. // Sigils allow for typing values using their textual representation.
// All sigils start with ~ followed by a letter indicating sigil type // All sigils start with ~ followed by a letter or
// multi-letter uppercase starting at Elixir v1.15.0, indicating sigil type
// and then a delimiter pair enclosing the textual representation. // and then a delimiter pair enclosing the textual representation.
// Optional modifiers are allowed after the closing delimiter. // Optional modifiers are allowed after the closing delimiter.
// For instance a regular expressions can be written as: // For instance a regular expressions can be written as:
@ -353,16 +354,16 @@ export const language = <languages.IMonarchLanguage>{
sigils: [ sigils: [
[/~[a-z]@sigilStartDelimiter/, { token: '@rematch', next: '@sigil.interpol' }], [/~[a-z]@sigilStartDelimiter/, { token: '@rematch', next: '@sigil.interpol' }],
[/~[A-Z]@sigilStartDelimiter/, { token: '@rematch', next: '@sigil.noInterpol' }] [/~([A-Z]+)@sigilStartDelimiter/, { token: '@rematch', next: '@sigil.noInterpol' }]
], ],
sigil: [ sigil: [
[/~([a-zA-Z])\{/, { token: '@rematch', switchTo: '@sigilStart.$S2.$1.{.}' }], [/~([a-z]|[A-Z]+)\{/, { token: '@rematch', switchTo: '@sigilStart.$S2.$1.{.}' }],
[/~([a-zA-Z])\[/, { token: '@rematch', switchTo: '@sigilStart.$S2.$1.[.]' }], [/~([a-z]|[A-Z]+)\[/, { token: '@rematch', switchTo: '@sigilStart.$S2.$1.[.]' }],
[/~([a-zA-Z])\(/, { token: '@rematch', switchTo: '@sigilStart.$S2.$1.(.)' }], [/~([a-z]|[A-Z]+)\(/, { token: '@rematch', switchTo: '@sigilStart.$S2.$1.(.)' }],
[/~([a-zA-Z])\</, { token: '@rematch', switchTo: '@sigilStart.$S2.$1.<.>' }], [/~([a-z]|[A-Z]+)\</, { token: '@rematch', switchTo: '@sigilStart.$S2.$1.<.>' }],
[ [
/~([a-zA-Z])(@sigilSymmetricDelimiter)/, /~([a-z]|[A-Z]+)(@sigilSymmetricDelimiter)/,
{ token: '@rematch', switchTo: '@sigilStart.$S2.$1.$2.$2' } { token: '@rematch', switchTo: '@sigilStart.$S2.$1.$2.$2' }
] ]
], ],
@ -475,7 +476,7 @@ export const language = <languages.IMonarchLanguage>{
// Fallback to the generic sigil by default // Fallback to the generic sigil by default
'sigilStart.interpol': [ 'sigilStart.interpol': [
[ [
/~([a-zA-Z])@sigilStartDelimiter/, /~([a-z]|[A-Z]+)@sigilStartDelimiter/,
{ {
token: 'sigil.delimiter', token: 'sigil.delimiter',
switchTo: '@sigilContinue.$S2.$S3.$S4.$S5' switchTo: '@sigilContinue.$S2.$S3.$S4.$S5'
@ -498,7 +499,7 @@ export const language = <languages.IMonarchLanguage>{
'sigilStart.noInterpol': [ 'sigilStart.noInterpol': [
[ [
/~([a-zA-Z])@sigilStartDelimiter/, /~([a-z]|[A-Z]+)@sigilStartDelimiter/,
{ {
token: 'sigil.delimiter', token: 'sigil.delimiter',
switchTo: '@sigilContinue.$S2.$S3.$S4.$S5' switchTo: '@sigilContinue.$S2.$S3.$S4.$S5'

View file

@ -40937,7 +40937,7 @@ ${lanes.join("\n")}
trace(state.host, Diagnostics.Module_name_0_matched_pattern_1, moduleName, matchedPatternText); trace(state.host, Diagnostics.Module_name_0_matched_pattern_1, moduleName, matchedPatternText);
} }
const resolved = forEach(paths[matchedPatternText], (subst) => { const resolved = forEach(paths[matchedPatternText], (subst) => {
const path = matchedStar ? subst.replace("*", matchedStar) : subst; const path = matchedStar ? subst.replace("*", matchedStar) : subst; // CodeQL [SM02383] This is a false positive, the code is from the TypeScript compiler
const candidate = normalizePath(combinePaths(baseDirectory, path)); const candidate = normalizePath(combinePaths(baseDirectory, path));
if (state.traceEnabled) { if (state.traceEnabled) {
trace(state.host, Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path); trace(state.host, Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path);

View file

@ -39,7 +39,7 @@
'<ul><li>' + '<ul><li>' +
renderLoadingOptions(true) + renderLoadingOptions(true) +
(isRelease ? '' : `</li><li>${renderLoadingOptions(false)}`) + (isRelease ? '' : `</li><li>${renderLoadingOptions(false)}`) +
'</li></ul>'; '</li></ul>'; // CodeQL [SM03712] This code is not deployed and serves as local test code. No risk of malicious input.
document.body.appendChild(div); document.body.appendChild(div);
@ -47,7 +47,7 @@
for (let i = 0; i < aElements.length; i++) { for (let i = 0; i < aElements.length; i++) {
let aElement = aElements[i]; let aElement = aElements[i];
if (aElement.className === 'loading-opts') { if (aElement.className === 'loading-opts') {
aElement.href += window.location.search; aElement.href += window.location.search; // CodeQL [SM01507] This code is not deployed and serves as local test code. No risk of malicious input.
} }
} }
})(); })();

View file

@ -84,7 +84,7 @@ function loadScript(path: string): Promise<void> {
script.onload = () => res(); script.onload = () => res();
script.async = true; script.async = true;
script.type = "text/javascript"; script.type = "text/javascript";
script.src = path; script.src = path; // CodeQL [SM01507] This is safe because the runner (that allows for dynamic paths) runs in an isolated iframe. The hosting website uses a static path configuration. // CodeQL [SM03712] This is safe because the runner (that allows for dynamic paths) runs in an isolated iframe. The hosting website uses a static path configuration.
document.head.appendChild(script); document.head.appendChild(script);
}); });
} }

View file

@ -21,7 +21,7 @@ window.addEventListener("message", (event) => {
const style = document.getElementById( const style = document.getElementById(
"custom-style" "custom-style"
) as HTMLStyleElement; ) as HTMLStyleElement;
style.innerHTML = e.css; style.innerHTML = e.css; // CodeQL [SM03712] This is safe because the runner runs in an isolated iframe.
} }
}); });
@ -54,7 +54,7 @@ async function initialize(state: IPreviewState) {
const js = massageJs(state.js); const js = massageJs(state.js);
try { try {
eval(js); eval(js); // CodeQL [SM01632] This is safe because the runner runs in an isolated iframe. This feature is essential to the functionality of the playground. // CodeQL [SM02688] This is safe because the runner runs in an isolated iframe. This feature is essential to the functionality of the playground.
} catch (err) { } catch (err) {
const pre = document.createElement("pre"); const pre = document.createElement("pre");
pre.appendChild( pre.appendChild(

View file

@ -172,10 +172,9 @@ class EditorDemo extends React.Component {
<div> <div>
<h2>IntelliSense, Validation</h2> <h2>IntelliSense, Validation</h2>
<p> <p>
Paragraph of text beneath the heading to explain Get completions and errors directly in the
the heading. We'll add onto it with another browser for supported languages. Or write your
sentence and probably just keep going until we own completion providers in JavaScript.
run out of words.
</p> </p>
</div> </div>
</div> </div>
@ -184,10 +183,9 @@ class EditorDemo extends React.Component {
<div> <div>
<h2>Basic Syntax Colorization</h2> <h2>Basic Syntax Colorization</h2>
<p> <p>
Paragraph of text beneath the heading to explain Colorize code using our pre-built syntax
the heading. We'll add onto it with another highlighting, or configure your own custom
sentence and probably just keep going until we colorization.
run out of words.
</p> </p>
</div> </div>
</div> </div>

View file

@ -1,24 +1,24 @@
import { autorun } from "mobx"; import { autorun } from "mobx";
import { observer } from "mobx-react"; import { observer } from "mobx-react";
import * as React from "react"; import * as React from "react";
import { ButtonGroup, FormCheck } from "react-bootstrap";
import { getLoadedMonaco } from "../../../monaco-loader"; import { getLoadedMonaco } from "../../../monaco-loader";
import { IPlaygroundProject, IPreviewState } from "../../../shared";
import { Page } from "../../components/Page"; import { Page } from "../../components/Page";
import { Select } from "../../components/Select"; import { Select } from "../../components/Select";
import { Button, Col, Row, Stack } from "../../components/bootstrap";
import { import {
MonacoEditor, MonacoEditor,
MonacoEditorHeight, MonacoEditorHeight,
} from "../../components/monaco/MonacoEditor"; } from "../../components/monaco/MonacoEditor";
import { withLoadedMonaco } from "../../components/monaco/MonacoLoader"; import { withLoadedMonaco } from "../../components/monaco/MonacoLoader";
import { monacoEditorVersion } from "../../monacoEditorVersion";
import { hotComponent } from "../../utils/hotComponent"; import { hotComponent } from "../../utils/hotComponent";
import { IReference, ref } from "../../utils/ref"; import { IReference, ref } from "../../utils/ref";
import { getNpmVersionsSync } from "./getNpmVersionsSync";
import { getPlaygroundExamples, PlaygroundExample } from "./playgroundExamples";
import { PlaygroundModel } from "./PlaygroundModel"; import { PlaygroundModel } from "./PlaygroundModel";
import { Preview } from "./Preview"; import { Preview } from "./Preview";
import { SettingsDialog } from "./SettingsDialog"; import { SettingsDialog } from "./SettingsDialog";
import { Button, Col, Row, Stack } from "../../components/bootstrap"; import { getNpmVersionsSync } from "./getNpmVersionsSync";
import { ButtonGroup, FormCheck } from "react-bootstrap"; import { PlaygroundExample, getPlaygroundExamples } from "./playgroundExamples";
@hotComponent(module) @hotComponent(module)
@observer @observer
@ -258,7 +258,9 @@ export class VersionSelector extends React.Component<{
<Select <Select
values={versions} values={versions}
getLabel={(i) => getLabel={(i) =>
`${i}${ i === latestValue
? `latest stable (${monacoEditorVersion})`
: `${i}${
{ {
["undefined"]: "", ["undefined"]: "",
["true"]: " ✓", ["true"]: " ✓",

View file

@ -58,7 +58,7 @@ function createLangModel(languageId, text) {
var update = function () { var update = function () {
var def = null; var def = null;
try { try {
def = eval("(function(){ " + langModel.getValue() + "; })()"); def = eval("(function(){ " + langModel.getValue() + "; })()"); // CodeQL [SM01632] langModel.getValue() is a default value with volatile user modifications. This is an essential functionality for the monarch playground and safe, as no injection is possible.
} catch (err) { } catch (err) {
setInnerText(outputPane, err + "\n"); setInnerText(outputPane, err + "\n");
return; return;