diff --git a/config-overrides.js b/config-overrides.js new file mode 100644 index 000000000..6b9d5408d --- /dev/null +++ b/config-overrides.js @@ -0,0 +1,8 @@ +module.exports = function override(config) { + config.module.rules.push({ + test: /\.yml$/i, + loader: 'raw-loader', + }); + + return config; +}; diff --git a/package-lock.json b/package-lock.json index 1a49d39dc..6bba8141f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4265,8 +4265,7 @@ "ajv-keywords": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==" }, "alphanum-sort": { "version": "1.0.2", @@ -5215,8 +5214,7 @@ "big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", - "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", - "dev": true + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==" }, "binary-extensions": { "version": "2.2.0", @@ -7722,8 +7720,7 @@ "emojis-list": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", - "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", - "dev": true + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==" }, "encodeurl": { "version": "1.0.2", @@ -13086,7 +13083,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", - "dev": true, "requires": { "minimist": "^1.2.5" } @@ -13316,7 +13312,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", - "dev": true, "requires": { "big.js": "^5.2.2", "emojis-list": "^3.0.0", @@ -19873,6 +19868,27 @@ "unpipe": "1.0.0" } }, + "raw-loader": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-4.0.2.tgz", + "integrity": "sha512-ZnScIV3ag9A4wPX/ZayxL/jZH+euYb6FcUinPcgiQW0+UBtEv0O6Q3lGd3cqJ+GHH+rksEv3Pj99oxJ3u3VIKA==", + "requires": { + "loader-utils": "^2.0.0", + "schema-utils": "^3.0.0" + }, + "dependencies": { + "schema-utils": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", + "requires": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + } + } + } + }, "rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", diff --git a/package.json b/package.json index fe1721ed3..887da6f4e 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "js-yaml": "^4.1.0", "monaco-editor": "^0.28.1", "monaco-yaml": "^2.5.1", + "raw-loader": "^4.0.2", "react": "^17.0.2", "react-dom": "^17.0.2", "react-flow-renderer": "^9.6.9", diff --git a/src/components/Content.tsx b/src/components/Content.tsx index b91adb3ff..879966d3f 100644 --- a/src/components/Content.tsx +++ b/src/components/Content.tsx @@ -5,6 +5,7 @@ import { Editor } from './Editor/Editor'; import { Navigation } from './Navigation'; import { Template } from './Template'; import { Visualiser } from './Visualiser'; +import NewFile from './NewFile'; import { debounce } from '../helpers'; import state from '../state'; @@ -16,6 +17,7 @@ export const Content: React.FunctionComponent = () => { // eslint- const navigationEnabled = sidebarState.panels.navigation.get(); const editorEnabled = sidebarState.panels.editor.get(); + const newFileEnabled = sidebarState.panels.newFile.get(); const viewEnabled = sidebarState.panels.view.get(); const viewType = sidebarState.panels.viewType.get(); @@ -48,26 +50,31 @@ export const Content: React.FunctionComponent = () => { // eslint- return (
- { - localStorage.setItem(splitPosRight, String(size)); - }, 100)} - > - {navigationAndEditor} - {viewType === 'template' &&