diff --git a/package-lock.json b/package-lock.json index 138f9f7e..7b653845 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,16 @@ { "name": "shinylive", - "version": "0.4.1", + "version": "0.5.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "shinylive", - "version": "0.4.1", + "version": "0.5.0", "license": "MIT", + "dependencies": { + "@codemirror/lang-sql": "^6.7.0" + }, "devDependencies": { "@codemirror/autocomplete": "^6.4.2", "@codemirror/commands": "6.2.1", @@ -749,7 +752,6 @@ "version": "6.11.1", "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.11.1.tgz", "integrity": "sha512-L5UInv8Ffd6BPw0P3EF7JLYAMeEbclY7+6Q11REt8vhih8RuLreKtPy/xk8wPxs4EQgYqzI7cdgpiYwWlbS/ow==", - "dev": true, "dependencies": { "@codemirror/language": "^6.0.0", "@codemirror/state": "^6.0.0", @@ -831,11 +833,23 @@ "@lezer/python": "^1.1.4" } }, + "node_modules/@codemirror/lang-sql": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/@codemirror/lang-sql/-/lang-sql-6.7.0.tgz", + "integrity": "sha512-KMXp6rtyPYz6RaElvkh/77ClEAoQoHRPZo0zutRRialeFs/B/X8YaUJBCnAV2zqyeJPLZ4hgo48mG8TKoNXfZA==", + "dependencies": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@lezer/common": "^1.2.0", + "@lezer/highlight": "^1.0.0", + "@lezer/lr": "^1.0.0" + } + }, "node_modules/@codemirror/language": { "version": "6.9.3", "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.9.3.tgz", "integrity": "sha512-qq48pYzoi6ldYWV/52+Z9Ou6QouVI+8YwvxFbUypI33NbjG2UeRHKENRyhwljTTiOqjQ33FjyZj6EREQ9apAOQ==", - "dev": true, "dependencies": { "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.0.0", @@ -879,14 +893,12 @@ "node_modules/@codemirror/state": { "version": "6.3.2", "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.3.2.tgz", - "integrity": "sha512-5jEikOfU0r9y+OTlZn5AEQB15mibu3deLBUp+GnLzVUNezEEuPt/JdSeniQNi+0YviblAvOPO2JQAlgJ3SYYaA==", - "dev": true + "integrity": "sha512-5jEikOfU0r9y+OTlZn5AEQB15mibu3deLBUp+GnLzVUNezEEuPt/JdSeniQNi+0YviblAvOPO2JQAlgJ3SYYaA==" }, "node_modules/@codemirror/view": { "version": "6.22.1", "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.22.1.tgz", "integrity": "sha512-38BRn1nPqZqiHbmWfI8zri23IbRVbmSpSmh1E/Ysvc+lIGGdBC17K8zlK7ZU6fhfy9x4De9Zyj5JQqScPq5DkA==", - "dev": true, "dependencies": { "@codemirror/state": "^6.1.4", "style-mod": "^4.1.0", @@ -2069,10 +2081,9 @@ } }, "node_modules/@lezer/common": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.1.1.tgz", - "integrity": "sha512-aAPB9YbvZHqAW+bIwiuuTDGB4DG0sYNRObGLxud8cW7osw1ZQxfDuTZ8KQiqfZ0QJGcR34CvpTMDXEyo/+Htgg==", - "dev": true + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.2.1.tgz", + "integrity": "sha512-yemX0ZD2xS/73llMZIK6KplkjIjf2EvAHcinDi/TfJ9hS25G0388+ClHt6/3but0oOxinTcQHJLDXh6w1crzFQ==" }, "node_modules/@lezer/css": { "version": "1.1.4", @@ -2088,7 +2099,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.0.tgz", "integrity": "sha512-WrS5Mw51sGrpqjlh3d4/fOwpEV2Hd3YOkp9DBt4k8XZQcoTHZFB7sx030A6OcahF4J1nDQAa3jXlTVVYH50IFA==", - "dev": true, "dependencies": { "@lezer/common": "^1.0.0" } @@ -2118,7 +2128,6 @@ "version": "1.3.14", "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.3.14.tgz", "integrity": "sha512-z5mY4LStlA3yL7aHT/rqgG614cfcvklS+8oFRFBYrs4YaWLJyKKM4+nN6KopToX0o9Hj6zmH6M5kinOYuy06ug==", - "dev": true, "dependencies": { "@lezer/common": "^1.0.0" } @@ -9247,8 +9256,7 @@ "node_modules/style-mod": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.0.tgz", - "integrity": "sha512-Ca5ib8HrFn+f+0n4N4ScTIA9iTOQ7MaGS1ylHcoVqW9J7w2w8PzN6g9gKmTYgGEBH8e120+RCmhpje6jC5uGWA==", - "dev": true + "integrity": "sha512-Ca5ib8HrFn+f+0n4N4ScTIA9iTOQ7MaGS1ylHcoVqW9J7w2w8PzN6g9gKmTYgGEBH8e120+RCmhpje6jC5uGWA==" }, "node_modules/supports-color": { "version": "7.2.0", @@ -10151,8 +10159,7 @@ "node_modules/w3c-keyname": { "version": "2.2.8", "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", - "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==", - "dev": true + "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==" }, "node_modules/w3c-xmlserializer": { "version": "2.0.0", diff --git a/package.json b/package.json index d103717f..6c18c676 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "@codemirror/lang-html": "^6.4.2", "@codemirror/lang-javascript": "^6.1.4", "@codemirror/lang-python": "^6.1.1", + "@codemirror/lang-sql": "^6.7.0", "@codemirror/language": "^6.6.0", "@codemirror/legacy-modes": "^6.3.1", "@codemirror/lint": "^6.1.1", diff --git a/src/Components/codeMirror/extensions.ts b/src/Components/codeMirror/extensions.ts index 0bb46999..e7df7267 100644 --- a/src/Components/codeMirror/extensions.ts +++ b/src/Components/codeMirror/extensions.ts @@ -15,6 +15,7 @@ import { css } from "@codemirror/lang-css"; import { html } from "@codemirror/lang-html"; import { javascript } from "@codemirror/lang-javascript"; import { python } from "@codemirror/lang-python"; +import { sql } from "@codemirror/lang-sql"; import { StreamLanguage, bracketMatching, @@ -115,6 +116,7 @@ const LANG_EXTENSIONS: Record Extension> = { javascript: javascript, html: html, css: css, + sql: sql, r: () => StreamLanguage.define(r), }; diff --git a/src/utils.ts b/src/utils.ts index 46a21f07..915b82f4 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -85,6 +85,7 @@ const FILE_EXTENSIONS: Record = { css: "css", csv: "csv", r: "r", + sql: "sql", }; export function isApplePlatform(): boolean { @@ -147,7 +148,7 @@ export function stringToUint8Array(s: string): Uint8Array { export function engineSwitch( engine: AppEngine, rValue: string, - pythonValue: string + pythonValue: string, ): string { switch (engine) { case "r":