@manuscripts/article-editor 3.0.2-LEAN-3788.0 → 3.0.2
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/components/projects/CategoryInput.js +4 -22
- package/dist/cjs/components/projects/CategoryInput.js.map +1 -1
- package/dist/cjs/components/projects/TagsInput.js +2 -4
- package/dist/cjs/components/projects/TagsInput.js.map +1 -1
- package/dist/cjs/lib/section-categories.js +1 -20
- package/dist/cjs/lib/section-categories.js.map +1 -1
- package/dist/es/components/projects/CategoryInput.js +5 -23
- package/dist/es/components/projects/CategoryInput.js.map +1 -1
- package/dist/es/components/projects/TagsInput.js +2 -4
- package/dist/es/components/projects/TagsInput.js.map +1 -1
- package/dist/es/lib/section-categories.js +0 -17
- package/dist/es/lib/section-categories.js.map +1 -1
- package/dist/types/components/projects/TagsInput.d.ts +0 -1
- package/dist/types/lib/section-categories.d.ts +0 -3
- package/package.json +2 -3
|
@@ -38,50 +38,32 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports.CategoryInput = void 0;
|
|
41
|
-
const transform_1 = require("@manuscripts/transform");
|
|
42
|
-
const prosemirror_utils_1 = require("prosemirror-utils");
|
|
43
41
|
const react_1 = __importStar(require("react"));
|
|
44
42
|
const react_select_1 = __importDefault(require("react-select"));
|
|
45
43
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
46
44
|
const use_synced_data_1 = require("../../hooks/use-synced-data");
|
|
47
45
|
const section_categories_1 = require("../../lib/section-categories");
|
|
48
|
-
const store_1 = require("../../store");
|
|
49
46
|
const TagsInput_1 = require("./TagsInput");
|
|
50
47
|
const CategoryInput = ({ value, handleChange, existingCatsCounted, sectionCategories }) => {
|
|
51
48
|
const [currentValue, handleLocalChange] = (0, use_synced_data_1.useSyncedData)(value, handleChange, 0);
|
|
52
|
-
const [{ doc }] = (0, store_1.useStore)((state) => ({
|
|
53
|
-
doc: state.doc,
|
|
54
|
-
}));
|
|
55
49
|
const handleInputChange = (0, react_1.useCallback)((newValue) => newValue && handleLocalChange(newValue.value), [handleLocalChange]);
|
|
56
50
|
const OptionComponent = ({ innerProps, data, }) => {
|
|
57
|
-
return (react_1.default.createElement(TagsInput_1.OptionWrapper, { ...innerProps,
|
|
51
|
+
return (react_1.default.createElement(TagsInput_1.OptionWrapper, { ...innerProps, ref: null }, data.label));
|
|
58
52
|
};
|
|
59
53
|
const options = (0, react_1.useMemo)(() => {
|
|
60
|
-
const backmatter = (0, prosemirror_utils_1.findChildrenByType)(doc, transform_1.schema.nodes.backmatter)[0];
|
|
61
54
|
const options = [];
|
|
62
55
|
sectionCategories.map((cat) => {
|
|
63
|
-
// check if the category is part of the backmatter section, and its already present in the document
|
|
64
|
-
let isDisabled = false;
|
|
65
|
-
if (cat.groupIDs &&
|
|
66
|
-
(0, section_categories_1.isBackMatterSection)(cat.groupIDs[0]) &&
|
|
67
|
-
(0, section_categories_1.isBackMatterSectionCategoryExist)(backmatter.node, cat._id)) {
|
|
68
|
-
isDisabled = true;
|
|
69
|
-
}
|
|
70
56
|
if ((0, section_categories_1.isEditableSectionCategory)(cat) &&
|
|
71
57
|
(!(0, section_categories_1.isUniquePresent)(cat, existingCatsCounted) ||
|
|
72
58
|
(0, section_categories_1.isUniqueCurrent)(cat._id, currentValue))) {
|
|
73
|
-
options.push({
|
|
74
|
-
value: cat._id,
|
|
75
|
-
label: cat.name,
|
|
76
|
-
isDisabled: isDisabled,
|
|
77
|
-
});
|
|
59
|
+
options.push({ value: cat._id, label: cat.name });
|
|
78
60
|
}
|
|
79
61
|
});
|
|
80
62
|
return options;
|
|
81
|
-
}, [currentValue, existingCatsCounted, sectionCategories
|
|
63
|
+
}, [currentValue, existingCatsCounted, sectionCategories]);
|
|
82
64
|
const selectionValue = (0, react_1.useMemo)(() => {
|
|
83
65
|
const cat = sectionCategories.find((category) => category._id === currentValue);
|
|
84
|
-
return cat && { value: cat._id, label: cat.name
|
|
66
|
+
return cat && { value: cat._id, label: cat.name };
|
|
85
67
|
}, [currentValue, sectionCategories]);
|
|
86
68
|
return (react_1.default.createElement(Container, null,
|
|
87
69
|
react_1.default.createElement(react_select_1.default, { value: selectionValue, options: options, menuPortalTarget: document.body, onChange: handleInputChange, maxMenuHeight: 150, components: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CategoryInput.js","sourceRoot":"","sources":["../../../../src/components/projects/CategoryInput.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGH
|
|
1
|
+
{"version":3,"file":"CategoryInput.js","sourceRoot":"","sources":["../../../../src/components/projects/CategoryInput.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGH,+CAAmD;AACnD,gEAAkD;AAClD,0EAAsC;AAEtC,iEAA2D;AAC3D,qEAIqC;AACrC,2CAA2C;AAOpC,MAAM,aAAa,GAKrB,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,EAAE,EAAE;IACvE,MAAM,CAAC,YAAY,EAAE,iBAAiB,CAAC,GAAG,IAAA,+BAAa,EACrD,KAAK,EACL,YAAY,EACZ,CAAC,CACF,CAAA;IAED,MAAM,iBAAiB,GAAG,IAAA,mBAAW,EACnC,CAAC,QAA2B,EAAE,EAAE,CAC9B,QAAQ,IAAI,iBAAiB,CAAC,QAAQ,CAAC,KAAK,CAAC,EAC/C,CAAC,iBAAiB,CAAC,CACpB,CAAA;IAED,MAAM,eAAe,GAA6C,CAAC,EACjE,UAAU,EACV,IAAI,GACL,EAAE,EAAE;QACH,OAAO,CACL,8BAAC,yBAAa,OAAK,UAAU,EAAE,GAAG,EAAE,IAAI,IACrC,IAAI,CAAC,KAAK,CACG,CACjB,CAAA;IACH,CAAC,CAAA;IAED,MAAM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ED,MAAM,SAAS,GAAG,2BAAM,CAAC,GAAG,CAAA;YAChB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,EAAE;CAChD,CAAA"}
|
|
@@ -23,13 +23,11 @@ exports.OptionWrapper = styled_components_1.default.div `
|
|
|
23
23
|
display: flex;
|
|
24
24
|
justify-content: space-between;
|
|
25
25
|
align-items: center;
|
|
26
|
-
|
|
27
|
-
opacity: ${(props) => (props.isDisabled ? 0.5 : 1)};
|
|
26
|
+
|
|
28
27
|
background-color: ${(props) => props.focused ? props.theme.colors.background.fifth : 'transparent'};
|
|
29
28
|
|
|
30
29
|
&:hover {
|
|
31
|
-
background-color: ${(props) => props.
|
|
32
|
-
|
|
30
|
+
background-color: ${(props) => props.theme.colors.background.fifth};
|
|
33
31
|
g {
|
|
34
32
|
fill: ${(props) => props.theme.colors.text.secondary};
|
|
35
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagsInput.js","sourceRoot":"","sources":["../../../../src/components/projects/TagsInput.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;AAEH,0EAAsC;AAEzB,QAAA,aAAa,GAAG,2BAAM,CAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"TagsInput.js","sourceRoot":"","sources":["../../../../src/components/projects/TagsInput.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;AAEH,0EAAsC;AAEzB,QAAA,aAAa,GAAG,2BAAM,CAAC,GAAG,CAAuB;kBAC5C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;iBACrC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;oBACjC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;;;;;sBAKlC,CAAC,KAAK,EAAE,EAAE,CAC5B,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa;;;wBAG/C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK;;cAExD,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS;;;CAGzD,CAAA;AACY,QAAA,cAAc,GAAG,2BAAM,CAAC,GAAG,CAAA;;CAEvC,CAAA;AAEY,QAAA,SAAS,GAAG,2BAAM,CAAC,GAAG,CAAA;;CAElC,CAAA"}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2020 Atypon Systems LLC. All Rights Reserved.
|
|
12
12
|
*/
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.
|
|
14
|
+
exports.isUniquePresent = exports.isUniqueCurrent = exports.isUnique = exports.chooseSectionCategory = exports.sortSectionCategories = exports.isEditableSectionCategory = exports.isEditableSectionCategoryID = exports.uniqueSectionCategories = exports.uneditableSectionCategories = void 0;
|
|
15
15
|
exports.uneditableSectionCategories = [
|
|
16
16
|
'MPSectionCategory:bibliography',
|
|
17
17
|
'MPSectionCategory:keywords',
|
|
@@ -50,23 +50,4 @@ const isUniquePresent = (cat, existingCats) => {
|
|
|
50
50
|
return (0, exports.isUnique)(cat._id) && Object.keys(existingCats).includes(cat._id);
|
|
51
51
|
};
|
|
52
52
|
exports.isUniquePresent = isUniquePresent;
|
|
53
|
-
const isBackMatterSection = (groupId) => {
|
|
54
|
-
return groupId === 'MPSectionCategory:backmatter';
|
|
55
|
-
};
|
|
56
|
-
exports.isBackMatterSection = isBackMatterSection;
|
|
57
|
-
const isBackMatterSectionCategoryExist = (parent, category) => {
|
|
58
|
-
let found = false;
|
|
59
|
-
parent.descendants((node) => {
|
|
60
|
-
if (node.attrs.category === category) {
|
|
61
|
-
found = true;
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
if (found) {
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
return true;
|
|
68
|
-
});
|
|
69
|
-
return found;
|
|
70
|
-
};
|
|
71
|
-
exports.isBackMatterSectionCategoryExist = isBackMatterSectionCategoryExist;
|
|
72
53
|
//# sourceMappingURL=section-categories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"section-categories.js","sourceRoot":"","sources":["../../../src/lib/section-categories.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;
|
|
1
|
+
{"version":3,"file":"section-categories.js","sourceRoot":"","sources":["../../../src/lib/section-categories.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAIU,QAAA,2BAA2B,GAAa;IACnD,gCAAgC;IAChC,4BAA4B;IAC5B,mCAAmC;IACnC,kCAAkC;IAClC,uBAAuB;CACxB,CAAA;AAEY,QAAA,uBAAuB,GAAa;IAC/C,sCAAsC;IACtC,4BAA4B;CAC7B,CAAA;AAEM,MAAM,2BAA2B,GAAG,CAAC,EAAU,EAAE,EAAE,CACxD,CAAC,mCAA2B,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;AAD9B,QAAA,2BAA2B,+BACG;AAEpC,MAAM,yBAAyB,GAAG,CAAC,eAAgC,EAAE,EAAE,CAC5E,IAAA,mCAA2B,EAAC,eAAe,CAAC,GAAG,CAAC,CAAA;AADrC,QAAA,yBAAyB,6BACY;AAE3C,MAAM,qBAAqB,GAAG,CAAC,iBAAoC,EAAE,EAAE,CAC5E,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAA;AAD9C,QAAA,qBAAqB,yBACyB;AAEpD,MAAM,qBAAqB,GAAG,CAAC,OAAgB,EAAU,EAAE;IAChE,IAAI,OAAO,CAAC,QAAQ,EAAE;QACpB,OAAO,OAAO,CAAC,QAAQ,CAAA;KACxB;IAED,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC;QAC9B,CAAC,CAAC,2BAA2B;QAC7B,CAAC,CAAC,8BAA8B,CAAA;AACpC,CAAC,CAAA;AARY,QAAA,qBAAqB,yBAQjC;AAEM,MAAM,QAAQ,GAAG,CAAC,UAAkB,EAAE,EAAE;IAC7C,OAAO,+BAAuB,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAA;AACrD,CAAC,CAAA;AAFY,QAAA,QAAQ,YAEpB;AAEM,MAAM,eAAe,GAAG,CAC7B,UAAkB,EAClB,iBAAyB,EACzB,EAAE;IACF,OAAO,UAAU,KAAK,iBAAiB,CAAA;AACzC,CAAC,CAAA;AALY,QAAA,eAAe,mBAK3B;AAEM,MAAM,eAAe,GAAG,CAC7B,GAAoB,EACpB,YAAuC,EACvC,EAAE;IACF,OAAO,IAAA,gBAAQ,EAAC,GAAG,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AACzE,CAAC,CAAA;AALY,QAAA,eAAe,mBAK3B"}
|
|
@@ -9,50 +9,32 @@
|
|
|
9
9
|
*
|
|
10
10
|
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2020 Atypon Systems LLC. All Rights Reserved.
|
|
11
11
|
*/
|
|
12
|
-
import { schema } from '@manuscripts/transform';
|
|
13
|
-
import { findChildrenByType } from 'prosemirror-utils';
|
|
14
12
|
import React, { useCallback, useMemo } from 'react';
|
|
15
13
|
import Select from 'react-select';
|
|
16
14
|
import styled from 'styled-components';
|
|
17
15
|
import { useSyncedData } from '../../hooks/use-synced-data';
|
|
18
|
-
import {
|
|
19
|
-
import { useStore } from '../../store';
|
|
16
|
+
import { isEditableSectionCategory, isUniqueCurrent, isUniquePresent, } from '../../lib/section-categories';
|
|
20
17
|
import { OptionWrapper } from './TagsInput';
|
|
21
18
|
export const CategoryInput = ({ value, handleChange, existingCatsCounted, sectionCategories }) => {
|
|
22
19
|
const [currentValue, handleLocalChange] = useSyncedData(value, handleChange, 0);
|
|
23
|
-
const [{ doc }] = useStore((state) => ({
|
|
24
|
-
doc: state.doc,
|
|
25
|
-
}));
|
|
26
20
|
const handleInputChange = useCallback((newValue) => newValue && handleLocalChange(newValue.value), [handleLocalChange]);
|
|
27
21
|
const OptionComponent = ({ innerProps, data, }) => {
|
|
28
|
-
return (React.createElement(OptionWrapper, { ...innerProps,
|
|
22
|
+
return (React.createElement(OptionWrapper, { ...innerProps, ref: null }, data.label));
|
|
29
23
|
};
|
|
30
24
|
const options = useMemo(() => {
|
|
31
|
-
const backmatter = findChildrenByType(doc, schema.nodes.backmatter)[0];
|
|
32
25
|
const options = [];
|
|
33
26
|
sectionCategories.map((cat) => {
|
|
34
|
-
// check if the category is part of the backmatter section, and its already present in the document
|
|
35
|
-
let isDisabled = false;
|
|
36
|
-
if (cat.groupIDs &&
|
|
37
|
-
isBackMatterSection(cat.groupIDs[0]) &&
|
|
38
|
-
isBackMatterSectionCategoryExist(backmatter.node, cat._id)) {
|
|
39
|
-
isDisabled = true;
|
|
40
|
-
}
|
|
41
27
|
if (isEditableSectionCategory(cat) &&
|
|
42
28
|
(!isUniquePresent(cat, existingCatsCounted) ||
|
|
43
29
|
isUniqueCurrent(cat._id, currentValue))) {
|
|
44
|
-
options.push({
|
|
45
|
-
value: cat._id,
|
|
46
|
-
label: cat.name,
|
|
47
|
-
isDisabled: isDisabled,
|
|
48
|
-
});
|
|
30
|
+
options.push({ value: cat._id, label: cat.name });
|
|
49
31
|
}
|
|
50
32
|
});
|
|
51
33
|
return options;
|
|
52
|
-
}, [currentValue, existingCatsCounted, sectionCategories
|
|
34
|
+
}, [currentValue, existingCatsCounted, sectionCategories]);
|
|
53
35
|
const selectionValue = useMemo(() => {
|
|
54
36
|
const cat = sectionCategories.find((category) => category._id === currentValue);
|
|
55
|
-
return cat && { value: cat._id, label: cat.name
|
|
37
|
+
return cat && { value: cat._id, label: cat.name };
|
|
56
38
|
}, [currentValue, sectionCategories]);
|
|
57
39
|
return (React.createElement(Container, null,
|
|
58
40
|
React.createElement(Select, { value: selectionValue, options: options, menuPortalTarget: document.body, onChange: handleInputChange, maxMenuHeight: 150, components: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CategoryInput.js","sourceRoot":"","sources":["../../../../src/components/projects/CategoryInput.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"CategoryInput.js","sourceRoot":"","sources":["../../../../src/components/projects/CategoryInput.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACnD,OAAO,MAAuB,MAAM,cAAc,CAAA;AAClD,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAC3D,OAAO,EACL,yBAAyB,EACzB,eAAe,EACf,eAAe,GAChB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAO3C,MAAM,CAAC,MAAM,aAAa,GAKrB,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,EAAE,EAAE;IACvE,MAAM,CAAC,YAAY,EAAE,iBAAiB,CAAC,GAAG,aAAa,CACrD,KAAK,EACL,YAAY,EACZ,CAAC,CACF,CAAA;IAED,MAAM,iBAAiB,GAAG,WAAW,CACnC,CAAC,QAA2B,EAAE,EAAE,CAC9B,QAAQ,IAAI,iBAAiB,CAAC,QAAQ,CAA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AAE,OAAO,EAChB,gBAAgB,EAAE,QAAQ,CAAC,IAAI,EAC/B,QAAQ,EAAE,iBAAiB,EAC3B,aAAa,EAAE,GAAG,EAClB,UAAU,EAAE;gBACV,MAAM,EAAE,eAAe;aACxB,GACD,CACQ,CACb,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;YAChB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,EAAE;CAChD,CAAA"}
|
|
@@ -17,13 +17,11 @@ export const OptionWrapper = styled.div `
|
|
|
17
17
|
display: flex;
|
|
18
18
|
justify-content: space-between;
|
|
19
19
|
align-items: center;
|
|
20
|
-
|
|
21
|
-
opacity: ${(props) => (props.isDisabled ? 0.5 : 1)};
|
|
20
|
+
|
|
22
21
|
background-color: ${(props) => props.focused ? props.theme.colors.background.fifth : 'transparent'};
|
|
23
22
|
|
|
24
23
|
&:hover {
|
|
25
|
-
background-color: ${(props) => props.
|
|
26
|
-
|
|
24
|
+
background-color: ${(props) => props.theme.colors.background.fifth};
|
|
27
25
|
g {
|
|
28
26
|
fill: ${(props) => props.theme.colors.text.secondary};
|
|
29
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagsInput.js","sourceRoot":"","sources":["../../../../src/components/projects/TagsInput.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"TagsInput.js","sourceRoot":"","sources":["../../../../src/components/projects/TagsInput.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAuB;kBAC5C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;iBACrC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;oBACjC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;;;;;sBAKlC,CAAC,KAAK,EAAE,EAAE,CAC5B,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa;;;wBAG/C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK;;cAExD,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS;;;CAGzD,CAAA;AACD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA;;CAEvC,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;;CAElC,CAAA"}
|
|
@@ -40,21 +40,4 @@ export const isUniqueCurrent = (categoryId, currentCategoryId) => {
|
|
|
40
40
|
export const isUniquePresent = (cat, existingCats) => {
|
|
41
41
|
return isUnique(cat._id) && Object.keys(existingCats).includes(cat._id);
|
|
42
42
|
};
|
|
43
|
-
export const isBackMatterSection = (groupId) => {
|
|
44
|
-
return groupId === 'MPSectionCategory:backmatter';
|
|
45
|
-
};
|
|
46
|
-
export const isBackMatterSectionCategoryExist = (parent, category) => {
|
|
47
|
-
let found = false;
|
|
48
|
-
parent.descendants((node) => {
|
|
49
|
-
if (node.attrs.category === category) {
|
|
50
|
-
found = true;
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
if (found) {
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
return true;
|
|
57
|
-
});
|
|
58
|
-
return found;
|
|
59
|
-
};
|
|
60
43
|
//# sourceMappingURL=section-categories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"section-categories.js","sourceRoot":"","sources":["../../../src/lib/section-categories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"section-categories.js","sourceRoot":"","sources":["../../../src/lib/section-categories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,MAAM,CAAC,MAAM,2BAA2B,GAAa;IACnD,gCAAgC;IAChC,4BAA4B;IAC5B,mCAAmC;IACnC,kCAAkC;IAClC,uBAAuB;CACxB,CAAA;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAa;IAC/C,sCAAsC;IACtC,4BAA4B;CAC7B,CAAA;AAED,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,EAAU,EAAE,EAAE,CACxD,CAAC,2BAA2B,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;AAE3C,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,eAAgC,EAAE,EAAE,CAC5E,2BAA2B,CAAC,eAAe,CAAC,GAAG,CAAC,CAAA;AAElD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,iBAAoC,EAAE,EAAE,CAC5E,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAA;AAE3D,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,OAAgB,EAAU,EAAE;IAChE,IAAI,OAAO,CAAC,QAAQ,EAAE;QACpB,OAAO,OAAO,CAAC,QAAQ,CAAA;KACxB;IAED,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC;QAC9B,CAAC,CAAC,2BAA2B;QAC7B,CAAC,CAAC,8BAA8B,CAAA;AACpC,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,UAAkB,EAAE,EAAE;IAC7C,OAAO,uBAAuB,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAA;AACrD,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,UAAkB,EAClB,iBAAyB,EACzB,EAAE;IACF,OAAO,UAAU,KAAK,iBAAiB,CAAA;AACzC,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,GAAoB,EACpB,YAAuC,EACvC,EAAE;IACF,OAAO,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AACzE,CAAC,CAAA"}
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export declare const OptionWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
13
13
|
focused?: boolean | undefined;
|
|
14
|
-
isDisabled?: boolean | undefined;
|
|
15
14
|
}, never>;
|
|
16
15
|
export declare const OuterContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
17
16
|
export declare const Container: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2020 Atypon Systems LLC. All Rights Reserved.
|
|
11
11
|
*/
|
|
12
12
|
import { Section, SectionCategory } from '@manuscripts/json-schema';
|
|
13
|
-
import { ManuscriptNode } from '@manuscripts/transform';
|
|
14
13
|
export declare const uneditableSectionCategories: string[];
|
|
15
14
|
export declare const uniqueSectionCategories: string[];
|
|
16
15
|
export declare const isEditableSectionCategoryID: (id: string) => boolean;
|
|
@@ -22,5 +21,3 @@ export declare const isUniqueCurrent: (categoryId: string, currentCategoryId: st
|
|
|
22
21
|
export declare const isUniquePresent: (cat: SectionCategory, existingCats: {
|
|
23
22
|
[key: string]: number;
|
|
24
23
|
}) => boolean;
|
|
25
|
-
export declare const isBackMatterSection: (groupId: string) => boolean;
|
|
26
|
-
export declare const isBackMatterSectionCategoryExist: (parent: ManuscriptNode, category: string) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/article-editor",
|
|
3
|
-
"version": "3.0.2
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"license": "CPAL-1.0",
|
|
5
5
|
"description": "React components for editing and viewing manuscripts",
|
|
6
6
|
"repository": "github:Atypon-OpenSource/manuscripts-article-editor",
|
|
@@ -35,13 +35,12 @@
|
|
|
35
35
|
"@fontsource/lato": "^4.5.10",
|
|
36
36
|
"@fontsource/pt-sans": "^4.5.11",
|
|
37
37
|
"@fontsource/pt-serif": "^4.5.11",
|
|
38
|
-
"@manuscripts/body-editor": "2.0.3
|
|
38
|
+
"@manuscripts/body-editor": "2.0.3",
|
|
39
39
|
"@manuscripts/json-schema": "2.2.10",
|
|
40
40
|
"@manuscripts/library": "1.3.10",
|
|
41
41
|
"@manuscripts/style-guide": "2.0.0",
|
|
42
42
|
"@manuscripts/track-changes-plugin": "1.7.15",
|
|
43
43
|
"@manuscripts/transform": "2.3.21",
|
|
44
|
-
"prosemirror-utils": "^0.9.6",
|
|
45
44
|
"@microsoft/fetch-event-source": "^2.0.1",
|
|
46
45
|
"@popperjs/core": "^2.11.8",
|
|
47
46
|
"@reach/tabs": "^0.18.0",
|