@manuscripts/article-editor 1.4.10 → 1.4.11-LEAN-2852-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.
Files changed (216) hide show
  1. package/dist/cjs/src/EditorApp.js +3 -10
  2. package/dist/cjs/src/EditorApp.js.map +1 -1
  3. package/dist/cjs/src/Main.js +2 -2
  4. package/dist/cjs/src/Main.js.map +1 -1
  5. package/dist/cjs/src/components/library/BibliographyImportButton.js +6 -2
  6. package/dist/cjs/src/components/library/BibliographyImportButton.js.map +1 -1
  7. package/dist/cjs/src/components/library/ReferenceForm.js +12 -11
  8. package/dist/cjs/src/components/library/ReferenceForm.js.map +1 -1
  9. package/dist/cjs/src/components/metadata/Metadata.js +3 -6
  10. package/dist/cjs/src/components/metadata/Metadata.js.map +1 -1
  11. package/dist/cjs/src/components/metadata/MetadataContainer.js +7 -5
  12. package/dist/cjs/src/components/metadata/MetadataContainer.js.map +1 -1
  13. package/dist/cjs/src/components/projects/ApplicationMenus.js +0 -5
  14. package/dist/cjs/src/components/projects/ApplicationMenus.js.map +1 -1
  15. package/dist/cjs/src/components/projects/ContentTab.js +3 -4
  16. package/dist/cjs/src/components/projects/ContentTab.js.map +1 -1
  17. package/dist/cjs/src/components/projects/EditorElement.js +18 -21
  18. package/dist/cjs/src/components/projects/EditorElement.js.map +1 -1
  19. package/dist/cjs/src/components/projects/Inspector.js +10 -10
  20. package/dist/cjs/src/components/projects/Inspector.js.map +1 -1
  21. package/dist/cjs/src/components/projects/ManuscriptInspector.js +5 -3
  22. package/dist/cjs/src/components/projects/ManuscriptInspector.js.map +1 -1
  23. package/dist/cjs/src/components/projects/ManuscriptPageContainer.js +10 -3
  24. package/dist/cjs/src/components/projects/ManuscriptPageContainer.js.map +1 -1
  25. package/dist/cjs/src/components/projects/ManuscriptSidebar.js +2 -2
  26. package/dist/cjs/src/components/projects/ManuscriptSidebar.js.map +1 -1
  27. package/dist/cjs/src/components/track-changes/utils.js +1 -1
  28. package/dist/cjs/src/components/track-changes/utils.js.map +1 -1
  29. package/dist/cjs/src/hooks/use-create-editor.js +28 -43
  30. package/dist/cjs/src/hooks/use-create-editor.js.map +1 -1
  31. package/dist/cjs/src/hooks/use-handle-snapshot.js +6 -0
  32. package/dist/cjs/src/hooks/use-handle-snapshot.js.map +1 -1
  33. package/dist/cjs/src/hooks/use-tracked-model-management.js +3 -5
  34. package/dist/cjs/src/hooks/use-tracked-model-management.js.map +1 -1
  35. package/dist/cjs/src/index.js +2 -2
  36. package/dist/cjs/src/index.js.map +1 -1
  37. package/dist/cjs/src/postgres-data/PsSource.js +3 -3
  38. package/dist/cjs/src/postgres-data/PsSource.js.map +1 -1
  39. package/dist/cjs/src/postgres-data/buildData.js +2 -10
  40. package/dist/cjs/src/postgres-data/buildData.js.map +1 -1
  41. package/dist/cjs/src/store/DataSourceStrategy.js +2 -2
  42. package/dist/cjs/src/store/DataSourceStrategy.js.map +1 -1
  43. package/dist/cjs/src/store/Store.js.map +1 -1
  44. package/dist/cjs/stories/Full.stories.js +14 -6
  45. package/dist/cjs/stories/Full.stories.js.map +1 -1
  46. package/dist/es/src/EditorApp.js +3 -10
  47. package/dist/es/src/EditorApp.js.map +1 -1
  48. package/dist/es/src/Main.js +2 -2
  49. package/dist/es/src/Main.js.map +1 -1
  50. package/dist/es/src/components/library/BibliographyImportButton.js +5 -1
  51. package/dist/es/src/components/library/BibliographyImportButton.js.map +1 -1
  52. package/dist/es/src/components/library/ReferenceForm.js +12 -11
  53. package/dist/es/src/components/library/ReferenceForm.js.map +1 -1
  54. package/dist/es/src/components/metadata/Metadata.js +3 -6
  55. package/dist/es/src/components/metadata/Metadata.js.map +1 -1
  56. package/dist/es/src/components/metadata/MetadataContainer.js +7 -5
  57. package/dist/es/src/components/metadata/MetadataContainer.js.map +1 -1
  58. package/dist/es/src/components/projects/ApplicationMenus.js +0 -5
  59. package/dist/es/src/components/projects/ApplicationMenus.js.map +1 -1
  60. package/dist/es/src/components/projects/ContentTab.js +3 -4
  61. package/dist/es/src/components/projects/ContentTab.js.map +1 -1
  62. package/dist/es/src/components/projects/EditorElement.js +19 -22
  63. package/dist/es/src/components/projects/EditorElement.js.map +1 -1
  64. package/dist/es/src/components/projects/Inspector.js +11 -11
  65. package/dist/es/src/components/projects/Inspector.js.map +1 -1
  66. package/dist/es/src/components/projects/ManuscriptInspector.js +5 -3
  67. package/dist/es/src/components/projects/ManuscriptInspector.js.map +1 -1
  68. package/dist/es/src/components/projects/ManuscriptPageContainer.js +10 -3
  69. package/dist/es/src/components/projects/ManuscriptPageContainer.js.map +1 -1
  70. package/dist/es/src/components/projects/ManuscriptSidebar.js +2 -2
  71. package/dist/es/src/components/projects/ManuscriptSidebar.js.map +1 -1
  72. package/dist/es/src/components/track-changes/utils.js +1 -1
  73. package/dist/es/src/components/track-changes/utils.js.map +1 -1
  74. package/dist/es/src/hooks/use-create-editor.js +28 -43
  75. package/dist/es/src/hooks/use-create-editor.js.map +1 -1
  76. package/dist/es/src/hooks/use-handle-snapshot.js +6 -0
  77. package/dist/es/src/hooks/use-handle-snapshot.js.map +1 -1
  78. package/dist/es/src/hooks/use-tracked-model-management.js +3 -5
  79. package/dist/es/src/hooks/use-tracked-model-management.js.map +1 -1
  80. package/dist/es/src/index.js +2 -2
  81. package/dist/es/src/index.js.map +1 -1
  82. package/dist/es/src/postgres-data/PsSource.js +3 -3
  83. package/dist/es/src/postgres-data/PsSource.js.map +1 -1
  84. package/dist/es/src/postgres-data/buildData.js +2 -10
  85. package/dist/es/src/postgres-data/buildData.js.map +1 -1
  86. package/dist/es/src/store/DataSourceStrategy.js +2 -2
  87. package/dist/es/src/store/DataSourceStrategy.js.map +1 -1
  88. package/dist/es/src/store/Store.js.map +1 -1
  89. package/dist/es/stories/Full.stories.js +14 -6
  90. package/dist/es/stories/Full.stories.js.map +1 -1
  91. package/dist/types/src/EditorApp.d.ts +2 -1
  92. package/dist/types/src/Main.d.ts +2 -1
  93. package/dist/types/src/components/library/ReferenceForm.d.ts +1 -1
  94. package/dist/types/src/components/projects/ManuscriptSidebar.d.ts +2 -1
  95. package/dist/types/src/hooks/use-tracked-model-management.d.ts +1 -2
  96. package/dist/types/src/index.d.ts +2 -1
  97. package/dist/types/src/postgres-data/PsSource.d.ts +2 -2
  98. package/dist/types/src/postgres-data/buildData.d.ts +1 -2
  99. package/dist/types/src/store/DataSourceStrategy.d.ts +1 -1
  100. package/dist/types/src/store/Store.d.ts +32 -52
  101. package/package.json +9 -9
  102. package/dist/cjs/src/components/library/CitationProperties.js +0 -67
  103. package/dist/cjs/src/components/library/CitationProperties.js.map +0 -1
  104. package/dist/cjs/src/components/library/ExternalSearch.js +0 -156
  105. package/dist/cjs/src/components/library/ExternalSearch.js.map +0 -1
  106. package/dist/cjs/src/components/library/GlobalLibrary.js +0 -133
  107. package/dist/cjs/src/components/library/GlobalLibrary.js.map +0 -1
  108. package/dist/cjs/src/components/library/LibraryCollectionCategories.js +0 -53
  109. package/dist/cjs/src/components/library/LibraryCollectionCategories.js.map +0 -1
  110. package/dist/cjs/src/components/library/LibraryForm.js +0 -437
  111. package/dist/cjs/src/components/library/LibraryForm.js.map +0 -1
  112. package/dist/cjs/src/components/library/LibraryItems.js +0 -116
  113. package/dist/cjs/src/components/library/LibraryItems.js.map +0 -1
  114. package/dist/cjs/src/components/library/LibraryPageContainer.js +0 -107
  115. package/dist/cjs/src/components/library/LibraryPageContainer.js.map +0 -1
  116. package/dist/cjs/src/components/library/LibrarySidebar.js +0 -172
  117. package/dist/cjs/src/components/library/LibrarySidebar.js.map +0 -1
  118. package/dist/cjs/src/components/library/Messages.js +0 -25
  119. package/dist/cjs/src/components/library/Messages.js.map +0 -1
  120. package/dist/cjs/src/components/library/ProjectLibrary.js +0 -96
  121. package/dist/cjs/src/components/library/ProjectLibrary.js.map +0 -1
  122. package/dist/cjs/src/components/metadata/HeaderFigure.js +0 -147
  123. package/dist/cjs/src/components/metadata/HeaderFigure.js.map +0 -1
  124. package/dist/cjs/src/lib/replace-attachments-ids.js +0 -49
  125. package/dist/cjs/src/lib/replace-attachments-ids.js.map +0 -1
  126. package/dist/cjs/stories/LibrarySidebar.stories.js +0 -188
  127. package/dist/cjs/stories/LibrarySidebar.stories.js.map +0 -1
  128. package/dist/cjs/stories/Metadata.stories.js +0 -53
  129. package/dist/cjs/stories/Metadata.stories.js.map +0 -1
  130. package/dist/cjs/stories/Notification.stories.js +0 -62
  131. package/dist/cjs/stories/Notification.stories.js.map +0 -1
  132. package/dist/cjs/stories/Page.stories.js +0 -50
  133. package/dist/cjs/stories/Page.stories.js.map +0 -1
  134. package/dist/cjs/stories/Panel.stories.js +0 -62
  135. package/dist/cjs/stories/Panel.stories.js.map +0 -1
  136. package/dist/cjs/stories/Placeholders.stories.js +0 -23
  137. package/dist/cjs/stories/Placeholders.stories.js.map +0 -1
  138. package/dist/cjs/stories/PopperButtons.stories.js +0 -27
  139. package/dist/cjs/stories/PopperButtons.stories.js.map +0 -1
  140. package/dist/cjs/stories/Progress.stories.js +0 -25
  141. package/dist/cjs/stories/Progress.stories.js.map +0 -1
  142. package/dist/cjs/stories/ProgressIndicator.stories.js +0 -33
  143. package/dist/cjs/stories/ProgressIndicator.stories.js.map +0 -1
  144. package/dist/cjs/stories/ReloadDialog.stories.js +0 -21
  145. package/dist/cjs/stories/ReloadDialog.stories.js.map +0 -1
  146. package/dist/cjs/stories/SelectField.stories.js +0 -34
  147. package/dist/cjs/stories/SelectField.stories.js.map +0 -1
  148. package/dist/es/src/components/library/CitationProperties.js +0 -60
  149. package/dist/es/src/components/library/CitationProperties.js.map +0 -1
  150. package/dist/es/src/components/library/ExternalSearch.js +0 -127
  151. package/dist/es/src/components/library/ExternalSearch.js.map +0 -1
  152. package/dist/es/src/components/library/GlobalLibrary.js +0 -104
  153. package/dist/es/src/components/library/GlobalLibrary.js.map +0 -1
  154. package/dist/es/src/components/library/LibraryCollectionCategories.js +0 -45
  155. package/dist/es/src/components/library/LibraryCollectionCategories.js.map +0 -1
  156. package/dist/es/src/components/library/LibraryForm.js +0 -409
  157. package/dist/es/src/components/library/LibraryForm.js.map +0 -1
  158. package/dist/es/src/components/library/LibraryItems.js +0 -86
  159. package/dist/es/src/components/library/LibraryItems.js.map +0 -1
  160. package/dist/es/src/components/library/LibraryPageContainer.js +0 -80
  161. package/dist/es/src/components/library/LibraryPageContainer.js.map +0 -1
  162. package/dist/es/src/components/library/LibrarySidebar.js +0 -165
  163. package/dist/es/src/components/library/LibrarySidebar.js.map +0 -1
  164. package/dist/es/src/components/library/Messages.js +0 -18
  165. package/dist/es/src/components/library/Messages.js.map +0 -1
  166. package/dist/es/src/components/library/ProjectLibrary.js +0 -67
  167. package/dist/es/src/components/library/ProjectLibrary.js.map +0 -1
  168. package/dist/es/src/components/metadata/HeaderFigure.js +0 -117
  169. package/dist/es/src/components/metadata/HeaderFigure.js.map +0 -1
  170. package/dist/es/src/lib/replace-attachments-ids.js +0 -44
  171. package/dist/es/src/lib/replace-attachments-ids.js.map +0 -1
  172. package/dist/es/stories/LibrarySidebar.stories.js +0 -183
  173. package/dist/es/stories/LibrarySidebar.stories.js.map +0 -1
  174. package/dist/es/stories/Metadata.stories.js +0 -48
  175. package/dist/es/stories/Metadata.stories.js.map +0 -1
  176. package/dist/es/stories/Notification.stories.js +0 -57
  177. package/dist/es/stories/Notification.stories.js.map +0 -1
  178. package/dist/es/stories/Page.stories.js +0 -45
  179. package/dist/es/stories/Page.stories.js.map +0 -1
  180. package/dist/es/stories/Panel.stories.js +0 -57
  181. package/dist/es/stories/Panel.stories.js.map +0 -1
  182. package/dist/es/stories/Placeholders.stories.js +0 -18
  183. package/dist/es/stories/Placeholders.stories.js.map +0 -1
  184. package/dist/es/stories/PopperButtons.stories.js +0 -22
  185. package/dist/es/stories/PopperButtons.stories.js.map +0 -1
  186. package/dist/es/stories/Progress.stories.js +0 -20
  187. package/dist/es/stories/Progress.stories.js.map +0 -1
  188. package/dist/es/stories/ProgressIndicator.stories.js +0 -28
  189. package/dist/es/stories/ProgressIndicator.stories.js.map +0 -1
  190. package/dist/es/stories/ReloadDialog.stories.js +0 -16
  191. package/dist/es/stories/ReloadDialog.stories.js.map +0 -1
  192. package/dist/es/stories/SelectField.stories.js +0 -29
  193. package/dist/es/stories/SelectField.stories.js.map +0 -1
  194. package/dist/types/src/components/library/CitationProperties.d.ts +0 -17
  195. package/dist/types/src/components/library/ExternalSearch.d.ts +0 -19
  196. package/dist/types/src/components/library/GlobalLibrary.d.ts +0 -20
  197. package/dist/types/src/components/library/LibraryCollectionCategories.d.ts +0 -15
  198. package/dist/types/src/components/library/LibraryForm.d.ts +0 -20
  199. package/dist/types/src/components/library/LibraryItems.d.ts +0 -12
  200. package/dist/types/src/components/library/LibraryPageContainer.d.ts +0 -14
  201. package/dist/types/src/components/library/LibrarySidebar.d.ts +0 -21
  202. package/dist/types/src/components/library/Messages.d.ts +0 -15
  203. package/dist/types/src/components/library/ProjectLibrary.d.ts +0 -23
  204. package/dist/types/src/components/metadata/HeaderFigure.d.ts +0 -13
  205. package/dist/types/src/lib/replace-attachments-ids.d.ts +0 -15
  206. package/dist/types/stories/LibrarySidebar.stories.d.ts +0 -12
  207. package/dist/types/stories/Metadata.stories.d.ts +0 -12
  208. package/dist/types/stories/Notification.stories.d.ts +0 -12
  209. package/dist/types/stories/Page.stories.d.ts +0 -12
  210. package/dist/types/stories/Panel.stories.d.ts +0 -12
  211. package/dist/types/stories/Placeholders.stories.d.ts +0 -12
  212. package/dist/types/stories/PopperButtons.stories.d.ts +0 -12
  213. package/dist/types/stories/Progress.stories.d.ts +0 -12
  214. package/dist/types/stories/ProgressIndicator.stories.d.ts +0 -12
  215. package/dist/types/stories/ReloadDialog.stories.d.ts +0 -12
  216. package/dist/types/stories/SelectField.stories.d.ts +0 -12
@@ -1,165 +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 TriangleCollapsed from '@manuscripts/assets/react/TriangleCollapsed';
13
- import TriangleExpanded from '@manuscripts/assets/react/TriangleExpanded';
14
- import React from 'react';
15
- import styled from 'styled-components';
16
- import { sources } from '../../lib/sources';
17
- import { useStore } from '../../store';
18
- import { AddButton } from '../AddButton';
19
- import PageSidebar from '../PageSidebar';
20
- import { SidebarHeader } from '../Sidebar';
21
- import { BibliographyImportButton } from './BibliographyImportButton';
22
- import { DEFAULT_LIBRARY_COLLECTION_CATEGORY, sidebarIcon, sortByCategoryPriority, } from './LibraryCollectionCategories';
23
- const SectionContainer = styled.div `
24
- margin: 0 -${(props) => props.theme.grid.unit * 5}px ${(props) => props.theme.grid.unit * 4}px;
25
- `;
26
- const SectionIcon = styled.div `
27
- flex-shrink: 0;
28
- display: flex;
29
- align-items: center;
30
- justify-content: center;
31
- `;
32
- const SectionTitle = styled.div `
33
- margin-left: ${(props) => props.theme.grid.unit * 2}px;
34
- flex: 1;
35
- `;
36
- const ListTitle = styled.div `
37
- margin-left: ${(props) => props.theme.grid.unit * 2}px;
38
- flex: 1;
39
- `;
40
- const SectionLink = styled.button `
41
- background: transparent;
42
- cursor: pointer;
43
- width: 100%;
44
- text-align: left;
45
- border-right: none;
46
- font-size: inherit;
47
- font-family: inherit;
48
- align-items: center;
49
- border-bottom: 1px solid transparent;
50
- border-top: 1px solid transparent;
51
- color: ${(props) => props.theme.colors.text.secondary};
52
- display: flex;
53
- padding: ${(props) => props.theme.grid.unit * 2}px
54
- ${(props) => props.theme.grid.unit * 2}px
55
- ${(props) => props.theme.grid.unit * 2}px
56
- ${(props) => props.theme.grid.unit * 9}px;
57
- line-height: 1;
58
- overflow: hidden;
59
- text-decoration: none;
60
- text-overflow: ellipsis;
61
- transition: background-color 0.25s;
62
- white-space: nowrap;
63
-
64
- &:hover,
65
- &.active {
66
- background-color: ${(props) => props.theme.colors.background.fifth};
67
- }
68
-
69
- &.active {
70
- border-color: ${(props) => props.theme.colors.border.primary};
71
- }
72
-
73
- &:hover + &.active,
74
- &.active + &:hover {
75
- border-top-color: transparent;
76
- }
77
- `;
78
- const SectionTitleLink = styled(SectionLink) `
79
- color: ${(props) => props.theme.colors.text.primary};
80
- padding: 7px ${(props) => props.theme.grid.unit * 4}px;
81
- `;
82
- export const LibrarySidebar = ({ projectLibraryCollections, globalLibraries, globalLibraryCollections, importItems, createBibliographyItem, }) => {
83
- const globalLibrariesArray = Array.from(globalLibraries.values());
84
- const globalLibraryCollectionsArray = Array.from(globalLibraryCollections.values());
85
- const projectLibraryCollectionsArray = Array.from(projectLibraryCollections.values());
86
- const [, dispatch] = useStore();
87
- const [projectID] = useStore((store) => store.libraryProjectID);
88
- const [sourceID] = useStore((store) => store.librarySourceID);
89
- const [sourceType] = useStore((store) => store.sourceType || '');
90
- globalLibraryCollectionsArray.sort(sortByCategoryPriority);
91
- // TODO: sort projectLibraryCollectionsArray by count, filter out empty
92
- return (React.createElement(PageSidebar, { direction: 'row', minSize: 260, name: 'librarySidebar', side: 'end', sidebarTitle: React.createElement(SidebarHeader, { title: 'Library' }), sidebarFooter: React.createElement("div", null,
93
- React.createElement(FooterItem, null,
94
- React.createElement(AddButton, { action: createBibliographyItem, title: 'Create new library item', size: 'small' })),
95
- React.createElement(FooterItem, null,
96
- React.createElement(BibliographyImportButton, { importItems: importItems, component: ImportButton }))) },
97
- React.createElement(Section, { title: 'Project Library', open: sourceType === 'project', onClick: () => {
98
- dispatch({
99
- libraryProjectID: projectID,
100
- libraryFilterID: '',
101
- sourceType: 'project',
102
- });
103
- } }, projectLibraryCollectionsArray.map((projectLibraryCollection) => {
104
- // TODO: count items with this LibraryCollection and only show LibraryCollections with items
105
- return (React.createElement(SectionLink, { key: projectLibraryCollection._id, onClick: () => {
106
- dispatch({
107
- libraryProjectID: projectID,
108
- libraryFilterID: projectLibraryCollection._id,
109
- sourceType: 'project',
110
- });
111
- } }, projectLibraryCollection.name || 'Untitled List'));
112
- })),
113
- globalLibrariesArray.map((globalLibrary) => {
114
- const libraryCollections = globalLibraryCollectionsArray.filter((libraryCollection) => {
115
- return libraryCollection.containerID === globalLibrary._id;
116
- });
117
- const defaultLibraryCollection = libraryCollections.find((libraryCollection) => libraryCollection.category === DEFAULT_LIBRARY_COLLECTION_CATEGORY);
118
- const nonDefaultLibraryCollections = libraryCollections.filter((libraryCollection) => libraryCollection.category !== DEFAULT_LIBRARY_COLLECTION_CATEGORY);
119
- const defaultFilter = defaultLibraryCollection
120
- ? `/${defaultLibraryCollection._id}`
121
- : '';
122
- return (React.createElement(Section, { key: globalLibrary._id, title: globalLibrary.name || 'My Library', open: sourceType === 'global' &&
123
- sourceID === globalLibrary._id &&
124
- nonDefaultLibraryCollections.length > 0, onClick: () => {
125
- dispatch({
126
- libraryProjectID: projectID,
127
- librarySourceID: globalLibrary._id,
128
- libraryFilterID: defaultFilter,
129
- sourceType: 'global',
130
- });
131
- } }, nonDefaultLibraryCollections.map((libraryCollection) => (React.createElement(SectionLink, { key: libraryCollection._id, onClick: () => {
132
- dispatch({
133
- libraryProjectID: projectID,
134
- librarySourceID: globalLibrary._id,
135
- libraryFilterID: libraryCollection._id,
136
- sourceType: 'global',
137
- });
138
- } },
139
- React.createElement(SectionIcon, null, sidebarIcon(libraryCollection.category)),
140
- React.createElement(ListTitle, null, libraryCollection.name || 'Untitled List'))))));
141
- }),
142
- React.createElement(Section, { title: 'Search Online', open: sourceType === 'search', onClick: () => {
143
- dispatch({
144
- libraryProjectID: projectID,
145
- librarySourceID: 'crossref',
146
- sourceType: 'search',
147
- });
148
- } }, sources.map((source) => (React.createElement(SectionLink, { key: source.id, onClick: () => {
149
- dispatch({
150
- libraryProjectID: projectID,
151
- librarySourceID: source.id,
152
- sourceType: 'search',
153
- });
154
- } }, source.name))))));
155
- };
156
- const ImportButton = ({ importItems }) => (React.createElement(AddButton, { action: importItems, title: "Import from file", size: 'small' }));
157
- const Section = ({ children, open, onClick, title }) => (React.createElement(SectionContainer, null,
158
- React.createElement(SectionTitleLink, { onClick: onClick, className: open ? 'active' : '' },
159
- open ? React.createElement(TriangleExpanded, null) : React.createElement(TriangleCollapsed, null),
160
- React.createElement(SectionTitle, null, title)),
161
- open && children));
162
- const FooterItem = styled.div `
163
- margin-top: 8px;
164
- `;
165
- //# sourceMappingURL=LibrarySidebar.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LibrarySidebar.js","sourceRoot":"","sources":["../../../../../src/components/library/LibrarySidebar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,iBAAiB,MAAM,6CAA6C,CAAA;AAC3E,OAAO,gBAAgB,MAAM,4CAA4C,CAAA;AAOzE,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,WAAW,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,EACL,mCAAmC,EACnC,WAAW,EACX,sBAAsB,GACvB,MAAM,+BAA+B,CAAA;AAEtC,MAAM,gBAAgB,GAAG,MA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BAAC,iBAAiB,OAAG;QACpD,oBAAC,YAAY,QAAE,KAAK,CAAgB,CACnB;IAElB,IAAI,IAAI,QAAQ,CACA,CACpB,CAAA;AAED,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAA;;CAE5B,CAAA"}
@@ -1,18 +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 { FormattedMessage } from 'react-intl';
14
- export const CitationImportSuccessMessage = ({ count }) => (React.createElement(FormattedMessage, { id: 'citation_import_success', defaultMessage: `{count, number} {count, plural,
15
- one {record}
16
- other {records}
17
- } imported into the project library`, values: { count } }));
18
- //# sourceMappingURL=Messages.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Messages.js","sourceRoot":"","sources":["../../../../../src/components/library/Messages.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAE7C,MAAM,CAAC,MAAM,4BAA4B,GAEpC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAClB,oBAAC,gBAAgB,IACf,EAAE,EAAE,yBAAyB,EAC7B,cAAc,EAAE;;;0DAGsC,EACtD,MAAM,EAAE,EAAE,KAAK,EAAE,GACjB,CACH,CAAA"}
@@ -1,67 +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, { useCallback, useEffect, useState } from 'react';
13
- import { filterLibrary } from '../../lib/search-library';
14
- import { useStore } from '../../store';
15
- import { Main } from '../Page';
16
- import Panel from '../Panel';
17
- import { ResizingInspectorButton } from '../ResizerButtons';
18
- import LibraryForm from './LibraryForm';
19
- import { LibraryItems } from './LibraryItems';
20
- export const ProjectLibrary = React.memo(({ projectLibraryCollections, projectLibrary, user, query, setQuery, selectedItem, setSelectedItem, }) => {
21
- const [filteredItems, setFilteredItems] = useState([]);
22
- const [{ updateBiblioItem, deleteBiblioItem }] = useStore((store) => ({
23
- deleteBiblioItem: store.deleteBiblioItem,
24
- updateBiblioItem: store.updateBiblioItem,
25
- }));
26
- const [filterID] = useStore((store) => store.libraryFilterID || '');
27
- useEffect(() => {
28
- filterLibrary(projectLibrary, query, filterID ? new Set([filterID]) : undefined)
29
- .then((filteredItems) => {
30
- filteredItems.sort((a, b) => Number(b.updatedAt) - Number(a.updatedAt));
31
- setFilteredItems(filteredItems);
32
- })
33
- .catch((error) => {
34
- console.error(error);
35
- });
36
- }, [filterID, projectLibrary, query]);
37
- const handleSave = useCallback((item) => {
38
- // @ts-ignore https://github.com/jaredpalmer/formik/issues/2180
39
- if (item.issued === '') {
40
- item.issued = undefined;
41
- }
42
- return updateBiblioItem(item).then(() => {
43
- setSelectedItem(undefined);
44
- });
45
- }, [updateBiblioItem, setSelectedItem]);
46
- const handleDelete = useCallback((item) => {
47
- if (!window.confirm('Remove this item from the project library?')) {
48
- return Promise.resolve(false);
49
- }
50
- return deleteBiblioItem(item)
51
- .then(() => {
52
- // this.setState({
53
- // item: null,
54
- // })
55
- // TODO: change route
56
- })
57
- .then(() => {
58
- setSelectedItem(undefined);
59
- return item._id;
60
- });
61
- }, [deleteBiblioItem, setSelectedItem]);
62
- return (React.createElement(React.Fragment, null,
63
- React.createElement(Main, null,
64
- React.createElement(LibraryItems, { query: query, setQuery: setQuery, handleSelect: setSelectedItem, hasItem: () => true, items: filteredItems, filterID: filterID, projectLibraryCollections: projectLibraryCollections, selectedItem: selectedItem })),
65
- React.createElement(Panel, { name: 'libraryItem', side: 'start', direction: 'row', minSize: 300, resizerButton: ResizingInspectorButton }, selectedItem && (React.createElement(LibraryForm, { key: selectedItem._id, item: selectedItem, handleSave: handleSave, handleDelete: handleDelete, user: user })))));
66
- });
67
- //# sourceMappingURL=ProjectLibrary.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ProjectLibrary.js","sourceRoot":"","sources":["../../../../../src/components/library/ProjectLibrary.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAE/D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAO,E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AAY,EAAE,YAAY,GAC1B,CACG;QAEP,oBAAC,KAAK,IACJ,IAAI,EAAE,aAAa,EACnB,IAAI,EAAE,OAAO,EACb,SAAS,EAAE,KAAK,EAChB,OAAO,EAAE,GAAG,EACZ,aAAa,EAAE,uBAAuB,IAErC,YAAY,IAAI,CACf,oBAAC,WAAW,IACV,GAAG,EAAE,YAAY,CAAC,GAAG,EACrB,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,IAAI,GACV,CACH,CACK,CACP,CACJ,CAAA;AACH,CAAC,CACF,CAAA"}
@@ -1,117 +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) 2020 Atypon Systems LLC. All Rights Reserved.
11
- */
12
- import { ObjectTypes } from '@manuscripts/json-schema';
13
- import React, { useCallback, useEffect, useState } from 'react';
14
- import Dropzone from 'react-dropzone';
15
- import styled from 'styled-components';
16
- import { useStore } from '../../store';
17
- export const HeaderFigure = () => {
18
- const [loaded, setLoaded] = useState();
19
- const [src, setSrc] = useState();
20
- const [{ getAttachment, putAttachment, saveModel, manuscript }] = useStore((store) => {
21
- return {
22
- manuscript: store.manuscript,
23
- saveModel: store.saveModel,
24
- getAttachment: store.getAttachment,
25
- putAttachment: store.putAttachment,
26
- };
27
- });
28
- useEffect(() => {
29
- setLoaded(false);
30
- setSrc(undefined);
31
- if (manuscript.headerFigure && getAttachment) {
32
- getAttachment(manuscript.headerFigure, 'image')
33
- .then((blob) => {
34
- if (blob) {
35
- const url = window.URL.createObjectURL(blob);
36
- setSrc(url);
37
- }
38
- })
39
- .finally(() => {
40
- setLoaded(true);
41
- })
42
- .catch((error) => {
43
- console.error(error);
44
- });
45
- }
46
- else {
47
- setLoaded(true);
48
- }
49
- }, [getAttachment, manuscript.headerFigure]);
50
- const handleDrop = useCallback((acceptedFiles) => {
51
- const figureID = manuscript.headerFigure;
52
- if (figureID && putAttachment) {
53
- const [file] = acceptedFiles;
54
- if (!file) {
55
- return;
56
- }
57
- putAttachment(figureID, {
58
- id: 'image',
59
- data: file,
60
- type: file.type,
61
- })
62
- .then(async () => {
63
- // set the contentType on the Figure object
64
- await saveModel({
65
- _id: figureID,
66
- objectType: ObjectTypes.Figure,
67
- contentType: file.type,
68
- });
69
- const url = window.URL.createObjectURL(file);
70
- setSrc(url);
71
- })
72
- .catch((error) => {
73
- console.error(error);
74
- });
75
- }
76
- }, [manuscript.headerFigure, putAttachment, saveModel]);
77
- if (!manuscript.headerFigure || !loaded) {
78
- return null;
79
- }
80
- if (!src) {
81
- return (React.createElement(Dropzone, { onDrop: handleDrop, accept: '.jpg,.jpeg,.png,.gif,.webp', multiple: false }, ({ isDragActive, isDragAccept, getInputProps, getRootProps }) => (React.createElement(StyledDropArea, { ...getRootProps() },
82
- React.createElement("input", { ...getInputProps() }),
83
- React.createElement("div", null,
84
- "Drag an image here or click to browse\u2026",
85
- isDragActive && React.createElement("div", null, "Drop here"),
86
- isDragAccept && React.createElement("div", null, "Accept here"))))));
87
- }
88
- return (React.createElement(FigureContainer, null, src && React.createElement("img", { alt: 'Header figure', src: src })));
89
- };
90
- const FigureContainer = styled.figure `
91
- display: flex;
92
- flex-direction: column;
93
- align-items: center;
94
- justify-content: center;
95
- margin: 0 0 24px 0;
96
-
97
- img {
98
- width: 100%;
99
- object-fit: contain;
100
- }
101
- `;
102
- const StyledDropArea = styled.div `
103
- flex: 1;
104
- display: flex;
105
- flex-direction: column;
106
- align-items: center;
107
- justify-content: center;
108
- padding: 16px;
109
- border: 2px dashed #ddd;
110
- margin-bottom: 16px;
111
- cursor: pointer;
112
-
113
- &:focus {
114
- outline: none;
115
- }
116
- `;
117
- //# sourceMappingURL=HeaderFigure.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HeaderFigure.js","sourceRoot":"","sources":["../../../../../src/components/metadata/HeaderFigure.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAU,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC/D,OAAO,QAAQ,MAAM,gBAAgB,CAAA;AACrC,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,MAAM,CAAC,MAAM,YAAY,GAAa,GAAG,EAAE;IACzC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,EAAW,CAAA;IAC/C,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,QAAQ,EAAU,CAAA;IACxC,MAAM,CAAC,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,GAAG,QAAQ,CACxE,CAAC,KAAK,EAAE,EAAE;QACR,OAAO;YACL,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,aAAa,EAAE,KAAK,CAAC,aAAa;YAClC,aAAa,EAAE,KAAK,CAAC,aAAa;SACnC,CAAA;IACH,CAAC,CACF,CAAA;IAED,SAAS,CAAC,GAAG,EAAE;QACb,SAAS,CAAC,KAAK,CAAC,CAAA;QAChB,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,CAAA;gBACF,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;gBAC5C,MAAM,CAAC,GAAG,CAAC,CAAA;YACb,CAAC,CAAC;iBACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;gBACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;YACtB,CAAC,CAAC,CAAA;SACL;IACH,CAAC,EACD,CAAC,UAAU,CAAC,YAAY,EAAE,aAAa,EAAE,SAAS,CAAC,CACpD,CAAA;IAED,IAAI,CAAC,UAAU,CAAC,YAAY,IAAI,CAAC,MAAM,EAAE;QACvC,OAAO,IAAI,CAAA;KACZ;IAED,IAAI,CAAC,GAAG,EAAE;QACR,OAAO,CACL,oBAAC,QAAQ,IACP,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,4BAA4B,EACpC,QAAQ,EAAE,KAAK,IAEd,CAAC,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,CAChE,oBAAC,cAAc,OAAK,YAAY,EAAE;YAChC,kCAAW,aAAa,EAAE,GAAI;YAE9B;;gBAEG,YAAY,IAAI,6CAAoB;gBACpC,YAAY,IAAI,+CAAsB,CACnC,CACS,CAClB,CACQ,CACZ,CAAA;KACF;IAED,OAAO,CACL,oBAAC,eAAe,QACb,GAAG,IAAI,6BAAK,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,GAAG,GAAI,CAG/B,CACnB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAA;;;;;;;;;;;CAWpC,CAAA;AAED,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;CAchC,CAAA"}
@@ -1,44 +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 { ObjectTypes } from '@manuscripts/json-schema';
13
- const attachmentPrefix = 'attachment:';
14
- export function replaceAttachmentsIds(modelMap, attachments) {
15
- const newMap = new Map();
16
- modelMap.forEach((model) => {
17
- const figure = { ...model };
18
- if (figure.objectType === ObjectTypes.Figure &&
19
- figure.src?.startsWith(attachmentPrefix)) {
20
- const id = figure.src.replace(attachmentPrefix, '');
21
- const attachment = attachments.find((a) => id === a.id);
22
- if (attachment) {
23
- figure.src = attachment.link;
24
- }
25
- }
26
- newMap.set(figure._id, figure);
27
- });
28
- return newMap;
29
- }
30
- export function replaceAttachmentLinks(modelMap, attachments) {
31
- const newMap = new Map();
32
- modelMap.forEach((model) => {
33
- const figure = { ...model };
34
- if (figure.objectType === ObjectTypes.Figure && figure.src) {
35
- const attachment = attachments.find((a) => figure.src?.startsWith(a.link));
36
- if (attachment) {
37
- figure.src = attachmentPrefix + attachment.id;
38
- }
39
- }
40
- newMap.set(figure._id, figure);
41
- });
42
- return newMap;
43
- }
44
- //# sourceMappingURL=replace-attachments-ids.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"replace-attachments-ids.js","sourceRoot":"","sources":["../../../../src/lib/replace-attachments-ids.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAU,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAK9D,MAAM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C,CAAA;YAC1E,IAAI,UAAU,EAAE;gBACd,MAAM,CAAC,GAAG,GAAG,gBAAgB,GAAG,UAAU,CAAC,EAAE,CAAA;aAC9C;SACF;QACD,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;IAChC,CAAC,CAAC,CAAA;IACF,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -1,183 +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 { action } from '@storybook/addon-actions';
13
- import { storiesOf } from '@storybook/react';
14
- import { createBrowserHistory } from 'history';
15
- import React from 'react';
16
- // TODO: re-enable routing once storybook-react-router is compatible
17
- // import { Route, RouteComponentProps } from 'react-router'
18
- // import StoryRouter from 'storybook-react-router'
19
- import { LibrarySidebar } from '../src/components/library/LibrarySidebar';
20
- const projectLibraryCollections = new Map([
21
- [
22
- 'MPLibraryCollection:1',
23
- {
24
- _id: 'MPLibraryCollection:1',
25
- objectType: 'MPLibraryCollection',
26
- containerID: 'MPProject:1',
27
- name: 'Examples',
28
- owners: ['User_foo@example.com'],
29
- writers: [],
30
- viewers: [],
31
- createdAt: 0,
32
- updatedAt: 0,
33
- },
34
- ],
35
- ]);
36
- const globalLibraries = new Map([
37
- [
38
- 'MPLibrary:1',
39
- {
40
- _id: 'MPLibrary:1',
41
- objectType: 'MPLibrary',
42
- category: 'MPLibraryCategory:default',
43
- name: 'My Library',
44
- owners: ['User_foo@example.com'],
45
- writers: [],
46
- viewers: [],
47
- createdAt: 0,
48
- updatedAt: 0,
49
- },
50
- ],
51
- ]);
52
- const globalLibraryCollections = new Map([
53
- [
54
- 'MPLibraryCollection:2',
55
- {
56
- _id: 'MPLibraryCollection:2',
57
- objectType: 'MPLibraryCollection',
58
- containerID: 'MPLibrary:1',
59
- category: 'MPLibraryCollectionCategory:read-later',
60
- name: 'Read Later',
61
- owners: ['User_foo@example.com'],
62
- writers: [],
63
- viewers: [],
64
- createdAt: 0,
65
- updatedAt: 0,
66
- },
67
- ],
68
- [
69
- 'MPLibraryCollection:3',
70
- {
71
- _id: 'MPLibraryCollection:3',
72
- objectType: 'MPLibraryCollection',
73
- containerID: 'MPLibrary:1',
74
- category: 'MPLibraryCollectionCategory:favourites',
75
- name: 'Favourites',
76
- owners: ['User_foo@example.com'],
77
- writers: [],
78
- viewers: [],
79
- createdAt: 0,
80
- updatedAt: 0,
81
- },
82
- ],
83
- [
84
- 'MPLibraryCollection:4',
85
- {
86
- _id: 'MPLibraryCollection:4',
87
- objectType: 'MPLibraryCollection',
88
- containerID: 'MPLibrary:1',
89
- category: 'MPLibraryCollectionCategory:default',
90
- name: 'Default',
91
- owners: ['User_foo@example.com'],
92
- writers: [],
93
- viewers: [],
94
- createdAt: 0,
95
- updatedAt: 0,
96
- },
97
- ],
98
- [
99
- 'MPLibraryCollection:5',
100
- {
101
- _id: 'MPLibraryCollection:5',
102
- objectType: 'MPLibraryCollection',
103
- containerID: 'MPLibrary:1',
104
- category: 'MPLibraryCollectionCategory:watch-list',
105
- name: 'Watch List',
106
- owners: ['User_foo@example.com'],
107
- writers: [],
108
- viewers: [],
109
- createdAt: 0,
110
- updatedAt: 0,
111
- },
112
- ],
113
- [
114
- 'MPLibraryCollection:6',
115
- {
116
- _id: 'MPLibraryCollection:6',
117
- objectType: 'MPLibraryCollection',
118
- containerID: 'MPLibrary:1',
119
- category: 'MPLibraryCollectionCategory:my-publications',
120
- name: 'My Publications',
121
- owners: ['User_foo@example.com'],
122
- writers: [],
123
- viewers: [],
124
- createdAt: 0,
125
- updatedAt: 0,
126
- },
127
- ],
128
- ]);
129
- const routeProps = {
130
- history: createBrowserHistory(),
131
- match: {
132
- isExact: true,
133
- params: {
134
- projectID: 'MPProject:1',
135
- sourceType: 'library',
136
- sourceID: 'MPLibrary:1',
137
- },
138
- path: '',
139
- url: '',
140
- },
141
- location: {
142
- hash: '',
143
- pathname: '/projects/MPProject:1/library/global/MPLibrary:1',
144
- search: '',
145
- state: {},
146
- },
147
- };
148
- storiesOf('Library Sidebar', module).add('Sidebar', () => (React.createElement(LibrarySidebar, { projectLibraryCollections: projectLibraryCollections, globalLibraryCollections: globalLibraryCollections, globalLibraries: globalLibraries, importItems: action('import items'), createBibliographyItem: action('create bibliography item'), ...routeProps })));
149
- // storiesOf('Library Sidebar', module)
150
- // .addDecorator(
151
- // StoryRouter(
152
- // {},
153
- // {
154
- // initialEntries: [
155
- // {
156
- // pathname: `/projects/MPProject:1/library/global/MPLibrary:1`,
157
- // },
158
- // ],
159
- // }
160
- // )
161
- // )
162
- // .add('Sidebar', () => (
163
- // <Route
164
- // path={'/projects/:projectID/library/:sourceType?/:sourceID?/:filterID?'}
165
- // render={(
166
- // props: RouteComponentProps<{
167
- // projectID: string
168
- // sourceType: string
169
- // sourceID?: string
170
- // }>
171
- // ) => (
172
- // <LibrarySidebar
173
- // projectLibraryCollections={projectLibraryCollections}
174
- // globalLibraryCollections={globalLibraryCollections}
175
- // globalLibraries={globalLibraries}
176
- // importItems={action('import items')}
177
- // createBibliographyItem={action('create bibliography item')}
178
- // {...props}
179
- // />
180
- // )}
181
- // />
182
- // ))
183
- //# sourceMappingURL=LibrarySidebar.stories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Librar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