@milaboratories/milaboratories.ui-examples.model 1.0.32 → 1.0.34

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/bundle.js CHANGED
@@ -53,7 +53,7 @@
53
53
  return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
54
54
  }
55
55
  util2.joinValues = joinValues;
56
- util2.jsonStringifyReplacer = (_, value) => {
56
+ util2.jsonStringifyReplacer = (_2, value) => {
57
57
  if (typeof value === "bigint") {
58
58
  return value.toString();
59
59
  }
@@ -368,7 +368,7 @@
368
368
  };
369
369
  }
370
370
  let errorMessage = "";
371
- const maps = errorMaps.filter((m) => !!m).slice().reverse();
371
+ const maps = errorMaps.filter((m2) => !!m2).slice().reverse();
372
372
  for (const map of maps) {
373
373
  errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;
374
374
  }
@@ -409,12 +409,12 @@
409
409
  }
410
410
  static mergeArray(status, results) {
411
411
  const arrayValue = [];
412
- for (const s2 of results) {
413
- if (s2.status === "aborted")
412
+ for (const s of results) {
413
+ if (s.status === "aborted")
414
414
  return INVALID;
415
- if (s2.status === "dirty")
415
+ if (s.status === "dirty")
416
416
  status.dirty();
417
- arrayValue.push(s2.value);
417
+ arrayValue.push(s.value);
418
418
  }
419
419
  return { status: status.value, value: arrayValue };
420
420
  }
@@ -3914,10 +3914,10 @@
3914
3914
  quotelessJson,
3915
3915
  ZodError
3916
3916
  });
3917
- function c$1(n) {
3917
+ function c(n) {
3918
3918
  throw new Error("Unexpected object: " + n);
3919
3919
  }
3920
- function D$1(n, t) {
3920
+ function D(n, t) {
3921
3921
  return { ...n, src: i(n.src, t) };
3922
3922
  }
3923
3923
  function i(n, t) {
@@ -3940,7 +3940,7 @@
3940
3940
  secondary: n.secondary.map((e) => i(e, t))
3941
3941
  };
3942
3942
  default:
3943
- c$1(n);
3943
+ c(n);
3944
3944
  }
3945
3945
  }
3946
3946
  z.object({
@@ -3958,22 +3958,22 @@
3958
3958
  function x$1(n) {
3959
3959
  return r(n.spec);
3960
3960
  }
3961
- function B(n, t) {
3962
- return {
3961
+ function L$1(n, t) {
3962
+ return n === void 0 ? void 0 : {
3963
3963
  ...n,
3964
3964
  data: t(n.data)
3965
3965
  };
3966
3966
  }
3967
- function L(n, t) {
3967
+ function O(n, t) {
3968
3968
  return n.ok ? { ok: true, value: t(n.value) } : n;
3969
3969
  }
3970
- var E = Object.defineProperty;
3971
- var j = (e, t, n) => t in e ? E(e, t, { enumerable: true, configurable: true, writable: true, value: n }) : e[t] = n;
3972
- var c = (e, t, n) => j(e, typeof t != "symbol" ? t + "" : t, n);
3973
- function f(e) {
3970
+ var M = Object.defineProperty;
3971
+ var U = (e, t, n) => t in e ? M(e, t, { enumerable: true, configurable: true, writable: true, value: n }) : e[t] = n;
3972
+ var f = (e, t, n) => U(e, typeof t != "symbol" ? t + "" : t, n);
3973
+ function C(e) {
3974
3974
  return { type: "Immediate", value: e };
3975
3975
  }
3976
- function $() {
3976
+ function K() {
3977
3977
  return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
3978
3978
  }
3979
3979
  function x(e) {
@@ -3982,92 +3982,119 @@
3982
3982
  if (typeof globalThis.platforma < "u") return globalThis.platforma;
3983
3983
  throw new Error("Can't get platforma instance.");
3984
3984
  }
3985
- function M() {
3985
+ function W() {
3986
3986
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
3987
3987
  }
3988
- function s() {
3988
+ function o() {
3989
3989
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
3990
3990
  throw new Error("Not in config rendering context");
3991
3991
  }
3992
- function y(e, t) {
3993
- const n = M();
3992
+ function _(e, t) {
3993
+ const n = W();
3994
3994
  if (n === void 0) return false;
3995
3995
  if (e in n.callbackRegistry) throw new Error(`Callback with key ${e} already registered.`);
3996
3996
  return n.callbackRegistry[e] = t, true;
3997
3997
  }
3998
- const b = /* @__PURE__ */ new Map();
3999
- function K(e, t) {
4000
- e in s().callbackRegistry || (s().callbackRegistry[e] = (n) => {
4001
- for (const r2 of b.get(e))
4002
- r2(n);
4003
- }, b.set(e, [])), b.get(e).push(t);
3998
+ const F = /* @__PURE__ */ new Map();
3999
+ function q(e, t) {
4000
+ e in o().callbackRegistry || (o().callbackRegistry[e] = (n) => {
4001
+ for (const i2 of F.get(e))
4002
+ i2(n);
4003
+ }, F.set(e, [])), F.get(e).push(t);
4004
4004
  }
4005
- class l {
4006
- constructor(t, n = (r2) => r2) {
4007
- c(this, "isResolved", false);
4008
- c(this, "resolvedValue");
4009
- this.handle = t, this.postProcess = n, K(t, (r2) => {
4010
- this.resolvedValue = n(r2), this.isResolved = true;
4005
+ class h {
4006
+ constructor(t, n = (i2) => i2) {
4007
+ f(this, "isResolved", false);
4008
+ f(this, "resolvedValue");
4009
+ this.handle = t, this.postProcess = n, q(t, (i2) => {
4010
+ this.resolvedValue = n(i2), this.isResolved = true;
4011
4011
  });
4012
4012
  }
4013
4013
  map(t) {
4014
- return new l(this.handle, (n) => t(this.postProcess(n)));
4014
+ return new h(this.handle, (n) => t(this.postProcess(n)));
4015
4015
  }
4016
4016
  mapDefined(t) {
4017
- return new l(this.handle, (n) => {
4018
- const r2 = this.postProcess(n);
4019
- return r2 ? t(r2) : void 0;
4017
+ return new h(this.handle, (n) => {
4018
+ const i2 = this.postProcess(n);
4019
+ return i2 ? t(i2) : void 0;
4020
4020
  });
4021
4021
  }
4022
4022
  toJSON() {
4023
4023
  return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
4024
4024
  }
4025
4025
  }
4026
- function F(e) {
4027
- return e === void 0 ? void 0 : new p(e);
4026
+ function V(e) {
4027
+ return e === void 0 ? void 0 : new m(e);
4028
4028
  }
4029
- class p {
4029
+ class m {
4030
4030
  constructor(t) {
4031
4031
  this.handle = t;
4032
4032
  }
4033
4033
  resolve(...t) {
4034
+ const n = t.map(
4035
+ (i2) => ({
4036
+ assertFieldType: "Input",
4037
+ ...typeof i2 == "string" ? { field: i2 } : i2
4038
+ })
4039
+ );
4040
+ return this.resolveWithCommon({}, ...n);
4041
+ }
4042
+ resolveOutput(...t) {
4043
+ const n = t.map(
4044
+ (i2) => ({
4045
+ assertFieldType: "Output",
4046
+ ...typeof i2 == "string" ? { field: i2 } : i2
4047
+ })
4048
+ );
4049
+ return this.resolveWithCommon({}, ...n);
4050
+ }
4051
+ resolveInput(...t) {
4052
+ const n = t.map(
4053
+ (i2) => ({
4054
+ assertFieldType: "Input",
4055
+ ...typeof i2 == "string" ? { field: i2 } : i2
4056
+ })
4057
+ );
4058
+ return this.resolveWithCommon({}, ...n);
4059
+ }
4060
+ resolveAny(...t) {
4034
4061
  return this.resolveWithCommon({}, ...t);
4035
4062
  }
4036
4063
  resolveWithCommon(t, ...n) {
4037
- return F(s().resolveWithCommon(this.handle, t, ...n));
4064
+ return V(o().resolveWithCommon(this.handle, t, ...n));
4038
4065
  }
4039
4066
  get resourceType() {
4040
- return s().getResourceType(this.handle);
4067
+ return o().getResourceType(this.handle);
4041
4068
  }
4042
4069
  getInputsLocked() {
4043
- return s().getInputsLocked(this.handle);
4070
+ return o().getInputsLocked(this.handle);
4044
4071
  }
4045
4072
  getOutputsLocked() {
4046
- return s().getOutputsLocked(this.handle);
4073
+ return o().getOutputsLocked(this.handle);
4047
4074
  }
4048
4075
  getIsReadyOrError() {
4049
- return s().getIsReadyOrError(this.handle);
4076
+ return o().getIsReadyOrError(this.handle);
4050
4077
  }
4051
4078
  getIsFinal() {
4052
- return s().getIsFinal(this.handle);
4079
+ return o().getIsFinal(this.handle);
4053
4080
  }
4054
4081
  getError() {
4055
- return F(s().getError(this.handle));
4082
+ return V(o().getError(this.handle));
4056
4083
  }
4057
4084
  listInputFields() {
4058
- return s().listInputFields(this.handle);
4085
+ return o().listInputFields(this.handle);
4059
4086
  }
4060
4087
  listOutputFields() {
4061
- return s().listOutputFields(this.handle);
4088
+ return o().listOutputFields(this.handle);
4062
4089
  }
4063
4090
  listDynamicFields() {
4064
- return s().listDynamicFields(this.handle);
4091
+ return o().listDynamicFields(this.handle);
4065
4092
  }
4066
4093
  getKeyValueBase64(t) {
4067
- return s().getKeyValueBase64(this.handle, t);
4094
+ return o().getKeyValueBase64(this.handle, t);
4068
4095
  }
4069
4096
  getKeyValueAsString(t) {
4070
- return s().getKeyValueAsString(this.handle, t);
4097
+ return o().getKeyValueAsString(this.handle, t);
4071
4098
  }
4072
4099
  getKeyValueAsJson(t) {
4073
4100
  const n = this.getKeyValueAsString(t);
@@ -4075,10 +4102,10 @@
4075
4102
  return JSON.parse(n);
4076
4103
  }
4077
4104
  getDataBase64() {
4078
- return s().getDataBase64(this.handle);
4105
+ return o().getDataBase64(this.handle);
4079
4106
  }
4080
4107
  getDataAsString() {
4081
- return s().getDataAsString(this.handle);
4108
+ return o().getDataAsString(this.handle);
4082
4109
  }
4083
4110
  getDataAsJson() {
4084
4111
  const t = this.getDataAsString();
@@ -4089,36 +4116,36 @@
4089
4116
  *
4090
4117
  */
4091
4118
  getPColumns(t = false, n = "") {
4092
- const r2 = this.parsePObjectCollection(t, n);
4093
- return r2 === void 0 ? void 0 : Object.entries(r2).map(([, a]) => {
4094
- if (!x$1(a)) throw new Error(`not a PColumn (kind = ${a.spec.kind})`);
4095
- return a;
4119
+ const i2 = this.parsePObjectCollection(t, n);
4120
+ return i2 === void 0 ? void 0 : Object.entries(i2).map(([, s]) => {
4121
+ if (!x$1(s)) throw new Error(`not a PColumn (kind = ${s.spec.kind})`);
4122
+ return s;
4096
4123
  });
4097
4124
  }
4098
4125
  /**
4099
4126
  *
4100
4127
  */
4101
4128
  parsePObjectCollection(t = false, n = "") {
4102
- const r2 = s().parsePObjectCollection(
4129
+ const i2 = o().parsePObjectCollection(
4103
4130
  this.handle,
4104
4131
  t,
4105
4132
  n
4106
4133
  );
4107
- if (r2 === void 0) return;
4108
- const i2 = {};
4109
- for (const [a, d] of Object.entries(r2))
4110
- i2[a] = B(d, (u) => new p(u));
4111
- return i2;
4134
+ if (i2 === void 0) return;
4135
+ const r2 = {};
4136
+ for (const [s, u] of Object.entries(i2))
4137
+ r2[s] = L$1(u, (a) => new m(a));
4138
+ return r2;
4112
4139
  }
4113
4140
  getFileContentAsBase64() {
4114
- return new l(s().getBlobContentAsBase64(this.handle));
4141
+ return new h(o().getBlobContentAsBase64(this.handle));
4115
4142
  }
4116
4143
  getFileContentAsString() {
4117
- return new l(s().getBlobContentAsString(this.handle));
4144
+ return new h(o().getBlobContentAsString(this.handle));
4118
4145
  }
4119
4146
  getFileContentAsJson() {
4120
- return new l(
4121
- s().getBlobContentAsString(this.handle)
4147
+ return new h(
4148
+ o().getBlobContentAsString(this.handle)
4122
4149
  ).mapDefined((t) => JSON.parse(t));
4123
4150
  }
4124
4151
  /**
@@ -4137,7 +4164,7 @@
4137
4164
  * @returns downloaded file handle
4138
4165
  */
4139
4166
  getFileHandle() {
4140
- return new l(s().getDownloadedBlobContentHandle(this.handle));
4167
+ return new h(o().getDownloadedBlobContentHandle(this.handle));
4141
4168
  }
4142
4169
  /**
4143
4170
  * @deprecated use getFileHandle
@@ -4149,7 +4176,7 @@
4149
4176
  * @returns downloaded file handle
4150
4177
  */
4151
4178
  getRemoteFileHandle() {
4152
- return new l(s().getOnDemandBlobContentHandle(this.handle));
4179
+ return new h(o().getOnDemandBlobContentHandle(this.handle));
4153
4180
  }
4154
4181
  /**
4155
4182
  * @deprecated use getRemoteFileHandle
@@ -4158,25 +4185,51 @@
4158
4185
  return this.getRemoteFileHandle();
4159
4186
  }
4160
4187
  getImportProgress() {
4161
- return new l(s().getImportProgress(this.handle));
4188
+ return new h(o().getImportProgress(this.handle));
4162
4189
  }
4163
4190
  getLastLogs(t) {
4164
- return new l(s().getLastLogs(this.handle, t));
4191
+ return new h(o().getLastLogs(this.handle, t));
4165
4192
  }
4166
4193
  getProgressLog(t) {
4167
- return new l(s().getProgressLog(this.handle, t));
4194
+ return new h(o().getProgressLog(this.handle, t));
4168
4195
  }
4169
4196
  getLogHandle() {
4170
- return new l(s().getLogHandle(this.handle));
4197
+ return new h(o().getLogHandle(this.handle));
4198
+ }
4199
+ allFieldsResolved(t = "Input") {
4200
+ switch (t) {
4201
+ case "Input":
4202
+ return this.getInputsLocked() && this.listInputFields().every(
4203
+ (n) => this.resolve({ field: n, assertFieldType: "Input" }) !== void 0
4204
+ );
4205
+ case "Output":
4206
+ return this.getOutputsLocked() && this.listOutputFields().every(
4207
+ (n) => this.resolve({ field: n, assertFieldType: "Output" }) !== void 0
4208
+ );
4209
+ }
4210
+ }
4211
+ mapFields(t, n) {
4212
+ const { fieldType: i2, requireLocked: r2, skipUnresolved: s } = {
4213
+ fieldType: "Input",
4214
+ requireLocked: true,
4215
+ skipUnresolved: false,
4216
+ ...n
4217
+ }, u = t;
4218
+ if (r2 && (i2 === "Input" && !this.getInputsLocked() || i2 === "Output" && !this.getOutputsLocked()))
4219
+ return;
4220
+ let d = (i2 === "Input" ? this.listInputFields() : i2 === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
4221
+ (l) => [l, this.resolve({ field: l, assertFieldType: i2 })]
4222
+ );
4223
+ return s && (d = d.filter((l) => l[1] !== void 0)), d.map(([l, g]) => u(l, g));
4171
4224
  }
4172
4225
  }
4173
- const R = "staging", V = "main";
4174
- class U {
4226
+ const L = "staging", T = "main";
4227
+ class Q {
4175
4228
  constructor() {
4176
- c(this, "ctx", s());
4177
- c(this, "defaultLabelFn", (t, n) => {
4178
- var r2;
4179
- return ((r2 = t.annotations) == null ? void 0 : r2["pl7.app/label"]) ?? "Unlabelled";
4229
+ f(this, "ctx", o());
4230
+ f(this, "defaultLabelFn", (t, n) => {
4231
+ var i2;
4232
+ return ((i2 = t.annotations) == null ? void 0 : i2["pl7.app/label"]) ?? "Unlabelled";
4180
4233
  });
4181
4234
  }
4182
4235
  /**
@@ -4186,9 +4239,9 @@
4186
4239
  return this.ctx.calculateOptions(t);
4187
4240
  }
4188
4241
  getOptions(t, n = this.defaultLabelFn) {
4189
- return this.getSpecs().entries.filter((r2) => t(r2.obj)).map((r2) => ({
4190
- ref: r2.ref,
4191
- label: n(r2.obj, r2.ref)
4242
+ return this.getSpecs().entries.filter((i2) => t(i2.obj)).map((i2) => ({
4243
+ ref: i2.ref,
4244
+ label: n(i2.obj, i2.ref)
4192
4245
  }));
4193
4246
  }
4194
4247
  /**
@@ -4205,7 +4258,7 @@
4205
4258
  ref: n.ref,
4206
4259
  obj: {
4207
4260
  ...n.obj,
4208
- data: new p(n.obj.data)
4261
+ data: new m(n.obj.data)
4209
4262
  }
4210
4263
  }))
4211
4264
  };
@@ -4224,7 +4277,7 @@
4224
4277
  ref: n.ref,
4225
4278
  obj: {
4226
4279
  ...n.obj,
4227
- data: L(n.obj.data, (r2) => new p(r2))
4280
+ data: O(n.obj.data, (i2) => new m(i2))
4228
4281
  }
4229
4282
  }))
4230
4283
  };
@@ -4244,9 +4297,12 @@
4244
4297
  */
4245
4298
  getDataByRef(t) {
4246
4299
  var n;
4247
- return (n = this.getData().entries.find(
4248
- (r2) => r2.ref.blockId === t.blockId && r2.ref.name === t.name
4249
- )) == null ? void 0 : n.obj;
4300
+ return typeof this.ctx.getDataFromResultPoolByRef > "u" ? (n = this.getData().entries.find(
4301
+ (i2) => i2.ref.blockId === t.blockId && i2.ref.name === t.name
4302
+ )) == null ? void 0 : n.obj : L$1(
4303
+ this.ctx.getDataFromResultPoolByRef(t.blockId, t.name),
4304
+ (i2) => new m(i2)
4305
+ );
4250
4306
  }
4251
4307
  /**
4252
4308
  * @param ref a Ref
@@ -4254,9 +4310,9 @@
4254
4310
  */
4255
4311
  getSpecByRef(t) {
4256
4312
  var n;
4257
- return (n = this.getSpecs().entries.find(
4258
- (r2) => r2.ref.blockId === t.blockId && r2.ref.name === t.name
4259
- )) == null ? void 0 : n.obj;
4313
+ return typeof this.ctx.getSpecFromResultPoolByRef > "u" ? (n = this.getSpecs().entries.find(
4314
+ (i2) => i2.ref.blockId === t.blockId && i2.ref.name === t.name
4315
+ )) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(t.blockId, t.name);
4260
4316
  }
4261
4317
  /**
4262
4318
  * @param spec object specification
@@ -4264,23 +4320,23 @@
4264
4320
  */
4265
4321
  findDataWithCompatibleSpec(t) {
4266
4322
  const n = [];
4267
- t: for (const r$1 of this.getData().entries) {
4268
- if (!r(r$1.obj.spec))
4323
+ t: for (const i2 of this.getData().entries) {
4324
+ if (!r(i2.obj.spec))
4269
4325
  continue;
4270
- const i2 = r$1.obj.spec;
4271
- if (t.name === i2.name && t.valueType === i2.valueType && t.axesSpec.length === i2.axesSpec.length && D(t.domain, i2.domain)) {
4272
- for (let a = 0; a < t.axesSpec.length; ++a) {
4273
- const d = t.axesSpec[a], u = i2.axesSpec[a];
4274
- if (d.name !== u.name || d.type !== u.type || !D(d.domain, u.domain))
4326
+ const r$1 = i2.obj.spec;
4327
+ if (t.name === r$1.name && t.valueType === r$1.valueType && t.axesSpec.length === r$1.axesSpec.length && P(t.domain, r$1.domain)) {
4328
+ for (let s = 0; s < t.axesSpec.length; ++s) {
4329
+ const u = t.axesSpec[s], a = r$1.axesSpec[s];
4330
+ if (u.name !== a.name || u.type !== a.type || !P(u.domain, a.domain))
4275
4331
  continue t;
4276
4332
  }
4277
- n.push(r$1.obj);
4333
+ n.push(i2.obj);
4278
4334
  }
4279
4335
  }
4280
4336
  return n;
4281
4337
  }
4282
4338
  }
4283
- function D(e, t) {
4339
+ function P(e, t) {
4284
4340
  if (e === void 0) return t === void 0;
4285
4341
  if (t === void 0) return true;
4286
4342
  for (const n in t)
@@ -4289,18 +4345,18 @@
4289
4345
  }
4290
4346
  class w {
4291
4347
  constructor() {
4292
- c(this, "ctx");
4293
- c(this, "args");
4294
- c(this, "uiState");
4295
- c(this, "resultPool", new U());
4296
- this.ctx = s(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : void 0;
4348
+ f(this, "ctx");
4349
+ f(this, "args");
4350
+ f(this, "uiState");
4351
+ f(this, "resultPool", new Q());
4352
+ this.ctx = o(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : void 0;
4297
4353
  }
4298
4354
  getNamedAccessor(t) {
4299
4355
  const n = this.ctx.getAccessorHandleByName(t);
4300
- return n ? new p(n) : void 0;
4356
+ return n ? new m(n) : void 0;
4301
4357
  }
4302
4358
  get prerun() {
4303
- return this.getNamedAccessor(R);
4359
+ return this.getNamedAccessor(L);
4304
4360
  }
4305
4361
  /**
4306
4362
  * @deprecated use prerun
@@ -4315,7 +4371,7 @@
4315
4371
  return this.precalc;
4316
4372
  }
4317
4373
  get outputs() {
4318
- return this.getNamedAccessor(V);
4374
+ return this.getNamedAccessor(T);
4319
4375
  }
4320
4376
  /**
4321
4377
  * @deprecated use outputs
@@ -4324,108 +4380,184 @@
4324
4380
  return this.outputs;
4325
4381
  }
4326
4382
  createPFrame(t) {
4327
- return this.ctx.createPFrame(t.map((n) => B(n, (r2) => r2.handle)));
4383
+ return this.ctx.createPFrame(t.map((n) => L$1(n, (i2) => i2.handle)));
4328
4384
  }
4329
4385
  createPTable(t) {
4330
4386
  var n;
4331
4387
  return "columns" in t ? n = {
4332
4388
  src: {
4333
4389
  type: "inner",
4334
- entries: t.columns.map((r2) => ({ type: "column", column: r2 }))
4390
+ entries: t.columns.map((i2) => ({ type: "column", column: i2 }))
4335
4391
  },
4336
4392
  filters: t.filters ?? [],
4337
4393
  sorting: t.sorting ?? []
4338
- } : n = t, this.ctx.createPTable(D$1(n, (r2) => B(r2, (i2) => i2.handle)));
4394
+ } : n = t, this.ctx.createPTable(D(n, (i2) => L$1(i2, (r2) => r2.handle)));
4339
4395
  }
4396
+ /** @deprecated scheduled for removal from SDK */
4340
4397
  getBlockLabel(t) {
4341
4398
  return this.ctx.getBlockLabel(t);
4342
4399
  }
4400
+ getCurrentUnstableMarker() {
4401
+ if (!(typeof this.ctx.getCurrentUnstableMarker > "u"))
4402
+ return this.ctx.getCurrentUnstableMarker();
4403
+ }
4343
4404
  }
4344
- const O = "1.8.19";
4345
- class g {
4346
- constructor(t, n, r2, i2, a) {
4347
- this._renderingMode = t, this._initialArgs = n, this._outputs = r2, this._inputsValid = i2, this._sections = a;
4405
+ const b = "1.10.0";
4406
+ function Z(e) {
4407
+ return e.__renderLambda === true;
4408
+ }
4409
+ function I(e) {
4410
+ if (e !== void 0)
4411
+ return Z(e) ? e.handle : e;
4412
+ }
4413
+ class p {
4414
+ constructor(t, n, i2, r2, s, u, a) {
4415
+ this._renderingMode = t, this._initialArgs = n, this._initialUiState = i2, this._outputs = r2, this._inputsValid = s, this._sections = u, this._title = a;
4348
4416
  }
4349
- /** Initiates configuration builder */
4350
4417
  static create(t = "Heavy") {
4351
- return new g(
4418
+ return new p(
4352
4419
  t,
4353
4420
  void 0,
4354
4421
  {},
4355
- f(true),
4356
- f([])
4422
+ {},
4423
+ C(true),
4424
+ C([]),
4425
+ void 0
4357
4426
  );
4358
4427
  }
4359
- output(t, n) {
4428
+ output(t, n, i2 = {}) {
4360
4429
  if (typeof n == "function") {
4361
4430
  const r2 = `output#${t}`;
4362
- return y(r2, () => n(new w())), new g(
4431
+ return _(r2, () => n(new w())), new p(
4363
4432
  this._renderingMode,
4364
4433
  this._initialArgs,
4434
+ this._initialUiState,
4365
4435
  {
4366
4436
  ...this._outputs,
4367
- [t]: r2
4437
+ [t]: {
4438
+ __renderLambda: true,
4439
+ handle: r2,
4440
+ ...i2
4441
+ }
4368
4442
  },
4369
4443
  this._inputsValid,
4370
- this._sections
4444
+ this._sections,
4445
+ this._title
4371
4446
  );
4372
4447
  } else
4373
- return new g(
4448
+ return new p(
4374
4449
  this._renderingMode,
4375
4450
  this._initialArgs,
4451
+ this._initialUiState,
4376
4452
  {
4377
4453
  ...this._outputs,
4378
4454
  [t]: n
4379
4455
  },
4380
4456
  this._inputsValid,
4381
- this._sections
4457
+ this._sections,
4458
+ this._title
4382
4459
  );
4383
4460
  }
4461
+ /** Shortcut for {@link output} with retentive flag set to true. */
4462
+ retentiveOutput(t, n) {
4463
+ return this.output(t, n, { retentive: true });
4464
+ }
4384
4465
  /** @deprecated */
4385
4466
  canRun(t) {
4386
4467
  return this.inputsValid(t);
4387
4468
  }
4388
4469
  argsValid(t) {
4389
- return typeof t == "function" ? (y("inputsValid", () => t(new w())), new g(
4470
+ return typeof t == "function" ? (_("inputsValid", () => t(new w())), new p(
4390
4471
  this._renderingMode,
4391
4472
  this._initialArgs,
4473
+ this._initialUiState,
4392
4474
  this._outputs,
4393
- "inputsValid",
4394
- this._sections
4395
- )) : new g(
4475
+ {
4476
+ __renderLambda: true,
4477
+ handle: "inputsValid"
4478
+ },
4479
+ this._sections,
4480
+ this._title
4481
+ )) : new p(
4396
4482
  this._renderingMode,
4397
4483
  this._initialArgs,
4484
+ this._initialUiState,
4398
4485
  this._outputs,
4399
4486
  t,
4400
- this._sections
4487
+ this._sections,
4488
+ this._title
4401
4489
  );
4402
4490
  }
4403
4491
  inputsValid(t) {
4404
4492
  return this.argsValid(t);
4405
4493
  }
4406
4494
  sections(t) {
4407
- return Array.isArray(t) ? this.sections(f(t)) : typeof t == "function" ? (y("sections", () => t(new w())), new g(
4495
+ return Array.isArray(t) ? this.sections(C(t)) : typeof t == "function" ? (_("sections", () => t(new w())), new p(
4408
4496
  this._renderingMode,
4409
4497
  this._initialArgs,
4498
+ this._initialUiState,
4410
4499
  this._outputs,
4411
4500
  this._inputsValid,
4412
- "sections"
4413
- )) : new g(
4501
+ { __renderLambda: true, handle: "sections" },
4502
+ this._title
4503
+ )) : new p(
4414
4504
  this._renderingMode,
4415
4505
  this._initialArgs,
4506
+ this._initialUiState,
4416
4507
  this._outputs,
4417
4508
  this._inputsValid,
4418
- t
4509
+ t,
4510
+ this._title
4419
4511
  );
4420
4512
  }
4421
- /** Sets initial args for the block, this value must be specified. */
4513
+ title(t) {
4514
+ return _("title", () => t(new w())), new p(
4515
+ this._renderingMode,
4516
+ this._initialArgs,
4517
+ this._initialUiState,
4518
+ this._outputs,
4519
+ this._inputsValid,
4520
+ this._sections,
4521
+ { __renderLambda: true, handle: "title" }
4522
+ );
4523
+ }
4524
+ /**
4525
+ * Sets initial args for the block, this value must be specified.
4526
+ * @deprecated use {@link withArgs}
4527
+ * */
4422
4528
  initialArgs(t) {
4423
- return new g(
4529
+ return new p(
4530
+ this._renderingMode,
4531
+ t,
4532
+ this._initialUiState,
4533
+ this._outputs,
4534
+ this._inputsValid,
4535
+ this._sections,
4536
+ this._title
4537
+ );
4538
+ }
4539
+ /** Sets initial args for the block, this value must be specified. */
4540
+ withArgs(t) {
4541
+ return new p(
4542
+ this._renderingMode,
4543
+ t,
4544
+ this._initialUiState,
4545
+ this._outputs,
4546
+ this._inputsValid,
4547
+ this._sections,
4548
+ this._title
4549
+ );
4550
+ }
4551
+ /** Defines type and sets initial value for block UiState. */
4552
+ withUiState(t) {
4553
+ return new p(
4424
4554
  this._renderingMode,
4555
+ this._initialArgs,
4425
4556
  t,
4426
4557
  this._outputs,
4427
4558
  this._inputsValid,
4428
- this._sections
4559
+ this._sections,
4560
+ this._title
4429
4561
  );
4430
4562
  }
4431
4563
  /** Renders all provided block settings into a pre-configured platforma API
@@ -4434,26 +4566,36 @@
4434
4566
  done() {
4435
4567
  if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
4436
4568
  const t = {
4437
- sdkVersion: O,
4569
+ v3: {
4570
+ sdkVersion: b,
4571
+ renderingMode: this._renderingMode,
4572
+ initialArgs: this._initialArgs,
4573
+ initialUiState: this._initialUiState,
4574
+ inputsValid: this._inputsValid,
4575
+ sections: this._sections,
4576
+ title: this._title,
4577
+ outputs: this._outputs
4578
+ },
4579
+ // fields below are added to allow previous desktop versions read generated configs
4580
+ sdkVersion: b,
4438
4581
  renderingMode: this._renderingMode,
4439
4582
  initialArgs: this._initialArgs,
4440
- inputsValid: this._inputsValid,
4441
- sections: this._sections,
4442
- outputs: this._outputs
4583
+ inputsValid: I(this._inputsValid),
4584
+ sections: I(this._sections),
4585
+ outputs: Object.fromEntries(
4586
+ Object.entries(this._outputs).map(([n, i2]) => [n, I(i2)])
4587
+ )
4443
4588
  };
4444
- return $() ? x(t) : { config: t };
4589
+ return K() ? x({ sdkVersion: b }) : { config: t };
4445
4590
  }
4446
4591
  }
4447
4592
  const $BlockArgs = z.object({
4448
4593
  numbers: z.array(z.coerce.number())
4449
4594
  });
4450
- const platforma = g.create("Heavy").initialArgs({ numbers: [] }).output(
4451
- "numbers",
4452
- (ctx) => {
4453
- var _a, _b;
4454
- return (_b = (_a = ctx.outputs) == null ? void 0 : _a.resolve("numbers")) == null ? void 0 : _b.getDataAsJson();
4455
- }
4456
- ).output("pFrame", (ctx) => {
4595
+ const platforma = p.create("Heavy").withArgs({ numbers: [] }).withUiState({ dataTableState: void 0 }).output("numbers", (ctx) => {
4596
+ var _a, _b;
4597
+ return (_b = (_a = ctx.outputs) == null ? void 0 : _a.resolve("numbers")) == null ? void 0 : _b.getDataAsJson();
4598
+ }).output("pFrame", (ctx) => {
4457
4599
  const collection = ctx.resultPool.getData();
4458
4600
  if (collection === void 0 || !collection.isComplete) return void 0;
4459
4601
  const valueTypes = ["Int", "Long", "Float", "Double", "String", "Bytes"];