react-semaphor 0.1.522 → 0.1.523

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 (31) hide show
  1. package/dist/brand-studio/index.js +1 -1
  2. package/dist/briefings/index.js +1 -1
  3. package/dist/chunks/{dashboard-briefing-launcher-BIRnsMqX.js → dashboard-briefing-launcher-CYiPCXQv.js} +4 -4
  4. package/dist/chunks/{dashboard-controls-D6Z6ws11.js → dashboard-controls-lzfI5yqq.js} +5 -5
  5. package/dist/chunks/{dashboard-json-Dq5ibJr2.js → dashboard-json-D_70142A.js} +3 -3
  6. package/dist/chunks/{edit-dashboard-visual-CYZLUQlx.js → edit-dashboard-visual-wlJKYkAf.js} +4 -4
  7. package/dist/chunks/{editor-action-buttons-DuxlCZYf.js → editor-action-buttons-CEw61v6F.js} +3 -3
  8. package/dist/chunks/{index-krDPPQuA.js → index-BBn_2FHm.js} +34805 -34462
  9. package/dist/chunks/{index-B0KwXM6P.js → index-BnZz-3jX.js} +186 -180
  10. package/dist/chunks/{report-preferences-dialog-BA9YJnPe.js → report-preferences-dialog-B7Ny-bLC.js} +2 -2
  11. package/dist/chunks/{switch-evlnTA4t.js → switch-BxOntwjd.js} +1625 -1626
  12. package/dist/dashboard/index.js +1 -1
  13. package/dist/data-app-builder/index.js +2 -2
  14. package/dist/index.js +7 -7
  15. package/dist/surfboard/index.js +2 -2
  16. package/dist/types/briefings/index.d.ts +5 -0
  17. package/dist/types/components/dashboard/dashboard-container.d.ts +1 -1
  18. package/dist/types/lib/dashboard-inputs/dashboard-input-snapshot.d.ts +26 -6
  19. package/dist/types/lib/document/document-generated-at.d.ts +13 -0
  20. package/dist/types/lib/download-pdf.d.ts +3 -0
  21. package/dist/types/lib/hooks/use-dashboard.d.ts +3 -1
  22. package/dist/types/lib/hooks/use-is-dashboard-ready.d.ts +3 -0
  23. package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +21 -0
  24. package/dist/types/lib/matrix-table/matrix-runtime.d.ts +8 -1
  25. package/dist/types/lib/matrix-table/use-matrix.d.ts +1 -0
  26. package/dist/types/lib/print/print-holds.d.ts +15 -0
  27. package/dist/types/lib/print/print-inputs.d.ts +104 -0
  28. package/dist/types/lib/print/print-sheets.d.ts +16 -0
  29. package/dist/types/lib/stores/dashboard-store.d.ts +8 -0
  30. package/dist/types/lib/types/common-types.d.ts +6 -0
  31. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { D as o } from "../chunks/index-krDPPQuA.js";
1
+ import { D as o } from "../chunks/index-BBn_2FHm.js";
2
2
  import { C as s, E as C } from "../chunks/common-types-C6cAQgyh.js";
3
3
  export {
4
4
  s as CONTROL_CARD_DEFAULT_VALUE,
@@ -2,8 +2,8 @@ import { jsx as r, jsxs as c, Fragment as re } from "react/jsx-runtime";
2
2
  import * as Zn from "react";
3
3
  import { useContext as qn, useState as x, useRef as oe, useMemo as je, useEffect as W, useCallback as Ot } from "react";
4
4
  import * as Xn from "react-dom/client";
5
- import { aL as ea, aM as ta, aN as Ir, aO as jr, aP as zr, aQ as ra, aR as Wr, aS as Hr, aT as Jr, aU as Vr, aV as _r, aW as Ur, aX as Gr, aY as na, aZ as aa, a_ as oa, a$ as Ht, b0 as on, R as Kr, b1 as sa, b2 as Vt, b3 as sn, b4 as ia, b5 as la } from "../chunks/index-krDPPQuA.js";
6
- import { B as H, P as it, a as lt, b as dt, _ as da, $ as ca, a0 as ua, a1 as pa, a2 as ha, L as me, R as ma, d as _t } from "../chunks/switch-evlnTA4t.js";
5
+ import { aL as ea, aM as ta, aN as Ir, aO as jr, aP as zr, aQ as ra, aR as Wr, aS as Hr, aT as Jr, aU as Vr, aV as _r, aW as Ur, aX as Gr, aY as na, aZ as aa, a_ as oa, a$ as Ht, b0 as on, R as Kr, b1 as sa, b2 as Vt, b3 as sn, b4 as ia, b5 as la } from "../chunks/index-BBn_2FHm.js";
6
+ import { B as H, P as it, a as lt, b as dt, _ as da, $ as ca, a0 as ua, a1 as pa, a2 as ha, L as me, R as ma, d as _t } from "../chunks/switch-BxOntwjd.js";
7
7
  import { loadSemaphorBrowserRuntime as ot } from "../data-app-builder-browser-runtime/index.js";
8
8
  import { c as Ve, X as He } from "../chunks/x-CXDkqdur.js";
9
9
  import { S as fa } from "../chunks/save-DgMfP0j8.js";
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
- import { E as x, F as B, S, c as N, U as _, d as P, C as w, V as F, e as R, f as L, g as I, h as M, I as k, R as U, i as O, j as V, k as q, l as z } from "./chunks/index-krDPPQuA.js";
2
- import { al as Ta, am as va, an as Aa, ao as Ba, W as Sa, G as Na, D as _a, A as Pa, z as wa, w as Fa, b as Ra, av as La, M as Ia, n as Ma, q as ka, q as Ua, r as Oa, B as Va, a as qa, ag as za, ai as ja, aj as Wa, ah as Qa, a7 as Ha, aa as Ka, au as Ga, _ as Ya, af as Xa, aq as $a, a2 as Ja, ab as Za, y as ae, x as ee, ay as se, Z as re, ac as oe, ad as ie, a6 as te, a9 as ne, at as le, as as de, ar as ue, ax as ce, aw as pe, a8 as fe, Y as me, X as he, a0 as Ce, ae as ge, a4 as De, a1 as Ee, a3 as xe, a5 as be, $ as ye, P as Te, L as ve, ap as Ae, v as Be, J as Se, t as Ne, m as _e, H as Pe, K as we, o as Fe, T as Re, O as Le, N as Ie, Q as Me, u as ke, s as Ue, p as Oe, ak as Ve } from "./chunks/index-krDPPQuA.js";
1
+ import { E as x, F as B, S, c as N, U as _, d as P, C as w, V as F, e as R, f as L, g as I, h as M, I as k, R as U, i as O, j as V, k as q, l as z } from "./chunks/index-BBn_2FHm.js";
2
+ import { al as Ta, am as va, an as Aa, ao as Ba, W as Sa, G as Na, D as _a, A as Pa, z as wa, w as Fa, b as Ra, av as La, M as Ia, n as Ma, q as ka, q as Ua, r as Oa, B as Va, a as qa, ag as za, ai as ja, aj as Wa, ah as Qa, a7 as Ha, aa as Ka, au as Ga, _ as Ya, af as Xa, aq as $a, a2 as Ja, ab as Za, y as ae, x as ee, ay as se, Z as re, ac as oe, ad as ie, a6 as te, a9 as ne, at as le, as as de, ar as ue, ax as ce, aw as pe, a8 as fe, Y as me, X as he, a0 as Ce, ae as ge, a4 as De, a1 as Ee, a3 as xe, a5 as be, $ as ye, P as Te, L as ve, ap as Ae, v as Be, J as Se, t as Ne, m as _e, H as Pe, K as we, o as Fe, T as Re, O as Le, N as Ie, Q as Me, u as ke, s as Ue, p as Oe, ak as Ve } from "./chunks/index-BBn_2FHm.js";
3
3
  import { C as ze, E as je } from "./chunks/common-types-C6cAQgyh.js";
4
- import { R as Qe } from "./chunks/report-preferences-dialog-BA9YJnPe.js";
4
+ import { R as Qe } from "./chunks/report-preferences-dialog-B7Ny-bLC.js";
5
5
  import { jsx as a, jsxs as l } from "react/jsx-runtime";
6
- import { u as j, P as W, a as Q, B as H, c as g, b as K, d as G } from "./chunks/switch-evlnTA4t.js";
7
- import { A as Ke, n as Ge, e as Ye, f as Xe, g as $e, p as Je, o as Ze, s as as, t as es, m as ss, i as rs, l as os, q as is, k as ts, j as ns, h as ls, v as ds, r as us, w as cs, y as ps, x as fs, z as ms, E as hs, D as Cs } from "./chunks/switch-evlnTA4t.js";
6
+ import { u as j, P as W, a as Q, B as H, c as g, b as K, d as G } from "./chunks/switch-BxOntwjd.js";
7
+ import { A as Ke, n as Ge, e as Ye, f as Xe, g as $e, p as Je, o as Ze, s as as, t as es, m as ss, i as rs, l as os, q as is, k as ts, j as ns, h as ls, v as ds, r as us, w as cs, y as ps, x as fs, z as ms, E as hs, D as Cs } from "./chunks/switch-BxOntwjd.js";
8
8
  import * as f from "react";
9
9
  import { useMemo as Y, useEffect as b } from "react";
10
10
  import { D as Ds } from "./chunks/token-types-BC6RcUY8.js";
11
11
  import { C as xs, D as bs, L as ys, P as Ts, f as vs, g as As, k as Bs, j as Ss, l as Ns, e as _s, c as Ps, b as ws, d as Fs, n as Rs, h as Ls } from "./chunks/validators-CsdOtZI6.js";
12
- import { A as Ms, h as ks, D as Us, f as Os, g as Vs, e as qs, b as zs, E as js, N as Ws, U as Qs, a as Hs, V as Ks, W as Gs, u as Ys, c as Xs, d as $s } from "./chunks/dashboard-briefing-launcher-BIRnsMqX.js";
12
+ import { A as Ms, h as ks, D as Us, f as Os, g as Vs, e as qs, b as zs, E as js, N as Ws, U as Qs, a as Hs, V as Ks, W as Gs, u as Ys, c as Xs, d as $s } from "./chunks/dashboard-briefing-launcher-CYiPCXQv.js";
13
13
  import { u as Zs } from "./chunks/use-debounced-dirty-check-BwAbnX_5.js";
14
14
  import "./chunks/matrix-operation-contract-D32U2CSw.js";
15
15
  import "./chunks/matrix-continuation-C4sRcjZU.js";
@@ -21,7 +21,7 @@ import { c as X } from "./chunks/calculated-field-identity-Dy_WpDdo.js";
21
21
  import "zod";
22
22
  import "./chunks/card-config-utils-CAyjC5Tp.js";
23
23
  import "react-dom";
24
- import "./chunks/index-B0KwXM6P.js";
24
+ import "./chunks/index-BnZz-3jX.js";
25
25
  import "./chunks/appearance-context-VJdrKi7r.js";
26
26
  import "./chunks/color-CJvdlFM_.js";
27
27
  import "./chunks/index-CLIro-EG.js";
@@ -1,6 +1,6 @@
1
- import { b as a, a as o } from "../chunks/index-krDPPQuA.js";
1
+ import { b as a, a as o } from "../chunks/index-BBn_2FHm.js";
2
2
  import { C as f, E } from "../chunks/common-types-C6cAQgyh.js";
3
- import { R as t } from "../chunks/report-preferences-dialog-BA9YJnPe.js";
3
+ import { R as t } from "../chunks/report-preferences-dialog-B7Ny-bLC.js";
4
4
  export {
5
5
  f as CONTROL_CARD_DEFAULT_VALUE,
6
6
  a as DisplayFormatPreferencesFields,
@@ -196,6 +196,11 @@ export type BriefingAttachmentSettings = {
196
196
  controlBindings?: unknown[];
197
197
  tablePreferences?: Record<string, unknown>;
198
198
  dashboardInputExecutionSnapshot?: Record<string, unknown>;
199
+ /**
200
+ * Full dashboard PDF only: one input capture per sheet under one reference
201
+ * time (react-semaphor `PrintInputCapture`). Opaque to the app.
202
+ */
203
+ printInputCapture?: Record<string, unknown>;
199
204
  selectedSheetId?: string;
200
205
  cardType?: string;
201
206
  allowDownload?: boolean;
@@ -5,5 +5,5 @@ type ContainerProps = DashboardProps & HTMLAttributes<HTMLDivElement> & {
5
5
  cardId?: string;
6
6
  dashboardId?: string;
7
7
  };
8
- export declare function Container({ className, customStyle, onSave, onEvent, onDashboardLifecycleEvent, LoadingComponent, ErrorComponent, onChartElementClicked, id, authToken, currentTheme, appearance: _appearance, version, customCards, showAssistant, defaultFilterValues, defaultControlValues, controlContractOverrides, documentInputValues: _documentInputValues, dashboardInputExecutionSnapshot, presentationExecutionSnapshot, renderMode: _renderMode, onFilterValuesChange, selectedSheetId, eventHandlers, type, cardId, dashboardId, style, ...props }: ContainerProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function Container({ className, customStyle, onSave, onEvent, onDashboardLifecycleEvent, LoadingComponent, ErrorComponent, onChartElementClicked, id, authToken, currentTheme, appearance: _appearance, version, customCards, showAssistant, defaultFilterValues, defaultControlValues, controlContractOverrides, documentInputValues: _documentInputValues, dashboardInputExecutionSnapshot, printInputCapture, presentationExecutionSnapshot, renderMode: _renderMode, onFilterValuesChange, selectedSheetId, eventHandlers, type, cardId, dashboardId, style, ...props }: ContainerProps): import("react/jsx-runtime").JSX.Element;
9
9
  export {};
@@ -1,18 +1,37 @@
1
1
  import { DashboardInputExecutionSnapshot, DashboardInputValues, NormalizedDashboardInput, ResolvedDashboardInputContext, TCard, TDashboard } from '../types/common-types.js';
2
2
  import { TFilterValue } from '../../components/surfboard/filter/types.js';
3
+ import { DashboardInputRuntimeTarget } from './dashboard-input-values.js';
3
4
  import { DashboardInputRuntimeValues } from './resolve-dashboard-input-context.js';
4
5
  import { TransientInputContext } from './transient-input-context.js';
6
+ type DashboardInputReplacementScope = {
7
+ dashboard: TDashboard;
8
+ dashboardInputValues?: DashboardInputValues;
9
+ sheetId?: string;
10
+ cardId?: string;
11
+ };
12
+ /** An applicable input whose slot replay completes as `cleared`, because nothing was captured for it. */
13
+ export type UncapturedInputSlot = {
14
+ input: NormalizedDashboardInput;
15
+ target: DashboardInputRuntimeTarget;
16
+ };
17
+ export type UncapturedInputSlotsResult = {
18
+ status: 'unresolved';
19
+ } | {
20
+ status: 'resolved';
21
+ uncaptured: UncapturedInputSlot[];
22
+ };
5
23
  /**
6
24
  * Converts replacement snapshot semantics into self-describing slots at the
7
25
  * ingestion seam. Consumers can then resolve every slot with one precedence
8
26
  * rule and never need a separately travelling authority bit.
9
27
  */
10
- export declare function completeDashboardInputReplacementValues({ dashboard, dashboardInputValues, sheetId, cardId, }: {
11
- dashboard: TDashboard;
12
- dashboardInputValues?: DashboardInputValues;
13
- sheetId?: string;
14
- cardId?: string;
15
- }): DashboardInputValues;
28
+ export declare function completeDashboardInputReplacementValues(scope: DashboardInputReplacementScope): DashboardInputValues;
29
+ /**
30
+ * Every applicable input slot that replay would complete as `cleared` for this
31
+ * scope. It runs the same completion as `completeDashboardInputReplacementValues`,
32
+ * so the two can never disagree about what a snapshot covers.
33
+ */
34
+ export declare function listUncapturedInputSlots(scope: DashboardInputReplacementScope): UncapturedInputSlotsResult;
16
35
  export type BuildDashboardInputExecutionSnapshotParams = {
17
36
  dashboard: TDashboard;
18
37
  sheetId?: string | null;
@@ -63,3 +82,4 @@ export declare function materializeDashboardInputSnapshotValues({ inputs, contex
63
82
  cardId?: string | null;
64
83
  sectionId?: string | null;
65
84
  }): DashboardInputValues;
85
+ export {};
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The first "generated at" time a Document shows. In a Document print render
3
+ * the store holds the replayed reference time for every replay source,
4
+ * including a per-sheet capture that never reaches the context prop.
5
+ * Interactive views keep seeding from the prop, legacy values, or now.
6
+ */
7
+ export declare function resolveDocumentGeneratedAtSeed(input: {
8
+ isDocumentPrintMode: boolean;
9
+ replayReferenceTime?: string;
10
+ snapshotGeneratedAt?: string;
11
+ legacyGeneratedAt?: string;
12
+ now: () => string;
13
+ }): string;
@@ -3,6 +3,7 @@ import { AuthToken, ControlBinding, ControlDefinition, DashboardInputExecutionSn
3
3
  import { TChartType } from './charts/types.js';
4
4
  import { FastPathTableStructure } from '../shared/format-utils/table-structure.js';
5
5
  import { PresentationExecutionSnapshot } from '../shared/format-utils/index.js';
6
+ import { PrintInputCapture } from './print/print-inputs.js';
6
7
  import { buildMatrixDeliveryPayload } from './matrix-table/matrix-delivery.js';
7
8
  export type MatrixPdfCapture = ReturnType<typeof buildMatrixDeliveryPayload>;
8
9
  export type DashboardParams = {
@@ -16,6 +17,8 @@ export type DashboardParams = {
16
17
  selectedSheetId?: string;
17
18
  dashboardId: string;
18
19
  dashboardInputExecutionSnapshot?: DashboardInputExecutionSnapshot;
20
+ /** "All sheets" downloads: one input capture per sheet, Documents included. */
21
+ printInputCapture?: PrintInputCapture;
19
22
  presentationExecutionSnapshot: PresentationExecutionSnapshot;
20
23
  timezone?: string;
21
24
  };
@@ -16,6 +16,8 @@ type UseDashboardProps = {
16
16
  controlBindings?: ControlBinding[];
17
17
  };
18
18
  dashboardInputExecutionSnapshot?: DashboardInputExecutionSnapshot;
19
+ /** Untrusted per-sheet input capture of a Full dashboard PDF; see resolvePrintInputs. */
20
+ printInputCapture?: unknown;
19
21
  presentationExecutionSnapshot?: PresentationExecutionSnapshot;
20
22
  customStyle?: TStyle;
21
23
  currentTheme?: 'light' | 'dark' | 'system';
@@ -28,7 +30,7 @@ type UseDashboardProps = {
28
30
  type?: 'dashboard' | 'visual';
29
31
  cardId?: string;
30
32
  };
31
- export declare function useDashboard({ customStyle, currentTheme, onSave, onEvent, onDashboardLifecycleEvent, defaultFilterValues, defaultControlValues, controlContractOverrides, dashboardInputExecutionSnapshot, presentationExecutionSnapshot, type, cardId, selectedSheetId, onFilterValuesChange, }: UseDashboardProps): {
33
+ export declare function useDashboard({ customStyle, currentTheme, onSave, onEvent, onDashboardLifecycleEvent, defaultFilterValues, defaultControlValues, controlContractOverrides, dashboardInputExecutionSnapshot, printInputCapture, presentationExecutionSnapshot, type, cardId, selectedSheetId, onFilterValuesChange, }: UseDashboardProps): {
32
34
  isFetching: boolean;
33
35
  isLoading: boolean;
34
36
  isError: boolean;
@@ -4,6 +4,9 @@
4
4
  * Uses TanStack Query's global fetching count to determine when all queries are complete.
5
5
  * This is more accurate than intercepting fetch/XHR as it only tracks actual data queries.
6
6
  *
7
+ * An active print hold (for example, a Matrix still loading visible cells)
8
+ * counts like an in-flight fetch: ready needs a quiet window with neither.
9
+ *
7
10
  * @param delayMs - Initial delay before monitoring starts (allows queries to begin)
8
11
  * @param quietMs - Time with no fetching activity before declaring ready
9
12
  * @returns boolean - true when dashboard is ready (all queries complete)
@@ -79,8 +79,29 @@ export type MatrixRuntimeSnapshot = {
79
79
  bytes: number;
80
80
  checkpoints: number;
81
81
  inFlight: number;
82
+ /** Work waiting for an operation slot in the current generation. */
83
+ queued: number;
82
84
  };
83
85
  };
86
+ /**
87
+ * Coverage of the current viewport for the current generation. `failed` wins
88
+ * over `incomplete`, which wins over `complete`.
89
+ */
90
+ export type MatrixVisibleCoverage = {
91
+ status: 'complete';
92
+ generation: number;
93
+ } | {
94
+ status: 'incomplete';
95
+ generation: number;
96
+ unloadedCells: number;
97
+ loadingCells: number;
98
+ queued: number;
99
+ inFlight: number;
100
+ } | {
101
+ status: 'failed';
102
+ generation: number;
103
+ error: MatrixRuntimeError;
104
+ };
84
105
  /** One operation boundary; providers own transport/auth, never branch assembly. */
85
106
  export type MatrixWindowExecutor = (input: {
86
107
  spec: MatrixSpec;
@@ -1,6 +1,6 @@
1
1
  import { QueryClient } from '@tanstack/react-query';
2
2
  import { MatrixAxis, MatrixCoordinate, MatrixPath, MatrixSort, MatrixViewState } from '../../shared/analytics-protocol/index.js';
3
- import { MatrixCellAddress, MatrixCellState, MatrixRuntimeInput, MatrixRuntimeSnapshot, MatrixViewport, MatrixWindowExecutor } from './matrix-runtime-types.js';
3
+ import { MatrixCellAddress, MatrixCellState, MatrixRuntimeInput, MatrixRuntimeSnapshot, MatrixViewport, MatrixVisibleCoverage, MatrixWindowExecutor } from './matrix-runtime-types.js';
4
4
  /** Owns acquisition, errors, generation fencing and retention for exactly one card. */
5
5
  export declare class MatrixRuntimeController {
6
6
  private query;
@@ -48,6 +48,13 @@ export declare class MatrixRuntimeController {
48
48
  private acceptChoices;
49
49
  retry: (retryKey: string) => void;
50
50
  readCell: (coordinate: MatrixCellAddress) => MatrixCellState;
51
+ /**
52
+ * Whether every visible axis item and cell of the current generation is
53
+ * loaded. A pure read over the slice `plan()` loads; it never schedules work.
54
+ * Value, null and empty cells are complete; unloaded and loading cells, axis
55
+ * pages still loading, and queued or active work are not.
56
+ */
57
+ readVisibleCoverage: () => MatrixVisibleCoverage;
51
58
  /** Used by explicit refresh/retry integrations; latest-issued response wins. */
52
59
  refetchCell: (coordinate: MatrixCoordinate) => void;
53
60
  refetchPage: (key: string) => void;
@@ -61,6 +61,7 @@ export declare function useMatrix(input: MatrixInput): {
61
61
  bytes: number;
62
62
  checkpoints: number;
63
63
  inFlight: number;
64
+ queued: number;
64
65
  };
65
66
  };
66
67
  export type MatrixRuntime = ReturnType<typeof useMatrix>;
@@ -0,0 +1,15 @@
1
+ /** Something that must finish before the dashboard counts as ready. */
2
+ export type PrintHold = {
3
+ /** Stable, e.g. `matrix:${cardId}`. Registrations with the same key are listed once. */
4
+ key: string;
5
+ /** Card title for error messages; never data values. */
6
+ label: string;
7
+ };
8
+ /**
9
+ * While `held` is true, the dashboard's ready flag stays false. The hold is
10
+ * released when `held` turns false or the component unmounts. Each call is its
11
+ * own registration, so parent and child components can hold the same key.
12
+ */
13
+ export declare function usePrintHold(hold: PrintHold, held: boolean): void;
14
+ /** Holds registered right now, one per key, in registration order. */
15
+ export declare function useActivePrintHolds(): readonly PrintHold[];
@@ -0,0 +1,104 @@
1
+ import { DashboardInputExecutionSnapshot, TDashboard } from '../types/common-types.js';
2
+ import { DashboardInputRuntimeValues } from '../dashboard-inputs/resolve-dashboard-input-context.js';
3
+ import { TransientInputContext } from '../dashboard-inputs/transient-input-context.js';
4
+ import { PrintSheetRef } from './print-sheets.js';
5
+ /**
6
+ * The inputs a Full dashboard PDF replays: one single-sheet capture per sheet,
7
+ * each in its own sheet's mode, under one reference time. Persisted in
8
+ * Briefing attachment settings (`settings.printInputCapture`) and carried in
9
+ * the print render record (`viewState.printInputCapture`).
10
+ */
11
+ export type PrintInputCapture = {
12
+ version: 1;
13
+ /** Relative dates resolve against this. Briefing execution rewrites it on every run. */
14
+ generatedAt: string;
15
+ /** IANA zone when known; optional like the existing snapshot contract's. */
16
+ timezone?: string;
17
+ /** Keyed by sheet id. Every printable sheet at capture time has an entry. */
18
+ sheets: Record<string, PrintSheetInputs>;
19
+ };
20
+ /** One sheet's captured inputs: a single-sheet snapshot minus the capture-level fields. */
21
+ export type PrintSheetInputs = Omit<DashboardInputExecutionSnapshot, 'generatedAt' | 'timezone' | 'mode' | 'sheetId'> & {
22
+ /** Equals its key in `sheets`. */
23
+ sheetId: string;
24
+ /** Equals the sheet's kind. */
25
+ mode: 'dashboard' | 'document';
26
+ };
27
+ /**
28
+ * What a PDF render replays for one sheet. Decided once per sheet, before the
29
+ * existing replay in useDashboard runs.
30
+ */
31
+ export type PrintInputResolution =
32
+ /** Replay this snapshot through the existing replay code. */
33
+ {
34
+ status: 'replay';
35
+ snapshot: DashboardInputExecutionSnapshot;
36
+ source: 'capture' | 'legacy_snapshot';
37
+ }
38
+ /** Replay nothing: the existing no-snapshot path (dashboard defaults, Lens values), as today. */
39
+ | {
40
+ status: 'no_replay';
41
+ }
42
+ /** The sheet has applicable inputs that were never captured. The sheet must not print. */
43
+ | {
44
+ status: 'missing';
45
+ missing: MissingPrintInputs;
46
+ };
47
+ /**
48
+ * Why a sheet cannot print. A plain object, not an Error instance, so it can
49
+ * live in the Immer store. Shaped for getDeliveryRenderErrorAttributes.
50
+ */
51
+ export type MissingPrintInputs = {
52
+ code: 'print_inputs_not_captured';
53
+ deliveryBlocking: true;
54
+ sheetId: string;
55
+ sheetTitle: string;
56
+ /** Distinct authored labels, at most three. */
57
+ inputLabels: readonly string[];
58
+ message: string;
59
+ };
60
+ /**
61
+ * Decides, for one sheet of a dashboard PDF render, whether and what to
62
+ * replay. Rules (first match wins; a present capture wins over a legacy
63
+ * snapshot):
64
+ * - R1: a capture with an entry for the sheet replays that entry.
65
+ * - R2: a capture without an entry for the sheet (a sheet added after saving),
66
+ * or one that does not parse, is decided by applicability.
67
+ * - R3: a legacy snapshot built for dashboard sheets is never replayed onto a
68
+ * Document; the Document is decided by applicability.
69
+ * - R4: any other legacy snapshot replays unchanged.
70
+ * - R5: nothing captured for a dashboard sheet replays nothing, as today.
71
+ * - R6: nothing captured for a Document is decided by applicability.
72
+ *
73
+ * "By applicability": if replaying empty values would clear any applicable
74
+ * input slot, the sheet's inputs were never captured and it must not print.
75
+ */
76
+ export declare function resolvePrintInputs({ dashboard, sheetId, legacySnapshot, capture, }: {
77
+ dashboard: TDashboard;
78
+ sheetId: string;
79
+ legacySnapshot?: DashboardInputExecutionSnapshot;
80
+ /** Untrusted: it crossed persistence and the print render record. */
81
+ capture?: unknown;
82
+ }): PrintInputResolution;
83
+ export declare function buildMissingPrintInputs({ sheetId, sheetTitle, inputLabels, }: {
84
+ sheetId: string;
85
+ sheetTitle: string;
86
+ inputLabels: readonly string[];
87
+ }): MissingPrintInputs;
88
+ /**
89
+ * Captures every sheet's inputs for a Full dashboard PDF. It has no gate of
90
+ * its own: each caller keeps the gate it used before (Briefings capture when
91
+ * the dashboard requires input resolution; immediate downloads also capture
92
+ * for drill state). Carried state follows the caller: a schedule passes no
93
+ * transient contexts or card view state, a download passes the viewer's.
94
+ */
95
+ export declare function capturePrintInputs({ dashboard, sheets, runtimeValues, transientContexts, timezone, generatedAt, }: {
96
+ dashboard: TDashboard;
97
+ sheets: readonly PrintSheetRef[];
98
+ runtimeValues: DashboardInputRuntimeValues;
99
+ transientContexts: readonly TransientInputContext[] | undefined;
100
+ timezone?: string;
101
+ generatedAt?: string;
102
+ }): PrintInputCapture;
103
+ /** Reads an untrusted value. Returns undefined for anything that is not a valid version-1 capture. */
104
+ export declare function parsePrintInputCapture(value: unknown): PrintInputCapture | undefined;
@@ -0,0 +1,16 @@
1
+ import { TDashboard } from '../types/common-types.js';
2
+ export type PrintSheetKind = 'dashboard' | 'document';
3
+ /** One sheet a Full dashboard PDF prints. */
4
+ export type PrintSheetRef = {
5
+ sheetId: string;
6
+ /** The sheet's kind, or 'dashboard' when the sheet has none. */
7
+ kind: PrintSheetKind;
8
+ /** The sheet's title, or `Sheet ${index + 1}` when it is empty. */
9
+ title: string;
10
+ };
11
+ /**
12
+ * Every sheet a Full dashboard PDF prints, in dashboard order. Pure.
13
+ * The scheduler's `listPrintSheetsFromTemplate` mirrors these rules; a shared
14
+ * fixture (`__fixtures__/print-sheets.json`) pins both to the same output.
15
+ */
16
+ export declare function listPrintSheets(dashboard: Pick<TDashboard, 'sheets'> | null | undefined): PrintSheetRef[];
@@ -1,6 +1,7 @@
1
1
  import { AuthToken, TBaseQuery, Breakpoint, ControlDefinition, CustomCard, StyleProps, TCard, TDashboard, TEvent, TFrame, TSheet, TStyle, AIScopeTable, TLens, CacheConfig, FilterLayoutSettings, DocumentDefinition, DashboardInput, DashboardInputSlot, DashboardInputValues, DashboardLifecycleEvent } from '../types/common-types.js';
2
2
  import { TFilter, TFilterValue } from '../../components/surfboard/filter/types.js';
3
3
  import { TransientInputContext } from '../dashboard-inputs/transient-input-context.js';
4
+ import { MissingPrintInputs } from '../print/print-inputs.js';
4
5
  import { default as ReactGridLayout } from 'react-grid-layout';
5
6
  import { DashboardAIContext } from '../types/assistant-types.js';
6
7
  import { FilterGroup, Field } from '../types/explorer-types.js';
@@ -104,6 +105,11 @@ export type DashboardStore = {
104
105
  dashboardCardPagination: Record<string, DashboardCardPaginationState>;
105
106
  /** Fixed execution clock from a strict dashboard input replay snapshot. */
106
107
  dashboardInputReferenceTime?: string;
108
+ /**
109
+ * Set when a PDF render's sheet has applicable inputs that were never
110
+ * captured. The sheet must not print; DashboardTabs renders the reason.
111
+ */
112
+ missingPrintInputs?: MissingPrintInputs;
107
113
  semanticExecutionPayload: SemanticExecutionPayload;
108
114
  reportContext: ReportRuntimeContext | null;
109
115
  /** Access-token session that owns the hydrated report context. */
@@ -216,6 +222,8 @@ type Actions = {
216
222
  transientContexts?: TransientInputContext[];
217
223
  reportContext?: ReportRuntimeContext;
218
224
  authToken?: AuthToken;
225
+ /** Present (even as undefined) on every PDF-aware hydration; replaces the previous value. */
226
+ missingPrintInputs?: MissingPrintInputs;
219
227
  }) => void;
220
228
  hydrateRuntimeControlValues: (dashboard: TDashboard, runtimeOverrides?: Record<string, unknown>) => void;
221
229
  mergeSemanticExecutionPayload: (semanticExecutionPayload: SemanticExecutionPayload) => void;
@@ -259,6 +259,12 @@ export type DashboardProps = {
259
259
  * inputs instead of documentInputValues.
260
260
  */
261
261
  dashboardInputExecutionSnapshot?: DashboardInputExecutionSnapshot;
262
+ /**
263
+ * Internal print prop: the per-sheet input capture of a Full dashboard PDF
264
+ * (`PrintInputCapture`). Untrusted; resolved per sheet by resolvePrintInputs
265
+ * on PDF renders only.
266
+ */
267
+ printInputCapture?: unknown;
262
268
  /** Server-resolved immutable presentation snapshot for internal print views. */
263
269
  presentationExecutionSnapshot?: PresentationExecutionSnapshot;
264
270
  /**
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.522",
8
+ "version": "0.1.523",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",