@manuscripts/article-editor 1.4.11 → 1.4.12

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 (190) hide show
  1. package/dist/cjs/src/EditorApp.js +3 -3
  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/metadata/Metadata.js +0 -4
  8. package/dist/cjs/src/components/metadata/Metadata.js.map +1 -1
  9. package/dist/cjs/src/components/projects/ApplicationMenus.js +0 -5
  10. package/dist/cjs/src/components/projects/ApplicationMenus.js.map +1 -1
  11. package/dist/cjs/src/components/projects/ContentTab.js +3 -4
  12. package/dist/cjs/src/components/projects/ContentTab.js.map +1 -1
  13. package/dist/cjs/src/components/projects/EditorElement.js +18 -21
  14. package/dist/cjs/src/components/projects/EditorElement.js.map +1 -1
  15. package/dist/cjs/src/components/projects/Inspector.js +10 -10
  16. package/dist/cjs/src/components/projects/Inspector.js.map +1 -1
  17. package/dist/cjs/src/components/projects/ManuscriptPageContainer.js +2 -2
  18. package/dist/cjs/src/components/projects/ManuscriptPageContainer.js.map +1 -1
  19. package/dist/cjs/src/hooks/use-create-editor.js +24 -45
  20. package/dist/cjs/src/hooks/use-create-editor.js.map +1 -1
  21. package/dist/cjs/src/hooks/use-tracked-model-management.js +3 -5
  22. package/dist/cjs/src/hooks/use-tracked-model-management.js.map +1 -1
  23. package/dist/cjs/src/index.js +2 -2
  24. package/dist/cjs/src/index.js.map +1 -1
  25. package/dist/cjs/src/postgres-data/PsSource.js +3 -3
  26. package/dist/cjs/src/postgres-data/PsSource.js.map +1 -1
  27. package/dist/cjs/src/postgres-data/buildData.js +2 -10
  28. package/dist/cjs/src/postgres-data/buildData.js.map +1 -1
  29. package/dist/cjs/src/store/DataSourceStrategy.js +2 -2
  30. package/dist/cjs/src/store/DataSourceStrategy.js.map +1 -1
  31. package/dist/cjs/src/store/Store.js.map +1 -1
  32. package/dist/cjs/stories/Full.stories.js +14 -6
  33. package/dist/cjs/stories/Full.stories.js.map +1 -1
  34. package/dist/es/src/EditorApp.js +3 -3
  35. package/dist/es/src/EditorApp.js.map +1 -1
  36. package/dist/es/src/Main.js +2 -2
  37. package/dist/es/src/Main.js.map +1 -1
  38. package/dist/es/src/components/library/BibliographyImportButton.js +5 -1
  39. package/dist/es/src/components/library/BibliographyImportButton.js.map +1 -1
  40. package/dist/es/src/components/metadata/Metadata.js +0 -4
  41. package/dist/es/src/components/metadata/Metadata.js.map +1 -1
  42. package/dist/es/src/components/projects/ApplicationMenus.js +0 -5
  43. package/dist/es/src/components/projects/ApplicationMenus.js.map +1 -1
  44. package/dist/es/src/components/projects/ContentTab.js +3 -4
  45. package/dist/es/src/components/projects/ContentTab.js.map +1 -1
  46. package/dist/es/src/components/projects/EditorElement.js +19 -22
  47. package/dist/es/src/components/projects/EditorElement.js.map +1 -1
  48. package/dist/es/src/components/projects/Inspector.js +11 -11
  49. package/dist/es/src/components/projects/Inspector.js.map +1 -1
  50. package/dist/es/src/components/projects/ManuscriptPageContainer.js +2 -2
  51. package/dist/es/src/components/projects/ManuscriptPageContainer.js.map +1 -1
  52. package/dist/es/src/hooks/use-create-editor.js +24 -45
  53. package/dist/es/src/hooks/use-create-editor.js.map +1 -1
  54. package/dist/es/src/hooks/use-tracked-model-management.js +3 -5
  55. package/dist/es/src/hooks/use-tracked-model-management.js.map +1 -1
  56. package/dist/es/src/index.js +2 -2
  57. package/dist/es/src/index.js.map +1 -1
  58. package/dist/es/src/postgres-data/PsSource.js +3 -3
  59. package/dist/es/src/postgres-data/PsSource.js.map +1 -1
  60. package/dist/es/src/postgres-data/buildData.js +2 -10
  61. package/dist/es/src/postgres-data/buildData.js.map +1 -1
  62. package/dist/es/src/store/DataSourceStrategy.js +2 -2
  63. package/dist/es/src/store/DataSourceStrategy.js.map +1 -1
  64. package/dist/es/src/store/Store.js.map +1 -1
  65. package/dist/es/stories/Full.stories.js +14 -6
  66. package/dist/es/stories/Full.stories.js.map +1 -1
  67. package/dist/types/src/EditorApp.d.ts +2 -1
  68. package/dist/types/src/Main.d.ts +2 -1
  69. package/dist/types/src/hooks/use-tracked-model-management.d.ts +1 -2
  70. package/dist/types/src/index.d.ts +2 -1
  71. package/dist/types/src/postgres-data/PsSource.d.ts +2 -2
  72. package/dist/types/src/postgres-data/buildData.d.ts +1 -2
  73. package/dist/types/src/store/DataSourceStrategy.d.ts +1 -1
  74. package/dist/types/src/store/Store.d.ts +29 -52
  75. package/package.json +3 -3
  76. package/dist/cjs/src/components/library/CitationProperties.js +0 -67
  77. package/dist/cjs/src/components/library/CitationProperties.js.map +0 -1
  78. package/dist/cjs/src/components/library/ExternalSearch.js +0 -156
  79. package/dist/cjs/src/components/library/ExternalSearch.js.map +0 -1
  80. package/dist/cjs/src/components/library/GlobalLibrary.js +0 -133
  81. package/dist/cjs/src/components/library/GlobalLibrary.js.map +0 -1
  82. package/dist/cjs/src/components/library/LibraryCollectionCategories.js +0 -53
  83. package/dist/cjs/src/components/library/LibraryCollectionCategories.js.map +0 -1
  84. package/dist/cjs/src/components/library/LibraryForm.js +0 -437
  85. package/dist/cjs/src/components/library/LibraryForm.js.map +0 -1
  86. package/dist/cjs/src/components/library/LibraryItems.js +0 -116
  87. package/dist/cjs/src/components/library/LibraryItems.js.map +0 -1
  88. package/dist/cjs/src/components/library/LibraryPageContainer.js +0 -107
  89. package/dist/cjs/src/components/library/LibraryPageContainer.js.map +0 -1
  90. package/dist/cjs/src/components/library/LibrarySidebar.js +0 -172
  91. package/dist/cjs/src/components/library/LibrarySidebar.js.map +0 -1
  92. package/dist/cjs/src/components/library/Messages.js +0 -25
  93. package/dist/cjs/src/components/library/Messages.js.map +0 -1
  94. package/dist/cjs/src/components/library/ProjectLibrary.js +0 -96
  95. package/dist/cjs/src/components/library/ProjectLibrary.js.map +0 -1
  96. package/dist/cjs/src/components/metadata/HeaderFigure.js +0 -147
  97. package/dist/cjs/src/components/metadata/HeaderFigure.js.map +0 -1
  98. package/dist/cjs/src/lib/replace-attachments-ids.js +0 -49
  99. package/dist/cjs/src/lib/replace-attachments-ids.js.map +0 -1
  100. package/dist/cjs/stories/LibrarySidebar.stories.js +0 -188
  101. package/dist/cjs/stories/LibrarySidebar.stories.js.map +0 -1
  102. package/dist/cjs/stories/Metadata.stories.js +0 -53
  103. package/dist/cjs/stories/Metadata.stories.js.map +0 -1
  104. package/dist/cjs/stories/Notification.stories.js +0 -62
  105. package/dist/cjs/stories/Notification.stories.js.map +0 -1
  106. package/dist/cjs/stories/Page.stories.js +0 -50
  107. package/dist/cjs/stories/Page.stories.js.map +0 -1
  108. package/dist/cjs/stories/Panel.stories.js +0 -62
  109. package/dist/cjs/stories/Panel.stories.js.map +0 -1
  110. package/dist/cjs/stories/Placeholders.stories.js +0 -23
  111. package/dist/cjs/stories/Placeholders.stories.js.map +0 -1
  112. package/dist/cjs/stories/PopperButtons.stories.js +0 -27
  113. package/dist/cjs/stories/PopperButtons.stories.js.map +0 -1
  114. package/dist/cjs/stories/Progress.stories.js +0 -25
  115. package/dist/cjs/stories/Progress.stories.js.map +0 -1
  116. package/dist/cjs/stories/ProgressIndicator.stories.js +0 -33
  117. package/dist/cjs/stories/ProgressIndicator.stories.js.map +0 -1
  118. package/dist/cjs/stories/ReloadDialog.stories.js +0 -21
  119. package/dist/cjs/stories/ReloadDialog.stories.js.map +0 -1
  120. package/dist/cjs/stories/SelectField.stories.js +0 -34
  121. package/dist/cjs/stories/SelectField.stories.js.map +0 -1
  122. package/dist/es/src/components/library/CitationProperties.js +0 -60
  123. package/dist/es/src/components/library/CitationProperties.js.map +0 -1
  124. package/dist/es/src/components/library/ExternalSearch.js +0 -127
  125. package/dist/es/src/components/library/ExternalSearch.js.map +0 -1
  126. package/dist/es/src/components/library/GlobalLibrary.js +0 -104
  127. package/dist/es/src/components/library/GlobalLibrary.js.map +0 -1
  128. package/dist/es/src/components/library/LibraryCollectionCategories.js +0 -45
  129. package/dist/es/src/components/library/LibraryCollectionCategories.js.map +0 -1
  130. package/dist/es/src/components/library/LibraryForm.js +0 -409
  131. package/dist/es/src/components/library/LibraryForm.js.map +0 -1
  132. package/dist/es/src/components/library/LibraryItems.js +0 -86
  133. package/dist/es/src/components/library/LibraryItems.js.map +0 -1
  134. package/dist/es/src/components/library/LibraryPageContainer.js +0 -80
  135. package/dist/es/src/components/library/LibraryPageContainer.js.map +0 -1
  136. package/dist/es/src/components/library/LibrarySidebar.js +0 -165
  137. package/dist/es/src/components/library/LibrarySidebar.js.map +0 -1
  138. package/dist/es/src/components/library/Messages.js +0 -18
  139. package/dist/es/src/components/library/Messages.js.map +0 -1
  140. package/dist/es/src/components/library/ProjectLibrary.js +0 -67
  141. package/dist/es/src/components/library/ProjectLibrary.js.map +0 -1
  142. package/dist/es/src/components/metadata/HeaderFigure.js +0 -117
  143. package/dist/es/src/components/metadata/HeaderFigure.js.map +0 -1
  144. package/dist/es/src/lib/replace-attachments-ids.js +0 -44
  145. package/dist/es/src/lib/replace-attachments-ids.js.map +0 -1
  146. package/dist/es/stories/LibrarySidebar.stories.js +0 -183
  147. package/dist/es/stories/LibrarySidebar.stories.js.map +0 -1
  148. package/dist/es/stories/Metadata.stories.js +0 -48
  149. package/dist/es/stories/Metadata.stories.js.map +0 -1
  150. package/dist/es/stories/Notification.stories.js +0 -57
  151. package/dist/es/stories/Notification.stories.js.map +0 -1
  152. package/dist/es/stories/Page.stories.js +0 -45
  153. package/dist/es/stories/Page.stories.js.map +0 -1
  154. package/dist/es/stories/Panel.stories.js +0 -57
  155. package/dist/es/stories/Panel.stories.js.map +0 -1
  156. package/dist/es/stories/Placeholders.stories.js +0 -18
  157. package/dist/es/stories/Placeholders.stories.js.map +0 -1
  158. package/dist/es/stories/PopperButtons.stories.js +0 -22
  159. package/dist/es/stories/PopperButtons.stories.js.map +0 -1
  160. package/dist/es/stories/Progress.stories.js +0 -20
  161. package/dist/es/stories/Progress.stories.js.map +0 -1
  162. package/dist/es/stories/ProgressIndicator.stories.js +0 -28
  163. package/dist/es/stories/ProgressIndicator.stories.js.map +0 -1
  164. package/dist/es/stories/ReloadDialog.stories.js +0 -16
  165. package/dist/es/stories/ReloadDialog.stories.js.map +0 -1
  166. package/dist/es/stories/SelectField.stories.js +0 -29
  167. package/dist/es/stories/SelectField.stories.js.map +0 -1
  168. package/dist/types/src/components/library/CitationProperties.d.ts +0 -17
  169. package/dist/types/src/components/library/ExternalSearch.d.ts +0 -19
  170. package/dist/types/src/components/library/GlobalLibrary.d.ts +0 -20
  171. package/dist/types/src/components/library/LibraryCollectionCategories.d.ts +0 -15
  172. package/dist/types/src/components/library/LibraryForm.d.ts +0 -20
  173. package/dist/types/src/components/library/LibraryItems.d.ts +0 -12
  174. package/dist/types/src/components/library/LibraryPageContainer.d.ts +0 -14
  175. package/dist/types/src/components/library/LibrarySidebar.d.ts +0 -21
  176. package/dist/types/src/components/library/Messages.d.ts +0 -15
  177. package/dist/types/src/components/library/ProjectLibrary.d.ts +0 -23
  178. package/dist/types/src/components/metadata/HeaderFigure.d.ts +0 -13
  179. package/dist/types/src/lib/replace-attachments-ids.d.ts +0 -15
  180. package/dist/types/stories/LibrarySidebar.stories.d.ts +0 -12
  181. package/dist/types/stories/Metadata.stories.d.ts +0 -12
  182. package/dist/types/stories/Notification.stories.d.ts +0 -12
  183. package/dist/types/stories/Page.stories.d.ts +0 -12
  184. package/dist/types/stories/Panel.stories.d.ts +0 -12
  185. package/dist/types/stories/Placeholders.stories.d.ts +0 -12
  186. package/dist/types/stories/PopperButtons.stories.d.ts +0 -12
  187. package/dist/types/stories/Progress.stories.d.ts +0 -12
  188. package/dist/types/stories/ProgressIndicator.stories.d.ts +0 -12
  189. package/dist/types/stories/ReloadDialog.stories.d.ts +0 -12
  190. package/dist/types/stories/SelectField.stories.d.ts +0 -12
@@ -1,45 +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 MyPublications from '@manuscripts/assets/react/MyPublications';
13
- import Paragraph from '@manuscripts/assets/react/Paragraph';
14
- import Star from '@manuscripts/assets/react/Star';
15
- import Target from '@manuscripts/assets/react/Target';
16
- import Time from '@manuscripts/assets/react/Time';
17
- import React from 'react';
18
- export const DEFAULT_LIBRARY_COLLECTION_CATEGORY = 'MPLibraryCollectionCategory:default';
19
- const icons = {
20
- 'MPLibraryCollectionCategory:default': React.createElement(Paragraph, { width: 18, height: 18 }),
21
- 'MPLibraryCollectionCategory:favourites': React.createElement(Star, { width: 18, height: 18 }),
22
- 'MPLibraryCollectionCategory:read-later': React.createElement(Time, { width: 18, height: 18 }),
23
- 'MPLibraryCollectionCategory:watch-list': React.createElement(Target, { width: 18, height: 18 }),
24
- 'MPLibraryCollectionCategory:my-publications': (React.createElement(MyPublications, { width: 18, height: 18 })),
25
- };
26
- export const sidebarIcon = (key) => key && key in icons
27
- ? icons[key]
28
- : icons[DEFAULT_LIBRARY_COLLECTION_CATEGORY];
29
- const priorities = {
30
- 'MPLibraryCollectionCategory:default': 5,
31
- 'MPLibraryCollectionCategory:my-publications': 4,
32
- 'MPLibraryCollectionCategory:favourites': 3,
33
- 'MPLibraryCollectionCategory:read-later': 2,
34
- 'MPLibraryCollectionCategory:watch-list': 1,
35
- };
36
- export const sortByCategoryPriority = (a, b) => {
37
- const priorityA = a.category && a.category in priorities
38
- ? priorities[a.category]
39
- : 0;
40
- const priorityB = b.category && b.category in priorities
41
- ? priorities[b.category]
42
- : 0;
43
- return priorityB - priorityA;
44
- };
45
- //# sourceMappingURL=LibraryCollectionCategories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LibraryCollectionCategories.js","sourceRoot":"","sources":["../../../../../src/components/library/LibraryCollectionCategories.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,cAAc,MAAM,0CAA0C,CAAA;AACrE,OAAO,SAAS,MAAM,qCAAqC,CAAA;AAC3D,OAAO,IAAI,MAAM,gCAAgC,CAAA;AACjD,OAAO,MAAM,MAAM,kCAAkC,CAAA;AACrD,OAAO,IAAI,MAAM,gCAAgC,CAAA;AAEjD,OAAO,KAAK,MAAM,OAAO,CAAA;AASzB,MAAM,CAAC,MAAM,mCAAmC,GAC9C,qCAAqC,CAAA;AAEvC,MAAM,KAAK,GAAwD;IACjE,qCAAqC,EAAE,oBAAC,SAAS,IAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,GAAI;IAC3E,wCAAwC,EAAE,oBAAC,IAAI,IAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,GAAI;IACzE,wCAAwC,EAAE,oBAAC,IAAI,IAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,GAAI;IACzE,wCAAwC,EAAE,oBAAC,MAAM,IAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,GAAI;IAC3E,6CAA6C,EAAE,CAC7C,oBAAC,cAAc,IAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,GAAI,CAC1C;CACF,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAY,EAAE,EAAE,CAC1C,GAAG,IAAI,GAAG,IAAI,KAAK;IACjB,CAAC,CAAC,KAAK,CAAC,GAAgC,CAAC;IACzC,CAAC,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAA;AAEhD,MAAM,UAAU,GAAmD;IACjE,qCAAqC,EAAE,CAAC;IACxC,6CAA6C,EAAE,CAAC;IAChD,wCAAwC,EAAE,CAAC;IAC3C,wCAAwC,EAAE,CAAC;IAC3C,wCAAwC,EAAE,CAAC;CAC5C,CAAA;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,CAAoB,EACpB,CAAoB,EACpB,EAAE;IACF,MAAM,SAAS,GACb,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,QAAQ,IAAI,UAAU;QACpC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAqC,CAAC;QACrD,CAAC,CAAC,CAAC,CAAA;IAEP,MAAM,SAAS,GACb,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,QAAQ,IAAI,UAAU;QACpC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAqC,CAAC;QACrD,CAAC,CAAC,CAAC,CAAA;IAEP,OAAO,SAAS,GAAG,SAAS,CAAA;AAC9B,CAAC,CAAA"}
@@ -1,409 +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 AddAuthor from '@manuscripts/assets/react/AddAuthor';
13
- import ArrowDownBlack from '@manuscripts/assets/react/ArrowDownBlack';
14
- import { bibliographyItemTypes } from '@manuscripts/library';
15
- import { ButtonGroup, IconButton, PrimaryButton, TertiaryButton, TextField, } from '@manuscripts/style-guide';
16
- import { TitleField } from '@manuscripts/title-editor';
17
- import { buildBibliographicDate, buildBibliographicName, buildLibraryCollection, } from '@manuscripts/transform';
18
- import { Field, FieldArray, Form, Formik } from 'formik';
19
- import React, { useCallback, useEffect, useRef, useState } from 'react';
20
- import CreatableSelect from 'react-select/creatable';
21
- import styled from 'styled-components';
22
- import { selectStyles } from '../../lib/select-styles';
23
- import { useStore } from '../../store';
24
- import { SelectField } from '../SelectField';
25
- const LabelContainer = styled.div `
26
- display: flex;
27
- justify-content: space-between;
28
- align-items: center;
29
- margin-bottom: ${(props) => props.theme.grid.unit}px;
30
- `;
31
- const Label = styled.label `
32
- font-family: ${(props) => props.theme.font.family.sans};
33
- font-size: ${(props) => props.theme.font.size.medium};
34
- display: flex;
35
- color: ${(props) => props.theme.colors.text.secondary};
36
- `;
37
- const AuthorHeading = styled.button.attrs({
38
- type: 'button',
39
- }) `
40
- display: flex;
41
- width: 100%;
42
- justify-content: space-between;
43
- align-items: center;
44
- padding: ${(props) => props.theme.grid.unit * 2}px
45
- ${(props) => props.theme.grid.unit * 3}px;
46
- cursor: pointer;
47
- border: none;
48
- background: none;
49
- font-size: inherit;
50
- color: ${(props) => props.isExpanded
51
- ? props.theme.colors.brand.default
52
- : props.theme.colors.text.primary};
53
- `;
54
- const FieldLabel = styled.label `
55
- font-family: ${(props) => props.theme.font.family.sans};
56
- font-size: ${(props) => props.theme.font.size.medium};
57
- color: ${(props) => props.theme.colors.text.muted};
58
- width: 50%;
59
- `;
60
- const NameFieldContainer = styled.div `
61
- display: flex;
62
- align-items: center;
63
- border-bottom: 1px solid ${(props) => props.theme.colors.text.muted};
64
- background-color: ${(props) => props.theme.colors.background.primary};
65
- `;
66
- const NameField = styled.input `
67
- font-size: ${(props) => props.theme.font.size.normal};
68
- padding: ${(props) => props.theme.grid.unit * 2}px
69
- ${(props) => props.theme.grid.unit * 4}px;
70
- box-sizing: border-box;
71
- border: none;
72
- background-color: transparent;
73
- width: 50%;
74
-
75
- &:focus {
76
- outline: none;
77
- }
78
-
79
- &::placeholder {
80
- color: ${(props) => props.theme.colors.text.muted};
81
- }
82
-
83
- &:hover::placeholder {
84
- color: ${(props) => props.theme.colors.text.secondary};
85
- }
86
- `;
87
- const CollapsibleAuthorContainer = ({ children, title, action }) => {
88
- const [expanded, setExpanded] = useState(!title);
89
- const toggleExpanded = useCallback(() => {
90
- setExpanded((value) => !value);
91
- }, []);
92
- return (React.createElement(AuthorContainer, { isExpanded: expanded },
93
- React.createElement(AuthorHeading, { isExpanded: expanded, onClick: toggleExpanded, tabIndex: 0 },
94
- React.createElement("span", null, !title ? 'Edit author name' : title),
95
- React.createElement(ArrowDownBlack, { style: {
96
- transform: expanded ? 'rotate(180deg)' : 'rotate(0deg)',
97
- } })),
98
- expanded && React.createElement(AuthorContent, null, children),
99
- expanded && React.createElement(AuthorActions, null, action)));
100
- };
101
- const AuthorContainer = styled.div `
102
- font-size: ${(props) => props.theme.font.size.medium};
103
- background-color: ${(props) => props.isExpanded ? props.theme.colors.background.secondary : 'transparent'};
104
- overflow: hidden;
105
-
106
- &:active,
107
- &:hover {
108
- background-color: ${(props) => props.theme.colors.background.secondary};
109
- }
110
-
111
- &:not(:last-of-type) {
112
- border-bottom: 1px solid ${(props) => props.theme.colors.text.muted};
113
- }
114
-
115
- &:first-of-type {
116
- border-top-left-radius: ${(props) => props.theme.grid.radius.default};
117
- border-top-right-radius: ${(props) => props.theme.grid.radius.default};
118
- }
119
-
120
- &:last-of-type {
121
- border-bottom-left-radius: ${(props) => props.theme.grid.radius.default};
122
- border-bottom-right-radius: ${(props) => props.theme.grid.radius.default};
123
- }
124
- `;
125
- const AuthorContent = styled.div `
126
- border-radius: ${(props) => props.theme.grid.radius.small};
127
- border: 1px solid ${(props) => props.theme.colors.text.muted};
128
- margin: 0 ${(props) => props.theme.grid.unit * 3}px;
129
- `;
130
- const StyledTitleField = styled(TitleField) `
131
- & .ProseMirror {
132
- font-family: ${(props) => props.theme.font.family.sans};
133
- font-size: ${(props) => props.theme.font.size.medium};
134
- line-height: 1.25;
135
- color: ${(props) => props.theme.colors.text.primary};
136
- border-radius: ${(props) => props.theme.grid.radius.small};
137
- border: 1px solid ${(props) => props.theme.colors.text.muted};
138
- padding: ${(props) => props.theme.grid.unit * 2}px
139
- ${(props) => props.theme.grid.unit * 3}px;
140
-
141
- &:focus {
142
- outline: none;
143
- border-color: ${(props) => props.theme.colors.border.field.hover};
144
- background-color: ${(props) => props.theme.colors.background.fifth};
145
- }
146
- }
147
-
148
- &:hover {
149
- & .ProseMirror {
150
- background-color: ${(props) => props.theme.colors.background.fifth};
151
- }
152
- }
153
- `;
154
- const FormTextField = styled(TextField) `
155
- padding: ${(props) => props.theme.grid.unit * 2}px
156
- ${(props) => props.theme.grid.unit * 3}px;
157
- `;
158
- const YearField = styled(Field) `
159
- font-family: ${(props) => props.theme.font.family.sans};
160
- padding: ${(props) => props.theme.grid.unit * 2}px
161
- ${(props) => props.theme.grid.unit * 3}px;
162
- font-size: ${(props) => props.theme.font.size.medium};
163
- color: ${(props) => props.theme.colors.text.primary};
164
- border-radius: ${(props) => props.theme.grid.radius.small};
165
- border: solid 1px ${(props) => props.theme.colors.text.muted};
166
- `;
167
- const Button = styled(IconButton).attrs({
168
- defaultColor: true,
169
- size: 24,
170
- }) `
171
- circle,
172
- use {
173
- fill: ${(props) => props.theme.colors.brand.default};
174
- }
175
-
176
- path {
177
- mask: none;
178
- }
179
- `;
180
- const BaseButton = styled.button.attrs({
181
- type: 'button',
182
- }) `
183
- font-family: ${(props) => props.theme.font.family.sans};
184
- background-color: ${(props) => props.theme.colors.background.secondary};
185
- border: none;
186
- cursor: pointer;
187
- font-size: ${(props) => props.theme.font.size.normal};
188
- font-weight: ${(props) => props.theme.font.weight.medium};
189
- color: ${(props) => props.theme.colors.brand.default};
190
- `;
191
- const PlainTextButton = styled(TertiaryButton) ``;
192
- const Author = styled.div ``;
193
- const Actions = styled.div `
194
- flex-shrink: 1;
195
- display: flex;
196
- justify-content: space-between;
197
- align-items: center;
198
- padding: ${(props) => props.theme.grid.unit * 2}px;
199
- padding-left: ${(props) => props.theme.grid.unit * 8}px;
200
- padding-bottom: 64px; // leave space for the chat button
201
- `;
202
- const AuthorActions = styled(Actions) `
203
- justify-content: flex-end;
204
- `;
205
- const AuthorFormContainer = styled.div `
206
- border-radius: ${(props) => props.theme.grid.radius.small};
207
- border: solid 1px ${(props) => props.theme.colors.text.muted};
208
- `;
209
- const TitleLink = styled.a `
210
- align-items: center;
211
- border-radius: ${(props) => props.theme.grid.radius.small};
212
- cursor: pointer;
213
- display: inline-flex;
214
- font: ${(props) => props.theme.font.weight.normal}
215
- ${(props) => props.theme.font.size.medium} /
216
- ${(props) => props.theme.font.lineHeight.large}
217
- ${(props) => props.theme.font.family.sans};
218
- justify-content: center;
219
- outline: none;
220
- padding: 7px ${(props) => props.theme.grid.unit * 3}px;
221
- text-decoration: none;
222
- transition: border 0.1s, color 0.1s, background-color 0.1s;
223
- vertical-align: middle;
224
- white-space: nowrap;
225
-
226
- color: ${(props) => props.theme.colors.button.secondary.color.default};
227
- background-color: ${(props) => props.theme.colors.button.secondary.background.default};
228
- border: 1px solid
229
- ${(props) => props.theme.colors.button.secondary.border.default};
230
-
231
- &:not([disabled]):hover,
232
- &:not([disabled]):focus {
233
- color: ${(props) => props.theme.colors.button.secondary.color.hover};
234
- background-color: ${(props) => props.theme.colors.button.secondary.background.hover};
235
- border-color: ${(props) => props.theme.colors.button.secondary.border.hover};
236
- }
237
- &:not([disabled]):active {
238
- color: ${(props) => props.theme.colors.button.secondary.color.active};
239
- background-color: ${(props) => props.theme.colors.button.secondary.background.active};
240
- border-color: ${(props) => props.theme.colors.button.secondary.border.active};
241
- }
242
- `;
243
- const FormField = styled.div `
244
- padding: ${(props) => props.theme.grid.unit * 3}px;
245
- padding-left: ${(props) => props.theme.grid.unit * 8}px;
246
- `;
247
- const FlexForm = styled(Form) `
248
- height: 100%;
249
- display: flex;
250
- flex-direction: column;
251
- overflow: hidden;
252
- `;
253
- const FormFields = styled.div `
254
- flex: 1;
255
- overflow-y: auto;
256
- `;
257
- const buildOptions = (data) => {
258
- const options = [];
259
- for (const libraryCollection of data.values()) {
260
- options.push({
261
- value: libraryCollection._id,
262
- label: libraryCollection.name,
263
- });
264
- }
265
- return options;
266
- };
267
- const buildInitialValues = (item) => ({
268
- _id: item._id,
269
- title: item.title,
270
- author: item.author,
271
- DOI: item.DOI,
272
- issued: item.issued,
273
- type: item.type,
274
- 'container-title': item['container-title'],
275
- URL: item.URL,
276
- issue: item.issue ? String(item.issue) : undefined,
277
- volume: item.volume ? String(item.volume) : undefined,
278
- page: item.page ? String(item.page) : undefined,
279
- supplement: item.supplement ? String(item.supplement) : undefined,
280
- });
281
- const bibliographyItemTypeOptions = Array.from(bibliographyItemTypes.entries())
282
- .map(([value, label]) => ({ value, label }))
283
- .sort((a, b) => a.label.localeCompare(b.label));
284
- // TODO: a "manage library collections" page, where unused library collections can be deleted
285
- const LibraryForm = ({ item, handleSave, handleDelete, user }) => {
286
- const formRef = useRef(null);
287
- useEffect(() => {
288
- if (formRef.current) {
289
- formRef.current.scrollTop = 0;
290
- }
291
- }, [item]);
292
- const [{ createProjectLibraryCollection, projectLibraryCollections, projectID },] = useStore((store) => ({
293
- createProjectLibraryCollection: store.createProjectLibraryCollection,
294
- projectLibraryCollections: store.projectLibraryCollections,
295
- projectID: store.projectID,
296
- }));
297
- return (React.createElement(Formik, { initialValues: buildInitialValues(item), onSubmit: handleSave, enableReinitialize: true }, ({ values, setFieldValue, handleChange }) => (React.createElement(FlexForm, null,
298
- React.createElement(FormFields, { ref: formRef },
299
- React.createElement(FormField, null,
300
- React.createElement(LabelContainer, null,
301
- React.createElement(Label, { htmlFor: 'library-item-type' }, "Type")),
302
- React.createElement(Field, { id: 'library-item-type', name: 'type', component: SelectField, options: bibliographyItemTypeOptions })),
303
- React.createElement(FormField, null,
304
- React.createElement(LabelContainer, null,
305
- React.createElement(Label, null, "Title")),
306
- React.createElement(StyledTitleField, { value: values.title || '', handleChange: (data) => setFieldValue('title', data), autoFocus: !values.title })),
307
- React.createElement(FieldArray, { name: 'author', render: ({ push, remove }) => (React.createElement(FormField, null,
308
- React.createElement(LabelContainer, null,
309
- React.createElement(Label, null, "Authors"),
310
- React.createElement(Button, { onClick: () => push(buildBibliographicName({
311
- given: '',
312
- family: '',
313
- })) },
314
- React.createElement(AddAuthor, { height: 17, width: 17 }))),
315
- React.createElement(AuthorFormContainer, null, values.author &&
316
- values.author.map((author, index) => (React.createElement(CollapsibleAuthorContainer, { key: author._id || `author.${index}`, title: [author.given, author.family].join(' ').trim(), action: React.createElement(BaseButton, { onClick: () => {
317
- if (window.confirm('Remove this author?')) {
318
- remove(index);
319
- }
320
- } }, "REMOVE") },
321
- React.createElement(Author, null,
322
- React.createElement(Field, { name: `author.${index}.given`, value: author.given, onChange: handleChange }, ({ field }) => (React.createElement(NameFieldContainer, null,
323
- React.createElement(NameField, { ...field, id: field.name, placeholder: 'Given', autoFocus: true }),
324
- React.createElement(FieldLabel, { htmlFor: field.name }, "Given")))),
325
- React.createElement(Field, { name: `author.${index}.family`, value: author.family, onChange: handleChange }, ({ field }) => (React.createElement(NameFieldContainer, null,
326
- React.createElement(NameField, { ...field, id: field.name, placeholder: 'Family' }),
327
- React.createElement(FieldLabel, { htmlFor: field.name }, "Family"))))))))))) }),
328
- React.createElement(FormField, null,
329
- React.createElement(LabelContainer, null,
330
- React.createElement(Label, { htmlFor: "issued['date-parts'][0][0]" }, "Year")),
331
- React.createElement(YearField, { name: "issued['date-parts'][0][0]", type: 'number', step: 1, onChange: (event) => {
332
- const { value } = event.target;
333
- if (value) {
334
- if (values.issued) {
335
- // NOTE: this assumes that "issued" is already a complete object
336
- setFieldValue("issued['date-parts'][0][0]", Number(value));
337
- }
338
- else {
339
- setFieldValue('issued', buildBibliographicDate({
340
- 'date-parts': [[Number(value)]],
341
- }));
342
- }
343
- }
344
- else {
345
- // NOTE: not undefined due to https://github.com/jaredpalmer/formik/issues/2180
346
- setFieldValue('issued', '');
347
- }
348
- } })),
349
- React.createElement(FormField, null,
350
- React.createElement(LabelContainer, null,
351
- React.createElement(Label, { htmlFor: 'container-title' }, "Container Title")),
352
- React.createElement(Field, { name: 'container-title' }, (props) => (React.createElement(FormTextField, { id: 'container-title', ...props.field })))),
353
- React.createElement(FormField, null,
354
- React.createElement(LabelContainer, null,
355
- React.createElement(Label, { htmlFor: 'volume' }, "Volume")),
356
- React.createElement(Field, { name: 'volume' }, (props) => (React.createElement(FormTextField, { id: 'volume', ...props.field })))),
357
- React.createElement(FormField, null,
358
- React.createElement(LabelContainer, null,
359
- React.createElement(Label, { htmlFor: 'issue' }, "Issue")),
360
- React.createElement(Field, { name: 'issue' }, (props) => (React.createElement(FormTextField, { id: 'issue', ...props.field })))),
361
- React.createElement(FormField, null,
362
- React.createElement(LabelContainer, null,
363
- React.createElement(Label, { htmlFor: 'page' }, "Page")),
364
- React.createElement(Field, { name: 'page' }, (props) => (React.createElement(FormTextField, { id: 'page', ...props.field })))),
365
- React.createElement(FormField, null,
366
- React.createElement(LabelContainer, null,
367
- React.createElement(Label, { htmlFor: 'url' }, "URL")),
368
- React.createElement(Field, { name: 'URL' }, (props) => (React.createElement(FormTextField, { type: 'url', id: 'url', ...props.field })))),
369
- React.createElement(FormField, null,
370
- React.createElement(LabelContainer, null,
371
- React.createElement(Label, { htmlFor: 'doi' }, "DOI")),
372
- React.createElement(Field, { name: 'DOI' }, (props) => (React.createElement(FormTextField, { id: 'doi', pattern: '(https://doi.org/)?10..+', ...props.field })))),
373
- React.createElement(FormField, null,
374
- React.createElement(LabelContainer, null,
375
- React.createElement(Label, { htmlFor: 'supplement' }, "Supplement")),
376
- React.createElement(Field, { name: 'supplement' }, (props) => (React.createElement(FormTextField, { id: 'supplement', ...props.field })))),
377
- React.createElement(FormField, null,
378
- React.createElement(LabelContainer, null,
379
- React.createElement(Label, { htmlFor: 'keywordIDs' }, "Lists")),
380
- React.createElement(Field, { name: 'keywordIDs' }, (props) => (React.createElement(CreatableSelect, { onChange: async (newValue) => {
381
- setFieldValue(props.field.name, await Promise.all(newValue.map(async (option) => {
382
- const existing = projectLibraryCollections.get(option.value);
383
- if (existing) {
384
- return existing._id;
385
- }
386
- const libraryCollection = buildLibraryCollection(user.userID, String(option.label));
387
- await createProjectLibraryCollection(libraryCollection, projectID);
388
- return libraryCollection._id;
389
- })));
390
- }, options: buildOptions(projectLibraryCollections), value: props.field.value
391
- ? props.field.value
392
- .filter((id) => projectLibraryCollections.has(id))
393
- .map((id) => projectLibraryCollections.get(id))
394
- .map((item) => ({
395
- value: item._id,
396
- label: item.name,
397
- }))
398
- : null, styles: selectStyles }))))),
399
- React.createElement(Actions, null,
400
- handleDelete && (React.createElement(PlainTextButton, { danger: true, type: 'button', onClick: () => handleDelete(item) }, "Remove")),
401
- React.createElement(ButtonGroup, null,
402
- React.createElement(TitleLink, { href: `https://doi.org/${values.DOI}`, target: '_blank', rel: 'noopener noreferrer' },
403
- React.createElement("span", { role: 'img', "aria-label": 'Link' }, "\uD83D\uDD17"),
404
- ' ',
405
- "Open"),
406
- React.createElement(PrimaryButton, { type: "submit" }, "Save")))))));
407
- };
408
- export default LibraryForm;
409
- //# sourceMappingURL=LibraryForm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LibraryForm.js","sourceRoot":"","sources":["../../../../../src/components/library/LibraryForm.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,SAAS,MAAM,qCAAqC,CAAA;AAC3D,OAAO,cAAc,MAAM,0CAA0C,CAAA;AAOrE,OAAO,EAAE,q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C,KAAK;wBACf,CAAC,CAAE,KAAK,CAAC,KAAK,CAAC,KAAkB;6BAC5B,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,yBAAyB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;6BACjD,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,yBAAyB,CAAC,GAAG,CAAC,EAAE,CAAE,CAAC;6BAC/C,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;4BACd,KAAK,EAAE,IAAI,CAAC,GAAG;4BACf,KAAK,EAAE,IAAI,CAAC,IAAI;yBACjB,CAAC,CAAC;wBACP,CAAC,CAAC,IAAI,EAEV,MAAM,EAAE,YAAY,GACpB,CACH,CACK,CACE,CACD;QAEb,oBAAC,OAAO;YACL,YAAY,IAAI,CACf,oBAAC,eAAe,IACd,MAAM,EAAE,IAAI,EACZ,IAAI,EAAE,QAAQ,EACd,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,aAGjB,CACnB;YAED,oBAAC,WAAW;gBACV,oBAAC,SAAS,IACR,IAAI,EAAE,mBAAmB,MAAM,CAAC,GAAG,EAAE,EACrC,MAAM,EAAE,QAAQ,EAChB,GAAG,EAAE,qBAAqB;oBAE1B,8BAAM,IAAI,EAAE,KAAK,gBAAc,MAAM,mBAE9B;oBAAC,GAAG;2BAED;gBAEZ,oBAAC,aAAa,IAAC,IAAI,EAAC,QAAQ,WAAqB,CACrC,CACN,CACD,CACZ,CACM,CACV,CAAA;AACH,CAAC,CAAA;AAED,eAAe,WAAW,CAAA"}
@@ -1,86 +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) 2023 Atypon Systems LLC. All Rights Reserved.
11
- */
12
- import ReferenceLibraryIcon from '@manuscripts/assets/react/ReferenceLibraryIcon';
13
- import { fullLibraryItemMetadata } from '@manuscripts/library';
14
- import { Title } from '@manuscripts/title-editor';
15
- import React from 'react';
16
- import styled from 'styled-components';
17
- import Search, { SearchWrapper } from '../Search';
18
- const Container = styled.div `
19
- display: flex;
20
- flex-direction: column;
21
- height: 100%;
22
- overflow: hidden;
23
- `;
24
- const Items = styled.div `
25
- flex: 1;
26
- overflow-y: auto;
27
- `;
28
- const Item = styled.div `
29
- cursor: pointer;
30
- padding: ${(props) => props.theme.grid.unit * 3}px;
31
- border-bottom: 1px solid;
32
- border-top: 1px solid;
33
- background-color: ${(props) => props.isActive ? props.theme.colors.background.fifth : 'transparent'};
34
- border-color: ${(props) => props.isActive ? props.theme.colors.border.primary : 'transparent'};
35
- transition: background-color 0.25s;
36
- display: flex;
37
- ${(props) => !props.isActive &&
38
- 'box-shadow: 0 1px 0 0 ' + props.theme.colors.border.secondary};
39
-
40
- &:hover {
41
- box-shadow: unset;
42
- background-color: ${(props) => props.theme.colors.background.fifth};
43
- }
44
- `;
45
- const ItemMetadata = styled.div `
46
- flex: 1;
47
- `;
48
- const Metadata = styled.div `
49
- margin-top: ${(props) => props.theme.grid.unit}px;
50
- color: ${(props) => props.theme.colors.text.secondary};
51
- flex: 1;
52
- font-weight: ${(props) => props.theme.font.weight.light};
53
- `;
54
- const ItemIcon = styled.div `
55
- flex-shrink: 1;
56
- margin-right: ${(props) => props.theme.grid.unit * 4}px;
57
- height: ${(props) => props.theme.grid.unit * 6}px;
58
- width: ${(props) => props.theme.grid.unit * 6}px;
59
- display: inline-flex;
60
- justify-content: center;
61
- align-items: center;
62
- cursor: pointer;
63
- `;
64
- const StyledReferenceLibraryIcon = styled(ReferenceLibraryIcon) `
65
- path {
66
- stroke: ${(props) => props.theme.colors.text.muted};
67
- }
68
- `;
69
- const EmptyItems = styled.div `
70
- flex: 1;
71
- justify-content: center;
72
- align-items: center;
73
- text-align: center;
74
- padding: ${(props) => props.theme.grid.unit * 4}px;
75
- `;
76
- export const LibraryItems = ({ query, setQuery, handleSelect, items, selectedItem }) => (React.createElement(Container, null,
77
- React.createElement(SearchWrapper, null,
78
- React.createElement(Search, { autoComplete: 'off', autoFocus: !selectedItem, handleSearchChange: (e) => setQuery(e.target.value), placeholder: 'Search library…', type: 'search', value: query || '' })),
79
- query && items.length === 0 && (React.createElement(EmptyItems, null, "No items match this query.")),
80
- items.length > 0 && (React.createElement(Items, null, items.map((item) => (React.createElement(Item, { key: item._id, onClick: () => handleSelect(item), isActive: selectedItem ? selectedItem._id === item._id : false },
81
- React.createElement(ItemIcon, null,
82
- React.createElement(StyledReferenceLibraryIcon, null)),
83
- React.createElement(ItemMetadata, null,
84
- React.createElement(Title, { value: item.title || 'Untitled', title: item.title }),
85
- React.createElement(Metadata, { "data-cy": 'search-result-author' }, fullLibraryItemMetadata(item))))))))));
86
- //# sourceMappingURL=LibraryItems.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LibraryItems.js","sourceRoot":"","sources":["../../../../../src/components/library/LibraryItems.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,oBAAoB,MAAM,gDAAgD,CAAA;AAEjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AACjD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,MAAM,EAAE,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