react-semaphor 0.1.584 → 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.
- package/dist/analytics-protocol/index.js +474 -435
- package/dist/assistant-context/index.js +1 -1
- package/dist/briefings/index.js +2 -2
- package/dist/chunks/{assistant-chat-nmycV1Se.js → assistant-chat-BU5gchFy.js} +8 -8
- package/dist/chunks/{bookmark-impact-CI3gmxi0.js → bookmark-impact-ZPSGncK6.js} +2 -2
- package/dist/chunks/{bookmark-state-D9-RFkDg.js → bookmark-state-CL4WEpgB.js} +2 -2
- package/dist/chunks/{card-filter-builder-C7QyPqRy.js → card-filter-builder-HELJWA4D.js} +208 -208
- package/dist/chunks/{comparison-window-caption-BAnsTI8y.js → comparison-window-caption-CoART8BC.js} +530 -633
- package/dist/chunks/{dashboard-inJy_V78.js → dashboard-BXP-ZxSY.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-DXs0XA1O.js → dashboard-briefing-launcher-BGj42whr.js} +9 -9
- package/dist/chunks/{dashboard-controls-6Zoo8d8Y.js → dashboard-controls-zvbRp6D2.js} +9 -9
- package/dist/chunks/{dashboard-json-D5eJhVA9.js → dashboard-json-CykexgqL.js} +1 -1
- package/dist/chunks/{dates-B3_GWc_Y.js → dates-CaqZtq01.js} +6 -6
- package/dist/chunks/{edit-dashboard-visual-DR03SYeW.js → edit-dashboard-visual-C82JNxbt.js} +2679 -2614
- package/dist/chunks/filter-line-Cu2u1K36.js +131 -0
- package/dist/chunks/{filter-reach-copy-CZwzrxBp.js → filter-reach-copy-ZERaFKsN.js} +1640 -1367
- package/dist/chunks/{filter-value-text-DtOvqcjn.js → filter-value-text-xefXzZlf.js} +10 -10
- package/dist/chunks/{index-BgT1L0p5.js → index-otMIColV.js} +35 -35
- package/dist/chunks/{matrix-analytical-definition-Cs2v43FM.js → matrix-analytical-definition-DOVSFFuf.js} +390 -542
- package/dist/chunks/{metric-comparison-Be4uS3Ql.js → metric-comparison-ZmurmEIs.js} +2 -2
- package/dist/chunks/{pivot-header-presentation-uH06jiZD.js → pivot-header-presentation-CdeTU96P.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-DvZY4eJM.js → pivot-result-contract-expectations-Bx_BCu-7.js} +1010 -1005
- package/dist/chunks/{pivot-result-identity-BZexMfmL.js → pivot-result-identity-Bvs6Uq3v.js} +1 -1
- package/dist/chunks/raw-temporal-value-DH-feMc2.js +322 -0
- package/dist/chunks/{report-preferences-dialog-DWeVe2so.js → report-preferences-dialog-B-CoyS1x.js} +119 -119
- package/dist/chunks/{resolve-dashboard-input-context-uATCuOP7.js → resolve-dashboard-input-context-BTTdKXH0.js} +10273 -10190
- package/dist/chunks/{saved-dashboard-context-DSVV9iqW.js → saved-dashboard-context-B-rosN4W.js} +78 -75
- package/dist/chunks/{semaphor-ready-indicator-B9vvRMnJ.js → semaphor-ready-indicator-Cy1n_04D.js} +28208 -27864
- package/dist/chunks/{shelf-drop-preview-context-BHOnp5Bo.js → shelf-drop-preview-context-Bmz54WYm.js} +2 -2
- package/dist/chunks/{stored-dashboard-xc5iidHL.js → stored-dashboard-rDJ8sw6J.js} +601 -596
- package/dist/chunks/{table-export-sheet-Cv_94obr.js → table-export-sheet-Dmtqi5NV.js} +1 -1
- package/dist/chunks/{variable-draft-C3CjhsJQ.js → variable-draft-DvngkRMl.js} +3 -3
- package/dist/chunks/{visual-choice-JiJ-_3bi.js → visual-choice-BBPizkRo.js} +74 -72
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +699 -688
- package/dist/format-utils/index.js +145 -142
- package/dist/index.js +14 -14
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/index.js +2 -2
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +86 -3
- package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +49 -27
- package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +7 -0
- package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +30 -2
- package/dist/types/shared/analytics-protocol/click-reach-filter-id.d.ts +9 -0
- package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +3 -1
- package/dist/types/shared/analytics-protocol/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/click-to-filter-card-decision.d.ts +102 -0
- package/dist/types/shared/dashboard-authoring/filter-reach-copy.d.ts +13 -1
- package/dist/types/shared/dashboard-authoring/index.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/kpi-date-context.d.ts +191 -0
- package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +3 -0
- package/dist/types/shared/dashboard-authoring/see-records/measure-kind.d.ts +5 -2
- package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +37 -4
- package/dist/types/shared/dashboard-authoring/semantic-auto-join-card.d.ts +13 -0
- package/dist/types/shared/format-utils/semantic-format.d.ts +0 -1
- package/dist/types/shared/format-utils/temporal-bucket.d.ts +20 -0
- package/dist/types/shared/temporal/calendar-periods.d.ts +15 -0
- package/dist/types/shared/temporal/raw-temporal-equality.d.ts +14 -0
- package/package.json +2 -2
- package/dist/chunks/raw-temporal-value-DdT0s47W.js +0 -159
|
@@ -2,7 +2,7 @@ var ft = Object.defineProperty;
|
|
|
2
2
|
var ht = (e, t, r) => t in e ? ft(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
3
|
var ne = (e, t, r) => ht(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
4
|
import { z as S } from "zod";
|
|
5
|
-
import { e as ct } from "./comparison-window-caption-
|
|
5
|
+
import { e as ct } from "./comparison-window-caption-CoART8BC.js";
|
|
6
6
|
var E = Uint8Array, I = Uint16Array, pe = Int32Array, xe = new E([
|
|
7
7
|
0,
|
|
8
8
|
0,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as v, g as N, a as y, b as D } from "./resolve-dashboard-input-context-
|
|
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-
|
|
4
|
-
import { g as L, m as x } from "./matrix-analytical-definition-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
|
11
|
+
function F(e) {
|
|
11
12
|
return !e || !Array.isArray(e.conditions) ? [] : N(e) ? [
|
|
12
13
|
...e.conditions,
|
|
13
|
-
...(e.groups ?? []).flatMap((n) =>
|
|
14
|
+
...(e.groups ?? []).flatMap((n) => F(n))
|
|
14
15
|
] : [];
|
|
15
16
|
}
|
|
16
|
-
function
|
|
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 = (
|
|
21
|
+
const o = (t, s) => {
|
|
21
22
|
var c;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
|
29
|
+
return i.length === r.conditions.length ? e : { ...e, filters: { ...r, conditions: i } };
|
|
28
30
|
}
|
|
29
|
-
const
|
|
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
|
|
54
|
-
const { options: r, reason: o } =
|
|
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:
|
|
57
|
-
const
|
|
58
|
-
return
|
|
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:
|
|
62
|
-
message: `${
|
|
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
|
|
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) =>
|
|
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 (
|
|
73
|
-
if (!e.records.every((l) =>
|
|
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
|
|
76
|
-
lineMinPoints:
|
|
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
|
-
} =
|
|
84
|
-
if (
|
|
85
|
-
return { options: [{ kind: "number", encodings: { y:
|
|
86
|
-
if (o.length === 1 &&
|
|
87
|
-
if (
|
|
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:
|
|
91
|
+
const l = { x: o[0], y: t };
|
|
90
92
|
return {
|
|
91
93
|
options: [
|
|
92
94
|
{ kind: "line", encodings: l },
|
|
93
|
-
...
|
|
95
|
+
...s <= h ? [{ kind: "bar", encodings: l }] : [],
|
|
94
96
|
f
|
|
95
97
|
],
|
|
96
|
-
reason: `A time column and ${p(
|
|
98
|
+
reason: `A time column and ${p(t.length, "measure")} over ${s} points`
|
|
97
99
|
};
|
|
98
100
|
}
|
|
99
|
-
if (
|
|
100
|
-
if (!k(e.records,
|
|
101
|
-
if (
|
|
102
|
-
if (
|
|
103
|
-
return n(`One category with ${
|
|
104
|
-
const l = { kind: "bar", encodings: { x:
|
|
105
|
-
return
|
|
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, ...
|
|
108
|
-
if (b.length === 2 &&
|
|
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 ?
|
|
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:
|
|
119
|
+
const v = { x: l, y: t, series: u }, y = m <= h ? [
|
|
118
120
|
{ kind: "bar", encodings: v },
|
|
119
|
-
...e.governed &&
|
|
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
|
|
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
|
|
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
|
|
153
|
-
for (const
|
|
154
|
-
const
|
|
155
|
-
if (!
|
|
156
|
-
if (
|
|
157
|
-
|
|
158
|
-
const d =
|
|
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(
|
|
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
|
|
168
|
+
function B(e, n) {
|
|
167
169
|
var o;
|
|
168
|
-
const r = (o = e.find((
|
|
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
|
|
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
|
|
178
|
-
if (r.has(
|
|
179
|
-
r.add(
|
|
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
|
|
191
|
+
function _(e) {
|
|
190
192
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
191
193
|
}
|
|
192
|
-
function
|
|
194
|
+
function U(e) {
|
|
193
195
|
return e.charAt(0).toLowerCase() + e.slice(1);
|
|
194
196
|
}
|
|
195
197
|
export {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
198
|
+
P as V,
|
|
199
|
+
I as a,
|
|
200
|
+
z as c,
|
|
201
|
+
x as f,
|
|
200
202
|
N as i,
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
203
|
+
F as u,
|
|
204
|
+
D as v,
|
|
205
|
+
E as w
|
|
204
206
|
};
|
package/dist/dashboard/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as o } from "../chunks/dashboard-
|
|
2
|
-
import { C as s, E as C } from "../chunks/bookmark-state-
|
|
1
|
+
import { D as o } from "../chunks/dashboard-BXP-ZxSY.js";
|
|
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,
|
|
5
5
|
o as Dashboard,
|