@manuscripts/body-editor 1.10.5 → 1.10.6-LEAN-3651.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.
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.clipboardParser = void 0;
|
|
4
|
+
const transform_1 = require("@manuscripts/transform");
|
|
5
|
+
const prosemirror_model_1 = require("prosemirror-model");
|
|
6
|
+
const nodes = [
|
|
7
|
+
{
|
|
8
|
+
tag: 'p',
|
|
9
|
+
node: 'paragraph',
|
|
10
|
+
},
|
|
11
|
+
];
|
|
12
|
+
exports.clipboardParser = new prosemirror_model_1.DOMParser(transform_1.schema, [
|
|
13
|
+
...nodes,
|
|
14
|
+
...prosemirror_model_1.DOMParser.fromSchema(transform_1.schema).rules,
|
|
15
|
+
]);
|
|
@@ -23,6 +23,7 @@ require("prosemirror-view/style/prosemirror.css");
|
|
|
23
23
|
const transform_1 = require("@manuscripts/transform");
|
|
24
24
|
const prosemirror_state_1 = require("prosemirror-state");
|
|
25
25
|
const prosemirror_view_1 = require("prosemirror-view");
|
|
26
|
+
const clipboard_1 = require("../clipboard");
|
|
26
27
|
const paste_1 = require("../lib/paste");
|
|
27
28
|
const editor_plugins_1 = __importDefault(require("./editor-plugins"));
|
|
28
29
|
const editor_views_1 = __importDefault(require("./editor-views"));
|
|
@@ -46,6 +47,7 @@ const createEditorView = (props, root, state, dispatch) => {
|
|
|
46
47
|
nodeViews: (0, editor_views_1.default)(props, dispatch),
|
|
47
48
|
attributes: props.attributes,
|
|
48
49
|
transformPasted: paste_1.transformPasted,
|
|
50
|
+
clipboardParser: clipboard_1.clipboardParser,
|
|
49
51
|
});
|
|
50
52
|
const tr = view.state.tr.setMeta('INIT', true);
|
|
51
53
|
const nextState = view.state.apply(tr);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { schema } from '@manuscripts/transform';
|
|
2
|
+
import { DOMParser } from 'prosemirror-model';
|
|
3
|
+
const nodes = [
|
|
4
|
+
{
|
|
5
|
+
tag: 'p',
|
|
6
|
+
node: 'paragraph',
|
|
7
|
+
},
|
|
8
|
+
];
|
|
9
|
+
export const clipboardParser = new DOMParser(schema, [
|
|
10
|
+
...nodes,
|
|
11
|
+
...DOMParser.fromSchema(schema).rules,
|
|
12
|
+
]);
|
|
@@ -17,6 +17,7 @@ import 'prosemirror-view/style/prosemirror.css';
|
|
|
17
17
|
import { schema } from '@manuscripts/transform';
|
|
18
18
|
import { EditorState } from 'prosemirror-state';
|
|
19
19
|
import { EditorView } from 'prosemirror-view';
|
|
20
|
+
import { clipboardParser } from '../clipboard';
|
|
20
21
|
import { transformPasted } from '../lib/paste';
|
|
21
22
|
import plugins from './editor-plugins';
|
|
22
23
|
import views from './editor-views';
|
|
@@ -39,6 +40,7 @@ export const createEditorView = (props, root, state, dispatch) => {
|
|
|
39
40
|
nodeViews: views(props, dispatch),
|
|
40
41
|
attributes: props.attributes,
|
|
41
42
|
transformPasted,
|
|
43
|
+
clipboardParser,
|
|
42
44
|
});
|
|
43
45
|
const tr = view.state.tr.setMeta('INIT', true);
|
|
44
46
|
const nextState = view.state.apply(tr);
|
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.10.
|
|
4
|
+
"version": "1.10.6-LEAN-3651.0",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|