tycho-components 0.31.0 → 0.31.2
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/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export { SentenceStatusNames } from './types/SentenceStatus';
|
|
|
21
21
|
export type { SentenceStatus } from './types/SentenceStatus';
|
|
22
22
|
export type { Mark, Break, Format as SentenceFormat, SentenceTier, Translation, } from './types/Sentence';
|
|
23
23
|
export type { default as Sentence } from './types/Sentence';
|
|
24
|
+
export { INFLECTIONS } from './types/Struct';
|
|
24
25
|
export type { Chunk, Edition, Format, Morpheme, Split, Struct, Token, ConlluToken, } from './types/Struct';
|
|
25
26
|
export type { CytoscapeTree, Tree } from './types/Tree';
|
|
26
27
|
export { UserStatusNames } from './types/User';
|
package/dist/configs/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export { CorpusImageTypeNames } from './types/CorpusImage';
|
|
|
10
10
|
export { DEFAULT_EDITION_TIERS, EditionTiers, StructuralEditionTiers, isStructuralEditionTier, } from './types/EditionTiers';
|
|
11
11
|
export { DEFAULT_DELIMITERS, DELIMITERS, DelimiterNames, EMPTY_CONFIGURATION, } from './types/ProcessConfiguration';
|
|
12
12
|
export { SentenceStatusNames } from './types/SentenceStatus';
|
|
13
|
+
export { INFLECTIONS } from './types/Struct';
|
|
13
14
|
export { UserStatusNames } from './types/User';
|
|
14
15
|
export { useCorpusUtils } from './useCorpusUtils';
|
|
15
16
|
export { useLoggedUtils } from './useLoggedUtils';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const INFLECTIONS = ['1S', '2S', '3S', '1P', '2P', '3P'];
|
|
@@ -19,12 +19,14 @@ const getColspan = (thisToken) => {
|
|
|
19
19
|
return thisToken.splits ? thisToken.splits.length : 1;
|
|
20
20
|
};
|
|
21
21
|
const getAsText = (struct, displayTags) => {
|
|
22
|
+
if (displayTags)
|
|
23
|
+
return getAsTextWithTags(struct);
|
|
22
24
|
const tokens = sort(struct);
|
|
23
25
|
let value = '';
|
|
24
|
-
tokens.forEach((token
|
|
26
|
+
tokens.forEach((token) => {
|
|
25
27
|
if (!isVisible(token))
|
|
26
28
|
return;
|
|
27
|
-
value += `${getValue(token
|
|
29
|
+
value += `${getValue(token)} `;
|
|
28
30
|
});
|
|
29
31
|
return value.trim();
|
|
30
32
|
};
|
|
@@ -34,7 +36,7 @@ const getAsTextWithTags = (struct) => {
|
|
|
34
36
|
tokens.forEach((token) => {
|
|
35
37
|
if (!isVisible(token))
|
|
36
38
|
return;
|
|
37
|
-
let tokenValue = token
|
|
39
|
+
let tokenValue = getValue(token);
|
|
38
40
|
const tag = getTag(token);
|
|
39
41
|
if (tag) {
|
|
40
42
|
tokenValue = `${tokenValue}/${tag}`;
|
|
@@ -43,10 +45,11 @@ const getAsTextWithTags = (struct) => {
|
|
|
43
45
|
});
|
|
44
46
|
return value.trim();
|
|
45
47
|
};
|
|
46
|
-
const getValue = (token
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
const getValue = (token) => {
|
|
49
|
+
if (token.split != null && token.ec == null) {
|
|
50
|
+
return token.split.v ?? '';
|
|
51
|
+
}
|
|
52
|
+
return token.v ?? '';
|
|
50
53
|
};
|
|
51
54
|
const sort = (struct) => {
|
|
52
55
|
if (!struct?.tokens)
|
|
@@ -63,7 +66,9 @@ const isVisible = (token) => {
|
|
|
63
66
|
const isFirstFromSplit = (token) => {
|
|
64
67
|
if (!token.split)
|
|
65
68
|
return false;
|
|
66
|
-
|
|
69
|
+
if (token.split.idx !== undefined)
|
|
70
|
+
return token.split.idx === 0;
|
|
71
|
+
return Boolean(token.split.v);
|
|
67
72
|
};
|
|
68
73
|
const getEditionTierName = (k) => EditionTierUtils.getEditionTierName(k);
|
|
69
74
|
const SentenceUtils = {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tycho-components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.31.
|
|
4
|
+
"version": "0.31.2",
|
|
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.7",
|
|
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.7",
|
|
115
115
|
"typescript": "^5.7.3",
|
|
116
116
|
"vite": "^7.0.0",
|
|
117
117
|
"vitest": "^3.2.6",
|