@milaboratories/milaboratories.monetization-test.model 1.0.40 → 1.0.41
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 +7 -0
- package/dist/bundle.js +140 -78
- package/dist/bundle.js.map +1 -1
- package/dist/model.json +1 -1
- package/package.json +6 -6
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.41 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 [1m4.
|
|
10
|
+
[32mcreated [1mdist, dist[22m in [1m4.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.2s[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.41 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.41 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
package/dist/bundle.js
CHANGED
|
@@ -7358,7 +7358,7 @@
|
|
|
7358
7358
|
}
|
|
7359
7359
|
}
|
|
7360
7360
|
|
|
7361
|
-
var version = "1.
|
|
7361
|
+
var version = "1.49.0";
|
|
7362
7362
|
|
|
7363
7363
|
const PlatformaSDKVersion = version;
|
|
7364
7364
|
|
|
@@ -7378,52 +7378,52 @@
|
|
|
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) {
|
|
@@ -7432,13 +7432,20 @@
|
|
|
7432
7432
|
argsValid(cfgOrRf) {
|
|
7433
7433
|
if (typeof cfgOrRf === 'function') {
|
|
7434
7434
|
tryRegisterCallback('inputsValid', () => cfgOrRf(new RenderCtx()));
|
|
7435
|
-
return new BlockModel(
|
|
7436
|
-
|
|
7437
|
-
|
|
7438
|
-
|
|
7435
|
+
return new BlockModel({
|
|
7436
|
+
...this.config,
|
|
7437
|
+
inputsValid: {
|
|
7438
|
+
__renderLambda: true,
|
|
7439
|
+
handle: 'inputsValid',
|
|
7440
|
+
},
|
|
7441
|
+
});
|
|
7442
|
+
}
|
|
7443
|
+
else {
|
|
7444
|
+
return new BlockModel({
|
|
7445
|
+
...this.config,
|
|
7446
|
+
inputsValid: cfgOrRf,
|
|
7447
|
+
});
|
|
7439
7448
|
}
|
|
7440
|
-
else
|
|
7441
|
-
return new BlockModel(this._renderingMode, this._initialArgs, this._initialUiState, this._outputs, cfgOrRf, this._sections, this._title, this._enrichmentTargets, this._featureFlags);
|
|
7442
7449
|
}
|
|
7443
7450
|
sections(arrOrCfgOrRf) {
|
|
7444
7451
|
if (Array.isArray(arrOrCfgOrRf)) {
|
|
@@ -7446,34 +7453,82 @@
|
|
|
7446
7453
|
}
|
|
7447
7454
|
else if (typeof arrOrCfgOrRf === 'function') {
|
|
7448
7455
|
tryRegisterCallback('sections', () => arrOrCfgOrRf(new RenderCtx()));
|
|
7449
|
-
return new BlockModel(
|
|
7456
|
+
return new BlockModel({
|
|
7457
|
+
...this.config,
|
|
7458
|
+
sections: {
|
|
7459
|
+
__renderLambda: true,
|
|
7460
|
+
handle: 'sections',
|
|
7461
|
+
},
|
|
7462
|
+
});
|
|
7463
|
+
}
|
|
7464
|
+
else {
|
|
7465
|
+
return new BlockModel({
|
|
7466
|
+
...this.config,
|
|
7467
|
+
sections: arrOrCfgOrRf,
|
|
7468
|
+
});
|
|
7450
7469
|
}
|
|
7451
|
-
else
|
|
7452
|
-
return new BlockModel(this._renderingMode, this._initialArgs, this._initialUiState, this._outputs, this._inputsValid, arrOrCfgOrRf, this._title, this._enrichmentTargets, this._featureFlags);
|
|
7453
7470
|
}
|
|
7454
7471
|
/** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */
|
|
7455
7472
|
title(rf) {
|
|
7456
7473
|
tryRegisterCallback('title', () => rf(new RenderCtx()));
|
|
7457
|
-
return new BlockModel(
|
|
7474
|
+
return new BlockModel({
|
|
7475
|
+
...this.config,
|
|
7476
|
+
title: {
|
|
7477
|
+
__renderLambda: true,
|
|
7478
|
+
handle: 'title',
|
|
7479
|
+
},
|
|
7480
|
+
});
|
|
7481
|
+
}
|
|
7482
|
+
subtitle(rf) {
|
|
7483
|
+
tryRegisterCallback('subtitle', () => rf(new RenderCtx()));
|
|
7484
|
+
return new BlockModel({
|
|
7485
|
+
...this.config,
|
|
7486
|
+
subtitle: {
|
|
7487
|
+
__renderLambda: true,
|
|
7488
|
+
handle: 'subtitle',
|
|
7489
|
+
},
|
|
7490
|
+
});
|
|
7491
|
+
}
|
|
7492
|
+
tags(rf) {
|
|
7493
|
+
tryRegisterCallback('tags', () => rf(new RenderCtx()));
|
|
7494
|
+
return new BlockModel({
|
|
7495
|
+
...this.config,
|
|
7496
|
+
tags: {
|
|
7497
|
+
__renderLambda: true,
|
|
7498
|
+
handle: 'tags',
|
|
7499
|
+
},
|
|
7500
|
+
});
|
|
7458
7501
|
}
|
|
7459
7502
|
/**
|
|
7460
7503
|
* Sets initial args for the block, this value must be specified.
|
|
7461
7504
|
* @deprecated use {@link withArgs}
|
|
7462
7505
|
* */
|
|
7463
7506
|
initialArgs(value) {
|
|
7464
|
-
return
|
|
7507
|
+
return this.withArgs(value);
|
|
7465
7508
|
}
|
|
7466
7509
|
/** Sets initial args for the block, this value must be specified. */
|
|
7467
|
-
withArgs(
|
|
7468
|
-
return new BlockModel(
|
|
7510
|
+
withArgs(initialArgs) {
|
|
7511
|
+
return new BlockModel({
|
|
7512
|
+
...this.config,
|
|
7513
|
+
initialArgs,
|
|
7514
|
+
});
|
|
7469
7515
|
}
|
|
7470
7516
|
/** Defines type and sets initial value for block UiState. */
|
|
7471
|
-
withUiState(
|
|
7472
|
-
return new BlockModel(
|
|
7517
|
+
withUiState(initialUiState) {
|
|
7518
|
+
return new BlockModel({
|
|
7519
|
+
...this.config,
|
|
7520
|
+
initialUiState,
|
|
7521
|
+
});
|
|
7473
7522
|
}
|
|
7474
7523
|
/** Sets or overrides feature flags for the block. */
|
|
7475
7524
|
withFeatureFlags(flags) {
|
|
7476
|
-
return new BlockModel(
|
|
7525
|
+
return new BlockModel({
|
|
7526
|
+
...this.config,
|
|
7527
|
+
featureFlags: {
|
|
7528
|
+
...this.config.featureFlags,
|
|
7529
|
+
...flags,
|
|
7530
|
+
},
|
|
7531
|
+
});
|
|
7477
7532
|
}
|
|
7478
7533
|
/**
|
|
7479
7534
|
* Defines how to derive list of upstream references this block is meant to enrich with its exports from block args.
|
|
@@ -7481,43 +7536,50 @@
|
|
|
7481
7536
|
*/
|
|
7482
7537
|
enriches(lambda) {
|
|
7483
7538
|
tryRegisterCallback('enrichmentTargets', lambda);
|
|
7484
|
-
return new BlockModel(
|
|
7539
|
+
return new BlockModel({
|
|
7540
|
+
...this.config,
|
|
7541
|
+
enrichmentTargets: {
|
|
7542
|
+
__renderLambda: true,
|
|
7543
|
+
handle: 'enrichmentTargets',
|
|
7544
|
+
},
|
|
7545
|
+
});
|
|
7485
7546
|
}
|
|
7486
7547
|
/** Renders all provided block settings into a pre-configured platforma API
|
|
7487
7548
|
* instance, that can be used in frontend to interact with block state, and
|
|
7488
7549
|
* other features provided by the platforma to the block. */
|
|
7489
|
-
done(apiVersion) {
|
|
7490
|
-
const requiresUIAPIVersion = apiVersion ?? 1;
|
|
7550
|
+
done(apiVersion = 1) {
|
|
7491
7551
|
return this.withFeatureFlags({
|
|
7492
|
-
...this.
|
|
7493
|
-
requiresUIAPIVersion,
|
|
7494
|
-
})
|
|
7552
|
+
...this.config.featureFlags,
|
|
7553
|
+
requiresUIAPIVersion: apiVersion,
|
|
7554
|
+
}).#done();
|
|
7495
7555
|
}
|
|
7496
|
-
|
|
7497
|
-
if (this.
|
|
7556
|
+
#done() {
|
|
7557
|
+
if (this.config.initialArgs === undefined)
|
|
7498
7558
|
throw new Error('Initial arguments not set.');
|
|
7499
7559
|
const config = {
|
|
7500
7560
|
v3: {
|
|
7501
7561
|
sdkVersion: PlatformaSDKVersion,
|
|
7502
|
-
renderingMode: this.
|
|
7503
|
-
initialArgs: this.
|
|
7504
|
-
initialUiState: this.
|
|
7505
|
-
inputsValid: this.
|
|
7506
|
-
sections: this.
|
|
7507
|
-
title: this.
|
|
7508
|
-
|
|
7509
|
-
|
|
7510
|
-
|
|
7562
|
+
renderingMode: this.config.renderingMode,
|
|
7563
|
+
initialArgs: this.config.initialArgs,
|
|
7564
|
+
initialUiState: this.config.initialUiState,
|
|
7565
|
+
inputsValid: this.config.inputsValid,
|
|
7566
|
+
sections: this.config.sections,
|
|
7567
|
+
title: this.config.title,
|
|
7568
|
+
subtitle: this.config.subtitle,
|
|
7569
|
+
tags: this.config.tags,
|
|
7570
|
+
outputs: this.config.outputs,
|
|
7571
|
+
enrichmentTargets: this.config.enrichmentTargets,
|
|
7572
|
+
featureFlags: this.config.featureFlags,
|
|
7511
7573
|
},
|
|
7512
7574
|
// fields below are added to allow previous desktop versions read generated configs
|
|
7513
7575
|
sdkVersion: PlatformaSDKVersion,
|
|
7514
|
-
renderingMode: this.
|
|
7515
|
-
initialArgs: this.
|
|
7516
|
-
inputsValid: downgradeCfgOrLambda(this.
|
|
7517
|
-
sections: downgradeCfgOrLambda(this.
|
|
7518
|
-
outputs: Object.fromEntries(Object.entries(this.
|
|
7576
|
+
renderingMode: this.config.renderingMode,
|
|
7577
|
+
initialArgs: this.config.initialArgs,
|
|
7578
|
+
inputsValid: downgradeCfgOrLambda(this.config.inputsValid),
|
|
7579
|
+
sections: downgradeCfgOrLambda(this.config.sections),
|
|
7580
|
+
outputs: Object.fromEntries(Object.entries(this.config.outputs).map(([key, value]) => [key, downgradeCfgOrLambda(value)])),
|
|
7519
7581
|
};
|
|
7520
|
-
globalThis.platformaApiVersion =
|
|
7582
|
+
globalThis.platformaApiVersion = this.config.featureFlags.requiresUIAPIVersion;
|
|
7521
7583
|
if (!isInUI())
|
|
7522
7584
|
// we are in the configuration rendering routine, not in actual UI
|
|
7523
7585
|
return { config };
|