tycho-components 0.10.1 → 0.10.3

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.
@@ -2,8 +2,6 @@
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  text-align: center;
5
- margin: auto 0px;
6
- height: 100%;
7
5
 
8
6
  > .ds-icon {
9
7
  color: var(--icon-on-disabled);
@@ -2,6 +2,7 @@ import { Struct, Token } from "../configs/types/Struct";
2
2
  declare const SentenceUtils: {
3
3
  sort: (struct: Struct) => Token[];
4
4
  getAsText: (struct: Struct, displayTags?: boolean) => string;
5
+ getAsTextWithTags: (struct: Struct) => string;
5
6
  isVisible: (token: Token) => boolean;
6
7
  isFirstFromSplit: (token: Token) => boolean;
7
8
  getColspan: (thisToken: Token) => number;
@@ -26,6 +26,21 @@ const getAsText = (struct, displayTags) => {
26
26
  });
27
27
  return value.trim();
28
28
  };
29
+ const getAsTextWithTags = (struct) => {
30
+ const tokens = sort(struct);
31
+ let value = "";
32
+ tokens.forEach((token) => {
33
+ if (!isVisible(token))
34
+ return;
35
+ let tokenValue = getValue(token, true);
36
+ const tag = getTag(token);
37
+ if (tag) {
38
+ tokenValue = `${tokenValue}/${tag}`;
39
+ }
40
+ value += `${tokenValue} `;
41
+ });
42
+ return value.trim();
43
+ };
29
44
  const getValue = (token, displayTags) => {
30
45
  return token.split !== undefined && token.ec === undefined && !displayTags
31
46
  ? token.split.v || ""
@@ -56,6 +71,7 @@ const getEditionTierName = (k) => {
56
71
  const SentenceUtils = {
57
72
  sort,
58
73
  getAsText,
74
+ getAsTextWithTags,
59
75
  isVisible,
60
76
  isFirstFromSplit,
61
77
  getColspan,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tycho-components",
3
3
  "private": false,
4
- "version": "0.10.1",
4
+ "version": "0.10.3",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {