tycho-components 0.25.11 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/configs/localization/HeaderAppTexts.js +3 -3
- package/dist/features/DocumentDrawer/DocumentEdit/DocumentEdit.js +1 -1
- package/dist/features/DocumentDrawer/localization/ActionsTexts.d.ts +24 -0
- package/dist/features/DocumentDrawer/localization/ActionsTexts.js +24 -0
- package/dist/features/TreeView/cytoscape/CytoscapeTreeConverter.d.ts +2 -0
- package/dist/features/TreeView/cytoscape/CytoscapeTreeConverter.js +21 -11
- package/package.json +5 -3
|
@@ -15,7 +15,7 @@ export const HeaderAppTexts = {
|
|
|
15
15
|
'catalog.desc': 'Manages access to corpora and organizes documents.',
|
|
16
16
|
'admin.name': 'Administration',
|
|
17
17
|
'admin.desc': 'Manages corpus creation, user access, and system settings.',
|
|
18
|
-
'edictor.name': '
|
|
18
|
+
'edictor.name': 'Editor',
|
|
19
19
|
'edictor.desc': 'Used for transcription and editing of textual and oral corpora. Supports multi-layer annotation for philological editions, parallel corpora, translations, morpheme-level editing, POS taggers, parsers, lexical integration, and multimedia (images and audio).',
|
|
20
20
|
'lexicon.name': 'Lexicon',
|
|
21
21
|
'lexicon.desc': 'Manages, lists, and registers lexical entries or corpus lemmas.',
|
|
@@ -49,7 +49,7 @@ export const HeaderAppTexts = {
|
|
|
49
49
|
'catalog.desc': 'Gerencia o acesso aos corpora e organiza os documentos.',
|
|
50
50
|
'admin.name': 'Administração',
|
|
51
51
|
'admin.desc': 'Gerencia a criação de corpora, o acesso de usuários e as configurações do sistema.',
|
|
52
|
-
'edictor.name': '
|
|
52
|
+
'edictor.name': 'Editor',
|
|
53
53
|
'edictor.desc': 'Usado para transcrição e edição de corpora textuais e orais. Suporta anotação em múltiplas camadas para edições filológicas, corpora paralelos, traduções, edição em nível de morfema, etiquetadores morfossintáticos (POS), parsers, integração lexical e multimídia (imagens e áudio).',
|
|
54
54
|
'lexicon.name': 'Léxico',
|
|
55
55
|
'lexicon.desc': 'Gerencia, lista e cadastra as entradas lexicais ou verbetes de um corpus',
|
|
@@ -84,7 +84,7 @@ export const HeaderAppTexts = {
|
|
|
84
84
|
'catalog.desc': "Gestisce l'accesso ai corpora e organizza i documenti.",
|
|
85
85
|
'admin.name': 'Amministrazione',
|
|
86
86
|
'admin.desc': "Gestisce la creazione del corpus, l'accesso degli utenti e le impostazioni del sistema.",
|
|
87
|
-
'edictor.name': '
|
|
87
|
+
'edictor.name': 'Editor',
|
|
88
88
|
'edictor.desc': "Usato per la trascrizione e l'editing di corpora testuali e orali. Supporta l'annotazione multilivello per edizioni filologiche, corpora paralleli, traduzioni, editing a livello di morfema, tag POS, parser, integrazione lessicale e multimedia (immagini e audio).",
|
|
89
89
|
'lexicon.name': 'Lessico',
|
|
90
90
|
'lexicon.desc': 'Gestisce, elenca e registra voci lessicali o lemmi del corpus.',
|
|
@@ -178,7 +178,7 @@ export const getDocumentFields = (categories, t) => [
|
|
|
178
178
|
name: t('document.field.status'),
|
|
179
179
|
type: 'select',
|
|
180
180
|
required: false,
|
|
181
|
-
options: FormUtils.convertEnum(DocumentStatusNames, t
|
|
181
|
+
options: FormUtils.convertEnum(DocumentStatusNames, t),
|
|
182
182
|
},
|
|
183
183
|
{
|
|
184
184
|
attr: 'visible',
|
|
@@ -14,6 +14,14 @@ export declare const ActionsTexts: {
|
|
|
14
14
|
'actions.label.info': string;
|
|
15
15
|
'actions.label.remove': string;
|
|
16
16
|
'actions.label.remove.description': string;
|
|
17
|
+
'actions.name.edictor': string;
|
|
18
|
+
'actions.name.translations': string;
|
|
19
|
+
'actions.name.design': string;
|
|
20
|
+
'actions.name.transcriber': string;
|
|
21
|
+
'actions.label.edictor': string;
|
|
22
|
+
'actions.label.translations': string;
|
|
23
|
+
'actions.label.design': string;
|
|
24
|
+
'actions.label.transcriber': string;
|
|
17
25
|
'label.resume.title': string;
|
|
18
26
|
'label.resume.description': string;
|
|
19
27
|
'label.syntactic.title': string;
|
|
@@ -45,6 +53,14 @@ export declare const ActionsTexts: {
|
|
|
45
53
|
'actions.label.info': string;
|
|
46
54
|
'actions.label.remove': string;
|
|
47
55
|
'actions.label.remove.description': string;
|
|
56
|
+
'actions.name.edictor': string;
|
|
57
|
+
'actions.name.translations': string;
|
|
58
|
+
'actions.name.design': string;
|
|
59
|
+
'actions.name.transcriber': string;
|
|
60
|
+
'actions.label.edictor': string;
|
|
61
|
+
'actions.label.translations': string;
|
|
62
|
+
'actions.label.design': string;
|
|
63
|
+
'actions.label.transcriber': string;
|
|
48
64
|
'modal.remove.title': string;
|
|
49
65
|
'label.resume.title': string;
|
|
50
66
|
'label.resume.description': string;
|
|
@@ -76,6 +92,14 @@ export declare const ActionsTexts: {
|
|
|
76
92
|
'actions.label.info': string;
|
|
77
93
|
'actions.label.remove': string;
|
|
78
94
|
'actions.label.remove.description': string;
|
|
95
|
+
'actions.name.edictor': string;
|
|
96
|
+
'actions.name.translations': string;
|
|
97
|
+
'actions.name.design': string;
|
|
98
|
+
'actions.name.transcriber': string;
|
|
99
|
+
'actions.label.edictor': string;
|
|
100
|
+
'actions.label.translations': string;
|
|
101
|
+
'actions.label.design': string;
|
|
102
|
+
'actions.label.transcriber': string;
|
|
79
103
|
'label.resume.title': string;
|
|
80
104
|
'label.resume.description': string;
|
|
81
105
|
'label.syntactic.title': string;
|
|
@@ -14,6 +14,14 @@ export const ActionsTexts = {
|
|
|
14
14
|
'actions.label.info': 'Open information',
|
|
15
15
|
'actions.label.remove': 'Remove document',
|
|
16
16
|
'actions.label.remove.description': 'Attention! This process is irreversible.',
|
|
17
|
+
'actions.name.edictor': 'Editor',
|
|
18
|
+
'actions.name.translations': 'Translations',
|
|
19
|
+
'actions.name.design': 'Design',
|
|
20
|
+
'actions.name.transcriber': 'Transcriber',
|
|
21
|
+
'actions.label.edictor': 'Editor',
|
|
22
|
+
'actions.label.translations': 'Translations',
|
|
23
|
+
'actions.label.design': 'Design',
|
|
24
|
+
'actions.label.transcriber': 'Transcriber',
|
|
17
25
|
'label.resume.title': 'Resume syntactic annotation',
|
|
18
26
|
'label.resume.description': 'Continue from the last reviewed sentence.',
|
|
19
27
|
'label.syntactic.title': 'Review sentences',
|
|
@@ -45,6 +53,14 @@ export const ActionsTexts = {
|
|
|
45
53
|
'actions.label.info': 'Exibir informações',
|
|
46
54
|
'actions.label.remove': 'Remover documento',
|
|
47
55
|
'actions.label.remove.description': 'Atenção! Este processo é irreversível.',
|
|
56
|
+
'actions.name.edictor': 'Editor',
|
|
57
|
+
'actions.name.translations': 'Traduções',
|
|
58
|
+
'actions.name.design': 'Design',
|
|
59
|
+
'actions.name.transcriber': 'Transcriber',
|
|
60
|
+
'actions.label.edictor': 'Editor',
|
|
61
|
+
'actions.label.translations': 'Traduções',
|
|
62
|
+
'actions.label.design': 'Design',
|
|
63
|
+
'actions.label.transcriber': 'Transcriber',
|
|
48
64
|
'modal.remove.title': 'Remover documento',
|
|
49
65
|
'label.resume.title': 'Continuar anotação sintática',
|
|
50
66
|
'label.resume.description': 'Continue a partir da última sentença revisada.',
|
|
@@ -76,6 +92,14 @@ export const ActionsTexts = {
|
|
|
76
92
|
'actions.label.info': 'Apri informazioni',
|
|
77
93
|
'actions.label.remove': 'Rimuovi documento',
|
|
78
94
|
'actions.label.remove.description': 'Attenzione! Questo processo è irreversibile.',
|
|
95
|
+
'actions.name.edictor': 'Editor',
|
|
96
|
+
'actions.name.translations': 'Traduzioni',
|
|
97
|
+
'actions.name.design': 'Design',
|
|
98
|
+
'actions.name.transcriber': 'Transcriber',
|
|
99
|
+
'actions.label.edictor': 'Editor',
|
|
100
|
+
'actions.label.translations': 'Traduzioni',
|
|
101
|
+
'actions.label.design': 'Design',
|
|
102
|
+
'actions.label.transcriber': 'Transcriber',
|
|
79
103
|
'label.resume.title': 'Riprendi annotazione sintattica',
|
|
80
104
|
'label.resume.description': "Continua dall'ultima frase revisionata.",
|
|
81
105
|
'label.syntactic.title': 'Revisiona frasi',
|
|
@@ -162,6 +162,11 @@ export default class CytoscapeTreeConverter {
|
|
|
162
162
|
for (const token of tokens) {
|
|
163
163
|
if (token.ec)
|
|
164
164
|
continue;
|
|
165
|
+
if (token.l !== chunk.l)
|
|
166
|
+
continue;
|
|
167
|
+
const dominator = this.tightestChunk(this.findContainingChunks(struct, chunk.l, token.p, token.p));
|
|
168
|
+
if (!dominator || this.generateChunkId(dominator) !== nodeId)
|
|
169
|
+
continue;
|
|
165
170
|
tree.edges.push({
|
|
166
171
|
data: {
|
|
167
172
|
id: this.uuid(),
|
|
@@ -184,8 +189,8 @@ export default class CytoscapeTreeConverter {
|
|
|
184
189
|
];
|
|
185
190
|
}
|
|
186
191
|
}
|
|
187
|
-
leveledChunks = this.getChunksByLevel(struct, chunk, levelCount);
|
|
188
192
|
levelCount++;
|
|
193
|
+
leveledChunks = this.getChunksByLevel(struct, chunk, levelCount);
|
|
189
194
|
}
|
|
190
195
|
}
|
|
191
196
|
generateChunkId(chunk) {
|
|
@@ -212,18 +217,23 @@ export default class CytoscapeTreeConverter {
|
|
|
212
217
|
return `${token.p}`;
|
|
213
218
|
}
|
|
214
219
|
findParent(struct, chunk) {
|
|
215
|
-
|
|
220
|
+
return this.tightestChunk(this.findContainingChunks(struct, chunk.l - 1, chunk.i, chunk.f));
|
|
221
|
+
}
|
|
222
|
+
findContainingChunks(struct, level, i, f) {
|
|
223
|
+
return struct.chunks.filter((c) => c.l === level && i >= c.i && f <= c.f);
|
|
224
|
+
}
|
|
225
|
+
tightestChunk(chunks) {
|
|
216
226
|
if (chunks.length === 0)
|
|
217
227
|
return null;
|
|
218
|
-
|
|
219
|
-
const
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
if (
|
|
224
|
-
return
|
|
225
|
-
|
|
226
|
-
|
|
228
|
+
return chunks.reduce((best, c) => {
|
|
229
|
+
const span = c.f - c.i;
|
|
230
|
+
const bestSpan = best.f - best.i;
|
|
231
|
+
if (span < bestSpan)
|
|
232
|
+
return c;
|
|
233
|
+
if (span > bestSpan)
|
|
234
|
+
return best;
|
|
235
|
+
return c.i > best.i ? c : best;
|
|
236
|
+
});
|
|
227
237
|
}
|
|
228
238
|
initTree(struct) {
|
|
229
239
|
this.sortChunks(struct);
|
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.26.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"cytoscape-dagre": "^2.5.0",
|
|
56
56
|
"cytoscape-node-html-label": "^1.2.2",
|
|
57
57
|
"date-fns": "^4.1.0",
|
|
58
|
-
"driver.js": "^1.4.0",
|
|
59
58
|
"date-fns-tz": "^3.2.0",
|
|
59
|
+
"driver.js": "^1.4.0",
|
|
60
60
|
"file-saver": "^2.0.5",
|
|
61
61
|
"html2canvas": "^1.4.1",
|
|
62
62
|
"js-cookie": "^3.0.5",
|
|
@@ -112,6 +112,7 @@
|
|
|
112
112
|
"storybook": "^10.1.11",
|
|
113
113
|
"typescript": "^5.7.3",
|
|
114
114
|
"vite": "^7.0.0",
|
|
115
|
+
"vitest": "^3.2.6",
|
|
115
116
|
"wavesurfer-react": "^2.2.2",
|
|
116
117
|
"wavesurfer.js": "^6.6.3"
|
|
117
118
|
},
|
|
@@ -120,6 +121,7 @@
|
|
|
120
121
|
"build-storybook": "storybook build",
|
|
121
122
|
"build": "tsc && node scripts/copy-package-json.js && npm run copy-css",
|
|
122
123
|
"build-publish": "tsc && npm run copy-css",
|
|
123
|
-
"copy-css": "node scripts/copy-css.js"
|
|
124
|
+
"copy-css": "node scripts/copy-css.js",
|
|
125
|
+
"test": "vitest run"
|
|
124
126
|
}
|
|
125
127
|
}
|