@milaboratories/milaboratories.monetization-test.model 1.0.40 → 1.0.42
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/.turbo/turbo-build.log +3 -3
- package/.turbo/turbo-lint.log +1 -1
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +14 -0
- package/dist/bundle.js +157 -79
- package/dist/bundle.js.map +1 -1
- package/dist/index.d.ts +17 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/model.json +1 -1
- package/package.json +5 -5
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
WARN Issue while reading "/home/runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
|
|
2
2
|
|
|
3
|
-
> @milaboratories/milaboratories.monetization-test.model@1.0.
|
|
3
|
+
> @milaboratories/milaboratories.monetization-test.model@1.0.42 build /home/runner/_work/platforma/platforma/etc/blocks/monetization-test/model
|
|
4
4
|
> ts-builder build --target block-model && block-tools build-model
|
|
5
5
|
|
|
6
6
|
Building block-model project...
|
|
7
7
|
↳ rollup -c /configs/rollup.block-model.config.js
|
|
8
8
|
[36m
|
|
9
9
|
[1m./src/index.ts[22m → [1mdist, dist[22m...[39m
|
|
10
|
-
[32mcreated [1mdist, dist[22m in [
|
|
10
|
+
[32mcreated [1mdist, dist[22m in [1m3.5s[22m[39m
|
|
11
11
|
[36m
|
|
12
12
|
[1m./src/index.ts[22m → [1mdist[22m...[39m
|
|
13
13
|
[1m[33m(!) Circular dependency[39m[22m
|
|
14
14
|
../../../../sdk/model/dist/components/PFrameForGraphs.js -> ../../../../sdk/model/dist/pframe_utils/columns.js -> ../../../../sdk/model/dist/components/PFrameForGraphs.js
|
|
15
|
-
[32mcreated [1mdist[22m in [1m5.
|
|
15
|
+
[32mcreated [1mdist[22m in [1m5.5s[22m[39m
|
|
16
16
|
Build completed successfully
|
package/.turbo/turbo-lint.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
WARN Issue while reading "/home/runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
|
|
2
2
|
|
|
3
|
-
> @milaboratories/milaboratories.monetization-test.model@1.0.
|
|
3
|
+
> @milaboratories/milaboratories.monetization-test.model@1.0.42 lint /home/runner/_work/platforma/platforma/etc/blocks/monetization-test/model
|
|
4
4
|
> eslint .
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
WARN Issue while reading "/home/runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
|
|
2
2
|
|
|
3
|
-
> @milaboratories/milaboratories.monetization-test.model@1.0.
|
|
3
|
+
> @milaboratories/milaboratories.monetization-test.model@1.0.42 type-check /home/runner/_work/platforma/platforma/etc/blocks/monetization-test/model
|
|
4
4
|
> ts-builder types --target block-model
|
|
5
5
|
|
|
6
6
|
↳ tsc --noEmit --project ./tsconfig.json --customConditions ,
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @milaboratories/milaboratories.monetization-test.model
|
|
2
2
|
|
|
3
|
+
## 1.0.42
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [fc75a16]
|
|
8
|
+
- @platforma-sdk/model@1.50.0
|
|
9
|
+
|
|
10
|
+
## 1.0.41
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [88f33fa]
|
|
15
|
+
- @platforma-sdk/model@1.49.0
|
|
16
|
+
|
|
3
17
|
## 1.0.40
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/bundle.js
CHANGED
|
@@ -7358,7 +7358,7 @@
|
|
|
7358
7358
|
}
|
|
7359
7359
|
}
|
|
7360
7360
|
|
|
7361
|
-
var version = "1.
|
|
7361
|
+
var version = "1.50.0";
|
|
7362
7362
|
|
|
7363
7363
|
const PlatformaSDKVersion = version;
|
|
7364
7364
|
|
|
@@ -7378,67 +7378,82 @@
|
|
|
7378
7378
|
* to call {@link done()} at the end of configuration. Value returned by this builder must be
|
|
7379
7379
|
* exported as constant with name "platforma" from the "config" module. */
|
|
7380
7380
|
class BlockModel {
|
|
7381
|
-
|
|
7382
|
-
|
|
7383
|
-
|
|
7384
|
-
|
|
7385
|
-
|
|
7386
|
-
|
|
7387
|
-
|
|
7388
|
-
|
|
7389
|
-
|
|
7390
|
-
|
|
7391
|
-
|
|
7392
|
-
this._initialArgs = _initialArgs;
|
|
7393
|
-
this._initialUiState = _initialUiState;
|
|
7394
|
-
this._outputs = _outputs;
|
|
7395
|
-
this._inputsValid = _inputsValid;
|
|
7396
|
-
this._sections = _sections;
|
|
7397
|
-
this._title = _title;
|
|
7398
|
-
this._enrichmentTargets = _enrichmentTargets;
|
|
7399
|
-
this._featureFlags = _featureFlags;
|
|
7400
|
-
}
|
|
7401
|
-
static INITIAL_BLOCK_FEATURE_FLAGS = {
|
|
7402
|
-
supportsLazyState: true,
|
|
7403
|
-
requiresUIAPIVersion: 1,
|
|
7404
|
-
requiresModelAPIVersion: 1,
|
|
7405
|
-
};
|
|
7381
|
+
config;
|
|
7382
|
+
constructor(config) {
|
|
7383
|
+
this.config = config;
|
|
7384
|
+
}
|
|
7385
|
+
static get INITIAL_BLOCK_FEATURE_FLAGS() {
|
|
7386
|
+
return {
|
|
7387
|
+
supportsLazyState: true,
|
|
7388
|
+
requiresUIAPIVersion: 1,
|
|
7389
|
+
requiresModelAPIVersion: 1,
|
|
7390
|
+
};
|
|
7391
|
+
}
|
|
7406
7392
|
static create(renderingMode = 'Heavy') {
|
|
7407
|
-
return new BlockModel(
|
|
7393
|
+
return new BlockModel({
|
|
7394
|
+
renderingMode,
|
|
7395
|
+
initialUiState: {},
|
|
7396
|
+
outputs: {},
|
|
7397
|
+
inputsValid: getImmediate(true),
|
|
7398
|
+
sections: getImmediate([]),
|
|
7399
|
+
featureFlags: BlockModel.INITIAL_BLOCK_FEATURE_FLAGS,
|
|
7400
|
+
});
|
|
7408
7401
|
}
|
|
7409
7402
|
output(key, cfgOrRf, flags = {}) {
|
|
7410
7403
|
if (typeof cfgOrRf === 'function') {
|
|
7411
7404
|
const handle = `output#${key}`;
|
|
7412
7405
|
tryRegisterCallback(handle, () => cfgOrRf(new RenderCtx()));
|
|
7413
|
-
return new BlockModel(
|
|
7414
|
-
...this.
|
|
7415
|
-
|
|
7416
|
-
|
|
7417
|
-
|
|
7418
|
-
|
|
7406
|
+
return new BlockModel({
|
|
7407
|
+
...this.config,
|
|
7408
|
+
outputs: {
|
|
7409
|
+
...this.config.outputs,
|
|
7410
|
+
[key]: {
|
|
7411
|
+
__renderLambda: true,
|
|
7412
|
+
handle,
|
|
7413
|
+
...flags,
|
|
7414
|
+
},
|
|
7419
7415
|
},
|
|
7420
|
-
}
|
|
7416
|
+
});
|
|
7417
|
+
}
|
|
7418
|
+
else {
|
|
7419
|
+
return new BlockModel({
|
|
7420
|
+
...this.config,
|
|
7421
|
+
outputs: {
|
|
7422
|
+
...this.config.outputs,
|
|
7423
|
+
[key]: cfgOrRf,
|
|
7424
|
+
},
|
|
7425
|
+
});
|
|
7421
7426
|
}
|
|
7422
|
-
else
|
|
7423
|
-
return new BlockModel(this._renderingMode, this._initialArgs, this._initialUiState, {
|
|
7424
|
-
...this._outputs,
|
|
7425
|
-
[key]: cfgOrRf,
|
|
7426
|
-
}, this._inputsValid, this._sections, this._title, this._enrichmentTargets, this._featureFlags);
|
|
7427
7427
|
}
|
|
7428
7428
|
/** Shortcut for {@link output} with retentive flag set to true. */
|
|
7429
7429
|
retentiveOutput(key, rf) {
|
|
7430
7430
|
return this.output(key, rf, { retentive: true });
|
|
7431
7431
|
}
|
|
7432
|
+
/** Shortcut for {@link output} with withStatus flag set to true. */
|
|
7433
|
+
outputWithStatus(key, rf) {
|
|
7434
|
+
return this.output(key, rf, { withStatus: true });
|
|
7435
|
+
}
|
|
7436
|
+
/** Shortcut for {@link output} with retentive and withStatus flags set to true. */
|
|
7437
|
+
retentiveOutputWithStatus(key, rf) {
|
|
7438
|
+
return this.output(key, rf, { retentive: true, withStatus: true });
|
|
7439
|
+
}
|
|
7432
7440
|
argsValid(cfgOrRf) {
|
|
7433
7441
|
if (typeof cfgOrRf === 'function') {
|
|
7434
7442
|
tryRegisterCallback('inputsValid', () => cfgOrRf(new RenderCtx()));
|
|
7435
|
-
return new BlockModel(
|
|
7436
|
-
|
|
7437
|
-
|
|
7438
|
-
|
|
7443
|
+
return new BlockModel({
|
|
7444
|
+
...this.config,
|
|
7445
|
+
inputsValid: {
|
|
7446
|
+
__renderLambda: true,
|
|
7447
|
+
handle: 'inputsValid',
|
|
7448
|
+
},
|
|
7449
|
+
});
|
|
7450
|
+
}
|
|
7451
|
+
else {
|
|
7452
|
+
return new BlockModel({
|
|
7453
|
+
...this.config,
|
|
7454
|
+
inputsValid: cfgOrRf,
|
|
7455
|
+
});
|
|
7439
7456
|
}
|
|
7440
|
-
else
|
|
7441
|
-
return new BlockModel(this._renderingMode, this._initialArgs, this._initialUiState, this._outputs, cfgOrRf, this._sections, this._title, this._enrichmentTargets, this._featureFlags);
|
|
7442
7457
|
}
|
|
7443
7458
|
sections(arrOrCfgOrRf) {
|
|
7444
7459
|
if (Array.isArray(arrOrCfgOrRf)) {
|
|
@@ -7446,34 +7461,82 @@
|
|
|
7446
7461
|
}
|
|
7447
7462
|
else if (typeof arrOrCfgOrRf === 'function') {
|
|
7448
7463
|
tryRegisterCallback('sections', () => arrOrCfgOrRf(new RenderCtx()));
|
|
7449
|
-
return new BlockModel(
|
|
7464
|
+
return new BlockModel({
|
|
7465
|
+
...this.config,
|
|
7466
|
+
sections: {
|
|
7467
|
+
__renderLambda: true,
|
|
7468
|
+
handle: 'sections',
|
|
7469
|
+
},
|
|
7470
|
+
});
|
|
7471
|
+
}
|
|
7472
|
+
else {
|
|
7473
|
+
return new BlockModel({
|
|
7474
|
+
...this.config,
|
|
7475
|
+
sections: arrOrCfgOrRf,
|
|
7476
|
+
});
|
|
7450
7477
|
}
|
|
7451
|
-
else
|
|
7452
|
-
return new BlockModel(this._renderingMode, this._initialArgs, this._initialUiState, this._outputs, this._inputsValid, arrOrCfgOrRf, this._title, this._enrichmentTargets, this._featureFlags);
|
|
7453
7478
|
}
|
|
7454
7479
|
/** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */
|
|
7455
7480
|
title(rf) {
|
|
7456
7481
|
tryRegisterCallback('title', () => rf(new RenderCtx()));
|
|
7457
|
-
return new BlockModel(
|
|
7482
|
+
return new BlockModel({
|
|
7483
|
+
...this.config,
|
|
7484
|
+
title: {
|
|
7485
|
+
__renderLambda: true,
|
|
7486
|
+
handle: 'title',
|
|
7487
|
+
},
|
|
7488
|
+
});
|
|
7489
|
+
}
|
|
7490
|
+
subtitle(rf) {
|
|
7491
|
+
tryRegisterCallback('subtitle', () => rf(new RenderCtx()));
|
|
7492
|
+
return new BlockModel({
|
|
7493
|
+
...this.config,
|
|
7494
|
+
subtitle: {
|
|
7495
|
+
__renderLambda: true,
|
|
7496
|
+
handle: 'subtitle',
|
|
7497
|
+
},
|
|
7498
|
+
});
|
|
7499
|
+
}
|
|
7500
|
+
tags(rf) {
|
|
7501
|
+
tryRegisterCallback('tags', () => rf(new RenderCtx()));
|
|
7502
|
+
return new BlockModel({
|
|
7503
|
+
...this.config,
|
|
7504
|
+
tags: {
|
|
7505
|
+
__renderLambda: true,
|
|
7506
|
+
handle: 'tags',
|
|
7507
|
+
},
|
|
7508
|
+
});
|
|
7458
7509
|
}
|
|
7459
7510
|
/**
|
|
7460
7511
|
* Sets initial args for the block, this value must be specified.
|
|
7461
7512
|
* @deprecated use {@link withArgs}
|
|
7462
7513
|
* */
|
|
7463
7514
|
initialArgs(value) {
|
|
7464
|
-
return
|
|
7515
|
+
return this.withArgs(value);
|
|
7465
7516
|
}
|
|
7466
7517
|
/** Sets initial args for the block, this value must be specified. */
|
|
7467
|
-
withArgs(
|
|
7468
|
-
return new BlockModel(
|
|
7518
|
+
withArgs(initialArgs) {
|
|
7519
|
+
return new BlockModel({
|
|
7520
|
+
...this.config,
|
|
7521
|
+
initialArgs,
|
|
7522
|
+
});
|
|
7469
7523
|
}
|
|
7470
7524
|
/** Defines type and sets initial value for block UiState. */
|
|
7471
|
-
withUiState(
|
|
7472
|
-
return new BlockModel(
|
|
7525
|
+
withUiState(initialUiState) {
|
|
7526
|
+
return new BlockModel({
|
|
7527
|
+
...this.config,
|
|
7528
|
+
initialUiState,
|
|
7529
|
+
});
|
|
7473
7530
|
}
|
|
7474
7531
|
/** Sets or overrides feature flags for the block. */
|
|
7475
7532
|
withFeatureFlags(flags) {
|
|
7476
|
-
return new BlockModel(
|
|
7533
|
+
return new BlockModel({
|
|
7534
|
+
...this.config,
|
|
7535
|
+
featureFlags: {
|
|
7536
|
+
...this.config.featureFlags,
|
|
7537
|
+
...flags,
|
|
7538
|
+
},
|
|
7539
|
+
});
|
|
7477
7540
|
}
|
|
7478
7541
|
/**
|
|
7479
7542
|
* Defines how to derive list of upstream references this block is meant to enrich with its exports from block args.
|
|
@@ -7481,49 +7544,64 @@
|
|
|
7481
7544
|
*/
|
|
7482
7545
|
enriches(lambda) {
|
|
7483
7546
|
tryRegisterCallback('enrichmentTargets', lambda);
|
|
7484
|
-
return new BlockModel(
|
|
7547
|
+
return new BlockModel({
|
|
7548
|
+
...this.config,
|
|
7549
|
+
enrichmentTargets: {
|
|
7550
|
+
__renderLambda: true,
|
|
7551
|
+
handle: 'enrichmentTargets',
|
|
7552
|
+
},
|
|
7553
|
+
});
|
|
7485
7554
|
}
|
|
7486
7555
|
/** Renders all provided block settings into a pre-configured platforma API
|
|
7487
7556
|
* instance, that can be used in frontend to interact with block state, and
|
|
7488
7557
|
* other features provided by the platforma to the block. */
|
|
7489
|
-
done(apiVersion) {
|
|
7490
|
-
const requiresUIAPIVersion = apiVersion ?? 1;
|
|
7558
|
+
done(apiVersion = 1) {
|
|
7491
7559
|
return this.withFeatureFlags({
|
|
7492
|
-
...this.
|
|
7493
|
-
requiresUIAPIVersion,
|
|
7494
|
-
})
|
|
7560
|
+
...this.config.featureFlags,
|
|
7561
|
+
requiresUIAPIVersion: apiVersion,
|
|
7562
|
+
}).#done();
|
|
7495
7563
|
}
|
|
7496
|
-
|
|
7497
|
-
if (this.
|
|
7564
|
+
#done() {
|
|
7565
|
+
if (this.config.initialArgs === undefined)
|
|
7498
7566
|
throw new Error('Initial arguments not set.');
|
|
7499
7567
|
const config = {
|
|
7500
7568
|
v3: {
|
|
7501
7569
|
sdkVersion: PlatformaSDKVersion,
|
|
7502
|
-
renderingMode: this.
|
|
7503
|
-
initialArgs: this.
|
|
7504
|
-
initialUiState: this.
|
|
7505
|
-
inputsValid: this.
|
|
7506
|
-
sections: this.
|
|
7507
|
-
title: this.
|
|
7508
|
-
|
|
7509
|
-
|
|
7510
|
-
|
|
7570
|
+
renderingMode: this.config.renderingMode,
|
|
7571
|
+
initialArgs: this.config.initialArgs,
|
|
7572
|
+
initialUiState: this.config.initialUiState,
|
|
7573
|
+
inputsValid: this.config.inputsValid,
|
|
7574
|
+
sections: this.config.sections,
|
|
7575
|
+
title: this.config.title,
|
|
7576
|
+
subtitle: this.config.subtitle,
|
|
7577
|
+
tags: this.config.tags,
|
|
7578
|
+
outputs: this.config.outputs,
|
|
7579
|
+
enrichmentTargets: this.config.enrichmentTargets,
|
|
7580
|
+
featureFlags: this.config.featureFlags,
|
|
7511
7581
|
},
|
|
7512
7582
|
// fields below are added to allow previous desktop versions read generated configs
|
|
7513
7583
|
sdkVersion: PlatformaSDKVersion,
|
|
7514
|
-
renderingMode: this.
|
|
7515
|
-
initialArgs: this.
|
|
7516
|
-
inputsValid: downgradeCfgOrLambda(this.
|
|
7517
|
-
sections: downgradeCfgOrLambda(this.
|
|
7518
|
-
outputs: Object.fromEntries(Object.entries(this.
|
|
7584
|
+
renderingMode: this.config.renderingMode,
|
|
7585
|
+
initialArgs: this.config.initialArgs,
|
|
7586
|
+
inputsValid: downgradeCfgOrLambda(this.config.inputsValid),
|
|
7587
|
+
sections: downgradeCfgOrLambda(this.config.sections),
|
|
7588
|
+
outputs: Object.fromEntries(Object.entries(this.config.outputs).map(([key, value]) => [key, downgradeCfgOrLambda(value)])),
|
|
7519
7589
|
};
|
|
7520
|
-
globalThis.platformaApiVersion =
|
|
7590
|
+
globalThis.platformaApiVersion = this.config.featureFlags.requiresUIAPIVersion;
|
|
7521
7591
|
if (!isInUI())
|
|
7522
7592
|
// we are in the configuration rendering routine, not in actual UI
|
|
7523
7593
|
return { config };
|
|
7524
7594
|
// normal operation inside the UI
|
|
7525
7595
|
else
|
|
7526
|
-
return
|
|
7596
|
+
return {
|
|
7597
|
+
...getPlatformaInstance({ sdkVersion: PlatformaSDKVersion, apiVersion: platformaApiVersion }),
|
|
7598
|
+
blockModelInfo: {
|
|
7599
|
+
outputs: Object.fromEntries(Object.entries(this.config.outputs)
|
|
7600
|
+
.map(([key, value]) => [key, {
|
|
7601
|
+
withStatus: Boolean(isConfigLambda(value) && value.withStatus),
|
|
7602
|
+
}])),
|
|
7603
|
+
},
|
|
7604
|
+
};
|
|
7527
7605
|
}
|
|
7528
7606
|
}
|
|
7529
7607
|
|