@manuscripts/body-editor 1.9.19 → 1.9.20-LEAN-3535.0
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/dist/cjs/lib/popper.js +13 -2
- package/dist/cjs/plugins/selected-suggestion-ui.js +1 -0
- package/dist/cjs/views/bibliography_element.js +4 -12
- package/dist/cjs/views/citation.js +8 -0
- package/dist/cjs/views/citation_editable.js +9 -9
- package/dist/cjs/views/contributors.js +1 -2
- package/dist/es/lib/popper.js +13 -2
- package/dist/es/plugins/selected-suggestion-ui.js +1 -0
- package/dist/es/views/bibliography_element.js +4 -12
- package/dist/es/views/citation.js +8 -0
- package/dist/es/views/citation_editable.js +10 -10
- package/dist/es/views/contributors.js +1 -2
- package/dist/types/lib/popper.d.ts +1 -0
- package/dist/types/views/bibliography_element.d.ts +0 -1
- package/dist/types/views/citation.d.ts +2 -0
- package/dist/types/views/citation_editable.d.ts +1 -2
- package/package.json +1 -1
package/dist/cjs/lib/popper.js
CHANGED
|
@@ -22,8 +22,10 @@ exports.PopperManager = void 0;
|
|
|
22
22
|
const popper_js_1 = __importDefault(require("popper.js"));
|
|
23
23
|
class PopperManager {
|
|
24
24
|
show(target, contents, placement = 'bottom', showArrow = true, modifiers = {}) {
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
this.destroy();
|
|
26
|
+
if (contents.classList.contains('context-menu')) {
|
|
27
|
+
this.clickEventHandler = this.clickEventHandler.bind(this);
|
|
28
|
+
document.body.addEventListener('click', this.clickEventHandler);
|
|
27
29
|
}
|
|
28
30
|
window.requestAnimationFrame(() => {
|
|
29
31
|
const container = document.createElement('div');
|
|
@@ -57,8 +59,17 @@ class PopperManager {
|
|
|
57
59
|
});
|
|
58
60
|
});
|
|
59
61
|
}
|
|
62
|
+
clickEventHandler(event) {
|
|
63
|
+
const editorElement = document.querySelector('.manuscript-editor');
|
|
64
|
+
const contextMenuElement = document.querySelector('.context-menu');
|
|
65
|
+
if (!(editorElement === null || editorElement === void 0 ? void 0 : editorElement.contains(event.target)) &&
|
|
66
|
+
!(contextMenuElement === null || contextMenuElement === void 0 ? void 0 : contextMenuElement.contains(event.target))) {
|
|
67
|
+
this.destroy();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
60
70
|
destroy() {
|
|
61
71
|
if (this.activePopper) {
|
|
72
|
+
document.body.removeEventListener('click', this.clickEventHandler);
|
|
62
73
|
this.removeContainerClass(this.activePopper.reference);
|
|
63
74
|
this.activePopper.destroy();
|
|
64
75
|
delete this.activePopper;
|
|
@@ -69,6 +69,7 @@ class SuggestionView {
|
|
|
69
69
|
if ((_b = (_a = dom.parentElement) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.classList.contains('keyword')) {
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
|
+
console.log(dom);
|
|
72
73
|
dom.addEventListener('click', this.listener);
|
|
73
74
|
});
|
|
74
75
|
}
|
|
@@ -45,9 +45,7 @@ const ReactSubView_1 = __importDefault(require("./ReactSubView"));
|
|
|
45
45
|
class BibliographyElementBlockView extends block_view_1.default {
|
|
46
46
|
constructor() {
|
|
47
47
|
super(...arguments);
|
|
48
|
-
this.clickedElementId = null;
|
|
49
48
|
this.showPopper = (id) => {
|
|
50
|
-
this.props.popper.destroy();
|
|
51
49
|
const bib = (0, bibliography_1.getBibliographyPluginState)(this.view.state);
|
|
52
50
|
if (!bib) {
|
|
53
51
|
return;
|
|
@@ -71,8 +69,6 @@ class BibliographyElementBlockView extends block_view_1.default {
|
|
|
71
69
|
this.props.setComment((0, transform_1.buildComment)(citationId));
|
|
72
70
|
};
|
|
73
71
|
this.showContextMenu = (elementId) => {
|
|
74
|
-
this.props.popper.destroy();
|
|
75
|
-
this.clickedElementId = null;
|
|
76
72
|
const can = this.props.getCapabilities();
|
|
77
73
|
const element = document.getElementById(elementId);
|
|
78
74
|
const componentProps = {
|
|
@@ -95,7 +91,6 @@ class BibliographyElementBlockView extends block_view_1.default {
|
|
|
95
91
|
};
|
|
96
92
|
this.onClickHandler = (elementId, dataTracked) => {
|
|
97
93
|
var _a;
|
|
98
|
-
this.clickedElementId = elementId;
|
|
99
94
|
const isSelectedSuggestion = !!((_a = selected_suggestion_ui_1.selectedSuggestionKey
|
|
100
95
|
.getState(this.view.state)) === null || _a === void 0 ? void 0 : _a.find(this.getPos(), this.getPos() + this.node.nodeSize).length);
|
|
101
96
|
const { tr, doc } = this.view.state;
|
|
@@ -107,11 +102,9 @@ class BibliographyElementBlockView extends block_view_1.default {
|
|
|
107
102
|
if (isSelectedSuggestion) {
|
|
108
103
|
tr.setMeta(selected_suggestion_ui_1.CLEAR_SUGGESTION_ID, true);
|
|
109
104
|
}
|
|
110
|
-
else {
|
|
111
|
-
this.showContextMenu(elementId);
|
|
112
|
-
}
|
|
113
105
|
}
|
|
114
106
|
this.view.dispatch(tr);
|
|
107
|
+
this.showContextMenu(elementId);
|
|
115
108
|
};
|
|
116
109
|
this.updateContents = () => __awaiter(this, void 0, void 0, function* () {
|
|
117
110
|
this.props.popper.destroy();
|
|
@@ -164,7 +157,9 @@ class BibliographyElementBlockView extends block_view_1.default {
|
|
|
164
157
|
element.classList.add('selected-suggestion');
|
|
165
158
|
}
|
|
166
159
|
if (can.seeReferencesButtons) {
|
|
167
|
-
element.addEventListener('click', () =>
|
|
160
|
+
element.addEventListener('click', () => {
|
|
161
|
+
this.onClickHandler(element.id, dataTracked);
|
|
162
|
+
});
|
|
168
163
|
}
|
|
169
164
|
wrapper.append(element);
|
|
170
165
|
}
|
|
@@ -175,9 +170,6 @@ class BibliographyElementBlockView extends block_view_1.default {
|
|
|
175
170
|
else {
|
|
176
171
|
this.container.appendChild(wrapper);
|
|
177
172
|
}
|
|
178
|
-
if (this.clickedElementId) {
|
|
179
|
-
this.showContextMenu(this.clickedElementId);
|
|
180
|
-
}
|
|
181
173
|
});
|
|
182
174
|
this.createElement = () => {
|
|
183
175
|
this.container = document.createElement('div');
|
|
@@ -27,6 +27,7 @@ class CitationView extends base_node_view_1.BaseNodeView {
|
|
|
27
27
|
constructor() {
|
|
28
28
|
super(...arguments);
|
|
29
29
|
this.ignoreMutation = () => true;
|
|
30
|
+
this.wasUpdated = false;
|
|
30
31
|
this.initialise = () => {
|
|
31
32
|
if (!this.node.type.spec.toDOM) {
|
|
32
33
|
throw Error(`Node view ${this.node.type} doesn't have toDOM method`);
|
|
@@ -59,6 +60,13 @@ class CitationView extends base_node_view_1.BaseNodeView {
|
|
|
59
60
|
this.dom.appendChild(element);
|
|
60
61
|
(0, comment_annotation_1.addCommentToLeafNode)(this.getPos(), this.getPos() + this.node.nodeSize, this.view.state, this.dom);
|
|
61
62
|
this.setDomAttrs(this.node, this.dom, ['rids', 'contents', 'selectedText']);
|
|
63
|
+
if (!this.wasUpdated) {
|
|
64
|
+
this.dom.addEventListener('click', () => this.onClickHandler());
|
|
65
|
+
}
|
|
66
|
+
this.wasUpdated = true;
|
|
67
|
+
this.props.popper.update();
|
|
68
|
+
};
|
|
69
|
+
this.onClickHandler = () => {
|
|
62
70
|
};
|
|
63
71
|
}
|
|
64
72
|
}
|
|
@@ -47,17 +47,18 @@ class CitationEditableView extends citation_1.CitationView {
|
|
|
47
47
|
element.classList.contains('comment-icon') ||
|
|
48
48
|
((_a = element.parentElement) === null || _a === void 0 ? void 0 : _a.classList.contains('comment-icon')));
|
|
49
49
|
};
|
|
50
|
-
this.
|
|
50
|
+
this.onClickHandler = () => {
|
|
51
51
|
var _a;
|
|
52
52
|
const can = this.props.getCapabilities();
|
|
53
53
|
const dataTracked = this.node.attrs.dataTracked;
|
|
54
54
|
const isSelectedSuggestion = !!((_a = selected_suggestion_ui_1.selectedSuggestionKey
|
|
55
55
|
.getState(this.view.state)) === null || _a === void 0 ? void 0 : _a.find(this.getPos(), this.getPos() + this.node.nodeSize).length);
|
|
56
|
-
this.
|
|
56
|
+
const { tr, doc } = this.view.state;
|
|
57
|
+
tr.setSelection(prosemirror_state_1.NodeSelection.create(doc, this.getPos()));
|
|
57
58
|
if (dataTracked && !isSelectedSuggestion) {
|
|
58
|
-
|
|
59
|
+
tr.setMeta(selected_suggestion_ui_1.SET_SUGGESTION_ID, dataTracked[0].id);
|
|
59
60
|
}
|
|
60
|
-
|
|
61
|
+
if (can.seeReferencesButtons && !(0, track_changes_utils_1.isDeleted)(this.node)) {
|
|
61
62
|
const attrs = (0, track_changes_utils_1.getActualAttrs)(this.node);
|
|
62
63
|
if (!attrs.rids.length) {
|
|
63
64
|
this.showPopper();
|
|
@@ -66,10 +67,7 @@ class CitationEditableView extends citation_1.CitationView {
|
|
|
66
67
|
this.showContextMenu();
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
|
-
|
|
70
|
-
this.deselectNode = () => {
|
|
71
|
-
this.dom.classList.remove('ProseMirror-selectednode');
|
|
72
|
-
this.props.popper.destroy();
|
|
70
|
+
this.view.dispatch(tr);
|
|
73
71
|
};
|
|
74
72
|
this.destroy = () => {
|
|
75
73
|
var _a;
|
|
@@ -85,7 +83,9 @@ class CitationEditableView extends citation_1.CitationView {
|
|
|
85
83
|
],
|
|
86
84
|
};
|
|
87
85
|
this.contextMenu = (0, ReactSubView_1.default)(this.props, style_guide_1.ContextMenu, componentProps, this.node, this.getPos, this.view, 'context-menu');
|
|
88
|
-
|
|
86
|
+
setTimeout(() => {
|
|
87
|
+
this.props.popper.show(this.dom, this.contextMenu, 'right-start', false);
|
|
88
|
+
}, 0);
|
|
89
89
|
};
|
|
90
90
|
this.showPopper = () => {
|
|
91
91
|
this.props.popper.destroy();
|
|
@@ -179,7 +179,6 @@ class ContributorsView extends block_view_1.default {
|
|
|
179
179
|
};
|
|
180
180
|
this.onClickHandler = (elementId, dataTracked) => {
|
|
181
181
|
var _a;
|
|
182
|
-
this.props.popper.destroy();
|
|
183
182
|
const isSelectedSuggestion = !!((_a = selected_suggestion_ui_1.selectedSuggestionKey
|
|
184
183
|
.getState(this.view.state)) === null || _a === void 0 ? void 0 : _a.find(this.getPos(), this.getPos() + this.node.nodeSize).length);
|
|
185
184
|
const { tr, doc } = this.view.state;
|
|
@@ -192,11 +191,11 @@ class ContributorsView extends block_view_1.default {
|
|
|
192
191
|
tr.setMeta(selected_suggestion_ui_1.CLEAR_SUGGESTION_ID, true);
|
|
193
192
|
}
|
|
194
193
|
}
|
|
194
|
+
this.view.dispatch(tr);
|
|
195
195
|
if (!((dataTracked === null || dataTracked === void 0 ? void 0 : dataTracked.operation) === track_changes_plugin_1.CHANGE_OPERATION.delete &&
|
|
196
196
|
(dataTracked === null || dataTracked === void 0 ? void 0 : dataTracked.status) !== track_changes_plugin_1.CHANGE_STATUS.rejected)) {
|
|
197
197
|
this.showContextMenu(elementId);
|
|
198
198
|
}
|
|
199
|
-
this.view.dispatch(tr);
|
|
200
199
|
};
|
|
201
200
|
this.showContextMenu = (elementId) => {
|
|
202
201
|
this.props.popper.destroy();
|
package/dist/es/lib/popper.js
CHANGED
|
@@ -16,8 +16,10 @@
|
|
|
16
16
|
import Popper from 'popper.js';
|
|
17
17
|
export class PopperManager {
|
|
18
18
|
show(target, contents, placement = 'bottom', showArrow = true, modifiers = {}) {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
this.destroy();
|
|
20
|
+
if (contents.classList.contains('context-menu')) {
|
|
21
|
+
this.clickEventHandler = this.clickEventHandler.bind(this);
|
|
22
|
+
document.body.addEventListener('click', this.clickEventHandler);
|
|
21
23
|
}
|
|
22
24
|
window.requestAnimationFrame(() => {
|
|
23
25
|
const container = document.createElement('div');
|
|
@@ -51,8 +53,17 @@ export class PopperManager {
|
|
|
51
53
|
});
|
|
52
54
|
});
|
|
53
55
|
}
|
|
56
|
+
clickEventHandler(event) {
|
|
57
|
+
const editorElement = document.querySelector('.manuscript-editor');
|
|
58
|
+
const contextMenuElement = document.querySelector('.context-menu');
|
|
59
|
+
if (!(editorElement === null || editorElement === void 0 ? void 0 : editorElement.contains(event.target)) &&
|
|
60
|
+
!(contextMenuElement === null || contextMenuElement === void 0 ? void 0 : contextMenuElement.contains(event.target))) {
|
|
61
|
+
this.destroy();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
54
64
|
destroy() {
|
|
55
65
|
if (this.activePopper) {
|
|
66
|
+
document.body.removeEventListener('click', this.clickEventHandler);
|
|
56
67
|
this.removeContainerClass(this.activePopper.reference);
|
|
57
68
|
this.activePopper.destroy();
|
|
58
69
|
delete this.activePopper;
|
|
@@ -66,6 +66,7 @@ class SuggestionView {
|
|
|
66
66
|
if ((_b = (_a = dom.parentElement) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.classList.contains('keyword')) {
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
+
console.log(dom);
|
|
69
70
|
dom.addEventListener('click', this.listener);
|
|
70
71
|
});
|
|
71
72
|
}
|
|
@@ -39,9 +39,7 @@ import ReactSubView from './ReactSubView';
|
|
|
39
39
|
export class BibliographyElementBlockView extends BlockView {
|
|
40
40
|
constructor() {
|
|
41
41
|
super(...arguments);
|
|
42
|
-
this.clickedElementId = null;
|
|
43
42
|
this.showPopper = (id) => {
|
|
44
|
-
this.props.popper.destroy();
|
|
45
43
|
const bib = getBibliographyPluginState(this.view.state);
|
|
46
44
|
if (!bib) {
|
|
47
45
|
return;
|
|
@@ -65,8 +63,6 @@ export class BibliographyElementBlockView extends BlockView {
|
|
|
65
63
|
this.props.setComment(buildComment(citationId));
|
|
66
64
|
};
|
|
67
65
|
this.showContextMenu = (elementId) => {
|
|
68
|
-
this.props.popper.destroy();
|
|
69
|
-
this.clickedElementId = null;
|
|
70
66
|
const can = this.props.getCapabilities();
|
|
71
67
|
const element = document.getElementById(elementId);
|
|
72
68
|
const componentProps = {
|
|
@@ -89,7 +85,6 @@ export class BibliographyElementBlockView extends BlockView {
|
|
|
89
85
|
};
|
|
90
86
|
this.onClickHandler = (elementId, dataTracked) => {
|
|
91
87
|
var _a;
|
|
92
|
-
this.clickedElementId = elementId;
|
|
93
88
|
const isSelectedSuggestion = !!((_a = selectedSuggestionKey
|
|
94
89
|
.getState(this.view.state)) === null || _a === void 0 ? void 0 : _a.find(this.getPos(), this.getPos() + this.node.nodeSize).length);
|
|
95
90
|
const { tr, doc } = this.view.state;
|
|
@@ -101,11 +96,9 @@ export class BibliographyElementBlockView extends BlockView {
|
|
|
101
96
|
if (isSelectedSuggestion) {
|
|
102
97
|
tr.setMeta(CLEAR_SUGGESTION_ID, true);
|
|
103
98
|
}
|
|
104
|
-
else {
|
|
105
|
-
this.showContextMenu(elementId);
|
|
106
|
-
}
|
|
107
99
|
}
|
|
108
100
|
this.view.dispatch(tr);
|
|
101
|
+
this.showContextMenu(elementId);
|
|
109
102
|
};
|
|
110
103
|
this.updateContents = () => __awaiter(this, void 0, void 0, function* () {
|
|
111
104
|
this.props.popper.destroy();
|
|
@@ -158,7 +151,9 @@ export class BibliographyElementBlockView extends BlockView {
|
|
|
158
151
|
element.classList.add('selected-suggestion');
|
|
159
152
|
}
|
|
160
153
|
if (can.seeReferencesButtons) {
|
|
161
|
-
element.addEventListener('click', () =>
|
|
154
|
+
element.addEventListener('click', () => {
|
|
155
|
+
this.onClickHandler(element.id, dataTracked);
|
|
156
|
+
});
|
|
162
157
|
}
|
|
163
158
|
wrapper.append(element);
|
|
164
159
|
}
|
|
@@ -169,9 +164,6 @@ export class BibliographyElementBlockView extends BlockView {
|
|
|
169
164
|
else {
|
|
170
165
|
this.container.appendChild(wrapper);
|
|
171
166
|
}
|
|
172
|
-
if (this.clickedElementId) {
|
|
173
|
-
this.showContextMenu(this.clickedElementId);
|
|
174
|
-
}
|
|
175
167
|
});
|
|
176
168
|
this.createElement = () => {
|
|
177
169
|
this.container = document.createElement('div');
|
|
@@ -24,6 +24,7 @@ export class CitationView extends BaseNodeView {
|
|
|
24
24
|
constructor() {
|
|
25
25
|
super(...arguments);
|
|
26
26
|
this.ignoreMutation = () => true;
|
|
27
|
+
this.wasUpdated = false;
|
|
27
28
|
this.initialise = () => {
|
|
28
29
|
if (!this.node.type.spec.toDOM) {
|
|
29
30
|
throw Error(`Node view ${this.node.type} doesn't have toDOM method`);
|
|
@@ -56,6 +57,13 @@ export class CitationView extends BaseNodeView {
|
|
|
56
57
|
this.dom.appendChild(element);
|
|
57
58
|
addCommentToLeafNode(this.getPos(), this.getPos() + this.node.nodeSize, this.view.state, this.dom);
|
|
58
59
|
this.setDomAttrs(this.node, this.dom, ['rids', 'contents', 'selectedText']);
|
|
60
|
+
if (!this.wasUpdated) {
|
|
61
|
+
this.dom.addEventListener('click', () => this.onClickHandler());
|
|
62
|
+
}
|
|
63
|
+
this.wasUpdated = true;
|
|
64
|
+
this.props.popper.update();
|
|
65
|
+
};
|
|
66
|
+
this.onClickHandler = () => {
|
|
59
67
|
};
|
|
60
68
|
}
|
|
61
69
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { ContextMenu } from '@manuscripts/style-guide';
|
|
17
17
|
import { buildComment, schema, } from '@manuscripts/transform';
|
|
18
|
-
import { TextSelection } from 'prosemirror-state';
|
|
18
|
+
import { NodeSelection, TextSelection } from 'prosemirror-state';
|
|
19
19
|
import { findChildrenByType } from 'prosemirror-utils';
|
|
20
20
|
import { CitationEditor, } from '../components/references/CitationEditor';
|
|
21
21
|
import { CitationViewer, } from '../components/references/CitationViewer';
|
|
@@ -41,17 +41,18 @@ export class CitationEditableView extends CitationView {
|
|
|
41
41
|
element.classList.contains('comment-icon') ||
|
|
42
42
|
((_a = element.parentElement) === null || _a === void 0 ? void 0 : _a.classList.contains('comment-icon')));
|
|
43
43
|
};
|
|
44
|
-
this.
|
|
44
|
+
this.onClickHandler = () => {
|
|
45
45
|
var _a;
|
|
46
46
|
const can = this.props.getCapabilities();
|
|
47
47
|
const dataTracked = this.node.attrs.dataTracked;
|
|
48
48
|
const isSelectedSuggestion = !!((_a = selectedSuggestionKey
|
|
49
49
|
.getState(this.view.state)) === null || _a === void 0 ? void 0 : _a.find(this.getPos(), this.getPos() + this.node.nodeSize).length);
|
|
50
|
-
this.
|
|
50
|
+
const { tr, doc } = this.view.state;
|
|
51
|
+
tr.setSelection(NodeSelection.create(doc, this.getPos()));
|
|
51
52
|
if (dataTracked && !isSelectedSuggestion) {
|
|
52
|
-
|
|
53
|
+
tr.setMeta(SET_SUGGESTION_ID, dataTracked[0].id);
|
|
53
54
|
}
|
|
54
|
-
|
|
55
|
+
if (can.seeReferencesButtons && !isDeleted(this.node)) {
|
|
55
56
|
const attrs = getActualAttrs(this.node);
|
|
56
57
|
if (!attrs.rids.length) {
|
|
57
58
|
this.showPopper();
|
|
@@ -60,10 +61,7 @@ export class CitationEditableView extends CitationView {
|
|
|
60
61
|
this.showContextMenu();
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
|
-
|
|
64
|
-
this.deselectNode = () => {
|
|
65
|
-
this.dom.classList.remove('ProseMirror-selectednode');
|
|
66
|
-
this.props.popper.destroy();
|
|
64
|
+
this.view.dispatch(tr);
|
|
67
65
|
};
|
|
68
66
|
this.destroy = () => {
|
|
69
67
|
var _a;
|
|
@@ -79,7 +77,9 @@ export class CitationEditableView extends CitationView {
|
|
|
79
77
|
],
|
|
80
78
|
};
|
|
81
79
|
this.contextMenu = ReactSubView(this.props, ContextMenu, componentProps, this.node, this.getPos, this.view, 'context-menu');
|
|
82
|
-
|
|
80
|
+
setTimeout(() => {
|
|
81
|
+
this.props.popper.show(this.dom, this.contextMenu, 'right-start', false);
|
|
82
|
+
}, 0);
|
|
83
83
|
};
|
|
84
84
|
this.showPopper = () => {
|
|
85
85
|
this.props.popper.destroy();
|
|
@@ -173,7 +173,6 @@ export class ContributorsView extends BlockView {
|
|
|
173
173
|
};
|
|
174
174
|
this.onClickHandler = (elementId, dataTracked) => {
|
|
175
175
|
var _a;
|
|
176
|
-
this.props.popper.destroy();
|
|
177
176
|
const isSelectedSuggestion = !!((_a = selectedSuggestionKey
|
|
178
177
|
.getState(this.view.state)) === null || _a === void 0 ? void 0 : _a.find(this.getPos(), this.getPos() + this.node.nodeSize).length);
|
|
179
178
|
const { tr, doc } = this.view.state;
|
|
@@ -186,11 +185,11 @@ export class ContributorsView extends BlockView {
|
|
|
186
185
|
tr.setMeta(CLEAR_SUGGESTION_ID, true);
|
|
187
186
|
}
|
|
188
187
|
}
|
|
188
|
+
this.view.dispatch(tr);
|
|
189
189
|
if (!((dataTracked === null || dataTracked === void 0 ? void 0 : dataTracked.operation) === CHANGE_OPERATION.delete &&
|
|
190
190
|
(dataTracked === null || dataTracked === void 0 ? void 0 : dataTracked.status) !== CHANGE_STATUS.rejected)) {
|
|
191
191
|
this.showContextMenu(elementId);
|
|
192
192
|
}
|
|
193
|
-
this.view.dispatch(tr);
|
|
194
193
|
};
|
|
195
194
|
this.showContextMenu = (elementId) => {
|
|
196
195
|
this.props.popper.destroy();
|
|
@@ -17,6 +17,7 @@ import Popper from 'popper.js';
|
|
|
17
17
|
export declare class PopperManager {
|
|
18
18
|
protected activePopper?: Popper;
|
|
19
19
|
show(target: Element, contents: HTMLElement, placement?: Popper.Placement, showArrow?: boolean, modifiers?: Popper.Modifiers): void;
|
|
20
|
+
clickEventHandler(event: Event): void;
|
|
20
21
|
destroy(): void;
|
|
21
22
|
update(): void;
|
|
22
23
|
private focusInput;
|
|
@@ -24,7 +24,6 @@ export declare class BibliographyElementBlockView<PropsType extends Bibliography
|
|
|
24
24
|
private container;
|
|
25
25
|
private editor;
|
|
26
26
|
private contextMenu;
|
|
27
|
-
private clickedElementId;
|
|
28
27
|
showPopper: (id: string) => void;
|
|
29
28
|
stopEvent: () => boolean;
|
|
30
29
|
ignoreMutation: () => boolean;
|
|
@@ -17,8 +17,10 @@ import { ManuscriptNodeView } from '@manuscripts/transform';
|
|
|
17
17
|
import { BaseNodeProps, BaseNodeView } from './base_node_view';
|
|
18
18
|
export declare class CitationView<PropsType extends BaseNodeProps> extends BaseNodeView<PropsType> implements ManuscriptNodeView {
|
|
19
19
|
ignoreMutation: () => boolean;
|
|
20
|
+
wasUpdated: boolean;
|
|
20
21
|
initialise: () => this;
|
|
21
22
|
updateContents: () => void;
|
|
23
|
+
onClickHandler: () => void;
|
|
22
24
|
}
|
|
23
25
|
declare const _default: (props: BaseNodeProps, dispatch?: import("..").Dispatch | undefined) => import("../types").NodeViewCreator<CitationView<any>>;
|
|
24
26
|
export default _default;
|
|
@@ -19,8 +19,7 @@ export declare class CitationEditableView extends CitationView<EditableBlockProp
|
|
|
19
19
|
private editor;
|
|
20
20
|
private contextMenu;
|
|
21
21
|
stopEvent: (event: Event) => boolean;
|
|
22
|
-
|
|
23
|
-
deselectNode: () => void;
|
|
22
|
+
onClickHandler: () => void;
|
|
24
23
|
destroy: () => void;
|
|
25
24
|
showContextMenu: () => void;
|
|
26
25
|
showPopper: () => void;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/body-editor",
|
|
3
3
|
"description": "Prosemirror components for editing and viewing manuscripts",
|
|
4
|
-
"version": "1.9.
|
|
4
|
+
"version": "1.9.20-LEAN-3535.0",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|