@milaboratories/milaboratories.ui-examples.model 1.1.36 → 1.1.37

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.
@@ -1,6 +1,6 @@
1
1
   WARN  Issue while reading "/opt/actions-runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
2
2
 
3
- > @milaboratories/milaboratories.ui-examples.model@1.1.36 build /opt/actions-runner/_work/platforma/platforma/etc/blocks/ui-examples/model
3
+ > @milaboratories/milaboratories.ui-examples.model@1.1.37 build /opt/actions-runner/_work/platforma/platforma/etc/blocks/ui-examples/model
4
4
  > tsup && vite build && block-tools build-model
5
5
 
6
6
  CLI Building entry: src/index.ts
@@ -13,12 +13,12 @@
13
13
  ESM Build start
14
14
  CJS dist/index.cjs 4.88 KB
15
15
  CJS dist/index.cjs.map 11.28 KB
16
- CJS ⚡️ Build success in 194ms
16
+ CJS ⚡️ Build success in 116ms
17
17
  ESM dist/index.js 4.74 KB
18
18
  ESM dist/index.js.map 11.23 KB
19
- ESM ⚡️ Build success in 195ms
19
+ ESM ⚡️ Build success in 117ms
20
20
  DTS Build start
21
- DTS ⚡️ Build success in 1597ms
21
+ DTS ⚡️ Build success in 1562ms
22
22
  DTS dist/index.d.cts 2.40 KB
23
23
  DTS dist/index.d.ts 2.40 KB
24
24
  vite v5.4.11 building for production...
@@ -26,6 +26,6 @@ transforming...
26
26
  ✓ 9 modules transformed.
27
27
  rendering chunks...
28
28
  computing gzip size...
29
- dist/bundle.js 175.56 kB │ gzip: 33.75 kB │ map: 376.82 kB
30
- dist/bundle.js 187.71 kB │ gzip: 34.38 kB │ map: 378.27 kB
31
- ✓ built in 832ms
29
+ dist/bundle.js 175.93 kB │ gzip: 33.81 kB │ map: 377.52 kB
30
+ dist/bundle.js 188.10 kB │ gzip: 34.43 kB │ map: 378.97 kB
31
+ ✓ built in 683ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @milaboratories/milaboratories.ui-examples.model
2
2
 
3
+ ## 1.1.37
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [11f6e3e]
8
+ - @platforma-sdk/model@1.27.17
9
+
3
10
  ## 1.1.36
4
11
 
5
12
  ### Patch Changes
package/dist/bundle.js CHANGED
@@ -3948,8 +3948,8 @@
3948
3948
  quotelessJson,
3949
3949
  ZodError
3950
3950
  });
3951
- var $ = Object.defineProperty;
3952
- var L = (n2, t, e) => t in n2 ? $(n2, t, { enumerable: true, configurable: true, writable: true, value: e }) : n2[t] = e;
3951
+ var $$1 = Object.defineProperty;
3952
+ var L = (n2, t, e) => t in n2 ? $$1(n2, t, { enumerable: true, configurable: true, writable: true, value: e }) : n2[t] = e;
3953
3953
  var p$1 = (n2, t, e) => L(n2, typeof t != "symbol" ? t + "" : t, e);
3954
3954
  function w(n2) {
3955
3955
  throw new Error("Unexpected object: " + n2);
@@ -4299,7 +4299,7 @@
4299
4299
  }
4300
4300
  return true;
4301
4301
  }
4302
- function N$1(n2, t) {
4302
+ function N(n2, t) {
4303
4303
  if (t.name !== void 0 && n2.name !== t.name || t.namePattern !== void 0 && !new RegExp(t.namePattern).test(n2.name))
4304
4304
  return false;
4305
4305
  if (t.type !== void 0) {
@@ -4346,7 +4346,7 @@
4346
4346
  return true;
4347
4347
  }
4348
4348
  function Bn(n2) {
4349
- return Array.isArray(n2) ? (t) => n2.some((e) => f(t) && N$1(t, e)) : (t) => f(t) && N$1(t, n2);
4349
+ return Array.isArray(n2) ? (t) => n2.some((e) => f(t) && N(t, e)) : (t) => f(t) && N(t, n2);
4350
4350
  }
4351
4351
  z$2.object({
4352
4352
  __isRef: z$2.literal(true).describe("Crucial marker for the block dependency tree reconstruction"),
@@ -4417,7 +4417,7 @@
4417
4417
  });
4418
4418
  var _e = Object.defineProperty;
4419
4419
  var Ie = (t, e, n2) => e in t ? _e(t, e, { enumerable: true, configurable: true, writable: true, value: n2 }) : t[e] = n2;
4420
- var T = (t, e, n2) => Ie(t, typeof e != "symbol" ? e + "" : e, n2);
4420
+ var F = (t, e, n2) => Ie(t, typeof e != "symbol" ? e + "" : e, n2);
4421
4421
  function Y(t) {
4422
4422
  return { type: "Immediate", value: t };
4423
4423
  }
@@ -4430,7 +4430,7 @@
4430
4430
  if (typeof globalThis.platforma < "u") return globalThis.platforma;
4431
4431
  throw new Error("Can't get platforma instance.");
4432
4432
  }
4433
- function $e() {
4433
+ function Je() {
4434
4434
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
4435
4435
  }
4436
4436
  function h() {
@@ -4438,13 +4438,13 @@
4438
4438
  throw new Error("Not in config rendering context");
4439
4439
  }
4440
4440
  function q(t, e) {
4441
- const n2 = $e();
4441
+ const n2 = Je();
4442
4442
  if (n2 === void 0) return false;
4443
4443
  if (t in n2.callbackRegistry) throw new Error(`Callback with key ${t} already registered.`);
4444
4444
  return n2.callbackRegistry[t] = e, true;
4445
4445
  }
4446
4446
  const ne = /* @__PURE__ */ new Map();
4447
- function Je(t, e) {
4447
+ function Ne(t, e) {
4448
4448
  t in h().callbackRegistry || (h().callbackRegistry[t] = (n2) => {
4449
4449
  for (const r of ne.get(t))
4450
4450
  r(n2);
@@ -4452,9 +4452,9 @@
4452
4452
  }
4453
4453
  class S {
4454
4454
  constructor(e, n2 = (r) => r) {
4455
- T(this, "isResolved", false);
4456
- T(this, "resolvedValue");
4457
- this.handle = e, this.postProcess = n2, Je(e, (r) => {
4455
+ F(this, "isResolved", false);
4456
+ F(this, "resolvedValue");
4457
+ this.handle = e, this.postProcess = n2, Ne(e, (r) => {
4458
4458
  this.resolvedValue = n2(r), this.isResolved = true;
4459
4459
  });
4460
4460
  }
@@ -4695,39 +4695,99 @@
4695
4695
  }
4696
4696
  }
4697
4697
  const ve = "staging", we = "main";
4698
- const Ue = "pl7.app/label", Me = "pl7.app/trace", Ge = z$2.object({
4698
+ function Ue(t, e) {
4699
+ const n2 = [...e].sort((s2, o) => o[0] - s2[0]);
4700
+ if (t.type === "JsonPartitioned" || t.type === "BinaryPartitioned") {
4701
+ const { partitionKeyLength: s2 } = t;
4702
+ for (const [o] of e)
4703
+ if (o >= s2)
4704
+ throw new Error(`Can't filter on non-partitioned axis ${o}. Must be >= ${s2}`);
4705
+ } else if (t.type === "Json") {
4706
+ const { keyLength: s2 } = t;
4707
+ for (const [o] of e)
4708
+ if (o >= s2)
4709
+ throw new Error(`Can't filter on non-data axis ${o}. Must be >= ${s2}`);
4710
+ }
4711
+ const r = (s2) => {
4712
+ for (const [o, a] of n2)
4713
+ if (s2[o] !== a)
4714
+ return false;
4715
+ return true;
4716
+ }, i = (s2) => {
4717
+ const o = [...s2];
4718
+ for (const [a] of n2)
4719
+ o.splice(a, 1);
4720
+ return o;
4721
+ };
4722
+ switch (t.type) {
4723
+ case "Json": {
4724
+ const s2 = t.data.filter((o) => r(o.key)).map((o) => ({
4725
+ key: i(o.key),
4726
+ value: o.value
4727
+ }));
4728
+ return {
4729
+ type: "Json",
4730
+ keyLength: t.keyLength - e.length,
4731
+ data: s2
4732
+ };
4733
+ }
4734
+ case "JsonPartitioned": {
4735
+ const s2 = t.parts.filter((o) => r(o.key)).map((o) => ({
4736
+ key: i(o.key),
4737
+ value: o.value
4738
+ }));
4739
+ return {
4740
+ type: "JsonPartitioned",
4741
+ partitionKeyLength: t.partitionKeyLength - e.length,
4742
+ parts: s2
4743
+ };
4744
+ }
4745
+ case "BinaryPartitioned": {
4746
+ const s2 = t.parts.filter((o) => r(o.key)).map((o) => ({
4747
+ key: i(o.key),
4748
+ value: o.value
4749
+ }));
4750
+ return {
4751
+ type: "BinaryPartitioned",
4752
+ partitionKeyLength: t.partitionKeyLength - e.length,
4753
+ parts: s2
4754
+ };
4755
+ }
4756
+ }
4757
+ }
4758
+ const Me = "pl7.app/label", Ge = "pl7.app/trace", We = z$2.object({
4699
4759
  type: z$2.string(),
4700
4760
  importance: z$2.number().optional(),
4701
4761
  id: z$2.string().optional(),
4702
4762
  label: z$2.string()
4703
- }), We = z$2.array(Ge), He = 1e-3, qe = "__LABEL__", pe = "__LABEL__@1";
4763
+ }), He = z$2.array(We), qe = 1e-3, ze = "__LABEL__", pe = "__LABEL__@1";
4704
4764
  function de(t, e, n2 = {}) {
4705
4765
  const r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s2 = t.map((f2) => {
4706
4766
  var R, k2;
4707
4767
  const p2 = e(f2);
4708
4768
  let d, y2, g2;
4709
4769
  "spec" in p2 && typeof p2.spec == "object" ? (d = p2.spec, y2 = p2.prefixTrace, g2 = p2.suffixTrace) : d = p2;
4710
- const v = (R = d.annotations) == null ? void 0 : R[Ue], w2 = (k2 = d.annotations) == null ? void 0 : k2[Me], x2 = (w2 ? We.safeParse(JSON.parse(w2)).data : void 0) ?? [], C = [
4770
+ const v = (R = d.annotations) == null ? void 0 : R[Me], w2 = (k2 = d.annotations) == null ? void 0 : k2[Ge], x2 = (w2 ? He.safeParse(JSON.parse(w2)).data : void 0) ?? [], C = [
4711
4771
  ...y2 ?? [],
4712
4772
  ...x2,
4713
4773
  ...g2 ?? []
4714
4774
  ];
4715
4775
  if (v) {
4716
- const A = { label: v, type: qe, importance: -2 };
4776
+ const A = { label: v, type: ze, importance: -2 };
4717
4777
  n2.addLabelAsSuffix ? C.push(A) : C.splice(0, 0, A);
4718
4778
  }
4719
- const P2 = [], F = /* @__PURE__ */ new Map();
4779
+ const P2 = [], T = /* @__PURE__ */ new Map();
4720
4780
  for (let A = C.length - 1; A >= 0; --A) {
4721
- const { type: j } = C[A], V = C[A].importance ?? 0, K = (F.get(j) ?? 0) + 1;
4722
- F.set(j, K);
4723
- const $2 = `${j}@${K}`;
4724
- i.set($2, (i.get($2) ?? 0) + 1), r.set(
4725
- $2,
4781
+ const { type: j } = C[A], V = C[A].importance ?? 0, K = (T.get(j) ?? 0) + 1;
4782
+ T.set(j, K);
4783
+ const J = `${j}@${K}`;
4784
+ i.set(J, (i.get(J) ?? 0) + 1), r.set(
4785
+ J,
4726
4786
  Math.max(
4727
- r.get($2) ?? Number.NEGATIVE_INFINITY,
4728
- V - (C.length - A) * He
4787
+ r.get(J) ?? Number.NEGATIVE_INFINITY,
4788
+ V - (C.length - A) * qe
4729
4789
  )
4730
- ), P2.push({ ...C[A], fullType: $2, occurenceIndex: K });
4790
+ ), P2.push({ ...C[A], fullType: J, occurenceIndex: K });
4731
4791
  }
4732
4792
  return P2.reverse(), {
4733
4793
  value: f2,
@@ -4762,7 +4822,7 @@
4762
4822
  }
4763
4823
  return l2(/* @__PURE__ */ new Set([...o, ...a]));
4764
4824
  }
4765
- const H = "PColumnData/", Q = H + "ResourceMap", Z = H + "Partitioned/ResourceMap", N = H + "JsonPartitioned", E = H + "BinaryPartitioned", Ae = H + "Partitioned/", ee = Ae + "JsonPartitioned", B = Ae + "BinaryPartitioned";
4825
+ const H = "PColumnData/", Q = H + "ResourceMap", Z = H + "Partitioned/ResourceMap", $ = H + "JsonPartitioned", E = H + "BinaryPartitioned", Ae = H + "Partitioned/", ee = Ae + "JsonPartitioned", B = Ae + "BinaryPartitioned";
4766
4826
  const ae = (t) => {
4767
4827
  if (t.endsWith(".index"))
4768
4828
  return { baseKey: t.substring(0, t.length - 6), type: "index" };
@@ -4770,7 +4830,7 @@
4770
4830
  return { baseKey: t.substring(0, t.length - 7), type: "values" };
4771
4831
  throw new Error(`key must ends on .index/.values for binary p-column, got: ${t}`);
4772
4832
  };
4773
- function ze(t) {
4833
+ function Ye(t) {
4774
4834
  if (!t) return;
4775
4835
  const e = t.resourceType.name, n2 = t.getDataAsJson(), r = [];
4776
4836
  let i = 0;
@@ -4781,7 +4841,7 @@
4781
4841
  case Z:
4782
4842
  i = n2.partitionKeyLength + n2.keyLength;
4783
4843
  break;
4784
- case N:
4844
+ case $:
4785
4845
  case E:
4786
4846
  i = n2.partitionKeyLength;
4787
4847
  break;
@@ -4792,7 +4852,7 @@
4792
4852
  }
4793
4853
  switch (e) {
4794
4854
  case Q:
4795
- case N:
4855
+ case $:
4796
4856
  case E:
4797
4857
  for (let s2 of t.listInputFields()) {
4798
4858
  e === E && (s2 = ae(s2).baseKey);
@@ -4816,8 +4876,8 @@
4816
4876
  }
4817
4877
  return { data: r, keyLength: i };
4818
4878
  }
4819
- function Ye(t) {
4820
- const e = ze(t);
4879
+ function Xe(t) {
4880
+ const e = Ye(t);
4821
4881
  if (!e) return;
4822
4882
  const { data: n2, keyLength: r } = e, i = [];
4823
4883
  for (let s2 = 0; s2 < r; ++s2)
@@ -4839,7 +4899,7 @@
4839
4899
  case Q:
4840
4900
  case Z:
4841
4901
  throw new Error(`Only data columns are supported, got: ${n2}`);
4842
- case N: {
4902
+ case $: {
4843
4903
  if (typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
4844
4904
  throw new Error(`Missing partitionKeyLength in metadata for ${n2}`);
4845
4905
  const i = [];
@@ -4889,8 +4949,8 @@
4889
4949
  for (const o of t.listInputFields()) {
4890
4950
  const a = t.resolve({ field: o, assertFieldType: "Input" });
4891
4951
  if (a === void 0) return;
4892
- if (a.resourceType.name !== N)
4893
- throw new Error(`Expected ${N} inside ${n2}, but got ${a.resourceType.name}`);
4952
+ if (a.resourceType.name !== $)
4953
+ throw new Error(`Expected ${$} inside ${n2}, but got ${a.resourceType.name}`);
4894
4954
  const c2 = le(a, JSON.parse(o));
4895
4955
  if (c2 === void 0) return;
4896
4956
  if (c2.type !== "JsonPartitioned")
@@ -4928,66 +4988,6 @@
4928
4988
  throw new Error(`Unknown resource type: ${n2}`);
4929
4989
  }
4930
4990
  }
4931
- function Xe(t, e) {
4932
- const n2 = [...e].sort((s2, o) => o[0] - s2[0]);
4933
- if (t.type === "JsonPartitioned" || t.type === "BinaryPartitioned") {
4934
- const { partitionKeyLength: s2 } = t;
4935
- for (const [o] of e)
4936
- if (o >= s2)
4937
- throw new Error(`Can't filter on non-partitioned axis ${o}. Must be >= ${s2}`);
4938
- } else if (t.type === "Json") {
4939
- const { keyLength: s2 } = t;
4940
- for (const [o] of e)
4941
- if (o >= s2)
4942
- throw new Error(`Can't filter on non-data axis ${o}. Must be >= ${s2}`);
4943
- }
4944
- const r = (s2) => {
4945
- for (const [o, a] of n2)
4946
- if (s2[o] !== a)
4947
- return false;
4948
- return true;
4949
- }, i = (s2) => {
4950
- const o = [...s2];
4951
- for (const [a] of n2)
4952
- o.splice(a, 1);
4953
- return o;
4954
- };
4955
- switch (t.type) {
4956
- case "Json": {
4957
- const s2 = t.data.filter((o) => r(o.key)).map((o) => ({
4958
- key: i(o.key),
4959
- value: o.value
4960
- }));
4961
- return {
4962
- type: "Json",
4963
- keyLength: t.keyLength - e.length,
4964
- data: s2
4965
- };
4966
- }
4967
- case "JsonPartitioned": {
4968
- const s2 = t.parts.filter((o) => r(o.key)).map((o) => ({
4969
- key: i(o.key),
4970
- value: o.value
4971
- }));
4972
- return {
4973
- type: "JsonPartitioned",
4974
- partitionKeyLength: t.partitionKeyLength - e.length,
4975
- parts: s2
4976
- };
4977
- }
4978
- case "BinaryPartitioned": {
4979
- const s2 = t.parts.filter((o) => r(o.key)).map((o) => ({
4980
- key: i(o.key),
4981
- value: o.value
4982
- }));
4983
- return {
4984
- type: "BinaryPartitioned",
4985
- partitionKeyLength: t.partitionKeyLength - e.length,
4986
- parts: s2
4987
- };
4988
- }
4989
- }
4990
- }
4991
4991
  function re(t, e) {
4992
4992
  if (t === void 0) return e === void 0;
4993
4993
  if (e === void 0) return true;
@@ -5013,7 +5013,7 @@
5013
5013
  }
5014
5014
  class et {
5015
5015
  constructor() {
5016
- T(this, "ctx", h());
5016
+ F(this, "ctx", h());
5017
5017
  }
5018
5018
  /**
5019
5019
  * @deprecated use getOptions()
@@ -5062,32 +5062,32 @@
5062
5062
  return;
5063
5063
  }
5064
5064
  if (!Y$1(g2)) throw new Error(`Assertion failed: expected PColumn, got ${g2.spec.kind}`);
5065
- const v = Ye(g2.data);
5065
+ const v = Xe(g2.data);
5066
5066
  if (!v) {
5067
5067
  if (r != null && r.dontWaitAllData) continue;
5068
5068
  return;
5069
5069
  }
5070
5070
  if (p2 >= v.length)
5071
5071
  throw new Error(`Not enough partition keys for the requested split axes in column ${y$1.name}`);
5072
- const w2 = f$1.map((P2) => this.findLabels(y(y$1.axesSpec[P2]))), x2 = [], C = (P2, F) => {
5073
- if (F >= f$1.length) {
5072
+ const w2 = f$1.map((P2) => this.findLabels(y(y$1.axesSpec[P2]))), x2 = [], C = (P2, T) => {
5073
+ if (T >= f$1.length) {
5074
5074
  x2.push([...P2]);
5075
5075
  return;
5076
5076
  }
5077
- const R = f$1[F], k2 = v[R];
5077
+ const R = f$1[T], k2 = v[R];
5078
5078
  for (const A of k2)
5079
- P2.push(A), C(P2, F + 1), P2.pop();
5079
+ P2.push(A), C(P2, T + 1), P2.pop();
5080
5080
  };
5081
5081
  C([], 0);
5082
5082
  for (const P2 of x2) {
5083
- const F = P2.map((R, k2) => {
5083
+ const T = P2.map((R, k2) => {
5084
5084
  const A = f$1[k2], j = y(y$1.axesSpec[A]), V = w2[k2], K = (V == null ? void 0 : V[R]) ?? String(R);
5085
5085
  return { axisIdx: A, axisId: j, value: R, label: K };
5086
5086
  });
5087
5087
  a.push({
5088
5088
  obj: y$1,
5089
5089
  ref: d,
5090
- axisFilters: F
5090
+ axisFilters: T
5091
5091
  });
5092
5092
  }
5093
5093
  }
@@ -5152,7 +5152,7 @@
5152
5152
  g2.axisIdx,
5153
5153
  g2.value
5154
5154
  ]);
5155
- m2 = Xe(l2, p2);
5155
+ m2 = Ue(l2, p2);
5156
5156
  const d = [...a.axisFilters].map((g2) => g2.axisIdx).sort((g2, v) => v - g2), y2 = [...u2.axesSpec];
5157
5157
  for (const g2 of d)
5158
5158
  y2.splice(g2, 1);
@@ -5353,14 +5353,26 @@
5353
5353
  }
5354
5354
  }
5355
5355
  }
5356
+ /**
5357
+ * Find labels data for a given axis id of a p-column.
5358
+ * @returns a map of axis value => label
5359
+ */
5360
+ findLabelsForColumnAxis(e, n2) {
5361
+ const r = this.findLabels(e.spec.axesSpec[n2]);
5362
+ if (r)
5363
+ return Object.fromEntries(e.data.listInputFields().map((i) => {
5364
+ const s2 = JSON.parse(i);
5365
+ return [s2[n2], r[s2[n2]] ?? "Unlabelled"];
5366
+ }));
5367
+ }
5356
5368
  }
5357
5369
  class z {
5358
5370
  constructor() {
5359
- T(this, "ctx");
5360
- T(this, "args");
5361
- T(this, "uiState");
5362
- T(this, "_activeArgsCache");
5363
- T(this, "resultPool", new et());
5371
+ F(this, "ctx");
5372
+ F(this, "args");
5373
+ F(this, "uiState");
5374
+ F(this, "_activeArgsCache");
5375
+ F(this, "resultPool", new et());
5364
5376
  this.ctx = h(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : {};
5365
5377
  }
5366
5378
  /**
@@ -5428,7 +5440,7 @@
5428
5440
  return this.ctx.getCurrentUnstableMarker();
5429
5441
  }
5430
5442
  }
5431
- const U = "1.27.10";
5443
+ const U = "1.27.17";
5432
5444
  function tt(t) {
5433
5445
  return t.__renderLambda === true;
5434
5446
  }