@manuscripts/body-editor 2.5.6-date-fix.0 → 2.5.7
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/commands.js +121 -211
- package/dist/cjs/components/views/DeleteFootnoteDialog.js +2 -2
- package/dist/cjs/components/views/FootnotesSelector.js +18 -19
- package/dist/cjs/configs/ManuscriptsEditor.js +2 -1
- package/dist/cjs/configs/editor-plugins.js +0 -2
- package/dist/cjs/configs/editor-views.js +6 -4
- package/dist/cjs/icons.js +8 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/lib/comments.js +5 -1
- package/dist/cjs/lib/context-menu.js +21 -101
- package/dist/cjs/lib/doc.js +27 -4
- package/dist/cjs/lib/footnotes.js +31 -122
- package/dist/cjs/lib/plugins.js +8 -0
- package/dist/cjs/menus.js +1 -1
- package/dist/cjs/plugins/affiliations.js +2 -1
- package/dist/cjs/plugins/comments.js +10 -8
- package/dist/cjs/plugins/footnotes.js +188 -0
- package/dist/cjs/plugins/persist.js +4 -4
- package/dist/cjs/plugins/placeholder.js +19 -12
- package/dist/cjs/testing/default-editor-data.js +1 -1
- package/dist/cjs/testing/setup-editor.js +1 -0
- package/dist/cjs/versions.js +1 -1
- package/dist/cjs/views/editable_block.js +1 -1
- package/dist/cjs/views/footnote.js +117 -13
- package/dist/cjs/views/footnotes_element.js +10 -2
- package/dist/cjs/views/general_table_footnote.js +83 -0
- package/dist/cjs/views/inline_footnote.js +74 -124
- package/dist/cjs/views/table_element_footer.js +2 -5
- package/dist/es/commands.js +118 -207
- package/dist/es/components/views/DeleteFootnoteDialog.js +2 -2
- package/dist/es/components/views/FootnotesSelector.js +18 -19
- package/dist/es/configs/ManuscriptsEditor.js +2 -1
- package/dist/es/configs/editor-plugins.js +0 -2
- package/dist/es/configs/editor-views.js +4 -2
- package/dist/es/icons.js +5 -0
- package/dist/es/index.js +1 -0
- package/dist/es/lib/comments.js +3 -0
- package/dist/es/lib/context-menu.js +24 -101
- package/dist/es/lib/doc.js +25 -4
- package/dist/es/lib/footnotes.js +28 -116
- package/dist/es/lib/plugins.js +4 -0
- package/dist/es/menus.js +1 -1
- package/dist/es/plugins/affiliations.js +2 -1
- package/dist/es/plugins/comments.js +11 -9
- package/dist/es/plugins/footnotes.js +185 -0
- package/dist/es/plugins/persist.js +4 -4
- package/dist/es/plugins/placeholder.js +20 -11
- package/dist/es/testing/default-editor-data.js +1 -1
- package/dist/es/testing/setup-editor.js +1 -0
- package/dist/es/versions.js +1 -1
- package/dist/es/views/editable_block.js +1 -1
- package/dist/es/views/footnote.js +118 -13
- package/dist/es/views/footnotes_element.js +10 -2
- package/dist/es/views/general_table_footnote.js +76 -0
- package/dist/es/views/inline_footnote.js +78 -128
- package/dist/es/views/table_element_footer.js +4 -5
- package/dist/types/commands.d.ts +10 -14
- package/dist/types/components/views/DeleteFootnoteDialog.d.ts +2 -2
- package/dist/types/components/views/FootnotesSelector.d.ts +7 -7
- package/dist/types/configs/editor-views.d.ts +22 -35
- package/dist/types/icons.d.ts +2 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/lib/comments.d.ts +1 -0
- package/dist/types/lib/context-menu.d.ts +1 -3
- package/dist/types/lib/doc.d.ts +2 -0
- package/dist/types/lib/footnotes.d.ts +8 -19
- package/dist/types/lib/plugins.d.ts +3 -0
- package/dist/types/plugins/{footnotes/index.d.ts → footnotes.d.ts} +14 -11
- package/dist/types/plugins/placeholder.d.ts +0 -2
- package/dist/types/versions.d.ts +1 -1
- package/dist/types/views/footnote.d.ts +14 -6
- package/dist/types/views/footnotes_element.d.ts +1 -0
- package/dist/types/views/{table_element_footer_editable.d.ts → general_table_footnote.d.ts} +11 -2
- package/dist/types/views/inline_footnote.d.ts +8 -14
- package/dist/types/views/table_element_footer.d.ts +2 -2
- package/package.json +3 -3
- package/styles/Editor.css +35 -64
- package/dist/cjs/plugins/footnotes/index.js +0 -215
- package/dist/cjs/plugins/footnotes/widgets.js +0 -136
- package/dist/cjs/plugins/table-footnote.js +0 -46
- package/dist/cjs/views/footnote_editable.js +0 -21
- package/dist/cjs/views/footnotes_element_editable.js +0 -22
- package/dist/cjs/views/table_element_footer_editable.js +0 -20
- package/dist/es/plugins/footnotes/index.js +0 -211
- package/dist/es/plugins/footnotes/widgets.js +0 -127
- package/dist/es/plugins/table-footnote.js +0 -44
- package/dist/es/views/footnote_editable.js +0 -19
- package/dist/es/views/footnotes_element_editable.js +0 -20
- package/dist/es/views/table_element_footer_editable.js +0 -18
- package/dist/types/plugins/footnotes/widgets.d.ts +0 -22
- package/dist/types/plugins/table-footnote.d.ts +0 -3
- package/dist/types/views/footnote_editable.d.ts +0 -51
- package/dist/types/views/footnotes_element_editable.d.ts +0 -51
package/dist/cjs/commands.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.autoComplete = exports.mergeCellsWithSpace = exports.addColumns = exports.addRows = exports.
|
|
18
|
+
exports.autoComplete = exports.mergeCellsWithSpace = exports.addColumns = exports.addRows = exports.addInlineComment = exports.addNodeComment = exports.createAndFillTableElement = exports.selectAllIsolating = exports.ignoreAtomBlockNodeForward = exports.isAtEndOfTextBlock = exports.ignoreMetaNodeBackspaceCommand = exports.ignoreAtomBlockNodeBackward = exports.isTextSelection = exports.isAtStartOfTextBlock = exports.insertTOCSection = exports.insertBibliographySection = exports.insertList = exports.insertKeywords = exports.insertContributors = exports.insertAbstract = exports.insertBackMatterSection = exports.insertSection = exports.insertGraphicalAbstract = exports.insertBoxElement = exports.insertInlineFootnote = exports.insertFootnotesElement = exports.insertTableElementFooter = exports.insertInlineEquation = exports.insertCrossReference = exports.insertInlineCitation = exports.insertLink = exports.insertSectionLabel = exports.findPosBeforeFirstSubsection = exports.insertBreak = exports.deleteBlock = exports.insertBlock = exports.insertSupplement = exports.insertTable = exports.insertFigure = exports.insertGeneralTableFootnote = exports.insertInlineTableFootnote = exports.createBlock = exports.createSelection = exports.canInsert = exports.blockActive = exports.isNodeSelection = exports.markActive = exports.addToStart = void 0;
|
|
19
19
|
const json_schema_1 = require("@manuscripts/json-schema");
|
|
20
20
|
const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
|
|
21
21
|
const transform_1 = require("@manuscripts/transform");
|
|
@@ -34,7 +34,6 @@ const track_changes_utils_1 = require("./lib/track-changes-utils");
|
|
|
34
34
|
const utils_1 = require("./lib/utils");
|
|
35
35
|
const comments_2 = require("./plugins/comments");
|
|
36
36
|
const editor_props_1 = require("./plugins/editor-props");
|
|
37
|
-
const footnotes_2 = require("./plugins/footnotes");
|
|
38
37
|
const autocompletion_1 = require("./plugins/section_title/autocompletion");
|
|
39
38
|
const addToStart = (state, dispatch) => {
|
|
40
39
|
const { selection } = state;
|
|
@@ -162,48 +161,38 @@ const createBlock = (nodeType, position, state, dispatch, attrs) => {
|
|
|
162
161
|
}
|
|
163
162
|
};
|
|
164
163
|
exports.createBlock = createBlock;
|
|
165
|
-
const
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
const insertGeneralFootnote = (tableElementNode, position, view, tableElementFooter) => {
|
|
171
|
-
const { state, dispatch } = view;
|
|
172
|
-
const paragraph = state.schema.nodes.paragraph.create({
|
|
173
|
-
placeholder: 'Add general note here',
|
|
174
|
-
});
|
|
175
|
-
const generalNote = state.schema.nodes.general_table_footnote.create({}, [
|
|
176
|
-
paragraph,
|
|
177
|
-
]);
|
|
178
|
-
const tableColGroup = (0, prosemirror_utils_1.findChildrenByType)(tableElementNode, transform_1.schema.nodes.table_colgroup)[0];
|
|
179
|
-
const table = (0, prosemirror_utils_1.findChildrenByType)(tableElementNode, transform_1.schema.nodes.table)[0];
|
|
180
|
-
const tr = state.tr;
|
|
181
|
-
const pos = (tableElementFooter === null || tableElementFooter === void 0 ? void 0 : tableElementFooter.length)
|
|
182
|
-
? position + tableElementFooter[0].pos + 2
|
|
183
|
-
: position +
|
|
184
|
-
(!tableColGroup
|
|
185
|
-
? table.pos + table.node.nodeSize
|
|
186
|
-
: tableColGroup.pos + tableColGroup.node.nodeSize);
|
|
187
|
-
if (tableElementFooter === null || tableElementFooter === void 0 ? void 0 : tableElementFooter.length) {
|
|
188
|
-
if ((0, track_changes_utils_1.isDeleted)(tableElementFooter[0].node)) {
|
|
189
|
-
const tableElementFooterPos = tr.mapping.map(position + tableElementFooter[0].pos + 1);
|
|
190
|
-
(0, exports.undoFootnoteDelete)(tr, tableElementFooter[0], tableElementFooterPos);
|
|
191
|
-
}
|
|
192
|
-
tr.insert(pos, generalNote);
|
|
164
|
+
const insertInlineTableFootnote = (state, dispatch) => {
|
|
165
|
+
const $pos = state.selection.$to;
|
|
166
|
+
const table = (0, prosemirror_utils_1.findParentNodeOfTypeClosestToPos)($pos, transform_1.schema.nodes.table);
|
|
167
|
+
if (!table) {
|
|
168
|
+
return false;
|
|
193
169
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
id: (0, transform_1.generateNodeID)(transform_1.schema.nodes.table_element_footer),
|
|
197
|
-
}, [generalNote]);
|
|
198
|
-
tr.insert(pos, tableElementFooter);
|
|
170
|
+
if (!dispatch) {
|
|
171
|
+
return true;
|
|
199
172
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
173
|
+
return (0, exports.insertInlineFootnote)(state, dispatch);
|
|
174
|
+
};
|
|
175
|
+
exports.insertInlineTableFootnote = insertInlineTableFootnote;
|
|
176
|
+
const insertGeneralTableFootnote = (element, state, dispatch) => {
|
|
177
|
+
const existing = (0, prosemirror_utils_1.findChildrenByType)(element[0], transform_1.schema.nodes.general_table_footnote);
|
|
178
|
+
if (existing.length) {
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
if (!dispatch) {
|
|
182
|
+
return true;
|
|
204
183
|
}
|
|
184
|
+
const tr = state.tr;
|
|
185
|
+
const footer = (0, exports.insertTableElementFooter)(tr, element);
|
|
186
|
+
const pos = footer.pos + 1;
|
|
187
|
+
const node = transform_1.schema.nodes.general_table_footnote.create({}, [
|
|
188
|
+
transform_1.schema.nodes.paragraph.create(),
|
|
189
|
+
]);
|
|
190
|
+
tr.insert(pos, node);
|
|
191
|
+
const selection = prosemirror_state_1.TextSelection.create(tr.doc, pos + 1);
|
|
192
|
+
tr.setSelection(selection).scrollIntoView();
|
|
193
|
+
dispatch(tr);
|
|
205
194
|
};
|
|
206
|
-
exports.
|
|
195
|
+
exports.insertGeneralTableFootnote = insertGeneralTableFootnote;
|
|
207
196
|
const insertFigure = (file, state, dispatch) => {
|
|
208
197
|
const position = findBlockInsertPosition(state);
|
|
209
198
|
if (position === null || !dispatch) {
|
|
@@ -404,81 +393,72 @@ const insertInlineEquation = (state, dispatch) => {
|
|
|
404
393
|
return true;
|
|
405
394
|
};
|
|
406
395
|
exports.insertInlineEquation = insertInlineEquation;
|
|
407
|
-
const
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
396
|
+
const insertTableElementFooter = (tr, table) => {
|
|
397
|
+
const footer = (0, prosemirror_utils_1.findChildrenByType)(table[0], transform_1.schema.nodes.table_element_footer)[0];
|
|
398
|
+
if (footer) {
|
|
399
|
+
const pos = tr.mapping.map(table[1] + footer.pos + 1);
|
|
400
|
+
if ((0, track_changes_utils_1.isDeleted)(footer.node)) {
|
|
401
|
+
reinstateNode(tr, footer.node, pos);
|
|
402
|
+
}
|
|
403
|
+
return {
|
|
404
|
+
node: footer.node,
|
|
405
|
+
pos,
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
const pos = tr.mapping.map(table[1] + table[0].nodeSize - 2);
|
|
409
|
+
const node = transform_1.schema.nodes.table_element_footer.create();
|
|
410
|
+
tr.insert(pos, node);
|
|
411
|
+
return {
|
|
412
|
+
node,
|
|
413
|
+
pos,
|
|
414
|
+
};
|
|
412
415
|
};
|
|
413
|
-
exports.
|
|
414
|
-
const
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
state.schema.nodes.section_title.create({}, state.schema.text('Footnotes')),
|
|
420
|
-
state.schema.nodes.footnotes_element.create({}, footnote),
|
|
421
|
-
]);
|
|
422
|
-
const backmatter = (0, prosemirror_utils_1.findChildrenByType)(tr.doc, transform_1.schema.nodes.backmatter)[0];
|
|
423
|
-
const sectionPos = backmatter.pos + 1;
|
|
424
|
-
tr.insert(sectionPos, section);
|
|
425
|
-
let footnotePos = 0;
|
|
426
|
-
section.descendants((n, pos) => {
|
|
427
|
-
if ((0, transform_1.isFootnoteNode)(n)) {
|
|
428
|
-
footnotePos = pos;
|
|
429
|
-
n.descendants((childNode, childPos) => {
|
|
430
|
-
if ((0, transform_1.isParagraphNode)(childNode)) {
|
|
431
|
-
footnotePos += childPos;
|
|
432
|
-
}
|
|
433
|
-
});
|
|
434
|
-
}
|
|
435
|
-
});
|
|
436
|
-
selectionPos = sectionPos + footnotePos;
|
|
416
|
+
exports.insertTableElementFooter = insertTableElementFooter;
|
|
417
|
+
const insertFootnotesElement = (tr, container) => {
|
|
418
|
+
let pos;
|
|
419
|
+
if ((0, transform_1.isTableElementNode)(container[0])) {
|
|
420
|
+
const footer = (0, exports.insertTableElementFooter)(tr, container);
|
|
421
|
+
pos = footer.pos + footer.node.nodeSize - 1;
|
|
437
422
|
}
|
|
438
423
|
else {
|
|
439
|
-
const
|
|
440
|
-
|
|
441
|
-
if ((0, track_changes_utils_1.isDeleted)(footnoteElement.node)) {
|
|
442
|
-
const footnoteElementPos = footnotesSection.pos + footnoteElement.pos + 1;
|
|
443
|
-
(0, exports.undoFootnoteDelete)(tr, footnoteElement, footnoteElementPos);
|
|
444
|
-
const updatedAttrs = Object.assign(Object.assign({}, footnoteElement.node.attrs), { dataTracked: null });
|
|
445
|
-
tr.setNodeMarkup(footnoteElementPos, undefined, updatedAttrs, footnoteElement.node.marks);
|
|
446
|
-
}
|
|
447
|
-
const pos = footnotesSection.pos +
|
|
448
|
-
footnoteElement.pos +
|
|
449
|
-
footnoteElement.node.nodeSize -
|
|
450
|
-
1;
|
|
451
|
-
tr.insert(pos, footnote);
|
|
452
|
-
selectionPos = pos + 2;
|
|
453
|
-
}
|
|
454
|
-
else {
|
|
455
|
-
const footnoteElement = transform_1.schema.nodes.footnotes_element.create({}, footnote);
|
|
456
|
-
const pos = footnotesSection.pos + footnotesSection.node.nodeSize - 1;
|
|
457
|
-
tr.insert(pos, footnoteElement);
|
|
458
|
-
selectionPos = pos + 2;
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
if (selectionPos) {
|
|
462
|
-
const selection = prosemirror_state_1.TextSelection.near(tr.doc.resolve(selectionPos));
|
|
463
|
-
tr.setSelection(selection).scrollIntoView();
|
|
424
|
+
const section = (0, doc_1.insertFootnotesSection)(tr);
|
|
425
|
+
pos = section.pos + section.node.nodeSize - 1;
|
|
464
426
|
}
|
|
465
|
-
|
|
427
|
+
const node = transform_1.schema.nodes.footnotes_element.create();
|
|
428
|
+
tr.insert(pos, node);
|
|
429
|
+
return [node, pos];
|
|
466
430
|
};
|
|
467
|
-
exports.
|
|
468
|
-
const insertInlineFootnote = (
|
|
469
|
-
const
|
|
470
|
-
const
|
|
471
|
-
const
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
const
|
|
475
|
-
|
|
476
|
-
const node = state.schema.nodes.inline_footnote.create({
|
|
431
|
+
exports.insertFootnotesElement = insertFootnotesElement;
|
|
432
|
+
const insertInlineFootnote = (state, dispatch) => {
|
|
433
|
+
const pos = state.selection.to;
|
|
434
|
+
const tr = state.tr;
|
|
435
|
+
const container = (0, footnotes_1.findFootnotesContainerNode)(state.doc, pos);
|
|
436
|
+
const fn = (0, footnotes_1.getFootnotesElementState)(state, container.node.attrs.id);
|
|
437
|
+
const hasUnusedFootnotes = fn && fn.unusedFootnoteIDs.size > 0;
|
|
438
|
+
const footnote = !hasUnusedFootnotes && (0, footnotes_1.createFootnote)();
|
|
439
|
+
const node = transform_1.schema.nodes.inline_footnote.create({
|
|
477
440
|
rids: footnote ? [footnote.attrs.id] : [],
|
|
478
441
|
});
|
|
479
|
-
tr.insert(
|
|
442
|
+
tr.insert(pos, node);
|
|
480
443
|
if (footnote) {
|
|
481
|
-
|
|
444
|
+
let element;
|
|
445
|
+
if (fn) {
|
|
446
|
+
element = [fn.element[0], tr.mapping.map(fn.element[1])];
|
|
447
|
+
}
|
|
448
|
+
else {
|
|
449
|
+
element = (0, exports.insertFootnotesElement)(tr, [container.node, container.pos]);
|
|
450
|
+
}
|
|
451
|
+
if ((0, track_changes_utils_1.isDeleted)(element[0])) {
|
|
452
|
+
reinstateNode(tr, element[0], element[1]);
|
|
453
|
+
}
|
|
454
|
+
const fnPos = element[1] + element[0].nodeSize - 1;
|
|
455
|
+
tr.insert(fnPos, footnote);
|
|
456
|
+
const selection = prosemirror_state_1.TextSelection.create(tr.doc, fnPos + 2);
|
|
457
|
+
tr.setSelection(selection).scrollIntoView();
|
|
458
|
+
}
|
|
459
|
+
else {
|
|
460
|
+
const selection = prosemirror_state_1.NodeSelection.create(tr.doc, pos);
|
|
461
|
+
tr.setSelection(selection).scrollIntoView();
|
|
482
462
|
}
|
|
483
463
|
if (dispatch) {
|
|
484
464
|
dispatch(tr);
|
|
@@ -486,6 +466,34 @@ const insertInlineFootnote = (kind) => (state, dispatch) => {
|
|
|
486
466
|
return true;
|
|
487
467
|
};
|
|
488
468
|
exports.insertInlineFootnote = insertInlineFootnote;
|
|
469
|
+
const reinstateNode = (tr, node, pos) => {
|
|
470
|
+
const attrs = Object.assign(Object.assign({}, node.attrs), { dataTracked: null });
|
|
471
|
+
tr.setNodeMarkup(pos, null, attrs);
|
|
472
|
+
};
|
|
473
|
+
const insertBoxElement = (state, dispatch) => {
|
|
474
|
+
const selection = state.selection;
|
|
475
|
+
const isBody = (0, prosemirror_utils_1.hasParentNodeOfType)(transform_1.schema.nodes.body)(selection);
|
|
476
|
+
const isBoxText = (0, prosemirror_utils_1.hasParentNodeOfType)(transform_1.schema.nodes.box_element)(selection);
|
|
477
|
+
if (!isBody || isBoxText) {
|
|
478
|
+
return false;
|
|
479
|
+
}
|
|
480
|
+
const position = findBlockInsertPosition(state);
|
|
481
|
+
const paragraph = transform_1.schema.nodes.paragraph.create({});
|
|
482
|
+
const section = transform_1.schema.nodes.section.createAndFill({}, [
|
|
483
|
+
transform_1.schema.nodes.section_title.create(),
|
|
484
|
+
paragraph,
|
|
485
|
+
]);
|
|
486
|
+
const node = transform_1.schema.nodes.box_element.createAndFill({}, [
|
|
487
|
+
transform_1.schema.nodes.figcaption.create({}, [transform_1.schema.nodes.caption_title.create()]),
|
|
488
|
+
section,
|
|
489
|
+
]);
|
|
490
|
+
if (position && dispatch) {
|
|
491
|
+
const tr = state.tr.insert(position, node);
|
|
492
|
+
dispatch(tr);
|
|
493
|
+
}
|
|
494
|
+
return true;
|
|
495
|
+
};
|
|
496
|
+
exports.insertBoxElement = insertBoxElement;
|
|
489
497
|
const insertGraphicalAbstract = (state, dispatch, view) => {
|
|
490
498
|
if ((0, utils_1.getChildOfType)(state.doc, transform_1.schema.nodes.graphical_abstract_section, true)) {
|
|
491
499
|
return false;
|
|
@@ -975,6 +983,11 @@ const addInlineComment = (state, dispatch) => {
|
|
|
975
983
|
}
|
|
976
984
|
let from = selection.from;
|
|
977
985
|
let to = selection.to;
|
|
986
|
+
if (from === to) {
|
|
987
|
+
const result = (0, helpers_1.findWordBoundaries)(state, from);
|
|
988
|
+
from = result.from;
|
|
989
|
+
to = result.to;
|
|
990
|
+
}
|
|
978
991
|
const props = (0, editor_props_1.getEditorProps)(state);
|
|
979
992
|
const contribution = (0, json_schema_1.buildContribution)(props.userID);
|
|
980
993
|
const attrs = {
|
|
@@ -982,7 +995,7 @@ const addInlineComment = (state, dispatch) => {
|
|
|
982
995
|
contents: '',
|
|
983
996
|
target: node.attrs.id,
|
|
984
997
|
contributions: [contribution],
|
|
985
|
-
originalText: selectedText(),
|
|
998
|
+
originalText: selectedText() || state.doc.textBetween(from, to),
|
|
986
999
|
selector: {
|
|
987
1000
|
from,
|
|
988
1001
|
to,
|
|
@@ -993,11 +1006,6 @@ const addInlineComment = (state, dispatch) => {
|
|
|
993
1006
|
if (comments) {
|
|
994
1007
|
const pos = comments.pos + 1;
|
|
995
1008
|
const tr = state.tr.insert(pos, comment);
|
|
996
|
-
if (from === to) {
|
|
997
|
-
const result = (0, helpers_1.findWordBoundaries)(state, from);
|
|
998
|
-
from = result.from;
|
|
999
|
-
to = result.to;
|
|
1000
|
-
}
|
|
1001
1009
|
const start = transform_1.schema.nodes.highlight_marker.create({
|
|
1002
1010
|
id: comment.attrs.id,
|
|
1003
1011
|
tid: node.attrs.id,
|
|
@@ -1020,104 +1028,6 @@ const addInlineComment = (state, dispatch) => {
|
|
|
1020
1028
|
return false;
|
|
1021
1029
|
};
|
|
1022
1030
|
exports.addInlineComment = addInlineComment;
|
|
1023
|
-
const insertTableFootnote = (tableElementNode, position, view, inlineFootnote) => {
|
|
1024
|
-
const { state, dispatch } = view;
|
|
1025
|
-
const tr = state.tr;
|
|
1026
|
-
const footnote = transform_1.schema.nodes.footnote.createAndFill({
|
|
1027
|
-
id: (0, transform_1.generateNodeID)(transform_1.schema.nodes.footnote),
|
|
1028
|
-
kind: 'footnote',
|
|
1029
|
-
});
|
|
1030
|
-
const insertedAt = state.selection.to;
|
|
1031
|
-
let footnoteIndex;
|
|
1032
|
-
if (inlineFootnote) {
|
|
1033
|
-
const contents = inlineFootnote.node.attrs.contents.split(',').map(Number);
|
|
1034
|
-
footnoteIndex = Math.max(...contents) + 1;
|
|
1035
|
-
tr.setNodeMarkup(inlineFootnote.pos, undefined, {
|
|
1036
|
-
rids: [...inlineFootnote.node.attrs.rids, footnote.attrs.id],
|
|
1037
|
-
contents: inlineFootnote.node.attrs.contents + ',' + footnoteIndex,
|
|
1038
|
-
});
|
|
1039
|
-
}
|
|
1040
|
-
else {
|
|
1041
|
-
const inlineFootnotes = (0, prosemirror_utils_1.findChildrenByType)(tableElementNode, transform_1.schema.nodes.inline_footnote);
|
|
1042
|
-
footnoteIndex =
|
|
1043
|
-
inlineFootnotes.filter(({ pos }) => position + pos <= insertedAt).length +
|
|
1044
|
-
1;
|
|
1045
|
-
const inlineFootnoteNode = state.schema.nodes.inline_footnote.create({
|
|
1046
|
-
rids: [footnote.attrs.id],
|
|
1047
|
-
contents: footnoteIndex === -1 ? inlineFootnotes.length : footnoteIndex,
|
|
1048
|
-
});
|
|
1049
|
-
tr.insert(insertedAt, inlineFootnoteNode);
|
|
1050
|
-
}
|
|
1051
|
-
let insertionPos = position;
|
|
1052
|
-
const footnotesElement = (0, prosemirror_utils_1.findChildrenByType)(tableElementNode, transform_1.schema.nodes.footnotes_element).pop();
|
|
1053
|
-
if (footnotesElement) {
|
|
1054
|
-
if ((0, track_changes_utils_1.isDeleted)(footnotesElement.node)) {
|
|
1055
|
-
const footnotesElementPos = tr.mapping.map(position + footnotesElement.pos + 1);
|
|
1056
|
-
(0, exports.undoFootnoteDelete)(tr, footnotesElement, footnotesElementPos);
|
|
1057
|
-
}
|
|
1058
|
-
const footnotePos = (0, footnotes_1.getNewFootnotePos)(footnotesElement, footnoteIndex);
|
|
1059
|
-
insertionPos = tr.mapping.map(position + footnotePos);
|
|
1060
|
-
tr.insert(insertionPos, footnote);
|
|
1061
|
-
}
|
|
1062
|
-
else {
|
|
1063
|
-
const footnoteElement = state.schema.nodes.footnotes_element.create({}, footnote);
|
|
1064
|
-
const tableElementFooter = (0, prosemirror_utils_1.findChildrenByType)(tableElementNode, transform_1.schema.nodes.table_element_footer)[0];
|
|
1065
|
-
if (tableElementFooter) {
|
|
1066
|
-
if ((0, track_changes_utils_1.isDeleted)(tableElementFooter.node)) {
|
|
1067
|
-
const tableElementFooterPos = tr.mapping.map(position + tableElementFooter.pos + 1);
|
|
1068
|
-
(0, exports.undoFootnoteDelete)(tr, tableElementFooter, tableElementFooterPos);
|
|
1069
|
-
}
|
|
1070
|
-
const pos = tableElementFooter.pos;
|
|
1071
|
-
insertionPos = position + pos + tableElementFooter.node.nodeSize;
|
|
1072
|
-
tr.insert(tr.mapping.map(insertionPos), footnoteElement);
|
|
1073
|
-
}
|
|
1074
|
-
else {
|
|
1075
|
-
const tableElementFooter = transform_1.schema.nodes.table_element_footer.create({
|
|
1076
|
-
id: (0, transform_1.generateNodeID)(transform_1.schema.nodes.table_element_footer),
|
|
1077
|
-
}, [footnoteElement]);
|
|
1078
|
-
const tableColGroup = (0, prosemirror_utils_1.findChildrenByType)(tableElementNode, transform_1.schema.nodes.table_colgroup)[0];
|
|
1079
|
-
const table = (0, prosemirror_utils_1.findChildrenByType)(tableElementNode, transform_1.schema.nodes.table)[0];
|
|
1080
|
-
if (tableColGroup) {
|
|
1081
|
-
insertionPos =
|
|
1082
|
-
position + tableColGroup.pos + tableColGroup.node.nodeSize;
|
|
1083
|
-
tr.insert(tr.mapping.map(insertionPos), tableElementFooter);
|
|
1084
|
-
}
|
|
1085
|
-
else {
|
|
1086
|
-
insertionPos = position + table.pos + table.node.nodeSize;
|
|
1087
|
-
tr.insert(tr.mapping.map(insertionPos), tableElementFooter);
|
|
1088
|
-
}
|
|
1089
|
-
}
|
|
1090
|
-
}
|
|
1091
|
-
dispatch(tr);
|
|
1092
|
-
const textSelection = prosemirror_state_1.TextSelection.near(view.state.tr.doc.resolve(insertionPos + 1));
|
|
1093
|
-
view.focus();
|
|
1094
|
-
dispatch(view.state.tr.setSelection(textSelection).scrollIntoView());
|
|
1095
|
-
};
|
|
1096
|
-
exports.insertTableFootnote = insertTableFootnote;
|
|
1097
|
-
const insertBoxElement = (state, dispatch) => {
|
|
1098
|
-
const selection = state.selection;
|
|
1099
|
-
const isBody = (0, prosemirror_utils_1.hasParentNodeOfType)(transform_1.schema.nodes.body)(selection);
|
|
1100
|
-
const isBoxText = (0, prosemirror_utils_1.hasParentNodeOfType)(transform_1.schema.nodes.box_element)(selection);
|
|
1101
|
-
if (!isBody || isBoxText) {
|
|
1102
|
-
return false;
|
|
1103
|
-
}
|
|
1104
|
-
const position = findBlockInsertPosition(state);
|
|
1105
|
-
const paragraph = transform_1.schema.nodes.paragraph.create({});
|
|
1106
|
-
const section = transform_1.schema.nodes.section.createAndFill({}, [
|
|
1107
|
-
transform_1.schema.nodes.section_title.create(),
|
|
1108
|
-
paragraph,
|
|
1109
|
-
]);
|
|
1110
|
-
const BoxElementNode = transform_1.schema.nodes.box_element.createAndFill({}, [
|
|
1111
|
-
transform_1.schema.nodes.figcaption.create({}, [transform_1.schema.nodes.caption_title.create()]),
|
|
1112
|
-
section,
|
|
1113
|
-
]);
|
|
1114
|
-
if (position && dispatch) {
|
|
1115
|
-
const tr = state.tr.insert(position, BoxElementNode);
|
|
1116
|
-
dispatch(tr);
|
|
1117
|
-
}
|
|
1118
|
-
return true;
|
|
1119
|
-
};
|
|
1120
|
-
exports.insertBoxElement = insertBoxElement;
|
|
1121
1031
|
const addRows = (direction) => (state, dispatch) => {
|
|
1122
1032
|
if (dispatch) {
|
|
1123
1033
|
const { tr } = state;
|
|
@@ -26,7 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.DeleteFootnoteDialog = void 0;
|
|
27
27
|
const style_guide_1 = require("@manuscripts/style-guide");
|
|
28
28
|
const react_1 = __importStar(require("react"));
|
|
29
|
-
const DeleteFootnoteDialog = ({
|
|
29
|
+
const DeleteFootnoteDialog = ({ header, message, handleDelete, }) => {
|
|
30
30
|
const [isOpen, setOpen] = (0, react_1.useState)(true);
|
|
31
31
|
return (react_1.default.createElement(style_guide_1.Dialog, { className: "delete-footnote-dialog", isOpen: isOpen, actions: {
|
|
32
32
|
primary: {
|
|
@@ -40,6 +40,6 @@ const DeleteFootnoteDialog = ({ footnoteType, footnoteMessage, handleDelete, })
|
|
|
40
40
|
action: () => setOpen(false),
|
|
41
41
|
title: 'Cancel',
|
|
42
42
|
},
|
|
43
|
-
}, category: style_guide_1.Category.confirmation, header:
|
|
43
|
+
}, category: style_guide_1.Category.confirmation, header: header, message: message }));
|
|
44
44
|
};
|
|
45
45
|
exports.DeleteFootnoteDialog = DeleteFootnoteDialog;
|
|
@@ -76,12 +76,12 @@ const AddNewFootnote = (0, styled_components_1.default)(style_guide_1.ButtonGrou
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
`;
|
|
79
|
-
const FootnotesSelector = ({
|
|
79
|
+
const FootnotesSelector = ({ footnotes, inlineFootnote, labels, onAdd, onInsert, onCancel, }) => {
|
|
80
80
|
let selectedNotesMap;
|
|
81
81
|
if (inlineFootnote) {
|
|
82
82
|
const rids = inlineFootnote.attrs.rids;
|
|
83
|
-
const selectedNotes =
|
|
84
|
-
selectedNotesMap = new Map(selectedNotes.map((
|
|
83
|
+
const selectedNotes = footnotes.filter((node) => rids.includes(node.attrs.id));
|
|
84
|
+
selectedNotesMap = new Map(selectedNotes.map((node) => [node.attrs.id, node]));
|
|
85
85
|
}
|
|
86
86
|
const [selections, setSelections] = (0, react_1.useState)(new Map(selectedNotesMap));
|
|
87
87
|
const toggleSelection = (item) => {
|
|
@@ -99,44 +99,43 @@ const FootnotesSelector = ({ notes, inlineFootnote, onAdd, onInsert, onCancel, a
|
|
|
99
99
|
return selections.has(item.attrs.id);
|
|
100
100
|
};
|
|
101
101
|
const handleClick = () => {
|
|
102
|
-
return onInsert(
|
|
102
|
+
return onInsert(footnotes.filter((node) => selections.has(node.attrs.id)));
|
|
103
103
|
};
|
|
104
104
|
return (react_1.default.createElement(Container, null,
|
|
105
105
|
react_1.default.createElement(NotesContainer, null,
|
|
106
|
-
react_1.default.createElement(FootnotesList, {
|
|
106
|
+
react_1.default.createElement(FootnotesList, { footnotes: footnotes, inlineFootnote: inlineFootnote, labels: labels, isSelected: isSelected, onSelect: toggleSelection })),
|
|
107
107
|
react_1.default.createElement(Actions, null,
|
|
108
108
|
react_1.default.createElement(AddNewFootnote, null,
|
|
109
109
|
react_1.default.createElement(style_guide_1.IconTextButton, { onClick: onAdd },
|
|
110
110
|
react_1.default.createElement(style_guide_1.AddNewIcon, null),
|
|
111
|
-
|
|
111
|
+
"Add new")),
|
|
112
112
|
react_1.default.createElement(style_guide_1.ButtonGroup, null,
|
|
113
113
|
react_1.default.createElement(style_guide_1.SecondaryButton, { onClick: onCancel }, "Cancel"),
|
|
114
114
|
react_1.default.createElement(style_guide_1.PrimaryButton, { onClick: handleClick, disabled: selections.size === 0 && !inlineFootnote }, inlineFootnote ? 'Update' : 'Insert')))));
|
|
115
115
|
};
|
|
116
116
|
exports.FootnotesSelector = FootnotesSelector;
|
|
117
|
-
const FootnotesList = ({
|
|
117
|
+
const FootnotesList = ({ footnotes, inlineFootnote, labels, isSelected, onSelect }) => {
|
|
118
|
+
const rids = inlineFootnote === null || inlineFootnote === void 0 ? void 0 : inlineFootnote.attrs.rids;
|
|
118
119
|
const selectedNotes = [];
|
|
119
120
|
const remainingNotes = [];
|
|
120
|
-
|
|
121
|
-
const isNoteSelected =
|
|
121
|
+
footnotes.forEach((footnote) => {
|
|
122
|
+
const isNoteSelected = rids === null || rids === void 0 ? void 0 : rids.includes(footnote.attrs.id);
|
|
122
123
|
if (isNoteSelected) {
|
|
123
|
-
selectedNotes.push(
|
|
124
|
+
selectedNotes.push(footnote);
|
|
124
125
|
}
|
|
125
126
|
else {
|
|
126
|
-
remainingNotes.push(
|
|
127
|
+
remainingNotes.push(footnote);
|
|
127
128
|
}
|
|
128
129
|
});
|
|
129
130
|
return (react_1.default.createElement(NotesListContainer, null,
|
|
130
|
-
selectedNotes.map((
|
|
131
|
+
selectedNotes.map((footnote) => (react_1.default.createElement(FootnoteItem, { key: footnote.attrs.id, footnote: footnote, label: labels.get(footnote.attrs.id), isSelected: isSelected, onSelect: onSelect }))),
|
|
131
132
|
selectedNotes.length > 0 && remainingNotes.length > 0 && react_1.default.createElement(Separator, null),
|
|
132
|
-
remainingNotes.map((
|
|
133
|
+
remainingNotes.map((footnote) => (react_1.default.createElement(FootnoteItem, { key: footnote.attrs.id, footnote: footnote, label: labels.get(footnote.attrs.id), isSelected: isSelected, onSelect: onSelect })))));
|
|
133
134
|
};
|
|
134
|
-
const FootnoteItem = ({
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
react_1.default.createElement(StatusIcon, null, isSelected(node) ? (react_1.default.createElement(style_guide_1.AddedIcon, { "data-cy": 'plus-icon-ok' })) : (react_1.default.createElement(style_guide_1.AddIcon, { "data-cy": 'plus-icon' }))),
|
|
139
|
-
react_1.default.createElement(NoteText, null, (index ? index + '. ' : '') + ((_a = node.firstChild) === null || _a === void 0 ? void 0 : _a.textContent))));
|
|
135
|
+
const FootnoteItem = ({ footnote, label, isSelected, onSelect }) => {
|
|
136
|
+
return (react_1.default.createElement(FootnoteItemContainer, { onClick: () => onSelect(footnote) },
|
|
137
|
+
react_1.default.createElement(StatusIcon, null, isSelected(footnote) ? (react_1.default.createElement(style_guide_1.AddedIcon, { "data-cy": 'plus-icon-ok' })) : (react_1.default.createElement(style_guide_1.AddIcon, { "data-cy": 'plus-icon' }))),
|
|
138
|
+
react_1.default.createElement(NoteText, null, (label ? label + '. ' : '') + footnote.textContent)));
|
|
140
139
|
};
|
|
141
140
|
const Separator = styled_components_1.default.div `
|
|
142
141
|
height: 0;
|
|
@@ -26,6 +26,7 @@ const prosemirror_view_1 = require("prosemirror-view");
|
|
|
26
26
|
const clipboard_1 = require("../clipboard");
|
|
27
27
|
const helpers_1 = require("../lib/helpers");
|
|
28
28
|
const paste_1 = require("../lib/paste");
|
|
29
|
+
const plugins_1 = require("../lib/plugins");
|
|
29
30
|
const editor_plugins_1 = __importDefault(require("./editor-plugins"));
|
|
30
31
|
const editor_views_1 = __importDefault(require("./editor-views"));
|
|
31
32
|
const createEditorState = (props) => prosemirror_state_1.EditorState.create({
|
|
@@ -58,7 +59,7 @@ const createEditorView = (props, root, state, dispatch) => {
|
|
|
58
59
|
}
|
|
59
60
|
},
|
|
60
61
|
});
|
|
61
|
-
const tr = view.state.tr.setMeta(
|
|
62
|
+
const tr = view.state.tr.setMeta(plugins_1.INIT_META, true);
|
|
62
63
|
const nextState = view.state.apply(tr);
|
|
63
64
|
view.updateState(nextState);
|
|
64
65
|
return view;
|
|
@@ -41,7 +41,6 @@ const section_title_1 = __importDefault(require("../plugins/section_title"));
|
|
|
41
41
|
const section_category_1 = __importDefault(require("../plugins/section-category"));
|
|
42
42
|
const sections_1 = __importDefault(require("../plugins/sections"));
|
|
43
43
|
const selected_suggestion_1 = __importDefault(require("../plugins/selected-suggestion"));
|
|
44
|
-
const table_footnote_1 = __importDefault(require("../plugins/table-footnote"));
|
|
45
44
|
const tables_cursor_fix_1 = __importDefault(require("../plugins/tables-cursor-fix"));
|
|
46
45
|
const toc_1 = __importDefault(require("../plugins/toc"));
|
|
47
46
|
const rules_1 = __importDefault(require("../rules"));
|
|
@@ -73,7 +72,6 @@ exports.default = (props) => {
|
|
|
73
72
|
(0, prosemirror_tables_1.tableEditing)(),
|
|
74
73
|
(0, selected_suggestion_1.default)(),
|
|
75
74
|
(0, footnotes_1.default)(props),
|
|
76
|
-
(0, table_footnote_1.default)(),
|
|
77
75
|
(0, editor_props_1.default)(props),
|
|
78
76
|
(0, doi_1.default)(),
|
|
79
77
|
(0, section_category_1.default)(props),
|
|
@@ -31,8 +31,9 @@ const equation_editable_1 = __importDefault(require("../views/equation_editable"
|
|
|
31
31
|
const equation_element_editable_1 = __importDefault(require("../views/equation_element_editable"));
|
|
32
32
|
const figure_editable_1 = __importDefault(require("../views/figure_editable"));
|
|
33
33
|
const figure_element_editable_1 = __importDefault(require("../views/figure_element_editable"));
|
|
34
|
-
const
|
|
34
|
+
const footnote_1 = __importDefault(require("../views/footnote"));
|
|
35
35
|
const footnotes_element_1 = __importDefault(require("../views/footnotes_element"));
|
|
36
|
+
const general_table_footnote_1 = __importDefault(require("../views/general_table_footnote"));
|
|
36
37
|
const inline_equation_editable_1 = __importDefault(require("../views/inline_equation_editable"));
|
|
37
38
|
const inline_footnote_editable_1 = __importDefault(require("../views/inline_footnote_editable"));
|
|
38
39
|
const keyword_1 = __importDefault(require("../views/keyword"));
|
|
@@ -49,7 +50,7 @@ const section_label_1 = __importDefault(require("../views/section_label"));
|
|
|
49
50
|
const section_title_editable_1 = __importDefault(require("../views/section_title_editable"));
|
|
50
51
|
const table_cell_1 = __importDefault(require("../views/table_cell"));
|
|
51
52
|
const table_element_editable_1 = __importDefault(require("../views/table_element_editable"));
|
|
52
|
-
const
|
|
53
|
+
const table_element_footer_1 = __importDefault(require("../views/table_element_footer"));
|
|
53
54
|
const title_editable_1 = __importDefault(require("../views/title_editable"));
|
|
54
55
|
const toc_element_editable_1 = __importDefault(require("../views/toc_element_editable"));
|
|
55
56
|
exports.default = (props, dispatch) => {
|
|
@@ -66,8 +67,9 @@ exports.default = (props, dispatch) => {
|
|
|
66
67
|
equation_element: (0, equation_element_editable_1.default)(props),
|
|
67
68
|
figure: (0, figure_editable_1.default)(props, dispatch),
|
|
68
69
|
figure_element: (0, figure_element_editable_1.default)(props, dispatch),
|
|
69
|
-
footnote: (0,
|
|
70
|
+
footnote: (0, footnote_1.default)(props),
|
|
70
71
|
footnotes_element: (0, footnotes_element_1.default)(props),
|
|
72
|
+
general_table_footnote: (0, general_table_footnote_1.default)(props, dispatch),
|
|
71
73
|
inline_equation: (0, inline_equation_editable_1.default)(props),
|
|
72
74
|
inline_footnote: (0, inline_footnote_editable_1.default)(props, dispatch),
|
|
73
75
|
keyword: (0, keyword_1.default)(props, dispatch),
|
|
@@ -85,7 +87,7 @@ exports.default = (props, dispatch) => {
|
|
|
85
87
|
table_element: (0, table_element_editable_1.default)(props),
|
|
86
88
|
table_cell: (0, table_cell_1.default)(props),
|
|
87
89
|
table_header: (0, table_cell_1.default)(props),
|
|
88
|
-
table_element_footer: (0,
|
|
90
|
+
table_element_footer: (0, table_element_footer_1.default)(props),
|
|
89
91
|
toc_element: (0, toc_element_editable_1.default)(props),
|
|
90
92
|
comments: (0, empty_1.default)('comments'),
|
|
91
93
|
supplements: (0, empty_1.default)('supplements'),
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteIcon = exports.alertIcon = void 0;
|
|
4
|
+
const style_guide_1 = require("@manuscripts/style-guide");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const server_1 = require("react-dom/server");
|
|
7
|
+
exports.alertIcon = (0, server_1.renderToStaticMarkup)((0, react_1.createElement)(style_guide_1.AlertIcon));
|
|
8
|
+
exports.deleteIcon = (0, server_1.renderToStaticMarkup)((0, react_1.createElement)(style_guide_1.DeleteIcon));
|
package/dist/cjs/index.js
CHANGED
|
@@ -47,6 +47,7 @@ Object.defineProperty(exports, "PopperManager", { enumerable: true, get: functio
|
|
|
47
47
|
__exportStar(require("./toolbar"), exports);
|
|
48
48
|
__exportStar(require("./lib/comments"), exports);
|
|
49
49
|
__exportStar(require("./lib/files"), exports);
|
|
50
|
+
__exportStar(require("./lib/footnotes"), exports);
|
|
50
51
|
__exportStar(require("./lib/doc"), exports);
|
|
51
52
|
__exportStar(require("./plugins/comments"), exports);
|
|
52
53
|
var selected_suggestion_1 = require("./plugins/selected-suggestion");
|
package/dist/cjs/lib/comments.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createCommentMarker = exports.getCommentRange = exports.getCommentKey = exports.isNodeComment = void 0;
|
|
3
|
+
exports.createCommentMarker = exports.getCommentRange = exports.getCommentKey = exports.isReply = exports.isNodeComment = void 0;
|
|
4
4
|
const isNodeComment = (c) => !c.range;
|
|
5
5
|
exports.isNodeComment = isNodeComment;
|
|
6
|
+
const isReply = (comment) => {
|
|
7
|
+
return comment.node.attrs.target.includes('MPCommentAnnotation');
|
|
8
|
+
};
|
|
9
|
+
exports.isReply = isReply;
|
|
6
10
|
const getCommentKey = (comment, range, target) => {
|
|
7
11
|
if (!range) {
|
|
8
12
|
return target.attrs.id;
|