├── .gitignore ├── .storybook ├── config.js ├── fonts.less ├── style.less ├── ui-atom.less ├── ui-variables.less └── webpack.config.js ├── CHANGELOG.md ├── LICENSE.txt ├── README.md ├── assets ├── fonts │ ├── icomoon.eot │ ├── icomoon.svg │ ├── icomoon.ttf │ └── icomoon.woff └── jsoneditor-icons.svg ├── dist ├── src │ ├── actions │ │ ├── index.js │ │ ├── index.js.map │ │ ├── update-user-code.js │ │ └── update-user-code.js.map │ ├── api │ │ ├── index.js │ │ └── index.js.map │ ├── commands │ │ ├── auth.js │ │ ├── auth.js.map │ │ ├── change-project-branch.js │ │ ├── change-project-branch.js.map │ │ ├── commit.js │ │ ├── commit.js.map │ │ ├── copy-branch.js │ │ ├── copy-branch.js.map │ │ ├── fetch.js │ │ ├── fetch.js.map │ │ ├── index.js │ │ ├── index.js.map │ │ ├── start.js │ │ └── start.js.map │ ├── components │ │ ├── atom-modal │ │ │ ├── index.js │ │ │ └── index.js.map │ │ ├── branches-block │ │ │ ├── index.js │ │ │ └── index.js.map │ │ ├── confirm-modal │ │ │ ├── index.js │ │ │ └── index.js.map │ │ ├── console-panel │ │ │ ├── index.js │ │ │ └── index.js.map │ │ ├── memory-panel │ │ │ ├── index.js │ │ │ └── index.js.map │ │ ├── modules-block │ │ │ ├── actions │ │ │ │ ├── create.js │ │ │ │ ├── create.js.map │ │ │ │ ├── delete.js │ │ │ │ ├── delete.js.map │ │ │ │ ├── index.js │ │ │ │ ├── index.js.map │ │ │ │ ├── modify.js │ │ │ │ ├── modify.js.map │ │ │ │ ├── open-text-editor.js │ │ │ │ ├── open-text-editor.js.map │ │ │ │ ├── update.js │ │ │ │ └── update.js.map │ │ │ ├── effects │ │ │ │ ├── delete.js │ │ │ │ ├── delete.js.map │ │ │ │ ├── index.js │ │ │ │ ├── index.js.map │ │ │ │ ├── open-text-editor.js │ │ │ │ └── open-text-editor.js.map │ │ │ ├── index.js │ │ │ ├── index.js.map │ │ │ └── reducers │ │ │ │ ├── create.js │ │ │ │ ├── create.js.map │ │ │ │ ├── delete.js │ │ │ │ ├── delete.js.map │ │ │ │ ├── index.js │ │ │ │ ├── index.js.map │ │ │ │ ├── modify.js │ │ │ │ ├── modify.js.map │ │ │ │ ├── update.js │ │ │ │ └── update.js.map │ │ ├── prompt-modal │ │ │ ├── index.js │ │ │ └── index.js.map │ │ ├── screeps-panel │ │ │ ├── actions │ │ │ │ ├── add-project.js │ │ │ │ ├── add-project.js.map │ │ │ │ ├── index.js │ │ │ │ ├── index.js.map │ │ │ │ ├── set-active-module.js │ │ │ │ ├── set-active-module.js.map │ │ │ │ ├── update.js │ │ │ │ └── update.js.map │ │ │ ├── index.js │ │ │ ├── index.js.map │ │ │ └── reducers │ │ │ │ ├── add-project.js │ │ │ │ ├── add-project.js.map │ │ │ │ ├── index.js │ │ │ │ ├── index.js.map │ │ │ │ ├── remove-project.js │ │ │ │ ├── remove-project.js.map │ │ │ │ ├── set-active-module.js │ │ │ │ ├── set-active-module.js.map │ │ │ │ ├── update.js │ │ │ │ └── update.js.map │ │ ├── screeps-status-bar │ │ │ ├── index.js │ │ │ └── index.js.map │ │ ├── token-modal │ │ │ ├── index.js │ │ │ └── index.js.map │ │ └── welcome-pane │ │ │ ├── index.js │ │ │ └── index.js.map │ ├── config.js │ ├── config.js.map │ ├── consumed-services │ │ ├── consume-status-bar.js │ │ ├── consume-status-bar.js.map │ │ ├── consume-tree-view.js │ │ ├── consume-tree-view.js.map │ │ ├── index.js │ │ └── index.js.map │ ├── decoratos │ │ ├── index.js │ │ ├── index.js.map │ │ ├── progress.js │ │ └── progress.js.map │ ├── index.js │ ├── index.js.map │ ├── service.js │ ├── service.js.map │ ├── services │ │ ├── user.js │ │ └── user.js.map │ ├── socket │ │ ├── index.js │ │ └── index.js.map │ ├── state.js │ ├── state.js.map │ ├── store │ │ ├── actions │ │ │ ├── add-project.js │ │ │ ├── add-project.js.map │ │ │ ├── add-text-editor.js │ │ │ ├── add-text-editor.js.map │ │ │ ├── create-project.js │ │ │ ├── create-project.js.map │ │ │ ├── index.js │ │ │ ├── index.js.map │ │ │ ├── local-file-change.js │ │ │ ├── local-file-change.js.map │ │ │ ├── local-file-modify.js │ │ │ ├── local-file-modify.js.map │ │ │ ├── update-user-code-success.js │ │ │ └── update-user-code-success.js.map │ │ ├── effects │ │ │ ├── create-project.js │ │ │ ├── create-project.js.map │ │ │ ├── index.js │ │ │ ├── index.js.map │ │ │ ├── local-file-change.js │ │ │ └── local-file-change.js.map │ │ ├── index.js │ │ ├── index.js.map │ │ └── reducers │ │ │ ├── add-project.js │ │ │ ├── add-project.js.map │ │ │ ├── add-text-editor.js │ │ │ ├── add-text-editor.js.map │ │ │ ├── index.js │ │ │ ├── index.js.map │ │ │ ├── local-file-change.js │ │ │ ├── local-file-change.js.map │ │ │ ├── local-file-modify.js │ │ │ ├── local-file-modify.js.map │ │ │ ├── update-user-code-success.js │ │ │ └── update-user-code-success.js.map │ ├── utils.js │ └── utils.js.map └── ui │ ├── components │ ├── auth-view │ │ ├── index.js │ │ └── index.js.map │ ├── branches-view │ │ ├── index.js │ │ └── index.js.map │ ├── confirm │ │ ├── index.js │ │ └── index.js.map │ ├── console-view │ │ ├── components │ │ │ ├── console-input.js │ │ │ ├── console-input.js.map │ │ │ ├── controls.js │ │ │ ├── controls.js.map │ │ │ ├── message-item.js │ │ │ ├── message-item.js.map │ │ │ ├── messages-list.js │ │ │ └── messages-list.js.map │ │ ├── index.js │ │ └── index.js.map │ ├── create-project-view │ │ ├── index.js │ │ └── index.js.map │ ├── memory-view │ │ ├── components │ │ │ ├── controls.js │ │ │ ├── controls.js.map │ │ │ ├── input.js │ │ │ ├── input.js.map │ │ │ ├── item.js │ │ │ ├── item.js.map │ │ │ ├── jsoneditor.js │ │ │ ├── jsoneditor.js.map │ │ │ ├── main.js │ │ │ ├── main.js.map │ │ │ ├── segment-controls.js │ │ │ ├── segment-controls.js.map │ │ │ ├── segment.js │ │ │ └── segment.js.map │ │ ├── index.js │ │ └── index.js.map │ ├── modules-view │ │ ├── index.js │ │ └── index.js.map │ ├── prompt │ │ ├── index.js │ │ └── index.js.map │ ├── resizable-panel │ │ ├── index.js │ │ └── index.js.map │ ├── token │ │ ├── index.js │ │ └── index.js.map │ └── welcome-view │ │ ├── index.js │ │ └── index.js.map │ ├── index.js │ └── index.js.map ├── keymaps └── atom-package.json ├── menus └── atom-package.json ├── package-lock.json ├── package.json ├── screeps-ide.gif ├── spec ├── atom-package-spec.js └── atom-package-view-spec.js ├── src ├── actions │ ├── index.ts │ └── update-user-code.ts ├── api │ ├── index.d.ts │ └── index.ts ├── commands │ ├── auth.ts │ ├── change-project-branch.ts │ ├── commit.ts │ ├── copy-branch.ts │ ├── fetch.ts │ ├── index.ts │ └── start.ts ├── components │ ├── atom-modal │ │ └── index.tsx │ ├── branches-block │ │ └── index.tsx │ ├── confirm-modal │ │ └── index.tsx │ ├── console-panel │ │ └── index.tsx │ ├── memory-panel │ │ └── index.tsx │ ├── modules-block │ │ ├── actions │ │ │ ├── create.ts │ │ │ ├── delete.ts │ │ │ ├── index.ts │ │ │ ├── modify.ts │ │ │ ├── open-text-editor.ts │ │ │ └── update.ts │ │ ├── effects │ │ │ ├── delete.ts │ │ │ ├── index.ts │ │ │ └── open-text-editor.ts │ │ ├── index.tsx │ │ └── reducers │ │ │ ├── create.ts │ │ │ ├── delete.ts │ │ │ ├── index.ts │ │ │ ├── modify.ts │ │ │ └── update.ts │ ├── prompt-modal │ │ └── index.tsx │ ├── screeps-panel │ │ ├── actions │ │ │ ├── add-project.ts │ │ │ ├── index.ts │ │ │ ├── set-active-module.ts │ │ │ ├── update-branches.ts │ │ │ └── update-modules.ts │ │ ├── index.tsx │ │ ├── reducers │ │ │ ├── add-project.ts │ │ │ ├── index.ts │ │ │ ├── remove-project.ts │ │ │ ├── set-active-module.ts │ │ │ ├── update-branches.ts │ │ │ └── update-modules.ts │ │ └── style.less │ ├── screeps-status-bar │ │ ├── index.tsx │ │ └── style.less │ ├── token-modal │ │ └── index.tsx │ └── welcome-pane │ │ └── index.tsx ├── config.ts ├── consumed-services │ ├── consume-status-bar.ts │ ├── consume-tree-view.ts │ └── index.ts ├── decoratos │ ├── index.ts │ └── progress.ts ├── index.d.ts ├── index.tsx ├── service.ts ├── services │ └── user.ts ├── socket │ ├── index.d.ts │ └── index.ts ├── state.ts ├── store │ ├── actions │ │ ├── add-project.ts │ │ ├── add-text-editor.ts │ │ ├── create-project.ts │ │ ├── index.ts │ │ ├── local-file-change.ts │ │ └── update-user-code-success.ts │ ├── effects │ │ ├── create-project.ts │ │ └── index.ts │ ├── index.ts │ └── reducers │ │ ├── add-project.ts │ │ ├── add-text-editor.ts │ │ ├── index.ts │ │ ├── local-file-change.ts │ │ └── update-user-code-success.ts └── utils.ts ├── stories ├── auth-view.stories.js ├── branches-view.stories.js ├── buttons-elements.stories.js ├── confirm.stories.js ├── console-view.stories.js ├── create-project-view.stories.js ├── data.js ├── forms-elements.stories.js ├── icons.stories.js ├── memory-view.stories.js ├── modules-view.stories.js ├── prompt.stories.js ├── token.stories.js └── welcome-view.stories.js ├── styles ├── fonts.less └── main.less ├── tsconfig.atom.json ├── tsconfig.json ├── ui ├── components │ ├── auth-view │ │ ├── index.d.ts │ │ ├── index.tsx │ │ └── style.less │ ├── branches-view │ │ ├── index.d.ts │ │ ├── index.tsx │ │ └── style.less │ ├── confirm │ │ └── index.tsx │ ├── console-view │ │ ├── components │ │ │ ├── console-input.tsx │ │ │ ├── controls.tsx │ │ │ ├── message-item.tsx │ │ │ └── messages-list.tsx │ │ ├── index.d.ts │ │ ├── index.tsx │ │ └── style.less │ ├── create-project-view │ │ ├── index.tsx │ │ └── style.less │ ├── memory-view │ │ ├── components │ │ │ ├── controls.tsx │ │ │ ├── input.tsx │ │ │ ├── item.tsx │ │ │ ├── jsoneditor.less │ │ │ ├── jsoneditor.tsx │ │ │ ├── main.tsx │ │ │ ├── segment-controls.tsx │ │ │ └── segment.tsx │ │ ├── index.d.ts │ │ ├── index.tsx │ │ └── style.less │ ├── modal │ │ └── style.less │ ├── modules-view │ │ ├── index.d.ts │ │ ├── index.tsx │ │ └── style.less │ ├── prompt │ │ └── index.tsx │ ├── resizable-panel │ │ ├── index.tsx │ │ └── style.less │ ├── token │ │ └── index.tsx │ └── welcome-view │ │ ├── index.d.ts │ │ ├── index.tsx │ │ └── style.less ├── elements │ ├── button-group.less │ ├── buttons.less │ ├── form.less │ ├── icons.less │ └── radio.less ├── index.scss ├── index.tsx └── style.css └── webpack ├── webpack.common.js ├── webpack.dev.js └── webpack.prod.js /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | npm-debug.log 3 | node_modules 4 | .vscode/ 5 | .branches/ 6 | .idea -------------------------------------------------------------------------------- /.storybook/config.js: -------------------------------------------------------------------------------- 1 | import { configure, addParameters } from '@storybook/react'; 2 | import { create } from '@storybook/theming'; 3 | 4 | // coral / ocean highlights 5 | const theme = create({ 6 | base: 'dark', 7 | 8 | colorPrimary: '#FF4785', 9 | colorSecondary: '#1EA7FD', 10 | 11 | // UI 12 | appBg: '#21252b', 13 | appContentBg: '#21252b', 14 | appBorderColor: 'black', 15 | appBorderRadius: 4, 16 | 17 | // Toolbar default and active colors 18 | barTextColor: 'silver', 19 | barSelectedColor: 'black', 20 | barBg: '#21252b', 21 | }); 22 | addParameters({ 23 | options: { theme } 24 | }); 25 | import './style.less'; 26 | 27 | // automatically import all files ending in *.stories.js 28 | const req = require.context('../stories', true, /\.stories\.js$/); 29 | function loadStories() { 30 | req.keys().forEach(filename => req(filename)); 31 | } 32 | 33 | configure(loadStories, module); 34 | -------------------------------------------------------------------------------- /.storybook/fonts.less: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'screepsicons'; 3 | src: url('../assets/fonts/icomoon.eot'); 4 | src: url('../assets/fonts/icomoon.eot#iefix') format('embedded-opentype'), 5 | url('../assets/fonts/icomoon.ttf') format('truetype'), 6 | url('../assets/fonts/icomoon.woff') format('woff'), 7 | url('../assets/fonts/icomoon.svg#icomoon') format('svg'); 8 | 9 | font-weight: normal; 10 | font-style: normal; 11 | } 12 | -------------------------------------------------------------------------------- /.storybook/style.less: -------------------------------------------------------------------------------- 1 | @import 'ui-variables'; 2 | @import 'fonts.less'; 3 | 4 | // Components 5 | @import '../ui/components/auth-view/style.less'; 6 | @import '../ui/components/branches-view/style.less'; 7 | @import '../ui/components/console-view/style.less'; 8 | @import '../ui/components/create-project-view/style.less'; 9 | @import '../ui/components/memory-view/style.less'; 10 | @import '../ui/components/modules-view/style.less'; 11 | @import '../ui/components/welcome-view/style.less'; 12 | 13 | // Elements 14 | @import '../ui/elements/buttons.less'; 15 | @import '../ui/elements/button-group.less'; 16 | @import '../ui/elements/form.less'; 17 | @import '../ui/elements/icons.less'; 18 | @import '../ui/components/modal/style.less'; 19 | 20 | @import 'ui-atom'; 21 | 22 | html, body { 23 | height: 100%; 24 | padding: 0; 25 | margin: 0; 26 | 27 | font-size: 12px; 28 | } 29 | 30 | #root { 31 | height: 100%; 32 | } 33 | 34 | .storybook-ui-elements-buttons { 35 | margin: 0 20px; 36 | 37 | & > div { 38 | display: flex; 39 | justify-content: space-between; 40 | align-items: center; 41 | padding: 10px; 42 | 43 | &:first-child { 44 | color: @text-color-highlight; 45 | font-size: 12px; 46 | font-family: Arial, Helvetica, sans-serif; 47 | } 48 | 49 | div { 50 | width: 20%; 51 | 52 | &:first-child { 53 | color: @text-color-highlight; 54 | font-size: 12px; 55 | font-family: Arial, Helvetica, sans-serif; 56 | } 57 | } 58 | } 59 | } 60 | 61 | .storybook-ui-elements-icons { 62 | div { 63 | display: inline-block; 64 | margin: 5px; 65 | 66 | color: @text-color-highlight; 67 | font-size: 16px; 68 | } 69 | } -------------------------------------------------------------------------------- /.storybook/ui-variables.less: -------------------------------------------------------------------------------- 1 | // UI Theme => One Dark 2 | // Syntax Theme => One Dark 3 | 4 | @text-color: #9da5b4; 5 | @text-color-subtle: rgba(157, 165, 180, 0.6); 6 | @text-color-highlight: #d7dae0; 7 | @text-color-selected: white; 8 | -------------------------------------------------------------------------------- /.storybook/webpack.config.js: -------------------------------------------------------------------------------- 1 | // Native dependencies. 2 | const path = require('path'); 3 | 4 | // Webpack dependencies. 5 | const MiniCssExtractPlugin = require('mini-css-extract-plugin'); 6 | 7 | // Constants defines. 8 | const sourceMap = true; 9 | 10 | const STYLE_LOADER = [ 11 | { 12 | test: /\.less$/, 13 | use: [{ 14 | loader: 'style-loader' 15 | }, { 16 | loader: 'css-loader', 17 | options: { 18 | sourceMap 19 | } 20 | }, { 21 | loader: 'less-loader', 22 | options: { 23 | sourceMap 24 | } 25 | }] 26 | } 27 | ]; 28 | const COMPILER_LOADER = [ 29 | { 30 | test: /\.(ts|tsx)$/, 31 | exclude: [/node_modules/, /\.old$/], 32 | use: [{ 33 | loader: 'ts-loader' 34 | }] 35 | } 36 | ]; 37 | const ASSETS_LOADER = [ 38 | { 39 | test: /\.(jpe?g|png|gif|svg)$/, 40 | use: [{ 41 | loader: 'url-loader', 42 | options: { 43 | limit: 8196, 44 | name: 'assets/img/[name].[hash].[ext]', 45 | fallback: 'file-loader' 46 | } 47 | }] 48 | }, { 49 | test: /\.(eot|ttf|woff)$/, 50 | use: [{ 51 | loader: 'file-loader', 52 | options: { 53 | name: 'assets/fonts/[name].[hash].[ext]', 54 | fallback: 'file-loader' 55 | } 56 | }] 57 | } 58 | ]; 59 | 60 | module.exports = { 61 | resolve: { 62 | extensions: ['.ts', '.tsx', '.js', '.json'] 63 | }, 64 | 65 | plugins: [ 66 | ], 67 | 68 | module: { 69 | rules: [ 70 | ...STYLE_LOADER, 71 | ...COMPILER_LOADER, 72 | ...ASSETS_LOADER 73 | ] 74 | } 75 | }; 76 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/ide/b57b1ce7959679a140496d51f80c3e331525a46f/CHANGELOG.md -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019, Artem Chivchalov 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, 4 | provided that the above copyright notice and this permission notice appear in all copies. 5 | 6 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL 7 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 8 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 9 | AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 10 | OF THIS SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Screeps IDE 2 | 3 | This is an IDE package for Atom that helps to write code for [Screeps](https://screeps.com) - MMO RTS sandbox game for programmers. 4 | 5 | ![screeps-ide](screeps-ide.gif) 6 | 7 | ## Install from source 8 | 9 | ``` 10 | npm install 11 | npm run build 12 | apm link 13 | ``` -------------------------------------------------------------------------------- /assets/fonts/icomoon.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/ide/b57b1ce7959679a140496d51f80c3e331525a46f/assets/fonts/icomoon.eot -------------------------------------------------------------------------------- /assets/fonts/icomoon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/ide/b57b1ce7959679a140496d51f80c3e331525a46f/assets/fonts/icomoon.ttf -------------------------------------------------------------------------------- /assets/fonts/icomoon.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/ide/b57b1ce7959679a140496d51f80c3e331525a46f/assets/fonts/icomoon.woff -------------------------------------------------------------------------------- /dist/src/actions/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const tslib_1 = require("tslib"); 4 | tslib_1.__exportStar(require("./update-user-code"), exports); 5 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/src/actions/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/actions/index.ts"],"names":[],"mappings":";;;AAAA,6DAAmC"} -------------------------------------------------------------------------------- /dist/src/actions/update-user-code.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const utils_1 = require("../utils"); 4 | async function updateUserCode(branch, modules) { 5 | if (!branch) { 6 | throw new Error('Need check branch'); 7 | } 8 | let api; 9 | try { 10 | api = await utils_1.getApi(); 11 | await utils_1.getUser(); 12 | } 13 | catch (err) { 14 | throw new Error(err); 15 | } 16 | try { 17 | await api.updateUserCode({ branch, modules }); 18 | } 19 | catch (err) { 20 | throw new Error('Error update user code'); 21 | } 22 | } 23 | exports.updateUserCode = updateUserCode; 24 | //# sourceMappingURL=update-user-code.js.map -------------------------------------------------------------------------------- /dist/src/actions/update-user-code.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"update-user-code.js","sourceRoot":"","sources":["../../../src/actions/update-user-code.ts"],"names":[],"mappings":";;AAEA,oCAEkB;AAEX,KAAK,UAAU,cAAc,CAChC,MAAc,EACd,OAAqB;IAErB,IAAI,CAAC,MAAM,EAAE;QACT,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;KACxC;IAED,IAAI,GAAG,CAAC;IACR,IAAI;QACA,GAAG,GAAG,MAAM,cAAM,EAAE,CAAC;QACrB,MAAM,eAAO,EAAE,CAAC;KACnB;IAAC,OAAO,GAAG,EAAE;QACV,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;KACxB;IAED,IAAI;QACA,MAAM,GAAG,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;KACjD;IAAC,OAAM,GAAG,EAAE;QACT,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;KAC7C;AACL,CAAC;AArBD,wCAqBC"} -------------------------------------------------------------------------------- /dist/src/commands/change-project-branch.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const store_1 = require("../store"); 4 | const utils_1 = require("../utils"); 5 | async function changeProjectBranch(event) { 6 | let target = event.target; 7 | const el = utils_1.$('span:first-child', target); 8 | if (!el) { 9 | return; 10 | } 11 | const projectPath = el.getAttribute('data-path'); 12 | store_1.default.dispatch({ 13 | type: 'CREATE_PROJECT', 14 | payload: { 15 | projectPath, 16 | projectPathLabel: 'Project folder path', 17 | projectPathReadonly: true, 18 | download: true, 19 | downloadForce: true, 20 | submitBtn: 'Change' 21 | } 22 | }); 23 | } 24 | exports.changeProjectBranch = changeProjectBranch; 25 | //# sourceMappingURL=change-project-branch.js.map -------------------------------------------------------------------------------- /dist/src/commands/change-project-branch.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"change-project-branch.js","sourceRoot":"","sources":["../../../src/commands/change-project-branch.ts"],"names":[],"mappings":";;AAAA,oCAA4C;AAE5C,oCAEkB;AAEX,KAAK,UAAU,mBAAmB,CAAC,KAAkB;IACxD,IAAI,MAAM,GAAgB,KAAK,CAAC,MAAqB,CAAC;IAEtD,MAAM,EAAE,GAAG,SAAC,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;IAEzC,IAAI,CAAC,EAAE,EAAE;QACL,OAAO;KACV;IAED,MAAM,WAAW,GAAG,EAAE,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IAEjD,eAAK,CAAC,QAAQ,CAAC;QACX,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE;YACL,WAAW;YACX,gBAAgB,EAAE,qBAAqB;YACvC,mBAAmB,EAAE,IAAI;YACzB,QAAQ,EAAE,IAAI;YACd,aAAa,EAAE,IAAI;YACnB,SAAS,EAAE,QAAQ;SACtB;KACJ,CAAC,CAAC;AACP,CAAC;AAtBD,kDAsBC"} -------------------------------------------------------------------------------- /dist/src/commands/copy-branch.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const utils_1 = require("../utils"); 4 | const state_1 = require("../state"); 5 | const prompt_modal_1 = require("../components/prompt-modal"); 6 | async function copyBranch(branch) { 7 | let api; 8 | try { 9 | api = await utils_1.getApi(); 10 | await utils_1.getUser(); 11 | } 12 | catch (err) { 13 | throw err; 14 | } 15 | let newName; 16 | try { 17 | newName = await prompt_modal_1.default({ 18 | legend: 'This branch will be cloned to the new branch. Please enter a new branch name:' 19 | }); 20 | await api.cloneUserBranch({ branch, newName }); 21 | const { list: branches } = await api.getUserBranches(); 22 | state_1.default.next(Object.assign({}, state_1.default.getValue(), { branches })); 23 | } 24 | catch (err) { 25 | throw err; 26 | } 27 | return newName; 28 | } 29 | exports.copyBranch = copyBranch; 30 | //# sourceMappingURL=copy-branch.js.map -------------------------------------------------------------------------------- /dist/src/commands/copy-branch.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"copy-branch.js","sourceRoot":"","sources":["../../../src/commands/copy-branch.ts"],"names":[],"mappings":";;AAAA,oCAEkB;AAElB,oCAA8C;AAE9C,6DAA+D;AAExD,KAAK,UAAU,UAAU,CAAC,MAAc;IAC3C,IAAI,GAAG,CAAC;IACR,IAAI;QACA,GAAG,GAAG,MAAM,cAAM,EAAE,CAAC;QACrB,MAAM,eAAO,EAAE,CAAC;KACnB;IAAC,OAAO,GAAG,EAAE;QACV,MAAM,GAAG,CAAC;KACb;IAED,IAAI,OAAO,CAAC;IACZ,IAAI;QACA,OAAO,GAAG,MAAM,sBAAM,CAAC;YACnB,MAAM,EAAE,+EAA+E;SAC1F,CAAC,CAAC;QAEH,MAAM,GAAG,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;QAE/C,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,MAAM,GAAG,CAAC,eAAe,EAAE,CAAC;QAEvD,eAAO,CAAC,IAAI,mBACL,eAAO,CAAC,QAAQ,EAAE,IACrB,QAAQ,IACV,CAAC;KACN;IAAC,OAAM,GAAG,EAAE;QACT,MAAM,GAAG,CAAC;KACb;IAED,OAAO,OAAO,CAAC;AACnB,CAAC;AA5BD,gCA4BC"} -------------------------------------------------------------------------------- /dist/src/commands/fetch.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../../src/commands/fetch.ts"],"names":[],"mappings":";;AAAA,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAE7B,+BAA4B;AAE5B,oCAKkB;AAElB,+DAAiE;AAE1D,KAAK,UAAU,KAAK,CAAC,KAAkB;IAC1C,MAAM,uBAAO,CAAC;QACV,MAAM,EAAE,oCAAoC;KAC/C,CAAC,CAAC;IAEH,IAAI,QAAQ,CAAC;IACb,IAAI,KAAK,CAAC,MAAM,EAAE;QACd,IAAI,MAAM,GAAgB,KAAK,CAAC,MAAqB,CAAC;QAEtD,IAAI,MAAM,CAAC,QAAQ,KAAK,IAAI,EAAE;YAC1B,MAAM,GAAG,MAAM,CAAC,UAAyB,CAAC;SAC7C;QAED,QAAQ,GAAG,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;KAC/C;IAED,IAAI,CAAC,QAAQ,EAAE;QACX,aAAa;QACb,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,iBAAiB,EAAE,CAAC,OAAO,EAAY,CAAC;KACjF;IAED,IAAI,CAAC,QAAQ,EAAE;QACX,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC;KACnC;IAED,aAAa;IACb,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,UAAU;SACjE,mBAAmB,EAAE;SACrB,YAAY,CAAC,QAAQ,CAAC,CAAC;IAE5B,MAAM,WAAW,GAAG,MAAM,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAEzD,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,+BAAuB,CAAC,WAAW,CAAC,CAAC;IACnE,IAAI,GAAG,CAAC;IACR,IAAI;QACA,GAAG,GAAG,MAAM,cAAM,EAAE,CAAC;QACrB,MAAM,eAAO,EAAE,CAAC;KACnB;IAAC,OAAO,GAAG,EAAE;QACV,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;KACxB;IAED,MAAM,OAAO,GAAG,4BAAoB,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IACvD,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAElD,KAAK,MAAM,UAAU,IAAI,OAAO,EAAE;QAC9B,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;QACpC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAErD,MAAM,UAAU,GAAG,IAAI,WAAI,CAAC,GAAI,UAAW,KAAK,CAAC,CAAC;QAClD,MAAM,UAAU,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;KACzC;AACL,CAAC;AAnDD,sBAmDC;AAED,KAAK,UAAU,qBAAqB,CAAC,UAA8B;IAC/D,OAAM,UAAU,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE;QAChE,UAAU,GAAG,UAAU,CAAC,aAAa,CAAC;QAEtC,IAAI,UAAU,KAAK,QAAQ,CAAC,IAAI,EAAE;YAC9B,OAAO;SACV;KACJ;IAED,IAAI,CAAC,UAAU,EAAE;QACb,OAAO;KACV;IAED,MAAM,eAAe,GAAG,SAAC,CAAC,wCAAwC,EAAE,UAAU,CAAgB,CAAC;IAE/F,IAAI,CAAC,eAAe,EAAE;QAClB,OAAO;KACV;IAED,OAAO,eAAe,CAAC,YAAY,CAAC,WAAW,CAAW,CAAC;AAC/D,CAAC"} -------------------------------------------------------------------------------- /dist/src/commands/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const tslib_1 = require("tslib"); 4 | tslib_1.__exportStar(require("./start"), exports); 5 | tslib_1.__exportStar(require("./auth"), exports); 6 | tslib_1.__exportStar(require("./commit"), exports); 7 | tslib_1.__exportStar(require("./fetch"), exports); 8 | tslib_1.__exportStar(require("./copy-branch"), exports); 9 | tslib_1.__exportStar(require("./change-project-branch"), exports); 10 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/src/commands/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":";;;AAAA,kDAAwB;AACxB,iDAAuB;AACvB,mDAAyB;AACzB,kDAAwB;AACxB,wDAA8B;AAC9B,kEAAwC"} -------------------------------------------------------------------------------- /dist/src/commands/start.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | function startCommand() { 4 | console.log(1, atom.project.getPaths()); 5 | } 6 | exports.startCommand = startCommand; 7 | //# sourceMappingURL=start.js.map -------------------------------------------------------------------------------- /dist/src/commands/start.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"start.js","sourceRoot":"","sources":["../../../src/commands/start.ts"],"names":[],"mappings":";;AAAA,SAAgB,YAAY;IAC1B,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;AAC1C,CAAC;AAFD,oCAEC"} -------------------------------------------------------------------------------- /dist/src/components/atom-modal/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const React = require("react"); 4 | const ReactDOM = require("react-dom"); 5 | const rxjs_1 = require("rxjs"); 6 | class AtomModal { 7 | constructor(Component, props = {}) { 8 | this._eventsSbj = new rxjs_1.Subject(); 9 | this._ref = React.createRef(); 10 | this.onEscape = (event) => { 11 | if (event.code !== 'Escape') { 12 | return; 13 | } 14 | this.onCancel(); 15 | }; 16 | this.onCancel = () => { 17 | this._eventsSbj.next({ type: 'MODAL_CANCEL' }); 18 | this.destroy(); 19 | }; 20 | this.onSubmit = (payload) => { 21 | this._eventsSbj.next({ type: 'MODAL_SUBMIT', payload }); 22 | }; 23 | this._element = document.createElement('div'); 24 | this.events$ = this._eventsSbj.asObservable(); 25 | setTimeout(() => { 26 | this._atomModalPanelRef = atom.workspace.addModalPanel({ 27 | item: this._element, 28 | visible: true 29 | }); 30 | document.body.addEventListener('keyup', this.onEscape); 31 | ReactDOM.render(React.createElement(Component, Object.assign({ ref: this._ref }, props, { onCancel: this.onCancel, onSubmit: this.onSubmit })), this._element); 32 | }); 33 | } 34 | get ref() { 35 | return this._ref.current; 36 | } 37 | hide() { 38 | this._atomModalPanelRef.hide(); 39 | } 40 | destroy() { 41 | this._atomModalPanelRef.destroy(); 42 | document.body.removeEventListener('keyup', this.onEscape); 43 | } 44 | } 45 | exports.AtomModal = AtomModal; 46 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/src/components/atom-modal/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/atom-modal/index.tsx"],"names":[],"mappings":";;AAAA,+BAA+B;AAC/B,sCAAsC;AAEtC,+BAA2C;AAY3C,MAAa,SAAS;IAYlB,YAAY,SAAc,EAAE,QAAa,EAAE;QARnC,eAAU,GAAqB,IAAI,cAAO,EAAE,CAAC;QAG9C,SAAI,GAAQ,KAAK,CAAC,SAAS,EAAE,CAAC;QAsCrC,aAAQ,GAAG,CAAC,KAAoB,EAAE,EAAE;YAChC,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;gBACzB,OAAO;aACV;YAED,IAAI,CAAC,QAAQ,EAAE,CAAC;QACpB,CAAC,CAAA;QAED,aAAQ,GAAG,GAAG,EAAE;YACZ,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,cAAc,EAAC,CAAC,CAAC;YAC9C,IAAI,CAAC,OAAO,EAAE,CAAC;QACnB,CAAC,CAAA;QAED,aAAQ,GAAG,CAAC,OAAqB,EAAE,EAAE;YACjC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC,CAAC;QAC5D,CAAC,CAAA;QA/CG,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC9C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC;QAE9C,UAAU,CAAC,GAAG,EAAE;YACZ,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC;gBACnD,IAAI,EAAE,IAAI,CAAC,QAAQ;gBACnB,OAAO,EAAE,IAAI;aAChB,CAAC,CAAC;YAEH,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YAEvD,QAAQ,CAAC,MAAM,CACX,oBAAC,SAAS,kBAAC,GAAG,EAAG,IAAI,CAAC,IAAI,IACjB,KAAK,IAEV,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,IACzB,EACF,IAAI,CAAC,QAAuB,CAC/B,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC;IA1BD,IAAI,GAAG;QACH,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;IAC7B,CAAC;IA0BD,IAAI;QACA,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC;IACnC,CAAC;IAED,OAAO;QACH,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,CAAC;QAClC,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9D,CAAC;CAkBF;AA7DH,8BA6DG"} -------------------------------------------------------------------------------- /dist/src/components/confirm-modal/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const operators_1 = require("rxjs/operators"); 4 | const atom_modal_1 = require("../../components/atom-modal"); 5 | const confirm_1 = require("../../../ui/components/confirm"); 6 | function default_1(props) { 7 | return new Promise((resolve, reject) => { 8 | const confirmModalRef = new atom_modal_1.AtomModal(confirm_1.default, props); 9 | confirmModalRef.events$ 10 | .pipe(operators_1.filter(({ type }) => type === 'MODAL_SUBMIT')) 11 | .pipe(operators_1.tap(() => confirmModalRef.hide())) 12 | .pipe(operators_1.tap(() => resolve(true))) 13 | .subscribe(); 14 | confirmModalRef.events$ 15 | .pipe(operators_1.filter(({ type }) => type === 'MODAL_CANCEL')) 16 | .pipe(operators_1.tap(() => reject(false))) 17 | .subscribe(); 18 | }); 19 | } 20 | exports.default = default_1; 21 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/src/components/confirm-modal/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/confirm-modal/index.tsx"],"names":[],"mappings":";;AAAA,8CAA6C;AAE7C,4DAAwD;AACxD,4DAAyE;AAEzE,mBAAwB,KAA6B;IACjD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACnC,MAAM,eAAe,GAAG,IAAI,sBAAS,CAAC,iBAAY,EAAE,KAAK,CAAC,CAAC;QAC3D,eAAe,CAAC,OAAO;aAClB,IAAI,CAAC,kBAAM,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,cAAc,CAAC,CAAC;aACnD,IAAI,CAAC,eAAG,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC;aACvC,IAAI,CAAC,eAAG,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;aAC9B,SAAS,EAAE,CAAC;QAEjB,eAAe,CAAC,OAAO;aAClB,IAAI,CAAC,kBAAM,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,cAAc,CAAC,CAAC;aACnD,IAAI,CAAC,eAAG,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;aAC9B,SAAS,EAAE,CAAC;IACrB,CAAC,CAAC,CAAC;AACP,CAAC;AAdD,4BAcC"} -------------------------------------------------------------------------------- /dist/src/components/modules-block/actions/create.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.CREATE_MODULE = 'CREATE_MODULE'; 4 | function CreateModuleAction(branch, module) { 5 | return { 6 | type: exports.CREATE_MODULE, 7 | payload: { 8 | branch, 9 | module 10 | } 11 | }; 12 | } 13 | exports.CreateModuleAction = CreateModuleAction; 14 | //# sourceMappingURL=create.js.map -------------------------------------------------------------------------------- /dist/src/components/modules-block/actions/create.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../../src/components/modules-block/actions/create.ts"],"names":[],"mappings":";;AAEa,QAAA,aAAa,GAAG,eAAe,CAAC;AAC7C,SAAgB,kBAAkB,CAAC,MAAc,EAAE,MAAc;IAC7D,OAAO;QACH,IAAI,EAAE,qBAAa;QACnB,OAAO,EAAE;YACL,MAAM;YACN,MAAM;SACT;KACJ,CAAA;AACL,CAAC;AARD,gDAQC"} -------------------------------------------------------------------------------- /dist/src/components/modules-block/actions/delete.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.DELETE_MODULE = 'DELETE_MODULE'; 4 | function DeleteModuleAction(branch, module) { 5 | return { 6 | type: exports.DELETE_MODULE, 7 | payload: { 8 | branch, 9 | module 10 | } 11 | }; 12 | } 13 | exports.DeleteModuleAction = DeleteModuleAction; 14 | //# sourceMappingURL=delete.js.map -------------------------------------------------------------------------------- /dist/src/components/modules-block/actions/delete.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../../../src/components/modules-block/actions/delete.ts"],"names":[],"mappings":";;AAEa,QAAA,aAAa,GAAG,eAAe,CAAC;AAC7C,SAAgB,kBAAkB,CAAC,MAAc,EAAE,MAAc;IAC7D,OAAO;QACH,IAAI,EAAE,qBAAa;QACnB,OAAO,EAAE;YACL,MAAM;YACN,MAAM;SACT;KACJ,CAAA;AACL,CAAC;AARD,gDAQC"} -------------------------------------------------------------------------------- /dist/src/components/modules-block/actions/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const tslib_1 = require("tslib"); 4 | tslib_1.__exportStar(require("./create"), exports); 5 | tslib_1.__exportStar(require("./update"), exports); 6 | tslib_1.__exportStar(require("./delete"), exports); 7 | tslib_1.__exportStar(require("./modify"), exports); 8 | tslib_1.__exportStar(require("./open-text-editor"), exports); 9 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/src/components/modules-block/actions/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/modules-block/actions/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB;AACzB,mDAAyB;AACzB,mDAAyB;AACzB,mDAAyB;AACzB,6DAAmC"} -------------------------------------------------------------------------------- /dist/src/components/modules-block/actions/modify.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.MODIFY_MODULE = 'MODIFY_MODULE'; 4 | function ModifyModuleAction(branch, module, modified) { 5 | return { 6 | type: exports.MODIFY_MODULE, 7 | payload: { 8 | branch, 9 | module, 10 | modified 11 | } 12 | }; 13 | } 14 | exports.ModifyModuleAction = ModifyModuleAction; 15 | //# sourceMappingURL=modify.js.map -------------------------------------------------------------------------------- /dist/src/components/modules-block/actions/modify.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"modify.js","sourceRoot":"","sources":["../../../../../src/components/modules-block/actions/modify.ts"],"names":[],"mappings":";;AAEa,QAAA,aAAa,GAAG,eAAe,CAAC;AAC7C,SAAgB,kBAAkB,CAAC,MAAc,EAAE,MAAc,EAAE,QAAiB;IAChF,OAAO;QACH,IAAI,EAAE,qBAAa;QACnB,OAAO,EAAE;YACL,MAAM;YACN,MAAM;YACN,QAAQ;SACX;KACJ,CAAA;AACL,CAAC;AATD,gDASC"} -------------------------------------------------------------------------------- /dist/src/components/modules-block/actions/open-text-editor.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.OPEN_TEXT_EDITOR = 'OPEN_TEXT_EDITOR'; 4 | function OpenTextEditorAction(branch, module, textEditorPending = true) { 5 | return { 6 | type: exports.OPEN_TEXT_EDITOR, 7 | payload: { 8 | module, 9 | branch, 10 | textEditorPending 11 | } 12 | }; 13 | } 14 | exports.OpenTextEditorAction = OpenTextEditorAction; 15 | //# sourceMappingURL=open-text-editor.js.map -------------------------------------------------------------------------------- /dist/src/components/modules-block/actions/open-text-editor.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"open-text-editor.js","sourceRoot":"","sources":["../../../../../src/components/modules-block/actions/open-text-editor.ts"],"names":[],"mappings":";;AAEa,QAAA,gBAAgB,GAAG,kBAAkB,CAAC;AACnD,SAAgB,oBAAoB,CAAC,MAAc,EAAE,MAAc,EAAE,oBAA6B,IAAI;IAClG,OAAO;QACH,IAAI,EAAE,wBAAgB;QACtB,OAAO,EAAE;YACL,MAAM;YACN,MAAM;YACN,iBAAiB;SACpB;KACJ,CAAA;AACL,CAAC;AATD,oDASC"} -------------------------------------------------------------------------------- /dist/src/components/modules-block/actions/update.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.UPDATE_MODULE = 'UPDATE_MODULE'; 4 | function UpdateModuleAction(branch, module, content) { 5 | return { 6 | type: exports.UPDATE_MODULE, 7 | payload: { 8 | branch, 9 | module, 10 | content 11 | } 12 | }; 13 | } 14 | exports.UpdateModuleAction = UpdateModuleAction; 15 | //# sourceMappingURL=update.js.map -------------------------------------------------------------------------------- /dist/src/components/modules-block/actions/update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../../src/components/modules-block/actions/update.ts"],"names":[],"mappings":";;AAEa,QAAA,aAAa,GAAG,eAAe,CAAC;AAC7C,SAAgB,kBAAkB,CAAC,MAAc,EAAE,MAAc,EAAE,OAAe;IAC9E,OAAO;QACH,IAAI,EAAE,qBAAa;QACnB,OAAO,EAAE;YACL,MAAM;YACN,MAAM;YACN,OAAO;SACV;KACJ,CAAA;AACL,CAAC;AATD,gDASC"} -------------------------------------------------------------------------------- /dist/src/components/modules-block/effects/delete.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const fs = require('fs'); 4 | const store_1 = require("../../../store"); 5 | const actions_1 = require("../actions"); 6 | const utils_1 = require("../../../utils"); 7 | exports.deleteEffect = store_1.default 8 | .effect((state, { type, payload: { branch, module } }) => { 9 | state; 10 | if (type !== actions_1.DELETE_MODULE) { 11 | return; 12 | } 13 | const modulePath = utils_1.getModulePath(branch, module); 14 | try { 15 | fs.unlink(modulePath, () => { }); 16 | } 17 | catch (err) { 18 | // Noop. 19 | } 20 | }); 21 | //# sourceMappingURL=delete.js.map -------------------------------------------------------------------------------- /dist/src/components/modules-block/effects/delete.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../../../src/components/modules-block/effects/delete.ts"],"names":[],"mappings":";;AAAA,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAEzB,0CAA0D;AAE1D,wCAEoB;AAEpB,0CAEwB;AAEX,QAAA,YAAY,GAAG,eAAK;KAChC,MAAM,CAAC,CAAC,KAAa,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAU,EAAQ,EAAE;IAC3E,KAAK,CAAC;IAEN,IAAI,IAAI,KAAK,uBAAa,EAAE;QACxB,OAAO;KACV;IAED,MAAM,UAAU,GAAG,qBAAa,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEjD,IAAI;QACA,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA;KAClC;IAAC,OAAO,GAAG,EAAE;QACV,QAAQ;KACX;AACL,CAAC,CAAC,CAAC"} -------------------------------------------------------------------------------- /dist/src/components/modules-block/effects/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const tslib_1 = require("tslib"); 4 | tslib_1.__exportStar(require("./open-text-editor"), exports); 5 | tslib_1.__exportStar(require("./delete"), exports); 6 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/src/components/modules-block/effects/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/modules-block/effects/index.ts"],"names":[],"mappings":";;;AAAA,6DAAmC;AACnC,mDAAyB"} -------------------------------------------------------------------------------- /dist/src/components/modules-block/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const React = require("react"); 4 | const actions_1 = require("./actions"); 5 | const confirm_modal_1 = require("../confirm-modal"); 6 | const store_1 = require("../../store"); 7 | const state_1 = require("../../state"); 8 | require("./reducers"); 9 | const effects = require("./effects"); 10 | Object.values(effects).forEach((effect) => effect.subscribe()); 11 | const modules_view_1 = require("../../../ui/components/modules-view"); 12 | const actions_2 = require("../../actions"); 13 | function ModulesBlock(props) { 14 | return (React.createElement(modules_view_1.default, { branch: props.branch, modules: props.modules, active: props.active, onCreateModule: (...args) => onCreateModule(...args), onSelectModule: (...args) => onSelectModule(...args), onDeleteModule: (...args) => onDeleteModule(...args) })); 15 | async function onCreateModule(module) { 16 | store_1.default.dispatch(actions_1.CreateModuleAction(props.branch, module)); 17 | store_1.default.dispatch(actions_1.OpenTextEditorAction(props.branch, module)); 18 | } 19 | async function onSelectModule(module, textEditorPending) { 20 | store_1.default.dispatch(actions_1.OpenTextEditorAction(props.branch, module, textEditorPending)); 21 | } 22 | async function onDeleteModule(module) { 23 | try { 24 | await confirm_modal_1.default({ 25 | submitBtn: 'Delete', 26 | legend: 'This action cannot be undone! Are you sure?' 27 | }); 28 | } 29 | catch (err) { 30 | return; 31 | } 32 | const modules = state_1.selectModules(props.branch); 33 | delete modules[module]; 34 | await actions_2.updateUserCode(props.branch, modules); 35 | store_1.default.dispatch(actions_1.DeleteModuleAction(props.branch, module)); 36 | } 37 | } 38 | exports.ModulesBlock = ModulesBlock; 39 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/src/components/modules-block/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/modules-block/index.tsx"],"names":[],"mappings":";;AAAA,+BAA+B;AAE/B,uCAImB;AAEnB,oDAAsD;AACtD,uCAA+C;AAC/C,uCAA4C;AAE5C,sBAAoB;AACpB,qCAAqC;AAErC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;AAE/D,sEAA8D;AAC9D,2CAA+C;AAQ/C,SAAgB,YAAY,CAAC,KAAwB;IAEjD,OAAO,CACH,oBAAC,sBAAW,IACR,MAAM,EAAG,KAAK,CAAC,MAAM,EACrB,OAAO,EAAG,KAAK,CAAC,OAAO,EAEvB,MAAM,EAAG,KAAK,CAAC,MAAM,EAErB,cAAc,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,EACpD,cAAc,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,EACpD,cAAc,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,GACtD,CACL,CAAA;IAED,KAAK,UAAU,cAAc,CAAC,MAAc;QACxC,eAAK,CAAC,QAAQ,CAAC,4BAAkB,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;QACzD,eAAK,CAAC,QAAQ,CAAC,8BAAoB,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/D,CAAC;IAED,KAAK,UAAU,cAAc,CAAC,MAAc,EAAE,iBAA0B;QACpE,eAAK,CAAC,QAAQ,CAAC,8BAAoB,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAClF,CAAC;IAED,KAAK,UAAU,cAAc,CAAC,MAAc;QACxC,IAAI;YACA,MAAM,uBAAO,CAAC;gBACV,SAAS,EAAE,QAAQ;gBACnB,MAAM,EAAE,6CAA6C;aACxD,CAAC,CAAC;SAEN;QAAC,OAAM,GAAG,EAAE;YACT,OAAO;SACV;QAED,MAAM,OAAO,GAAG,qBAAa,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC5C,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;QAEvB,MAAM,wBAAc,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAE5C,eAAK,CAAC,QAAQ,CAAC,4BAAkB,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7D,CAAC;AACL,CAAC;AA1CD,oCA0CC"} -------------------------------------------------------------------------------- /dist/src/components/modules-block/reducers/create.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const store_1 = require("../../../store"); 4 | const actions_1 = require("../actions"); 5 | function generateContent(module) { 6 | return `/* 7 | * Module code goes here. Use 'module.exports' to export things: 8 | * module.exports.thing = 'a thing'; 9 | * 10 | * You can import it from another modules like this: 11 | * var mod = require('${module}'); 12 | * mod.thing == 'a thing'; // true 13 | */ 14 | 15 | module.exports = { 16 | 17 | }; 18 | `; 19 | } 20 | store_1.default.reducer((state, { type, payload: { branch, module } }) => { 21 | if (type !== actions_1.CREATE_MODULE) { 22 | return state; 23 | } 24 | const content = generateContent(module); 25 | return Object.assign({}, state, { modules: Object.assign({}, state.modules, { [branch]: Object.assign({}, state.modules[branch], { [module]: { 26 | content, 27 | isNew: true, 28 | modified: true 29 | } }) }) }); 30 | }); 31 | //# sourceMappingURL=create.js.map -------------------------------------------------------------------------------- /dist/src/components/modules-block/reducers/create.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../../src/components/modules-block/reducers/create.ts"],"names":[],"mappings":";;AAAA,0CAA0D;AAC1D,wCAA2C;AAE3C,SAAS,eAAe,CAAC,MAAc;IACnC,OAAO;;;;;uBAKa,MAAO;;;;;;;CAO9B,CAAA;AACD,CAAC;AAED,eAAK,CAAC,OAAO,CAAC,CAAC,KAAa,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAU,EAAU,EAAE;IACnF,IAAI,IAAI,KAAK,uBAAa,EAAE;QACxB,OAAO,KAAK,CAAC;KAChB;IAED,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IAExC,yBACO,KAAK,IACR,OAAO,oBACA,KAAK,CAAC,OAAO,IAChB,CAAC,MAAM,CAAC,oBACD,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IACxB,CAAC,MAAM,CAAC,EAAE;oBACN,OAAO;oBACP,KAAK,EAAE,IAAI;oBACX,QAAQ,EAAE,IAAI;iBACjB,UAGX;AACN,CAAC,CAAC,CAAC"} -------------------------------------------------------------------------------- /dist/src/components/modules-block/reducers/delete.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const store_1 = require("../../../store"); 4 | const actions_1 = require("../actions"); 5 | store_1.default.reducer((state, { type, payload: { branch, module } }) => { 6 | if (type !== actions_1.DELETE_MODULE) { 7 | return state; 8 | } 9 | delete state.modules[branch][module]; 10 | return Object.assign({}, state, { modules: Object.assign({}, state.modules, { [branch]: Object.assign({}, state.modules[branch]) }) }); 11 | }); 12 | //# sourceMappingURL=delete.js.map -------------------------------------------------------------------------------- /dist/src/components/modules-block/reducers/delete.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../../../src/components/modules-block/reducers/delete.ts"],"names":[],"mappings":";;AAAA,0CAA0D;AAC1D,wCAA2C;AAE3C,eAAK,CAAC,OAAO,CAAC,CAAC,KAAa,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAU,EAAU,EAAE;IACnF,IAAI,IAAI,KAAK,uBAAa,EAAE;QACxB,OAAO,KAAK,CAAC;KAChB;IAED,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;IAErC,yBACO,KAAK,IACR,OAAO,oBACA,KAAK,CAAC,OAAO,IAChB,CAAC,MAAM,CAAC,oBACD,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,QAGlC;AACN,CAAC,CAAC,CAAC"} -------------------------------------------------------------------------------- /dist/src/components/modules-block/reducers/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | require("./create"); 4 | require("./delete"); 5 | require("./update"); 6 | require("./modify"); 7 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/src/components/modules-block/reducers/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/modules-block/reducers/index.ts"],"names":[],"mappings":";;AAAA,oBAAkB;AAClB,oBAAkB;AAClB,oBAAkB;AAClB,oBAAkB"} -------------------------------------------------------------------------------- /dist/src/components/modules-block/reducers/modify.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const store_1 = require("../../../store"); 4 | const actions_1 = require("../actions"); 5 | store_1.default.reducer((state, { type, payload: { branch, module, modified } }) => { 6 | if (type !== actions_1.MODIFY_MODULE) { 7 | return state; 8 | } 9 | try { 10 | if (state.modules[branch][module].modified === modified) { 11 | return state; 12 | } 13 | } 14 | catch (err) { 15 | return state; 16 | } 17 | return Object.assign({}, state, { modules: Object.assign({}, state.modules, { [branch]: Object.assign({}, state.modules[branch], { [module]: Object.assign({}, state.modules[branch][module], { modified }) }) }) }); 18 | }); 19 | //# sourceMappingURL=modify.js.map -------------------------------------------------------------------------------- /dist/src/components/modules-block/reducers/modify.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"modify.js","sourceRoot":"","sources":["../../../../../src/components/modules-block/reducers/modify.ts"],"names":[],"mappings":";;AAAA,0CAA0D;AAC1D,wCAA2C;AAE3C,eAAK,CAAC,OAAO,CAAC,CAAC,KAAa,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAC,EAAU,EAAU,EAAE;IAC5F,IAAI,IAAI,KAAK,uBAAa,EAAE;QACxB,OAAO,KAAK,CAAC;KAChB;IAED,IAAI;QACA,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,KAAK,QAAQ,EAAE;YACrD,OAAO,KAAK,CAAC;SAChB;KACJ;IAAC,OAAM,GAAG,EAAE;QACT,OAAO,KAAK,CAAC;KAChB;IAED,yBACO,KAAK,IACR,OAAO,oBACA,KAAK,CAAC,OAAO,IAChB,CAAC,MAAM,CAAC,oBACD,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IACxB,CAAC,MAAM,CAAC,oBACD,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,IAChC,QAAQ,aAItB;AACN,CAAC,CAAC,CAAC"} -------------------------------------------------------------------------------- /dist/src/components/modules-block/reducers/update.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const store_1 = require("../../../store"); 4 | const actions_1 = require("../actions"); 5 | store_1.default.reducer((state, { type, payload: { branch, module, content } }) => { 6 | if (type !== actions_1.UPDATE_MODULE) { 7 | return state; 8 | } 9 | return Object.assign({}, state, { modules: Object.assign({}, state.modules, { [branch]: Object.assign({}, state.modules[branch], { [module]: Object.assign({}, state.modules[branch][module], { content }) }) }) }); 10 | }); 11 | //# sourceMappingURL=update.js.map -------------------------------------------------------------------------------- /dist/src/components/modules-block/reducers/update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../../src/components/modules-block/reducers/update.ts"],"names":[],"mappings":";;AAAA,0CAA0D;AAC1D,wCAA2C;AAE3C,eAAK,CAAC,OAAO,CAAC,CAAC,KAAa,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,EAAU,EAAU,EAAE;IAC5F,IAAI,IAAI,KAAK,uBAAa,EAAE;QACxB,OAAO,KAAK,CAAC;KAChB;IAED,yBACO,KAAK,IACR,OAAO,oBACA,KAAK,CAAC,OAAO,IAChB,CAAC,MAAM,CAAC,oBACD,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IACxB,CAAC,MAAM,CAAC,oBACD,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,IAChC,OAAO,aAIrB;AACN,CAAC,CAAC,CAAC"} -------------------------------------------------------------------------------- /dist/src/components/prompt-modal/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const operators_1 = require("rxjs/operators"); 4 | const atom_modal_1 = require("../../components/atom-modal"); 5 | const prompt_1 = require("../../../ui/components/prompt"); 6 | function default_1(props) { 7 | return new Promise((resolve, reject) => { 8 | const promptModalRef = new atom_modal_1.AtomModal(prompt_1.default, props); 9 | promptModalRef.events$ 10 | .pipe(operators_1.filter(({ type }) => type === 'MODAL_SUBMIT')) 11 | .pipe(operators_1.tap(() => promptModalRef.hide())) 12 | .pipe(operators_1.tap(({ payload }) => resolve(payload))) 13 | .subscribe(); 14 | promptModalRef.events$ 15 | .pipe(operators_1.filter(({ type }) => type === 'MODAL_CANCEL')) 16 | .pipe(operators_1.tap(() => reject(null))) 17 | .subscribe(); 18 | }); 19 | } 20 | exports.default = default_1; 21 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/src/components/prompt-modal/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/prompt-modal/index.tsx"],"names":[],"mappings":";;AAAA,8CAA6C;AAE7C,4DAAwD;AACxD,0DAAuE;AAEvE,mBAAwB,KAA6B;IACjD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACnC,MAAM,cAAc,GAAG,IAAI,sBAAS,CAAC,gBAAW,EAAE,KAAK,CAAC,CAAC;QACzD,cAAc,CAAC,OAAO;aACjB,IAAI,CAAC,kBAAM,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,cAAc,CAAC,CAAC;aACnD,IAAI,CAAC,eAAG,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC;aACtC,IAAI,CAAC,eAAG,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;aAC5C,SAAS,EAAE,CAAC;QAEjB,cAAc,CAAC,OAAO;aACjB,IAAI,CAAC,kBAAM,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,cAAc,CAAC,CAAC;aACnD,IAAI,CAAC,eAAG,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;aAC7B,SAAS,EAAE,CAAC;IACrB,CAAC,CAAC,CAAC;AACP,CAAC;AAdD,4BAcC"} -------------------------------------------------------------------------------- /dist/src/components/screeps-panel/actions/add-project.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.ADD_PROJECT = 'ADD_PROJECT'; 4 | function AddProjectAction() { 5 | return { 6 | type: exports.ADD_PROJECT, 7 | payload: {} 8 | }; 9 | } 10 | exports.AddProjectAction = AddProjectAction; 11 | //# sourceMappingURL=add-project.js.map -------------------------------------------------------------------------------- /dist/src/components/screeps-panel/actions/add-project.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"add-project.js","sourceRoot":"","sources":["../../../../../src/components/screeps-panel/actions/add-project.ts"],"names":[],"mappings":";;AAEa,QAAA,WAAW,GAAG,aAAa,CAAC;AACzC,SAAgB,gBAAgB;IAC5B,OAAO;QACH,IAAI,EAAE,mBAAW;QACjB,OAAO,EAAE,EAAG;KACf,CAAA;AACL,CAAC;AALD,4CAKC"} -------------------------------------------------------------------------------- /dist/src/components/screeps-panel/actions/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const tslib_1 = require("tslib"); 4 | tslib_1.__exportStar(require("./update"), exports); 5 | tslib_1.__exportStar(require("./add-project"), exports); 6 | tslib_1.__exportStar(require("./set-active-module"), exports); 7 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/src/components/screeps-panel/actions/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/screeps-panel/actions/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB;AACzB,wDAA8B;AAC9B,8DAAoC"} -------------------------------------------------------------------------------- /dist/src/components/screeps-panel/actions/set-active-module.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.SET_ACTIVE_MODULE = 'SET_ACTIVE_MODULE'; 4 | function SetActiveModule(branch, module) { 5 | return { 6 | type: exports.SET_ACTIVE_MODULE, 7 | payload: { 8 | branch, 9 | module 10 | } 11 | }; 12 | } 13 | exports.SetActiveModule = SetActiveModule; 14 | //# sourceMappingURL=set-active-module.js.map -------------------------------------------------------------------------------- /dist/src/components/screeps-panel/actions/set-active-module.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"set-active-module.js","sourceRoot":"","sources":["../../../../../src/components/screeps-panel/actions/set-active-module.ts"],"names":[],"mappings":";;AAEa,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AACrD,SAAgB,eAAe,CAAC,MAAqB,EAAE,MAAqB;IACxE,OAAO;QACH,IAAI,EAAE,yBAAiB;QACvB,OAAO,EAAE;YACL,MAAM;YACN,MAAM;SACT;KACJ,CAAA;AACL,CAAC;AARD,0CAQC"} -------------------------------------------------------------------------------- /dist/src/components/screeps-panel/actions/update.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.UPDATE_MODULES = 'UPDATE_MODULES'; 4 | function UpdateModulesAction(branch, modules) { 5 | return { 6 | type: exports.UPDATE_MODULES, 7 | payload: { 8 | branch, 9 | modules 10 | } 11 | }; 12 | } 13 | exports.UpdateModulesAction = UpdateModulesAction; 14 | //# sourceMappingURL=update.js.map -------------------------------------------------------------------------------- /dist/src/components/screeps-panel/actions/update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../../src/components/screeps-panel/actions/update.ts"],"names":[],"mappings":";;AAEa,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAC/C,SAAgB,mBAAmB,CAAC,MAAc,EAAE,OAAqB;IACrE,OAAO;QACH,IAAI,EAAE,sBAAc;QACpB,OAAO,EAAE;YACL,MAAM;YACN,OAAO;SACV;KACJ,CAAA;AACL,CAAC;AARD,kDAQC"} -------------------------------------------------------------------------------- /dist/src/components/screeps-panel/reducers/add-project.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const store_1 = require("../../../store"); 4 | const actions_1 = require("../actions"); 5 | store_1.default.reducer((state, { type }) => { 6 | if (type !== actions_1.ADD_PROJECT) { 7 | return state; 8 | } 9 | return Object.assign({}, state); 10 | }); 11 | //# sourceMappingURL=add-project.js.map -------------------------------------------------------------------------------- /dist/src/components/screeps-panel/reducers/add-project.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"add-project.js","sourceRoot":"","sources":["../../../../../src/components/screeps-panel/reducers/add-project.ts"],"names":[],"mappings":";;AAAA,0CAA0D;AAC1D,wCAAyC;AAEzC,eAAK,CAAC,OAAO,CAAC,CAAC,KAAa,EAAE,EAAE,IAAI,EAAU,EAAU,EAAE;IACtD,IAAI,IAAI,KAAK,qBAAW,EAAE;QACtB,OAAO,KAAK,CAAC;KAChB;IAED,yBACO,KAAK,EACV;AACN,CAAC,CAAC,CAAC"} -------------------------------------------------------------------------------- /dist/src/components/screeps-panel/reducers/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | require("./update"); 4 | require("./add-project"); 5 | require("./remove-project"); 6 | require("./set-active-module"); 7 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/src/components/screeps-panel/reducers/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/screeps-panel/reducers/index.ts"],"names":[],"mappings":";;AAAA,oBAAkB;AAClB,yBAAuB;AACvB,4BAA0B;AAC1B,+BAA6B"} -------------------------------------------------------------------------------- /dist/src/components/screeps-panel/reducers/remove-project.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const store_1 = require("../../../store"); 4 | // import { REMOVE_PROJECT } from '../actions'; 5 | store_1.default.reducer((state, { type }) => { 6 | if (type !== 'REMOVE_PROJECT') { 7 | return state; 8 | } 9 | return Object.assign({}, state); 10 | }); 11 | //# sourceMappingURL=remove-project.js.map -------------------------------------------------------------------------------- /dist/src/components/screeps-panel/reducers/remove-project.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"remove-project.js","sourceRoot":"","sources":["../../../../../src/components/screeps-panel/reducers/remove-project.ts"],"names":[],"mappings":";;AAAA,0CAA0D;AAC1D,+CAA+C;AAE/C,eAAK,CAAC,OAAO,CAAC,CAAC,KAAa,EAAE,EAAE,IAAI,EAAU,EAAU,EAAE;IACtD,IAAI,IAAI,KAAK,gBAAgB,EAAE;QAC3B,OAAO,KAAK,CAAC;KAChB;IAED,yBACO,KAAK,EACV;AACN,CAAC,CAAC,CAAC"} -------------------------------------------------------------------------------- /dist/src/components/screeps-panel/reducers/set-active-module.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const store_1 = require("../../../store"); 4 | const actions_1 = require("../actions"); 5 | store_1.default.reducer((state, { type, payload: { branch, module } }) => { 6 | if (type !== actions_1.SET_ACTIVE_MODULE) { 7 | return state; 8 | } 9 | return Object.assign({}, state, { activeBranchTextEditor: branch, activeModuleTextEditor: module }); 10 | }); 11 | //# sourceMappingURL=set-active-module.js.map -------------------------------------------------------------------------------- /dist/src/components/screeps-panel/reducers/set-active-module.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"set-active-module.js","sourceRoot":"","sources":["../../../../../src/components/screeps-panel/reducers/set-active-module.ts"],"names":[],"mappings":";;AAAA,0CAA0D;AAC1D,wCAA+C;AAE/C,eAAK,CAAC,OAAO,CAAC,CAAC,KAAa,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAU,EAAU,EAAE;IACnF,IAAI,IAAI,KAAK,2BAAiB,EAAE;QAC5B,OAAO,KAAK,CAAC;KAChB;IAED,yBACO,KAAK,IACR,sBAAsB,EAAE,MAAM,EAC9B,sBAAsB,EAAE,MAAM,IAChC;AACN,CAAC,CAAC,CAAC"} -------------------------------------------------------------------------------- /dist/src/components/screeps-panel/reducers/update.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const store_1 = require("../../../store"); 4 | const actions_1 = require("../actions"); 5 | store_1.default.reducer((state, { type, payload: { branch, modules } }) => { 6 | if (type !== actions_1.UPDATE_MODULES) { 7 | return state; 8 | } 9 | const modules1 = Object.entries(state.modules[branch]) 10 | .filter(([, { isNew }]) => isNew) 11 | .reduce((modules, [module, { isNew, modified }]) => { 12 | modules[module] = { 13 | isNew, 14 | modified 15 | }; 16 | return modules; 17 | }, {}); 18 | const modules2 = Object.entries(modules) 19 | .filter(([, content]) => !!content) 20 | .reduce((modules, [module, content]) => { 21 | modules[module] = { 22 | content, 23 | modified: false 24 | }; 25 | return modules; 26 | }, {}); 27 | // Object.entries(modules2).forEach(() => { 28 | // }) 29 | return Object.assign({}, state, { modules: Object.assign({}, state.modules, { [branch]: Object.assign({}, modules1, modules2) }) }); 30 | }); 31 | //# sourceMappingURL=update.js.map -------------------------------------------------------------------------------- /dist/src/components/screeps-panel/reducers/update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../../src/components/screeps-panel/reducers/update.ts"],"names":[],"mappings":";;AAAA,0CAA0D;AAC1D,wCAA4C;AAE5C,eAAK,CAAC,OAAO,CAAC,CAAC,KAAa,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,EAAU,EAAU,EAAE;IACpF,IAAI,IAAI,KAAK,wBAAc,EAAE;QACzB,OAAO,KAAK,CAAC;KAChB;IAED,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;SACjD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC;SAChC,MAAM,CAAC,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE;QAC/C,OAAO,CAAC,MAAM,CAAC,GAAG;YACd,KAAK;YACL,QAAQ;SACX,CAAC;QAEF,OAAO,OAAO,CAAC;IACnB,CAAC,EAAE,EAAS,CAAC,CAAA;IAEjB,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;SACnC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;SAClC,MAAM,CAAC,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE;QACnC,OAAO,CAAC,MAAM,CAAC,GAAG;YACd,OAAO;YACP,QAAQ,EAAE,KAAK;SAClB,CAAC;QAEF,OAAO,OAAO,CAAC;IACnB,CAAC,EAAE,EAAS,CAAC,CAAA;IAEjB,2CAA2C;IAE3C,KAAK;IAEL,yBACO,KAAK,IACR,OAAO,oBACA,KAAK,CAAC,OAAO,IAChB,CAAC,MAAM,CAAC,oBACD,QAAQ,EACR,QAAQ,QAGrB;AACN,CAAC,CAAC,CAAC"} -------------------------------------------------------------------------------- /dist/src/components/screeps-status-bar/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const React = require("react"); 4 | const ReactDOM = require("react-dom"); 5 | class ScreepsStatusBar { 6 | constructor() { 7 | this.element = document.createElement('div'); 8 | this.element.classList.add('screeps-ide__status-bar', 'screeps-ide__status-bar--screeps', 'inline-block'); 9 | this.render(); 10 | } 11 | render() { 12 | ReactDOM.render(React.createElement("div", null, 13 | React.createElement("b", { className: 'sc-icon-screeps' }), 14 | React.createElement("i", null, "Screeps")), this.element); 15 | } 16 | } 17 | exports.ScreepsStatusBar = ScreepsStatusBar; 18 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/src/components/screeps-status-bar/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/screeps-status-bar/index.tsx"],"names":[],"mappings":";;AAAA,+BAA+B;AAC/B,sCAAsC;AAEtC,MAAa,gBAAgB;IAGzB;QAFO,YAAO,GAAgB,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAIxD,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CACtB,yBAAyB,EACzB,kCAAkC,EAClC,cAAc,CACjB,CAAC;QAEF,IAAI,CAAC,MAAM,EAAE,CAAC;IAClB,CAAC;IAED,MAAM;QACF,QAAQ,CAAC,MAAM,CACX;YACI,2BAAG,SAAS,EAAC,iBAAiB,GAAK;YACnC,yCAAc,CACZ,EACN,IAAI,CAAC,OAAO,CACf,CAAA;IACL,CAAC;CACJ;AAvBD,4CAuBC"} -------------------------------------------------------------------------------- /dist/src/components/token-modal/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/src/components/token-modal/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/token-modal/index.tsx"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /dist/src/components/welcome-pane/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const React = require("react"); 4 | const ReactDOM = require("react-dom"); 5 | const commands_1 = require("../../commands"); 6 | const config_1 = require("../../config"); 7 | const ui_1 = require("../../../ui"); 8 | const store_1 = require("../../store"); 9 | const actions_1 = require("../../store/actions"); 10 | const screeps_panel_1 = require("../screeps-panel"); 11 | exports.WELCOME_URI = 'atom://screeps-ide/welcome'; 12 | class WelcomePane { 13 | constructor() { 14 | this.element = document.createElement('div'); 15 | this.render(); 16 | } 17 | render() { 18 | ReactDOM.render(React.createElement(ui_1.WelcomeView, { showOnStartup: config_1.configGetter('showOnStartup'), onSignin: () => this.onSignin(), onCreateNewProject: () => this.onCreateNewProject(), onChangeShowOnStartup: (...args) => this.onChangeShowOnStartup(...args) }), this.element); 19 | } 20 | async onSignin() { 21 | try { 22 | await commands_1.authCommand(); 23 | atom.workspace.open(screeps_panel_1.SCREEPS_URI, { 24 | activatePane: true, 25 | activateItem: true, 26 | // split: 'down', 27 | location: 'bottom' 28 | }); 29 | } 30 | catch (err) { 31 | // Noop. 32 | } 33 | } 34 | async onCreateNewProject() { 35 | store_1.default.dispatch(actions_1.CreateProjectAction()); 36 | } 37 | onChangeShowOnStartup(value) { 38 | config_1.configSetter('showOnStartup', value); 39 | } 40 | // Atom pane required interface's methods 41 | getURI() { 42 | return exports.WELCOME_URI; 43 | } 44 | getTitle() { 45 | return 'Welcome to Screeps'; 46 | } 47 | } 48 | exports.WelcomePane = WelcomePane; 49 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/src/components/welcome-pane/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/welcome-pane/index.tsx"],"names":[],"mappings":";;AAAA,+BAA+B;AAC/B,sCAAsC;AAEtC,6CAA6C;AAC7C,yCAA0D;AAC1D,oCAA0C;AAE1C,uCAA+C;AAC/C,iDAA0D;AAE1D,oDAA+C;AAElC,QAAA,WAAW,GAAG,4BAA4B,CAAC;AAExD,MAAa,WAAW;IAGpB;QACI,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAI,CAAC,MAAM,EAAE,CAAC;IAClB,CAAC;IAED,MAAM;QACF,QAAQ,CAAC,MAAM,CACX,oBAAC,gBAAW,IACR,aAAa,EAAG,qBAAY,CAAC,eAAe,CAAY,EAExD,QAAQ,EAAG,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,EAChC,kBAAkB,EAAG,GAAG,EAAE,CAAC,IAAI,CAAC,kBAAkB,EAAE,EACpD,qBAAqB,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,qBAAqB,CAAC,GAAG,IAAI,CAAC,GACzE,EACF,IAAI,CAAC,OAAO,CACf,CAAC;IACN,CAAC;IAED,KAAK,CAAC,QAAQ;QACV,IAAI;YACA,MAAM,sBAAW,EAAE,CAAC;YAEpB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,2BAAW,EAAE;gBAC7B,YAAY,EAAE,IAAI;gBAClB,YAAY,EAAE,IAAI;gBAClB,iBAAiB;gBACjB,QAAQ,EAAE,QAAQ;aACrB,CAAC,CAAC;SACN;QAAC,OAAM,GAAG,EAAE;YACT,QAAQ;SACX;IACL,CAAC;IAED,KAAK,CAAC,kBAAkB;QACpB,eAAK,CAAC,QAAQ,CAAC,6BAAmB,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED,qBAAqB,CAAC,KAAc;QAChC,qBAAY,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC;IAED,yCAAyC;IACzC,MAAM;QACF,OAAO,mBAAW,CAAC;IACvB,CAAC;IAED,QAAQ;QACJ,OAAO,oBAAoB,CAAC;IAChC,CAAC;CACJ;AApDD,kCAoDC"} -------------------------------------------------------------------------------- /dist/src/config.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":";;AAMa,QAAA,YAAY,GAAG,aAAa,CAAC;AAE1C,MAAM,MAAM,GAAG;IACX,KAAK,EAAE,QAAQ;IACf,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,CAAC;IACR,UAAU,EAAE;QACR,SAAS,EAAE;YACP,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;YACX,KAAK,EAAE,CAAC;SACX;QAED,MAAM,EAAE;YACJ,KAAK,EAAE,gBAAgB;YACvB,WAAW,EAAE,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,yBAAyB;YAClC,KAAK,EAAE,CAAC;SACX;QAED,YAAY,EAAE;YACV,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EAAE,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,4BAA4B;YACrC,KAAK,EAAE,CAAC;SACX;QAED,GAAG,EAAE;YACD,KAAK,EAAE,gBAAgB;YACvB,WAAW,EAAE,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,QAAQ;YACjB,KAAK,EAAE,CAAC;SACX;KACJ;CACJ,CAAC;AAEF,IAAI,MAAM,GAAgB;IACtB,aAAa,EAAE;QACX,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,4EAA4E;KAC5F;IAED,iBAAiB,EAAE;QACf,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;QACd,WAAW,EAAE,6CAA6C;KAC7D;IAED,MAAM;CACT,CAAC;AAEF,kBAAe,MAAM,CAAC;AAEtB,SAAgB,YAAY,CAAC,IAAY;IACrC,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAI,oBAAa,IAAK,IAAK,EAAE,CAAC,CAAC;IAE3D,IAAI,CAAC,KAAK,EAAE;QACR,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAI,oBAAa,UAAW,IAAK,EAAE,CAAC,CAAC;KAChE;IAED,IAAI,CAAC,KAAK,EAAE;QACR,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAI,oBAAa,WAAY,IAAK,EAAE,CAAC,CAAC;KACjE;IAED,OAAO,KAAK,CAAC;AACjB,CAAC;AAZD,oCAYC;AAED,SAAgB,YAAY,CAAC,IAAY,EAAE,KAAuB;IAC9D,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAI,oBAAa,IAAK,IAAK,EAAE,EAAE,KAAK,CAAC,CAAC;AAC1D,CAAC;AAFD,oCAEC"} -------------------------------------------------------------------------------- /dist/src/consumed-services/consume-status-bar.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const atom_1 = require("atom"); 4 | const screeps_panel_1 = require("../components/screeps-panel"); 5 | const screeps_status_bar_1 = require("../components/screeps-status-bar"); 6 | const priority = 10000; 7 | function consumeStatusBar(statusBar) { 8 | const subscriptions = new atom_1.CompositeDisposable(); 9 | const consoleStatusBar = new screeps_status_bar_1.ScreepsStatusBar(); 10 | statusBar.addLeftTile({ item: consoleStatusBar.element, priority }); 11 | consoleStatusBar.element.addEventListener('click', () => atom.workspace.open(screeps_panel_1.SCREEPS_URI, { 12 | activatePane: true, 13 | activateItem: true, 14 | // split: 'down', 15 | location: 'left' 16 | })); 17 | statusBar.addLeftTile({ 18 | item: consoleStatusBar.element, 19 | priority 20 | }); 21 | subscriptions.add(atom.tooltips.add(consoleStatusBar.element, { title: 'Show Screeps panel' })); 22 | } 23 | exports.consumeStatusBar = consumeStatusBar; 24 | //# sourceMappingURL=consume-status-bar.js.map -------------------------------------------------------------------------------- /dist/src/consumed-services/consume-status-bar.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"consume-status-bar.js","sourceRoot":"","sources":["../../../src/consumed-services/consume-status-bar.ts"],"names":[],"mappings":";;AAAA,+BAA2C;AAI3C,+DAA0D;AAE1D,yEAAoE;AAEpE,MAAM,QAAQ,GAAG,KAAK,CAAC;AAEvB,SAAgB,gBAAgB,CAAC,SAAc;IAC3C,MAAM,aAAa,GAAG,IAAI,0BAAmB,EAAE,CAAC;IAEhD,MAAM,gBAAgB,GAAG,IAAI,qCAAgB,EAAE,CAAC;IAEhD,SAAS,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;IACpE,gBAAgB,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,2BAAW,EAAE;QACtF,YAAY,EAAE,IAAI;QAClB,YAAY,EAAE,IAAI;QAClB,iBAAiB;QACjB,QAAQ,EAAE,MAAM;KACnB,CAAC,CAAC,CAAC;IAEJ,SAAS,CAAC,WAAW,CAAC;QAClB,IAAI,EAAE,gBAAgB,CAAC,OAAO;QAC9B,QAAQ;KACX,CAAC,CAAC;IACH,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,gBAAgB,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAC,CAAC,CAAC,CAAC;AACnG,CAAC;AAlBD,4CAkBC"} -------------------------------------------------------------------------------- /dist/src/consumed-services/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const tslib_1 = require("tslib"); 4 | tslib_1.__exportStar(require("./consume-tree-view"), exports); 5 | tslib_1.__exportStar(require("./consume-status-bar"), exports); 6 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/src/consumed-services/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/consumed-services/index.ts"],"names":[],"mappings":";;;AAAA,8DAAoC;AACpC,+DAAqC"} -------------------------------------------------------------------------------- /dist/src/decoratos/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const tslib_1 = require("tslib"); 4 | tslib_1.__exportStar(require("./progress"), exports); 5 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/src/decoratos/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decoratos/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B"} -------------------------------------------------------------------------------- /dist/src/decoratos/progress.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | let animationStartTime = 0; 4 | const ANIMATION_MIN_TIME = 1500; 5 | // @ts-ignore 6 | function progress(target, name, descriptor) { 7 | const original = descriptor.value; 8 | descriptor.value = async function (...args) { 9 | showProgress(this); 10 | let result; 11 | try { 12 | result = await original.apply(this, args); 13 | } 14 | catch (err) { 15 | hideProgress(this); 16 | throw err; 17 | } 18 | hideProgress(this); 19 | return result; 20 | }; 21 | return descriptor; 22 | } 23 | exports.progress = progress; 24 | function showProgress(component) { 25 | animationStartTime = new Date().getTime(); 26 | component.state = { isProgressing: true }; 27 | } 28 | function hideProgress(component) { 29 | const now = new Date().getTime(); 30 | const delay = ANIMATION_MIN_TIME - (now - animationStartTime); 31 | setTimeout(() => { 32 | component.state = { isProgressing: false }; 33 | }, delay > 0 ? delay : 0); 34 | } 35 | //# sourceMappingURL=progress.js.map -------------------------------------------------------------------------------- /dist/src/decoratos/progress.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"progress.js","sourceRoot":"","sources":["../../../src/decoratos/progress.ts"],"names":[],"mappings":";;AAAA,IAAI,kBAAkB,GAAW,CAAC,CAAC;AACnC,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEhC,aAAa;AACb,SAAgB,QAAQ,CAAC,MAAW,EAAE,IAAS,EAAE,UAAe;IAC5D,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC;IAElC,UAAU,CAAC,KAAK,GAAG,KAAK,WAAU,GAAG,IAAW;QAC5C,YAAY,CAAC,IAAI,CAAC,CAAC;QAEnB,IAAI,MAAM,CAAC;QACX,IAAI;YACA,MAAM,GAAG,MAAM,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;SAC7C;QAAC,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,IAAI,CAAC,CAAC;YACnB,MAAM,GAAG,CAAC;SACb;QAED,YAAY,CAAC,IAAI,CAAC,CAAC;QACnB,OAAO,MAAM,CAAC;IAClB,CAAC,CAAC;IAEF,OAAO,UAAU,CAAC;AACtB,CAAC;AAnBD,4BAmBC;AAGD,SAAS,YAAY,CAAC,SAAc;IAChC,kBAAkB,GAAG,IAAI,IAAI,EAAE,CAAE,OAAO,EAAE,CAAC;IAE3C,SAAS,CAAC,KAAK,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;AAC9C,CAAC;AAED,SAAS,YAAY,CAAC,SAAc;IAChC,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAE,OAAO,EAAE,CAAC;IAClC,MAAM,KAAK,GAAG,kBAAkB,GAAG,CAAC,GAAG,GAAG,kBAAkB,CAAC,CAAC;IAE9D,UAAU,CAAC,GAAG,EAAE;QACZ,SAAS,CAAC,KAAK,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;IAC/C,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC"} -------------------------------------------------------------------------------- /dist/src/service.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const rxjs_1 = require("rxjs"); 4 | // import { } 5 | const utils_1 = require("./utils"); 6 | class Service { 7 | constructor() { 8 | this.state = new rxjs_1.BehaviorSubject({ 9 | modules: {}, 10 | branch: '', 11 | branches: [] 12 | }); 13 | this.state$ = this.state.asObservable(); 14 | this.shards = new rxjs_1.BehaviorSubject([]); 15 | this.shards$ = this.shards.asObservable(); 16 | this.getGameShardsInfo(); 17 | } 18 | getUserBranches() { 19 | this._api.getUserBranches() 20 | .then(({ list }) => { 21 | const data = this.state.getValue(); 22 | this.state.next(Object.assign({}, data, { branches: list })); 23 | }); 24 | } 25 | getUserCode(branch) { 26 | const data = this.state.getValue(); 27 | this.state.next(Object.assign({}, data, { branch, modules: {} })); 28 | this._api.getUserCode(branch) 29 | .then(({ branch, modules }) => { 30 | const data = this.state.getValue(); 31 | this.state.next(Object.assign({}, data, { branch, 32 | modules })); 33 | }); 34 | } 35 | async getGameShardsInfo() { 36 | const api = await utils_1.getApi(); 37 | const { shards } = await api.getGameShardsInfo(); 38 | this.shards.next(shards); 39 | } 40 | } 41 | exports.Service = Service; 42 | //# sourceMappingURL=service.js.map -------------------------------------------------------------------------------- /dist/src/service.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/service.ts"],"names":[],"mappings":";;AAAA,+BAAuC;AACvC,aAAa;AAEb,mCAAiC;AAEjC,MAAa,OAAO;IAahB;QAZO,UAAK,GAAyB,IAAI,sBAAe,CAAC;YACrD,OAAO,EAAE,EAAE;YACX,MAAM,EAAE,EAAE;YACV,QAAQ,EAAE,EAAE;SACf,CAAC,CAAC;QACI,WAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;QAEnC,WAAM,GAAyB,IAAI,sBAAe,CAAC,EAAE,CAAC,CAAC;QACvD,YAAO,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;QAKxC,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAC7B,CAAC;IAED,eAAe;QACX,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;aACtB,IAAI,CAAC,CAAC,EAAE,IAAI,EAAiB,EAAE,EAAE;YAC9B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;YACnC,IAAI,CAAC,KAAK,CAAC,IAAI,mBACR,IAAI,IACP,QAAQ,EAAE,IAAI,IAChB,CAAC;QACP,CAAC,CAAC,CAAC;IACX,CAAC;IAED,WAAW,CAAC,MAAe;QACvB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;QACnC,IAAI,CAAC,KAAK,CAAC,IAAI,mBACR,IAAI,IACP,MAAM,EACN,OAAO,EAAE,EAAE,IACb,CAAC;QAEH,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC;aACxB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAiC,EAAE,EAAE;YACzD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;YACnC,IAAI,CAAC,KAAK,CAAC,IAAI,mBACR,IAAI,IACP,MAAM;gBACN,OAAO,IACT,CAAC;QACP,CAAC,CAAC,CAAC;IACX,CAAC;IAED,KAAK,CAAC,iBAAiB;QACnB,MAAM,GAAG,GAAG,MAAM,cAAM,EAAE,CAAC;QAC3B,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC,iBAAiB,EAAE,CAAC;QAEjD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;CACJ;AArDD,0BAqDC"} -------------------------------------------------------------------------------- /dist/src/services/user.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | class User { 4 | constructor(_data) { 5 | this._data = _data; 6 | console.log(this._data); 7 | } 8 | get id() { 9 | return this._data._id; 10 | } 11 | get shard() { 12 | const shards = Object.keys(this._data.cpuShard); 13 | return shards[0]; 14 | } 15 | } 16 | exports.User = User; 17 | //# sourceMappingURL=user.js.map -------------------------------------------------------------------------------- /dist/src/services/user.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"user.js","sourceRoot":"","sources":["../../../src/services/user.ts"],"names":[],"mappings":";;AAAA,MAAa,IAAI;IAUb,YAAoB,KAAsB;QAAtB,UAAK,GAAL,KAAK,CAAiB;QACtC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAXD,IAAI,EAAE;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;IAC1B,CAAC;IAED,IAAI,KAAK;QACL,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChD,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;IACrB,CAAC;CAKJ;AAbD,oBAaC"} -------------------------------------------------------------------------------- /dist/src/state.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const rxjs_1 = require("rxjs"); 4 | exports.INITIAL_STATE = { 5 | branch: '', 6 | branches: [], 7 | modules: { 8 | default: {} 9 | }, 10 | projects: {}, 11 | files: {} 12 | }; 13 | const __state = new rxjs_1.BehaviorSubject(exports.INITIAL_STATE); 14 | const next = __state.next; 15 | __state.next = function (...args) { 16 | // console.log(.1, 'next', ...args); 17 | return next.apply(this, args); 18 | }; 19 | exports.default = __state; 20 | function selectModules(branch) { 21 | const { modules } = __state.getValue(); 22 | return Object.entries(modules[branch]) 23 | .reduce((modules, [module, { content, deleted, isNew }]) => { 24 | if (!deleted && !isNew) { 25 | modules[module] = content; 26 | } 27 | return modules; 28 | }, {}); 29 | } 30 | exports.selectModules = selectModules; 31 | function selectProjectPath(filePath) { 32 | const { projects } = __state.getValue(); 33 | if (!projects) { 34 | return; 35 | } 36 | const projectPath = Object.keys(projects).find((projectPath) => { 37 | return filePath.includes(projectPath); 38 | }); 39 | return projectPath; 40 | } 41 | exports.selectProjectPath = selectProjectPath; 42 | //# sourceMappingURL=state.js.map -------------------------------------------------------------------------------- /dist/src/state.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/state.ts"],"names":[],"mappings":";;AAAA,+BAAuC;AAE1B,QAAA,aAAa,GAAG;IACzB,MAAM,EAAE,EAAE;IACV,QAAQ,EAAE,EAAE;IACZ,OAAO,EAAE;QACL,OAAO,EAAE,EACR;KACJ;IACD,QAAQ,EAAE,EAAE;IACZ,KAAK,EAAE,EAAE;CACZ,CAAC;AAEF,MAAM,OAAO,GAAG,IAAI,sBAAe,CAAS,qBAAa,CAAC,CAAC;AAE3D,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;AAC1B,OAAO,CAAC,IAAI,GAAG,UAAS,GAAG,IAAI;IAC3B,oCAAoC;IACpC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAClC,CAAC,CAAA;AAED,kBAAe,OAAO,CAAC;AAEvB,SAAgB,aAAa,CAAC,MAAc;IACxC,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAEvC,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;SACjC,MAAM,CAAC,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;QACvD,IAAI,CAAC,OAAO,IAAI,CAAC,KAAK,EAAE;YACpB,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC;SAC7B;QAED,OAAO,OAAO,CAAC;IACnB,CAAC,EAAE,EAAkB,CAAC,CAAC;AAC/B,CAAC;AAXD,sCAWC;AAED,SAAgB,iBAAiB,CAAC,QAAgB;IAC9C,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAExC,IAAI,CAAC,QAAQ,EAAE;QACX,OAAO;KACV;IAED,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE;QAC3D,OAAO,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,OAAO,WAAW,CAAC;AACvB,CAAC;AAZD,8CAYC"} -------------------------------------------------------------------------------- /dist/src/store/actions/add-project.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.ADD_PROJECT = 'ADD_PROJECT'; 4 | function AddProjectAction(projectPath, branch, files) { 5 | return { 6 | type: exports.ADD_PROJECT, 7 | payload: { 8 | projectPath, 9 | branch, 10 | files 11 | } 12 | }; 13 | } 14 | exports.AddProjectAction = AddProjectAction; 15 | //# sourceMappingURL=add-project.js.map -------------------------------------------------------------------------------- /dist/src/store/actions/add-project.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"add-project.js","sourceRoot":"","sources":["../../../../src/store/actions/add-project.ts"],"names":[],"mappings":";;AAEa,QAAA,WAAW,GAAG,aAAa,CAAC;AACzC,SAAgB,gBAAgB,CAAC,WAAmB,EAAE,MAAc,EAAE,KAAU;IAC5E,OAAO;QACH,IAAI,EAAE,mBAAW;QACjB,OAAO,EAAE;YACL,WAAW;YACX,MAAM;YACN,KAAK;SACR;KACJ,CAAA;AACL,CAAC;AATD,4CASC"} -------------------------------------------------------------------------------- /dist/src/store/actions/add-text-editor.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.ADD_TEXT_EDITOR = 'ADD_TEXT_EDITOR'; 4 | function AddTextEditorAction(filePath) { 5 | return { 6 | type: exports.ADD_TEXT_EDITOR, 7 | payload: { 8 | filePath 9 | } 10 | }; 11 | } 12 | exports.AddTextEditorAction = AddTextEditorAction; 13 | //# sourceMappingURL=add-text-editor.js.map -------------------------------------------------------------------------------- /dist/src/store/actions/add-text-editor.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"add-text-editor.js","sourceRoot":"","sources":["../../../../src/store/actions/add-text-editor.ts"],"names":[],"mappings":";;AAEa,QAAA,eAAe,GAAG,iBAAiB,CAAC;AACjD,SAAgB,mBAAmB,CAAC,QAA4B;IAC5D,OAAO;QACH,IAAI,EAAE,uBAAe;QACrB,OAAO,EAAE;YACL,QAAQ;SACX;KACJ,CAAA;AACL,CAAC;AAPD,kDAOC"} -------------------------------------------------------------------------------- /dist/src/store/actions/create-project.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.CREATE_PROJECT = 'CREATE_PROJECT'; 4 | function CreateProjectAction() { 5 | return { 6 | type: exports.CREATE_PROJECT, 7 | payload: {} 8 | }; 9 | } 10 | exports.CreateProjectAction = CreateProjectAction; 11 | //# sourceMappingURL=create-project.js.map -------------------------------------------------------------------------------- /dist/src/store/actions/create-project.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"create-project.js","sourceRoot":"","sources":["../../../../src/store/actions/create-project.ts"],"names":[],"mappings":";;AAEa,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAC/C,SAAgB,mBAAmB;IAC/B,OAAO;QACH,IAAI,EAAE,sBAAc;QACpB,OAAO,EAAE,EAAE;KACd,CAAA;AACL,CAAC;AALD,kDAKC"} -------------------------------------------------------------------------------- /dist/src/store/actions/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const tslib_1 = require("tslib"); 4 | tslib_1.__exportStar(require("./create-project"), exports); 5 | tslib_1.__exportStar(require("./local-file-change"), exports); 6 | tslib_1.__exportStar(require("./add-project"), exports); 7 | tslib_1.__exportStar(require("./update-user-code-success"), exports); 8 | tslib_1.__exportStar(require("./add-text-editor"), exports); 9 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/src/store/actions/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/store/actions/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC;AACjC,8DAAoC;AACpC,wDAA8B;AAC9B,qEAA2C;AAC3C,4DAAkC"} -------------------------------------------------------------------------------- /dist/src/store/actions/local-file-change.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.LOCAL_FILE_CHANGE = 'LOCAL_FILE_CHANGE'; 4 | function LocalFileChangeAction(filePath, content) { 5 | return { 6 | type: exports.LOCAL_FILE_CHANGE, 7 | payload: { 8 | filePath, 9 | content 10 | } 11 | }; 12 | } 13 | exports.LocalFileChangeAction = LocalFileChangeAction; 14 | //# sourceMappingURL=local-file-change.js.map -------------------------------------------------------------------------------- /dist/src/store/actions/local-file-change.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"local-file-change.js","sourceRoot":"","sources":["../../../../src/store/actions/local-file-change.ts"],"names":[],"mappings":";;AAEa,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AACrD,SAAgB,qBAAqB,CAAC,QAAgB,EAAE,OAAe;IACnE,OAAO;QACH,IAAI,EAAE,yBAAiB;QACvB,OAAO,EAAE;YACL,QAAQ;YACR,OAAO;SACV;KACJ,CAAA;AACL,CAAC;AARD,sDAQC"} -------------------------------------------------------------------------------- /dist/src/store/actions/local-file-modify.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.LOCAL_FILE_MODIFY = 'LOCAL_FILE_MODIFY'; 4 | function LocalFileModifyAction(projectPath, filePath, modified) { 5 | return { 6 | type: exports.LOCAL_FILE_MODIFY, 7 | payload: { 8 | projectPath, 9 | filePath, 10 | modified 11 | } 12 | }; 13 | } 14 | exports.LocalFileModifyAction = LocalFileModifyAction; 15 | //# sourceMappingURL=local-file-modify.js.map -------------------------------------------------------------------------------- /dist/src/store/actions/local-file-modify.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"local-file-modify.js","sourceRoot":"","sources":["../../../../src/store/actions/local-file-modify.ts"],"names":[],"mappings":";;AAEa,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AACrD,SAAgB,qBAAqB,CAAC,WAAmB,EAAE,QAAgB,EAAE,QAAiB;IAC1F,OAAO;QACH,IAAI,EAAE,yBAAiB;QACvB,OAAO,EAAE;YACL,WAAW;YACX,QAAQ;YACR,QAAQ;SACX;KACJ,CAAA;AACL,CAAC;AATD,sDASC"} -------------------------------------------------------------------------------- /dist/src/store/actions/update-user-code-success.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.UPDATE_USER_CODE_SUCCESS = 'UPDATE_USER_CODE_SUCCESS'; 4 | function UpdateUserCodeSuccessAction(projectPath, branch, modules) { 5 | return { 6 | type: exports.UPDATE_USER_CODE_SUCCESS, 7 | payload: { 8 | projectPath, 9 | branch, 10 | modules 11 | } 12 | }; 13 | } 14 | exports.UpdateUserCodeSuccessAction = UpdateUserCodeSuccessAction; 15 | //# sourceMappingURL=update-user-code-success.js.map -------------------------------------------------------------------------------- /dist/src/store/actions/update-user-code-success.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"update-user-code-success.js","sourceRoot":"","sources":["../../../../src/store/actions/update-user-code-success.ts"],"names":[],"mappings":";;AAEa,QAAA,wBAAwB,GAAG,0BAA0B,CAAC;AACnE,SAAgB,2BAA2B,CAAC,WAAmB,EAAE,MAAc,EAAE,OAAY;IACzF,OAAO;QACH,IAAI,EAAE,gCAAwB;QAC9B,OAAO,EAAE;YACL,WAAW;YACX,MAAM;YACN,OAAO;SACV;KACJ,CAAA;AACL,CAAC;AATD,kEASC"} -------------------------------------------------------------------------------- /dist/src/store/effects/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const tslib_1 = require("tslib"); 4 | tslib_1.__exportStar(require("./create-project"), exports); 5 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/src/store/effects/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/store/effects/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC"} -------------------------------------------------------------------------------- /dist/src/store/effects/local-file-change.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const index_1 = require("../index"); 4 | const actions_1 = require("../actions"); 5 | const state_1 = require("../../state"); 6 | const utils_1 = require("../../utils"); 7 | ``; 8 | exports.locaFileChangeEffect = index_1.default 9 | .effect(async (state, { type, payload: { path, content } }) => { 10 | if (type !== actions_1.LOCAL_FILE_CHANGE) { 11 | return; 12 | } 13 | const projectPath = selectProjectPath(path); 14 | if (!projectPath) { 15 | return; 16 | } 17 | const matches = /.*([^\\]+)\.js$/gm.exec(path); 18 | if (!matches) { 19 | return; 20 | } 21 | const [, module] = matches; 22 | const { branch } = await utils_1.getScreepsProjectConfig(projectPath); 23 | const modified = content !== state.modules[branch][module].content; 24 | index_1.default.dispatch(actions_1.LocalFileModifyAction(projectPath, path, modified)); 25 | }); 26 | function selectProjectPath(filePath) { 27 | const { projects } = state_1.default.getValue(); 28 | if (!projects) { 29 | return; 30 | } 31 | const projectPath = Object.keys(projects).find((projectPath) => { 32 | return filePath.includes(projectPath); 33 | }); 34 | return projectPath; 35 | } 36 | //# sourceMappingURL=local-file-change.js.map -------------------------------------------------------------------------------- /dist/src/store/effects/local-file-change.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"local-file-change.js","sourceRoot":"","sources":["../../../../src/store/effects/local-file-change.ts"],"names":[],"mappings":";;AACA,oCAAoD;AACpD,wCAGoB;AACpB,uCAAiD;AACjD,uCAEqB;AAAA,EAAE,CAAA;AAEV,QAAA,oBAAoB,GAAG,eAAK;KACxC,MAAM,CAAC,KAAK,EAAE,KAAa,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAU,EAAiB,EAAE;IACzF,IAAI,IAAI,KAAK,2BAAiB,EAAE;QAC5B,OAAO;KACV;IAED,MAAM,WAAW,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC5C,IAAI,CAAC,WAAW,EAAE;QACd,OAAO;KACV;IAED,MAAM,OAAO,GAAG,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/C,IAAI,CAAC,OAAO,EAAE;QACV,OAAO;KACV;IAED,MAAM,CAAC,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC;IAC3B,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,+BAAuB,CAAC,WAAW,CAAC,CAAC;IAE9D,MAAM,QAAQ,GAAG,OAAO,KAAK,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;IAEnE,eAAK,CAAC,QAAQ,CAAC,+BAAqB,CAAC,WAAW,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;AACvE,CAAC,CAAC,CAAC;AAEH,SAAS,iBAAiB,CAAC,QAAgB;IACvC,MAAM,EAAE,QAAQ,EAAE,GAAG,eAAO,CAAC,QAAQ,EAAE,CAAC;IAExC,IAAI,CAAC,QAAQ,EAAE;QACX,OAAO;KACV;IAED,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE;QAC3D,OAAO,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,OAAO,WAAW,CAAC;AACvB,CAAC"} -------------------------------------------------------------------------------- /dist/src/store/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const rxjs_1 = require("rxjs"); 4 | const operators_1 = require("rxjs/operators"); 5 | const state_1 = require("../state"); 6 | const store = new rxjs_1.Subject(); 7 | function dispatch(action) { 8 | console.log(action.type); 9 | store.next(action); 10 | } 11 | function reducer(func) { 12 | store 13 | .pipe(operators_1.map((action) => { 14 | let state = state_1.default.getValue(); 15 | state = func(state, action); 16 | return [state, action]; 17 | })) 18 | .pipe(operators_1.distinctUntilChanged(([nState], [oState]) => nState === oState)) 19 | .pipe(operators_1.tap(([state]) => state_1.default.next(state))) 20 | .subscribe(); 21 | } 22 | function effect(func) { 23 | return store 24 | .pipe(operators_1.tap((action) => { 25 | let state = state_1.default.getValue(); 26 | state = func(state, action); 27 | })); 28 | } 29 | // @ts-ignore 30 | function pipe(callback) { 31 | return store.pipe(callback); 32 | } 33 | exports.default = { 34 | dispatch, 35 | pipe, 36 | reducer, 37 | effect 38 | }; 39 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/src/store/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/store/index.ts"],"names":[],"mappings":";;AAAA,+BAA2C;AAC3C,8CAAgE;AAEhE,oCAA+B;AAO/B,MAAM,KAAK,GAAG,IAAI,cAAO,EAAU,CAAC;AAEpC,SAAS,QAAQ,CAAC,MAAc;IAC5B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACzB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACvB,CAAC;AAED,SAAS,OAAO,CAAC,IAAc;IAC3B,KAAK;SACA,IAAI,CAAC,eAAG,CAA2B,CAAC,MAAc,EAAE,EAAE;QACnD,IAAI,KAAK,GAAG,eAAO,CAAC,QAAQ,EAAE,CAAC;QAC/B,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAC5B,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;SACF,IAAI,CAAC,gCAAoB,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;SACrE,IAAI,CAAC,eAAG,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,eAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;SAC3C,SAAS,EAAE,CAAC;AACrB,CAAC;AAED,SAAS,MAAM,CAAC,IAAc;IAC1B,OAAO,KAAK;SACP,IAAI,CAAC,eAAG,CAAC,CAAC,MAAc,EAAE,EAAE;QACzB,IAAI,KAAK,GAAG,eAAO,CAAC,QAAQ,EAAE,CAAC;QAC/B,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC,CAAC;AACZ,CAAC;AAED,aAAa;AACb,SAAS,IAAI,CAAC,QAAQ;IAClB,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC;AAED,kBAAe;IACX,QAAQ;IACR,IAAI;IACJ,OAAO;IACP,MAAM;CACT,CAAC"} -------------------------------------------------------------------------------- /dist/src/store/reducers/add-project.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const index_1 = require("../index"); 4 | const actions_1 = require("../actions"); 5 | index_1.default.reducer((state, { type, payload: { projectPath, branch, files } }) => { 6 | if (type !== actions_1.ADD_PROJECT) { 7 | return state; 8 | } 9 | files = files || {}; 10 | const projects = state.projects || {}; 11 | return Object.assign({}, state, { projects: Object.assign({}, projects, { [projectPath]: { 12 | branch, 13 | files 14 | } }) }); 15 | }); 16 | //# sourceMappingURL=add-project.js.map -------------------------------------------------------------------------------- /dist/src/store/reducers/add-project.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"add-project.js","sourceRoot":"","sources":["../../../../src/store/reducers/add-project.ts"],"names":[],"mappings":";;AAAA,oCAAoD;AACpD,wCAAyC;AAGzC,eAAK,CAAC,OAAO,CAAC,CAAC,KAAa,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,EAAU,EAAU,EAAE;IAC/F,IAAI,IAAI,KAAK,qBAAW,EAAE;QACtB,OAAO,KAAK,CAAC;KAChB;IAED,KAAK,GAAG,KAAK,IAAI,EAAE,CAAC;IACpB,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC;IAEtC,yBACO,KAAK,IACR,QAAQ,oBACD,QAAQ,IACX,CAAC,WAAW,CAAC,EAAE;gBACX,MAAM;gBACN,KAAK;aACR,OAEP;AACN,CAAC,CAAC,CAAC"} -------------------------------------------------------------------------------- /dist/src/store/reducers/add-text-editor.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const index_1 = require("../index"); 4 | const actions_1 = require("../actions"); 5 | const state_1 = require("../../state"); 6 | index_1.default.reducer((state, { type, payload: { filePath } }) => { 7 | if (type !== actions_1.ADD_TEXT_EDITOR) { 8 | return state; 9 | } 10 | if (!filePath) { 11 | return state; 12 | } 13 | const projectPath = selectProjectPath(filePath); 14 | if (!projectPath) { 15 | return state; 16 | } 17 | const project = state.projects[projectPath]; 18 | const file = project.files[filePath]; 19 | if (file) { 20 | return state; 21 | } 22 | return Object.assign({}, state, { projects: Object.assign({}, state.projects, { [projectPath]: Object.assign({}, project, { files: Object.assign({}, project.files, { [filePath]: {} }) }) }) }); 23 | }); 24 | function selectProjectPath(filePath) { 25 | const { projects } = state_1.default.getValue(); 26 | if (!projects) { 27 | return; 28 | } 29 | const projectPath = Object.keys(projects).find((projectPath) => { 30 | return filePath.includes(projectPath); 31 | }); 32 | return projectPath; 33 | } 34 | //# sourceMappingURL=add-text-editor.js.map -------------------------------------------------------------------------------- /dist/src/store/reducers/add-text-editor.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"add-text-editor.js","sourceRoot":"","sources":["../../../../src/store/reducers/add-text-editor.ts"],"names":[],"mappings":";;AAAA,oCAAoD;AACpD,wCAEoB;AACpB,uCAAiD;AAEjD,eAAK,CAAC,OAAO,CAAC,CAAC,KAAa,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAU,EAAU,EAAE;IAC7E,IAAI,IAAI,KAAK,yBAAe,EAAE;QAC1B,OAAO,KAAK,CAAC;KAChB;IAED,IAAI,CAAC,QAAQ,EAAE;QACX,OAAO,KAAK,CAAC;KAChB;IAED,MAAM,WAAW,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAChD,IAAI,CAAC,WAAW,EAAE;QACd,OAAO,KAAK,CAAC;KAChB;IAED,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC5C,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAErC,IAAI,IAAI,EAAE;QACN,OAAO,KAAK,CAAC;KAChB;IAED,yBACO,KAAK,IACR,QAAQ,oBACD,KAAK,CAAC,QAAQ,IACjB,CAAC,WAAW,CAAC,oBACN,OAAO,IACV,KAAK,oBACE,OAAO,CAAC,KAAK,IAChB,CAAC,QAAQ,CAAC,EAAE,EACX,aAIf;AACN,CAAC,CAAC,CAAC;AAEH,SAAS,iBAAiB,CAAC,QAAgB;IACvC,MAAM,EAAE,QAAQ,EAAE,GAAG,eAAO,CAAC,QAAQ,EAAE,CAAC;IAExC,IAAI,CAAC,QAAQ,EAAE;QACX,OAAO;KACV;IAED,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE;QAC3D,OAAO,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,OAAO,WAAW,CAAC;AACvB,CAAC"} -------------------------------------------------------------------------------- /dist/src/store/reducers/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | require("./add-project"); 4 | require("./update-user-code-success"); 5 | require("./local-file-change"); 6 | require("./add-text-editor"); 7 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/src/store/reducers/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/store/reducers/index.ts"],"names":[],"mappings":";;AAAA,yBAAuB;AACvB,sCAAoC;AACpC,+BAA6B;AAC7B,6BAA2B"} -------------------------------------------------------------------------------- /dist/src/store/reducers/local-file-change.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const index_1 = require("../index"); 4 | const actions_1 = require("../actions"); 5 | const state_1 = require("../../state"); 6 | const utils_1 = require("../../utils"); 7 | index_1.default.reducer((state, { type, payload: { filePath, content } }) => { 8 | if (type !== actions_1.LOCAL_FILE_CHANGE) { 9 | return state; 10 | } 11 | const projectPath = selectProjectPath(filePath); 12 | if (!projectPath) { 13 | return state; 14 | } 15 | const project = state.projects[projectPath]; 16 | const file = project.files[filePath] || {}; 17 | const hash = utils_1.hashCode(content); 18 | const modified = file.hash !== hash; 19 | return Object.assign({}, state, { projects: Object.assign({}, state.projects, { [projectPath]: Object.assign({}, project, { files: Object.assign({}, project.files, { [filePath]: Object.assign({}, file, { modified }) }) }) }) }); 20 | }); 21 | function selectProjectPath(filePath) { 22 | const { projects } = state_1.default.getValue(); 23 | if (!projects) { 24 | return; 25 | } 26 | const projectPath = Object.keys(projects).find((projectPath) => { 27 | return filePath.includes(projectPath); 28 | }); 29 | return projectPath; 30 | } 31 | //# sourceMappingURL=local-file-change.js.map -------------------------------------------------------------------------------- /dist/src/store/reducers/local-file-change.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"local-file-change.js","sourceRoot":"","sources":["../../../../src/store/reducers/local-file-change.ts"],"names":[],"mappings":";;AAAA,oCAAoD;AACpD,wCAEoB;AACpB,uCAAiD;AACjD,uCAEqB;AAErB,eAAK,CAAC,OAAO,CAAC,CAAC,KAAa,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAC3C,QAAQ,EACR,OAAO,EACV,EAAU,EAAU,EAAE;IACnB,IAAI,IAAI,KAAK,2BAAiB,EAAE;QAC5B,OAAO,KAAK,CAAC;KAChB;IAED,MAAM,WAAW,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAChD,IAAI,CAAC,WAAW,EAAE;QACd,OAAO,KAAK,CAAC;KAChB;IAED,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC5C,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;IAE3C,MAAM,IAAI,GAAG,gBAAQ,CAAC,OAAO,CAAC,CAAC;IAC/B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC;IAEpC,yBACO,KAAK,IACR,QAAQ,oBACD,KAAK,CAAC,QAAQ,IACjB,CAAC,WAAW,CAAC,oBACN,OAAO,IACV,KAAK,oBACE,OAAO,CAAC,KAAK,IAChB,CAAC,QAAQ,CAAC,oBACH,IAAI,IACP,QAAQ,gBAK1B;AACN,CAAC,CAAC,CAAC;AAEH,SAAS,iBAAiB,CAAC,QAAgB;IACvC,MAAM,EAAE,QAAQ,EAAE,GAAG,eAAO,CAAC,QAAQ,EAAE,CAAC;IAExC,IAAI,CAAC,QAAQ,EAAE;QACX,OAAO;KACV;IAED,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE;QAC3D,OAAO,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,OAAO,WAAW,CAAC;AACvB,CAAC"} -------------------------------------------------------------------------------- /dist/src/store/reducers/local-file-modify.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const index_1 = require("../index"); 4 | const actions_1 = require("../actions"); 5 | index_1.default.reducer((state, { type, payload: { projectPath, filePath, modified } }) => { 6 | if (type !== actions_1.LOCAL_FILE_MODIFY) { 7 | return state; 8 | } 9 | const branch = state.projects[projectPath].branch; 10 | const files = state.files || {}; 11 | return Object.assign({}, state, { files: Object.assign({}, files, { [branch]: Object.assign({}, files[branch], { [filePath]: modified }) }) }); 12 | }); 13 | //# sourceMappingURL=local-file-modify.js.map -------------------------------------------------------------------------------- /dist/src/store/reducers/local-file-modify.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"local-file-modify.js","sourceRoot":"","sources":["../../../../src/store/reducers/local-file-modify.ts"],"names":[],"mappings":";;AAAA,oCAAoD;AACpD,wCAA+C;AAG/C,eAAK,CAAC,OAAO,CAAC,CAAC,KAAa,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAC3C,WAAW,EACX,QAAQ,EACR,QAAQ,EACX,EAAU,EAAU,EAAE;IACnB,IAAI,IAAI,KAAK,2BAAiB,EAAE;QAC5B,OAAO,KAAK,CAAC;KAChB;IAED,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC;IAElD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;IAEhC,yBACO,KAAK,IACR,KAAK,oBACE,KAAK,IACR,CAAC,MAAM,CAAC,oBACD,KAAK,CAAC,MAAM,CAAC,IAChB,CAAC,QAAQ,CAAC,EAAE,QAAQ,UAG9B;AACN,CAAC,CAAC,CAAC"} -------------------------------------------------------------------------------- /dist/src/store/reducers/update-user-code-success.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const path = require('path'); 4 | const index_1 = require("../index"); 5 | const actions_1 = require("../actions"); 6 | const utils_1 = require("../../utils"); 7 | index_1.default.reducer((state, { type, payload: { projectPath, modules } }) => { 8 | if (type !== actions_1.UPDATE_USER_CODE_SUCCESS) { 9 | return state; 10 | } 11 | const project = state.projects[projectPath]; 12 | const files = {}; 13 | for (const moduleName in modules) { 14 | const content = modules[moduleName]; 15 | const modulePath = path.resolve(projectPath, moduleName); 16 | const hash = utils_1.hashCode(content || ''); 17 | files[`${modulePath}.js`] = { hash }; 18 | } 19 | return Object.assign({}, state, { projects: Object.assign({}, state.projects, { [projectPath]: Object.assign({}, project, { files }) }) }); 20 | }); 21 | //# sourceMappingURL=update-user-code-success.js.map -------------------------------------------------------------------------------- /dist/src/store/reducers/update-user-code-success.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"update-user-code-success.js","sourceRoot":"","sources":["../../../../src/store/reducers/update-user-code-success.ts"],"names":[],"mappings":";;AAAA,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAE7B,oCAAoD;AACpD,wCAAsD;AAEtD,uCAEqB;AAErB,eAAK,CAAC,OAAO,CAAC,CAAC,KAAa,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,EAAU,EAAU,EAAE;IACzF,IAAI,IAAI,KAAK,kCAAwB,EAAE;QACnC,OAAO,KAAK,CAAC;KAChB;IAED,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC5C,MAAM,KAAK,GAAwC,EAAE,CAAC;IAEtD,KAAK,MAAM,UAAU,IAAI,OAAO,EAAE;QAC9B,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;QACpC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QAEzD,MAAM,IAAI,GAAG,gBAAQ,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;QAErC,KAAK,CAAC,GAAI,UAAW,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC;KAC1C;IAED,yBACO,KAAK,IACR,QAAQ,oBACD,KAAK,CAAC,QAAQ,IACjB,CAAC,WAAW,CAAC,oBACN,OAAO,IACV,KAAK,UAGf;AACN,CAAC,CAAC,CAAC"} -------------------------------------------------------------------------------- /dist/ui/components/confirm/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const React = require("react"); 4 | exports.MODAL_CLOSE = 'MODAL_CLOSE'; 5 | function default_1({ legend, submitBtn, onCancel: cancel, onSubmit: submit }) { 6 | legend = legend || 'Are you sure? Do you want execute it?'; 7 | submitBtn = submitBtn || 'Ok'; 8 | return (React.createElement("div", { className: 'screeps-ide screeps-modal screeps-auth-modal' }, 9 | React.createElement("header", null, 10 | React.createElement("div", { className: 'logotype' }), 11 | React.createElement("button", { className: 'btn _cross', onClick: onCancel })), 12 | React.createElement("form", { className: '--indented' }, 13 | React.createElement("legend", null, legend)), 14 | React.createElement("footer", null, 15 | React.createElement("button", { className: 'btn btn--big btn--transparent', onClick: onCancel }, "Cancel"), 16 | React.createElement("button", { className: 'btn btn--big btn--primary', type: 'submit', onClick: onSubmit }, submitBtn)))); 17 | // Public component output actions. 18 | function onCancel() { 19 | cancel && cancel(); 20 | } 21 | function onSubmit() { 22 | submit && submit(); 23 | } 24 | } 25 | exports.default = default_1; 26 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/ui/components/confirm/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../ui/components/confirm/index.tsx"],"names":[],"mappings":";;AAAA,+BAA+B;AAElB,QAAA,WAAW,GAAG,aAAa,CAAC;AAUzC,mBAAwB,EACpB,MAAM,EACN,SAAS,EAET,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EACC;IACjB,MAAM,GAAG,MAAM,IAAI,uCAAuC,CAAC;IAC3D,SAAS,GAAG,SAAS,IAAI,IAAI,CAAC;IAE9B,OAAO,CACH,6BAAK,SAAS,EAAC,8CAA8C;QACzD;YACI,6BAAK,SAAS,EAAC,UAAU,GAAG;YAC5B,gCAAQ,SAAS,EAAC,YAAY,EAAC,OAAO,EAAG,QAAQ,GAAI,CAChD;QACT,8BAAM,SAAS,EAAC,YAAY;YACxB,oCAAU,MAAM,CAAW,CACxB;QACP;YACI,gCACI,SAAS,EAAC,+BAA+B,EACzC,OAAO,EAAG,QAAQ,aACN;YAChB,gCACI,SAAS,EAAC,2BAA2B,EAAC,IAAI,EAAC,QAAQ,EACnD,OAAO,EAAG,QAAQ,IACnB,SAAS,CAAW,CAClB,CACP,CACT,CAAC;IAEF,mCAAmC;IACnC,SAAS,QAAQ;QACb,MAAM,IAAI,MAAM,EAAE,CAAC;IACvB,CAAC;IAED,SAAS,QAAQ;QACb,MAAM,IAAI,MAAM,EAAE,CAAC;IACvB,CAAC;AACL,CAAC;AAxCD,4BAwCC"} -------------------------------------------------------------------------------- /dist/ui/components/console-view/components/controls.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const React = require("react"); 4 | const react_1 = require("react"); 5 | function default_1({ shard, shards, paused: _paused, onShard: applyShard, onResume: resume, onPause: pause, onClean: clean, }) { 6 | const [paused, setPaused] = react_1.useState(_paused); 7 | let toggle; 8 | if (paused) { 9 | toggle = (React.createElement("button", { id: 'screeps-console__play', className: 'btn icon', onClick: onResume }, 10 | React.createElement("i", { className: 'sc-icon-play' }))); 11 | } 12 | else { 13 | toggle = (React.createElement("button", { id: 'screeps-console__pause', className: 'btn icon', onClick: onPause }, 14 | React.createElement("i", { className: 'sc-icon-pause' }))); 15 | } 16 | return (React.createElement("div", { className: 'screeps-console__controls' }, 17 | React.createElement("div", { className: '' }, 18 | React.createElement("select", { className: 'input-select', onChange: onShard, value: shard }, shards.map(({ name }) => { 19 | return (React.createElement("option", { key: name, value: name }, name)); 20 | }))), 21 | React.createElement("div", { className: 'btn-group' }, 22 | React.createElement("button", { id: 'screeps-console__delete', className: 'btn icon', onClick: onClean }, 23 | React.createElement("i", { className: 'sc-icon-delete' })), 24 | toggle))); 25 | function onShard(event) { 26 | applyShard && applyShard(event.target.value); 27 | } 28 | function onPause() { 29 | setPaused(true); 30 | pause && pause(); 31 | } 32 | function onResume() { 33 | setPaused(false); 34 | resume && resume(); 35 | } 36 | function onClean() { 37 | clean && clean(); 38 | } 39 | } 40 | exports.default = default_1; 41 | //# sourceMappingURL=controls.js.map -------------------------------------------------------------------------------- /dist/ui/components/console-view/components/controls.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"controls.js","sourceRoot":"","sources":["../../../../../ui/components/console-view/components/controls.tsx"],"names":[],"mappings":";;AAAA,+BAA+B;AAC/B,iCAAiC;AAajC,mBAAwB,EACpB,KAAK,EACL,MAAM,EACN,MAAM,EAAE,OAAO,EAEf,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,KAAK,EACd,OAAO,EAAE,KAAK,GACU;IACxB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,gBAAQ,CAAC,OAAO,CAAC,CAAC;IAC9C,IAAI,MAAM,CAAC;IAEX,IAAI,MAAM,EAAE;QACR,MAAM,GAAG,CAAC,gCAAQ,EAAE,EAAC,uBAAuB,EACxC,SAAS,EAAC,UAAU,EAAC,OAAO,EAAG,QAAQ;YAAG,2BAAG,SAAS,EAAC,cAAc,GAAG,CACnE,CAAC,CAAC;KACd;SAAM;QACH,MAAM,GAAG,CAAC,gCAAQ,EAAE,EAAC,wBAAwB,EACzC,SAAS,EAAC,UAAU,EAAC,OAAO,EAAG,OAAO;YAAG,2BAAG,SAAS,EAAC,eAAe,GAAG,CACnE,CAAC,CAAC;KACd;IAED,OAAO,CACH,6BAAK,SAAS,EAAC,2BAA2B;QACtC,6BAAK,SAAS,EAAC,EAAE;YACb,gCAAQ,SAAS,EAAC,cAAc,EAAC,QAAQ,EAAG,OAAO,EAAG,KAAK,EAAG,KAAK,IAC7D,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAoB,EAAE,EAAE;gBACxC,OAAO,CAAC,gCAAQ,GAAG,EAAG,IAAI,EAAG,KAAK,EAAG,IAAI,IAAK,IAAI,CAAW,CAAC,CAAC;YACnE,CAAC,CAAC,CACG,CACP;QACN,6BAAK,SAAS,EAAC,WAAW;YACtB,gCAAQ,EAAE,EAAC,yBAAyB,EAChC,SAAS,EAAC,UAAU,EAAC,OAAO,EAAG,OAAO;gBAAG,2BAAG,SAAS,EAAC,gBAAgB,GAAG,CACpE;YACP,MAAM,CACN,CACJ,CACT,CAAC;IAEF,SAAS,OAAO,CAAC,KAAU;QACvB,UAAU,IAAI,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACjD,CAAC;IAED,SAAS,OAAO;QACZ,SAAS,CAAC,IAAI,CAAC,CAAC;QAEhB,KAAK,IAAI,KAAK,EAAE,CAAC;IACrB,CAAC;IAED,SAAS,QAAQ;QACb,SAAS,CAAC,KAAK,CAAC,CAAC;QAEjB,MAAM,IAAI,MAAM,EAAE,CAAC;IACvB,CAAC;IAED,SAAS,OAAO;QACZ,KAAK,IAAI,KAAK,EAAE,CAAC;IACrB,CAAC;AACL,CAAC;AA5DD,4BA4DC"} -------------------------------------------------------------------------------- /dist/ui/components/console-view/components/message-item.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const React = require("react"); 4 | function unescapeHTML(escapedHTML) { 5 | return escapedHTML.replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&'); 6 | } 7 | function default_1(props) { 8 | let timestamp, shard, message, error; 9 | if (props.message.timeStamp) { 10 | timestamp = (React.createElement("span", { className: '--timestamp' }, 11 | "[", 12 | new Date(props.message.timeStamp).toLocaleTimeString(), 13 | "]")); 14 | } 15 | if (props.message.shard) { 16 | shard = (React.createElement("span", { className: '--shard' }, 17 | "[", 18 | props.message.shard, 19 | "]")); 20 | } 21 | if (props.message.log) { 22 | message = (React.createElement("span", { className: '--log', dangerouslySetInnerHTML: { __html: unescapeHTML(props.message.log) } })); 23 | } 24 | if (props.message.expression) { 25 | message = (React.createElement("span", { className: '--input' }, unescapeHTML(props.message.expression))); 26 | } 27 | if (props.message.result) { 28 | message = (React.createElement("span", { className: '--output' }, unescapeHTML(props.message.result))); 29 | } 30 | if (props.message.error) { 31 | error = (React.createElement("span", { className: '--error' }, unescapeHTML(props.message.error))); 32 | } 33 | return (React.createElement("div", { className: 'screeps-console__message native-key-bindings', tabIndex: -1 }, 34 | timestamp, 35 | shard, 36 | message, 37 | error)); 38 | } 39 | exports.default = default_1; 40 | //# sourceMappingURL=message-item.js.map -------------------------------------------------------------------------------- /dist/ui/components/console-view/components/message-item.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"message-item.js","sourceRoot":"","sources":["../../../../../ui/components/console-view/components/message-item.tsx"],"names":[],"mappings":";;AAAA,+BAA+B;AAM/B,SAAS,YAAY,CAAC,WAAmB;IACrC,OAAO,WAAW,CAAC,OAAO,CAAC,OAAO,EAAC,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,EAAC,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAC,GAAG,CAAC,CAAC;AACvF,CAAC;AAED,mBAAwB,KAAmC;IACvD,IAAI,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC;IAErC,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE;QACzB,SAAS,GAAG,CACR,8BAAM,SAAS,EAAC,aAAa;;YACtB,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAE,kBAAkB,EAAE;gBACvD,CACV,CAAC;KACL;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE;QACrB,KAAK,GAAG,CACJ,8BAAM,SAAS,EAAC,SAAS;;YAClB,KAAK,CAAC,OAAO,CAAC,KAAK;gBACnB,CACV,CAAC;KACL;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACnB,OAAO,GAAG,CACN,8BAAM,SAAS,EAAC,OAAO,EAAC,uBAAuB,EAAG,EAAE,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,GAAU,CAC1G,CAAC;KACL;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE;QAC1B,OAAO,GAAG,CACN,8BAAM,SAAS,EAAC,SAAS,IAAG,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAS,CAC9E,CAAC;KACL;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE;QACtB,OAAO,GAAG,CACN,8BAAM,SAAS,EAAC,UAAU,IAAG,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAS,CAC3E,CAAC;KACL;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE;QACrB,KAAK,GAAE,CACH,8BAAM,SAAS,EAAC,SAAS,IAAG,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAS,CACzE,CAAC;KACL;IAED,OAAO,CACH,6BAAK,SAAS,EAAC,8CAA8C,EAAC,QAAQ,EAAG,CAAC,CAAC;QACrE,SAAS;QACT,KAAK;QACL,OAAO;QACP,KAAK,CACL,CACT,CAAC;AACN,CAAC;AAnDD,4BAmDC"} -------------------------------------------------------------------------------- /dist/ui/components/console-view/components/messages-list.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const React = require("react"); 4 | const react_1 = require("react"); 5 | const message_item_1 = require("./message-item"); 6 | let scrollToBottom = true; 7 | function default_1({ messages }) { 8 | const messagesRef = react_1.useRef(null); 9 | const messagesBottomRef = react_1.useRef(null); 10 | react_1.useEffect(() => { 11 | if (!messagesBottomRef.current || !scrollToBottom) { 12 | return; 13 | } 14 | // @ts-ignore 15 | messagesBottomRef.current.scrollIntoView({ behavior: 'smooth' }); 16 | }, [messages]); 17 | return (React.createElement("div", { className: 'screeps-console__messages', ref: messagesRef, onScroll: onScroll }, 18 | messages.map((message, index) => { 19 | return (React.createElement(message_item_1.default, { key: index, message: message })); 20 | }), 21 | React.createElement("div", { ref: messagesBottomRef }))); 22 | function onScroll() { 23 | if (!messagesRef.current) { 24 | return; 25 | } 26 | const { offsetHeight, scrollHeight, scrollTop } = messagesRef.current; 27 | scrollToBottom = (scrollTop + offsetHeight) >= scrollHeight; 28 | } 29 | } 30 | exports.default = default_1; 31 | //# sourceMappingURL=messages-list.js.map -------------------------------------------------------------------------------- /dist/ui/components/console-view/components/messages-list.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"messages-list.js","sourceRoot":"","sources":["../../../../../ui/components/console-view/components/messages-list.tsx"],"names":[],"mappings":";;AAAA,+BAA+B;AAC/B,iCAA0C;AAE1C,iDAAmE;AAMnE,IAAI,cAAc,GAAG,IAAI,CAAC;AAC1B,mBAAwB,EAAE,QAAQ,EAAiC;IAC/D,MAAM,WAAW,GAAG,cAAM,CAAiB,IAAI,CAAC,CAAC;IACjD,MAAM,iBAAiB,GAAG,cAAM,CAAiB,IAAI,CAAC,CAAC;IAEvD,iBAAS,CAAC,GAAG,EAAE;QACX,IAAI,CAAC,iBAAiB,CAAC,OAAO,IAAI,CAAC,cAAc,EAAE;YAC/C,OAAO;SACV;QAED,aAAa;QACb,iBAAiB,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;IACrE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO,CACH,6BAAK,SAAS,EAAC,2BAA2B,EAAC,GAAG,EAAG,WAAW,EACxD,QAAQ,EAAG,QAAQ;QAElB,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;YAC7B,OAAO,CAAC,oBAAC,sBAAsB,IAAC,GAAG,EAAG,KAAK,EAAG,OAAO,EAAG,OAAO,GAAK,CAAC,CAAA;QACzE,CAAC,CAAC;QACF,6BAAK,GAAG,EAAG,iBAAiB,GAAK,CAC/B,CACT,CAAC;IAEF,SAAS,QAAQ;QACb,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE;YACtB,OAAO;SACV;QAED,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC;QAEtE,cAAc,GAAG,CAAC,SAAS,GAAG,YAAY,CAAC,IAAI,YAAY,CAAC;IAChE,CAAC;AACL,CAAC;AAjCD,4BAiCC"} -------------------------------------------------------------------------------- /dist/ui/components/console-view/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /// 3 | Object.defineProperty(exports, "__esModule", { value: true }); 4 | const React = require("react"); 5 | const controls_1 = require("./components/controls"); 6 | const messages_list_1 = require("./components/messages-list"); 7 | const console_input_1 = require("./components/console-input"); 8 | function default_1(props) { 9 | return (React.createElement("div", { className: 'screeps-ide screeps-console screeps-console__view' }, 10 | React.createElement(controls_1.default, { shard: props.shard || '', shards: props.shards || [], paused: props.paused || false, onShard: props.onShard, onResume: props.onResume, onPause: props.onPause, onClean: props.onClean }), 11 | React.createElement("hr", { className: 'screeps-hr' }), 12 | React.createElement(messages_list_1.default, { messages: props.messages || [] }), 13 | React.createElement("hr", { className: 'screeps-hr' }), 14 | React.createElement(console_input_1.default, { onInput: props.onInput }))); 15 | } 16 | exports.default = default_1; 17 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/ui/components/console-view/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../ui/components/console-view/index.tsx"],"names":[],"mappings":";AAAA,qCAAqC;;AAErC,+BAA+B;AAE/B,oDAAuE;AACvE,8DAAgF;AAChF,8DAAyE;AAEzE,mBAAwB,KAAwB;IAC5C,OAAO,CACH,6BAAK,SAAS,EAAC,mDAAmD;QAC9D,oBAAC,kBAAmB,IAChB,KAAK,EAAG,KAAK,CAAC,KAAK,IAAI,EAAE,EACzB,MAAM,EAAG,KAAK,CAAC,MAAM,IAAI,EAAE,EAC3B,MAAM,EAAG,KAAK,CAAC,MAAM,IAAI,KAAK,EAE9B,OAAO,EAAG,KAAK,CAAC,OAAO,EACvB,QAAQ,EAAG,KAAK,CAAC,QAAQ,EACzB,OAAO,EAAG,KAAK,CAAC,OAAO,EACvB,OAAO,EAAG,KAAK,CAAC,OAAO,GACzB;QACF,4BAAI,SAAS,EAAC,YAAY,GAAG;QAC7B,oBAAC,uBAAuB,IAAC,QAAQ,EAAG,KAAK,CAAC,QAAQ,IAAI,EAAE,GAAG;QAC3D,4BAAI,SAAS,EAAC,YAAY,GAAG;QAC7B,oBAAC,uBAAgB,IAAC,OAAO,EAAG,KAAK,CAAC,OAAO,GAAI,CAC3C,CACT,CAAC;AACN,CAAC;AAnBD,4BAmBC"} -------------------------------------------------------------------------------- /dist/ui/components/memory-view/components/controls.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const React = require("react"); 4 | exports.MEMORY_MAIN_VIEW = 'MEMORY_MAIN_VIEW'; 5 | exports.MEMORY_SEGMENTS_VIEW = 'MEMORY_SEGMENTS_VIEW'; 6 | function default_1(props) { 7 | return (React.createElement("div", { className: 'screeps-memory__controls' }, 8 | React.createElement("div", { className: '' }, 9 | React.createElement("select", { className: 'native-key-bindings input-select', value: props.shard, onChange: onShard, tabIndex: 1 }, props.shards.map(({ name }) => { 10 | return (React.createElement("option", { key: name, value: name }, name)); 11 | })), 12 | props.children), 13 | React.createElement("div", { className: 'btn-group' }, 14 | React.createElement("button", { id: 'screeps-memory__control-main', className: ['native-key-bindings btn icon', props.view === exports.MEMORY_MAIN_VIEW ? 'selected' : ''].join(' '), onClick: onMainMemory, onKeyPress: onEnter(onMainMemory), tabIndex: 5 }, 15 | React.createElement("i", { className: 'sc-icon-dehaze' })), 16 | React.createElement("button", { id: 'screeps-memory__control-segments', className: ['native-key-bindings btn icon', props.view === exports.MEMORY_SEGMENTS_VIEW ? 'selected' : ''].join(' '), onClick: onSegments, onKeyPress: onEnter(onSegments), tabIndex: 6 }, 17 | React.createElement("i", { className: 'sc-icon-view' }))))); 18 | function onShard(event) { 19 | props.onShard && props.onShard(event.target.value); 20 | } 21 | function onMainMemory() { 22 | props.onToggleView && props.onToggleView(exports.MEMORY_MAIN_VIEW); 23 | } 24 | function onSegments() { 25 | props.onToggleView && props.onToggleView(exports.MEMORY_SEGMENTS_VIEW); 26 | } 27 | function onEnter(handler) { 28 | return function ({ key }) { 29 | key === 'Enter' && handler(); 30 | }; 31 | } 32 | } 33 | exports.default = default_1; 34 | //# sourceMappingURL=controls.js.map -------------------------------------------------------------------------------- /dist/ui/components/memory-view/components/controls.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"controls.js","sourceRoot":"","sources":["../../../../../ui/components/memory-view/components/controls.tsx"],"names":[],"mappings":";;AAAA,+BAA+B;AAgBlB,QAAA,gBAAgB,GAAG,kBAAkB,CAAC;AACtC,QAAA,oBAAoB,GAAG,sBAAsB,CAAC;AAE3D,mBAAwB,KAA+B;IACnD,OAAO,CACH,6BAAK,SAAS,EAAC,0BAA0B;QACrC,6BAAK,SAAS,EAAC,EAAE;YACb,gCAAQ,SAAS,EAAC,kCAAkC,EAChD,KAAK,EAAG,KAAK,CAAC,KAAK,EAEnB,QAAQ,EAAG,OAAO,EAElB,QAAQ,EAAG,CAAC,IAEV,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAoB,EAAE,EAAE;gBAC9C,OAAO,CAAC,gCAAQ,GAAG,EAAG,IAAI,EAAG,KAAK,EAAG,IAAI,IAAK,IAAI,CAAW,CAAC,CAAC;YACnE,CAAC,CAAC,CACG;YACP,KAAK,CAAC,QAAQ,CACd;QACN,6BAAK,SAAS,EAAC,WAAW;YACtB,gCAAQ,EAAE,EAAC,8BAA8B,EACrC,SAAS,EAAG,CAAC,8BAA8B,EAAE,KAAK,CAAC,IAAI,KAAK,wBAAgB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAE,CAAC,IAAI,CAAC,GAAG,CAAC,EAE1G,OAAO,EAAG,YAAY,EACtB,UAAU,EAAG,OAAO,CAAC,YAAY,CAAC,EAElC,QAAQ,EAAG,CAAC;gBACZ,2BAAG,SAAS,EAAC,gBAAgB,GAAG,CAC3B;YACT,gCAAQ,EAAE,EAAC,kCAAkC,EACzC,SAAS,EAAG,CAAC,8BAA8B,EAAE,KAAK,CAAC,IAAI,KAAK,4BAAoB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAE,CAAC,IAAI,CAAC,GAAG,CAAC,EAE9G,OAAO,EAAG,UAAU,EACpB,UAAU,EAAG,OAAO,CAAC,UAAU,CAAC,EAEhC,QAAQ,EAAG,CAAC;gBACZ,2BAAG,SAAS,EAAC,cAAc,GAAG,CACzB,CACP,CACJ,CACT,CAAC;IAEF,SAAS,OAAO,CAAC,KAAU;QACvB,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvD,CAAC;IAED,SAAS,YAAY;QACjB,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,YAAY,CAAC,wBAAgB,CAAC,CAAC;IAC/D,CAAC;IAED,SAAS,UAAU;QACf,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,YAAY,CAAC,4BAAoB,CAAC,CAAC;IACnE,CAAC;IAED,SAAS,OAAO,CAAC,OAAiB;QAC9B,OAAO,UAAS,EAAE,GAAG,EAAuB;YACxC,GAAG,KAAK,OAAO,IAAI,OAAO,EAAE,CAAC;QACjC,CAAC,CAAA;IACL,CAAC;AACL,CAAC;AAzDD,4BAyDC"} -------------------------------------------------------------------------------- /dist/ui/components/memory-view/components/input.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const React = require("react"); 4 | const react_1 = require("react"); 5 | function default_1({ onInput }) { 6 | const [value, setValue] = react_1.useState(''); 7 | return (React.createElement("div", { className: 'screeps-memory__input' }, 8 | React.createElement("form", { onSubmit: onSubmit }, 9 | React.createElement("fieldset", { className: 'screeps-field' }, 10 | React.createElement("input", { className: 'native-key-bindings', type: 'text', placeholder: 'Add new memory watch path here, e.g. "creeps.John"', autoComplete: '', onChange: onChange, value: value }), 11 | React.createElement("div", { className: 'underline' }))))); 12 | function onChange(event) { 13 | const target = event.target; 14 | const value = target.value; 15 | setValue(value); 16 | } 17 | function onSubmit(event) { 18 | onInput && onInput(value); 19 | setValue(''); 20 | event.preventDefault(); 21 | } 22 | } 23 | exports.default = default_1; 24 | //# sourceMappingURL=input.js.map -------------------------------------------------------------------------------- /dist/ui/components/memory-view/components/input.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"input.js","sourceRoot":"","sources":["../../../../../ui/components/memory-view/components/input.tsx"],"names":[],"mappings":";;AAAA,+BAA+B;AAC/B,iCAAiC;AAMjC,mBAAwB,EACpB,OAAO,EACa;IACpB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,gBAAQ,CAAC,EAAE,CAAC,CAAC;IAEvC,OAAO,CACH,6BAAK,SAAS,EAAC,uBAAuB;QAClC,8BAAM,QAAQ,EAAG,QAAQ;YACrB,kCAAU,SAAS,EAAC,eAAe;gBAC/B,+BACI,SAAS,EAAC,qBAAqB,EAE/B,IAAI,EAAC,MAAM,EACX,WAAW,EAAC,oDAAoD,EAEhE,YAAY,EAAC,EAAE,EAEf,QAAQ,EAAG,QAAQ,EAEnB,KAAK,EAAG,KAAK,GAAI;gBACrB,6BAAK,SAAS,EAAC,WAAW,GAAG,CACtB,CACR,CACL,CACT,CAAC;IAEF,SAAS,QAAQ,CAAC,KAAwB;QACtC,MAAM,MAAM,GAAG,KAAK,CAAC,MAA0B,CAAC;QAChD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAE3B,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IAED,SAAS,QAAQ,CAAC,KAAsB;QACpC,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC;QAC1B,QAAQ,CAAC,EAAE,CAAC,CAAC;QAEb,KAAK,CAAC,cAAc,EAAE,CAAC;IAC3B,CAAC;AACL,CAAC;AAvCD,4BAuCC"} -------------------------------------------------------------------------------- /dist/ui/components/memory-view/components/jsoneditor.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const React = require("react"); 4 | const react_1 = require("react"); 5 | //@ts-ignore 6 | const jsoneditor_1 = require("jsoneditor"); 7 | exports.default = react_1.forwardRef(function (props, ref) { 8 | const [editorRef, setEditorRef] = react_1.useState(); 9 | const editorContainerRef = react_1.useRef(null); 10 | react_1.useEffect(() => { 11 | const editorRef = new jsoneditor_1.default(editorContainerRef.current, { 12 | name: props.name || 'Memory' 13 | }, props.value || 'undefined'); 14 | // TODO: Block error: Cannot read property '0' of undefined; 15 | const _onMultiSelect = editorRef._onMultiSelect; 16 | editorRef._onMultiSelect = () => { 17 | try { 18 | _onMultiSelect.bind(editorRef); 19 | } 20 | catch (err) { 21 | // Noop. 22 | } 23 | }; 24 | setEditorRef(editorRef); 25 | }, [editorContainerRef]); 26 | react_1.useImperativeHandle(ref, () => ({ 27 | getValue, 28 | setValue 29 | })); 30 | return (React.createElement("div", { className: 'native-key-bindings', draggable: false, ref: editorContainerRef })); 31 | function getValue() { 32 | return editorRef.get(); 33 | } 34 | function setValue(value) { 35 | editorRef.set(value); 36 | } 37 | }); 38 | //# sourceMappingURL=jsoneditor.js.map -------------------------------------------------------------------------------- /dist/ui/components/memory-view/components/jsoneditor.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"jsoneditor.js","sourceRoot":"","sources":["../../../../../ui/components/memory-view/components/jsoneditor.tsx"],"names":[],"mappings":";;AAAA,+BAA+B;AAC/B,iCAAoF;AAEpF,YAAY;AACZ,2CAAoC;AAOpC,kBAAe,kBAAU,CAAC,UAAS,KAAiC,EAAE,GAAG;IACrE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,gBAAQ,EAAE,CAAC;IAC7C,MAAM,kBAAkB,GAAG,cAAM,CAAC,IAAI,CAAC,CAAC;IAExC,iBAAS,CAAC,GAAG,EAAE;QACX,MAAM,SAAS,GAAG,IAAI,oBAAU,CAAC,kBAAkB,CAAC,OAAO,EAAE;YACzD,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,QAAQ;SAC/B,EAAE,KAAK,CAAC,KAAK,IAAI,WAAW,CAAC,CAAC;QAE/B,4DAA4D;QAC5D,MAAM,cAAc,GAAG,SAAS,CAAC,cAAc,CAAC;QAChD,SAAS,CAAC,cAAc,GAAG,GAAG,EAAE;YAC5B,IAAI;gBACA,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aAClC;YAAC,OAAM,GAAG,EAAE;gBACT,QAAQ;aACX;QACL,CAAC,CAAA;QAED,YAAY,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAEzB,2BAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;QAC5B,QAAQ;QACR,QAAQ;KACX,CAAC,CAAC,CAAC;IAEJ,OAAO,CACH,6BAAK,SAAS,EAAC,qBAAqB,EAAC,SAAS,EAAG,KAAK,EAAG,GAAG,EAAG,kBAAkB,GAAS,CAC7F,CAAC;IAEF,SAAS,QAAQ;QACb,OAAO,SAAS,CAAC,GAAG,EAAE,CAAC;IAC3B,CAAC;IAED,SAAS,QAAQ,CAAC,KAAU;QACxB,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;AACL,CAAC,CAAC,CAAA"} -------------------------------------------------------------------------------- /dist/ui/components/memory-view/components/segment-controls.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const React = require("react"); 4 | exports.BTN_SAVE = 'screeps-memory__segment-controls-save'; 5 | exports.BTN_RELOAD = 'screeps-memory__segment-controls-reload'; 6 | const segments = []; 7 | for (let i = 0; i < 100; i++) { 8 | segments.push(i); 9 | } 10 | function default_1(props) { 11 | return (React.createElement("div", { className: 'screeps-memory__segment-controls' }, 12 | "Segment #:", 13 | React.createElement("select", { className: 'native-key-bindings input-select', value: props.segment, onChange: onSegment, tabIndex: 2 }, segments.map((name) => { 14 | return (React.createElement("option", { key: name, value: name }, name)); 15 | })), 16 | React.createElement("button", { id: `${exports.BTN_RELOAD}`, type: 'button', className: 'native-key-bindings btn', onClick: onRefresh, onKeyPress: onEnter(onRefresh), tabIndex: 3 }, 17 | React.createElement("i", { className: 'sc-icon-cached' })), 18 | React.createElement("button", { id: `${exports.BTN_SAVE}`, type: 'button', className: 'native-key-bindings btn', onClick: onUpdate, onKeyPress: onEnter(onUpdate), tabIndex: 4, disabled: !props.hasChange }, 19 | React.createElement("i", { className: 'sc-icon-done' })))); 20 | function onSegment(event) { 21 | props.onSegment && props.onSegment(event.target.value); 22 | } 23 | function onRefresh() { 24 | props.onSegment && props.onSegment(props.segment); 25 | } 26 | function onUpdate(event) { 27 | props.onUpdate && props.onUpdate(event.target.value); 28 | } 29 | function onEnter(handler) { 30 | return function ({ key }) { 31 | key === 'Enter' && handler(); 32 | }; 33 | } 34 | } 35 | exports.default = default_1; 36 | //# sourceMappingURL=segment-controls.js.map -------------------------------------------------------------------------------- /dist/ui/components/memory-view/components/segment-controls.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"segment-controls.js","sourceRoot":"","sources":["../../../../../ui/components/memory-view/components/segment-controls.tsx"],"names":[],"mappings":";;AAAA,+BAA+B;AAWlB,QAAA,QAAQ,GAAG,uCAAuC,CAAC;AACnD,QAAA,UAAU,GAAG,yCAAyC,CAAC;AAEpE,MAAM,QAAQ,GAAa,EAAE,CAAC;AAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;IAC1B,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;CACpB;AAED,mBAAwB,KAAsC;IAC1D,OAAO,CACH,6BAAK,SAAS,EAAC,kCAAkC;;QAE7C,gCAAQ,SAAS,EAAC,kCAAkC,EAChD,KAAK,EAAG,KAAK,CAAC,OAAO,EAErB,QAAQ,EAAG,SAAS,EAEpB,QAAQ,EAAG,CAAC,IAEV,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACpB,OAAO,CAAC,gCAAQ,GAAG,EAAG,IAAI,EAAG,KAAK,EAAG,IAAI,IAAK,IAAI,CAAW,CAAC,CAAC;QACnE,CAAC,CAAC,CACG;QACT,gCAAQ,EAAE,EAAG,GAAI,kBAAW,EAAE,EAC1B,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,yBAAyB,EAEnC,OAAO,EAAG,SAAS,EACnB,UAAU,EAAG,OAAO,CAAC,SAAS,CAAC,EAE/B,QAAQ,EAAG,CAAC;YAEZ,2BAAG,SAAS,EAAC,gBAAgB,GAAG,CAC3B;QACT,gCAAQ,EAAE,EAAG,GAAI,gBAAS,EAAE,EACxB,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,yBAAyB,EAEnC,OAAO,EAAG,QAAQ,EAClB,UAAU,EAAG,OAAO,CAAC,QAAQ,CAAC,EAE9B,QAAQ,EAAG,CAAC,EAEZ,QAAQ,EAAG,CAAC,KAAK,CAAC,SAAS;YAE3B,2BAAG,SAAS,EAAC,cAAc,GAAG,CACzB,CACP,CACT,CAAC;IAEF,SAAS,SAAS,CAAC,KAAU;QACzB,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC3D,CAAC;IAED,SAAS,SAAS;QACd,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;IAED,SAAS,QAAQ,CAAC,KAAU;QACxB,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACzD,CAAC;IAED,SAAS,OAAO,CAAC,OAAiB;QAC9B,OAAO,UAAS,EAAE,GAAG,EAAuB;YACxC,GAAG,KAAK,OAAO,IAAI,OAAO,EAAE,CAAC;QACjC,CAAC,CAAA;IACL,CAAC;AACL,CAAC;AA3DD,4BA2DC"} -------------------------------------------------------------------------------- /dist/ui/components/memory-view/components/segment.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const React = require("react"); 4 | function default_1(props) { 5 | return (React.createElement("div", { className: 'screeps-memory__segment' }, 6 | React.createElement("textarea", { className: 'native-key-bindings', placeholder: 'NO DATA', value: props.segment, onChange: onChange, tabIndex: 7 }))); 7 | function onChange(event) { 8 | props.onChange && props.onChange(event.target.value); 9 | } 10 | } 11 | exports.default = default_1; 12 | //# sourceMappingURL=segment.js.map -------------------------------------------------------------------------------- /dist/ui/components/memory-view/components/segment.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"segment.js","sourceRoot":"","sources":["../../../../../ui/components/memory-view/components/segment.tsx"],"names":[],"mappings":";;AAAA,+BAA+B;AAQ/B,mBAAwB,KAA8B;IAClD,OAAO,CACH,6BAAK,SAAS,EAAC,yBAAyB;QACpC,kCAAU,SAAS,EAAC,qBAAqB,EAEzC,WAAW,EAAC,SAAS,EACrB,KAAK,EAAG,KAAK,CAAC,OAAO,EAErB,QAAQ,EAAG,QAAQ,EAEnB,QAAQ,EAAG,CAAC,GAAI,CACd,CACT,CAAC;IAEF,SAAS,QAAQ,CAAC,KAAU;QACxB,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACzD,CAAC;AACL,CAAC;AAjBD,4BAiBC"} -------------------------------------------------------------------------------- /dist/ui/components/prompt/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../ui/components/prompt/index.tsx"],"names":[],"mappings":";;AAAA,+BAA+B;AAC/B,iCAAiC;AAEpB,QAAA,WAAW,GAAG,aAAa,CAAC;AAWzC,mBAAwB,EACpB,MAAM,EACN,SAAS,EAET,OAAO,EAAE,KAAK,EACd,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EACA;IAChB,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,gBAAQ,CAAC,EAAE,CAAC,CAAC;IAC3C,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,gBAAQ,CAAC,EAAE,CAAC,CAAC;IAE3C,MAAM,GAAG,MAAM,IAAI,uCAAuC,CAAC;IAC3D,SAAS,GAAG,SAAS,IAAI,IAAI,CAAC;IAE9B,OAAO,CACH,6BAAK,SAAS,EAAC,8CAA8C;QACzD;YACI,6BAAK,SAAS,EAAC,UAAU,GAAG;YAC5B,gCAAQ,SAAS,EAAC,YAAY,EAAC,OAAO,EAAG,QAAQ,GAAI,CAChD;QACT,8BAAM,SAAS,EAAG,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAG,QAAQ,EAAG,QAAQ;YACxF,kCAAU,SAAS,EAAC,eAAe;gBAC/B,oCAAU,MAAM,CAAW;gBAC3B,+BACI,SAAS,EAAC,qBAAqB,EAE/B,IAAI,EAAC,MAAM,EACX,IAAI,EAAC,SAAS,EAEd,QAAQ,EAAG,OAAO,EAElB,QAAQ,EAAG,IAAI,EACf,SAAS,EAAG,IAAI,EAEhB,QAAQ,EAAG,CAAC,GACd;gBACF,6BAAK,SAAS,EAAC,WAAW,GAAG,CACtB;YACX,6BAAK,SAAS,EAAC,SAAS,IAAG,OAAO,CAAQ,CACvC;QACP;YACI,gCACI,SAAS,EAAC,+BAA+B,EACzC,OAAO,EAAG,QAAQ,EAElB,QAAQ,EAAG,CAAC,aACA;YAChB,gCACI,SAAS,EAAC,2BAA2B,EAAC,IAAI,EAAC,QAAQ,EACnD,QAAQ,EAAG,CAAC,OAAO,EAEnB,OAAO,EAAG,QAAQ,EAElB,QAAQ,EAAG,CAAC,IACb,SAAS,CAAW,CAClB,CACP,CACT,CAAC;IAEF,6BAA6B;IAC7B,SAAS,OAAO,CAAC,KAAwB;QACrC,MAAM,MAAM,GAAG,KAAK,CAAC,MAA0B,CAAC;QAEhD,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAEzB,IAAI;YACA,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACnD,UAAU,CAAC,OAAO,CAAC,CAAC;SACvB;QAAC,OAAM,GAAG,EAAE;YACT,UAAU,CAAC,EAAE,CAAC,CAAC;SAClB;IACL,CAAC;IAED,mCAAmC;IACnC,SAAS,QAAQ;QACb,MAAM,IAAI,MAAM,EAAE,CAAC;IACvB,CAAC;IAED,SAAS,QAAQ;QACb,MAAM,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;AACL,CAAC;AAjFD,4BAiFC"} -------------------------------------------------------------------------------- /dist/ui/components/resizable-panel/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const React = require("react"); 4 | const react_1 = require("react"); 5 | const rxjs_1 = require("rxjs"); 6 | const operators_1 = require("rxjs/operators"); 7 | function default_1(props) { 8 | const [height, setHeight] = react_1.useState(props.height); 9 | const [style, setStyle] = react_1.useState({}); 10 | const elementRef = react_1.useRef(null); 11 | react_1.useEffect(() => { 12 | if (height) { 13 | setStyle(Object.assign({}, style, { 'height': `${height}px` })); 14 | } 15 | }, [height]); 16 | return (React.createElement("div", { ref: elementRef, className: 'screeps-ide screeps-resizable-panel', style: style }, 17 | props.children, 18 | React.createElement("div", { className: 'panel-divider', onMouseDown: onResizeStart }))); 19 | function onResizeStart() { 20 | const up$ = rxjs_1.fromEvent(document.body, 'mouseup'); 21 | const move$ = rxjs_1.fromEvent(document.body, 'mousemove'); 22 | move$.pipe(operators_1.takeUntil(up$)) 23 | // @ts-ignore 24 | .pipe(operators_1.tap(({ movementY }) => { 25 | const element = elementRef.current; 26 | if (!element) { 27 | return; 28 | } 29 | const height = element.offsetHeight + movementY; 30 | setHeight(height); 31 | props.onChangeHeight && props.onChangeHeight(height); 32 | })) 33 | .subscribe(); 34 | } 35 | } 36 | exports.default = default_1; 37 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/ui/components/resizable-panel/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../ui/components/resizable-panel/index.tsx"],"names":[],"mappings":";;AAAA,+BAA+B;AAC/B,iCAAoD;AAEpD,+BAAiC;AACjC,8CAAgD;AAWhD,mBAAwB,KAA2B;IAC/C,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,gBAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACnD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,gBAAQ,CAAC,EAAE,CAAC,CAAC;IAEvC,MAAM,UAAU,GAAG,cAAM,CAAiB,IAAI,CAAC,CAAC;IAEhD,iBAAS,CAAC,GAAG,EAAE;QACX,IAAI,MAAM,EAAE;YACR,QAAQ,mBACD,KAAK,IACR,QAAQ,EAAE,GAAI,MAAO,IAAI,IAC3B,CAAC;SACN;IACL,CAAC,EAAE,CAAE,MAAM,CAAE,CAAC,CAAA;IAEd,OAAO,CACH,6BAAK,GAAG,EAAG,UAAU,EAAG,SAAS,EAAC,qCAAqC,EAAC,KAAK,EAAG,KAAK;QAC/E,KAAK,CAAC,QAAQ;QAChB,6BAAK,SAAS,EAAC,eAAe,EAAC,WAAW,EAAG,aAAa,GAAI,CAC5D,CACT,CAAC;IAEF,SAAS,aAAa;QAClB,MAAM,GAAG,GAAG,gBAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAChD,MAAM,KAAK,GAAG,gBAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAEpD,KAAK,CAAC,IAAI,CAAC,qBAAS,CAAC,GAAG,CAAC,CAAC;YACtB,aAAa;aACZ,IAAI,CAAC,eAAG,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;YACxB,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;YAEnC,IAAI,CAAC,OAAO,EAAE;gBACV,OAAO;aACV;YAED,MAAM,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;YAEhD,SAAS,CAAC,MAAM,CAAC,CAAC;YAElB,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QACzD,CAAC,CAAC,CAAC;aACF,SAAS,EAAE,CAAC;IACrB,CAAC;AAEL,CAAC;AA5CD,4BA4CC"} -------------------------------------------------------------------------------- /dist/ui/components/token/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const React = require("react"); 4 | exports.MODAL_CLOSE = 'MODAL_CLOSE'; 5 | function default_1(props) { 6 | return (React.createElement("div", { className: 'screeps-ide screeps-modal screeps-auth-modal' }, 7 | React.createElement("header", null, 8 | React.createElement("div", { className: 'logotype' }), 9 | React.createElement("button", { className: 'btn _cross', onClick: onCancel })), 10 | React.createElement("form", { className: '--indented', onSubmit: onSubmit }, 11 | React.createElement("fieldset", { className: 'screeps-field' }, 12 | React.createElement("legend", null, "This auth token will be saved to your preferences:"), 13 | React.createElement("input", { className: 'native-key-bindings', type: 'text', name: 'email', required: true, readOnly: true, value: props.token.substr(0, 8) + '-****-****-****-************' }), 14 | React.createElement("div", { className: 'underline' }))), 15 | React.createElement("footer", null, 16 | React.createElement("button", { className: 'btn btn--big btn--transparent', onClick: onCancel, type: 'button' }, "Cancel"), 17 | React.createElement("button", { className: 'btn btn--big btn--primary', type: 'submit', onClick: onSubmit }, "Ok")))); 18 | // Public component output actions. 19 | function onCancel() { 20 | props.onCancel && props.onCancel(); 21 | } 22 | function onSubmit() { 23 | props.onSubmit && props.onSubmit(); 24 | } 25 | } 26 | exports.default = default_1; 27 | ; 28 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/ui/components/token/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../ui/components/token/index.tsx"],"names":[],"mappings":";;AAAA,+BAA+B;AAElB,QAAA,WAAW,GAAG,aAAa,CAAC;AASzC,mBAAwB,KAAuB;IAC3C,OAAO,CACH,6BAAK,SAAS,EAAC,8CAA8C;QACzD;YACI,6BAAK,SAAS,EAAC,UAAU,GAAG;YAC5B,gCAAQ,SAAS,EAAC,YAAY,EAAC,OAAO,EAAE,QAAQ,GAAG,CAC9C;QACT,8BAAM,SAAS,EAAC,YAAY,EAAC,QAAQ,EAAG,QAAQ;YAC5C,kCAAU,SAAS,EAAC,eAAe;gBAC/B,yFAAmE;gBACnE,+BACI,SAAS,EAAC,qBAAqB,EAE/B,IAAI,EAAC,MAAM,EACX,IAAI,EAAC,OAAO,EAEZ,QAAQ,EAAG,IAAI,EACf,QAAQ,EAAG,IAAI,EAEf,KAAK,EAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,8BAA8B,GACnE;gBACF,6BAAK,SAAS,EAAC,WAAW,GAAG,CACtB,CACR;QACP;YACI,gCAAQ,SAAS,EAAC,+BAA+B,EAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAC,QAAQ,aAAgB;YAClG,gCAAQ,SAAS,EAAC,2BAA2B,EAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAG,QAAQ,SAAc,CACvF,CACP,CACT,CAAC;IAEF,mCAAmC;IACnC,SAAS,QAAQ;QACb,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;IACvC,CAAC;IAED,SAAS,QAAQ;QACb,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;IACvC,CAAC;AACL,CAAC;AAvCD,4BAuCC;AAAA,CAAC"} -------------------------------------------------------------------------------- /dist/ui/components/welcome-view/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../ui/components/welcome-view/index.tsx"],"names":[],"mappings":";AAAA,qCAAqC;;AAErC,+BAA+B;AAC/B,iCAA4C;AAE5C,mBAAwB,KAAwB;IAE5C,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,gBAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IAExE,iBAAS,CAAC,GAAG,EAAE;QACX,gBAAgB,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IAC1C,CAAC,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;IAE1B,OAAO,CACH,6BAAK,SAAS,EAAC,6BAA6B;QACxC,6BAAK,SAAS,EAAC,0BAA0B;YAErC,6BAAK,SAAS,EAAC,uBAAuB,GAAO;YAG7C,iCAAS,SAAS,EAAC,0BAA0B;gBACzC,oGAAyE;gBAEzE;oBACI;;wBACc,2BAAG,IAAI,EAAC,qBAAqB,EAAC,MAAM,EAAC,QAAQ,cAAY;iDAClE;oBACL;wBACI,gCAAQ,SAAS,EAAC,KAAK,EAAC,OAAO,EAAG,QAAQ,4BAAiC;uIAC1E;oBACL;;wBAC8C,gCAAQ,SAAS,EAAC,KAAK,EAAC,OAAO,EAAG,kBAAkB,2BAAgC;gDAC7H;oBACL,4GAEK,CACJ,CACC;YAEV,iCAAS,SAAS,EAAC,0BAA0B;gBACzC;oBACI,+BAAO,SAAS,EAAC,gBAAgB,EAAC,IAAI,EAAC,UAAU,EAAC,OAAO,EAAG,aAAa,EAAG,QAAQ,EAAG,qBAAqB,GAAK;2DAE7G,CACF,CACR,CACJ,CACT,CAAC;IAEF,SAAS,QAAQ;QACb,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;IACvC,CAAC;IAED,SAAS,kBAAkB;QACvB,KAAK,CAAC,kBAAkB,IAAI,KAAK,CAAC,kBAAkB,EAAE,CAAC;IAC3D,CAAC;IAED,SAAS,qBAAqB;QAC1B,gBAAgB,CAAC,CAAC,aAAa,CAAC,CAAC;QAEjC,KAAK,CAAC,qBAAqB,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC,aAAa,CAAC,CAAC;IAC/E,CAAC;AACL,CAAC;AAzDD,4BAyDC"} -------------------------------------------------------------------------------- /dist/ui/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | var auth_view_1 = require("./components/auth-view"); 4 | exports.AuthView = auth_view_1.default; 5 | exports.MODAL_CLOSE = auth_view_1.MODAL_CLOSE; 6 | var token_1 = require("./components/token"); 7 | exports.TokenModal = token_1.default; 8 | var modules_view_1 = require("./components/modules-view"); 9 | exports.ModulesView = modules_view_1.default; 10 | var console_view_1 = require("./components/console-view"); 11 | exports.ConsoleView = console_view_1.default; 12 | var memory_view_1 = require("./components/memory-view"); 13 | exports.MemoryView = memory_view_1.default; 14 | var resizable_panel_1 = require("./components/resizable-panel"); 15 | exports.ResizablePanel = resizable_panel_1.default; 16 | var welcome_view_1 = require("./components/welcome-view"); 17 | exports.WelcomeView = welcome_view_1.default; 18 | var branches_view_1 = require("./components/branches-view"); 19 | exports.BTN_BRANCHES_CLONE = branches_view_1.BTN_CLONE; 20 | exports.BTN_BRANCHES_DELETE = branches_view_1.BTN_DELETE; 21 | exports.BranchesView = branches_view_1.default; 22 | var item_1 = require("./components/memory-view/components/item"); 23 | exports.PATH_BTN_REMOVE = item_1.BTN_REMOVE; 24 | exports.PATH_BTN_DELETE = item_1.BTN_DELETE; 25 | exports.PATH_BTN_UPDATE = item_1.BTN_UPDATE; 26 | exports.PATH_BTN_RELOAD = item_1.BTN_RELOAD; 27 | exports.PATH_BTN_CANCEL = item_1.BTN_CANCEL; 28 | var controls_1 = require("./components/memory-view/components/controls"); 29 | exports.MEMORY_MAIN_VIEW = controls_1.MEMORY_MAIN_VIEW; 30 | exports.MEMORY_SEGMENTS_VIEW = controls_1.MEMORY_SEGMENTS_VIEW; 31 | var segment_controls_1 = require("./components/memory-view/components/segment-controls"); 32 | exports.BTN_SEGMENTS_SAVE = segment_controls_1.BTN_SAVE; 33 | exports.BTN_SEGMENTS_RELOAD = segment_controls_1.BTN_RELOAD; 34 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/ui/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ui/index.tsx"],"names":[],"mappings":";;AAAA,oDAA0E;AAAjE,+BAAA,OAAO,CAAY;AAAE,kCAAA,WAAW,CAAA;AACzC,4CAA2D;AAAlD,6BAAA,OAAO,CAAc;AAC9B,0DAAkE;AAAzD,qCAAA,OAAO,CAAe;AAC/B,0DAAmE;AAA1D,qCAAA,OAAO,CAAe;AAC/B,wDAAiE;AAAxD,mCAAA,OAAO,CAAc;AAC9B,gEAAyE;AAAhE,2CAAA,OAAO,CAAkB;AAClC,0DAAmE;AAA1D,qCAAA,OAAO,CAAe;AAC/B,4DAIoC;AAHhC,6CAAA,SAAS,CAAsB;AAC/B,8CAAA,UAAU,CAAuB;AACjC,uCAAA,OAAO,CAAgB;AAG3B,iEAMkD;AAL9C,iCAAA,UAAU,CAAmB;AAC7B,iCAAA,UAAU,CAAmB;AAC7B,iCAAA,UAAU,CAAmB;AAC7B,iCAAA,UAAU,CAAmB;AAC7B,iCAAA,UAAU,CAAmB;AAEjC,yEAGsD;AAFlD,sCAAA,gBAAgB,CAAA;AAChB,0CAAA,oBAAoB,CAAA;AAExB,yFAG8D;AAF1D,+CAAA,QAAQ,CAAqB;AAC7B,iDAAA,UAAU,CAAuB"} -------------------------------------------------------------------------------- /keymaps/atom-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "atom-workspace": { 3 | "ctrl-1": "screeps-ide:branches", 4 | "ctrl-2": "screeps-ide:console", 5 | "ctrl-3": "screeps-ide:memory", 6 | "ctrl-alt-enter": "screeps-ide:commit", 7 | "ctrl-alt-f": "screeps-ide:fetch" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /menus/atom-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "context-menu": { 3 | ".tree-view [screeps-dist]": [ 4 | { "type": "separator" }, 5 | 6 | { 7 | "label": "Screeps", 8 | "submenu": [ 9 | { "label": "Fetch", "command": "screeps-ide:fetch" }, 10 | { "label": "Commit", "command": "screeps-ide:commit" }, 11 | { "label": "Change Branch", "command": "screeps-ide:changeProjectBranch" } 12 | ] 13 | }, 14 | 15 | { "type": "separator" } 16 | ] 17 | 18 | }, 19 | 20 | "menu": [ 21 | { 22 | "label": "Packages", 23 | "submenu": [ 24 | { 25 | "label": "Screeps", 26 | "submenu": [ 27 | { "label": "Branches", "command": "screeps-ide:branches" }, 28 | { "label": "Console", "command": "screeps-ide:console" }, 29 | { "label": "Memory", "command": "screeps-ide:memory" }, 30 | 31 | { "type": "separator" }, 32 | 33 | { "label": "Fetch", "command": "screeps-ide:fetch" }, 34 | { "label": "Commit", "command": "screeps-ide:commit" } 35 | ] 36 | } 37 | ] 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /screeps-ide.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/ide/b57b1ce7959679a140496d51f80c3e331525a46f/screeps-ide.gif -------------------------------------------------------------------------------- /spec/atom-package-view-spec.js: -------------------------------------------------------------------------------- 1 | 'use babel'; 2 | 3 | import AtomPackageView from '../lib/atom-package-view'; 4 | 5 | describe('AtomPackageView', () => { 6 | it('has one valid test', () => { 7 | expect('life').toBe('easy'); 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /src/actions/index.ts: -------------------------------------------------------------------------------- 1 | export * from './update-user-code'; 2 | -------------------------------------------------------------------------------- /src/actions/update-user-code.ts: -------------------------------------------------------------------------------- 1 | import __state from '../state'; 2 | 3 | import { 4 | getApi, getUser 5 | } from '../utils'; 6 | 7 | export async function updateUserCode( 8 | branch: string, 9 | modules: IModulesData 10 | ): Promise { 11 | if (!branch) { 12 | throw new Error('Need check branch'); 13 | } 14 | 15 | let api; 16 | try { 17 | api = await getApi(); 18 | await getUser(); 19 | } catch (err) { 20 | throw new Error(err); 21 | } 22 | 23 | try { 24 | await api.updateUserCode({ branch, modules }); 25 | } catch(err) { 26 | throw new Error('Error update user code'); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/commands/change-project-branch.ts: -------------------------------------------------------------------------------- 1 | import { default as store } from '../store'; 2 | 3 | import { 4 | $ 5 | } from '../utils'; 6 | 7 | export async function changeProjectBranch(event: CustomEvent) { 8 | let target: HTMLElement = event.target as HTMLElement; 9 | 10 | const el = $('span:first-child', target); 11 | 12 | if (!el) { 13 | return; 14 | } 15 | 16 | const projectPath = el.getAttribute('data-path'); 17 | 18 | store.dispatch({ 19 | type: 'CREATE_PROJECT', 20 | payload: { 21 | projectPath, 22 | projectPathLabel: 'Project folder path', 23 | projectPathReadonly: true, 24 | download: true, 25 | downloadForce: true, 26 | submitBtn: 'Change' 27 | } 28 | }); 29 | } -------------------------------------------------------------------------------- /src/commands/copy-branch.ts: -------------------------------------------------------------------------------- 1 | import { 2 | getApi, getUser, 3 | } from '../utils'; 4 | 5 | import { default as __state } from '../state'; 6 | 7 | import { default as prompt } from '../components/prompt-modal'; 8 | 9 | export async function copyBranch(branch: string) { 10 | let api; 11 | try { 12 | api = await getApi(); 13 | await getUser(); 14 | } catch (err) { 15 | throw err; 16 | } 17 | 18 | let newName; 19 | try { 20 | newName = await prompt({ 21 | legend: 'This branch will be cloned to the new branch. Please enter a new branch name:' 22 | }); 23 | 24 | await api.cloneUserBranch({ branch, newName }); 25 | 26 | const { list: branches } = await api.getUserBranches(); 27 | 28 | __state.next({ 29 | ...__state.getValue(), 30 | branches 31 | }); 32 | } catch(err) { 33 | throw err; 34 | } 35 | 36 | return newName; 37 | } -------------------------------------------------------------------------------- /src/commands/index.ts: -------------------------------------------------------------------------------- 1 | export * from './start'; 2 | export * from './auth'; 3 | export * from './commit'; 4 | export * from './fetch'; 5 | export * from './copy-branch'; 6 | export * from './change-project-branch'; 7 | -------------------------------------------------------------------------------- /src/commands/start.ts: -------------------------------------------------------------------------------- 1 | export function startCommand() { 2 | console.log(1, atom.project.getPaths()); 3 | } 4 | -------------------------------------------------------------------------------- /src/components/confirm-modal/index.tsx: -------------------------------------------------------------------------------- 1 | import { filter, tap } from 'rxjs/operators'; 2 | 3 | import { AtomModal } from '../../components/atom-modal'; 4 | import { default as ConfirmModal } from '../../../ui/components/confirm'; 5 | 6 | export default function(props: { [key: string]: any }): Promise { 7 | return new Promise((resolve, reject) => { 8 | const confirmModalRef = new AtomModal(ConfirmModal, props); 9 | confirmModalRef.events$ 10 | .pipe(filter(({ type }) => type === 'MODAL_SUBMIT')) 11 | .pipe(tap(() => confirmModalRef.hide())) 12 | .pipe(tap(() => resolve(true))) 13 | .subscribe(); 14 | 15 | confirmModalRef.events$ 16 | .pipe(filter(({ type }) => type === 'MODAL_CANCEL')) 17 | .pipe(tap(() => reject(false))) 18 | .subscribe(); 19 | }); 20 | } 21 | -------------------------------------------------------------------------------- /src/components/modules-block/actions/create.ts: -------------------------------------------------------------------------------- 1 | import { Action } from '../../../store'; 2 | 3 | export const CREATE_MODULE = 'CREATE_MODULE'; 4 | export function CreateModuleAction(branch: string, module: string): Action { 5 | return { 6 | type: CREATE_MODULE, 7 | payload: { 8 | branch, 9 | module 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/components/modules-block/actions/delete.ts: -------------------------------------------------------------------------------- 1 | import { Action } from '../../../store'; 2 | 3 | export const DELETE_MODULE = 'DELETE_MODULE'; 4 | export function DeleteModuleAction(branch: string, module: string): Action { 5 | return { 6 | type: DELETE_MODULE, 7 | payload: { 8 | branch, 9 | module 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/components/modules-block/actions/index.ts: -------------------------------------------------------------------------------- 1 | export * from './create'; 2 | export * from './update'; 3 | export * from './delete'; 4 | export * from './modify'; 5 | export * from './open-text-editor'; 6 | -------------------------------------------------------------------------------- /src/components/modules-block/actions/modify.ts: -------------------------------------------------------------------------------- 1 | import { Action } from '../../../store'; 2 | 3 | export const MODIFY_MODULE = 'MODIFY_MODULE'; 4 | export function ModifyModuleAction(branch: string, module: string, modified: boolean): Action { 5 | return { 6 | type: MODIFY_MODULE, 7 | payload: { 8 | branch, 9 | module, 10 | modified 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/components/modules-block/actions/open-text-editor.ts: -------------------------------------------------------------------------------- 1 | import { Action } from '../../../store'; 2 | 3 | export const OPEN_TEXT_EDITOR = 'OPEN_TEXT_EDITOR'; 4 | export function OpenTextEditorAction(branch: string, module: string, textEditorPending: boolean = true): Action { 5 | return { 6 | type: OPEN_TEXT_EDITOR, 7 | payload: { 8 | module, 9 | branch, 10 | textEditorPending 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/components/modules-block/actions/update.ts: -------------------------------------------------------------------------------- 1 | import { Action } from '../../../store'; 2 | 3 | export const UPDATE_MODULE = 'UPDATE_MODULE'; 4 | export function UpdateModuleAction(branch: string, module: string, content: string): Action { 5 | return { 6 | type: UPDATE_MODULE, 7 | payload: { 8 | branch, 9 | module, 10 | content 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/components/modules-block/effects/delete.ts: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | 3 | import { default as store, Action } from '../../../store'; 4 | import { default as __state } from '../../../state'; 5 | import { 6 | DELETE_MODULE 7 | } from '../actions'; 8 | 9 | import { 10 | getModulePath, 11 | } from '../../../utils'; 12 | 13 | export const deleteEffect = store 14 | .effect((state: IState, { type, payload: { branch, module } }: Action): void => { 15 | state; 16 | 17 | if (type !== DELETE_MODULE) { 18 | return; 19 | } 20 | 21 | const modulePath = getModulePath(branch, module); 22 | 23 | try { 24 | fs.unlink(modulePath, () => {}) 25 | } catch (err) { 26 | // Noop. 27 | } 28 | }); 29 | -------------------------------------------------------------------------------- /src/components/modules-block/effects/index.ts: -------------------------------------------------------------------------------- 1 | export * from './open-text-editor'; 2 | export * from './delete'; 3 | -------------------------------------------------------------------------------- /src/components/modules-block/reducers/create.ts: -------------------------------------------------------------------------------- 1 | import { default as store, Action } from '../../../store'; 2 | import { CREATE_MODULE } from '../actions'; 3 | 4 | function generateContent(module: string) { 5 | return `/* 6 | * Module code goes here. Use 'module.exports' to export things: 7 | * module.exports.thing = 'a thing'; 8 | * 9 | * You can import it from another modules like this: 10 | * var mod = require('${ module }'); 11 | * mod.thing == 'a thing'; // true 12 | */ 13 | 14 | module.exports = { 15 | 16 | }; 17 | ` 18 | } 19 | 20 | store.reducer((state: IState, { type, payload: { branch, module } }: Action): IState => { 21 | if (type !== CREATE_MODULE) { 22 | return state; 23 | } 24 | 25 | const content = generateContent(module); 26 | 27 | return { 28 | ...state, 29 | modules: { 30 | ...state.modules, 31 | [branch]: { 32 | ...state.modules[branch], 33 | [module]: { 34 | content, 35 | isNew: true, 36 | modified: true 37 | } 38 | } 39 | } 40 | }; 41 | }); 42 | -------------------------------------------------------------------------------- /src/components/modules-block/reducers/delete.ts: -------------------------------------------------------------------------------- 1 | import { default as store, Action } from '../../../store'; 2 | import { DELETE_MODULE } from '../actions'; 3 | 4 | store.reducer((state: IState, { type, payload: { branch, module } }: Action): IState => { 5 | if (type !== DELETE_MODULE) { 6 | return state; 7 | } 8 | 9 | delete state.modules[branch][module]; 10 | 11 | return { 12 | ...state, 13 | modules: { 14 | ...state.modules, 15 | [branch]: { 16 | ...state.modules[branch] 17 | } 18 | } 19 | }; 20 | }); 21 | -------------------------------------------------------------------------------- /src/components/modules-block/reducers/index.ts: -------------------------------------------------------------------------------- 1 | import './create'; 2 | import './delete'; 3 | import './update'; 4 | import './modify'; 5 | -------------------------------------------------------------------------------- /src/components/modules-block/reducers/modify.ts: -------------------------------------------------------------------------------- 1 | import { default as store, Action } from '../../../store'; 2 | import { MODIFY_MODULE } from '../actions'; 3 | 4 | store.reducer((state: IState, { type, payload: { branch, module, modified} }: Action): IState => { 5 | if (type !== MODIFY_MODULE) { 6 | return state; 7 | } 8 | 9 | try { 10 | if (state.modules[branch][module].modified === modified) { 11 | return state; 12 | } 13 | } catch(err) { 14 | return state; 15 | } 16 | 17 | return { 18 | ...state, 19 | modules: { 20 | ...state.modules, 21 | [branch]: { 22 | ...state.modules[branch], 23 | [module]: { 24 | ...state.modules[branch][module], 25 | modified 26 | } 27 | } 28 | } 29 | }; 30 | }); 31 | -------------------------------------------------------------------------------- /src/components/modules-block/reducers/update.ts: -------------------------------------------------------------------------------- 1 | import { default as store, Action } from '../../../store'; 2 | import { UPDATE_MODULE } from '../actions'; 3 | 4 | store.reducer((state: IState, { type, payload: { branch, module, content } }: Action): IState => { 5 | if (type !== UPDATE_MODULE) { 6 | return state; 7 | } 8 | 9 | return { 10 | ...state, 11 | modules: { 12 | ...state.modules, 13 | [branch]: { 14 | ...state.modules[branch], 15 | [module]: { 16 | ...state.modules[branch][module], 17 | content 18 | } 19 | } 20 | } 21 | }; 22 | }); 23 | -------------------------------------------------------------------------------- /src/components/prompt-modal/index.tsx: -------------------------------------------------------------------------------- 1 | import { filter, tap } from 'rxjs/operators'; 2 | 3 | import { AtomModal } from '../../components/atom-modal'; 4 | import { default as PromptModal } from '../../../ui/components/prompt'; 5 | 6 | export default function(props: { [key: string]: any }): Promise { 7 | return new Promise((resolve, reject) => { 8 | const promptModalRef = new AtomModal(PromptModal, props); 9 | promptModalRef.events$ 10 | .pipe(filter(({ type }) => type === 'MODAL_SUBMIT')) 11 | .pipe(tap(() => promptModalRef.hide())) 12 | .pipe(tap(({ payload }) => resolve(payload))) 13 | .subscribe(); 14 | 15 | promptModalRef.events$ 16 | .pipe(filter(({ type }) => type === 'MODAL_CANCEL')) 17 | .pipe(tap(() => reject(null))) 18 | .subscribe(); 19 | }); 20 | } 21 | -------------------------------------------------------------------------------- /src/components/screeps-panel/actions/add-project.ts: -------------------------------------------------------------------------------- 1 | import { Action } from '../../../store'; 2 | 3 | export const ADD_PROJECT = 'ADD_PROJECT'; 4 | export function AddProjectAction(): Action { 5 | return { 6 | type: ADD_PROJECT, 7 | payload: { } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/components/screeps-panel/actions/index.ts: -------------------------------------------------------------------------------- 1 | export * from './update-modules'; 2 | export * from './add-project'; 3 | export * from './set-active-module'; 4 | export * from './update-branches'; 5 | -------------------------------------------------------------------------------- /src/components/screeps-panel/actions/set-active-module.ts: -------------------------------------------------------------------------------- 1 | import { Action } from '../../../store'; 2 | 3 | export const SET_ACTIVE_MODULE = 'SET_ACTIVE_MODULE'; 4 | export function SetActiveModule(branch: string | null, module: string | null): Action { 5 | return { 6 | type: SET_ACTIVE_MODULE, 7 | payload: { 8 | branch, 9 | module 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/components/screeps-panel/actions/update-branches.ts: -------------------------------------------------------------------------------- 1 | import { Action } from '../../../store'; 2 | 3 | export const UPDATE_BRANCHES = 'UPDATE_BRANCHES'; 4 | export function UpdateBranchesAction(branches: any[]): Action { 5 | return { 6 | type: UPDATE_BRANCHES, 7 | payload: { 8 | branches 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/components/screeps-panel/actions/update-modules.ts: -------------------------------------------------------------------------------- 1 | import { Action } from '../../../store'; 2 | 3 | export const UPDATE_MODULES = 'UPDATE_MODULES'; 4 | export function UpdateModulesAction(branch: string, modules: IModulesData): Action { 5 | return { 6 | type: UPDATE_MODULES, 7 | payload: { 8 | branch, 9 | modules 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/components/screeps-panel/reducers/add-project.ts: -------------------------------------------------------------------------------- 1 | import { default as store, Action } from '../../../store'; 2 | import { ADD_PROJECT } from '../actions'; 3 | 4 | store.reducer((state: IState, { type }: Action): IState => { 5 | if (type !== ADD_PROJECT) { 6 | return state; 7 | } 8 | 9 | return { 10 | ...state 11 | }; 12 | }); 13 | -------------------------------------------------------------------------------- /src/components/screeps-panel/reducers/index.ts: -------------------------------------------------------------------------------- 1 | import './update-modules'; 2 | import './add-project'; 3 | import './remove-project'; 4 | import './set-active-module'; 5 | import './update-branches'; 6 | -------------------------------------------------------------------------------- /src/components/screeps-panel/reducers/remove-project.ts: -------------------------------------------------------------------------------- 1 | import { default as store, Action } from '../../../store'; 2 | // import { REMOVE_PROJECT } from '../actions'; 3 | 4 | store.reducer((state: IState, { type }: Action): IState => { 5 | if (type !== 'REMOVE_PROJECT') { 6 | return state; 7 | } 8 | 9 | return { 10 | ...state 11 | }; 12 | }); 13 | -------------------------------------------------------------------------------- /src/components/screeps-panel/reducers/set-active-module.ts: -------------------------------------------------------------------------------- 1 | import { default as store, Action } from '../../../store'; 2 | import { SET_ACTIVE_MODULE } from '../actions'; 3 | 4 | store.reducer((state: IState, { type, payload: { branch, module } }: Action): IState => { 5 | if (type !== SET_ACTIVE_MODULE) { 6 | return state; 7 | } 8 | 9 | return { 10 | ...state, 11 | activeBranchTextEditor: branch, 12 | activeModuleTextEditor: module 13 | }; 14 | }); 15 | -------------------------------------------------------------------------------- /src/components/screeps-panel/reducers/update-branches.ts: -------------------------------------------------------------------------------- 1 | import { default as store, Action } from '../../../store'; 2 | import { UPDATE_BRANCHES } from '../actions'; 3 | 4 | store.reducer((state: IState, { type, payload: { branches } }: Action): IState => { 5 | if (type !== UPDATE_BRANCHES) { 6 | return state; 7 | } 8 | 9 | return { 10 | ...state, 11 | branches 12 | }; 13 | }); 14 | -------------------------------------------------------------------------------- /src/components/screeps-panel/reducers/update-modules.ts: -------------------------------------------------------------------------------- 1 | import { default as store, Action } from '../../../store'; 2 | import { UPDATE_MODULES } from '../actions'; 3 | 4 | store.reducer((state: IState, { type, payload: { branch, modules } }: Action): IState => { 5 | if (type !== UPDATE_MODULES) { 6 | return state; 7 | } 8 | 9 | const modules1 = Object.entries(state.modules[branch] || {}) 10 | .filter(([, { isNew }]) => isNew) 11 | .reduce((modules, [module, { isNew, modified }]) => { 12 | modules[module] = { 13 | isNew, 14 | modified 15 | }; 16 | 17 | return modules; 18 | }, {} as any) 19 | 20 | const modules2 = Object.entries(modules) 21 | .filter(([, content]) => !!content) 22 | .reduce((modules, [module, content]) => { 23 | modules[module] = { 24 | content, 25 | modified: false 26 | }; 27 | 28 | return modules; 29 | }, {} as any) 30 | 31 | return { 32 | ...state, 33 | modules: { 34 | ...state.modules, 35 | [branch]: { 36 | ...modules1, 37 | ...modules2 38 | } 39 | } 40 | }; 41 | }); 42 | -------------------------------------------------------------------------------- /src/components/screeps-panel/style.less: -------------------------------------------------------------------------------- 1 | .screeps-panel { 2 | display: flex; 3 | flex-direction: column; 4 | height: 100%; 5 | 6 | & > footer { 7 | display: flex; 8 | flex-direction: column; 9 | box-sizing: border-box; 10 | min-height: 64px; 11 | margin-top: auto; 12 | padding-top: 4px; 13 | padding-bottom: 4px; 14 | 15 | button { 16 | flex: 1; 17 | margin: 0 4px; 18 | min-height: 26px; 19 | } 20 | 21 | div { 22 | display: flex; 23 | margin-top: 4px; 24 | } 25 | } 26 | 27 | &:before { 28 | content: "\e900"; 29 | 30 | position: absolute; 31 | top: 40%; 32 | 33 | width: 100%; 34 | margin: auto; 35 | 36 | opacity: .02; 37 | 38 | font-family: 'screepsicons' !important; 39 | font-size: 200px; 40 | text-align: center; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/components/screeps-status-bar/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import * as ReactDOM from 'react-dom'; 3 | 4 | export class ScreepsStatusBar { 5 | public element: HTMLElement = document.createElement('div'); 6 | 7 | constructor( 8 | ) { 9 | this.element.classList.add( 10 | 'screeps-ide__status-bar', 11 | 'screeps-ide__status-bar--screeps', 12 | 'inline-block' 13 | ); 14 | 15 | this.render(); 16 | } 17 | 18 | render() { 19 | ReactDOM.render( 20 |
21 | 22 | Screeps 23 |
, 24 | this.element 25 | ) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/components/screeps-status-bar/style.less: -------------------------------------------------------------------------------- 1 | .screeps-ide__status-bar--screeps { 2 | display: flex; 3 | align-items: center; 4 | height: 100%; 5 | 6 | & > div { 7 | display: flex; 8 | align-items: center; 9 | 10 | b { 11 | font-size: 2em; 12 | } 13 | } 14 | } 15 | 16 | .screeps-ide__tooltip--screeps { 17 | width: 400px; 18 | } 19 | -------------------------------------------------------------------------------- /src/components/token-modal/index.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/ide/b57b1ce7959679a140496d51f80c3e331525a46f/src/components/token-modal/index.tsx -------------------------------------------------------------------------------- /src/components/welcome-pane/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import * as ReactDOM from 'react-dom'; 3 | 4 | import { authCommand } from '../../commands'; 5 | import { configSetter, configGetter } from '../../config'; 6 | import { WelcomeView } from '../../../ui'; 7 | 8 | import { default as store } from '../../store'; 9 | import { CreateProjectAction } from '../../store/actions'; 10 | 11 | import { SCREEPS_URI } from '../screeps-panel'; 12 | 13 | export const WELCOME_URI = 'atom://screeps-ide/welcome'; 14 | 15 | export class WelcomePane { 16 | public element: HTMLElement; 17 | 18 | constructor() { 19 | this.element = document.createElement('div'); 20 | this.render(); 21 | } 22 | 23 | render() { 24 | ReactDOM.render( 25 | this.onSignin() } 29 | onCreateNewProject={ () => this.onCreateNewProject() } 30 | onChangeShowOnStartup={(...args) => this.onChangeShowOnStartup(...args)} 31 | />, 32 | this.element 33 | ); 34 | } 35 | 36 | async onSignin() { 37 | try { 38 | await authCommand(); 39 | 40 | atom.workspace.open(SCREEPS_URI, { 41 | activatePane: true, 42 | activateItem: true, 43 | // split: 'down', 44 | location: 'bottom' 45 | }); 46 | } catch(err) { 47 | // Noop. 48 | } 49 | } 50 | 51 | async onCreateNewProject() { 52 | store.dispatch(CreateProjectAction()); 53 | } 54 | 55 | onChangeShowOnStartup(value: boolean) { 56 | configSetter('showOnStartup', value); 57 | } 58 | 59 | // Atom pane required interface's methods 60 | getURI() { 61 | return WELCOME_URI; 62 | } 63 | 64 | getTitle() { 65 | return 'Welcome to Screeps'; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/consumed-services/consume-status-bar.ts: -------------------------------------------------------------------------------- 1 | import { CompositeDisposable } from 'atom'; 2 | 3 | import { default as __state } from '../state'; 4 | 5 | import { SCREEPS_URI } from '../components/screeps-panel'; 6 | 7 | import { ScreepsStatusBar } from '../components/screeps-status-bar'; 8 | 9 | const priority = 10000; 10 | 11 | export function consumeStatusBar(statusBar: any) { 12 | const subscriptions = new CompositeDisposable(); 13 | 14 | const consoleStatusBar = new ScreepsStatusBar(); 15 | 16 | statusBar.addLeftTile({ item: consoleStatusBar.element, priority }); 17 | consoleStatusBar.element.addEventListener('click', () => atom.workspace.open(SCREEPS_URI, { 18 | activatePane: true, 19 | activateItem: true, 20 | // split: 'down', 21 | location: 'left' 22 | })); 23 | 24 | statusBar.addLeftTile({ 25 | item: consoleStatusBar.element, 26 | priority 27 | }); 28 | subscriptions.add(atom.tooltips.add(consoleStatusBar.element, { title: 'Show Screeps panel'})); 29 | } 30 | -------------------------------------------------------------------------------- /src/consumed-services/index.ts: -------------------------------------------------------------------------------- 1 | export * from './consume-tree-view'; 2 | export * from './consume-status-bar'; 3 | -------------------------------------------------------------------------------- /src/decoratos/index.ts: -------------------------------------------------------------------------------- 1 | export * from './progress'; 2 | -------------------------------------------------------------------------------- /src/decoratos/progress.ts: -------------------------------------------------------------------------------- 1 | let animationStartTime: number = 0; 2 | const ANIMATION_MIN_TIME = 1500; 3 | 4 | // @ts-ignore 5 | export function progress(target: any, name: any, descriptor: any) { 6 | const original = descriptor.value; 7 | 8 | descriptor.value = async function(...args: any[]) { 9 | showProgress(this); 10 | 11 | let result; 12 | try { 13 | result = await original.apply(this, args); 14 | } catch (err) { 15 | hideProgress(this); 16 | throw err; 17 | } 18 | 19 | hideProgress(this); 20 | return result; 21 | }; 22 | 23 | return descriptor; 24 | } 25 | 26 | 27 | function showProgress(component: any) { 28 | animationStartTime = new Date() .getTime(); 29 | 30 | component.state = { isProgressing: true }; 31 | } 32 | 33 | function hideProgress(component: any) { 34 | const now = new Date() .getTime(); 35 | const delay = ANIMATION_MIN_TIME - (now - animationStartTime); 36 | 37 | setTimeout(() => { 38 | component.state = { isProgressing: false }; 39 | }, delay > 0 ? delay : 0); 40 | } 41 | -------------------------------------------------------------------------------- /src/index.d.ts: -------------------------------------------------------------------------------- 1 | 2 | interface IState { 3 | branch: string; 4 | branches: IBranch[]; 5 | 6 | modules: { 7 | [key: string]: IModules; 8 | }; 9 | 10 | projects: { 11 | // Projet Path 12 | [key: string]: { 13 | branch: string; 14 | files: { 15 | // File Path 16 | [key: string]: { 17 | hash: number; 18 | modified: boolean; 19 | }; 20 | }; 21 | }; 22 | } 23 | 24 | files: { 25 | // Branch Name 26 | [key: string]: { 27 | // File Path : modified 28 | [key: string]: boolean; 29 | }; 30 | }; 31 | 32 | activeBranchTextEditor?: string; 33 | activeModuleTextEditor?: string; 34 | } 35 | -------------------------------------------------------------------------------- /src/service.ts: -------------------------------------------------------------------------------- 1 | import { BehaviorSubject } from 'rxjs'; 2 | // import { } 3 | 4 | import { getApi } from './utils'; 5 | 6 | export class Service { 7 | public state: BehaviorSubject = new BehaviorSubject({ 8 | modules: {}, 9 | branch: '', 10 | branches: [] 11 | }); 12 | public state$ = this.state.asObservable(); 13 | 14 | public shards: BehaviorSubject = new BehaviorSubject([]); 15 | public shards$ = this.shards.asObservable(); 16 | 17 | private _api: any; 18 | 19 | constructor() { 20 | this.getGameShardsInfo(); 21 | } 22 | 23 | getUserBranches() { 24 | this._api.getUserBranches() 25 | .then(({ list }: { list: any }) => { 26 | const data = this.state.getValue(); 27 | this.state.next({ 28 | ...data, 29 | branches: list 30 | }); 31 | }); 32 | } 33 | 34 | getUserCode(branch?: string) { 35 | const data = this.state.getValue(); 36 | this.state.next({ 37 | ...data, 38 | branch, 39 | modules: {} 40 | }); 41 | 42 | this._api.getUserCode(branch) 43 | .then(({ branch, modules }: { branch: any, modules: any }) => { 44 | const data = this.state.getValue(); 45 | this.state.next({ 46 | ...data, 47 | branch, 48 | modules 49 | }); 50 | }); 51 | } 52 | 53 | async getGameShardsInfo() { 54 | const api = await getApi(); 55 | const { shards } = await api.getGameShardsInfo(); 56 | 57 | this.shards.next(shards); 58 | } 59 | } -------------------------------------------------------------------------------- /src/services/user.ts: -------------------------------------------------------------------------------- 1 | export class User { 2 | get id() { 3 | return this._data._id; 4 | } 5 | 6 | get shard() { 7 | const shards = Object.keys(this._data.cpuShard); 8 | return shards[0]; 9 | } 10 | 11 | constructor(private _data: IAuthMeResponse) { 12 | console.log(this._data); 13 | } 14 | } -------------------------------------------------------------------------------- /src/socket/index.d.ts: -------------------------------------------------------------------------------- 1 | interface ISocketSettings { 2 | url: string; 3 | token?: string; 4 | } 5 | -------------------------------------------------------------------------------- /src/state.ts: -------------------------------------------------------------------------------- 1 | import { BehaviorSubject } from 'rxjs'; 2 | 3 | export const INITIAL_STATE = { 4 | branch: '', 5 | branches: [], 6 | modules: { 7 | default: { 8 | } 9 | }, 10 | projects: {}, 11 | files: {} 12 | }; 13 | 14 | const __state = new BehaviorSubject(INITIAL_STATE); 15 | 16 | const next = __state.next; 17 | __state.next = function(...args) { 18 | // console.log(.1, 'next', ...args); 19 | return next.apply(this, args); 20 | } 21 | 22 | export default __state; 23 | 24 | export function selectModules(branch: string): IModulesData { 25 | const { modules } = __state.getValue(); 26 | 27 | return Object.entries(modules[branch]) 28 | .reduce((modules, [module, { content, deleted, isNew }]) => { 29 | if (!deleted && !isNew) { 30 | modules[module] = content; 31 | } 32 | 33 | return modules; 34 | }, {} as IModulesData); 35 | } 36 | 37 | export function selectProjectPath(filePath: string): string | undefined { 38 | const { projects } = __state.getValue(); 39 | 40 | if (!projects) { 41 | return; 42 | } 43 | 44 | const projectPath = Object.keys(projects).find((projectPath) => { 45 | return filePath.includes(projectPath); 46 | }); 47 | 48 | return projectPath; 49 | } 50 | -------------------------------------------------------------------------------- /src/store/actions/add-project.ts: -------------------------------------------------------------------------------- 1 | import { Action } from '../'; 2 | 3 | export const ADD_PROJECT = 'ADD_PROJECT'; 4 | export function AddProjectAction(projectPath: string, branch: string, files: any): Action { 5 | return { 6 | type: ADD_PROJECT, 7 | payload: { 8 | projectPath, 9 | branch, 10 | files 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/store/actions/add-text-editor.ts: -------------------------------------------------------------------------------- 1 | import { Action } from '../'; 2 | 3 | export const ADD_TEXT_EDITOR = 'ADD_TEXT_EDITOR'; 4 | export function AddTextEditorAction(filePath: string | undefined): Action { 5 | return { 6 | type: ADD_TEXT_EDITOR, 7 | payload: { 8 | filePath 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/store/actions/create-project.ts: -------------------------------------------------------------------------------- 1 | import { Action } from '../'; 2 | 3 | export const CREATE_PROJECT = 'CREATE_PROJECT'; 4 | export function CreateProjectAction(): Action { 5 | return { 6 | type: CREATE_PROJECT, 7 | payload: {} 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/store/actions/index.ts: -------------------------------------------------------------------------------- 1 | export * from './create-project'; 2 | export * from './local-file-change'; 3 | export * from './add-project'; 4 | export * from './update-user-code-success'; 5 | export * from './add-text-editor'; 6 | -------------------------------------------------------------------------------- /src/store/actions/local-file-change.ts: -------------------------------------------------------------------------------- 1 | import { Action } from '../'; 2 | 3 | export const LOCAL_FILE_CHANGE = 'LOCAL_FILE_CHANGE'; 4 | export function LocalFileChangeAction(filePath: string, content: string): Action { 5 | return { 6 | type: LOCAL_FILE_CHANGE, 7 | payload: { 8 | filePath, 9 | content 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/store/actions/update-user-code-success.ts: -------------------------------------------------------------------------------- 1 | import { Action } from '..'; 2 | 3 | export const UPDATE_USER_CODE_SUCCESS = 'UPDATE_USER_CODE_SUCCESS'; 4 | export function UpdateUserCodeSuccessAction(projectPath: string, branch: string, modules: any): Action { 5 | return { 6 | type: UPDATE_USER_CODE_SUCCESS, 7 | payload: { 8 | projectPath, 9 | branch, 10 | modules 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/store/effects/index.ts: -------------------------------------------------------------------------------- 1 | export * from './create-project'; 2 | -------------------------------------------------------------------------------- /src/store/index.ts: -------------------------------------------------------------------------------- 1 | import { Subject, Observable } from 'rxjs'; 2 | import { tap, map, distinctUntilChanged } from 'rxjs/operators'; 3 | 4 | import __state from '../state'; 5 | 6 | export type Action = { 7 | type: string; 8 | payload: any; 9 | } 10 | 11 | const store = new Subject(); 12 | 13 | function dispatch(action: Action) { 14 | console.log(action.type); 15 | store.next(action); 16 | } 17 | 18 | function reducer(func: Function) { 19 | store 20 | .pipe(map((action: Action) => { 21 | let state = __state.getValue(); 22 | state = func(state, action); 23 | return [state, action]; 24 | })) 25 | .pipe(distinctUntilChanged(([nState], [oState]) => nState === oState)) 26 | .pipe(tap(([state]) => __state.next(state))) 27 | .subscribe(); 28 | } 29 | 30 | function effect(func: Function): Observable { 31 | return store 32 | .pipe(tap((action: Action) => { 33 | let state = __state.getValue(); 34 | state = func(state, action); 35 | })); 36 | } 37 | 38 | // @ts-ignore 39 | function pipe(callback): Observable { 40 | return store.pipe(callback); 41 | } 42 | 43 | export default { 44 | dispatch, 45 | pipe, 46 | reducer, 47 | effect 48 | }; 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/store/reducers/add-project.ts: -------------------------------------------------------------------------------- 1 | import { default as store, Action } from '../index'; 2 | import { ADD_PROJECT } from '../actions'; 3 | import { default as __state } from '../../state'; 4 | 5 | store.reducer((state: IState, { type, payload: { projectPath, branch, files } }: Action): IState => { 6 | if (type !== ADD_PROJECT) { 7 | return state; 8 | } 9 | 10 | files = files || {}; 11 | const projects = state.projects || {}; 12 | 13 | return { 14 | ...state, 15 | projects: { 16 | ...projects, 17 | [projectPath]: { 18 | branch, 19 | files 20 | } 21 | } 22 | }; 23 | }); 24 | -------------------------------------------------------------------------------- /src/store/reducers/add-text-editor.ts: -------------------------------------------------------------------------------- 1 | import { default as store, Action } from '../index'; 2 | import { 3 | ADD_TEXT_EDITOR 4 | } from '../actions'; 5 | import { default as __state } from '../../state'; 6 | 7 | store.reducer((state: IState, { type, payload: { filePath } }: Action): IState => { 8 | if (type !== ADD_TEXT_EDITOR) { 9 | return state; 10 | } 11 | 12 | if (!filePath) { 13 | return state; 14 | } 15 | 16 | const projectPath = selectProjectPath(filePath); 17 | if (!projectPath) { 18 | return state; 19 | } 20 | 21 | const project = state.projects[projectPath]; 22 | const file = project.files[filePath]; 23 | 24 | if (file) { 25 | return state; 26 | } 27 | 28 | return { 29 | ...state, 30 | projects: { 31 | ...state.projects, 32 | [projectPath] : { 33 | ...project, 34 | files: { 35 | ...project.files, 36 | [filePath]: { 37 | } 38 | } 39 | } 40 | } 41 | }; 42 | }); 43 | 44 | function selectProjectPath(filePath: string): string | undefined { 45 | const { projects } = __state.getValue(); 46 | 47 | if (!projects) { 48 | return; 49 | } 50 | 51 | const projectPath = Object.keys(projects).find((projectPath) => { 52 | return filePath.includes(projectPath); 53 | }); 54 | 55 | return projectPath; 56 | } -------------------------------------------------------------------------------- /src/store/reducers/index.ts: -------------------------------------------------------------------------------- 1 | import './add-project'; 2 | import './update-user-code-success'; 3 | import './local-file-change'; 4 | import './add-text-editor'; 5 | -------------------------------------------------------------------------------- /src/store/reducers/local-file-change.ts: -------------------------------------------------------------------------------- 1 | import { default as store, Action } from '../index'; 2 | import { 3 | LOCAL_FILE_CHANGE 4 | } from '../actions'; 5 | import { default as __state } from '../../state'; 6 | import { 7 | hashCode 8 | } from '../../utils'; 9 | 10 | store.reducer((state: IState, { type, payload: { 11 | filePath, 12 | content 13 | } }: Action): IState => { 14 | if (type !== LOCAL_FILE_CHANGE) { 15 | return state; 16 | } 17 | 18 | const projectPath = selectProjectPath(filePath); 19 | if (!projectPath) { 20 | return state; 21 | } 22 | 23 | const project = state.projects[projectPath]; 24 | const file = project.files[filePath] || {}; 25 | 26 | const hash = hashCode(content); 27 | const modified = file.hash !== hash; 28 | 29 | return { 30 | ...state, 31 | projects: { 32 | ...state.projects, 33 | [projectPath] : { 34 | ...project, 35 | files: { 36 | ...project.files, 37 | [filePath]: { 38 | ...file, 39 | modified 40 | } 41 | } 42 | } 43 | } 44 | }; 45 | }); 46 | 47 | function selectProjectPath(filePath: string): string | undefined { 48 | const { projects } = __state.getValue(); 49 | 50 | if (!projects) { 51 | return; 52 | } 53 | 54 | const projectPath = Object.keys(projects).find((projectPath) => { 55 | return filePath.includes(projectPath); 56 | }); 57 | 58 | return projectPath; 59 | } -------------------------------------------------------------------------------- /src/store/reducers/update-user-code-success.ts: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | import { default as store, Action } from '../index'; 4 | import { UPDATE_USER_CODE_SUCCESS } from '../actions'; 5 | import { default as __state } from '../../state'; 6 | import { 7 | hashCode 8 | } from '../../utils'; 9 | 10 | store.reducer((state: IState, { type, payload: { projectPath, modules } }: Action): IState => { 11 | if (type !== UPDATE_USER_CODE_SUCCESS) { 12 | return state; 13 | } 14 | 15 | const project = state.projects[projectPath]; 16 | const files: { [key: string]: { hash: number } } = {}; 17 | 18 | for (const moduleName in modules) { 19 | const content = modules[moduleName]; 20 | const modulePath = path.resolve(projectPath, moduleName); 21 | 22 | const hash = hashCode(content || ''); 23 | 24 | files[`${ modulePath }.js`] = { hash }; 25 | } 26 | 27 | return { 28 | ...state, 29 | projects: { 30 | ...state.projects, 31 | [projectPath]: { 32 | ...project, 33 | files 34 | } 35 | } 36 | }; 37 | }); 38 | -------------------------------------------------------------------------------- /stories/auth-view.stories.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { useRef } from 'react'; 3 | 4 | import { storiesOf } from '@storybook/react'; 5 | import { action } from '@storybook/addon-actions'; 6 | import { linkTo } from '@storybook/addon-links'; 7 | 8 | import { default as AuthView } from '../ui/components/auth-view'; 9 | 10 | function AuthViewInvalid() { 11 | const authViewRef = useRef(null); 12 | 13 | setTimeout(() => { 14 | if (!authViewRef.current) { 15 | return; 16 | } 17 | 18 | authViewRef.current.setState({ 19 | isInvalid: true, 20 | isBlocking: true 21 | }); 22 | }); 23 | 24 | return () 25 | } 26 | 27 | storiesOf('UI Components|Auth View', module) 28 | .add('Clear', () => ( 29 | 30 | )) 31 | .add('Invalid', () => ( 32 | 33 | )); 34 | -------------------------------------------------------------------------------- /stories/branches-view.stories.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { storiesOf } from '@storybook/react'; 4 | import { action } from '@storybook/addon-actions'; 5 | import { linkTo } from '@storybook/addon-links'; 6 | 7 | import { default as BranchesView } from '../ui/components/branches-view'; 8 | 9 | const branch = 'default'; 10 | const branches = [{ 11 | _id: '1', 12 | branch: 'default', 13 | activeWorld: true 14 | }, { 15 | _id: '2', 16 | branch: 'simulation', 17 | activeSim: true 18 | }, { 19 | _id: '3', 20 | branch: 'tutorial' 21 | }]; 22 | 23 | storiesOf('UI Components|Branches View', module) 24 | .add('View', () => ( 25 | 26 | 30 | 31 | )) 32 | .add('View Progressing', () => ( 33 | 34 | 40 | 41 | )) 42 | .add('View Active Branch', () => ( 43 | 44 | 50 | 51 | )); 52 | -------------------------------------------------------------------------------- /stories/confirm.stories.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { storiesOf } from '@storybook/react'; 4 | import { action } from '@storybook/addon-actions'; 5 | import { linkTo } from '@storybook/addon-links'; 6 | 7 | import { default as ConfirmView } from '../ui/components/confirm'; 8 | 9 | storiesOf('UI Components|Confirm View', module) 10 | .add('View', () => ( 11 | 12 | )); 13 | -------------------------------------------------------------------------------- /stories/create-project-view.stories.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { storiesOf } from '@storybook/react'; 4 | import { action } from '@storybook/addon-actions'; 5 | import { linkTo } from '@storybook/addon-links'; 6 | 7 | import { default as CreateProjectView } from '../ui/components/create-project-view'; 8 | 9 | const branch = 'default'; 10 | const branches = [{ 11 | _id: '1', 12 | branch: 'default', 13 | activeWorld: true 14 | }, { 15 | _id: '2', 16 | branch: 'simulation', 17 | activeSim: true 18 | }, { 19 | _id: '3', 20 | branch: 'tutorial' 21 | }]; 22 | 23 | storiesOf('UI Components|Create Project View', module) 24 | .add('Create', () => ( 25 | 29 | )) 30 | .add('Download', () => ( 31 | 42 | )); 43 | -------------------------------------------------------------------------------- /stories/data.js: -------------------------------------------------------------------------------- 1 | export const shards = [{ 2 | name: 'shard0' 3 | }, { 4 | name: 'shard1' 5 | }, { 6 | name :'shard2' 7 | }, { 8 | name: 'shard3' 9 | }]; 10 | 11 | export const memory = [ 12 | { 13 | path: "", 14 | value: { 15 | tasks: [], 16 | spawns: { 17 | Spawn1: { 18 | tasks: [] 19 | } 20 | }, 21 | i: 33398, 22 | shard: "shard0", 23 | a: "a", 24 | b: 123 25 | } 26 | }, 27 | { path: "creeps", value: "undefined" }, 28 | { path: "rooms", value: "undefined" }, 29 | { path: "shard", value: "shard0" }, 30 | { path: "tasks", value: "" }, 31 | ]; 32 | -------------------------------------------------------------------------------- /stories/icons.stories.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { storiesOf } from '@storybook/react'; 4 | import { action } from '@storybook/addon-actions'; 5 | import { linkTo } from '@storybook/addon-links'; 6 | 7 | 8 | storiesOf('UI Elements|Icons', module) 9 | .add('View', () => ( 10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | )); 28 | -------------------------------------------------------------------------------- /stories/modules-view.stories.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { storiesOf } from '@storybook/react'; 4 | import { action } from '@storybook/addon-actions'; 5 | import { linkTo } from '@storybook/addon-links'; 6 | 7 | import { default as ModulesView } from '../ui/components/modules-view'; 8 | 9 | const branch = 'default'; 10 | const modules = { 11 | 'role.builder': { 12 | modified: true 13 | }, 14 | 'role.harvester': { 15 | }, 16 | 'role.upgrader': {} 17 | }; 18 | 19 | storiesOf('UI Components|Modules View', module) 20 | .add('View', () => ( 21 | 22 | 28 | 29 | )); 30 | -------------------------------------------------------------------------------- /stories/prompt.stories.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { storiesOf } from '@storybook/react'; 4 | import { action } from '@storybook/addon-actions'; 5 | import { linkTo } from '@storybook/addon-links'; 6 | 7 | import { default as PromptView } from '../ui/components/prompt'; 8 | 9 | storiesOf('UI Components|Prompt View', module) 10 | .add('Default', () => ( 11 | 12 | )) 13 | .add('With warning', () => ( 14 | { 17 | if (!['one', 'two', 'three'].includes(value)) { 18 | return; 19 | } 20 | 21 | return { 22 | warning: `Value ${ value } in list` 23 | }; 24 | }} 25 | /> 26 | )); 27 | -------------------------------------------------------------------------------- /stories/token.stories.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { storiesOf } from '@storybook/react'; 4 | import { action } from '@storybook/addon-actions'; 5 | import { linkTo } from '@storybook/addon-links'; 6 | 7 | import { default as TokenView } from '../ui/components/token'; 8 | 9 | storiesOf('UI Components|Token View', module) 10 | .add('View', () => ( 11 | 12 | )); 13 | -------------------------------------------------------------------------------- /stories/welcome-view.stories.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { storiesOf } from '@storybook/react'; 4 | import { linkTo } from '@storybook/addon-links'; 5 | 6 | import { default as WelcomeView } from '../ui/components/welcome-view'; 7 | 8 | storiesOf('UI Components|Welcome View', module) 9 | .add('View', () => ( 10 | {}} 15 | /> 16 | )); 17 | 18 | -------------------------------------------------------------------------------- /styles/fonts.less: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'screepsicons'; 3 | src: url('atom://screeps-ide/assets/fonts/icomoon.eot'); 4 | src: url('atom://screeps-ide/assets/fonts/icomoon.eot#iefix') format('embedded-opentype'), 5 | url('atom://screeps-ide/assets/fonts/icomoon.ttf') format('truetype'), 6 | url('atom://screeps-ide/assets/fonts/icomoon.woff') format('woff'), 7 | url('atom://screeps-ide/assets/fonts/icomoon.svg#icomoon') format('svg'); 8 | 9 | font-weight: normal; 10 | font-style: normal; 11 | } 12 | -------------------------------------------------------------------------------- /tsconfig.atom.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "rootDirs": [ 5 | "./src", "./ui" 6 | ] 7 | }, 8 | "exclude": [ 9 | "examples" 10 | ] 11 | } -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "experimentalDecorators": true, 4 | "forceConsistentCasingInFileNames": true, 5 | "importHelpers": true, 6 | "jsx": "react", 7 | "lib": ["es7", "dom", "ES2017.object"], 8 | "module": "commonjs", 9 | "noLib": false, 10 | "outDir": "./dist", 11 | "rootDirs": [ 12 | "./examples", 13 | ], 14 | "preserveConstEnums": true, 15 | "skipLibCheck": false, 16 | "sourceMap": true, 17 | "strict": true, 18 | "target": "es2017", 19 | "noUnusedParameters": true, 20 | "noUnusedLocals": true, 21 | "noFallthroughCasesInSwitch": true, 22 | "noImplicitAny": true, 23 | "noImplicitThis": true 24 | }, 25 | "exclude": [ 26 | "node_modules" 27 | ], 28 | "includes": [ 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /ui/components/auth-view/index.d.ts: -------------------------------------------------------------------------------- 1 | interface IAuthModalProps { 2 | onCancel?: Function; 3 | onSubmit?: Function; 4 | } 5 | 6 | interface IAuthModalState { 7 | isInvalid: boolean; 8 | isBlocking: boolean; 9 | } 10 | -------------------------------------------------------------------------------- /ui/components/auth-view/style.less: -------------------------------------------------------------------------------- 1 | .screeps-auth-modal { 2 | header + div { 3 | color: @text-color-subtle; 4 | } 5 | 6 | footer > div { 7 | flex: 1 0 auto; 8 | display: flex; 9 | align-items: center; 10 | 11 | a + a { 12 | margin-left: 30px; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ui/components/branches-view/index.d.ts: -------------------------------------------------------------------------------- 1 | interface IBranch { 2 | _id: string; 3 | branch: string; 4 | activeWorld?: boolean; 5 | activeSim: boolean; 6 | } 7 | 8 | interface IBranchesViewProps { 9 | isProgressing?: boolean; 10 | active?: string; 11 | 12 | branches: IBranch[]; 13 | 14 | onCopyBranch?(branch: string): Promise; 15 | onSelectBranch?(branch: string): Promise; 16 | onDeleteBranch?(branch: string): Promise; 17 | 18 | onSetActiveSim?(branch: string): Promise; 19 | onSetActiveWorld?(branch: string): Promise; 20 | } 21 | -------------------------------------------------------------------------------- /ui/components/confirm/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | export const MODAL_CLOSE = 'MODAL_CLOSE'; 4 | 5 | interface IConfirmModalProps { 6 | legend?: string; 7 | submitBtn?: string; 8 | 9 | onCancel?(): void; 10 | onSubmit?(): void; 11 | } 12 | 13 | export default function({ 14 | legend, 15 | submitBtn, 16 | 17 | onCancel: cancel, 18 | onSubmit: submit 19 | }: IConfirmModalProps) { 20 | legend = legend || 'Are you sure? Do you want execute it?'; 21 | submitBtn = submitBtn || 'Ok'; 22 | 23 | return ( 24 |
25 |
26 |
27 |
29 |
30 | { legend } 31 |
32 |
33 | 37 | 41 |
42 |
43 | ); 44 | 45 | // Public component output actions. 46 | function onCancel() { 47 | cancel && cancel(); 48 | } 49 | 50 | function onSubmit() { 51 | submit && submit(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /ui/components/console-view/components/message-item.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | interface IConsoleMessageItemViewProps { 4 | message: any 5 | } 6 | 7 | function unescapeHTML(escapedHTML: string) { 8 | return escapedHTML.replace(/</g,'<').replace(/>/g,'>').replace(/&/g,'&'); 9 | } 10 | 11 | export default function(props: IConsoleMessageItemViewProps) { 12 | let timestamp, shard, message, error; 13 | 14 | if (props.message.timeStamp) { 15 | timestamp = ( 16 | 17 | [{ new Date(props.message.timeStamp) .toLocaleTimeString() }] 18 | 19 | ); 20 | } 21 | 22 | if (props.message.shard) { 23 | shard = ( 24 | 25 | [{ props.message.shard }] 26 | 27 | ); 28 | } 29 | 30 | if (props.message.log) { 31 | message = ( 32 | 33 | ); 34 | } 35 | 36 | if (props.message.expression) { 37 | message = ( 38 | { unescapeHTML(props.message.expression) } 39 | ); 40 | } 41 | 42 | if (props.message.result) { 43 | message = ( 44 | { unescapeHTML(props.message.result) } 45 | ); 46 | } 47 | 48 | if (props.message.error) { 49 | error =( 50 | { unescapeHTML(props.message.error) } 51 | ); 52 | } 53 | 54 | return ( 55 |
56 | { timestamp } 57 | { shard } 58 | { message } 59 | { error } 60 |
61 | ); 62 | } 63 | -------------------------------------------------------------------------------- /ui/components/console-view/components/messages-list.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { useRef, useEffect } from 'react'; 3 | 4 | import { default as ConsoleMessageItemView } from './message-item'; 5 | 6 | interface IConsoleMessagesListViewProps { 7 | messages: any[] 8 | } 9 | 10 | let scrollToBottom = true; 11 | export default function({ messages }: IConsoleMessagesListViewProps) { 12 | const messagesRef = useRef(null); 13 | const messagesBottomRef = useRef(null); 14 | 15 | useEffect(() => { 16 | if (!messagesBottomRef.current || !scrollToBottom) { 17 | return; 18 | } 19 | 20 | // @ts-ignore 21 | messagesBottomRef.current.scrollIntoView({ behavior: 'smooth' }); 22 | }, [messages]); 23 | 24 | return ( 25 |
28 | {messages.map((message, index) => { 29 | return () 30 | })} 31 |
32 |
33 | ); 34 | 35 | function onScroll() { 36 | if (!messagesRef.current) { 37 | return; 38 | } 39 | 40 | const { offsetHeight, scrollHeight, scrollTop } = messagesRef.current; 41 | 42 | scrollToBottom = (scrollTop + offsetHeight) >= scrollHeight; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /ui/components/console-view/index.d.ts: -------------------------------------------------------------------------------- 1 | declare interface IConsoleViewState { 2 | shard: any; 3 | shards: any; 4 | paused: boolean; 5 | messages: any[]; 6 | } 7 | 8 | declare interface IConsoleViewProps { 9 | shard?: string; 10 | output?: any; 11 | shards?: any; 12 | messages?: any[]; 13 | paused: boolean; 14 | 15 | onShard?(shard: string): Promise; 16 | onInput?(expression: string): Promise; 17 | onClose?(): Promise; 18 | onPause?(): Promise; 19 | onResume?(): Promise; 20 | onClean?(): Promise; 21 | } 22 | -------------------------------------------------------------------------------- /ui/components/console-view/index.tsx: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import * as React from 'react'; 4 | 5 | import { default as ConsoleControlsView } from './components/controls'; 6 | import { default as ConsoleMessagesListView } from './components/messages-list'; 7 | import { default as ConsoleInputView } from './components/console-input'; 8 | 9 | export default function(props: IConsoleViewProps) { 10 | return ( 11 |
12 | 22 |
23 | 24 |
25 | 26 |
27 | ); 28 | } 29 | -------------------------------------------------------------------------------- /ui/components/create-project-view/style.less: -------------------------------------------------------------------------------- 1 | .screeps-create-project { 2 | color: rgba(234, 237, 255, 0.7); 3 | 4 | .input-select { 5 | width: 100%; 6 | } 7 | 8 | .screeps-field:nth-child(3) { 9 | margin-top: 0; 10 | } 11 | 12 | em { 13 | color: rgba(255, 255, 255, 0.2); 14 | } 15 | } -------------------------------------------------------------------------------- /ui/components/memory-view/components/input.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { useState } from 'react'; 3 | 4 | interface IMemoryInputViewProps { 5 | onInput?(name: string): void; 6 | } 7 | 8 | export default function({ 9 | onInput 10 | }: IMemoryInputViewProps) { 11 | const [value, setValue] = useState(''); 12 | 13 | return ( 14 |
15 |
16 |
17 | 28 |
29 |
30 |
31 |
32 | ); 33 | 34 | function onChange(event: React.ChangeEvent) { 35 | const target = event.target as HTMLInputElement; 36 | const value = target.value; 37 | 38 | setValue(value); 39 | } 40 | 41 | function onSubmit(event: React.FormEvent) { 42 | onInput && onInput(value); 43 | setValue(''); 44 | 45 | event.preventDefault(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /ui/components/memory-view/components/jsoneditor.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { useRef, useState, useEffect, useImperativeHandle, forwardRef } from 'react' 3 | 4 | //@ts-ignore 5 | import JSONEditor from 'jsoneditor'; 6 | 7 | interface IMemoryJSONEditorViewProps { 8 | name: string; 9 | value: any; 10 | } 11 | 12 | export default forwardRef(function(props: IMemoryJSONEditorViewProps, ref) { 13 | const [editorRef, setEditorRef] = useState(); 14 | const editorContainerRef = useRef(null); 15 | 16 | useEffect(() => { 17 | const editorRef = new JSONEditor(editorContainerRef.current, { 18 | name: props.name || 'Memory' 19 | }, props.value || 'undefined'); 20 | 21 | // TODO: Block error: Cannot read property '0' of undefined; 22 | const _onMultiSelect = editorRef._onMultiSelect; 23 | editorRef._onMultiSelect = () => { 24 | try { 25 | _onMultiSelect.bind(editorRef); 26 | } catch(err) { 27 | // Noop. 28 | } 29 | } 30 | 31 | setEditorRef(editorRef); 32 | }, [editorContainerRef]); 33 | 34 | useImperativeHandle(ref, () => ({ 35 | getValue, 36 | setValue 37 | })); 38 | 39 | return ( 40 |
41 | ); 42 | 43 | function getValue() { 44 | return editorRef.get(); 45 | } 46 | 47 | function setValue(value: any) { 48 | editorRef.set(value); 49 | } 50 | }) 51 | -------------------------------------------------------------------------------- /ui/components/memory-view/components/segment.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | interface IMemorySegmentViewProps { 4 | segment: string; 5 | 6 | onChange?: Function; 7 | } 8 | 9 | export default function(props: IMemorySegmentViewProps) { 10 | return ( 11 |
12 |