tycho-components 0.29.16 → 0.30.0

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.
@@ -6,6 +6,7 @@ import { UploadedFile } from "../../common/AppDropzone/UploadedFile";
6
6
  export type Mark = {
7
7
  id: string;
8
8
  tokens: Token[];
9
+ editions?: Edition[];
9
10
  before?: boolean;
10
11
  };
11
12
  export type Break = {
@@ -120,9 +120,20 @@ const getEditionForToken = (token) => {
120
120
  o: '',
121
121
  ops: {},
122
122
  }));
123
- return { ...edition, o: token.v };
123
+ const base = { ...edition, o: token.split?.v || token.v };
124
+ if (!token.edition?.ops || Object.keys(token.edition.ops).length === 0) {
125
+ if (token.edition?.o) {
126
+ return { ...base, ...token.edition, ops: token.edition.ops || {} };
127
+ }
128
+ return base;
129
+ }
130
+ return {
131
+ ...base,
132
+ ...token.edition,
133
+ ops: { ...base.ops, ...token.edition.ops },
134
+ };
124
135
  };
125
- const getOriginalValue = (token) => token.edition?.o || '';
136
+ const getOriginalValue = (token) => token.edition?.o || token.v || '';
126
137
  const getDisplayTierOrder = (corpus) => [
127
138
  StructuralEditionTiers.ORIGINAL,
128
139
  StructuralEditionTiers.JUNCTION,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tycho-components",
3
3
  "private": false,
4
- "version": "0.29.16",
4
+ "version": "0.30.0",
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.5",
85
+ "tycho-storybook": "0.10.6",
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.5",
114
+ "tycho-storybook": "^0.10.6",
115
115
  "typescript": "^5.7.3",
116
116
  "vite": "^7.0.0",
117
117
  "vitest": "^3.2.6",