tycho-components 0.2.0-SNAPSHOT-26 → 0.2.1-SNAPSHOT

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/SentenceView/SentenceEditionTiers.d.ts +7 -0
  2. package/dist/SentenceView/SentenceEditionTiers.js +21 -0
  3. package/dist/SentenceView/SentenceMorphemeTags.d.ts +6 -0
  4. package/dist/SentenceView/SentenceMorphemeTags.js +23 -0
  5. package/dist/SentenceView/SentenceMorphemeTiers.d.ts +9 -0
  6. package/dist/SentenceView/SentenceMorphemeTiers.js +41 -0
  7. package/dist/SentenceView/SentenceTags.d.ts +6 -0
  8. package/dist/SentenceView/SentenceTags.js +20 -0
  9. package/dist/SentenceView/SentenceValues.d.ts +6 -0
  10. package/dist/SentenceView/SentenceValues.js +14 -0
  11. package/dist/SentenceView/SentenceView.d.ts +12 -0
  12. package/dist/SentenceView/SentenceView.js +12 -0
  13. package/dist/SentenceView/SentenceWordTiers.d.ts +8 -0
  14. package/dist/SentenceView/SentenceWordTiers.js +15 -0
  15. package/dist/SentenceView/style.scss +73 -0
  16. package/dist/configs/Localization.d.ts +45 -0
  17. package/dist/configs/Localization.js +4 -0
  18. package/dist/configs/localization/SentenceTexts.d.ts +47 -0
  19. package/dist/configs/localization/SentenceTexts.js +47 -0
  20. package/dist/configs/mock/MockStructs.d.ts +4 -0
  21. package/dist/configs/mock/MockStructs.js +1135 -0
  22. package/dist/configs/types/EditionTiers.d.ts +12 -0
  23. package/dist/configs/types/EditionTiers.js +13 -0
  24. package/dist/configs/types/Parameter.d.ts +12 -0
  25. package/dist/configs/types/Parameter.js +1 -0
  26. package/dist/configs/types/Struct.d.ts +2 -2
  27. package/dist/functions/EditionTierUtils.d.ts +8 -0
  28. package/dist/functions/EditionTierUtils.js +32 -0
  29. package/dist/functions/SentenceUtils.d.ts +3 -0
  30. package/dist/functions/SentenceUtils.js +21 -1
  31. package/dist/index.d.ts +3 -0
  32. package/dist/index.js +2 -0
  33. package/package.json +1 -1
  34. package/dist/TreeView/types/TreeViewExample.d.ts +0 -3
  35. package/dist/TreeView/types/TreeViewExample.js +0 -455
@@ -0,0 +1,12 @@
1
+ export declare enum EditionTiers {
2
+ JUNCTION = "jun",
3
+ SEGMENTATION = "seg",
4
+ SPELLING = "gra",
5
+ EXPANSION = "exp",
6
+ CORRECTION = "cor",
7
+ PUNCTUATION = "pon",
8
+ ILLEGIBLE = "ileg",
9
+ MODERNIZATION = "mod",
10
+ PADRONIZATION = "pad",
11
+ INFLECTION = "fle"
12
+ }
@@ -0,0 +1,13 @@
1
+ export var EditionTiers;
2
+ (function (EditionTiers) {
3
+ EditionTiers["JUNCTION"] = "jun";
4
+ EditionTiers["SEGMENTATION"] = "seg";
5
+ EditionTiers["SPELLING"] = "gra";
6
+ EditionTiers["EXPANSION"] = "exp";
7
+ EditionTiers["CORRECTION"] = "cor";
8
+ EditionTiers["PUNCTUATION"] = "pon";
9
+ EditionTiers["ILLEGIBLE"] = "ileg";
10
+ EditionTiers["MODERNIZATION"] = "mod";
11
+ EditionTiers["PADRONIZATION"] = "pad";
12
+ EditionTiers["INFLECTION"] = "fle";
13
+ })(EditionTiers || (EditionTiers = {}));
@@ -0,0 +1,12 @@
1
+ export type ParameterType = 'C' | 'MC' | 'S' | 'TR';
2
+ export type Parameter = {
3
+ name: string;
4
+ symbol: string;
5
+ order: number;
6
+ type: ParameterType;
7
+ uid?: string;
8
+ corpus?: string;
9
+ value?: string;
10
+ map?: Record<string, string>;
11
+ values?: string[];
12
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,7 +1,7 @@
1
1
  import SentenceStatus from './SentenceStatus';
2
2
  export type Split = {
3
- v: string;
4
- t: string;
3
+ v?: string;
4
+ t?: string;
5
5
  idx: number;
6
6
  };
7
7
  export type Chunk = {
@@ -0,0 +1,8 @@
1
+ import { EditionTiers } from '../configs/types/EditionTiers';
2
+ import { Token } from '../configs/types/Struct';
3
+ declare const EditionTierUtils: {
4
+ getIterateTiers: () => EditionTiers[];
5
+ getEditionTierName: (k: string) => string;
6
+ getEditionForToken: (token: Token) => any;
7
+ };
8
+ export default EditionTierUtils;
@@ -0,0 +1,32 @@
1
+ import { EditionTiers } from '../configs/types/EditionTiers';
2
+ const getEditionForToken = (token) => {
3
+ if (token.eid)
4
+ return token.edition;
5
+ const edition = JSON.parse(JSON.stringify({
6
+ id: '',
7
+ o: '',
8
+ ops: {},
9
+ }));
10
+ return { ...edition, o: token.v };
11
+ };
12
+ const getIterateTiers = () => {
13
+ const ordered = [];
14
+ for (const value of Object.values(EditionTiers)) {
15
+ const key = getEditionTierName(value);
16
+ if (key !== 'ORIGINAL' && key !== 'JUNCTION' && key !== 'SEGMENTATION') {
17
+ ordered.push(value);
18
+ }
19
+ }
20
+ return ordered;
21
+ };
22
+ const getEditionTierName = (k) => {
23
+ const idx = Object.values(EditionTiers).indexOf(k);
24
+ const key = Object.keys(EditionTiers)[idx];
25
+ return key || k;
26
+ };
27
+ const EditionTierUtils = {
28
+ getIterateTiers,
29
+ getEditionTierName,
30
+ getEditionForToken,
31
+ };
32
+ export default EditionTierUtils;
@@ -4,5 +4,8 @@ declare const SentenceUtils: {
4
4
  getAsText: (struct: Struct, displayTags?: boolean) => string;
5
5
  isVisible: (token: Token) => boolean;
6
6
  isFirstFromSplit: (token: Token) => boolean;
7
+ getColspan: (thisToken: Token) => number;
8
+ skipToken: (token: Token) => boolean;
9
+ getTag: (token: Token) => string;
7
10
  };
8
11
  export default SentenceUtils;
@@ -1,3 +1,20 @@
1
+ const getTag = (token) => {
2
+ if (token.split)
3
+ return token.split.t || '';
4
+ return token.t ?? '';
5
+ };
6
+ const skipToken = (token) => {
7
+ if (token.ec)
8
+ return true;
9
+ if (!token.v)
10
+ return false;
11
+ if (token.v.startsWith('@') && token.split)
12
+ return true;
13
+ return false;
14
+ };
15
+ const getColspan = (thisToken) => {
16
+ return thisToken.splits ? thisToken.splits.length : 1;
17
+ };
1
18
  const getAsText = (struct, displayTags) => {
2
19
  const tokens = sort(struct);
3
20
  let value = '';
@@ -10,7 +27,7 @@ const getAsText = (struct, displayTags) => {
10
27
  };
11
28
  const getValue = (token, displayTags) => {
12
29
  return token.split !== undefined && token.ec === undefined && !displayTags
13
- ? token.split.v
30
+ ? token.split.v || ''
14
31
  : token.v;
15
32
  };
16
33
  const sort = (struct) => {
@@ -35,5 +52,8 @@ const SentenceUtils = {
35
52
  getAsText,
36
53
  isVisible,
37
54
  isFirstFromSplit,
55
+ getColspan,
56
+ skipToken,
57
+ getTag,
38
58
  };
39
59
  export default SentenceUtils;
package/dist/index.d.ts CHANGED
@@ -31,6 +31,8 @@ export { commonResources } from './configs/Localization';
31
31
  export type { Corpus, Github } from './configs/types/Corpus';
32
32
  export { CorpusImageTypeNames } from './configs/types/CorpusImage';
33
33
  export type { CorpusImage, CorpusImageType } from './configs/types/CorpusImage';
34
+ export { EditionTiers } from './configs/types/EditionTiers';
35
+ export type { Parameter, ParameterType } from './configs/types/Parameter';
34
36
  export { SentenceStatusNames } from './configs/types/SentenceStatus';
35
37
  export type { SentenceStatus } from './configs/types/SentenceStatus';
36
38
  export type { Chunk, Edition, Format, Morpheme, Split, Struct, Token, } from './configs/types/Struct';
@@ -42,6 +44,7 @@ export { useLoggedUtils } from './configs/useLoggedUtils';
42
44
  export { useMessageUtils } from './configs/useMessageUtils';
43
45
  export { useTourUtils } from './configs/useTourUtils';
44
46
  export { default as DateUtils } from './functions/DateUtils';
47
+ export { default as EditionTierUtils } from './functions/EditionTierUtils';
45
48
  export { default as FilterUtils } from './functions/FilterUtils';
46
49
  export { default as FormUtils } from './functions/FormUtils';
47
50
  export { default as ImageUtils } from './functions/ImageUtils';
package/dist/index.js CHANGED
@@ -22,6 +22,7 @@ export { default as HeaderNotifications } from './Comments/HeaderNotifications';
22
22
  export { CommonProvider } from './configs/CommonContext';
23
23
  export { commonResources } from './configs/Localization';
24
24
  export { CorpusImageTypeNames } from './configs/types/CorpusImage';
25
+ export { EditionTiers } from './configs/types/EditionTiers';
25
26
  export { SentenceStatusNames } from './configs/types/SentenceStatus';
26
27
  export { UserStatusNames } from './configs/types/User';
27
28
  export { useCorpusUtils } from './configs/useCorpusUtils';
@@ -29,6 +30,7 @@ export { useLoggedUtils } from './configs/useLoggedUtils';
29
30
  export { useMessageUtils } from './configs/useMessageUtils';
30
31
  export { useTourUtils } from './configs/useTourUtils';
31
32
  export { default as DateUtils } from './functions/DateUtils';
33
+ export { default as EditionTierUtils } from './functions/EditionTierUtils';
32
34
  export { default as FilterUtils } from './functions/FilterUtils';
33
35
  export { default as FormUtils } from './functions/FormUtils';
34
36
  export { default as ImageUtils } from './functions/ImageUtils';
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-26",
4
+ "version": "0.2.1-SNAPSHOT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -1,3 +0,0 @@
1
- import { Struct } from '../../configs/types/Struct';
2
- export declare const structExample: Struct;
3
- export declare const structNotParsedExample: Struct;
@@ -1,455 +0,0 @@
1
- export const structExample = {
2
- uid: '13e0ee30-8f07-11e6-b457-90b11c409ded',
3
- parsed: '2025-09-06T11:40:47.261+00:00',
4
- tokens: [
5
- {
6
- attributes: {
7
- 'gloss-br': 'agora',
8
- gloss: 'now',
9
- },
10
- p: 1,
11
- v: 'natigide',
12
- t: 'ADV',
13
- l: 1,
14
- },
15
- {
16
- splits: [
17
- {
18
- attributes: {
19
- 'gloss-br': 'Ant',
20
- gloss: 'Ant',
21
- },
22
- v: 'n',
23
- t: 'Ant',
24
- },
25
- {
26
- attributes: {
27
- 'gloss-br': 'história',
28
- gloss: 'history',
29
- },
30
- v: 'atema',
31
- t: 'n',
32
- },
33
- {
34
- attributes: {
35
- 'gloss-br': 'de',
36
- gloss: 'of',
37
- },
38
- v: 'tigi',
39
- t: 'Apl',
40
- },
41
- ],
42
- attributes: {
43
- 'gloss-br': 'história',
44
- },
45
- p: 2,
46
- v: 'natematigi',
47
- t: 'N$',
48
- l: 2,
49
- },
50
- {
51
- splits: [
52
- {
53
- attributes: {
54
- 'gloss-br': 'fem',
55
- gloss: 'fem',
56
- },
57
- v: 'a',
58
- t: 'Gnr',
59
- },
60
- {
61
- attributes: {
62
- 'gloss-br': 'ausente',
63
- gloss: 'absent',
64
- },
65
- v: 'ca',
66
- t: 'Ncl',
67
- },
68
- {
69
- attributes: {
70
- 'gloss-br': 'Hon',
71
- gloss: 'Hon',
72
- },
73
- v: 'wa',
74
- t: 'Hon',
75
- },
76
- ],
77
- attributes: {
78
- 'gloss-br': 'uma',
79
- },
80
- p: 3,
81
- v: 'acoa',
82
- t: 'D',
83
- l: 1,
84
- },
85
- {
86
- splits: [
87
- {
88
- attributes: {
89
- 'gloss-br': 'mulher',
90
- gloss: 'woman',
91
- },
92
- v: 'iwalo',
93
- t: 'n',
94
- },
95
- ],
96
- attributes: {
97
- 'gloss-br': 'mulher',
98
- },
99
- p: 4,
100
- v: 'iwaalo',
101
- t: 'N',
102
- l: 1,
103
- },
104
- {
105
- attributes: {
106
- 'gloss-br': 'que ',
107
- },
108
- p: 5,
109
- v: 'ane',
110
- t: 'WPRO',
111
- l: 3,
112
- },
113
- {
114
- p: 6,
115
- v: '*T*',
116
- l: 4,
117
- ec: true,
118
- coidx: [1, 2],
119
- },
120
- {
121
- splits: [
122
- {
123
- v: 'di',
124
- t: 'Inv',
125
- },
126
- {
127
- v: 'n',
128
- t: 'Ref',
129
- },
130
- {
131
- attributes: {
132
- 'gloss-br': 'virar',
133
- gloss: 'turn',
134
- },
135
- v: 'ana',
136
- t: 'v',
137
- },
138
- {
139
- attributes: {
140
- 'gloss-br': 'para',
141
- gloss: 'into',
142
- },
143
- v: 'tigi',
144
- t: 'Apl',
145
- },
146
- ],
147
- attributes: {
148
- 'gloss-br': 'virava',
149
- },
150
- p: 7,
151
- v: 'dinanatigi',
152
- t: 'VBAPL',
153
- l: 3,
154
- },
155
- {
156
- attributes: {
157
- 'gloss-br': 'que',
158
- },
159
- p: 8,
160
- v: 'me',
161
- t: 'C',
162
- l: 4,
163
- },
164
- {
165
- splits: [
166
- {
167
- attributes: {
168
- 'gloss-br': 'onça',
169
- gloss: 'jaguar',
170
- },
171
- v: 'nigediogo',
172
- t: 'n',
173
- },
174
- ],
175
- attributes: {
176
- 'gloss-br': 'onça',
177
- },
178
- p: 9,
179
- v: 'nigediogo',
180
- t: 'N',
181
- l: 6,
182
- },
183
- {
184
- p: 10,
185
- v: '.',
186
- t: '.',
187
- l: 0,
188
- },
189
- ],
190
- chunks: [
191
- {
192
- i: 1,
193
- f: 10,
194
- t: 'IP-MAT',
195
- l: 0,
196
- },
197
- {
198
- i: 1,
199
- f: 1,
200
- t: 'ADVP',
201
- l: 1,
202
- },
203
- {
204
- i: 2,
205
- f: 9,
206
- t: 'NP',
207
- l: 1,
208
- },
209
- {
210
- i: 2,
211
- f: 2,
212
- t: 'NP',
213
- l: 2,
214
- },
215
- {
216
- i: 5,
217
- f: 9,
218
- t: 'CP-REL',
219
- l: 2,
220
- },
221
- {
222
- i: 5,
223
- f: 5,
224
- t: 'WNP',
225
- l: 3,
226
- coidx: [1, 2],
227
- },
228
- {
229
- i: 6,
230
- f: 9,
231
- t: 'IP-SUB',
232
- l: 3,
233
- },
234
- {
235
- i: 8,
236
- f: 9,
237
- t: 'CP-me',
238
- l: 4,
239
- },
240
- {
241
- i: 9,
242
- f: 9,
243
- t: 'IP-SUB',
244
- l: 5,
245
- },
246
- {
247
- i: 9,
248
- f: 9,
249
- t: 'NP',
250
- l: 6,
251
- },
252
- {
253
- i: 6,
254
- f: 6,
255
- t: 'NP-TRACE',
256
- l: 4,
257
- },
258
- ],
259
- corpus: 'C12',
260
- document: 'D388',
261
- page: 'P7029',
262
- };
263
- export const structNotParsedExample = {
264
- uid: '13e0ee30-8f07-11e6-b457-90b11c409ded',
265
- tokens: [
266
- {
267
- attributes: {
268
- 'gloss-br': 'agora',
269
- gloss: 'now',
270
- },
271
- p: 1,
272
- v: 'natigide',
273
- t: 'ADV',
274
- l: 1,
275
- },
276
- {
277
- splits: [
278
- {
279
- attributes: {
280
- 'gloss-br': 'Ant',
281
- gloss: 'Ant',
282
- },
283
- v: 'n',
284
- t: 'Ant',
285
- },
286
- {
287
- attributes: {
288
- 'gloss-br': 'história',
289
- gloss: 'history',
290
- },
291
- v: 'atema',
292
- t: 'n',
293
- },
294
- {
295
- attributes: {
296
- 'gloss-br': 'de',
297
- gloss: 'of',
298
- },
299
- v: 'tigi',
300
- t: 'Apl',
301
- },
302
- ],
303
- attributes: {
304
- 'gloss-br': 'história',
305
- },
306
- p: 2,
307
- v: 'natematigi',
308
- t: 'N$',
309
- l: 2,
310
- },
311
- {
312
- splits: [
313
- {
314
- attributes: {
315
- 'gloss-br': 'fem',
316
- gloss: 'fem',
317
- },
318
- v: 'a',
319
- t: 'Gnr',
320
- },
321
- {
322
- attributes: {
323
- 'gloss-br': 'ausente',
324
- gloss: 'absent',
325
- },
326
- v: 'ca',
327
- t: 'Ncl',
328
- },
329
- {
330
- attributes: {
331
- 'gloss-br': 'Hon',
332
- gloss: 'Hon',
333
- },
334
- v: 'wa',
335
- t: 'Hon',
336
- },
337
- ],
338
- attributes: {
339
- 'gloss-br': 'uma',
340
- },
341
- p: 3,
342
- v: 'acoa',
343
- t: 'D',
344
- l: 1,
345
- },
346
- {
347
- splits: [
348
- {
349
- attributes: {
350
- 'gloss-br': 'mulher',
351
- gloss: 'woman',
352
- },
353
- v: 'iwalo',
354
- t: 'n',
355
- },
356
- ],
357
- attributes: {
358
- 'gloss-br': 'mulher',
359
- },
360
- p: 4,
361
- v: 'iwaalo',
362
- t: 'N',
363
- l: 1,
364
- },
365
- {
366
- attributes: {
367
- 'gloss-br': 'que ',
368
- },
369
- p: 5,
370
- v: 'ane',
371
- t: 'WPRO',
372
- l: 3,
373
- },
374
- {
375
- p: 6,
376
- v: '*T*',
377
- l: 4,
378
- ec: true,
379
- coidx: [1],
380
- },
381
- {
382
- splits: [
383
- {
384
- v: 'di',
385
- t: 'Inv',
386
- },
387
- {
388
- v: 'n',
389
- t: 'Ref',
390
- },
391
- {
392
- attributes: {
393
- 'gloss-br': 'virar',
394
- gloss: 'turn',
395
- },
396
- v: 'ana',
397
- t: 'v',
398
- },
399
- {
400
- attributes: {
401
- 'gloss-br': 'para',
402
- gloss: 'into',
403
- },
404
- v: 'tigi',
405
- t: 'Apl',
406
- },
407
- ],
408
- attributes: {
409
- 'gloss-br': 'virava',
410
- },
411
- p: 7,
412
- v: 'dinanatigi',
413
- t: 'VBAPL',
414
- l: 3,
415
- },
416
- {
417
- attributes: {
418
- 'gloss-br': 'que',
419
- },
420
- p: 8,
421
- v: 'me',
422
- t: 'C',
423
- l: 4,
424
- },
425
- {
426
- splits: [
427
- {
428
- attributes: {
429
- 'gloss-br': 'onça',
430
- gloss: 'jaguar',
431
- },
432
- v: 'nigediogo',
433
- t: 'n',
434
- },
435
- ],
436
- attributes: {
437
- 'gloss-br': 'onça',
438
- },
439
- p: 9,
440
- v: 'nigediogo',
441
- t: 'N',
442
- l: 6,
443
- },
444
- {
445
- p: 10,
446
- v: '.',
447
- t: '.',
448
- l: 0,
449
- },
450
- ],
451
- chunks: [],
452
- corpus: 'C12',
453
- document: 'D388',
454
- page: 'P7029',
455
- };