react-semaphor 0.1.545 → 0.1.546

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 (141) hide show
  1. package/dist/analytics-protocol/index.js +405 -442
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/assistant-protocol/index.js +100 -76
  4. package/dist/brand-studio/index.js +4 -4
  5. package/dist/briefings/index.js +6 -6
  6. package/dist/chunks/{add-to-dashboard-BuAqfA2Y.js → add-to-dashboard-BQRAAnc3.js} +55 -33
  7. package/dist/chunks/{analytics-base-schemas-BFAoRlkU.js → analytics-base-schemas-BKs3flFS.js} +2 -2
  8. package/dist/chunks/{assistant-chat-D7sWTypJ.js → assistant-chat-BPXhulAx.js} +2826 -2595
  9. package/dist/chunks/{bookmark-state-CXw7lZ50.js → bookmark-state-C4vetoa0.js} +7 -8
  10. package/dist/chunks/column-catalog-BYnochWQ.js +3363 -0
  11. package/dist/chunks/comparison-window-caption-C2xF-eWw.js +1433 -0
  12. package/dist/chunks/{context-ClREvqCZ.js → context-BerEBuFR.js} +11 -6
  13. package/dist/chunks/custom-visual-inputs-CkJW9pBS.js +295 -0
  14. package/dist/chunks/{dashboard-B1tMju0u.js → dashboard-C3CoKbGY.js} +1 -1
  15. package/dist/chunks/dashboard-briefing-launcher-Be4h-7My.js +3734 -0
  16. package/dist/chunks/dashboard-controls-bxPrlSyp.js +2307 -0
  17. package/dist/chunks/{dashboard-json-CoYRPqxx.js → dashboard-json-BrjxIiRt.js} +5 -5
  18. package/dist/chunks/{document-dashboard-inputs-BesAHZvB.js → document-dashboard-inputs-CRVHpIHp.js} +872 -974
  19. package/dist/chunks/{edit-dashboard-visual-JPtNfJRb.js → edit-dashboard-visual-DYYYDjY6.js} +2361 -2447
  20. package/dist/chunks/{filter-value-text-ff7osJr7.js → filter-value-text-Ddf55Ku1.js} +9 -9
  21. package/dist/chunks/global-date-filter-utils-9d6m9-FE.js +11859 -0
  22. package/dist/chunks/index-CtoK1Lgu.js +586 -0
  23. package/dist/chunks/{index-DRWiuqyd.js → index-DkQkMKa1.js} +80 -79
  24. package/dist/chunks/list-filter-DsaTbM3J.js +15 -0
  25. package/dist/chunks/matrix-analytical-definition-B9vW-osb.js +717 -0
  26. package/dist/chunks/{matrix-card-DjwWcCo8.js → matrix-card-LiMEipvq.js} +3 -3
  27. package/dist/chunks/{matrix-formatter-DnCyRXJE.js → matrix-formatter-DWEeC0_c.js} +44 -44
  28. package/dist/chunks/{matrix-member-presentation-CQGdVks6.js → matrix-member-presentation-DqzG-UhQ.js} +1 -1
  29. package/dist/chunks/{matrix-operation-contract-8OIO4gob.js → matrix-operation-contract-D6vYkZK4.js} +72 -72
  30. package/dist/chunks/{metric-comparison-DEwi9uc2.js → metric-comparison-zpGw4lD6.js} +2 -2
  31. package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +119 -0
  32. package/dist/chunks/{pivot-header-presentation-DHcx1XGQ.js → pivot-header-presentation-CQnIDtUv.js} +1 -1
  33. package/dist/chunks/{pivot-result-identity-DJhXXcns.js → pivot-result-identity-C-Q1j1Wb.js} +1 -1
  34. package/dist/chunks/{pivot-result-lifecycle-DM4CyGKs.js → pivot-result-lifecycle-pwq3b7LC.js} +571 -380
  35. package/dist/chunks/{raw-temporal-contract-C51YG48G.js → raw-temporal-contract-WuXA8jBP.js} +1 -1
  36. package/dist/chunks/{raw-temporal-presentation-C3mUgnEx.js → raw-temporal-presentation-CBzrDOjM.js} +8 -8
  37. package/dist/chunks/{report-preferences-dialog-DUtuUL_5.js → report-preferences-dialog-4QEZWe5U.js} +111 -112
  38. package/dist/chunks/{report-runtime-context-Dq8XyODK.js → report-runtime-context-hWiTCzFV.js} +2 -2
  39. package/dist/chunks/resolve-dashboard-input-context-UpK_LBpL.js +5677 -0
  40. package/dist/chunks/{saved-dashboard-context-LrF_kW0l.js → saved-dashboard-context-D_I3Lxk0.js} +34 -34
  41. package/dist/chunks/{selection-reducer-Dj_8xD69.js → selection-reducer-CJzkTZio.js} +15 -15
  42. package/dist/chunks/{semaphor-ready-indicator-BxF96Yhv.js → semaphor-ready-indicator-4zpRHE-X.js} +45823 -47304
  43. package/dist/chunks/{shelf-drop-preview-context-CNaM_Gmh.js → shelf-drop-preview-context-Cfw7TRAx.js} +84 -84
  44. package/dist/chunks/{source-entity-resolution-BYn9giz3.js → source-entity-resolution-BIGRvtbG.js} +13 -13
  45. package/dist/chunks/{switch-uDtPgQlQ.js → switch-CEBOR4n7.js} +3 -3
  46. package/dist/chunks/{table-export-sheet-YzMioA7Y.js → table-export-sheet-4X9mAG3V.js} +1 -1
  47. package/dist/chunks/table-settings-CunhoDUi.js +605 -0
  48. package/dist/chunks/{temporal-bucket-D7NBrrtL.js → temporal-bucket-CQOSbv9-.js} +26 -26
  49. package/dist/chunks/{token-types-DBbZVQsm.js → token-types-BMqRmT-C.js} +1 -1
  50. package/dist/chunks/{use-create-flow-overlay-state-CjB7ig1o.js → use-create-flow-overlay-state-DZBZiiD-.js} +101 -101
  51. package/dist/chunks/{validators-DMHTpf7a.js → validators-C-aOQlTB.js} +713 -658
  52. package/dist/chunks/{relative-date-label-Bk2j94pA.js → zoned-wall-clock-MulfA26h.js} +64 -21
  53. package/dist/dashboard/index.js +2 -2
  54. package/dist/dashboard-authoring/index.js +1802 -1149
  55. package/dist/data-app-sdk/index.js +6 -6
  56. package/dist/data-app-sdk-adapters/index.js +3 -3
  57. package/dist/data-app-sdk-validation/index.js +14 -14
  58. package/dist/format-utils/index.js +133 -133
  59. package/dist/index.js +192 -186
  60. package/dist/layouts/index.js +5 -242
  61. package/dist/report-runtime-context/index.js +2 -2
  62. package/dist/shared/index.js +4 -5
  63. package/dist/style.css +1 -1
  64. package/dist/surfboard/index.js +2 -2
  65. package/dist/types/components/index.d.ts +2 -0
  66. package/dist/types/components/surfboard/arrange-layout-button.d.ts +8 -0
  67. package/dist/types/components/surfboard/screen-size-preview-button.d.ts +7 -0
  68. package/dist/types/index.js +6 -6
  69. package/dist/types/lib/charts/table-chart-types.d.ts +4 -0
  70. package/dist/types/lib/charts/types.d.ts +2 -2
  71. package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +6 -0
  72. package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +2 -0
  73. package/dist/types/lib/dashboard-inputs/prepare-loaded-dashboard.d.ts +15 -0
  74. package/dist/types/lib/matrix-table/matrix-editor.d.ts +52 -0
  75. package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +69 -0
  76. package/dist/types/lib/stores/dashboard-store.d.ts +125 -6
  77. package/dist/types/lib/types/common-types.d.ts +8 -0
  78. package/dist/types/lib/types/explorer-types.d.ts +10 -0
  79. package/dist/types/lib/types/semantic-types.d.ts +84 -0
  80. package/dist/types/lib/utils/build-saved-editor-card.d.ts +20 -0
  81. package/dist/types/lib/utils/card-type-change.d.ts +16 -0
  82. package/dist/types/lib/utils/field-availability-context.d.ts +25 -0
  83. package/dist/types/lib/utils/field-placement.d.ts +96 -0
  84. package/dist/types/lib/utils/field-state-calculator.d.ts +161 -0
  85. package/dist/types/lib/utils/qualified-entity-name.d.ts +2 -0
  86. package/dist/types/shared/analytics-protocol/field-provenance.d.ts +89 -0
  87. package/dist/types/shared/analytics-protocol/index.d.ts +2 -0
  88. package/dist/types/shared/analytics-protocol/query-policies.d.ts +52 -0
  89. package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +1 -1
  90. package/dist/types/shared/analytics-protocol/time-window.d.ts +40 -1
  91. package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +4 -1
  92. package/dist/types/shared/assistant-protocol/answer-text.d.ts +20 -0
  93. package/dist/types/shared/assistant-protocol/context.d.ts +21 -21
  94. package/dist/types/shared/assistant-protocol/index.d.ts +1 -0
  95. package/dist/types/shared/assistant-protocol/limits.d.ts +6 -1
  96. package/dist/types/shared/assistant-protocol/parts.d.ts +43 -3
  97. package/dist/types/shared/assistant-protocol/request.d.ts +14 -2
  98. package/dist/types/shared/dashboard-authoring/calculated-field-identity.d.ts +3 -0
  99. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +487 -0
  100. package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +34 -0
  101. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +7886 -0
  102. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +43 -0
  103. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +54 -0
  104. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +89 -0
  105. package/dist/types/shared/dashboard-authoring/column-catalog.d.ts +32 -0
  106. package/dist/types/shared/dashboard-authoring/contracts.d.ts +0 -55
  107. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +24 -14
  108. package/dist/types/shared/dashboard-authoring/dashboard-card-source-index.d.ts +9 -1
  109. package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +26 -0
  110. package/dist/types/shared/dashboard-authoring/filter-applicability.d.ts +75 -0
  111. package/dist/types/shared/dashboard-authoring/index.d.ts +18 -2
  112. package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +10 -37
  113. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +189 -0
  114. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +94 -0
  115. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +78 -0
  116. package/dist/types/shared/dashboard-authoring/validators.d.ts +1 -2
  117. package/dist/types/shared/layouts/engine/grid.d.ts +25 -0
  118. package/dist/types/shared/layouts/engine/index.d.ts +4 -0
  119. package/dist/types/shared/layouts/engine/sheet-layout.d.ts +7 -0
  120. package/dist/types/shared/layouts/engine/types.d.ts +125 -0
  121. package/dist/types/shared/layouts/index.d.ts +1 -2
  122. package/package.json +2 -2
  123. package/dist/chunks/apply-dashboard-operations-CZEMsx8E.js +0 -2080
  124. package/dist/chunks/calendar-day-equality-dvoQp1xW.js +0 -410
  125. package/dist/chunks/comparison-window-caption-D4E6IHPD.js +0 -1624
  126. package/dist/chunks/custom-visual-inputs-DLCD9Y5V.js +0 -329
  127. package/dist/chunks/dashboard-briefing-launcher-CePgIu0Z.js +0 -3720
  128. package/dist/chunks/dashboard-controls-Cq05n3e0.js +0 -2315
  129. package/dist/chunks/dashboard-filter-value-compatibility-CwQ_iSNb.js +0 -108
  130. package/dist/chunks/matrix-analytical-definition-C7Gb0e12.js +0 -117
  131. package/dist/chunks/normalize-dashboard-for-dirty-check-Bk3VYv_q.js +0 -67
  132. package/dist/chunks/numeric-presentation-7X_IrD58.js +0 -5226
  133. package/dist/chunks/resolve-dashboard-input-context-DJ2tICwz.js +0 -9415
  134. package/dist/chunks/stable-serialize-CfqXeiBP.js +0 -6
  135. package/dist/chunks/table-settings-CLZocegs.js +0 -501
  136. package/dist/chunks/use-debounced-dirty-check-BwAbnX_5.js +0 -59
  137. package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +0 -46
  138. package/dist/types/shared/dashboard-authoring/change-compiler.d.ts +0 -7
  139. package/dist/types/shared/dashboard-authoring/layout-compiler.d.ts +0 -2
  140. package/dist/types/shared/layouts/create-frame-layouts.d.ts +0 -27
  141. package/dist/types/shared/layouts/frame-layouts.d.ts +0 -23
@@ -1,6 +0,0 @@
1
- function f(t) {
2
- return JSON.stringify(t, (y, i) => !i || typeof i != "object" || Array.isArray(i) ? i : Object.keys(i).sort().reduce((s, r) => (s[r] = i[r], s), {}));
3
- }
4
- export {
5
- f as s
6
- };
@@ -1,501 +0,0 @@
1
- import { k as R } from "./validators-DMHTpf7a.js";
2
- import { z as u } from "zod";
3
- const F = 8, T = 6, I = Object.freeze([]);
4
- function j(e) {
5
- switch (e.type) {
6
- case "table":
7
- case "chart":
8
- return e.card ? [e.card] : I;
9
- case "kpi":
10
- return Array.isArray(e.cards) ? e.cards : I;
11
- default:
12
- return I;
13
- }
14
- }
15
- function ne(e, t) {
16
- switch (e.type) {
17
- case "table":
18
- case "chart": {
19
- if (!e.card) return e;
20
- const r = t(e.card);
21
- return r === e.card ? e : { ...e, card: r };
22
- }
23
- case "kpi": {
24
- if (!Array.isArray(e.cards)) return e;
25
- const r = e.cards.map(t);
26
- return r.every((a, n) => a === e.cards[n]) ? e : { ...e, cards: r };
27
- }
28
- default:
29
- return e;
30
- }
31
- }
32
- function O(e) {
33
- var r;
34
- const t = [];
35
- for (const a of e.sheets || []) {
36
- const n = a.id;
37
- for (const i of a.cards || [])
38
- t.push({ kind: "sheetCard", sheetId: n, cardId: i.id, card: i });
39
- for (const i of a.frames || [])
40
- for (const s of i.cards || [])
41
- t.push({
42
- kind: "frameCard",
43
- sheetId: n,
44
- frameId: i.id,
45
- cardId: s.id,
46
- card: s
47
- });
48
- for (const i of ((r = a.document) == null ? void 0 : r.sections) || [])
49
- for (const s of j(i))
50
- t.push({
51
- kind: "documentSectionCard",
52
- sheetId: n,
53
- sectionId: i.id,
54
- cardId: s.id,
55
- card: s
56
- });
57
- }
58
- return t;
59
- }
60
- function S(e) {
61
- return !!e && typeof e == "object" && !Array.isArray(e);
62
- }
63
- function ie(e) {
64
- if (!S(e))
65
- return [{ path: "", message: "must be an object." }];
66
- const t = [];
67
- e.title !== void 0 && typeof e.title != "string" && t.push({ path: "title", message: "must be a string." });
68
- const r = e.cards;
69
- if (!Array.isArray(r))
70
- t.push({ path: "cards", message: "must be an array of KPI cards." });
71
- else {
72
- (r.length < 1 || r.length > F) && t.push({
73
- path: "cards",
74
- message: `must hold 1 to ${F} KPI cards.`
75
- });
76
- const n = /* @__PURE__ */ new Set();
77
- r.forEach((i, s) => {
78
- if (!S(i)) {
79
- t.push({ path: `cards[${s}]`, message: "must be a card." });
80
- return;
81
- }
82
- typeof i.id != "string" || !i.id ? t.push({
83
- path: `cards[${s}].id`,
84
- message: "must be a non-empty string."
85
- }) : n.has(i.id) ? t.push({
86
- path: `cards[${s}].id`,
87
- message: `duplicates card id '${i.id}'.`
88
- }) : n.add(i.id), i.type !== "kpi" && t.push({ path: `cards[${s}].type`, message: "must be 'kpi'." });
89
- });
90
- }
91
- const a = e.kpi;
92
- return S(a) ? (a.layout !== "tiles" && a.layout !== "lines" ? t.push({
93
- path: "kpi.layout",
94
- message: "must be 'tiles' or 'lines'."
95
- }) : a.layout === "tiles" && Array.isArray(r) && r.length > T && t.push({
96
- path: "kpi.layout",
97
- message: `must be 'lines' for more than ${T} KPI cards.`
98
- }), a.columns !== void 0 && a.columns !== 1 && a.columns !== 2 && t.push({ path: "kpi.columns", message: "must be 1 or 2." })) : t.push({ path: "kpi", message: "must be an object." }), t;
99
- }
100
- const B = ["new", "edit", "delete", "create", "update", "remove"];
101
- function M(e, t) {
102
- return (e.sheets || []).flatMap(
103
- (r) => O({ sheets: [r] }).filter(t).map((a) => ({
104
- card: a.card,
105
- sheet: r,
106
- ...a.kind === "frameCard" && { frameId: a.frameId },
107
- ...a.kind === "documentSectionCard" && {
108
- sectionId: a.sectionId
109
- }
110
- }))
111
- );
112
- }
113
- function m(e) {
114
- return M(e, (t) => t.kind !== "documentSectionCard");
115
- }
116
- function se(e) {
117
- return [
118
- ...m(e),
119
- ...M(e, (t) => t.kind === "documentSectionCard")
120
- ];
121
- }
122
- function oe(e) {
123
- return m(e).map((t) => t.card);
124
- }
125
- function de(e, t, r) {
126
- return r && t === r ? !0 : !O(e).some(
127
- (a) => a.cardId === t
128
- );
129
- }
130
- function ce(e) {
131
- return !e || e.trim().length === 0 ? { isValid: !1, error: "Card ID cannot be empty" } : e.length < 3 ? { isValid: !1, error: "Card ID must be at least 3 characters" } : e.length > 50 ? { isValid: !1, error: "Card ID must be less than 50 characters" } : /^[a-zA-Z0-9-_]+$/.test(e) ? /^[a-zA-Z0-9]/.test(e) ? B.includes(e.toLowerCase()) ? {
132
- isValid: !1,
133
- error: `"${e}" is a reserved keyword and cannot be used`
134
- } : { isValid: !0 } : {
135
- isValid: !1,
136
- error: "Card ID must start with a letter or number"
137
- } : {
138
- isValid: !1,
139
- error: "Card ID can only contain letters, numbers, hyphens, and underscores"
140
- };
141
- }
142
- function ue(e, t) {
143
- var r;
144
- return (r = P(e, t)) == null ? void 0 : r.card;
145
- }
146
- function P(e, t) {
147
- for (const r of m(e))
148
- if (r.card.id === t)
149
- return r;
150
- }
151
- function le(e, t) {
152
- for (const r of e.sheets || [])
153
- for (const a of r.frames || [])
154
- for (const n of a.cards || [])
155
- if (n.id === t)
156
- return { card: n, sheet: r };
157
- }
158
- const h = {
159
- includeMetricFilterDatasets: !0,
160
- preferQualifiedIdentity: !1
161
- };
162
- function q(e) {
163
- if (!e) return;
164
- if (e.kind === "semantic")
165
- return { entityName: e.datasetName, entityId: e.datasetId, label: e.label };
166
- const t = [e.databaseName, e.schemaName, e.tableName].filter((r) => !!(r && r.trim())).join(".");
167
- return {
168
- entityName: e.tableName,
169
- qualifiedEntityName: t.includes(".") ? t : void 0,
170
- label: e.label
171
- };
172
- }
173
- function z(e) {
174
- var r;
175
- const t = q(e.source);
176
- return t ? `${(r = e.source) == null ? void 0 : r.kind}:${t.qualifiedEntityName || t.entityName}` : "";
177
- }
178
- function K(e) {
179
- return [
180
- e.id,
181
- e.qualifiedEntityName,
182
- e.entityId,
183
- e.entityName,
184
- e.qualifiedFieldName,
185
- e.name,
186
- // Source-only fields from different datasets can otherwise share a key
187
- // and the second dataset would be silently dropped.
188
- z(e)
189
- ].join("|");
190
- }
191
- function U(e) {
192
- return [e.entityName, e.qualifiedEntityName || "", e.entityId || ""].join("|");
193
- }
194
- function fe(e) {
195
- return e.entityName || e.qualifiedEntityName || "";
196
- }
197
- function Q(e) {
198
- var t, r;
199
- return !!(e.expression || e.derivedField || (r = (t = e.calculatedFormula) == null ? void 0 : t.inputFields) != null && r.length);
200
- }
201
- function G(e) {
202
- return R(e) ? !0 : e.entityName || e.qualifiedEntityName ? !1 : !e.source || Q(e);
203
- }
204
- function g(e, t) {
205
- const r = U(t);
206
- e.found.has(r) || e.found.set(r, t);
207
- }
208
- function p(e, t) {
209
- var l, v, k;
210
- if (!e) return;
211
- const r = K(e);
212
- if (t.visitedFields.has(r)) return;
213
- t.visitedFields.add(r);
214
- const a = G(e);
215
- if (!a) {
216
- const f = !e.entityName && !e.qualifiedEntityName ? q(e.source) : void 0;
217
- g(
218
- t,
219
- f || {
220
- // May be empty for qualified-only metadata; identity then comes from
221
- // `qualifiedEntityName` (see `identityFor` and the calculator).
222
- entityName: e.entityName || "",
223
- entityId: e.entityId,
224
- qualifiedEntityName: e.qualifiedEntityName,
225
- label: e.source && e.source.kind === "semantic" ? e.source.label : void 0
226
- }
227
- );
228
- }
229
- t.includeMetricFilterDatasets && "parameters" in e && ((l = e.parameters) != null && l.filters) && E(e.parameters.filters, t);
230
- const n = (v = e.calculatedFormula) == null ? void 0 : v.inputFields, i = !!(n && n.length > 0);
231
- i && n.forEach((f) => p(f, t));
232
- let s = !1, o = !1;
233
- const d = i || (k = e.derivedField) == null ? void 0 : k.inputs;
234
- if (d && Object.keys(d).length > 0)
235
- for (const f of Object.values(d)) {
236
- const c = f.field.source;
237
- if (!c) {
238
- i || (o = !0);
239
- continue;
240
- }
241
- if (c.kind === "sql") {
242
- o = !0;
243
- continue;
244
- }
245
- if (c.kind === "semantic")
246
- g(t, {
247
- entityName: c.datasetName,
248
- entityId: c.datasetId,
249
- label: c.label
250
- });
251
- else {
252
- const D = [c.databaseName, c.schemaName, c.tableName].filter((w) => !!(w && w.trim())).join(".");
253
- g(t, {
254
- entityName: c.tableName,
255
- qualifiedEntityName: D.includes(".") ? D : void 0,
256
- label: c.label
257
- });
258
- }
259
- s = !0;
260
- }
261
- o && (t.complete = !1), a && !i && !s && (t.complete = !1);
262
- }
263
- function E(e, t) {
264
- if (e && !t.visitedGroups.has(e.id)) {
265
- t.visitedGroups.add(e.id);
266
- for (const r of e.conditions || [])
267
- p(r.field, t);
268
- for (const r of e.groups || [])
269
- E(r, t);
270
- }
271
- }
272
- function b(e, t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set()) {
273
- return {
274
- found: /* @__PURE__ */ new Map(),
275
- complete: !0,
276
- visitedFields: t,
277
- visitedGroups: r,
278
- includeMetricFilterDatasets: e
279
- };
280
- }
281
- function N(e, t) {
282
- var a;
283
- const r = (a = e.qualifiedEntityName) != null && a.includes(".") ? e.qualifiedEntityName : void 0;
284
- return t === "qualifiedOnly" ? r : t === "preferQualified" ? r || e.entityName || void 0 : e.entityName || void 0;
285
- }
286
- function me(e) {
287
- const t = b(!1);
288
- return p(e, t), { datasets: Array.from(t.found.values()), complete: t.complete };
289
- }
290
- function V(e, t, r = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), n = h) {
291
- const i = { ...h, ...n }, s = b(i.includeMetricFilterDatasets, r, a);
292
- p(e, s), s.found.forEach((o) => {
293
- const d = N(o, i.preferQualifiedIdentity ? "preferQualified" : "name");
294
- d && t.add(d);
295
- });
296
- }
297
- function pe(e, t) {
298
- V(e, t, /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), {
299
- preferQualifiedIdentity: !0
300
- });
301
- }
302
- function ye(e, t, r = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set()) {
303
- const n = b(!0, r, a);
304
- p(e, n), n.found.forEach((i) => {
305
- const s = N(i, "qualifiedOnly");
306
- s && t.add(s);
307
- });
308
- }
309
- function he(e, t, r = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set()) {
310
- V(e, t, r, a, {
311
- includeMetricFilterDatasets: !1
312
- });
313
- }
314
- function be(e, t, r = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), n = h) {
315
- const i = { ...h, ...n }, s = b(i.includeMetricFilterDatasets, r, a);
316
- E(e, s), s.found.forEach((o) => {
317
- const d = N(o, i.preferQualifiedIdentity ? "preferQualified" : "name");
318
- d && t.add(d);
319
- });
320
- }
321
- function Ie(e, t) {
322
- return t != null && t[e] ? t[e] : (e.includes(".") ? e.slice(e.lastIndexOf(".") + 1) : e).replace(/[_-]+/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\s+/g, " ").trim().replace(/\b\w/g, (a) => a.toUpperCase());
323
- }
324
- const Se = {
325
- database: null,
326
- schema: null,
327
- table: null
328
- }, ge = "__card_default__", L = {
329
- bookmarksPerViewerPerDashboard: 20,
330
- bookmarkNameMaxChars: 100,
331
- columnLabelMaxChars: 120,
332
- tableSettingsMaxBytes: 65536,
333
- rememberedTableSettingsMaxBytes: 262144,
334
- bookmarkStateMaxBytes: 65536
335
- }, W = 1;
336
- function Ce(e) {
337
- return new TextEncoder().encode(JSON.stringify(e ?? null)).length;
338
- }
339
- function J(e) {
340
- const t = encodeURIComponent;
341
- switch (e.kind) {
342
- case "dimension":
343
- return `dim:${e.role}:${t(e.fieldId)}`;
344
- case "metric":
345
- return `metric:${t(e.metricId)}:${t(
346
- e.metricAlias
347
- )}`;
348
- case "result":
349
- return `result:${t(e.key)}`;
350
- }
351
- }
352
- function y(e) {
353
- if (e)
354
- try {
355
- return decodeURIComponent(e);
356
- } catch {
357
- return;
358
- }
359
- }
360
- function Y(e) {
361
- if (typeof e != "string") return;
362
- const t = e.split(":");
363
- let r;
364
- if (t[0] === "dim" && t.length === 3) {
365
- const a = t[1], n = y(t[2]);
366
- (a === "detail" || a === "groupby") && n && (r = { kind: "dimension", role: a, fieldId: n });
367
- } else if (t[0] === "metric" && t.length === 3) {
368
- const a = y(t[1]), n = y(t[2]);
369
- a && n && (r = { kind: "metric", metricId: a, metricAlias: n });
370
- } else if (t[0] === "result" && t.length === 2) {
371
- const a = y(t[1]);
372
- a && (r = { kind: "result", key: a });
373
- }
374
- return r && J(r) === e ? r : void 0;
375
- }
376
- function C(e) {
377
- return typeof e == "string" && Y(e) !== void 0;
378
- }
379
- const A = u.array(u.string()).max(2e3), Z = u.object({
380
- order: A.optional(),
381
- hidden: A.optional(),
382
- labels: u.record(u.string(), u.string().max(L.columnLabelMaxChars)).optional(),
383
- sort: u.array(
384
- u.object({
385
- columnId: u.string(),
386
- direction: u.enum(["asc", "desc"])
387
- }).strict()
388
- ).max(2e3).optional()
389
- }).strict();
390
- function _(e) {
391
- const t = /* @__PURE__ */ new Set(), r = [];
392
- for (const a of e)
393
- !C(a) || t.has(a) || (t.add(a), r.push(a));
394
- return r;
395
- }
396
- function $(e) {
397
- if (!e) return;
398
- const t = e.order ? _(e.order) : void 0, r = e.hidden ? _(e.hidden) : void 0, a = Object.entries(e.labels ?? {}).flatMap(
399
- ([o, d]) => {
400
- const l = typeof d == "string" ? d.trim() : "";
401
- return C(o) && l ? [
402
- [
403
- o,
404
- l.slice(0, L.columnLabelMaxChars)
405
- ]
406
- ] : [];
407
- }
408
- ), n = /* @__PURE__ */ new Set(), i = e.sort ? e.sort.filter((o) => !C(o.columnId) || n.has(o.columnId) ? !1 : (n.add(o.columnId), !0)) : void 0, s = {};
409
- return t != null && t.length && (s.order = t), r != null && r.length && (s.hidden = r), a.length && (s.labels = Object.fromEntries(a)), i && (s.sort = i.map(({ columnId: o, direction: d }) => ({
410
- columnId: o,
411
- direction: d
412
- }))), Object.keys(s).length ? s : void 0;
413
- }
414
- function X(e) {
415
- return $(e) === void 0;
416
- }
417
- function H(e, t) {
418
- if (t !== W)
419
- return {
420
- ok: !1,
421
- error: `Unsupported table settings version ${t}.`
422
- };
423
- const r = Z.safeParse(e);
424
- return r.success ? {
425
- ok: !0,
426
- value: $(r.data) ?? {}
427
- } : { ok: !1, error: "Table settings are invalid." };
428
- }
429
- function Ee(e, t, r) {
430
- if (!e || typeof e != "object" || Array.isArray(e)) return {};
431
- const a = {};
432
- for (const [n, i] of Object.entries(
433
- e
434
- )) {
435
- if (!r.has(n)) continue;
436
- const s = H(i, t);
437
- s.ok && !X(s.value) && (a[n] = s.value);
438
- }
439
- return a;
440
- }
441
- const ee = /* @__PURE__ */ new Set([
442
- "table",
443
- "detailTable"
444
- ]);
445
- function x(e) {
446
- return ee.has(e.type);
447
- }
448
- function te(e) {
449
- var t, r;
450
- return x(e) && ((r = (t = e.preferences) == null ? void 0 : t.tablePrefs) == null ? void 0 : r.allowViewerColumnCustomization) !== !1;
451
- }
452
- function Ne(e) {
453
- return new Set(
454
- m(e).filter(({ card: t }) => x(t)).map(({ card: t }) => t.id)
455
- );
456
- }
457
- function ve(e) {
458
- return new Set(
459
- m(e).filter(({ card: t }) => te(t)).map(({ card: t }) => t.id)
460
- );
461
- }
462
- export {
463
- P as A,
464
- ue as B,
465
- ge as C,
466
- F as D,
467
- Se as E,
468
- oe as F,
469
- m as G,
470
- se as H,
471
- de as I,
472
- ce as J,
473
- le as K,
474
- L as V,
475
- fe as a,
476
- pe as b,
477
- V as c,
478
- q as d,
479
- ye as e,
480
- he as f,
481
- be as g,
482
- Ie as h,
483
- W as i,
484
- X as j,
485
- H as k,
486
- Ee as l,
487
- Ce as m,
488
- $ as n,
489
- x as o,
490
- Y as p,
491
- te as q,
492
- me as r,
493
- Ne as s,
494
- J as t,
495
- ve as u,
496
- O as v,
497
- T as w,
498
- j as x,
499
- ne as y,
500
- ie as z
501
- };
@@ -1,59 +0,0 @@
1
- import { useState as C, useRef as m, useEffect as h, useCallback as W } from "react";
2
- const j = (n) => JSON.stringify(n, (e, r) => !r || typeof r != "object" || Array.isArray(r) ? r : Object.keys(r).sort().reduce((c, l) => (c[l] = r[l], c), {}));
3
- function O(n, e, r = 300, c = 1e3, l) {
4
- const [D, f] = C(!1), [I, o] = C(!1), d = m(null), t = m(0), T = m(n), w = m(e), u = l || j;
5
- h(() => {
6
- t.current += 1;
7
- const a = t.current, k = T.current !== n, R = w.current !== e;
8
- if (T.current = n, w.current = e, e === null) {
9
- const i = window.setTimeout(() => {
10
- a === t.current && (f(!1), o(!1));
11
- }, 0);
12
- return () => clearTimeout(i);
13
- }
14
- if (R && !k) {
15
- const i = window.setTimeout(() => {
16
- if (a === t.current) {
17
- const s = u(n), y = u(e);
18
- f(s !== y), o(!1);
19
- }
20
- }, 0);
21
- return () => clearTimeout(i);
22
- }
23
- const g = k ? window.setTimeout(() => {
24
- a === t.current && o(!0);
25
- }, 0) : null, z = setTimeout(() => {
26
- const i = window.requestIdleCallback || ((s) => window.setTimeout(
27
- () => s({
28
- didTimeout: !1,
29
- timeRemaining: () => 50
30
- }),
31
- 1
32
- ));
33
- d.current = i(
34
- (s) => {
35
- if (s.timeRemaining() > 0 || s.didTimeout) {
36
- if (a !== t.current) return;
37
- const y = u(n), P = u(e);
38
- f(y !== P), o(!1);
39
- }
40
- },
41
- { timeout: c }
42
- );
43
- }, r);
44
- return () => {
45
- g !== null && clearTimeout(g), clearTimeout(z), d.current !== null && ((window.cancelIdleCallback || window.clearTimeout)(d.current), d.current = null);
46
- };
47
- }, [n, e, r, c, u]);
48
- const b = W(() => {
49
- f(!1), o(!1);
50
- }, []);
51
- return {
52
- isDirty: e === null ? !1 : D,
53
- isDirtyPending: e === null ? !1 : I,
54
- resetDirty: b
55
- };
56
- }
57
- export {
58
- O as u
59
- };
@@ -1,46 +0,0 @@
1
- const u = /* @__PURE__ */ new Map();
2
- function l(e, t) {
3
- let n = u.get(t);
4
- n || (n = new Intl.DateTimeFormat("en-CA", {
5
- calendar: "gregory",
6
- numberingSystem: "latn",
7
- timeZone: t,
8
- year: "numeric",
9
- month: "2-digit",
10
- day: "2-digit",
11
- hour: "2-digit",
12
- minute: "2-digit",
13
- second: "2-digit",
14
- hourCycle: "h23"
15
- }), u.set(t, n));
16
- const c = n.formatToParts(e), r = (s) => {
17
- var o;
18
- return Number((o = c.find((i) => i.type === s)) == null ? void 0 : o.value);
19
- };
20
- return {
21
- year: r("year"),
22
- month: r("month"),
23
- day: r("day"),
24
- hour: r("hour"),
25
- minute: r("minute"),
26
- second: r("second")
27
- };
28
- }
29
- function m(e) {
30
- const t = /* @__PURE__ */ new Date(0);
31
- return t.setUTCFullYear(e.year, e.month - 1, e.day), t.setUTCHours(e.hour, e.minute, e.second, e.millisecond ?? 0), t.getTime();
32
- }
33
- function a(e, t) {
34
- const n = e - (e % 1e3 + 1e3) % 1e3;
35
- return m(l(new Date(n), t)) - n;
36
- }
37
- const d = 864e5;
38
- function f(e, t) {
39
- const n = m(e), c = a(n - d, t), r = a(n + d, t), s = [.../* @__PURE__ */ new Set([c, r])].map((o) => n - o).filter((o) => a(o, t) === n - o).sort((o, i) => o - i);
40
- return new Date(s.length ? s[0] : n - c);
41
- }
42
- export {
43
- f as a,
44
- m as w,
45
- l as z
46
- };
@@ -1,7 +0,0 @@
1
- import { DashboardChangeCompileResult, DashboardChangePlan, GeneratedDashboardCardArtifact } from './contracts.js';
2
- import { TDashboard } from '../../lib/types/index.js';
3
- export declare function applyDashboardChangePlan(input: {
4
- dashboard: TDashboard;
5
- changePlan: DashboardChangePlan;
6
- cardArtifacts: GeneratedDashboardCardArtifact[];
7
- }): DashboardChangeCompileResult;
@@ -1,2 +0,0 @@
1
- import { DashboardLayoutCompileInput, DashboardLayoutCompileResult } from './contracts.js';
2
- export declare function compileResponsiveDashboardLayouts(inputs: DashboardLayoutCompileInput[]): DashboardLayoutCompileResult;
@@ -1,27 +0,0 @@
1
- import { Breakpoint } from '../../lib/types/common-types.js';
2
- export type PersistedFrameLayoutItem = {
3
- i: string;
4
- x: number;
5
- y: number;
6
- w: number;
7
- h: number;
8
- minW?: number;
9
- minH?: number;
10
- maxW?: number;
11
- maxH?: number;
12
- static?: boolean;
13
- isResizable?: boolean;
14
- isDraggable?: boolean;
15
- };
16
- export type PersistedFrameLayouts = Partial<Record<Breakpoint, PersistedFrameLayoutItem[]>>;
17
- export type CreateFrameLayoutsOptions = {
18
- id: string;
19
- layouts?: PersistedFrameLayouts;
20
- initialHeight?: number;
21
- x?: number;
22
- y?: number;
23
- w?: number;
24
- minH?: number;
25
- minW?: number;
26
- };
27
- export declare function createFrameLayouts({ id, layouts, initialHeight, y, x, w, minH, minW, }: CreateFrameLayoutsOptions): PersistedFrameLayouts;
@@ -1,23 +0,0 @@
1
- import { Breakpoint, TFrame } from '../../lib/types/common-types.js';
2
- import { PersistedFrameLayoutItem, PersistedFrameLayouts } from './create-frame-layouts.js';
3
- export declare function resizeFrameLayoutsForFrameTypeChange({ layouts, previousFrame, nextFrame, }: {
4
- layouts: PersistedFrameLayouts | undefined;
5
- previousFrame: TFrame | undefined;
6
- nextFrame: TFrame;
7
- }): PersistedFrameLayouts | undefined;
8
- export declare function addToLayout({ id, layouts, initialHeight, y, x, w, minH, frame, }: {
9
- id: string;
10
- layouts: PersistedFrameLayouts | undefined;
11
- initialHeight?: number;
12
- x?: number;
13
- y?: number;
14
- w?: number;
15
- minH?: number;
16
- frame?: TFrame;
17
- }): Partial<Record<Breakpoint, PersistedFrameLayoutItem[]>>;
18
- export declare function removeFromLayout(id: string, layouts: PersistedFrameLayouts | undefined): PersistedFrameLayouts | undefined;
19
- export declare function duplicateLayoutItem({ sourceId, duplicatedId, layouts, }: {
20
- sourceId: string;
21
- duplicatedId: string;
22
- layouts: PersistedFrameLayouts | undefined;
23
- }): PersistedFrameLayouts | undefined;