@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,23 @@
|
|
|
1
|
+
|
|
2
|
+
.documentation_view_middle{
|
|
3
|
+
// position:relative;
|
|
4
|
+
height:100%;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.documentation_view_middle_view{
|
|
8
|
+
position:absolute;
|
|
9
|
+
overflow:hidden;
|
|
10
|
+
padding:4px 4px 4px 0px;
|
|
11
|
+
right:0px;
|
|
12
|
+
bottom:0px;
|
|
13
|
+
left:0px;
|
|
14
|
+
top:0px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.documentation_view_middle_view_with_sidebar{
|
|
18
|
+
left:218px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.documentation_view_middle_view_with_toolbar{
|
|
22
|
+
top:36px;
|
|
23
|
+
}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
import { ActionDocumentationCurrentNavigation } from '../../actions/action-documentation';
|
|
5
|
+
import Link from 'z-abs-complayer-router-client/client/react-component/link';
|
|
6
|
+
import ReactComponentStore from 'z-abs-corelayer-client/client/react-component/react-component-store';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export default class MiddleDocumentationNavigation extends ReactComponentStore {
|
|
11
|
+
constructor(props) {
|
|
12
|
+
super(props, [props.documentationStore]);
|
|
13
|
+
this.documentationStoreName = props.documentationStore.constructor.name;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
_documentationStore(state) {
|
|
17
|
+
return state[this.documentationStoreName];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
shouldUpdate(nextProps, nextState) {
|
|
21
|
+
return !this.shallowCompare(this.props.titleText, nextProps.titleText)
|
|
22
|
+
|| !this.shallowCompare(this.props._uriPath, nextProps._uriPath)
|
|
23
|
+
|| !this.deepCompare(this._documentationStore(this.state).documentation.navigations, this._documentationStore(nextState).documentation.navigations)
|
|
24
|
+
|| !this.deepCompare(this._documentationStore(this.state).documentationPreview.navigations, this._documentationStore(nextState).documentationPreview.navigations)
|
|
25
|
+
|| !this.shallowCompare(this._documentationStore(this.state).current, this._documentationStore(nextState).current);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
renderLinkInner(name, link) {
|
|
29
|
+
if(!this.props.preview) {
|
|
30
|
+
const match = name.match(/^\[\[stack\-[a-z-]+\]\]/);
|
|
31
|
+
if(null !== match) {
|
|
32
|
+
link = name;
|
|
33
|
+
const oldName = name;
|
|
34
|
+
name = oldName.substring('[[stack-'.length, match[0].length - 2) + oldName.substring(match[0].length);
|
|
35
|
+
}
|
|
36
|
+
return (
|
|
37
|
+
<Link data-name={name} href={`/${link}`}>
|
|
38
|
+
{name}
|
|
39
|
+
</Link>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
return (
|
|
44
|
+
<a className="doc_nav_preview">
|
|
45
|
+
{name}
|
|
46
|
+
</a>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
renderLink(name, link, location, index) {
|
|
52
|
+
const className = location === link ? "doc_nav_inner_chosen" : "doc_nav_inner";
|
|
53
|
+
return (
|
|
54
|
+
<li className={className} key={index}>
|
|
55
|
+
<span className={className}></span>
|
|
56
|
+
{this.renderLinkInner(name, link)}
|
|
57
|
+
</li>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
renderPathInner(node, open, innerPaths) {
|
|
62
|
+
const classNameUlInner = open ? "doc_nav_inner_heading_open" : "doc_nav_inner_heading_closed";
|
|
63
|
+
return (
|
|
64
|
+
<>
|
|
65
|
+
<p data-name={node.name} className="doc_nav_inner_heading"
|
|
66
|
+
onClickCapture={(e) => {
|
|
67
|
+
e.stopPropagation();
|
|
68
|
+
e.preventDefault();
|
|
69
|
+
this.dispatch(this.props.documentationStore, new ActionDocumentationCurrentNavigation(this._documentationStore(this.state).current.navigationIndex, open ? node.parentPath : node.path, node.link));
|
|
70
|
+
}}
|
|
71
|
+
>{node.name}</p>
|
|
72
|
+
<svg className={classNameUlInner} width="11" height="11" viewBox="0 0 11 11"
|
|
73
|
+
onClickCapture={(e) => {
|
|
74
|
+
e.stopPropagation();
|
|
75
|
+
e.preventDefault();
|
|
76
|
+
this.dispatch(this.props.documentationStore, new ActionDocumentationCurrentNavigation(this._documentationStore(this.state).current.navigationIndex, open ? node.parentPath : node.path, node.link));
|
|
77
|
+
}}
|
|
78
|
+
>
|
|
79
|
+
<polygon points="2,2 2,10 10,6"/>
|
|
80
|
+
</svg>
|
|
81
|
+
{innerPaths}
|
|
82
|
+
</>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
renderPath(node, location, index) {
|
|
87
|
+
const open = this._documentationStore(this.state).current.navigationPath.startsWith(node.path);
|
|
88
|
+
const classNameUlInner = open ? "doc_nav_inner_heading_open" : "doc_nav_inner_heading_closed";
|
|
89
|
+
let innerPaths = null;
|
|
90
|
+
if(open) {
|
|
91
|
+
innerPaths = (
|
|
92
|
+
<ul className={classNameUlInner}>
|
|
93
|
+
{this.renderTree(node.tree, location)}
|
|
94
|
+
</ul>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
return (
|
|
98
|
+
<li className="doc_nav_inner_heading" key={index}>
|
|
99
|
+
<span className={classNameUlInner}></span>
|
|
100
|
+
{this.renderPathInner(node, open, innerPaths)}
|
|
101
|
+
</li>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
calc(names, path, link, tree) {
|
|
106
|
+
if(1 === names.length) {
|
|
107
|
+
const name = names[0];
|
|
108
|
+
const thisPath = '' !== path ? `${path}/${name}` : name;
|
|
109
|
+
const node = {
|
|
110
|
+
name: name,
|
|
111
|
+
path: thisPath,
|
|
112
|
+
parentPath: path,
|
|
113
|
+
link: link
|
|
114
|
+
};
|
|
115
|
+
tree.set(name, node);
|
|
116
|
+
}
|
|
117
|
+
else if(1 < names.length) {
|
|
118
|
+
const name = names.shift();
|
|
119
|
+
const thisPath = '' !== path ? `${path}/${name}` : name;
|
|
120
|
+
if(tree.has(name)) {
|
|
121
|
+
const node = tree.get(name);
|
|
122
|
+
this.calc(names, thisPath, link, node.tree);
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
const node = {
|
|
126
|
+
name: name,
|
|
127
|
+
path: thisPath,
|
|
128
|
+
parentPath: path,
|
|
129
|
+
tree: new Map()
|
|
130
|
+
};
|
|
131
|
+
tree.set(name, node);
|
|
132
|
+
this.calc(names, thisPath, link, node.tree);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
renderTree(tree, location) {
|
|
138
|
+
let index = 0;
|
|
139
|
+
const nodes = [];
|
|
140
|
+
if(undefined !== tree) {
|
|
141
|
+
tree.forEach((node) => {
|
|
142
|
+
if(node.link) {
|
|
143
|
+
nodes.push(this.renderLink(node.name, node.link, location, index++));
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
nodes.push(this.renderPath(node, location, index++));
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
return nodes;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
renderNavigations(refs, location, open, classNameUl) {
|
|
154
|
+
if(!open) {
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
const tree = new Map();
|
|
158
|
+
refs.forEach((ref) => {
|
|
159
|
+
const names = ref.name.split('/');
|
|
160
|
+
this.calc(names, '', ref.link, tree);
|
|
161
|
+
});
|
|
162
|
+
return (
|
|
163
|
+
<ul className={classNameUl}>
|
|
164
|
+
{this.renderTree(tree, location)}
|
|
165
|
+
</ul>
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
_getNavigations() {
|
|
170
|
+
if(!this.props.preview) {
|
|
171
|
+
return this._documentationStore(this.state).documentation.navigations;
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
return this._documentationStore(this.state).documentationPreview.navigations;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
render() {
|
|
179
|
+
const navigations = this._getNavigations();
|
|
180
|
+
const location = undefined === this.props._uriPath ? '' : (this.props._uriPath.startsWith('/') ? this.props._uriPath.substring(1) : this.props._uriPath);
|
|
181
|
+
const navigationSections = navigations.map((navigation, index) => {
|
|
182
|
+
const open = this._documentationStore(this.state).current.navigationIndex === index;
|
|
183
|
+
const classNameUl = open ? "doc_nav_heading_open" : "doc_nav_heading_closed";
|
|
184
|
+
return (
|
|
185
|
+
<div key={index} className="doc_nav_section">
|
|
186
|
+
<span className={classNameUl}></span>
|
|
187
|
+
<h3 data-name={navigation.heading} className="doc_nav_heading"
|
|
188
|
+
onClickCapture={(e) => {
|
|
189
|
+
e.stopPropagation();
|
|
190
|
+
e.preventDefault();
|
|
191
|
+
this.dispatch(this.props.documentationStore, new ActionDocumentationCurrentNavigation(index, '', ''));
|
|
192
|
+
}}
|
|
193
|
+
>{navigation.heading}</h3>
|
|
194
|
+
<svg className={classNameUl} width="11" height="11" viewBox="0 0 11 11"
|
|
195
|
+
onClickCapture={(e) => {
|
|
196
|
+
e.stopPropagation();
|
|
197
|
+
e.preventDefault();
|
|
198
|
+
this.dispatch(this.props.documentationStore, new ActionDocumentationCurrentNavigation(index, '', ''));
|
|
199
|
+
}}
|
|
200
|
+
>
|
|
201
|
+
<polygon points="2,2 2,10 10,6"/>
|
|
202
|
+
</svg>
|
|
203
|
+
{this.renderNavigations(navigation.refs, location, open, classNameUl)}
|
|
204
|
+
</div>
|
|
205
|
+
);
|
|
206
|
+
});
|
|
207
|
+
const previewStyle = this.props.preview ? {position:'relative',width:'100%'} : null;
|
|
208
|
+
return (
|
|
209
|
+
<div className="doc_nav col-xs-2 panel panel-default" style={previewStyle}>
|
|
210
|
+
<h3 className="doc_nav_title">{this.props.titleText}</h3>
|
|
211
|
+
{navigationSections}
|
|
212
|
+
</div>
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
import { ActionDocumentationMarkup, ActionDocumentationMarkupSave, ActionDocumentationMarkupCancel, ActionDocumentationLocalNoteMarkupSave, ActionDocumentationLocalNoteMarkupCancel } from '../../actions/action-documentation';
|
|
5
|
+
import Button from 'z-abs-complayer-bootstrap-client/client/button';
|
|
6
|
+
import ButtonNew from 'z-abs-complayer-bootstrap-client/client/button-new';
|
|
7
|
+
import {RouterContext} from 'z-abs-complayer-router-client/client/react-component/router-context';
|
|
8
|
+
import ReactComponentStore from 'z-abs-corelayer-client/client/react-component/react-component-store';
|
|
9
|
+
import GuidGenerator from 'z-abs-corelayer-cs/clientServer/guid-generator';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export default class MiddleDocumentationToolbar extends ReactComponentStore {
|
|
14
|
+
constructor(props) {
|
|
15
|
+
super(props, [props.documentationStore, props.plusServicesStore], {
|
|
16
|
+
guid: ''
|
|
17
|
+
});
|
|
18
|
+
this.boundKeyDown = this._keyDown.bind(this);
|
|
19
|
+
this.markupDisabledOpen = false;
|
|
20
|
+
this.markupDisabledSave = true;
|
|
21
|
+
this.markupDisabledHelp = false;
|
|
22
|
+
this.markupDisabledCancel = true;
|
|
23
|
+
this.documentationStoreName = props.documentationStore.constructor.name;
|
|
24
|
+
this.plusServicesStoreName = props.plusServicesStore.constructor.name;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
_documentationStore(state) {
|
|
28
|
+
return state[this.documentationStoreName];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
_plusServiceStore(state) {
|
|
32
|
+
return state[this.plusServicesStoreName];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
didMount() {
|
|
36
|
+
window.addEventListener('keydown', this.boundKeyDown, true);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
shouldUpdate(nextProps, nextState) {
|
|
40
|
+
return !this.shallowCompareObjectValues(this.props, nextProps)
|
|
41
|
+
|| !this.shallowCompare(this._plusServiceStore(this.state).plusServices, this._plusServiceStore(nextState).plusServices)
|
|
42
|
+
|| !this.shallowCompare(this._documentationStore(this.state).markup, this._documentationStore(nextState).markup)
|
|
43
|
+
|| !this.shallowCompare(this._documentationStore(this.state).currentDocumentName, this._documentationStore(nextState).currentDocumentName)
|
|
44
|
+
|| !this.shallowCompare(this._documentationStore(this.state).localNoteMarkup, this._documentationStore(nextState).localNoteMarkup)
|
|
45
|
+
|| this.state.guid !== nextState.guid;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
willUnmount() {
|
|
49
|
+
window.removeEventListener('keydown', this.boundKeyDown, true);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
_markupOpen() {
|
|
53
|
+
this.dispatch(this.props.documentationStore, new ActionDocumentationMarkup());
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
_markupSave() {
|
|
57
|
+
if(this._documentationStore(this.state).markup.definition) {
|
|
58
|
+
this.dispatch(this.props.documentationStore, new ActionDocumentationMarkupSave());
|
|
59
|
+
}
|
|
60
|
+
else if(this._documentationStore(this.state).localNoteMarkup.definition) {
|
|
61
|
+
this.dispatch(this.props.documentationStore, new ActionDocumentationLocalNoteMarkupSave());
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
_markupHelp() {
|
|
66
|
+
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
_markupCancel() {
|
|
70
|
+
if(this._documentationStore(this.state).markup.definition) {
|
|
71
|
+
this.dispatch(this.props.documentationStore, new ActionDocumentationMarkupCancel());
|
|
72
|
+
}
|
|
73
|
+
else if(this._documentationStore(this.state).localNoteMarkup.definition) {
|
|
74
|
+
this.dispatch(this.props.documentationStore, new ActionDocumentationLocalNoteMarkupCancel());
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
_keyDown(e) {
|
|
79
|
+
if(e.ctrlKey && 'o' === e.key) {
|
|
80
|
+
if(!this.markupDisabledOpen) {
|
|
81
|
+
e.preventDefault();
|
|
82
|
+
this._markupOpen();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
else if(e.ctrlKey && e.shiftKey && '?' === e.key) {
|
|
86
|
+
if(!this.markupDisabledHelp) {
|
|
87
|
+
e.preventDefault();
|
|
88
|
+
this._markupHelp();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
else if(e.ctrlKey && e.shiftKey && 'C' === e.key) {
|
|
92
|
+
if(!this.markupDisabledCancel) {
|
|
93
|
+
e.preventDefault();
|
|
94
|
+
this._markupCancel();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
else if(e.ctrlKey && 's' === e.key) {
|
|
98
|
+
if(!this.markupDisabledSave) {
|
|
99
|
+
e.preventDefault();
|
|
100
|
+
this._markupSave();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
renderMarkupOpenButton() {
|
|
106
|
+
this.markupDisabledOpen = this._documentationStore(this.state).markup.definition || this._documentationStore(this.state).localNoteMarkup.definition;
|
|
107
|
+
return (
|
|
108
|
+
<ButtonNew id="documentation_markup_open" icon="icon-markup-open" size="aj_btn_sm" colorMark="markup_color" placement="bottom" heading="Open" content="Markup" shortcut="Ctrl+O" disabled={this.markupDisabledOpen}
|
|
109
|
+
onClick={(e) => {
|
|
110
|
+
this._markupOpen();
|
|
111
|
+
}}
|
|
112
|
+
/>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
renderMarkupSaveButton() {
|
|
117
|
+
this.markupDisabledSave = true;
|
|
118
|
+
if(this._documentationStore(this.state).markup.definition) {
|
|
119
|
+
this.markupDisabledSave = undefined !== this._documentationStore(this.state).markup.navigation.rows || (this._documentationStore(this.state).markup.navigation.content === this._documentationStore(this.state).markup.navigation.contentOriginal && this._documentationStore(this.state).markup.document.content === this._documentationStore(this.state).markup.document.contentOriginal);
|
|
120
|
+
}
|
|
121
|
+
else if(this._documentationStore(this.state).localNoteMarkup.definition) {
|
|
122
|
+
this.markupDisabledSave = this._documentationStore(this.state).localNoteMarkup.document.content === this._documentationStore(this.state).localNoteMarkup.document.contentOriginal;
|
|
123
|
+
}
|
|
124
|
+
return (
|
|
125
|
+
<ButtonNew id="documentation_markup_save" icon="icon-markup-save" size="aj_btn_sm" colorMark="markup_color" placement="bottom" heading="Save" content="Markup" shortcut="Ctrl+S" disabled={this.markupDisabledSave}
|
|
126
|
+
onClick={(e) => {
|
|
127
|
+
this._markupSave();
|
|
128
|
+
}}
|
|
129
|
+
/>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
renderMarkupHelpButton() {
|
|
134
|
+
this.markupDisabledHelp = this._documentationStore(this.state).markup.definition;
|
|
135
|
+
return (
|
|
136
|
+
<ButtonNew id="documentation_markup_help" icon="icon-markup-help" size="aj_btn_sm" colorMark="markup_color" placement="bottom" heading="Help" content="Markup" shortcut="Ctrl+Shift+?" disabled={this.markupDisabledHelp}
|
|
137
|
+
onClick={(e) => {
|
|
138
|
+
this._markupHelp();
|
|
139
|
+
}}
|
|
140
|
+
/>
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
renderMarkupCancelButton() {
|
|
145
|
+
this.markupDisabledCancel = !this._documentationStore(this.state).markup.definition && !this._documentationStore(this.state).localNoteMarkup.definition;
|
|
146
|
+
return (
|
|
147
|
+
<ButtonNew id="documentation_markup_cancel" icon="icon-markup-close" size="aj_btn_sm" colorMark="markup_color" placement="bottom" heading="Cancel" content="Markup" shortcut="Ctrl+Shift+C" disabled={this.markupDisabledCancel}
|
|
148
|
+
onClick={(e) => {
|
|
149
|
+
this._markupCancel();
|
|
150
|
+
}}
|
|
151
|
+
/>
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
renderMarkupShowNavigationButton() {
|
|
156
|
+
const toolTipInstruction = this.props.showNavigationMarkup ? "Hide" : "Show";
|
|
157
|
+
const active = this.props.showNavigationMarkup ? "active" : "";
|
|
158
|
+
return (
|
|
159
|
+
<ButtonNew id="documentation_navigation" colorMark="markup_color" icon="icon-doc-navigation" size="aj_btn_sm" placement="bottom" heading={`${toolTipInstruction}`} content="Navigation Markup" active={active} disabled={!this._documentationStore(this.state).markup.definition}
|
|
160
|
+
onClick={(e) => {
|
|
161
|
+
this.props.onToggleNavigationMarkup && this.props.onToggleNavigationMarkup();
|
|
162
|
+
}}
|
|
163
|
+
/>
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
renderMarkupShowPreviewNavigationButton() {
|
|
168
|
+
const toolTipInstruction = this.props.showNavigationPreview ? "Hide" : "Show";
|
|
169
|
+
const active = this.props.showNavigationPreview ? "active" : "";
|
|
170
|
+
return (
|
|
171
|
+
<ButtonNew id="documentation_navigation_preview" colorMark="markup_color" icon="icon-doc-navigation-preview" size="aj_btn_sm" placement="bottom" heading={`${toolTipInstruction}`} content="Navigation Preview" active={active} disabled={!this._documentationStore(this.state).markup.definition}
|
|
172
|
+
onClick={(e) => {
|
|
173
|
+
this.props.onToggleNavigationPreview && this.props.onToggleNavigationPreview();
|
|
174
|
+
}}
|
|
175
|
+
/>
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
renderMarkupShowDocumentButton() {
|
|
180
|
+
const toolTipInstruction = this.props.showDocumentationMarkup ? "Hide" : "Show";
|
|
181
|
+
const active = this.props.showDocumentationMarkup ? "active" : "";
|
|
182
|
+
return (
|
|
183
|
+
<ButtonNew id="documentation_markup" colorMark="markup_color" icon="icon-doc-markup" size="aj_btn_sm" placement="bottom" heading={`${toolTipInstruction}`} content="Document Markup" active={active} disabled={!this._documentationStore(this.state).markup.definition}
|
|
184
|
+
onClick={(e) => {
|
|
185
|
+
this.props.onToggleDocumentationMarkup && this.props.onToggleDocumentationMarkup();
|
|
186
|
+
}}
|
|
187
|
+
/>
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
renderMarkupShowDocumentPreviewButton() {
|
|
192
|
+
const toolTipInstruction = this.props.showDocumentationPreview ? "Hide" : "Show";
|
|
193
|
+
const active = this.props.showDocumentationPreview ? "active" : "";
|
|
194
|
+
return (
|
|
195
|
+
<ButtonNew id="documentation_markup_preview" colorMark="markup_color" icon="icon-doc-markup-preview" size="aj_btn_sm" placement="bottom" heading={`${toolTipInstruction}`} content="Document Preview" active={active} disabled={!this._documentationStore(this.state).markup.definition}
|
|
196
|
+
onClick={(e) => {
|
|
197
|
+
this.props.onToggleDocumentationPreview && this.props.onToggleDocumentationPreview();
|
|
198
|
+
}}
|
|
199
|
+
/>
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
renderHorizontalOrVerticalButton() {
|
|
204
|
+
let toolTipInstruction;
|
|
205
|
+
let image1Style;
|
|
206
|
+
let image2Style;
|
|
207
|
+
if(this.props.documentationOrder) {
|
|
208
|
+
toolTipInstruction = 'Vertical';
|
|
209
|
+
image1Style = {top:'8px',left:'0px',transform:'scale(1.3, 0.9)'};
|
|
210
|
+
image2Style = {width:'0px',top:'-4px',left:'-14px',transform:'scale(1.3, 0.9)'};
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
toolTipInstruction = 'Horizontal';
|
|
214
|
+
image1Style = {top:'2px',left:'-8px',transform:'scale(1.3, 0.9)'};
|
|
215
|
+
image2Style = {width:'0px',top:'2px',left:'-6px',transform:'scale(1.3, 0.9)'};
|
|
216
|
+
}
|
|
217
|
+
return (
|
|
218
|
+
<ButtonNew id="documentation_align" icon="icon-align" size="aj_btn_sm" colorMark="markup_color" active={this.props.documentationOrder} placement="bottom" heading={`${toolTipInstruction}`} content="Document Order" disabled={!this._documentationStore(this.state).markup.definition}
|
|
219
|
+
onClick={(e) => {
|
|
220
|
+
this.props.onToggleDocumentationOrder && this.props.onToggleDocumentationOrder();
|
|
221
|
+
}}
|
|
222
|
+
/>
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
renderGuidGeneratorButton() {
|
|
227
|
+
if(this._documentationStore(this.state).markup.definition || this._documentationStore(this.state).localNoteMarkup.definition) {
|
|
228
|
+
return (
|
|
229
|
+
<ButtonNew id="documentation_guid" icon="icon-guid" size="aj_btn_sm" colorMark="markup_color" placement="bottom" heading="Generate" content="GUID"
|
|
230
|
+
onClick={(e) => {
|
|
231
|
+
const guid = GuidGenerator.create();
|
|
232
|
+
navigator.clipboard.writeText(guid).then(() => {
|
|
233
|
+
/* clipboard successfully set */
|
|
234
|
+
}, () => {
|
|
235
|
+
/* clipboard write failed */
|
|
236
|
+
});
|
|
237
|
+
this.updateState({guid: {$set: guid}});
|
|
238
|
+
}}
|
|
239
|
+
/>
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
renderGuidLabel(htmlFor) {
|
|
245
|
+
if(this.state.guid && (this._documentationStore(this.state).markup.definition || this._documentationStore(this.state).localNoteMarkup.definition)) {
|
|
246
|
+
return (
|
|
247
|
+
<label className="documentation_guid" htmlFor={htmlFor}>{this.state.guid}</label>
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
renderDocumentationButton() {
|
|
253
|
+
return (
|
|
254
|
+
<ButtonNew id="documentation_documentation" colorMark="markup_color" icon="icon-doc-documentation" size="aj_btn_sm" heading="Goto" content="Documentation"
|
|
255
|
+
onClick={(e) => {
|
|
256
|
+
this.context.history(`/documentation`, {global: true});
|
|
257
|
+
}}
|
|
258
|
+
/>
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
renderEducationButton() {
|
|
263
|
+
return (
|
|
264
|
+
<ButtonNew id="documentation_education" colorMark="markup_color" icon="icon-doc-education" size="aj_btn_sm" heading="Goto" content="Education"
|
|
265
|
+
onClick={(e) => {
|
|
266
|
+
this.context.history(`/education`, {global: true});
|
|
267
|
+
}}
|
|
268
|
+
/>
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
renderWorkshopButton() {
|
|
273
|
+
return (
|
|
274
|
+
<ButtonNew id="documentation_workshop" colorMark="markup_color" icon="icon-doc-workshop" size="aj_btn_sm" heading="Goto" content="Workshop"
|
|
275
|
+
onClick={(e) => {
|
|
276
|
+
this.context.history(`/workshop`, {global: true});
|
|
277
|
+
}}
|
|
278
|
+
/>
|
|
279
|
+
);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
renderVideosButton() {
|
|
283
|
+
return (
|
|
284
|
+
<ButtonNew id="documentation_video" colorMark="markup_color" icon="icon-doc-video" size="aj_btn_sm" heading="Goto" content="Videos"
|
|
285
|
+
onClick={(e) => {
|
|
286
|
+
this.context.history(`/videos`, {global: true});
|
|
287
|
+
}}
|
|
288
|
+
/>
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
renderLocalDocumentationButton(repoName) {
|
|
293
|
+
return (
|
|
294
|
+
<ButtonNew id={`start_local_documentation_${repoName}`} colorMark="markup_color" icon="icon-doc-docs" size="aj_btn_sm" heading="Goto" content="Plus Service - Docs" aria-label="Plus Service - Docs"
|
|
295
|
+
onClick={(e) => {
|
|
296
|
+
this.context.history(`/local-documentation-${repoName}`, {global: true});
|
|
297
|
+
}}
|
|
298
|
+
/>
|
|
299
|
+
);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
renderLocalDocumentationButtons() {
|
|
303
|
+
if(this.props.plusServicesStore.isLoaded('docs')) {
|
|
304
|
+
return this.renderLocalDocumentationButton('Local');
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
render() {
|
|
309
|
+
return (
|
|
310
|
+
<div className="middle_toolbar middle_documentation_toolbar">
|
|
311
|
+
<div className="toolbar" role="toolbar" aria-label="...">
|
|
312
|
+
<div className="aj_btn_group" role="group" aria-label="...">
|
|
313
|
+
{this.renderMarkupOpenButton()}
|
|
314
|
+
{this.renderMarkupSaveButton()}
|
|
315
|
+
{this.renderMarkupHelpButton()}
|
|
316
|
+
{this.renderMarkupCancelButton()}
|
|
317
|
+
</div>
|
|
318
|
+
<div className="aj_btn_group" role="group" aria-label="...">
|
|
319
|
+
{this.renderMarkupShowDocumentButton()}
|
|
320
|
+
{this.renderMarkupShowDocumentPreviewButton()}
|
|
321
|
+
{this.renderMarkupShowNavigationButton()}
|
|
322
|
+
{this.renderMarkupShowPreviewNavigationButton()}
|
|
323
|
+
{this.renderHorizontalOrVerticalButton()}
|
|
324
|
+
</div>
|
|
325
|
+
<div className="aj_btn_group" role="group" aria-label="...">
|
|
326
|
+
{this.renderGuidGeneratorButton()}
|
|
327
|
+
{this.renderGuidLabel('aaa')}
|
|
328
|
+
</div>
|
|
329
|
+
<div className="aj_btn_group middle_documentation_heading" role="group" aria-label="...">
|
|
330
|
+
<h4 className="middle_documentation_heading">{`${this.props.titleText} - ${this._documentationStore(this.state).current.navigationName}`}</h4>
|
|
331
|
+
</div>
|
|
332
|
+
<div className="aj_btn_group" role="group" aria-label="..." style={{float: 'right'}}>
|
|
333
|
+
{this.renderDocumentationButton()}
|
|
334
|
+
{this.renderEducationButton()}
|
|
335
|
+
{this.renderWorkshopButton()}
|
|
336
|
+
{this.renderVideosButton()}
|
|
337
|
+
</div>
|
|
338
|
+
<div className="aj_btn_group" role="group" aria-label="..." style={{float: 'right'}}>
|
|
339
|
+
{this.renderLocalDocumentationButtons()}
|
|
340
|
+
</div>
|
|
341
|
+
</div>
|
|
342
|
+
</div>
|
|
343
|
+
);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
MiddleDocumentationToolbar.contextType = RouterContext;
|