@aj-shadow/z-abs-complayer-codeeditor-client 0.0.0-aj-beta.221
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitattributes +26 -0
- package/LICENSE.txt +96 -0
- package/README.md +5 -0
- package/npm-shrinkwrap.json +13 -0
- package/package.json +10 -0
- package/project/client/_build/Bundle-CompLayer-Codeeditor-client.bld +41 -0
- package/project/client/_build/Client-CompLayer-Codeeditor-client-jsx.bld +10 -0
- package/project/client/_build/Client-CompLayer-Codeeditor-client.bld +10 -0
- package/project/client/_build/Client-css-CompLayer-Codeeditor-bundle.bld +9 -0
- package/project/client/_build/z-abs-complayer-codeeditor-client.prj +36 -0
- package/project/client/actions/action-code-editor-file.js +78 -0
- package/project/client/actions/action-code-editor-folder.js +41 -0
- package/project/client/actions/action-code-editor-persistent-data.js +23 -0
- package/project/client/actions/action-code-editor-project.js +23 -0
- package/project/client/actions/action-code-editor-workspace.js +35 -0
- package/project/client/actions/data-action-code-editor-file.js +41 -0
- package/project/client/actions/data-action-code-editor-folder.js +33 -0
- package/project/client/actions/data-action-code-editor-persistent-data.js +27 -0
- package/project/client/actions/data-action-code-editor-project.js +20 -0
- package/project/client/actions/data-action-code-editor-workspace.js +27 -0
- package/project/client/components/middle-code-editor-sidebar.jsx +117 -0
- package/project/client/components/middle-code-editor-toolbar.jsx +638 -0
- package/project/client/components/middle-code-editor-view.jsx +400 -0
- package/project/client/components/middle-code-editor.jsx +50 -0
- package/project/client/css/code-editor.css +44 -0
- package/project/client/css/scrollbar-dark.css +8 -0
- package/project/client/css/scrollbar-light.css +6 -0
- package/project/client/css/search.css +40 -0
- package/project/client/css/search_light.css +8 -0
- package/project/client/css/serach_dark.css +8 -0
- package/project/client/css/sidebar-dark.css +21 -0
- package/project/client/css/sidebar-light.css +18 -0
- package/project/client/css/tab.css +19 -0
- package/project/client/css/tab_dark.css +9 -0
- package/project/client/css/tab_light.css +9 -0
- package/project/client/css/view-dark.css +11 -0
- package/project/client/css/view-light.css +10 -0
- package/project/client/stores/code-editor-store.js +1044 -0
- package/project/z-abs-complayer-codeeditor-client.tree +40 -0
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
import CodeEditorStore from '../stores/code-editor-store';
|
|
6
|
+
import { ActionCodeEditorWorkspaceGet } from '../actions/action-code-editor-workspace';
|
|
7
|
+
import { ActionCodeEditorFileGet, ActionCodeEditorFileSet, ActionCodeEditorFileEdit, ActionCodeEditorFileClose, ActionCodeEditorFileMove } from '../actions/action-code-editor-file';
|
|
8
|
+
import { ActionCodeEditorWorkspaceSearchSet } from '../actions/action-code-editor-workspace';
|
|
9
|
+
import Tabs from 'z-abs-complayer-bootstrap-client/client/tabs';
|
|
10
|
+
import Tab from 'z-abs-complayer-bootstrap-client/client/tab';
|
|
11
|
+
import CodeMirrorEditor from 'z-abs-complayer-codemirror-client/client/code-mirror-editor';
|
|
12
|
+
import {RouterContext} from 'z-abs-complayer-router-client/client/react-component/router-context';
|
|
13
|
+
import ReactComponentStore from 'z-abs-corelayer-client/client/react-component/react-component-store';
|
|
14
|
+
import React from 'react';
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
export default class MiddleCodeEditorView extends ReactComponentStore {
|
|
18
|
+
constructor(props) {
|
|
19
|
+
super(props, [CodeEditorStore]);
|
|
20
|
+
this.close = false;
|
|
21
|
+
this.fileIcons = new Map();
|
|
22
|
+
this.fileIcons.set('bld', '/abs-images/icon/build.svg');
|
|
23
|
+
this.fileIcons.set('css', '/abs-images/icon/css.svg');
|
|
24
|
+
this.fileIcons.set('js', '/abs-images/icon/js.svg');
|
|
25
|
+
this.fileIcons.set('json', '/abs-images/icon/json.svg');
|
|
26
|
+
this.fileIcons.set('jsx', '/abs-images/icon/jsx.svg');
|
|
27
|
+
this.fileIcons.set('html', '/abs-images/icon/html.svg');
|
|
28
|
+
this.fileIcons.set('md', '/abs-images/icon/md.svg');
|
|
29
|
+
this.fileIcons.set('prj', '/abs-images/icon/project.svg');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
shouldUpdate(nextProps, nextState) {
|
|
33
|
+
return !this.shallowCompare(this.props._uriPath, nextProps._uriPath)
|
|
34
|
+
|| !this.shallowCompareObjectValues(this.props.location, nextProps.location)
|
|
35
|
+
|| !this.shallowCompareMapValues(this.state.CodeEditorStore.files, nextState.CodeEditorStore.files)
|
|
36
|
+
|| !this.shallowCompare(this.state.CodeEditorStore.current, nextState.CodeEditorStore.current)
|
|
37
|
+
|| !this.shallowCompare(this.state.CodeEditorStore.current.query, nextState.CodeEditorStore.current.query)
|
|
38
|
+
|| !this.shallowCompare(this.state.CodeEditorStore.persistentData, nextState.CodeEditorStore.persistentData);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
renderTabFileHeading(fileType) {
|
|
42
|
+
const filePath = this.fileIcons.get(fileType);
|
|
43
|
+
if(filePath) {
|
|
44
|
+
return (
|
|
45
|
+
<img className="middle_code_editor_tab_icon" src={filePath} />
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
renderTabFile(file, key) {
|
|
54
|
+
let id = -1;
|
|
55
|
+
const lineFunctions = new Map([
|
|
56
|
+
[
|
|
57
|
+
CodeEditorStore.SEARCH_FILES, {
|
|
58
|
+
name: CodeEditorStore.SEARCH_FILES,
|
|
59
|
+
types: [
|
|
60
|
+
{
|
|
61
|
+
id: ++id,
|
|
62
|
+
lightMode: {backgroundColor: "bisque"},
|
|
63
|
+
darkMode: {backgroundColor: "#040"}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: ++id,
|
|
67
|
+
lightMode: {backgroundColor: "#EFCEA6"},
|
|
68
|
+
darkMode: {backgroundColor: "#060"}
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
extentionLines: [],
|
|
72
|
+
getLines: (url) => {
|
|
73
|
+
const fileLines = this.state.CodeEditorStore.searchLines.get(CodeEditorStore.SEARCH_FILES);
|
|
74
|
+
const lines = fileLines.get(url);
|
|
75
|
+
if(lines) {
|
|
76
|
+
if(lines[lines.length-1].type !== 1) {
|
|
77
|
+
for(let i = 0; i < lines.length-1;++i) {
|
|
78
|
+
lines[i].type = 0;
|
|
79
|
+
}
|
|
80
|
+
lines[lines.length-1].type = 1;
|
|
81
|
+
}
|
|
82
|
+
return lines;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
return [];
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
[
|
|
91
|
+
CodeEditorStore.LOG_FILES, {
|
|
92
|
+
name: CodeEditorStore.LOG_FILES,
|
|
93
|
+
types: [
|
|
94
|
+
{
|
|
95
|
+
id: (id = 0),
|
|
96
|
+
lightMode: {backgroundColor: "PapayaWhip", color: "Peru"},
|
|
97
|
+
darkMode: {backgroundColor: "PapayaWhip", color: "Peru"}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
id: ++id,
|
|
101
|
+
lightMode: {backgroundColor: "Plum", color: "DarkMagenta"},
|
|
102
|
+
darkMode: {backgroundColor: "Plum", color: "DarkMagenta"}
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: ++id,
|
|
106
|
+
lightMode: {backgroundColor: "#FF8888", color: "#AA0000"},
|
|
107
|
+
darkMode: {backgroundColor: "#FF8888", color: "#AA0000"}
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: ++id,
|
|
111
|
+
lightMode: {backgroundColor: "DarkOrange", color: "#FFDD88"},
|
|
112
|
+
darkMode: {backgroundColor: "DarkOrange", color: "#FFDD88"}
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
id: ++id,
|
|
116
|
+
lightMode: {backgroundColor: "#DDDDFF", color: "#0000ff"},
|
|
117
|
+
darkMode: {backgroundColor: "#DDDDFF", color: "#0000ff"}
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
id: ++id,
|
|
121
|
+
lightMode: {backgroundColor: "#DDDDFF", color: "Navy"},
|
|
122
|
+
darkMode: {backgroundColor: "#DDDDFF", color: "Navy"}
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: ++id,
|
|
126
|
+
lightMode: {backgroundColor: "green", color: "#D0E9C6"},
|
|
127
|
+
darkMode: {backgroundColor: "green", color: "#D0E9C6"}
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
id: ++id,
|
|
131
|
+
lightMode: {backgroundColor: "red", color: "#FFDDDD"},
|
|
132
|
+
darkMode: {backgroundColor: "red", color: "#FFDDDD"}
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
id: ++id,
|
|
136
|
+
lightMode: {backgroundColor: "PaleTurquoise", color: "DodgerBlue"},
|
|
137
|
+
darkMode: {backgroundColor: "PaleTurquoise", color: "DodgerBlue"}
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
id: ++id,
|
|
141
|
+
lightMode: {backgroundColor: "#FDFDFD", color: "#AAAAFF"},
|
|
142
|
+
darkMode: {backgroundColor: "#FDFDFD", color: "#AAAAFF"}
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
id: ++id,
|
|
146
|
+
lightMode: {backgroundColor: "#FDFDFD", color: "#FF6464"},
|
|
147
|
+
darkMode: {backgroundColor: "#FDFDFD", color: "#FF6464"}
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
extentionLines: [],
|
|
151
|
+
getLines: (url) => {
|
|
152
|
+
const fileLines = this.state.CodeEditorStore.searchLines.get(CodeEditorStore.LOG_FILES);
|
|
153
|
+
const lines = fileLines.get(url);
|
|
154
|
+
if(lines) {
|
|
155
|
+
return lines;
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
return [];
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
]);
|
|
164
|
+
return (
|
|
165
|
+
<Tab eventKey={key} key={key}
|
|
166
|
+
title={
|
|
167
|
+
<div>
|
|
168
|
+
{this.renderTabFileHeading(file.type)}
|
|
169
|
+
{file.title}
|
|
170
|
+
<button type="button" className={this.theme(this.state.CodeEditorStore.persistentData.darkMode, 'middle_code_editor_close')} aria-label="Close"
|
|
171
|
+
onClick={(e, a) => {
|
|
172
|
+
this.close = true;
|
|
173
|
+
this.dispatch(CodeEditorStore, new ActionCodeEditorFileClose(key));
|
|
174
|
+
}}
|
|
175
|
+
>
|
|
176
|
+
×
|
|
177
|
+
</button>
|
|
178
|
+
</div>
|
|
179
|
+
}
|
|
180
|
+
onMove={(fromKey, toKey) => {
|
|
181
|
+
this.dispatch(CodeEditorStore, new ActionCodeEditorFileMove(fromKey, toKey));
|
|
182
|
+
}}
|
|
183
|
+
>
|
|
184
|
+
<CodeMirrorEditor id={`code_editor_view_${key}`} projectId={file.projectId} docKey={key} code={file.content} options={this.getOptions(file.type)} darkMode={this.state.CodeEditorStore.persistentData.darkMode} emptyLine={this.state.CodeEditorStore.persistentData.emptyLine} currentType={this.state.CodeEditorStore.current.type} currentFile={this.state.CodeEditorStore.current.file} lineFunctions={lineFunctions} lines={this.state.CodeEditorStore.searchLines} eol={this.state.CodeEditorStore.eol}
|
|
185
|
+
onChanged={(projectId, docKey, code) => {
|
|
186
|
+
this.dispatch(CodeEditorStore, new ActionCodeEditorFileEdit(projectId, docKey, code));
|
|
187
|
+
}}
|
|
188
|
+
onFocusChange={(focused, docKey) => {
|
|
189
|
+
if(focused) {
|
|
190
|
+
const file = this.state.CodeEditorStore.files.get(docKey);
|
|
191
|
+
if(file) {
|
|
192
|
+
this.dispatch(CodeEditorStore, new ActionCodeEditorFileGet(file.projectId, file.key, file.title, file.path, file.type, file.plugin, file.workspaceName));
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}}
|
|
196
|
+
/>
|
|
197
|
+
</Tab>
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
renderTabSearchHeading(data) {
|
|
202
|
+
const hits = 1 !== data.data.hits ? 'hits' : 'hit';
|
|
203
|
+
const files = 1 !== data.data.files ? 'files' : 'file';
|
|
204
|
+
const searchMessage = `Search"${data.search}" <${data.data.hits} ${hits} in ${data.data.files} ${files} of ${data.data.searched} searched>`;
|
|
205
|
+
return (
|
|
206
|
+
<tr key="search_header" className="editor_search_header">
|
|
207
|
+
<td>{searchMessage}</td>
|
|
208
|
+
</tr>
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
renderTabSearchFileFound(foundFile, found, search, key) {
|
|
213
|
+
const classNameSearchFound = this.state.CodeEditorStore.persistentData.darkMode ? "editor_search_found_dark" : "editor_search_found_light";
|
|
214
|
+
return (
|
|
215
|
+
<React.Fragment key={`found_fragment_${key}`}>
|
|
216
|
+
<tr key={`found_tr_${key}`} className={classNameSearchFound}>
|
|
217
|
+
<td>
|
|
218
|
+
{`Line: ${found.lineNbr} `}
|
|
219
|
+
<a className="editor_search_found"
|
|
220
|
+
onClick={(e) => {
|
|
221
|
+
const url = `./${foundFile.file}`.replace(new RegExp('[/\\\\]', 'g'), '/');
|
|
222
|
+
this.dispatch(CodeEditorStore, new ActionCodeEditorFileSet(url, CodeEditorStore.SEARCH_FILES, found.lineNbr, 0));
|
|
223
|
+
}}>
|
|
224
|
+
{found.lineBefore}<span className="editor_search_found">{search}</span>{found.lineAfter}
|
|
225
|
+
</a>
|
|
226
|
+
</td>
|
|
227
|
+
</tr>
|
|
228
|
+
</React.Fragment>
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
renderTabSearchFile(foundFile, search, index) {
|
|
233
|
+
const rows = [];
|
|
234
|
+
foundFile.indexes.forEach((found, fIndex) => {
|
|
235
|
+
rows.push(this.renderTabSearchFileFound(foundFile, found, search, `${index}_${fIndex}`));
|
|
236
|
+
});
|
|
237
|
+
const hits = 1 !== foundFile.indexes.length ? 'hits' : 'hit';
|
|
238
|
+
const fileMessage = `<${foundFile.indexes.length} ${hits}> ${foundFile.file}`;
|
|
239
|
+
return (
|
|
240
|
+
<React.Fragment key={`file_fragment_${index}`}>
|
|
241
|
+
<tr key={`file_tr_${index}`} className={"editor_search_file"}>
|
|
242
|
+
<td>{fileMessage}</td>
|
|
243
|
+
</tr>
|
|
244
|
+
{rows}
|
|
245
|
+
</React.Fragment>
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
renderTabSearchRows(data) {
|
|
250
|
+
const rows = [];
|
|
251
|
+
rows.push(this.renderTabSearchHeading(data));
|
|
252
|
+
if(0 !== data.data.foundFiles.length) {
|
|
253
|
+
data.data.foundFiles.forEach((foundFile, index) => {
|
|
254
|
+
rows.push(this.renderTabSearchFile(foundFile, data.search, index));
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
return (
|
|
258
|
+
<table>
|
|
259
|
+
<tbody>
|
|
260
|
+
{rows}
|
|
261
|
+
</tbody>
|
|
262
|
+
</table>
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
renderTabHeading() {
|
|
267
|
+
return (
|
|
268
|
+
<span className="editor_search_header">
|
|
269
|
+
search
|
|
270
|
+
</span>
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
renderTabSearch(data, key) {
|
|
275
|
+
const rows = this.renderTabSearchRows(data);
|
|
276
|
+
return (
|
|
277
|
+
<Tab eventKey={key} key={key}
|
|
278
|
+
title={
|
|
279
|
+
<div>
|
|
280
|
+
{this.renderTabHeading()}
|
|
281
|
+
{data.title}
|
|
282
|
+
<button type="button" className={this.theme(this.state.CodeEditorStore.persistentData.darkMode, 'middle_code_editor_close')} aria-label="Close"
|
|
283
|
+
onClick={(e, a) => {
|
|
284
|
+
this.close = true;
|
|
285
|
+
this.dispatch(CodeEditorStore, new ActionCodeEditorFileClose(key));
|
|
286
|
+
}}
|
|
287
|
+
>
|
|
288
|
+
×
|
|
289
|
+
</button>
|
|
290
|
+
</div>
|
|
291
|
+
}
|
|
292
|
+
onMove={(fromKey, toKey) => {
|
|
293
|
+
this.dispatch(CodeEditorStore, new ActionCodeEditorFileMove(fromKey, toKey));
|
|
294
|
+
}}
|
|
295
|
+
>
|
|
296
|
+
<div className="editor_search bootstrap_same_size_as_parent">
|
|
297
|
+
{rows}
|
|
298
|
+
</div>
|
|
299
|
+
</Tab>
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
renderTab(options) {
|
|
304
|
+
const result = [];
|
|
305
|
+
this.state.CodeEditorStore.files.forEach((data, key) => {
|
|
306
|
+
if('search' === data.tabType) {
|
|
307
|
+
result.push(this.renderTabSearch(data, key));
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
if(data.valid) {
|
|
311
|
+
result.push(this.renderTabFile(data, key));
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
return result;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
renderTabs(options) {
|
|
319
|
+
if(0 !== this.state.CodeEditorStore.files.size) {
|
|
320
|
+
return (
|
|
321
|
+
<Tabs id="code_editor_tabs" draggable="true" activeKey={null !== this.state.CodeEditorStore.current.file ? this.state.CodeEditorStore.current.file.key : null} darkMode={this.state.CodeEditorStore.persistentData.darkMode}
|
|
322
|
+
onSelect={(selectedKey) => {
|
|
323
|
+
if(!this.close) {
|
|
324
|
+
const file = this.state.CodeEditorStore.files.get(selectedKey);
|
|
325
|
+
if('search' === file.tabType) {
|
|
326
|
+
this.dispatch(CodeEditorStore, new ActionCodeEditorWorkspaceSearchSet(file.key));
|
|
327
|
+
}
|
|
328
|
+
else {
|
|
329
|
+
this.dispatch(CodeEditorStore, new ActionCodeEditorFileGet(file.projectId, file.key, file.title, file.path, file.type, file.plugin, file.workspaceName));
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
else {
|
|
333
|
+
this.close = false;
|
|
334
|
+
}
|
|
335
|
+
}}
|
|
336
|
+
>
|
|
337
|
+
{this.renderTab(options)}
|
|
338
|
+
</Tabs>
|
|
339
|
+
);
|
|
340
|
+
}
|
|
341
|
+
else {
|
|
342
|
+
return null;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
getOptions(type) {
|
|
347
|
+
return {
|
|
348
|
+
highlightActiveLine: true,
|
|
349
|
+
closeBrackets: true,
|
|
350
|
+
bracketMatching: true,
|
|
351
|
+
drawSelection: true,
|
|
352
|
+
history: true,
|
|
353
|
+
autocompletion: true,
|
|
354
|
+
|
|
355
|
+
tabKeyAction: 'indent',
|
|
356
|
+
tabSize: 2,
|
|
357
|
+
indentType: 'spaces',
|
|
358
|
+
indentUnit: 2,
|
|
359
|
+
|
|
360
|
+
darkMode: true,
|
|
361
|
+
lineNumbers: true,
|
|
362
|
+
highlightActiveLineGutter: true,
|
|
363
|
+
breakpointGutter: false,
|
|
364
|
+
foldGutter: true,
|
|
365
|
+
emptyLine: true,
|
|
366
|
+
linesSearchLines: true,
|
|
367
|
+
|
|
368
|
+
type: type
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
render () {
|
|
373
|
+
const darkMode = this.state.CodeEditorStore.persistentData.darkMode;
|
|
374
|
+
return (
|
|
375
|
+
<div className={this.theme(darkMode, "view")}>
|
|
376
|
+
{this.renderTabs()}
|
|
377
|
+
</div>
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
// Double code /App layer log log-type
|
|
384
|
+
/*MiddleCodeEditorView.csses = [
|
|
385
|
+
'log_engine',
|
|
386
|
+
'log_debug',
|
|
387
|
+
'log_error',
|
|
388
|
+
'log_warning',
|
|
389
|
+
'log_ip',
|
|
390
|
+
'log_gui',
|
|
391
|
+
'log_verify_success',
|
|
392
|
+
'log_verify_failure',
|
|
393
|
+
'log_test_data',
|
|
394
|
+
'log_browser_log',
|
|
395
|
+
'log_browser_err'
|
|
396
|
+
];*/
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
MiddleCodeEditorView.contextType = RouterContext;
|
|
400
|
+
MiddleCodeEditorView.REMOVE_KEY_LENGTH = 'code_editor_tabs-tab-'.length;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
import CodeEditorStore from '../stores/code-editor-store';
|
|
5
|
+
import MiddleCodeEditorToolbar from './middle-code-editor-toolbar';
|
|
6
|
+
import MiddleCodeEditorSidebar from './middle-code-editor-sidebar';
|
|
7
|
+
import MiddleCodeEditorView from './middle-code-editor-view';
|
|
8
|
+
import Route from 'z-abs-complayer-router-client/client/react-component/route';
|
|
9
|
+
import ReactComponentBase from 'z-abs-corelayer-client/client/react-component/react-component-base';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export default class MiddleCodeEditor extends ReactComponentBase {
|
|
14
|
+
constructor(props) {
|
|
15
|
+
super(props);
|
|
16
|
+
this.setTitle(() => {
|
|
17
|
+
return {
|
|
18
|
+
isPath: this.props._uriPath,
|
|
19
|
+
text: this.props._uriPath ? this.props._uriPath : 'Code Editor',
|
|
20
|
+
prefix: 'CE: '
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
if(props.showWorkspace) {
|
|
24
|
+
CodeEditorStore.showWorkspace = true;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
shouldUpdate(nextProps, nextState) {
|
|
29
|
+
return !this.shallowCompare(this.props, nextProps);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
render() {
|
|
33
|
+
return (
|
|
34
|
+
<div className="middle middle_code_editor">
|
|
35
|
+
<Route switch="*" handler={MiddleCodeEditorToolbar} showWorkspace={this.props.showWorkspace}
|
|
36
|
+
onOpen={(appName) => {
|
|
37
|
+
this.setTitle(() => {
|
|
38
|
+
return {
|
|
39
|
+
isPath: this.props._uriPath,
|
|
40
|
+
text: appName,
|
|
41
|
+
prefix: 'CE: '
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
}}/>
|
|
45
|
+
<Route switch="*" handler={MiddleCodeEditorSidebar} />
|
|
46
|
+
<Route switch="*" handler={MiddleCodeEditorView} />
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
|
|
2
|
+
img.middle_code_editor_tab_icon{
|
|
3
|
+
width:16px;
|
|
4
|
+
padding-right:4px;
|
|
5
|
+
padding-bottom:2px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
div.middle_code_editor_sidebar{
|
|
9
|
+
width:360px;
|
|
10
|
+
min-width:180px;
|
|
11
|
+
max-width:720px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
div.middle_code_editor_sidebar_mover {
|
|
15
|
+
position:absolute;
|
|
16
|
+
top:0px;
|
|
17
|
+
bottom:0px;
|
|
18
|
+
width:4px;
|
|
19
|
+
right:0px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
div.middle_code_editor_sidebar_mover:hover {
|
|
23
|
+
cursor:e-resize;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
div.middle_code_editor_view{
|
|
27
|
+
position:absolute;
|
|
28
|
+
overflow:hidden;
|
|
29
|
+
padding: 4px 4px 4px 0px;
|
|
30
|
+
right: 0px;
|
|
31
|
+
bottom: 0px;
|
|
32
|
+
left: 360px;
|
|
33
|
+
top: 36px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
div.editor_markup_name{
|
|
37
|
+
display:inline-block;
|
|
38
|
+
height:30px;
|
|
39
|
+
font-weight:bold;
|
|
40
|
+
margin:0;
|
|
41
|
+
padding:0;
|
|
42
|
+
position:relative;
|
|
43
|
+
top:-8px;
|
|
44
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
div.editor_search{
|
|
3
|
+
overflow:auto;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
span.editor_search_header{
|
|
7
|
+
background-color:LightSkyBlue;
|
|
8
|
+
border-radius:3px;
|
|
9
|
+
color:black;
|
|
10
|
+
border:0.5px black solid;
|
|
11
|
+
padding:0px 2px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
tr.editor_search_header{
|
|
15
|
+
background-color:LightSkyBlue;
|
|
16
|
+
font-family:monospace;
|
|
17
|
+
font-size:12px;
|
|
18
|
+
font-weight:700;
|
|
19
|
+
white-space: nowrap;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
tr.editor_search_file{
|
|
23
|
+
background-color:PaleGreen;
|
|
24
|
+
font-family:monospace;
|
|
25
|
+
font-size:12px;
|
|
26
|
+
font-weight:700;
|
|
27
|
+
white-space: nowrap;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
span.editor_search_found{
|
|
31
|
+
background-color:Yellow;
|
|
32
|
+
font-family:monospace;
|
|
33
|
+
font-size:12px;
|
|
34
|
+
font-weight:700;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
a.editor_search_found{
|
|
38
|
+
color:inherit;
|
|
39
|
+
cursor:pointer;
|
|
40
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
div.sidebar_dark{
|
|
4
|
+
width:360px;
|
|
5
|
+
min-width:180px;
|
|
6
|
+
max-width:720px;
|
|
7
|
+
background-color:Black;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
div.sidebar_mover_dark {
|
|
11
|
+
position:absolute;
|
|
12
|
+
top:0px;
|
|
13
|
+
bottom:0px;
|
|
14
|
+
width:4px;
|
|
15
|
+
right:0px;
|
|
16
|
+
background-color:Black;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
div.sidebar_mover_dark:hover {
|
|
20
|
+
cursor:e-resize;
|
|
21
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
div.sidebar_light{
|
|
3
|
+
width:360px;
|
|
4
|
+
min-width:180px;
|
|
5
|
+
max-width:720px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
div.sidebar_mover_light {
|
|
9
|
+
position:absolute;
|
|
10
|
+
top:0px;
|
|
11
|
+
bottom:0px;
|
|
12
|
+
width:4px;
|
|
13
|
+
right:0px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
div.sidebar_mover_light:hover {
|
|
17
|
+
cursor:e-resize;
|
|
18
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
button.middle_code_editor_close {
|
|
3
|
+
float:right;
|
|
4
|
+
margin-left:8px;
|
|
5
|
+
margin-right:-4px;
|
|
6
|
+
opacity:1.0;
|
|
7
|
+
padding:0;
|
|
8
|
+
cursor:pointer;
|
|
9
|
+
border:0;
|
|
10
|
+
font-size:21px;
|
|
11
|
+
font-weight:bold;
|
|
12
|
+
text-shadow:0 1px 0 #fff;
|
|
13
|
+
line-height:1;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
button.middle_code_editor_close:hover {
|
|
17
|
+
text-decoration:none;
|
|
18
|
+
cursor:pointer;
|
|
19
|
+
}
|