tycho-components 0.28.10 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. package/dist/configs/Localization.d.ts +2 -2
  2. package/dist/configs/Localization.js +21 -39
  3. package/dist/configs/index.d.ts +2 -0
  4. package/dist/configs/index.js +1 -0
  5. package/dist/configs/types/Document.d.ts +3 -3
  6. package/dist/configs/types/Document.js +4 -4
  7. package/dist/features/index.d.ts +15 -32
  8. package/dist/features/index.js +11 -21
  9. package/package.json +3 -3
  10. package/dist/features/DocumentDrawer/Actions/Actions.d.ts +0 -17
  11. package/dist/features/DocumentDrawer/Actions/Actions.js +0 -121
  12. package/dist/features/DocumentDrawer/Actions/PageRemoveSentences.d.ts +0 -7
  13. package/dist/features/DocumentDrawer/Actions/PageRemoveSentences.js +0 -23
  14. package/dist/features/DocumentDrawer/Actions/index.d.ts +0 -2
  15. package/dist/features/DocumentDrawer/Actions/index.js +0 -2
  16. package/dist/features/DocumentDrawer/Actions/style.scss +0 -0
  17. package/dist/features/DocumentDrawer/AutomaticParser/AutomaticParser.d.ts +0 -8
  18. package/dist/features/DocumentDrawer/AutomaticParser/AutomaticParser.js +0 -96
  19. package/dist/features/DocumentDrawer/AutomaticParser/index.d.ts +0 -2
  20. package/dist/features/DocumentDrawer/AutomaticParser/index.js +0 -2
  21. package/dist/features/DocumentDrawer/AutomaticParser/style.scss +0 -10
  22. package/dist/features/DocumentDrawer/DocumentDrawer.d.ts +0 -19
  23. package/dist/features/DocumentDrawer/DocumentDrawer.js +0 -102
  24. package/dist/features/DocumentDrawer/DocumentEdit/DocumentEdit.d.ts +0 -35
  25. package/dist/features/DocumentDrawer/DocumentEdit/DocumentEdit.js +0 -207
  26. package/dist/features/DocumentDrawer/DocumentEdit/index.d.ts +0 -2
  27. package/dist/features/DocumentDrawer/DocumentEdit/index.js +0 -1
  28. package/dist/features/DocumentDrawer/DocumentExport/DocumentExport.d.ts +0 -7
  29. package/dist/features/DocumentDrawer/DocumentExport/DocumentExport.js +0 -83
  30. package/dist/features/DocumentDrawer/DocumentExport/ExportInvalidSentences.d.ts +0 -7
  31. package/dist/features/DocumentDrawer/DocumentExport/ExportInvalidSentences.js +0 -12
  32. package/dist/features/DocumentDrawer/DocumentExport/ExportTxtTierModal.d.ts +0 -8
  33. package/dist/features/DocumentDrawer/DocumentExport/ExportTxtTierModal.js +0 -14
  34. package/dist/features/DocumentDrawer/DocumentExport/index.d.ts +0 -2
  35. package/dist/features/DocumentDrawer/DocumentExport/index.js +0 -2
  36. package/dist/features/DocumentDrawer/DocumentExport/style.scss +0 -49
  37. package/dist/features/DocumentDrawer/DocumentLexicon/DocumentLexicon.d.ts +0 -7
  38. package/dist/features/DocumentDrawer/DocumentLexicon/DocumentLexicon.js +0 -22
  39. package/dist/features/DocumentDrawer/DocumentLexicon/index.d.ts +0 -2
  40. package/dist/features/DocumentDrawer/DocumentLexicon/index.js +0 -2
  41. package/dist/features/DocumentDrawer/DocumentLexicon/style.scss +0 -38
  42. package/dist/features/DocumentDrawer/DocumentRemove/DocumentRemove.d.ts +0 -12
  43. package/dist/features/DocumentDrawer/DocumentRemove/DocumentRemove.js +0 -28
  44. package/dist/features/DocumentDrawer/DocumentRemove/index.d.ts +0 -2
  45. package/dist/features/DocumentDrawer/DocumentRemove/index.js +0 -2
  46. package/dist/features/DocumentDrawer/DocumentRemove/style.scss +0 -0
  47. package/dist/features/DocumentDrawer/Github/Github.d.ts +0 -8
  48. package/dist/features/DocumentDrawer/Github/Github.js +0 -11
  49. package/dist/features/DocumentDrawer/Github/GithubCommit.d.ts +0 -8
  50. package/dist/features/DocumentDrawer/Github/GithubCommit.js +0 -86
  51. package/dist/features/DocumentDrawer/Github/index.d.ts +0 -2
  52. package/dist/features/DocumentDrawer/Github/index.js +0 -2
  53. package/dist/features/DocumentDrawer/Github/style.scss +0 -31
  54. package/dist/features/DocumentDrawer/ImageGallery/GalleryImage.d.ts +0 -8
  55. package/dist/features/DocumentDrawer/ImageGallery/GalleryImage.js +0 -5
  56. package/dist/features/DocumentDrawer/ImageGallery/GalleryRemoval.d.ts +0 -9
  57. package/dist/features/DocumentDrawer/ImageGallery/GalleryRemoval.js +0 -14
  58. package/dist/features/DocumentDrawer/ImageGallery/ImageGallery.d.ts +0 -9
  59. package/dist/features/DocumentDrawer/ImageGallery/ImageGallery.js +0 -45
  60. package/dist/features/DocumentDrawer/ImageGallery/index.d.ts +0 -2
  61. package/dist/features/DocumentDrawer/ImageGallery/index.js +0 -2
  62. package/dist/features/DocumentDrawer/ImageGallery/style.scss +0 -41
  63. package/dist/features/DocumentDrawer/Inconsistency/Inconsistency.d.ts +0 -8
  64. package/dist/features/DocumentDrawer/Inconsistency/Inconsistency.js +0 -18
  65. package/dist/features/DocumentDrawer/Inconsistency/InconsistencyActions.d.ts +0 -7
  66. package/dist/features/DocumentDrawer/Inconsistency/InconsistencyActions.js +0 -77
  67. package/dist/features/DocumentDrawer/Inconsistency/InconsistencyResponse.d.ts +0 -31
  68. package/dist/features/DocumentDrawer/Inconsistency/InconsistencyResponse.js +0 -39
  69. package/dist/features/DocumentDrawer/Inconsistency/InconsistencyService.d.ts +0 -6
  70. package/dist/features/DocumentDrawer/Inconsistency/InconsistencyService.js +0 -8
  71. package/dist/features/DocumentDrawer/Inconsistency/style.scss +0 -64
  72. package/dist/features/DocumentDrawer/Info/Info.d.ts +0 -10
  73. package/dist/features/DocumentDrawer/Info/Info.js +0 -16
  74. package/dist/features/DocumentDrawer/Info/index.d.ts +0 -2
  75. package/dist/features/DocumentDrawer/Info/index.js +0 -2
  76. package/dist/features/DocumentDrawer/Info/style.scss +0 -24
  77. package/dist/features/DocumentDrawer/Metadata/DocumentMetadata/DocumentMetadata.d.ts +0 -8
  78. package/dist/features/DocumentDrawer/Metadata/DocumentMetadata/DocumentMetadata.js +0 -60
  79. package/dist/features/DocumentDrawer/Metadata/DocumentMetadata/index.d.ts +0 -2
  80. package/dist/features/DocumentDrawer/Metadata/DocumentMetadata/index.js +0 -2
  81. package/dist/features/DocumentDrawer/Metadata/DocumentMetadata/style.scss +0 -7
  82. package/dist/features/DocumentDrawer/Metadata/DocumentMetadataEdit/DocumentMetadataEdit.d.ts +0 -11
  83. package/dist/features/DocumentDrawer/Metadata/DocumentMetadataEdit/DocumentMetadataEdit.js +0 -195
  84. package/dist/features/DocumentDrawer/Metadata/DocumentMetadataEdit/index.d.ts +0 -2
  85. package/dist/features/DocumentDrawer/Metadata/DocumentMetadataEdit/index.js +0 -2
  86. package/dist/features/DocumentDrawer/Metadata/DocumentMetadataEdit/style.scss +0 -58
  87. package/dist/features/DocumentDrawer/PageStatusComponent/PageStatusComponent.d.ts +0 -9
  88. package/dist/features/DocumentDrawer/PageStatusComponent/PageStatusComponent.js +0 -30
  89. package/dist/features/DocumentDrawer/PageStatusComponent/index.d.ts +0 -2
  90. package/dist/features/DocumentDrawer/PageStatusComponent/index.js +0 -2
  91. package/dist/features/DocumentDrawer/PageStatusComponent/style.scss +0 -19
  92. package/dist/features/DocumentDrawer/Pages/BoxRemoval.d.ts +0 -10
  93. package/dist/features/DocumentDrawer/Pages/BoxRemoval.js +0 -14
  94. package/dist/features/DocumentDrawer/Pages/Boxes.d.ts +0 -10
  95. package/dist/features/DocumentDrawer/Pages/Boxes.js +0 -65
  96. package/dist/features/DocumentDrawer/Pages/PageRemoval.d.ts +0 -10
  97. package/dist/features/DocumentDrawer/Pages/PageRemoval.js +0 -15
  98. package/dist/features/DocumentDrawer/Pages/Pages.d.ts +0 -10
  99. package/dist/features/DocumentDrawer/Pages/Pages.js +0 -67
  100. package/dist/features/DocumentDrawer/Pages/style.scss +0 -48
  101. package/dist/features/DocumentDrawer/deps.d.ts +0 -28
  102. package/dist/features/DocumentDrawer/deps.js +0 -20
  103. package/dist/features/DocumentDrawer/functions/FileUtils.d.ts +0 -4
  104. package/dist/features/DocumentDrawer/functions/FileUtils.js +0 -8
  105. package/dist/features/DocumentDrawer/functions/MetadataUtils.d.ts +0 -41
  106. package/dist/features/DocumentDrawer/functions/MetadataUtils.js +0 -192
  107. package/dist/features/DocumentDrawer/index.d.ts +0 -7
  108. package/dist/features/DocumentDrawer/index.js +0 -4
  109. package/dist/features/DocumentDrawer/localization/ActionsTexts.d.ts +0 -119
  110. package/dist/features/DocumentDrawer/localization/ActionsTexts.js +0 -119
  111. package/dist/features/DocumentDrawer/localization/DocumentTexts.d.ts +0 -137
  112. package/dist/features/DocumentDrawer/localization/DocumentTexts.js +0 -137
  113. package/dist/features/DocumentDrawer/localization/ExportTexts.d.ts +0 -74
  114. package/dist/features/DocumentDrawer/localization/ExportTexts.js +0 -74
  115. package/dist/features/DocumentDrawer/localization/GithubTexts.d.ts +0 -35
  116. package/dist/features/DocumentDrawer/localization/GithubTexts.js +0 -35
  117. package/dist/features/DocumentDrawer/localization/InconsistencyTexts.d.ts +0 -101
  118. package/dist/features/DocumentDrawer/localization/InconsistencyTexts.js +0 -101
  119. package/dist/features/DocumentDrawer/localization/PageTexts.d.ts +0 -45
  120. package/dist/features/DocumentDrawer/localization/PageTexts.js +0 -45
  121. package/dist/features/DocumentDrawer/localization/ParserTexts.d.ts +0 -30
  122. package/dist/features/DocumentDrawer/localization/ParserTexts.js +0 -30
  123. package/dist/features/DocumentDrawer/services/AutomaticParserService.d.ts +0 -8
  124. package/dist/features/DocumentDrawer/services/AutomaticParserService.js +0 -9
  125. package/dist/features/DocumentDrawer/services/BoundingBoxService.d.ts +0 -11
  126. package/dist/features/DocumentDrawer/services/BoundingBoxService.js +0 -20
  127. package/dist/features/DocumentDrawer/services/DocumentService.d.ts +0 -13
  128. package/dist/features/DocumentDrawer/services/DocumentService.js +0 -20
  129. package/dist/features/DocumentDrawer/services/ExportService.d.ts +0 -11
  130. package/dist/features/DocumentDrawer/services/ExportService.js +0 -22
  131. package/dist/features/DocumentDrawer/services/GithubService.d.ts +0 -8
  132. package/dist/features/DocumentDrawer/services/GithubService.js +0 -12
  133. package/dist/features/DocumentDrawer/services/ImageService.d.ts +0 -8
  134. package/dist/features/DocumentDrawer/services/ImageService.js +0 -12
  135. package/dist/features/DocumentDrawer/services/LexiconService.d.ts +0 -7
  136. package/dist/features/DocumentDrawer/services/LexiconService.js +0 -6
  137. package/dist/features/DocumentDrawer/services/MetadataService.d.ts +0 -11
  138. package/dist/features/DocumentDrawer/services/MetadataService.js +0 -18
  139. package/dist/features/DocumentDrawer/services/PageService.d.ts +0 -13
  140. package/dist/features/DocumentDrawer/services/PageService.js +0 -19
  141. package/dist/features/DocumentDrawer/services/SentenceService.d.ts +0 -6
  142. package/dist/features/DocumentDrawer/services/SentenceService.js +0 -6
  143. package/dist/features/DocumentDrawer/style.scss +0 -192
  144. package/dist/features/DocumentDrawer/types/BoundingBox.d.ts +0 -8
  145. package/dist/features/DocumentDrawer/types/BoundingBox.js +0 -1
  146. package/dist/features/DocumentDrawer/types/CatalogSearchFilter.d.ts +0 -15
  147. package/dist/features/DocumentDrawer/types/CatalogSearchFilter.js +0 -16
  148. package/dist/features/DocumentDrawer/types/Category.d.ts +0 -16
  149. package/dist/features/DocumentDrawer/types/Category.js +0 -5
  150. package/dist/features/DocumentDrawer/types/DocumentDrawerActionId.d.ts +0 -3
  151. package/dist/features/DocumentDrawer/types/DocumentDrawerActionId.js +0 -14
  152. package/dist/features/DocumentDrawer/types/DocumentStatus.d.ts +0 -7
  153. package/dist/features/DocumentDrawer/types/DocumentStatus.js +0 -6
  154. package/dist/features/DocumentDrawer/types/DocumentUpdateRequest.d.ts +0 -13
  155. package/dist/features/DocumentDrawer/types/DocumentUpdateRequest.js +0 -1
  156. package/dist/features/DocumentDrawer/types/Export.d.ts +0 -30
  157. package/dist/features/DocumentDrawer/types/Export.js +0 -46
  158. package/dist/features/DocumentDrawer/types/Lexicon.d.ts +0 -6
  159. package/dist/features/DocumentDrawer/types/Lexicon.js +0 -1
  160. package/dist/features/DocumentDrawer/types/LexiconResponse.d.ts +0 -6
  161. package/dist/features/DocumentDrawer/types/LexiconResponse.js +0 -1
  162. package/dist/features/DocumentDrawer/types/Metadata.d.ts +0 -22
  163. package/dist/features/DocumentDrawer/types/Metadata.js +0 -8
  164. package/dist/features/DocumentDrawer/types/Page.d.ts +0 -10
  165. package/dist/features/DocumentDrawer/types/Page.js +0 -1
  166. package/dist/features/DocumentDrawer/types/PageStatus.d.ts +0 -9
  167. package/dist/features/DocumentDrawer/types/PageStatus.js +0 -8
  168. package/dist/features/DocumentDrawer/types/Parser.d.ts +0 -18
  169. package/dist/features/DocumentDrawer/types/Parser.js +0 -21
  170. package/dist/features/DocumentDrawer/types/Query.d.ts +0 -6
  171. package/dist/features/DocumentDrawer/types/Query.js +0 -1
  172. package/dist/features/DocumentDrawer/types/Sentence.d.ts +0 -4
  173. package/dist/features/DocumentDrawer/types/Sentence.js +0 -1
  174. package/dist/features/Participants/ParticipantCreate/ParticipantCreate.d.ts +0 -8
  175. package/dist/features/Participants/ParticipantCreate/ParticipantCreate.js +0 -44
  176. package/dist/features/Participants/ParticipantCreate/index.d.ts +0 -2
  177. package/dist/features/Participants/ParticipantCreate/index.js +0 -2
  178. package/dist/features/Participants/ParticipantRemove/ParticipantRemove.d.ts +0 -11
  179. package/dist/features/Participants/ParticipantRemove/ParticipantRemove.js +0 -39
  180. package/dist/features/Participants/ParticipantRemove/index.d.ts +0 -2
  181. package/dist/features/Participants/ParticipantRemove/index.js +0 -2
  182. package/dist/features/Participants/ParticipantRemove/style.scss +0 -15
  183. package/dist/features/Participants/ParticipantService.d.ts +0 -10
  184. package/dist/features/Participants/ParticipantService.js +0 -19
  185. package/dist/features/Participants/Participants.d.ts +0 -10
  186. package/dist/features/Participants/Participants.js +0 -134
  187. package/dist/features/Participants/index.d.ts +0 -2
  188. package/dist/features/Participants/index.js +0 -2
  189. package/dist/features/Participants/style.scss +0 -51
  190. package/dist/features/SentenceSplit/SentenceSplit.d.ts +0 -33
  191. package/dist/features/SentenceSplit/SentenceSplit.js +0 -191
  192. package/dist/features/SentenceSplit/SentenceSplitAudio/SentenceSplitAudioStep.d.ts +0 -9
  193. package/dist/features/SentenceSplit/SentenceSplitAudio/SentenceSplitAudioStep.js +0 -38
  194. package/dist/features/SentenceSplit/SentenceSplitAudio/index.d.ts +0 -2
  195. package/dist/features/SentenceSplit/SentenceSplitAudio/index.js +0 -2
  196. package/dist/features/SentenceSplit/SentenceSplitAudio/style.scss +0 -29
  197. package/dist/features/SentenceSplit/SentenceSplitChoose/SentenceSplitChoose.d.ts +0 -10
  198. package/dist/features/SentenceSplit/SentenceSplitChoose/SentenceSplitChoose.js +0 -23
  199. package/dist/features/SentenceSplit/SentenceSplitChoose/index.d.ts +0 -2
  200. package/dist/features/SentenceSplit/SentenceSplitChoose/index.js +0 -2
  201. package/dist/features/SentenceSplit/SentenceSplitChoose/style.scss +0 -25
  202. package/dist/features/SentenceSplit/SentenceSplitCommentUtils.d.ts +0 -21
  203. package/dist/features/SentenceSplit/SentenceSplitCommentUtils.js +0 -77
  204. package/dist/features/SentenceSplit/SentenceSplitComments/SentenceSplitCommentBlock.d.ts +0 -7
  205. package/dist/features/SentenceSplit/SentenceSplitComments/SentenceSplitCommentBlock.js +0 -6
  206. package/dist/features/SentenceSplit/SentenceSplitComments/SentenceSplitComments.d.ts +0 -8
  207. package/dist/features/SentenceSplit/SentenceSplitComments/SentenceSplitComments.js +0 -37
  208. package/dist/features/SentenceSplit/SentenceSplitComments/SentenceSplitCommentsStep.d.ts +0 -11
  209. package/dist/features/SentenceSplit/SentenceSplitComments/SentenceSplitCommentsStep.js +0 -72
  210. package/dist/features/SentenceSplit/SentenceSplitComments/SentenceSplitCommentsWords.d.ts +0 -9
  211. package/dist/features/SentenceSplit/SentenceSplitComments/SentenceSplitCommentsWords.js +0 -15
  212. package/dist/features/SentenceSplit/SentenceSplitComments/index.d.ts +0 -2
  213. package/dist/features/SentenceSplit/SentenceSplitComments/index.js +0 -2
  214. package/dist/features/SentenceSplit/SentenceSplitComments/style.scss +0 -126
  215. package/dist/features/SentenceSplit/SentenceSplitPreview/SentenceSplitPreview.d.ts +0 -10
  216. package/dist/features/SentenceSplit/SentenceSplitPreview/SentenceSplitPreview.js +0 -10
  217. package/dist/features/SentenceSplit/SentenceSplitPreview/SentenceSplitPreviewStep.d.ts +0 -11
  218. package/dist/features/SentenceSplit/SentenceSplitPreview/SentenceSplitPreviewStep.js +0 -24
  219. package/dist/features/SentenceSplit/SentenceSplitPreview/index.d.ts +0 -2
  220. package/dist/features/SentenceSplit/SentenceSplitPreview/index.js +0 -2
  221. package/dist/features/SentenceSplit/SentenceSplitPreview/style.scss +0 -24
  222. package/dist/features/SentenceSplit/SentenceSplitService.d.ts +0 -13
  223. package/dist/features/SentenceSplit/SentenceSplitService.js +0 -13
  224. package/dist/features/SentenceSplit/SentenceSplitTranslations/SentenceSplitTranslations.d.ts +0 -12
  225. package/dist/features/SentenceSplit/SentenceSplitTranslations/SentenceSplitTranslations.js +0 -15
  226. package/dist/features/SentenceSplit/SentenceSplitTranslations/SentenceSplitTranslationsStep.d.ts +0 -10
  227. package/dist/features/SentenceSplit/SentenceSplitTranslations/SentenceSplitTranslationsStep.js +0 -8
  228. package/dist/features/SentenceSplit/SentenceSplitTranslations/index.d.ts +0 -2
  229. package/dist/features/SentenceSplit/SentenceSplitTranslations/index.js +0 -2
  230. package/dist/features/SentenceSplit/SentenceSplitTranslations/style.scss +0 -23
  231. package/dist/features/SentenceSplit/SentenceSplitUtils.d.ts +0 -6
  232. package/dist/features/SentenceSplit/SentenceSplitUtils.js +0 -17
  233. package/dist/features/SentenceSplit/index.d.ts +0 -2
  234. package/dist/features/SentenceSplit/index.js +0 -2
  235. package/dist/features/SentenceSplit/localization/SentenceSplitTexts.d.ts +0 -107
  236. package/dist/features/SentenceSplit/localization/SentenceSplitTexts.js +0 -107
  237. package/dist/features/SentenceSplit/style.scss +0 -173
  238. package/dist/features/SentenceSplit/types/Language.d.ts +0 -6
  239. package/dist/features/SentenceSplit/types/Language.js +0 -1
  240. package/dist/features/SentenceSplit/types/SentenceSplitRequest.d.ts +0 -20
  241. package/dist/features/SentenceSplit/types/SentenceSplitRequest.js +0 -16
  242. /package/dist/{features/Participants → configs}/types/Participant.d.ts +0 -0
  243. /package/dist/{features/Participants → configs}/types/Participant.js +0 -0
@@ -1,2 +0,0 @@
1
- import Info from './Info';
2
- export default Info;
@@ -1,24 +0,0 @@
1
- .info-container {
2
- .body {
3
- height: 88vh;
4
- overflow-y: auto;
5
- padding: 16px;
6
-
7
- .uid {
8
- @include helper-small-1;
9
- cursor: pointer;
10
- }
11
- }
12
-
13
- .footer {
14
- padding-left: 16px;
15
- }
16
- }
17
-
18
- @media (max-width: 1366px) {
19
- .info-container {
20
- .body {
21
- height: 84vh;
22
- }
23
- }
24
- }
@@ -1,8 +0,0 @@
1
- import { Document } from '../../deps';
2
- import './style.scss';
3
- type Props = {
4
- document: Document;
5
- onDocumentChange?: (document: Document) => void;
6
- };
7
- export default function DocumentMetadata({ document, onDocumentChange, }: Props): import("react/jsx-runtime").JSX.Element;
8
- export {};
@@ -1,60 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import metadataService from '../../services/MetadataService';
3
- import { useEffect, useMemo, useState } from 'react';
4
- import { useTranslation } from 'react-i18next';
5
- import { AppFormInfo, AppPlaceholder, } from '../../deps';
6
- import './style.scss';
7
- import { Button } from 'tycho-storybook';
8
- import DocumentMetadataEdit from '../DocumentMetadataEdit/DocumentMetadataEdit';
9
- import MetadataUtils from '../../functions/MetadataUtils';
10
- function getDocumentMetaValue(document, attr) {
11
- const entry = document.metadata?.find((m) => {
12
- const values = m;
13
- return (values.uid === attr || values.symbol === attr || values[attr] != null);
14
- });
15
- if (!entry)
16
- return undefined;
17
- const values = entry;
18
- return values.value || values[attr];
19
- }
20
- function hasDisplayValue(value) {
21
- return value != null && String(value).trim() !== '';
22
- }
23
- export default function DocumentMetadata({ document, onDocumentChange, }) {
24
- const { t } = useTranslation('document');
25
- const { metaAttr, normalizeMetadataType, formatMetadataDateForDisplay } = MetadataUtils;
26
- const [editOpen, setEditOpen] = useState(false);
27
- const [metadata, setMetadata] = useState();
28
- const filteredMetadata = useMemo(() => (metadata ?? []).filter((meta) => hasDisplayValue(getDocumentMetaValue(document, metaAttr(meta)))), [metadata, document]);
29
- const fields = useMemo(() => filteredMetadata.map((meta) => {
30
- const attr = metaAttr(meta);
31
- const type = normalizeMetadataType(meta.type);
32
- const base = {
33
- attr,
34
- name: meta.name,
35
- type: type === 'DATE' ? 'datepicker' : meta.type?.toLowerCase() || 'text',
36
- };
37
- if (type === 'DATE') {
38
- return {
39
- ...base,
40
- display: (raw) => formatMetadataDateForDisplay(raw == null ? '' : String(raw)),
41
- };
42
- }
43
- return base;
44
- }), [filteredMetadata]);
45
- const data = useMemo(() => {
46
- const row = {};
47
- filteredMetadata.forEach((meta) => {
48
- const attr = metaAttr(meta);
49
- const raw = getDocumentMetaValue(document, attr);
50
- row[attr] = raw;
51
- });
52
- return row;
53
- }, [filteredMetadata, document]);
54
- useEffect(() => {
55
- metadataService.list(document).then((response) => {
56
- setMetadata(response.data);
57
- });
58
- }, [document]);
59
- return (_jsxs("div", { className: "metadata-container", children: [_jsxs("div", { className: "header", children: [_jsx("div", { className: "title", children: t('metadata.label.title') }), _jsx(Button, { size: "small", onClick: () => setEditOpen(true), text: t('document.button.edit'), icon: "edit", mode: "outlined" })] }), _jsxs("div", { className: "body", children: [filteredMetadata.length > 0 && (_jsx(AppFormInfo, { fields: fields, data: data })), metadata && filteredMetadata.length === 0 && (_jsx(AppPlaceholder, { text: t('placeholder.empty.metadata') }))] }), editOpen && metadata && (_jsx(DocumentMetadataEdit, { document: document, metadata: metadata, onClose: () => setEditOpen(false), onSave: (updated) => onDocumentChange?.(updated) }))] }));
60
- }
@@ -1,2 +0,0 @@
1
- import DocumentMetadata from './DocumentMetadata';
2
- export default DocumentMetadata;
@@ -1,2 +0,0 @@
1
- import DocumentMetadata from './DocumentMetadata';
2
- export default DocumentMetadata;
@@ -1,7 +0,0 @@
1
- .metadata-container {
2
- .body {
3
- height: 90vh;
4
- overflow-y: auto;
5
- padding: 16px;
6
- }
7
- }
@@ -1,11 +0,0 @@
1
- import Metadata from '../../types/Metadata';
2
- import { Document } from '../../deps';
3
- import './style.scss';
4
- type Props = {
5
- document: Document;
6
- metadata: Metadata[];
7
- onClose: () => void;
8
- onSave: (document: Document) => void;
9
- };
10
- export default function DocumentMetadataEdit({ document, metadata, onClose, onSave, }: Props): import("react/jsx-runtime").JSX.Element;
11
- export {};
@@ -1,195 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import MetadataUtils from '../../functions/MetadataUtils';
3
- import documentService from '../../services/DocumentService';
4
- import metadataService from '../../services/MetadataService';
5
- import { useEffect, useMemo, useRef, useState } from 'react';
6
- import { useForm } from 'react-hook-form';
7
- import { useTranslation } from 'react-i18next';
8
- import { AppForm, AppModal, useMessageUtils, } from '../../deps';
9
- import { Button, IconButton, SelectField } from 'tycho-storybook';
10
- import './style.scss';
11
- const PENDING_FIELD = 'val';
12
- const ADD_SELECT_FIELD = 'attr';
13
- export default function DocumentMetadataEdit({ document, metadata, onClose, onSave, }) {
14
- const { t } = useTranslation('document');
15
- const { dispatchMessage, dispatchError } = useMessageUtils();
16
- const { metaAttr, normalizeMetadataType, toAppFormField, toAutocompleteFormValue, normalizeMetadataDateValue, resolveRawFromForm, serializeMetadataValue, compareMetadata, buildInitialEntries, } = MetadataUtils;
17
- const initialAttrsRef = useRef(new Set((document.metadata || []).map((m) => {
18
- const values = m;
19
- return values.uid || values.symbol || values[m.attr];
20
- })));
21
- const modalContentRef = useRef(null);
22
- const syncedEntryAttrsRef = useRef('');
23
- const definitions = useMemo(() => [...metadata].sort(compareMetadata), [metadata]);
24
- const [entries, setEntries] = useState([]);
25
- const [loaded, setLoaded] = useState(false);
26
- const [pendingAttr, setPendingAttr] = useState(null);
27
- const [saving, setSaving] = useState(false);
28
- const pendingFieldRef = useRef(null);
29
- const form = useForm({ defaultValues: {} });
30
- const addSelectForm = useForm({
31
- defaultValues: { [ADD_SELECT_FIELD]: '' },
32
- });
33
- const pendingForm = useForm({
34
- defaultValues: { [PENDING_FIELD]: '' },
35
- });
36
- const pendingMeta = useMemo(() => pendingAttr
37
- ? definitions.find((d) => metaAttr(d) === pendingAttr)
38
- : undefined, [definitions, pendingAttr]);
39
- const selectedAddAttr = addSelectForm.watch(ADD_SELECT_FIELD);
40
- const availableToAdd = useMemo(() => definitions
41
- .filter((d) => !entries.some((e) => e.attr === metaAttr(d)))
42
- .sort((a, b) => a.name.localeCompare(b.name)), [definitions, entries]);
43
- const entryLoadOptions = useMemo(() => {
44
- const base = {};
45
- for (const m of definitions) {
46
- if (normalizeMetadataType(m.type) === 'TEXT') {
47
- const attr = metaAttr(m);
48
- base[attr] = async (query) => {
49
- const r = await metadataService.suggestValues(document.corpus, m.uid, query);
50
- return r.data.map((v) => ({ label: v, value: v }));
51
- };
52
- }
53
- }
54
- return base;
55
- }, [definitions, document.corpus]);
56
- const pendingLoadOptions = useMemo(() => {
57
- const base = {};
58
- if (!pendingMeta || normalizeMetadataType(pendingMeta.type) !== 'TEXT')
59
- return base;
60
- base[PENDING_FIELD] = async (query) => {
61
- const r = await metadataService.suggestValues(document.corpus, pendingMeta.uid, query);
62
- return r.data.map((v) => ({ label: v, value: v }));
63
- };
64
- return base;
65
- }, [pendingMeta, document.corpus]);
66
- const pendingFields = useMemo(() => {
67
- if (!pendingMeta)
68
- return [];
69
- return [toAppFormField(pendingMeta, PENDING_FIELD, t)];
70
- }, [pendingMeta, t]);
71
- const handleRemove = (attr) => {
72
- setEntries((prev) => prev.filter((e) => e.attr !== attr));
73
- if (pendingAttr === attr)
74
- setPendingAttr(null);
75
- };
76
- const handleAddPending = () => {
77
- if (!pendingMeta || pendingAttr == null)
78
- return;
79
- const raw = pendingForm.getValues(PENDING_FIELD);
80
- const val = serializeMetadataValue(pendingMeta, raw);
81
- setEntries((prev) => [
82
- ...prev,
83
- { attr: pendingAttr, meta: pendingMeta, value: val },
84
- ]);
85
- setPendingAttr(null);
86
- addSelectForm.reset({ [ADD_SELECT_FIELD]: '' });
87
- pendingForm.reset({ [PENDING_FIELD]: '' });
88
- };
89
- const buildPayload = (formValues) => {
90
- const domRoot = modalContentRef.current;
91
- const payload = {};
92
- for (const e of entries) {
93
- const raw = resolveRawFromForm(e.meta, e.attr, formValues, domRoot);
94
- payload[e.attr] = serializeMetadataValue(e.meta, raw);
95
- }
96
- for (const uid of initialAttrsRef.current) {
97
- if (!(uid in payload)) {
98
- payload[uid] = '';
99
- }
100
- }
101
- return payload;
102
- };
103
- const submitMetadata = async (formValues) => {
104
- const payload = buildPayload(formValues);
105
- setSaving(true);
106
- try {
107
- await metadataService.update(document.uid, payload);
108
- dispatchMessage({ key: 'update.success', t });
109
- const refreshed = await documentService.get(document.uid);
110
- onSave(refreshed.data);
111
- onClose();
112
- }
113
- catch (err) {
114
- const msg = t('error.metadata.invalid', {
115
- value: err.response.data.details[0],
116
- field: err.response.data.details[1],
117
- type: err.response.data.details[2],
118
- });
119
- dispatchError({ err: msg });
120
- }
121
- finally {
122
- setSaving(false);
123
- }
124
- };
125
- const handleConfirm = () => {
126
- void form.handleSubmit((values) => submitMetadata(values))();
127
- };
128
- useEffect(() => {
129
- setEntries(buildInitialEntries(definitions, document));
130
- setLoaded(true);
131
- syncedEntryAttrsRef.current = '';
132
- }, [definitions, document]);
133
- useEffect(() => {
134
- if (!loaded)
135
- return;
136
- const attrKey = entries
137
- .map((e) => e.attr)
138
- .sort()
139
- .join('|');
140
- if (syncedEntryAttrsRef.current === attrKey)
141
- return;
142
- syncedEntryAttrsRef.current = attrKey;
143
- const prev = form.getValues();
144
- const dirty = form.formState.dirtyFields;
145
- const next = {};
146
- entries.forEach((e) => {
147
- const existing = prev[e.attr];
148
- const type = normalizeMetadataType(e.meta.type);
149
- const isDirty = !!dirty[e.attr];
150
- if (isDirty && existing !== undefined) {
151
- next[e.attr] = existing;
152
- return;
153
- }
154
- const stored = e.value ?? '';
155
- if (type === 'TEXT') {
156
- if (existing != null && typeof existing === 'object') {
157
- next[e.attr] = existing;
158
- }
159
- else {
160
- next[e.attr] = toAutocompleteFormValue(existing != null ? String(existing) : stored);
161
- }
162
- }
163
- else if (type === 'DATE') {
164
- next[e.attr] = normalizeMetadataDateValue(existing != null ? String(existing) : stored);
165
- }
166
- else {
167
- next[e.attr] = existing ?? stored;
168
- }
169
- });
170
- form.reset(next);
171
- }, [entries, loaded]);
172
- useEffect(() => {
173
- if (!pendingMeta)
174
- return;
175
- pendingForm.reset({
176
- [PENDING_FIELD]: normalizeMetadataType(pendingMeta.type) === 'TEXT' ? null : '',
177
- });
178
- }, [pendingMeta, pendingForm]);
179
- useEffect(() => {
180
- if (!pendingMeta)
181
- return;
182
- const timeout = window.setTimeout(() => {
183
- const el = pendingFieldRef.current?.querySelector('input:not([disabled]), textarea:not([disabled]), select:not([disabled])');
184
- el?.focus();
185
- }, 0);
186
- return () => window.clearTimeout(timeout);
187
- }, [pendingMeta]);
188
- useEffect(() => {
189
- setPendingAttr(selectedAddAttr || null);
190
- }, [selectedAddAttr]);
191
- return (_jsx(AppModal, { title: t('metadata.modal.edit.title'), className: "modal-document-metadata", close: onClose, confirm: handleConfirm, disableConfirm: !loaded || saving, disableBackdropClose: true, disableEscapeClose: true, children: _jsxs("div", { className: "document-metadata-edit", ref: modalContentRef, children: [_jsxs("div", { className: "document-metadata-edit-add", children: [_jsx(SelectField, { label: t('metadata.add.select.label'), attr: ADD_SELECT_FIELD, placeholder: t('metadata.add.select.placeholder'), createdForm: addSelectForm, options: availableToAdd.map((def) => ({
192
- label: def.name,
193
- value: metaAttr(def),
194
- })), showEndAdornment: false }), pendingMeta && (_jsxs("div", { className: "document-metadata-edit-pending-field", ref: pendingFieldRef, children: [_jsx(AppForm, { fields: pendingFields, form: pendingForm, runtimeLoadOptions: pendingLoadOptions }), _jsx(Button, { size: "small", mode: "outlined", text: t('metadata.button.add'), onClick: handleAddPending })] }))] }), entries.length > 0 && (_jsxs("div", { className: "document-metadata-edit-list", children: [_jsx("div", { className: "document-metadata-edit-list-label", children: t('metadata.list.label') }), entries.map((e) => (_jsxs("div", { className: "document-metadata-edit-row", "data-metadata-field": e.attr, children: [_jsx("div", { className: "document-metadata-edit-row-field", children: _jsx(AppForm, { fields: [toAppFormField(e.meta, e.attr, t)], form: form, runtimeLoadOptions: entryLoadOptions }) }), _jsx(IconButton, { name: "delete", size: "large", mode: "outlined", color: "danger", title: t('metadata.remove.tooltip'), onClick: () => handleRemove(e.attr) })] }, e.attr)))] }))] }) }));
195
- }
@@ -1,2 +0,0 @@
1
- import DocumentMetadataEdit from './DocumentMetadataEdit';
2
- export default DocumentMetadataEdit;
@@ -1,2 +0,0 @@
1
- import DocumentMetadataEdit from './DocumentMetadataEdit';
2
- export default DocumentMetadataEdit;
@@ -1,58 +0,0 @@
1
- .modal-document-metadata {
2
- width: min(560px, 92vw);
3
- margin-top: 8vh;
4
-
5
- .body {
6
- height: 70vh;
7
- overflow-y: auto;
8
-
9
- .document-metadata-edit {
10
- display: flex;
11
- flex-direction: column;
12
- gap: 24px;
13
-
14
- &-label {
15
- display: block;
16
- font-size: 0.875rem;
17
- margin-bottom: var(--spacing-x-small, 0.25rem);
18
- }
19
-
20
- &-select {
21
- width: 100%;
22
- max-width: 100%;
23
- padding: 0.5rem 0.75rem;
24
- border-radius: var(--radius-100, 4px);
25
- border: 1px solid var(--border-default, #ccc);
26
- background: var(--background-default, #fff);
27
- }
28
-
29
- &-pending-field {
30
- margin-top: var(--spacing-small, 0.5rem);
31
- display: flex;
32
- flex-direction: column;
33
- gap: var(--spacing-small, 0.5rem);
34
- }
35
-
36
- &-list-label {
37
- font-weight: 600;
38
- margin-bottom: var(--spacing-x-small, 0.25rem);
39
- }
40
-
41
- &-row {
42
- display: flex;
43
- align-items: flex-start;
44
- gap: var(--spacing-small, 0.5rem);
45
- margin-bottom: var(--spacing-small, 0.5rem);
46
-
47
- &-field {
48
- flex: 1;
49
- min-width: 0;
50
-
51
- .app-form-container {
52
- width: 100%;
53
- }
54
- }
55
- }
56
- }
57
- }
58
- }
@@ -1,9 +0,0 @@
1
- import { PageStatus } from '../types/PageStatus';
2
- import Page from '../types/Page';
3
- import './style.scss';
4
- type Props = {
5
- page: Page;
6
- onUpdate: (status: PageStatus) => void;
7
- };
8
- export default function PageStatusComponent({ page, onUpdate }: Props): import("react/jsx-runtime").JSX.Element;
9
- export {};
@@ -1,30 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { PageStatusNames } from '../types/PageStatus';
3
- import { useTranslation } from 'react-i18next';
4
- import { Tag } from 'tycho-storybook';
5
- import './style.scss';
6
- const SELECTABLE_STATUSES = [
7
- 'TRANSCRIPTION',
8
- 'EDITION',
9
- 'REVIEW',
10
- 'COMPLETED',
11
- ];
12
- export default function PageStatusComponent({ page, onUpdate }) {
13
- const { t } = useTranslation('page');
14
- const currentStatus = page.status ?? 'EDITION';
15
- const colors = {
16
- blue: 'blue',
17
- green: 'green',
18
- yellow: 'yellow',
19
- violet: 'violet',
20
- gray: 'gray',
21
- };
22
- const colorByStatus = {
23
- TRANSCRIPTION: colors.blue,
24
- EDITION: colors.violet,
25
- REVIEW: colors.yellow,
26
- COMPLETED: colors.green,
27
- };
28
- const statusColor = colorByStatus[currentStatus];
29
- return (_jsx(Tag, { color: statusColor, size: "medium", text: t(PageStatusNames[currentStatus]), className: "page-status-tag" }));
30
- }
@@ -1,2 +0,0 @@
1
- import PageStatusComponent from './PageStatusComponent';
2
- export default PageStatusComponent;
@@ -1,2 +0,0 @@
1
- import PageStatusComponent from './PageStatusComponent';
2
- export default PageStatusComponent;
@@ -1,19 +0,0 @@
1
- .page-status-tag {
2
- cursor: pointer;
3
- }
4
-
5
- .popover-status {
6
- .popover-body {
7
- padding: 8px;
8
-
9
- .options {
10
- display: flex;
11
- flex-direction: column;
12
- gap: 8px;
13
-
14
- > .ds-button {
15
- width: 100%;
16
- }
17
- }
18
- }
19
- }
@@ -1,10 +0,0 @@
1
- import BoundingBox from '../types/BoundingBox';
2
- import { Document } from '../deps';
3
- import './style.scss';
4
- type Props = {
5
- box: BoundingBox;
6
- onClose: () => void;
7
- onRemove: (document: Document) => void;
8
- };
9
- export default function BoxRemoval({ box, onClose, onRemove }: Props): import("react/jsx-runtime").JSX.Element;
10
- export {};
@@ -1,14 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import BoundingBoxService from '../services/BoundingBoxService';
3
- import { useTranslation } from 'react-i18next';
4
- import { AppModalConfirm } from '../deps';
5
- import './style.scss';
6
- export default function BoxRemoval({ box, onClose, onRemove }) {
7
- const { t } = useTranslation('page');
8
- const handleRemovePage = () => {
9
- BoundingBoxService.remove(box).then((response) => {
10
- onRemove(response.data);
11
- });
12
- };
13
- return (_jsx(AppModalConfirm, { title: t('modal.title.page.remove'), subtitle: t('modal.description.page.remove'), onClose: onClose, onConfirm: handleRemovePage }));
14
- }
@@ -1,10 +0,0 @@
1
- import { Document } from '../deps';
2
- import './style.scss';
3
- type Props = {
4
- document: Document;
5
- setDocument: React.Dispatch<React.SetStateAction<Document | undefined>>;
6
- setOpenFile: (b: boolean) => void;
7
- handleChange: (document: Document) => void;
8
- };
9
- export default function Boxes({ document, setDocument, setOpenFile, handleChange, }: Props): import("react/jsx-runtime").JSX.Element;
10
- export {};
@@ -1,65 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import BoundingBoxService from '../services/BoundingBoxService';
3
- import { useEffect, useState } from 'react';
4
- import { useTranslation } from 'react-i18next';
5
- import { AppCard, AppPagination, AppPicture, ToolsUtils, useCorpusUtils, useMessageUtils } from '../deps';
6
- import { Button, IconButton } from 'tycho-storybook';
7
- import BoxRemoval from './BoxRemoval';
8
- import './style.scss';
9
- export default function Boxes({ document, setDocument, setOpenFile, handleChange, }) {
10
- const { t } = useTranslation('page');
11
- const { dispatchMessage, dispatchLoading, isLoading } = useMessageUtils();
12
- const { getCorpus, hasCorpus, hasParameter } = useCorpusUtils();
13
- const [pages, setPages] = useState();
14
- const [removeBox, setRemoveBox] = useState(null);
15
- const [pagination, setPagination] = useState({
16
- pageIndex: 0,
17
- pageSize: 10,
18
- });
19
- const open = (thisBox) => {
20
- setOpenFile(false);
21
- hasCorpus();
22
- ToolsUtils.redirectPage({
23
- corpus: getCorpus(),
24
- tool: document.defaultTool,
25
- uid: thisBox.uid,
26
- hasParameter,
27
- });
28
- };
29
- const handleAddPage = () => {
30
- if (isLoading() || !hasCorpus())
31
- return;
32
- dispatchLoading(true);
33
- BoundingBoxService.create(document.uid, getCorpus()).then(() => {
34
- loadData();
35
- });
36
- };
37
- const handleRemoved = (updated) => {
38
- setDocument((prev) => prev && { ...prev, ...updated });
39
- handleChange(updated);
40
- setRemoveBox(null);
41
- loadData();
42
- };
43
- const loadData = () => {
44
- BoundingBoxService.page(document, pagination.pageIndex, pagination.pageSize).then((r) => {
45
- setPages(r.data);
46
- dispatchLoading(false);
47
- });
48
- };
49
- const validateRemovePage = (thisBox) => {
50
- if (pages?.totalElements === 1) {
51
- dispatchMessage({ key: 'remove.one.page', t });
52
- return;
53
- }
54
- setRemoveBox(thisBox);
55
- };
56
- useEffect(() => {
57
- loadData();
58
- }, [pagination]);
59
- return (_jsxs("div", { className: "pages-container", children: [_jsxs("div", { className: "header", children: [_jsx("div", { className: "title", children: t('pages.label.title') }), _jsx(Button, { size: "small", onClick: handleAddPage, text: t('pages.tooltip.add'), icon: "add", mode: "outlined" })] }), _jsx("div", { className: "body", children: pages &&
60
- pages.content &&
61
- pages.content.map((thisBox, idx) => (_jsx(AppCard, { onClick: () => open(thisBox), footer: _jsxs(_Fragment, { children: [_jsxs("span", { children: [t('pages.label.card'), " ", thisBox.order] }), _jsx(IconButton, { onClick: (e) => {
62
- validateRemovePage(thisBox);
63
- e.stopPropagation();
64
- }, title: t('pages.tooltip.remove'), name: "delete", mode: "ghost", size: "small" })] }), children: _jsx(AppPicture, { src: thisBox.image?.url || '' }) }, idx.valueOf()))) }), _jsx("div", { className: "footer", children: pages && (_jsx(AppPagination, { totalElements: pages.totalElements, pagination: pagination, setPagination: setPagination, hideItensPage: true })) }), removeBox !== null && (_jsx(BoxRemoval, { box: removeBox, onClose: () => setRemoveBox(null), onRemove: handleRemoved }))] }));
65
- }
@@ -1,10 +0,0 @@
1
- import Page from '../types/Page';
2
- import { Document } from '../deps';
3
- import './style.scss';
4
- type Props = {
5
- page: Page;
6
- onClose: () => void;
7
- onRemove: (document: Document) => void;
8
- };
9
- export default function PageRemoval({ page, onClose, onRemove }: Props): import("react/jsx-runtime").JSX.Element;
10
- export {};
@@ -1,15 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import PageService from '../services/PageService';
3
- import { useTranslation } from 'react-i18next';
4
- import { AppModalConfirm } from '../deps';
5
- import './style.scss';
6
- export default function PageRemoval({ page, onClose, onRemove }) {
7
- const { t } = useTranslation('page');
8
- const handleRemovePage = () => {
9
- PageService.remove(page).then((response) => {
10
- onRemove(response.data);
11
- onClose();
12
- });
13
- };
14
- return (_jsx(AppModalConfirm, { title: t('modal.title.page.remove'), subtitle: t('modal.description.page.remove'), onClose: onClose, onConfirm: handleRemovePage }));
15
- }
@@ -1,10 +0,0 @@
1
- import { Document } from '../deps';
2
- import './style.scss';
3
- type Props = {
4
- document: Document;
5
- setDocument: React.Dispatch<React.SetStateAction<Document | undefined>>;
6
- handleChange: (document: Document) => void;
7
- setOpenFile: (b: boolean) => void;
8
- };
9
- export default function Pages({ document, setDocument, setOpenFile, handleChange, }: Props): import("react/jsx-runtime").JSX.Element;
10
- export {};