react-semaphor 0.1.544 → 0.1.545

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 (88) hide show
  1. package/dist/analytics-protocol/index.js +35 -34
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/brand-studio/index.js +2 -2
  4. package/dist/briefings/index.js +50 -47
  5. package/dist/chunks/{class-utils-Df1OVOT1.js → _commonjsHelpers-DimLPMtv.js} +124 -98
  6. package/dist/chunks/{apply-dashboard-operations-Bz4n1Lq6.js → apply-dashboard-operations-CZEMsx8E.js} +778 -958
  7. package/dist/chunks/{assistant-chat-BNLkCDml.js → assistant-chat-D7sWTypJ.js} +308 -309
  8. package/dist/chunks/calendar-day-equality-dvoQp1xW.js +410 -0
  9. package/dist/chunks/{comparison-window-caption-BTkrN3W4.js → comparison-window-caption-D4E6IHPD.js} +56 -55
  10. package/dist/chunks/{custom-visual-inputs-DUtpYZOk.js → custom-visual-inputs-DLCD9Y5V.js} +8 -2
  11. package/dist/chunks/{dashboard-g5a4DKWq.js → dashboard-B1tMju0u.js} +1 -1
  12. package/dist/chunks/{dashboard-briefing-launcher-DQ_8O_e2.js → dashboard-briefing-launcher-CePgIu0Z.js} +771 -776
  13. package/dist/chunks/{dashboard-controls-8RyBTQUO.js → dashboard-controls-Cq05n3e0.js} +28 -28
  14. package/dist/chunks/{dashboard-json-7qT9jmfL.js → dashboard-json-CoYRPqxx.js} +3 -3
  15. package/dist/chunks/document-dashboard-inputs-BesAHZvB.js +3112 -0
  16. package/dist/chunks/{edit-dashboard-visual-BfJwnRIZ.js → edit-dashboard-visual-JPtNfJRb.js} +5624 -5615
  17. package/dist/chunks/{filter-value-text-CYsVYPuD.js → filter-value-text-ff7osJr7.js} +1 -1
  18. package/dist/chunks/{index-DkAyQvC6.js → index-DRWiuqyd.js} +378 -333
  19. package/dist/chunks/{matrix-formatter-CxJLkztA.js → matrix-formatter-DnCyRXJE.js} +13 -13
  20. package/dist/chunks/{numeric-presentation-DESvLiu9.js → numeric-presentation-7X_IrD58.js} +2571 -2572
  21. package/dist/chunks/{raw-temporal-presentation-CLiVi90c.js → raw-temporal-presentation-C3mUgnEx.js} +1 -1
  22. package/dist/chunks/{zoned-wall-clock-MulfA26h.js → relative-date-label-Bk2j94pA.js} +21 -64
  23. package/dist/chunks/rendered-file-D8xEuVVx.js +108 -0
  24. package/dist/chunks/{report-preferences-dialog-Df7VpRVW.js → report-preferences-dialog-DUtuUL_5.js} +631 -603
  25. package/dist/chunks/resolve-dashboard-input-context-DJ2tICwz.js +9415 -0
  26. package/dist/chunks/{saved-dashboard-context-B-mQ--nV.js → saved-dashboard-context-LrF_kW0l.js} +183 -211
  27. package/dist/chunks/selection-filter-compiler-BKXmyLrS.js +79 -0
  28. package/dist/chunks/{semaphor-ready-indicator-DDAxk8us.js → semaphor-ready-indicator-BxF96Yhv.js} +45764 -46519
  29. package/dist/chunks/{shelf-drop-preview-context-BSRPwaED.js → shelf-drop-preview-context-CNaM_Gmh.js} +885 -866
  30. package/dist/chunks/{switch-C3jLxlG0.js → switch-uDtPgQlQ.js} +44 -45
  31. package/dist/chunks/{table-export-sheet-CPfGAQ9X.js → table-export-sheet-YzMioA7Y.js} +1 -1
  32. package/dist/chunks/{use-create-flow-overlay-state-BxzFviM-.js → use-create-flow-overlay-state-CjB7ig1o.js} +105 -105
  33. package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +46 -0
  34. package/dist/dashboard/index.js +1 -1
  35. package/dist/dashboard-authoring/index.js +556 -544
  36. package/dist/data-app-sdk/index.js +1 -1
  37. package/dist/format-utils/index.js +163 -152
  38. package/dist/index.js +351 -323
  39. package/dist/style.css +1 -1
  40. package/dist/surfboard/index.js +1 -1
  41. package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
  42. package/dist/types/briefings/attachments.d.ts +33 -6
  43. package/dist/types/briefings/index.d.ts +6 -5
  44. package/dist/types/components/surfboard/filter/types.d.ts +0 -14
  45. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +68 -82
  46. package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +0 -8
  47. package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +35 -1
  48. package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +199 -0
  49. package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +7 -2
  50. package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +1 -1
  51. package/dist/types/lib/dashboard-viewer/captured-runtime-values.d.ts +40 -0
  52. package/dist/types/lib/dashboard-viewer/compatibility-input-storage.d.ts +16 -16
  53. package/dist/types/lib/dashboard-viewer/viewer-state.d.ts +11 -9
  54. package/dist/types/lib/download-pdf.d.ts +75 -1
  55. package/dist/types/lib/hooks/use-date-filter.d.ts +5 -0
  56. package/dist/types/lib/hooks/use-text-filter.d.ts +5 -0
  57. package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +5 -4
  58. package/dist/types/lib/query-context/assemble-card-query.d.ts +158 -0
  59. package/dist/types/lib/query-context/build-card-query-context.d.ts +3 -3
  60. package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +15 -6
  61. package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +11 -13
  62. package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +22 -12
  63. package/dist/types/lib/stores/dashboard-store.d.ts +39 -55
  64. package/dist/types/lib/stores/editor-store.d.ts +0 -3
  65. package/dist/types/lib/types/common-types.d.ts +21 -6
  66. package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +4 -11
  67. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +12 -12
  68. package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +7 -0
  69. package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +92 -0
  70. package/dist/types/shared/dashboard-authoring/filter-model/ad-hoc-filter-values.d.ts +10 -0
  71. package/dist/types/shared/dashboard-authoring/filter-model/filter-definitions.d.ts +29 -0
  72. package/dist/types/shared/dashboard-authoring/filter-model/filter-values.d.ts +58 -0
  73. package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +7 -0
  74. package/dist/types/shared/dashboard-authoring/filter-model/prototype-document-inputs.d.ts +15 -0
  75. package/dist/types/shared/dashboard-authoring/filter-model/read-dashboard-filter-model.d.ts +78 -0
  76. package/dist/types/shared/dashboard-authoring/filter-model/stored-dashboard.d.ts +18 -0
  77. package/dist/types/shared/dashboard-authoring/filter-model/toolbar-filter-reach.d.ts +23 -0
  78. package/dist/types/shared/dashboard-authoring/index.d.ts +2 -0
  79. package/dist/types/shared/format-utils/exporters/index.d.ts +2 -0
  80. package/dist/types/shared/format-utils/exporters/rendered-file.d.ts +106 -0
  81. package/package.json +2 -2
  82. package/dist/chunks/_commonjsHelpers-BkfeUUK-.js +0 -28
  83. package/dist/chunks/calendar-day-equality-BmJAWduY.js +0 -460
  84. package/dist/chunks/document-dashboard-inputs-BC6p-ESg.js +0 -8087
  85. package/dist/chunks/document-sheet-utils-Duo9uLoH.js +0 -3619
  86. package/dist/chunks/sort-target-MT1WK1vX.js +0 -29
  87. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +0 -88
  88. package/dist/types/lib/dashboard-inputs/dashboard-input-scope.d.ts +0 -10
@@ -1,6 +1,6 @@
1
1
  import "./analytics-base-schemas-BFAoRlkU.js";
2
2
  import { r as P } from "./pivot-result-identity-DJhXXcns.js";
3
- import { r as R, n as M } from "./numeric-presentation-DESvLiu9.js";
3
+ import { r as R, n as M } from "./numeric-presentation-7X_IrD58.js";
4
4
  import "./validators-DMHTpf7a.js";
5
5
  import "./matrix-operation-contract-8OIO4gob.js";
6
6
  import { v as S } from "./raw-temporal-contract-C51YG48G.js";
@@ -1,12 +1,12 @@
1
- function y(t) {
1
+ function u(t) {
2
2
  if (!t) return null;
3
- for (const [e, o] of Object.entries(T))
4
- if (w(o, t))
3
+ for (const [e, o] of Object.entries(m))
4
+ if (f(o, t))
5
5
  return e;
6
6
  return null;
7
7
  }
8
- const d = (t, e) => Math.abs(t) === 1 ? e : `${e}s`;
9
- function h(t, e) {
8
+ const r = (t, e) => Math.abs(t) === 1 ? e : `${e}s`;
9
+ function a(t, e) {
10
10
  if (t === 0)
11
11
  return e === "day" ? "today" : `this ${e}`;
12
12
  if (t === -1)
@@ -14,28 +14,28 @@ function h(t, e) {
14
14
  if (t === 1)
15
15
  return e === "day" ? "tomorrow" : `next ${e}`;
16
16
  const o = Math.abs(t);
17
- return t < 0 ? `${o} ${d(o, e)} ago` : `${o} ${d(o, e)} ahead`;
17
+ return t < 0 ? `${o} ${r(o, e)} ago` : `${o} ${r(o, e)} ahead`;
18
18
  }
19
- const L = (t) => t.charAt(0).toUpperCase() + t.slice(1);
20
- function l(t, e) {
21
- return L(h(t, e));
19
+ const d = (t) => t.charAt(0).toUpperCase() + t.slice(1);
20
+ function s(t, e) {
21
+ return d(a(t, e));
22
22
  }
23
- function p(t) {
23
+ function l(t) {
24
24
  if (!t) return null;
25
25
  if (t.mode === "last" && t.relativeTo === "latest_data") {
26
- const { relativeTo: o, ...s } = t, n = p(s);
26
+ const { relativeTo: o, ...i } = t, n = l(i);
27
27
  return n ? `${n} of data` : null;
28
28
  }
29
- const e = y(t);
30
- return e || (t.mode === "this" ? t.boundary === "first_day" ? "First day of the month" : t.boundary === "last_day" ? "Last day of the month" : `This ${t.unit}${t.toDate ? " to date" : ""}` : t.mode === "previous" ? `Last ${t.unit}` : t.mode === "last" ? `Last ${t.n} ${d(t.n, t.unit)}` : t.mode === "between" ? t.from === t.to ? l(t.from, t.unit) : `${l(t.from, t.unit)} to ${h(
29
+ const e = u(t);
30
+ return e || (t.mode === "this" ? t.boundary === "first_day" ? "First day of the month" : t.boundary === "last_day" ? "Last day of the month" : `This ${t.unit}${t.toDate ? " to date" : ""}` : t.mode === "previous" ? `Last ${t.unit}` : t.mode === "last" ? `Last ${t.n} ${r(t.n, t.unit)}` : t.mode === "between" ? t.from === t.to ? s(t.from, t.unit) : `${s(t.from, t.unit)} to ${a(
31
31
  t.to,
32
32
  t.unit
33
33
  )}` : null);
34
34
  }
35
- function w(t, e) {
35
+ function f(t, e) {
36
36
  return !(t.mode !== e.mode || t.unit !== e.unit || t.mode === "last" && e.mode === "last" && (t.n !== e.n || !!t.complete != !!e.complete || t.relativeTo !== e.relativeTo) || t.mode === "this" && e.mode === "this" && (!!t.toDate != !!e.toDate || t.boundary !== e.boundary) || t.mode === "between" && e.mode === "between" && (t.from !== e.from || t.to !== e.to));
37
37
  }
38
- const T = {
38
+ const m = {
39
39
  // Sub-day presets
40
40
  "Last 30 minutes": { mode: "last", n: 30, unit: "minute" },
41
41
  "Last 1 hour": { mode: "last", n: 1, unit: "hour" },
@@ -76,54 +76,11 @@ const T = {
76
76
  // Year presets
77
77
  "This year": { mode: "this", unit: "year" },
78
78
  "Last year": { mode: "previous", unit: "year" }
79
- }, m = /* @__PURE__ */ new Map();
80
- function v(t, e) {
81
- let o = m.get(e);
82
- o || (o = new Intl.DateTimeFormat("en-CA", {
83
- calendar: "gregory",
84
- numberingSystem: "latn",
85
- timeZone: e,
86
- year: "numeric",
87
- month: "2-digit",
88
- day: "2-digit",
89
- hour: "2-digit",
90
- minute: "2-digit",
91
- second: "2-digit",
92
- hourCycle: "h23"
93
- }), m.set(e, o));
94
- const s = o.formatToParts(t), n = (i) => {
95
- var r;
96
- return Number((r = s.find((a) => a.type === i)) == null ? void 0 : r.value);
97
- };
98
- return {
99
- year: n("year"),
100
- month: n("month"),
101
- day: n("day"),
102
- hour: n("hour"),
103
- minute: n("minute"),
104
- second: n("second")
105
- };
106
- }
107
- function c(t) {
108
- const e = /* @__PURE__ */ new Date(0);
109
- return e.setUTCFullYear(t.year, t.month - 1, t.day), e.setUTCHours(t.hour, t.minute, t.second, t.millisecond ?? 0), e.getTime();
110
- }
111
- function u(t, e) {
112
- const o = t - (t % 1e3 + 1e3) % 1e3;
113
- return c(v(new Date(o), e)) - o;
114
- }
115
- const f = 864e5;
116
- function $(t, e) {
117
- const o = c(t), s = u(o - f, e), n = u(o + f, e), i = [.../* @__PURE__ */ new Set([s, n])].map((r) => o - r).filter((r) => u(r, e) === o - r).sort((r, a) => r - a);
118
- return new Date(i.length ? i[0] : o - s);
119
- }
79
+ };
120
80
  export {
121
- l as a,
122
- $ as b,
123
- y as f,
124
- p as g,
125
- T as p,
126
- w as r,
127
- c as w,
128
- v as z
81
+ s as a,
82
+ u as f,
83
+ l as g,
84
+ m as p,
85
+ f as r
129
86
  };
@@ -0,0 +1,108 @@
1
+ const m = 1280, r = {
2
+ minCssWidth: 320,
3
+ minCssHeight: 120,
4
+ maxCardCssWidth: 4096,
5
+ maxCardCssHeight: 4096,
6
+ maxSheetCssWidth: 4096,
7
+ /** Chromium's largest capture in device pixels, either side. */
8
+ maxDevicePixels: 16384
9
+ }, f = 1024, n = { fit: "imageFit", width: "imageWidth", height: "imageHeight" };
10
+ function c(t, e) {
11
+ if (t instanceof URLSearchParams) return t.get(e) ?? void 0;
12
+ const i = t[e];
13
+ return typeof i == "string" ? i : void 0;
14
+ }
15
+ function u(t) {
16
+ if (!(t === void 0 || !/^\d{1,6}$/.test(t.trim())))
17
+ return Number(t.trim());
18
+ }
19
+ function o(t, e, i) {
20
+ return Math.min(Math.max(t, e), i);
21
+ }
22
+ function g(t) {
23
+ const { minCssWidth: e, minCssHeight: i, maxCardCssWidth: s, maxCardCssHeight: a } = r;
24
+ return {
25
+ cssWidth: o(Math.round(t.cssWidth), e, s),
26
+ cssHeight: o(Math.round(t.cssHeight), i, a)
27
+ };
28
+ }
29
+ function l(t) {
30
+ return o(Math.round(t), r.minCssWidth, r.maxSheetCssWidth);
31
+ }
32
+ function p(t) {
33
+ const e = c(t, n.fit), i = u(c(t, n.width)), s = c(t, n.height), a = u(s);
34
+ if (i === void 0) return null;
35
+ switch (e) {
36
+ case "card":
37
+ return a === void 0 ? null : { fit: "card", ...g({ cssWidth: i, cssHeight: a }) };
38
+ case "layout":
39
+ return s !== void 0 ? null : { fit: "layout", dashboardWidth: l(i) };
40
+ case "sheet":
41
+ return s !== void 0 ? null : { fit: "sheet", cssWidth: l(i) };
42
+ default:
43
+ return null;
44
+ }
45
+ }
46
+ function W(t, e) {
47
+ switch (e.set(n.fit, t.fit), e.delete(n.height), t.fit) {
48
+ case "card":
49
+ e.set(n.width, String(t.cssWidth)), e.set(n.height, String(t.cssHeight));
50
+ return;
51
+ case "layout":
52
+ e.set(n.width, String(t.dashboardWidth));
53
+ return;
54
+ case "sheet":
55
+ e.set(n.width, String(t.cssWidth));
56
+ }
57
+ }
58
+ function d(t, e) {
59
+ const i = r.maxDevicePixels;
60
+ return t * 2 <= i && e * 2 <= i ? { status: "ready", viewport: { width: t, height: e, deviceScaleFactor: 2 } } : t <= i && e <= i ? { status: "ready", viewport: { width: t, height: e, deviceScaleFactor: 1 } } : { status: "too_large", cssWidth: t, cssHeight: e };
61
+ }
62
+ function x(t, e) {
63
+ switch (t.fit) {
64
+ case "card":
65
+ return d(t.cssWidth, t.cssHeight);
66
+ case "layout":
67
+ return d(t.dashboardWidth, f);
68
+ case "sheet": {
69
+ if (e === void 0 || !Number.isFinite(e))
70
+ throw new Error("A sheet image needs the measured sheet height.");
71
+ const i = Math.max(Math.ceil(e), r.minCssHeight);
72
+ return d(t.cssWidth, i);
73
+ }
74
+ }
75
+ }
76
+ const I = ["pdf", "png", "zip"], h = {
77
+ pdf: Object.freeze({ kind: "pdf", extension: "pdf", contentType: "application/pdf", label: "PDF" }),
78
+ png: Object.freeze({ kind: "png", extension: "png", contentType: "image/png", label: "PNG image" }),
79
+ zip: Object.freeze({
80
+ kind: "zip",
81
+ extension: "zip",
82
+ contentType: "application/zip",
83
+ label: "PNG images (zip)"
84
+ })
85
+ };
86
+ function S(t) {
87
+ return { ...h[t] };
88
+ }
89
+ function C(t) {
90
+ var i;
91
+ return `${(i = t.title) != null && i.trim() ? t.title : "Report"}-${t.at.toISOString()}.${h[t.kind].extension}`;
92
+ }
93
+ function H(t) {
94
+ const e = (t.title ?? "").replace(/[\\/:*?"<>|\u0000-\u001f]+/g, "_").replace(/\s+/g, " ").trim().slice(0, 120) || "Sheet";
95
+ return `${String(t.position).padStart(2, "0")} ${e}.${h.png.extension}`;
96
+ }
97
+ export {
98
+ m as E,
99
+ r as I,
100
+ I as R,
101
+ x as a,
102
+ C as b,
103
+ g as c,
104
+ p,
105
+ S as r,
106
+ H as s,
107
+ W as w
108
+ };