@platforma-open/milaboratories.repertoire-mutation-heatmap.block 1.3.0 → 1.4.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.
- package/block-pack/main.plj.gz +0 -0
- package/block-pack/manifest.json +1 -1
- package/block-pack/model.json +1 -1
- package/block-pack/published.json +1 -1
- package/block-pack/ui.tgz +0 -0
- package/dist/AGENTS.d.ts +4856 -1425
- package/dist/AGENTS.d.ts.map +1 -1
- package/dist/index.d.ts +4856 -1425
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +664 -313
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { r as __toESM, t as __commonJSMin } from "./rolldown-runtime-DC62tzP2.js";
|
|
2
2
|
//#region ../model/dist/chart-state.js
|
|
3
3
|
/**
|
|
4
|
+
* Opacity range, reversed for the error column the page binds: the smallest error draws solid and
|
|
5
|
+
* the largest faint. A column bound to opacity by hand fades the other way round. Dragging the
|
|
6
|
+
* range slider re-sorts the two ends, which undoes the reversal.
|
|
7
|
+
*/
|
|
8
|
+
const ERROR_OPACITY_RANGE = {
|
|
9
|
+
min: 1,
|
|
10
|
+
max: .15
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
4
13
|
* Default state for a mutation-landscape chart. Used by `init` for the placeholder and by the UI
|
|
5
14
|
* for each score a run produces, so the two look alike.
|
|
6
15
|
*
|
|
@@ -14,7 +23,8 @@ function makeLandscapeChartState(title, currentTab) {
|
|
|
14
23
|
layersSettings: { heatmap: {
|
|
15
24
|
normalizationDirection: null,
|
|
16
25
|
transform: null,
|
|
17
|
-
NAValueAs: null
|
|
26
|
+
NAValueAs: null,
|
|
27
|
+
opacityRange: { ...ERROR_OPACITY_RANGE }
|
|
18
28
|
} },
|
|
19
29
|
axesSettings: {
|
|
20
30
|
axisX: {
|
|
@@ -180,6 +190,22 @@ function withYAnnotationTitleAtBottom(state) {
|
|
|
180
190
|
}
|
|
181
191
|
};
|
|
182
192
|
}
|
|
193
|
+
/**
|
|
194
|
+
* Seeds the reversed error opacity on a saved chart. Layer settings are seeded once, when a chart
|
|
195
|
+
* is created, so an older chart would otherwise fade its most certain cells.
|
|
196
|
+
*/
|
|
197
|
+
function withErrorOpacityRange(state) {
|
|
198
|
+
return {
|
|
199
|
+
...state,
|
|
200
|
+
layersSettings: {
|
|
201
|
+
...state.layersSettings,
|
|
202
|
+
heatmap: {
|
|
203
|
+
...state.layersSettings?.heatmap,
|
|
204
|
+
opacityRange: { ...ERROR_OPACITY_RANGE }
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
}
|
|
183
209
|
function mapChartStates(data, rewrite) {
|
|
184
210
|
return {
|
|
185
211
|
compositionHeatmapState: rewrite(data.compositionHeatmapState),
|
|
@@ -188,14 +214,14 @@ function mapChartStates(data, rewrite) {
|
|
|
188
214
|
};
|
|
189
215
|
}
|
|
190
216
|
//#endregion
|
|
191
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
217
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/plugin_handle.js
|
|
192
218
|
const PLUGIN_OUTPUT_PREFIX = "plugin-output#";
|
|
193
219
|
/** Construct the output key for a plugin output in the block outputs map. */
|
|
194
220
|
function pluginOutputKey(handle, outputKey) {
|
|
195
221
|
return `${PLUGIN_OUTPUT_PREFIX}${handle}#${outputKey}`;
|
|
196
222
|
}
|
|
197
223
|
//#endregion
|
|
198
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
224
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/block_storage.js
|
|
199
225
|
/**
|
|
200
226
|
* Discriminator key for BlockStorage format detection.
|
|
201
227
|
* This unique hash-based key identifies data as BlockStorage vs legacy formats.
|
|
@@ -4007,20 +4033,6 @@ const coerce = {
|
|
|
4007
4033
|
coerce: true
|
|
4008
4034
|
}))
|
|
4009
4035
|
};
|
|
4010
|
-
objectType({
|
|
4011
|
-
type: literalType("plain"),
|
|
4012
|
-
content: stringType()
|
|
4013
|
-
});
|
|
4014
|
-
//#endregion
|
|
4015
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.53.0/node_modules/@milaboratories/pl-model-common/dist/bmodel/block_kind_ref.js
|
|
4016
|
-
/**
|
|
4017
|
-
* Compose a {@link BlockKindReference} from a kind's `name`/`version`.
|
|
4018
|
-
*
|
|
4019
|
-
* The single place that decides how the reference is assembled. If global
|
|
4020
|
-
* uniqueness later requires the name segment to be org-qualified, this is the
|
|
4021
|
-
* one line that changes.
|
|
4022
|
-
*/
|
|
4023
|
-
const formatKindRef = (k) => `${k.name}@${k.version}`;
|
|
4024
4036
|
objectType({
|
|
4025
4037
|
/** Included left border. */
|
|
4026
4038
|
from: numberType().min(0),
|
|
@@ -4028,7 +4040,7 @@ objectType({
|
|
|
4028
4040
|
to: numberType().min(1)
|
|
4029
4041
|
});
|
|
4030
4042
|
//#endregion
|
|
4031
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
4043
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/util.js
|
|
4032
4044
|
function assertNever(x) {
|
|
4033
4045
|
throw new Error("Unexpected object: " + x);
|
|
4034
4046
|
}
|
|
@@ -4040,7 +4052,7 @@ function uniqueBy(array, makeId) {
|
|
|
4040
4052
|
return [...new Map(array.map((e) => [makeId(e), e])).values()];
|
|
4041
4053
|
}
|
|
4042
4054
|
//#endregion
|
|
4043
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
4055
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/data_info.js
|
|
4044
4056
|
/**
|
|
4045
4057
|
* Type guard function that checks if the given value is a valid DataInfo.
|
|
4046
4058
|
*
|
|
@@ -4229,7 +4241,7 @@ function entriesToDataInfo(dataInfoEntries) {
|
|
|
4229
4241
|
}
|
|
4230
4242
|
}
|
|
4231
4243
|
//#endregion
|
|
4232
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
4244
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/errors.js
|
|
4233
4245
|
var ServiceError = class extends Error {
|
|
4234
4246
|
name = "ServiceError";
|
|
4235
4247
|
};
|
|
@@ -4253,7 +4265,7 @@ function ensureError(value) {
|
|
|
4253
4265
|
return new Error(stringifyValue(value));
|
|
4254
4266
|
}
|
|
4255
4267
|
//#endregion
|
|
4256
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
4268
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/json.js
|
|
4257
4269
|
var import_canonicalize = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4258
4270
|
module.exports = function serialize(object) {
|
|
4259
4271
|
if (typeof object === "number" && isNaN(object)) throw new Error("NaN is not allowed");
|
|
@@ -4286,7 +4298,7 @@ function parseJsonSafely(value, fallback) {
|
|
|
4286
4298
|
}
|
|
4287
4299
|
}
|
|
4288
4300
|
//#endregion
|
|
4289
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
4301
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js
|
|
4290
4302
|
function readMetadata(metadata, key) {
|
|
4291
4303
|
return metadata?.[key];
|
|
4292
4304
|
}
|
|
@@ -4614,7 +4626,7 @@ function matchAxisId(query, target) {
|
|
|
4614
4626
|
return query.name === target.name && matchDomain$1(query.domain, target.domain) && matchDomain$1(query.contextDomain, target.contextDomain);
|
|
4615
4627
|
}
|
|
4616
4628
|
//#endregion
|
|
4617
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
4629
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/query/utils.js
|
|
4618
4630
|
const BOOLEAN_TYPES = /* @__PURE__ */ new Set([
|
|
4619
4631
|
"numericComparison",
|
|
4620
4632
|
"stringEquals",
|
|
@@ -4719,7 +4731,7 @@ function collectSpecQueryColumns(query) {
|
|
|
4719
4731
|
return result;
|
|
4720
4732
|
}
|
|
4721
4733
|
//#endregion
|
|
4722
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
4734
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/table_calculate.js
|
|
4723
4735
|
function mapPTableDef(def, cb) {
|
|
4724
4736
|
return {
|
|
4725
4737
|
...def,
|
|
@@ -4762,7 +4774,7 @@ function mapJoinEntry(entry, cb) {
|
|
|
4762
4774
|
}
|
|
4763
4775
|
}
|
|
4764
4776
|
//#endregion
|
|
4765
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
4777
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/table_common.js
|
|
4766
4778
|
function getPTableColumnId(spec) {
|
|
4767
4779
|
switch (spec.type) {
|
|
4768
4780
|
case "axis": return {
|
|
@@ -4776,7 +4788,7 @@ function getPTableColumnId(spec) {
|
|
|
4776
4788
|
}
|
|
4777
4789
|
}
|
|
4778
4790
|
//#endregion
|
|
4779
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
4791
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/filtered_column.js
|
|
4780
4792
|
function stringifyColumnFilteredId(key) {
|
|
4781
4793
|
return canonicalizeJson(createColumnFilteredKey(key));
|
|
4782
4794
|
}
|
|
@@ -4809,7 +4821,7 @@ function applyAxisFilters(spec, axisFilters) {
|
|
|
4809
4821
|
};
|
|
4810
4822
|
}
|
|
4811
4823
|
//#endregion
|
|
4812
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
4824
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/pool/spec.js
|
|
4813
4825
|
function isPObjectId(value) {
|
|
4814
4826
|
if (typeof value !== "string") return false;
|
|
4815
4827
|
return isPObjectKey(parseJsonSafely(value));
|
|
@@ -4896,7 +4908,7 @@ function extractAllColumns(entry) {
|
|
|
4896
4908
|
return [...columns.values()];
|
|
4897
4909
|
}
|
|
4898
4910
|
//#endregion
|
|
4899
|
-
//#region ../node_modules/.pnpm/@milaboratories+helpers@1.14.
|
|
4911
|
+
//#region ../node_modules/.pnpm/@milaboratories+helpers@1.14.6/node_modules/@milaboratories/helpers/dist/utils.js
|
|
4900
4912
|
function isNil$1(v) {
|
|
4901
4913
|
return v === null || v === void 0;
|
|
4902
4914
|
}
|
|
@@ -4929,13 +4941,13 @@ function isPlainObject$1(value) {
|
|
|
4929
4941
|
return prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null;
|
|
4930
4942
|
}
|
|
4931
4943
|
//#endregion
|
|
4932
|
-
//#region ../node_modules/.pnpm/@milaboratories+helpers@1.14.
|
|
4944
|
+
//#region ../node_modules/.pnpm/@milaboratories+helpers@1.14.6/node_modules/@milaboratories/helpers/dist/error.js
|
|
4933
4945
|
function throwError(v) {
|
|
4934
4946
|
if (typeof v === "string") throw new Error(v);
|
|
4935
4947
|
else throw v;
|
|
4936
4948
|
}
|
|
4937
4949
|
//#endregion
|
|
4938
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
4950
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/discovered_column.js
|
|
4939
4951
|
function isColumnDiscoveredKey(obj) {
|
|
4940
4952
|
return typeof obj === "object" && obj !== null && "__isDiscovered" in obj;
|
|
4941
4953
|
}
|
|
@@ -5215,7 +5227,12 @@ function isString(value) {
|
|
|
5215
5227
|
return typeof value === "string";
|
|
5216
5228
|
}
|
|
5217
5229
|
//#endregion
|
|
5218
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
5230
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/column_value.js
|
|
5231
|
+
function isColumnValueKey(obj) {
|
|
5232
|
+
return typeof obj === "object" && obj !== null && "__isColumnValue" in obj && obj.__isColumnValue === true && "column" in obj && isColumnUniversalId(obj.column) && "value" in obj && isString(obj.value);
|
|
5233
|
+
}
|
|
5234
|
+
//#endregion
|
|
5235
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/ids.js
|
|
5219
5236
|
/**
|
|
5220
5237
|
* Canonically serializes a column key to a branded string id. Accepts both
|
|
5221
5238
|
* the new {@link ColumnUniversalKey} and the deprecated {@link UniversalPColumnId}
|
|
@@ -5235,6 +5252,10 @@ function parseColumnIdSafely(str, fallback = void 0) {
|
|
|
5235
5252
|
function isColumnUniversalKey(value) {
|
|
5236
5253
|
return isPObjectKey(value) || isColumnFilteredKey(value) || isColumnDiscoveredKey(value) || isColumnOverriddenKey(value);
|
|
5237
5254
|
}
|
|
5255
|
+
function isColumnUniversalId(value) {
|
|
5256
|
+
const key = isString(value) ? parseJsonSafely(value, false) : false;
|
|
5257
|
+
return key === false ? false : isColumnUniversalKey(key);
|
|
5258
|
+
}
|
|
5238
5259
|
/**
|
|
5239
5260
|
* Take a value out of however many `JSON.stringify` passes wrapped it, or `undefined`
|
|
5240
5261
|
* when `s` is not JSON at all.
|
|
@@ -5274,7 +5295,8 @@ function peelJsonLayers(s) {
|
|
|
5274
5295
|
}
|
|
5275
5296
|
}
|
|
5276
5297
|
/**
|
|
5277
|
-
* Rewrite every block id buried inside a column id
|
|
5298
|
+
* Rewrite every block id buried inside a column id, or inside the column of a column value
|
|
5299
|
+
* id — a picked value names its producer through that column's leaf.
|
|
5278
5300
|
*
|
|
5279
5301
|
* A {@link GlobalPObjectKey} leaf names its upstream by block id, and the wrapper key forms
|
|
5280
5302
|
* nest by *string* id rather than by object — so a block id can sit under several layers of
|
|
@@ -5304,17 +5326,43 @@ function remapColumnIdBlockIds(id, remapBlockId) {
|
|
|
5304
5326
|
*
|
|
5305
5327
|
* Escape padding is peeled and put back, so an id that reached params through an extra
|
|
5306
5328
|
* `JSON.stringify` is rewritten in place and comes back wrapped as it was found. A string
|
|
5307
|
-
* that
|
|
5329
|
+
* that peels to neither a column key nor a column value key is left alone: params hold
|
|
5330
|
+
* ordinary strings too.
|
|
5308
5331
|
*/
|
|
5309
5332
|
function remapIdString(id, remapBlockId) {
|
|
5310
5333
|
const peeled = peelJsonLayers(id);
|
|
5311
|
-
if (peeled === void 0
|
|
5312
|
-
|
|
5313
|
-
if (
|
|
5314
|
-
|
|
5334
|
+
if (peeled === void 0) return void 0;
|
|
5335
|
+
let rebuilt;
|
|
5336
|
+
if (isColumnValueKey(peeled.value)) {
|
|
5337
|
+
const remappedKey = remapValueKey(peeled.value, remapBlockId);
|
|
5338
|
+
if (remappedKey === void 0) return void 0;
|
|
5339
|
+
rebuilt = canonicalizeJson(remappedKey);
|
|
5340
|
+
} else if (isColumnUniversalKey(peeled.value)) {
|
|
5341
|
+
const remappedKey = remapKey(peeled.value, remapBlockId);
|
|
5342
|
+
if (remappedKey === void 0) return void 0;
|
|
5343
|
+
rebuilt = stringifyColumnId(remappedKey);
|
|
5344
|
+
} else return;
|
|
5315
5345
|
for (let layer = 0; layer < peeled.layers; layer++) rebuilt = JSON.stringify(rebuilt);
|
|
5316
5346
|
return rebuilt;
|
|
5317
5347
|
}
|
|
5348
|
+
/**
|
|
5349
|
+
* {@link remapIdString} over a column id. Remapping keeps an id's shape, so a column id comes
|
|
5350
|
+
* back a column id.
|
|
5351
|
+
*/
|
|
5352
|
+
function remapColumnIdString(id, remapBlockId) {
|
|
5353
|
+
return remapIdString(id, remapBlockId);
|
|
5354
|
+
}
|
|
5355
|
+
/**
|
|
5356
|
+
* The value-id half of {@link remapIdString}. `undefined` means "nothing to change". Only the
|
|
5357
|
+
* column carries block ids; the value is cell data and stays as it is.
|
|
5358
|
+
*/
|
|
5359
|
+
function remapValueKey(key, remapBlockId) {
|
|
5360
|
+
const column = remapColumnIdString(key.column, remapBlockId);
|
|
5361
|
+
return column === void 0 ? void 0 : {
|
|
5362
|
+
...key,
|
|
5363
|
+
column
|
|
5364
|
+
};
|
|
5365
|
+
}
|
|
5318
5366
|
/** The key half of {@link remapColumnIdBlockIds}. `undefined` means "nothing to change". */
|
|
5319
5367
|
function remapKey(key, remapBlockId) {
|
|
5320
5368
|
if (isGlobalPObjectKey(key)) {
|
|
@@ -5326,7 +5374,7 @@ function remapKey(key, remapBlockId) {
|
|
|
5326
5374
|
}
|
|
5327
5375
|
if (isLocalPObjectKey(key)) return void 0;
|
|
5328
5376
|
if (isColumnFilteredKey(key)) {
|
|
5329
|
-
const source =
|
|
5377
|
+
const source = remapColumnIdString(key.source, remapBlockId);
|
|
5330
5378
|
return source === void 0 ? void 0 : {
|
|
5331
5379
|
...key,
|
|
5332
5380
|
source
|
|
@@ -5348,10 +5396,10 @@ function remapKey(key, remapBlockId) {
|
|
|
5348
5396
|
* id is the map key, not the value.
|
|
5349
5397
|
*/
|
|
5350
5398
|
function remapDiscoveredKey(key, remapBlockId) {
|
|
5351
|
-
const column =
|
|
5399
|
+
const column = remapColumnIdString(key.column, remapBlockId);
|
|
5352
5400
|
let pathChanged = false;
|
|
5353
5401
|
const path = key.path?.map((item) => {
|
|
5354
|
-
const itemColumn =
|
|
5402
|
+
const itemColumn = remapColumnIdString(item.column, remapBlockId);
|
|
5355
5403
|
if (itemColumn === void 0) return item;
|
|
5356
5404
|
pathChanged = true;
|
|
5357
5405
|
return {
|
|
@@ -5389,7 +5437,7 @@ function extractPObjectId(id) {
|
|
|
5389
5437
|
throw new Error(`extractPObjectId: unrecognized column id structure: ${JSON.stringify(id)}`);
|
|
5390
5438
|
}
|
|
5391
5439
|
//#endregion
|
|
5392
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
5440
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/overridden.js
|
|
5393
5441
|
function isColumnOverriddenKey(obj) {
|
|
5394
5442
|
return typeof obj === "object" && obj !== null && "__isOverridden" in obj;
|
|
5395
5443
|
}
|
|
@@ -5511,7 +5559,7 @@ function mergeRecord(a, b) {
|
|
|
5511
5559
|
};
|
|
5512
5560
|
}
|
|
5513
5561
|
//#endregion
|
|
5514
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
5562
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/anchored.js
|
|
5515
5563
|
function axisKey(axis) {
|
|
5516
5564
|
return (0, import_canonicalize.default)(getAxisId(axis));
|
|
5517
5565
|
}
|
|
@@ -5757,7 +5805,7 @@ function isAnchorAxisRef(value) {
|
|
|
5757
5805
|
return typeof value === "object" && "anchor" in value;
|
|
5758
5806
|
}
|
|
5759
5807
|
//#endregion
|
|
5760
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
5808
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/selectors.js
|
|
5761
5809
|
/**
|
|
5762
5810
|
* Determines if an axis ID matches an axis selector.
|
|
5763
5811
|
*
|
|
@@ -5883,7 +5931,7 @@ function multiColumnSelectorsToPredicate(selectors) {
|
|
|
5883
5931
|
return (spec) => isPColumnSpec(spec) && arr.some((sel) => matchMultiColumnSelector(spec, sel));
|
|
5884
5932
|
}
|
|
5885
5933
|
//#endregion
|
|
5886
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
5934
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/native_id.js
|
|
5887
5935
|
function deriveNativeId(spec) {
|
|
5888
5936
|
const result = {
|
|
5889
5937
|
kind: spec.kind,
|
|
@@ -5895,7 +5943,7 @@ function deriveNativeId(spec) {
|
|
|
5895
5943
|
return (0, import_canonicalize.default)(result);
|
|
5896
5944
|
}
|
|
5897
5945
|
//#endregion
|
|
5898
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
5946
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/linker_columns.js
|
|
5899
5947
|
var LinkerMap = class LinkerMap {
|
|
5900
5948
|
/** Graph of linkers connected by axes (single or grouped by parents) */
|
|
5901
5949
|
data;
|
|
@@ -6072,7 +6120,70 @@ var LinkerMap = class LinkerMap {
|
|
|
6072
6120
|
}
|
|
6073
6121
|
};
|
|
6074
6122
|
//#endregion
|
|
6075
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
6123
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/resource_types.js
|
|
6124
|
+
/** Well-known resource type names used across the platform. */
|
|
6125
|
+
const ResourceTypeName = {
|
|
6126
|
+
StreamManager: "StreamManager",
|
|
6127
|
+
StdMap: "StdMap",
|
|
6128
|
+
StdMapSlash: "std/map",
|
|
6129
|
+
EphStdMap: "EphStdMap",
|
|
6130
|
+
PFrame: "PFrame",
|
|
6131
|
+
ParquetChunk: "ParquetChunk",
|
|
6132
|
+
BContext: "BContext",
|
|
6133
|
+
BlockPackCustom: "BlockPackCustom",
|
|
6134
|
+
BinaryMap: "BinaryMap",
|
|
6135
|
+
BinaryValue: "BinaryValue",
|
|
6136
|
+
BlobMap: "BlobMap",
|
|
6137
|
+
BResolveSingle: "BResolveSingle",
|
|
6138
|
+
BResolveSingleNoResult: "BResolveSingleNoResult",
|
|
6139
|
+
BResolveChoice: "BResolveChoice",
|
|
6140
|
+
BQueryResult: "BQueryResult",
|
|
6141
|
+
TengoTemplate: "TengoTemplate",
|
|
6142
|
+
TengoLib: "TengoLib",
|
|
6143
|
+
SoftwareInfo: "SoftwareInfo",
|
|
6144
|
+
Dummy: "Dummy",
|
|
6145
|
+
JsonResourceError: "json/resourceError",
|
|
6146
|
+
JsonObject: "json/object",
|
|
6147
|
+
JsonGzObject: "json-gz/object",
|
|
6148
|
+
JsonString: "json/string",
|
|
6149
|
+
JsonArray: "json/array",
|
|
6150
|
+
JsonNumber: "json/number",
|
|
6151
|
+
JsonBool: "json/bool",
|
|
6152
|
+
JsonNull: "json/null",
|
|
6153
|
+
JsonErrorTrace: "json/errorTrace",
|
|
6154
|
+
BContextEnd: "BContextEnd",
|
|
6155
|
+
FrontendFromUrl: "Frontend/FromUrl",
|
|
6156
|
+
FrontendFromFolder: "Frontend/FromFolder",
|
|
6157
|
+
FrontendFromLocalTgz: "Frontend/FromLocalTgz",
|
|
6158
|
+
BObjectSpec: "BObjectSpec",
|
|
6159
|
+
Blob: "Blob",
|
|
6160
|
+
Null: "Null",
|
|
6161
|
+
Binary: "binary",
|
|
6162
|
+
LSProvider: "LSProvider",
|
|
6163
|
+
WorkingDirectory: "WorkingDirectory",
|
|
6164
|
+
UserProject: "UserProject",
|
|
6165
|
+
Projects: "Projects",
|
|
6166
|
+
ClientRoot: "ClientRoot",
|
|
6167
|
+
SharingOutbox: "SharingOutbox",
|
|
6168
|
+
SharingState: "SharingState",
|
|
6169
|
+
SharedEnvelope: "SharedEnvelope"
|
|
6170
|
+
};
|
|
6171
|
+
objectType({
|
|
6172
|
+
type: literalType("plain"),
|
|
6173
|
+
content: stringType()
|
|
6174
|
+
});
|
|
6175
|
+
//#endregion
|
|
6176
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/bmodel/block_kind_ref.js
|
|
6177
|
+
/**
|
|
6178
|
+
* Compose a {@link BlockKindReference} from a kind's `name`/`version`.
|
|
6179
|
+
*
|
|
6180
|
+
* The single place that decides how the reference is assembled. If global
|
|
6181
|
+
* uniqueness later requires the name segment to be org-qualified, this is the
|
|
6182
|
+
* one line that changes.
|
|
6183
|
+
*/
|
|
6184
|
+
const formatKindRef = (k) => `${k.name}@${k.version}`;
|
|
6185
|
+
//#endregion
|
|
6186
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/flags/block_flags.js
|
|
6076
6187
|
/**
|
|
6077
6188
|
* Required PFrames version. Bump this in lockstep with the `@milaboratories/pframes-rs-*`
|
|
6078
6189
|
* version in `pnpm-workspace.yaml` so blocks built against the new SDK refuse to load on
|
|
@@ -6080,10 +6191,16 @@ var LinkerMap = class LinkerMap {
|
|
|
6080
6191
|
*/
|
|
6081
6192
|
const REQUIRES_PFRAMES_VERSION = 1001031;
|
|
6082
6193
|
stringType().length(24).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/);
|
|
6194
|
+
//#endregion
|
|
6195
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/ref.js
|
|
6196
|
+
/** One output of one block: the block and the name of the output in its output context. */
|
|
6197
|
+
const BlockOutput = objectType({
|
|
6198
|
+
blockId: stringType().describe("Upstream block id"),
|
|
6199
|
+
name: stringType().describe("Name of the output provided to the upstream block's output context")
|
|
6200
|
+
});
|
|
6083
6201
|
objectType({
|
|
6084
6202
|
__isRef: literalType(true).describe("Crucial marker for the block dependency tree reconstruction"),
|
|
6085
|
-
|
|
6086
|
-
name: stringType().describe("Name of the output provided to the upstream block's output context"),
|
|
6203
|
+
...BlockOutput.shape,
|
|
6087
6204
|
requireEnrichments: literalType(true).optional().describe("True if current block that stores this reference in its args, may need enrichments for the references value originating from the blocks in between current and referenced block")
|
|
6088
6205
|
}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").readonly();
|
|
6089
6206
|
/**
|
|
@@ -6124,7 +6241,41 @@ function createEnrichmentRef(hit, options = {}) {
|
|
|
6124
6241
|
};
|
|
6125
6242
|
}
|
|
6126
6243
|
//#endregion
|
|
6127
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
6244
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/args_issue.js
|
|
6245
|
+
/**
|
|
6246
|
+
* Reads one {@link ArgsIssue} from a value of unknown origin.
|
|
6247
|
+
*
|
|
6248
|
+
* Any severity other than `"warning"` is read as `"error"`: an issue whose weight cannot be
|
|
6249
|
+
* told keeps the block from running rather than letting it run on a misread finding.
|
|
6250
|
+
*
|
|
6251
|
+
* @throws when `value` is not an object carrying a string `message`
|
|
6252
|
+
*/
|
|
6253
|
+
function parseArgsIssue(value) {
|
|
6254
|
+
if (typeof value !== "object" || value === null) throw new Error(`An args issue must be an object, got ${describe$1(value)}`);
|
|
6255
|
+
const message = "message" in value ? value.message : void 0;
|
|
6256
|
+
if (!isString(message)) throw new Error(`An args issue must carry a string message, got ${describe$1(message)}`);
|
|
6257
|
+
return {
|
|
6258
|
+
severity: "severity" in value && value.severity === "warning" ? "warning" : "error",
|
|
6259
|
+
message
|
|
6260
|
+
};
|
|
6261
|
+
}
|
|
6262
|
+
/**
|
|
6263
|
+
* Reads a list of {@link ArgsIssue}s from a value of unknown origin, each entry as
|
|
6264
|
+
* {@link parseArgsIssue} reads it.
|
|
6265
|
+
*
|
|
6266
|
+
* @throws when `value` is not an array, or one of its entries is not an issue
|
|
6267
|
+
*/
|
|
6268
|
+
function parseArgsIssues(value) {
|
|
6269
|
+
if (!Array.isArray(value)) throw new Error(`Args issues must be an array, got ${describe$1(value)}`);
|
|
6270
|
+
return value.map(parseArgsIssue);
|
|
6271
|
+
}
|
|
6272
|
+
function describe$1(value) {
|
|
6273
|
+
if (value === null) return "null";
|
|
6274
|
+
if (Array.isArray(value)) return "an array";
|
|
6275
|
+
return typeof value;
|
|
6276
|
+
}
|
|
6277
|
+
//#endregion
|
|
6278
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/value_or_error.js
|
|
6128
6279
|
function mapValueInVOE(voe, cb) {
|
|
6129
6280
|
return voe.ok ? {
|
|
6130
6281
|
ok: true,
|
|
@@ -6132,56 +6283,7 @@ function mapValueInVOE(voe, cb) {
|
|
|
6132
6283
|
} : voe;
|
|
6133
6284
|
}
|
|
6134
6285
|
//#endregion
|
|
6135
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
6136
|
-
/** Well-known resource type names used across the platform. */
|
|
6137
|
-
const ResourceTypeName = {
|
|
6138
|
-
StreamManager: "StreamManager",
|
|
6139
|
-
StdMap: "StdMap",
|
|
6140
|
-
StdMapSlash: "std/map",
|
|
6141
|
-
EphStdMap: "EphStdMap",
|
|
6142
|
-
PFrame: "PFrame",
|
|
6143
|
-
ParquetChunk: "ParquetChunk",
|
|
6144
|
-
BContext: "BContext",
|
|
6145
|
-
BlockPackCustom: "BlockPackCustom",
|
|
6146
|
-
BinaryMap: "BinaryMap",
|
|
6147
|
-
BinaryValue: "BinaryValue",
|
|
6148
|
-
BlobMap: "BlobMap",
|
|
6149
|
-
BResolveSingle: "BResolveSingle",
|
|
6150
|
-
BResolveSingleNoResult: "BResolveSingleNoResult",
|
|
6151
|
-
BResolveChoice: "BResolveChoice",
|
|
6152
|
-
BQueryResult: "BQueryResult",
|
|
6153
|
-
TengoTemplate: "TengoTemplate",
|
|
6154
|
-
TengoLib: "TengoLib",
|
|
6155
|
-
SoftwareInfo: "SoftwareInfo",
|
|
6156
|
-
Dummy: "Dummy",
|
|
6157
|
-
JsonResourceError: "json/resourceError",
|
|
6158
|
-
JsonObject: "json/object",
|
|
6159
|
-
JsonGzObject: "json-gz/object",
|
|
6160
|
-
JsonString: "json/string",
|
|
6161
|
-
JsonArray: "json/array",
|
|
6162
|
-
JsonNumber: "json/number",
|
|
6163
|
-
JsonBool: "json/bool",
|
|
6164
|
-
JsonNull: "json/null",
|
|
6165
|
-
JsonErrorTrace: "json/errorTrace",
|
|
6166
|
-
BContextEnd: "BContextEnd",
|
|
6167
|
-
FrontendFromUrl: "Frontend/FromUrl",
|
|
6168
|
-
FrontendFromFolder: "Frontend/FromFolder",
|
|
6169
|
-
FrontendFromLocalTgz: "Frontend/FromLocalTgz",
|
|
6170
|
-
BObjectSpec: "BObjectSpec",
|
|
6171
|
-
Blob: "Blob",
|
|
6172
|
-
Null: "Null",
|
|
6173
|
-
Binary: "binary",
|
|
6174
|
-
LSProvider: "LSProvider",
|
|
6175
|
-
WorkingDirectory: "WorkingDirectory",
|
|
6176
|
-
UserProject: "UserProject",
|
|
6177
|
-
Projects: "Projects",
|
|
6178
|
-
ClientRoot: "ClientRoot",
|
|
6179
|
-
SharingOutbox: "SharingOutbox",
|
|
6180
|
-
SharingState: "SharingState",
|
|
6181
|
-
SharedEnvelope: "SharedEnvelope"
|
|
6182
|
-
};
|
|
6183
|
-
//#endregion
|
|
6184
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.53.0/node_modules/@milaboratories/pl-model-common/dist/services/service_types.js
|
|
6286
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/services/service_types.js
|
|
6185
6287
|
const SERVICE_ID_PATTERN = /^[a-zA-Z][a-zA-Z0-9]*$/;
|
|
6186
6288
|
const { service, isNodeService, isWasmService, isMainService, getServiceKind, getServiceModelMethods, getServiceUiMethods } = (() => {
|
|
6187
6289
|
const typeMap = /* @__PURE__ */ new Map();
|
|
@@ -6220,7 +6322,7 @@ const { service, isNodeService, isWasmService, isMainService, getServiceKind, ge
|
|
|
6220
6322
|
};
|
|
6221
6323
|
})();
|
|
6222
6324
|
//#endregion
|
|
6223
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
6325
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/services/service_declarations.js
|
|
6224
6326
|
const Services = {
|
|
6225
6327
|
PFrameSpec: service()({
|
|
6226
6328
|
type: "wasm",
|
|
@@ -6314,7 +6416,7 @@ function resolveRequiredServices(flags) {
|
|
|
6314
6416
|
}
|
|
6315
6417
|
Object.fromEntries(Object.keys(Services).map((key) => [`requires${key}`, true]));
|
|
6316
6418
|
//#endregion
|
|
6317
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
6419
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/services/service_injectors.js
|
|
6318
6420
|
function buildMethodMap(pick) {
|
|
6319
6421
|
const result = {};
|
|
6320
6422
|
for (const id of Object.values(Services)) result[id] = [...pick(id)];
|
|
@@ -6323,7 +6425,7 @@ function buildMethodMap(pick) {
|
|
|
6323
6425
|
buildMethodMap(getServiceUiMethods);
|
|
6324
6426
|
buildMethodMap(getServiceModelMethods);
|
|
6325
6427
|
//#endregion
|
|
6326
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
6428
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/columns/accessor_traversal.js
|
|
6327
6429
|
/** Resource types that hold column collections — DFS stops here and collects. */
|
|
6328
6430
|
const COLLECT_TYPES = [ResourceTypeName.PFrame];
|
|
6329
6431
|
/** Resource types DFS descends through when looking for PFrames. */
|
|
@@ -6431,7 +6533,7 @@ function indexPoolBlock(block) {
|
|
|
6431
6533
|
return result;
|
|
6432
6534
|
}
|
|
6433
6535
|
//#endregion
|
|
6434
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
6536
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/columns/column_registry.js
|
|
6435
6537
|
/**
|
|
6436
6538
|
* Id-index over a set of {@link ColumnEntriesProvider}s. Sole job:
|
|
6437
6539
|
* {@link PObjectId} → {@link LeafEntry}. Generic over the accessor flavour, so
|
|
@@ -6468,7 +6570,7 @@ var ColumnRegistry = class {
|
|
|
6468
6570
|
}
|
|
6469
6571
|
};
|
|
6470
6572
|
//#endregion
|
|
6471
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
6573
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/columns/dedup.js
|
|
6472
6574
|
/**
|
|
6473
6575
|
* Two-track dedup over an item stream keyed by `ColumnUniversalId`:
|
|
6474
6576
|
*
|
|
@@ -6509,7 +6611,7 @@ function dedupColumns(items, getId, getSpec) {
|
|
|
6509
6611
|
return out;
|
|
6510
6612
|
}
|
|
6511
6613
|
//#endregion
|
|
6512
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
6614
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/columns/providers.js
|
|
6513
6615
|
/**
|
|
6514
6616
|
* Generic entries provider over a single accessor root. Walks `<root>` once
|
|
6515
6617
|
* from the supplied `rootPath`, builds an id → {@link LeafEntry} map and
|
|
@@ -6566,7 +6668,7 @@ var ResultPoolEntriesProvider = class {
|
|
|
6566
6668
|
}
|
|
6567
6669
|
};
|
|
6568
6670
|
//#endregion
|
|
6569
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
6671
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/template/template_ref_form.js
|
|
6570
6672
|
/**
|
|
6571
6673
|
* Whether `value` is a reference in the readable spelling.
|
|
6572
6674
|
*
|
|
@@ -6635,7 +6737,7 @@ function expandTemplatePlRef(ref) {
|
|
|
6635
6737
|
};
|
|
6636
6738
|
}
|
|
6637
6739
|
//#endregion
|
|
6638
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.
|
|
6740
|
+
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.55.0/node_modules/@milaboratories/pl-model-common/dist/template/template_relocate.js
|
|
6639
6741
|
/**
|
|
6640
6742
|
* Point every column identifier in a block's params at the blocks of the project being built.
|
|
6641
6743
|
*
|
|
@@ -6695,7 +6797,7 @@ function relocateBlockIds(params, blockIds) {
|
|
|
6695
6797
|
return walk(params);
|
|
6696
6798
|
}
|
|
6697
6799
|
//#endregion
|
|
6698
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
6800
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/block_migrations.js
|
|
6699
6801
|
/** Create a DataVersioned wrapper with correct shape */
|
|
6700
6802
|
function makeVersionedData(version, data) {
|
|
6701
6803
|
return {
|
|
@@ -7007,9 +7109,10 @@ var DataModelInitialChain = class extends DataModelMigrationChain {
|
|
|
7007
7109
|
if (data !== null && typeof data === "object" && "args" in data) return fn(data);
|
|
7008
7110
|
return data;
|
|
7009
7111
|
};
|
|
7112
|
+
const initialVersion = this.versionChain[0];
|
|
7010
7113
|
const step = {
|
|
7011
7114
|
fromVersion: DATA_MODEL_LEGACY_VERSION,
|
|
7012
|
-
toVersion:
|
|
7115
|
+
toVersion: initialVersion,
|
|
7013
7116
|
migrate: wrappedFn
|
|
7014
7117
|
};
|
|
7015
7118
|
return new DataModelMigrationChainWithRecover({
|
|
@@ -7273,7 +7376,7 @@ var DataModel = class DataModel {
|
|
|
7273
7376
|
}
|
|
7274
7377
|
};
|
|
7275
7378
|
//#endregion
|
|
7276
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
7379
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/internal.js
|
|
7277
7380
|
/** Utility code helping to identify whether the code is running in actual UI environment */
|
|
7278
7381
|
function isInUI() {
|
|
7279
7382
|
return typeof globalThis.getPlatforma !== "undefined" || typeof globalThis.platforma !== "undefined";
|
|
@@ -7343,7 +7446,7 @@ function registerFutureAwait(handle, onResolve) {
|
|
|
7343
7446
|
futureResolves.get(handle).push(onResolve);
|
|
7344
7447
|
}
|
|
7345
7448
|
//#endregion
|
|
7346
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
7449
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/block_storage_facade.js
|
|
7347
7450
|
/**
|
|
7348
7451
|
* All facade callback names as constants.
|
|
7349
7452
|
* These are the source of truth - the interface is derived from these.
|
|
@@ -7381,7 +7484,7 @@ function registerFacadeCallbacks(callbacks) {
|
|
|
7381
7484
|
for (const key of Object.values(BlockStorageFacadeCallbacks)) tryRegisterCallback(key, callbacks[key]);
|
|
7382
7485
|
}
|
|
7383
7486
|
//#endregion
|
|
7384
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
7487
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/services/block_services.js
|
|
7385
7488
|
/**
|
|
7386
7489
|
* Services required by all V3 blocks by default.
|
|
7387
7490
|
* Edit this when a new service should be available to all blocks.
|
|
@@ -7397,7 +7500,7 @@ const BLOCK_SERVICE_FLAGS = {
|
|
|
7397
7500
|
};
|
|
7398
7501
|
resolveRequiredServices(BLOCK_SERVICE_FLAGS);
|
|
7399
7502
|
//#endregion
|
|
7400
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
7503
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/render/future.js
|
|
7401
7504
|
var FutureRef = class FutureRef {
|
|
7402
7505
|
handle;
|
|
7403
7506
|
postProcess;
|
|
@@ -7425,7 +7528,7 @@ var FutureRef = class FutureRef {
|
|
|
7425
7528
|
}
|
|
7426
7529
|
};
|
|
7427
7530
|
//#endregion
|
|
7428
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
7531
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/render/accessor.js
|
|
7429
7532
|
function ifDef(value, cb) {
|
|
7430
7533
|
return value === void 0 ? void 0 : cb(value);
|
|
7431
7534
|
}
|
|
@@ -7675,11 +7778,11 @@ var TreeNodeAccessor = class TreeNodeAccessor {
|
|
|
7675
7778
|
}
|
|
7676
7779
|
};
|
|
7677
7780
|
//#endregion
|
|
7678
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
7781
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/render/internal.js
|
|
7679
7782
|
const MainAccessorName = "main";
|
|
7680
7783
|
const StagingAccessorName = "staging";
|
|
7681
7784
|
//#endregion
|
|
7682
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
7785
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/render/util/axis_filtering.js
|
|
7683
7786
|
function filterDataInfoEntries(dataInfoEntries, axisFilters) {
|
|
7684
7787
|
const sortedFilters = [...axisFilters].sort((a, b) => b[0] - a[0]);
|
|
7685
7788
|
const { type } = dataInfoEntries;
|
|
@@ -7743,7 +7846,7 @@ function filterDataInfoEntries(dataInfoEntries, axisFilters) {
|
|
|
7743
7846
|
}
|
|
7744
7847
|
}
|
|
7745
7848
|
//#endregion
|
|
7746
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
7849
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/labels/linked_column_postfix.js
|
|
7747
7850
|
/**
|
|
7748
7851
|
* Structural postfix derivation for linked columns (phase 2 of `deriveDistinctLabels`).
|
|
7749
7852
|
*
|
|
@@ -7915,7 +8018,10 @@ function resolveGroup(entries, indices, format) {
|
|
|
7915
8018
|
* linked columns by the difference between their sources.
|
|
7916
8019
|
*/
|
|
7917
8020
|
function derivePostfixes(entries, format = defaultLinkerFormatter) {
|
|
7918
|
-
const postfix = [...entries.reduce((acc, e, idx) =>
|
|
8021
|
+
const postfix = [...entries.reduce((acc, e, idx) => {
|
|
8022
|
+
const key = `${e.stem}\u0000${e.marker ?? ""}`;
|
|
8023
|
+
return acc.set(key, [...acc.get(key) ?? [], idx]);
|
|
8024
|
+
}, /* @__PURE__ */ new Map()).values()].reduce((acc, idxs) => {
|
|
7919
8025
|
if (idxs.length < 2) return acc;
|
|
7920
8026
|
const resolved = resolveGroup(idxs.map((i) => entries[i]), idxs, format);
|
|
7921
8027
|
return idxs.reduce((m, i, k) => m.set(i, resolved[k]), acc);
|
|
@@ -7926,7 +8032,7 @@ function derivePostfixes(entries, format = defaultLinkerFormatter) {
|
|
|
7926
8032
|
});
|
|
7927
8033
|
}
|
|
7928
8034
|
//#endregion
|
|
7929
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
8035
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/labels/derive_distinct_labels.js
|
|
7930
8036
|
const DISTANCE_PENALTY = .001;
|
|
7931
8037
|
const LABEL_TYPE = "__LABEL__";
|
|
7932
8038
|
const LABEL_TYPE_FULL = "__LABEL__@1";
|
|
@@ -7948,9 +8054,10 @@ function isSyntheticType(t) {
|
|
|
7948
8054
|
function deriveDistinctLabels(values, options = {}) {
|
|
7949
8055
|
const stems = deriveStems(values, options);
|
|
7950
8056
|
return derivePostfixes(values.map((v, i) => {
|
|
7951
|
-
const { spec, linkerPath } = extractEntryParts(v);
|
|
8057
|
+
const { spec, linkerPath, marker } = extractEntryParts(v);
|
|
7952
8058
|
return {
|
|
7953
8059
|
stem: stems[i],
|
|
8060
|
+
marker,
|
|
7954
8061
|
hit: spec,
|
|
7955
8062
|
linkers: (linkerPath ?? []).map((s) => s.spec)
|
|
7956
8063
|
};
|
|
@@ -8002,13 +8109,15 @@ function extractEntryParts(entry) {
|
|
|
8002
8109
|
spec: entry,
|
|
8003
8110
|
extraTrace: void 0,
|
|
8004
8111
|
linkerPath: void 0,
|
|
8005
|
-
qualifications: void 0
|
|
8112
|
+
qualifications: void 0,
|
|
8113
|
+
marker: void 0
|
|
8006
8114
|
};
|
|
8007
8115
|
return {
|
|
8008
8116
|
spec: entry.spec,
|
|
8009
8117
|
extraTrace: entry.extraTrace,
|
|
8010
8118
|
linkerPath: entry.linkerPath,
|
|
8011
|
-
qualifications: entry.qualifications
|
|
8119
|
+
qualifications: entry.qualifications,
|
|
8120
|
+
marker: entry.marker
|
|
8012
8121
|
};
|
|
8013
8122
|
}
|
|
8014
8123
|
function formatQualification(q) {
|
|
@@ -8355,7 +8464,7 @@ function repairBareLabels(labels, minimized, records, stats, forceTraceElements,
|
|
|
8355
8464
|
return patched;
|
|
8356
8465
|
}
|
|
8357
8466
|
//#endregion
|
|
8358
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
8467
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/render/util/label.js
|
|
8359
8468
|
/** @deprecated Use deriveDistinctLabels */
|
|
8360
8469
|
function deriveLabels(values, getSpec, options = {}) {
|
|
8361
8470
|
return deriveDistinctLabels(values.map(getSpec), options).map((label, i) => ({
|
|
@@ -8364,15 +8473,17 @@ function deriveLabels(values, getSpec, options = {}) {
|
|
|
8364
8473
|
}));
|
|
8365
8474
|
}
|
|
8366
8475
|
//#endregion
|
|
8367
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
8368
|
-
const
|
|
8369
|
-
const
|
|
8370
|
-
const
|
|
8371
|
-
const
|
|
8372
|
-
const
|
|
8373
|
-
const
|
|
8374
|
-
const
|
|
8375
|
-
const
|
|
8476
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/render/util/pcolumn_data.js
|
|
8477
|
+
const PCD_PREFIX = "PColumnData/";
|
|
8478
|
+
const RT_RESOURCE_MAP = PCD_PREFIX + "ResourceMap";
|
|
8479
|
+
const RT_RESOURCE_MAP_PARTITIONED = PCD_PREFIX + "Partitioned/ResourceMap";
|
|
8480
|
+
const RT_JSON_PARTITIONED = PCD_PREFIX + "JsonPartitioned";
|
|
8481
|
+
const RT_BINARY_PARTITIONED = PCD_PREFIX + "BinaryPartitioned";
|
|
8482
|
+
const RT_PARQUET_PARTITIONED = PCD_PREFIX + "ParquetPartitioned";
|
|
8483
|
+
const PCD_SUP_PREFIX = PCD_PREFIX + "Partitioned/";
|
|
8484
|
+
const RT_JSON_SUPER_PARTITIONED = PCD_SUP_PREFIX + "JsonPartitioned";
|
|
8485
|
+
const RT_BINARY_SUPER_PARTITIONED = PCD_SUP_PREFIX + "BinaryPartitioned";
|
|
8486
|
+
const RT_PARQUET_SUPER_PARTITIONED = PCD_SUP_PREFIX + "ParquetPartitioned";
|
|
8376
8487
|
const removeIndexSuffix = (keyStr) => {
|
|
8377
8488
|
if (keyStr.endsWith(".index")) return {
|
|
8378
8489
|
baseKey: keyStr.substring(0, keyStr.length - 6),
|
|
@@ -8658,7 +8769,7 @@ function allPColumnsReady(columns) {
|
|
|
8658
8769
|
return columns.every(isPColumnReady);
|
|
8659
8770
|
}
|
|
8660
8771
|
//#endregion
|
|
8661
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
8772
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/render/util/column_collection.js
|
|
8662
8773
|
function isPColumnValues(value) {
|
|
8663
8774
|
if (!Array.isArray(value)) return false;
|
|
8664
8775
|
if (value.length === 0) return true;
|
|
@@ -8692,9 +8803,10 @@ function splitFiltersToAxisFilter(splitFilters) {
|
|
|
8692
8803
|
}
|
|
8693
8804
|
function fallbackIdDeriver(originalId, axisFilters) {
|
|
8694
8805
|
if (!axisFilters || axisFilters.length === 0) return originalId;
|
|
8806
|
+
const filtersToCanonicalize = [...axisFilters].sort((a, b) => a[0] - b[0]);
|
|
8695
8807
|
return (0, import_canonicalize.default)({
|
|
8696
8808
|
id: originalId,
|
|
8697
|
-
axisFilters:
|
|
8809
|
+
axisFilters: filtersToCanonicalize
|
|
8698
8810
|
});
|
|
8699
8811
|
}
|
|
8700
8812
|
/** Checks if a selector object uses any anchor properties */
|
|
@@ -8936,7 +9048,7 @@ var PColumnCollection = class {
|
|
|
8936
9048
|
}
|
|
8937
9049
|
};
|
|
8938
9050
|
//#endregion
|
|
8939
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
9051
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/services/service_bridge.js
|
|
8940
9052
|
/**
|
|
8941
9053
|
* Builds a ServiceProxy from a ServiceDispatch.
|
|
8942
9054
|
* Each service method call is forwarded to dispatch.callServiceMethod.
|
|
@@ -8945,7 +9057,7 @@ function createServiceProxy(dispatch) {
|
|
|
8945
9057
|
return ((serviceId) => Object.freeze(Object.fromEntries(dispatch.getServiceMethods(serviceId).map((method) => [method, (...args) => dispatch.callServiceMethod(serviceId, method, ...args)]))));
|
|
8946
9058
|
}
|
|
8947
9059
|
//#endregion
|
|
8948
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
9060
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/services/get_services.js
|
|
8949
9061
|
const cachedServices = /* @__PURE__ */ new WeakMap();
|
|
8950
9062
|
function getService(name, deps) {
|
|
8951
9063
|
const ctx = deps?.ctx ?? getCfgRenderCtx();
|
|
@@ -8959,7 +9071,7 @@ function getService(name, deps) {
|
|
|
8959
9071
|
})();
|
|
8960
9072
|
}
|
|
8961
9073
|
//#endregion
|
|
8962
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
9074
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/render/util/pframe_upgraders.js
|
|
8963
9075
|
function patchInSetFilters(filters) {
|
|
8964
9076
|
const inSetToOrEqual = (predicate) => {
|
|
8965
9077
|
if (predicate.operator !== "InSet") return predicate;
|
|
@@ -8997,7 +9109,7 @@ function patchInSetFilters(filters) {
|
|
|
8997
9109
|
return filters.map((filter) => mapFilter(filter, inSetToOrEqual));
|
|
8998
9110
|
}
|
|
8999
9111
|
//#endregion
|
|
9000
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
9112
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/render/api.js
|
|
9001
9113
|
/**
|
|
9002
9114
|
* Helper function to match domain objects
|
|
9003
9115
|
* @param query Optional domain to match against
|
|
@@ -9048,11 +9160,13 @@ var ResultPool = class {
|
|
|
9048
9160
|
let refsWithEnrichments = false;
|
|
9049
9161
|
if (typeof opts !== "undefined") {
|
|
9050
9162
|
if (typeof opts === "function") labelOps = opts;
|
|
9051
|
-
else if (typeof opts === "object")
|
|
9052
|
-
|
|
9053
|
-
|
|
9054
|
-
|
|
9055
|
-
|
|
9163
|
+
else if (typeof opts === "object") {
|
|
9164
|
+
if ("includeNativeLabel" in opts || "separator" in opts || "addLabelAsSuffix" in opts) labelOps = opts;
|
|
9165
|
+
else {
|
|
9166
|
+
opts = opts;
|
|
9167
|
+
labelOps = opts.label ?? {};
|
|
9168
|
+
refsWithEnrichments = opts.refsWithEnrichments ?? false;
|
|
9169
|
+
}
|
|
9056
9170
|
}
|
|
9057
9171
|
}
|
|
9058
9172
|
if (typeof labelOps === "object") return deriveLabels(filtered, (o) => o.obj, labelOps ?? {}).map(({ value: { ref }, label }) => ({
|
|
@@ -9446,27 +9560,27 @@ var PluginRenderCtx = class extends RenderCtxBase {
|
|
|
9446
9560
|
}
|
|
9447
9561
|
};
|
|
9448
9562
|
//#endregion
|
|
9449
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
9563
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/plugin_model.js
|
|
9450
9564
|
/** Internal plugin↔block handshake. `Symbol.for` (not `Symbol`) so it stays
|
|
9451
9565
|
* identical across multiple `@platforma-sdk/model` copies in one process. */
|
|
9452
9566
|
const CREATE_PLUGIN_MODEL = Symbol.for("@platforma-sdk/model:createPluginModel");
|
|
9453
9567
|
//#endregion
|
|
9454
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
9455
|
-
const PlatformaSDKVersion = "1.
|
|
9568
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/version.js
|
|
9569
|
+
const PlatformaSDKVersion = "1.88.0";
|
|
9456
9570
|
//#endregion
|
|
9457
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
9571
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/bconfig/types.js
|
|
9458
9572
|
function isConfigLambda(cfgOrFh) {
|
|
9459
9573
|
return cfgOrFh.__renderLambda === true;
|
|
9460
9574
|
}
|
|
9461
9575
|
//#endregion
|
|
9462
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
9576
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/bconfig/normalization.js
|
|
9463
9577
|
function downgradeCfgOrLambda(data) {
|
|
9464
9578
|
if (data === void 0) return void 0;
|
|
9465
9579
|
if (isConfigLambda(data)) return data.handle;
|
|
9466
9580
|
return data;
|
|
9467
9581
|
}
|
|
9468
9582
|
//#endregion
|
|
9469
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
9583
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/block_storage_callbacks.js
|
|
9470
9584
|
/**
|
|
9471
9585
|
* BlockStorage Callback Implementations - wired to facade callbacks in BlockModelV3.done().
|
|
9472
9586
|
*
|
|
@@ -9755,42 +9869,77 @@ function createInitialStorageFromParams(paramsJson, blockIdsJson, hooks) {
|
|
|
9755
9869
|
}
|
|
9756
9870
|
}
|
|
9757
9871
|
/**
|
|
9758
|
-
* Derives args from storage using the
|
|
9759
|
-
*
|
|
9872
|
+
* Derives args from storage using the block's args function, then finds the issues in them
|
|
9873
|
+
* with the block's `argsIssues()`.
|
|
9874
|
+
*
|
|
9875
|
+
* A throw from `argsIssues()`, or a result that is not a list of issues, is one error carrying
|
|
9876
|
+
* the thrown or parser message, so a broken check keeps the block from running instead of
|
|
9877
|
+
* letting it run unchecked.
|
|
9760
9878
|
*
|
|
9761
9879
|
* @param storageJson - Storage as JSON string
|
|
9762
|
-
* @param
|
|
9763
|
-
* @returns ArgsDeriveResult with derived args or error
|
|
9880
|
+
* @param derivation - The block's args and args issues lambdas
|
|
9881
|
+
* @returns ArgsDeriveResult with derived args and args issues, or error
|
|
9764
9882
|
*/
|
|
9765
|
-
function deriveArgsFromStorage(storageJson,
|
|
9883
|
+
function deriveArgsFromStorage(storageJson, derivation) {
|
|
9766
9884
|
const { data } = normalizeStorage(storageJson);
|
|
9767
|
-
|
|
9768
|
-
|
|
9769
|
-
}
|
|
9770
|
-
|
|
9771
|
-
|
|
9885
|
+
const run = deriveArgsWithIssues(data, derivation);
|
|
9886
|
+
if (run.type === "threw") return { error: `args() threw: ${run.message}` };
|
|
9887
|
+
const { args, issues } = run;
|
|
9888
|
+
const errors = errorMessages(issues);
|
|
9889
|
+
if (errors.length > 0) return {
|
|
9890
|
+
error: errors.join("; "),
|
|
9891
|
+
args,
|
|
9892
|
+
issues
|
|
9893
|
+
};
|
|
9894
|
+
return {
|
|
9895
|
+
value: args,
|
|
9896
|
+
issues
|
|
9897
|
+
};
|
|
9772
9898
|
}
|
|
9773
9899
|
/**
|
|
9774
9900
|
* Derives prerunArgs from storage.
|
|
9775
|
-
*
|
|
9901
|
+
*
|
|
9902
|
+
* A block with its own `prerunArgs()` is staged with what it returns, unless its
|
|
9903
|
+
* `prerunArgsIssues()` finds errors in it; `argsIssues()` is not consulted then. A `prerunArgs()`
|
|
9904
|
+
* that returns `undefined` skips staging, and `prerunArgsIssues()` is not called for it.
|
|
9905
|
+
*
|
|
9906
|
+
* A block without its own `prerunArgs()` is staged with its args, unless `argsIssues()` finds
|
|
9907
|
+
* errors in them: args that may not run are not staged either.
|
|
9908
|
+
*
|
|
9909
|
+
* A throw from either issues lambda, or a result that is not a list of issues, is one error
|
|
9910
|
+
* carrying the thrown or parser message.
|
|
9776
9911
|
*
|
|
9777
9912
|
* @param storageJson - Storage as JSON string
|
|
9778
|
-
* @param
|
|
9779
|
-
* @
|
|
9780
|
-
* @returns ArgsDeriveResult with derived prerunArgs or error
|
|
9913
|
+
* @param derivation - The block's args, args issues and own staging lambdas
|
|
9914
|
+
* @returns PrerunArgsDeriveResult with derived prerunArgs and their issues, or error
|
|
9781
9915
|
*/
|
|
9782
|
-
function derivePrerunArgsFromStorage(storageJson,
|
|
9916
|
+
function derivePrerunArgsFromStorage(storageJson, derivation) {
|
|
9783
9917
|
const { data } = normalizeStorage(storageJson);
|
|
9784
|
-
|
|
9785
|
-
|
|
9786
|
-
|
|
9787
|
-
return { error: `prerunArgs() threw: ${
|
|
9788
|
-
|
|
9789
|
-
|
|
9790
|
-
|
|
9791
|
-
|
|
9792
|
-
|
|
9918
|
+
const { ownPrerunArgs } = derivation;
|
|
9919
|
+
if (ownPrerunArgs !== void 0) {
|
|
9920
|
+
const run = derivePrerunArgsWithIssues(data, ownPrerunArgs);
|
|
9921
|
+
if (run.type === "threw") return { error: `prerunArgs() threw: ${run.message}` };
|
|
9922
|
+
const errors = errorMessages(run.issues);
|
|
9923
|
+
if (errors.length > 0) return {
|
|
9924
|
+
error: errors.join("; "),
|
|
9925
|
+
issues: run.issues
|
|
9926
|
+
};
|
|
9927
|
+
return {
|
|
9928
|
+
value: run.args,
|
|
9929
|
+
issues: run.issues
|
|
9930
|
+
};
|
|
9793
9931
|
}
|
|
9932
|
+
const run = deriveArgsWithIssues(data, derivation);
|
|
9933
|
+
if (run.type === "threw") return { error: `args() threw (fallback): ${run.message}` };
|
|
9934
|
+
const errors = errorMessages(run.issues);
|
|
9935
|
+
if (errors.length > 0) return {
|
|
9936
|
+
error: `argsIssues() found errors (fallback): ${errors.join("; ")}`,
|
|
9937
|
+
issues: run.issues
|
|
9938
|
+
};
|
|
9939
|
+
return {
|
|
9940
|
+
value: run.args,
|
|
9941
|
+
issues: run.issues
|
|
9942
|
+
};
|
|
9794
9943
|
}
|
|
9795
9944
|
/**
|
|
9796
9945
|
* Derives this block's template-entry params from storage.
|
|
@@ -9809,7 +9958,7 @@ function derivePrerunArgsFromStorage(storageJson, deriveArgs, derivePrerunArgs)
|
|
|
9809
9958
|
*
|
|
9810
9959
|
* @param storageJson - Storage as JSON string
|
|
9811
9960
|
* @param deriveTemplateParams - The block's templateParams lambda
|
|
9812
|
-
* @returns
|
|
9961
|
+
* @returns DeriveResult holding the params exactly as the block projected them
|
|
9813
9962
|
*/
|
|
9814
9963
|
function deriveTemplateParamsFromStorage(storageJson, deriveTemplateParams) {
|
|
9815
9964
|
const { data } = normalizeStorage(storageJson);
|
|
@@ -9819,8 +9968,76 @@ function deriveTemplateParamsFromStorage(storageJson, deriveTemplateParams) {
|
|
|
9819
9968
|
return { error: `templateParams() threw: ${e instanceof Error ? e.message : String(e)}` };
|
|
9820
9969
|
}
|
|
9821
9970
|
}
|
|
9971
|
+
function deriveArgsWithIssues(data, derivation) {
|
|
9972
|
+
const { deriveArgs, argsIssues } = derivation;
|
|
9973
|
+
let args;
|
|
9974
|
+
try {
|
|
9975
|
+
args = deriveArgs(data);
|
|
9976
|
+
} catch (e) {
|
|
9977
|
+
return {
|
|
9978
|
+
type: "threw",
|
|
9979
|
+
message: messageOf(e)
|
|
9980
|
+
};
|
|
9981
|
+
}
|
|
9982
|
+
if (argsIssues === void 0) return {
|
|
9983
|
+
type: "derived",
|
|
9984
|
+
args,
|
|
9985
|
+
issues: []
|
|
9986
|
+
};
|
|
9987
|
+
return {
|
|
9988
|
+
type: "derived",
|
|
9989
|
+
args,
|
|
9990
|
+
issues: collectIssues(() => argsIssues({
|
|
9991
|
+
args,
|
|
9992
|
+
data
|
|
9993
|
+
}))
|
|
9994
|
+
};
|
|
9995
|
+
}
|
|
9996
|
+
function derivePrerunArgsWithIssues(data, derivation) {
|
|
9997
|
+
const { derivePrerunArgs, prerunArgsIssues } = derivation;
|
|
9998
|
+
let prerunArgs;
|
|
9999
|
+
try {
|
|
10000
|
+
prerunArgs = derivePrerunArgs(data);
|
|
10001
|
+
} catch (e) {
|
|
10002
|
+
return {
|
|
10003
|
+
type: "threw",
|
|
10004
|
+
message: messageOf(e)
|
|
10005
|
+
};
|
|
10006
|
+
}
|
|
10007
|
+
if (prerunArgsIssues === void 0 || prerunArgs === void 0) return {
|
|
10008
|
+
type: "derived",
|
|
10009
|
+
args: prerunArgs,
|
|
10010
|
+
issues: []
|
|
10011
|
+
};
|
|
10012
|
+
return {
|
|
10013
|
+
type: "derived",
|
|
10014
|
+
args: prerunArgs,
|
|
10015
|
+
issues: collectIssues(() => prerunArgsIssues({
|
|
10016
|
+
prerunArgs,
|
|
10017
|
+
data
|
|
10018
|
+
}))
|
|
10019
|
+
};
|
|
10020
|
+
}
|
|
10021
|
+
/**
|
|
10022
|
+
* Calls an issues lambda of the block. Its result is parsed rather than trusted: a block's types
|
|
10023
|
+
* do not hold at run time, and an entry that cannot be read must count as an error, not slip
|
|
10024
|
+
* past. A throw, or a result that cannot be read, is one error carrying its message.
|
|
10025
|
+
*/
|
|
10026
|
+
function collectIssues(issuesOf) {
|
|
10027
|
+
try {
|
|
10028
|
+
return parseArgsIssues(issuesOf());
|
|
10029
|
+
} catch (e) {
|
|
10030
|
+
return [{
|
|
10031
|
+
severity: "error",
|
|
10032
|
+
message: messageOf(e)
|
|
10033
|
+
}];
|
|
10034
|
+
}
|
|
10035
|
+
}
|
|
10036
|
+
function errorMessages(issues) {
|
|
10037
|
+
return issues.filter((issue) => issue.severity !== "warning").map((issue) => issue.message);
|
|
10038
|
+
}
|
|
9822
10039
|
//#endregion
|
|
9823
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
10040
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/block_model.js
|
|
9824
10041
|
/**
|
|
9825
10042
|
* Merges two feature flag objects with type-aware logic:
|
|
9826
10043
|
* - `supports*` (boolean): OR — `true` if either side is `true`
|
|
@@ -9848,10 +10065,12 @@ var BlockModelV3 = class BlockModelV3 {
|
|
|
9848
10065
|
static FEATURE_FLAGS = {
|
|
9849
10066
|
supportsLazyState: true,
|
|
9850
10067
|
supportsPframeQueryRanking: true,
|
|
10068
|
+
supportsColumnLinks: true,
|
|
9851
10069
|
requiresUIAPIVersion: 3,
|
|
9852
10070
|
requiresModelAPIVersion: 2,
|
|
9853
10071
|
requiresCreatePTable: 2,
|
|
9854
10072
|
requiresPFramesVersion: REQUIRES_PFRAMES_VERSION,
|
|
10073
|
+
requiresArgsIssues: true,
|
|
9855
10074
|
...BLOCK_SERVICE_FLAGS
|
|
9856
10075
|
};
|
|
9857
10076
|
/** @deprecated Use FEATURE_FLAGS */
|
|
@@ -9895,7 +10114,9 @@ var BlockModelV3 = class BlockModelV3 {
|
|
|
9895
10114
|
enrichmentTargets: void 0,
|
|
9896
10115
|
featureFlags: { ...BlockModelV3.FEATURE_FLAGS },
|
|
9897
10116
|
deriveArgs: void 0,
|
|
10117
|
+
argsIssues: void 0,
|
|
9898
10118
|
derivePrerunArgs: void 0,
|
|
10119
|
+
prerunArgsIssues: void 0,
|
|
9899
10120
|
deriveTemplateParams: void 0,
|
|
9900
10121
|
plugins: {}
|
|
9901
10122
|
});
|
|
@@ -9925,19 +10146,56 @@ var BlockModelV3 = class BlockModelV3 {
|
|
|
9925
10146
|
* Sets a function to derive block args from data.
|
|
9926
10147
|
* This is called during setData to compute the args that will be used for block execution.
|
|
9927
10148
|
*
|
|
10149
|
+
* Build args even from incomplete data, and say what keeps the block from running in
|
|
10150
|
+
* {@link argsIssues}: args that exist let the platform see what the block references
|
|
10151
|
+
* before it is ready to run. Throwing here still works, and means there are no args at all.
|
|
10152
|
+
*
|
|
10153
|
+
* Setting args again drops a {@link argsIssues} set before, since it checked other args.
|
|
10154
|
+
*
|
|
9928
10155
|
* @example
|
|
9929
10156
|
* .args<BlockArgs>((data) => ({ numbers: data.numbers }))
|
|
9930
10157
|
*
|
|
9931
10158
|
* @example
|
|
9932
|
-
* .args<BlockArgs>((data) => {
|
|
9933
|
-
*
|
|
9934
|
-
*
|
|
9935
|
-
*
|
|
10159
|
+
* .args<BlockArgs>((data) => ({ numbers: data.numbers }))
|
|
10160
|
+
* .argsIssues(({ args }) =>
|
|
10161
|
+
* args.numbers.length === 0 ? [{ severity: 'error', message: 'Numbers required' }] : [],
|
|
10162
|
+
* )
|
|
9936
10163
|
*/
|
|
9937
10164
|
args(lambda) {
|
|
9938
10165
|
return new BlockModelV3({
|
|
9939
10166
|
...this.config,
|
|
9940
|
-
deriveArgs: lambda
|
|
10167
|
+
deriveArgs: lambda,
|
|
10168
|
+
argsIssues: void 0
|
|
10169
|
+
});
|
|
10170
|
+
}
|
|
10171
|
+
/**
|
|
10172
|
+
* Sets a function that finds what keeps the block from running with the args {@link args}
|
|
10173
|
+
* derived (optional). It is called after `args()`, with its result and the data it was built
|
|
10174
|
+
* from.
|
|
10175
|
+
*
|
|
10176
|
+
* An issue of severity `"error"` keeps the block from running; a `"warning"` does not. A throw,
|
|
10177
|
+
* or a result that is not a list of issues, counts as one error carrying the thrown or parser
|
|
10178
|
+
* message. Without this function, args that `args()` returns are always runnable.
|
|
10179
|
+
*
|
|
10180
|
+
* A block without its own {@link prerunArgs} is staged with its args, and only while this
|
|
10181
|
+
* function finds no errors in them.
|
|
10182
|
+
*
|
|
10183
|
+
* Must be set after `.args()`, and is dropped when `.args()` is set again.
|
|
10184
|
+
*
|
|
10185
|
+
* @example
|
|
10186
|
+
* .args((data) => ({ dataset: data.dataset, threshold: data.threshold }))
|
|
10187
|
+
* .argsIssues(({ args }) => {
|
|
10188
|
+
* const issues: ArgsIssue[] = [];
|
|
10189
|
+
* if (args.dataset === undefined) issues.push({ severity: 'error', message: 'Select a dataset' });
|
|
10190
|
+
* if (args.threshold > 0.5) issues.push({ severity: 'warning', message: 'Threshold is high' });
|
|
10191
|
+
* return issues;
|
|
10192
|
+
* })
|
|
10193
|
+
*/
|
|
10194
|
+
argsIssues(fn) {
|
|
10195
|
+
if (this.config.deriveArgs === void 0) throw new Error("argsIssues() must be set after args(): it checks the args they derive.");
|
|
10196
|
+
return new BlockModelV3({
|
|
10197
|
+
...this.config,
|
|
10198
|
+
argsIssues: fn
|
|
9941
10199
|
});
|
|
9942
10200
|
}
|
|
9943
10201
|
/**
|
|
@@ -9950,6 +10208,9 @@ var BlockModelV3 = class BlockModelV3 {
|
|
|
9950
10208
|
* The staging / prerun phase runs only if currentPrerunArgs differs from the executed
|
|
9951
10209
|
* version of prerunArgs (same comparison logic as currentArgs vs prodArgs).
|
|
9952
10210
|
*
|
|
10211
|
+
* Setting prerun args again drops a {@link prerunArgsIssues} set before, since it checked other
|
|
10212
|
+
* args.
|
|
10213
|
+
*
|
|
9953
10214
|
* @example
|
|
9954
10215
|
* .prerunArgs((data) => ({ numbers: data.numbers }))
|
|
9955
10216
|
*
|
|
@@ -9963,7 +10224,33 @@ var BlockModelV3 = class BlockModelV3 {
|
|
|
9963
10224
|
prerunArgs(fn) {
|
|
9964
10225
|
return new BlockModelV3({
|
|
9965
10226
|
...this.config,
|
|
9966
|
-
derivePrerunArgs: fn
|
|
10227
|
+
derivePrerunArgs: fn,
|
|
10228
|
+
prerunArgsIssues: void 0
|
|
10229
|
+
});
|
|
10230
|
+
}
|
|
10231
|
+
/**
|
|
10232
|
+
* Sets a function that finds what keeps the block from being staged with the args
|
|
10233
|
+
* {@link prerunArgs} derived (optional). It is called after `prerunArgs()`, with its result
|
|
10234
|
+
* and the data it was built from; not when `prerunArgs()` returned `undefined`, which skips
|
|
10235
|
+
* staging anyway.
|
|
10236
|
+
*
|
|
10237
|
+
* An issue of severity `"error"` keeps the block from being staged; a `"warning"` does not. A
|
|
10238
|
+
* throw, or a result that is not a list of issues, counts as one error carrying the thrown or
|
|
10239
|
+
* parser message. {@link argsIssues} is not consulted for a block with its own prerun args.
|
|
10240
|
+
*
|
|
10241
|
+
* Must be set after `.prerunArgs()`, and is dropped when `.prerunArgs()` is set again.
|
|
10242
|
+
*
|
|
10243
|
+
* @example
|
|
10244
|
+
* .prerunArgs((data) => ({ dataset: data.dataset }))
|
|
10245
|
+
* .prerunArgsIssues(({ prerunArgs }) =>
|
|
10246
|
+
* prerunArgs.dataset === undefined ? [{ severity: 'error', message: 'Select a dataset' }] : [],
|
|
10247
|
+
* )
|
|
10248
|
+
*/
|
|
10249
|
+
prerunArgsIssues(fn) {
|
|
10250
|
+
if (this.config.derivePrerunArgs === void 0) throw new Error("prerunArgsIssues() must be set after prerunArgs(): it checks the prerun args they derive.");
|
|
10251
|
+
return new BlockModelV3({
|
|
10252
|
+
...this.config,
|
|
10253
|
+
prerunArgsIssues: fn
|
|
9967
10254
|
});
|
|
9968
10255
|
}
|
|
9969
10256
|
/**
|
|
@@ -10096,7 +10383,7 @@ var BlockModelV3 = class BlockModelV3 {
|
|
|
10096
10383
|
const pluginRegistry = {};
|
|
10097
10384
|
const pluginHandles = Object.keys(plugins);
|
|
10098
10385
|
for (const handle of pluginHandles) pluginRegistry[handle] = plugins[handle].model.name;
|
|
10099
|
-
const { dataModel, deriveArgs, derivePrerunArgs, deriveTemplateParams, parseInitializationParams } = this.config;
|
|
10386
|
+
const { dataModel, deriveArgs, argsIssues, derivePrerunArgs, prerunArgsIssues, deriveTemplateParams, parseInitializationParams } = this.config;
|
|
10100
10387
|
function getPlugin(handle) {
|
|
10101
10388
|
const plugin = plugins[handle];
|
|
10102
10389
|
if (!plugin) throw new Error(`Plugin model not found for '${handle}'`);
|
|
@@ -10119,8 +10406,18 @@ var BlockModelV3 = class BlockModelV3 {
|
|
|
10119
10406
|
getPluginRegistry: () => pluginRegistry,
|
|
10120
10407
|
createPluginData: (handle) => getPlugin(handle).model.getDefaultData()
|
|
10121
10408
|
}),
|
|
10122
|
-
[BlockStorageFacadeCallbacks.ArgsDerive]: (storageJson) => deriveArgsFromStorage(storageJson,
|
|
10123
|
-
|
|
10409
|
+
[BlockStorageFacadeCallbacks.ArgsDerive]: (storageJson) => deriveArgsFromStorage(storageJson, {
|
|
10410
|
+
deriveArgs,
|
|
10411
|
+
argsIssues
|
|
10412
|
+
}),
|
|
10413
|
+
[BlockStorageFacadeCallbacks.PrerunArgsDerive]: (storageJson) => derivePrerunArgsFromStorage(storageJson, {
|
|
10414
|
+
deriveArgs,
|
|
10415
|
+
argsIssues,
|
|
10416
|
+
ownPrerunArgs: derivePrerunArgs === void 0 ? void 0 : {
|
|
10417
|
+
derivePrerunArgs,
|
|
10418
|
+
prerunArgsIssues
|
|
10419
|
+
}
|
|
10420
|
+
}),
|
|
10124
10421
|
[BlockStorageFacadeCallbacks.InitializationParamsDerive]: (storageJson) => deriveTemplateParamsFromStorage(storageJson, deriveTemplateParams),
|
|
10125
10422
|
[BlockStorageFacadeCallbacks.StorageInitialFromParams]: (paramsJson, blockIdsJson) => createInitialStorageFromParams(paramsJson, blockIdsJson, {
|
|
10126
10423
|
getBlockDataFromParams: (params) => dataModel.getDataFromParams(params),
|
|
@@ -10186,7 +10483,7 @@ var BlockModelV3 = class BlockModelV3 {
|
|
|
10186
10483
|
}
|
|
10187
10484
|
};
|
|
10188
10485
|
//#endregion
|
|
10189
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
10486
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/pframe_utils/axes.js
|
|
10190
10487
|
/** Create id for column copy with added keys in axes domains */
|
|
10191
10488
|
const colId = (id, domains, contextDomains) => {
|
|
10192
10489
|
let wid = id.toString();
|
|
@@ -10292,7 +10589,7 @@ function getAdditionalColumnsForColumn(blockAxes, column) {
|
|
|
10292
10589
|
})];
|
|
10293
10590
|
}
|
|
10294
10591
|
//#endregion
|
|
10295
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
10592
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/columns/column_recipes/leaf_rebrand.js
|
|
10296
10593
|
/**
|
|
10297
10594
|
* Replace every column leaf whose id equals `fromId` with `toId`, leaving
|
|
10298
10595
|
* other column refs (linkers, sub-anchors) intact. Wrapper recipes
|
|
@@ -10960,7 +11257,7 @@ var U = class d {
|
|
|
10960
11257
|
}
|
|
10961
11258
|
};
|
|
10962
11259
|
//#endregion
|
|
10963
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
11260
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/columns/column_providers/providers.js
|
|
10964
11261
|
/**
|
|
10965
11262
|
* Unified memoised factory dispatching to the right provider flavour by the
|
|
10966
11263
|
* source shape:
|
|
@@ -11020,7 +11317,7 @@ var AccessorColumnsProviderImpl = class extends AccessorEntriesProvider {
|
|
|
11020
11317
|
}
|
|
11021
11318
|
getColumns() {
|
|
11022
11319
|
if (this.cachedColumns !== void 0) return this.cachedColumns;
|
|
11023
|
-
return this.cachedColumns = Array.from(this.entries.values()
|
|
11320
|
+
return this.cachedColumns = Array.from(this.entries.values(), DataColumn.fromAccessor).filter((column) => column !== void 0);
|
|
11024
11321
|
}
|
|
11025
11322
|
};
|
|
11026
11323
|
/**
|
|
@@ -11042,14 +11339,14 @@ var ResultPoolColumnsProviderImpl = class extends ResultPoolEntriesProvider {
|
|
|
11042
11339
|
}
|
|
11043
11340
|
getColumns() {
|
|
11044
11341
|
if (this.cachedColumns !== void 0) return this.cachedColumns;
|
|
11045
|
-
return this.cachedColumns = Array.from(this.getPObjectEntries().values()
|
|
11342
|
+
return this.cachedColumns = Array.from(this.getPObjectEntries().values(), DataColumn.fromAccessor).filter((column) => column !== void 0);
|
|
11046
11343
|
}
|
|
11047
11344
|
};
|
|
11048
11345
|
function hashRawPool(rawPool) {
|
|
11049
11346
|
return rawPool.map((b) => `${b.blockId}\x1f${b.prodCtx ?? ""}\x1f${b.stagingCtx ?? ""}\x1f${b.prodIncomplete ? 1 : 0}\x1f${b.stagingIncomplete ? 1 : 0}`).join("");
|
|
11050
11347
|
}
|
|
11051
11348
|
//#endregion
|
|
11052
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
11349
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/columns/column_providers/index.js
|
|
11053
11350
|
/**
|
|
11054
11351
|
* Build the default set of ColumnsProviders for the ambient render ctx:
|
|
11055
11352
|
* - `AccessorColumnsProvider` over `outputs` (if present)
|
|
@@ -11084,26 +11381,7 @@ function isColumnProvider(source) {
|
|
|
11084
11381
|
return typeof p.getColumns === "function" && typeof p.isFinal === "function";
|
|
11085
11382
|
}
|
|
11086
11383
|
//#endregion
|
|
11087
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
11088
|
-
/**
|
|
11089
|
-
* Thrown by leaf-recipe factories when the requested column is provably
|
|
11090
|
-
* absent in the active render ctx — i.e. every relevant accessor reports
|
|
11091
|
-
* `inputsLocked` and the column did not appear. Distinct from the
|
|
11092
|
-
* `undefined` return that the factories still use for the "resolving" case
|
|
11093
|
-
* (the column may still appear later).
|
|
11094
|
-
*
|
|
11095
|
-
* Catch at the boundary (resolver / filter+sort wiring / data-table assembly)
|
|
11096
|
-
* when partial absence should be surfaced to the user rather than silently
|
|
11097
|
-
* producing an empty result.
|
|
11098
|
-
*/
|
|
11099
|
-
var ColumnAbsentError = class extends Error {
|
|
11100
|
-
id;
|
|
11101
|
-
constructor(id) {
|
|
11102
|
-
super(`Column is absent in the active render ctx and will not appear: ${id}`);
|
|
11103
|
-
this.id = id;
|
|
11104
|
-
this.name = "ColumnAbsentError";
|
|
11105
|
-
}
|
|
11106
|
-
};
|
|
11384
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/columns/data_column.js
|
|
11107
11385
|
/**
|
|
11108
11386
|
* The leaf-recipe building block: a {@link DataColumnRecipe} whose `id` is a bare
|
|
11109
11387
|
* {@link PObjectId} and whose readers are bound to a single tree-accessor
|
|
@@ -11156,29 +11434,15 @@ var DataColumnImpl = class DataColumnImpl {
|
|
|
11156
11434
|
}
|
|
11157
11435
|
/**
|
|
11158
11436
|
* Resolve via the ambient {@link ColumnRegistry}. Spec is resolved eagerly:
|
|
11159
|
-
* returns `undefined`
|
|
11160
|
-
*
|
|
11161
|
-
*
|
|
11437
|
+
* returns `undefined` unless the id names a column whose spec is readable in
|
|
11438
|
+
* this ctx — while it is resolving, when it is absent, and when the id names
|
|
11439
|
+
* an export that is not a column (a `kind: "File"` object, for example).
|
|
11162
11440
|
* Data and dataStatus stay lazy.
|
|
11163
11441
|
*/
|
|
11164
11442
|
static fromId(id, { ctx } = {}) {
|
|
11165
|
-
const
|
|
11166
|
-
|
|
11167
|
-
|
|
11168
|
-
if (registry.isFinal()) throw new ColumnAbsentError(id);
|
|
11169
|
-
return;
|
|
11170
|
-
}
|
|
11171
|
-
const spec = readSpecAccessor(leaf);
|
|
11172
|
-
if (isNil(spec)) {
|
|
11173
|
-
if (leaf.accessor.getInputsLocked()) throw new ColumnAbsentError(id);
|
|
11174
|
-
return;
|
|
11175
|
-
}
|
|
11176
|
-
if (!spec.hasData()) return void 0;
|
|
11177
|
-
return new DataColumnImpl(id, {
|
|
11178
|
-
getSpec: () => spec.getDataAsJson(),
|
|
11179
|
-
getData: () => readDataAccessor(leaf),
|
|
11180
|
-
getDataStatus: () => readDataStatus(leaf)
|
|
11181
|
-
});
|
|
11443
|
+
const leaf = new ColumnRegistry(getCtxProviders({ ctx })).resolve(id);
|
|
11444
|
+
if (isNil(leaf)) return void 0;
|
|
11445
|
+
return DataColumnImpl.fromAccessor(leaf);
|
|
11182
11446
|
}
|
|
11183
11447
|
/** {@link PlRef} wrapper over {@link fromId}. */
|
|
11184
11448
|
static fromPlRef(ref) {
|
|
@@ -11186,18 +11450,15 @@ var DataColumnImpl = class DataColumnImpl {
|
|
|
11186
11450
|
}
|
|
11187
11451
|
/**
|
|
11188
11452
|
* Bind directly to an accessor-backed {@link LeafEntry} — no registry.
|
|
11189
|
-
*
|
|
11190
|
-
*
|
|
11453
|
+
* Returns `undefined` unless the leaf's spec is readable and is a column
|
|
11454
|
+
* spec: while the spec is resolving, when it is absent, and for an export
|
|
11455
|
+
* that is not a column.
|
|
11191
11456
|
*/
|
|
11192
11457
|
static fromAccessor(entry) {
|
|
11193
|
-
const spec =
|
|
11194
|
-
if (
|
|
11195
|
-
if (entry.accessor.getInputsLocked()) throw new ColumnAbsentError(entry.id);
|
|
11196
|
-
return;
|
|
11197
|
-
}
|
|
11198
|
-
if (!spec.hasData()) return void 0;
|
|
11458
|
+
const spec = readSpec(entry);
|
|
11459
|
+
if (spec === void 0 || !isPColumnSpec(spec)) return void 0;
|
|
11199
11460
|
return new DataColumnImpl(entry.id, {
|
|
11200
|
-
getSpec: () => spec
|
|
11461
|
+
getSpec: () => spec,
|
|
11201
11462
|
getData: () => readDataAccessor(entry),
|
|
11202
11463
|
getDataStatus: () => readDataStatus(entry)
|
|
11203
11464
|
});
|
|
@@ -11219,7 +11480,9 @@ var DataColumnImpl = class DataColumnImpl {
|
|
|
11219
11480
|
* Distinguishes `present` / `resolving` / `absent` for a {@link PObjectId}
|
|
11220
11481
|
* in the active render ctx. Falls back to the registry's `isFinal()`
|
|
11221
11482
|
* when the id has no entry — only then we can say `absent` instead of
|
|
11222
|
-
* `resolving`.
|
|
11483
|
+
* `resolving`. The status tells only whether the spec is readable: for an
|
|
11484
|
+
* export that is not a column it is `present`, and the factories return
|
|
11485
|
+
* `undefined`.
|
|
11223
11486
|
*/
|
|
11224
11487
|
static getStatusById(id, { ctx } = {}) {
|
|
11225
11488
|
const registry = new ColumnRegistry(getCtxProviders({ ctx }));
|
|
@@ -11288,6 +11551,12 @@ const readSpecAccessor = memoizeByEntry(({ accessor, name }) => accessor.travers
|
|
|
11288
11551
|
assertFieldType: "Input",
|
|
11289
11552
|
ignoreError: true
|
|
11290
11553
|
}));
|
|
11554
|
+
/** The leaf's spec, or `undefined` until the spec resource has data. */
|
|
11555
|
+
const readSpec = memoizeByEntry((entry) => {
|
|
11556
|
+
const spec = readSpecAccessor(entry);
|
|
11557
|
+
if (isNil(spec) || !spec.hasData()) return void 0;
|
|
11558
|
+
return spec.getDataAsJson();
|
|
11559
|
+
});
|
|
11291
11560
|
/**
|
|
11292
11561
|
* Per-entry counterpart to {@link readDataStatus}: tells whether the leaf's
|
|
11293
11562
|
* **spec** can be read in this ctx, and — for the negative cases —
|
|
@@ -11324,7 +11593,7 @@ function memoizeByEntry(fn) {
|
|
|
11324
11593
|
};
|
|
11325
11594
|
}
|
|
11326
11595
|
//#endregion
|
|
11327
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
11596
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/columns/column_recipes/column_overrided_recipe.js
|
|
11328
11597
|
/**
|
|
11329
11598
|
* Recipe wrapper that overlays {@link SpecOverrides} on top of any other
|
|
11330
11599
|
* recipe. The id is `ColumnOverriddenKey { source: inner.id, specOverrides }`.
|
|
@@ -11462,7 +11731,7 @@ var DataColumnOverriddenRecipe = class extends ColumnOverriddenRecipe {
|
|
|
11462
11731
|
}
|
|
11463
11732
|
};
|
|
11464
11733
|
//#endregion
|
|
11465
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
11734
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/columns/column_recipes/column_filtered_recipe.js
|
|
11466
11735
|
/**
|
|
11467
11736
|
* Recipe wrapper that fixes the values of selected axes of an inner recipe
|
|
11468
11737
|
* (axis slicing). The id is `FilteredPColumnId { source: inner.id,
|
|
@@ -11588,7 +11857,7 @@ function toAxisSelector(axis) {
|
|
|
11588
11857
|
return selector;
|
|
11589
11858
|
}
|
|
11590
11859
|
//#endregion
|
|
11591
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
11860
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/columns/column_recipes/index.js
|
|
11592
11861
|
/**
|
|
11593
11862
|
* Build a `ColumnRecipe` from a stringified id. Dispatches to the matching
|
|
11594
11863
|
* concrete recipe variant based on the id's encoding and recurses on
|
|
@@ -11626,8 +11895,8 @@ function ColumnRecipeBuild(id, opts = {}) {
|
|
|
11626
11895
|
* Resolution status counterpart to {@link ColumnRecipeBuild}. Dispatches on
|
|
11627
11896
|
* the parsed id shape to the matching `getStatusBy*` static — never
|
|
11628
11897
|
* constructs the recipe. Use this at boundaries (resolver, filter/sort
|
|
11629
|
-
* targets) to
|
|
11630
|
-
*
|
|
11898
|
+
* targets) to tell an `absent` column from a `resolving` one: the recipe
|
|
11899
|
+
* factory returns `undefined` for both.
|
|
11631
11900
|
*/
|
|
11632
11901
|
function ColumnRecipeGetStatus(id, opts = {}) {
|
|
11633
11902
|
const parsed = parseColumnIdSafely(id);
|
|
@@ -11639,7 +11908,7 @@ function ColumnRecipeGetStatus(id, opts = {}) {
|
|
|
11639
11908
|
}
|
|
11640
11909
|
const ColumnRecipe = Object.assign(ColumnRecipeBuild, { getStatus: ColumnRecipeGetStatus });
|
|
11641
11910
|
//#endregion
|
|
11642
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
11911
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/columns/column_recipes/column_discovered_recipe.js
|
|
11643
11912
|
/**
|
|
11644
11913
|
* Recipe for columns identified by a {@link ColumnDiscoveredKey}: a base
|
|
11645
11914
|
* column + a `path` of linkers + qualifications.
|
|
@@ -11810,7 +12079,7 @@ function referencedUniIdsOf(key) {
|
|
|
11810
12079
|
return /* @__PURE__ */ new Set([key.column, ...(key.path ?? []).map((item) => item.column)]);
|
|
11811
12080
|
}
|
|
11812
12081
|
//#endregion
|
|
11813
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
12082
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/columns/column.js
|
|
11814
12083
|
/**
|
|
11815
12084
|
* Unified entry point — routes between the two top-level dispatchers:
|
|
11816
12085
|
* - string id (`PObjectId` / `ColumnUniversalId`) → {@link ColumnRecipe}
|
|
@@ -11824,7 +12093,7 @@ function Column(source, opts) {
|
|
|
11824
12093
|
return DataColumn(source, opts);
|
|
11825
12094
|
}
|
|
11826
12095
|
//#endregion
|
|
11827
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
12096
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/columns/columns_collection.js
|
|
11828
12097
|
/**
|
|
11829
12098
|
* Build a {@link ColumnsCollection} from sandbox-side source descriptors.
|
|
11830
12099
|
* Resolves the `columnsCollection` driver (either from `deps.driver` or via
|
|
@@ -11933,7 +12202,35 @@ function defaultCtxSources(ctx) {
|
|
|
11933
12202
|
return [...currentBlockSources(ctx), { kind: "result_pool" }];
|
|
11934
12203
|
}
|
|
11935
12204
|
//#endregion
|
|
11936
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
12205
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/columns/peer_links.js
|
|
12206
|
+
/** Main axes of the datasets: the second axis of every column marked `pl7.app/isAnchor`. */
|
|
12207
|
+
function collectDatasetAxes(specs) {
|
|
12208
|
+
return new Set(specs.flatMap((spec) => {
|
|
12209
|
+
const main = spec.axesSpec[1];
|
|
12210
|
+
return readAnnotation(spec, Annotation.IsAnchor) === "true" && main !== void 0 ? [canonicalizeAxisId(main)] : [];
|
|
12211
|
+
}));
|
|
12212
|
+
}
|
|
12213
|
+
/** {@link collectDatasetAxes} over the result pool. */
|
|
12214
|
+
function getResultPoolDatasetAxes() {
|
|
12215
|
+
return collectDatasetAxes(ResultPoolColumnsProvider().getColumns().map((c) => c.getSpec()));
|
|
12216
|
+
}
|
|
12217
|
+
/**
|
|
12218
|
+
* Labels of the peer links on a linker path. A peer link joins two datasets' main axes, e.g. one
|
|
12219
|
+
* clonotype to another, so the columns behind it describe a different clonotype than the row.
|
|
12220
|
+
*/
|
|
12221
|
+
function findPeerLinks(linkers, datasetAxes) {
|
|
12222
|
+
return uniq(linkers.flatMap((l) => {
|
|
12223
|
+
const peer = l.axesSpec.every((a) => datasetAxes.has(canonicalizeAxisId(a)));
|
|
12224
|
+
const label = readAnnotation(l, Annotation.LinkLabel) ?? readAnnotation(l, Annotation.Label);
|
|
12225
|
+
return peer && label ? [label] : [];
|
|
12226
|
+
}));
|
|
12227
|
+
}
|
|
12228
|
+
/** Hover text for the link icon. */
|
|
12229
|
+
function describePeerLinks(links) {
|
|
12230
|
+
return `Reached via ${links.join(", then ")}`;
|
|
12231
|
+
}
|
|
12232
|
+
//#endregion
|
|
12233
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/columns/utils.js
|
|
11937
12234
|
/**
|
|
11938
12235
|
* PObjectIds of every non-hit column referenced by `recipe.getQuery()`,
|
|
11939
12236
|
* deduped in traversal order. The hit column is
|
|
@@ -12064,7 +12361,7 @@ function hasSingleDataColumn(recipe) {
|
|
|
12064
12361
|
return recipe.getReferencedIds().length === 1;
|
|
12065
12362
|
}
|
|
12066
12363
|
//#endregion
|
|
12067
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
12364
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/pframe_utils/columns.js
|
|
12068
12365
|
function getAllRelatedColumns(ctx, predicate) {
|
|
12069
12366
|
const columns = new PColumnCollection();
|
|
12070
12367
|
columns.addColumnProvider(ctx.resultPool);
|
|
@@ -12140,7 +12437,7 @@ function discoverIntegrableColumnIds(ctx, rootColumns) {
|
|
|
12140
12437
|
}
|
|
12141
12438
|
}
|
|
12142
12439
|
//#endregion
|
|
12143
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
12440
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/components/PFrameForGraphs.js
|
|
12144
12441
|
function isHiddenFromGraphColumn(column) {
|
|
12145
12442
|
return !!readAnnotationJson(column, Annotation.HideDataFromGraphs);
|
|
12146
12443
|
}
|
|
@@ -12169,7 +12466,7 @@ function createPFrameForGraphs(ctx, blockColumns) {
|
|
|
12169
12466
|
}));
|
|
12170
12467
|
}
|
|
12171
12468
|
//#endregion
|
|
12172
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
12469
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/components/PlDatasetSelector/filter_discovery.js
|
|
12173
12470
|
/**
|
|
12174
12471
|
* Matches columns annotated `pl7.app/isSubset: "true"` whose axes ⊆ anchor axes.
|
|
12175
12472
|
*
|
|
@@ -12221,7 +12518,7 @@ function buildRefMap(entries) {
|
|
|
12221
12518
|
return new Map(entries.map((e) => [(0, import_canonicalize.default)(e.ref), e.ref]));
|
|
12222
12519
|
}
|
|
12223
12520
|
//#endregion
|
|
12224
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
12521
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/components/PlDatasetSelector/enrichment_discovery.js
|
|
12225
12522
|
/**
|
|
12226
12523
|
* Linker-reached hits attached to the anchor primary. Drops zero-hop variants
|
|
12227
12524
|
* (filters / the primary itself) and structural hits (subset, linker, label
|
|
@@ -12281,7 +12578,7 @@ function enrichmentVariantsToRefs(variants, labelOptions) {
|
|
|
12281
12578
|
});
|
|
12282
12579
|
}
|
|
12283
12580
|
//#endregion
|
|
12284
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
12581
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/components/PlDatasetSelector/build_dataset_options.js
|
|
12285
12582
|
function toPredicate(opt) {
|
|
12286
12583
|
if (opt === void 0) return () => true;
|
|
12287
12584
|
return typeof opt === "function" ? opt : multiColumnSelectorsToPredicate(opt);
|
|
@@ -12295,7 +12592,7 @@ function toPredicate(opt) {
|
|
|
12295
12592
|
function buildDatasetOptions(ctx, opts) {
|
|
12296
12593
|
const primaryPredicate = toPredicate(opts?.primary);
|
|
12297
12594
|
const filterPredicate = toPredicate(opts?.filter);
|
|
12298
|
-
const options = ctx.resultPool.getOptions(primaryPredicate, { refsWithEnrichments: opts?.requireEnrichments ?? true });
|
|
12595
|
+
const options = ctx.resultPool.getOptions((spec) => isPColumnSpec(spec) && primaryPredicate(spec), { refsWithEnrichments: opts?.requireEnrichments ?? true });
|
|
12299
12596
|
if (options.length === 0) return [];
|
|
12300
12597
|
const refMap = buildRefMap(ctx.resultPool.getSpecs().entries);
|
|
12301
12598
|
const withEnrichments = opts?.withEnrichments ?? false;
|
|
@@ -12331,7 +12628,7 @@ function buildDatasetOptions(ctx, opts) {
|
|
|
12331
12628
|
});
|
|
12332
12629
|
}
|
|
12333
12630
|
//#endregion
|
|
12334
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
12631
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/filters/traverse.js
|
|
12335
12632
|
/**
|
|
12336
12633
|
* Recursively traverses a FilterSpec tree bottom-up, applying visitor callbacks.
|
|
12337
12634
|
*
|
|
@@ -12370,7 +12667,7 @@ function collectFilterSpecColumns(filter) {
|
|
|
12370
12667
|
});
|
|
12371
12668
|
}
|
|
12372
12669
|
//#endregion
|
|
12373
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
12670
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/filters/converters/filterToQuery.js
|
|
12374
12671
|
/** Converts a QueryColumnId object into a SpecQueryExpression reference. */
|
|
12375
12672
|
function resolveColumnRef(col) {
|
|
12376
12673
|
return col.type === "axis" ? {
|
|
@@ -12757,7 +13054,7 @@ function isEmpty(value) {
|
|
|
12757
13054
|
return true;
|
|
12758
13055
|
}
|
|
12759
13056
|
//#endregion
|
|
12760
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
13057
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/filters/distill.js
|
|
12761
13058
|
/**
|
|
12762
13059
|
* Strips non-FilterSpec metadata (whitelist approach) and removes
|
|
12763
13060
|
* unfilled leaves (type is undefined or any required field is undefined).
|
|
@@ -12862,7 +13159,7 @@ const REQUIRED_KEYS_BY_TYPE = {
|
|
|
12862
13159
|
greaterThanColumnOrEqual: ["column", "rhs"]
|
|
12863
13160
|
};
|
|
12864
13161
|
//#endregion
|
|
12865
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
13162
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/components/PlDataTable/state-migration.js
|
|
12866
13163
|
/** Upgrade PlDataTableStateV2 to the latest version */
|
|
12867
13164
|
function upgradePlDataTableStateV2(state) {
|
|
12868
13165
|
if (!state) return createPlDataTableStateV2();
|
|
@@ -13220,7 +13517,7 @@ function parseLegacyLeafColumn(s) {
|
|
|
13220
13517
|
return parsed;
|
|
13221
13518
|
}
|
|
13222
13519
|
//#endregion
|
|
13223
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
13520
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/utils.js
|
|
13224
13521
|
/** Adapt a {@link ColumnRecipe} to the plain {@link RuleColumn} shape. */
|
|
13225
13522
|
function toRuleColumn(col) {
|
|
13226
13523
|
return {
|
|
@@ -13314,11 +13611,12 @@ function deriveAllLabels(options) {
|
|
|
13314
13611
|
return deriveDistinctLabels(columns.map((c) => ({
|
|
13315
13612
|
spec: c.spec,
|
|
13316
13613
|
linkerPath: c.linkerPath?.map((step) => ({ spec: step.linker.spec })),
|
|
13317
|
-
qualifications: c.qualifications
|
|
13614
|
+
qualifications: c.qualifications,
|
|
13615
|
+
marker: c.marker
|
|
13318
13616
|
})), deriveLabelsOptions).reduce((acc, label, index) => (acc[columns[index].id] = label, acc), {});
|
|
13319
13617
|
}
|
|
13320
13618
|
//#endregion
|
|
13321
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
13619
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/createPTableDefV3.js
|
|
13322
13620
|
/**
|
|
13323
13621
|
* Assemble a ptable def directly from recipes. Each secondary recipe is its own
|
|
13324
13622
|
* outer-joined subtree: `getQuery()` encodes its linker chain, and its
|
|
@@ -13382,7 +13680,7 @@ function columnToJoinEntry(col, qualifications) {
|
|
|
13382
13680
|
};
|
|
13383
13681
|
}
|
|
13384
13682
|
//#endregion
|
|
13385
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
13683
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/components/PlDataTable/columnResolver.js
|
|
13386
13684
|
function createColumnResolver(columns) {
|
|
13387
13685
|
const axisIds = [];
|
|
13388
13686
|
for (const c of columns) for (const ax of c.getSpec().axesSpec) axisIds.push(getAxisId(ax));
|
|
@@ -13404,7 +13702,7 @@ function createColumnResolver(columns) {
|
|
|
13404
13702
|
};
|
|
13405
13703
|
}
|
|
13406
13704
|
//#endregion
|
|
13407
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
13705
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/discoverColumns.js
|
|
13408
13706
|
/**
|
|
13409
13707
|
* Discover columns from sources/anchors and split them into primary
|
|
13410
13708
|
* (direct anchor hits — zero-hop, query is a bare column) and secondary
|
|
@@ -13450,7 +13748,7 @@ function discoverLabelColumns(ctx, primary) {
|
|
|
13450
13748
|
}).getColumns();
|
|
13451
13749
|
}
|
|
13452
13750
|
//#endregion
|
|
13453
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.
|
|
13751
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.88.0/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/createPlDataTableV3.js
|
|
13454
13752
|
function createPlDataTableV3(ctx, options) {
|
|
13455
13753
|
const state = upgradePlDataTableStateV2(options.tableState);
|
|
13456
13754
|
const primaryJoinType = options.primaryJoinType ?? "full";
|
|
@@ -13459,8 +13757,13 @@ function createPlDataTableV3(ctx, options) {
|
|
|
13459
13757
|
const { primary, secondary } = resolved;
|
|
13460
13758
|
if (primary.length === 0) return void 0;
|
|
13461
13759
|
const { direct, linked } = splitByTopology(secondary);
|
|
13760
|
+
const labelable = [...primary, ...secondary].map(toLabelableColumn);
|
|
13761
|
+
const linkHints = collectLinkHints(labelable);
|
|
13462
13762
|
const derivedLabels = deriveAllLabels({
|
|
13463
|
-
columns:
|
|
13763
|
+
columns: labelable.filter((c) => !isColumnHidden(c.spec)).map((c) => ({
|
|
13764
|
+
...c,
|
|
13765
|
+
marker: linkHints.get(c.id)
|
|
13766
|
+
})),
|
|
13464
13767
|
deriveLabelsOptions: {
|
|
13465
13768
|
includeNativeLabel: true,
|
|
13466
13769
|
...options.labelsOptions
|
|
@@ -13533,6 +13836,7 @@ function createPlDataTableV3(ctx, options) {
|
|
|
13533
13836
|
],
|
|
13534
13837
|
primaryColumns: primary,
|
|
13535
13838
|
derivedLabels,
|
|
13839
|
+
linkHints,
|
|
13536
13840
|
visibilityByColId,
|
|
13537
13841
|
orderByColId
|
|
13538
13842
|
});
|
|
@@ -13574,6 +13878,15 @@ function splitByTopology(columns) {
|
|
|
13574
13878
|
function collectLinkerSnapshots(linked) {
|
|
13575
13879
|
return uniqueBy(linked.flatMap((c) => collectLinkerColumns(c)), (c) => c.id);
|
|
13576
13880
|
}
|
|
13881
|
+
/** Link icon hover text per column, for columns reached through at least one peer link. */
|
|
13882
|
+
function collectLinkHints(columns) {
|
|
13883
|
+
if (!columns.some((c) => c.linkerPath?.length)) return /* @__PURE__ */ new Map();
|
|
13884
|
+
const datasetAxes = getResultPoolDatasetAxes();
|
|
13885
|
+
return new Map(columns.flatMap((c) => {
|
|
13886
|
+
const links = findPeerLinks(c.linkerPath?.map((step) => step.linker.spec) ?? [], datasetAxes);
|
|
13887
|
+
return links.length > 0 ? [[c.id, describePeerLinks(links)]] : [];
|
|
13888
|
+
}));
|
|
13889
|
+
}
|
|
13577
13890
|
function toLabelableColumn(col) {
|
|
13578
13891
|
return {
|
|
13579
13892
|
id: col.id,
|
|
@@ -13594,7 +13907,7 @@ function toLabelableColumn(col) {
|
|
|
13594
13907
|
* The UI overlays this onto the engine-emitted specs at render time.
|
|
13595
13908
|
*/
|
|
13596
13909
|
function buildColumnsMeta(params) {
|
|
13597
|
-
const { fullColumns, visibleColumns, primaryColumns, derivedLabels } = params;
|
|
13910
|
+
const { fullColumns, visibleColumns, primaryColumns, derivedLabels, linkHints } = params;
|
|
13598
13911
|
const { visibilityByColId, orderByColId } = params;
|
|
13599
13912
|
const visibleStatus = buildDataStatusMap(visibleColumns);
|
|
13600
13913
|
const columns = fullColumns.reduce((acc, c) => {
|
|
@@ -13603,7 +13916,8 @@ function buildColumnsMeta(params) {
|
|
|
13603
13916
|
label: derivedLabels[c.id],
|
|
13604
13917
|
visibility: getEffectiveVisibility(rc, visibilityByColId),
|
|
13605
13918
|
order: getOrderPriority(rc, orderByColId),
|
|
13606
|
-
status: visibleStatus[c.id]
|
|
13919
|
+
status: visibleStatus[c.id],
|
|
13920
|
+
linkHint: linkHints.get(c.id)
|
|
13607
13921
|
};
|
|
13608
13922
|
return acc;
|
|
13609
13923
|
}, {});
|
|
@@ -13879,6 +14193,11 @@ const LANDSCAPE_SCORE_REF = "pl7.app/repertoire/landscapeScoreRef";
|
|
|
13879
14193
|
const MUTATION_ID_AXIS = "pl7.app/repertoire/mutationId";
|
|
13880
14194
|
const MUTATION_VARIANT_LINK = "pl7.app/repertoire/mutationVariantLink";
|
|
13881
14195
|
const BROWSABLE_MUTATION = "pl7.app/repertoire/browsableMutation";
|
|
14196
|
+
const LANDSCAPE_ERROR = "pl7.app/repertoire/singleMutantError";
|
|
14197
|
+
const LANDSCAPE_NT_VARIANTS = "pl7.app/repertoire/singleMutantNtVariants";
|
|
14198
|
+
const LANDSCAPE_SCORE_INDEX_DOMAIN = "pl7.app/repertoire/landscapeScore";
|
|
14199
|
+
const LANDSCAPE_ERROR_COLUMN = "pl7.app/repertoire/landscapeScoreErrorColumn";
|
|
14200
|
+
const LANDSCAPE_NT_VARIANTS_COLUMN = "pl7.app/repertoire/landscapeScoreNtVariantsColumn";
|
|
13882
14201
|
//#endregion
|
|
13883
14202
|
//#region ../model/dist/drill-down-table.js
|
|
13884
14203
|
/**
|
|
@@ -13933,13 +14252,18 @@ function drillDownTableModel(ctx) {
|
|
|
13933
14252
|
visibility: "default"
|
|
13934
14253
|
}
|
|
13935
14254
|
];
|
|
13936
|
-
if (activeScoreSpec !== void 0)
|
|
13937
|
-
|
|
13938
|
-
|
|
13939
|
-
|
|
13940
|
-
|
|
13941
|
-
|
|
13942
|
-
|
|
14255
|
+
if (activeScoreSpec !== void 0) {
|
|
14256
|
+
const scoreDomain = Object.fromEntries(Object.entries(activeScoreSpec.domain ?? {}).map(([k, v]) => [k, exactMatch(v)]));
|
|
14257
|
+
const landscapeCol = outputPColumns(ctx, "singleMutantHeatmapPf")?.find((c) => c.spec.name === "pl7.app/repertoire/singleMutantValue" && c.spec.annotations?.["pl7.app/repertoire/landscapeScoreRef"] === scoreKey);
|
|
14258
|
+
const companionNames = [LANDSCAPE_ERROR_COLUMN, LANDSCAPE_NT_VARIANTS_COLUMN].map((key) => landscapeCol?.spec.annotations?.[key]).filter((name) => name !== void 0);
|
|
14259
|
+
for (const name of [activeScoreSpec.name, ...companionNames]) visibility.push({
|
|
14260
|
+
match: {
|
|
14261
|
+
name: exactMatch(name),
|
|
14262
|
+
domain: scoreDomain
|
|
14263
|
+
},
|
|
14264
|
+
visibility: "default"
|
|
14265
|
+
});
|
|
14266
|
+
}
|
|
13943
14267
|
visibility.push({
|
|
13944
14268
|
match: { name: ".*" },
|
|
13945
14269
|
visibility: "optional"
|
|
@@ -14103,19 +14427,27 @@ function drillDownLabel(mutationId, scoreLabel) {
|
|
|
14103
14427
|
* Shared by the `landscapePanels` output and by `.sections()`, which needs the same list to name
|
|
14104
14428
|
* one page per score — two derivations of "which charts exist" would drift the moment one of
|
|
14105
14429
|
* them changed.
|
|
14430
|
+
*
|
|
14431
|
+
* `labelByRef` maps a score's ref to its picker label. The workflow stamps each column with the
|
|
14432
|
+
* score's own native label, which two sibling blocks share. The picker already told them apart, so
|
|
14433
|
+
* its label is used when given, and the stamped one is the fallback.
|
|
14106
14434
|
*/
|
|
14107
|
-
function landscapePanelsFrom(pCols) {
|
|
14435
|
+
function landscapePanelsFrom(pCols, labelByRef) {
|
|
14108
14436
|
if (pCols === void 0) return void 0;
|
|
14109
14437
|
const panels = [];
|
|
14110
14438
|
for (const col of pCols) {
|
|
14111
14439
|
if (col.spec.name !== "pl7.app/repertoire/singleMutantValue") continue;
|
|
14112
14440
|
const key = col.spec.annotations?.[LANDSCAPE_SCORE_REF];
|
|
14113
14441
|
if (key === void 0) continue;
|
|
14442
|
+
const scoreIndex = col.spec.domain?.[LANDSCAPE_SCORE_INDEX_DOMAIN];
|
|
14443
|
+
const companion = (name) => pCols.find((c) => c.spec.name === name && c.spec.domain?.["pl7.app/repertoire/landscapeScore"] === scoreIndex)?.spec;
|
|
14114
14444
|
panels.push({
|
|
14115
14445
|
key,
|
|
14116
|
-
label: col.spec.annotations?.["pl7.app/label"] ?? "Score",
|
|
14446
|
+
label: labelByRef?.get(key) ?? col.spec.annotations?.["pl7.app/label"] ?? "Score",
|
|
14117
14447
|
index: Number(col.spec.annotations?.["pl7.app/repertoire/landscapeScoreIndex"] ?? "0"),
|
|
14118
|
-
spec: col.spec
|
|
14448
|
+
spec: col.spec,
|
|
14449
|
+
errorSpec: companion(LANDSCAPE_ERROR),
|
|
14450
|
+
ntVariantsSpec: companion(LANDSCAPE_NT_VARIANTS)
|
|
14119
14451
|
});
|
|
14120
14452
|
}
|
|
14121
14453
|
panels.sort((a, b) => a.index - b.index);
|
|
@@ -14163,7 +14495,7 @@ function runColumnOptions(entries, inputFilter) {
|
|
|
14163
14495
|
const stamp = subsetStampOf(e.spec);
|
|
14164
14496
|
return stamp === void 0 || stamp === inputFilter;
|
|
14165
14497
|
});
|
|
14166
|
-
const labels = deriveDistinctLabels(fitting.map((e) => e.spec));
|
|
14498
|
+
const labels = deriveDistinctLabels(fitting.map((e) => e.spec), { includeNativeLabel: true });
|
|
14167
14499
|
return fitting.map((e, i) => ({
|
|
14168
14500
|
label: labels[i] ?? e.id,
|
|
14169
14501
|
value: e.id,
|
|
@@ -14182,17 +14514,57 @@ function landscapeHref(scoreKey) {
|
|
|
14182
14514
|
function landscapeLabel(scoreLabel) {
|
|
14183
14515
|
return `Landscape · ${scoreLabel}`;
|
|
14184
14516
|
}
|
|
14185
|
-
/**
|
|
14186
|
-
|
|
14517
|
+
/**
|
|
14518
|
+
* score id -> display label, from the columns the last run produced.
|
|
14519
|
+
*
|
|
14520
|
+
* `labelByRef` carries the picker labels, which tell sibling blocks' same-named scores apart. It is
|
|
14521
|
+
* preferred per score; the column's stamped label is the fallback. See {@link landscapePanelsFrom}.
|
|
14522
|
+
*/
|
|
14523
|
+
function scoreLabelsByKey(pCols, labelByRef) {
|
|
14187
14524
|
const labels = {};
|
|
14188
14525
|
for (const col of pCols ?? []) {
|
|
14189
14526
|
if (col.spec.name !== "pl7.app/repertoire/singleMutantValue") continue;
|
|
14190
14527
|
const key = col.spec.annotations?.[LANDSCAPE_SCORE_REF];
|
|
14191
|
-
const label = col.spec.annotations?.["pl7.app/label"];
|
|
14528
|
+
const label = labelByRef?.get(key ?? "") ?? col.spec.annotations?.["pl7.app/label"];
|
|
14192
14529
|
if (key !== void 0 && label !== void 0) labels[key] = label;
|
|
14193
14530
|
}
|
|
14194
14531
|
return labels;
|
|
14195
14532
|
}
|
|
14533
|
+
/**
|
|
14534
|
+
* Score picker options from the result pool.
|
|
14535
|
+
*
|
|
14536
|
+
* Shared by the `scoreOptions` output and by section / panel naming, so a score's page is named by
|
|
14537
|
+
* the same label the user picked it under, and the two cannot drift.
|
|
14538
|
+
*
|
|
14539
|
+
* Discovered via discover() (not getCanonicalOptions — see roundFrequencyOptions for why) anchored
|
|
14540
|
+
* on the state matrix. The anchor name `main` must match the workflow's `bb.addAnchor(...)`.
|
|
14541
|
+
*
|
|
14542
|
+
* Numeric only — a cell holds one variant's score. NOT restricted to `pl7.app/isScore`: no shipped
|
|
14543
|
+
* block emits a variant-keyed column carrying that annotation yet (repertoire-score is
|
|
14544
|
+
* clonotype-keyed), so filtering on it would leave the dropdown empty. Revisit once the bin-score
|
|
14545
|
+
* block lands.
|
|
14546
|
+
*/
|
|
14547
|
+
function computeScoreOptions(ctx) {
|
|
14548
|
+
const stateMatrixRef = ctx.data.stateMatrixRef;
|
|
14549
|
+
if (stateMatrixRef === void 0) return void 0;
|
|
14550
|
+
const stateSpec = poolSpecByRef(ctx, stateMatrixRef);
|
|
14551
|
+
if (!stateSpec) return void 0;
|
|
14552
|
+
const columns = ColumnsCollection(["result_pool"]).discover({
|
|
14553
|
+
anchors: { main: stateSpec },
|
|
14554
|
+
mode: "enrichment",
|
|
14555
|
+
maxHops: 0,
|
|
14556
|
+
exclude: [{ annotations: { "pl7.app/isLinkerColumn": exactMatch("true") } }]
|
|
14557
|
+
}).getColumns();
|
|
14558
|
+
const variantAxisName = stateSpec.axesSpec[0]?.name;
|
|
14559
|
+
return runColumnOptions(dedupByLeafId(columns.filter((recipe) => isLandscapeScoreColumn(recipe.getSpec(), variantAxisName))).map((recipe) => ({
|
|
14560
|
+
id: recipe.id,
|
|
14561
|
+
spec: recipe.getSpec()
|
|
14562
|
+
})), inputFilterOf(ctx.data));
|
|
14563
|
+
}
|
|
14564
|
+
/** ref -> picker label for the discovered scores. See {@link computeScoreOptions}. */
|
|
14565
|
+
function scoreLabelByRefFrom(ctx) {
|
|
14566
|
+
return new Map((computeScoreOptions(ctx) ?? []).map((o) => [o.value, o.label]));
|
|
14567
|
+
}
|
|
14196
14568
|
function drillDownHref(mutationId) {
|
|
14197
14569
|
return `/drilldown?m=${encodeURIComponent(mutationId)}`;
|
|
14198
14570
|
}
|
|
@@ -14217,6 +14589,11 @@ const dataModel = new DataModelBuilder({ kind }).from("v1").migrate("v2", (v1) =
|
|
|
14217
14589
|
...v5,
|
|
14218
14590
|
...mapChartStates(v5, withYAnnotationTitleAtBottom),
|
|
14219
14591
|
drillDownChartState: withYAnnotationTitleAtBottom(v5.drillDownChartState)
|
|
14592
|
+
})).migrate("v7", (v6) => ({
|
|
14593
|
+
...v6,
|
|
14594
|
+
singleMutantHeatmapState: withErrorOpacityRange(v6.singleMutantHeatmapState),
|
|
14595
|
+
singleMutantHeatmapStates: Object.fromEntries(Object.entries(v6.singleMutantHeatmapStates).map(([key, state]) => [key, withErrorOpacityRange(state)])),
|
|
14596
|
+
drillDownChartState: withErrorOpacityRange(v6.drillDownChartState)
|
|
14220
14597
|
})).init(() => ({
|
|
14221
14598
|
drillDowns: [],
|
|
14222
14599
|
drillDownChartState: makeDrillDownChartState(),
|
|
@@ -14282,34 +14659,7 @@ const platforma$1 = BlockModelV3.create({
|
|
|
14282
14659
|
}
|
|
14283
14660
|
};
|
|
14284
14661
|
});
|
|
14285
|
-
}).output("scoreOptions", (ctx) => {
|
|
14286
|
-
const stateMatrixRef = ctx.data.stateMatrixRef;
|
|
14287
|
-
if (stateMatrixRef === void 0) return void 0;
|
|
14288
|
-
const stateSpec = poolSpecByRef(ctx, stateMatrixRef);
|
|
14289
|
-
if (!stateSpec) return void 0;
|
|
14290
|
-
const anchors = { main: stateSpec };
|
|
14291
|
-
const columns = ColumnsCollection(["result_pool"]).discover({
|
|
14292
|
-
anchors,
|
|
14293
|
-
mode: "enrichment",
|
|
14294
|
-
maxHops: 0,
|
|
14295
|
-
exclude: [{ annotations: { "pl7.app/isLinkerColumn": exactMatch("true") } }]
|
|
14296
|
-
}).getColumns();
|
|
14297
|
-
const variantAxisName = stateSpec.axesSpec[0]?.name;
|
|
14298
|
-
const seen = /* @__PURE__ */ new Set();
|
|
14299
|
-
const entries = [];
|
|
14300
|
-
for (const recipe of columns) {
|
|
14301
|
-
const spec = recipe.getSpec();
|
|
14302
|
-
if (!isLandscapeScoreColumn(spec, variantAxisName)) continue;
|
|
14303
|
-
const dedupKey = spec.name + "|" + JSON.stringify(spec.domain ?? {});
|
|
14304
|
-
if (seen.has(dedupKey)) continue;
|
|
14305
|
-
seen.add(dedupKey);
|
|
14306
|
-
entries.push({
|
|
14307
|
-
id: recipe.id,
|
|
14308
|
-
spec
|
|
14309
|
-
});
|
|
14310
|
-
}
|
|
14311
|
-
return runColumnOptions(entries, inputFilterOf(ctx.data));
|
|
14312
|
-
}).output("roundFrequencyOptions", (ctx) => {
|
|
14662
|
+
}).output("scoreOptions", (ctx) => computeScoreOptions(ctx)).output("roundFrequencyOptions", (ctx) => {
|
|
14313
14663
|
const stateMatrixRef = ctx.data.stateMatrixRef;
|
|
14314
14664
|
if (stateMatrixRef === void 0) return void 0;
|
|
14315
14665
|
const stateSpec = poolSpecByRef(ctx, stateMatrixRef);
|
|
@@ -14355,7 +14705,7 @@ const platforma$1 = BlockModelV3.create({
|
|
|
14355
14705
|
return createPFrameForGraphs(ctx, pCols);
|
|
14356
14706
|
}).output("singleMutantHeatmapPCols", (ctx) => {
|
|
14357
14707
|
return outputPColumns(ctx, "singleMutantHeatmapPf");
|
|
14358
|
-
}).output("landscapePanels", (ctx) => landscapePanelsFrom(outputPColumns(ctx, "singleMutantHeatmapPf"))).output("singleMutantCount", (ctx) => {
|
|
14708
|
+
}).output("landscapePanels", (ctx) => landscapePanelsFrom(outputPColumns(ctx, "singleMutantHeatmapPf"), scoreLabelByRefFrom(ctx))).output("singleMutantCount", (ctx) => {
|
|
14359
14709
|
return ctx.outputs?.resolve({
|
|
14360
14710
|
field: "singleMutantCount",
|
|
14361
14711
|
assertFieldType: "Input",
|
|
@@ -14381,7 +14731,8 @@ const platforma$1 = BlockModelV3.create({
|
|
|
14381
14731
|
return outputPColumns(ctx, "compositionHeatmapPf");
|
|
14382
14732
|
}).output("isRunning", (ctx) => ctx.outputs?.getIsReadyOrError() === false).title(() => "Mutation Explorer").subtitle((ctx) => ctx.data.customBlockLabel || ctx.data.defaultBlockLabel || NO_DATASET_LABEL).sections((ctx) => {
|
|
14383
14733
|
const pCols = outputPColumns(ctx, "singleMutantHeatmapPf");
|
|
14384
|
-
const
|
|
14734
|
+
const labelByRef = scoreLabelByRefFrom(ctx);
|
|
14735
|
+
const panels = landscapePanelsFrom(pCols, labelByRef) ?? [];
|
|
14385
14736
|
const sections = [];
|
|
14386
14737
|
if (panels.length === 0) sections.push({
|
|
14387
14738
|
type: "link",
|
|
@@ -14395,7 +14746,7 @@ const platforma$1 = BlockModelV3.create({
|
|
|
14395
14746
|
});
|
|
14396
14747
|
const drillDowns = ctx.data.drillDowns ?? [];
|
|
14397
14748
|
if (drillDowns.length > 0) {
|
|
14398
|
-
const scoreLabels = scoreLabelsByKey(pCols);
|
|
14749
|
+
const scoreLabels = scoreLabelsByKey(pCols, labelByRef);
|
|
14399
14750
|
sections.push({ type: "delimiter" });
|
|
14400
14751
|
for (const d of drillDowns) sections.push({
|
|
14401
14752
|
type: "link",
|