Upgrade playground dependencies (#5830)

<!--
Thank you for contributing to Ruff! To help us out with reviewing, please consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

This PR upgrades the playground's runtime and dev dependencies

<!-- What's the purpose of the change? What does it do, and why? -->

## Test Plan

I tested the playground locally

<!-- How was it tested? -->
This commit is contained in:
Micha Reiser 2023-07-18 08:00:54 +02:00 committed by GitHub
parent a4e5e3205f
commit 9ddf40455d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 1538 additions and 3379 deletions

View file

@ -0,0 +1,2 @@
**.md
pkg

View file

@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />

File diff suppressed because it is too large Load diff

View file

@ -16,27 +16,27 @@
"@monaco-editor/react": "^4.4.6",
"classnames": "^2.3.2",
"lz-string": "^1.4.4",
"monaco-editor": "^0.34.1",
"monaco-editor": "^0.40.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.9",
"@typescript-eslint/eslint-plugin": "^5.47.1",
"@typescript-eslint/parser": "^5.47.1",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@vitejs/plugin-react-swc": "^3.0.0",
"autoprefixer": "^10.4.13",
"eslint": "^8.30.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "^7.31.11",
"eslint-plugin-react-hooks": "^4.6.0",
"postcss": "^8.4.20",
"prettier": "^2.8.1",
"prettier": "^3.0.0",
"tailwindcss": "^3.2.4",
"typescript": "^4.9.3",
"typescript": "^5.1.6",
"vite": "^4.0.0"
}
}

View file

@ -24,7 +24,7 @@ export function stringify(settings: Settings): string {
*/
export async function persist(settingsSource: string, pythonSource: string) {
const hash = lzstring.compressToEncodedURIComponent(
settingsSource + "$$$" + pythonSource,
settingsSource.replaceAll("$$$", "$$$$$$") + "$$$" + pythonSource,
);
await navigator.clipboard.writeText(
window.location.href.split("#")[0] + "#" + hash,
@ -39,11 +39,9 @@ export function restore(): [string, string] | null {
window.location.hash.slice(1),
);
if (value) {
const parts = value.split("$$$");
const settingsSource = parts[0];
const pythonSource = parts[1];
return [settingsSource, pythonSource];
if (value != null) {
const [settingsSource, pythonSource] = value.split("$$$");
return [settingsSource.replaceAll("$$$$$$", "$$$"), pythonSource];
} else {
return null;
}