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