@manuscripts/article-editor 1.8.1 → 1.8.3

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 (326) hide show
  1. package/dist/cjs/src/components/Support.js +129 -0
  2. package/dist/cjs/src/components/Support.js.map +1 -0
  3. package/dist/cjs/src/components/inspector/ElementStyleInspector.js +14 -0
  4. package/dist/cjs/src/components/inspector/ElementStyleInspector.js.map +1 -0
  5. package/dist/cjs/src/components/inspector/StatisticsInspector.js +39 -0
  6. package/dist/cjs/src/components/inspector/StatisticsInspector.js.map +1 -0
  7. package/dist/cjs/src/components/library/CitationModel.js +210 -0
  8. package/dist/cjs/src/components/library/CitationModel.js.map +1 -0
  9. package/dist/cjs/src/components/library/CitationProperties.js +67 -0
  10. package/dist/cjs/src/components/library/CitationProperties.js.map +1 -0
  11. package/dist/cjs/src/components/library/ExternalSearch.js +156 -0
  12. package/dist/cjs/src/components/library/ExternalSearch.js.map +1 -0
  13. package/dist/cjs/src/components/library/GlobalLibrary.js +133 -0
  14. package/dist/cjs/src/components/library/GlobalLibrary.js.map +1 -0
  15. package/dist/cjs/src/components/library/LibraryCollectionCategories.js +53 -0
  16. package/dist/cjs/src/components/library/LibraryCollectionCategories.js.map +1 -0
  17. package/dist/cjs/src/components/library/LibraryForm.js +437 -0
  18. package/dist/cjs/src/components/library/LibraryForm.js.map +1 -0
  19. package/dist/cjs/src/components/library/LibraryItems.js +116 -0
  20. package/dist/cjs/src/components/library/LibraryItems.js.map +1 -0
  21. package/dist/cjs/src/components/library/LibraryPageContainer.js +107 -0
  22. package/dist/cjs/src/components/library/LibraryPageContainer.js.map +1 -0
  23. package/dist/cjs/src/components/library/LibrarySidebar.js +172 -0
  24. package/dist/cjs/src/components/library/LibrarySidebar.js.map +1 -0
  25. package/dist/cjs/src/components/library/Messages.js +25 -0
  26. package/dist/cjs/src/components/library/Messages.js.map +1 -0
  27. package/dist/cjs/src/components/library/ProjectLibrary.js +96 -0
  28. package/dist/cjs/src/components/library/ProjectLibrary.js.map +1 -0
  29. package/dist/cjs/src/components/metadata/HeaderFigure.js +147 -0
  30. package/dist/cjs/src/components/metadata/HeaderFigure.js.map +1 -0
  31. package/dist/cjs/src/components/metadata/Metadata.js +103 -0
  32. package/dist/cjs/src/components/metadata/Metadata.js.map +1 -0
  33. package/dist/cjs/src/components/metadata/MetadataContainer.js +203 -0
  34. package/dist/cjs/src/components/metadata/MetadataContainer.js.map +1 -0
  35. package/dist/cjs/src/components/metadata/TitleFieldContainer.js +56 -0
  36. package/dist/cjs/src/components/metadata/TitleFieldContainer.js.map +1 -0
  37. package/dist/cjs/src/components/projects/CategorisedKeywordsInput.js +439 -0
  38. package/dist/cjs/src/components/projects/CategorisedKeywordsInput.js.map +1 -0
  39. package/dist/cjs/src/components/projects/KeywordsInput.js +80 -0
  40. package/dist/cjs/src/components/projects/KeywordsInput.js.map +1 -0
  41. package/dist/cjs/src/components/projects/SortableManuscript.js +102 -0
  42. package/dist/cjs/src/components/projects/SortableManuscript.js.map +1 -0
  43. package/dist/cjs/src/components/projects/lean-workflow/ApplicationMenusLW.js +102 -0
  44. package/dist/cjs/src/components/projects/lean-workflow/ApplicationMenusLW.js.map +1 -0
  45. package/dist/cjs/src/components/projects/lean-workflow/CommentList.js +289 -0
  46. package/dist/cjs/src/components/projects/lean-workflow/CommentList.js.map +1 -0
  47. package/dist/cjs/src/components/projects/lean-workflow/CommentsTab.js +41 -0
  48. package/dist/cjs/src/components/projects/lean-workflow/CommentsTab.js.map +1 -0
  49. package/dist/cjs/src/components/projects/lean-workflow/ContentTab.js +66 -0
  50. package/dist/cjs/src/components/projects/lean-workflow/ContentTab.js.map +1 -0
  51. package/dist/cjs/src/components/projects/lean-workflow/EditorElement.js +252 -0
  52. package/dist/cjs/src/components/projects/lean-workflow/EditorElement.js.map +1 -0
  53. package/dist/cjs/src/components/projects/lean-workflow/ExceptionDialog.js +150 -0
  54. package/dist/cjs/src/components/projects/lean-workflow/ExceptionDialog.js.map +1 -0
  55. package/dist/cjs/src/components/projects/lean-workflow/ManuscriptPageContainerLW.js +187 -0
  56. package/dist/cjs/src/components/projects/lean-workflow/ManuscriptPageContainerLW.js.map +1 -0
  57. package/dist/cjs/src/components/projects/lean-workflow/SaveStatusController.js +53 -0
  58. package/dist/cjs/src/components/projects/lean-workflow/SaveStatusController.js.map +1 -0
  59. package/dist/cjs/src/components/projects/lean-workflow/TrackChangesStyles.js +106 -0
  60. package/dist/cjs/src/components/projects/lean-workflow/TrackChangesStyles.js.map +1 -0
  61. package/dist/cjs/src/components/projects/lean-workflow/icons/DeleteIcon.js +27 -0
  62. package/dist/cjs/src/components/projects/lean-workflow/icons/DeleteIcon.js.map +1 -0
  63. package/dist/cjs/src/components/projects/lean-workflow/icons/GroupIcon.js +29 -0
  64. package/dist/cjs/src/components/projects/lean-workflow/icons/GroupIcon.js.map +1 -0
  65. package/dist/cjs/src/components/projects/lean-workflow/icons/LinkIcon.js +23 -0
  66. package/dist/cjs/src/components/projects/lean-workflow/icons/LinkIcon.js.map +1 -0
  67. package/dist/cjs/src/components/projects/lean-workflow/icons/TemplateIcon.js +23 -0
  68. package/dist/cjs/src/components/projects/lean-workflow/icons/TemplateIcon.js.map +1 -0
  69. package/dist/cjs/src/components/projects/lean-workflow/provider/UserProvider.js +38 -0
  70. package/dist/cjs/src/components/projects/lean-workflow/provider/UserProvider.js.map +1 -0
  71. package/dist/cjs/src/components/requirements/RequirementContainer.js +58 -0
  72. package/dist/cjs/src/components/requirements/RequirementContainer.js.map +1 -0
  73. package/dist/cjs/src/components/requirements/RequirementsData.js +129 -0
  74. package/dist/cjs/src/components/requirements/RequirementsData.js.map +1 -0
  75. package/dist/cjs/src/components/requirements/RequirementsIcons.js +34 -0
  76. package/dist/cjs/src/components/requirements/RequirementsIcons.js.map +1 -0
  77. package/dist/cjs/src/components/requirements/RequirementsInspector.js +150 -0
  78. package/dist/cjs/src/components/requirements/RequirementsInspector.js.map +1 -0
  79. package/dist/cjs/src/components/requirements/RequirementsList.js +84 -0
  80. package/dist/cjs/src/components/requirements/RequirementsList.js.map +1 -0
  81. package/dist/cjs/src/components/requirements/SectionValidations.js +47 -0
  82. package/dist/cjs/src/components/requirements/SectionValidations.js.map +1 -0
  83. package/dist/cjs/src/hooks/use-create-editor.js +2 -2
  84. package/dist/cjs/src/hooks/use-create-editor.js.map +1 -1
  85. package/dist/cjs/src/hooks/use-requirements-validation.js +87 -0
  86. package/dist/cjs/src/hooks/use-requirements-validation.js.map +1 -0
  87. package/dist/cjs/src/lib/apollo.js +41 -0
  88. package/dist/cjs/src/lib/apollo.js.map +1 -0
  89. package/dist/cjs/src/lib/lean-workflow-gql.js +40 -0
  90. package/dist/cjs/src/lib/lean-workflow-gql.js.map +1 -0
  91. package/dist/cjs/src/lib/replace-attachments-ids.js +49 -0
  92. package/dist/cjs/src/lib/replace-attachments-ids.js.map +1 -0
  93. package/dist/cjs/src/postgres-data/Bibilo.js +33 -0
  94. package/dist/cjs/src/postgres-data/Bibilo.js.map +1 -0
  95. package/dist/cjs/src/store/BiblioTools.js +3 -0
  96. package/dist/cjs/src/store/BiblioTools.js.map +1 -0
  97. package/dist/cjs/stories/Citation.stories.js +43 -0
  98. package/dist/cjs/stories/Citation.stories.js.map +1 -0
  99. package/dist/cjs/stories/LibrarySidebar.stories.js +188 -0
  100. package/dist/cjs/stories/LibrarySidebar.stories.js.map +1 -0
  101. package/dist/cjs/stories/Metadata.stories.js +53 -0
  102. package/dist/cjs/stories/Metadata.stories.js.map +1 -0
  103. package/dist/cjs/stories/Notification.stories.js +62 -0
  104. package/dist/cjs/stories/Notification.stories.js.map +1 -0
  105. package/dist/cjs/stories/Page.stories.js +50 -0
  106. package/dist/cjs/stories/Page.stories.js.map +1 -0
  107. package/dist/cjs/stories/Panel.stories.js +62 -0
  108. package/dist/cjs/stories/Panel.stories.js.map +1 -0
  109. package/dist/cjs/stories/Placeholders.stories.js +23 -0
  110. package/dist/cjs/stories/Placeholders.stories.js.map +1 -0
  111. package/dist/cjs/stories/PopperButtons.stories.js +27 -0
  112. package/dist/cjs/stories/PopperButtons.stories.js.map +1 -0
  113. package/dist/cjs/stories/Progress.stories.js +25 -0
  114. package/dist/cjs/stories/Progress.stories.js.map +1 -0
  115. package/dist/cjs/stories/ProgressIndicator.stories.js +33 -0
  116. package/dist/cjs/stories/ProgressIndicator.stories.js.map +1 -0
  117. package/dist/cjs/stories/ReloadDialog.stories.js +21 -0
  118. package/dist/cjs/stories/ReloadDialog.stories.js.map +1 -0
  119. package/dist/cjs/stories/RequirementsInspector.stories.js +159 -0
  120. package/dist/cjs/stories/RequirementsInspector.stories.js.map +1 -0
  121. package/dist/cjs/stories/RequirmentsList.stories.js +36 -0
  122. package/dist/cjs/stories/RequirmentsList.stories.js.map +1 -0
  123. package/dist/cjs/stories/SelectField.stories.js +34 -0
  124. package/dist/cjs/stories/SelectField.stories.js.map +1 -0
  125. package/dist/cjs/stories/Support.stories.js +32 -0
  126. package/dist/cjs/stories/Support.stories.js.map +1 -0
  127. package/dist/cjs/stories/data/doc.js +27 -0
  128. package/dist/cjs/stories/data/doc.js.map +1 -0
  129. package/dist/cjs/stories/data/validationData.js +44 -0
  130. package/dist/cjs/stories/data/validationData.js.map +1 -0
  131. package/dist/es/src/components/Support.js +100 -0
  132. package/dist/es/src/components/Support.js.map +1 -0
  133. package/dist/es/src/components/inspector/ElementStyleInspector.js +13 -0
  134. package/dist/es/src/components/inspector/ElementStyleInspector.js.map +1 -0
  135. package/dist/es/src/components/inspector/StatisticsInspector.js +32 -0
  136. package/dist/es/src/components/inspector/StatisticsInspector.js.map +1 -0
  137. package/dist/es/src/components/library/CitationModel.js +180 -0
  138. package/dist/es/src/components/library/CitationModel.js.map +1 -0
  139. package/dist/es/src/components/library/CitationProperties.js +60 -0
  140. package/dist/es/src/components/library/CitationProperties.js.map +1 -0
  141. package/dist/es/src/components/library/ExternalSearch.js +127 -0
  142. package/dist/es/src/components/library/ExternalSearch.js.map +1 -0
  143. package/dist/es/src/components/library/GlobalLibrary.js +104 -0
  144. package/dist/es/src/components/library/GlobalLibrary.js.map +1 -0
  145. package/dist/es/src/components/library/LibraryCollectionCategories.js +45 -0
  146. package/dist/es/src/components/library/LibraryCollectionCategories.js.map +1 -0
  147. package/dist/es/src/components/library/LibraryForm.js +409 -0
  148. package/dist/es/src/components/library/LibraryForm.js.map +1 -0
  149. package/dist/es/src/components/library/LibraryItems.js +86 -0
  150. package/dist/es/src/components/library/LibraryItems.js.map +1 -0
  151. package/dist/es/src/components/library/LibraryPageContainer.js +80 -0
  152. package/dist/es/src/components/library/LibraryPageContainer.js.map +1 -0
  153. package/dist/es/src/components/library/LibrarySidebar.js +165 -0
  154. package/dist/es/src/components/library/LibrarySidebar.js.map +1 -0
  155. package/dist/es/src/components/library/Messages.js +18 -0
  156. package/dist/es/src/components/library/Messages.js.map +1 -0
  157. package/dist/es/src/components/library/ProjectLibrary.js +67 -0
  158. package/dist/es/src/components/library/ProjectLibrary.js.map +1 -0
  159. package/dist/es/src/components/metadata/HeaderFigure.js +117 -0
  160. package/dist/es/src/components/metadata/HeaderFigure.js.map +1 -0
  161. package/dist/es/src/components/metadata/Metadata.js +73 -0
  162. package/dist/es/src/components/metadata/Metadata.js.map +1 -0
  163. package/dist/es/src/components/metadata/MetadataContainer.js +178 -0
  164. package/dist/es/src/components/metadata/MetadataContainer.js.map +1 -0
  165. package/dist/es/src/components/metadata/TitleFieldContainer.js +49 -0
  166. package/dist/es/src/components/metadata/TitleFieldContainer.js.map +1 -0
  167. package/dist/es/src/components/projects/CategorisedKeywordsInput.js +409 -0
  168. package/dist/es/src/components/projects/CategorisedKeywordsInput.js.map +1 -0
  169. package/dist/es/src/components/projects/KeywordsInput.js +73 -0
  170. package/dist/es/src/components/projects/KeywordsInput.js.map +1 -0
  171. package/dist/es/src/components/projects/SortableManuscript.js +72 -0
  172. package/dist/es/src/components/projects/SortableManuscript.js.map +1 -0
  173. package/dist/es/src/components/projects/lean-workflow/ApplicationMenusLW.js +72 -0
  174. package/dist/es/src/components/projects/lean-workflow/ApplicationMenusLW.js.map +1 -0
  175. package/dist/es/src/components/projects/lean-workflow/CommentList.js +259 -0
  176. package/dist/es/src/components/projects/lean-workflow/CommentList.js.map +1 -0
  177. package/dist/es/src/components/projects/lean-workflow/CommentsTab.js +34 -0
  178. package/dist/es/src/components/projects/lean-workflow/CommentsTab.js.map +1 -0
  179. package/dist/es/src/components/projects/lean-workflow/ContentTab.js +59 -0
  180. package/dist/es/src/components/projects/lean-workflow/ContentTab.js.map +1 -0
  181. package/dist/es/src/components/projects/lean-workflow/EditorElement.js +227 -0
  182. package/dist/es/src/components/projects/lean-workflow/EditorElement.js.map +1 -0
  183. package/dist/es/src/components/projects/lean-workflow/ExceptionDialog.js +120 -0
  184. package/dist/es/src/components/projects/lean-workflow/ExceptionDialog.js.map +1 -0
  185. package/dist/es/src/components/projects/lean-workflow/ManuscriptPageContainerLW.js +159 -0
  186. package/dist/es/src/components/projects/lean-workflow/ManuscriptPageContainerLW.js.map +1 -0
  187. package/dist/es/src/components/projects/lean-workflow/SaveStatusController.js +23 -0
  188. package/dist/es/src/components/projects/lean-workflow/SaveStatusController.js.map +1 -0
  189. package/dist/es/src/components/projects/lean-workflow/TrackChangesStyles.js +99 -0
  190. package/dist/es/src/components/projects/lean-workflow/TrackChangesStyles.js.map +1 -0
  191. package/dist/es/src/components/projects/lean-workflow/icons/DeleteIcon.js +20 -0
  192. package/dist/es/src/components/projects/lean-workflow/icons/DeleteIcon.js.map +1 -0
  193. package/dist/es/src/components/projects/lean-workflow/icons/GroupIcon.js +22 -0
  194. package/dist/es/src/components/projects/lean-workflow/icons/GroupIcon.js.map +1 -0
  195. package/dist/es/src/components/projects/lean-workflow/icons/LinkIcon.js +16 -0
  196. package/dist/es/src/components/projects/lean-workflow/icons/LinkIcon.js.map +1 -0
  197. package/dist/es/src/components/projects/lean-workflow/icons/TemplateIcon.js +16 -0
  198. package/dist/es/src/components/projects/lean-workflow/icons/TemplateIcon.js.map +1 -0
  199. package/dist/es/src/components/projects/lean-workflow/provider/UserProvider.js +11 -0
  200. package/dist/es/src/components/projects/lean-workflow/provider/UserProvider.js.map +1 -0
  201. package/dist/es/src/components/requirements/RequirementContainer.js +51 -0
  202. package/dist/es/src/components/requirements/RequirementContainer.js.map +1 -0
  203. package/dist/es/src/components/requirements/RequirementsData.js +99 -0
  204. package/dist/es/src/components/requirements/RequirementsData.js.map +1 -0
  205. package/dist/es/src/components/requirements/RequirementsIcons.js +24 -0
  206. package/dist/es/src/components/requirements/RequirementsIcons.js.map +1 -0
  207. package/dist/es/src/components/requirements/RequirementsInspector.js +118 -0
  208. package/dist/es/src/components/requirements/RequirementsInspector.js.map +1 -0
  209. package/dist/es/src/components/requirements/RequirementsList.js +54 -0
  210. package/dist/es/src/components/requirements/RequirementsList.js.map +1 -0
  211. package/dist/es/src/components/requirements/SectionValidations.js +40 -0
  212. package/dist/es/src/components/requirements/SectionValidations.js.map +1 -0
  213. package/dist/es/src/hooks/use-create-editor.js +3 -3
  214. package/dist/es/src/hooks/use-create-editor.js.map +1 -1
  215. package/dist/es/src/hooks/use-requirements-validation.js +83 -0
  216. package/dist/es/src/hooks/use-requirements-validation.js.map +1 -0
  217. package/dist/es/src/lib/apollo.js +35 -0
  218. package/dist/es/src/lib/apollo.js.map +1 -0
  219. package/dist/es/src/lib/lean-workflow-gql.js +33 -0
  220. package/dist/es/src/lib/lean-workflow-gql.js.map +1 -0
  221. package/dist/es/src/lib/replace-attachments-ids.js +44 -0
  222. package/dist/es/src/lib/replace-attachments-ids.js.map +1 -0
  223. package/dist/es/src/postgres-data/Bibilo.js +29 -0
  224. package/dist/es/src/postgres-data/Bibilo.js.map +1 -0
  225. package/dist/es/src/store/BiblioTools.js +2 -0
  226. package/dist/es/src/store/BiblioTools.js.map +1 -0
  227. package/dist/es/stories/Citation.stories.js +38 -0
  228. package/dist/es/stories/Citation.stories.js.map +1 -0
  229. package/dist/es/stories/LibrarySidebar.stories.js +183 -0
  230. package/dist/es/stories/LibrarySidebar.stories.js.map +1 -0
  231. package/dist/es/stories/Metadata.stories.js +48 -0
  232. package/dist/es/stories/Metadata.stories.js.map +1 -0
  233. package/dist/es/stories/Notification.stories.js +57 -0
  234. package/dist/es/stories/Notification.stories.js.map +1 -0
  235. package/dist/es/stories/Page.stories.js +45 -0
  236. package/dist/es/stories/Page.stories.js.map +1 -0
  237. package/dist/es/stories/Panel.stories.js +57 -0
  238. package/dist/es/stories/Panel.stories.js.map +1 -0
  239. package/dist/es/stories/Placeholders.stories.js +18 -0
  240. package/dist/es/stories/Placeholders.stories.js.map +1 -0
  241. package/dist/es/stories/PopperButtons.stories.js +22 -0
  242. package/dist/es/stories/PopperButtons.stories.js.map +1 -0
  243. package/dist/es/stories/Progress.stories.js +20 -0
  244. package/dist/es/stories/Progress.stories.js.map +1 -0
  245. package/dist/es/stories/ProgressIndicator.stories.js +28 -0
  246. package/dist/es/stories/ProgressIndicator.stories.js.map +1 -0
  247. package/dist/es/stories/ReloadDialog.stories.js +16 -0
  248. package/dist/es/stories/ReloadDialog.stories.js.map +1 -0
  249. package/dist/es/stories/RequirementsInspector.stories.js +154 -0
  250. package/dist/es/stories/RequirementsInspector.stories.js.map +1 -0
  251. package/dist/es/stories/RequirmentsList.stories.js +31 -0
  252. package/dist/es/stories/RequirmentsList.stories.js.map +1 -0
  253. package/dist/es/stories/SelectField.stories.js +29 -0
  254. package/dist/es/stories/SelectField.stories.js.map +1 -0
  255. package/dist/es/stories/Support.stories.js +27 -0
  256. package/dist/es/stories/Support.stories.js.map +1 -0
  257. package/dist/es/stories/data/doc.js +21 -0
  258. package/dist/es/stories/data/doc.js.map +1 -0
  259. package/dist/es/stories/data/validationData.js +41 -0
  260. package/dist/es/stories/data/validationData.js.map +1 -0
  261. package/dist/types/src/components/Support.d.ts +13 -0
  262. package/dist/types/src/components/inspector/ElementStyleInspector.d.ts +13 -0
  263. package/dist/types/src/components/inspector/StatisticsInspector.d.ts +17 -0
  264. package/dist/types/src/components/library/CitationModel.d.ts +18 -0
  265. package/dist/types/src/components/library/CitationProperties.d.ts +17 -0
  266. package/dist/types/src/components/library/ExternalSearch.d.ts +19 -0
  267. package/dist/types/src/components/library/GlobalLibrary.d.ts +20 -0
  268. package/dist/types/src/components/library/LibraryCollectionCategories.d.ts +15 -0
  269. package/dist/types/src/components/library/LibraryForm.d.ts +20 -0
  270. package/dist/types/src/components/library/LibraryItems.d.ts +12 -0
  271. package/dist/types/src/components/library/LibraryPageContainer.d.ts +14 -0
  272. package/dist/types/src/components/library/LibrarySidebar.d.ts +21 -0
  273. package/dist/types/src/components/library/Messages.d.ts +15 -0
  274. package/dist/types/src/components/library/ProjectLibrary.d.ts +23 -0
  275. package/dist/types/src/components/metadata/HeaderFigure.d.ts +13 -0
  276. package/dist/types/src/components/metadata/Metadata.d.ts +60 -0
  277. package/dist/types/src/components/metadata/MetadataContainer.d.ts +21 -0
  278. package/dist/types/src/components/metadata/TitleFieldContainer.d.ts +19 -0
  279. package/dist/types/src/components/projects/CategorisedKeywordsInput.d.ts +6 -0
  280. package/dist/types/src/components/projects/KeywordsInput.d.ts +17 -0
  281. package/dist/types/src/components/projects/SortableManuscript.d.ts +18 -0
  282. package/dist/types/src/components/projects/lean-workflow/ApplicationMenusLW.d.ts +20 -0
  283. package/dist/types/src/components/projects/lean-workflow/CommentList.d.ts +18 -0
  284. package/dist/types/src/components/projects/lean-workflow/CommentsTab.d.ts +7 -0
  285. package/dist/types/src/components/projects/lean-workflow/ContentTab.d.ts +6 -0
  286. package/dist/types/src/components/projects/lean-workflow/EditorElement.d.ts +18 -0
  287. package/dist/types/src/components/projects/lean-workflow/ExceptionDialog.d.ts +4 -0
  288. package/dist/types/src/components/projects/lean-workflow/ManuscriptPageContainerLW.d.ts +18 -0
  289. package/dist/types/src/components/projects/lean-workflow/SaveStatusController.d.ts +17 -0
  290. package/dist/types/src/components/projects/lean-workflow/TrackChangesStyles.d.ts +13 -0
  291. package/dist/types/src/components/projects/lean-workflow/icons/DeleteIcon.d.ts +13 -0
  292. package/dist/types/src/components/projects/lean-workflow/icons/GroupIcon.d.ts +15 -0
  293. package/dist/types/src/components/projects/lean-workflow/icons/LinkIcon.d.ts +13 -0
  294. package/dist/types/src/components/projects/lean-workflow/icons/TemplateIcon.d.ts +13 -0
  295. package/dist/types/src/components/projects/lean-workflow/provider/UserProvider.d.ts +22 -0
  296. package/dist/types/src/components/requirements/RequirementContainer.d.ts +19 -0
  297. package/dist/types/src/components/requirements/RequirementsData.d.ts +21 -0
  298. package/dist/types/src/components/requirements/RequirementsIcons.d.ts +16 -0
  299. package/dist/types/src/components/requirements/RequirementsInspector.d.ts +23 -0
  300. package/dist/types/src/components/requirements/RequirementsList.d.ts +16 -0
  301. package/dist/types/src/components/requirements/SectionValidations.d.ts +21 -0
  302. package/dist/types/src/hooks/use-create-editor.d.ts +0 -1
  303. package/dist/types/src/hooks/use-requirements-validation.d.ts +22 -0
  304. package/dist/types/src/lib/apollo.d.ts +13 -0
  305. package/dist/types/src/lib/lean-workflow-gql.d.ts +66 -0
  306. package/dist/types/src/lib/replace-attachments-ids.d.ts +15 -0
  307. package/dist/types/src/postgres-data/Bibilo.d.ts +33 -0
  308. package/dist/types/src/store/BiblioTools.d.ts +21 -0
  309. package/dist/types/stories/Citation.stories.d.ts +12 -0
  310. package/dist/types/stories/LibrarySidebar.stories.d.ts +12 -0
  311. package/dist/types/stories/Metadata.stories.d.ts +12 -0
  312. package/dist/types/stories/Notification.stories.d.ts +12 -0
  313. package/dist/types/stories/Page.stories.d.ts +12 -0
  314. package/dist/types/stories/Panel.stories.d.ts +12 -0
  315. package/dist/types/stories/Placeholders.stories.d.ts +12 -0
  316. package/dist/types/stories/PopperButtons.stories.d.ts +12 -0
  317. package/dist/types/stories/Progress.stories.d.ts +12 -0
  318. package/dist/types/stories/ProgressIndicator.stories.d.ts +12 -0
  319. package/dist/types/stories/ReloadDialog.stories.d.ts +12 -0
  320. package/dist/types/stories/RequirementsInspector.stories.d.ts +12 -0
  321. package/dist/types/stories/RequirmentsList.stories.d.ts +12 -0
  322. package/dist/types/stories/SelectField.stories.d.ts +12 -0
  323. package/dist/types/stories/Support.stories.d.ts +12 -0
  324. package/dist/types/stories/data/doc.d.ts +14 -0
  325. package/dist/types/stories/data/validationData.d.ts +13 -0
  326. package/package.json +2 -2
@@ -0,0 +1,99 @@
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 { usePermissions } from '@manuscripts/style-guide';
13
+ import React from 'react';
14
+ import styled from 'styled-components';
15
+ import config from '../../../config';
16
+ import { useStore } from '../../../store';
17
+ import { useEditorStore } from '../../track-changes/useEditorStore';
18
+ const TrackChangesOn = styled.div `
19
+
20
+ .track-changes--control {
21
+ display: none;
22
+ position: absolute;
23
+ }
24
+
25
+ .track-changes--control > button {
26
+ display: flex;
27
+ flex-direction: column;
28
+ justify-content: center;
29
+ align-items: center;
30
+ background: ${(props) => props.theme.colors.button.secondary.background.default};
31
+ border: 1px solid
32
+ ${(props) => props.theme.colors.button.secondary.border.default};
33
+ color: ${(props) => props.theme.colors.button.secondary.color.default};
34
+ width: 2em;
35
+ height: 2em;
36
+ border-radius: 50%;
37
+ cursor: pointer;
38
+ }
39
+
40
+ .track-changes--control > button:hover {
41
+ background: ${(props) => props.theme.colors.button.default.background.hover} !important;
42
+ }
43
+
44
+ .track-changes--control > button > svg {
45
+ display: inline-flex;
46
+ width: 1.2em;
47
+ height: 1.2em;
48
+ }
49
+ }
50
+ `;
51
+ const TrackChangesReadOnly = styled(TrackChangesOn) `
52
+ .track-changes--control {
53
+ display: none !important;
54
+ }
55
+ `;
56
+ const TrackChangesRejectOnly = styled(TrackChangesOn) `
57
+ [data-action='accept'] {
58
+ display: none !important;
59
+ }
60
+ `;
61
+ const TrackChangesOff = styled.div `
62
+ .track-changes--control {
63
+ display: none !important;
64
+ }
65
+ `;
66
+ const Actions = styled.div `
67
+ .pending:hover .track-changes--control:is(${(props) => props.selector}),
68
+ .track-changes--control:is(${(props) => props.selector}):hover {
69
+ display: inline-flex;
70
+ }
71
+ `;
72
+ const trackChangesCssSelector = (ids) => {
73
+ return ids.map((id) => `[data-changeid="${id}"]`).join(',\n');
74
+ };
75
+ export const TrackChangesStyles = ({ children }) => {
76
+ const { trackState } = useEditorStore();
77
+ const can = usePermissions();
78
+ const [user] = useStore((store) => store.user);
79
+ const { changeSet } = trackState || {};
80
+ const suggestedChangesSelector = trackChangesCssSelector(changeSet?.pending ? changeSet?.pending.map((change) => change.id) : []);
81
+ const mySuggestedChangesSelector = trackChangesCssSelector(changeSet?.pending
82
+ ? changeSet?.pending
83
+ .filter((change) => change.dataTracked.authorID == user?._id)
84
+ .map((change) => change.id)
85
+ : []);
86
+ if (!config.quarterback.enabled) {
87
+ return React.createElement(TrackChangesOff, null, children);
88
+ }
89
+ if (can.handleSuggestion) {
90
+ return (React.createElement(TrackChangesOn, null,
91
+ React.createElement(Actions, { selector: suggestedChangesSelector }, children)));
92
+ }
93
+ if (can.rejectOwnSuggestion) {
94
+ return (React.createElement(TrackChangesRejectOnly, null,
95
+ React.createElement(Actions, { selector: mySuggestedChangesSelector }, children)));
96
+ }
97
+ return React.createElement(TrackChangesReadOnly, null, children);
98
+ };
99
+ //# sourceMappingURL=TrackChangesStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrackChangesStyles.js","sourceRoot":"","sources":["../../../../../../src/components/projects/lean-workflow/TrackChangesStyles.tsx"],"names":[],"mappings":"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"}
@@ -0,0 +1,20 @@
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) 2022 Atypon Systems LLC. All Rights Reserved.
11
+ */
12
+ import React from 'react';
13
+ export const DeleteIcon = () => (React.createElement("svg", { width: "13", height: "16", viewBox: "0 0 13 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
14
+ React.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" }),
15
+ React.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" }),
16
+ React.createElement("rect", { className: "icon_element", y: "2", width: "13", height: "3", rx: "1.5", fill: "#F35143" }),
17
+ React.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" }),
18
+ React.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" }),
19
+ React.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" })));
20
+ //# sourceMappingURL=DeleteIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeleteIcon.js","sourceRoot":"","sources":["../../../../../../../src/components/projects/lean-workflow/icons/DeleteIcon.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,CAAC,MAAM,UAAU,GAAa,GAAG,EAAE,CAAC,CACxC,6BACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B;IAElC,8BACE,SAAS,EAAC,cAAc,EACxB,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,8UAA8U,EAChV,IAAI,EAAC,SAAS,GACd;IACF,8BACE,SAAS,EAAC,cAAc,EACxB,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,6PAA6P,EAC/P,IAAI,EAAC,SAAS,GACd;IACF,8BACE,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,8BACE,SAAS,EAAC,cAAc,EACxB,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,8HAA8H,EAChI,IAAI,EAAC,SAAS,GACd;IACF,8BACE,SAAS,EAAC,cAAc,EACxB,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,8HAA8H,EAChI,IAAI,EAAC,SAAS,GACd;IACF,8BACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,mIAAmI,EACrI,IAAI,EAAC,OAAO,GACZ,CACE,CACP,CAAA"}
@@ -0,0 +1,22 @@
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) 2022 Atypon Systems LLC. All Rights Reserved.
11
+ */
12
+ import React from 'react';
13
+ import styled from 'styled-components';
14
+ export const GroupIcon = ({ numberOfCitations, }) => (React.createElement(BadgeIcon, { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
15
+ React.createElement("rect", { width: "12", height: "12", rx: "6", fill: (numberOfCitations > 0 && '#BCE7F6') || '#FE8F1F' }),
16
+ React.createElement("text", { x: "6", y: "8", fill: "#FFF", fontSize: "9px", textAnchor: "middle", fontWeight: "400" }, numberOfCitations)));
17
+ const BadgeIcon = styled.svg `
18
+ top: -4px;
19
+ right: 16px;
20
+ position: absolute;
21
+ `;
22
+ //# sourceMappingURL=GroupIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GroupIcon.js","sourceRoot":"","sources":["../../../../../../../src/components/projects/lean-workflow/icons/GroupIcon.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,MAAM,CAAC,MAAM,SAAS,GAA4C,CAAC,EACjE,iBAAiB,GAClB,EAAE,EAAE,CAAC,CACJ,oBAAC,SAAS,IACR,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B;IAElC,8BACE,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,8BACE,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;AAED,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAI3B,CAAA"}
@@ -0,0 +1,16 @@
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) 2022 Atypon Systems LLC. All Rights Reserved.
11
+ */
12
+ import React from 'react';
13
+ export const LinkIcon = () => (React.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
14
+ React.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" }),
15
+ React.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" })));
16
+ //# sourceMappingURL=LinkIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinkIcon.js","sourceRoot":"","sources":["../../../../../../../src/components/projects/lean-workflow/icons/LinkIcon.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,CAAC,MAAM,QAAQ,GAAa,GAAG,EAAE,CAAC,CACtC,6BACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B;IAElC,8BACE,CAAC,EAAC,ojBAAojB,EACtjB,IAAI,EAAC,SAAS,GACd;IACF,8BACE,CAAC,EAAC,wjBAAwjB,EAC1jB,IAAI,EAAC,SAAS,GACd,CACE,CACP,CAAA"}
@@ -0,0 +1,16 @@
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) 2022 Atypon Systems LLC. All Rights Reserved.
11
+ */
12
+ import React from 'react';
13
+ export const TemplateIcon = () => (React.createElement("svg", { width: "16", height: "18", viewBox: "0 0 16 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
14
+ React.createElement("rect", { x: "1.25", y: "1.25", width: "13.5", height: "15.5", rx: "1.75", fill: "white", stroke: "#6E6E6E", strokeWidth: "1.5" }),
15
+ React.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" })));
16
+ //# sourceMappingURL=TemplateIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TemplateIcon.js","sourceRoot":"","sources":["../../../../../../../src/components/projects/lean-workflow/icons/TemplateIcon.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,CAAC,MAAM,YAAY,GAAa,GAAG,EAAE,CAAC,CAC1C,6BACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B;IAElC,8BACE,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,8BACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,ySAAyS,EAC3S,IAAI,EAAC,SAAS,GACd,CACE,CACP,CAAA"}
@@ -0,0 +1,11 @@
1
+ import React, { createContext } from 'react';
2
+ // @ts-ignore
3
+ export const UserContext = createContext({});
4
+ export const UserProvider = ({ lwUser, manuscriptUser, submissionId, children, }) => {
5
+ return (React.createElement(UserContext.Provider, { value: {
6
+ lwUser,
7
+ manuscriptUser,
8
+ submissionId,
9
+ } }, children));
10
+ };
11
+ //# sourceMappingURL=UserProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserProvider.js","sourceRoot":"","sources":["../../../../../../../src/components/projects/lean-workflow/provider/UserProvider.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAU5C,aAAa;AACb,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAgB,EAAE,CAAC,CAAA;AAE3D,MAAM,CAAC,MAAM,YAAY,GAA4B,CAAC,EACpD,MAAM,EACN,cAAc,EACd,YAAY,EACZ,QAAQ,GACT,EAAE,EAAE;IACH,OAAO,CACL,oBAAC,WAAW,CAAC,QAAQ,IACnB,KAAK,EAAE;YACL,MAAM;YACN,cAAc;YACd,YAAY;SACb,IAEA,QAAQ,CACY,CACxB,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,51 @@
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 styled from 'styled-components';
14
+ import { useDropdown } from '../../hooks/use-dropdown';
15
+ import { ArrowDownIcon, ArrowUpIcon, ValidationDangerIcon, ValidationPassedIcon, } from './RequirementsIcons';
16
+ export const RequirementContainer = ({ title, result, children, }) => {
17
+ const failedResults = result.filter((node) => !node.passed && !node.ignored);
18
+ const { toggleOpen, isOpen } = useDropdown(failedResults.length !== 0);
19
+ return (React.createElement(Container, null,
20
+ React.createElement(Data, { onClick: toggleOpen },
21
+ React.createElement(Icon, null, failedResults.length === 0 ? (React.createElement(ValidationPassedIcon, null)) : (React.createElement(ValidationDangerIcon, null))),
22
+ React.createElement(Title, null, title),
23
+ React.createElement(ExpanderButton, null, isOpen ? React.createElement(ArrowUpIcon, null) : React.createElement(ArrowDownIcon, null))),
24
+ isOpen && React.createElement(React.Fragment, null, children)));
25
+ };
26
+ const ExpanderButton = styled.div `
27
+ cursor: pointer;
28
+ `;
29
+ const Container = styled.div `
30
+ padding: 0 0 16px 0;
31
+ border-bottom: 1px solid #f2f2f2;
32
+ margin: 24px 28px 0;
33
+ `;
34
+ const Title = styled.div `
35
+ font-family: Lato;
36
+ font-style: normal;
37
+ font-weight: bold;
38
+ font-size: 16px;
39
+ line-height: 24px;
40
+ flex: 0.96;
41
+ cursor: pointer;
42
+ `;
43
+ const Icon = styled.div `
44
+ display: inline-flex;
45
+ padding: 3px 11px 0 0;
46
+ `;
47
+ const Data = styled.div `
48
+ display: flex;
49
+ padding: 20px 0 0 21px;
50
+ `;
51
+ //# sourceMappingURL=RequirementContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RequirementContainer.js","sourceRoot":"","sources":["../../../../../src/components/requirements/RequirementContainer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EACL,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,qBAAqB,CAAA;AAO5B,MAAM,CAAC,MAAM,oBAAoB,GAAoB,CAAC,EACpD,KAAK,EACL,MAAM,EACN,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CACjC,CAAC,IAAyB,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAC7D,CAAA;IACD,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC,aAAa,CAAC,MAAM,KAAK,CAAC,CAAC,CAAA;IAEtE,OAAO,CACL,oBAAC,SAAS;QACR,oBAAC,IAAI,IAAC,OAAO,EAAE,UAAU;YACvB,oBAAC,IAAI,QACF,aAAa,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAC5B,oBAAC,oBAAoB,OAAG,CACzB,CAAC,CAAC,CAAC,CACF,oBAAC,oBAAoB,OAAG,CACzB,CACI;YACP,oBAAC,KAAK,QAAE,KAAK,CAAS;YACtB,oBAAC,cAAc,QACZ,MAAM,CAAC,CAAC,CAAC,oBAAC,WAAW,OAAG,CAAC,CAAC,CAAC,oBAAC,aAAa,OAAG,CAC9B,CACZ;QACN,MAAM,IAAI,0CAAG,QAAQ,CAAI,CAChB,CACb,CAAA;AACH,CAAC,CAAA;AAED,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA;;CAEhC,CAAA;AACD,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAI3B,CAAA;AACD,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;CAQvB,CAAA;AACD,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAGtB,CAAA;AACD,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAGtB,CAAA"}
@@ -0,0 +1,99 @@
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 { runManuscriptFixes, } from '@manuscripts/requirements';
14
+ import { isEqual } from 'lodash-es';
15
+ import React, { useCallback, useState } from 'react';
16
+ import styled from 'styled-components';
17
+ const getDiff = (modelMap, containedModelArray) => {
18
+ const result = new Array();
19
+ containedModelArray.forEach((value) => {
20
+ if (!modelMap.get(value._id)) {
21
+ // Determine added objects
22
+ result.push(value);
23
+ }
24
+ else {
25
+ // Determine updated objects
26
+ if (!isEqual(modelMap.get(value._id), value)) {
27
+ result.push(value);
28
+ }
29
+ }
30
+ });
31
+ return result;
32
+ };
33
+ export const RequirementsData = ({ node, modelMap, manuscriptID, bulkUpdate }) => {
34
+ const [isShown, setIsShown] = useState(false);
35
+ const fixItHandler = useCallback(async () => {
36
+ const manuscriptData = new Array();
37
+ modelMap.forEach((value) => {
38
+ manuscriptData.push({
39
+ ...value,
40
+ });
41
+ });
42
+ const result = runManuscriptFixes(manuscriptData, manuscriptID, [node]);
43
+ const changedItems = getDiff(modelMap, result);
44
+ await bulkUpdate(changedItems);
45
+ }, [modelMap, bulkUpdate, manuscriptID, node]);
46
+ const ignoreItHandler = useCallback(async () => {
47
+ modelMap.forEach((model) => {
48
+ if (model.objectType === ObjectTypes.RequirementsValidation) {
49
+ const validationModel = model;
50
+ validationModel.results.forEach((value) => {
51
+ if (value._id === node._id) {
52
+ value.ignored = true;
53
+ }
54
+ });
55
+ modelMap.set(validationModel._id, validationModel);
56
+ }
57
+ });
58
+ }, [modelMap, node]);
59
+ return (React.createElement(InspectorContainer, null,
60
+ React.createElement(MessageContainer, { onMouseEnter: () => setIsShown(true), onMouseLeave: () => setIsShown(false) },
61
+ React.createElement(Message, null,
62
+ " ",
63
+ node.message,
64
+ " "),
65
+ isShown && !node.passed && node.fixable && (React.createElement(ButtonsList, null,
66
+ React.createElement(Button, { onClick: fixItHandler }, " Fix it"),
67
+ !node.ignored && (React.createElement(Button, { onClick: ignoreItHandler }, " Ignore")))))));
68
+ };
69
+ const InspectorContainer = styled.div `
70
+ display: flex;
71
+ height: 52px;
72
+ `;
73
+ const MessageContainer = styled.div `
74
+ font-family: Lato;
75
+ font-size: 14px;
76
+ color: #353535;
77
+ padding: 4px 0 0 58px;
78
+ `;
79
+ const Message = styled.div `
80
+ display: inline;
81
+ cursor: default;
82
+ `;
83
+ const Button = styled.button `
84
+ font-family: Lato;
85
+ font-size: 14px;
86
+ text-decoration-line: underline;
87
+ color: #0d79d0;
88
+ padding: 0 0 0 9px;
89
+ cursor: pointer;
90
+ background: #fff;
91
+ border: none;
92
+ outline: none;
93
+ `;
94
+ const ButtonsList = styled.div `
95
+ float: right;
96
+ padding: 22px 0 0 0;
97
+ cursor: pointer;
98
+ `;
99
+ //# sourceMappingURL=RequirementsData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RequirementsData.js","sourceRoot":"","sources":["../../../../../src/components/requirements/RequirementsData.tsx"],"names":[],"mappings":"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"}
@@ -0,0 +1,24 @@
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 React from 'react';
13
+ export const ArrowDownIcon = () => (React.createElement("svg", { width: "19", height: "19", viewBox: "0 0 19 19", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
14
+ React.createElement("path", { d: "M18.5 9.5C18.5 14.4706 14.4706 18.5 9.5 18.5C4.52944 18.5 0.5 14.4706 0.5 9.5C0.5 4.52944 4.52944 0.5 9.5 0.5C14.4706 0.5 18.5 4.52944 18.5 9.5Z", stroke: "#E2E2E2" }),
15
+ React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.3437 8.231C12.7604 7.88994 13.3921 7.93134 13.7545 8.32348C14.117 8.71562 14.073 9.31 13.6562 9.65106L9.56451 13L5.35969 9.70134C4.93548 9.36855 4.87828 8.77516 5.23193 8.37598C5.58557 7.97679 6.21615 7.92296 6.64035 8.25575L9.53703 10.5282L12.3437 8.231Z", fill: "#6E6E6E" })));
16
+ export const ArrowUpIcon = () => (React.createElement("svg", { width: "19", height: "19", viewBox: "0 0 19 19", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
17
+ React.createElement("path", { d: "M18.5 9.5C18.5 14.4706 14.4706 18.5 9.5 18.5C4.52944 18.5 0.5 14.4706 0.5 9.5C0.5 4.52944 4.52944 0.5 9.5 0.5C14.4706 0.5 18.5 4.52944 18.5 9.5Z", stroke: "#E2E2E2" }),
18
+ React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.65627 11.769C6.23955 12.1101 5.60792 12.0687 5.24548 11.6765C4.88304 11.2844 4.92704 10.69 5.34375 10.3489L9.43549 7L13.6403 10.2987C14.0645 10.6315 14.1217 11.2248 13.7681 11.624C13.4144 12.0232 12.7839 12.077 12.3596 11.7443L9.46297 9.47182L6.65627 11.769Z", fill: "#6E6E6E" })));
19
+ export const ValidationDangerIcon = () => (React.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
20
+ React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8 1C11.866 1 15 4.134 15 8C15 11.866 11.866 15 8 15C4.134 15 1 11.866 1 8C1 4.134 4.13333 1 8 1ZM8 0C12.418 0 16 3.582 16 8C16 12.418 12.418 16 8 16C3.582 16 0 12.418 0 8C0 3.582 3.58133 0 8 0ZM8 10.8C7.82319 10.8 7.65362 10.8702 7.5286 10.9953C7.40357 11.1203 7.33333 11.2899 7.33333 11.4667C7.33333 11.6435 7.40357 11.813 7.5286 11.9381C7.65362 12.0631 7.82319 12.1333 8 12.1333C8.17681 12.1333 8.34638 12.0631 8.47141 11.9381C8.59643 11.813 8.66667 11.6435 8.66667 11.4667C8.66667 11.2899 8.59643 11.1203 8.47141 10.9953C8.34638 10.8702 8.17681 10.8 8 10.8ZM8.01333 4C7.8542 4 7.70159 4.06321 7.58907 4.17574C7.47655 4.28826 7.41333 4.44087 7.41333 4.6V9.4C7.41333 9.55913 7.47655 9.71174 7.58907 9.82426C7.70159 9.93679 7.8542 10 8.01333 10C8.17246 10 8.32508 9.93679 8.4376 9.82426C8.55012 9.71174 8.61333 9.55913 8.61333 9.4V4.6C8.61333 4.44087 8.55012 4.28826 8.4376 4.17574C8.32508 4.06321 8.17246 4 8.01333 4Z", fill: "#F35143" })));
21
+ export const ValidationPassedIcon = () => (React.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
22
+ React.createElement("path", { d: "M7.99984 0C3.58852 0 0 3.5888 0 8C0 12.4112 3.58852 16 7.99984 16C12.4112 16 16 12.4112 16 8C16 3.5888 12.4112 0 7.99984 0ZM7.99984 14.9508C4.1672 14.9508 1.0492 11.8326 1.0492 8C1.0492 4.16732 4.16716 1.04924 7.99984 1.04924C11.8325 1.04924 14.9507 4.16736 14.9507 8C14.9507 11.8326 11.8325 14.9508 7.99984 14.9508Z", fill: "#36B260" }),
23
+ React.createElement("path", { d: "M10.8962 5.38104L6.771 9.50608L5.10344 7.83888C4.89852 7.6342 4.56656 7.63408 4.36164 7.839C4.15664 8.044 4.15664 8.376 4.36164 8.58092L6.40016 10.6191C6.5026 10.7214 6.6368 10.7726 6.771 10.7726C6.9052 10.7726 7.03976 10.7214 7.14216 10.619L7.14324 10.6176L11.638 6.12284C11.843 5.91804 11.843 5.5858 11.638 5.381C11.4331 5.17608 11.1009 5.17608 10.8962 5.38104Z", fill: "#36B260" })));
24
+ //# sourceMappingURL=RequirementsIcons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RequirementsIcons.js","sourceRoot":"","sources":["../../../../../src/components/requirements/RequirementsIcons.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,CACjC,6BACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B;IAElC,8BACE,CAAC,EAAC,kJAAkJ,EACpJ,MAAM,EAAC,SAAS,GAChB;IACF,8BACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,qQAAqQ,EACvQ,IAAI,EAAC,SAAS,GACd,CACE,CACP,CAAA;AACD,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,CAC/B,6BACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B;IAElC,8BACE,CAAC,EAAC,kJAAkJ,EACpJ,MAAM,EAAC,SAAS,GAChB;IACF,8BACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,uQAAuQ,EACzQ,IAAI,EAAC,SAAS,GACd,CACE,CACP,CAAA;AACD,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE,CAAC,CACxC,6BACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B;IAElC,8BACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,y5BAAy5B,EAC35B,IAAI,EAAC,SAAS,GACd,CACE,CACP,CAAA;AACD,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE,CAAC,CACxC,6BACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B;IAElC,8BACE,CAAC,EAAC,8TAA8T,EAChU,IAAI,EAAC,SAAS,GACd;IACF,8BACE,CAAC,EAAC,6WAA6W,EAC/W,IAAI,EAAC,SAAS,GACd,CACE,CACP,CAAA"}
@@ -0,0 +1,118 @@
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 { createTemplateValidator, } from '@manuscripts/requirements';
13
+ import { isFigure } from '@manuscripts/transform';
14
+ import toBuffer from 'blob-to-buffer';
15
+ import React, { useEffect, useState } from 'react';
16
+ import styled from 'styled-components';
17
+ import { useStore } from '../../store';
18
+ import { DataLoadingPlaceholder } from '../Placeholders';
19
+ import { RequirementsList } from './RequirementsList';
20
+ export const buildQualityCheck = async (modelMap, prototypeId, manuscriptID, template, sectionCategories, validationOptions) => {
21
+ if (typeof prototypeId === 'undefined') {
22
+ return [];
23
+ }
24
+ const getData = async (id) => {
25
+ if (modelMap.has(id)) {
26
+ const model = modelMap.get(id);
27
+ if (isFigure(model)) {
28
+ const modelSrc = model.src;
29
+ const blobData = await fetch(modelSrc).then((res) => res.blob());
30
+ const blobFile = new File([blobData], id, {
31
+ type: blobData.type,
32
+ });
33
+ return fileToBuffer(blobFile);
34
+ }
35
+ }
36
+ return undefined;
37
+ };
38
+ const fileToBuffer = (file) => new Promise((resolve, reject) => {
39
+ toBuffer(file, (err, buffer) => {
40
+ if (err) {
41
+ reject(err);
42
+ }
43
+ else {
44
+ resolve(buffer);
45
+ }
46
+ });
47
+ });
48
+ const validateManuscript = createTemplateValidator(template, sectionCategories);
49
+ // TODO: remove `as AnyValidationResult[]`
50
+ const results = (await validateManuscript(Array.from(modelMap.values()), manuscriptID, getData, validationOptions));
51
+ return results;
52
+ };
53
+ export const RequirementsInspector = () => {
54
+ const [{ modelMap, manuscript, manuscriptID, sectionCategories, template }] = useStore((store) => ({
55
+ modelMap: store.modelMap,
56
+ manuscript: store.manuscript,
57
+ manuscriptID: store.manuscriptID,
58
+ sectionCategories: store.sectionCategories,
59
+ template: store.template,
60
+ }));
61
+ const prototypeId = manuscript.prototype;
62
+ const [result, setResult] = useState([]);
63
+ const [error, setError] = useState();
64
+ const [isBuilding, setIsBuilding] = useState(false);
65
+ useEffect(() => {
66
+ setIsBuilding(true);
67
+ buildQualityCheck(modelMap, prototypeId, manuscriptID, template, sectionCategories)
68
+ .then(setResult)
69
+ .finally(() => {
70
+ setIsBuilding(false);
71
+ })
72
+ .catch(setError);
73
+ // eslint-disable-next-line react-hooks/exhaustive-deps
74
+ }, [prototypeId, manuscriptID, JSON.stringify([...modelMap.values()])]);
75
+ return (React.createElement(RequirementsInspectorView, { prototypeId: prototypeId, result: result, error: error, isBuilding: isBuilding }));
76
+ };
77
+ export const RequirementsInspectorView = ({ error, result, isBuilding }) => {
78
+ const [prototypeId, dispatch] = useStore((store) => store.manuscript?.prototype);
79
+ useEffect(() => {
80
+ if (error) {
81
+ dispatch({ requirementError: 'QR_SERVICE_UNAVAILABLE' });
82
+ }
83
+ if (!prototypeId) {
84
+ dispatch({ requirementError: 'QR_PROFILE_NOT_FOUND' });
85
+ }
86
+ dispatch({ requirementError: '' });
87
+ }, [error, prototypeId, dispatch]);
88
+ useEffect(() => {
89
+ if (!prototypeId) {
90
+ dispatch({ requirementError: 'QR_PROFILE_NOT_FOUND' });
91
+ }
92
+ else {
93
+ dispatch({ requirementError: '' });
94
+ }
95
+ }, [prototypeId, dispatch]);
96
+ if (isBuilding) {
97
+ return React.createElement(DataLoadingPlaceholder, null);
98
+ }
99
+ if (error) {
100
+ return React.createElement(ErrorMessage, null,
101
+ " ",
102
+ error?.message);
103
+ }
104
+ if (!prototypeId) {
105
+ return (React.createElement(AlertMessage, null, "You need to select a template to display the quality report check"));
106
+ }
107
+ if (!result) {
108
+ return null;
109
+ }
110
+ return React.createElement(RequirementsList, { validationResult: result });
111
+ };
112
+ const AlertMessage = styled.div `
113
+ margin: 13px 0 9px 17px;
114
+ `;
115
+ const ErrorMessage = styled.div `
116
+ margin: 13px 0 9px 17px;
117
+ `;
118
+ //# sourceMappingURL=RequirementsInspector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RequirementsInspector.js","sourceRoot":"","sources":["../../../../../src/components/requirements/RequirementsInspector.tsx"],"names":[],"mappings":"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"}
@@ -0,0 +1,54 @@
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 React, { useMemo } from 'react';
13
+ import styled from 'styled-components';
14
+ import { useStore } from '../../store';
15
+ import { RequirementContainer } from './RequirementContainer';
16
+ import { RequirementsData } from './RequirementsData';
17
+ import { SectionValidations } from './SectionValidations';
18
+ export const RequirementsList = ({ validationResult }) => {
19
+ const [{ modelMap, manuscriptID, bulkUpdate }] = useStore((store) => ({
20
+ modelMap: store.modelMap,
21
+ manuscriptID: store.manuscriptID,
22
+ bulkUpdate: store.bulkUpdate,
23
+ }));
24
+ const sortedData = useMemo(() => [...validationResult].sort((a, b) => a.passed === b.passed ? 0 : a ? -1 : 1), [validationResult]);
25
+ const ignoredValidations = sortedData.filter((node) => node.ignored);
26
+ const validationsList = sortedData.filter((node) => !node.ignored);
27
+ const manuscriptValidation = validationsList.filter((node) => node.type && node.type.startsWith('manuscript-'));
28
+ const bibliographyValidation = validationsList.filter((node) => node.type && node.type.startsWith('bibliography-'));
29
+ const figureValidation = validationsList.filter((node) => node.type && node.type.startsWith('figure-'));
30
+ const requiredSectionValidation = validationsList.filter((node) => node.type === 'required-section');
31
+ const sectionOrderValidation = validationsList.filter((node) => node.type === 'section-order');
32
+ const sectionValidation = validationsList.filter((node) => node.type && node.type.startsWith('section-'));
33
+ return (React.createElement(RequirementList, null,
34
+ manuscriptValidation.length !== 0 && (React.createElement(RequirementContainer, { result: manuscriptValidation, title: 'Manuscript' },
35
+ React.createElement(Requirement, null, manuscriptValidation.map((section) => section.message && (React.createElement(RequirementsData, { node: section, key: section._id, modelMap: modelMap, manuscriptID: manuscriptID, bulkUpdate: bulkUpdate })))))),
36
+ React.createElement(SectionValidations, { sortedData: sectionValidation, modelMap: modelMap, manuscriptID: manuscriptID, bulkUpdate: bulkUpdate }),
37
+ requiredSectionValidation.length !== 0 && (React.createElement(RequirementContainer, { result: requiredSectionValidation, title: 'Required Section' },
38
+ React.createElement(Requirement, null, requiredSectionValidation.map((section) => section.message && (React.createElement(RequirementsData, { node: section, key: section._id, modelMap: modelMap, manuscriptID: manuscriptID, bulkUpdate: bulkUpdate })))))),
39
+ bibliographyValidation.length !== 0 && (React.createElement(RequirementContainer, { result: bibliographyValidation, title: 'Bibliography' },
40
+ React.createElement(Requirement, null, bibliographyValidation.map((section) => section.message && (React.createElement(RequirementsData, { node: section, key: section._id, modelMap: modelMap, manuscriptID: manuscriptID, bulkUpdate: bulkUpdate })))))),
41
+ figureValidation.length !== 0 && (React.createElement(RequirementContainer, { result: figureValidation, title: 'Figure' },
42
+ React.createElement(Requirement, null, figureValidation.map((section) => section.message && (React.createElement(RequirementsData, { node: section, key: section._id, modelMap: modelMap, manuscriptID: manuscriptID, bulkUpdate: bulkUpdate })))))),
43
+ sectionOrderValidation.length !== 0 && (React.createElement(RequirementContainer, { result: sectionOrderValidation, title: 'Section Order' },
44
+ React.createElement(Requirement, null, sectionOrderValidation.map((section) => section.message && (React.createElement(RequirementsData, { node: section, key: section._id, modelMap: modelMap, manuscriptID: manuscriptID, bulkUpdate: bulkUpdate })))))),
45
+ ignoredValidations.length !== 0 && (React.createElement(RequirementContainer, { result: ignoredValidations, title: 'Ignored' },
46
+ React.createElement(Requirement, null, ignoredValidations.map((section) => section.message && (React.createElement(RequirementsData, { node: section, key: section._id, modelMap: modelMap, manuscriptID: manuscriptID, bulkUpdate: bulkUpdate }))))))));
47
+ };
48
+ const RequirementList = styled.div `
49
+ display: block;
50
+ `;
51
+ const Requirement = styled.div `
52
+ padding: 15px 0 0 0;
53
+ `;
54
+ //# sourceMappingURL=RequirementsList.js.map