Merge branch 'main' into samstrohkorbatt/python-fstring
commit
c869a186ff
|
@ -5,7 +5,7 @@
|
|||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Monaco Editor Playground",
|
||||
"name": "Monaco Editor Playground (Languages from source, needs 'npm run watch', no JSON/CSS/... workers!)",
|
||||
"type": "chrome",
|
||||
"request": "launch",
|
||||
"url": "https://microsoft.github.io/monaco-editor/playground.html?sourceLanguages=http%3A%2F%2Flocalhost%3A5002%2Fout%2Flanguages%2Famd-tsc",
|
||||
|
@ -15,6 +15,17 @@
|
|||
"order": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Monaco Editor Playground (Languages locally bundled, needs 'npm run build')",
|
||||
"type": "chrome",
|
||||
"request": "launch",
|
||||
"url": "https://microsoft.github.io/monaco-editor/playground.html?sourceLanguages=http%3A%2F%2Flocalhost%3A5002%2Fout%2Flanguages%2Fbundled%2Famd-dev%2Fvs",
|
||||
"preLaunchTask": "Launch Http Server",
|
||||
"presentation": {
|
||||
"group": "monaco",
|
||||
"order": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Website",
|
||||
"type": "chrome",
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
"style-loader": "^3.3.1",
|
||||
"terser": "^5.14.2",
|
||||
"ts-node": "^10.6.0",
|
||||
"typescript": "^5.0.2",
|
||||
"typescript": "^5.4.5",
|
||||
"vite": "^3.2.8",
|
||||
"vscode-css-languageservice": "6.2.14",
|
||||
"vscode-html-languageservice": "5.2.0",
|
||||
|
@ -6905,16 +6905,16 @@
|
|||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.2.tgz",
|
||||
"integrity": "sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==",
|
||||
"version": "5.4.5",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
|
||||
"integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.20"
|
||||
"node": ">=14.17"
|
||||
}
|
||||
},
|
||||
"node_modules/union": {
|
||||
|
@ -12206,9 +12206,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"typescript": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.2.tgz",
|
||||
"integrity": "sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==",
|
||||
"version": "5.4.5",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
|
||||
"integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
|
||||
"dev": true
|
||||
},
|
||||
"union": {
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
"style-loader": "^3.3.1",
|
||||
"terser": "^5.14.2",
|
||||
"ts-node": "^10.6.0",
|
||||
"typescript": "^5.0.2",
|
||||
"typescript": "^5.4.5",
|
||||
"vite": "^3.2.8",
|
||||
"vscode-css-languageservice": "6.2.14",
|
||||
"vscode-html-languageservice": "5.2.0",
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
"monaco-editor": "^0.32.0",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"typescript": "^5.0.2",
|
||||
"typescript": "^5.4.5",
|
||||
"vite": "^2.9.17"
|
||||
}
|
||||
},
|
||||
|
@ -1379,16 +1379,16 @@
|
|||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.2.tgz",
|
||||
"integrity": "sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==",
|
||||
"version": "5.4.5",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
|
||||
"integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.20"
|
||||
"node": ">=14.17"
|
||||
}
|
||||
},
|
||||
"node_modules/vite": {
|
||||
|
@ -2319,9 +2319,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"typescript": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.2.tgz",
|
||||
"integrity": "sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==",
|
||||
"version": "5.4.5",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
|
||||
"integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
|
||||
"dev": true
|
||||
},
|
||||
"vite": {
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"@types/react": "^17.0.39",
|
||||
"@types/react-dom": "^17.0.11",
|
||||
"@vitejs/plugin-react": "^1.1.4",
|
||||
"typescript": "^5.0.2",
|
||||
"typescript": "^5.4.5",
|
||||
"vite": "^2.9.17"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
"style-loader": "^3.3.1",
|
||||
"terser-webpack-plugin": "^5.3.1",
|
||||
"ts-loader": "^9.2.6",
|
||||
"typescript": "^5.0.2",
|
||||
"typescript": "^5.4.5",
|
||||
"webpack": "^5.76.0",
|
||||
"webpack-cli": "^4.9.2",
|
||||
"webpack-dev-server": "^4.7.4",
|
||||
|
@ -4113,16 +4113,16 @@
|
|||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.2.tgz",
|
||||
"integrity": "sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==",
|
||||
"version": "5.4.5",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
|
||||
"integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.20"
|
||||
"node": ">=14.17"
|
||||
}
|
||||
},
|
||||
"node_modules/universalify": {
|
||||
|
@ -7196,9 +7196,9 @@
|
|||
}
|
||||
},
|
||||
"typescript": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.2.tgz",
|
||||
"integrity": "sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==",
|
||||
"version": "5.4.5",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
|
||||
"integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
|
||||
"dev": true
|
||||
},
|
||||
"universalify": {
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
"style-loader": "^3.3.1",
|
||||
"terser-webpack-plugin": "^5.3.1",
|
||||
"ts-loader": "^9.2.6",
|
||||
"typescript": "^5.0.2",
|
||||
"typescript": "^5.4.5",
|
||||
"webpack-cli": "^4.9.2",
|
||||
"webpack-dev-server": "^4.7.4",
|
||||
"webpack": "^5.76.0",
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as mode from './jsonMode';
|
||||
import { Emitter, IEvent, languages, Uri } from 'monaco-editor-core';
|
||||
import { Emitter, IEvent, languages, Uri } from '../../fillers/monaco-editor-core';
|
||||
|
||||
// ---- JSON service types ----
|
||||
export interface BaseASTNode {
|
||||
|
|
|
@ -12,6 +12,7 @@ export const libFileSet: Record<string, boolean> = {}
|
|||
libFileSet['lib.d.ts'] = true;
|
||||
libFileSet['lib.decorators.d.ts'] = true;
|
||||
libFileSet['lib.decorators.legacy.d.ts'] = true;
|
||||
libFileSet['lib.dom.asynciterable.d.ts'] = true;
|
||||
libFileSet['lib.dom.d.ts'] = true;
|
||||
libFileSet['lib.dom.iterable.d.ts'] = true;
|
||||
libFileSet['lib.es2015.collection.d.ts'] = true;
|
||||
|
@ -27,7 +28,9 @@ libFileSet['lib.es2015.symbol.wellknown.d.ts'] = true;
|
|||
libFileSet['lib.es2016.array.include.d.ts'] = true;
|
||||
libFileSet['lib.es2016.d.ts'] = true;
|
||||
libFileSet['lib.es2016.full.d.ts'] = true;
|
||||
libFileSet['lib.es2016.intl.d.ts'] = true;
|
||||
libFileSet['lib.es2017.d.ts'] = true;
|
||||
libFileSet['lib.es2017.date.d.ts'] = true;
|
||||
libFileSet['lib.es2017.full.d.ts'] = true;
|
||||
libFileSet['lib.es2017.intl.d.ts'] = true;
|
||||
libFileSet['lib.es2017.object.d.ts'] = true;
|
||||
|
@ -74,14 +77,21 @@ libFileSet['lib.es2022.regexp.d.ts'] = true;
|
|||
libFileSet['lib.es2022.sharedmemory.d.ts'] = true;
|
||||
libFileSet['lib.es2022.string.d.ts'] = true;
|
||||
libFileSet['lib.es2023.array.d.ts'] = true;
|
||||
libFileSet['lib.es2023.collection.d.ts'] = true;
|
||||
libFileSet['lib.es2023.d.ts'] = true;
|
||||
libFileSet['lib.es2023.full.d.ts'] = true;
|
||||
libFileSet['lib.es5.d.ts'] = true;
|
||||
libFileSet['lib.es6.d.ts'] = true;
|
||||
libFileSet['lib.esnext.collection.d.ts'] = true;
|
||||
libFileSet['lib.esnext.d.ts'] = true;
|
||||
libFileSet['lib.esnext.decorators.d.ts'] = true;
|
||||
libFileSet['lib.esnext.disposable.d.ts'] = true;
|
||||
libFileSet['lib.esnext.full.d.ts'] = true;
|
||||
libFileSet['lib.esnext.intl.d.ts'] = true;
|
||||
libFileSet['lib.esnext.object.d.ts'] = true;
|
||||
libFileSet['lib.esnext.promise.d.ts'] = true;
|
||||
libFileSet['lib.scripthost.d.ts'] = true;
|
||||
libFileSet['lib.webworker.asynciterable.d.ts'] = true;
|
||||
libFileSet['lib.webworker.d.ts'] = true;
|
||||
libFileSet['lib.webworker.importscripts.d.ts'] = true;
|
||||
libFileSet['lib.webworker.iterable.d.ts'] = true;
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -2,4 +2,4 @@
|
|||
// **NOTE**: Do not edit directly! This file is generated using `npm run import-typescript`
|
||||
//
|
||||
|
||||
export const typescriptVersion = "5.0.2";
|
||||
export const typescriptVersion = "5.4.5";
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
"glob": "^7.2.0",
|
||||
"monaco-editor": "^0.32.0",
|
||||
"style-loader": "^3.3.1",
|
||||
"typescript": "^5.0.2",
|
||||
"typescript": "^5.4.5",
|
||||
"webpack": "^5.68.0",
|
||||
"webpack-cli": "^4.9.2"
|
||||
},
|
||||
|
@ -1628,16 +1628,16 @@
|
|||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.2.tgz",
|
||||
"integrity": "sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==",
|
||||
"version": "5.4.5",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
|
||||
"integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.20"
|
||||
"node": ">=14.17"
|
||||
}
|
||||
},
|
||||
"node_modules/uri-js": {
|
||||
|
@ -2995,9 +2995,9 @@
|
|||
}
|
||||
},
|
||||
"typescript": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.2.tgz",
|
||||
"integrity": "sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==",
|
||||
"version": "5.4.5",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
|
||||
"integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
|
||||
"dev": true
|
||||
},
|
||||
"uri-js": {
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
"glob": "^7.2.0",
|
||||
"monaco-editor": "^0.32.0",
|
||||
"style-loader": "^3.3.1",
|
||||
"typescript": "^5.0.2",
|
||||
"typescript": "^5.4.5",
|
||||
"webpack": "^5.68.0",
|
||||
"webpack-cli": "^4.9.2"
|
||||
},
|
||||
|
|
|
@ -28,7 +28,8 @@
|
|||
"react": "^17.0.2",
|
||||
"react-bootstrap": "^2.4.0",
|
||||
"react-dom": "^17.0.2",
|
||||
"typedoc": "^0.23.26"
|
||||
"typedoc": "^0.25.12",
|
||||
"@vscode/web-editors": "./vscode-web-editors.tgz"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/classnames": "^2.3.1",
|
||||
|
@ -50,7 +51,7 @@
|
|||
"style-loader": "^1.1.3",
|
||||
"ts-loader": "^9.3.1",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^5.0.2",
|
||||
"typescript": "^5.4.5",
|
||||
"webpack": "^5.90.1",
|
||||
"webpack-bundle-analyzer": "^4.5.0",
|
||||
"webpack-cli": "^4.10.0",
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"strict": true,
|
||||
"outDir": "dist",
|
||||
"skipLibCheck": true,
|
||||
"rootDir": ".",
|
||||
"resolveJsonModule": true,
|
||||
"newLine": "LF",
|
||||
"sourceMap": true,
|
||||
"jsx": "react",
|
||||
"experimentalDecorators": true,
|
||||
"useDefineForClassFields": false,
|
||||
"noEmit": true
|
||||
},
|
||||
"include": ["**/*", "../node_modules/monaco-editor/monaco.d.ts"]
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
import React = require("react");
|
||||
import * as React from "react";
|
||||
import { home, playground, docs, monarch } from "../pages/routes";
|
||||
import { Container, Navbar, Nav, NavDropdown } from "./bootstrap";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React = require("react");
|
||||
import * as React from "react";
|
||||
import { PageNav } from "./Nav";
|
||||
|
||||
export function Page(props: { children: React.ReactNode }) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { observer } from "mobx-react";
|
||||
import React = require("react");
|
||||
import * as React from "react";
|
||||
import { IReference } from "../utils/ref";
|
||||
import { Form } from "./bootstrap";
|
||||
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as packageJson from "monaco-editor/package.json";
|
||||
import packageJson from "monaco-editor/package.json";
|
||||
|
||||
export const monacoEditorVersion = packageJson.version;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Home } from "./home/Home";
|
||||
import { PlaygroundPage } from "./playground/PlaygroundPage";
|
||||
import { docs, home, monarch, playground } from "./routes";
|
||||
import React = require("react");
|
||||
import * as React from "react";
|
||||
import { DocsPage } from "./DocsPage";
|
||||
import { MonarchPage } from "./MonarchPage";
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import {
|
|||
IHistoryModel,
|
||||
ILocation,
|
||||
} from "../utils/ObservableHistory";
|
||||
import React = require("react");
|
||||
import * as React from "react";
|
||||
|
||||
export class DocsPage extends React.Component implements IHistoryModel {
|
||||
private _lastIFrame: HTMLIFrameElement | null = null;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React = require("react");
|
||||
import * as React from "react";
|
||||
import { Page } from "../components/Page";
|
||||
|
||||
export class MonarchPage extends React.Component<{}, {}> {
|
||||
|
|
|
@ -8,7 +8,7 @@ import {
|
|||
ControlledMonacoEditor,
|
||||
} from "../../components/monaco/MonacoEditor";
|
||||
import { ObservablePromise } from "../../utils/ObservablePromise";
|
||||
import React = require("react");
|
||||
import * as React from "react";
|
||||
import { ref } from "../../utils/ref";
|
||||
import { monacoEditorVersion } from "../../monacoEditorVersion";
|
||||
|
||||
|
|
|
@ -38,13 +38,18 @@ export class LocationModel implements IHistoryModel {
|
|||
*/
|
||||
@observable historyId: number = 0;
|
||||
|
||||
constructor(private readonly model: PlaygroundModel) {
|
||||
this.dispose.track(
|
||||
new HistoryController((initialLocation) => {
|
||||
this.updateLocation(initialLocation);
|
||||
return this;
|
||||
})
|
||||
);
|
||||
constructor(
|
||||
private readonly model: PlaygroundModel,
|
||||
createHistoryController = true
|
||||
) {
|
||||
if (createHistoryController) {
|
||||
this.dispose.track(
|
||||
new HistoryController((initialLocation) => {
|
||||
this.updateLocation(initialLocation);
|
||||
return this;
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
get location(): ILocation {
|
||||
|
|
|
@ -30,6 +30,7 @@ import {
|
|||
} from "./SettingsModel";
|
||||
import { BisectModel } from "./BisectModel";
|
||||
import { LocationModel } from "./LocationModel";
|
||||
import { createJsonWebEditorClient, vObj, vString } from "@vscode/web-editors";
|
||||
|
||||
export class PlaygroundModel {
|
||||
public readonly dispose = Disposable.fn();
|
||||
|
@ -47,7 +48,25 @@ export class PlaygroundModel {
|
|||
@observable
|
||||
public reloadKey = 0;
|
||||
|
||||
public readonly historyModel = new LocationModel(this);
|
||||
private readonly webEditorClient = createJsonWebEditorClient(
|
||||
vObj({
|
||||
js: vString(),
|
||||
html: vString(),
|
||||
css: vString(),
|
||||
}),
|
||||
(data) => {
|
||||
runInAction(() => {
|
||||
this.html = data.html;
|
||||
this.js = data.js;
|
||||
this.css = data.css;
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
public readonly historyModel = new LocationModel(
|
||||
this,
|
||||
this.webEditorClient === undefined
|
||||
);
|
||||
|
||||
public reload(): void {
|
||||
this.reloadKey++;
|
||||
|
@ -163,6 +182,17 @@ export class PlaygroundModel {
|
|||
constructor() {
|
||||
let lastState: IPreviewState | undefined = undefined;
|
||||
|
||||
this.webEditorClient?.onDidConnect.then(() => {
|
||||
autorun(() => {
|
||||
const state = this.playgroundProject;
|
||||
this.webEditorClient!.updateContent({
|
||||
js: state.js,
|
||||
html: state.html,
|
||||
css: state.css,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
this.dispose.track({
|
||||
dispose: reaction(
|
||||
() => ({ state: this.state }),
|
||||
|
|
|
@ -42,7 +42,12 @@ export class SettingsModel {
|
|||
}
|
||||
|
||||
constructor() {
|
||||
const settingsStr = localStorage.getItem(this.settingsKey);
|
||||
const settingsStr = "";
|
||||
try {
|
||||
localStorage.getItem(this.settingsKey);
|
||||
} catch (e) {
|
||||
console.error("Failed to load settings from localStorage", e);
|
||||
}
|
||||
if (settingsStr) {
|
||||
this._settings = JSON.parse(settingsStr);
|
||||
} else {
|
||||
|
@ -54,7 +59,11 @@ export class SettingsModel {
|
|||
setSettings(settings: Settings): void {
|
||||
const settingsJson = JSON.stringify(toJS(settings));
|
||||
this._settings = JSON.parse(settingsJson);
|
||||
localStorage.setItem(this.settingsKey, settingsJson);
|
||||
try {
|
||||
localStorage.setItem(this.settingsKey, settingsJson);
|
||||
} catch (e) {
|
||||
console.error("Failed to save settings to localStorage", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import { normalizeLineEnding } from "./utils";
|
||||
import { IPlaygroundProject } from "../../../shared";
|
||||
|
||||
export function findLastIndex<T>(
|
||||
|
|
|
@ -2,18 +2,15 @@
|
|||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node16",
|
||||
"moduleResolution": "Node",
|
||||
"strict": true,
|
||||
"outDir": "dist",
|
||||
"skipLibCheck": true,
|
||||
"rootDir": "./src",
|
||||
"resolveJsonModule": true,
|
||||
"newLine": "LF",
|
||||
"sourceMap": true,
|
||||
"jsx": "react",
|
||||
"experimentalDecorators": true,
|
||||
// to enable mobx decorators
|
||||
"useDefineForClassFields": false
|
||||
"useDefineForClassFields": false,
|
||||
"noEmit": true
|
||||
},
|
||||
"include": ["src/**/*", "./node_modules/monaco-editor/monaco.d.ts"]
|
||||
"exclude": ["src/**/*", "./node_modules/monaco-editor/monaco.d.ts"]
|
||||
}
|
||||
|
|
Binary file not shown.
|
@ -487,6 +487,10 @@
|
|||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
"@vscode/web-editors@./vscode-web-editors.tgz":
|
||||
version "0.1.0"
|
||||
resolved "./vscode-web-editors.tgz#657c1b47d50dfd1a457f660e3184fb88121f8b24"
|
||||
|
||||
"@webassemblyjs/ast@1.11.6", "@webassemblyjs/ast@^1.11.5":
|
||||
version "1.11.6"
|
||||
resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.6.tgz#db046555d3c413f8966ca50a95176a0e2c642e24"
|
||||
|
@ -2054,7 +2058,7 @@ make-error@^1.1.1:
|
|||
resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
|
||||
integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==
|
||||
|
||||
marked@^4.2.12:
|
||||
marked@^4.3.0:
|
||||
version "4.3.0"
|
||||
resolved "https://registry.yarnpkg.com/marked/-/marked-4.3.0.tgz#796362821b019f734054582038b116481b456cf3"
|
||||
integrity sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==
|
||||
|
@ -2145,13 +2149,6 @@ minimatch@^3.1.1:
|
|||
dependencies:
|
||||
brace-expansion "^1.1.7"
|
||||
|
||||
minimatch@^7.1.3:
|
||||
version "7.4.3"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-7.4.3.tgz#012cbf110a65134bb354ae9773b55256cdb045a2"
|
||||
integrity sha512-5UB4yYusDtkRPbRiy1cqZ1IpGNcJCGlEMG17RKzPddpyiPKoCdwohbED8g4QXT0ewCt8LTkQXuljsUfQ3FKM4A==
|
||||
dependencies:
|
||||
brace-expansion "^2.0.1"
|
||||
|
||||
minimatch@^7.4.1:
|
||||
version "7.4.2"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-7.4.2.tgz#157e847d79ca671054253b840656720cb733f10f"
|
||||
|
@ -2159,6 +2156,13 @@ minimatch@^7.4.1:
|
|||
dependencies:
|
||||
brace-expansion "^2.0.1"
|
||||
|
||||
minimatch@^9.0.3:
|
||||
version "9.0.4"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.4.tgz#8e49c731d1749cbec05050ee5145147b32496a51"
|
||||
integrity sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==
|
||||
dependencies:
|
||||
brace-expansion "^2.0.1"
|
||||
|
||||
minimist@^1.2.0:
|
||||
version "1.2.8"
|
||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c"
|
||||
|
@ -2972,10 +2976,10 @@ shebang-regex@^3.0.0:
|
|||
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
|
||||
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
|
||||
|
||||
shiki@^0.14.1:
|
||||
version "0.14.1"
|
||||
resolved "https://registry.yarnpkg.com/shiki/-/shiki-0.14.1.tgz#9fbe082d0a8aa2ad63df4fbf2ee11ec924aa7ee1"
|
||||
integrity sha512-+Jz4nBkCBe0mEDqo1eKRcCdjRtrCjozmcbTUjbPTX7OOJfEbTZzlUWlZtGe3Gb5oV1/jnojhG//YZc3rs9zSEw==
|
||||
shiki@^0.14.7:
|
||||
version "0.14.7"
|
||||
resolved "https://registry.yarnpkg.com/shiki/-/shiki-0.14.7.tgz#c3c9e1853e9737845f1d2ef81b31bcfb07056d4e"
|
||||
integrity sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==
|
||||
dependencies:
|
||||
ansi-sequence-parser "^1.1.0"
|
||||
jsonc-parser "^3.2.0"
|
||||
|
@ -3233,20 +3237,20 @@ type-is@~1.6.18:
|
|||
media-typer "0.3.0"
|
||||
mime-types "~2.1.24"
|
||||
|
||||
typedoc@^0.23.26:
|
||||
version "0.23.28"
|
||||
resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.23.28.tgz#3ce9c36ef1c273fa849d2dea18651855100d3ccd"
|
||||
integrity sha512-9x1+hZWTHEQcGoP7qFmlo4unUoVJLB0H/8vfO/7wqTnZxg4kPuji9y3uRzEu0ZKez63OJAUmiGhUrtukC6Uj3w==
|
||||
typedoc@^0.25.12:
|
||||
version "0.25.13"
|
||||
resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.25.13.tgz#9a98819e3b2d155a6d78589b46fa4c03768f0922"
|
||||
integrity sha512-pQqiwiJ+Z4pigfOnnysObszLiU3mVLWAExSPf+Mu06G/qsc3wzbuM56SZQvONhHLncLUhYzOVkjFFpFfL5AzhQ==
|
||||
dependencies:
|
||||
lunr "^2.3.9"
|
||||
marked "^4.2.12"
|
||||
minimatch "^7.1.3"
|
||||
shiki "^0.14.1"
|
||||
marked "^4.3.0"
|
||||
minimatch "^9.0.3"
|
||||
shiki "^0.14.7"
|
||||
|
||||
typescript@^5.0.2:
|
||||
version "5.0.2"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.2.tgz#891e1a90c5189d8506af64b9ef929fca99ba1ee5"
|
||||
integrity sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==
|
||||
typescript@^5.4.5:
|
||||
version "5.4.5"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.5.tgz#42ccef2c571fdbd0f6718b1d1f5e6e5ef006f611"
|
||||
integrity sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==
|
||||
|
||||
uncontrollable@^7.2.1:
|
||||
version "7.2.1"
|
||||
|
|
Loading…
Reference in New Issue