-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* docs: update esm-vite sample * docs: update esm-plain-webpack sample * docs: update esm-monaco-webpack-plugin sample
- Loading branch information
Showing
19 changed files
with
397 additions
and
156 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,29 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>esm-monaco-webpack-plugin-sample</title> | ||
</head> | ||
|
||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>esm-monaco-webpack-plugin-sample</title> | ||
</head> | ||
|
||
<body> | ||
<h2>FlinkSQL Demo</h2> | ||
<div style="width: 700px;height: 400px;border: 1px solid #ddd;"> | ||
<div id="container" style="height: 100%; width: 100%;"></div> | ||
</div> | ||
</body> | ||
|
||
<body> | ||
<h2>ESM Monaco Webpack Plugin Demo</h2> | ||
<select | ||
name="language" | ||
style="width: 120px; height: 32px; margin-bottom: 8px; font-size: 16px" | ||
id="lang-select" | ||
> | ||
<option value="mysql">MYSQL</option> | ||
<option value="flinksql" selected>FLINK</option> | ||
<option value="hivesql">HIVE</option> | ||
<option value="sparksql">SPARK</option> | ||
<option value="impalasql">IMPALA</option> | ||
<option value="trinosql">TRINO</option> | ||
<option value="pgsql">PGSQL</option> | ||
</select> | ||
<div style="width: 700px; height: 400px; border: 1px solid #ddd"> | ||
<div id="container" style="height: 100%; width: 100%"></div> | ||
</div> | ||
</body> | ||
</html> | ||
<!doctype html> | ||
<!DOCTYPE html> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,13 +1,40 @@ | ||
import * as monaco from 'monaco-editor'; | ||
import { LanguageIdEnum } from 'monaco-sql-languages'; | ||
import './languageSetup'; | ||
|
||
let editorIns: monaco.editor.IStandaloneCodeEditor | null = null; | ||
|
||
function render() { | ||
const container = document.getElementById('container'); | ||
if (container) { | ||
monaco.editor.create(container, { | ||
language: LanguageIdEnum.FLINK | ||
editorIns = monaco.editor.create(container, { | ||
language: LanguageIdEnum.TRINO | ||
}); | ||
} | ||
} | ||
|
||
function listenLangChange() { | ||
const langSelect = document.getElementById('lang-select') as HTMLSelectElement; | ||
if (langSelect && editorIns) { | ||
langSelect.addEventListener('change', () => { | ||
if (!editorIns) return; | ||
|
||
const lang = langSelect.options[langSelect.selectedIndex].value; | ||
const model = editorIns.getModel(); | ||
|
||
if (model && model.getLanguageId() !== lang) { | ||
monaco.editor.setModelLanguage(model, lang); | ||
setTimeout(() => { | ||
console.log( | ||
'language changed, current is: ', | ||
editorIns?.getModel()?.getLanguageId() | ||
); | ||
}, 200); | ||
} | ||
}); | ||
} | ||
} | ||
|
||
render(); | ||
|
||
listenLangChange(); |
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,8 @@ | ||
/** import contribution files */ | ||
import 'monaco-sql-languages/esm/languages/mysql/mysql.contribution'; | ||
import 'monaco-sql-languages/esm/languages/flink/flink.contribution'; | ||
import 'monaco-sql-languages/esm/languages/spark/spark.contribution'; | ||
import 'monaco-sql-languages/esm/languages/hive/hive.contribution'; | ||
import 'monaco-sql-languages/esm/languages/trino/trino.contribution'; | ||
import 'monaco-sql-languages/esm/languages/pgsql/pgsql.contribution'; | ||
import 'monaco-sql-languages/esm/languages/impala/impala.contribution'; |
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 |
---|---|---|
@@ -1,18 +1,29 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>esm-plain-webpack-sample</title> | ||
</head> | ||
|
||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>esm-plain-webpack-sample</title> | ||
</head> | ||
|
||
<body> | ||
<h2>FlinkSQL Demo</h2> | ||
<div style="width: 700px;height: 400px;border: 1px solid #ddd;"> | ||
<div id="container" style="height: 100%; width: 100%;"></div> | ||
</div> | ||
</body> | ||
|
||
<body> | ||
<h2>ESM Plain Webpack Demo</h2> | ||
<select | ||
name="language" | ||
style="width: 120px; height: 32px; margin-bottom: 8px; font-size: 16px" | ||
id="lang-select" | ||
> | ||
<option value="mysql">MYSQL</option> | ||
<option value="flinksql" selected>FLINK</option> | ||
<option value="hivesql">HIVE</option> | ||
<option value="sparksql">SPARK</option> | ||
<option value="impalasql">IMPALA</option> | ||
<option value="trinosql">TRINO</option> | ||
<option value="pgsql">PGSQL</option> | ||
</select> | ||
<div style="width: 700px; height: 400px; border: 1px solid #ddd"> | ||
<div id="container" style="height: 100%; width: 100%"></div> | ||
</div> | ||
</body> | ||
</html> | ||
<!doctype html> | ||
<!DOCTYPE html> |
Oops, something went wrong.