@platforma-sdk/model 1.39.18 → 1.40.1

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/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const PlatformaSDKVersion = "1.39.18";
1
+ export declare const PlatformaSDKVersion = "1.40.1";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,YAAY,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,WAAW,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platforma-sdk/model",
3
- "version": "1.39.18",
3
+ "version": "1.40.1",
4
4
  "description": "Platforma.bio SDK / Block Model",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",
@@ -36,21 +36,27 @@ import {
36
36
  TreeNodeAccessor,
37
37
  } from '../render';
38
38
 
39
- /** Canonicalized PTableColumnSpec JSON string */
40
- export type PTableColumnSpecJson = CanonicalizedJson<PTableColumnSpec>;
39
+ export type PlTableColumnId = {
40
+ /** Original column spec */
41
+ source: PTableColumnSpec;
42
+ /** Column spec with labeled axes replaced by label columns */
43
+ labeled: PTableColumnSpec;
44
+ };
45
+
46
+ export type PlTableColumnIdJson = CanonicalizedJson<PlTableColumnId>;
41
47
 
42
48
  export type PlDataTableGridStateCore = {
43
49
  /** Includes column ordering */
44
50
  columnOrder?: {
45
51
  /** All colIds in order */
46
- orderedColIds: PTableColumnSpecJson[];
52
+ orderedColIds: PlTableColumnIdJson[];
47
53
  };
48
54
  /** Includes current sort columns and direction */
49
55
  sort?: {
50
56
  /** Sorted columns and directions in order */
51
57
  sortModel: {
52
58
  /** Column Id to apply the sort to. */
53
- colId: PTableColumnSpecJson;
59
+ colId: PlTableColumnIdJson;
54
60
  /** Sort direction */
55
61
  sort: 'asc' | 'desc';
56
62
  }[];
@@ -58,7 +64,7 @@ export type PlDataTableGridStateCore = {
58
64
  /** Includes column visibility */
59
65
  columnVisibility?: {
60
66
  /** All colIds which were hidden */
61
- hiddenColIds: PTableColumnSpecJson[];
67
+ hiddenColIds: PlTableColumnIdJson[];
62
68
  };
63
69
  };
64
70
 
@@ -85,7 +91,19 @@ export type PlDataTableStateV2 =
85
91
  // Old versions of the state
86
92
  | {
87
93
  // no version
88
- gridState: PlDataTableGridStateCore & {
94
+ gridState: {
95
+ columnOrder?: {
96
+ orderedColIds: CanonicalizedJson<PTableColumnSpec>[];
97
+ };
98
+ sort?: {
99
+ sortModel: {
100
+ colId: CanonicalizedJson<PTableColumnSpec>;
101
+ sort: 'asc' | 'desc';
102
+ }[];
103
+ };
104
+ columnVisibility?: {
105
+ hiddenColIds: CanonicalizedJson<PTableColumnSpec>[];
106
+ };
89
107
  sourceId?: string;
90
108
  sheets?: Record<CanonicalizedJson<AxisId>, string | number>;
91
109
  };
@@ -98,7 +116,20 @@ export type PlDataTableStateV2 =
98
116
  version: 2;
99
117
  stateCache: {
100
118
  sourceId: string;
101
- gridState: PlDataTableGridStateCore;
119
+ gridState: {
120
+ columnOrder?: {
121
+ orderedColIds: CanonicalizedJson<PTableColumnSpec>[];
122
+ };
123
+ sort?: {
124
+ sortModel: {
125
+ colId: CanonicalizedJson<PTableColumnSpec>;
126
+ sort: 'asc' | 'desc';
127
+ }[];
128
+ };
129
+ columnVisibility?: {
130
+ hiddenColIds: CanonicalizedJson<PTableColumnSpec>[];
131
+ };
132
+ };
102
133
  sheetsState: PlDataTableSheetState[];
103
134
  }[];
104
135
  pTableParams: {
@@ -107,6 +138,29 @@ export type PlDataTableStateV2 =
107
138
  sorting: PTableSorting[];
108
139
  };
109
140
  }
141
+ | {
142
+ version: 3;
143
+ stateCache: {
144
+ sourceId: string;
145
+ gridState: {
146
+ columnOrder?: {
147
+ orderedColIds: CanonicalizedJson<PTableColumnSpec>[];
148
+ };
149
+ sort?: {
150
+ sortModel: {
151
+ colId: CanonicalizedJson<PTableColumnSpec>;
152
+ sort: 'asc' | 'desc';
153
+ }[];
154
+ };
155
+ columnVisibility?: {
156
+ hiddenColIds: CanonicalizedJson<PTableColumnSpec>[];
157
+ };
158
+ };
159
+ sheetsState: PlDataTableSheetState[];
160
+ filtersState: PlDataTableFilterState[];
161
+ }[];
162
+ pTableParams: PTableParamsV2;
163
+ }
110
164
  // Normalized state
111
165
  | PlDataTableStateV2Normalized;
112
166
 
@@ -139,7 +193,7 @@ export type PTableParamsV2 =
139
193
 
140
194
  export type PlDataTableStateV2Normalized = {
141
195
  /** Version for upgrades */
142
- version: 3;
196
+ version: 4;
143
197
  /** Internal states, LRU cache for 5 sourceId-s */
144
198
  stateCache: PlDataTableStateV2CacheEntry[];
145
199
  /** PTable params derived from the cache state for the current sourceId */
@@ -159,7 +213,7 @@ export function makeDefaultPTableParams(): PTableParamsV2 {
159
213
  /** Create default PlDataTableStateV2 */
160
214
  export function createPlDataTableStateV2(): PlDataTableStateV2Normalized {
161
215
  return {
162
- version: 3,
216
+ version: 4,
163
217
  stateCache: [],
164
218
  pTableParams: makeDefaultPTableParams(),
165
219
  };
@@ -167,10 +221,10 @@ export function createPlDataTableStateV2(): PlDataTableStateV2Normalized {
167
221
 
168
222
  /** Upgrade PlDataTableStateV2 to the latest version */
169
223
  export function upgradePlDataTableStateV2(state: PlDataTableStateV2): PlDataTableStateV2Normalized {
170
- // v1
224
+ // v1 -> v2
171
225
  if (!('version' in state)) {
172
226
  // Non upgradeable as sourceId calculation algorithm has changed, resetting state to default
173
- return createPlDataTableStateV2();
227
+ state = createPlDataTableStateV2();
174
228
  }
175
229
  // v2 -> v3
176
230
  if (state.version === 2) {
@@ -183,6 +237,11 @@ export function upgradePlDataTableStateV2(state: PlDataTableStateV2): PlDataTabl
183
237
  pTableParams: makeDefaultPTableParams(),
184
238
  };
185
239
  }
240
+ // v3 -> v4
241
+ if (state.version === 3) {
242
+ // Non upgradeable as column ids calculation algorithm has changed, resetting state to default
243
+ state = createPlDataTableStateV2();
244
+ }
186
245
  return state;
187
246
  }
188
247
 
@@ -12,11 +12,27 @@ import { type PlSelectionModel } from './PlSelectionModel';
12
12
 
13
13
  export type PColumnPredicate = (column: PColumnIdAndSpec) => boolean;
14
14
 
15
- export type PlMultiSequenceAlignmentModel = {
16
- version?: number;
15
+ export interface PlMultiSequenceAlignmentSettings {
17
16
  sequenceColumnIds?: PObjectId[];
18
17
  labelColumnIds?: PTableColumnId[];
19
- };
18
+ colorScheme: PlMultiSequenceAlignmentColorSchemeOption;
19
+ widgets: ('consensus' | 'seqLogo' | 'legend')[];
20
+ alignmentParams: {
21
+ gpo: number;
22
+ gpe: number;
23
+ tgpe: number;
24
+ };
25
+ }
26
+
27
+ export interface PlMultiSequenceAlignmentModel
28
+ extends Partial<PlMultiSequenceAlignmentSettings> {
29
+ version?: number;
30
+ }
31
+
32
+ export type PlMultiSequenceAlignmentColorSchemeOption =
33
+ | { type: 'no-color' }
34
+ | { type: 'chemical-properties' }
35
+ | { type: 'markup'; columnId: PObjectId };
20
36
 
21
37
  export function createRowSelectionColumn({
22
38
  selection,