@iota-uz/sdk 0.16.0 → 0.17.1

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.
Files changed (55) hide show
  1. package/dist/client-host/identity.d.ts +4 -4
  2. package/dist/client-host/identity.js +2 -2
  3. package/dist/lens/{CascadePanel-jtC2EUUS.js → CascadePanel-Sd2OKQx-.js} +15 -15
  4. package/dist/lens/{ChartDataEquivalent-BFDdHoQn.js → ChartDataEquivalent-DgCAb4Ov.js} +14 -13
  5. package/dist/lens/ChartPanel-CiAahY9O.js +709 -0
  6. package/dist/lens/{CoveragePanel-5LWQwFMZ.js → CoveragePanel-DeeKg8gF.js} +10 -10
  7. package/dist/lens/{GaugePanel-eVYvp3Hk.js → GaugePanel-8rsf_XHS.js} +8 -8
  8. package/dist/lens/{MapPanel-CzpZKz1Y.js → MapPanel-Bq0mfVCB.js} +14 -14
  9. package/dist/lens/{MetricFlowPanel-CG2Bj7s6.js → MetricFlowPanel-ZBJqPFpc.js} +2 -2
  10. package/dist/lens/{MetricHierarchyPanel-Difdcafn.js → MetricHierarchyPanel-DStGwvVU.js} +2 -2
  11. package/dist/lens/{MetricRelationshipPanel-Cq1dFTeY.js → MetricRelationshipPanel-D6ItmGCS.js} +2 -2
  12. package/dist/lens/{PrintReport-BiUdo8XG.js → PrintReport-Dr-6xXVr.js} +413 -397
  13. package/dist/lens/{TablePanel-_6j7epQg.js → TablePanel-CzLP8gG0.js} +1 -1
  14. package/dist/lens/{adapter-DRShqW45.js → adapter-BwEwcw2W.js} +4960 -4956
  15. package/dist/lens/adapter-CgoRd_uP.js +6 -0
  16. package/dist/lens/charts/adapter.d.ts +1 -0
  17. package/dist/lens/charts/adapter.d.ts.map +1 -1
  18. package/dist/lens/charts/echarts/options.d.ts.map +1 -1
  19. package/dist/lens/charts/keys.d.ts +2 -0
  20. package/dist/lens/charts/keys.d.ts.map +1 -1
  21. package/dist/lens/contract/schemas.d.ts.map +1 -1
  22. package/dist/lens/contract/types.d.ts +1 -0
  23. package/dist/lens/contract/types.d.ts.map +1 -1
  24. package/dist/lens/{index-CmXDbBaF.js → index-B6anZ5Pr.js} +1 -1
  25. package/dist/lens/{index-BBtBPnTb.js → index-R9mnOHaj.js} +684 -667
  26. package/dist/lens/index.js +1 -1
  27. package/dist/lens/{install-ByIx15ES.js → install-CsNOaFxV.js} +1 -1
  28. package/dist/lens/{install-DKwCLbtk.js → install-CumkiUJn.js} +1 -1
  29. package/dist/lens/{install-ByEamXef.js → install-D5OiGDnd.js} +1 -1
  30. package/dist/lens/{install-DIbrzh5h.js → install-VEXJv-Wi.js} +1 -1
  31. package/dist/lens/keys-6_gqLhcv.js +78 -0
  32. package/dist/lens/{metricViews-IoSavtwn.js → metricViews-De-9pff-.js} +1 -1
  33. package/dist/lens/panels/ChartPanel.d.ts.map +1 -1
  34. package/dist/lens/panels/data.d.ts +2 -0
  35. package/dist/lens/panels/data.d.ts.map +1 -1
  36. package/dist/lens/{prefetch-CrMQhAEy.js → prefetch-C_qYKOTU.js} +2 -2
  37. package/dist/lens/{prefetchPanels-BbWAAYrz.js → prefetchPanels-CD4C-A5q.js} +1 -1
  38. package/dist/lens/print/PrintReport.d.ts.map +1 -1
  39. package/dist/lens/{print-CLo-mTEP.js → print-Iu804kRb.js} +18 -18
  40. package/dist/lens/{scales-CChHRiVq.js → scales-CWTA0tSQ.js} +53 -53
  41. package/dist/sdk-identity.cjs +3 -3
  42. package/dist/sdk-identity.js +3 -3
  43. package/dist/sdk-identity.json +2 -2
  44. package/dist/testing/driver.d.ts +19 -0
  45. package/dist/testing/driver.js +103 -30
  46. package/dist/testing/fixtures.d.ts +27 -0
  47. package/dist/testing/fixtures.js +19 -4
  48. package/dist/testing/index.d.ts +3 -2
  49. package/dist/testing/index.js +6 -30
  50. package/dist/testing/lease.d.ts +11 -0
  51. package/dist/testing/lease.js +44 -0
  52. package/package.json +1 -1
  53. package/dist/lens/ChartHost-DTnhnwkn.js +0 -68
  54. package/dist/lens/ChartPanel-_S4IVYdJ.js +0 -730
  55. package/dist/lens/keys-DenV5HsJ.js +0 -12
@@ -1,8 +1,8 @@
1
1
  import { jsx as r, jsxs as f, Fragment as B } from "react/jsx-runtime";
2
2
  import { useMemo as E, useState as I } from "react";
3
- import { o as M, u as T, a0 as k, L as C, a as $, s as j, h as R, z as H, P as U, a5 as W, a2 as S, a3 as P } from "./index-BBtBPnTb.js";
3
+ import { t as M, u as T, a0 as k, L as C, a as $, a5 as j, h as R, A, P as H, a6 as U, a2 as S, a3 as P } from "./index-R9mnOHaj.js";
4
4
  import "@iota-uz/sdk/client-host";
5
- function z(e) {
5
+ function W(e) {
6
6
  if (typeof e == "number" && Number.isFinite(e)) return e;
7
7
  if (typeof e == "string" && e.trim()) {
8
8
  const o = Number(e);
@@ -10,8 +10,8 @@ function z(e) {
10
10
  }
11
11
  return 0;
12
12
  }
13
- function A(e, o, g) {
14
- const h = S(o, k(e, "label") ?? k(e, "category") ?? "label"), v = S(o, k(e, "value") ?? "value"), m = S(o, k(e, "id")), t = o.rows.map((c) => Math.max(0, z(c[v]))), n = t.reduce((c, s) => c + s, 0);
13
+ function D(e, o, g) {
14
+ const h = S(o, k(e, "label") ?? k(e, "category") ?? "label"), v = S(o, k(e, "value") ?? "value"), m = S(o, k(e, "id")), t = o.rows.map((c) => Math.max(0, W(c[v]))), n = t.reduce((c, s) => c + s, 0);
15
15
  return { segments: o.rows.map((c, s) => {
16
16
  const u = m >= 0 ? P(c[m], String(s)) : String(s), l = t[s] ?? 0;
17
17
  return {
@@ -23,7 +23,7 @@ function A(e, o, g) {
23
23
  };
24
24
  }), total: n };
25
25
  }
26
- function D({ activeSegment: e, formatValue: o, onSegmentEnter: g, onSegmentLeave: h, segments: v, total: m, target: t }) {
26
+ function V({ activeSegment: e, formatValue: o, onSegmentEnter: g, onSegmentLeave: h, segments: v, total: m, target: t }) {
27
27
  var u;
28
28
  const n = Math.max(m, t.value) * 1.04;
29
29
  if (n <= 0) return null;
@@ -68,13 +68,13 @@ function D({ activeSegment: e, formatValue: o, onSegmentEnter: g, onSegmentLeave
68
68
  }
69
69
  function K({ panel: e }) {
70
70
  const o = M(e.id), g = T(), h = k(e, "value") ?? "value", v = C(e.format[h]), m = C({ kind: "percent", minorUnits: !1, precision: 0 }), { document: t } = $(), { segments: n, total: i } = E(
71
- () => o.data ? A(e, o.data, j(t.theme, e, { labels: R(o.data, e) })) : { segments: [], total: 0 },
71
+ () => o.data ? D(e, o.data, j(t.theme, e, { labels: R(o.data, e) })) : { segments: [], total: 0 },
72
72
  [t.theme, o.data, e]
73
- ), c = e.headline ?? e.total ?? i, s = n.reduce((a, d) => a + (d.value > 0 ? 1 : 0), 0), u = s > 1 || !!e.target && s > 0, l = H(e), F = l.cardURL(o.data), L = (a) => {
73
+ ), c = e.headline ?? e.total ?? i, s = n.reduce((a, d) => a + (d.value > 0 ? 1 : 0), 0), u = s > 1 || !!e.target && s > 0, l = A(e), F = l.cardURL(o.data), L = (a) => {
74
74
  var d;
75
75
  return l.rowScoped ? l.urlForRow(o.data, (d = o.data) == null ? void 0 : d.rows[a]) : void 0;
76
76
  }, [b, w] = I(), y = (a) => w(a), N = (a) => w((d) => d === a ? void 0 : d);
77
- return /* @__PURE__ */ r(U, { panel: e, frame: o, children: /* @__PURE__ */ r(W, { href: F, label: e.title, onClick: l.onClick(F), children: /* @__PURE__ */ f("div", { className: "lens-coverage", "data-segment-active": b ? "true" : void 0, children: [
77
+ return /* @__PURE__ */ r(H, { panel: e, frame: o, children: /* @__PURE__ */ r(U, { href: F, label: e.title, onClick: l.onClick(F), children: /* @__PURE__ */ f("div", { className: "lens-coverage", "data-segment-active": b ? "true" : void 0, children: [
78
78
  /* @__PURE__ */ f("p", { className: "lens-coverage-headline", children: [
79
79
  /* @__PURE__ */ r("span", { className: "lens-coverage-headline-value", children: v(c) }),
80
80
  /* @__PURE__ */ r("span", { className: "lens-coverage-headline-label", children: g("panel.total", "Total") })
@@ -91,7 +91,7 @@ function K({ panel: e }) {
91
91
  a.key
92
92
  )) }),
93
93
  u && e.target && /* @__PURE__ */ r(
94
- D,
94
+ V,
95
95
  {
96
96
  activeSegment: b,
97
97
  formatValue: v,
@@ -127,5 +127,5 @@ function K({ panel: e }) {
127
127
  }
128
128
  export {
129
129
  K as CoveragePanel,
130
- A as buildCoverageSegments
130
+ D as buildCoverageSegments
131
131
  };
@@ -1,5 +1,5 @@
1
- import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
- import { o as N, u as F, L as b, P as M } from "./index-BBtBPnTb.js";
1
+ import { jsx as e, jsxs as n } from "react/jsx-runtime";
2
+ import { t as N, u as F, L as b, P as M } from "./index-R9mnOHaj.js";
3
3
  import "@iota-uz/sdk/client-host";
4
4
  import "react";
5
5
  function y(a) {
@@ -10,27 +10,27 @@ function y(a) {
10
10
  }
11
11
  function j({ panel: a }) {
12
12
  var g, h, f, v;
13
- const r = N(a.id), m = F(), s = a.encoding.value, o = ((g = r.data) == null ? void 0 : g.columns.findIndex((p) => p.name === s)) ?? -1, c = o >= 0 ? y((f = (h = r.data) == null ? void 0 : h.rows[0]) == null ? void 0 : f[o]) : void 0, i = b(s ? a.format[s] : void 0), n = ((v = a.radial) == null ? void 0 : v.max) ?? 1, l = Math.max(0, Math.min(n, c ?? 0)), x = n > 0 ? l / n * 100 : 0, u = i(c), d = i(n);
14
- return /* @__PURE__ */ e(M, { panel: a, frame: r, children: /* @__PURE__ */ t(
13
+ const r = N(a.id), m = F(), s = a.encoding.value, o = ((g = r.data) == null ? void 0 : g.columns.findIndex((p) => p.name === s)) ?? -1, c = o >= 0 ? y((f = (h = r.data) == null ? void 0 : h.rows[0]) == null ? void 0 : f[o]) : void 0, i = b(s ? a.format[s] : void 0), t = ((v = a.radial) == null ? void 0 : v.max) ?? 1, l = Math.max(0, Math.min(t, c ?? 0)), x = t > 0 ? l / t * 100 : 0, u = i(c), d = i(t);
14
+ return /* @__PURE__ */ e(M, { panel: a, frame: r, children: /* @__PURE__ */ n(
15
15
  "div",
16
16
  {
17
17
  "aria-label": m("chart.gaugeValue", "{name} value", { name: a.title }),
18
- "aria-valuemax": n,
18
+ "aria-valuemax": t,
19
19
  "aria-valuemin": 0,
20
20
  "aria-valuenow": l,
21
21
  "aria-valuetext": u,
22
22
  className: "lens-gauge",
23
23
  role: "meter",
24
24
  children: [
25
- /* @__PURE__ */ t("svg", { "aria-hidden": "true", className: "lens-gauge-arc", viewBox: "0 0 120 70", children: [
25
+ /* @__PURE__ */ n("svg", { "aria-hidden": "true", className: "lens-gauge-arc", viewBox: "0 0 120 70", children: [
26
26
  /* @__PURE__ */ e("path", { className: "lens-gauge-track", d: "M10 60 A50 50 0 0 1 110 60", pathLength: "100" }),
27
27
  /* @__PURE__ */ e("path", { className: "lens-gauge-value-arc", d: "M10 60 A50 50 0 0 1 110 60", pathLength: "100", style: { strokeDasharray: `${x} 100` } })
28
28
  ] }),
29
- /* @__PURE__ */ t("div", { className: "lens-gauge-reading", children: [
29
+ /* @__PURE__ */ n("div", { className: "lens-gauge-reading", children: [
30
30
  /* @__PURE__ */ e("strong", { children: u }),
31
31
  /* @__PURE__ */ e("span", { children: m("chart.gaugeRange", "of {maximum}", { maximum: d }) })
32
32
  ] }),
33
- /* @__PURE__ */ t("div", { "aria-hidden": "true", className: "lens-gauge-scale", children: [
33
+ /* @__PURE__ */ n("div", { "aria-hidden": "true", className: "lens-gauge-scale", children: [
34
34
  /* @__PURE__ */ e("span", { children: i(0) }),
35
35
  /* @__PURE__ */ e("span", { children: d })
36
36
  ] })
@@ -1,10 +1,10 @@
1
1
  import { jsx as M, jsxs as U, Fragment as J } from "react/jsx-runtime";
2
2
  import { useState as N, useEffect as k, useMemo as $, useCallback as O } from "react";
3
- import { o as T, a as D, t as G, u as _, L as q, z, P as B } from "./index-BBtBPnTb.js";
3
+ import { t as T, a as D, x as G, u as _, L as q, A as B, P as K } from "./index-R9mnOHaj.js";
4
4
  import "@iota-uz/sdk/client-host";
5
- import { C as K } from "./ChartDataEquivalent-BFDdHoQn.js";
6
- import { C as W } from "./ChartHost-DTnhnwkn.js";
7
- const F = 5 * 1024 * 1024;
5
+ import { C as W } from "./ChartDataEquivalent-DgCAb4Ov.js";
6
+ import { C as z } from "./keys-6_gqLhcv.js";
7
+ const A = 5 * 1024 * 1024;
8
8
  function H(e, a) {
9
9
  var c, r, o, d;
10
10
  const i = a.trim(), l = i.split(/[-_]/, 1)[0] ?? "";
@@ -13,7 +13,7 @@ function H(e, a) {
13
13
  function E(e) {
14
14
  return e !== null && typeof e == "object" && !Array.isArray(e) ? e : void 0;
15
15
  }
16
- function A(e, a) {
16
+ function F(e, a) {
17
17
  const i = E(e);
18
18
  if ((i == null ? void 0 : i.type) !== "FeatureCollection" || !Array.isArray(i.features) || i.features.length === 0)
19
19
  throw new Error("Map geometry must be a non-empty GeoJSON FeatureCollection");
@@ -56,10 +56,10 @@ async function X(e, a, i = fetch, l) {
56
56
  var y;
57
57
  const c = e.inline !== void 0, r = typeof e.url == "string" && e.url.trim() !== "";
58
58
  if (c === r) throw new Error("Map source requires exactly one of inline or URL");
59
- if (c) return A(e.inline, a);
59
+ if (c) return F(e.inline, a);
60
60
  const o = e.maxBytes ?? 0;
61
- if (!Number.isInteger(o) || o <= 0 || o > F)
62
- throw new Error(`Map source maxBytes must be between 1 and ${F}`);
61
+ if (!Number.isInteger(o) || o <= 0 || o > A)
62
+ throw new Error(`Map source maxBytes must be between 1 and ${A}`);
63
63
  const d = e.url;
64
64
  if (!d.startsWith("/") || d.startsWith("//") || d.includes("\\")) throw new Error("Map source URL must be same-origin");
65
65
  const t = typeof window > "u" ? "http://localhost" : window.location.href, n = new URL(d, t);
@@ -80,7 +80,7 @@ async function X(e, a, i = fetch, l) {
80
80
  } catch {
81
81
  throw new Error("Map geometry response is not valid JSON");
82
82
  }
83
- return A(f, a);
83
+ return F(f, a);
84
84
  }
85
85
  function Y(e, a, i) {
86
86
  const l = e.map;
@@ -99,7 +99,7 @@ function Y(e, a, i) {
99
99
  }
100
100
  function ne({ panel: e, adapter: a, fetcher: i, frame: l }) {
101
101
  var C;
102
- const c = T(e.id), r = l ?? c, { document: o } = D(), { drillInto: d } = G(), t = _(), n = q(e.encoding.value ? e.format[e.encoding.value] : void 0), s = z(e), [g, v] = N(0), [f, y] = N({ loading: !0 }), u = e.map, P = u ? H(u, ((C = o.meta) == null ? void 0 : C.locale) ?? "") : void 0;
102
+ const c = T(e.id), r = l ?? c, { document: o } = D(), { drillInto: d } = G(), t = _(), n = q(e.encoding.value ? e.format[e.encoding.value] : void 0), s = B(e), [g, v] = N(0), [f, y] = N({ loading: !0 }), u = e.map, P = u ? H(u, ((C = o.meta) == null ? void 0 : C.locale) ?? "") : void 0;
103
103
  k(() => {
104
104
  const m = new AbortController();
105
105
  return y({ loading: !0 }), u ? (X(u.source, u.featureProperty, i, m.signal).then((w) => y({ loading: !1, data: w })).catch((w) => {
@@ -143,9 +143,9 @@ function ne({ panel: e, adapter: a, fetcher: i, frame: l }) {
143
143
  const I = r.data.columns.findIndex(({ name: x }) => x === e.encoding.id), j = r.data.rows.find((x) => x[I] === m);
144
144
  s.activate(s.urlForRow(r.data, j), void 0, { newTab: h == null ? void 0 : h.newTab });
145
145
  }, [d, r.data, s, e.drillRoot, e.encoding.id, e.id]);
146
- return /* @__PURE__ */ M(B, { panel: e, frame: R, children: b && /* @__PURE__ */ U(J, { children: [
146
+ return /* @__PURE__ */ M(K, { panel: e, frame: R, children: b && /* @__PURE__ */ U(J, { children: [
147
147
  /* @__PURE__ */ M(
148
- K,
148
+ W,
149
149
  {
150
150
  actionable: L,
151
151
  format: b.format,
@@ -157,7 +157,7 @@ function ne({ panel: e, adapter: a, fetcher: i, frame: l }) {
157
157
  }
158
158
  ),
159
159
  /* @__PURE__ */ M(
160
- W,
160
+ z,
161
161
  {
162
162
  adapter: a,
163
163
  drillable: L,
@@ -171,7 +171,7 @@ function ne({ panel: e, adapter: a, fetcher: i, frame: l }) {
171
171
  ] }) });
172
172
  }
173
173
  export {
174
- F as MAX_MAP_GEOJSON_BYTES,
174
+ A as MAX_MAP_GEOJSON_BYTES,
175
175
  ne as MapPanel,
176
176
  X as loadMapGeometry,
177
177
  Y as mapJoinError,
@@ -1,8 +1,8 @@
1
1
  import { jsxs as d, jsx as o, Fragment as F } from "react/jsx-runtime";
2
2
  import { useMemo as m } from "react";
3
- import { o as C, u as h, a0 as P, L as x, a6 as D, b as q, P as E } from "./index-BBtBPnTb.js";
3
+ import { t as C, u as h, a0 as P, L as x, a7 as D, b as q, P as E } from "./index-R9mnOHaj.js";
4
4
  import "@iota-uz/sdk/client-host";
5
- import { f as K, r as L, d as M, Q } from "./metricViews-IoSavtwn.js";
5
+ import { f as K, r as L, d as M, Q } from "./metricViews-De-9pff-.js";
6
6
  function v() {
7
7
  const e = h();
8
8
  return m(() => ({
@@ -1,8 +1,8 @@
1
1
  import { jsx as l, jsxs as t, Fragment as E } from "react/jsx-runtime";
2
2
  import { useMemo as d } from "react";
3
- import { o as K, u as x, a0 as N, L as g, a6 as A, b as D, P as L } from "./index-BBtBPnTb.js";
3
+ import { t as K, u as x, a0 as N, L as g, a7 as A, b as D, P as L } from "./index-R9mnOHaj.js";
4
4
  import "@iota-uz/sdk/client-host";
5
- import { h as M, r as Q, Q as V } from "./metricViews-IoSavtwn.js";
5
+ import { h as M, r as Q, Q as V } from "./metricViews-De-9pff-.js";
6
6
  function j() {
7
7
  const a = x();
8
8
  return d(() => ({
@@ -1,8 +1,8 @@
1
1
  import { jsx as s, jsxs as u, Fragment as A } from "react/jsx-runtime";
2
2
  import { useMemo as E } from "react";
3
- import { o as K, u as P, a0 as R, L as T, a6 as $, b as g, P as z } from "./index-BBtBPnTb.js";
3
+ import { t as K, u as P, a0 as R, L as T, a7 as $, b as g, P as z } from "./index-R9mnOHaj.js";
4
4
  import "@iota-uz/sdk/client-host";
5
- import { a as C, c as L, b as O, e as Q, Q as V } from "./metricViews-IoSavtwn.js";
5
+ import { a as C, c as L, b as O, e as Q, Q as V } from "./metricViews-De-9pff-.js";
6
6
  function j() {
7
7
  const a = P();
8
8
  return E(() => ({