react-semaphor 0.1.583 → 0.1.585

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 (95) hide show
  1. package/dist/analytics-protocol/index.js +470 -428
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/brand-studio/index.js +7 -7
  4. package/dist/briefings/index.js +4 -4
  5. package/dist/chunks/aggregate-measure-field-DsFXETpI.js +22 -0
  6. package/dist/chunks/{assistant-chat-D3fm5qod.js → assistant-chat-BdbLmAnK.js} +12 -12
  7. package/dist/chunks/{bookmark-impact-Dpxl46Wd.js → bookmark-impact-BhT3k379.js} +2 -2
  8. package/dist/chunks/{bookmark-state-BEl_G9vr.js → bookmark-state-CL4WEpgB.js} +22 -22
  9. package/dist/chunks/{card-filter-builder-IxkFVxy2.js → card-filter-builder-CEcKF6Fw.js} +124 -124
  10. package/dist/chunks/comparison-window-caption-CoART8BC.js +1254 -0
  11. package/dist/chunks/{dashboard-BMqG98fc.js → dashboard-MPku_x1M.js} +1 -1
  12. package/dist/chunks/{dashboard-briefing-launcher-D45YfCkm.js → dashboard-briefing-launcher-CkFNlkr1.js} +13 -13
  13. package/dist/chunks/{dashboard-controls-DOvZRfof.js → dashboard-controls-Clt4ovXS.js} +84 -84
  14. package/dist/chunks/{dashboard-json-B_4TqF_o.js → dashboard-json-DSmXazIg.js} +4 -4
  15. package/dist/chunks/{dates-44_rcNj2.js → dates-CYZW9owO.js} +8 -8
  16. package/dist/chunks/{edit-dashboard-visual-BBPKJWSe.js → edit-dashboard-visual-Dn2ECRbX.js} +2752 -2687
  17. package/dist/chunks/filter-line-Cu2u1K36.js +131 -0
  18. package/dist/chunks/{filter-reach-copy-DWPq4Swi.js → filter-reach-copy-CmJpPa4G.js} +1745 -1326
  19. package/dist/chunks/{filter-value-text-DXGYypEd.js → filter-value-text-xefXzZlf.js} +6 -6
  20. package/dist/chunks/{index-DPRzcFp0.js → index-0WYn6RMz.js} +37 -37
  21. package/dist/chunks/{layout-grid-8rR-LPTk.js → layout-grid-9nSS2SL-.js} +1 -1
  22. package/dist/chunks/{list-filter-C1-uTgjR.js → list-filter-CfMPI6v4.js} +1 -1
  23. package/dist/chunks/{matrix-analytical-definition-D_HgptqZ.js → matrix-analytical-definition-QjBgUYhP.js} +382 -544
  24. package/dist/chunks/{matrix-member-presentation-DRa-9e6Q.js → matrix-member-presentation-BKDyxJho.js} +1 -1
  25. package/dist/chunks/{matrix-operation-contract-DCVinw1o.js → matrix-operation-contract-BM5TveR3.js} +153 -147
  26. package/dist/chunks/{metric-comparison-n9NsIa-2.js → metric-comparison-ZmurmEIs.js} +3 -3
  27. package/dist/chunks/{paintbrush-aR17Z3C9.js → paintbrush-LzAje2ff.js} +1 -1
  28. package/dist/chunks/{palette-a5FCZKFI.js → palette-DicJG0TC.js} +1 -1
  29. package/dist/chunks/{pivot-header-presentation-MvvlxtIB.js → pivot-header-presentation-CdeTU96P.js} +1 -1
  30. package/dist/chunks/{pivot-result-contract-expectations-8tuNjRvG.js → pivot-result-contract-expectations-Bx_BCu-7.js} +1029 -1010
  31. package/dist/chunks/{pivot-result-identity-B89X5xjb.js → pivot-result-identity-Bvs6Uq3v.js} +1 -1
  32. package/dist/chunks/raw-temporal-value-DH-feMc2.js +322 -0
  33. package/dist/chunks/{report-preferences-dialog-B8PhISua.js → report-preferences-dialog-BRaeufEi.js} +63 -62
  34. package/dist/chunks/{report-runtime-context-BhPzLTbS.js → report-runtime-context-NlOXwyRB.js} +1 -1
  35. package/dist/chunks/{resolve-dashboard-input-context-BfT8y5xL.js → resolve-dashboard-input-context-Cn9jumxl.js} +4924 -4823
  36. package/dist/chunks/{save-D985VvYp.js → save-0wu1Z1U7.js} +1 -1
  37. package/dist/chunks/{saved-dashboard-context-DH91-2B9.js → saved-dashboard-context-CfqkUMzR.js} +6 -6
  38. package/dist/chunks/selection-filter-compiler-BReJy-uv.js +92 -0
  39. package/dist/chunks/{semaphor-ready-indicator-Cg_Z2IDc.js → semaphor-ready-indicator-D6WjdTGl.js} +48377 -47074
  40. package/dist/chunks/{shelf-drop-preview-context-C7-BgcP4.js → shelf-drop-preview-context-Bbbrr9u4.js} +5 -5
  41. package/dist/chunks/{stored-dashboard-BpyCiE49.js → stored-dashboard-sPkTjxYf.js} +210 -221
  42. package/dist/chunks/{style-sheet-parts-C7qGZuH1.js → style-sheet-parts-_dGSFzDi.js} +2 -2
  43. package/dist/chunks/{table-export-sheet-wBkk17aa.js → table-export-sheet-Dmtqi5NV.js} +1 -1
  44. package/dist/chunks/{token-types-iKMplaBL.js → token-types-DEe_FP4l.js} +1 -1
  45. package/dist/chunks/{upload-CiGNKJ_0.js → upload-CtyOkU_B.js} +1 -1
  46. package/dist/chunks/{validators-B8fpdinG.js → validators-CJ8Jh0E8.js} +2 -2
  47. package/dist/chunks/{variable-draft-D8GFhAkm.js → variable-draft-D1RotIEG.js} +4 -4
  48. package/dist/dashboard/index.js +2 -2
  49. package/dist/dashboard-authoring/index.js +670 -647
  50. package/dist/format-utils/index.js +218 -215
  51. package/dist/index.js +234 -231
  52. package/dist/report-runtime-context/index.js +1 -1
  53. package/dist/style.css +1 -1
  54. package/dist/surfboard/index.js +2 -2
  55. package/dist/types/components/visual/data-table/types/data-table.d.ts +3 -0
  56. package/dist/types/components/visual/matrix-table/matrix-interaction-actions.d.ts +24 -3
  57. package/dist/types/index.js +5 -5
  58. package/dist/types/lib/hooks/interactions/use-drill-actions.d.ts +1 -1
  59. package/dist/types/lib/interactions/get-click-context-from-chartjs.d.ts +9 -0
  60. package/dist/types/lib/matrix-table/matrix-runtime.d.ts +8 -3
  61. package/dist/types/lib/query-context/compile-selection-filters.d.ts +1 -5
  62. package/dist/types/lib/see-records/click.d.ts +79 -0
  63. package/dist/types/lib/see-records/see-records-offer.d.ts +25 -0
  64. package/dist/types/lib/see-records/use-see-records-offer.d.ts +16 -0
  65. package/dist/types/lib/types/common-types.d.ts +6 -0
  66. package/dist/types/shared/analytics-protocol/aggregate-expression.d.ts +7 -0
  67. package/dist/types/shared/analytics-protocol/aggregate-measure-field.d.ts +13 -0
  68. package/dist/types/shared/analytics-protocol/index.d.ts +1 -0
  69. package/dist/types/shared/analytics-protocol/selection-filter-compiler.d.ts +3 -0
  70. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +6 -0
  71. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
  72. package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +1 -1
  73. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -0
  74. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +2 -0
  75. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +1 -0
  76. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
  77. package/dist/types/shared/dashboard-authoring/index.d.ts +2 -0
  78. package/dist/types/shared/dashboard-authoring/kpi-date-context.d.ts +191 -0
  79. package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +14 -0
  80. package/dist/types/shared/dashboard-authoring/see-records/availability.d.ts +30 -0
  81. package/dist/types/shared/dashboard-authoring/see-records/click.d.ts +37 -0
  82. package/dist/types/shared/dashboard-authoring/see-records/index.d.ts +12 -0
  83. package/dist/types/shared/dashboard-authoring/see-records/limits.d.ts +18 -0
  84. package/dist/types/shared/dashboard-authoring/see-records/measure-kind.d.ts +49 -0
  85. package/dist/types/shared/dashboard-authoring/see-records/request.d.ts +28 -0
  86. package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +94 -0
  87. package/dist/types/shared/format-utils/semantic-format.d.ts +0 -1
  88. package/dist/types/shared/format-utils/temporal-bucket.d.ts +20 -0
  89. package/dist/types/shared/temporal/calendar-periods.d.ts +15 -0
  90. package/dist/types/shared/temporal/raw-temporal-equality.d.ts +14 -0
  91. package/dist/types/shared/usage-events/envelope.d.ts +4 -4
  92. package/package.json +1 -1
  93. package/dist/chunks/comparison-window-caption-sRFtnX1q.js +0 -1371
  94. package/dist/chunks/raw-temporal-value-DdT0s47W.js +0 -159
  95. package/dist/chunks/selection-filter-compiler-CUDRnUxc.js +0 -80
@@ -1,5 +1,5 @@
1
- import { a, R as s, D as o } from "../chunks/report-preferences-dialog-B8PhISua.js";
2
- import { C as f, E as D } from "../chunks/bookmark-state-BEl_G9vr.js";
1
+ import { a, R as s, D as o } from "../chunks/report-preferences-dialog-BRaeufEi.js";
2
+ import { C as f, E as D } from "../chunks/bookmark-state-CL4WEpgB.js";
3
3
  export {
4
4
  f as CONTROL_CARD_DEFAULT_VALUE,
5
5
  a as DisplayFormatPreferencesFields,
@@ -1,3 +1,4 @@
1
+ import { SeeRecordsOfferFor } from '../../../../lib/see-records/use-see-records-offer.js';
1
2
  import { TCard } from '../../../../lib/types/common-types.js';
2
3
  import { CSSProperties } from 'react';
3
4
  import { Column, SortingState, ColumnSizingState } from '@tanstack/react-table';
@@ -192,6 +193,8 @@ export interface DataTableProps {
192
193
  x: number;
193
194
  y: number;
194
195
  }) => void;
196
+ /** See records for a clicked number (see-records TECH-SPEC 3); absent where no list opens. */
197
+ seeRecordsOffer?: SeeRecordsOfferFor;
195
198
  }
196
199
  export interface DataTableColumnSettingsProps {
197
200
  column: Column<any, unknown> | null;
@@ -1,4 +1,6 @@
1
1
  import { MatrixInteractionInput, MatrixInteraction } from '../../../lib/interactions/get-click-context-from-matrix.js';
2
+ import { MatrixPath, MatrixSpec } from '../../../shared/analytics-protocol/index.js';
3
+ import { SeeRecordsOffer } from '../../../lib/see-records/see-records-offer.js';
2
4
  export type MatrixSelectionSource = 'rowMembers' | 'columnMembers' | 'cells';
3
5
  export type MatrixInteractionHost = Pick<MatrixInteractionInput, 'resolveField' | 'capabilities'> & {
4
6
  canDispatch?: (mode: 'clickFilter' | 'drillToDetail', context: NonNullable<MatrixInteraction['context']>) => boolean;
@@ -20,14 +22,33 @@ export type MatrixInteractionHost = Pick<MatrixInteractionInput, 'resolveField'
20
22
  */
21
23
  isSelected?: (context: NonNullable<MatrixInteraction['context']>) => boolean;
22
24
  drill: (context: NonNullable<MatrixInteraction['context']>, measure: NonNullable<MatrixInteraction['measure']>) => void;
25
+ /**
26
+ * See records for one value, given the request the cells on screen
27
+ * answered (undefined while they are updating). Absent where no list opens.
28
+ */
29
+ seeRecords?: (value: {
30
+ spec: MatrixSpec;
31
+ interaction: MatrixInteraction;
32
+ rowPath: MatrixPath;
33
+ columnPath: MatrixPath;
34
+ measureId: string;
35
+ shownValue?: number;
36
+ }, source: Record<string, unknown> | undefined) => SeeRecordsOffer;
37
+ };
38
+ /** What the grid reads for See records as a menu opens: the cells' request and the value. */
39
+ export type MatrixSeeRecordsRead = {
40
+ readSource: () => Record<string, unknown> | undefined;
41
+ shownValue?: number;
23
42
  };
24
43
  /** The host adapts Matrix gestures to selection and drill callbacks; it owns no query or permission policy. */
25
- export declare function MatrixInteractionActions({ input, host, }: {
44
+ export declare function MatrixInteractionActions({ input, host, seeRecords, }: {
26
45
  input: Omit<MatrixInteractionInput, 'resolveField' | 'capabilities'>;
27
46
  host?: MatrixInteractionHost;
47
+ seeRecords?: MatrixSeeRecordsRead;
28
48
  }): import("react").JSX.Element | null;
29
- /** Cell-level drill access after the redundant floating selection toolbar was removed. */
30
- export declare function MatrixCellDrillAction({ input, host, }: {
49
+ /** A cell's right-click: its one records item (SR-D23). */
50
+ export declare function MatrixCellDrillAction({ input, host, seeRecords, }: {
31
51
  input: Omit<MatrixInteractionInput, 'resolveField' | 'capabilities'>;
32
52
  host?: MatrixInteractionHost;
53
+ seeRecords?: MatrixSeeRecordsRead;
33
54
  }): import("react").JSX.Element | null;
@@ -1,8 +1,8 @@
1
- import { B as t, y as r, C as l, E as o, V as i, j as n, c as d, g as m, f as u, b as c, e as E, d as C, a as T, x as p, w as D, l as A, h as I, o as _, v as F, u as S, m as b, n as L, p as f, k as N, q as y, s as R, i as h, r as g, t as x } from "../chunks/bookmark-state-BEl_G9vr.js";
2
- import { C as O, D as V, L as w, d as U, g as k, e as z, h as B, f as K, c as v, a as Y, i as q, b as G, n as P, s as Q } from "../chunks/validators-B8fpdinG.js";
3
- import { D as j } from "../chunks/token-types-iKMplaBL.js";
4
- import { r as X, a as H } from "../chunks/pivot-result-identity-B89X5xjb.js";
5
- import { D as $ } from "../chunks/report-runtime-context-BhPzLTbS.js";
1
+ import { B as t, y as r, C as l, E as o, V as i, j as n, c as d, g as m, f as u, b as c, e as E, d as C, a as T, x as p, w as D, l as A, h as I, o as _, v as F, u as S, m as b, n as L, p as f, k as N, q as y, s as R, i as h, r as g, t as x } from "../chunks/bookmark-state-CL4WEpgB.js";
2
+ import { C as O, D as V, L as w, d as U, g as k, h as z, e as B, f as K, c as v, a as Y, i as q, b as G, n as P, s as Q } from "../chunks/validators-CJ8Jh0E8.js";
3
+ import { D as j } from "../chunks/token-types-DEe_FP4l.js";
4
+ import { r as X, a as H } from "../chunks/pivot-result-identity-Bvs6Uq3v.js";
5
+ import { D as $ } from "../chunks/report-runtime-context-NlOXwyRB.js";
6
6
  const e = [
7
7
  "concatenate",
8
8
  "conditional-category",
@@ -81,6 +81,6 @@ export declare function useDrillActions(card: TCard, frameId: string, sheetId: s
81
81
  x: number;
82
82
  y: number;
83
83
  };
84
- }) => void;
84
+ }) => boolean;
85
85
  applySelectedInteraction: (interaction: Interaction, context: ClickContextResult) => void;
86
86
  };
@@ -1,3 +1,4 @@
1
+ import { SeeRecordsOffer } from '../see-records/see-records-offer.js';
1
2
  import { TCard } from '../types/index.js';
2
3
  import { QueryColumnKeyMap, CardConfig, Field } from '../types/explorer-types.js';
3
4
  import { ClickedMetricValue, ClickFilterCondition } from '../types/interaction-types.js';
@@ -9,6 +10,14 @@ export interface ClickContextResult {
9
10
  metrics?: ClickedMetricValue[];
10
11
  /** The dimension column under the pointer, when the visual has cells. */
11
12
  clickedField?: Field;
13
+ /**
14
+ * The result column the clicked mark draws (a chart series' key in the
15
+ * records). See records names the clicked measure from it through the
16
+ * result's own identity, never the browser's config (ledger IN-13).
17
+ */
18
+ resultColumnKey?: string;
19
+ /** What the click site offers for See records; a menu opened from this context shows it. */
20
+ seeRecords?: SeeRecordsOffer;
12
21
  }
13
22
  export declare function getClickContextFromChartJs({ resolvedCardConfig, card, records, chart, clickEvent, columnKeyMap, resultColumns, valueFormatPreferences, }: {
14
23
  resolvedCardConfig: CardConfig;
@@ -1,4 +1,4 @@
1
- import { SemaphorFilterReachEntry, MatrixAxis, MatrixCoordinate, MatrixPath, MatrixSort, MatrixViewState } from '../../shared/analytics-protocol/index.js';
1
+ import { SemaphorFilterReachEntry, MatrixAxis, MatrixCoordinate, MatrixPath, MatrixSort, MatrixViewState, OperationTemporalState } from '../../shared/analytics-protocol/index.js';
2
2
  import { QueryClient } from '@tanstack/react-query';
3
3
  import { MatrixCellAddress, MatrixCellState, MatrixDatasetRetention, MatrixRuntimeInput, MatrixRuntimeSnapshot, MatrixViewport, MatrixVisibleCoverage, MatrixWindowExecutor } from './matrix-runtime-types.js';
4
4
  /** Owns acquisition, errors, generation fencing and retention for exactly one card. */
@@ -69,14 +69,19 @@ export declare class MatrixRuntimeController {
69
69
  private acceptChoices;
70
70
  retry: (retryKey: string) => void;
71
71
  readCell: (coordinate: MatrixCellAddress) => MatrixCellState;
72
+ /** Which filters the latest window's source applied, and why not, as the server reported it. */
73
+ readFilterReach: () => SemaphorFilterReachEntry[];
74
+ /**
75
+ * The state the cells on screen ran on: absent until the acquisition's first
76
+ * response reports one, and again once a reload starts (see-records SR-D38).
77
+ */
78
+ readTemporalState: () => OperationTemporalState | undefined;
72
79
  /**
73
80
  * Whether every visible axis item and cell of the current generation is
74
81
  * loaded. A pure read over the slice `plan()` loads; it never schedules work.
75
82
  * Value, null and empty cells are complete; unloaded and loading cells, axis
76
83
  * pages still loading, and queued or active work are not.
77
84
  */
78
- /** Which filters the latest window's source applied, and why not, as the server reported it. */
79
- readFilterReach: () => SemaphorFilterReachEntry[];
80
85
  readVisibleCoverage: () => MatrixVisibleCoverage;
81
86
  /** Used by explicit refresh/retry integrations; latest-issued response wins. */
82
87
  refetchCell: (coordinate: MatrixCoordinate) => void;
@@ -1,5 +1 @@
1
- import { FilterCondition } from '../types/explorer-types.js';
2
- import { ClickFilterCondition } from '../types/interaction-types.js';
3
- export { compileSelectionFilterGroup, selectionFilterGroupKey, type SelectionFilterSource, } from '../../shared/analytics-protocol/selection-filter-compiler.js';
4
- /** A dashboard click condition as an explorer filter condition. */
5
- export declare function toFilterCondition(condition: ClickFilterCondition, id: string): FilterCondition;
1
+ export { compileSelectionFilterGroup, selectionFilterGroupKey, toFilterCondition, type SelectionFilterSource, } from '../../shared/analytics-protocol/selection-filter-compiler.js';
@@ -0,0 +1,79 @@
1
+ import { Row } from '@tanstack/react-table';
2
+ import { SemaphorResultColumn } from '../../shared/analytics-protocol/contracts.js';
3
+ import { SeeRecordsClick } from '../../shared/dashboard-authoring/see-records/index.js';
4
+ import { MatrixPath, MatrixSpec } from '../../shared/analytics-protocol/index.js';
5
+ import { MatrixInteraction } from '../interactions/get-click-context-from-matrix.js';
6
+ import { KpiNumberIdentity } from '../../shared/dashboard-authoring/kpi-figure.js';
7
+ import { TableColumnTotal } from '../../shared/dashboard-authoring/measure-calculations/table-column-total.js';
8
+ import { QueryColumnKeyMap } from '../../shared/format-utils/pivot-result-identity.js';
9
+ import { RawTemporalPresentation } from '../formatters/raw-temporal-presentation.js';
10
+ import { TCard } from '../types/common-types.js';
11
+ import { CardConfig } from '../types/explorer-types.js';
12
+ import { ComparisonMetadataMap } from '../types/query-types.js';
13
+ import { ClickContextResult } from '../interactions/get-click-context-from-chartjs.js';
14
+ import { RegularTableTemporalPresentation } from '../formatters/regular-table-temporal-presentation.js';
15
+ /** What a renderer knows about its result, for naming the clicked measure. */
16
+ export type SeeRecordsResultIdentity = {
17
+ columnKeyMap?: QueryColumnKeyMap;
18
+ resultColumns?: readonly SemaphorResultColumn[];
19
+ comparisonMetadata?: ComparisonMetadataMap;
20
+ };
21
+ export type SeeRecordsClickInput = ({
22
+ kind: 'tableCell';
23
+ card: TCard;
24
+ resolvedCardConfig: CardConfig;
25
+ row: Row<unknown>;
26
+ /** The clicked cell's column: its result key. */
27
+ columnId: string;
28
+ temporalPresentation?: RegularTableTemporalPresentation;
29
+ rawTemporalPresentation?: RawTemporalPresentation;
30
+ shownValue?: number;
31
+ } & SeeRecordsResultIdentity) | ({
32
+ kind: 'tableTotals';
33
+ card: TCard;
34
+ resolvedCardConfig: CardConfig;
35
+ columnId: string;
36
+ total?: TableColumnTotal;
37
+ shownValue?: number;
38
+ } & SeeRecordsResultIdentity)
39
+ /** One of a KPI's numbers, by its own result row (`readKpiNumber`): never its comparison (SR-D28). */
40
+ | {
41
+ kind: 'kpi';
42
+ card: TCard;
43
+ number: KpiNumberIdentity;
44
+ }
45
+ /**
46
+ * A Matrix value: the conditions the Matrix's own interaction stated for its
47
+ * row and column paths (`prepareMatrixInteraction`), and the measure it holds.
48
+ */
49
+ | {
50
+ kind: 'matrixValue';
51
+ card: TCard;
52
+ spec: MatrixSpec;
53
+ interaction: MatrixInteraction;
54
+ rowPath: MatrixPath;
55
+ columnPath: MatrixPath;
56
+ measureId: string;
57
+ shownValue?: number;
58
+ } | ({
59
+ kind: 'chartMark';
60
+ card: TCard;
61
+ /** The config the chart drew: its groupings are what a mark sits under. */
62
+ resolvedCardConfig: CardConfig;
63
+ /** The chart's own click context, as `getClickContextFromChartJs` built it. */
64
+ context: ClickContextResult;
65
+ shownValue?: number;
66
+ } & SeeRecordsResultIdentity);
67
+ export type SeeRecordsClickCapture = {
68
+ ok: true;
69
+ click: SeeRecordsClick;
70
+ } | {
71
+ ok: false;
72
+ message: string;
73
+ };
74
+ /**
75
+ * The measure a result column holds, by the result's own identity: a pivoted
76
+ * column's `pivotIdentity`, else the column key map's metric entry for the key.
77
+ */
78
+ export declare function resultMeasureId(columnKey: string, identity: SeeRecordsResultIdentity): string | undefined;
79
+ export declare function seeRecordsClickFrom(input: SeeRecordsClickInput): SeeRecordsClickCapture;
@@ -0,0 +1,25 @@
1
+ import { TCard } from '../types/common-types.js';
2
+ import { SeeRecordsClickInput } from './click.js';
3
+ export type SeeRecordsOffer = {
4
+ status: 'hidden';
5
+ } | {
6
+ status: 'disabled';
7
+ message: string;
8
+ } | {
9
+ status: 'enabled';
10
+ open: () => void;
11
+ };
12
+ export declare const SEE_RECORDS_LABEL = "See records";
13
+ export declare const SEE_RECORDS_HIDDEN: SeeRecordsOffer;
14
+ export declare function resolveSeeRecordsOffer(input: {
15
+ click: SeeRecordsClickInput;
16
+ card: TCard;
17
+ dashboardId: string;
18
+ frameId: string;
19
+ /** The frame query's own flag: the rows on screen answer the current request (SR-D38). */
20
+ isCurrentQueryResult: boolean;
21
+ /** The request those rows answered. */
22
+ queryRequestPayload: Record<string, unknown> | undefined;
23
+ }): SeeRecordsOffer;
24
+ /** A click that does nothing today runs See records when it is offered (SR-D10). Returns whether it opened. */
25
+ export declare function runSeeRecordsOffer(offer: SeeRecordsOffer | undefined): boolean;
@@ -0,0 +1,16 @@
1
+ import { TCard } from '../types/common-types.js';
2
+ import { SeeRecordsClickInput } from './click.js';
3
+ import { SeeRecordsOffer } from './see-records-offer.js';
4
+ /** The rows on screen and the request they answered, when a site reads them as its menu opens. */
5
+ export type SeeRecordsFrameState = {
6
+ isCurrentQueryResult: boolean;
7
+ queryRequestPayload: Record<string, unknown> | undefined;
8
+ };
9
+ /** A site that reads its frame state per click (a Matrix's runtime) passes it; others use the hook's. */
10
+ export type SeeRecordsOfferFor = (input: SeeRecordsClickInput, frame?: SeeRecordsFrameState) => SeeRecordsOffer;
11
+ export declare function useSeeRecordsOffer(input: {
12
+ card: TCard;
13
+ frameId: string | undefined;
14
+ isCurrentQueryResult: boolean;
15
+ queryRequestPayload: Record<string, unknown> | undefined;
16
+ }): SeeRecordsOfferFor | undefined;
@@ -1377,6 +1377,12 @@ export type TCard = {
1377
1377
  clickToFilter?: ClickToFilterSettings;
1378
1378
  /** Receiver side. false = this card ignores selections from every source card. Default true. */
1379
1379
  respondsToSelections?: boolean;
1380
+ /**
1381
+ * false hides See records on this card: no list icon, menu item or plain
1382
+ * click opens its numbers' records. Absent means on. Presentation only, not
1383
+ * access (see-records SR-D4, SR-D16).
1384
+ */
1385
+ seeRecords?: false;
1380
1386
  /**
1381
1387
  * Set only on a data variable's projected card, never stored: the variable
1382
1388
  * it runs (data variables DV-D9, P3b-03). The browser's comparison rule
@@ -61,6 +61,13 @@ export type ScannedAggregateExpression = {
61
61
  * FILTER and OVER suffixes, and the input tokens outside them.
62
62
  */
63
63
  export declare function scanAggregateExpression(expression: string, resolvedInputTokens?: ReadonlySet<string>): ScannedAggregateExpression;
64
+ /**
65
+ * The row value one aggregate call reads: its single argument, without a
66
+ * DISTINCT. The one cut the compiler's measure-filter rewrite and See
67
+ * records' row expression share. Undefined when the call has no single row
68
+ * argument: several arguments, a FILTER (it narrows the rows) or an OVER.
69
+ */
70
+ export declare function aggregateCallOperand(expression: string, call: ScannedAggregateCall): string | undefined;
64
71
  /** A unit of an expression skeleton: an aggregate call or an input token. */
65
72
  export type SkeletonUnit = {
66
73
  kind: 'call';
@@ -0,0 +1,13 @@
1
+ import { AggregateFunction, Field, MetricField } from '../../lib/types/explorer-types.js';
2
+ export type AggregateMeasureFieldLike = Partial<Pick<Field, 'entityName' | 'entityId'>> & {
3
+ aggregate?: AggregateFunction | string;
4
+ isPreAggregated?: boolean;
5
+ expression?: string;
6
+ calculatedFormula?: MetricField['calculatedFormula'];
7
+ };
8
+ /** The field aggregates itself: an aggregate, pre-aggregation, an aggregate expression, or aggregate inputs. */
9
+ export declare function hasAggregateMeasureSemantics(field: AggregateMeasureFieldLike | null | undefined): boolean;
10
+ /** A metric-role field that aggregates: one with aggregate semantics, or a calculated field. */
11
+ export declare function isAggregateMetricRoleField(field: (AggregateMeasureFieldLike & {
12
+ role?: string;
13
+ }) | null | undefined): boolean;
@@ -20,6 +20,7 @@ export * from './dashboard-date-comparison-definition.js';
20
20
  export * from './dashboard-input-contract.js';
21
21
  export * from './selection-contract.js';
22
22
  export * from './selection-filter-compiler.js';
23
+ export * from './aggregate-measure-field.js';
23
24
  export * from './temporal-context.js';
24
25
  export * from './temporal-bucket-contract.js';
25
26
  export * from './raw-temporal-contract.js';
@@ -1,4 +1,7 @@
1
1
  import { FilterCondition, FilterGroup } from '../../lib/types/explorer-types.js';
2
+ import { ClickFilterCondition } from '../../lib/types/interaction-types.js';
3
+ /** A dashboard click condition as an explorer filter condition. */
4
+ export declare function toFilterCondition(condition: ClickFilterCondition, id: string): FilterCondition;
2
5
  /** One source selection already projected into executable filter conditions. */
3
6
  export type SelectionFilterSource = {
4
7
  sourceCardId: string;
@@ -95,4 +95,10 @@ export declare function writeComparisonPresentation(preferences: TCardPreference
95
95
  * (RC-D16), as the panel's "Inherit Global Date comparison" switch writes it:
96
96
  * `false` stored, `true` the key removed.
97
97
  */
98
+ /**
99
+ * Whether viewers can open the records behind a card's numbers (see-records
100
+ * SR-D4): `false` stored, `true` the key removed. The Interactions sheet and
101
+ * the MCP both write through this.
102
+ */
103
+ export declare function writeSeeRecords<T extends Pick<TCard, 'seeRecords'>>(card: T, on: boolean): T;
98
104
  export declare function writeInheritComparison(preferences: TCardPreferences | undefined, inherit: boolean): TCardPreferences;
@@ -1,6 +1,6 @@
1
1
  import { TCard } from '../../../lib/types/common-types.js';
2
2
  import { CardType } from '../changes/card-types.js';
3
- export type SettingName = 'columns.label' | 'columns.format' | 'columns.hidden' | 'columns.width' | 'orientation' | 'stack' | 'donut' | 'totals' | 'dataLabels' | 'legend' | 'axes' | 'highlights' | 'columns.polarity' | 'comparisonDisplay' | 'inheritComparison' | 'band';
3
+ export type SettingName = 'columns.label' | 'columns.format' | 'columns.hidden' | 'columns.width' | 'orientation' | 'stack' | 'donut' | 'totals' | 'dataLabels' | 'legend' | 'axes' | 'highlights' | 'columns.polarity' | 'comparisonDisplay' | 'inheritComparison' | 'band' | 'seeRecords';
4
4
  export declare const SETTINGS_BY_KIND: Readonly<Record<CardType, readonly SettingName[]>>;
5
5
  export type CardSettingsKind = {
6
6
  type: CardType;
@@ -10,7 +10,7 @@ export { carryColumnSettings } from './carry-column-settings.js';
10
10
  export { confirmClassFor, type ConfirmClass } from './confirm-class.js';
11
11
  export { writeColumnFormat, withFormatOverride } from './column-format-write.js';
12
12
  export { writeColumnPolarity } from './column-polarity-write.js';
13
- export { writeComparisonDisplay, writeComparisonPresentation, writeInheritComparison } from './card-display-write.js';
13
+ export { writeComparisonDisplay, writeComparisonPresentation, writeInheritComparison, writeSeeRecords } from './card-display-write.js';
14
14
  export type { ResolvedCardSettings, ResolvedColumnSettings, ResolvedComparisonDisplay } from './resolved.js';
15
15
  export { SETTINGS_BY_KIND, cardSettingsKind, type CardSettingsKind, type SettingName } from './card-kinds.js';
16
16
  export type { AxisInput, CardSettingsInput, ColumnSettingsInput, ComparisonDisplayInput, DashboardUpdateChange, FormatInput, FormatPatch, HighlightAddChange, HighlightColor, HighlightCondition, HighlightRemoveChange, HighlightStyleInput, LegendPosition, Polarity, } from './inputs.js';
@@ -76,6 +76,8 @@ export type CardSettingsInput = {
76
76
  inheritComparison?: boolean;
77
77
  /** A KPI's band (KPI tile layout KL-D29): `trend` needs a Trend By; `automatic` follows the summary and target. */
78
78
  band?: 'automatic' | 'trend' | 'none';
79
+ /** false: viewers can't open the records behind the card's numbers; true removes the stored opt-out (see-records SR-D4). */
80
+ seeRecords?: boolean;
79
81
  };
80
82
  /** The filter operators (CA-D11): formatting and filtering share one condition language. */
81
83
  export type HighlightCondition = {
@@ -53,4 +53,6 @@ export type ResolvedCardSettings = {
53
53
  inheritComparison?: boolean;
54
54
  /** A KPI's band (KL-D29); null returns it to Automatic. */
55
55
  band?: 'trend' | 'none' | null;
56
+ /** Whether viewers can open the records behind the card's numbers (see-records SR-D4). */
57
+ seeRecords?: boolean;
56
58
  };
@@ -119,6 +119,7 @@ export declare const CARD_KEY_CLASSES: {
119
119
  readonly linkedInteractionTargetOverrides: "presentation";
120
120
  readonly clickToFilter: "presentation";
121
121
  readonly respondsToSelections: "presentation";
122
+ readonly seeRecords: "presentation";
122
123
  readonly dataVariableId: "presentation";
123
124
  readonly linkedClickToFilterOverrides: "presentation";
124
125
  readonly paginationConfig: "presentation";
@@ -1446,9 +1446,9 @@ export declare const conditionalRuleSchema: z.ZodObject<{
1446
1446
  italic?: boolean | undefined;
1447
1447
  fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
1448
1448
  backgroundColor?: string | undefined;
1449
+ textColor?: string | undefined;
1449
1450
  textDecoration?: "none" | "underline" | "line-through" | undefined;
1450
1451
  icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
1451
- textColor?: string | undefined;
1452
1452
  }, {
1453
1453
  dataBar?: {
1454
1454
  color: string;
@@ -1457,9 +1457,9 @@ export declare const conditionalRuleSchema: z.ZodObject<{
1457
1457
  italic?: boolean | undefined;
1458
1458
  fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
1459
1459
  backgroundColor?: string | undefined;
1460
+ textColor?: string | undefined;
1460
1461
  textDecoration?: "none" | "underline" | "line-through" | undefined;
1461
1462
  icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
1462
- textColor?: string | undefined;
1463
1463
  }>>;
1464
1464
  }, "strict", z.ZodTypeAny, {
1465
1465
  id: string;
@@ -1726,9 +1726,9 @@ export declare const conditionalRuleSchema: z.ZodObject<{
1726
1726
  italic?: boolean | undefined;
1727
1727
  fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
1728
1728
  backgroundColor?: string | undefined;
1729
+ textColor?: string | undefined;
1729
1730
  textDecoration?: "none" | "underline" | "line-through" | undefined;
1730
1731
  icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
1731
- textColor?: string | undefined;
1732
1732
  } | undefined;
1733
1733
  enabled?: boolean | undefined;
1734
1734
  }, {
@@ -1996,9 +1996,9 @@ export declare const conditionalRuleSchema: z.ZodObject<{
1996
1996
  italic?: boolean | undefined;
1997
1997
  fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
1998
1998
  backgroundColor?: string | undefined;
1999
+ textColor?: string | undefined;
1999
2000
  textDecoration?: "none" | "underline" | "line-through" | undefined;
2000
2001
  icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
2001
- textColor?: string | undefined;
2002
2002
  } | undefined;
2003
2003
  enabled?: boolean | undefined;
2004
2004
  }>;
@@ -3380,9 +3380,9 @@ export declare const cardConditionalFormattingSchema: z.ZodObject<{
3380
3380
  italic?: boolean | undefined;
3381
3381
  fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
3382
3382
  backgroundColor?: string | undefined;
3383
+ textColor?: string | undefined;
3383
3384
  textDecoration?: "none" | "underline" | "line-through" | undefined;
3384
3385
  icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
3385
- textColor?: string | undefined;
3386
3386
  }, {
3387
3387
  dataBar?: {
3388
3388
  color: string;
@@ -3391,9 +3391,9 @@ export declare const cardConditionalFormattingSchema: z.ZodObject<{
3391
3391
  italic?: boolean | undefined;
3392
3392
  fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
3393
3393
  backgroundColor?: string | undefined;
3394
+ textColor?: string | undefined;
3394
3395
  textDecoration?: "none" | "underline" | "line-through" | undefined;
3395
3396
  icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
3396
- textColor?: string | undefined;
3397
3397
  }>>;
3398
3398
  }, "strict", z.ZodTypeAny, {
3399
3399
  id: string;
@@ -3660,9 +3660,9 @@ export declare const cardConditionalFormattingSchema: z.ZodObject<{
3660
3660
  italic?: boolean | undefined;
3661
3661
  fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
3662
3662
  backgroundColor?: string | undefined;
3663
+ textColor?: string | undefined;
3663
3664
  textDecoration?: "none" | "underline" | "line-through" | undefined;
3664
3665
  icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
3665
- textColor?: string | undefined;
3666
3666
  } | undefined;
3667
3667
  enabled?: boolean | undefined;
3668
3668
  }, {
@@ -3930,9 +3930,9 @@ export declare const cardConditionalFormattingSchema: z.ZodObject<{
3930
3930
  italic?: boolean | undefined;
3931
3931
  fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
3932
3932
  backgroundColor?: string | undefined;
3933
+ textColor?: string | undefined;
3933
3934
  textDecoration?: "none" | "underline" | "line-through" | undefined;
3934
3935
  icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
3935
- textColor?: string | undefined;
3936
3936
  } | undefined;
3937
3937
  enabled?: boolean | undefined;
3938
3938
  }>, "many">;
@@ -4203,9 +4203,9 @@ export declare const cardConditionalFormattingSchema: z.ZodObject<{
4203
4203
  italic?: boolean | undefined;
4204
4204
  fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
4205
4205
  backgroundColor?: string | undefined;
4206
+ textColor?: string | undefined;
4206
4207
  textDecoration?: "none" | "underline" | "line-through" | undefined;
4207
4208
  icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
4208
- textColor?: string | undefined;
4209
4209
  } | undefined;
4210
4210
  enabled?: boolean | undefined;
4211
4211
  }[];
@@ -4476,9 +4476,9 @@ export declare const cardConditionalFormattingSchema: z.ZodObject<{
4476
4476
  italic?: boolean | undefined;
4477
4477
  fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
4478
4478
  backgroundColor?: string | undefined;
4479
+ textColor?: string | undefined;
4479
4480
  textDecoration?: "none" | "underline" | "line-through" | undefined;
4480
4481
  icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
4481
- textColor?: string | undefined;
4482
4482
  } | undefined;
4483
4483
  enabled?: boolean | undefined;
4484
4484
  }[];
@@ -56,6 +56,8 @@ export * from './card-formats/sql-date-pattern.js';
56
56
  export * from './retired-presentation-fields.js';
57
57
  export * from './conditional-formatting/index.js';
58
58
  export * from './kpi-figure.js';
59
+ export * from './kpi-date-context.js';
60
+ export * from './see-records/index.js';
59
61
  export * from './card-settings/index.js';
60
62
  export * from './measure-calculations/index.js';
61
63
  export { bookmarkImpactSentence, describeBookmarkImpact, type BookmarkImpactItem, } from '../dashboard-viewer/bookmark-impact.js';