tycho-components 0.28.2 → 0.28.4

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.
@@ -179,6 +179,10 @@ export default class CytoscapeTreeConverter {
179
179
  return (dominator !== null &&
180
180
  this.generateChunkId(dominator) === this.generateChunkId(chunk));
181
181
  }
182
+ const tightestDominator = this.findTightestContainingChunk(struct, token.p, token.p);
183
+ if (tightestDominator !== null) {
184
+ return (this.generateChunkId(tightestDominator) === this.generateChunkId(chunk));
185
+ }
182
186
  if (token.l !== chunk.l)
183
187
  return false;
184
188
  const dominator = this.tightestChunk(this.findContainingChunks(struct, chunk.l, token.p, token.p));
@@ -11,6 +11,7 @@ declare const EditionTierUtils: {
11
11
  getTierLabel: (symbol: string, corpus?: Corpus | null, t?: (key: string) => string) => string;
12
12
  isUnderSelected: (selected: string, tier: string, corpus?: Corpus | null) => boolean;
13
13
  buildEditionGroups: (corpus?: Corpus | null) => EditionGroup[];
14
+ getUngroupedEditionTiers: (corpus?: Corpus | null) => string[];
14
15
  findGroupForTier: (tier: string, corpus?: Corpus | null) => EditionGroup | undefined;
15
16
  isAbbreviationTier: (symbol: string, corpus?: Corpus | null) => boolean;
16
17
  validateEditionTiers: (tiers: EditionTierDefinition[]) => string | null;
@@ -54,20 +54,31 @@ const buildEditionGroups = (corpus) => {
54
54
  tiers: [StructuralEditionTiers.ORIGINAL],
55
55
  defaultTier: StructuralEditionTiers.ORIGINAL,
56
56
  },
57
- {
58
- id: 'semiDiplomatic',
59
- labelKey: 'edition.group.semiDiplomatic',
60
- tiers: semi,
61
- defaultTier: semi[semi.length - 1] || EditionTiers.ILLEGIBLE,
62
- },
63
- {
64
- id: 'modernized',
65
- labelKey: 'edition.group.modernized',
66
- tiers: modern,
67
- defaultTier: modern[modern.length - 1] || EditionTiers.INFLECTION,
68
- },
57
+ ...(semi.length > 0
58
+ ? [
59
+ {
60
+ id: 'semiDiplomatic',
61
+ labelKey: 'edition.group.semiDiplomatic',
62
+ tiers: semi,
63
+ defaultTier: semi[semi.length - 1],
64
+ },
65
+ ]
66
+ : []),
67
+ ...(modern.length > 0
68
+ ? [
69
+ {
70
+ id: 'modernized',
71
+ labelKey: 'edition.group.modernized',
72
+ tiers: modern,
73
+ defaultTier: modern[modern.length - 1],
74
+ },
75
+ ]
76
+ : []),
69
77
  ];
70
78
  };
79
+ const getUngroupedEditionTiers = (corpus) => getCorpusEditionTiers(corpus)
80
+ .filter((tier) => tier.group !== 'semiDiplomatic' && tier.group !== 'modernized')
81
+ .map((tier) => tier.symbol);
71
82
  const findGroupForTier = (tier, corpus) => buildEditionGroups(corpus).find((group) => group.tiers.includes(tier));
72
83
  const isAbbreviationTier = (symbol, corpus) => getCorpusEditionTiers(corpus).some((tier) => tier.symbol === symbol && tier.abbreviation);
73
84
  const validateEditionTiers = (tiers) => {
@@ -114,6 +125,7 @@ const EditionTierUtils = {
114
125
  getTierLabel,
115
126
  isUnderSelected,
116
127
  buildEditionGroups,
128
+ getUngroupedEditionTiers,
117
129
  findGroupForTier,
118
130
  isAbbreviationTier,
119
131
  validateEditionTiers,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tycho-components",
3
3
  "private": false,
4
- "version": "0.28.2",
4
+ "version": "0.28.4",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {