react-semaphor 0.1.586 → 0.1.588

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 (98) hide show
  1. package/dist/analytics-protocol/index.js +341 -338
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/assistant-protocol/index.js +5 -5
  4. package/dist/brand-studio/index.js +8 -8
  5. package/dist/briefings/index.js +5 -5
  6. package/dist/chunks/{add-to-dashboard-DhP8wVtM.js → add-to-dashboard-C86FsM8D.js} +1 -1
  7. package/dist/chunks/{aggregate-measure-field-DsFXETpI.js → aggregate-measure-field-BrkXsSJp.js} +2 -2
  8. package/dist/chunks/{analytics-base-schemas-BaIQrEzX.js → analytics-base-schemas-8wz9vqn_.js} +173 -165
  9. package/dist/chunks/{assistant-chat-BU5gchFy.js → assistant-chat-BeM6joPc.js} +19 -18
  10. package/dist/chunks/{bookmark-impact-ZPSGncK6.js → bookmark-impact-B7pbMx2e.js} +2 -2
  11. package/dist/chunks/{bookmark-state-CL4WEpgB.js → bookmark-state-Bn7k3ttp.js} +5 -5
  12. package/dist/chunks/{card-filter-builder-HELJWA4D.js → card-filter-builder-DmodrhyI.js} +81 -81
  13. package/dist/chunks/{comparison-window-caption-CoART8BC.js → comparison-window-caption-fqijZdVd.js} +451 -395
  14. package/dist/chunks/{context-BTLBjQNh.js → context-CVXTFljo.js} +1 -1
  15. package/dist/chunks/{dashboard-BXP-ZxSY.js → dashboard-Tu5wT0Cw.js} +1 -1
  16. package/dist/chunks/{dashboard-briefing-launcher-BGj42whr.js → dashboard-briefing-launcher-D8jMxIJo.js} +249 -265
  17. package/dist/chunks/{dashboard-controls-zvbRp6D2.js → dashboard-controls-uzeAIEkM.js} +65 -65
  18. package/dist/chunks/{dashboard-json-CykexgqL.js → dashboard-json-i5rpFNCg.js} +5 -5
  19. package/dist/chunks/dates-BunbHJH0.js +115 -0
  20. package/dist/chunks/{edit-dashboard-visual-C82JNxbt.js → edit-dashboard-visual-BpEK_Sls.js} +2882 -2843
  21. package/dist/chunks/{filter-line-Cu2u1K36.js → filter-line-Dza3ee4w.js} +5 -5
  22. package/dist/chunks/{filter-reach-copy-ZERaFKsN.js → filter-reach-copy-D5AmDHda.js} +939 -937
  23. package/dist/chunks/{filter-value-text-xefXzZlf.js → filter-value-text-DQw4v3nC.js} +6 -6
  24. package/dist/chunks/{index-otMIColV.js → index-dGxJTaP1.js} +39 -39
  25. package/dist/chunks/{layout-grid-9nSS2SL-.js → layout-grid-XCYphks2.js} +1 -1
  26. package/dist/chunks/{list-filter-CfMPI6v4.js → list-filter-DGV3fqqv.js} +1 -1
  27. package/dist/chunks/{matrix-analytical-definition-DOVSFFuf.js → matrix-analytical-definition-SN0JUJVk.js} +3 -3
  28. package/dist/chunks/{matrix-member-presentation-BKDyxJho.js → matrix-member-presentation-DVBJR0MA.js} +1 -1
  29. package/dist/chunks/{matrix-operation-contract-BM5TveR3.js → matrix-operation-contract-JSmproo9.js} +15 -15
  30. package/dist/chunks/{metric-comparison-ZmurmEIs.js → metric-comparison-xE_J6hkg.js} +2 -2
  31. package/dist/chunks/{paintbrush-LzAje2ff.js → paintbrush-DEEZXhDj.js} +1 -1
  32. package/dist/chunks/{palette-DicJG0TC.js → palette-Bgy0H-Nt.js} +1 -1
  33. package/dist/chunks/{pivot-header-presentation-CdeTU96P.js → pivot-header-presentation-D-DfPAjb.js} +1 -1
  34. package/dist/chunks/{pivot-result-contract-expectations-Bx_BCu-7.js → pivot-result-contract-expectations-DbBahmgc.js} +545 -536
  35. package/dist/chunks/{pivot-result-identity-Bvs6Uq3v.js → pivot-result-identity-CUsMt_4r.js} +1 -1
  36. package/dist/chunks/{raw-temporal-value-DH-feMc2.js → raw-temporal-value-BnGCWJAL.js} +1 -1
  37. package/dist/chunks/{report-preferences-dialog-B-CoyS1x.js → report-preferences-dialog-CTM0xfd0.js} +14 -14
  38. package/dist/chunks/{report-runtime-context-NlOXwyRB.js → report-runtime-context-CrOgmuxO.js} +2 -2
  39. package/dist/chunks/{resolve-dashboard-input-context-BTTdKXH0.js → resolve-dashboard-input-context-DFBIngUZ.js} +5621 -5476
  40. package/dist/chunks/{save-0wu1Z1U7.js → save-xnRCvMeA.js} +1 -1
  41. package/dist/chunks/{saved-dashboard-context-B-rosN4W.js → saved-dashboard-context-DKMTP9ib.js} +17 -17
  42. package/dist/chunks/selection-filter-compiler-DkIjp1yH.js +131 -0
  43. package/dist/chunks/{semaphor-ready-indicator-Cy1n_04D.js → semaphor-ready-indicator-zU9reNmX.js} +47183 -46779
  44. package/dist/chunks/{shelf-drop-preview-context-Bmz54WYm.js → shelf-drop-preview-context-R9sf4oDX.js} +6 -6
  45. package/dist/chunks/{stored-dashboard-rDJ8sw6J.js → stored-dashboard-CksluF2S.js} +1539 -1404
  46. package/dist/chunks/{style-sheet-parts-_dGSFzDi.js → style-sheet-parts-D7NbsFL0.js} +3 -3
  47. package/dist/chunks/{table-export-sheet-Dmtqi5NV.js → table-export-sheet-ClSgERQC.js} +1 -1
  48. package/dist/chunks/{token-types-DEe_FP4l.js → token-types-DTocOcwt.js} +1 -1
  49. package/dist/chunks/{upload-CtyOkU_B.js → upload-BXGgYS4g.js} +1 -1
  50. package/dist/chunks/{validators-CJ8Jh0E8.js → validators-CrYXNnNE.js} +51 -49
  51. package/dist/chunks/{variable-draft-DvngkRMl.js → variable-draft-rbtGPvmX.js} +16 -14
  52. package/dist/chunks/visual-choice-DDfHfHvY.js +172 -0
  53. package/dist/dashboard/index.js +2 -2
  54. package/dist/dashboard-authoring/index.js +1501 -1460
  55. package/dist/format-utils/index.js +162 -158
  56. package/dist/index.js +21 -21
  57. package/dist/report-runtime-context/index.js +2 -2
  58. package/dist/style.css +1 -1
  59. package/dist/surfboard/index.js +2 -2
  60. package/dist/types/index.js +5 -5
  61. package/dist/types/lib/dashboard-view-state/card-view-state.d.ts +39 -2
  62. package/dist/types/lib/dashboard-view-state/date-zoom.d.ts +65 -0
  63. package/dist/types/lib/dashboard-view-state/grain-pick.d.ts +38 -0
  64. package/dist/types/lib/dashboard-view-state/index.d.ts +2 -0
  65. package/dist/types/lib/formatters/grouped-temporal-presentation.d.ts +6 -2
  66. package/dist/types/lib/hooks/interactions/use-drill-actions.d.ts +1 -1
  67. package/dist/types/lib/interactions/get-click-context-from-table.d.ts +2 -2
  68. package/dist/types/lib/query-context/assemble-card-query.d.ts +2 -1
  69. package/dist/types/lib/query-context/build-card-query-context.d.ts +15 -1
  70. package/dist/types/lib/query-context/describe-card-execution-snapshot.d.ts +3 -0
  71. package/dist/types/lib/query-context/resolve-runtime-card-filters.d.ts +14 -1
  72. package/dist/types/lib/stores/dashboard-store.d.ts +7 -1
  73. package/dist/types/lib/types/explorer-types.d.ts +24 -4
  74. package/dist/types/lib/utils/card-config-utils.d.ts +1 -1
  75. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +32 -0
  76. package/dist/types/shared/analytics-protocol/contracts.d.ts +30 -0
  77. package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +13 -0
  78. package/dist/types/shared/dashboard-authoring/automatic-grain.d.ts +77 -0
  79. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +10 -3
  80. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
  81. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +5 -2
  82. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +5 -2
  83. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +2 -0
  84. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +13 -8
  85. package/dist/types/shared/dashboard-authoring/control-value-resolution.d.ts +24 -0
  86. package/dist/types/shared/dashboard-authoring/index.d.ts +2 -0
  87. package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +12 -12
  88. package/dist/types/shared/dashboard-authoring/kpi-trend-rule.d.ts +51 -0
  89. package/dist/types/shared/dashboard-authoring/variable-draft.d.ts +1 -0
  90. package/dist/types/shared/format-utils/index.d.ts +1 -0
  91. package/dist/types/shared/format-utils/partial-period.d.ts +40 -0
  92. package/dist/types/shared/format-utils/temporal-bucket.d.ts +11 -0
  93. package/dist/types/shared/usage-events/details.d.ts +2 -2
  94. package/dist/usage-events/index.js +1 -1
  95. package/package.json +1 -1
  96. package/dist/chunks/dates-CaqZtq01.js +0 -92
  97. package/dist/chunks/selection-filter-compiler-BReJy-uv.js +0 -92
  98. package/dist/chunks/visual-choice-BBPizkRo.js +0 -206
@@ -1,206 +0,0 @@
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;
6
- }
7
- function N(e) {
8
- var n;
9
- return !e.negate && (e.logicalOperator === "AND" || e.conditions.length + (((n = e.groups) == null ? void 0 : n.length) ?? 0) <= 1);
10
- }
11
- function F(e) {
12
- return !e || !Array.isArray(e.conditions) ? [] : N(e) ? [
13
- ...e.conditions,
14
- ...(e.groups ?? []).flatMap((n) => F(n))
15
- ] : [];
16
- }
17
- function E(e, n) {
18
- const r = e.filters;
19
- if (!r || !Array.isArray(r.conditions) || !N(r) || !n.length)
20
- return e;
21
- const o = (t, s) => {
22
- var c;
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))
28
- );
29
- return i.length === r.conditions.length ? e : { ...e, filters: { ...r, conditions: i } };
30
- }
31
- const P = ["number", "line", "bar", "stackedBar", "table"], I = {
32
- /** Fewest points on a line. */
33
- lineMinPoints: 2,
34
- /** Most measures on one line chart. */
35
- lineMaxMeasures: 3,
36
- /**
37
- * Categories (or time points) on a bar chart. Up to `barDefaultMaxCategories`
38
- * a category breakdown opens as bars; past it, up to `barMaxCategories`, it
39
- * opens as a table with bars in the toggle and on request; past that, a
40
- * table only.
41
- */
42
- barMinCategories: 2,
43
- barDefaultMaxCategories: 12,
44
- barMaxCategories: 30,
45
- /** Series a bar with series shows, at least and at most. */
46
- seriesMin: 2,
47
- seriesMax: 6
48
- }, f = { kind: "table", encodings: {} }, $ = {
49
- number: "a single number",
50
- line: "a line chart",
51
- bar: "a bar chart",
52
- stackedBar: "a stacked bar chart",
53
- table: "a table"
54
- };
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);
57
- if (n === void 0)
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 } : {
61
- ok: !1,
62
- code: "kind_not_eligible",
63
- eligible: t,
64
- message: `${_($[n])} does not fit this result: ${U(o)}. It can be shown as ${t.map((a) => $[a]).join(" or ")}.`
65
- };
66
- }
67
- function q(e) {
68
- const n = (l) => ({ options: [f], reason: l });
69
- if (!e.complete) return n("Part of the question could not be answered");
70
- if (e.truncated || e.records.length < e.rowCount) return n("The result has more rows than are kept");
71
- if (e.records.length === 0) return n("The result has no rows");
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");
73
- if (r("other").length) return n("A column cannot be charted");
74
- if (t.length === 0) return n("The result has no measure");
75
- if (!e.records.every((l) => t.every((u) => L(l[u]))))
76
- return n("A measure has values that are not numbers");
77
- const s = e.records.length, {
78
- lineMinPoints: a,
79
- lineMaxMeasures: d,
80
- barMinCategories: c,
81
- barDefaultMaxCategories: O,
82
- barMaxCategories: h,
83
- seriesMin: C,
84
- seriesMax: M
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");
90
- if (!T(e.records, o[0])) return n("The rows are not in time order");
91
- const l = { x: o[0], y: t };
92
- return {
93
- options: [
94
- { kind: "line", encodings: l },
95
- ...s <= h ? [{ kind: "bar", encodings: l }] : [],
96
- f
97
- ],
98
- reason: `A time column and ${p(t.length, "measure")} over ${s} points`
99
- };
100
- }
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` };
108
- }
109
- const b = [...o, ...i];
110
- if (b.length === 2 && t.length === 1) {
111
- const [l, u] = b, w = o.includes(l);
112
- if (w && !T(e.records, l)) return n("The rows are not in time order");
113
- const m = A(e.records, l), g = A(e.records, u);
114
- if (!k(e.records, b)) return n("A pair of grouping values repeats");
115
- if (m < (w ? a : c) || g < C)
116
- return n("Two groupings with too few values to chart");
117
- if (g > M)
118
- return n(`${g} series, more than a chart tells apart (${M})`);
119
- const v = { x: l, y: t, series: u }, y = m <= h ? [
120
- { kind: "bar", encodings: v },
121
- ...e.governed && B(e.columns, t[0]) ? [{ kind: "stackedBar", encodings: v }] : []
122
- ] : [];
123
- return w ? {
124
- options: [{ kind: "line", encodings: v }, ...y, f],
125
- reason: `A time column with ${g} series over ${m} points`
126
- } : y.length === 0 ? n(`${m} values on the axis, more than a bar chart shows (${h})`) : {
127
- options: [f, ...y],
128
- reason: `Two groupings (${m} by ${g}) and one measure`
129
- };
130
- }
131
- return n("The result does not have a chart shape");
132
- }
133
- function D(e, n) {
134
- if (n) {
135
- if (e.temporalBucket || e.role === "date") return "time";
136
- if (e.role === "measure") return "measure";
137
- if (e.role === "dimension" || e.role === "id") return "dimension";
138
- }
139
- switch (e.dataType) {
140
- case "date":
141
- case "datetime":
142
- return "time";
143
- case "string":
144
- return "dimension";
145
- case "number":
146
- return "measure";
147
- default:
148
- return "other";
149
- }
150
- }
151
- const V = /^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[+-]\d{2}:?\d{2})?$/;
152
- function T(e, n) {
153
- let r, o;
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;
161
- if (o === void 0 && (o = d), d !== o) return !1;
162
- const c = d ? Date.parse(s.replace(" ", "T")) : s;
163
- if (typeof c == "number" && Number.isNaN(c) || r !== void 0 && c <= r) return !1;
164
- r = c;
165
- }
166
- return !0;
167
- }
168
- function B(e, n) {
169
- var o;
170
- const r = (o = e.find((i) => i.key === n)) == null ? void 0 : o.aggregate;
171
- return r === "SUM" || r === "COUNT";
172
- }
173
- function L(e) {
174
- return e == null || typeof e == "number" && Number.isFinite(e);
175
- }
176
- function k(e, n) {
177
- const r = /* @__PURE__ */ new Set();
178
- for (const o of e) {
179
- const i = JSON.stringify(n.map((t) => o[t] ?? null));
180
- if (r.has(i)) return !1;
181
- r.add(i);
182
- }
183
- return !0;
184
- }
185
- function A(e, n) {
186
- return new Set(e.map((r) => JSON.stringify(r[n] ?? null))).size;
187
- }
188
- function p(e, n) {
189
- return e === 1 ? `one ${n}` : `${e} ${n}s`;
190
- }
191
- function _(e) {
192
- return e.charAt(0).toUpperCase() + e.slice(1);
193
- }
194
- function U(e) {
195
- return e.charAt(0).toLowerCase() + e.slice(1);
196
- }
197
- export {
198
- P as V,
199
- I as a,
200
- z as c,
201
- x as f,
202
- N as i,
203
- F as u,
204
- D as v,
205
- E as w
206
- };