@manuscripts/body-editor 1.6.18-LEAN-3281-0 → 1.6.19
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/plugins/bibliography/bibliography-utils.js +2 -8
- package/dist/cjs/plugins/footnotes/index.js +2 -2
- package/dist/cjs/tests.js +0 -6
- package/dist/es/plugins/bibliography/bibliography-utils.js +2 -8
- package/dist/es/plugins/footnotes/index.js +1 -1
- package/dist/es/tests.js +0 -3
- package/dist/types/icons.d.ts +16 -15
- package/dist/types/node-type-icons.d.ts +2 -1
- package/dist/types/types.d.ts +1 -1
- package/package.json +10 -27
|
@@ -103,7 +103,7 @@ const getCitation = (node) => {
|
|
|
103
103
|
};
|
|
104
104
|
exports.getCitation = getCitation;
|
|
105
105
|
const getBibliographyItem = (node) => {
|
|
106
|
-
const attrs = getEffectiveAttrs(node
|
|
106
|
+
const attrs = getEffectiveAttrs(node);
|
|
107
107
|
if (!attrs) {
|
|
108
108
|
return undefined;
|
|
109
109
|
}
|
|
@@ -113,15 +113,9 @@ const getBibliographyItem = (node) => {
|
|
|
113
113
|
};
|
|
114
114
|
exports.getBibliographyItem = getBibliographyItem;
|
|
115
115
|
const getLatest = (a, b) => a.updatedAt > b.updatedAt ? a : b;
|
|
116
|
-
const getEffectiveAttrs = (node
|
|
116
|
+
const getEffectiveAttrs = (node) => {
|
|
117
117
|
const _a = node.attrs, { dataTracked } = _a, attrs = __rest(_a, ["dataTracked"]);
|
|
118
118
|
const nodeChange = dataTracked === null || dataTracked === void 0 ? void 0 : dataTracked.reduce(getLatest);
|
|
119
|
-
const isDeleted = nodeChange &&
|
|
120
|
-
nodeChange.operation === track_changes_plugin_1.CHANGE_OPERATION.delete &&
|
|
121
|
-
nodeChange.status !== track_changes_plugin_1.CHANGE_STATUS.rejected;
|
|
122
|
-
if (isDeleted && excludeDeletedNode) {
|
|
123
|
-
return undefined;
|
|
124
|
-
}
|
|
125
119
|
const isRejected = nodeChange &&
|
|
126
120
|
nodeChange.operation === track_changes_plugin_1.CHANGE_OPERATION.set_node_attributes &&
|
|
127
121
|
nodeChange.status === track_changes_plugin_1.CHANGE_STATUS.rejected;
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.buildPluginState = exports.footnotesKey = void 0;
|
|
19
19
|
const transform_1 = require("@manuscripts/transform");
|
|
20
|
-
const
|
|
20
|
+
const lodash_1 = require("lodash");
|
|
21
21
|
const prosemirror_state_1 = require("prosemirror-state");
|
|
22
22
|
const prosemirror_utils_1 = require("prosemirror-utils");
|
|
23
23
|
const prosemirror_view_1 = require("prosemirror-view");
|
|
@@ -72,7 +72,7 @@ exports.default = () => {
|
|
|
72
72
|
appendTransaction(transactions, oldState, newState) {
|
|
73
73
|
const { nodes: oldInlineFootnoteNodes } = exports.footnotesKey.getState(oldState);
|
|
74
74
|
const { nodes: inlineFootnoteNodes, labels } = exports.footnotesKey.getState(newState);
|
|
75
|
-
if ((0,
|
|
75
|
+
if ((0, lodash_1.isEqual)(inlineFootnoteNodes, oldInlineFootnoteNodes)) {
|
|
76
76
|
return null;
|
|
77
77
|
}
|
|
78
78
|
const { tr } = newState;
|
package/dist/cjs/tests.js
CHANGED
|
@@ -14,15 +14,9 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
-
};
|
|
20
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
18
|
require("regenerator-runtime/runtime");
|
|
22
|
-
const enzyme_1 = require("enzyme");
|
|
23
|
-
const enzyme_adapter_react_16_1 = __importDefault(require("enzyme-adapter-react-16"));
|
|
24
19
|
const uuid_1 = require("uuid");
|
|
25
|
-
(0, enzyme_1.configure)({ adapter: new enzyme_adapter_react_16_1.default() });
|
|
26
20
|
process.env.API_BASE_URL = 'https://127.0.0.1/';
|
|
27
21
|
const supportedCommands = [];
|
|
28
22
|
Object.defineProperty(document, 'queryCommandSupported', {
|
|
@@ -97,7 +97,7 @@ export const getCitation = (node) => {
|
|
|
97
97
|
};
|
|
98
98
|
};
|
|
99
99
|
export const getBibliographyItem = (node) => {
|
|
100
|
-
const attrs = getEffectiveAttrs(node
|
|
100
|
+
const attrs = getEffectiveAttrs(node);
|
|
101
101
|
if (!attrs) {
|
|
102
102
|
return undefined;
|
|
103
103
|
}
|
|
@@ -106,15 +106,9 @@ export const getBibliographyItem = (node) => {
|
|
|
106
106
|
return pickBy(item, (v) => v !== undefined);
|
|
107
107
|
};
|
|
108
108
|
const getLatest = (a, b) => a.updatedAt > b.updatedAt ? a : b;
|
|
109
|
-
const getEffectiveAttrs = (node
|
|
109
|
+
const getEffectiveAttrs = (node) => {
|
|
110
110
|
const _a = node.attrs, { dataTracked } = _a, attrs = __rest(_a, ["dataTracked"]);
|
|
111
111
|
const nodeChange = dataTracked === null || dataTracked === void 0 ? void 0 : dataTracked.reduce(getLatest);
|
|
112
|
-
const isDeleted = nodeChange &&
|
|
113
|
-
nodeChange.operation === CHANGE_OPERATION.delete &&
|
|
114
|
-
nodeChange.status !== CHANGE_STATUS.rejected;
|
|
115
|
-
if (isDeleted && excludeDeletedNode) {
|
|
116
|
-
return undefined;
|
|
117
|
-
}
|
|
118
112
|
const isRejected = nodeChange &&
|
|
119
113
|
nodeChange.operation === CHANGE_OPERATION.set_node_attributes &&
|
|
120
114
|
nodeChange.status === CHANGE_STATUS.rejected;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { isFootnoteNode, isInlineFootnoteNode, schema, } from '@manuscripts/transform';
|
|
17
|
-
import { isEqual } from 'lodash
|
|
17
|
+
import { isEqual } from 'lodash';
|
|
18
18
|
import { NodeSelection, Plugin, PluginKey } from 'prosemirror-state';
|
|
19
19
|
import { hasParentNodeOfType } from 'prosemirror-utils';
|
|
20
20
|
import { Decoration, DecorationSet } from 'prosemirror-view';
|
package/dist/es/tests.js
CHANGED
|
@@ -14,10 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import 'regenerator-runtime/runtime';
|
|
17
|
-
import { configure } from 'enzyme';
|
|
18
|
-
import Adapter from 'enzyme-adapter-react-16';
|
|
19
17
|
import { v4 as uuid } from 'uuid';
|
|
20
|
-
configure({ adapter: new Adapter() });
|
|
21
18
|
process.env.API_BASE_URL = 'https://127.0.0.1/';
|
|
22
19
|
const supportedCommands = [];
|
|
23
20
|
Object.defineProperty(document, 'queryCommandSupported', {
|
package/dist/types/icons.d.ts
CHANGED
|
@@ -13,21 +13,22 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import React from 'react';
|
|
16
17
|
declare const _default: {
|
|
17
|
-
italic: JSX.Element;
|
|
18
|
-
bold: JSX.Element;
|
|
19
|
-
subscript: JSX.Element;
|
|
20
|
-
superscript: JSX.Element;
|
|
21
|
-
underline: JSX.Element;
|
|
22
|
-
ordered_list: JSX.Element;
|
|
23
|
-
bullet_list: JSX.Element;
|
|
24
|
-
figure_element: JSX.Element;
|
|
25
|
-
table_element: JSX.Element;
|
|
26
|
-
citation: JSX.Element;
|
|
27
|
-
inline_equation: JSX.Element;
|
|
28
|
-
equation_element: JSX.Element;
|
|
29
|
-
listing_element: JSX.Element;
|
|
30
|
-
symbol: JSX.Element;
|
|
31
|
-
highlight: JSX.Element;
|
|
18
|
+
italic: React.JSX.Element;
|
|
19
|
+
bold: React.JSX.Element;
|
|
20
|
+
subscript: React.JSX.Element;
|
|
21
|
+
superscript: React.JSX.Element;
|
|
22
|
+
underline: React.JSX.Element;
|
|
23
|
+
ordered_list: React.JSX.Element;
|
|
24
|
+
bullet_list: React.JSX.Element;
|
|
25
|
+
figure_element: React.JSX.Element;
|
|
26
|
+
table_element: React.JSX.Element;
|
|
27
|
+
citation: React.JSX.Element;
|
|
28
|
+
inline_equation: React.JSX.Element;
|
|
29
|
+
equation_element: React.JSX.Element;
|
|
30
|
+
listing_element: React.JSX.Element;
|
|
31
|
+
symbol: React.JSX.Element;
|
|
32
|
+
highlight: React.JSX.Element;
|
|
32
33
|
};
|
|
33
34
|
export default _default;
|
|
@@ -14,4 +14,5 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { NodeType } from 'prosemirror-model';
|
|
17
|
-
|
|
17
|
+
import React from 'react';
|
|
18
|
+
export declare const nodeTypeIcon: (nodeType: NodeType) => React.JSX.Element | null;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import { ManuscriptEditorState, ManuscriptEditorView, ManuscriptNode, ManuscriptNodeView, ManuscriptTransaction } from '@manuscripts/transform';
|
|
17
17
|
import { Decoration } from 'prosemirror-view';
|
|
18
18
|
export type EditorAction = (state: ManuscriptEditorState, dispatch?: (tr: ManuscriptTransaction) => void, view?: ManuscriptEditorView) => boolean;
|
|
19
|
-
export type NodeViewCreator<T extends ManuscriptNodeView> = (node: ManuscriptNode, view: ManuscriptEditorView, getPos:
|
|
19
|
+
export type NodeViewCreator<T extends ManuscriptNodeView> = (node: ManuscriptNode, view: ManuscriptEditorView, getPos: () => number | undefined, decorations: readonly Decoration[]) => T;
|
|
20
20
|
export interface ChangeReceiverCommand {
|
|
21
21
|
childSections?: ManuscriptNode[];
|
|
22
22
|
}
|
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.6.
|
|
4
|
+
"version": "1.6.19",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -31,20 +31,20 @@
|
|
|
31
31
|
"@manuscripts/assets": "^0.6.4",
|
|
32
32
|
"@manuscripts/json-schema": "^2.2.2",
|
|
33
33
|
"@manuscripts/library": "1.3.2",
|
|
34
|
-
"@manuscripts/style-guide": "1.7.
|
|
34
|
+
"@manuscripts/style-guide": "1.7.2",
|
|
35
35
|
"@manuscripts/track-changes-plugin": "^1.7.5",
|
|
36
36
|
"@manuscripts/transform": "2.0.4",
|
|
37
37
|
"astrocite-eutils": "^0.16.4",
|
|
38
|
-
"axios": "^1.
|
|
38
|
+
"axios": "^1.6.7",
|
|
39
39
|
"codemirror": "^5.58.1",
|
|
40
40
|
"dompurify": "^2.4.1",
|
|
41
41
|
"grapheme-splitter": "^1.0.4",
|
|
42
42
|
"history": "^4.10.1",
|
|
43
|
-
"lodash-es": "^4.17.21",
|
|
44
43
|
"popper.js": "^1.16.1",
|
|
45
44
|
"prosemirror-collab": "^1.3.1",
|
|
46
45
|
"prosemirror-commands": "^1.5.0",
|
|
47
46
|
"prosemirror-dropcursor": "^1.6.1",
|
|
47
|
+
"prosemirror-gapcursor": "^1.3.1",
|
|
48
48
|
"prosemirror-history": "^1.3.0",
|
|
49
49
|
"prosemirror-inputrules": "^1.2.0",
|
|
50
50
|
"prosemirror-keymap": "^1.2.0",
|
|
@@ -60,39 +60,28 @@
|
|
|
60
60
|
"react-dnd-html5-backend": "^11.1.3",
|
|
61
61
|
"react-dom": "^17.0.2",
|
|
62
62
|
"react-is": "^17.0.2",
|
|
63
|
-
"react-
|
|
63
|
+
"react-router-dom": "^5.3.4",
|
|
64
64
|
"react-select": "^5.7.3",
|
|
65
|
-
"
|
|
65
|
+
"styled-components": "^5.2.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@babel/core": "^7.20.5",
|
|
69
69
|
"@babel/preset-env": "^7.20.2",
|
|
70
70
|
"@babel/preset-react": "^7.18.6",
|
|
71
71
|
"@babel/preset-typescript": "^7.18.6",
|
|
72
|
-
"@inline-svg-unique-id/react": "^1.2.3",
|
|
73
72
|
"@manuscripts/eslint-config": "^0.5.1",
|
|
74
73
|
"@types/codemirror": "^5.60.5",
|
|
75
74
|
"@types/dompurify": "^2.4.0",
|
|
76
|
-
"@types/enzyme": "^3.10.12",
|
|
77
|
-
"@types/enzyme-adapter-react-16": "^1.0.6",
|
|
78
75
|
"@types/jest": "^29.2.4",
|
|
79
|
-
"@types/lodash
|
|
76
|
+
"@types/lodash": "^4.14.202",
|
|
80
77
|
"@types/react": "^16.9.52",
|
|
81
78
|
"@types/react-dom": "^16.9.8",
|
|
82
|
-
"@types/react-modal": "^3.10.6",
|
|
83
79
|
"@types/react-router-dom": "^5.1.6",
|
|
84
80
|
"@types/styled-components": "^5.1.4",
|
|
85
81
|
"@types/uuid": "^9.0.0",
|
|
86
82
|
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
|
87
83
|
"@typescript-eslint/parser": "^5.47.0",
|
|
88
|
-
"axios-mock-adapter": "^1.21.2",
|
|
89
|
-
"buffer": "^5.5.0",
|
|
90
84
|
"concurrently": "^7.6.0",
|
|
91
|
-
"crypto-browserify": "^3.12.0",
|
|
92
|
-
"depcheck": "^1.4.3",
|
|
93
|
-
"enzyme": "^3.11.0",
|
|
94
|
-
"enzyme-adapter-react-16": "^1.15.7",
|
|
95
|
-
"enzyme-to-json": "^3.6.2",
|
|
96
85
|
"eslint": "^8.30.0",
|
|
97
86
|
"eslint-config-prettier": "^8.5.0",
|
|
98
87
|
"eslint-plugin-header": "^3.1.1",
|
|
@@ -106,24 +95,18 @@
|
|
|
106
95
|
"eslint-plugin-react": "^7.31.11",
|
|
107
96
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
108
97
|
"eslint-plugin-simple-import-sort": "^8.0.0",
|
|
109
|
-
"events": "^3.1.0",
|
|
110
|
-
"fontoxpath": "^3.28.2",
|
|
111
98
|
"husky": "^8.0.2",
|
|
112
99
|
"jest": "^29.3.1",
|
|
113
100
|
"jest-environment-jsdom": "^29.3.1",
|
|
114
101
|
"jest-prosemirror": "^2.1.1",
|
|
115
102
|
"lodash": "^4.17.21",
|
|
116
103
|
"prettier": "^2.8.1",
|
|
117
|
-
"prosemirror-gapcursor": "^1.3.1",
|
|
118
|
-
"react-modern-calendar-datepicker": "^3.1.3",
|
|
119
|
-
"react-router": "^6.8.1",
|
|
120
|
-
"react-router-dom": "^5.2.0",
|
|
121
104
|
"regenerator-runtime": "^0.13.11",
|
|
122
105
|
"rimraf": "^3.0.2",
|
|
123
|
-
"
|
|
124
|
-
"
|
|
106
|
+
"typescript": "^4.0.5",
|
|
107
|
+
"uuid": "^9.0.0"
|
|
125
108
|
},
|
|
126
109
|
"resolutions": {
|
|
127
110
|
"@types/react": "^17.0.2"
|
|
128
111
|
}
|
|
129
|
-
}
|
|
112
|
+
}
|