Removes webview playground.
This commit is contained in:
@@ -1,35 +0,0 @@
|
||||
import * as React from "react";
|
||||
import * as ReactDOM from "react-dom";
|
||||
import "./style.scss";
|
||||
import * as Components from "./playground/index";
|
||||
|
||||
const url = new URL(window.location.href);
|
||||
|
||||
const theme = url.searchParams.get("theme");
|
||||
if (theme && theme === "dark") {
|
||||
require("./vscode-dark.scss");
|
||||
} else {
|
||||
require("./vscode-light.scss");
|
||||
}
|
||||
|
||||
function render(target: HTMLDivElement) {
|
||||
const c = require("./playground/index") as typeof Components;
|
||||
ReactDOM.render(<c.Playground />, target);
|
||||
}
|
||||
|
||||
const target = document.createElement("div");
|
||||
target.className = "target";
|
||||
document.body.appendChild(target);
|
||||
|
||||
render(target);
|
||||
|
||||
declare var module: {
|
||||
hot?: { accept: (componentName: string, callback: () => void) => void };
|
||||
};
|
||||
declare var require: (name: string) => any;
|
||||
|
||||
if (module.hot) {
|
||||
module.hot.accept("./playground/index", () => {
|
||||
render(target);
|
||||
});
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
import * as React from "react";
|
||||
import "../style.scss";
|
||||
import { DecoratedGridComponent } from "@hediet/visualization";
|
||||
import { observable } from "mobx";
|
||||
import { observer } from "mobx-react";
|
||||
|
||||
@observer
|
||||
export class Playground extends React.Component {
|
||||
@observable
|
||||
private phase = 0;
|
||||
|
||||
componentDidMount() {
|
||||
setInterval(() => {
|
||||
this.phase++;
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
background: "lightgray",
|
||||
padding: 10,
|
||||
}}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
background: "white",
|
||||
}}
|
||||
>
|
||||
<DecoratedGridComponent
|
||||
data={{
|
||||
kind: { array: true },
|
||||
rows: [
|
||||
{
|
||||
columns: [
|
||||
[
|
||||
{ tag: "h" },
|
||||
{ tag: "e" },
|
||||
{ tag: "l" },
|
||||
{ tag: "l" },
|
||||
{ tag: "o" },
|
||||
],
|
||||
[
|
||||
{ tag: "e" },
|
||||
{ tag: "h" },
|
||||
{ tag: "l" },
|
||||
{ tag: "l" },
|
||||
{ tag: "o" },
|
||||
],
|
||||
][this.phase % 2],
|
||||
},
|
||||
],
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -7,12 +7,8 @@ import { CleanWebpackPlugin } from "clean-webpack-plugin";
|
||||
|
||||
const r = (file: string) => path.resolve(__dirname, file);
|
||||
|
||||
const mode = process.argv.some(v => v === "--playground")
|
||||
? "playground"
|
||||
: "default";
|
||||
|
||||
module.exports = {
|
||||
entry: [mode === "default" ? r("src/index.tsx") : r("src/playground.tsx")],
|
||||
entry: [r("src/index.tsx")],
|
||||
output: {
|
||||
path: r("dist"),
|
||||
filename: "[name].js",
|
||||
@@ -47,15 +43,12 @@ module.exports = {
|
||||
}),
|
||||
new ForkTsCheckerWebpackPlugin(),
|
||||
new CleanWebpackPlugin(),
|
||||
new MonacoWebpackPlugin({
|
||||
// Add more languages here once webworker issues are solved.
|
||||
languages: ["typescript"],
|
||||
}),
|
||||
];
|
||||
if (mode === "default") {
|
||||
plugins.push(
|
||||
new MonacoWebpackPlugin({
|
||||
// Add more languages here once webworker issues are solved.
|
||||
languages: ["typescript"],
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
return plugins;
|
||||
})(),
|
||||
} as webpack.Configuration;
|
||||
|
||||
Reference in New Issue
Block a user