tycho-components 0.28.11 → 0.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/configs/Localization.d.ts +2 -2
- package/dist/configs/Localization.js +21 -39
- package/dist/configs/index.d.ts +2 -0
- package/dist/configs/index.js +1 -0
- package/dist/configs/types/Document.d.ts +3 -3
- package/dist/configs/types/Document.js +4 -4
- package/dist/features/index.d.ts +15 -32
- package/dist/features/index.js +11 -21
- package/package.json +3 -3
- package/dist/features/DocumentDrawer/Actions/Actions.d.ts +0 -17
- package/dist/features/DocumentDrawer/Actions/Actions.js +0 -121
- package/dist/features/DocumentDrawer/Actions/PageRemoveSentences.d.ts +0 -7
- package/dist/features/DocumentDrawer/Actions/PageRemoveSentences.js +0 -23
- package/dist/features/DocumentDrawer/Actions/index.d.ts +0 -2
- package/dist/features/DocumentDrawer/Actions/index.js +0 -2
- package/dist/features/DocumentDrawer/Actions/style.scss +0 -0
- package/dist/features/DocumentDrawer/AutomaticParser/AutomaticParser.d.ts +0 -8
- package/dist/features/DocumentDrawer/AutomaticParser/AutomaticParser.js +0 -96
- package/dist/features/DocumentDrawer/AutomaticParser/index.d.ts +0 -2
- package/dist/features/DocumentDrawer/AutomaticParser/index.js +0 -2
- package/dist/features/DocumentDrawer/AutomaticParser/style.scss +0 -10
- package/dist/features/DocumentDrawer/DocumentDrawer.d.ts +0 -19
- package/dist/features/DocumentDrawer/DocumentDrawer.js +0 -102
- package/dist/features/DocumentDrawer/DocumentEdit/DocumentEdit.d.ts +0 -35
- package/dist/features/DocumentDrawer/DocumentEdit/DocumentEdit.js +0 -207
- package/dist/features/DocumentDrawer/DocumentEdit/index.d.ts +0 -2
- package/dist/features/DocumentDrawer/DocumentEdit/index.js +0 -1
- package/dist/features/DocumentDrawer/DocumentExport/DocumentExport.d.ts +0 -7
- package/dist/features/DocumentDrawer/DocumentExport/DocumentExport.js +0 -83
- package/dist/features/DocumentDrawer/DocumentExport/ExportInvalidSentences.d.ts +0 -7
- package/dist/features/DocumentDrawer/DocumentExport/ExportInvalidSentences.js +0 -12
- package/dist/features/DocumentDrawer/DocumentExport/ExportTxtTierModal.d.ts +0 -8
- package/dist/features/DocumentDrawer/DocumentExport/ExportTxtTierModal.js +0 -14
- package/dist/features/DocumentDrawer/DocumentExport/index.d.ts +0 -2
- package/dist/features/DocumentDrawer/DocumentExport/index.js +0 -2
- package/dist/features/DocumentDrawer/DocumentExport/style.scss +0 -49
- package/dist/features/DocumentDrawer/DocumentLexicon/DocumentLexicon.d.ts +0 -7
- package/dist/features/DocumentDrawer/DocumentLexicon/DocumentLexicon.js +0 -22
- package/dist/features/DocumentDrawer/DocumentLexicon/index.d.ts +0 -2
- package/dist/features/DocumentDrawer/DocumentLexicon/index.js +0 -2
- package/dist/features/DocumentDrawer/DocumentLexicon/style.scss +0 -38
- package/dist/features/DocumentDrawer/DocumentRemove/DocumentRemove.d.ts +0 -12
- package/dist/features/DocumentDrawer/DocumentRemove/DocumentRemove.js +0 -28
- package/dist/features/DocumentDrawer/DocumentRemove/index.d.ts +0 -2
- package/dist/features/DocumentDrawer/DocumentRemove/index.js +0 -2
- package/dist/features/DocumentDrawer/DocumentRemove/style.scss +0 -0
- package/dist/features/DocumentDrawer/Github/Github.d.ts +0 -8
- package/dist/features/DocumentDrawer/Github/Github.js +0 -11
- package/dist/features/DocumentDrawer/Github/GithubCommit.d.ts +0 -8
- package/dist/features/DocumentDrawer/Github/GithubCommit.js +0 -86
- package/dist/features/DocumentDrawer/Github/index.d.ts +0 -2
- package/dist/features/DocumentDrawer/Github/index.js +0 -2
- package/dist/features/DocumentDrawer/Github/style.scss +0 -31
- package/dist/features/DocumentDrawer/ImageGallery/GalleryImage.d.ts +0 -8
- package/dist/features/DocumentDrawer/ImageGallery/GalleryImage.js +0 -5
- package/dist/features/DocumentDrawer/ImageGallery/GalleryRemoval.d.ts +0 -9
- package/dist/features/DocumentDrawer/ImageGallery/GalleryRemoval.js +0 -14
- package/dist/features/DocumentDrawer/ImageGallery/ImageGallery.d.ts +0 -9
- package/dist/features/DocumentDrawer/ImageGallery/ImageGallery.js +0 -45
- package/dist/features/DocumentDrawer/ImageGallery/index.d.ts +0 -2
- package/dist/features/DocumentDrawer/ImageGallery/index.js +0 -2
- package/dist/features/DocumentDrawer/ImageGallery/style.scss +0 -41
- package/dist/features/DocumentDrawer/Inconsistency/Inconsistency.d.ts +0 -8
- package/dist/features/DocumentDrawer/Inconsistency/Inconsistency.js +0 -18
- package/dist/features/DocumentDrawer/Inconsistency/InconsistencyActions.d.ts +0 -7
- package/dist/features/DocumentDrawer/Inconsistency/InconsistencyActions.js +0 -77
- package/dist/features/DocumentDrawer/Inconsistency/InconsistencyResponse.d.ts +0 -31
- package/dist/features/DocumentDrawer/Inconsistency/InconsistencyResponse.js +0 -39
- package/dist/features/DocumentDrawer/Inconsistency/InconsistencyService.d.ts +0 -6
- package/dist/features/DocumentDrawer/Inconsistency/InconsistencyService.js +0 -8
- package/dist/features/DocumentDrawer/Inconsistency/style.scss +0 -64
- package/dist/features/DocumentDrawer/Info/Info.d.ts +0 -10
- package/dist/features/DocumentDrawer/Info/Info.js +0 -16
- package/dist/features/DocumentDrawer/Info/index.d.ts +0 -2
- package/dist/features/DocumentDrawer/Info/index.js +0 -2
- package/dist/features/DocumentDrawer/Info/style.scss +0 -24
- package/dist/features/DocumentDrawer/Metadata/DocumentMetadata/DocumentMetadata.d.ts +0 -8
- package/dist/features/DocumentDrawer/Metadata/DocumentMetadata/DocumentMetadata.js +0 -60
- package/dist/features/DocumentDrawer/Metadata/DocumentMetadata/index.d.ts +0 -2
- package/dist/features/DocumentDrawer/Metadata/DocumentMetadata/index.js +0 -2
- package/dist/features/DocumentDrawer/Metadata/DocumentMetadata/style.scss +0 -7
- package/dist/features/DocumentDrawer/Metadata/DocumentMetadataEdit/DocumentMetadataEdit.d.ts +0 -11
- package/dist/features/DocumentDrawer/Metadata/DocumentMetadataEdit/DocumentMetadataEdit.js +0 -195
- package/dist/features/DocumentDrawer/Metadata/DocumentMetadataEdit/index.d.ts +0 -2
- package/dist/features/DocumentDrawer/Metadata/DocumentMetadataEdit/index.js +0 -2
- package/dist/features/DocumentDrawer/Metadata/DocumentMetadataEdit/style.scss +0 -58
- package/dist/features/DocumentDrawer/PageStatusComponent/PageStatusComponent.d.ts +0 -9
- package/dist/features/DocumentDrawer/PageStatusComponent/PageStatusComponent.js +0 -30
- package/dist/features/DocumentDrawer/PageStatusComponent/index.d.ts +0 -2
- package/dist/features/DocumentDrawer/PageStatusComponent/index.js +0 -2
- package/dist/features/DocumentDrawer/PageStatusComponent/style.scss +0 -19
- package/dist/features/DocumentDrawer/Pages/BoxRemoval.d.ts +0 -10
- package/dist/features/DocumentDrawer/Pages/BoxRemoval.js +0 -14
- package/dist/features/DocumentDrawer/Pages/Boxes.d.ts +0 -10
- package/dist/features/DocumentDrawer/Pages/Boxes.js +0 -65
- package/dist/features/DocumentDrawer/Pages/PageRemoval.d.ts +0 -10
- package/dist/features/DocumentDrawer/Pages/PageRemoval.js +0 -15
- package/dist/features/DocumentDrawer/Pages/Pages.d.ts +0 -10
- package/dist/features/DocumentDrawer/Pages/Pages.js +0 -67
- package/dist/features/DocumentDrawer/Pages/style.scss +0 -48
- package/dist/features/DocumentDrawer/deps.d.ts +0 -28
- package/dist/features/DocumentDrawer/deps.js +0 -20
- package/dist/features/DocumentDrawer/functions/FileUtils.d.ts +0 -4
- package/dist/features/DocumentDrawer/functions/FileUtils.js +0 -8
- package/dist/features/DocumentDrawer/functions/MetadataUtils.d.ts +0 -41
- package/dist/features/DocumentDrawer/functions/MetadataUtils.js +0 -192
- package/dist/features/DocumentDrawer/index.d.ts +0 -7
- package/dist/features/DocumentDrawer/index.js +0 -4
- package/dist/features/DocumentDrawer/localization/ActionsTexts.d.ts +0 -119
- package/dist/features/DocumentDrawer/localization/ActionsTexts.js +0 -119
- package/dist/features/DocumentDrawer/localization/DocumentTexts.d.ts +0 -137
- package/dist/features/DocumentDrawer/localization/DocumentTexts.js +0 -137
- package/dist/features/DocumentDrawer/localization/ExportTexts.d.ts +0 -74
- package/dist/features/DocumentDrawer/localization/ExportTexts.js +0 -74
- package/dist/features/DocumentDrawer/localization/GithubTexts.d.ts +0 -35
- package/dist/features/DocumentDrawer/localization/GithubTexts.js +0 -35
- package/dist/features/DocumentDrawer/localization/InconsistencyTexts.d.ts +0 -101
- package/dist/features/DocumentDrawer/localization/InconsistencyTexts.js +0 -101
- package/dist/features/DocumentDrawer/localization/PageTexts.d.ts +0 -45
- package/dist/features/DocumentDrawer/localization/PageTexts.js +0 -45
- package/dist/features/DocumentDrawer/localization/ParserTexts.d.ts +0 -30
- package/dist/features/DocumentDrawer/localization/ParserTexts.js +0 -30
- package/dist/features/DocumentDrawer/services/AutomaticParserService.d.ts +0 -8
- package/dist/features/DocumentDrawer/services/AutomaticParserService.js +0 -9
- package/dist/features/DocumentDrawer/services/BoundingBoxService.d.ts +0 -11
- package/dist/features/DocumentDrawer/services/BoundingBoxService.js +0 -20
- package/dist/features/DocumentDrawer/services/DocumentService.d.ts +0 -13
- package/dist/features/DocumentDrawer/services/DocumentService.js +0 -20
- package/dist/features/DocumentDrawer/services/ExportService.d.ts +0 -11
- package/dist/features/DocumentDrawer/services/ExportService.js +0 -22
- package/dist/features/DocumentDrawer/services/GithubService.d.ts +0 -8
- package/dist/features/DocumentDrawer/services/GithubService.js +0 -12
- package/dist/features/DocumentDrawer/services/ImageService.d.ts +0 -8
- package/dist/features/DocumentDrawer/services/ImageService.js +0 -12
- package/dist/features/DocumentDrawer/services/LexiconService.d.ts +0 -7
- package/dist/features/DocumentDrawer/services/LexiconService.js +0 -6
- package/dist/features/DocumentDrawer/services/MetadataService.d.ts +0 -11
- package/dist/features/DocumentDrawer/services/MetadataService.js +0 -18
- package/dist/features/DocumentDrawer/services/PageService.d.ts +0 -13
- package/dist/features/DocumentDrawer/services/PageService.js +0 -19
- package/dist/features/DocumentDrawer/services/SentenceService.d.ts +0 -6
- package/dist/features/DocumentDrawer/services/SentenceService.js +0 -6
- package/dist/features/DocumentDrawer/style.scss +0 -192
- package/dist/features/DocumentDrawer/types/BoundingBox.d.ts +0 -8
- package/dist/features/DocumentDrawer/types/BoundingBox.js +0 -1
- package/dist/features/DocumentDrawer/types/CatalogSearchFilter.d.ts +0 -15
- package/dist/features/DocumentDrawer/types/CatalogSearchFilter.js +0 -16
- package/dist/features/DocumentDrawer/types/Category.d.ts +0 -16
- package/dist/features/DocumentDrawer/types/Category.js +0 -5
- package/dist/features/DocumentDrawer/types/DocumentDrawerActionId.d.ts +0 -3
- package/dist/features/DocumentDrawer/types/DocumentDrawerActionId.js +0 -14
- package/dist/features/DocumentDrawer/types/DocumentStatus.d.ts +0 -7
- package/dist/features/DocumentDrawer/types/DocumentStatus.js +0 -6
- package/dist/features/DocumentDrawer/types/DocumentUpdateRequest.d.ts +0 -13
- package/dist/features/DocumentDrawer/types/DocumentUpdateRequest.js +0 -1
- package/dist/features/DocumentDrawer/types/Export.d.ts +0 -30
- package/dist/features/DocumentDrawer/types/Export.js +0 -46
- package/dist/features/DocumentDrawer/types/Lexicon.d.ts +0 -6
- package/dist/features/DocumentDrawer/types/Lexicon.js +0 -1
- package/dist/features/DocumentDrawer/types/LexiconResponse.d.ts +0 -6
- package/dist/features/DocumentDrawer/types/LexiconResponse.js +0 -1
- package/dist/features/DocumentDrawer/types/Metadata.d.ts +0 -22
- package/dist/features/DocumentDrawer/types/Metadata.js +0 -8
- package/dist/features/DocumentDrawer/types/Page.d.ts +0 -10
- package/dist/features/DocumentDrawer/types/Page.js +0 -1
- package/dist/features/DocumentDrawer/types/PageStatus.d.ts +0 -9
- package/dist/features/DocumentDrawer/types/PageStatus.js +0 -8
- package/dist/features/DocumentDrawer/types/Parser.d.ts +0 -18
- package/dist/features/DocumentDrawer/types/Parser.js +0 -21
- package/dist/features/DocumentDrawer/types/Query.d.ts +0 -6
- package/dist/features/DocumentDrawer/types/Query.js +0 -1
- package/dist/features/DocumentDrawer/types/Sentence.d.ts +0 -4
- package/dist/features/DocumentDrawer/types/Sentence.js +0 -1
- package/dist/features/Participants/ParticipantCreate/ParticipantCreate.d.ts +0 -8
- package/dist/features/Participants/ParticipantCreate/ParticipantCreate.js +0 -44
- package/dist/features/Participants/ParticipantCreate/index.d.ts +0 -2
- package/dist/features/Participants/ParticipantCreate/index.js +0 -2
- package/dist/features/Participants/ParticipantRemove/ParticipantRemove.d.ts +0 -11
- package/dist/features/Participants/ParticipantRemove/ParticipantRemove.js +0 -39
- package/dist/features/Participants/ParticipantRemove/index.d.ts +0 -2
- package/dist/features/Participants/ParticipantRemove/index.js +0 -2
- package/dist/features/Participants/ParticipantRemove/style.scss +0 -15
- package/dist/features/Participants/ParticipantService.d.ts +0 -10
- package/dist/features/Participants/ParticipantService.js +0 -19
- package/dist/features/Participants/Participants.d.ts +0 -10
- package/dist/features/Participants/Participants.js +0 -134
- package/dist/features/Participants/index.d.ts +0 -2
- package/dist/features/Participants/index.js +0 -2
- package/dist/features/Participants/style.scss +0 -51
- package/dist/features/SentenceSplit/SentenceSplit.d.ts +0 -33
- package/dist/features/SentenceSplit/SentenceSplit.js +0 -191
- package/dist/features/SentenceSplit/SentenceSplitAudio/SentenceSplitAudioStep.d.ts +0 -9
- package/dist/features/SentenceSplit/SentenceSplitAudio/SentenceSplitAudioStep.js +0 -38
- package/dist/features/SentenceSplit/SentenceSplitAudio/index.d.ts +0 -2
- package/dist/features/SentenceSplit/SentenceSplitAudio/index.js +0 -2
- package/dist/features/SentenceSplit/SentenceSplitAudio/style.scss +0 -29
- package/dist/features/SentenceSplit/SentenceSplitChoose/SentenceSplitChoose.d.ts +0 -10
- package/dist/features/SentenceSplit/SentenceSplitChoose/SentenceSplitChoose.js +0 -23
- package/dist/features/SentenceSplit/SentenceSplitChoose/index.d.ts +0 -2
- package/dist/features/SentenceSplit/SentenceSplitChoose/index.js +0 -2
- package/dist/features/SentenceSplit/SentenceSplitChoose/style.scss +0 -25
- package/dist/features/SentenceSplit/SentenceSplitCommentUtils.d.ts +0 -21
- package/dist/features/SentenceSplit/SentenceSplitCommentUtils.js +0 -77
- package/dist/features/SentenceSplit/SentenceSplitComments/SentenceSplitCommentBlock.d.ts +0 -7
- package/dist/features/SentenceSplit/SentenceSplitComments/SentenceSplitCommentBlock.js +0 -6
- package/dist/features/SentenceSplit/SentenceSplitComments/SentenceSplitComments.d.ts +0 -8
- package/dist/features/SentenceSplit/SentenceSplitComments/SentenceSplitComments.js +0 -37
- package/dist/features/SentenceSplit/SentenceSplitComments/SentenceSplitCommentsStep.d.ts +0 -11
- package/dist/features/SentenceSplit/SentenceSplitComments/SentenceSplitCommentsStep.js +0 -72
- package/dist/features/SentenceSplit/SentenceSplitComments/SentenceSplitCommentsWords.d.ts +0 -9
- package/dist/features/SentenceSplit/SentenceSplitComments/SentenceSplitCommentsWords.js +0 -15
- package/dist/features/SentenceSplit/SentenceSplitComments/index.d.ts +0 -2
- package/dist/features/SentenceSplit/SentenceSplitComments/index.js +0 -2
- package/dist/features/SentenceSplit/SentenceSplitComments/style.scss +0 -126
- package/dist/features/SentenceSplit/SentenceSplitPreview/SentenceSplitPreview.d.ts +0 -10
- package/dist/features/SentenceSplit/SentenceSplitPreview/SentenceSplitPreview.js +0 -10
- package/dist/features/SentenceSplit/SentenceSplitPreview/SentenceSplitPreviewStep.d.ts +0 -11
- package/dist/features/SentenceSplit/SentenceSplitPreview/SentenceSplitPreviewStep.js +0 -24
- package/dist/features/SentenceSplit/SentenceSplitPreview/index.d.ts +0 -2
- package/dist/features/SentenceSplit/SentenceSplitPreview/index.js +0 -2
- package/dist/features/SentenceSplit/SentenceSplitPreview/style.scss +0 -24
- package/dist/features/SentenceSplit/SentenceSplitService.d.ts +0 -13
- package/dist/features/SentenceSplit/SentenceSplitService.js +0 -13
- package/dist/features/SentenceSplit/SentenceSplitTranslations/SentenceSplitTranslations.d.ts +0 -12
- package/dist/features/SentenceSplit/SentenceSplitTranslations/SentenceSplitTranslations.js +0 -15
- package/dist/features/SentenceSplit/SentenceSplitTranslations/SentenceSplitTranslationsStep.d.ts +0 -10
- package/dist/features/SentenceSplit/SentenceSplitTranslations/SentenceSplitTranslationsStep.js +0 -8
- package/dist/features/SentenceSplit/SentenceSplitTranslations/index.d.ts +0 -2
- package/dist/features/SentenceSplit/SentenceSplitTranslations/index.js +0 -2
- package/dist/features/SentenceSplit/SentenceSplitTranslations/style.scss +0 -23
- package/dist/features/SentenceSplit/SentenceSplitUtils.d.ts +0 -6
- package/dist/features/SentenceSplit/SentenceSplitUtils.js +0 -17
- package/dist/features/SentenceSplit/index.d.ts +0 -2
- package/dist/features/SentenceSplit/index.js +0 -2
- package/dist/features/SentenceSplit/localization/SentenceSplitTexts.d.ts +0 -107
- package/dist/features/SentenceSplit/localization/SentenceSplitTexts.js +0 -107
- package/dist/features/SentenceSplit/style.scss +0 -173
- package/dist/features/SentenceSplit/types/Language.d.ts +0 -6
- package/dist/features/SentenceSplit/types/Language.js +0 -1
- package/dist/features/SentenceSplit/types/SentenceSplitRequest.d.ts +0 -20
- package/dist/features/SentenceSplit/types/SentenceSplitRequest.js +0 -16
- /package/dist/{features/Participants → configs}/types/Participant.d.ts +0 -0
- /package/dist/{features/Participants → configs}/types/Participant.js +0 -0
|
@@ -2,7 +2,7 @@ export declare const commonResources: {
|
|
|
2
2
|
en: {
|
|
3
3
|
[k: string]: Record<string, unknown>;
|
|
4
4
|
};
|
|
5
|
-
|
|
5
|
+
"pt-BR": {
|
|
6
6
|
[k: string]: Record<string, unknown>;
|
|
7
7
|
};
|
|
8
8
|
it: {
|
|
@@ -13,7 +13,7 @@ export declare const featureResources: {
|
|
|
13
13
|
en: {
|
|
14
14
|
[k: string]: Record<string, unknown>;
|
|
15
15
|
};
|
|
16
|
-
|
|
16
|
+
"pt-BR": {
|
|
17
17
|
[k: string]: Record<string, unknown>;
|
|
18
18
|
};
|
|
19
19
|
it: {
|
|
@@ -1,30 +1,22 @@
|
|
|
1
|
-
import i18n from
|
|
2
|
-
import languageDetector from
|
|
3
|
-
import { initReactI18next } from
|
|
4
|
-
import { BaseTexts } from
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { ParticipantsTexts } from
|
|
13
|
-
import { SentenceTexts } from
|
|
14
|
-
import { TreeTexts } from
|
|
15
|
-
import {
|
|
16
|
-
import { SentenceSplitTexts } from '../features/SentenceSplit/localization/SentenceSplitTexts';
|
|
17
|
-
import { DocumentTexts } from '../features/DocumentDrawer/localization/DocumentTexts';
|
|
18
|
-
import { ActionsTexts } from '../features/DocumentDrawer/localization/ActionsTexts';
|
|
19
|
-
import PageTexts from '../features/DocumentDrawer/localization/PageTexts';
|
|
20
|
-
import { ExportTexts } from '../features/DocumentDrawer/localization/ExportTexts';
|
|
21
|
-
import { GithubTexts } from '../features/DocumentDrawer/localization/GithubTexts';
|
|
22
|
-
import ParserTexts from '../features/DocumentDrawer/localization/ParserTexts';
|
|
23
|
-
import { InconsistencyTexts } from '../features/DocumentDrawer/localization/InconsistencyTexts';
|
|
1
|
+
import i18n from "i18next";
|
|
2
|
+
import languageDetector from "i18next-browser-languagedetector";
|
|
3
|
+
import { initReactI18next } from "react-i18next";
|
|
4
|
+
import { BaseTexts } from "./localization/BaseTexts";
|
|
5
|
+
import { CommentsTexts } from "./localization/CommentsTexts";
|
|
6
|
+
import { CommonTexts } from "./localization/CommonTexts";
|
|
7
|
+
import { ConsentTexts } from "./localization/ConsentTexts";
|
|
8
|
+
import { HeaderAppTexts } from "./localization/HeaderAppTexts";
|
|
9
|
+
import { HeaderTexts } from "./localization/HeaderTexts";
|
|
10
|
+
import { HelpTexts } from "./localization/HelpTexts";
|
|
11
|
+
import { ParametersTexts } from "./localization/ParametersTexts";
|
|
12
|
+
import { ParticipantsTexts } from "./localization/ParticipantsTexts";
|
|
13
|
+
import { SentenceTexts } from "./localization/SentenceTexts";
|
|
14
|
+
import { TreeTexts } from "./localization/TreeTexts";
|
|
15
|
+
import { UploadTexts } from "./localization/UploadTexts";
|
|
24
16
|
function buildResources(namespaces) {
|
|
25
17
|
return {
|
|
26
18
|
en: Object.fromEntries(Object.entries(namespaces).map(([key, texts]) => [key, texts.en])),
|
|
27
|
-
|
|
19
|
+
"pt-BR": Object.fromEntries(Object.entries(namespaces).map(([key, texts]) => [key, texts["pt-BR"]])),
|
|
28
20
|
it: Object.fromEntries(Object.entries(namespaces).map(([key, texts]) => [key, texts.it])),
|
|
29
21
|
};
|
|
30
22
|
}
|
|
@@ -32,7 +24,7 @@ const CORE_NAMESPACES = {
|
|
|
32
24
|
base: BaseTexts,
|
|
33
25
|
common: CommonTexts,
|
|
34
26
|
header: HeaderTexts,
|
|
35
|
-
|
|
27
|
+
"header-app": HeaderAppTexts,
|
|
36
28
|
upload: UploadTexts,
|
|
37
29
|
help: HelpTexts,
|
|
38
30
|
consent: ConsentTexts,
|
|
@@ -43,19 +35,11 @@ const FEATURE_NAMESPACES = {
|
|
|
43
35
|
tree: TreeTexts,
|
|
44
36
|
sentence: SentenceTexts,
|
|
45
37
|
parameters: ParametersTexts,
|
|
46
|
-
sentenceSplit: SentenceSplitTexts,
|
|
47
|
-
document: DocumentTexts,
|
|
48
|
-
actions: ActionsTexts,
|
|
49
|
-
page: PageTexts,
|
|
50
|
-
export: ExportTexts,
|
|
51
|
-
github: GithubTexts,
|
|
52
|
-
parser: ParserTexts,
|
|
53
|
-
inconsistency: InconsistencyTexts,
|
|
54
38
|
};
|
|
55
39
|
export const commonResources = buildResources(CORE_NAMESPACES);
|
|
56
40
|
export const featureResources = buildResources(FEATURE_NAMESPACES);
|
|
57
41
|
export function mergeResources(core = commonResources, features = featureResources) {
|
|
58
|
-
const locales = [
|
|
42
|
+
const locales = ["en", "pt-BR", "it"];
|
|
59
43
|
return Object.fromEntries(locales.map((locale) => [
|
|
60
44
|
locale,
|
|
61
45
|
{
|
|
@@ -69,11 +53,9 @@ export function commonLocalization(includeFeatures = true) {
|
|
|
69
53
|
.use(initReactI18next)
|
|
70
54
|
.use(languageDetector)
|
|
71
55
|
.init({
|
|
72
|
-
resources: includeFeatures
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
fallbackLng: 'en',
|
|
76
|
-
defaultNS: 'common',
|
|
56
|
+
resources: includeFeatures ? mergeResources() : commonResources,
|
|
57
|
+
fallbackLng: "en",
|
|
58
|
+
defaultNS: "common",
|
|
77
59
|
interpolation: {
|
|
78
60
|
escapeValue: false,
|
|
79
61
|
},
|
package/dist/configs/index.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export { CorpusStatusNames } from './types/CorpusStatus';
|
|
|
10
10
|
export type { CorpusStatus } from './types/CorpusStatus';
|
|
11
11
|
export { DocumentStatusNames } from './types/Document';
|
|
12
12
|
export type { DocumentStatus, default as Document } from './types/Document';
|
|
13
|
+
export type { default as Participant, ParticipantCreateRequest, ParticipantUpdateRequest, } from './types/Participant';
|
|
14
|
+
export { EMPTY_PARTICIPANT } from './types/Participant';
|
|
13
15
|
export { CorpusImageTypeNames } from './types/CorpusImage';
|
|
14
16
|
export type { CorpusImage, CorpusImageType } from './types/CorpusImage';
|
|
15
17
|
export { DEFAULT_EDITION_TIERS, EditionTiers, StructuralEditionTiers, isStructuralEditionTier, } from './types/EditionTiers';
|
package/dist/configs/index.js
CHANGED
|
@@ -7,6 +7,7 @@ export { default as ParserListService } from './services/ParserListService';
|
|
|
7
7
|
export { default as ProfileService } from './services/ProfileService';
|
|
8
8
|
export { CorpusStatusNames } from './types/CorpusStatus';
|
|
9
9
|
export { DocumentStatusNames } from './types/Document';
|
|
10
|
+
export { EMPTY_PARTICIPANT } from './types/Participant';
|
|
10
11
|
export { CorpusImageTypeNames } from './types/CorpusImage';
|
|
11
12
|
export { DEFAULT_EDITION_TIERS, EditionTiers, StructuralEditionTiers, isStructuralEditionTier, } from './types/EditionTiers';
|
|
12
13
|
export { SentenceStatusNames } from './types/SentenceStatus';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Participant from
|
|
2
|
-
import { PlatformTools } from
|
|
3
|
-
export type DocumentStatus =
|
|
1
|
+
import Participant from './Participant';
|
|
2
|
+
import { PlatformTools } from '../../functions/ToolsUtils';
|
|
3
|
+
export type DocumentStatus = 'EDITING' | 'EDITED' | 'SYNTACTIC' | 'COMPLETED';
|
|
4
4
|
export declare const DocumentStatusNames: {
|
|
5
5
|
EDITING: string;
|
|
6
6
|
EDITED: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const DocumentStatusNames = {
|
|
2
|
-
EDITING:
|
|
3
|
-
EDITED:
|
|
4
|
-
SYNTACTIC:
|
|
5
|
-
COMPLETED:
|
|
2
|
+
EDITING: 'common:document.status.editing',
|
|
3
|
+
EDITED: 'common:document.status.edited',
|
|
4
|
+
SYNTACTIC: 'common:document.status.syntactic',
|
|
5
|
+
COMPLETED: 'common:document.status.completed',
|
|
6
6
|
};
|
package/dist/features/index.d.ts
CHANGED
|
@@ -1,32 +1,15 @@
|
|
|
1
|
-
export { default as CommentComponent } from
|
|
2
|
-
export { default as HeaderNotifications } from
|
|
3
|
-
export type { Comment, CommentRequest } from
|
|
4
|
-
export { default as CommentService } from
|
|
5
|
-
export { default as Parameters } from
|
|
6
|
-
export { default as
|
|
7
|
-
export
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export { default as
|
|
11
|
-
export { default as
|
|
12
|
-
export type {
|
|
13
|
-
export { default as
|
|
14
|
-
export {
|
|
15
|
-
export type {
|
|
16
|
-
export { default as CytoscapeMenuCanvas } from './CytoscapeMenu/CytoscapeMenuCanvas';
|
|
17
|
-
export { registerCytoscapeContextMenus, contextMenus, } from './CytoscapeMenu';
|
|
18
|
-
export type { CytoscapeContextMenuOptions, MenuItemOption, ContextMenusInstance, } from './CytoscapeMenu';
|
|
19
|
-
export { default as SentenceSplit } from './SentenceSplit';
|
|
20
|
-
export { default as SentenceSplitService } from './SentenceSplit/SentenceSplitService';
|
|
21
|
-
export type { SentenceSplitRequest, SentenceSplitCommentAction, SplitComment, } from './SentenceSplit/types/SentenceSplitRequest';
|
|
22
|
-
export { emptySentenceSplitRequest, isSentenceSplitCommentAction, SENTENCE_SPLIT_COMMENT_ACTIONS, } from './SentenceSplit/types/SentenceSplitRequest';
|
|
23
|
-
export type { default as SentenceSplitLanguage } from './SentenceSplit/types/Language';
|
|
24
|
-
export type { SentenceSplitTranslationsInput, SentenceSplitIconButtonProps, } from './SentenceSplit/SentenceSplit';
|
|
25
|
-
export { SentenceSplitTexts } from './SentenceSplit/localization/SentenceSplitTexts';
|
|
26
|
-
export { default as DocumentDrawer } from './DocumentDrawer';
|
|
27
|
-
export { default as DocumentExport } from './DocumentDrawer/DocumentExport';
|
|
28
|
-
export type { DocumentDrawerProps } from './DocumentDrawer';
|
|
29
|
-
export type { DocumentDrawerActionId } from './DocumentDrawer/types/DocumentDrawerActionId';
|
|
30
|
-
export { DOCUMENT_DRAWER_ACTION_IDS, isDocumentDrawerActionId, } from './DocumentDrawer/types/DocumentDrawerActionId';
|
|
31
|
-
export type { default as CatalogSearchFilter } from './DocumentDrawer/types/CatalogSearchFilter';
|
|
32
|
-
export { emptyCatalogSearchFilter, hasActiveCatalogFilter, } from './DocumentDrawer/types/CatalogSearchFilter';
|
|
1
|
+
export { default as CommentComponent } from "./Comments";
|
|
2
|
+
export { default as HeaderNotifications } from "./Comments/HeaderNotifications";
|
|
3
|
+
export type { Comment, CommentRequest } from "./Comments/types/Comment";
|
|
4
|
+
export { default as CommentService } from "./Comments/CommentService";
|
|
5
|
+
export { default as Parameters } from "./Parameters";
|
|
6
|
+
export { default as SentenceView } from "./SentenceView";
|
|
7
|
+
export { default as TreeView } from "./TreeView";
|
|
8
|
+
export { default as CytoscapeTreeConverter } from "./TreeView/cytoscape/CytoscapeTreeConverter";
|
|
9
|
+
export type { CytoscapeTreeConverterOptions } from "./TreeView/cytoscape/CytoscapeTreeConverter";
|
|
10
|
+
export { default as SyntreesCytoscape } from "./TreeView/cytoscape/SyntreesCytoscape";
|
|
11
|
+
export { default as TreeViewSearch } from "./TreeView/TreeViewSearch/TreeViewSearch";
|
|
12
|
+
export type { SearchCriteria } from "./TreeView/TreeViewSearch/TreeViewSearch";
|
|
13
|
+
export { default as CytoscapeMenuCanvas } from "./CytoscapeMenu/CytoscapeMenuCanvas";
|
|
14
|
+
export { registerCytoscapeContextMenus, contextMenus } from "./CytoscapeMenu";
|
|
15
|
+
export type { CytoscapeContextMenuOptions, MenuItemOption, ContextMenusInstance, } from "./CytoscapeMenu";
|
package/dist/features/index.js
CHANGED
|
@@ -1,21 +1,11 @@
|
|
|
1
|
-
export { default as CommentComponent } from
|
|
2
|
-
export { default as HeaderNotifications } from
|
|
3
|
-
export { default as CommentService } from
|
|
4
|
-
export { default as Parameters } from
|
|
5
|
-
export { default as
|
|
6
|
-
export {
|
|
7
|
-
export { default as
|
|
8
|
-
export { default as
|
|
9
|
-
export { default as
|
|
10
|
-
export { default as
|
|
11
|
-
export {
|
|
12
|
-
export { default as CytoscapeMenuCanvas } from './CytoscapeMenu/CytoscapeMenuCanvas';
|
|
13
|
-
export { registerCytoscapeContextMenus, contextMenus, } from './CytoscapeMenu';
|
|
14
|
-
export { default as SentenceSplit } from './SentenceSplit';
|
|
15
|
-
export { default as SentenceSplitService } from './SentenceSplit/SentenceSplitService';
|
|
16
|
-
export { emptySentenceSplitRequest, isSentenceSplitCommentAction, SENTENCE_SPLIT_COMMENT_ACTIONS, } from './SentenceSplit/types/SentenceSplitRequest';
|
|
17
|
-
export { SentenceSplitTexts } from './SentenceSplit/localization/SentenceSplitTexts';
|
|
18
|
-
export { default as DocumentDrawer } from './DocumentDrawer';
|
|
19
|
-
export { default as DocumentExport } from './DocumentDrawer/DocumentExport';
|
|
20
|
-
export { DOCUMENT_DRAWER_ACTION_IDS, isDocumentDrawerActionId, } from './DocumentDrawer/types/DocumentDrawerActionId';
|
|
21
|
-
export { emptyCatalogSearchFilter, hasActiveCatalogFilter, } from './DocumentDrawer/types/CatalogSearchFilter';
|
|
1
|
+
export { default as CommentComponent } from "./Comments";
|
|
2
|
+
export { default as HeaderNotifications } from "./Comments/HeaderNotifications";
|
|
3
|
+
export { default as CommentService } from "./Comments/CommentService";
|
|
4
|
+
export { default as Parameters } from "./Parameters";
|
|
5
|
+
export { default as SentenceView } from "./SentenceView";
|
|
6
|
+
export { default as TreeView } from "./TreeView";
|
|
7
|
+
export { default as CytoscapeTreeConverter } from "./TreeView/cytoscape/CytoscapeTreeConverter";
|
|
8
|
+
export { default as SyntreesCytoscape } from "./TreeView/cytoscape/SyntreesCytoscape";
|
|
9
|
+
export { default as TreeViewSearch } from "./TreeView/TreeViewSearch/TreeViewSearch";
|
|
10
|
+
export { default as CytoscapeMenuCanvas } from "./CytoscapeMenu/CytoscapeMenuCanvas";
|
|
11
|
+
export { registerCytoscapeContextMenus, contextMenus } from "./CytoscapeMenu";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tycho-components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.29.1",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"react-i18next": "^13.0.2",
|
|
83
83
|
"react-router-dom": "^6.14.2",
|
|
84
84
|
"react-toastify": "^9.1.3",
|
|
85
|
-
"tycho-storybook": "0.10.
|
|
85
|
+
"tycho-storybook": "0.10.3",
|
|
86
86
|
"wavesurfer-react": "^2.2.2",
|
|
87
87
|
"wavesurfer.js": "^6.6.3"
|
|
88
88
|
},
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"react-toastify": "^9.1.3",
|
|
112
112
|
"sass-embedded": "^1.97.2",
|
|
113
113
|
"storybook": "^10.1.11",
|
|
114
|
-
"tycho-storybook": "^0.10.
|
|
114
|
+
"tycho-storybook": "^0.10.3",
|
|
115
115
|
"typescript": "^5.7.3",
|
|
116
116
|
"vite": "^7.0.0",
|
|
117
117
|
"vitest": "^3.2.6",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import CatalogSearchFilter from '../types/CatalogSearchFilter';
|
|
2
|
-
import type { DocumentDrawerActionId } from '../types/DocumentDrawerActionId';
|
|
3
|
-
import { Document } from '../deps';
|
|
4
|
-
import './style.scss';
|
|
5
|
-
type Props = {
|
|
6
|
-
document: Document;
|
|
7
|
-
setOpenFile: (b: boolean) => void;
|
|
8
|
-
setFilter: (p: CatalogSearchFilter) => void;
|
|
9
|
-
handleClickDocument: (uid: string) => void;
|
|
10
|
-
useGrid: boolean;
|
|
11
|
-
pageUid?: string;
|
|
12
|
-
pageOrder?: number;
|
|
13
|
-
onPageReload?: () => void;
|
|
14
|
-
hiddenActions?: DocumentDrawerActionId[];
|
|
15
|
-
};
|
|
16
|
-
export default function Actions({ document, setOpenFile, setFilter, handleClickDocument, useGrid, pageUid, pageOrder, onPageReload, hiddenActions, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export {};
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import AutomaticParser from '../AutomaticParser';
|
|
3
|
-
import DocumentRemove from '../DocumentRemove';
|
|
4
|
-
import InconsistencyActions from '../Inconsistency/InconsistencyActions';
|
|
5
|
-
import DocumentService from '../services/DocumentService';
|
|
6
|
-
import SentenceService from '../services/SentenceService';
|
|
7
|
-
import PageRemoveSentences from './PageRemoveSentences';
|
|
8
|
-
import { useMemo, useState } from 'react';
|
|
9
|
-
import { useTranslation } from 'react-i18next';
|
|
10
|
-
import { ToolsUtils, useCorpusUtils, useMessageUtils } from '../deps';
|
|
11
|
-
import { Icon } from 'tycho-storybook';
|
|
12
|
-
import './style.scss';
|
|
13
|
-
export default function Actions({ document, setOpenFile, setFilter, handleClickDocument, useGrid, pageUid, pageOrder, onPageReload, hiddenActions = [], }) {
|
|
14
|
-
const { t } = useTranslation('actions');
|
|
15
|
-
const { getCorpus } = useCorpusUtils();
|
|
16
|
-
const [openRemove, setOpenRemove] = useState(false);
|
|
17
|
-
const [openRemoveSentences, setOpenRemoveSentences] = useState(false);
|
|
18
|
-
const { dispatchError, dispatchMessage } = useMessageUtils();
|
|
19
|
-
const [openAutomatic, setOpenAutomatic] = useState(false);
|
|
20
|
-
const hidden = useMemo(() => new Set(hiddenActions), [hiddenActions]);
|
|
21
|
-
const navigateSameWindow = (url) => {
|
|
22
|
-
window.location.assign(url);
|
|
23
|
-
};
|
|
24
|
-
const handleResume = () => {
|
|
25
|
-
SentenceService.resume(document.uid).then((r) => {
|
|
26
|
-
if (!r.data) {
|
|
27
|
-
dispatchError({ err: 'warning.syntactic.review', t });
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
navigateSameWindow(`${import.meta.env.VITE_APP_REVISION_URL}/tree/${r.data.uid}`);
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
const handleReview = () => {
|
|
34
|
-
const baseUrl = import.meta.env.VITE_APP_REVISION_URL;
|
|
35
|
-
const url = document.defaultTool === 'DESIGN'
|
|
36
|
-
? `${baseUrl}/box/${document.uid}`
|
|
37
|
-
: `${baseUrl}/${document.uid}`;
|
|
38
|
-
navigateSameWindow(url);
|
|
39
|
-
};
|
|
40
|
-
const handleDocuments = () => {
|
|
41
|
-
window.location.href = `${import.meta.env.VITE_APP_CATALOG_URL}/${getCorpus().uid}`;
|
|
42
|
-
};
|
|
43
|
-
const handleTranscription = () => {
|
|
44
|
-
if (!pageUid) {
|
|
45
|
-
dispatchError({ err: 'error.page.required', t });
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
setOpenRemoveSentences(true);
|
|
49
|
-
};
|
|
50
|
-
const handleSyncSearch = () => {
|
|
51
|
-
DocumentService.syncSearch(document.uid)
|
|
52
|
-
.then(() => dispatchMessage({ key: 'sync.search.success', t }))
|
|
53
|
-
.catch(() => dispatchError({ err: 'error.unknown', t }));
|
|
54
|
-
};
|
|
55
|
-
const actionOptions = [
|
|
56
|
-
{
|
|
57
|
-
id: 'documents',
|
|
58
|
-
iconName: 'list',
|
|
59
|
-
title: t('label.documents.title'),
|
|
60
|
-
description: t('label.documents.description'),
|
|
61
|
-
onClick: handleDocuments,
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
id: 'edition',
|
|
65
|
-
iconName: ToolsUtils.getIcon(document.defaultTool),
|
|
66
|
-
title: t('label.edition.title'),
|
|
67
|
-
description: t('label.edition.description'),
|
|
68
|
-
onClick: () => handleClickDocument(document.uid),
|
|
69
|
-
buttonClassName: document.defaultTool === 'DESIGN' ? 'action-design' : undefined,
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
id: 'syntactic',
|
|
73
|
-
iconName: 'graph_4',
|
|
74
|
-
title: t('label.syntactic.title'),
|
|
75
|
-
description: t('label.syntactic.description'),
|
|
76
|
-
onClick: handleReview,
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
id: 'resume',
|
|
80
|
-
iconName: 'play_arrow',
|
|
81
|
-
title: t('label.resume.title'),
|
|
82
|
-
description: t('label.resume.description'),
|
|
83
|
-
onClick: handleResume,
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
id: 'transcription',
|
|
87
|
-
iconName: 'checkbook',
|
|
88
|
-
title: t('label.transcription.title'),
|
|
89
|
-
description: t('label.transcription.description', {
|
|
90
|
-
pageNumber: pageOrder,
|
|
91
|
-
}),
|
|
92
|
-
onClick: handleTranscription,
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
id: 'automatic',
|
|
96
|
-
iconName: 'settings_timelapse',
|
|
97
|
-
title: t('label.automatic.title'),
|
|
98
|
-
description: t('label.automatic.description'),
|
|
99
|
-
onClick: () => setOpenAutomatic(true),
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
id: 'sync',
|
|
103
|
-
iconName: 'sync',
|
|
104
|
-
title: t('label.sync.title'),
|
|
105
|
-
description: t('label.sync.description'),
|
|
106
|
-
onClick: handleSyncSearch,
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
id: 'remove',
|
|
110
|
-
iconName: 'delete',
|
|
111
|
-
title: t('actions.label.remove'),
|
|
112
|
-
description: t('actions.label.remove.description'),
|
|
113
|
-
onClick: () => setOpenRemove(true),
|
|
114
|
-
},
|
|
115
|
-
];
|
|
116
|
-
const visibleActions = actionOptions.filter((action) => !hidden.has(action.id));
|
|
117
|
-
return (_jsxs("div", { className: "file-actions-container", children: [_jsxs("div", { className: "body", children: [visibleActions.map(({ id, iconName, title, description, onClick, buttonClassName }) => (_jsxs("div", { className: "action-line", onClick: onClick, children: [_jsx("div", { className: `action-button${buttonClassName ? ` ${buttonClassName}` : ''}`, children: _jsx(Icon, { name: iconName, size: "medium" }) }), _jsxs("div", { className: "action-desc", children: [_jsx("span", { className: "title", children: title }), _jsx("span", { children: description })] })] }, id))), !hidden.has('inconsistency') && (_jsx(InconsistencyActions, { document: document }))] }), openRemove && (_jsx(DocumentRemove, { document: document, setFilter: setFilter, onClose: () => setOpenRemove(false), useGrid: useGrid, setOpenFile: setOpenFile })), openAutomatic && (_jsx(AutomaticParser, { document: document, onClose: () => setOpenAutomatic(false) })), openRemoveSentences && pageUid && (_jsx(PageRemoveSentences, { pageUid: pageUid, onClose: () => setOpenRemoveSentences(false), onSuccess: () => {
|
|
118
|
-
onPageReload?.();
|
|
119
|
-
setOpenFile(false);
|
|
120
|
-
} }))] }));
|
|
121
|
-
}
|
|
@@ -1,23 +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, useMessageUtils } from '../deps';
|
|
5
|
-
export default function PageRemoveSentences({ pageUid, onClose, onSuccess, }) {
|
|
6
|
-
const { t } = useTranslation('actions');
|
|
7
|
-
const { dispatchError, dispatchLoading } = useMessageUtils();
|
|
8
|
-
const handleRemoveSentences = () => {
|
|
9
|
-
dispatchLoading(true);
|
|
10
|
-
PageService.removeSentences(pageUid)
|
|
11
|
-
.then(() => {
|
|
12
|
-
onSuccess?.();
|
|
13
|
-
onClose();
|
|
14
|
-
})
|
|
15
|
-
.catch((err) => {
|
|
16
|
-
dispatchError({ err, t });
|
|
17
|
-
})
|
|
18
|
-
.finally(() => {
|
|
19
|
-
dispatchLoading(false);
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
return (_jsx(AppModalConfirm, { title: t('label.transcription.title'), subtitle: t('modal.description.sentences.remove'), onClose: onClose, onConfirm: handleRemoveSentences }));
|
|
23
|
-
}
|
|
File without changes
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import AutomaticParserService from '../services/AutomaticParserService';
|
|
3
|
-
import { EMPTY_PARSER_REQUEST } from '../types/Parser';
|
|
4
|
-
import { Box, FormControlLabel, LinearProgress, Switch, Typography, } from '@mui/material';
|
|
5
|
-
import { useEffect, useRef, useState } from 'react';
|
|
6
|
-
import { Trans, useTranslation } from 'react-i18next';
|
|
7
|
-
import { AppLoading, AppModal, useMessageUtils, } from '../deps';
|
|
8
|
-
import './style.scss';
|
|
9
|
-
const timingCheck = 5000;
|
|
10
|
-
export default function AutomaticParser({ document, onClose }) {
|
|
11
|
-
const { t } = useTranslation('parser');
|
|
12
|
-
const { dispatchMessage, dispatchError } = useMessageUtils();
|
|
13
|
-
const [checking, setChecking] = useState(true);
|
|
14
|
-
const [loading, setLoading] = useState(false);
|
|
15
|
-
const [completed, setCompleted] = useState(false);
|
|
16
|
-
const [percentage, setPercentage] = useState(0);
|
|
17
|
-
const [request, setRequest] = useState(EMPTY_PARSER_REQUEST);
|
|
18
|
-
const intervalCheckRef = useRef(null);
|
|
19
|
-
const handleChange = (field) => (event) => {
|
|
20
|
-
setRequest((prev) => ({ ...prev, [field]: event.target.checked }));
|
|
21
|
-
};
|
|
22
|
-
const calculatePercentage = (parsed, total, errors) => {
|
|
23
|
-
if (!total)
|
|
24
|
-
return 0;
|
|
25
|
-
const processed = parsed + errors;
|
|
26
|
-
return Math.min(100, (processed / total) * 100) || 0;
|
|
27
|
-
};
|
|
28
|
-
const check = () => {
|
|
29
|
-
AutomaticParserService.checkParsingStatus(document.uid)
|
|
30
|
-
.then((res) => {
|
|
31
|
-
const { parsed = 0, total = 0, completed, errors = 0, } = res?.data ?? {};
|
|
32
|
-
setChecking(false);
|
|
33
|
-
setPercentage(calculatePercentage(parsed, total, errors));
|
|
34
|
-
if (completed) {
|
|
35
|
-
setLoading(false);
|
|
36
|
-
if (intervalCheckRef.current) {
|
|
37
|
-
clearInterval(intervalCheckRef.current);
|
|
38
|
-
intervalCheckRef.current = null;
|
|
39
|
-
}
|
|
40
|
-
setCompleted(true);
|
|
41
|
-
dispatchMessage({
|
|
42
|
-
key: 'msg.parser.completed',
|
|
43
|
-
t,
|
|
44
|
-
ns: 'parser',
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
})
|
|
48
|
-
.catch(() => setChecking(false));
|
|
49
|
-
};
|
|
50
|
-
const handleCheck = () => {
|
|
51
|
-
if (!document)
|
|
52
|
-
return;
|
|
53
|
-
setChecking(true);
|
|
54
|
-
AutomaticParserService.checkParsingStatus(document.uid)
|
|
55
|
-
.then((res) => {
|
|
56
|
-
const { completed } = res?.data ?? {};
|
|
57
|
-
setChecking(false);
|
|
58
|
-
if (!completed) {
|
|
59
|
-
setLoading(true);
|
|
60
|
-
intervalCheckRef.current = setInterval(check, timingCheck);
|
|
61
|
-
}
|
|
62
|
-
})
|
|
63
|
-
.catch(() => setChecking(false));
|
|
64
|
-
};
|
|
65
|
-
const handleConfirm = () => {
|
|
66
|
-
if (loading)
|
|
67
|
-
return;
|
|
68
|
-
setLoading(true);
|
|
69
|
-
AutomaticParserService.executeAutomaticParsing(document.uid, request)
|
|
70
|
-
.then(() => {
|
|
71
|
-
if (!intervalCheckRef.current) {
|
|
72
|
-
intervalCheckRef.current = setInterval(check, timingCheck);
|
|
73
|
-
}
|
|
74
|
-
})
|
|
75
|
-
.catch((err) => {
|
|
76
|
-
setLoading(false);
|
|
77
|
-
const message = err?.response?.data?.message || err?.message;
|
|
78
|
-
dispatchError({
|
|
79
|
-
err: message ?? 'error.start',
|
|
80
|
-
key: message ? 'message' : 'parser',
|
|
81
|
-
t,
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
};
|
|
85
|
-
useEffect(() => {
|
|
86
|
-
setPercentage(0);
|
|
87
|
-
handleCheck();
|
|
88
|
-
return () => {
|
|
89
|
-
if (intervalCheckRef.current) {
|
|
90
|
-
clearInterval(intervalCheckRef.current);
|
|
91
|
-
intervalCheckRef.current = null;
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
}, []);
|
|
95
|
-
return (_jsx(AppModal, { title: t('modal.automatic.title'), className: "modal-automatic-parser", close: onClose, confirm: completed ? onClose : handleConfirm, confirmLabel: completed ? t('modal.automatic.finish') : undefined, disableCancel: completed, disableConfirm: !completed && loading, children: checking ? (_jsx(AppLoading, {})) : (_jsxs(_Fragment, { children: [_jsx("p", { children: _jsx(Trans, { t: t, i18nKey: "modal.automatic.desc", components: { bold: _jsx("b", {}) } }) }), _jsx(FormControlLabel, { control: _jsx(Switch, { checked: request.reprocess, onChange: handleChange('reprocess') }), label: t('modal.automatic.reprocess') }), _jsx(FormControlLabel, { control: _jsx(Switch, { checked: request.resetTags, onChange: handleChange('resetTags') }), label: t('modal.automatic.reset') }), (loading || percentage > 0) && (_jsx(Box, { sx: { mt: 3 }, children: _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', mb: 1 }, children: [_jsx(Box, { sx: { width: '100%', mr: 1 }, children: _jsx(LinearProgress, { variant: "determinate", value: percentage }) }), _jsx(Box, { sx: { minWidth: 60 }, children: _jsx(Typography, { variant: "body2", color: "text.secondary", children: `${percentage.toFixed(2)}%` }) })] }) }))] })) }));
|
|
96
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import CatalogSearchFilter from './types/CatalogSearchFilter';
|
|
2
|
-
import Category from './types/Category';
|
|
3
|
-
import type { DocumentDrawerActionId } from './types/DocumentDrawerActionId';
|
|
4
|
-
import { Document } from './deps';
|
|
5
|
-
import './style.scss';
|
|
6
|
-
export type DocumentDrawerProps = {
|
|
7
|
-
uid: string;
|
|
8
|
-
setOpenFile: (b: boolean) => void;
|
|
9
|
-
setFilter: (p: CatalogSearchFilter) => void;
|
|
10
|
-
handleChange: (document: Document) => void;
|
|
11
|
-
handleClickDocument: (uid: string) => void;
|
|
12
|
-
useGrid: boolean;
|
|
13
|
-
categoriesHierarchy: Category[];
|
|
14
|
-
pageUid?: string;
|
|
15
|
-
pageOrder?: number;
|
|
16
|
-
onPageReload?: () => void;
|
|
17
|
-
hiddenActions?: DocumentDrawerActionId[];
|
|
18
|
-
};
|
|
19
|
-
export default function DocumentDrawer({ uid, setOpenFile, setFilter, handleChange, handleClickDocument, useGrid, categoriesHierarchy, pageUid, pageOrder, onPageReload, hiddenActions, }: DocumentDrawerProps): import("react/jsx-runtime").JSX.Element | null;
|