@manuscripts/body-editor 2.7.45 → 2.7.47
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 -1
- package/dist/cjs/menus.js +1 -1
- package/dist/cjs/plugins/section-category/section-category-utils.js +1 -1
- package/dist/cjs/versions.js +1 -1
- package/dist/es/commands.js +1 -1
- package/dist/es/menus.js +2 -2
- package/dist/es/plugins/section-category/section-category-utils.js +2 -2
- package/dist/es/versions.js +1 -1
- package/dist/types/versions.d.ts +1 -1
- package/package.json +2 -2
package/dist/cjs/commands.js
CHANGED
|
@@ -1123,7 +1123,7 @@ const addHeaderRow = (direction) => (state, dispatch) => {
|
|
|
1123
1123
|
const addRowStep = (0, prosemirror_tables_1.addRow)(state.tr, rect, rect[direction === 'below' ? 'bottom' : 'top']).steps.pop();
|
|
1124
1124
|
if (addRowStep && addRowStep instanceof prosemirror_transform_1.ReplaceStep) {
|
|
1125
1125
|
const { from, to, slice } = addRowStep;
|
|
1126
|
-
const cells = (0, prosemirror_utils_1.flatten)(slice.content.firstChild);
|
|
1126
|
+
const cells = (0, prosemirror_utils_1.flatten)(slice.content.firstChild, false);
|
|
1127
1127
|
const row = transform_1.schema.nodes.table_row.create(undefined, cells.map((cell) => transform_1.schema.nodes.table_header.create(cell.node.attrs, cell.node.content)));
|
|
1128
1128
|
tr.step(new prosemirror_transform_1.ReplaceStep(from, to, new prosemirror_model_1.Slice(prosemirror_model_1.Fragment.from(row), slice.openStart, slice.openEnd)));
|
|
1129
1129
|
dispatch(tr);
|
package/dist/cjs/menus.js
CHANGED
|
@@ -38,7 +38,7 @@ const getEditorMenus = (editor) => {
|
|
|
38
38
|
run: doCommand(command),
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
|
-
const categories = (0, transform_1.
|
|
41
|
+
const categories = (0, transform_1.getGroupCategories)(props.sectionCategories, 'backmatter');
|
|
42
42
|
const edit = {
|
|
43
43
|
id: 'edit',
|
|
44
44
|
label: 'Edit',
|
|
@@ -89,7 +89,7 @@ function buildPluginState(state, props) {
|
|
|
89
89
|
const category = categories.get(categoryID);
|
|
90
90
|
const $pos = state.doc.resolve(pos);
|
|
91
91
|
const group = isInBackmatter($pos) ? 'backmatter' : 'body';
|
|
92
|
-
const groupCategories = (0, transform_1.
|
|
92
|
+
const groupCategories = (0, transform_1.getGroupCategories)(categories, group);
|
|
93
93
|
decorations.push(prosemirror_view_1.Decoration.widget(pos + 1, (view) => createButton(view, pos, category, groupCategories, usedCategoryIDs, can === null || can === void 0 ? void 0 : can.editArticle)));
|
|
94
94
|
return false;
|
|
95
95
|
}
|
package/dist/cjs/versions.js
CHANGED
package/dist/es/commands.js
CHANGED
|
@@ -1070,7 +1070,7 @@ export const addHeaderRow = (direction) => (state, dispatch) => {
|
|
|
1070
1070
|
const addRowStep = addRow(state.tr, rect, rect[direction === 'below' ? 'bottom' : 'top']).steps.pop();
|
|
1071
1071
|
if (addRowStep && addRowStep instanceof ReplaceStep) {
|
|
1072
1072
|
const { from, to, slice } = addRowStep;
|
|
1073
|
-
const cells = flatten(slice.content.firstChild);
|
|
1073
|
+
const cells = flatten(slice.content.firstChild, false);
|
|
1074
1074
|
const row = schema.nodes.table_row.create(undefined, cells.map((cell) => schema.nodes.table_header.create(cell.node.attrs, cell.node.content)));
|
|
1075
1075
|
tr.step(new ReplaceStep(from, to, new Slice(Fragment.from(row), slice.openStart, slice.openEnd)));
|
|
1076
1076
|
dispatch(tr);
|
package/dist/es/menus.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import {
|
|
16
|
+
import { getGroupCategories, schema, } from '@manuscripts/transform';
|
|
17
17
|
import { toggleMark } from 'prosemirror-commands';
|
|
18
18
|
import { redo, undo } from 'prosemirror-history';
|
|
19
19
|
import { addInlineComment, blockActive, canInsert, insertAbstract, insertAffiliation, insertAward, insertBackmatterSection, insertBlock, insertBoxElement, insertContributors, insertCrossReference, insertGraphicalAbstract, insertInlineCitation, insertInlineEquation, insertInlineFootnote, insertKeywords, insertLink, insertList, insertSection, markActive, } from './commands';
|
|
@@ -35,7 +35,7 @@ export const getEditorMenus = (editor) => {
|
|
|
35
35
|
run: doCommand(command),
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
|
-
const categories =
|
|
38
|
+
const categories = getGroupCategories(props.sectionCategories, 'backmatter');
|
|
39
39
|
const edit = {
|
|
40
40
|
id: 'edit',
|
|
41
41
|
label: 'Edit',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getGroupCategories, isSectionNode, schema, } from '@manuscripts/transform';
|
|
2
2
|
import { findChildrenByType, findParentNodeOfTypeClosestToPos, } from 'prosemirror-utils';
|
|
3
3
|
import { Decoration, DecorationSet } from 'prosemirror-view';
|
|
4
4
|
import { sectionCategoryIcon } from '../../icons';
|
|
@@ -86,7 +86,7 @@ export function buildPluginState(state, props) {
|
|
|
86
86
|
const category = categories.get(categoryID);
|
|
87
87
|
const $pos = state.doc.resolve(pos);
|
|
88
88
|
const group = isInBackmatter($pos) ? 'backmatter' : 'body';
|
|
89
|
-
const groupCategories =
|
|
89
|
+
const groupCategories = getGroupCategories(categories, group);
|
|
90
90
|
decorations.push(Decoration.widget(pos + 1, (view) => createButton(view, pos, category, groupCategories, usedCategoryIDs, can === null || can === void 0 ? void 0 : can.editArticle)));
|
|
91
91
|
return false;
|
|
92
92
|
}
|
package/dist/es/versions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '2.7.
|
|
1
|
+
export const VERSION = '2.7.47';
|
|
2
2
|
export const MATHJAX_VERSION = '3.2.2';
|
package/dist/types/versions.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "2.7.
|
|
1
|
+
export declare const VERSION = "2.7.47";
|
|
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": "2.7.
|
|
4
|
+
"version": "2.7.47",
|
|
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.3.11",
|
|
35
35
|
"@manuscripts/style-guide": "2.0.35",
|
|
36
36
|
"@manuscripts/track-changes-plugin": "1.9.4",
|
|
37
|
-
"@manuscripts/transform": "3.0.
|
|
37
|
+
"@manuscripts/transform": "3.0.41",
|
|
38
38
|
"@popperjs/core": "^2.11.8",
|
|
39
39
|
"astrocite-eutils": "^0.16.4",
|
|
40
40
|
"codemirror": "^5.58.1",
|