tycho-components 0.2.0-SNAPSHOT-10 → 0.2.0-SNAPSHOT-12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,6 +8,7 @@ import SentenceUtils from '../functions/SentenceUtils';
8
8
  import CytoscapeTreeConverter from './cytoscape/CytoscapeTreeConverter';
9
9
  import SyntreesCytoscape from './cytoscape/SyntreesCytoscape';
10
10
  import './style.scss';
11
+ import AppPlaceholder from '../AppPlaceholder';
11
12
  export default function TreeView({ struct, expression, onExpand, selector = 'canvas-tree', translations, }) {
12
13
  const { t } = useTranslation('tree');
13
14
  const [cy, setCy] = useState(null);
@@ -65,6 +66,9 @@ export default function TreeView({ struct, expression, onExpand, selector = 'can
65
66
  useEffect(() => {
66
67
  load();
67
68
  }, [struct]);
69
+ if (!struct.chunks || struct.chunks.length === 0) {
70
+ return _jsx(AppPlaceholder, { text: t('placeholder.sentence.notparsed') });
71
+ }
68
72
  return (_jsxs("div", { className: "tree-view-container", children: [cy &&
69
73
  getButtons(generateImage, reset, downloadPsd, displayInfo, onExpand, expression)
70
74
  .filter((btn) => btn.condition)
@@ -1,6 +1,5 @@
1
1
  .tree-view-container {
2
2
  position: relative;
3
- padding-top: 8px;
4
3
  width: 100%;
5
4
 
6
5
  .canvas-tree {
@@ -1,2 +1,3 @@
1
1
  import { Struct } from '../../configs/types/Struct';
2
2
  export declare const structExample: Struct;
3
+ export declare const structNotParsedExample: Struct;
@@ -259,3 +259,196 @@ export const structExample = {
259
259
  document: 'D388',
260
260
  page: 'P7029',
261
261
  };
262
+ export const structNotParsedExample = {
263
+ uid: '13e0ee30-8f07-11e6-b457-90b11c409ded',
264
+ tokens: [
265
+ {
266
+ attributes: {
267
+ 'gloss-br': 'agora',
268
+ gloss: 'now',
269
+ },
270
+ p: 1,
271
+ v: 'natigide',
272
+ t: 'ADV',
273
+ l: 1,
274
+ },
275
+ {
276
+ splits: [
277
+ {
278
+ attributes: {
279
+ 'gloss-br': 'Ant',
280
+ gloss: 'Ant',
281
+ },
282
+ v: 'n',
283
+ t: 'Ant',
284
+ },
285
+ {
286
+ attributes: {
287
+ 'gloss-br': 'história',
288
+ gloss: 'history',
289
+ },
290
+ v: 'atema',
291
+ t: 'n',
292
+ },
293
+ {
294
+ attributes: {
295
+ 'gloss-br': 'de',
296
+ gloss: 'of',
297
+ },
298
+ v: 'tigi',
299
+ t: 'Apl',
300
+ },
301
+ ],
302
+ attributes: {
303
+ 'gloss-br': 'história',
304
+ },
305
+ p: 2,
306
+ v: 'natematigi',
307
+ t: 'N$',
308
+ l: 2,
309
+ },
310
+ {
311
+ splits: [
312
+ {
313
+ attributes: {
314
+ 'gloss-br': 'fem',
315
+ gloss: 'fem',
316
+ },
317
+ v: 'a',
318
+ t: 'Gnr',
319
+ },
320
+ {
321
+ attributes: {
322
+ 'gloss-br': 'ausente',
323
+ gloss: 'absent',
324
+ },
325
+ v: 'ca',
326
+ t: 'Ncl',
327
+ },
328
+ {
329
+ attributes: {
330
+ 'gloss-br': 'Hon',
331
+ gloss: 'Hon',
332
+ },
333
+ v: 'wa',
334
+ t: 'Hon',
335
+ },
336
+ ],
337
+ attributes: {
338
+ 'gloss-br': 'uma',
339
+ },
340
+ p: 3,
341
+ v: 'acoa',
342
+ t: 'D',
343
+ l: 1,
344
+ },
345
+ {
346
+ splits: [
347
+ {
348
+ attributes: {
349
+ 'gloss-br': 'mulher',
350
+ gloss: 'woman',
351
+ },
352
+ v: 'iwalo',
353
+ t: 'n',
354
+ },
355
+ ],
356
+ attributes: {
357
+ 'gloss-br': 'mulher',
358
+ },
359
+ p: 4,
360
+ v: 'iwaalo',
361
+ t: 'N',
362
+ l: 1,
363
+ },
364
+ {
365
+ attributes: {
366
+ 'gloss-br': 'que ',
367
+ },
368
+ p: 5,
369
+ v: 'ane',
370
+ t: 'WPRO',
371
+ l: 3,
372
+ },
373
+ {
374
+ p: 6,
375
+ v: '*T*',
376
+ l: 4,
377
+ ec: true,
378
+ coidx: [1],
379
+ },
380
+ {
381
+ splits: [
382
+ {
383
+ v: 'di',
384
+ t: 'Inv',
385
+ },
386
+ {
387
+ v: 'n',
388
+ t: 'Ref',
389
+ },
390
+ {
391
+ attributes: {
392
+ 'gloss-br': 'virar',
393
+ gloss: 'turn',
394
+ },
395
+ v: 'ana',
396
+ t: 'v',
397
+ },
398
+ {
399
+ attributes: {
400
+ 'gloss-br': 'para',
401
+ gloss: 'into',
402
+ },
403
+ v: 'tigi',
404
+ t: 'Apl',
405
+ },
406
+ ],
407
+ attributes: {
408
+ 'gloss-br': 'virava',
409
+ },
410
+ p: 7,
411
+ v: 'dinanatigi',
412
+ t: 'VBAPL',
413
+ l: 3,
414
+ },
415
+ {
416
+ attributes: {
417
+ 'gloss-br': 'que',
418
+ },
419
+ p: 8,
420
+ v: 'me',
421
+ t: 'C',
422
+ l: 4,
423
+ },
424
+ {
425
+ splits: [
426
+ {
427
+ attributes: {
428
+ 'gloss-br': 'onça',
429
+ gloss: 'jaguar',
430
+ },
431
+ v: 'nigediogo',
432
+ t: 'n',
433
+ },
434
+ ],
435
+ attributes: {
436
+ 'gloss-br': 'onça',
437
+ },
438
+ p: 9,
439
+ v: 'nigediogo',
440
+ t: 'N',
441
+ l: 6,
442
+ },
443
+ {
444
+ p: 10,
445
+ v: '.',
446
+ t: '.',
447
+ l: 0,
448
+ },
449
+ ],
450
+ chunks: [],
451
+ corpus: 'C12',
452
+ document: 'D388',
453
+ page: 'P7029',
454
+ };
@@ -38,6 +38,7 @@ export declare const commonResources: {
38
38
  'button.save': string;
39
39
  'button.clone': string;
40
40
  'button.apply': string;
41
+ 'button.search': string;
41
42
  'select.empty': string;
42
43
  'pagination.label.showing': string;
43
44
  'pagination.label.results': string;
@@ -137,6 +138,7 @@ export declare const commonResources: {
137
138
  'button.download.tree': string;
138
139
  'button.download.penn': string;
139
140
  'button.info': string;
141
+ 'placeholder.sentence.notparsed': string;
140
142
  };
141
143
  upload: {
142
144
  'label.dropzone': string;
@@ -185,6 +187,7 @@ export declare const commonResources: {
185
187
  'button.save': string;
186
188
  'button.clone': string;
187
189
  'button.apply': string;
190
+ 'button.search': string;
188
191
  'select.empty': string;
189
192
  'pagination.label.showing': string;
190
193
  'pagination.label.results': string;
@@ -281,6 +284,7 @@ export declare const commonResources: {
281
284
  'button.recenter.tree': string;
282
285
  'button.download.tree': string;
283
286
  'button.download.penn': string;
287
+ 'placeholder.sentence.notparsed': string;
284
288
  };
285
289
  upload: {
286
290
  'label.dropzone': string;
@@ -328,6 +332,7 @@ export declare const commonResources: {
328
332
  'button.remove': string;
329
333
  'button.save': string;
330
334
  'button.clone': string;
335
+ 'button.search': string;
331
336
  'select.empty': string;
332
337
  'button.apply': string;
333
338
  'pagination.label.showing': string;
@@ -6,6 +6,7 @@ export declare const CommonTexts: {
6
6
  'button.save': string;
7
7
  'button.clone': string;
8
8
  'button.apply': string;
9
+ 'button.search': string;
9
10
  'select.empty': string;
10
11
  'pagination.label.showing': string;
11
12
  'pagination.label.results': string;
@@ -32,6 +33,7 @@ export declare const CommonTexts: {
32
33
  'button.save': string;
33
34
  'button.clone': string;
34
35
  'button.apply': string;
36
+ 'button.search': string;
35
37
  'select.empty': string;
36
38
  'pagination.label.showing': string;
37
39
  'pagination.label.results': string;
@@ -57,6 +59,7 @@ export declare const CommonTexts: {
57
59
  'button.remove': string;
58
60
  'button.save': string;
59
61
  'button.clone': string;
62
+ 'button.search': string;
60
63
  'select.empty': string;
61
64
  'button.apply': string;
62
65
  'pagination.label.showing': string;
@@ -6,6 +6,7 @@ export const CommonTexts = {
6
6
  'button.save': 'Save',
7
7
  'button.clone': 'Clone',
8
8
  'button.apply': 'Apply',
9
+ 'button.search': 'Search',
9
10
  'select.empty': 'Select',
10
11
  'pagination.label.showing': '',
11
12
  'pagination.label.results': 'results per page',
@@ -32,6 +33,7 @@ export const CommonTexts = {
32
33
  'button.save': 'Salvar',
33
34
  'button.clone': 'Clonar',
34
35
  'button.apply': 'Aplicar',
36
+ 'button.search': 'Buscar',
35
37
  'select.empty': 'Selecionar',
36
38
  'pagination.label.showing': 'Exibindo',
37
39
  'pagination.label.results': 'resultados por página',
@@ -57,6 +59,7 @@ export const CommonTexts = {
57
59
  'button.remove': 'Rimuovi',
58
60
  'button.save': 'Salva',
59
61
  'button.clone': 'Clona',
62
+ 'button.search': 'Cerca',
60
63
  'select.empty': 'Seleziona',
61
64
  'button.apply': 'Applica',
62
65
  'pagination.label.showing': 'Mostrando',
@@ -5,12 +5,14 @@ export declare const TreeTexts: {
5
5
  'button.download.tree': string;
6
6
  'button.download.penn': string;
7
7
  'button.info': string;
8
+ 'placeholder.sentence.notparsed': string;
8
9
  };
9
10
  'pt-BR': {
10
11
  'button.expand.tree': string;
11
12
  'button.recenter.tree': string;
12
13
  'button.download.tree': string;
13
14
  'button.download.penn': string;
15
+ 'placeholder.sentence.notparsed': string;
14
16
  };
15
17
  it: {
16
18
  'button.expand.tree': string;
@@ -5,12 +5,14 @@ export const TreeTexts = {
5
5
  'button.download.tree': 'Download tree as image',
6
6
  'button.download.penn': 'Download in Penn Tree format',
7
7
  'button.info': 'Display translations and glosses',
8
+ 'placeholder.sentence.notparsed': 'This sentence has not been parsed.',
8
9
  },
9
10
  'pt-BR': {
10
11
  'button.expand.tree': 'Expandir árvore',
11
12
  'button.recenter.tree': 'Recentralizar árvore',
12
13
  'button.download.tree': 'Baixar árvore como imagem',
13
14
  'button.download.penn': 'Baixar no formato Penn Tree',
15
+ 'placeholder.sentence.notparsed': 'O parser não foi realizado nesta sentença.',
14
16
  },
15
17
  it: {
16
18
  'button.expand.tree': 'Espandi albero',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tycho-components",
3
3
  "private": false,
4
- "version": "0.2.0-SNAPSHOT-10",
4
+ "version": "0.2.0-SNAPSHOT-12",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {