@platforma-sdk/model 1.53.10 → 1.53.13

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.
Files changed (288) hide show
  1. package/dist/annotations/converter.cjs +11 -11
  2. package/dist/annotations/converter.cjs.map +1 -1
  3. package/dist/annotations/converter.d.ts +1 -1
  4. package/dist/annotations/converter.d.ts.map +1 -1
  5. package/dist/annotations/converter.js +11 -11
  6. package/dist/annotations/converter.js.map +1 -1
  7. package/dist/annotations/index.d.ts +2 -2
  8. package/dist/annotations/types.d.ts +4 -4
  9. package/dist/bconfig/index.d.ts +5 -5
  10. package/dist/bconfig/lambdas.d.ts +7 -7
  11. package/dist/bconfig/lambdas.d.ts.map +1 -1
  12. package/dist/bconfig/normalization.cjs.map +1 -1
  13. package/dist/bconfig/normalization.d.ts +3 -3
  14. package/dist/bconfig/normalization.js.map +1 -1
  15. package/dist/bconfig/types.cjs.map +1 -1
  16. package/dist/bconfig/types.d.ts +2 -2
  17. package/dist/bconfig/types.d.ts.map +1 -1
  18. package/dist/bconfig/types.js.map +1 -1
  19. package/dist/bconfig/util.d.ts +4 -4
  20. package/dist/bconfig/v3.d.ts +3 -3
  21. package/dist/block_api_v1.d.ts +2 -2
  22. package/dist/block_api_v1.d.ts.map +1 -1
  23. package/dist/block_api_v2.d.ts +2 -2
  24. package/dist/block_api_v2.d.ts.map +1 -1
  25. package/dist/block_api_v3.d.ts +3 -3
  26. package/dist/block_migrations.cjs +10 -10
  27. package/dist/block_migrations.cjs.map +1 -1
  28. package/dist/block_migrations.d.ts.map +1 -1
  29. package/dist/block_migrations.js +10 -10
  30. package/dist/block_migrations.js.map +1 -1
  31. package/dist/block_model.cjs +11 -11
  32. package/dist/block_model.cjs.map +1 -1
  33. package/dist/block_model.d.ts +8 -8
  34. package/dist/block_model.d.ts.map +1 -1
  35. package/dist/block_model.js +11 -11
  36. package/dist/block_model.js.map +1 -1
  37. package/dist/block_state_patch.d.ts +2 -2
  38. package/dist/block_state_util.cjs +1 -1
  39. package/dist/block_state_util.cjs.map +1 -1
  40. package/dist/block_state_util.d.ts +3 -3
  41. package/dist/block_state_util.js +1 -1
  42. package/dist/block_state_util.js.map +1 -1
  43. package/dist/block_storage.cjs +10 -10
  44. package/dist/block_storage.cjs.map +1 -1
  45. package/dist/block_storage.d.ts +2 -2
  46. package/dist/block_storage.d.ts.map +1 -1
  47. package/dist/block_storage.js +10 -10
  48. package/dist/block_storage.js.map +1 -1
  49. package/dist/block_storage_vm.cjs +22 -22
  50. package/dist/block_storage_vm.cjs.map +1 -1
  51. package/dist/block_storage_vm.d.ts +1 -1
  52. package/dist/block_storage_vm.d.ts.map +1 -1
  53. package/dist/block_storage_vm.js +22 -22
  54. package/dist/block_storage_vm.js.map +1 -1
  55. package/dist/builder.cjs +32 -23
  56. package/dist/builder.cjs.map +1 -1
  57. package/dist/builder.d.ts +7 -7
  58. package/dist/builder.d.ts.map +1 -1
  59. package/dist/builder.js +32 -23
  60. package/dist/builder.js.map +1 -1
  61. package/dist/components/PFrameForGraphs.cjs +7 -6
  62. package/dist/components/PFrameForGraphs.cjs.map +1 -1
  63. package/dist/components/PFrameForGraphs.d.ts +4 -4
  64. package/dist/components/PFrameForGraphs.d.ts.map +1 -1
  65. package/dist/components/PFrameForGraphs.js +7 -6
  66. package/dist/components/PFrameForGraphs.js.map +1 -1
  67. package/dist/components/PlAnnotations/filter.d.ts +14 -14
  68. package/dist/components/PlAnnotations/filter.d.ts.map +1 -1
  69. package/dist/components/PlAnnotations/filters_ui.cjs +46 -46
  70. package/dist/components/PlAnnotations/filters_ui.cjs.map +1 -1
  71. package/dist/components/PlAnnotations/filters_ui.d.ts +10 -34
  72. package/dist/components/PlAnnotations/filters_ui.d.ts.map +1 -1
  73. package/dist/components/PlAnnotations/filters_ui.js +46 -46
  74. package/dist/components/PlAnnotations/filters_ui.js.map +1 -1
  75. package/dist/components/PlAnnotations/index.d.ts +2 -2
  76. package/dist/components/PlAnnotations/types.d.ts +2 -2
  77. package/dist/components/PlDataTable.cjs +19 -20
  78. package/dist/components/PlDataTable.cjs.map +1 -1
  79. package/dist/components/PlDataTable.d.ts +27 -27
  80. package/dist/components/PlDataTable.d.ts.map +1 -1
  81. package/dist/components/PlDataTable.js +19 -20
  82. package/dist/components/PlDataTable.js.map +1 -1
  83. package/dist/components/PlMultiSequenceAlignment.cjs +2 -2
  84. package/dist/components/PlMultiSequenceAlignment.cjs.map +1 -1
  85. package/dist/components/PlMultiSequenceAlignment.d.ts +6 -6
  86. package/dist/components/PlMultiSequenceAlignment.d.ts.map +1 -1
  87. package/dist/components/PlMultiSequenceAlignment.js +2 -2
  88. package/dist/components/PlMultiSequenceAlignment.js.map +1 -1
  89. package/dist/components/PlSelectionModel.cjs.map +1 -1
  90. package/dist/components/PlSelectionModel.d.ts +1 -1
  91. package/dist/components/PlSelectionModel.js.map +1 -1
  92. package/dist/components/index.d.ts +5 -5
  93. package/dist/config/actions.cjs +39 -39
  94. package/dist/config/actions.cjs.map +1 -1
  95. package/dist/config/actions.d.ts +9 -9
  96. package/dist/config/actions.d.ts.map +1 -1
  97. package/dist/config/actions.js +39 -39
  98. package/dist/config/actions.js.map +1 -1
  99. package/dist/config/actions_kinds.d.ts +30 -30
  100. package/dist/config/actions_kinds.d.ts.map +1 -1
  101. package/dist/config/index.d.ts +6 -6
  102. package/dist/config/model.d.ts +28 -28
  103. package/dist/config/model_meta.d.ts +1 -1
  104. package/dist/config/type_engine.d.ts +3 -3
  105. package/dist/config/type_util.d.ts +2 -2
  106. package/dist/env_value.cjs +1 -1
  107. package/dist/env_value.cjs.map +1 -1
  108. package/dist/env_value.js +1 -1
  109. package/dist/env_value.js.map +1 -1
  110. package/dist/filters/converter.cjs +36 -32
  111. package/dist/filters/converter.cjs.map +1 -1
  112. package/dist/filters/converter.d.ts +2 -2
  113. package/dist/filters/converter.d.ts.map +1 -1
  114. package/dist/filters/converter.js +36 -32
  115. package/dist/filters/converter.js.map +1 -1
  116. package/dist/filters/index.d.ts +2 -2
  117. package/dist/filters/types.d.ts +33 -33
  118. package/dist/filters/types.d.ts.map +1 -1
  119. package/dist/index.d.ts +24 -24
  120. package/dist/internal.cjs +7 -7
  121. package/dist/internal.cjs.map +1 -1
  122. package/dist/internal.d.ts +4 -4
  123. package/dist/internal.d.ts.map +1 -1
  124. package/dist/internal.js +7 -7
  125. package/dist/internal.js.map +1 -1
  126. package/dist/package.json.cjs +1 -1
  127. package/dist/package.json.js +1 -1
  128. package/dist/pframe.cjs +1 -1
  129. package/dist/pframe.cjs.map +1 -1
  130. package/dist/pframe.d.ts +1 -1
  131. package/dist/pframe.js +1 -1
  132. package/dist/pframe.js.map +1 -1
  133. package/dist/pframe_utils/columns.cjs +23 -15
  134. package/dist/pframe_utils/columns.cjs.map +1 -1
  135. package/dist/pframe_utils/columns.d.ts +3 -3
  136. package/dist/pframe_utils/columns.d.ts.map +1 -1
  137. package/dist/pframe_utils/columns.js +23 -15
  138. package/dist/pframe_utils/columns.js.map +1 -1
  139. package/dist/pframe_utils/index.cjs +25 -25
  140. package/dist/pframe_utils/index.cjs.map +1 -1
  141. package/dist/pframe_utils/index.d.ts +3 -3
  142. package/dist/pframe_utils/index.d.ts.map +1 -1
  143. package/dist/pframe_utils/index.js +25 -25
  144. package/dist/pframe_utils/index.js.map +1 -1
  145. package/dist/platforma.d.ts +7 -7
  146. package/dist/platforma.d.ts.map +1 -1
  147. package/dist/raw_globals.cjs +4 -1
  148. package/dist/raw_globals.cjs.map +1 -1
  149. package/dist/raw_globals.d.ts +2 -2
  150. package/dist/raw_globals.d.ts.map +1 -1
  151. package/dist/raw_globals.js +4 -1
  152. package/dist/raw_globals.js.map +1 -1
  153. package/dist/ref_util.cjs +4 -4
  154. package/dist/ref_util.cjs.map +1 -1
  155. package/dist/ref_util.d.ts +1 -1
  156. package/dist/ref_util.js +4 -4
  157. package/dist/ref_util.js.map +1 -1
  158. package/dist/render/accessor.cjs +24 -24
  159. package/dist/render/accessor.cjs.map +1 -1
  160. package/dist/render/accessor.d.ts +10 -10
  161. package/dist/render/accessor.d.ts.map +1 -1
  162. package/dist/render/accessor.js +24 -24
  163. package/dist/render/accessor.js.map +1 -1
  164. package/dist/render/api.cjs +23 -23
  165. package/dist/render/api.cjs.map +1 -1
  166. package/dist/render/api.d.ts +11 -11
  167. package/dist/render/api.d.ts.map +1 -1
  168. package/dist/render/api.js +23 -23
  169. package/dist/render/api.js.map +1 -1
  170. package/dist/render/future.cjs.map +1 -1
  171. package/dist/render/future.d.ts +1 -1
  172. package/dist/render/future.js.map +1 -1
  173. package/dist/render/index.d.ts +6 -6
  174. package/dist/render/internal.cjs +4 -4
  175. package/dist/render/internal.cjs.map +1 -1
  176. package/dist/render/internal.d.ts +7 -7
  177. package/dist/render/internal.d.ts.map +1 -1
  178. package/dist/render/internal.js +4 -4
  179. package/dist/render/internal.js.map +1 -1
  180. package/dist/render/traversal_ops.d.ts +1 -1
  181. package/dist/render/util/axis_filtering.cjs +48 -44
  182. package/dist/render/util/axis_filtering.cjs.map +1 -1
  183. package/dist/render/util/axis_filtering.d.ts +2 -2
  184. package/dist/render/util/axis_filtering.js +48 -44
  185. package/dist/render/util/axis_filtering.js.map +1 -1
  186. package/dist/render/util/column_collection.cjs +42 -35
  187. package/dist/render/util/column_collection.cjs.map +1 -1
  188. package/dist/render/util/column_collection.d.ts +4 -4
  189. package/dist/render/util/column_collection.d.ts.map +1 -1
  190. package/dist/render/util/column_collection.js +42 -35
  191. package/dist/render/util/column_collection.js.map +1 -1
  192. package/dist/render/util/index.d.ts +4 -4
  193. package/dist/render/util/label.cjs +15 -21
  194. package/dist/render/util/label.cjs.map +1 -1
  195. package/dist/render/util/label.d.ts +2 -2
  196. package/dist/render/util/label.d.ts.map +1 -1
  197. package/dist/render/util/label.js +15 -21
  198. package/dist/render/util/label.js.map +1 -1
  199. package/dist/render/util/pcolumn_data.cjs +56 -54
  200. package/dist/render/util/pcolumn_data.cjs.map +1 -1
  201. package/dist/render/util/pcolumn_data.d.ts +5 -5
  202. package/dist/render/util/pcolumn_data.d.ts.map +1 -1
  203. package/dist/render/util/pcolumn_data.js +56 -54
  204. package/dist/render/util/pcolumn_data.js.map +1 -1
  205. package/dist/render/util/pframe_upgraders.cjs +6 -6
  206. package/dist/render/util/pframe_upgraders.cjs.map +1 -1
  207. package/dist/render/util/pframe_upgraders.d.ts +1 -1
  208. package/dist/render/util/pframe_upgraders.d.ts.map +1 -1
  209. package/dist/render/util/pframe_upgraders.js +6 -6
  210. package/dist/render/util/pframe_upgraders.js.map +1 -1
  211. package/dist/render/util/split_selectors.d.ts +1 -1
  212. package/dist/render/util/split_selectors.d.ts.map +1 -1
  213. package/dist/sdk_info.cjs.map +1 -1
  214. package/dist/sdk_info.js.map +1 -1
  215. package/dist/version.cjs.map +1 -1
  216. package/dist/version.js.map +1 -1
  217. package/package.json +23 -21
  218. package/src/annotations/converter.test.ts +98 -101
  219. package/src/annotations/converter.ts +21 -17
  220. package/src/annotations/index.ts +2 -2
  221. package/src/annotations/types.ts +4 -4
  222. package/src/bconfig/index.ts +5 -5
  223. package/src/bconfig/lambdas.ts +10 -12
  224. package/src/bconfig/normalization.ts +5 -5
  225. package/src/bconfig/types.ts +3 -5
  226. package/src/bconfig/util.ts +3 -3
  227. package/src/bconfig/v3.ts +3 -3
  228. package/src/block_api_v1.ts +7 -3
  229. package/src/block_api_v2.ts +7 -3
  230. package/src/block_api_v3.ts +3 -3
  231. package/src/block_migrations.test.ts +66 -67
  232. package/src/block_migrations.ts +16 -16
  233. package/src/block_model.ts +76 -140
  234. package/src/block_state_patch.ts +2 -2
  235. package/src/block_state_util.ts +4 -4
  236. package/src/block_storage.test.ts +106 -99
  237. package/src/block_storage.ts +22 -25
  238. package/src/block_storage_vm.ts +41 -35
  239. package/src/builder.ts +107 -95
  240. package/src/components/PFrameForGraphs.test.ts +261 -255
  241. package/src/components/PFrameForGraphs.ts +35 -22
  242. package/src/components/PlAnnotations/filter.ts +21 -15
  243. package/src/components/PlAnnotations/filters_ui.test.ts +230 -73
  244. package/src/components/PlAnnotations/filters_ui.ts +138 -105
  245. package/src/components/PlAnnotations/index.ts +2 -2
  246. package/src/components/PlAnnotations/types.ts +2 -2
  247. package/src/components/PlDataTable.ts +177 -164
  248. package/src/components/PlMultiSequenceAlignment.ts +11 -18
  249. package/src/components/PlSelectionModel.ts +1 -1
  250. package/src/components/index.ts +5 -5
  251. package/src/config/actions.ts +64 -59
  252. package/src/config/actions_kinds.ts +38 -34
  253. package/src/config/index.ts +6 -6
  254. package/src/config/model.ts +28 -28
  255. package/src/config/model_meta.ts +1 -1
  256. package/src/config/type_engine.ts +3 -3
  257. package/src/config/type_util.ts +2 -2
  258. package/src/env_value.ts +2 -2
  259. package/src/filters/converter.test.ts +185 -144
  260. package/src/filters/converter.ts +47 -35
  261. package/src/filters/index.ts +2 -2
  262. package/src/filters/types.ts +44 -39
  263. package/src/global.d.ts +1 -1
  264. package/src/index.ts +24 -24
  265. package/src/internal.ts +27 -17
  266. package/src/pframe.ts +3 -3
  267. package/src/pframe_utils/columns.ts +81 -31
  268. package/src/pframe_utils/index.ts +65 -43
  269. package/src/platforma.ts +44 -21
  270. package/src/raw_globals.ts +13 -7
  271. package/src/ref_util.ts +6 -6
  272. package/src/render/accessor.ts +43 -44
  273. package/src/render/api.ts +102 -78
  274. package/src/render/future.ts +2 -2
  275. package/src/render/index.ts +6 -6
  276. package/src/render/internal.ts +11 -12
  277. package/src/render/traversal_ops.ts +1 -1
  278. package/src/render/util/axis_filtering.ts +67 -52
  279. package/src/render/util/column_collection.ts +171 -91
  280. package/src/render/util/index.ts +4 -4
  281. package/src/render/util/label.test.ts +139 -139
  282. package/src/render/util/label.ts +42 -33
  283. package/src/render/util/pcolumn_data.ts +111 -75
  284. package/src/render/util/pframe_upgraders.ts +24 -13
  285. package/src/render/util/split_selectors.ts +6 -1
  286. package/src/sdk_info.ts +1 -1
  287. package/src/typing.test.ts +56 -56
  288. package/src/version.ts +1 -1
@@ -5,38 +5,34 @@ import type {
5
5
  PlRef,
6
6
  BlockCodeKnownFeatureFlags,
7
7
  BlockConfigContainer,
8
- } from '@milaboratories/pl-model-common';
8
+ } from "@milaboratories/pl-model-common";
9
9
  import {
10
10
  getPlatformaInstance,
11
11
  isInUI,
12
12
  createAndRegisterRenderLambda,
13
13
  createRenderLambda,
14
- } from './internal';
15
- import type { DataModel } from './block_migrations';
16
- import type { PlatformaV3 } from './platforma';
17
- import type { InferRenderFunctionReturn, RenderFunction } from './render';
18
- import { RenderCtx } from './render';
19
- import { PlatformaSDKVersion } from './version';
14
+ } from "./internal";
15
+ import type { DataModel } from "./block_migrations";
16
+ import type { PlatformaV3 } from "./platforma";
17
+ import type { InferRenderFunctionReturn, RenderFunction } from "./render";
18
+ import { RenderCtx } from "./render";
19
+ import { PlatformaSDKVersion } from "./version";
20
20
  // Import storage VM integration (side-effect: registers internal callbacks)
21
- import './block_storage_vm';
21
+ import "./block_storage_vm";
22
22
  import type {
23
23
  ConfigRenderLambda,
24
24
  DeriveHref,
25
25
  ConfigRenderLambdaFlags,
26
26
  InferOutputsFromLambdas,
27
- } from './bconfig';
28
- import { downgradeCfgOrLambda, isConfigLambda } from './bconfig';
29
- import type { PlatformaExtended } from './platforma';
27
+ } from "./bconfig";
28
+ import { downgradeCfgOrLambda, isConfigLambda } from "./bconfig";
29
+ import type { PlatformaExtended } from "./platforma";
30
30
 
31
31
  type SectionsExpectedType = readonly BlockSection[];
32
32
 
33
33
  type NoOb = Record<string, never>;
34
34
 
35
- interface BlockModelV3Config<
36
- Args,
37
- OutputsCfg extends Record<string, ConfigRenderLambda>,
38
- Data,
39
- > {
35
+ interface BlockModelV3Config<Args, OutputsCfg extends Record<string, ConfigRenderLambda>, Data> {
40
36
  renderingMode: BlockRenderingMode;
41
37
  dataModel: DataModel<Data>;
42
38
  outputs: OutputsCfg;
@@ -66,18 +62,15 @@ export class BlockModelV3<
66
62
  Args,
67
63
  OutputsCfg extends Record<string, ConfigRenderLambda>,
68
64
  Data extends Record<string, unknown> = Record<string, unknown>,
69
- Href extends `/${string}` = '/',
65
+ Href extends `/${string}` = "/",
70
66
  > {
71
- private constructor(
72
- private readonly config: BlockModelV3Config<Args, OutputsCfg, Data>,
73
- ) { }
74
-
75
- public static readonly INITIAL_BLOCK_FEATURE_FLAGS: BlockCodeKnownFeatureFlags
76
- = {
77
- supportsLazyState: true,
78
- requiresUIAPIVersion: 3,
79
- requiresModelAPIVersion: 2,
80
- };
67
+ private constructor(private readonly config: BlockModelV3Config<Args, OutputsCfg, Data>) {}
68
+
69
+ public static readonly INITIAL_BLOCK_FEATURE_FLAGS: BlockCodeKnownFeatureFlags = {
70
+ supportsLazyState: true,
71
+ requiresUIAPIVersion: 3,
72
+ requiresModelAPIVersion: 2,
73
+ };
81
74
 
82
75
  /**
83
76
  * Creates a new BlockModelV3 builder with the specified data model and options.
@@ -101,7 +94,7 @@ export class BlockModelV3<
101
94
  public static create<Data extends Record<string, unknown>>(
102
95
  options: BlockModelV3Options<Data>,
103
96
  ): BlockModelV3<NoOb, {}, Data> {
104
- const { dataModel, renderingMode = 'Heavy' } = options;
97
+ const { dataModel, renderingMode = "Heavy" } = options;
105
98
 
106
99
  // Register data model callbacks for VM use (initialData and upgrade)
107
100
  dataModel.registerCallbacks();
@@ -111,10 +104,7 @@ export class BlockModelV3<
111
104
  dataModel,
112
105
  outputs: {},
113
106
  // Register default sections callback (returns empty array)
114
- sections: createAndRegisterRenderLambda(
115
- { handle: 'sections', lambda: () => [] },
116
- true,
117
- ),
107
+ sections: createAndRegisterRenderLambda({ handle: "sections", lambda: () => [] }, true),
118
108
  title: undefined,
119
109
  subtitle: undefined,
120
110
  tags: undefined,
@@ -133,13 +123,10 @@ export class BlockModelV3<
133
123
  * workflows outputs and interact with platforma drivers
134
124
  * @param flags additional flags that may alter lambda rendering procedure
135
125
  * */
136
- public output<
137
- const Key extends string,
138
- const RF extends RenderFunction<Args, Data>,
139
- >(
126
+ public output<const Key extends string, const RF extends RenderFunction<Args, Data>>(
140
127
  key: Key,
141
128
  rf: RF,
142
- flags: ConfigRenderLambdaFlags & { withStatus: true }
129
+ flags: ConfigRenderLambdaFlags & { withStatus: true },
143
130
  ): BlockModelV3<
144
131
  Args,
145
132
  OutputsCfg & {
@@ -158,13 +145,10 @@ export class BlockModelV3<
158
145
  * workflows outputs and interact with platforma drivers
159
146
  * @param flags additional flags that may alter lambda rendering procedure
160
147
  * */
161
- public output<
162
- const Key extends string,
163
- const RF extends RenderFunction<Args, Data>,
164
- >(
148
+ public output<const Key extends string, const RF extends RenderFunction<Args, Data>>(
165
149
  key: Key,
166
150
  rf: RF,
167
- flags?: ConfigRenderLambdaFlags
151
+ flags?: ConfigRenderLambdaFlags,
168
152
  ): BlockModelV3<
169
153
  Args,
170
154
  OutputsCfg & {
@@ -192,28 +176,25 @@ export class BlockModelV3<
192
176
  }
193
177
 
194
178
  /** Shortcut for {@link output} with retentive flag set to true. */
195
- public retentiveOutput<
196
- const Key extends string,
197
- const RF extends RenderFunction<Args, Data>,
198
- >(
179
+ public retentiveOutput<const Key extends string, const RF extends RenderFunction<Args, Data>>(
199
180
  key: Key,
200
181
  rf: RF,
201
182
  ): BlockModelV3<
202
- Args,
203
- OutputsCfg & {
204
- [K in Key]: ConfigRenderLambda<InferRenderFunctionReturn<RF>>;
205
- },
206
- Data,
207
- Href
208
- > {
183
+ Args,
184
+ OutputsCfg & {
185
+ [K in Key]: ConfigRenderLambda<InferRenderFunctionReturn<RF>>;
186
+ },
187
+ Data,
188
+ Href
189
+ > {
209
190
  return this.output(key, rf, { retentive: true });
210
191
  }
211
192
 
212
193
  /** Shortcut for {@link output} with withStatus flag set to true. */
213
- public outputWithStatus<
214
- const Key extends string,
215
- const RF extends RenderFunction<Args, Data>,
216
- >(key: Key, rf: RF) {
194
+ public outputWithStatus<const Key extends string, const RF extends RenderFunction<Args, Data>>(
195
+ key: Key,
196
+ rf: RF,
197
+ ) {
217
198
  return this.output(key, rf, { withStatus: true });
218
199
  }
219
200
 
@@ -230,12 +211,10 @@ export class BlockModelV3<
230
211
  * return { numbers: data.numbers };
231
212
  * })
232
213
  */
233
- public args<Args>(
234
- lambda: (data: Data) => Args,
235
- ): BlockModelV3<Args, OutputsCfg, Data, Href> {
214
+ public args<Args>(lambda: (data: Data) => Args): BlockModelV3<Args, OutputsCfg, Data, Href> {
236
215
  return new BlockModelV3<Args, OutputsCfg, Data, Href>({
237
216
  ...this.config,
238
- args: createAndRegisterRenderLambda<Args>({ handle: 'args', lambda }),
217
+ args: createAndRegisterRenderLambda<Args>({ handle: "args", lambda }),
239
218
  });
240
219
  }
241
220
 
@@ -259,13 +238,11 @@ export class BlockModelV3<
259
238
  * return { numbers: data.numbers };
260
239
  * })
261
240
  */
262
- public prerunArgs(
263
- fn: (data: Data) => unknown,
264
- ): BlockModelV3<Args, OutputsCfg, Data, Href> {
241
+ public prerunArgs(fn: (data: Data) => unknown): BlockModelV3<Args, OutputsCfg, Data, Href> {
265
242
  return new BlockModelV3<Args, OutputsCfg, Data, Href>({
266
243
  ...this.config,
267
244
  prerunArgs: createAndRegisterRenderLambda({
268
- handle: 'prerunArgs',
245
+ handle: "prerunArgs",
269
246
  lambda: fn,
270
247
  }),
271
248
  });
@@ -276,26 +253,22 @@ export class BlockModelV3<
276
253
  const Ret extends SectionsExpectedType,
277
254
  const RF extends RenderFunction<Args, Data, Ret>,
278
255
  >(rf: RF): BlockModelV3<Args, OutputsCfg, Data, DeriveHref<ReturnType<RF>>> {
279
- return new BlockModelV3<Args, OutputsCfg, Data, DeriveHref<ReturnType<RF>>>(
280
- {
281
- ...this.config,
282
- // Replace the default sections callback with the user-provided one
283
- sections: createAndRegisterRenderLambda(
284
- { handle: 'sections', lambda: () => rf(new RenderCtx()) },
285
- true,
286
- ),
287
- },
288
- );
256
+ return new BlockModelV3<Args, OutputsCfg, Data, DeriveHref<ReturnType<RF>>>({
257
+ ...this.config,
258
+ // Replace the default sections callback with the user-provided one
259
+ sections: createAndRegisterRenderLambda(
260
+ { handle: "sections", lambda: () => rf(new RenderCtx()) },
261
+ true,
262
+ ),
263
+ });
289
264
  }
290
265
 
291
266
  /** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */
292
- public title(
293
- rf: RenderFunction<Args, Data, string>,
294
- ): BlockModelV3<Args, OutputsCfg, Data, Href> {
267
+ public title(rf: RenderFunction<Args, Data, string>): BlockModelV3<Args, OutputsCfg, Data, Href> {
295
268
  return new BlockModelV3<Args, OutputsCfg, Data, Href>({
296
269
  ...this.config,
297
270
  title: createAndRegisterRenderLambda({
298
- handle: 'title',
271
+ handle: "title",
299
272
  lambda: () => rf(new RenderCtx()),
300
273
  }),
301
274
  });
@@ -307,7 +280,7 @@ export class BlockModelV3<
307
280
  return new BlockModelV3<Args, OutputsCfg, Data, Href>({
308
281
  ...this.config,
309
282
  subtitle: createAndRegisterRenderLambda({
310
- handle: 'subtitle',
283
+ handle: "subtitle",
311
284
  lambda: () => rf(new RenderCtx()),
312
285
  }),
313
286
  });
@@ -319,7 +292,7 @@ export class BlockModelV3<
319
292
  return new BlockModelV3<Args, OutputsCfg, Data, Href>({
320
293
  ...this.config,
321
294
  tags: createAndRegisterRenderLambda({
322
- handle: 'tags',
295
+ handle: "tags",
323
296
  lambda: () => rf(new RenderCtx()),
324
297
  }),
325
298
  });
@@ -339,13 +312,11 @@ export class BlockModelV3<
339
312
  * Defines how to derive list of upstream references this block is meant to enrich with its exports from block args.
340
313
  * Influences dependency graph construction.
341
314
  */
342
- public enriches(
343
- lambda: (args: Args) => PlRef[],
344
- ): BlockModelV3<Args, OutputsCfg, Data, Href> {
315
+ public enriches(lambda: (args: Args) => PlRef[]): BlockModelV3<Args, OutputsCfg, Data, Href> {
345
316
  return new BlockModelV3<Args, OutputsCfg, Data, Href>({
346
317
  ...this.config,
347
318
  enrichmentTargets: createAndRegisterRenderLambda({
348
- handle: 'enrichmentTargets',
319
+ handle: "enrichmentTargets",
349
320
  lambda: lambda,
350
321
  }),
351
322
  });
@@ -365,8 +336,7 @@ export class BlockModelV3<
365
336
  public _done(): PlatformaExtended<
366
337
  PlatformaV3<Args, InferOutputsFromLambdas<OutputsCfg>, Data, Href>
367
338
  > {
368
- if (this.config.args === undefined)
369
- throw new Error('Args rendering function not set.');
339
+ if (this.config.args === undefined) throw new Error("Args rendering function not set.");
370
340
 
371
341
  const apiVersion = 3;
372
342
 
@@ -381,7 +351,7 @@ export class BlockModelV3<
381
351
  args: this.config.args,
382
352
  prerunArgs: this.config.prerunArgs,
383
353
  // Reference to __pl_data_initial callback registered by DataModel
384
- initialData: createRenderLambda({ handle: '__pl_data_initial' }),
354
+ initialData: createRenderLambda({ handle: "__pl_data_initial" }),
385
355
  sections: this.config.sections,
386
356
  title: this.config.title,
387
357
  outputs: this.config.outputs,
@@ -436,18 +406,11 @@ export class BlockModelV3<
436
406
 
437
407
  export type Expect<T extends true> = T;
438
408
 
439
- export type Equal<X, Y> = (<T>() => T extends X ? 1 : 2) extends <
440
- T,
441
- >() => T extends Y ? 1 : 2
442
- ? true
443
- : false;
409
+ export type Equal<X, Y> =
410
+ (<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y ? 1 : 2 ? true : false;
444
411
 
445
412
  export type Merge<A, B> = {
446
- [K in keyof A | keyof B]: K extends keyof B
447
- ? B[K]
448
- : K extends keyof A
449
- ? A[K]
450
- : never;
413
+ [K in keyof A | keyof B]: K extends keyof B ? B[K] : K extends keyof A ? A[K] : never;
451
414
  };
452
415
 
453
416
  // Helper types for testing
@@ -461,21 +424,14 @@ type _TestOutputs = {
461
424
  // Test: Merge type works correctly
462
425
  type _MergeTest1 = Expect<Equal<Merge<{ a: 1 }, { b: 2 }>, { a: 1; b: 2 }>>;
463
426
  type _MergeTest2 = Expect<Equal<Merge<{ a: 1 }, { a: 2 }>, { a: 2 }>>;
464
- type _MergeTest3 = Expect<
465
- Equal<Merge<{ a: 1; b: 1 }, { b: 2; c: 3 }>, { a: 1; b: 2; c: 3 }>
466
- >;
427
+ type _MergeTest3 = Expect<Equal<Merge<{ a: 1; b: 1 }, { b: 2; c: 3 }>, { a: 1; b: 2; c: 3 }>>;
467
428
 
468
429
  // Test: create() returns a BlockModelV3 instance
469
430
  // Note: Due to function overloads, ReturnType uses the last overload signature.
470
431
  // We verify the structure is correct using a simpler assignability test.
471
432
  type _CreateResult = ReturnType<typeof BlockModelV3.create>;
472
- type _CreateIsBlockModelV3 = _CreateResult extends BlockModelV3<
473
- infer _A,
474
- infer _O,
475
- infer _S
476
- >
477
- ? true
478
- : false;
433
+ type _CreateIsBlockModelV3 =
434
+ _CreateResult extends BlockModelV3<infer _A, infer _O, infer _S> ? true : false;
479
435
  type _CreateTest = Expect<_CreateIsBlockModelV3>;
480
436
 
481
437
  // Test: BlockModelV3Config interface structure
@@ -499,46 +455,29 @@ type _ConfigTest = Expect<
499
455
  >;
500
456
 
501
457
  // Test: Default Href is '/'
502
- type _HrefDefaultTest = BlockModelV3<
503
- _TestArgs,
504
- {},
505
- _TestData
506
- > extends BlockModelV3<_TestArgs, {}, _TestData, '/'>
507
- ? true
508
- : false;
458
+ type _HrefDefaultTest =
459
+ BlockModelV3<_TestArgs, {}, _TestData> extends BlockModelV3<_TestArgs, {}, _TestData, "/">
460
+ ? true
461
+ : false;
509
462
  type _VerifyHrefDefault = Expect<_HrefDefaultTest>;
510
463
 
511
464
  // Test: Custom Href can be specified
512
- type _CustomHref = '/settings' | '/main';
465
+ type _CustomHref = "/settings" | "/main";
513
466
  type _HrefCustomBuilder = BlockModelV3<_TestArgs, {}, _TestData, _CustomHref>;
514
- type _HrefCustomTest = _HrefCustomBuilder extends BlockModelV3<
515
- _TestArgs,
516
- {},
517
- _TestData,
518
- _CustomHref
519
- >
520
- ? true
521
- : false;
467
+ type _HrefCustomTest =
468
+ _HrefCustomBuilder extends BlockModelV3<_TestArgs, {}, _TestData, _CustomHref> ? true : false;
522
469
  type _VerifyHrefCustom = Expect<_HrefCustomTest>;
523
470
 
524
471
  // Test: Output type accumulation with & intersection
525
472
  type _OutputsAccumulation = { a: ConfigRenderLambda<string> } & {
526
473
  b: ConfigRenderLambda<number>;
527
474
  };
528
- type _VerifyOutputsHaveKeys = Expect<
529
- Equal<keyof _OutputsAccumulation, 'a' | 'b'>
530
- >;
475
+ type _VerifyOutputsHaveKeys = Expect<Equal<keyof _OutputsAccumulation, "a" | "b">>;
531
476
 
532
477
  // Test: Builder with all type parameters specified compiles
533
- type _FullBuilder = BlockModelV3<_TestArgs, _TestOutputs, _TestData, '/main'>;
534
- type _FullBuilderTest = _FullBuilder extends BlockModelV3<
535
- _TestArgs,
536
- _TestOutputs,
537
- _TestData,
538
- '/main'
539
- >
540
- ? true
541
- : false;
478
+ type _FullBuilder = BlockModelV3<_TestArgs, _TestOutputs, _TestData, "/main">;
479
+ type _FullBuilderTest =
480
+ _FullBuilder extends BlockModelV3<_TestArgs, _TestOutputs, _TestData, "/main"> ? true : false;
542
481
  type _VerifyFullBuilder = Expect<_FullBuilderTest>;
543
482
 
544
483
  // Test: InferOutputsFromLambdas maps outputs correctly
@@ -546,8 +485,5 @@ type _InferOutputsTest = InferOutputsFromLambdas<{
546
485
  myOutput: ConfigRenderLambda<number>;
547
486
  }>;
548
487
  type _VerifyInferOutputs = Expect<
549
- Equal<
550
- _InferOutputsTest,
551
- { myOutput: OutputWithStatus<number> & { __unwrap: true } }
552
- >
488
+ Equal<_InferOutputsTest, { myOutput: OutputWithStatus<number> & { __unwrap: true } }>
553
489
  >;
@@ -1,5 +1,5 @@
1
- import type { Unionize } from './unionize';
2
- import type { BlockOutputsBase, BlockState } from '@milaboratories/pl-model-common';
1
+ import type { Unionize } from "./unionize";
2
+ import type { BlockOutputsBase, BlockState } from "@milaboratories/pl-model-common";
3
3
 
4
4
  /** Patch for the BlockState, pushed by onStateUpdates method in SDK. */
5
5
  export type BlockStatePatch<
@@ -1,12 +1,12 @@
1
- import type { BlockOutputsBase, OutputWithStatus } from '@milaboratories/pl-model-common';
2
- import type { ErrorLike } from '@milaboratories/pl-error-like';
1
+ import type { BlockOutputsBase, OutputWithStatus } from "@milaboratories/pl-model-common";
2
+ import type { ErrorLike } from "@milaboratories/pl-error-like";
3
3
 
4
4
  export class OutputError extends Error {
5
5
  constructor(
6
6
  public readonly errors: ErrorLike[],
7
7
  public readonly moreErrors: boolean,
8
8
  ) {
9
- super(`${errors.length}${moreErrors ? '+' : ''} errors, first error: ` + errors[0].message);
9
+ super(`${errors.length}${moreErrors ? "+" : ""} errors, first error: ` + errors[0].message);
10
10
  }
11
11
  }
12
12
 
@@ -15,7 +15,7 @@ export function readOutput<T>(outputValue: OutputWithStatus<T>): T {
15
15
  return outputValue.value;
16
16
  }
17
17
 
18
- type ExtractValueType<V extends OutputWithStatus<unknown>> = Extract<V, { ok: true }>['value'];
18
+ type ExtractValueType<V extends OutputWithStatus<unknown>> = Extract<V, { ok: true }>["value"];
19
19
  type SimpleOutputs<Outputs extends BlockOutputsBase> = {
20
20
  [Key in keyof Outputs]: ExtractValueType<Outputs[Key]>;
21
21
  };