react-semaphor 0.1.585 → 0.1.586

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 (40) hide show
  1. package/dist/analytics-protocol/index.js +102 -100
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/briefings/index.js +1 -1
  4. package/dist/chunks/{assistant-chat-BdbLmAnK.js → assistant-chat-BU5gchFy.js} +6 -6
  5. package/dist/chunks/{bookmark-impact-BhT3k379.js → bookmark-impact-ZPSGncK6.js} +1 -1
  6. package/dist/chunks/{card-filter-builder-CEcKF6Fw.js → card-filter-builder-HELJWA4D.js} +165 -165
  7. package/dist/chunks/{dashboard-MPku_x1M.js → dashboard-BXP-ZxSY.js} +1 -1
  8. package/dist/chunks/{dashboard-briefing-launcher-CkFNlkr1.js → dashboard-briefing-launcher-BGj42whr.js} +7 -7
  9. package/dist/chunks/{dashboard-controls-Clt4ovXS.js → dashboard-controls-zvbRp6D2.js} +7 -7
  10. package/dist/chunks/{dashboard-json-DSmXazIg.js → dashboard-json-CykexgqL.js} +1 -1
  11. package/dist/chunks/{dates-CYZW9owO.js → dates-CaqZtq01.js} +4 -4
  12. package/dist/chunks/{edit-dashboard-visual-Dn2ECRbX.js → edit-dashboard-visual-C82JNxbt.js} +501 -501
  13. package/dist/chunks/{filter-reach-copy-CmJpPa4G.js → filter-reach-copy-ZERaFKsN.js} +880 -863
  14. package/dist/chunks/{index-0WYn6RMz.js → index-otMIColV.js} +1 -1
  15. package/dist/chunks/{matrix-analytical-definition-QjBgUYhP.js → matrix-analytical-definition-DOVSFFuf.js} +179 -169
  16. package/dist/chunks/{report-preferences-dialog-BRaeufEi.js → report-preferences-dialog-B-CoyS1x.js} +7 -7
  17. package/dist/chunks/{resolve-dashboard-input-context-Cn9jumxl.js → resolve-dashboard-input-context-BTTdKXH0.js} +10325 -10247
  18. package/dist/chunks/{saved-dashboard-context-CfqkUMzR.js → saved-dashboard-context-B-rosN4W.js} +75 -72
  19. package/dist/chunks/{semaphor-ready-indicator-D6WjdTGl.js → semaphor-ready-indicator-Cy1n_04D.js} +22649 -22461
  20. package/dist/chunks/{shelf-drop-preview-context-Bbbrr9u4.js → shelf-drop-preview-context-Bmz54WYm.js} +2 -2
  21. package/dist/chunks/{stored-dashboard-sPkTjxYf.js → stored-dashboard-rDJ8sw6J.js} +600 -595
  22. package/dist/chunks/{variable-draft-D1RotIEG.js → variable-draft-DvngkRMl.js} +3 -3
  23. package/dist/chunks/{visual-choice-JiJ-_3bi.js → visual-choice-BBPizkRo.js} +74 -72
  24. package/dist/dashboard/index.js +1 -1
  25. package/dist/dashboard-authoring/index.js +328 -320
  26. package/dist/index.js +11 -11
  27. package/dist/style.css +1 -1
  28. package/dist/surfboard/index.js +1 -1
  29. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +86 -3
  30. package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +49 -27
  31. package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +7 -0
  32. package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +30 -2
  33. package/dist/types/shared/analytics-protocol/click-reach-filter-id.d.ts +9 -0
  34. package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +3 -1
  35. package/dist/types/shared/analytics-protocol/index.d.ts +1 -0
  36. package/dist/types/shared/dashboard-authoring/click-to-filter-card-decision.d.ts +102 -0
  37. package/dist/types/shared/dashboard-authoring/filter-reach-copy.d.ts +13 -1
  38. package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
  39. package/dist/types/shared/dashboard-authoring/semantic-auto-join-card.d.ts +13 -0
  40. package/package.json +2 -2
@@ -1,7 +1,7 @@
1
- import { c as v, g as N, a as y, b as D } from "./resolve-dashboard-input-context-Cn9jumxl.js";
1
+ import { c as v, g as N, a as y, b as D } from "./resolve-dashboard-input-context-BTTdKXH0.js";
2
2
  import { d as M } from "./validators-CJ8Jh0E8.js";
3
- import { g as A, a as q, b as w, c as E } from "./filter-reach-copy-CmJpPa4G.js";
4
- import { g as L, m as x } from "./matrix-analytical-definition-QjBgUYhP.js";
3
+ import { g as A, a as q, b as w, c as E } from "./filter-reach-copy-ZERaFKsN.js";
4
+ import { g as L, m as x } from "./matrix-analytical-definition-DOVSFFuf.js";
5
5
  const O = [
6
6
  {
7
7
  value: "only",
@@ -1,32 +1,34 @@
1
- function S(e, n) {
2
- var t, i;
3
- const r = e.name.split(".").pop(), o = (t = e.fieldMeta) == null ? void 0 : t.qualifiedFieldName, a = !!(n.qualifiedFieldName && (o || e.name) === n.qualifiedFieldName), s = !((i = n.qualifiedFieldName) != null && i.includes(".")) && r === n.name;
4
- return a || s;
1
+ import { i as S } from "./matrix-analytical-definition-DOVSFFuf.js";
2
+ function x(e, n) {
3
+ var s, a;
4
+ const r = e.name.split(".").pop(), o = (s = e.fieldMeta) == null ? void 0 : s.qualifiedFieldName, i = !!(n.qualifiedFieldName && (o || e.name) === n.qualifiedFieldName), t = !((a = n.qualifiedFieldName) != null && a.includes(".")) && r === n.name;
5
+ return i || t;
5
6
  }
6
7
  function N(e) {
7
8
  var n;
8
9
  return !e.negate && (e.logicalOperator === "AND" || e.conditions.length + (((n = e.groups) == null ? void 0 : n.length) ?? 0) <= 1);
9
10
  }
10
- function x(e) {
11
+ function F(e) {
11
12
  return !e || !Array.isArray(e.conditions) ? [] : N(e) ? [
12
13
  ...e.conditions,
13
- ...(e.groups ?? []).flatMap((n) => x(n))
14
+ ...(e.groups ?? []).flatMap((n) => F(n))
14
15
  ] : [];
15
16
  }
16
- function U(e, n) {
17
+ function E(e, n) {
17
18
  const r = e.filters;
18
19
  if (!r || !Array.isArray(r.conditions) || !N(r) || !n.length)
19
20
  return e;
20
- const o = (s, t) => {
21
+ const o = (t, s) => {
21
22
  var c;
22
- const i = { name: t.field.name, qualifiedFieldName: t.field.qualifiedFieldName }, d = !((c = s.fieldMeta) != null && c.qualifiedFieldName);
23
- return S(s, i) || d && s.name === i.name;
24
- }, a = r.conditions.filter(
25
- (s) => !n.some((t) => o(t, s))
23
+ if (S(t.filterId)) return !1;
24
+ const a = { name: s.field.name, qualifiedFieldName: s.field.qualifiedFieldName }, d = !((c = t.fieldMeta) != null && c.qualifiedFieldName);
25
+ return x(t, a) || d && t.name === a.name;
26
+ }, i = r.conditions.filter(
27
+ (t) => !n.some((s) => o(s, t))
26
28
  );
27
- return a.length === r.conditions.length ? e : { ...e, filters: { ...r, conditions: a } };
29
+ return i.length === r.conditions.length ? e : { ...e, filters: { ...r, conditions: i } };
28
30
  }
29
- const E = ["number", "line", "bar", "stackedBar", "table"], F = {
31
+ const P = ["number", "line", "bar", "stackedBar", "table"], I = {
30
32
  /** Fewest points on a line. */
31
33
  lineMinPoints: 2,
32
34
  /** Most measures on one line chart. */
@@ -50,73 +52,73 @@ const E = ["number", "line", "bar", "stackedBar", "table"], F = {
50
52
  stackedBar: "a stacked bar chart",
51
53
  table: "a table"
52
54
  };
53
- function P(e, n) {
54
- const { options: r, reason: o } = I(e), a = e.governed ? r : [...r.filter((i) => i.kind === "table"), ...r.filter((i) => i.kind !== "table")], s = a.map((i) => i.kind);
55
+ function z(e, n) {
56
+ const { options: r, reason: o } = q(e), i = e.governed ? r : [...r.filter((a) => a.kind === "table"), ...r.filter((a) => a.kind !== "table")], t = i.map((a) => a.kind);
55
57
  if (n === void 0)
56
- return { ok: !0, visual: a[0], eligible: s, reason: e.governed ? o : `Advanced SQL opens as a table. ${o}` };
57
- const t = a.find((i) => i.kind === n);
58
- return t ? { ok: !0, visual: t, eligible: s, reason: o } : {
58
+ return { ok: !0, visual: i[0], eligible: t, reason: e.governed ? o : `Advanced SQL opens as a table. ${o}` };
59
+ const s = i.find((a) => a.kind === n);
60
+ return s ? { ok: !0, visual: s, eligible: t, reason: o } : {
59
61
  ok: !1,
60
62
  code: "kind_not_eligible",
61
- eligible: s,
62
- message: `${L($[n])} does not fit this result: ${_(o)}. It can be shown as ${s.map((i) => $[i]).join(" or ")}.`
63
+ eligible: t,
64
+ message: `${_($[n])} does not fit this result: ${U(o)}. It can be shown as ${t.map((a) => $[a]).join(" or ")}.`
63
65
  };
64
66
  }
65
- function I(e) {
67
+ function q(e) {
66
68
  const n = (l) => ({ options: [f], reason: l });
67
69
  if (!e.complete) return n("Part of the question could not be answered");
68
70
  if (e.truncated || e.records.length < e.rowCount) return n("The result has more rows than are kept");
69
71
  if (e.records.length === 0) return n("The result has no rows");
70
- const r = (l) => e.columns.filter((u) => q(u, e.governed) === l).map((u) => u.key), o = r("time"), a = r("dimension"), s = r("measure");
72
+ const r = (l) => e.columns.filter((u) => D(u, e.governed) === l).map((u) => u.key), o = r("time"), i = r("dimension"), t = r("measure");
71
73
  if (r("other").length) return n("A column cannot be charted");
72
- if (s.length === 0) return n("The result has no measure");
73
- if (!e.records.every((l) => s.every((u) => B(l[u]))))
74
+ if (t.length === 0) return n("The result has no measure");
75
+ if (!e.records.every((l) => t.every((u) => L(l[u]))))
74
76
  return n("A measure has values that are not numbers");
75
- const t = e.records.length, {
76
- lineMinPoints: i,
77
+ const s = e.records.length, {
78
+ lineMinPoints: a,
77
79
  lineMaxMeasures: d,
78
80
  barMinCategories: c,
79
81
  barDefaultMaxCategories: O,
80
82
  barMaxCategories: h,
81
83
  seriesMin: C,
82
84
  seriesMax: M
83
- } = F;
84
- if (t === 1 && e.columns.length === 1)
85
- return { options: [{ kind: "number", encodings: { y: s } }, f], reason: "One value" };
86
- if (o.length === 1 && a.length === 0 && s.length <= d) {
87
- if (t < i || !k(e.records, o)) return n("The time column does not form a series");
85
+ } = I;
86
+ if (s === 1 && e.columns.length === 1)
87
+ return { options: [{ kind: "number", encodings: { y: t } }, f], reason: "One value" };
88
+ if (o.length === 1 && i.length === 0 && t.length <= d) {
89
+ if (s < a || !k(e.records, o)) return n("The time column does not form a series");
88
90
  if (!T(e.records, o[0])) return n("The rows are not in time order");
89
- const l = { x: o[0], y: s };
91
+ const l = { x: o[0], y: t };
90
92
  return {
91
93
  options: [
92
94
  { kind: "line", encodings: l },
93
- ...t <= h ? [{ kind: "bar", encodings: l }] : [],
95
+ ...s <= h ? [{ kind: "bar", encodings: l }] : [],
94
96
  f
95
97
  ],
96
- reason: `A time column and ${p(s.length, "measure")} over ${t} points`
98
+ reason: `A time column and ${p(t.length, "measure")} over ${s} points`
97
99
  };
98
100
  }
99
- if (a.length === 1 && o.length === 0 && s.length === 1) {
100
- if (!k(e.records, a)) return n("A category value repeats");
101
- if (t < c) return n(`One category with ${p(t, "value")}`);
102
- if (t > h)
103
- return n(`One category with ${t} values, more than a bar chart shows (${h})`);
104
- const l = { kind: "bar", encodings: { x: a[0], y: s } };
105
- return t <= O ? { options: [l, f], reason: `One category with ${p(t, "value")} and one measure` } : { options: [f, l], reason: `One category with ${t} values: a table first, bars when asked` };
101
+ if (i.length === 1 && o.length === 0 && t.length === 1) {
102
+ if (!k(e.records, i)) return n("A category value repeats");
103
+ if (s < c) return n(`One category with ${p(s, "value")}`);
104
+ if (s > h)
105
+ return n(`One category with ${s} values, more than a bar chart shows (${h})`);
106
+ const l = { kind: "bar", encodings: { x: i[0], y: t } };
107
+ return s <= O ? { options: [l, f], reason: `One category with ${p(s, "value")} and one measure` } : { options: [f, l], reason: `One category with ${s} values: a table first, bars when asked` };
106
108
  }
107
- const b = [...o, ...a];
108
- if (b.length === 2 && s.length === 1) {
109
+ const b = [...o, ...i];
110
+ if (b.length === 2 && t.length === 1) {
109
111
  const [l, u] = b, w = o.includes(l);
110
112
  if (w && !T(e.records, l)) return n("The rows are not in time order");
111
113
  const m = A(e.records, l), g = A(e.records, u);
112
114
  if (!k(e.records, b)) return n("A pair of grouping values repeats");
113
- if (m < (w ? i : c) || g < C)
115
+ if (m < (w ? a : c) || g < C)
114
116
  return n("Two groupings with too few values to chart");
115
117
  if (g > M)
116
118
  return n(`${g} series, more than a chart tells apart (${M})`);
117
- const v = { x: l, y: s, series: u }, y = m <= h ? [
119
+ const v = { x: l, y: t, series: u }, y = m <= h ? [
118
120
  { kind: "bar", encodings: v },
119
- ...e.governed && V(e.columns, s[0]) ? [{ kind: "stackedBar", encodings: v }] : []
121
+ ...e.governed && B(e.columns, t[0]) ? [{ kind: "stackedBar", encodings: v }] : []
120
122
  ] : [];
121
123
  return w ? {
122
124
  options: [{ kind: "line", encodings: v }, ...y, f],
@@ -128,7 +130,7 @@ function I(e) {
128
130
  }
129
131
  return n("The result does not have a chart shape");
130
132
  }
131
- function q(e, n) {
133
+ function D(e, n) {
132
134
  if (n) {
133
135
  if (e.temporalBucket || e.role === "date") return "time";
134
136
  if (e.role === "measure") return "measure";
@@ -146,37 +148,37 @@ function q(e, n) {
146
148
  return "other";
147
149
  }
148
150
  }
149
- const D = /^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[+-]\d{2}:?\d{2})?$/;
151
+ const V = /^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[+-]\d{2}:?\d{2})?$/;
150
152
  function T(e, n) {
151
153
  let r, o;
152
- const a = /* @__PURE__ */ new Set();
153
- for (const s of e) {
154
- const t = s[n], i = typeof t == "string" ? D.exec(t) : null;
155
- if (!i) return !1;
156
- if (a.has(t)) continue;
157
- a.add(t);
158
- const d = i[1] !== void 0;
154
+ const i = /* @__PURE__ */ new Set();
155
+ for (const t of e) {
156
+ const s = t[n], a = typeof s == "string" ? V.exec(s) : null;
157
+ if (!a) return !1;
158
+ if (i.has(s)) continue;
159
+ i.add(s);
160
+ const d = a[1] !== void 0;
159
161
  if (o === void 0 && (o = d), d !== o) return !1;
160
- const c = d ? Date.parse(t.replace(" ", "T")) : t;
162
+ const c = d ? Date.parse(s.replace(" ", "T")) : s;
161
163
  if (typeof c == "number" && Number.isNaN(c) || r !== void 0 && c <= r) return !1;
162
164
  r = c;
163
165
  }
164
166
  return !0;
165
167
  }
166
- function V(e, n) {
168
+ function B(e, n) {
167
169
  var o;
168
- const r = (o = e.find((a) => a.key === n)) == null ? void 0 : o.aggregate;
170
+ const r = (o = e.find((i) => i.key === n)) == null ? void 0 : o.aggregate;
169
171
  return r === "SUM" || r === "COUNT";
170
172
  }
171
- function B(e) {
173
+ function L(e) {
172
174
  return e == null || typeof e == "number" && Number.isFinite(e);
173
175
  }
174
176
  function k(e, n) {
175
177
  const r = /* @__PURE__ */ new Set();
176
178
  for (const o of e) {
177
- const a = JSON.stringify(n.map((s) => o[s] ?? null));
178
- if (r.has(a)) return !1;
179
- r.add(a);
179
+ const i = JSON.stringify(n.map((t) => o[t] ?? null));
180
+ if (r.has(i)) return !1;
181
+ r.add(i);
180
182
  }
181
183
  return !0;
182
184
  }
@@ -186,19 +188,19 @@ function A(e, n) {
186
188
  function p(e, n) {
187
189
  return e === 1 ? `one ${n}` : `${e} ${n}s`;
188
190
  }
189
- function L(e) {
191
+ function _(e) {
190
192
  return e.charAt(0).toUpperCase() + e.slice(1);
191
193
  }
192
- function _(e) {
194
+ function U(e) {
193
195
  return e.charAt(0).toLowerCase() + e.slice(1);
194
196
  }
195
197
  export {
196
- E as V,
197
- F as a,
198
- P as c,
199
- S as f,
198
+ P as V,
199
+ I as a,
200
+ z as c,
201
+ x as f,
200
202
  N as i,
201
- x as u,
202
- q as v,
203
- U as w
203
+ F as u,
204
+ D as v,
205
+ E as w
204
206
  };
@@ -1,4 +1,4 @@
1
- import { D as o } from "../chunks/dashboard-MPku_x1M.js";
1
+ import { D as o } from "../chunks/dashboard-BXP-ZxSY.js";
2
2
  import { C as s, E as C } from "../chunks/bookmark-state-CL4WEpgB.js";
3
3
  export {
4
4
  s as CONTROL_CARD_DEFAULT_VALUE,