diff --git a/.github/workflows/preview-url-comment.yml b/.github/workflows/preview-url-comment.yml
index ad5e7f043..1643afb84 100644
--- a/.github/workflows/preview-url-comment.yml
+++ b/.github/workflows/preview-url-comment.yml
@@ -10,6 +10,9 @@ jobs:
preview-url-comment:
runs-on: ubuntu-latest
timeout-minutes: 10
+ permissions:
+ issues: write
+ pull-requests: write
steps:
- name: Generate preview URL
@@ -28,11 +31,9 @@ jobs:
# https://github.com/peter-evans/create-or-update-comment
- name: Create comment (if new)
if: ${{ steps.find-comment.outputs.comment-id == 0 }}
- uses: peter-evans/create-or-update-comment@v1
+ uses: peter-evans/create-or-update-comment@v4
with:
- token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
- edit-mode: replace
body: |
A live preview of this PR will be available at the URL(s) below.
The latest URL will be appended to this comment on each push.
@@ -43,9 +44,8 @@ jobs:
- name: Update comment (if existing)
if: ${{ steps.find-comment.outputs.comment-id != 0 }}
- uses: peter-evans/create-or-update-comment@v1
+ uses: peter-evans/create-or-update-comment@v4
with:
- token: ${{ secrets.GITHUB_TOKEN }}
comment-id: ${{ steps.find-comment.outputs.comment-id }}
edit-mode: append
body: ${{ steps.gen-url.outputs.url }}
diff --git a/package-lock.json b/package-lock.json
index 8d5db3bab..0817efb6a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -12,7 +12,7 @@
"packages/*"
],
"devDependencies": {
- "playground-elements": "^0.20.0",
+ "playground-elements": "^0.21.2",
"prettier": "^2.1.2",
"typescript": "~4.7.4",
"wireit": "^0.14.12"
@@ -745,6 +745,170 @@
"node": ">=6.9.0"
}
},
+ "node_modules/@codemirror/autocomplete": {
+ "version": "6.19.0",
+ "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.19.0.tgz",
+ "integrity": "sha512-61Hfv3cF07XvUxNeC3E7jhG8XNi1Yom1G0lRC936oLnlF+jrbrv8rc/J98XlYzcsAoTVupfsf5fLej1aI8kyIg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@codemirror/language": "^6.0.0",
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.17.0",
+ "@lezer/common": "^1.0.0"
+ }
+ },
+ "node_modules/@codemirror/commands": {
+ "version": "6.8.1",
+ "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.8.1.tgz",
+ "integrity": "sha512-KlGVYufHMQzxbdQONiLyGQDUW0itrLZwq3CcY7xpv9ZLRHqzkBSoteocBHtMCoY7/Ci4xhzSrToIeLg7FxHuaw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@codemirror/language": "^6.0.0",
+ "@codemirror/state": "^6.4.0",
+ "@codemirror/view": "^6.27.0",
+ "@lezer/common": "^1.1.0"
+ }
+ },
+ "node_modules/@codemirror/lang-css": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/@codemirror/lang-css/-/lang-css-6.3.1.tgz",
+ "integrity": "sha512-kr5fwBGiGtmz6l0LSJIbno9QrifNMUusivHbnA1H6Dmqy4HZFte3UAICix1VuKo0lMPKQr2rqB+0BkKi/S3Ejg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@codemirror/autocomplete": "^6.0.0",
+ "@codemirror/language": "^6.0.0",
+ "@codemirror/state": "^6.0.0",
+ "@lezer/common": "^1.0.2",
+ "@lezer/css": "^1.1.7"
+ }
+ },
+ "node_modules/@codemirror/lang-html": {
+ "version": "6.4.10",
+ "resolved": "https://registry.npmjs.org/@codemirror/lang-html/-/lang-html-6.4.10.tgz",
+ "integrity": "sha512-h/SceTVsN5r+WE+TVP2g3KDvNoSzbSrtZXCKo4vkKdbfT5t4otuVgngGdFukOO/rwRD2++pCxoh6xD4TEVMkQA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@codemirror/autocomplete": "^6.0.0",
+ "@codemirror/lang-css": "^6.0.0",
+ "@codemirror/lang-javascript": "^6.0.0",
+ "@codemirror/language": "^6.4.0",
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.17.0",
+ "@lezer/common": "^1.0.0",
+ "@lezer/css": "^1.1.0",
+ "@lezer/html": "^1.3.0"
+ }
+ },
+ "node_modules/@codemirror/lang-javascript": {
+ "version": "6.2.4",
+ "resolved": "https://registry.npmjs.org/@codemirror/lang-javascript/-/lang-javascript-6.2.4.tgz",
+ "integrity": "sha512-0WVmhp1QOqZ4Rt6GlVGwKJN3KW7Xh4H2q8ZZNGZaP6lRdxXJzmjm4FqvmOojVj6khWJHIb9sp7U/72W7xQgqAA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@codemirror/autocomplete": "^6.0.0",
+ "@codemirror/language": "^6.6.0",
+ "@codemirror/lint": "^6.0.0",
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.17.0",
+ "@lezer/common": "^1.0.0",
+ "@lezer/javascript": "^1.0.0"
+ }
+ },
+ "node_modules/@codemirror/lang-xml": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/@codemirror/lang-xml/-/lang-xml-6.1.0.tgz",
+ "integrity": "sha512-3z0blhicHLfwi2UgkZYRPioSgVTo9PV5GP5ducFH6FaHy0IAJRg+ixj5gTR1gnT/glAIC8xv4w2VL1LoZfs+Jg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@codemirror/autocomplete": "^6.0.0",
+ "@codemirror/language": "^6.4.0",
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.0.0",
+ "@lezer/common": "^1.0.0",
+ "@lezer/xml": "^1.0.0"
+ }
+ },
+ "node_modules/@codemirror/language": {
+ "version": "6.11.3",
+ "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.11.3.tgz",
+ "integrity": "sha512-9HBM2XnwDj7fnu0551HkGdrUrrqmYq/WC5iv6nbY2WdicXdGbhR/gfbZOH73Aqj4351alY1+aoG9rCNfiwS1RA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.23.0",
+ "@lezer/common": "^1.1.0",
+ "@lezer/highlight": "^1.0.0",
+ "@lezer/lr": "^1.0.0",
+ "style-mod": "^4.0.0"
+ }
+ },
+ "node_modules/@codemirror/lint": {
+ "version": "6.8.5",
+ "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.8.5.tgz",
+ "integrity": "sha512-s3n3KisH7dx3vsoeGMxsbRAgKe4O1vbrnKBClm99PU0fWxmxsx5rR2PfqQgIt+2MMJBHbiJ5rfIdLYfB9NNvsA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.35.0",
+ "crelt": "^1.0.5"
+ }
+ },
+ "node_modules/@codemirror/search": {
+ "version": "6.5.11",
+ "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.5.11.tgz",
+ "integrity": "sha512-KmWepDE6jUdL6n8cAAqIpRmLPBZ5ZKnicE8oGU/s3QrAVID+0VhLFrzUucVKHG5035/BSykhExDL/Xm7dHthiA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.0.0",
+ "crelt": "^1.0.5"
+ }
+ },
+ "node_modules/@codemirror/state": {
+ "version": "6.5.2",
+ "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.5.2.tgz",
+ "integrity": "sha512-FVqsPqtPWKVVL3dPSxy8wEF/ymIEuVzF1PK3VbUgrxXpJUSHQWWZz4JMToquRxnkw+36LTamCZG2iua2Ptq0fA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@marijn/find-cluster-break": "^1.0.0"
+ }
+ },
+ "node_modules/@codemirror/theme-one-dark": {
+ "version": "6.1.3",
+ "resolved": "https://registry.npmjs.org/@codemirror/theme-one-dark/-/theme-one-dark-6.1.3.tgz",
+ "integrity": "sha512-NzBdIvEJmx6fjeremiGp3t/okrLPYT0d9orIc7AFun8oZcRk58aejkqhv6spnz4MLAevrKNPMQYXEWMg4s+sKA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@codemirror/language": "^6.0.0",
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.0.0",
+ "@lezer/highlight": "^1.0.0"
+ }
+ },
+ "node_modules/@codemirror/view": {
+ "version": "6.38.4",
+ "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.38.4.tgz",
+ "integrity": "sha512-hduz0suCcUSC/kM8Fq3A9iLwInJDl8fD1xLpTIk+5xkNm8z/FT7UsIa9sOXrkpChh+XXc18RzswE8QqELsVl+g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@codemirror/state": "^6.5.0",
+ "crelt": "^1.0.6",
+ "style-mod": "^4.1.0",
+ "w3c-keyname": "^2.2.4"
+ }
+ },
"node_modules/@colors/colors": {
"version": "1.5.0",
"dev": true,
@@ -848,6 +1012,81 @@
"@jridgewell/sourcemap-codec": "^1.4.10"
}
},
+ "node_modules/@lezer/common": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.2.3.tgz",
+ "integrity": "sha512-w7ojc8ejBqr2REPsWxJjrMFsA/ysDCFICn8zEOR9mrqzOu2amhITYuLD8ag6XZf0CFXDrhKqw7+tW8cX66NaDA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@lezer/css": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/@lezer/css/-/css-1.3.0.tgz",
+ "integrity": "sha512-pBL7hup88KbI7hXnZV3PQsn43DHy6TWyzuyk2AO9UyoXcDltvIdqWKE1dLL/45JVZ+YZkHe1WVHqO6wugZZWcw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@lezer/common": "^1.2.0",
+ "@lezer/highlight": "^1.0.0",
+ "@lezer/lr": "^1.3.0"
+ }
+ },
+ "node_modules/@lezer/highlight": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.1.tgz",
+ "integrity": "sha512-Z5duk4RN/3zuVO7Jq0pGLJ3qynpxUVsh7IbUbGj88+uV2ApSAn6kWg2au3iJb+0Zi7kKtqffIESgNcRXWZWmSA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@lezer/common": "^1.0.0"
+ }
+ },
+ "node_modules/@lezer/html": {
+ "version": "1.3.12",
+ "resolved": "https://registry.npmjs.org/@lezer/html/-/html-1.3.12.tgz",
+ "integrity": "sha512-RJ7eRWdaJe3bsiiLLHjCFT1JMk8m1YP9kaUbvu2rMLEoOnke9mcTVDyfOslsln0LtujdWespjJ39w6zo+RsQYw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@lezer/common": "^1.2.0",
+ "@lezer/highlight": "^1.0.0",
+ "@lezer/lr": "^1.0.0"
+ }
+ },
+ "node_modules/@lezer/javascript": {
+ "version": "1.5.4",
+ "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.5.4.tgz",
+ "integrity": "sha512-vvYx3MhWqeZtGPwDStM2dwgljd5smolYD2lR2UyFcHfxbBQebqx8yjmFmxtJ/E6nN6u1D9srOiVWm3Rb4tmcUA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@lezer/common": "^1.2.0",
+ "@lezer/highlight": "^1.1.3",
+ "@lezer/lr": "^1.3.0"
+ }
+ },
+ "node_modules/@lezer/lr": {
+ "version": "1.4.2",
+ "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.4.2.tgz",
+ "integrity": "sha512-pu0K1jCIdnQ12aWNaAVU5bzi7Bd1w54J3ECgANPmYLtQKP0HBj2cE/5coBD66MT10xbtIuUr7tg0Shbsvk0mDA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@lezer/common": "^1.0.0"
+ }
+ },
+ "node_modules/@lezer/xml": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/@lezer/xml/-/xml-1.0.6.tgz",
+ "integrity": "sha512-CdDwirL0OEaStFue/66ZmFSeppuL6Dwjlk8qk153mSQwiSH/Dlri4GNymrNWnUmPl2Um7QfV1FO9KFUyX3Twww==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@lezer/common": "^1.2.0",
+ "@lezer/highlight": "^1.0.0",
+ "@lezer/lr": "^1.0.0"
+ }
+ },
"node_modules/@lit-labs/context": {
"version": "0.4.1",
"license": "BSD-3-Clause",
@@ -1002,6 +1241,13 @@
"typescript": "^4.3.5"
}
},
+ "node_modules/@marijn/find-cluster-break": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/@marijn/find-cluster-break/-/find-cluster-break-1.0.2.tgz",
+ "integrity": "sha512-l0h88YhZFyKdXIFNfSWpyjStDjGHwZ/U7iobcK1cQQD8sejsONdQtTVU+1wVN1PBw40PiiHB1vA5S7VTfQiP9g==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/@material/animation": {
"version": "14.0.0-canary.53b3cad2f.0",
"license": "MIT",
@@ -2090,14 +2336,6 @@
"@types/qs": "*"
}
},
- "node_modules/@types/codemirror": {
- "version": "5.60.7",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@types/tern": "*"
- }
- },
"node_modules/@types/command-line-args": {
"version": "5.2.0",
"license": "MIT"
@@ -2354,14 +2592,6 @@
"version": "2.0.1",
"license": "MIT"
},
- "node_modules/@types/tern": {
- "version": "0.23.4",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@types/estree": "*"
- }
- },
"node_modules/@types/tough-cookie": {
"version": "4.0.2",
"license": "MIT"
@@ -3526,6 +3756,13 @@
"version": "1.0.3",
"license": "MIT"
},
+ "node_modules/crelt": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz",
+ "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/css-select": {
"version": "5.1.0",
"dev": true,
@@ -6749,19 +6986,31 @@
}
},
"node_modules/playground-elements": {
- "version": "0.20.0",
- "resolved": "https://registry.npmjs.org/playground-elements/-/playground-elements-0.20.0.tgz",
- "integrity": "sha512-H4Qs09V9r5THLgASfpeg0PzFySPPFBW4F0kS59LIlQxNyQCtrJd8eDu8jMTXIF3NFoV265cicdzYqRcILsjitw==",
- "dev": true,
- "license": "BSD-3-Clause",
- "dependencies": {
+ "version": "0.21.2",
+ "resolved": "https://registry.npmjs.org/playground-elements/-/playground-elements-0.21.2.tgz",
+ "integrity": "sha512-8TS4+cad34VsBF1lcQWcOcQZtPcNucRf+LEOUDLsM5oArYzAj0ZGtIYNZ77Hw2XdOehc9pfBtdBohP7L4vR3tw==",
+ "dev": true,
+ "dependencies": {
+ "@codemirror/autocomplete": "^6.18.6",
+ "@codemirror/commands": "^6.8.0",
+ "@codemirror/lang-css": "^6.3.1",
+ "@codemirror/lang-html": "^6.4.9",
+ "@codemirror/lang-javascript": "^6.2.3",
+ "@codemirror/lang-xml": "^6.1.0",
+ "@codemirror/language": "^6.11.0",
+ "@codemirror/lint": "^6.8.4",
+ "@codemirror/search": "^6.5.10",
+ "@codemirror/state": "^6.5.2",
+ "@codemirror/theme-one-dark": "^6.1.2",
+ "@codemirror/view": "^6.36.4",
+ "@lezer/highlight": "^1.2.1",
"@material/mwc-button": "^0.27.0",
"@material/mwc-icon-button": "^0.27.0",
"@material/mwc-linear-progress": "^0.27.0",
"@material/mwc-list": "^0.27.0",
"@material/mwc-menu": "^0.27.0",
"@material/mwc-textfield": "^0.27.0",
- "@types/codemirror": "^5.60.0",
+ "codemirror": "^6.0.1",
"comlink": "^4.4.1",
"fuse.js": "^7.0.0",
"lit": "^2.0.0 || ^3.0.0",
@@ -6769,6 +7018,22 @@
"vscode-languageserver-protocol": "^3.17.2"
}
},
+ "node_modules/playground-elements/node_modules/codemirror": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-6.0.2.tgz",
+ "integrity": "sha512-VhydHotNW5w1UGK0Qj96BwSk/Zqbp9WbnyK2W/eVMv4QyF41INRGpjUhFJY7/uDNuudSc33a/PKr4iDqRduvHw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@codemirror/autocomplete": "^6.0.0",
+ "@codemirror/commands": "^6.0.0",
+ "@codemirror/language": "^6.0.0",
+ "@codemirror/lint": "^6.0.0",
+ "@codemirror/search": "^6.0.0",
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.0.0"
+ }
+ },
"node_modules/playwright": {
"version": "1.28.1",
"hasInstallScript": true,
@@ -7853,6 +8118,13 @@
"url": "https://github.com/sponsors/Borewit"
}
},
+ "node_modules/style-mod": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.2.tgz",
+ "integrity": "sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/supports-color": {
"version": "5.5.0",
"license": "MIT",
@@ -8417,6 +8689,13 @@
"browser-process-hrtime": "^1.0.0"
}
},
+ "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,
+ "license": "MIT"
+ },
"node_modules/w3c-xmlserializer": {
"version": "2.0.0",
"license": "MIT",
diff --git a/package.json b/package.json
index a4db85262..3237cf7db 100644
--- a/package.json
+++ b/package.json
@@ -61,7 +61,7 @@
}
},
"devDependencies": {
- "playground-elements": "^0.20.0",
+ "playground-elements": "^0.21.2",
"prettier": "^2.1.2",
"typescript": "~4.7.4",
"wireit": "^0.14.12"
diff --git a/packages/lit-dev-content/site/articles/article/lit-cheat-sheet.md b/packages/lit-dev-content/site/articles/article/lit-cheat-sheet.md
index 0e4f8874c..ef24d8aae 100644
--- a/packages/lit-dev-content/site/articles/article/lit-cheat-sheet.md
+++ b/packages/lit-dev-content/site/articles/article/lit-cheat-sheet.md
@@ -400,7 +400,7 @@ Some better-supported alternatives to this approach may include:
- [Import Attributes](https://v8.dev/features/import-attributes) (external)
- [Import Attributes Browser Compatiblity Table](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import/with#browser_compatibility) (external)
- [Proposal Import Attributes](https://github.com/tc39/proposal-import-attributes) (external)
-- [Import JSON, CSS and more with import attributes](https://fullystacked.net/import-attributes/) (external)
+- [Import JSON, CSS and more with import attributes](https://olliewilliams.xyz/blog/import-attributes/) (external)
- [Using CSS Module Scripts to import stylesheets](https://web.dev/articles/constructable-stylesheets) (external)
- **NOTE:** The syntax of the import assertions proposal in this article was
deprecated in favor of import attribtues which uses `with` rather than
diff --git a/packages/lit-dev-content/site/css/code.css b/packages/lit-dev-content/site/css/code.css
index c823cdf30..7c666ab5d 100644
--- a/packages/lit-dev-content/site/css/code.css
+++ b/packages/lit-dev-content/site/css/code.css
@@ -10,7 +10,7 @@ body {
--playground-tab-bar-indicator-color: transparent;
}
-.CodeMirror {
+.cm-editor {
overflow-y: auto;
}
diff --git a/packages/lit-dev-content/site/css/codemirror.css b/packages/lit-dev-content/site/css/codemirror.css
index 20867e83d..ff2ab0bcf 100644
--- a/packages/lit-dev-content/site/css/codemirror.css
+++ b/packages/lit-dev-content/site/css/codemirror.css
@@ -1,73 +1,78 @@
/* TODO(aomarks) This should be published by playground-elements. It
externalizes the styles that are shared between scoped and SSR playgrounds */
-.CodeMirror {
+.cm-editor {
font-size: var(--playground-code-font-size, inherit);
color: var(--playground-code-default-color, #000);
background: var(--playground-code-background, #fff);
padding: var(--litdev-code-padding);
}
-.CodeMirror pre.CodeMirror-line {
+.cm-editor .cm-line {
margin: 0;
+ white-space: pre;
font-family: var(--playground-code-font-family, monospace);
line-height: var(--playground-code-line-height, 1.7em);
}
-.cm-keyword {
+/* CodeMirror 6 token-based classes */
+.tok-keyword {
color: var(--playground-code-keyword-color, #708);
}
-.cm-atom {
+.tok-atom,
+.tok-literal {
color: var(--playground-code-atom-color, #219);
}
-.cm-number {
+.tok-number {
color: var(--playground-code-number-color, #164);
}
-.cm-def {
+.tok-bool {
+ color: var(--playground-code-bool-color, var(--playground-code-atom-color, #219));
+}
+.tok-definition {
color: var(--playground-code-def-color, #00f);
}
-.cm-variable {
+.tok-variableName {
color: var(--playground-code-variable-color, #000);
}
-.cm-property {
+.tok-propertyName {
color: var(--playground-code-property-color, #000);
}
-.cm-operator {
+.tok-operator {
color: var(--playground-code-operator-color, #000);
}
-.cm-variable-2 {
+.tok-variableName2 {
color: var(--playground-code-variable-2-color, #05a);
}
-.cm-variable-3 {
+.tok-namespace {
color: var(--playground-code-variable-3-color, #085);
}
-.cm-type {
+.tok-typeName,
+.tok-className {
color: var(--playground-code-type-color, #085);
}
-.cm-comment {
+.tok-comment {
color: var(--playground-code-comment-color, #a50);
}
-.cm-string {
+.tok-string {
color: var(--playground-code-string-color, #a11);
}
-.cm-string-2 {
+.tok-string2 {
color: var(--playground-code-string-2-color, #f50);
}
-.cm-meta {
+.tok-meta {
color: var(--playground-code-meta-color, #555);
}
-.cm-qualifier {
+.tok-modifier {
color: var(--playground-code-qualifier-color, #555);
}
-.cm-builtin {
+.tok-standard,
+.tok-labelName {
color: var(--playground-code-builtin-color, #30a);
}
-.cm-tag {
+.tok-tagName {
color: var(--playground-code-tag-color, #170);
}
-.cm-attribute {
+.tok-attributeName {
color: var(--playground-code-attribute-color, #00c);
}
-.cm-callee {
- color: var(--playground-code-callee-color, #000);
-}
diff --git a/packages/lit-dev-content/site/css/docs.css b/packages/lit-dev-content/site/css/docs.css
index dc94c35bc..908b565d6 100644
--- a/packages/lit-dev-content/site/css/docs.css
+++ b/packages/lit-dev-content/site/css/docs.css
@@ -122,7 +122,7 @@ article pre>code:not([class]) {
}
/* Static code snippets */
-.CodeMirror {
+.cm-editor {
border: var(--sys-color-outline-variant);
}
@@ -150,7 +150,7 @@ litdev-example {
height: calc(var(--litdev-example-bar-height) + var(--litdev-example-editor-height) + var(--litdev-example-preview-height));
}
-.CodeMirror,
+.cm-editor,
litdev-example {
font-size: 0.85em;
border-radius: 5px;
diff --git a/packages/lit-dev-content/site/css/home/3-tour.css b/packages/lit-dev-content/site/css/home/3-tour.css
index a86d43e3d..88ef6d480 100644
--- a/packages/lit-dev-content/site/css/home/3-tour.css
+++ b/packages/lit-dev-content/site/css/home/3-tour.css
@@ -75,8 +75,8 @@ body.dark #tourCode .tourHighlight.active {
}
}
-#tourCode .CodeMirror-line,
-#tourCode .CodeMirror-line > span {
+#tourCode .cm-line,
+#tourCode .cm-line > span {
z-index: 0;
position: relative;
}
diff --git a/packages/lit-dev-content/site/home/3-tour.html b/packages/lit-dev-content/site/home/3-tour.html
index 3057b4fe8..6dea8e7e5 100644
--- a/packages/lit-dev-content/site/home/3-tour.html
+++ b/packages/lit-dev-content/site/home/3-tour.html
@@ -4,13 +4,13 @@
$1' + ); + } + return html; }; @@ -160,7 +173,8 @@ export const playgroundPlugin = ( eleventyConfig.addPairedShortcode( 'highlight', - (code: string, lang: 'js' | 'ts' | 'html' | 'css') => render(code, lang) + (code: string, lang: 'js' | 'ts' | 'html' | 'css', makePre = false) => + render(code, lang, makePre) ); eleventyConfig.addMarkdownHighlighter( diff --git a/packages/lit-dev-tools-cjs/src/playground-plugin/renderer.ts b/packages/lit-dev-tools-cjs/src/playground-plugin/renderer.ts index abd826e34..76f0cc2fa 100644 --- a/packages/lit-dev-tools-cjs/src/playground-plugin/renderer.ts +++ b/packages/lit-dev-tools-cjs/src/playground-plugin/renderer.ts @@ -107,36 +107,26 @@ export class Renderer { editor.type = lang; editor.value = code; await editor.updateComplete; - const cm = editor.shadowRoot.querySelector('.CodeMirror-code'); + const cm = editor.shadowRoot.querySelector('.cm-content'); if (cm === null) { throw new Error( - '