@platforma-sdk/model 1.38.0 → 1.39.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/dist/bconfig/index.d.ts +2 -3
- package/dist/bconfig/index.d.ts.map +1 -1
- package/dist/bconfig/normalization.d.ts +1 -7
- package/dist/bconfig/normalization.d.ts.map +1 -1
- package/dist/bconfig/types.d.ts +0 -4
- package/dist/bconfig/types.d.ts.map +1 -1
- package/dist/bconfig/{utils.d.ts → util.d.ts} +1 -1
- package/dist/bconfig/util.d.ts.map +1 -0
- package/dist/bconfig/v3.d.ts +3 -32
- package/dist/bconfig/v3.d.ts.map +1 -1
- package/dist/builder.d.ts +3 -1
- package/dist/builder.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +572 -604
- package/dist/index.mjs.map +1 -1
- package/dist/render/api.d.ts +4 -2
- package/dist/render/api.d.ts.map +1 -1
- package/dist/render/internal.d.ts +3 -3
- package/dist/render/internal.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/bconfig/index.ts +2 -3
- package/src/bconfig/normalization.ts +2 -105
- package/src/bconfig/types.ts +0 -5
- package/src/bconfig/v3.ts +3 -41
- package/src/builder.ts +21 -2
- package/src/render/api.ts +27 -7
- package/src/render/internal.ts +14 -3
- package/dist/bconfig/container.d.ts +0 -46
- package/dist/bconfig/container.d.ts.map +0 -1
- package/dist/bconfig/utils.d.ts.map +0 -1
- package/src/bconfig/container.ts +0 -58
- /package/src/bconfig/{utils.ts → util.ts} +0 -0
package/dist/render/api.d.ts
CHANGED
|
@@ -146,9 +146,11 @@ export declare class ResultPool implements ColumnProvider, AxisLabelProvider {
|
|
|
146
146
|
/** Main entry point to the API available within model lambdas (like outputs, sections, etc..) */
|
|
147
147
|
export declare class RenderCtx<Args, UiState> {
|
|
148
148
|
private readonly ctx;
|
|
149
|
-
readonly args: Args;
|
|
150
|
-
readonly uiState: UiState;
|
|
151
149
|
constructor();
|
|
150
|
+
private _argsCache?;
|
|
151
|
+
get args(): Args;
|
|
152
|
+
private _uiStateCache?;
|
|
153
|
+
get uiState(): UiState;
|
|
152
154
|
private _activeArgsCache?;
|
|
153
155
|
/**
|
|
154
156
|
* Returns args snapshot the block was executed for (i.e. when "Run" button was pressed).
|
package/dist/render/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/render/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,WAAW,EACX,MAAM,EACN,QAAQ,EACR,MAAM,EACN,OAAO,EACP,eAAe,EACf,WAAW,EACX,aAAa,EACb,SAAS,EACT,YAAY,EACZ,OAAO,EAEP,WAAW,EACX,cAAc,EACd,SAAS,EACT,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,KAAK,EACL,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,YAAY,EACb,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,iBAAiB,EAalB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAS,MAAM,YAAY,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG1C,OAAO,EAAqB,KAAK,iBAAiB,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1G,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAExE,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GAAG,QAAQ,CAAC,gBAAgB,CAAC,GAAG,aAAa,CAAC;AAiBjG,MAAM,MAAM,qBAAqB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,K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,OAAO,EAAE,MAAM,GAAG,MAAM;IAItC,wBAAwB,IAAI,MAAM,GAAG,SAAS;IAI9C,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI1B,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI1B,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;CAGnC;AAED,MAAM,MAAM,cAAc,CAAC,IAAI,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO,EAAE,GAAG,GAAG,OAAO,IAAI,CAC7E,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,KAC3B,GAAG,CAAC;AAET,MAAM,MAAM,eAAe,CAAC,CAAC,IAC3B,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,CAAC,GACxB,CAAC,GACD,CAAC,SAAS,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GACtE,CAAC,GACD;KAAG,GAAG,IAAI,MAAM,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CAAE,CAAC;AAEtD,MAAM,MAAM,yBAAyB,CAAC,EAAE,SAAS,WAAW,IAAI,EAAE,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,MAAM,CAAC,GAChG,eAAe,CAAC,CAAC,CAAC,GAClB,KAAK,CAAC"}
|
|
@@ -56,9 +56,9 @@ export declare const GlobalCfgRenderCtxFeatureFlags: {
|
|
|
56
56
|
pTablePartitionFiltersSupport: true;
|
|
57
57
|
};
|
|
58
58
|
export interface GlobalCfgRenderCtx extends GlobalCfgRenderCtxMethods {
|
|
59
|
-
readonly args: string;
|
|
60
|
-
readonly uiState: string;
|
|
61
|
-
readonly activeArgs
|
|
59
|
+
readonly args: string | (() => string);
|
|
60
|
+
readonly uiState: string | (() => string);
|
|
61
|
+
readonly activeArgs: undefined | string | (() => string | undefined);
|
|
62
62
|
readonly callbackRegistry: Record<string, AnyFunction>;
|
|
63
63
|
readonly featureFlags?: typeof GlobalCfgRenderCtxFeatureFlags;
|
|
64
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../src/render/internal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAChG,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EACX,MAAM,EACN,OAAO,EACP,aAAa,EACb,SAAS,EACT,YAAY,EACZ,OAAO,EACP,WAAW,EACX,cAAc,EACd,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACR,UAAU,EACX,MAAM,iCAAiC,CAAC;AAEzC,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAC7C,eAAO,MAAM,gBAAgB,SAAS,CAAC;AAEvC,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAC/D,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAE3D,MAAM,WAAW,yBAAyB,CAAC,OAAO,GAAG,cAAc,EAAE,OAAO,GAAG,YAAY;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../src/render/internal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAChG,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EACX,MAAM,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GAAG,CAAC,MAAM,MAAM,CAAC,CAAC;IACvC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,CAAC;IAC1C,QAAQ,CAAC,UAAU,EAAE,SAAS,GAAG,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC;IAKrE,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACvD,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,8BAA8B,CAAC;CAC/D;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,mBAAmB,EAAE,YAAY,EAAE,CAAC;CACrC,CAAC;AAEF,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,WAAW,CAE9D;AAiBD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,CAI5D"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PlatformaSDKVersion = "1.
|
|
1
|
+
export declare const PlatformaSDKVersion = "1.39.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-sdk/model",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.39.0",
|
|
4
4
|
"description": "Platforma.bio SDK / Block Model",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"utility-types": "^3.11.0",
|
|
22
22
|
"canonicalize": "~2.1.0",
|
|
23
23
|
"zod": "~3.23.8",
|
|
24
|
-
"@milaboratories/pl-model-common": "^1.
|
|
24
|
+
"@milaboratories/pl-model-common": "^1.16.0",
|
|
25
25
|
"@milaboratories/pl-error-like": "^1.12.2"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
package/src/bconfig/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { extractConfigGeneric, type BlockConfigContainer } from '@milaboratories/pl-model-common';
|
|
2
2
|
import type { TypedConfigOrConfigLambda, TypedConfigOrString } from './types';
|
|
3
3
|
import { isConfigLambda } from './types';
|
|
4
4
|
import type { BlockConfig } from './v3';
|
|
@@ -15,109 +15,6 @@ export function downgradeCfgOrLambda(
|
|
|
15
15
|
return data;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
function upgradeCfgOrLambda(data: TypedConfigOrString): TypedConfigOrConfigLambda;
|
|
19
|
-
function upgradeCfgOrLambda(
|
|
20
|
-
data: TypedConfigOrString | undefined
|
|
21
|
-
): TypedConfigOrConfigLambda | undefined;
|
|
22
|
-
function upgradeCfgOrLambda(
|
|
23
|
-
data: TypedConfigOrString | undefined,
|
|
24
|
-
): TypedConfigOrConfigLambda | undefined {
|
|
25
|
-
if (data === undefined) return undefined;
|
|
26
|
-
if (typeof data === 'string') return { __renderLambda: true, handle: data, retentive: false };
|
|
27
|
-
return data;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Takes universal config, and converts it into latest config structure.
|
|
32
|
-
*
|
|
33
|
-
* **Important**: This operation is not meant to be executed recusively.
|
|
34
|
-
* In no circumstance result of this function should be persisted!
|
|
35
|
-
* */
|
|
36
18
|
export function extractConfig(cfg: BlockConfigContainer): BlockConfig {
|
|
37
|
-
|
|
38
|
-
// version 3
|
|
39
|
-
const {
|
|
40
|
-
initialArgs,
|
|
41
|
-
initialUiState,
|
|
42
|
-
inputsValid,
|
|
43
|
-
outputs,
|
|
44
|
-
renderingMode,
|
|
45
|
-
sdkVersion,
|
|
46
|
-
sections,
|
|
47
|
-
title,
|
|
48
|
-
enrichmentTargets,
|
|
49
|
-
} = cfg.v3;
|
|
50
|
-
const { code } = cfg;
|
|
51
|
-
return {
|
|
52
|
-
initialArgs,
|
|
53
|
-
initialUiState,
|
|
54
|
-
inputsValid,
|
|
55
|
-
outputs,
|
|
56
|
-
renderingMode,
|
|
57
|
-
sdkVersion,
|
|
58
|
-
sections,
|
|
59
|
-
title,
|
|
60
|
-
code,
|
|
61
|
-
enrichmentTargets,
|
|
62
|
-
};
|
|
63
|
-
} else if (cfg.inputsValid !== undefined) {
|
|
64
|
-
// version 2
|
|
65
|
-
const { sdkVersion, renderingMode, outputs, inputsValid, sections, initialArgs, code } = cfg;
|
|
66
|
-
const fields = Object.keys(cfg);
|
|
67
|
-
if (
|
|
68
|
-
sdkVersion === undefined
|
|
69
|
-
|| renderingMode === undefined
|
|
70
|
-
|| outputs === undefined
|
|
71
|
-
|| inputsValid === undefined
|
|
72
|
-
|| sections === undefined
|
|
73
|
-
|| initialArgs === undefined
|
|
74
|
-
)
|
|
75
|
-
throw new Error(
|
|
76
|
-
`Malformed config v2. SDK version ${sdkVersion}; Fields = ${fields.join(', ')}`,
|
|
77
|
-
);
|
|
78
|
-
return {
|
|
79
|
-
sdkVersion,
|
|
80
|
-
renderingMode,
|
|
81
|
-
initialArgs,
|
|
82
|
-
outputs: Object.fromEntries(
|
|
83
|
-
Object.entries(outputs).map(([key, value]) => [key, upgradeCfgOrLambda(value)]),
|
|
84
|
-
),
|
|
85
|
-
inputsValid: upgradeCfgOrLambda(inputsValid),
|
|
86
|
-
sections: upgradeCfgOrLambda(sections),
|
|
87
|
-
initialUiState: undefined,
|
|
88
|
-
code,
|
|
89
|
-
};
|
|
90
|
-
} else if (cfg.renderingMode !== undefined) {
|
|
91
|
-
// version 1
|
|
92
|
-
const { sdkVersion, canRun, renderingMode, outputs, sections, initialArgs, code } = cfg;
|
|
93
|
-
const fields = Object.keys(cfg);
|
|
94
|
-
if (
|
|
95
|
-
renderingMode === undefined
|
|
96
|
-
|| outputs === undefined
|
|
97
|
-
|| canRun === undefined
|
|
98
|
-
|| sections === undefined
|
|
99
|
-
|| initialArgs === undefined
|
|
100
|
-
)
|
|
101
|
-
throw new Error(
|
|
102
|
-
`Malformed config v1. SDK version ${sdkVersion}; Fields = ${fields.join(', ')}`,
|
|
103
|
-
);
|
|
104
|
-
return {
|
|
105
|
-
sdkVersion: sdkVersion ?? 'unknown',
|
|
106
|
-
renderingMode,
|
|
107
|
-
initialArgs,
|
|
108
|
-
outputs: Object.fromEntries(
|
|
109
|
-
Object.entries(outputs).map(([key, value]) => [key, upgradeCfgOrLambda(value)]),
|
|
110
|
-
),
|
|
111
|
-
inputsValid: upgradeCfgOrLambda(canRun),
|
|
112
|
-
sections: upgradeCfgOrLambda(sections),
|
|
113
|
-
initialUiState: undefined,
|
|
114
|
-
code,
|
|
115
|
-
};
|
|
116
|
-
} else {
|
|
117
|
-
const { sdkVersion } = cfg;
|
|
118
|
-
const fields = Object.keys(cfg);
|
|
119
|
-
throw new Error(
|
|
120
|
-
`Config format not supported: SDK = ${sdkVersion}; Fields = ${fields.join(', ')}`,
|
|
121
|
-
);
|
|
122
|
-
}
|
|
19
|
+
return extractConfigGeneric(cfg) as BlockConfig;
|
|
123
20
|
}
|
package/src/bconfig/types.ts
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import type { TypedConfig } from '../config';
|
|
2
2
|
import type { ConfigRenderLambda } from './lambdas';
|
|
3
3
|
|
|
4
|
-
export type Code = {
|
|
5
|
-
type: 'plain';
|
|
6
|
-
content: string;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
4
|
export function isConfigLambda(
|
|
10
5
|
cfgOrFh: TypedConfigOrConfigLambda,
|
|
11
6
|
): cfgOrFh is ConfigRenderLambda {
|
package/src/bconfig/v3.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { BlockConfigV3Generic } from '@milaboratories/pl-model-common';
|
|
2
|
+
import type { TypedConfigOrConfigLambda } from './types';
|
|
3
3
|
import type { ConfigRenderLambda } from './lambdas';
|
|
4
4
|
|
|
5
5
|
export type BlockConfigV3<
|
|
@@ -9,44 +9,6 @@ export type BlockConfigV3<
|
|
|
9
9
|
string,
|
|
10
10
|
TypedConfigOrConfigLambda
|
|
11
11
|
>,
|
|
12
|
-
> =
|
|
13
|
-
/** SDK version used by the block */
|
|
14
|
-
readonly sdkVersion: string;
|
|
15
|
-
|
|
16
|
-
/** Main rendering mode for the block */
|
|
17
|
-
readonly renderingMode: BlockRenderingMode;
|
|
18
|
-
|
|
19
|
-
/** Initial value for the args when block is added to the project */
|
|
20
|
-
readonly initialArgs: Args;
|
|
21
|
-
|
|
22
|
-
/** Initial value for the args when block is added to the project */
|
|
23
|
-
readonly initialUiState: UiState;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Config to determine whether the block can be executed with current
|
|
27
|
-
* arguments.
|
|
28
|
-
*
|
|
29
|
-
* Optional to support earlier SDK version configs.
|
|
30
|
-
* */
|
|
31
|
-
readonly inputsValid: TypedConfigOrConfigLambda;
|
|
32
|
-
|
|
33
|
-
/** Configuration to derive list of section for the left overview panel */
|
|
34
|
-
readonly sections: TypedConfigOrConfigLambda;
|
|
35
|
-
|
|
36
|
-
/** Lambda to derive block title */
|
|
37
|
-
readonly title?: ConfigRenderLambda;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Lambda returning list of upstream blocks this block enriches with its exports,
|
|
41
|
-
* influences dependency graph construction
|
|
42
|
-
* */
|
|
43
|
-
readonly enrichmentTargets?: ConfigRenderLambda;
|
|
44
|
-
|
|
45
|
-
/** Configuration for the output cells */
|
|
46
|
-
readonly outputs: Outputs;
|
|
47
|
-
|
|
48
|
-
/** Config code bundle */
|
|
49
|
-
readonly code?: Code;
|
|
50
|
-
};
|
|
12
|
+
> = BlockConfigV3Generic<Args, UiState, TypedConfigOrConfigLambda, ConfigRenderLambda, Outputs>;
|
|
51
13
|
|
|
52
14
|
export type BlockConfig = BlockConfigV3;
|
package/src/builder.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BlockRenderingMode, BlockSection, ValueOrErrors, AnyFunction, PlRef } from '@milaboratories/pl-model-common';
|
|
1
|
+
import type { BlockRenderingMode, BlockSection, ValueOrErrors, AnyFunction, PlRef, BlockCodeKnownFeatureFlags, BlockConfigContainer } from '@milaboratories/pl-model-common';
|
|
2
2
|
import type { Checked, ConfigResult, TypedConfig } from './config';
|
|
3
3
|
import { getImmediate } from './config';
|
|
4
4
|
import { getPlatformaInstance, isInUI, tryRegisterCallback } from './internal';
|
|
@@ -13,7 +13,6 @@ import type {
|
|
|
13
13
|
DeriveHref,
|
|
14
14
|
ResolveCfgType,
|
|
15
15
|
ExtractFunctionHandleReturn,
|
|
16
|
-
BlockConfigContainer,
|
|
17
16
|
ConfigRenderLambdaFlags,
|
|
18
17
|
} from './bconfig';
|
|
19
18
|
import {
|
|
@@ -66,8 +65,15 @@ export class BlockModel<
|
|
|
66
65
|
private readonly _sections: TypedConfigOrConfigLambda,
|
|
67
66
|
private readonly _title: ConfigRenderLambda | undefined,
|
|
68
67
|
private readonly _enrichmentTargets: ConfigRenderLambda | undefined,
|
|
68
|
+
private readonly _featureFlags: BlockCodeKnownFeatureFlags,
|
|
69
69
|
) {}
|
|
70
70
|
|
|
71
|
+
public static readonly INITIAL_BLOCK_FEATURE_FLAGS: BlockCodeKnownFeatureFlags = {
|
|
72
|
+
supportsLazyState: true,
|
|
73
|
+
requiresUIAPIVersion: 1,
|
|
74
|
+
requiresModelAPIVersion: 1,
|
|
75
|
+
};
|
|
76
|
+
|
|
71
77
|
/** Initiates configuration builder */
|
|
72
78
|
public static create(renderingMode: BlockRenderingMode): BlockModel<NoOb, {}, NoOb>;
|
|
73
79
|
/** Initiates configuration builder */
|
|
@@ -92,6 +98,7 @@ export class BlockModel<
|
|
|
92
98
|
getImmediate([]),
|
|
93
99
|
undefined,
|
|
94
100
|
undefined,
|
|
101
|
+
{ ...BlockModel.INITIAL_BLOCK_FEATURE_FLAGS },
|
|
95
102
|
);
|
|
96
103
|
}
|
|
97
104
|
|
|
@@ -149,6 +156,7 @@ export class BlockModel<
|
|
|
149
156
|
this._sections,
|
|
150
157
|
this._title,
|
|
151
158
|
this._enrichmentTargets,
|
|
159
|
+
this._featureFlags,
|
|
152
160
|
);
|
|
153
161
|
} else
|
|
154
162
|
return new BlockModel(
|
|
@@ -163,6 +171,7 @@ export class BlockModel<
|
|
|
163
171
|
this._sections,
|
|
164
172
|
this._title,
|
|
165
173
|
this._enrichmentTargets,
|
|
174
|
+
this._featureFlags,
|
|
166
175
|
);
|
|
167
176
|
}
|
|
168
177
|
|
|
@@ -205,6 +214,7 @@ export class BlockModel<
|
|
|
205
214
|
this._sections,
|
|
206
215
|
this._title,
|
|
207
216
|
this._enrichmentTargets,
|
|
217
|
+
this._featureFlags,
|
|
208
218
|
);
|
|
209
219
|
} else
|
|
210
220
|
return new BlockModel<Args, OutputsCfg, UiState>(
|
|
@@ -216,6 +226,7 @@ export class BlockModel<
|
|
|
216
226
|
this._sections,
|
|
217
227
|
this._title,
|
|
218
228
|
this._enrichmentTargets,
|
|
229
|
+
this._featureFlags,
|
|
219
230
|
);
|
|
220
231
|
}
|
|
221
232
|
|
|
@@ -253,6 +264,7 @@ export class BlockModel<
|
|
|
253
264
|
{ __renderLambda: true, handle: 'sections' } as ConfigRenderLambda,
|
|
254
265
|
this._title,
|
|
255
266
|
this._enrichmentTargets,
|
|
267
|
+
this._featureFlags,
|
|
256
268
|
);
|
|
257
269
|
} else
|
|
258
270
|
return new BlockModel<Args, OutputsCfg, UiState>(
|
|
@@ -264,6 +276,7 @@ export class BlockModel<
|
|
|
264
276
|
arrOrCfgOrRf as TypedConfig,
|
|
265
277
|
this._title,
|
|
266
278
|
this._enrichmentTargets,
|
|
279
|
+
this._featureFlags,
|
|
267
280
|
);
|
|
268
281
|
}
|
|
269
282
|
|
|
@@ -281,6 +294,7 @@ export class BlockModel<
|
|
|
281
294
|
this._sections,
|
|
282
295
|
{ __renderLambda: true, handle: 'title' } as ConfigRenderLambda,
|
|
283
296
|
this._enrichmentTargets,
|
|
297
|
+
this._featureFlags,
|
|
284
298
|
);
|
|
285
299
|
}
|
|
286
300
|
|
|
@@ -298,6 +312,7 @@ export class BlockModel<
|
|
|
298
312
|
this._sections,
|
|
299
313
|
this._title,
|
|
300
314
|
this._enrichmentTargets,
|
|
315
|
+
this._featureFlags,
|
|
301
316
|
);
|
|
302
317
|
}
|
|
303
318
|
|
|
@@ -312,6 +327,7 @@ export class BlockModel<
|
|
|
312
327
|
this._sections,
|
|
313
328
|
this._title,
|
|
314
329
|
this._enrichmentTargets,
|
|
330
|
+
this._featureFlags,
|
|
315
331
|
);
|
|
316
332
|
}
|
|
317
333
|
|
|
@@ -326,6 +342,7 @@ export class BlockModel<
|
|
|
326
342
|
this._sections,
|
|
327
343
|
this._title,
|
|
328
344
|
this._enrichmentTargets,
|
|
345
|
+
this._featureFlags,
|
|
329
346
|
);
|
|
330
347
|
}
|
|
331
348
|
|
|
@@ -346,6 +363,7 @@ export class BlockModel<
|
|
|
346
363
|
this._sections,
|
|
347
364
|
this._title,
|
|
348
365
|
{ __renderLambda: true, handle: 'enrichmentTargets' } as ConfigRenderLambda,
|
|
366
|
+
this._featureFlags,
|
|
349
367
|
);
|
|
350
368
|
}
|
|
351
369
|
|
|
@@ -371,6 +389,7 @@ export class BlockModel<
|
|
|
371
389
|
title: this._title,
|
|
372
390
|
outputs: this._outputs,
|
|
373
391
|
enrichmentTargets: this._enrichmentTargets,
|
|
392
|
+
featureFlags: this._featureFlags,
|
|
374
393
|
},
|
|
375
394
|
|
|
376
395
|
// fields below are added to allow previous desktop versions read generated configs
|
package/src/render/api.ts
CHANGED
|
@@ -512,13 +512,30 @@ export class ResultPool implements ColumnProvider, AxisLabelProvider {
|
|
|
512
512
|
export class RenderCtx<Args, UiState> {
|
|
513
513
|
private readonly ctx: GlobalCfgRenderCtx;
|
|
514
514
|
|
|
515
|
-
public readonly args: Args;
|
|
516
|
-
public readonly uiState: UiState;
|
|
517
|
-
|
|
518
515
|
constructor() {
|
|
519
516
|
this.ctx = getCfgRenderCtx();
|
|
520
|
-
|
|
521
|
-
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
private _argsCache?: { v: Args };
|
|
520
|
+
|
|
521
|
+
public get args(): Args {
|
|
522
|
+
if (this._argsCache === undefined) {
|
|
523
|
+
const raw = this.ctx.args;
|
|
524
|
+
const value = typeof raw === 'function' ? raw() : raw;
|
|
525
|
+
this._argsCache = { v: JSON.parse(value) };
|
|
526
|
+
}
|
|
527
|
+
return this._argsCache.v;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
private _uiStateCache?: { v: UiState };
|
|
531
|
+
|
|
532
|
+
public get uiState(): UiState {
|
|
533
|
+
if (this._uiStateCache === undefined) {
|
|
534
|
+
const raw = this.ctx.uiState;
|
|
535
|
+
const value = typeof raw === 'function' ? raw() : raw;
|
|
536
|
+
this._uiStateCache = { v: value ? JSON.parse(value) : ({} as UiState) };
|
|
537
|
+
}
|
|
538
|
+
return this._uiStateCache.v;
|
|
522
539
|
}
|
|
523
540
|
|
|
524
541
|
// lazy rendering because this feature is rarely used
|
|
@@ -529,10 +546,13 @@ export class RenderCtx<Args, UiState> {
|
|
|
529
546
|
* Returns undefined, if block was never executed or stopped mid-way execution, so that the result was cleared.
|
|
530
547
|
* */
|
|
531
548
|
public get activeArgs(): Args | undefined {
|
|
532
|
-
if (this._activeArgsCache === undefined)
|
|
549
|
+
if (this._activeArgsCache === undefined) {
|
|
550
|
+
const raw = this.ctx.activeArgs;
|
|
551
|
+
const value = typeof raw === 'function' ? raw() : raw;
|
|
533
552
|
this._activeArgsCache = {
|
|
534
|
-
v:
|
|
553
|
+
v: value ? JSON.parse(value) : undefined,
|
|
535
554
|
};
|
|
555
|
+
}
|
|
536
556
|
return this._activeArgsCache.v;
|
|
537
557
|
}
|
|
538
558
|
|
package/src/render/internal.ts
CHANGED
|
@@ -27,6 +27,7 @@ export type AccessorHandle = Branded<string, 'AccessorHandle'>;
|
|
|
27
27
|
export type FutureHandle = Branded<string, 'FutureHandle'>;
|
|
28
28
|
|
|
29
29
|
export interface GlobalCfgRenderCtxMethods<AHandle = AccessorHandle, FHandle = FutureHandle> {
|
|
30
|
+
|
|
30
31
|
//
|
|
31
32
|
// Root accessor creation
|
|
32
33
|
//
|
|
@@ -171,12 +172,22 @@ export const GlobalCfgRenderCtxFeatureFlags = {
|
|
|
171
172
|
};
|
|
172
173
|
|
|
173
174
|
export interface GlobalCfgRenderCtx extends GlobalCfgRenderCtxMethods {
|
|
175
|
+
//
|
|
176
|
+
// State: Args, UI State, Active Args
|
|
177
|
+
//
|
|
178
|
+
// Old runtime injects these values as strings, new runtime injects them as functions
|
|
179
|
+
// that return strings, if block declares supportsLazyState flag.
|
|
180
|
+
// If function not called in lazy state API, then resulting output will not depend on these values,
|
|
181
|
+
// and thus will not be recalculated on corresponding state change.
|
|
182
|
+
//
|
|
183
|
+
|
|
184
|
+
readonly args: string | (() => string);
|
|
185
|
+
readonly uiState: string | (() => string);
|
|
186
|
+
readonly activeArgs: undefined | string | (() => string | undefined);
|
|
187
|
+
|
|
174
188
|
// Note: strings below are used because, anyway, using strings is the only way
|
|
175
189
|
// to get data inside the QuickJS context, as it is implemented now. With this
|
|
176
190
|
// approach deserialization can be lazily postponed until it is actually needed.
|
|
177
|
-
readonly args: string;
|
|
178
|
-
readonly uiState: string;
|
|
179
|
-
readonly activeArgs?: string;
|
|
180
191
|
readonly callbackRegistry: Record<string, AnyFunction>;
|
|
181
192
|
readonly featureFlags?: typeof GlobalCfgRenderCtxFeatureFlags;
|
|
182
193
|
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { BlockRenderingMode } from '@milaboratories/pl-model-common';
|
|
2
|
-
import { Code, TypedConfigOrString } from './types';
|
|
3
|
-
import { BlockConfigV3 } from './v3';
|
|
4
|
-
/** Container simplifying maintenance of forward and backward compatibility */
|
|
5
|
-
export type BlockConfigContainer = {
|
|
6
|
-
/** Actual config */
|
|
7
|
-
readonly v3: Omit<BlockConfigV3, 'code'>;
|
|
8
|
-
/** Config code bundle */
|
|
9
|
-
readonly code?: Code;
|
|
10
|
-
/**
|
|
11
|
-
* For backward compatibility
|
|
12
|
-
* @deprecated
|
|
13
|
-
*/
|
|
14
|
-
readonly sdkVersion?: string;
|
|
15
|
-
/**
|
|
16
|
-
* For backward compatibility
|
|
17
|
-
* @deprecated
|
|
18
|
-
*/
|
|
19
|
-
readonly renderingMode?: BlockRenderingMode;
|
|
20
|
-
/**
|
|
21
|
-
* For backward compatibility
|
|
22
|
-
* @deprecated
|
|
23
|
-
*/
|
|
24
|
-
readonly initialArgs?: unknown;
|
|
25
|
-
/**
|
|
26
|
-
* For backward compatibility
|
|
27
|
-
* @deprecated
|
|
28
|
-
*/
|
|
29
|
-
readonly canRun?: TypedConfigOrString;
|
|
30
|
-
/**
|
|
31
|
-
* For backward compatibility
|
|
32
|
-
* @deprecated
|
|
33
|
-
*/
|
|
34
|
-
readonly inputsValid?: TypedConfigOrString;
|
|
35
|
-
/**
|
|
36
|
-
* For backward compatibility
|
|
37
|
-
* @deprecated
|
|
38
|
-
*/
|
|
39
|
-
readonly sections?: TypedConfigOrString;
|
|
40
|
-
/**
|
|
41
|
-
* For backward compatibility
|
|
42
|
-
* @deprecated
|
|
43
|
-
*/
|
|
44
|
-
readonly outputs?: Record<string, TypedConfigOrString>;
|
|
45
|
-
};
|
|
46
|
-
//# sourceMappingURL=container.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/bconfig/container.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,KAAK,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AAE1C,8EAA8E;AAC9E,MAAM,MAAM,oBAAoB,GAAG;IACjC,oBAAoB;IACpB,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IAEzC,yBAAyB;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;IAMrB;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAE7B;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,kBAAkB,CAAC;IAE5C;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAE/B;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAEtC;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAE3C;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAExC;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;CACxD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/bconfig/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEpE,KAAK,UAAU,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG,CAAC,GAAG,EAAE,CAAC;AAG/C,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,YAAY,EAAE,GACzD,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,MAAM,CAAC,CAAC,GACxD,KAAK,CAAC"}
|
package/src/bconfig/container.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type { BlockRenderingMode } from '@milaboratories/pl-model-common';
|
|
2
|
-
import type { Code, TypedConfigOrString } from './types';
|
|
3
|
-
import type { BlockConfigV3 } from './v3';
|
|
4
|
-
|
|
5
|
-
/** Container simplifying maintenance of forward and backward compatibility */
|
|
6
|
-
export type BlockConfigContainer = {
|
|
7
|
-
/** Actual config */
|
|
8
|
-
readonly v3: Omit<BlockConfigV3, 'code'>;
|
|
9
|
-
|
|
10
|
-
/** Config code bundle */
|
|
11
|
-
readonly code?: Code;
|
|
12
|
-
|
|
13
|
-
//
|
|
14
|
-
// Fields below are used to read previous config versions
|
|
15
|
-
//
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* For backward compatibility
|
|
19
|
-
* @deprecated
|
|
20
|
-
*/
|
|
21
|
-
readonly sdkVersion?: string;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* For backward compatibility
|
|
25
|
-
* @deprecated
|
|
26
|
-
*/
|
|
27
|
-
readonly renderingMode?: BlockRenderingMode;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* For backward compatibility
|
|
31
|
-
* @deprecated
|
|
32
|
-
*/
|
|
33
|
-
readonly initialArgs?: unknown;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* For backward compatibility
|
|
37
|
-
* @deprecated
|
|
38
|
-
*/
|
|
39
|
-
readonly canRun?: TypedConfigOrString;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* For backward compatibility
|
|
43
|
-
* @deprecated
|
|
44
|
-
*/
|
|
45
|
-
readonly inputsValid?: TypedConfigOrString;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* For backward compatibility
|
|
49
|
-
* @deprecated
|
|
50
|
-
*/
|
|
51
|
-
readonly sections?: TypedConfigOrString;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* For backward compatibility
|
|
55
|
-
* @deprecated
|
|
56
|
-
*/
|
|
57
|
-
readonly outputs?: Record<string, TypedConfigOrString>;
|
|
58
|
-
};
|
|
File without changes
|