@milaboratories/milaboratories.ui-examples.model 1.2.22 → 1.2.24

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@milaboratories/milaboratories.ui-examples.model",
3
- "version": "1.2.22",
3
+ "version": "1.2.24",
4
4
  "description": "Block model",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -8,13 +8,13 @@
8
8
  "types": "dist/index.d.ts",
9
9
  "dependencies": {
10
10
  "zod": "~3.23.8",
11
- "@platforma-sdk/model": "1.42.10"
11
+ "@platforma-sdk/model": "1.42.16"
12
12
  },
13
13
  "devDependencies": {
14
14
  "typescript": "~5.6.3",
15
15
  "vite": "^6.3.5",
16
16
  "tsup": "~8.3.5",
17
- "@platforma-sdk/block-tools": "2.5.80"
17
+ "@platforma-sdk/block-tools": "2.5.81"
18
18
  },
19
19
  "tsup": {
20
20
  "entry": [
package/src/index.ts CHANGED
@@ -9,9 +9,13 @@ import type {
9
9
  PlDataTableSheet,
10
10
  } from '@platforma-sdk/model';
11
11
  import {
12
+ Annotation,
12
13
  BlockModel,
13
14
  createPlDataTableStateV2,
14
15
  createPlDataTableV2,
16
+ PColumnName,
17
+ stringifyJson,
18
+ ValueType,
15
19
  } from '@platforma-sdk/model';
16
20
  import { z } from 'zod';
17
21
 
@@ -99,12 +103,12 @@ export const platforma = BlockModel.create('Heavy')
99
103
  const sheets = [
100
104
  {
101
105
  axis: {
102
- type: 'Int',
106
+ type: ValueType.Int,
103
107
  name: 'part',
104
108
  annotations: {
105
- 'pl7.app/label': 'Partitioned axis',
106
- 'pl7.app/discreteValues': '[0,1]',
107
- },
109
+ [Annotation.Label]: 'Partitioned axis',
110
+ [Annotation.DiscreteValues]: stringifyJson([0, 1]),
111
+ } satisfies Annotation,
108
112
  },
109
113
  options: [
110
114
  { value: 0, label: 'Partition 1' },
@@ -123,28 +127,28 @@ export const platforma = BlockModel.create('Heavy')
123
127
  id: 'column1' as PObjectId,
124
128
  spec: {
125
129
  kind: 'PColumn',
126
- valueType: 'String',
130
+ valueType: ValueType.String,
127
131
  name: 'example',
128
132
  annotations: {
129
- 'pl7.app/label': 'String column',
130
- 'pl7.app/discreteValues': '["up","down"]',
131
- 'pl7.app/table/orderPriority': '101',
132
- },
133
+ [Annotation.Label]: 'String column',
134
+ [Annotation.DiscreteValues]: stringifyJson(['up', 'down']),
135
+ [Annotation.Table.OrderPriority]: stringifyJson(101),
136
+ } satisfies Annotation,
133
137
  axesSpec: [
134
138
  {
135
- type: 'Int',
139
+ type: ValueType.Int,
136
140
  name: 'part',
137
141
  annotations: {
138
- 'pl7.app/label': 'Partitioned axis',
139
- 'pl7.app/discreteValues': '[0,1]',
140
- },
142
+ [Annotation.Label]: 'Partitioned axis',
143
+ [Annotation.DiscreteValues]: stringifyJson([0, 1]),
144
+ } satisfies Annotation,
141
145
  },
142
146
  {
143
- type: 'Int',
147
+ type: ValueType.Int,
144
148
  name: 'index',
145
149
  annotations: {
146
- 'pl7.app/label': 'Int axis',
147
- },
150
+ [Annotation.Label]: 'Int axis',
151
+ } satisfies Annotation,
148
152
  },
149
153
  ],
150
154
  },
@@ -160,28 +164,28 @@ export const platforma = BlockModel.create('Heavy')
160
164
  id: 'column2' as PObjectId,
161
165
  spec: {
162
166
  kind: 'PColumn',
163
- valueType: 'Float',
167
+ valueType: ValueType.Float,
164
168
  name: 'value',
165
169
  annotations: {
166
- 'pl7.app/label': 'Float column',
167
- 'pl7.app/table/visibility': 'optional',
168
- 'pl7.app/table/orderPriority': '100',
169
- },
170
+ [Annotation.Label]: 'Float column',
171
+ [Annotation.Table.Visibility]: 'optional',
172
+ [Annotation.Table.OrderPriority]: stringifyJson(100),
173
+ } satisfies Annotation,
170
174
  axesSpec: [
171
175
  {
172
- type: 'Int',
176
+ type: ValueType.Int,
173
177
  name: 'part',
174
178
  annotations: {
175
- 'pl7.app/label': 'Partitioned axis',
176
- 'pl7.app/discreteValues': '[0,1]',
177
- },
179
+ [Annotation.Label]: 'Partitioned axis',
180
+ [Annotation.DiscreteValues]: stringifyJson([0, 1]),
181
+ } satisfies Annotation,
178
182
  },
179
183
  {
180
- type: 'Int',
184
+ type: ValueType.Int,
181
185
  name: 'index',
182
186
  annotations: {
183
- 'pl7.app/label': 'Int axis',
184
- },
187
+ [Annotation.Label]: 'Int axis',
188
+ } satisfies Annotation,
185
189
  },
186
190
  ],
187
191
  },
@@ -197,18 +201,18 @@ export const platforma = BlockModel.create('Heavy')
197
201
  id: 'labelColumn' as PObjectId,
198
202
  spec: {
199
203
  kind: 'PColumn',
200
- valueType: 'Int',
201
- name: 'pl7.app/label',
204
+ valueType: ValueType.Int,
205
+ name: PColumnName.Label,
202
206
  annotations: {
203
- 'pl7.app/label': 'Int axis labels',
204
- },
207
+ [Annotation.Label]: 'Int axis labels',
208
+ } satisfies Annotation,
205
209
  axesSpec: [
206
210
  {
207
- type: 'Int',
211
+ type: ValueType.Int,
208
212
  name: 'index',
209
213
  annotations: {
210
- 'pl7.app/label': 'Int axis',
211
- },
214
+ [Annotation.Label]: 'Int axis',
215
+ } satisfies Annotation,
212
216
  },
213
217
  ],
214
218
  },
@@ -224,27 +228,27 @@ export const platforma = BlockModel.create('Heavy')
224
228
  id: 'linkerColumn' as PObjectId,
225
229
  spec: {
226
230
  kind: 'PColumn',
227
- valueType: 'Int',
231
+ valueType: ValueType.Int,
228
232
  name: 'linker',
229
233
  annotations: {
230
- 'pl7.app/label': 'Index axis linker',
231
- 'pl7.app/isLinkerColumn': 'true',
232
- 'pl7.app/table/visibility': 'hidden',
233
- },
234
+ [Annotation.Label]: 'Index axis linker',
235
+ [Annotation.IsLinkerColumn]: stringifyJson(true),
236
+ [Annotation.Table.Visibility]: 'hidden',
237
+ } satisfies Annotation,
234
238
  axesSpec: [
235
239
  {
236
- type: 'Int',
240
+ type: ValueType.Int,
237
241
  name: 'index',
238
242
  annotations: {
239
- 'pl7.app/label': 'Int axis',
240
- },
243
+ [Annotation.Label]: 'Int axis',
244
+ } satisfies Annotation,
241
245
  },
242
246
  {
243
- type: 'Int',
247
+ type: ValueType.Int,
244
248
  name: 'linkedIndex',
245
249
  annotations: {
246
- 'pl7.app/label': 'Linked int axis',
247
- },
250
+ [Annotation.Label]: 'Linked int axis',
251
+ } satisfies Annotation,
248
252
  },
249
253
  ],
250
254
  },
@@ -262,20 +266,20 @@ export const platforma = BlockModel.create('Heavy')
262
266
  id: `alphabeticalColumn${j}` as PObjectId,
263
267
  spec: {
264
268
  kind: 'PColumn',
265
- valueType: 'String',
269
+ valueType: ValueType.String,
266
270
  name: 'value',
267
271
  annotations: {
268
- 'pl7.app/label': `Alphabetical column ${j}`,
269
- 'pl7.app/table/visibility': 'optional',
270
- 'pl7.app/table/orderPriority': (10 - j).toString(),
271
- },
272
+ [Annotation.Label]: `Alphabetical column ${j}`,
273
+ [Annotation.Table.Visibility]: 'optional',
274
+ [Annotation.Table.OrderPriority]: stringifyJson(10 - j),
275
+ } satisfies Annotation,
272
276
  axesSpec: [
273
277
  {
274
- type: 'Int',
278
+ type: ValueType.Int,
275
279
  name: 'linkedIndex',
276
280
  annotations: {
277
- 'pl7.app/label': 'Linked int axis',
278
- },
281
+ [Annotation.Label]: 'Linked int axis',
282
+ } satisfies Annotation,
279
283
  },
280
284
  ],
281
285
  },