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
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Struct } from '../../configs/types/Struct';
|
|
2
|
-
import type { Comment } from '../Comments/types/Comment';
|
|
3
|
-
import type { SplitComment } from './types/SentenceSplitRequest';
|
|
4
|
-
declare const SentenceSplitCommentUtils: {
|
|
5
|
-
collectTokenCidsByHalf: (struct: Struct, splitAfterToken: number) => {
|
|
6
|
-
first: Set<string>;
|
|
7
|
-
second: Set<string>;
|
|
8
|
-
};
|
|
9
|
-
buildCidToWordMap: (struct: Struct) => Record<string, string>;
|
|
10
|
-
commentsWithoutCid: (comments: Comment[]) => SplitComment[];
|
|
11
|
-
commentsWithCidForHalf: (all: Comment[], half: "first" | "second", cids: {
|
|
12
|
-
first: Set<string>;
|
|
13
|
-
second: Set<string>;
|
|
14
|
-
}) => Comment[];
|
|
15
|
-
commentsWithCidForHalfAsSplit: (all: Comment[], half: "first" | "second", cids: {
|
|
16
|
-
first: Set<string>;
|
|
17
|
-
second: Set<string>;
|
|
18
|
-
}) => SplitComment[];
|
|
19
|
-
initialCommentDispositions: (sentenceComments: Comment[], wordsFirst: SplitComment[], wordsSecond: SplitComment[]) => Record<string, string>;
|
|
20
|
-
};
|
|
21
|
-
export default SentenceSplitCommentUtils;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import SentenceUtils from '../../functions/SentenceUtils';
|
|
2
|
-
import SentenceSplitUtils from './SentenceSplitUtils';
|
|
3
|
-
const collectTokenCidsByHalf = (struct, splitAfterToken) => {
|
|
4
|
-
const sorted = SentenceUtils.sort(struct);
|
|
5
|
-
const visible = sorted.filter((tok) => SentenceUtils.isVisible(tok) && !SentenceSplitUtils.skipToken(tok));
|
|
6
|
-
const first = new Set();
|
|
7
|
-
const second = new Set();
|
|
8
|
-
for (const tok of visible) {
|
|
9
|
-
if (!tok.cid)
|
|
10
|
-
continue;
|
|
11
|
-
if (tok.p <= splitAfterToken)
|
|
12
|
-
first.add(tok.cid);
|
|
13
|
-
else
|
|
14
|
-
second.add(tok.cid);
|
|
15
|
-
}
|
|
16
|
-
return { first, second };
|
|
17
|
-
};
|
|
18
|
-
const buildCidToWordMap = (struct) => {
|
|
19
|
-
const sorted = SentenceUtils.sort(struct);
|
|
20
|
-
const visible = sorted.filter((tok) => SentenceUtils.isVisible(tok) && !SentenceSplitUtils.skipToken(tok));
|
|
21
|
-
const map = {};
|
|
22
|
-
for (const tok of visible) {
|
|
23
|
-
if (tok.cid)
|
|
24
|
-
map[tok.cid] = tok.v;
|
|
25
|
-
}
|
|
26
|
-
return map;
|
|
27
|
-
};
|
|
28
|
-
const commentsWithoutCid = (comments) => {
|
|
29
|
-
return comments
|
|
30
|
-
.filter((root) => !root.cid)
|
|
31
|
-
.map((c) => ({ ...c, action: 'first' }));
|
|
32
|
-
};
|
|
33
|
-
const commentsWithCidForHalf = (all, half, cids) => {
|
|
34
|
-
const roots = all.filter((c) => !c.reply);
|
|
35
|
-
const rootsInHalf = roots.filter((root) => {
|
|
36
|
-
if (!root.cid)
|
|
37
|
-
return false;
|
|
38
|
-
if (cids.first.has(root.cid))
|
|
39
|
-
return half === 'first';
|
|
40
|
-
if (cids.second.has(root.cid))
|
|
41
|
-
return half === 'second';
|
|
42
|
-
return half === 'first';
|
|
43
|
-
});
|
|
44
|
-
const rootIds = new Set(rootsInHalf.map((r) => r.id));
|
|
45
|
-
return all.filter((c) => {
|
|
46
|
-
if (!c.reply)
|
|
47
|
-
return rootIds.has(c.id);
|
|
48
|
-
return rootIds.has(c.reply);
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
const commentsWithCidForHalfAsSplit = (all, half, cids) => {
|
|
52
|
-
const action = half === 'first' ? 'first' : 'second';
|
|
53
|
-
return commentsWithCidForHalf(all, half, cids).map((c) => ({ ...c, action }));
|
|
54
|
-
};
|
|
55
|
-
const initialCommentDispositions = (sentenceComments, wordsFirst, wordsSecond) => {
|
|
56
|
-
const out = {};
|
|
57
|
-
for (const root of sentenceComments.filter((c) => !c.reply)) {
|
|
58
|
-
if (!root.cid)
|
|
59
|
-
out[root.id] = 'first';
|
|
60
|
-
}
|
|
61
|
-
for (const root of wordsFirst.filter((c) => !c.reply)) {
|
|
62
|
-
out[root.id] = 'first';
|
|
63
|
-
}
|
|
64
|
-
for (const root of wordsSecond.filter((c) => !c.reply)) {
|
|
65
|
-
out[root.id] = 'second';
|
|
66
|
-
}
|
|
67
|
-
return out;
|
|
68
|
-
};
|
|
69
|
-
const SentenceSplitCommentUtils = {
|
|
70
|
-
collectTokenCidsByHalf,
|
|
71
|
-
buildCidToWordMap,
|
|
72
|
-
commentsWithoutCid,
|
|
73
|
-
commentsWithCidForHalf,
|
|
74
|
-
commentsWithCidForHalfAsSplit,
|
|
75
|
-
initialCommentDispositions,
|
|
76
|
-
};
|
|
77
|
-
export default SentenceSplitCommentUtils;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import DateUtils from '../../../functions/DateUtils';
|
|
3
|
-
import './style.scss';
|
|
4
|
-
export default function SentenceSplitCommentBlock({ comment }) {
|
|
5
|
-
return (_jsxs("div", { className: "comment-block", children: [_jsxs("div", { className: "comment-top", children: [_jsx("div", { className: "comment-date", children: DateUtils.formatDateTime(comment.edited ? comment.edited : comment.date, 'MM/dd/yyyy - HH:mm') }), _jsx("span", { className: "comment-name", children: comment.name })] }), _jsxs("div", { className: "comment-content", children: [comment.title && (_jsxs("div", { className: "comment-title", children: [comment.title, " - "] })), _jsx("div", { className: "comment-text", children: comment.value })] })] }));
|
|
6
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type SentenceSplitCommentAction, type SplitComment } from '../types/SentenceSplitRequest';
|
|
2
|
-
import './style.scss';
|
|
3
|
-
type Props = {
|
|
4
|
-
comments: SplitComment[];
|
|
5
|
-
onChange: (root: SplitComment, action: SentenceSplitCommentAction) => void;
|
|
6
|
-
};
|
|
7
|
-
export default function SentenceSplitComments({ comments, onChange }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export {};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { MenuItem, Select } from '@mui/material';
|
|
3
|
-
import { ThemeProvider, useTheme } from '@mui/material/styles';
|
|
4
|
-
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { selectFieldTheme } from 'tycho-storybook';
|
|
6
|
-
import { isSentenceSplitCommentAction, SENTENCE_SPLIT_COMMENT_ACTIONS, } from '../types/SentenceSplitRequest';
|
|
7
|
-
import SentenceSplitCommentBlock from './SentenceSplitCommentBlock';
|
|
8
|
-
import './style.scss';
|
|
9
|
-
function CommentDispositionSelect({ options, value, onChange, }) {
|
|
10
|
-
const outerTheme = useTheme();
|
|
11
|
-
return (_jsx("div", { className: "ds-select-text", children: _jsx(ThemeProvider, { theme: selectFieldTheme(outerTheme), children: _jsx(Select, { variant: "filled", color: "primary", displayEmpty: false, value: value, size: "small", onChange: (e) => {
|
|
12
|
-
const val = String(e.target.value);
|
|
13
|
-
if (isSentenceSplitCommentAction(val)) {
|
|
14
|
-
onChange(val);
|
|
15
|
-
}
|
|
16
|
-
}, MenuProps: {
|
|
17
|
-
PaperProps: {
|
|
18
|
-
style: { maxHeight: 400 },
|
|
19
|
-
},
|
|
20
|
-
}, children: options.map((opt) => (_jsx(MenuItem, { value: opt.value, children: opt.label }, opt.value))) }) }) }));
|
|
21
|
-
}
|
|
22
|
-
export default function SentenceSplitComments({ comments, onChange }) {
|
|
23
|
-
const { t } = useTranslation('sentenceSplit');
|
|
24
|
-
const roots = comments.filter((c) => !c.reply);
|
|
25
|
-
const dispositionLabelKeys = {
|
|
26
|
-
first: 'split.comments.disposition.first',
|
|
27
|
-
second: 'split.comments.disposition.moveSecond',
|
|
28
|
-
duplicate: 'split.comments.disposition.duplicateSecond',
|
|
29
|
-
};
|
|
30
|
-
const dispositionOptions = SENTENCE_SPLIT_COMMENT_ACTIONS.map((value) => ({
|
|
31
|
-
label: t(dispositionLabelKeys[value]),
|
|
32
|
-
value,
|
|
33
|
-
}));
|
|
34
|
-
return (_jsx("div", { className: "comments-list", children: roots.map((root) => (_jsxs("div", { className: "comment-thread", children: [_jsxs("div", { className: "comment-wrapper", children: [_jsx(SentenceSplitCommentBlock, { comment: root }), comments
|
|
35
|
-
.filter((c) => c.reply === root.id)
|
|
36
|
-
.map((reply) => (_jsx("div", { className: "comment-replies", children: _jsx(SentenceSplitCommentBlock, { comment: reply }) }, reply.id)))] }), _jsx(CommentDispositionSelect, { options: dispositionOptions, value: root.action, onChange: (action) => onChange(root, action) })] }, root.id))) }));
|
|
37
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Struct } from '../../../configs/types/Struct';
|
|
2
|
-
import type { SentenceSplitRequest } from '../types/SentenceSplitRequest';
|
|
3
|
-
import './style.scss';
|
|
4
|
-
type Props = {
|
|
5
|
-
struct: Struct;
|
|
6
|
-
documentUid: string;
|
|
7
|
-
request: SentenceSplitRequest;
|
|
8
|
-
onChange: (request: SentenceSplitRequest) => void;
|
|
9
|
-
};
|
|
10
|
-
export default function SentenceSplitCommentsStep({ struct, documentUid, request, onChange, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import AppLoading from '../../../common/AppLoading/AppLoading';
|
|
5
|
-
import AppPlaceholder from '../../../common/AppPlaceholder/AppPlaceholder';
|
|
6
|
-
import { useCorpusUtils } from '../../../configs/useCorpusUtils';
|
|
7
|
-
import { useMessageUtils } from '../../../configs/useMessageUtils';
|
|
8
|
-
import SentenceSplitCommentUtils from '../SentenceSplitCommentUtils';
|
|
9
|
-
import SentenceSplitService from '../SentenceSplitService';
|
|
10
|
-
import SentenceSplitComments from './SentenceSplitComments';
|
|
11
|
-
import SentenceSplitCommentsWords from './SentenceSplitCommentsWords';
|
|
12
|
-
import './style.scss';
|
|
13
|
-
export default function SentenceSplitCommentsStep({ struct, documentUid, request, onChange, }) {
|
|
14
|
-
const { t } = useTranslation('sentenceSplit');
|
|
15
|
-
const { getCorpus } = useCorpusUtils();
|
|
16
|
-
const { dispatchError } = useMessageUtils();
|
|
17
|
-
const { collectTokenCidsByHalf, buildCidToWordMap, commentsWithoutCid, initialCommentDispositions, commentsWithCidForHalfAsSplit, } = SentenceSplitCommentUtils;
|
|
18
|
-
const [comments, setComments] = useState(null);
|
|
19
|
-
const [commentsSentence, setCommentsSentence] = useState([]);
|
|
20
|
-
const [commentsWordsFirst, setCommentsWordsFirst] = useState([]);
|
|
21
|
-
const [commentsWordsSecond, setCommentsWordsSecond] = useState([]);
|
|
22
|
-
const cidsByHalf = collectTokenCidsByHalf(struct, request.token);
|
|
23
|
-
const wordByCid = buildCidToWordMap(struct);
|
|
24
|
-
const handleChangeSentence = (root, action) => {
|
|
25
|
-
setCommentsSentence(commentsSentence.map((c) => (c.id === root.id ? { ...c, action } : c)));
|
|
26
|
-
onChange({
|
|
27
|
-
...request,
|
|
28
|
-
comments: {
|
|
29
|
-
...request.comments,
|
|
30
|
-
[root.id]: action,
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
let cancelled = false;
|
|
36
|
-
const references = {
|
|
37
|
-
sentence: struct.uid,
|
|
38
|
-
document: documentUid,
|
|
39
|
-
page: struct.page,
|
|
40
|
-
};
|
|
41
|
-
SentenceSplitService.findComments(getCorpus().uid, references)
|
|
42
|
-
.then((r) => {
|
|
43
|
-
if (cancelled)
|
|
44
|
-
return;
|
|
45
|
-
setComments(r.data);
|
|
46
|
-
const theseCommentsSentence = commentsWithoutCid(r.data);
|
|
47
|
-
const theseCommentsWordsFirst = commentsWithCidForHalfAsSplit(r.data, 'first', cidsByHalf);
|
|
48
|
-
const theseCommentsWordsSecond = commentsWithCidForHalfAsSplit(r.data, 'second', cidsByHalf);
|
|
49
|
-
const initialComments = initialCommentDispositions(theseCommentsSentence, theseCommentsWordsFirst, theseCommentsWordsSecond);
|
|
50
|
-
onChange({
|
|
51
|
-
...request,
|
|
52
|
-
comments: { ...initialComments },
|
|
53
|
-
});
|
|
54
|
-
setCommentsSentence(theseCommentsSentence);
|
|
55
|
-
setCommentsWordsFirst(theseCommentsWordsFirst);
|
|
56
|
-
setCommentsWordsSecond(theseCommentsWordsSecond);
|
|
57
|
-
})
|
|
58
|
-
.catch((err) => {
|
|
59
|
-
if (cancelled)
|
|
60
|
-
return;
|
|
61
|
-
dispatchError({ err, t });
|
|
62
|
-
});
|
|
63
|
-
return () => {
|
|
64
|
-
cancelled = true;
|
|
65
|
-
};
|
|
66
|
-
}, [struct.uid, documentUid, struct.page]);
|
|
67
|
-
if (comments === null) {
|
|
68
|
-
return _jsx(AppLoading, {});
|
|
69
|
-
}
|
|
70
|
-
const hasWordComments = comments.find((c) => c.cid) !== undefined;
|
|
71
|
-
return (_jsxs("div", { className: "step-content sentence-split-comments-container", children: [_jsxs("div", { className: "header", children: [_jsx("div", { className: "title", children: t('split.comments.title') }), _jsx("div", { className: "subtitle", children: t('split.comments.description') })] }), _jsxs("div", { className: "step-body", children: [comments.length === 0 && (_jsx(AppPlaceholder, { text: t('split.comments.empty'), useMarginTop: true })), commentsSentence != null && commentsSentence.length > 0 && (_jsxs("section", { className: "comments-section", children: [_jsx("h6", { className: "section-title", children: t('split.comments.sentenceLevel') }), _jsx("div", { className: "section-body", children: _jsx(SentenceSplitComments, { comments: commentsSentence, onChange: handleChangeSentence }) })] })), hasWordComments && (_jsxs("section", { className: "comments-section", children: [_jsx("h6", { className: "sentence-split-comments-section-title", children: t('split.comments.wordLevel') }), _jsxs("div", { className: "sentence-split-pair", children: [_jsxs("div", { children: [_jsx("h6", { children: t('split.label.first') }), _jsx("div", { className: "sentence-split-box", children: _jsx(SentenceSplitCommentsWords, { comments: commentsWordsFirst, emptyText: t('split.comments.empty'), wordByCid: wordByCid }) })] }), _jsxs("div", { children: [_jsx("h6", { children: t('split.label.second') }), _jsx("div", { className: "sentence-split-box", children: _jsx(SentenceSplitCommentsWords, { comments: commentsWordsSecond, emptyText: t('split.comments.empty'), wordByCid: wordByCid }) })] })] })] }))] })] }));
|
|
72
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { SplitComment } from '../types/SentenceSplitRequest';
|
|
2
|
-
import './style.scss';
|
|
3
|
-
type Props = {
|
|
4
|
-
comments: SplitComment[];
|
|
5
|
-
emptyText: string;
|
|
6
|
-
wordByCid: Record<string, string>;
|
|
7
|
-
};
|
|
8
|
-
export default function SentenceSplitCommentsWords({ comments, emptyText, wordByCid, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import AppPlaceholder from '../../../common/AppPlaceholder/AppPlaceholder';
|
|
4
|
-
import SentenceSplitCommentBlock from './SentenceSplitCommentBlock';
|
|
5
|
-
import './style.scss';
|
|
6
|
-
export default function SentenceSplitCommentsWords({ comments, emptyText, wordByCid, }) {
|
|
7
|
-
const { t } = useTranslation('sentenceSplit');
|
|
8
|
-
if (comments.length === 0) {
|
|
9
|
-
return _jsx(AppPlaceholder, { text: emptyText });
|
|
10
|
-
}
|
|
11
|
-
const roots = comments.filter((c) => !c.reply);
|
|
12
|
-
return (_jsx("div", { className: "comments-list", children: roots.map((root) => (_jsx("div", { className: "comment-thread", children: _jsxs("div", { className: "comment-wrapper", children: [root.cid && (_jsxs("div", { className: "comment-target-word", title: root.cid, children: [t('label.word'), wordByCid[root.cid] ?? t('split.comments.wordMissing')] })), _jsx(SentenceSplitCommentBlock, { comment: root }), comments
|
|
13
|
-
.filter((c) => c.reply === root.id)
|
|
14
|
-
.map((reply) => (_jsx("div", { className: "comment-replies", children: _jsx(SentenceSplitCommentBlock, { comment: reply }) }, reply.id)))] }) }, root.id))) }));
|
|
15
|
-
}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
.sentence-split-comments-container {
|
|
2
|
-
.comments-section {
|
|
3
|
-
margin-top: 24px;
|
|
4
|
-
border-top: 1px solid var(--border-subtle-1);
|
|
5
|
-
padding-top: 16px;
|
|
6
|
-
max-height: 30vh;
|
|
7
|
-
overflow-y: auto;
|
|
8
|
-
|
|
9
|
-
&:first-of-type {
|
|
10
|
-
margin-top: 16px;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.section-title {
|
|
14
|
-
@include body-medium-2;
|
|
15
|
-
color: var(--text-primary);
|
|
16
|
-
margin: 0 0 8px;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
> .ds-placeholder {
|
|
21
|
-
margin-top: 16px;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.sentence-split-box {
|
|
25
|
-
> .ds-placeholder {
|
|
26
|
-
.ds-icon {
|
|
27
|
-
font-size: 32px;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.title {
|
|
31
|
-
@include body-medium-2;
|
|
32
|
-
color: var(--text-primary);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.comments-list {
|
|
38
|
-
display: flex;
|
|
39
|
-
flex-direction: column;
|
|
40
|
-
gap: 0;
|
|
41
|
-
|
|
42
|
-
.comment-thread {
|
|
43
|
-
display: flex;
|
|
44
|
-
flex-direction: row;
|
|
45
|
-
border-bottom: 1px solid var(--border-subtle-1, #e8e8e8);
|
|
46
|
-
padding: 8px 0;
|
|
47
|
-
|
|
48
|
-
&:first-child {
|
|
49
|
-
padding-top: 0;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
&:last-child {
|
|
53
|
-
border-bottom: none;
|
|
54
|
-
padding-bottom: 0;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.ds-select-text {
|
|
58
|
-
margin-left: auto;
|
|
59
|
-
width: fit-content;
|
|
60
|
-
|
|
61
|
-
.MuiSelect-select {
|
|
62
|
-
padding: 4px 24px 4px 8px !important;
|
|
63
|
-
@include body-small-1;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.MuiSelect-icon {
|
|
67
|
-
font-size: 20px;
|
|
68
|
-
right: 0px;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.comment-target-word {
|
|
73
|
-
@include tag-medium-1;
|
|
74
|
-
color: var(--text-accent);
|
|
75
|
-
margin-bottom: 6px;
|
|
76
|
-
display: inline-block;
|
|
77
|
-
max-width: 100%;
|
|
78
|
-
word-break: break-word;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.comment-replies {
|
|
82
|
-
margin-left: 16px;
|
|
83
|
-
margin-top: 4px;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.comment-block {
|
|
87
|
-
display: flex;
|
|
88
|
-
flex-direction: column;
|
|
89
|
-
gap: 0px;
|
|
90
|
-
|
|
91
|
-
.comment-top {
|
|
92
|
-
display: flex;
|
|
93
|
-
align-items: center;
|
|
94
|
-
gap: 8px;
|
|
95
|
-
|
|
96
|
-
.comment-name {
|
|
97
|
-
@include body-small-2;
|
|
98
|
-
color: var(--text-primary);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.comment-date {
|
|
102
|
-
@include helper-small-1;
|
|
103
|
-
color: var(--text-tertiary);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.comment-content {
|
|
108
|
-
display: flex;
|
|
109
|
-
align-items: center;
|
|
110
|
-
gap: 4px;
|
|
111
|
-
|
|
112
|
-
.comment-title {
|
|
113
|
-
@include body-small-1;
|
|
114
|
-
color: var(--text-accent);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.comment-text {
|
|
118
|
-
@include body-small-1;
|
|
119
|
-
color: var(--text-primary);
|
|
120
|
-
white-space: pre-wrap;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Parameter } from '../../../configs/types/Parameter';
|
|
2
|
-
import { Token } from '../../../configs/types/Struct';
|
|
3
|
-
import './style.scss';
|
|
4
|
-
type Props = {
|
|
5
|
-
title: string;
|
|
6
|
-
tokens: Token[];
|
|
7
|
-
wordTiers: Parameter[];
|
|
8
|
-
};
|
|
9
|
-
export default function SentenceSplitPreview({ title, tokens, wordTiers, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import SentenceUtils from '../../../functions/SentenceUtils';
|
|
4
|
-
import SentenceSplitUtils from '../SentenceSplitUtils';
|
|
5
|
-
import './style.scss';
|
|
6
|
-
export default function SentenceSplitPreview({ title, tokens, wordTiers, }) {
|
|
7
|
-
const { t } = useTranslation(['sentenceSplit', 'sentence']);
|
|
8
|
-
return (_jsxs("div", { className: "sentence-split-preview-block", children: [_jsx("h6", { children: title }), _jsx("table", { className: "table table-striped sentence-split-preview-table", children: _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: t('sentence:label.word') }), tokens.map((tok) => (_jsx("td", { children: SentenceSplitUtils.getOriginalValue(tok) }, tok.p)))] }), _jsxs("tr", { children: [_jsx("td", { children: t('sentence:label.pos.tag') }), tokens.map((tok) => (_jsx("td", { children: SentenceUtils.getTag(tok) || t('sentence:label.empty') }, tok.p)))] }), wordTiers?.map((tier) => (_jsxs("tr", { children: [_jsx("td", { children: tier.name }), tokens.map((tok) => (_jsx("td", { children: (tok.attributes && tok.attributes[tier.symbol]) ||
|
|
9
|
-
t('sentence:label.empty') }, tok.p)))] }, tier.symbol)))] }) })] }));
|
|
10
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Parameter } from '../../../configs/types/Parameter';
|
|
2
|
-
import { Struct } from '../../../configs/types/Struct';
|
|
3
|
-
import { SentenceSplitRequest } from '../types/SentenceSplitRequest';
|
|
4
|
-
import './style.scss';
|
|
5
|
-
type Props = {
|
|
6
|
-
struct: Struct;
|
|
7
|
-
request: SentenceSplitRequest;
|
|
8
|
-
wordTiers: Parameter[];
|
|
9
|
-
};
|
|
10
|
-
export default function SentenceSplitPreviewStep({ struct, request, wordTiers, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import SentenceUtils from '../../../functions/SentenceUtils';
|
|
4
|
-
import SentenceSplitUtils from '../SentenceSplitUtils';
|
|
5
|
-
import SentenceSplitPreview from './SentenceSplitPreview';
|
|
6
|
-
import './style.scss';
|
|
7
|
-
function partitionVisibleTokens(struct, splitAfterToken) {
|
|
8
|
-
const sorted = SentenceUtils.sort(struct);
|
|
9
|
-
const visible = sorted.filter((tok) => SentenceUtils.isVisible(tok) && !SentenceSplitUtils.skipToken(tok));
|
|
10
|
-
const first = [];
|
|
11
|
-
const second = [];
|
|
12
|
-
visible.forEach((tok) => {
|
|
13
|
-
if (tok.p <= splitAfterToken)
|
|
14
|
-
first.push(tok);
|
|
15
|
-
else
|
|
16
|
-
second.push(tok);
|
|
17
|
-
});
|
|
18
|
-
return [first, second];
|
|
19
|
-
}
|
|
20
|
-
export default function SentenceSplitPreviewStep({ struct, request, wordTiers, }) {
|
|
21
|
-
const { t } = useTranslation('sentenceSplit');
|
|
22
|
-
const [first, second] = partitionVisibleTokens(struct, request.token);
|
|
23
|
-
return (_jsxs("div", { className: "step-content", children: [_jsxs("div", { className: "header", children: [_jsx("div", { className: "title", children: t('split.preview.title') }), _jsx("div", { className: "subtitle", children: t('split.preview.description') })] }), _jsx("div", { className: "step-body", children: _jsxs("div", { className: "sentence-split-preview-container", children: [_jsx(SentenceSplitPreview, { title: t('split.label.first'), tokens: first, wordTiers: wordTiers }), _jsx(SentenceSplitPreview, { title: t('split.label.second'), tokens: second, wordTiers: wordTiers })] }) })] }));
|
|
24
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
.sentence-split-preview-container {
|
|
2
|
-
display: grid;
|
|
3
|
-
grid-template-columns: 1fr 1fr;
|
|
4
|
-
gap: 16px;
|
|
5
|
-
margin-top: 24px;
|
|
6
|
-
|
|
7
|
-
.sentence-split-preview-block {
|
|
8
|
-
max-width: 100%;
|
|
9
|
-
overflow-x: auto;
|
|
10
|
-
|
|
11
|
-
.sentence-split-preview-table {
|
|
12
|
-
text-align: center;
|
|
13
|
-
|
|
14
|
-
td {
|
|
15
|
-
white-space: nowrap;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
td:first-child {
|
|
19
|
-
text-align: left;
|
|
20
|
-
font-weight: 500;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { SentenceSplitRequest } from './types/SentenceSplitRequest';
|
|
2
|
-
export type SentenceSplitCommentReferences = {
|
|
3
|
-
sentence: string;
|
|
4
|
-
document: string;
|
|
5
|
-
page: string;
|
|
6
|
-
};
|
|
7
|
-
declare function split(uid: string, request: SentenceSplitRequest): Promise<import("axios").AxiosResponse<unknown, any, {}>>;
|
|
8
|
-
declare function findComments(corpusUid: string, references: SentenceSplitCommentReferences): Promise<import("axios").AxiosResponse<import("..").Comment[], any, {}>>;
|
|
9
|
-
declare const SentenceSplitService: {
|
|
10
|
-
split: typeof split;
|
|
11
|
-
findComments: typeof findComments;
|
|
12
|
-
};
|
|
13
|
-
export default SentenceSplitService;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import api from '../../configs/api';
|
|
2
|
-
import CommentService from '../Comments/CommentService';
|
|
3
|
-
function split(uid, request) {
|
|
4
|
-
return api.post(`${import.meta.env.VITE_APP_EDICTOR_URL}/sentence/split/${uid}`, request);
|
|
5
|
-
}
|
|
6
|
-
function findComments(corpusUid, references) {
|
|
7
|
-
return CommentService.find(corpusUid, 'corpus', references);
|
|
8
|
-
}
|
|
9
|
-
const SentenceSplitService = {
|
|
10
|
-
split,
|
|
11
|
-
findComments,
|
|
12
|
-
};
|
|
13
|
-
export default SentenceSplitService;
|
package/dist/features/SentenceSplit/SentenceSplitTranslations/SentenceSplitTranslations.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import SentenceSplitLanguage from '../types/Language';
|
|
2
|
-
import type { SentenceSplitRequest } from '../types/SentenceSplitRequest';
|
|
3
|
-
import './style.scss';
|
|
4
|
-
type Segment = 'first' | 'second';
|
|
5
|
-
type Props = {
|
|
6
|
-
languages: SentenceSplitLanguage[];
|
|
7
|
-
segment: Segment;
|
|
8
|
-
request: SentenceSplitRequest;
|
|
9
|
-
onChange: (request: SentenceSplitRequest) => void;
|
|
10
|
-
};
|
|
11
|
-
export default function SentenceSplitTranslations({ languages, segment, request, onChange, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import './style.scss';
|
|
3
|
-
export default function SentenceSplitTranslations({ languages, segment, request, onChange, }) {
|
|
4
|
-
const field = segment === 'first' ? 'translationsFirst' : 'translationsSecond';
|
|
5
|
-
const values = request[field] || {};
|
|
6
|
-
const getValue = (language) => values[language.symbol] || '';
|
|
7
|
-
const changeValue = (language, value) => {
|
|
8
|
-
onChange({
|
|
9
|
-
...request,
|
|
10
|
-
[field]: { ...(request[field] || {}), [language.symbol]: value },
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
return (_jsx(_Fragment, { children: languages &&
|
|
14
|
-
languages.map((language, idx) => (_jsxs("div", { className: "language-field", children: [_jsx("span", { className: "title", children: language.name }), _jsx("input", { type: "text", className: "form-control", value: getValue(language), onChange: (e) => changeValue(language, e.target.value) })] }, idx.valueOf()))) }));
|
|
15
|
-
}
|
package/dist/features/SentenceSplit/SentenceSplitTranslations/SentenceSplitTranslationsStep.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import SentenceSplitLanguage from '../types/Language';
|
|
2
|
-
import type { SentenceSplitRequest } from '../types/SentenceSplitRequest';
|
|
3
|
-
import './style.scss';
|
|
4
|
-
type Props = {
|
|
5
|
-
languages: SentenceSplitLanguage[];
|
|
6
|
-
request: SentenceSplitRequest;
|
|
7
|
-
onChange: (request: SentenceSplitRequest) => void;
|
|
8
|
-
};
|
|
9
|
-
export default function SentenceSplitTranslationsStep({ languages, request, onChange, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export {};
|
package/dist/features/SentenceSplit/SentenceSplitTranslations/SentenceSplitTranslationsStep.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import SentenceSplitTranslations from './SentenceSplitTranslations';
|
|
4
|
-
import './style.scss';
|
|
5
|
-
export default function SentenceSplitTranslationsStep({ languages, request, onChange, }) {
|
|
6
|
-
const { t } = useTranslation('sentenceSplit');
|
|
7
|
-
return (_jsxs("div", { className: "step-content sentence-split-step-translations", children: [_jsxs("div", { className: "header", children: [_jsx("div", { className: "title", children: t('split.translations.title') }), _jsx("div", { className: "subtitle", children: t('split.translations.description') })] }), _jsxs("div", { className: "step-body", children: [_jsxs("div", { className: "split-translation-container", children: [_jsx("span", { className: "title", children: t('split.label.first') }), _jsx(SentenceSplitTranslations, { segment: "first", languages: languages, request: request, onChange: onChange })] }), _jsxs("div", { className: "split-translation-container", children: [_jsx("span", { className: "title", children: t('split.label.second') }), _jsx(SentenceSplitTranslations, { segment: "second", languages: languages, request: request, onChange: onChange })] })] })] }));
|
|
8
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
.split-translation-container {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
gap: 8px;
|
|
5
|
-
border: 1px solid var(--border-subtle-1);
|
|
6
|
-
border-radius: var(--radius-200);
|
|
7
|
-
padding: 8px 16px;
|
|
8
|
-
|
|
9
|
-
> .title {
|
|
10
|
-
@include body-medium-2;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
> .language-field {
|
|
14
|
-
display: flex;
|
|
15
|
-
flex-direction: column;
|
|
16
|
-
gap: 4px;
|
|
17
|
-
|
|
18
|
-
> .title {
|
|
19
|
-
@include body-medium-2;
|
|
20
|
-
margin-bottom: 4px;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|