react-semaphor 0.1.548 → 0.1.550

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 (51) hide show
  1. package/dist/assistant-context/index.js +1 -1
  2. package/dist/brand-studio/index.js +1 -1
  3. package/dist/briefings/index.js +1 -1
  4. package/dist/chunks/{assistant-chat-DCcWsoGm.js → assistant-chat-ClAvjeNe.js} +1834 -1849
  5. package/dist/chunks/{custom-visual-inputs-BTRnwsfd.js → custom-visual-inputs-CwAcigQS.js} +1 -1
  6. package/dist/chunks/{dashboard-BZHL9a-z.js → dashboard-DDQgKoss.js} +1 -1
  7. package/dist/chunks/dashboard-briefing-launcher-CCYs8E4j.js +3844 -0
  8. package/dist/chunks/{dashboard-controls-BGoBTPS7.js → dashboard-controls-DfSkQBsk.js} +982 -935
  9. package/dist/chunks/{dashboard-json-iHPsdn3j.js → dashboard-json-BPhyn9pl.js} +2 -2
  10. package/dist/chunks/{document-dashboard-inputs-B2AqPfrq.js → document-dashboard-inputs-DPQ_wUGD.js} +2 -2
  11. package/dist/chunks/{edit-dashboard-visual-CLEFFf2T.js → edit-dashboard-visual-G7EmLuR0.js} +280 -280
  12. package/dist/chunks/{filter-reach-copy-ByzGadUk.js → filter-reach-copy-8vnDYToV.js} +95 -93
  13. package/dist/chunks/{global-date-filter-utils-CeeFJ1CP.js → global-date-filter-utils-CnumW4j2.js} +1656 -1651
  14. package/dist/chunks/{index-DeDHr3iz.js → index-DzsdV1o4.js} +3 -3
  15. package/dist/chunks/{raw-temporal-presentation-CrUM2I_o.js → raw-temporal-presentation-CBKeEPYA.js} +1 -1
  16. package/dist/chunks/report-preferences-dialog-D_fEDaS4.js +2261 -0
  17. package/dist/chunks/{resolve-dashboard-input-context-BmWF9hSl.js → resolve-dashboard-input-context-DVWF7p5C.js} +1 -1
  18. package/dist/chunks/{saved-dashboard-context-qtfzl9Eb.js → saved-dashboard-context-BMqMzNAo.js} +4 -4
  19. package/dist/chunks/{semaphor-ready-indicator-Ol6VcaR7.js → semaphor-ready-indicator-Bz5BxITW.js} +25406 -25106
  20. package/dist/chunks/{shelf-drop-preview-context-C2SEC3I9.js → shelf-drop-preview-context-B8kNwpWQ.js} +4 -4
  21. package/dist/chunks/{switch-CEBOR4n7.js → switch-wJP6O7ZT.js} +2 -2
  22. package/dist/chunks/{use-create-flow-overlay-state-CbGIjaVD.js → use-create-flow-overlay-state-RzJa7G8S.js} +3 -3
  23. package/dist/dashboard/index.js +1 -1
  24. package/dist/dashboard-authoring/index.js +7 -7
  25. package/dist/index.js +187 -172
  26. package/dist/live-channel/index.js +124 -0
  27. package/dist/style.css +1 -1
  28. package/dist/surfboard/index.js +1 -1
  29. package/dist/types/components/assistant/assistant-entry-points.d.ts +4 -1
  30. package/dist/types/components/dashboard/favorites/dashboard-favorite-toggle.d.ts +11 -0
  31. package/dist/types/components/dashboard/favorites/favorite-star-button.d.ts +16 -0
  32. package/dist/types/components/index.d.ts +8 -0
  33. package/dist/types/components/sharing-and-management/hooks/use-resource-management.d.ts +16 -0
  34. package/dist/types/components/surfboard/dashboard-plus.d.ts +1 -1
  35. package/dist/types/components/surfboard/toolbar/toolbar-context.d.ts +86 -0
  36. package/dist/types/components/surfboard/toolbar/toolbar-overflow.d.ts +14 -0
  37. package/dist/types/lib/dashboard-viewer/viewer-store-state.d.ts +7 -0
  38. package/dist/types/lib/hooks/use-dashboard-favorite.d.ts +24 -0
  39. package/dist/types/lib/hooks/use-dashboard-query.d.ts +2 -0
  40. package/dist/types/lib/hooks/use-default-dashboard-toggle.d.ts +12 -0
  41. package/dist/types/lib/stores/dashboard-store.d.ts +9 -0
  42. package/dist/types/lib/types/common-types.d.ts +26 -1
  43. package/dist/types/live-channel.d.ts +2 -0
  44. package/dist/types/shared/assistant-protocol/parts.d.ts +11 -0
  45. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +14 -44
  46. package/dist/types/shared/dashboard-viewer/viewer-contract.d.ts +18 -0
  47. package/dist/types/shared/live-channel/index.d.ts +1 -0
  48. package/dist/types/shared/live-channel/live-channel-contract.d.ts +126 -0
  49. package/package.json +5 -1
  50. package/dist/chunks/dashboard-briefing-launcher-DML-cAzB.js +0 -3734
  51. package/dist/chunks/report-preferences-dialog-CM7kXmXp.js +0 -1977
@@ -0,0 +1,124 @@
1
+ const m = {
2
+ heartbeatMs: 25e3,
3
+ /** A screen's record expires this long after its last heartbeat: it is gone. */
4
+ heartbeatExpiryMs: 75e3,
5
+ hiddenTabGraceMs: 12e4,
6
+ /** Then the last value repeatedly. */
7
+ reconnectBackoffMs: [0, 1e3, 2e3, 5e3],
8
+ /** One per call. */
9
+ copyAnswerWaitMs: 3e3,
10
+ outcomeWaitMs: 8e3,
11
+ /** applyWithinMs = the outcome wait less this. */
12
+ applyMarginMs: 1e3,
13
+ /** A copy answer or an outcome is kept this long past its call's wait. */
14
+ replyRetentionMs: 3e4,
15
+ /** Distinct screens; a sixth gets 429. */
16
+ connectionsPerToken: 5
17
+ }, a = 200, u = 500, c = 50, p = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i, l = /* @__PURE__ */ new Set(["dashboard_changed", "not_editable", "refused", "expired"]);
18
+ function d(r) {
19
+ return typeof r == "string" && p.test(r);
20
+ }
21
+ function b(r, n) {
22
+ const e = I(n);
23
+ if (!e) return t("the event data is not a JSON object");
24
+ if (e.type !== r) return t("the event name and type differ");
25
+ switch (e.type) {
26
+ case "connected":
27
+ return s(e.connectionId) ? { ok: !0, value: { type: "connected", connectionId: e.connectionId } } : t("connected needs a connectionId");
28
+ case "copy_request":
29
+ return s(e.requestId) ? s(e.dashboardId) ? {
30
+ ok: !0,
31
+ value: { type: "copy_request", requestId: e.requestId, dashboardId: e.dashboardId }
32
+ } : t("copy_request needs a dashboardId") : t("copy_request needs a requestId");
33
+ case "delivery":
34
+ return s(e.deliveryId) ? s(e.revisionId) ? s(e.proposalId) ? f(e.operations) ? h(e.context) ? v(e.summary) ? typeof e.applyWithinMs != "number" || !Number.isFinite(e.applyWithinMs) || e.applyWithinMs <= 0 ? t("delivery needs a positive applyWithinMs") : {
35
+ ok: !0,
36
+ value: {
37
+ type: "delivery",
38
+ deliveryId: e.deliveryId,
39
+ revisionId: e.revisionId,
40
+ proposalId: e.proposalId,
41
+ operations: e.operations,
42
+ context: e.context,
43
+ summary: e.summary,
44
+ applyWithinMs: e.applyWithinMs
45
+ }
46
+ } : t("delivery needs a summary") : t("delivery needs a context") : t("delivery needs operations") : t("delivery needs a proposalId") : t("delivery needs a revisionId") : t("delivery needs a deliveryId");
47
+ default:
48
+ return t("unknown event type");
49
+ }
50
+ }
51
+ function M(r, n) {
52
+ const e = o(r);
53
+ if (!e) return t("the answer is not an object");
54
+ if (e.kind !== "uploaded") return t('kind must be "uploaded"');
55
+ if (e.screenId !== n.screenId || !d(e.screenId))
56
+ return t("screenId must match the query string");
57
+ if (e.requestId !== n.requestId || !s(e.requestId))
58
+ return t("requestId must match the query string");
59
+ if (!s(e.revisionId)) return t("the answer needs a revisionId");
60
+ const i = o(e.dashboard);
61
+ return !i || !s(i.id) ? t("the answer needs a dashboard with an id") : {
62
+ ok: !0,
63
+ value: {
64
+ kind: "uploaded",
65
+ screenId: e.screenId,
66
+ requestId: e.requestId,
67
+ revisionId: e.revisionId,
68
+ dashboard: i
69
+ }
70
+ };
71
+ }
72
+ function _(r) {
73
+ const n = o(r);
74
+ if (!n) return t("the report is not an object");
75
+ if (!d(n.screenId)) return t("the report needs a screenId (UUID v4)");
76
+ if (!s(n.deliveryId)) return t("the report needs a deliveryId");
77
+ const e = y(n.outcome);
78
+ return e ? { ok: !0, value: { screenId: n.screenId, deliveryId: n.deliveryId, outcome: e } } : t("the report needs an outcome");
79
+ }
80
+ function y(r) {
81
+ const n = o(r);
82
+ return n ? n.status === "applied" ? { status: "applied" } : n.status === "not_applied" && typeof n.reason == "string" && l.has(n.reason) && typeof n.message == "string" && n.message.length <= u ? {
83
+ status: "not_applied",
84
+ reason: n.reason,
85
+ message: n.message
86
+ } : null : null;
87
+ }
88
+ function t(r) {
89
+ return { ok: !1, problem: r };
90
+ }
91
+ function I(r) {
92
+ try {
93
+ return o(JSON.parse(r));
94
+ } catch {
95
+ return null;
96
+ }
97
+ }
98
+ function o(r) {
99
+ return r !== null && typeof r == "object" && !Array.isArray(r) ? r : null;
100
+ }
101
+ function s(r) {
102
+ return typeof r == "string" && r.length > 0 && r.length <= a;
103
+ }
104
+ function f(r) {
105
+ return Array.isArray(r) && r.length > 0 && r.every((n) => {
106
+ const e = o(n);
107
+ return e !== null && typeof e.op == "string";
108
+ });
109
+ }
110
+ function h(r) {
111
+ const n = o(r);
112
+ return n !== null && (n.calendar === null || o(n.calendar) !== null);
113
+ }
114
+ function v(r) {
115
+ return Array.isArray(r) && r.length <= c && r.every((n) => typeof n == "string");
116
+ }
117
+ export {
118
+ m as LIVE_CHANNEL_TIMINGS,
119
+ d as isScreenId,
120
+ _ as parseDeliveryOutcomeReport,
121
+ b as parseLiveChannelEvent,
122
+ M as parseScreenCopyAnswer,
123
+ y as parseScreenOutcome
124
+ };