@manuscripts/body-editor 1.2.19 → 1.2.20-LEAN-2623
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 +1 -19
- package/dist/cjs/menus.js +0 -6
- package/dist/es/commands.js +0 -17
- package/dist/es/menus.js +1 -7
- package/dist/types/commands.d.ts +0 -1
- package/package.json +2 -2
package/dist/cjs/commands.js
CHANGED
|
@@ -38,7 +38,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
38
38
|
return result;
|
|
39
39
|
};
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
-
exports.updateCommentAnnotationState = exports.addComment = exports.deleteHighlightMarkers = exports.insertHighlight = exports.createAndFillTableElement = exports.selectAllIsolating = exports.ignoreAtomBlockNodeForward = exports.isAtEndOfTextBlock = exports.ignoreAtomBlockNodeBackward = exports.isTextSelection = exports.isAtStartOfTextBlock = exports.ifInTableBody = exports.insertTOCSection = exports.insertBibliographySection = exports.insertFootnotesSection = exports.insertSection = exports.insertGraphicalAbstract = exports.
|
|
41
|
+
exports.updateCommentAnnotationState = exports.addComment = exports.deleteHighlightMarkers = exports.insertHighlight = exports.createAndFillTableElement = exports.selectAllIsolating = exports.ignoreAtomBlockNodeForward = exports.isAtEndOfTextBlock = exports.ignoreAtomBlockNodeBackward = exports.isTextSelection = exports.isAtStartOfTextBlock = exports.ifInTableBody = exports.insertTOCSection = exports.insertBibliographySection = exports.insertFootnotesSection = exports.insertSection = exports.insertGraphicalAbstract = exports.insertInlineFootnote = exports.insertInlineEquation = exports.insertCrossReference = exports.insertInlineCitation = exports.insertLink = exports.insertSectionLabel = exports.insertBreak = exports.deleteBlock = exports.insertBlock = exports.insertFileAsFigure = exports.createBlock = exports.createSelection = exports.canInsert = exports.blockActive = exports.isNodeSelection = exports.markActive = void 0;
|
|
42
42
|
const json_schema_1 = require("@manuscripts/json-schema");
|
|
43
43
|
const transform_1 = require("@manuscripts/transform");
|
|
44
44
|
const prosemirror_model_1 = require("prosemirror-model");
|
|
@@ -52,7 +52,6 @@ const comment_annotation_1 = require("./plugins/comment_annotation");
|
|
|
52
52
|
const footnotes_1 = require("./plugins/footnotes");
|
|
53
53
|
const footnotesUtils = __importStar(require("./plugins/footnotes/footnotes-utils"));
|
|
54
54
|
const highlight_1 = require("./plugins/highlight");
|
|
55
|
-
const keywords_1 = require("./plugins/keywords");
|
|
56
55
|
const models_1 = require("./plugins/models");
|
|
57
56
|
const markActive = (type) => (state) => {
|
|
58
57
|
const { from, $from, to, empty } = state.selection;
|
|
@@ -345,23 +344,6 @@ const insertInlineFootnote = (kind) => (state, dispatch) => {
|
|
|
345
344
|
return true;
|
|
346
345
|
};
|
|
347
346
|
exports.insertInlineFootnote = insertInlineFootnote;
|
|
348
|
-
const insertKeywordsSection = (state, dispatch) => {
|
|
349
|
-
if ((0, utils_1.getChildOfType)(state.doc, state.schema.nodes.keywords_section)) {
|
|
350
|
-
return false;
|
|
351
|
-
}
|
|
352
|
-
const section = state.schema.nodes.keywords_section.createAndFill({}, [
|
|
353
|
-
state.schema.nodes.section_title.create({}, state.schema.text('Keywords')),
|
|
354
|
-
]);
|
|
355
|
-
const pos = 0;
|
|
356
|
-
const tr = state.tr;
|
|
357
|
-
tr.insert(pos, section).setMeta(keywords_1.keywordsKey, { keywordsInserted: true });
|
|
358
|
-
if (dispatch) {
|
|
359
|
-
const selection = prosemirror_state_1.NodeSelection.create(tr.doc, pos);
|
|
360
|
-
dispatch(tr.setSelection(selection).scrollIntoView());
|
|
361
|
-
}
|
|
362
|
-
return true;
|
|
363
|
-
};
|
|
364
|
-
exports.insertKeywordsSection = insertKeywordsSection;
|
|
365
347
|
const insertGraphicalAbstract = (state, dispatch) => {
|
|
366
348
|
const pos = findPosAfterParentSection(state.selection.$from);
|
|
367
349
|
if (pos === null || (0, transform_1.isInBibliographySection)(state.selection.$from)) {
|
package/dist/cjs/menus.js
CHANGED
|
@@ -260,12 +260,6 @@ exports.default = (editor, handleOpenDialog, footnotesEnabled, contentEditable)
|
|
|
260
260
|
enable: isCommandValid(commands_1.insertTOCSection),
|
|
261
261
|
run: wrap(commands_1.insertTOCSection),
|
|
262
262
|
},
|
|
263
|
-
{
|
|
264
|
-
id: 'insert-keywords',
|
|
265
|
-
label: 'Keywords',
|
|
266
|
-
enable: isCommandValid(commands_1.insertKeywordsSection),
|
|
267
|
-
run: wrap(commands_1.insertKeywordsSection),
|
|
268
|
-
},
|
|
269
263
|
{
|
|
270
264
|
id: 'insert-bibliography',
|
|
271
265
|
label: 'Bibliography',
|
package/dist/es/commands.js
CHANGED
|
@@ -26,7 +26,6 @@ import { commentAnnotation } from './plugins/comment_annotation';
|
|
|
26
26
|
import { footnotesKey } from './plugins/footnotes';
|
|
27
27
|
import * as footnotesUtils from './plugins/footnotes/footnotes-utils';
|
|
28
28
|
import { highlightKey, SET_COMMENT } from './plugins/highlight';
|
|
29
|
-
import { keywordsKey } from './plugins/keywords';
|
|
30
29
|
import { INSERT, modelsKey } from './plugins/models';
|
|
31
30
|
export const markActive = (type) => (state) => {
|
|
32
31
|
const { from, $from, to, empty } = state.selection;
|
|
@@ -303,22 +302,6 @@ export const insertInlineFootnote = (kind) => (state, dispatch) => {
|
|
|
303
302
|
}
|
|
304
303
|
return true;
|
|
305
304
|
};
|
|
306
|
-
export const insertKeywordsSection = (state, dispatch) => {
|
|
307
|
-
if (getChildOfType(state.doc, state.schema.nodes.keywords_section)) {
|
|
308
|
-
return false;
|
|
309
|
-
}
|
|
310
|
-
const section = state.schema.nodes.keywords_section.createAndFill({}, [
|
|
311
|
-
state.schema.nodes.section_title.create({}, state.schema.text('Keywords')),
|
|
312
|
-
]);
|
|
313
|
-
const pos = 0;
|
|
314
|
-
const tr = state.tr;
|
|
315
|
-
tr.insert(pos, section).setMeta(keywordsKey, { keywordsInserted: true });
|
|
316
|
-
if (dispatch) {
|
|
317
|
-
const selection = NodeSelection.create(tr.doc, pos);
|
|
318
|
-
dispatch(tr.setSelection(selection).scrollIntoView());
|
|
319
|
-
}
|
|
320
|
-
return true;
|
|
321
|
-
};
|
|
322
305
|
export const insertGraphicalAbstract = (state, dispatch) => {
|
|
323
306
|
const pos = findPosAfterParentSection(state.selection.$from);
|
|
324
307
|
if (pos === null || isInBibliographySection(state.selection.$from)) {
|
package/dist/es/menus.js
CHANGED
|
@@ -18,7 +18,7 @@ import { toggleMark } from 'prosemirror-commands';
|
|
|
18
18
|
import { redo, undo } from 'prosemirror-history';
|
|
19
19
|
import { wrapInList } from 'prosemirror-schema-list';
|
|
20
20
|
import { addColumnAfter, addColumnBefore, addRowAfter, addRowBefore, deleteColumn, deleteRow, mergeCells, splitCell, } from 'prosemirror-tables';
|
|
21
|
-
import { addComment, blockActive, canInsert, ifInTableBody, insertBibliographySection, insertBlock, insertCrossReference, insertGraphicalAbstract, insertInlineCitation, insertInlineEquation, insertInlineFootnote,
|
|
21
|
+
import { addComment, blockActive, canInsert, ifInTableBody, insertBibliographySection, insertBlock, insertCrossReference, insertGraphicalAbstract, insertInlineCitation, insertInlineEquation, insertInlineFootnote, insertLink, insertSection, insertTOCSection, markActive, } from './commands';
|
|
22
22
|
import { DialogNames } from './components/dialog';
|
|
23
23
|
import { deleteClosestParentElement, findClosestParentElementNodeName, } from './lib/hierarchy';
|
|
24
24
|
export default (editor, handleOpenDialog, footnotesEnabled, contentEditable) => {
|
|
@@ -258,12 +258,6 @@ export default (editor, handleOpenDialog, footnotesEnabled, contentEditable) =>
|
|
|
258
258
|
enable: isCommandValid(insertTOCSection),
|
|
259
259
|
run: wrap(insertTOCSection),
|
|
260
260
|
},
|
|
261
|
-
{
|
|
262
|
-
id: 'insert-keywords',
|
|
263
|
-
label: 'Keywords',
|
|
264
|
-
enable: isCommandValid(insertKeywordsSection),
|
|
265
|
-
run: wrap(insertKeywordsSection),
|
|
266
|
-
},
|
|
267
261
|
{
|
|
268
262
|
id: 'insert-bibliography',
|
|
269
263
|
label: 'Bibliography',
|
package/dist/types/commands.d.ts
CHANGED
|
@@ -36,7 +36,6 @@ export declare const insertInlineCitation: (state: ManuscriptEditorState, dispat
|
|
|
36
36
|
export declare const insertCrossReference: (state: ManuscriptEditorState, dispatch?: Dispatch) => boolean;
|
|
37
37
|
export declare const insertInlineEquation: (state: ManuscriptEditorState, dispatch?: Dispatch) => boolean;
|
|
38
38
|
export declare const insertInlineFootnote: (kind: 'footnote' | 'endnote') => (state: ManuscriptEditorState, dispatch?: Dispatch) => boolean;
|
|
39
|
-
export declare const insertKeywordsSection: (state: ManuscriptEditorState, dispatch?: Dispatch) => boolean;
|
|
40
39
|
export declare const insertGraphicalAbstract: (state: ManuscriptEditorState, dispatch?: Dispatch) => boolean;
|
|
41
40
|
export declare const insertSection: (subsection?: boolean) => (state: ManuscriptEditorState, dispatch?: Dispatch) => boolean;
|
|
42
41
|
export declare const insertFootnotesSection: (state: ManuscriptEditorState, dispatch?: Dispatch) => boolean;
|
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.2.
|
|
4
|
+
"version": "1.2.20-LEAN-2623",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@manuscripts/library": "^1.1.2",
|
|
35
35
|
"@manuscripts/style-guide": "^1.1.9",
|
|
36
36
|
"@manuscripts/title-editor": "^1.1.0",
|
|
37
|
-
"@manuscripts/track-changes-plugin": "^1.6.
|
|
37
|
+
"@manuscripts/track-changes-plugin": "^1.6.1",
|
|
38
38
|
"@manuscripts/transform": "^1.3.0",
|
|
39
39
|
"astrocite-eutils": "^0.16.4",
|
|
40
40
|
"axios": "^1.2.2",
|