@manuscripts/body-editor 1.13.28 → 1.13.29
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 +0 -1
- package/dist/cjs/useEditor.js +6 -11
- package/dist/cjs/versions.js +1 -1
- package/dist/es/lib/popper.js +0 -1
- package/dist/es/useEditor.js +7 -12
- package/dist/es/versions.js +1 -1
- package/dist/types/components/outline/Outline.d.ts +2 -2
- package/dist/types/configs/ManuscriptsEditor.d.ts +0 -2
- package/dist/types/versions.d.ts +1 -1
- package/package.json +3 -3
package/dist/cjs/lib/popper.js
CHANGED
|
@@ -71,7 +71,6 @@ class PopperManager {
|
|
|
71
71
|
}
|
|
72
72
|
destroy() {
|
|
73
73
|
if (this.activePopper) {
|
|
74
|
-
console.log('destroying popper', this.activePopper, this.activePopper.state.elements.reference);
|
|
75
74
|
this.removeContainerClass(this.activePopper.state.elements.reference);
|
|
76
75
|
this.activePopper.destroy();
|
|
77
76
|
this.activePopper.state.elements.popper.remove();
|
package/dist/cjs/useEditor.js
CHANGED
|
@@ -37,7 +37,7 @@ const useEditor = (externalProps) => {
|
|
|
37
37
|
const view = (0, react_1.useRef)();
|
|
38
38
|
const props = Object.assign(Object.assign({}, externalProps), { popper: new popper_1.PopperManager() });
|
|
39
39
|
const [state, setState] = (0, react_1.useState)(() => (0, ManuscriptsEditor_1.createEditorState)(props));
|
|
40
|
-
const
|
|
40
|
+
const location = (0, react_router_dom_1.useLocation)();
|
|
41
41
|
const { collabProvider } = props;
|
|
42
42
|
if (collabProvider) {
|
|
43
43
|
collabProvider.onNewSteps((newVersion, steps, clientIDs) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -112,16 +112,11 @@ const useEditor = (externalProps) => {
|
|
|
112
112
|
});
|
|
113
113
|
}, [state]);
|
|
114
114
|
(0, react_1.useEffect)(() => {
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
});
|
|
121
|
-
return () => {
|
|
122
|
-
unlisten();
|
|
123
|
-
};
|
|
124
|
-
}, [history, focusNodeWithId]);
|
|
115
|
+
const nodeId = location.hash.substring(1);
|
|
116
|
+
if (nodeId) {
|
|
117
|
+
focusNodeWithId(nodeId);
|
|
118
|
+
}
|
|
119
|
+
}, [location]);
|
|
125
120
|
return {
|
|
126
121
|
state,
|
|
127
122
|
onRender,
|
package/dist/cjs/versions.js
CHANGED
package/dist/es/lib/popper.js
CHANGED
|
@@ -68,7 +68,6 @@ export class PopperManager {
|
|
|
68
68
|
}
|
|
69
69
|
destroy() {
|
|
70
70
|
if (this.activePopper) {
|
|
71
|
-
console.log('destroying popper', this.activePopper, this.activePopper.state.elements.reference);
|
|
72
71
|
this.removeContainerClass(this.activePopper.state.elements.reference);
|
|
73
72
|
this.activePopper.destroy();
|
|
74
73
|
this.activePopper.state.elements.popper.remove();
|
package/dist/es/useEditor.js
CHANGED
|
@@ -26,7 +26,7 @@ import { trackChangesPluginKey, TrackChangesStatus, } from '@manuscripts/track-c
|
|
|
26
26
|
import { getVersion, receiveTransaction, sendableSteps, } from 'prosemirror-collab';
|
|
27
27
|
import { NodeSelection, } from 'prosemirror-state';
|
|
28
28
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
29
|
-
import {
|
|
29
|
+
import { useLocation } from 'react-router-dom';
|
|
30
30
|
import { createEditorState, createEditorView, } from './configs/ManuscriptsEditor';
|
|
31
31
|
import { PopperManager } from './lib/popper';
|
|
32
32
|
import { useDoWithDebounce } from './lib/use-do-with-debounce';
|
|
@@ -34,7 +34,7 @@ export const useEditor = (externalProps) => {
|
|
|
34
34
|
const view = useRef();
|
|
35
35
|
const props = Object.assign(Object.assign({}, externalProps), { popper: new PopperManager() });
|
|
36
36
|
const [state, setState] = useState(() => createEditorState(props));
|
|
37
|
-
const
|
|
37
|
+
const location = useLocation();
|
|
38
38
|
const { collabProvider } = props;
|
|
39
39
|
if (collabProvider) {
|
|
40
40
|
collabProvider.onNewSteps((newVersion, steps, clientIDs) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -109,16 +109,11 @@ export const useEditor = (externalProps) => {
|
|
|
109
109
|
});
|
|
110
110
|
}, [state]);
|
|
111
111
|
useEffect(() => {
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
});
|
|
118
|
-
return () => {
|
|
119
|
-
unlisten();
|
|
120
|
-
};
|
|
121
|
-
}, [history, focusNodeWithId]);
|
|
112
|
+
const nodeId = location.hash.substring(1);
|
|
113
|
+
if (nodeId) {
|
|
114
|
+
focusNodeWithId(nodeId);
|
|
115
|
+
}
|
|
116
|
+
}, [location]);
|
|
122
117
|
return {
|
|
123
118
|
state,
|
|
124
119
|
onRender,
|
package/dist/es/versions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '1.13.
|
|
1
|
+
export const VERSION = '1.13.29';
|
|
2
2
|
export const MATHJAX_VERSION = '3.2.2';
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
/// <reference types="react" />
|
|
17
17
|
export declare const OutlineItemIcon: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
18
18
|
export declare const OutlineItem: import("styled-components").StyledComponent<"div", any, {
|
|
19
19
|
depth: number;
|
|
20
20
|
}, never>;
|
|
21
21
|
export declare const OutlineItemArrow: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
22
22
|
export declare const OutlineItemNoArrow: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
23
|
-
export declare const OutlineItemLink: import("styled-components").StyledComponent<
|
|
23
|
+
export declare const OutlineItemLink: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("react-router-dom").LinkProps & import("react").RefAttributes<HTMLAnchorElement>>, any, {}, never>;
|
|
24
24
|
export declare const OutlineItemLinkText: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
25
25
|
export declare const Outline: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
26
26
|
export declare const OutlineItemPlaceholder: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
@@ -17,7 +17,6 @@ import 'prosemirror-view/style/prosemirror.css';
|
|
|
17
17
|
import { Manuscript, UserProfile } from '@manuscripts/json-schema';
|
|
18
18
|
import { Capabilities } from '@manuscripts/style-guide';
|
|
19
19
|
import { ManuscriptNode } from '@manuscripts/transform';
|
|
20
|
-
import { History } from 'history';
|
|
21
20
|
import { EditorState } from 'prosemirror-state';
|
|
22
21
|
import { EditorView } from 'prosemirror-view';
|
|
23
22
|
import { DefaultTheme } from 'styled-components';
|
|
@@ -42,7 +41,6 @@ export interface EditorProps {
|
|
|
42
41
|
getFiles: () => FileAttachment[];
|
|
43
42
|
fileManagement: FileManagement;
|
|
44
43
|
popper: PopperManager;
|
|
45
|
-
history: History;
|
|
46
44
|
getCapabilities: () => Capabilities;
|
|
47
45
|
userID: string;
|
|
48
46
|
debug: boolean;
|
package/dist/types/versions.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.13.
|
|
1
|
+
export declare const VERSION = "1.13.29";
|
|
2
2
|
export declare const MATHJAX_VERSION = "3.2.2";
|
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.13.
|
|
4
|
+
"version": "1.13.29",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"react-dnd-html5-backend": "^16.0.1",
|
|
62
62
|
"react-dom": "^17.0.2",
|
|
63
63
|
"react-is": "^17.0.2",
|
|
64
|
-
"react-router-dom": "^
|
|
64
|
+
"react-router-dom": "^6.25.0",
|
|
65
65
|
"react-select": "^5.7.3",
|
|
66
66
|
"styled-components": "^5.2.0"
|
|
67
67
|
},
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@types/lodash": "^4.14.202",
|
|
78
78
|
"@types/react": "^17.0.2",
|
|
79
79
|
"@types/react-dom": "^17.0.2",
|
|
80
|
-
"@types/react-router-dom": "^5.
|
|
80
|
+
"@types/react-router-dom": "^5.3.3",
|
|
81
81
|
"@types/styled-components": "^5.1.4",
|
|
82
82
|
"@types/uuid": "^9.0.0",
|
|
83
83
|
"@typescript-eslint/eslint-plugin": "^5.47.0",
|