Skip to content

Commit

Permalink
Product: 0.4
Browse files Browse the repository at this point in the history
Product 0.4
  • Loading branch information
DrizzlingCattus authored Dec 13, 2019
2 parents 9209c12 + 8112ee8 commit b0e8f3c
Show file tree
Hide file tree
Showing 73 changed files with 2,029 additions and 964 deletions.
3 changes: 3 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,14 @@
"@fortawesome/free-brands-svg-icons": "^5.11.2",
"@fortawesome/free-solid-svg-icons": "^5.11.2",
"@fortawesome/react-fontawesome": "^0.1.7",
"ansicolor": "^1.1.92",
"axios": "^0.19.0",
"debug": "^4.1.1",
"dotenv-webpack": "^1.7.0",
"prop-types": "^15.7.2",
"react": "^16.11.0",
"react-dom": "^16.11.0",
"socket.io-client": "^2.3.0",
"styled-components": "^4.4.1",
"uuidv4": "^6.0.0"
}
Expand Down
22 changes: 10 additions & 12 deletions client/src/actions/CellAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,15 @@ const cellActionCreator = {
* - 엔터시 기준 셀의 다음 셀에 셀을 생성한다.
* @param {Cell} createMarkdownCell 새 셀 컴포넌트를 리턴하는 콜백
* @param {String} tag 셀의 타입(태그). 생략시 default input 셀이 생성된다.
* @param {Number} start ordered list일 경우의 start
*/
new(cellUuid, createMarkdownCell, tag = CELL_TAG.DEFAULT) {
new(cellUuid, createMarkdownCell, tag = CELL_TAG.DEFAULT, start = null) {
return {
type: CELL_ACTION.NEW,
cellUuid,
createMarkdownCell,
tag,
start,
};
},

Expand Down Expand Up @@ -142,15 +144,16 @@ const cellActionCreator = {
* @param {String} text 변경할 Cell의 텍스트
* @param {String} tag 변경할 Cell의 태그
* @param {React.element} cell 변경할 Cell 요소
* @param {Number} start ordered-list일 경우의 start
*/
transform(cellUuid, text, tag, cell, start) {
transform(cellUuid, text, tag, cell, start = null) {
return {
type: CELL_ACTION.TARGET.TRANSFORM,
cellUuid,
text,
tag,
cell,
start: start || null,
start,
};
},

Expand All @@ -165,23 +168,19 @@ const cellActionCreator = {

/**
* 쉬프트+위 입력시 선택할 셀의 범위를 위로 한 단계 올린다.
* @param {Uuid} cellUuid 블록을 시작할 기준 셀의 uuid
*/
blockUp(cellUuid) {
blockUp() {
return {
type: CELL_ACTION.BLOCK.UP,
cellUuid,
};
},

/**
* 쉬프트+아래 입력시 선택할 셀의 범위를 위로 한 단계 내린다.
* @param {Uuid} cellUuid 블록을 시작할 기준 셀의 uuid
*/
blockDown(cellUuid) {
blockDown() {
return {
type: CELL_ACTION.BLOCK.DOWN,
cellUuid,
};
},

Expand Down Expand Up @@ -219,12 +218,11 @@ const cellActionCreator = {
},

/**
* @param {Uuid} cellUuid 붙여넣기를 할 기준 셀의 uuid
* 현재 셀의 다음 셀부터 클립보드의 내용을 붙여넣기 한다.
*/
paste(cellUuid) {
paste() {
return {
type: CELL_ACTION.CLIPBOARD.PASTE,
cellUuid,
};
},

Expand Down
19 changes: 12 additions & 7 deletions client/src/actions/TerminalAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const TERMINAL_ACTION = {
UPDATE_OUTPUT: "terminal/update-output",

DELETE_REPL: "terminal/delete-repl",

LOAD: "terminal/load",
};

const terminalActionCreator = {
Expand All @@ -41,10 +43,9 @@ const terminalActionCreator = {
* 터미널 쉘 명령을 평가할 수 있다.
* @param {String} commandString REPL cell에 입력된 쉘 명령이다.
*/
evalInput(commandString) {
evalInput() {
return {
type: TERMINAL_ACTION.EVAL_INPUT,
commandString,
};
},

Expand All @@ -57,10 +58,9 @@ const terminalActionCreator = {
};
},

focusIn(cellUuid) {
focusIn() {
return {
type: TERMINAL_ACTION.FOCUS_IN,
cellUuid,
};
},

Expand Down Expand Up @@ -108,13 +108,11 @@ const terminalActionCreator = {

/**
* REPL 출력값을 업데이트한다.
* @param {Number} index 업데이트될 REPL cell index다.
* @param {String} text 업데이트될 REPL 출력값이다.
*/
updateOutputText(index, text) {
updateOutputText(text) {
return {
type: TERMINAL_ACTION.UPDATE_OUTPUT,
index,
text,
};
},
Expand All @@ -124,6 +122,13 @@ const terminalActionCreator = {
type: TERMINAL_ACTION.DELETE_REPL,
};
},

load(outputString) {
return {
type: TERMINAL_ACTION.LOAD,
outputString,
};
},
};

export { TERMINAL_ACTION, terminalActionCreator };
45 changes: 45 additions & 0 deletions client/src/actions/TerminalSetting.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
const TERMINAL_SETTING_ACTION = {
SELECT: {
OS: "terminal-setting/select/os",
PE: "terminal-setting/select/pe",
DB: "terminal-setting/select/db",
},
MOVE: {
PREV: "terminal-setting/move/prev",
NEXT: "terminal-setting/move/next",
STEP: "terminal-setting/move/step",
},
HIDE: "terminal-setting/hide",
};

const terminalSettingActionCreator = {
selectOS(os) {
return { type: TERMINAL_SETTING_ACTION.SELECT.OS, os };
},

selectPE(pe) {
return { type: TERMINAL_SETTING_ACTION.SELECT.PE, pe };
},

selectDB(db) {
return { type: TERMINAL_SETTING_ACTION.SELECT.DB, db };
},

prevStep(step) {
return { type: TERMINAL_SETTING_ACTION.MOVE.PREV, step };
},

nextStep(step) {
return { type: TERMINAL_SETTING_ACTION.MOVE.NEXT, step };
},

selectStep(step) {
return { type: TERMINAL_SETTING_ACTION.MOVE.STEP, step };
},

viewTerminalSetting() {
return { type: TERMINAL_SETTING_ACTION.HIDE };
},
};

export { TERMINAL_SETTING_ACTION, terminalSettingActionCreator };
36 changes: 0 additions & 36 deletions client/src/actions/TerminalSettingAction.js

This file was deleted.

12 changes: 10 additions & 2 deletions client/src/components/editor/EditorComponent.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import React, { useContext, useEffect, useRef } from "react";
import styled from "styled-components";

import { CellContext, CellDispatchContext } from "../../stores/CellStore";
import { cellActionCreator } from "../../actions/CellAction";
import { uuidManager } from "../../utils";
import { MarkdownCell } from "./cells";

const EditorComponentWrapper = styled.section`
width: 99%;
display: flex;
flex-direction: column;
`;

const EditorComponent = () => {
const { state } = useContext(CellContext);
const cellDispatch = useContext(CellDispatchContext);
Expand All @@ -21,13 +29,13 @@ const EditorComponent = () => {
}, []);

return (
<>
<EditorComponentWrapper>
{cells.map((cell, cellIndex) => {
const uuidArray = uuidManager.getUuidArray();
const key = uuidArray[cellIndex];
return <React.Fragment key={key}>{cell}</React.Fragment>;
})}
</>
</EditorComponentWrapper>
);
};

Expand Down
Loading

0 comments on commit b0e8f3c

Please sign in to comment.