Skip to content

Commit 3f82805

Browse files
committed
update docs
Signed-off-by: danieloprado <[email protected]>
1 parent 6956f3f commit 3f82805

File tree

190 files changed

+350
-347
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+350
-347
lines changed

docs/asset-manifest.json

Lines changed: 120 additions & 122 deletions
Large diffs are not rendered by default.

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="manifest" href="/material-ui/manifest.json"><link rel="shortcut icon" href="/material-ui/favicon.ico"><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700"><title>React App</title><link href="/material-ui/static/css/main.e52650ce.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script type="text/javascript" src="/material-ui/static/js/main.763546c1.js"></script></body></html>
1+
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="manifest" href="/material-ui/manifest.json"><link rel="shortcut icon" href="/material-ui/favicon.ico"><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700"><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.16.2/min/vs/loader.js"></script><script>require.config({paths:{vs:"https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.16.2/min/vs"}}),window.MonacoEnvironment={getWorkerUrl:function(o,r){return"/material-ui/monaco-editor-worker-loader-proxy.js"}},require(["vs/editor/editor.main"],function(){})</script><title>React App</title><link href="/material-ui/static/css/main.579baa03.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script type="text/javascript" src="/material-ui/static/js/main.3c895507.js"></script></body></html>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
self.MonacoEnvironment = {
2+
baseUrl: 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.16.2/min/'
3+
}
4+
5+
importScripts('https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.16.2/min/vs/base/worker/workerMain.js')

docs/project/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
"@material-ui/core": "3.9.3",
88
"@react-form-fields/material-ui": "1.17.3",
99
"jquery": "3.3.1",
10-
"lodash": "^4.17.11",
10+
"lodash": "4.17.11",
1111
"mdi-react": "5.3.0",
12-
"monaco-editor": "0.16.2",
1312
"react": "16.8.6",
1413
"react-dom": "16.8.6",
1514
"react-jss": "8.6.1",
@@ -26,7 +25,7 @@
2625
},
2726
"devDependencies": {
2827
"@types/jest": "24.0.11",
29-
"@types/lodash": "^4.14.123",
28+
"@types/lodash": "4.14.123",
3029
"@types/node": "11.12.2",
3130
"@types/react": "16.8.10",
3231
"@types/react-dom": "16.8.3",
@@ -36,4 +35,4 @@
3635
"tslint-eslint-rules": "5.4.0",
3736
"typescript": "3"
3837
}
39-
}
38+
}

docs/project/public/index.html

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,27 @@
55
<meta charset="utf-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
77
<meta name="theme-color" content="#000000">
8-
<!--
9-
manifest.json provides metadata used when your web app is added to the
10-
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
11-
-->
128
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
139
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
14-
<!--
15-
Notice the use of %PUBLIC_URL% in the tags above.
16-
It will be replaced with the URL of the `public` folder during the build.
17-
Only files inside the `public` folder can be referenced from the HTML.
18-
19-
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
20-
work correctly both with client-side routing and a non-root public URL.
21-
Learn how to configure a non-root public URL by running `npm run build`.
22-
-->
2310
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700">
2411

12+
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.16.2/min/vs/loader.js"></script>
13+
<script>
14+
require.config({
15+
paths: {
16+
'vs': 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.16.2/min/vs'
17+
}
18+
});
19+
20+
window.MonacoEnvironment = {
21+
getWorkerUrl: function (workerId, label) {
22+
return '%PUBLIC_URL%/monaco-editor-worker-loader-proxy.js';
23+
}
24+
};
25+
26+
require(["vs/editor/editor.main"], function () {})
27+
</script>
28+
2529
<title>React App</title>
2630
</head>
2731

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
self.MonacoEnvironment = {
2+
baseUrl: 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.16.2/min/'
3+
}
4+
5+
importScripts('https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.16.2/min/vs/base/worker/workerMain.js')

docs/project/src/components/Shared/Code.tsx

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { IStyledProps } from '@react-form-fields/material-ui/decorators/withStyl
44
import CopyIcon from 'mdi-react/ContentCopyIcon';
55
import * as monacoEditor from 'monaco-editor';
66
import React, { ComponentType, PureComponent } from 'react';
7-
import { MonacoEditorProps } from 'react-monaco-editor';
7+
import { EditorWillMount, MonacoEditorProps } from 'react-monaco-editor';
88

99
import { WithStyles } from '../../decorators/withStyles';
1010
import Toast from './Toast';
@@ -49,16 +49,7 @@ export default class Code extends PureComponent<IProps> {
4949

5050
constructor(props: IProps) {
5151
super(props);
52-
console.log('codde');
53-
this.MonacoEditor = React.lazy(async () => {
54-
const monacoEditor = await import('monaco-editor');
55-
monacoEditor.languages.typescript.typescriptDefaults.setCompilerOptions({
56-
jsx: monacoEditor.languages.typescript.JsxEmit.React
57-
});
58-
59-
const MonacoEditor = await import('react-monaco-editor');
60-
return MonacoEditor;
61-
});
52+
this.MonacoEditor = React.lazy(() => import('react-monaco-editor'));
6253
}
6354

6455
get lineNumbers() {
@@ -69,6 +60,12 @@ export default class Code extends PureComponent<IProps> {
6960
return (18 * this.props.content.split('\n').length) + 10;
7061
}
7162

63+
onEditorWillMount: EditorWillMount = (editor) => {
64+
editor.languages.typescript.typescriptDefaults.setCompilerOptions({
65+
jsx: monacoEditor.languages.typescript.JsxEmit.React
66+
});
67+
}
68+
7269
handleCopy = () => {
7370
this.editorRef.current.editor.focus();
7471
this.editorRef.current.editor.setSelection({ startColumn: 1, startLineNumber: 1, endLineNumber: this.lineNumbers + 1, endColumn: 999 });
@@ -98,6 +95,7 @@ export default class Code extends PureComponent<IProps> {
9895
theme='vs-dark'
9996
value={content}
10097
options={this.options}
98+
editorWillMount={this.onEditorWillMount}
10199
/>
102100
</React.Suspense>
103101
</div>

docs/project/src/components/Shared/CodeExpansion.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import React, { PureComponent } from 'react';
66

77
interface IState {
88
expanded: boolean;
9-
load: boolean;
109
}
1110

1211
interface IProps extends IStyledProps {
@@ -28,15 +27,15 @@ interface IProps extends IStyledProps {
2827
export default class CodeExpansion extends PureComponent<IProps, IState> {
2928
constructor(props: IProps) {
3029
super(props);
31-
this.state = { expanded: false, load: false };
30+
this.state = { expanded: false };
3231
}
3332

3433
toogleExpanded = () => {
35-
this.setState(({ expanded }) => ({ expanded: !expanded, load: true }));
34+
this.setState(({ expanded }) => ({ expanded: !expanded }));
3635
}
3736

3837
render() {
39-
const { expanded, load } = this.state;
38+
const { expanded } = this.state;
4039
const { children, classes } = this.props;
4140

4241
return (
@@ -46,11 +45,9 @@ export default class CodeExpansion extends PureComponent<IProps, IState> {
4645
</IconButton>
4746

4847
<ExpansionPanel expanded={expanded} className={classes.expansionPanel}>
49-
{load &&
50-
<div className={classes.code}>
51-
{children}
52-
</div>
53-
}
48+
<div className={classes.code}>
49+
{children}
50+
</div>
5451
</ExpansionPanel>
5552
</div>
5653
);

docs/project/yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@
218218
csstype "^2.0.0"
219219
indefinite-observable "^1.0.1"
220220

221-
"@types/lodash@^4.14.123":
221+
222222
version "4.14.123"
223223
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.123.tgz#39be5d211478c8dd3bdae98ee75bb7efe4abfe4d"
224224
integrity sha512-pQvPkc4Nltyx7G1Ww45OjVqUsJP4UsZm+GWJpigXgkikZqJgRm4c48g027o6tdgubWHwFRF15iFd+Y4Pmqv6+Q==
@@ -5661,7 +5661,7 @@ lodash.uniq@^4.5.0:
56615661
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
56625662
integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=
56635663

5664-
lodash@>4.17.4, "lodash@>=3.5 <5", lodash@>=4.0.0, lodash@^4.0.1, lodash@^4.17.11, lodash@^4.17.2, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.3.0:
5664+
lodash@4.17.11, lodash@>4.17.4, "lodash@>=3.5 <5", lodash@>=4.0.0, lodash@^4.0.1, lodash@^4.17.11, lodash@^4.17.2, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.3.0:
56655665
version "4.17.11"
56665666
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
56675667
integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==
@@ -5995,7 +5995,7 @@ [email protected], mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1:
59955995
dependencies:
59965996
minimist "0.0.8"
59975997

5998-
monaco-editor@0.16.2, monaco-editor@^0.16.0:
5998+
monaco-editor@^0.16.0:
59995999
version "0.16.2"
60006000
resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.16.2.tgz#950084ed82eeaef1c8c9d3c1bcab849fe11b2415"
60016001
integrity sha512-NtGrFzf54jADe7qsWh3lazhS7Kj0XHkJUGBq9fA/Jbwc+sgVcyfsYF6z2AQ7hPqDC+JmdOt/OwFjBnRwqXtx6w==

docs/service-worker.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)