@aj-shadow/z-abs-complayer-documentation-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-Documentation-client.bld +36 -0
- package/project/client/_build/Client-CompLayer-Documentation-client-jsx.bld +10 -0
- package/project/client/_build/Client-CompLayer-Documentation-client.bld +10 -0
- package/project/client/_build/Client-css-CompLayer-Documentation-bundle.bld +9 -0
- package/project/client/_build/z-abs-complayer-documentation-client.prj +36 -0
- package/project/client/actions/action-documentation.js +131 -0
- package/project/client/actions/data-action-documentation.js +78 -0
- package/project/client/calculations/arc.js +32 -0
- package/project/client/css/documentation.css +746 -0
- package/project/client/css/documentation_view.css +23 -0
- package/project/client/react-components/documentation/middle-documentation-navigation.jsx +215 -0
- package/project/client/react-components/documentation/middle-documentation-toolbar.jsx +348 -0
- package/project/client/react-components/documentation/middle-documentation-view.jsx +622 -0
- package/project/client/react-components/documentation/middle-documentation.jsx +86 -0
- package/project/client/stores/documentation-store-base.js +483 -0
- package/project/z-abs-complayer-documentation-client.tree +24 -0
|
@@ -0,0 +1,622 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
import MiddleDocumentationNavigation from './middle-documentation-navigation';
|
|
5
|
+
import { ActionDocumentationCurrentPage, ActionDocumentationGotoPage, ActionDocumentationMarkupNavigationChange, ActionDocumentationMarkupDocumentChange, ActionDocumentationMarkupCancel, ActionDocumentationLocalNoteMarkup, ActionDocumentationLocalNoteMarkupCancel, ActionDocumentationLocalNoteMarkupChange, ActionDocumentationLocalNoteDelete } from '../../actions/action-documentation';
|
|
6
|
+
import ComponentDocument from 'z-abs-complayer-markup-client/client/react-components/markup/component-document';
|
|
7
|
+
import ScrollData from 'z-abs-complayer-markup-client/client/react-components/helper/scroll-data';
|
|
8
|
+
import DataDocumentationNavigation from 'z-abs-complayer-markup-client/client/data/data-documentation/data-documentation-navigation';
|
|
9
|
+
import StyleStore from 'z-abs-complayer-markup-client/client/stores/style-store';
|
|
10
|
+
import ComponentMarkedTextarea from 'z-abs-complayer-bootstrap-client/client/marked-textarea';
|
|
11
|
+
import ButtonNew from 'z-abs-complayer-bootstrap-client/client/button-new';
|
|
12
|
+
import {RouterContext} from 'z-abs-complayer-router-client/client/react-component/router-context';
|
|
13
|
+
import NotFound from 'z-abs-corelayer-client/client/components/not-found';
|
|
14
|
+
import ReactComponentStore from 'z-abs-corelayer-client/client/react-component/react-component-store';
|
|
15
|
+
import React from 'react';
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
export default class MiddleDocumentationView extends ReactComponentStore {
|
|
19
|
+
constructor(props) {
|
|
20
|
+
super(props, [props.documentationStore, StyleStore], {
|
|
21
|
+
autoScroll: true,
|
|
22
|
+
breaks: false,
|
|
23
|
+
whiteSpaceClass: 'no_word_wrap'
|
|
24
|
+
});
|
|
25
|
+
this.boundKeyDown = this._keyDown.bind(this);
|
|
26
|
+
this.boundKeyUp = this._keyUp.bind(this);
|
|
27
|
+
this.ctrlKey = false;
|
|
28
|
+
this.refDocumentDiv = React.createRef();
|
|
29
|
+
this.refDocumentComponentDocument = React.createRef();
|
|
30
|
+
this.refPreviewDiv = React.createRef();
|
|
31
|
+
this.refPreviewComponentDocument = React.createRef();
|
|
32
|
+
this.refMarkupComponentMarkedTextarea = React.createRef();
|
|
33
|
+
this.scrollData = new ScrollData();
|
|
34
|
+
this.documentationStoreName = props.documentationStore.constructor.name;
|
|
35
|
+
this.scrollGuard = false;
|
|
36
|
+
this.topGuard = false;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
_documentationStore(state) {
|
|
40
|
+
return state[this.documentationStoreName];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
didMount() {
|
|
44
|
+
window.addEventListener('keydown', this.boundKeyDown, true);
|
|
45
|
+
window.addEventListener('keyup', this.boundKeyUp, true);
|
|
46
|
+
this.dispatch(this.props.documentationStore, new ActionDocumentationCurrentPage(this._getDocumentName(this.props._uriPath)));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
shouldUpdate(nextProps, nextState) {
|
|
50
|
+
return !this.shallowCompare(this.props, nextProps)
|
|
51
|
+
|| !this.shallowCompare(this._documentationStore(this.state), this._documentationStore(nextState))
|
|
52
|
+
|| !this.shallowCompare(this.state.autoScroll, nextState.autoScroll)
|
|
53
|
+
|| !this.shallowCompare(this.state.breaks, nextState.breaks)
|
|
54
|
+
|| !this.shallowCompare(this.state.whiteSpaceClass, nextState.whiteSpaceClass)
|
|
55
|
+
|| !this.shallowCompare(this.state.StyleStore.stackStyles, nextState.StyleStore.stackStyles);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
snapshotBeforeUpdate(prevProps, prevState) {
|
|
59
|
+
if(!this._documentationStore(prevState).markup.definition) {
|
|
60
|
+
if(null !== this.refDocumentComponentDocument.current) {
|
|
61
|
+
this.refDocumentComponentDocument.current.calculateTop(this.scrollData);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
if(null !== this.refPreviewComponentDocument.current) {
|
|
66
|
+
this.refPreviewComponentDocument.current.calculateTop(this.scrollData);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
didUpdate(prevProps, prevState) {
|
|
73
|
+
if(this._documentationStore(this.state).markup.definition) {
|
|
74
|
+
if(!this._documentationStore(prevState).markup.definition || this.props.documentationOrder !== prevProps.documentationOrder) {
|
|
75
|
+
const lines = this._documentationStore(this.state).markup.document.contentLines;
|
|
76
|
+
const lineHeight = this.refMarkupComponentMarkedTextarea.current.refTextArea.current.scrollHeight / lines;
|
|
77
|
+
const visibleLines = this.refMarkupComponentMarkedTextarea.current.refTextArea.current.clientHeight / lineHeight;
|
|
78
|
+
this.scrollData.setLength(Math.floor(lines - visibleLines));
|
|
79
|
+
this.refPreviewComponentDocument.current.scroll(this.scrollData);
|
|
80
|
+
this.refMarkupComponentMarkedTextarea.current.scroll(this.scrollData);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
const lineDelta = this._documentationStore(this.state).markup.document.contentLines - this._documentationStore(prevState).markup.document.contentLines;
|
|
84
|
+
if(0 !== lineDelta) {
|
|
85
|
+
this.scrollData.stepLines(lineDelta);
|
|
86
|
+
this.refPreviewComponentDocument.current.scroll(this.scrollData);
|
|
87
|
+
this.refMarkupComponentMarkedTextarea.current.scroll(this.scrollData);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
if(this._documentationStore(prevState).markup.definition) {
|
|
93
|
+
if(null !== this.refDocumentComponentDocument.current) {
|
|
94
|
+
this.refDocumentComponentDocument.current.scroll(this.scrollData);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
if(this.props.location.hash) {
|
|
99
|
+
const hash = document.getElementById(this.props.location.hash.substring(1));
|
|
100
|
+
if(null !== hash) {
|
|
101
|
+
this.scrollGuard = true;
|
|
102
|
+
hash.scrollIntoView();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
if(!this.topGuard) {
|
|
107
|
+
const hashTop = document.getElementById('topOfPage');
|
|
108
|
+
if(null !== hashTop) {
|
|
109
|
+
this.scrollGuard = true;
|
|
110
|
+
hashTop.scrollIntoView();
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
this.topGuard = false;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if(!this.shallowCompare(this.props._uriPath, prevProps._uriPath)) {
|
|
120
|
+
const documentName = this._getDocumentName(this.props._uriPath)
|
|
121
|
+
if(this._documentationStore(this.state).currentDocumentName !== documentName) {
|
|
122
|
+
this.dispatch(this.props.documentationStore, new ActionDocumentationCurrentPage(documentName));
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
willUnmount() {
|
|
128
|
+
window.removeEventListener('keyup', this.boundKeyUp, true);
|
|
129
|
+
window.removeEventListener('keydown', this.boundKeyDown, true);
|
|
130
|
+
if(this._documentationStore(this.state).markup.definition) {
|
|
131
|
+
this.dispatch(this.props.documentationStore, new ActionDocumentationMarkupCancel());
|
|
132
|
+
}
|
|
133
|
+
if(this._documentationStore(this.state).localNoteMarkup.definition) {
|
|
134
|
+
this.dispatch(this.props.documentationStore, new ActionDocumentationLocalNoteMarkupCancel());
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
_keyDown(e) {
|
|
139
|
+
if(e.ctrlKey) {
|
|
140
|
+
this.ctrlKey = true;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
_keyUp(e) {
|
|
145
|
+
if(!e.ctrlKey) {
|
|
146
|
+
this.ctrlKey = false;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
_calculateColumnClass() {
|
|
151
|
+
let columns = 0;
|
|
152
|
+
this.props.showNavigationMarkup && ++columns;
|
|
153
|
+
this.props.showNavigationPreview && ++columns;
|
|
154
|
+
this.props.showDocumentationMarkup && ++columns;
|
|
155
|
+
this.props.showDocumentationPreview && ++columns;
|
|
156
|
+
if(!this.props.showNavigationPreview) {
|
|
157
|
+
return `markup_filter_${this.props.documentationOrder ? 'horizontal' : 'vertical'}_${columns}`;
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
return `markup_filter_${this.props.documentationOrder ? 'horizontal_with' : 'vertical'}_${columns}`;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
renderNavigationMarkup() {
|
|
165
|
+
return (
|
|
166
|
+
<div className={this.props.showNavigationMarkup ? this._calculateColumnClass() : 'markup_filter_0'}>
|
|
167
|
+
<div className="test_cases_group">
|
|
168
|
+
<div className="markup_heading">
|
|
169
|
+
<h5 className="markup_heading">Markup - Navigation</h5>
|
|
170
|
+
</div>
|
|
171
|
+
<ComponentMarkedTextarea id="documentation_navigation_markup_textarea" className={this.state.whiteSpaceClass + ' form-control test_case_definition doc_same_size_as_parent'} rows="10" value={this._documentationStore(this.state).markup.navigation.content} results={this._documentationStore(this.state).markup.navigation.rows}
|
|
172
|
+
onChange={(value) => {
|
|
173
|
+
this.dispatch(this.props.documentationStore, new ActionDocumentationMarkupNavigationChange(value));
|
|
174
|
+
}}
|
|
175
|
+
/>
|
|
176
|
+
</div>
|
|
177
|
+
</div>
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
renderNavigationPreview() {
|
|
182
|
+
return (
|
|
183
|
+
<div className={this.props.showNavigationPreview ? `${this.props.documentationOrder ? 'markup_filter_horizontal_with_1' : this._calculateColumnClass()}` : 'markup_filter_0'}>
|
|
184
|
+
<div className="markup_heading">
|
|
185
|
+
<h5 className="markup_heading">Navigation - Preview</h5>
|
|
186
|
+
</div>
|
|
187
|
+
<div className="doc_nav_navigation_preview">
|
|
188
|
+
<MiddleDocumentationNavigation documentationStore={this.props.documentationStore} preview />
|
|
189
|
+
</div>
|
|
190
|
+
</div>
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
renderDocumentMarkupScrollFirstLine() {
|
|
195
|
+
const disabled = !this.state.autoScroll;
|
|
196
|
+
return (
|
|
197
|
+
<ButtonNew id="markup_documentation_first_line" colorMark="markup_color" icon="icon-line-first" size="aj_btn_xs" type="transparent" placement="bottom" heading="Goto" content="First line" disabled={disabled} sticky
|
|
198
|
+
onClick={(e) => {
|
|
199
|
+
this.scrollData.setLineFirst();
|
|
200
|
+
this.refPreviewComponentDocument.current.scroll(this.scrollData);
|
|
201
|
+
this.refMarkupComponentMarkedTextarea.current.scroll(this.scrollData);
|
|
202
|
+
}}
|
|
203
|
+
/>
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
renderDocumentMarkupScrollPreviousBlock() {
|
|
208
|
+
const disabled = !this.state.autoScroll;
|
|
209
|
+
return (
|
|
210
|
+
<ButtonNew id="markup_documentation_previous_block" colorMark="markup_color" icon="icon-line-previous-block" size="aj_btn_xs" type="transparent" placement="bottom" heading="Goto" content="Previous block" disabled={disabled} sticky
|
|
211
|
+
onClick={(e) => {
|
|
212
|
+
this.refPreviewComponentDocument.current.calculateObject(this.scrollData, 'previous_block');
|
|
213
|
+
this.refPreviewComponentDocument.current.scroll(this.scrollData);
|
|
214
|
+
this.refMarkupComponentMarkedTextarea.current.scroll(this.scrollData);
|
|
215
|
+
}}
|
|
216
|
+
/>
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
renderDocumentMarkupScrollPreviousLine() {
|
|
221
|
+
const disabled = !this.state.autoScroll;
|
|
222
|
+
return (
|
|
223
|
+
<ButtonNew id="markup_documentation_previous_line" colorMark="markup_color" icon="icon-line-previous-line" size="aj_btn_xs" type="transparent" placement="bottom" heading="Goto" content="Previous line" disabled={disabled} sticky
|
|
224
|
+
onClick={(e) => {
|
|
225
|
+
this.scrollData.decrement();
|
|
226
|
+
this.refPreviewComponentDocument.current.scroll(this.scrollData);
|
|
227
|
+
this.refMarkupComponentMarkedTextarea.current.scroll(this.scrollData);
|
|
228
|
+
}}
|
|
229
|
+
/>
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
renderDocumentMarkupScrollNextLine() {
|
|
234
|
+
const disabled = !this.state.autoScroll;
|
|
235
|
+
return (
|
|
236
|
+
<ButtonNew id="markup_documentation_next_line" colorMark="markup_color" icon="icon-line-next-line" size="aj_btn_xs" type="transparent" placement="bottom" heading="Goto" content="Next line" disabled={disabled} sticky
|
|
237
|
+
onClick={(e) => {
|
|
238
|
+
this.scrollData.increment();
|
|
239
|
+
this.refPreviewComponentDocument.current.scroll(this.scrollData);
|
|
240
|
+
this.refMarkupComponentMarkedTextarea.current.scroll(this.scrollData);
|
|
241
|
+
}}
|
|
242
|
+
/>
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
renderDocumentMarkupScrollNextBlock() {
|
|
247
|
+
const disabled = !this.state.autoScroll;
|
|
248
|
+
return (
|
|
249
|
+
<ButtonNew id="markup_documentation_next_block" colorMark="markup_color" icon="icon-line-next-block" size="aj_btn_xs" type="transparent" placement="bottom" heading="Goto" content="Next block" disabled={disabled} sticky
|
|
250
|
+
onClick={(e) => {
|
|
251
|
+
this.refPreviewComponentDocument.current.calculateObject(this.scrollData, 'next_block');
|
|
252
|
+
this.refPreviewComponentDocument.current.scroll(this.scrollData);
|
|
253
|
+
this.refMarkupComponentMarkedTextarea.current.scroll(this.scrollData);
|
|
254
|
+
}}
|
|
255
|
+
/>
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
renderDocumentMarkupScrollEndLine() {
|
|
260
|
+
const disabled = !this.state.autoScroll;
|
|
261
|
+
return (
|
|
262
|
+
<ButtonNew id="markup_documentation_last_line" colorMark="markup_color" icon="icon-line-last" size="aj_btn_xs" type="transparent" placement="bottom" heading="Goto" content="End line" disabled={disabled} sticky
|
|
263
|
+
onClick={(e) => {
|
|
264
|
+
this.scrollData.setLineLast();
|
|
265
|
+
this.refPreviewComponentDocument.current.scroll(this.scrollData);
|
|
266
|
+
this.refMarkupComponentMarkedTextarea.current.scroll(this.scrollData);
|
|
267
|
+
}}
|
|
268
|
+
/>
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
renderDocumentMarkup() {
|
|
273
|
+
return (
|
|
274
|
+
<div className={this.props.showDocumentationMarkup ? this._calculateColumnClass() : 'markup_filter_0'}>
|
|
275
|
+
<div className="markup_heading">
|
|
276
|
+
<h5 className="markup_heading">Markup - Document</h5>
|
|
277
|
+
<p className="markup_checkbox">
|
|
278
|
+
auto-scroll:
|
|
279
|
+
</p>
|
|
280
|
+
<input id="checkbox_input_markup_auto_scroll" name="checkbox_input_markup_auto_scroll" className="markup_checkbox" type="checkbox" aria-label="..." autoComplete="off" checked={this.state.autoScroll}
|
|
281
|
+
onChange={(e) => {
|
|
282
|
+
if(this.state.autoScroll) {
|
|
283
|
+
this.updateState({
|
|
284
|
+
autoScroll: {$set: false}
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
this.updateState({
|
|
289
|
+
autoScroll: {$set: true}
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
}}
|
|
293
|
+
/>
|
|
294
|
+
<p className="markup_checkbox">
|
|
295
|
+
breaks:
|
|
296
|
+
</p>
|
|
297
|
+
<input id="checkbox_input_markup_breaks" className="markup_checkbox" type="checkbox" aria-label="..." autoComplete="off" checked={this.state.breaks}
|
|
298
|
+
onChange={(e) => {
|
|
299
|
+
if(this.state.breaks) {
|
|
300
|
+
this.updateState({
|
|
301
|
+
breaks: {$set: false},
|
|
302
|
+
whiteSpaceClass: {$set: 'no_word_wrap'}
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
else {
|
|
306
|
+
this.updateState({
|
|
307
|
+
breaks: {$set: true},
|
|
308
|
+
whiteSpaceClass: {$set: 'word_wrap'}
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
}}
|
|
312
|
+
/>
|
|
313
|
+
<div className="aj_btn_group" role="group" aria-label="...">
|
|
314
|
+
{this.renderDocumentMarkupScrollFirstLine()}
|
|
315
|
+
{this.renderDocumentMarkupScrollPreviousBlock()}
|
|
316
|
+
{this.renderDocumentMarkupScrollPreviousLine()}
|
|
317
|
+
{this.renderDocumentMarkupScrollNextLine()}
|
|
318
|
+
{this.renderDocumentMarkupScrollNextBlock()}
|
|
319
|
+
{this.renderDocumentMarkupScrollEndLine()}
|
|
320
|
+
</div>
|
|
321
|
+
</div>
|
|
322
|
+
<ComponentMarkedTextarea id="documentation_navigation_marked_textarea" ref={this.refMarkupComponentMarkedTextarea} className={this.state.whiteSpaceClass + " form-control test_case_definition doc_same_size_as_parent"} value={this._documentationStore(this.state).markup.document.content}
|
|
323
|
+
onScroll={(e) => {
|
|
324
|
+
const lines = this._documentationStore(this.state).markup.document.contentLines;
|
|
325
|
+
const scrollLines = (e.target.scrollHeight - e.target.clientHeight) / e.target.scrollHeight * lines;
|
|
326
|
+
const scrollLine = e.target.scrollTop / (e.target.scrollHeight - e.target.clientHeight) * scrollLines;
|
|
327
|
+
const line = Math.floor(scrollLine);
|
|
328
|
+
this.scrollData.setLine(line, scrollLine - line);
|
|
329
|
+
if(this.state.autoScroll) {
|
|
330
|
+
this.refPreviewComponentDocument.current.scroll(this.scrollData);
|
|
331
|
+
}
|
|
332
|
+
}}
|
|
333
|
+
onChange={(value, rows) => {
|
|
334
|
+
this.dispatch(this.props.documentationStore, new ActionDocumentationMarkupDocumentChange(value));
|
|
335
|
+
}}
|
|
336
|
+
/>
|
|
337
|
+
|
|
338
|
+
</div>
|
|
339
|
+
);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
renderDocumentationPreview() {
|
|
343
|
+
const storeState = this._documentationStore(this.state).documentationPreview;
|
|
344
|
+
return (
|
|
345
|
+
<div className={this.props.showDocumentationPreview ? this._calculateColumnClass() : 'markup_filter_0'}>
|
|
346
|
+
<div className="markup_heading">
|
|
347
|
+
<h5 className="markup_heading">Preview - Document</h5>
|
|
348
|
+
</div>
|
|
349
|
+
<div ref={this.refPreviewDiv} className="doc_nav_preview_outer"
|
|
350
|
+
onScroll={(e) => {
|
|
351
|
+
this.scrollData.setScroll(e.target.scrollTop);
|
|
352
|
+
}}
|
|
353
|
+
>
|
|
354
|
+
<div className="doc_nav_preview_middle">
|
|
355
|
+
<div className="doc_nav_preview_inner"
|
|
356
|
+
onMouseUp={(e) => {
|
|
357
|
+
if(this.ctrlKey) {
|
|
358
|
+
this.scrollData.setScroll(e.target.offsetTop);
|
|
359
|
+
this.refPreviewComponentDocument.current.calculateTop(this.scrollData);
|
|
360
|
+
this.refPreviewComponentDocument.current.scroll( this.scrollData);
|
|
361
|
+
this.refMarkupComponentMarkedTextarea.current.scroll(this.scrollData);
|
|
362
|
+
}
|
|
363
|
+
}}
|
|
364
|
+
>
|
|
365
|
+
<ComponentDocument noediting={this.props.noediting} ref={this.refPreviewComponentDocument} preview document={storeState.document} embededDocuments={storeState.embededDocuments} localNotes={storeState.localNotes} linkReferences={this._documentationStore(this.state).linkReferences}
|
|
366
|
+
onEditorScroll={(top) => {
|
|
367
|
+
this.refPreviewDiv.current.scrollTop = top;
|
|
368
|
+
}}
|
|
369
|
+
/>
|
|
370
|
+
</div>
|
|
371
|
+
</div>
|
|
372
|
+
</div>
|
|
373
|
+
</div>
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
renderLocalNoteMarkup() {
|
|
378
|
+
return (
|
|
379
|
+
<div className={`markup_filter_${this.props.documentationOrder ? 'horizontal' : 'vertical'}_2`}>
|
|
380
|
+
<div className="form-group test_case_form_group">
|
|
381
|
+
<div className="markup_heading">
|
|
382
|
+
<label id="label_markup_lokal_note_breaks"htmlFor="comment">Markup - Local Note</label>
|
|
383
|
+
<p className="markup_checkbox">
|
|
384
|
+
breaks:
|
|
385
|
+
</p>
|
|
386
|
+
<input id="checkbox_input_markup_lokal_note_breaks" className="markup_checkbox" type="checkbox" aria-label="..." autoComplete="off" checked={this.state.breaks}
|
|
387
|
+
onChange={(e) => {
|
|
388
|
+
if(this.state.breaks) {
|
|
389
|
+
this.updateState({
|
|
390
|
+
breaks: {$set: false},
|
|
391
|
+
whiteSpaceClass: {$set: 'no_word_wrap'}
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
else {
|
|
395
|
+
this.updateState({
|
|
396
|
+
breaks: {$set: true},
|
|
397
|
+
whiteSpaceClass: {$set: 'word_wrap'}
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
}}
|
|
401
|
+
/>
|
|
402
|
+
</div>
|
|
403
|
+
<ComponentMarkedTextarea id="documentation_navigation_local_note_markup_textarea" className={this.state.whiteSpaceClass + ' form-control test_case_definition doc_same_size_as_parent'} rows="10" value={this._documentationStore(this.state).localNoteMarkup.document.content}
|
|
404
|
+
onChange={(value) => {
|
|
405
|
+
this.dispatch(this.props.documentationStore, new ActionDocumentationLocalNoteMarkupChange(value));
|
|
406
|
+
}}
|
|
407
|
+
/>
|
|
408
|
+
</div>
|
|
409
|
+
</div>
|
|
410
|
+
);
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
renderLocalNotePreview() {
|
|
414
|
+
const storeState = this._documentationStore(this.state).localNotePreview;
|
|
415
|
+
return (
|
|
416
|
+
<div className={`markup_filter_${this.props.documentationOrder ? 'horizontal' : 'vertical'}_2`}>
|
|
417
|
+
<div className="markup_heading">
|
|
418
|
+
<label htmlFor="comment">Preview - Local Note</label>
|
|
419
|
+
</div>
|
|
420
|
+
<div className="doc_nav_preview_outer doc_nav_preview_local_note"
|
|
421
|
+
onScroll={(e) => {
|
|
422
|
+
//this.scrollData.setScroll(e.target.scrollTop);
|
|
423
|
+
}}
|
|
424
|
+
>
|
|
425
|
+
<div className="doc_nav_preview_middle">
|
|
426
|
+
<div className="doc_nav_preview_inner"
|
|
427
|
+
onMouseUp={(e) => {
|
|
428
|
+
/*if(this.ctrlKey) {
|
|
429
|
+
this.scrollData.setScroll(e.target.offsetTop);
|
|
430
|
+
this.refPreviewComponentDocument.current.calculateTop(this.scrollData);
|
|
431
|
+
this.refPreviewComponentDocument.current.scroll( this.scrollData);
|
|
432
|
+
this.refMarkupComponentMarkedTextarea.current.scroll(this.scrollData);
|
|
433
|
+
}*/
|
|
434
|
+
}}
|
|
435
|
+
>
|
|
436
|
+
<ComponentDocument noediting={this.props.noediting} preview document={storeState.document} linkReferences={this._documentationStore(this.state).linkReferences}
|
|
437
|
+
onEditorScroll={(top) => {
|
|
438
|
+
// this.refPreviewDiv.current.scrollTop = top;
|
|
439
|
+
}}
|
|
440
|
+
/>
|
|
441
|
+
</div>
|
|
442
|
+
</div>
|
|
443
|
+
</div>
|
|
444
|
+
</div>
|
|
445
|
+
);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
renderDocument() {
|
|
449
|
+
if(undefined === this._documentationStore(this.state).currentDocumentName) {
|
|
450
|
+
return null;
|
|
451
|
+
}
|
|
452
|
+
const storeState = this._documentationStore(this.state).documentation;
|
|
453
|
+
if(!this.props.noediting || (this.props.noediting && storeState.documentCreated)) {
|
|
454
|
+
return (
|
|
455
|
+
<>
|
|
456
|
+
<div id="topOfPage" />
|
|
457
|
+
<ComponentDocument noediting={this.props.noediting} ref={this.refDocumentComponentDocument} document={storeState.document} embededDocuments={storeState.embededDocuments} localNotes={storeState.localNotes} linkReferences={this._documentationStore(this.state).linkReferences}
|
|
458
|
+
onAddNote={(guid) => {
|
|
459
|
+
this.dispatch(this.props.documentationStore, new ActionDocumentationLocalNoteMarkup(guid));
|
|
460
|
+
}}
|
|
461
|
+
onEditNote={(guid) => {
|
|
462
|
+
this.dispatch(this.props.documentationStore, new ActionDocumentationLocalNoteMarkup(guid));
|
|
463
|
+
}}
|
|
464
|
+
onDeleteNote={(guid) => {
|
|
465
|
+
this.dispatch(this.props.documentationStore, new ActionDocumentationLocalNoteDelete(guid));
|
|
466
|
+
}}
|
|
467
|
+
onEditorScroll={(top) => {
|
|
468
|
+
this.refDocumentDiv.current.scrollTop = top;
|
|
469
|
+
}}
|
|
470
|
+
/>
|
|
471
|
+
<div id="bottomOfPage" />
|
|
472
|
+
</>
|
|
473
|
+
);
|
|
474
|
+
}
|
|
475
|
+
else {
|
|
476
|
+
return (
|
|
477
|
+
<NotFound />
|
|
478
|
+
);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
renderFirstDocument() {
|
|
483
|
+
const disabled = false;
|
|
484
|
+
return (
|
|
485
|
+
<ButtonNew id="documentation_first_document" colorMark="markup_color" icon="icon-line-first" size="aj_btn_xs" className="documentation_first_document" type="transparent" placement="bottom" heading="Goto" content="First Document" disabled={disabled} sticky
|
|
486
|
+
onClick={(e) => {
|
|
487
|
+
this.dispatch(this.props.documentationStore, new ActionDocumentationGotoPage('first'));
|
|
488
|
+
}}
|
|
489
|
+
/>
|
|
490
|
+
);
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
renderPreviousDocument() {
|
|
494
|
+
const disabled = false;
|
|
495
|
+
return (
|
|
496
|
+
<ButtonNew id="documentation_previous_document" colorMark="markup_color" icon="icon-line-previous-line" size="aj_btn_xs" className="documentation_previous_document" type="transparent" placement="bottom" heading="Goto" content="Previous Document" disabled={disabled} sticky
|
|
497
|
+
onClick={(e) => {
|
|
498
|
+
this.dispatch(this.props.documentationStore, new ActionDocumentationGotoPage('previous'));
|
|
499
|
+
}}
|
|
500
|
+
/>
|
|
501
|
+
);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
renderPreviousSection() {
|
|
505
|
+
const disabled = false;
|
|
506
|
+
return (
|
|
507
|
+
<ButtonNew id="documentation_next_document" colorMark="markup_color" icon="icon-line-previous-block" size="aj_btn_xs" className="documentation_previous_document" type="transparent" placement="bottom" heading="Goto" content="Previous Section Document" disabled={disabled} sticky
|
|
508
|
+
onClick={(e) => {
|
|
509
|
+
this.dispatch(this.props.documentationStore, new ActionDocumentationGotoPage('previous-section'));
|
|
510
|
+
}}
|
|
511
|
+
/>
|
|
512
|
+
);
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
renderNextDocument() {
|
|
516
|
+
const disabled = false;
|
|
517
|
+
return (
|
|
518
|
+
<ButtonNew id="documentation_next_document" colorMark="markup_color" icon="icon-line-next-line" size="aj_btn_xs" className="documentation_next_document" type="transparent" placement="bottom" heading="Goto" content="Next Document" disabled={disabled} sticky
|
|
519
|
+
onClick={(e) => {
|
|
520
|
+
this.dispatch(this.props.documentationStore, new ActionDocumentationGotoPage('next'));
|
|
521
|
+
}}
|
|
522
|
+
/>
|
|
523
|
+
);
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
renderNextSection() {
|
|
527
|
+
const disabled = false;
|
|
528
|
+
return (
|
|
529
|
+
<ButtonNew id="documentation_next_section_document" colorMark="markup_color" icon="icon-line-next-block" size="aj_btn_xs" className="documentation_next_document" type="transparent" placement="bottom" heading="Goto" content="Next Section Document" disabled={disabled} sticky
|
|
530
|
+
onClick={(e) => {
|
|
531
|
+
this.dispatch(this.props.documentationStore, new ActionDocumentationGotoPage('next-section'));
|
|
532
|
+
}}
|
|
533
|
+
/>
|
|
534
|
+
);
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
renderLastDocument() {
|
|
538
|
+
const disabled = false;
|
|
539
|
+
return (
|
|
540
|
+
<ButtonNew id="documentation_last_document" colorMark="markup_color" icon="icon-line-last" size="aj_btn_xs" className="documentation_last_document" type="transparent" placement="bottom" heading="Goto" content="Last Document" disabled={disabled} sticky
|
|
541
|
+
onClick={(e) => {
|
|
542
|
+
this.dispatch(this.props.documentationStore, new ActionDocumentationGotoPage('last'));
|
|
543
|
+
}}
|
|
544
|
+
/>
|
|
545
|
+
);
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
render() {
|
|
549
|
+
const className = `${this.props.className ? ' ' + this.props.className : ''}`;
|
|
550
|
+
const documentationStore = this._documentationStore(this.state);
|
|
551
|
+
if(documentationStore.markup.definition) {
|
|
552
|
+
return (
|
|
553
|
+
<div className={className}>
|
|
554
|
+
<div className="documentation_tab_view">
|
|
555
|
+
{this.renderDocumentMarkup()}
|
|
556
|
+
{this.renderDocumentationPreview()}
|
|
557
|
+
{this.renderNavigationMarkup()}
|
|
558
|
+
{this.renderNavigationPreview()}
|
|
559
|
+
</div>
|
|
560
|
+
</div>
|
|
561
|
+
);
|
|
562
|
+
}
|
|
563
|
+
else if(documentationStore.localNoteMarkup.definition) {
|
|
564
|
+
return (
|
|
565
|
+
<div className={className}>
|
|
566
|
+
<div className="documentation_tab_view">
|
|
567
|
+
{this.renderLocalNoteMarkup()}
|
|
568
|
+
{this.renderLocalNotePreview()}
|
|
569
|
+
</div>
|
|
570
|
+
</div>
|
|
571
|
+
);
|
|
572
|
+
}
|
|
573
|
+
else {
|
|
574
|
+
return (
|
|
575
|
+
<div className={className}>
|
|
576
|
+
<div className="middle_documentation_start_view doc_same_size_as_parent">
|
|
577
|
+
<div className="container-fluid">
|
|
578
|
+
<div className="row">
|
|
579
|
+
<div ref={this.refDocumentDiv} className="col-xs-10 middle_view_documentaion_doc"
|
|
580
|
+
onScroll={(e) => {
|
|
581
|
+
this.scrollData.setScroll(e.target.scrollTop,e.target.scrollTop);
|
|
582
|
+
if(this.scrollGuard) {
|
|
583
|
+
this.scrollGuard = false;
|
|
584
|
+
}
|
|
585
|
+
}}>
|
|
586
|
+
<div className="col-xs-1 documentation_left" style={{position:'sticky',top:'2px'}}>
|
|
587
|
+
<div className="aj_btn_group" role="group" aria-label="...">
|
|
588
|
+
{this.renderFirstDocument()}
|
|
589
|
+
{this.renderPreviousSection()}
|
|
590
|
+
{this.renderPreviousDocument()}
|
|
591
|
+
</div>
|
|
592
|
+
</div>
|
|
593
|
+
<div className="col-xs-10">
|
|
594
|
+
{this.renderDocument()}
|
|
595
|
+
</div>
|
|
596
|
+
<div className="col-xs-1 documentation_right" style={{position:'sticky',top:'2px',right:'4px'}}>
|
|
597
|
+
<div className="aj_btn_group" role="group" aria-label="..." style={{float: 'right'}}>
|
|
598
|
+
{this.renderNextDocument()}
|
|
599
|
+
{this.renderNextSection()}
|
|
600
|
+
{this.renderLastDocument()}
|
|
601
|
+
</div>
|
|
602
|
+
</div>
|
|
603
|
+
</div>
|
|
604
|
+
<MiddleDocumentationNavigation documentationStore={this.props.documentationStore} titleText={this.props.titleText} _uriPath={this.props._uriPath} />
|
|
605
|
+
</div>
|
|
606
|
+
</div>
|
|
607
|
+
</div>
|
|
608
|
+
</div>
|
|
609
|
+
);
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
_getDocumentName(path) {
|
|
614
|
+
if(path.startsWith('/')) {
|
|
615
|
+
path = path.substring(1);
|
|
616
|
+
}
|
|
617
|
+
return path.length !== 0 ? path : null;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
|
|
622
|
+
MiddleDocumentationView.contextType = RouterContext;
|