@manuscripts/article-editor 1.9.4 → 1.9.5-LEAN-3092-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.
- package/dist/cjs/src/components/Sidebar/Sidebar.js +1 -2
- package/dist/cjs/src/components/Sidebar/Sidebar.js.map +1 -1
- package/dist/cjs/src/hooks/use-create-editor.js +0 -18
- package/dist/cjs/src/hooks/use-create-editor.js.map +1 -1
- package/dist/es/src/components/Sidebar/Sidebar.js +1 -2
- package/dist/es/src/components/Sidebar/Sidebar.js.map +1 -1
- package/dist/es/src/hooks/use-create-editor.js +0 -18
- package/dist/es/src/hooks/use-create-editor.js.map +1 -1
- package/package.json +6 -7
- package/dist/cjs/src/components/SelectField.js +0 -24
- package/dist/cjs/src/components/SelectField.js.map +0 -1
- package/dist/cjs/src/components/library/BibliographyImportButton.js +0 -149
- package/dist/cjs/src/components/library/BibliographyImportButton.js.map +0 -1
- package/dist/cjs/src/components/library/CitationEditor.js +0 -227
- package/dist/cjs/src/components/library/CitationEditor.js.map +0 -1
- package/dist/cjs/src/components/library/CitationModal.js +0 -262
- package/dist/cjs/src/components/library/CitationModal.js.map +0 -1
- package/dist/cjs/src/components/library/CitationSearch.js +0 -214
- package/dist/cjs/src/components/library/CitationSearch.js.map +0 -1
- package/dist/cjs/src/components/library/CitationSearchSection.js +0 -133
- package/dist/cjs/src/components/library/CitationSearchSection.js.map +0 -1
- package/dist/cjs/src/components/library/CitationViewer.js +0 -53
- package/dist/cjs/src/components/library/CitationViewer.js.map +0 -1
- package/dist/cjs/src/components/library/ReferenceForm.js +0 -419
- package/dist/cjs/src/components/library/ReferenceForm.js.map +0 -1
- package/dist/cjs/src/components/library/ReferencesEditor.js +0 -70
- package/dist/cjs/src/components/library/ReferencesEditor.js.map +0 -1
- package/dist/cjs/src/components/library/ReferencesViewer.js +0 -33
- package/dist/cjs/src/components/library/ReferencesViewer.js.map +0 -1
- package/dist/cjs/src/components/library/SearchResults.js +0 -126
- package/dist/cjs/src/components/library/SearchResults.js.map +0 -1
- package/dist/cjs/src/components/projects/icons/DeleteIcon.js +0 -27
- package/dist/cjs/src/components/projects/icons/DeleteIcon.js.map +0 -1
- package/dist/cjs/src/components/projects/icons/GroupIcon.js +0 -29
- package/dist/cjs/src/components/projects/icons/GroupIcon.js.map +0 -1
- package/dist/cjs/src/components/projects/icons/LinkIcon.js +0 -23
- package/dist/cjs/src/components/projects/icons/LinkIcon.js.map +0 -1
- package/dist/cjs/src/components/projects/icons/TemplateIcon.js +0 -23
- package/dist/cjs/src/components/projects/icons/TemplateIcon.js.map +0 -1
- package/dist/cjs/src/lib/select-styles.js +0 -40
- package/dist/cjs/src/lib/select-styles.js.map +0 -1
- package/dist/cjs/src/lib/sources.js +0 -36
- package/dist/cjs/src/lib/sources.js.map +0 -1
- package/dist/es/src/components/SelectField.js +0 -17
- package/dist/es/src/components/SelectField.js.map +0 -1
- package/dist/es/src/components/library/BibliographyImportButton.js +0 -120
- package/dist/es/src/components/library/BibliographyImportButton.js.map +0 -1
- package/dist/es/src/components/library/CitationEditor.js +0 -198
- package/dist/es/src/components/library/CitationEditor.js.map +0 -1
- package/dist/es/src/components/library/CitationModal.js +0 -232
- package/dist/es/src/components/library/CitationModal.js.map +0 -1
- package/dist/es/src/components/library/CitationSearch.js +0 -184
- package/dist/es/src/components/library/CitationSearch.js.map +0 -1
- package/dist/es/src/components/library/CitationSearchSection.js +0 -103
- package/dist/es/src/components/library/CitationSearchSection.js.map +0 -1
- package/dist/es/src/components/library/CitationViewer.js +0 -46
- package/dist/es/src/components/library/CitationViewer.js.map +0 -1
- package/dist/es/src/components/library/ReferenceForm.js +0 -389
- package/dist/es/src/components/library/ReferenceForm.js.map +0 -1
- package/dist/es/src/components/library/ReferencesEditor.js +0 -43
- package/dist/es/src/components/library/ReferencesEditor.js.map +0 -1
- package/dist/es/src/components/library/ReferencesViewer.js +0 -26
- package/dist/es/src/components/library/ReferencesViewer.js.map +0 -1
- package/dist/es/src/components/library/SearchResults.js +0 -119
- package/dist/es/src/components/library/SearchResults.js.map +0 -1
- package/dist/es/src/components/projects/icons/DeleteIcon.js +0 -20
- package/dist/es/src/components/projects/icons/DeleteIcon.js.map +0 -1
- package/dist/es/src/components/projects/icons/GroupIcon.js +0 -22
- package/dist/es/src/components/projects/icons/GroupIcon.js.map +0 -1
- package/dist/es/src/components/projects/icons/LinkIcon.js +0 -16
- package/dist/es/src/components/projects/icons/LinkIcon.js.map +0 -1
- package/dist/es/src/components/projects/icons/TemplateIcon.js +0 -16
- package/dist/es/src/components/projects/icons/TemplateIcon.js.map +0 -1
- package/dist/es/src/lib/select-styles.js +0 -37
- package/dist/es/src/lib/select-styles.js.map +0 -1
- package/dist/es/src/lib/sources.js +0 -33
- package/dist/es/src/lib/sources.js.map +0 -1
- package/dist/types/src/components/SelectField.d.ts +0 -23
- package/dist/types/src/components/library/BibliographyImportButton.d.ts +0 -23
- package/dist/types/src/components/library/CitationEditor.d.ts +0 -30
- package/dist/types/src/components/library/CitationModal.d.ts +0 -17
- package/dist/types/src/components/library/CitationSearch.d.ts +0 -22
- package/dist/types/src/components/library/CitationSearchSection.d.ts +0 -34
- package/dist/types/src/components/library/CitationViewer.d.ts +0 -18
- package/dist/types/src/components/library/ReferenceForm.d.ts +0 -51
- package/dist/types/src/components/library/ReferencesEditor.d.ts +0 -22
- package/dist/types/src/components/library/ReferencesViewer.d.ts +0 -9
- package/dist/types/src/components/library/SearchResults.d.ts +0 -26
- package/dist/types/src/components/projects/icons/DeleteIcon.d.ts +0 -13
- package/dist/types/src/components/projects/icons/GroupIcon.d.ts +0 -15
- package/dist/types/src/components/projects/icons/LinkIcon.d.ts +0 -13
- package/dist/types/src/components/projects/icons/TemplateIcon.d.ts +0 -13
- package/dist/types/src/lib/select-styles.d.ts +0 -13
- package/dist/types/src/lib/sources.d.ts +0 -25
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
4
|
-
*
|
|
5
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
6
|
-
*
|
|
7
|
-
* The Original Code is manuscripts-frontend.
|
|
8
|
-
*
|
|
9
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
10
|
-
*
|
|
11
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2023 Atypon Systems LLC. All Rights Reserved.
|
|
12
|
-
*/
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.ReferencesEditor = void 0;
|
|
38
|
-
const json_schema_1 = require("@manuscripts/json-schema");
|
|
39
|
-
const react_1 = __importStar(require("react"));
|
|
40
|
-
const CitationModal_1 = require("./CitationModal");
|
|
41
|
-
const ReferencesEditor = (props) => {
|
|
42
|
-
const { saveModel, deleteModel, referenceID } = props;
|
|
43
|
-
const [modelMap, setModelMap] = (0, react_1.useState)(props.modelMap);
|
|
44
|
-
const [showEditModel, setShowEditModel] = (0, react_1.useState)(false);
|
|
45
|
-
const [selectedItem, setSelectedItem] = (0, react_1.useState)();
|
|
46
|
-
(0, react_1.useEffect)(() => {
|
|
47
|
-
if (referenceID) {
|
|
48
|
-
const reference = modelMap.get(referenceID);
|
|
49
|
-
setSelectedItem(reference);
|
|
50
|
-
setShowEditModel(true);
|
|
51
|
-
}
|
|
52
|
-
}, [referenceID, modelMap]);
|
|
53
|
-
const saveCallback = (0, react_1.useCallback)(async (item) => {
|
|
54
|
-
await saveModel({ ...item, objectType: json_schema_1.ObjectTypes.BibliographyItem });
|
|
55
|
-
setModelMap(new Map([
|
|
56
|
-
...modelMap,
|
|
57
|
-
[item._id, { ...item, objectType: json_schema_1.ObjectTypes.BibliographyItem }],
|
|
58
|
-
]));
|
|
59
|
-
}, [saveModel, modelMap]);
|
|
60
|
-
const deleteReferenceCallback = (0, react_1.useCallback)(async () => {
|
|
61
|
-
if (selectedItem) {
|
|
62
|
-
await deleteModel(selectedItem._id);
|
|
63
|
-
modelMap.delete(selectedItem._id);
|
|
64
|
-
setModelMap(new Map([...modelMap]));
|
|
65
|
-
}
|
|
66
|
-
}, [selectedItem, deleteModel, modelMap]);
|
|
67
|
-
return (react_1.default.createElement(CitationModal_1.CitationModal, { editCitation: showEditModel, modelMap: modelMap, saveCallback: saveCallback, selectedItem: selectedItem, deleteCallback: deleteReferenceCallback, setSelectedItem: setSelectedItem, setShowEditModel: setShowEditModel }));
|
|
68
|
-
};
|
|
69
|
-
exports.ReferencesEditor = ReferencesEditor;
|
|
70
|
-
//# sourceMappingURL=ReferencesEditor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReferencesEditor.js","sourceRoot":"","sources":["../../../../../src/components/library/ReferencesEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,0DAA+E;AAE/E,+CAA+D;AAE/D,mDAA+C;AASxC,MAAM,gBAAgB,GAAoB,CAAC,KAAK,EAAE,EAAE;IACzD,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,KAAK,CAAA;IACrD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;IAExD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAA;IACzD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,GAAoB,CAAA;IAEpE,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,WAAW,EAAE;YACf,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAqB,CAAA;YAC/D,eAAe,CAAC,SAAS,CAAC,CAAA;YAC1B,gBAAgB,CAAC,IAAI,CAAC,CAAA;SACvB;IACH,CAAC,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAA;IAE3B,MAAM,YAAY,GAAG,IAAA,mBAAW,EAC9B,KAAK,EAAE,IAAI,EAAE,EAAE;QACb,MAAM,SAAS,CAAC,EAAE,GAAG,IAAI,EAAE,UAAU,EAAE,yBAAW,CAAC,gBAAgB,EAAE,CAAC,CAAA;QACtE,WAAW,CACT,IAAI,GAAG,CAAC;YACN,GAAG,QAAQ;YACX,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,GAAG,IAAI,EAAE,UAAU,EAAE,yBAAW,CAAC,gBAAgB,EAAE,CAAC;SAClE,CAAC,CACH,CAAA;IACH,CAAC,EACD,CAAC,SAAS,EAAE,QAAQ,CAAC,CACtB,CAAA;IAED,MAAM,uBAAuB,GAAG,IAAA,mBAAW,EAAC,KAAK,IAAI,EAAE;QACrD,IAAI,YAAY,EAAE;YAChB,MAAM,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;YACnC,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;YACjC,WAAW,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;SACpC;IACH,CAAC,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAA;IAEzC,OAAO,CACL,8BAAC,6BAAa,IACZ,YAAY,EAAE,aAAa,EAC3B,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,uBAAuB,EACvC,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,gBAAgB,GAClC,CACH,CAAA;AACH,CAAC,CAAA;AA/CY,QAAA,gBAAgB,oBA+C5B"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ReferencesViewer = void 0;
|
|
7
|
-
/*!
|
|
8
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
9
|
-
*
|
|
10
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
11
|
-
*
|
|
12
|
-
* The Original Code is manuscripts-frontend.
|
|
13
|
-
*
|
|
14
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
15
|
-
*
|
|
16
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2021 Atypon Systems LLC. All Rights Reserved.
|
|
17
|
-
*/
|
|
18
|
-
const style_guide_1 = require("@manuscripts/style-guide");
|
|
19
|
-
const react_1 = __importDefault(require("react"));
|
|
20
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
21
|
-
const References = styled_components_1.default.div `
|
|
22
|
-
display: flex;
|
|
23
|
-
flex-direction: column;
|
|
24
|
-
flex-wrap: wrap;
|
|
25
|
-
`;
|
|
26
|
-
const Reference = (0, styled_components_1.default)(style_guide_1.TertiaryButton) `
|
|
27
|
-
text-decoration: none;
|
|
28
|
-
`;
|
|
29
|
-
const ReferencesViewer = ({ items }) => {
|
|
30
|
-
return (react_1.default.createElement(References, null, items.map((item) => (react_1.default.createElement(Reference, { as: 'a', key: item.referencedObject, href: `#${item.referencedObject}` }, item.label)))));
|
|
31
|
-
};
|
|
32
|
-
exports.ReferencesViewer = ReferencesViewer;
|
|
33
|
-
//# sourceMappingURL=ReferencesViewer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReferencesViewer.js","sourceRoot":"","sources":["../../../../../src/components/library/ReferencesViewer.tsx"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;GAUG;AACH,0DAAyD;AACzD,kDAAyB;AACzB,0EAAsC;AAMtC,MAAM,UAAU,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;CAI5B,CAAA;AAED,MAAM,SAAS,GAAG,IAAA,2BAAM,EAAC,4BAAc,CAAC,CAAA;;CAEvC,CAAA;AAEM,MAAM,gBAAgB,GAAoB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC7D,OAAO,CACL,8BAAC,UAAU,QACR,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,8BAAC,SAAS,IACR,EAAE,EAAE,GAAG,EACP,GAAG,EAAE,IAAI,CAAC,gBAAgB,EAC1B,IAAI,EAAE,IAAI,IAAI,CAAC,gBAAgB,EAAE,IAEhC,IAAI,CAAC,KAAK,CACD,CACb,CAAC,CACS,CACd,CAAA;AACH,CAAC,CAAA;AAdY,QAAA,gBAAgB,oBAc5B"}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
4
|
-
*
|
|
5
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
6
|
-
*
|
|
7
|
-
* The Original Code is manuscripts-frontend.
|
|
8
|
-
*
|
|
9
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
10
|
-
*
|
|
11
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
12
|
-
*/
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.SearchResults = void 0;
|
|
18
|
-
const AddedIcon_1 = __importDefault(require("@manuscripts/assets/react/AddedIcon"));
|
|
19
|
-
const AddIcon_1 = __importDefault(require("@manuscripts/assets/react/AddIcon"));
|
|
20
|
-
const library_1 = require("@manuscripts/library");
|
|
21
|
-
const title_editor_1 = require("@manuscripts/title-editor");
|
|
22
|
-
const react_1 = __importDefault(require("react"));
|
|
23
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
24
|
-
const SearchResult = styled_components_1.default.div `
|
|
25
|
-
cursor: pointer;
|
|
26
|
-
padding: ${(props) => props.theme.grid.unit * 2}px 0;
|
|
27
|
-
display: flex;
|
|
28
|
-
|
|
29
|
-
&:not(:last-of-type) {
|
|
30
|
-
border-bottom: 1px solid #f6f6f6;
|
|
31
|
-
}
|
|
32
|
-
`;
|
|
33
|
-
const SearchResultAuthors = styled_components_1.default.div `
|
|
34
|
-
color: ${(props) => props.theme.colors.text.secondary};
|
|
35
|
-
flex: 1;
|
|
36
|
-
font-weight: ${(props) => props.theme.font.weight.light};
|
|
37
|
-
margin-top: ${(props) => props.theme.grid.unit}px;
|
|
38
|
-
`;
|
|
39
|
-
const ResultAuthorsPlaceholder = (0, styled_components_1.default)(SearchResultAuthors) `
|
|
40
|
-
background: ${(props) => props.theme.colors.text.muted};
|
|
41
|
-
height: 1.2em;
|
|
42
|
-
`;
|
|
43
|
-
const ResultTitlePlaceholder = styled_components_1.default.div `
|
|
44
|
-
background: ${(props) => props.theme.colors.border.primary};
|
|
45
|
-
height: 1.2em;
|
|
46
|
-
`;
|
|
47
|
-
const ResultMetadata = styled_components_1.default.div `
|
|
48
|
-
flex: 1;
|
|
49
|
-
`;
|
|
50
|
-
const Fetching = styled_components_1.default.div `
|
|
51
|
-
display: inline-block;
|
|
52
|
-
height: ${(props) => props.theme.grid.unit * 6}px;
|
|
53
|
-
width: ${(props) => props.theme.grid.unit * 6}px;
|
|
54
|
-
border: 1px dashed ${(props) => props.theme.colors.brand.default};
|
|
55
|
-
box-sizing: border-box;
|
|
56
|
-
border-radius: 50%;
|
|
57
|
-
animation: spin 10s linear infinite;
|
|
58
|
-
|
|
59
|
-
@keyframes spin {
|
|
60
|
-
100% {
|
|
61
|
-
transform: rotateZ(360deg);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
`;
|
|
65
|
-
const StatusIcon = styled_components_1.default.div `
|
|
66
|
-
flex-shrink: 1;
|
|
67
|
-
margin-right: ${(props) => props.theme.grid.unit * 3}px;
|
|
68
|
-
height: ${(props) => props.theme.grid.unit * 6}px;
|
|
69
|
-
width: ${(props) => props.theme.grid.unit * 6}px;
|
|
70
|
-
display: inline-flex;
|
|
71
|
-
justify-content: center;
|
|
72
|
-
align-items: center;
|
|
73
|
-
cursor: pointer;
|
|
74
|
-
`;
|
|
75
|
-
const Results = styled_components_1.default.div `
|
|
76
|
-
padding: 0 ${(props) => props.theme.grid.unit * 4}px;
|
|
77
|
-
flex: 1;
|
|
78
|
-
overflow-y: auto;
|
|
79
|
-
`;
|
|
80
|
-
const Error = styled_components_1.default.div `
|
|
81
|
-
padding: 0 ${(props) => props.theme.grid.unit * 3}px;
|
|
82
|
-
`;
|
|
83
|
-
const ResultPlaceholder = () => (react_1.default.createElement(SearchResult, { style: { opacity: 0.2 } },
|
|
84
|
-
react_1.default.createElement("div", { style: { width: 40 } }, "\u2026"),
|
|
85
|
-
react_1.default.createElement(ResultMetadata, null,
|
|
86
|
-
react_1.default.createElement(ResultTitlePlaceholder, null),
|
|
87
|
-
react_1.default.createElement(ResultAuthorsPlaceholder, null))));
|
|
88
|
-
const chooseStatusIcon = (fetching, selected, id) => {
|
|
89
|
-
if (fetching.has(id)) {
|
|
90
|
-
return react_1.default.createElement(Fetching, null);
|
|
91
|
-
}
|
|
92
|
-
if (selected.has(id)) {
|
|
93
|
-
return react_1.default.createElement(AddedIcon_1.default, { "data-cy": 'plus-icon-ok', width: 24, height: 24 });
|
|
94
|
-
}
|
|
95
|
-
return react_1.default.createElement(AddIcon_1.default, { "data-cy": 'plus-icon', width: 24, height: 24 });
|
|
96
|
-
};
|
|
97
|
-
const SearchResults = ({ error, searching, showMoreSearching, results, handleSelect, selected, fetching, }) => {
|
|
98
|
-
if (error) {
|
|
99
|
-
// TODO: keep results if error while fetching
|
|
100
|
-
return react_1.default.createElement(Error, null, error);
|
|
101
|
-
}
|
|
102
|
-
if (searching && !showMoreSearching) {
|
|
103
|
-
return (react_1.default.createElement(Results, null,
|
|
104
|
-
react_1.default.createElement(SearchingLabel, null, "Searching...."),
|
|
105
|
-
react_1.default.createElement(ResultPlaceholder, null),
|
|
106
|
-
react_1.default.createElement(ResultPlaceholder, null),
|
|
107
|
-
react_1.default.createElement(ResultPlaceholder, null)));
|
|
108
|
-
}
|
|
109
|
-
if (!results || !results.items || !results.items.length) {
|
|
110
|
-
return null;
|
|
111
|
-
}
|
|
112
|
-
return (react_1.default.createElement(Results, null, results.items.map((item) => {
|
|
113
|
-
const id = (0, library_1.estimateID)(item);
|
|
114
|
-
return (react_1.default.createElement(SearchResult, { onClick: () => handleSelect(id, item), key: id },
|
|
115
|
-
react_1.default.createElement(StatusIcon, null, chooseStatusIcon(fetching, selected, id)),
|
|
116
|
-
react_1.default.createElement(ResultMetadata, null,
|
|
117
|
-
react_1.default.createElement(title_editor_1.Title, { value: item.title || 'Untitled', title: item.title }),
|
|
118
|
-
react_1.default.createElement(SearchResultAuthors, { "data-cy": 'search-result-author' }, (0, library_1.shortLibraryItemMetadata)(item)))));
|
|
119
|
-
})));
|
|
120
|
-
};
|
|
121
|
-
exports.SearchResults = SearchResults;
|
|
122
|
-
const SearchingLabel = styled_components_1.default.div `
|
|
123
|
-
color: ${(props) => props.theme.colors.text.secondary};
|
|
124
|
-
margin-left: ${(props) => props.theme.grid.unit * 10}px;
|
|
125
|
-
`;
|
|
126
|
-
//# sourceMappingURL=SearchResults.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SearchResults.js","sourceRoot":"","sources":["../../../../../src/components/library/SearchResults.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DeleteIcon = void 0;
|
|
7
|
-
/*!
|
|
8
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
9
|
-
*
|
|
10
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
11
|
-
*
|
|
12
|
-
* The Original Code is manuscripts-frontend.
|
|
13
|
-
*
|
|
14
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
15
|
-
*
|
|
16
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2022 Atypon Systems LLC. All Rights Reserved.
|
|
17
|
-
*/
|
|
18
|
-
const react_1 = __importDefault(require("react"));
|
|
19
|
-
const DeleteIcon = () => (react_1.default.createElement("svg", { width: "13", height: "16", viewBox: "0 0 13 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
20
|
-
react_1.default.createElement("path", { className: "icon_element", fillRule: "evenodd", clipRule: "evenodd", d: "M2.00001 2.99995C2 3.0013 2 3.00265 2 3.00399V13.004C2 13.5563 2.44772 14.004 3 14.004H10C10.5523 14.004 11 13.5563 11 13.004V3.00399C11 3.00265 11 3.0013 11 2.99995C11.5978 3.34576 12 3.99211 12 4.73239V13.004C12 14.1086 11.1046 15.004 10 15.004H3C1.89543 15.004 1 14.1086 1 13.004V4.73239C1 3.99211 1.4022 3.34576 2.00001 2.99995Z", fill: "#F35143" }),
|
|
21
|
-
react_1.default.createElement("path", { className: "icon_element", fillRule: "evenodd", clipRule: "evenodd", d: "M4.5 0C3.67157 0 3 0.671573 3 1.5V3.5C3 4.32843 3.67157 5 4.5 5H8.5C9.32843 5 10 4.32843 10 3.5V1.5C10 0.671573 9.32843 0 8.5 0H4.5ZM9 1.5C9 1.22386 8.77614 1 8.5 1H4.5C4.22386 1 4 1.22386 4 1.5C4 1.77614 4.22386 2 4.5 2H8.5C8.77614 2 9 1.77614 9 1.5Z", fill: "#F35143" }),
|
|
22
|
-
react_1.default.createElement("rect", { className: "icon_element", y: "2", width: "13", height: "3", rx: "1.5", fill: "#F35143" }),
|
|
23
|
-
react_1.default.createElement("path", { className: "icon_element", fillRule: "evenodd", clipRule: "evenodd", d: "M8 7.5C8 7.22386 8.22386 7 8.5 7C8.77614 7 9 7.22386 9 7.5V11.5C9 11.7761 8.77614 12 8.5 12C8.22386 12 8 11.7761 8 11.5V7.5Z", fill: "#F35143" }),
|
|
24
|
-
react_1.default.createElement("path", { className: "icon_element", fillRule: "evenodd", clipRule: "evenodd", d: "M4 7.5C4 7.22386 4.22386 7 4.5 7C4.77614 7 5 7.22386 5 7.5V11.5C5 11.7761 4.77614 12 4.5 12C4.22386 12 4 11.7761 4 11.5V7.5Z", fill: "#F35143" }),
|
|
25
|
-
react_1.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.5 3C11.7761 3 12 3.22386 12 3.5C12 3.77614 11.7761 4 11.5 4L1.5 4C1.22386 4 1 3.77614 1 3.5C1 3.22386 1.22386 3 1.5 3L11.5 3Z", fill: "white" })));
|
|
26
|
-
exports.DeleteIcon = DeleteIcon;
|
|
27
|
-
//# sourceMappingURL=DeleteIcon.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteIcon.js","sourceRoot":"","sources":["../../../../../../src/components/projects/icons/DeleteIcon.tsx"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;GAUG;AACH,kDAAyB;AAElB,MAAM,UAAU,GAAa,GAAG,EAAE,CAAC,CACxC,uCACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B;IAElC,wCACE,SAAS,EAAC,cAAc,EACxB,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,8UAA8U,EAChV,IAAI,EAAC,SAAS,GACd;IACF,wCACE,SAAS,EAAC,cAAc,EACxB,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,6PAA6P,EAC/P,IAAI,EAAC,SAAS,GACd;IACF,wCACE,SAAS,EAAC,cAAc,EACxB,CAAC,EAAC,GAAG,EACL,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,GAAG,EACV,EAAE,EAAC,KAAK,EACR,IAAI,EAAC,SAAS,GACd;IACF,wCACE,SAAS,EAAC,cAAc,EACxB,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,8HAA8H,EAChI,IAAI,EAAC,SAAS,GACd;IACF,wCACE,SAAS,EAAC,cAAc,EACxB,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,8HAA8H,EAChI,IAAI,EAAC,SAAS,GACd;IACF,wCACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,mIAAmI,EACrI,IAAI,EAAC,OAAO,GACZ,CACE,CACP,CAAA;AAnDY,QAAA,UAAU,cAmDtB"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.GroupIcon = void 0;
|
|
7
|
-
/*!
|
|
8
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
9
|
-
*
|
|
10
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
11
|
-
*
|
|
12
|
-
* The Original Code is manuscripts-frontend.
|
|
13
|
-
*
|
|
14
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
15
|
-
*
|
|
16
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2022 Atypon Systems LLC. All Rights Reserved.
|
|
17
|
-
*/
|
|
18
|
-
const react_1 = __importDefault(require("react"));
|
|
19
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
20
|
-
const GroupIcon = ({ numberOfCitations, }) => (react_1.default.createElement(BadgeIcon, { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
21
|
-
react_1.default.createElement("rect", { width: "12", height: "12", rx: "6", fill: (numberOfCitations > 0 && '#BCE7F6') || '#FE8F1F' }),
|
|
22
|
-
react_1.default.createElement("text", { x: "6", y: "8", fill: "#FFF", fontSize: "9px", textAnchor: "middle", fontWeight: "400" }, numberOfCitations)));
|
|
23
|
-
exports.GroupIcon = GroupIcon;
|
|
24
|
-
const BadgeIcon = styled_components_1.default.svg `
|
|
25
|
-
top: -4px;
|
|
26
|
-
right: 16px;
|
|
27
|
-
position: absolute;
|
|
28
|
-
`;
|
|
29
|
-
//# sourceMappingURL=GroupIcon.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GroupIcon.js","sourceRoot":"","sources":["../../../../../../src/components/projects/icons/GroupIcon.tsx"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;GAUG;AACH,kDAAyB;AACzB,0EAAsC;AAE/B,MAAM,SAAS,GAA4C,CAAC,EACjE,iBAAiB,GAClB,EAAE,EAAE,CAAC,CACJ,8BAAC,SAAS,IACR,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B;IAElC,wCACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,EAAE,EAAC,GAAG,EACN,IAAI,EAAE,CAAC,iBAAiB,GAAG,CAAC,IAAI,SAAS,CAAC,IAAI,SAAS,GACvD;IACF,wCACE,CAAC,EAAC,GAAG,EACL,CAAC,EAAC,GAAG,EACL,IAAI,EAAC,MAAM,EACX,QAAQ,EAAC,KAAK,EACd,UAAU,EAAC,QAAQ,EACnB,UAAU,EAAC,KAAK,IAEf,iBAAiB,CACb,CACG,CACb,CAAA;AA3BY,QAAA,SAAS,aA2BrB;AAED,MAAM,SAAS,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;CAI3B,CAAA"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.LinkIcon = void 0;
|
|
7
|
-
/*!
|
|
8
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
9
|
-
*
|
|
10
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
11
|
-
*
|
|
12
|
-
* The Original Code is manuscripts-frontend.
|
|
13
|
-
*
|
|
14
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
15
|
-
*
|
|
16
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2022 Atypon Systems LLC. All Rights Reserved.
|
|
17
|
-
*/
|
|
18
|
-
const react_1 = __importDefault(require("react"));
|
|
19
|
-
const LinkIcon = () => (react_1.default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
20
|
-
react_1.default.createElement("path", { d: "M6.63317 12.1949L4.74782 14.0803C3.9662 14.8619 2.70042 14.8619 1.91945 14.0804C1.13832 13.2993 1.13832 12.0334 1.91929 11.2524L5.69063 7.48109C6.4716 6.70009 7.73751 6.70009 8.51848 7.48109C8.77882 7.74143 9.20095 7.74143 9.46129 7.48109C9.72163 7.22075 9.72163 6.79862 9.46129 6.53828C8.1596 5.23659 6.04951 5.23659 4.74782 6.53828L0.97651 10.3096C-0.325178 11.6113 -0.325178 13.7214 0.97651 15.0231C2.27804 16.3254 4.38829 16.3254 5.69067 15.0231L7.57601 13.1377C7.83635 12.8774 7.83635 12.4552 7.57601 12.1949C7.31567 11.9346 6.89351 11.9346 6.63317 12.1949Z", fill: "#6E6E6E" }),
|
|
21
|
-
react_1.default.createElement("path", { d: "M15.0235 0.976266C13.7218 -0.325422 11.6111 -0.325422 10.3094 0.976266L8.04737 3.23827C7.78702 3.49861 7.78702 3.92073 8.04737 4.18108C8.30771 4.44142 8.72984 4.44142 8.99018 4.18108L11.2522 1.91908C12.0331 1.13808 13.2997 1.13808 14.0807 1.91908C14.8617 2.70005 14.8617 3.96595 14.0807 4.74692L9.93271 8.89495C9.15171 9.67595 7.88584 9.67595 7.10487 8.89495C6.84452 8.63461 6.4224 8.63461 6.16205 8.89495C5.90171 9.1553 5.90171 9.57742 6.16205 9.83777C7.46374 11.1395 9.57384 11.1395 10.8755 9.83777L15.0235 5.68977C16.3252 4.38808 16.3252 2.27795 15.0235 0.976266Z", fill: "#6E6E6E" })));
|
|
22
|
-
exports.LinkIcon = LinkIcon;
|
|
23
|
-
//# sourceMappingURL=LinkIcon.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LinkIcon.js","sourceRoot":"","sources":["../../../../../../src/components/projects/icons/LinkIcon.tsx"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;GAUG;AACH,kDAAyB;AAElB,MAAM,QAAQ,GAAa,GAAG,EAAE,CAAC,CACtC,uCACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B;IAElC,wCACE,CAAC,EAAC,ojBAAojB,EACtjB,IAAI,EAAC,SAAS,GACd;IACF,wCACE,CAAC,EAAC,wjBAAwjB,EAC1jB,IAAI,EAAC,SAAS,GACd,CACE,CACP,CAAA;AAjBY,QAAA,QAAQ,YAiBpB"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.TemplateIcon = void 0;
|
|
7
|
-
/*!
|
|
8
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
9
|
-
*
|
|
10
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
11
|
-
*
|
|
12
|
-
* The Original Code is manuscripts-frontend.
|
|
13
|
-
*
|
|
14
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
15
|
-
*
|
|
16
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2022 Atypon Systems LLC. All Rights Reserved.
|
|
17
|
-
*/
|
|
18
|
-
const react_1 = __importDefault(require("react"));
|
|
19
|
-
const TemplateIcon = () => (react_1.default.createElement("svg", { width: "16", height: "18", viewBox: "0 0 16 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
20
|
-
react_1.default.createElement("rect", { x: "1.25", y: "1.25", width: "13.5", height: "15.5", rx: "1.75", fill: "white", stroke: "#6E6E6E", strokeWidth: "1.5" }),
|
|
21
|
-
react_1.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9 6.5C9 6.08579 8.66421 5.75 8.25 5.75H7.25V4.75C7.25 4.33579 6.91421 4 6.5 4C6.08579 4 5.75 4.33579 5.75 4.75V5.75H4.75C4.33579 5.75 4 6.08579 4 6.5C4 6.91421 4.33579 7.25 4.75 7.25H5.75V8.25C5.75 8.66421 6.08579 9 6.5 9C6.91421 9 7.25 8.66421 7.25 8.25V7.25H8.25C8.66421 7.25 9 6.91421 9 6.5Z", fill: "#6E6E6E" })));
|
|
22
|
-
exports.TemplateIcon = TemplateIcon;
|
|
23
|
-
//# sourceMappingURL=TemplateIcon.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TemplateIcon.js","sourceRoot":"","sources":["../../../../../../src/components/projects/icons/TemplateIcon.tsx"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;GAUG;AACH,kDAAyB;AAElB,MAAM,YAAY,GAAa,GAAG,EAAE,CAAC,CAC1C,uCACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B;IAElC,wCACE,CAAC,EAAC,MAAM,EACR,CAAC,EAAC,MAAM,EACR,KAAK,EAAC,MAAM,EACZ,MAAM,EAAC,MAAM,EACb,EAAE,EAAC,MAAM,EACT,IAAI,EAAC,OAAO,EACZ,MAAM,EAAC,SAAS,EAChB,WAAW,EAAC,KAAK,GACjB;IACF,wCACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,ySAAyS,EAC3S,IAAI,EAAC,SAAS,GACd,CACE,CACP,CAAA;AAzBY,QAAA,YAAY,gBAyBxB"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
4
|
-
*
|
|
5
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
6
|
-
*
|
|
7
|
-
* The Original Code is manuscripts-frontend.
|
|
8
|
-
*
|
|
9
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
10
|
-
*
|
|
11
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2020 Atypon Systems LLC. All Rights Reserved.
|
|
12
|
-
*/
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.selectStyles = void 0;
|
|
15
|
-
const theme_1 = require("../theme/theme");
|
|
16
|
-
// Since the generic OptionType is not used within the styles, it's declared as any
|
|
17
|
-
// Another choice would be to make this a generic function but that might incur some extraneous
|
|
18
|
-
// function calls for a data that is static.
|
|
19
|
-
exports.selectStyles = {
|
|
20
|
-
container: (base) => ({
|
|
21
|
-
...base,
|
|
22
|
-
flex: 1,
|
|
23
|
-
}),
|
|
24
|
-
control: (base, state) => ({
|
|
25
|
-
...base,
|
|
26
|
-
backgroundColor: state.isFocused
|
|
27
|
-
? theme_1.theme.colors.background.fifth
|
|
28
|
-
: theme_1.theme.colors.background.primary,
|
|
29
|
-
borderColor: state.isFocused
|
|
30
|
-
? theme_1.theme.colors.border.field.active
|
|
31
|
-
: theme_1.theme.colors.border.field.default,
|
|
32
|
-
'&:hover': {
|
|
33
|
-
backgroundColor: theme_1.theme.colors.background.fifth,
|
|
34
|
-
},
|
|
35
|
-
borderRadius: theme_1.theme.grid.radius.default,
|
|
36
|
-
boxShadow: 'none',
|
|
37
|
-
}),
|
|
38
|
-
menuPortal: (base) => ({ ...base, zIndex: 10 }),
|
|
39
|
-
};
|
|
40
|
-
//# sourceMappingURL=select-styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"select-styles.js","sourceRoot":"","sources":["../../../../src/lib/select-styles.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAIH,0CAAsC;AAEtC,mFAAmF;AACnF,+FAA+F;AAC/F,4CAA4C;AAC/B,QAAA,YAAY,GAA+B;IACtD,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACpB,GAAG,IAAI;QACP,IAAI,EAAE,CAAC;KACR,CAAC;IACF,OAAO,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QACzB,GAAG,IAAI;QACP,eAAe,EAAE,KAAK,CAAC,SAAS;YAC9B,CAAC,CAAC,aAAK,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK;YAC/B,CAAC,CAAC,aAAK,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO;QACnC,WAAW,EAAE,KAAK,CAAC,SAAS;YAC1B,CAAC,CAAC,aAAK,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM;YAClC,CAAC,CAAC,aAAK,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO;QACrC,SAAS,EAAE;YACT,eAAe,EAAE,aAAK,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK;SAC/C;QACD,YAAY,EAAE,aAAK,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO;QACvC,SAAS,EAAE,MAAM;KAClB,CAAC;IACF,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;CAChD,CAAA"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
4
|
-
*
|
|
5
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
6
|
-
*
|
|
7
|
-
* The Original Code is manuscripts-frontend.
|
|
8
|
-
*
|
|
9
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
10
|
-
*
|
|
11
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
12
|
-
*/
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.sources = void 0;
|
|
15
|
-
const body_editor_1 = require("@manuscripts/body-editor");
|
|
16
|
-
exports.sources = [
|
|
17
|
-
{
|
|
18
|
-
id: 'crossref',
|
|
19
|
-
name: 'Crossref',
|
|
20
|
-
search: body_editor_1.crossref.search,
|
|
21
|
-
fetch: body_editor_1.crossref.fetch,
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
id: 'datacite',
|
|
25
|
-
name: 'DataCite',
|
|
26
|
-
search: body_editor_1.datacite.search,
|
|
27
|
-
fetch: body_editor_1.datacite.fetch,
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
id: 'pubmed',
|
|
31
|
-
name: 'PubMed',
|
|
32
|
-
search: body_editor_1.pubmed.search,
|
|
33
|
-
fetch: body_editor_1.pubmed.fetch,
|
|
34
|
-
},
|
|
35
|
-
];
|
|
36
|
-
//# sourceMappingURL=sources.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sources.js","sourceRoot":"","sources":["../../../../src/lib/sources.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAEH,0DAAqE;AAuBxD,QAAA,OAAO,GAAoB;IACtC;QACE,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,sBAAQ,CAAC,MAAM;QACvB,KAAK,EAAE,sBAAQ,CAAC,KAAK;KACtB;IACD;QACE,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,sBAAQ,CAAC,MAAyB;QAC1C,KAAK,EAAE,sBAAQ,CAAC,KAAK;KACtB;IACD;QACE,EAAE,EAAE,QAAQ;QACZ,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,oBAAM,CAAC,MAAyB;QACxC,KAAK,EAAE,oBAAM,CAAC,KAAK;KACpB;CACF,CAAA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
3
|
-
*
|
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
5
|
-
*
|
|
6
|
-
* The Original Code is manuscripts-frontend.
|
|
7
|
-
*
|
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
9
|
-
*
|
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
-
*/
|
|
12
|
-
import React from 'react';
|
|
13
|
-
import Select from 'react-select';
|
|
14
|
-
export const SelectField = ({ id, options, field, form, }) => (React.createElement(Select, { inputId: id, options: options, name: field.name, value: options
|
|
15
|
-
? options.find((option) => option.value === field.value)
|
|
16
|
-
: undefined, onChange: (option) => form.setFieldValue(field.name, option.value), onBlur: field.onBlur }));
|
|
17
|
-
//# sourceMappingURL=SelectField.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectField.js","sourceRoot":"","sources":["../../../../src/components/SelectField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,MAAM,MAAM,cAAc,CAAA;AAYjC,MAAM,CAAC,MAAM,WAAW,GAAgD,CAAC,EACvE,EAAE,EACF,OAAO,EACP,KAAK,EACL,IAAI,GACL,EAAE,EAAE,CAAC,CACJ,oBAAC,MAAM,IACL,OAAO,EAAE,EAAE,EACX,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,KAAK,EACH,OAAO;QACL,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,CAAC;QACxD,CAAC,CAAC,SAAS,EAEf,QAAQ,EAAE,CAAC,MAAkB,EAAE,EAAE,CAC/B,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,EAE9C,MAAM,EAAE,KAAK,CAAC,MAAM,GACpB,CACH,CAAA"}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
3
|
-
*
|
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
5
|
-
*
|
|
6
|
-
* The Original Code is manuscripts-frontend.
|
|
7
|
-
*
|
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
9
|
-
*
|
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
-
*/
|
|
12
|
-
import AttentionRed from '@manuscripts/assets/react/AttentionRed';
|
|
13
|
-
import Check from '@manuscripts/assets/react/Check';
|
|
14
|
-
import { parseBibliography } from '@manuscripts/library';
|
|
15
|
-
import { SecondaryButton } from '@manuscripts/style-guide';
|
|
16
|
-
import { buildBibliographyItem } from '@manuscripts/transform';
|
|
17
|
-
import React, { useCallback, useContext, useState } from 'react';
|
|
18
|
-
import { FormattedMessage } from 'react-intl';
|
|
19
|
-
import { FileExtensionError } from '../../lib/errors';
|
|
20
|
-
import { ContactSupportButton } from '../ContactSupportButton';
|
|
21
|
-
import { NotificationContext, } from '../NotificationProvider';
|
|
22
|
-
import { NotificationActions, NotificationHead, NotificationMessage, NotificationPrompt, NotificationTitle, } from '../Notifications';
|
|
23
|
-
const CITATION_IMPORT_NOTIFICATION_ID = 'citation-import';
|
|
24
|
-
const createCitationImportErrorNotification = (title) => ({ removeNotification }) => (React.createElement(NotificationPrompt, null,
|
|
25
|
-
React.createElement(NotificationHead, null,
|
|
26
|
-
React.createElement(AttentionRed, null),
|
|
27
|
-
React.createElement(NotificationMessage, null,
|
|
28
|
-
React.createElement(NotificationTitle, null, title))),
|
|
29
|
-
React.createElement(NotificationActions, null,
|
|
30
|
-
React.createElement(SecondaryButton, { onClick: removeNotification }, "Dismiss"))));
|
|
31
|
-
const createCitationImportSuccessNotification = (count) => ({ removeNotification }) => (React.createElement(NotificationPrompt, null,
|
|
32
|
-
React.createElement(NotificationHead, null,
|
|
33
|
-
React.createElement(Check, { color: 'green' }),
|
|
34
|
-
React.createElement(NotificationMessage, null,
|
|
35
|
-
React.createElement(NotificationTitle, null,
|
|
36
|
-
React.createElement(CitationImportSuccessMessage, { count: count })))),
|
|
37
|
-
React.createElement(NotificationActions, null,
|
|
38
|
-
React.createElement(SecondaryButton, { onClick: removeNotification }, "Dismiss"))));
|
|
39
|
-
const openFilePicker = (acceptedExtensions, multiple = false) => new Promise((resolve, reject) => {
|
|
40
|
-
const input = document.createElement('input');
|
|
41
|
-
input.type = 'file';
|
|
42
|
-
input.accept = acceptedExtensions.join(',');
|
|
43
|
-
input.multiple = multiple;
|
|
44
|
-
const handleFocus = () => {
|
|
45
|
-
window.removeEventListener('focus', handleFocus);
|
|
46
|
-
// This event is fired before the input's change event,
|
|
47
|
-
// and before the input's FileList has been populated,
|
|
48
|
-
// so a delay is needed.
|
|
49
|
-
window.setTimeout(() => {
|
|
50
|
-
if (!input.files || !input.files.length) {
|
|
51
|
-
resolve([]);
|
|
52
|
-
}
|
|
53
|
-
}, 1000);
|
|
54
|
-
};
|
|
55
|
-
// window "focus" event, fired even if the file picker is cancelled.
|
|
56
|
-
window.addEventListener('focus', handleFocus);
|
|
57
|
-
input.addEventListener('change', () => {
|
|
58
|
-
if (input.files && input.files.length) {
|
|
59
|
-
for (const file of input.files) {
|
|
60
|
-
const ext = file.type.split('/').pop() || '';
|
|
61
|
-
const extension = ext.toLowerCase();
|
|
62
|
-
if (!acceptedExtensions.includes(extension)) {
|
|
63
|
-
const error = new FileExtensionError(extension, acceptedExtensions);
|
|
64
|
-
reject(error);
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
resolve(Array.from(input.files));
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
resolve([]);
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
input.click();
|
|
75
|
-
});
|
|
76
|
-
export const BibliographyImportButton = React.memo(({ importItems, component: Component }) => {
|
|
77
|
-
const { showNotification } = useContext(NotificationContext);
|
|
78
|
-
const [importing, setImporting] = useState(false);
|
|
79
|
-
const handleImport = useCallback(() => {
|
|
80
|
-
setImporting(true);
|
|
81
|
-
openFilePicker(['.bib', '.bibtex', '.ris'])
|
|
82
|
-
.then(async ([file]) => {
|
|
83
|
-
if (!file) {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
const text = await window
|
|
87
|
-
.fetch(URL.createObjectURL(file))
|
|
88
|
-
.then((response) => response.text());
|
|
89
|
-
if (!text) {
|
|
90
|
-
showNotification(CITATION_IMPORT_NOTIFICATION_ID, createCitationImportErrorNotification('No bibliography items were found in this file'));
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
const ext = file.type.split('/').pop() || '';
|
|
94
|
-
const items = await parseBibliography(text, ext);
|
|
95
|
-
if (!items || !items.length) {
|
|
96
|
-
showNotification(CITATION_IMPORT_NOTIFICATION_ID, createCitationImportErrorNotification('No bibliography items were found in this file'));
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
const bibliographyItems = items.map(buildBibliographyItem);
|
|
100
|
-
const newItems = await importItems(bibliographyItems);
|
|
101
|
-
showNotification(CITATION_IMPORT_NOTIFICATION_ID, createCitationImportSuccessNotification(newItems.length));
|
|
102
|
-
})
|
|
103
|
-
.finally(() => {
|
|
104
|
-
setImporting(false);
|
|
105
|
-
})
|
|
106
|
-
.catch(() => {
|
|
107
|
-
showNotification(CITATION_IMPORT_NOTIFICATION_ID, createCitationImportErrorNotification(React.createElement(React.Fragment, null,
|
|
108
|
-
"There was an error importing the file. Please",
|
|
109
|
-
' ',
|
|
110
|
-
React.createElement(ContactSupportButton, null, "contact support"),
|
|
111
|
-
" if this persists.")));
|
|
112
|
-
});
|
|
113
|
-
}, [importItems, showNotification]);
|
|
114
|
-
return React.createElement(Component, { importItems: handleImport, importing: importing });
|
|
115
|
-
});
|
|
116
|
-
const CitationImportSuccessMessage = ({ count }) => (React.createElement(FormattedMessage, { id: 'citation_import_success', defaultMessage: `{count, number} {count, plural,
|
|
117
|
-
one {record}
|
|
118
|
-
other {records}
|
|
119
|
-
} imported into the project library`, values: { count } }));
|
|
120
|
-
//# sourceMappingURL=BibliographyImportButton.js.map
|