react-semaphor 0.1.544 → 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 (179) hide show
  1. package/dist/analytics-protocol/index.js +405 -441
  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 +5 -5
  5. package/dist/briefings/index.js +55 -52
  6. package/dist/chunks/{class-utils-Df1OVOT1.js → _commonjsHelpers-DimLPMtv.js} +124 -98
  7. package/dist/chunks/{add-to-dashboard-BuAqfA2Y.js → add-to-dashboard-BQRAAnc3.js} +55 -33
  8. package/dist/chunks/{analytics-base-schemas-BFAoRlkU.js → analytics-base-schemas-BKs3flFS.js} +2 -2
  9. package/dist/chunks/{assistant-chat-BNLkCDml.js → assistant-chat-BPXhulAx.js} +2792 -2562
  10. package/dist/chunks/{bookmark-state-CXw7lZ50.js → bookmark-state-C4vetoa0.js} +7 -8
  11. package/dist/chunks/column-catalog-BYnochWQ.js +3363 -0
  12. package/dist/chunks/comparison-window-caption-C2xF-eWw.js +1433 -0
  13. package/dist/chunks/{context-ClREvqCZ.js → context-BerEBuFR.js} +11 -6
  14. package/dist/chunks/custom-visual-inputs-CkJW9pBS.js +295 -0
  15. package/dist/chunks/{dashboard-g5a4DKWq.js → dashboard-C3CoKbGY.js} +1 -1
  16. package/dist/chunks/dashboard-briefing-launcher-Be4h-7My.js +3734 -0
  17. package/dist/chunks/dashboard-controls-bxPrlSyp.js +2307 -0
  18. package/dist/chunks/{dashboard-json-7qT9jmfL.js → dashboard-json-BrjxIiRt.js} +6 -6
  19. package/dist/chunks/document-dashboard-inputs-CRVHpIHp.js +3010 -0
  20. package/dist/chunks/{edit-dashboard-visual-BfJwnRIZ.js → edit-dashboard-visual-DYYYDjY6.js} +5986 -6063
  21. package/dist/chunks/{filter-value-text-CYsVYPuD.js → filter-value-text-Ddf55Ku1.js} +8 -8
  22. package/dist/chunks/global-date-filter-utils-9d6m9-FE.js +11859 -0
  23. package/dist/chunks/index-CtoK1Lgu.js +586 -0
  24. package/dist/chunks/{index-DkAyQvC6.js → index-DkQkMKa1.js} +385 -339
  25. package/dist/chunks/list-filter-DsaTbM3J.js +15 -0
  26. package/dist/chunks/matrix-analytical-definition-B9vW-osb.js +717 -0
  27. package/dist/chunks/{matrix-card-DjwWcCo8.js → matrix-card-LiMEipvq.js} +3 -3
  28. package/dist/chunks/{matrix-formatter-CxJLkztA.js → matrix-formatter-DWEeC0_c.js} +55 -55
  29. package/dist/chunks/{matrix-member-presentation-CQGdVks6.js → matrix-member-presentation-DqzG-UhQ.js} +1 -1
  30. package/dist/chunks/{matrix-operation-contract-8OIO4gob.js → matrix-operation-contract-D6vYkZK4.js} +72 -72
  31. package/dist/chunks/{metric-comparison-DEwi9uc2.js → metric-comparison-zpGw4lD6.js} +2 -2
  32. package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +119 -0
  33. package/dist/chunks/{pivot-header-presentation-DHcx1XGQ.js → pivot-header-presentation-CQnIDtUv.js} +1 -1
  34. package/dist/chunks/{pivot-result-identity-DJhXXcns.js → pivot-result-identity-C-Q1j1Wb.js} +1 -1
  35. package/dist/chunks/{pivot-result-lifecycle-DM4CyGKs.js → pivot-result-lifecycle-pwq3b7LC.js} +571 -380
  36. package/dist/chunks/{raw-temporal-contract-C51YG48G.js → raw-temporal-contract-WuXA8jBP.js} +1 -1
  37. package/dist/chunks/{raw-temporal-presentation-CLiVi90c.js → raw-temporal-presentation-CBzrDOjM.js} +8 -8
  38. package/dist/chunks/rendered-file-D8xEuVVx.js +108 -0
  39. package/dist/chunks/{report-preferences-dialog-Df7VpRVW.js → report-preferences-dialog-4QEZWe5U.js} +637 -610
  40. package/dist/chunks/{report-runtime-context-Dq8XyODK.js → report-runtime-context-hWiTCzFV.js} +2 -2
  41. package/dist/chunks/resolve-dashboard-input-context-UpK_LBpL.js +5677 -0
  42. package/dist/chunks/{saved-dashboard-context-B-mQ--nV.js → saved-dashboard-context-D_I3Lxk0.js} +184 -212
  43. package/dist/chunks/selection-filter-compiler-BKXmyLrS.js +79 -0
  44. package/dist/chunks/{selection-reducer-Dj_8xD69.js → selection-reducer-CJzkTZio.js} +15 -15
  45. package/dist/chunks/{semaphor-ready-indicator-DDAxk8us.js → semaphor-ready-indicator-4zpRHE-X.js} +56832 -59068
  46. package/dist/chunks/{shelf-drop-preview-context-BSRPwaED.js → shelf-drop-preview-context-Cfw7TRAx.js} +890 -871
  47. package/dist/chunks/{source-entity-resolution-BYn9giz3.js → source-entity-resolution-BIGRvtbG.js} +13 -13
  48. package/dist/chunks/{switch-C3jLxlG0.js → switch-CEBOR4n7.js} +47 -48
  49. package/dist/chunks/{table-export-sheet-CPfGAQ9X.js → table-export-sheet-4X9mAG3V.js} +1 -1
  50. package/dist/chunks/table-settings-CunhoDUi.js +605 -0
  51. package/dist/chunks/{temporal-bucket-D7NBrrtL.js → temporal-bucket-CQOSbv9-.js} +26 -26
  52. package/dist/chunks/{token-types-DBbZVQsm.js → token-types-BMqRmT-C.js} +1 -1
  53. package/dist/chunks/{use-create-flow-overlay-state-BxzFviM-.js → use-create-flow-overlay-state-DZBZiiD-.js} +83 -83
  54. package/dist/chunks/{validators-DMHTpf7a.js → validators-C-aOQlTB.js} +713 -658
  55. package/dist/dashboard/index.js +2 -2
  56. package/dist/dashboard-authoring/index.js +1800 -1135
  57. package/dist/data-app-sdk/index.js +6 -6
  58. package/dist/data-app-sdk-adapters/index.js +3 -3
  59. package/dist/data-app-sdk-validation/index.js +14 -14
  60. package/dist/format-utils/index.js +198 -187
  61. package/dist/index.js +359 -325
  62. package/dist/layouts/index.js +5 -242
  63. package/dist/report-runtime-context/index.js +2 -2
  64. package/dist/shared/index.js +4 -5
  65. package/dist/style.css +1 -1
  66. package/dist/surfboard/index.js +2 -2
  67. package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
  68. package/dist/types/briefings/attachments.d.ts +33 -6
  69. package/dist/types/briefings/index.d.ts +6 -5
  70. package/dist/types/components/index.d.ts +2 -0
  71. package/dist/types/components/surfboard/arrange-layout-button.d.ts +8 -0
  72. package/dist/types/components/surfboard/filter/types.d.ts +0 -14
  73. package/dist/types/components/surfboard/screen-size-preview-button.d.ts +7 -0
  74. package/dist/types/index.js +6 -6
  75. package/dist/types/lib/charts/table-chart-types.d.ts +4 -0
  76. package/dist/types/lib/charts/types.d.ts +2 -2
  77. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +68 -82
  78. package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +0 -8
  79. package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +41 -1
  80. package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +201 -0
  81. package/dist/types/lib/dashboard-inputs/prepare-loaded-dashboard.d.ts +15 -0
  82. package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +7 -2
  83. package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +1 -1
  84. package/dist/types/lib/dashboard-viewer/captured-runtime-values.d.ts +40 -0
  85. package/dist/types/lib/dashboard-viewer/compatibility-input-storage.d.ts +16 -16
  86. package/dist/types/lib/dashboard-viewer/viewer-state.d.ts +11 -9
  87. package/dist/types/lib/download-pdf.d.ts +75 -1
  88. package/dist/types/lib/hooks/use-date-filter.d.ts +5 -0
  89. package/dist/types/lib/hooks/use-text-filter.d.ts +5 -0
  90. package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +5 -4
  91. package/dist/types/lib/matrix-table/matrix-editor.d.ts +52 -0
  92. package/dist/types/lib/query-context/assemble-card-query.d.ts +158 -0
  93. package/dist/types/lib/query-context/build-card-query-context.d.ts +3 -3
  94. package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +15 -6
  95. package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +11 -13
  96. package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +22 -12
  97. package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +69 -0
  98. package/dist/types/lib/stores/dashboard-store.d.ts +159 -56
  99. package/dist/types/lib/stores/editor-store.d.ts +0 -3
  100. package/dist/types/lib/types/common-types.d.ts +29 -6
  101. package/dist/types/lib/types/explorer-types.d.ts +10 -0
  102. package/dist/types/lib/types/semantic-types.d.ts +84 -0
  103. package/dist/types/lib/utils/build-saved-editor-card.d.ts +20 -0
  104. package/dist/types/lib/utils/card-type-change.d.ts +16 -0
  105. package/dist/types/lib/utils/field-availability-context.d.ts +25 -0
  106. package/dist/types/lib/utils/field-placement.d.ts +96 -0
  107. package/dist/types/lib/utils/field-state-calculator.d.ts +161 -0
  108. package/dist/types/lib/utils/qualified-entity-name.d.ts +2 -0
  109. package/dist/types/shared/analytics-protocol/field-provenance.d.ts +89 -0
  110. package/dist/types/shared/analytics-protocol/index.d.ts +2 -0
  111. package/dist/types/shared/analytics-protocol/query-policies.d.ts +52 -0
  112. package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +1 -1
  113. package/dist/types/shared/analytics-protocol/time-window.d.ts +40 -1
  114. package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +8 -12
  115. package/dist/types/shared/assistant-protocol/answer-text.d.ts +20 -0
  116. package/dist/types/shared/assistant-protocol/context.d.ts +21 -21
  117. package/dist/types/shared/assistant-protocol/index.d.ts +1 -0
  118. package/dist/types/shared/assistant-protocol/limits.d.ts +6 -1
  119. package/dist/types/shared/assistant-protocol/parts.d.ts +43 -3
  120. package/dist/types/shared/assistant-protocol/request.d.ts +14 -2
  121. package/dist/types/shared/dashboard-authoring/calculated-field-identity.d.ts +3 -0
  122. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +487 -0
  123. package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +34 -0
  124. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +7886 -0
  125. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +43 -0
  126. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +54 -0
  127. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +89 -0
  128. package/dist/types/shared/dashboard-authoring/column-catalog.d.ts +32 -0
  129. package/dist/types/shared/dashboard-authoring/contracts.d.ts +0 -55
  130. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +16 -6
  131. package/dist/types/shared/dashboard-authoring/dashboard-card-source-index.d.ts +9 -1
  132. package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +7 -0
  133. package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +118 -0
  134. package/dist/types/shared/dashboard-authoring/filter-applicability.d.ts +75 -0
  135. package/dist/types/shared/dashboard-authoring/filter-model/ad-hoc-filter-values.d.ts +10 -0
  136. package/dist/types/shared/dashboard-authoring/filter-model/filter-definitions.d.ts +29 -0
  137. package/dist/types/shared/dashboard-authoring/filter-model/filter-values.d.ts +58 -0
  138. package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +7 -0
  139. package/dist/types/shared/dashboard-authoring/filter-model/prototype-document-inputs.d.ts +15 -0
  140. package/dist/types/shared/dashboard-authoring/filter-model/read-dashboard-filter-model.d.ts +78 -0
  141. package/dist/types/shared/dashboard-authoring/filter-model/stored-dashboard.d.ts +18 -0
  142. package/dist/types/shared/dashboard-authoring/filter-model/toolbar-filter-reach.d.ts +23 -0
  143. package/dist/types/shared/dashboard-authoring/index.d.ts +20 -2
  144. package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +10 -37
  145. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +189 -0
  146. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +94 -0
  147. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +78 -0
  148. package/dist/types/shared/dashboard-authoring/validators.d.ts +1 -2
  149. package/dist/types/shared/format-utils/exporters/index.d.ts +2 -0
  150. package/dist/types/shared/format-utils/exporters/rendered-file.d.ts +106 -0
  151. package/dist/types/shared/layouts/engine/grid.d.ts +25 -0
  152. package/dist/types/shared/layouts/engine/index.d.ts +4 -0
  153. package/dist/types/shared/layouts/engine/sheet-layout.d.ts +7 -0
  154. package/dist/types/shared/layouts/engine/types.d.ts +125 -0
  155. package/dist/types/shared/layouts/index.d.ts +1 -2
  156. package/package.json +2 -2
  157. package/dist/chunks/_commonjsHelpers-BkfeUUK-.js +0 -28
  158. package/dist/chunks/apply-dashboard-operations-Bz4n1Lq6.js +0 -2260
  159. package/dist/chunks/calendar-day-equality-BmJAWduY.js +0 -460
  160. package/dist/chunks/comparison-window-caption-BTkrN3W4.js +0 -1623
  161. package/dist/chunks/custom-visual-inputs-DUtpYZOk.js +0 -323
  162. package/dist/chunks/dashboard-briefing-launcher-DQ_8O_e2.js +0 -3725
  163. package/dist/chunks/dashboard-controls-8RyBTQUO.js +0 -2315
  164. package/dist/chunks/dashboard-filter-value-compatibility-CwQ_iSNb.js +0 -108
  165. package/dist/chunks/document-dashboard-inputs-BC6p-ESg.js +0 -8087
  166. package/dist/chunks/document-sheet-utils-Duo9uLoH.js +0 -3619
  167. package/dist/chunks/matrix-analytical-definition-C7Gb0e12.js +0 -117
  168. package/dist/chunks/normalize-dashboard-for-dirty-check-Bk3VYv_q.js +0 -67
  169. package/dist/chunks/numeric-presentation-DESvLiu9.js +0 -5227
  170. package/dist/chunks/sort-target-MT1WK1vX.js +0 -29
  171. package/dist/chunks/stable-serialize-CfqXeiBP.js +0 -6
  172. package/dist/chunks/table-settings-CLZocegs.js +0 -501
  173. package/dist/chunks/use-debounced-dirty-check-BwAbnX_5.js +0 -59
  174. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +0 -88
  175. package/dist/types/lib/dashboard-inputs/dashboard-input-scope.d.ts +0 -10
  176. package/dist/types/shared/dashboard-authoring/change-compiler.d.ts +0 -7
  177. package/dist/types/shared/dashboard-authoring/layout-compiler.d.ts +0 -2
  178. package/dist/types/shared/layouts/create-frame-layouts.d.ts +0 -27
  179. package/dist/types/shared/layouts/frame-layouts.d.ts +0 -23
@@ -0,0 +1,158 @@
1
+ import { TFilterValue } from '../../components/surfboard/filter/types.js';
2
+ import { CardViewStateMap } from '../dashboard-view-state/index.js';
3
+ import { DashboardInputValues, ResolvedDashboardInputContext, TCard, TDashboard } from '../types/common-types.js';
4
+ import { PaginationConfig } from '../types/explorer-types.js';
5
+ import { ResolvedPrimaryDateField, SemanticExecutionPayload } from '../types/semantic-runtime-types.js';
6
+ import { TransientInputContext } from '../dashboard-inputs/transient-input-context.js';
7
+ import { prepareMatrixCard, MatrixCardCatalog } from '../matrix-table/matrix-card-adapter.js';
8
+ import { ViewerTableSettings } from '../../shared/dashboard-viewer/index.js';
9
+ import { CalendarContext } from '../../shared/report-runtime-context/index.js';
10
+ import { CardQueryContext, CompiledCardQueryContext } from './build-card-query-context.js';
11
+ import { DashboardCardQueryContractResult } from './build-dashboard-card-query-contract.js';
12
+ import { CardQueryBlock, CompiledDashboardCardFilters } from './compile-dashboard-card-filters.js';
13
+ import { DocumentSectionCardRuntime } from './document-section-card-query.js';
14
+ import { CardRequestPayload } from './card-server-request.js';
15
+ /**
16
+ * The one assembly of a card's query (card query assembly plan, CQ-D1): live
17
+ * cards, Matrix cards, exports, PDFs, Briefings, query keys, summaries, drill
18
+ * captures and the assistant all ask this module, so the same state always
19
+ * means the same query. Nothing else builds a card's query context or
20
+ * compiles it (the `check:guards` guard, CQ-INV-2).
21
+ *
22
+ * A caller's differences are data in its source and its place (CQ-D2); the
23
+ * module decides what each means. It is pure: hooks read the store and pass
24
+ * what they read.
25
+ */
26
+ /**
27
+ * The state a card's query is built from: the dashboard store's current
28
+ * values, a capture's, or a print's.
29
+ */
30
+ export type CardQuerySource = {
31
+ dashboard: TDashboard;
32
+ /**
33
+ * Runtime-only values no filter defines (chart clicks, summary chips; one
34
+ * filter model SPEC 5.8). Authored filter values are `dashboardInputValues`.
35
+ */
36
+ adHocFilterValues: TFilterValue[] | undefined;
37
+ controlValues: Record<string, unknown> | undefined;
38
+ inlineFilterValuesMap: Record<string, TFilterValue[] | undefined> | undefined;
39
+ cardControlValuesMap: Record<string, Record<string, unknown>> | undefined;
40
+ dashboardInputValues: DashboardInputValues | undefined;
41
+ /**
42
+ * Carried contexts in effect on the dashboard. Required so that every
43
+ * caller decides; see `buildCardQueryContext`. A section never receives them.
44
+ */
45
+ transientContexts: readonly TransientInputContext[] | undefined;
46
+ /** Drill paths by card. Required so that every caller decides; a section card does not drill. */
47
+ cardViewStates: CardViewStateMap | undefined;
48
+ /**
49
+ * Viewer table settings by card (dashboard bookmarks). Required so that
50
+ * every caller decides; a section card is not a viewer-customizable table.
51
+ */
52
+ viewerTableSettings: Readonly<Record<string, ViewerTableSettings>> | undefined;
53
+ /**
54
+ * The viewer's report calendar (report preferences): input defaults
55
+ * resolve in it and cards compile in its zone (CQ-D8). Null only before
56
+ * the report context loads.
57
+ */
58
+ calendar: CalendarContext | null;
59
+ /**
60
+ * The editor's preview: its card filter values win for the cards it shows,
61
+ * and it previews the authored table (no viewer table settings).
62
+ */
63
+ editor?: {
64
+ inlineFilterValuesMap: Record<string, TFilterValue[] | undefined>;
65
+ };
66
+ };
67
+ /** Where a card runs: a sheet of the dashboard, or a Document section with its own runtime. */
68
+ export type CardQueryPlace = {
69
+ kind: 'sheet';
70
+ sheetId: string | null | undefined;
71
+ } | {
72
+ kind: 'documentSection';
73
+ section: DocumentSectionCardRuntime;
74
+ };
75
+ export type AssembledCardQuery = {
76
+ /** The card the query runs: a section's card carries its document's control definitions. */
77
+ card: TCard;
78
+ context: CardQueryContext;
79
+ /** The inputs resolved for the card, when the dashboard resolves inputs. */
80
+ inputContext: ResolvedDashboardInputContext | undefined;
81
+ };
82
+ /** How a dashboard's cards compile (CQ-D3); one per dashboard, payload and calendar. */
83
+ export type CardQueryCompileScope = {
84
+ calendarContext: CalendarContext;
85
+ /** Whether every card the dashboard date reaches has a timestamp field. */
86
+ allowGlobalDateMinutePrecision: boolean;
87
+ semanticExecutionPayload: SemanticExecutionPayload | undefined;
88
+ globalCacheConfig: TDashboard['globalCacheConfig'];
89
+ };
90
+ export type CompiledCardQuery = {
91
+ status: 'ready';
92
+ card: TCard;
93
+ queryContext: CompiledCardQueryContext;
94
+ compiledFilters: CompiledDashboardCardFilters;
95
+ resolvedPrimaryDateField: ResolvedPrimaryDateField;
96
+ } | ({
97
+ status: 'blocked';
98
+ card: TCard;
99
+ cardId: string;
100
+ resolvedPrimaryDateField: ResolvedPrimaryDateField;
101
+ } & CardQueryBlock);
102
+ /** The compiler's inputs for a card at its place, from a source. */
103
+ export declare function assembleCardQueryContext({ card, place, source, }: {
104
+ card: TCard;
105
+ place: CardQueryPlace;
106
+ source: CardQuerySource;
107
+ }): AssembledCardQuery;
108
+ export declare function resolveCardQueryCompileScope(dashboard: TDashboard, semanticExecutionPayload: SemanticExecutionPayload | undefined, calendar: CalendarContext | null): CardQueryCompileScope;
109
+ /** Compiles an assembled card in its dashboard's scope. */
110
+ export declare function compileCardQuery(assembled: Pick<AssembledCardQuery, 'card' | 'context'>, scope: CardQueryCompileScope): CompiledCardQuery;
111
+ /**
112
+ * The request contract of an assembled card: its compiled filters, query
113
+ * identity and request payload.
114
+ */
115
+ export declare function buildCardQueryContract(assembled: Pick<AssembledCardQuery, 'card' | 'context'>, scope: CardQueryCompileScope, options?: {
116
+ resolvePaginationConfig?: (queryInputIdentity: string) => PaginationConfig | undefined;
117
+ }): DashboardCardQueryContractResult & {
118
+ resolvedPrimaryDateField: ResolvedPrimaryDateField;
119
+ };
120
+ export type AssembledCardQueryResult = (Extract<CompiledCardQuery, {
121
+ status: 'ready';
122
+ }> & {
123
+ matrix?: ReturnType<typeof prepareMatrixCard>;
124
+ /**
125
+ * The request the card posts to /api/v1/query, from these same assembled
126
+ * inputs (`withRequest`; not for Matrix, which runs on its window path).
127
+ */
128
+ request?: CardRequestPayload;
129
+ }) | BlockedCardQuery;
130
+ /**
131
+ * A card query that cannot run, and why (SPEC 4.8): the compile's `mapping`
132
+ * and `requiredInput`, or the assembly's `metadata`, `configuration` and
133
+ * `coverage`. `message` is set for every reason except `mapping`, whose
134
+ * wording each surface owns.
135
+ */
136
+ export type BlockedCardQuery = {
137
+ status: 'blocked';
138
+ cardId: string;
139
+ mappingDispositions: CompiledDashboardCardFilters['mappingDispositions'];
140
+ reason: CardQueryBlock['reason'] | 'metadata' | 'configuration' | 'coverage';
141
+ missingRequiredLabels: string[];
142
+ message?: string;
143
+ };
144
+ /**
145
+ * A card's compiled query, as the Matrix runtime and every capture run it: a
146
+ * Matrix card is prepared from the catalog (its spec owns its filters, and
147
+ * the dashboard date's precision covers only the cards it reaches).
148
+ */
149
+ export declare function assembleCardQuery({ card: targetCard, place, source, semanticExecutionPayload, matrixCatalog, withRequest, }: {
150
+ card: TCard;
151
+ place: CardQueryPlace;
152
+ source: CardQuerySource;
153
+ semanticExecutionPayload: SemanticExecutionPayload | undefined;
154
+ /** Columns metadata for every Matrix target the dashboard date covers. */
155
+ matrixCatalog: MatrixCardCatalog | undefined;
156
+ /** Also build the card's request (the analytics agent replays it on the server, D3b-2). */
157
+ withRequest?: boolean;
158
+ }): AssembledCardQueryResult;
@@ -33,8 +33,8 @@ export type BuildCardQueryContextParams = {
33
33
  * sort while the viewer sees their own.
34
34
  */
35
35
  viewerTableSettings: ViewerTableSettings | undefined;
36
- filters: TFilter[] | undefined;
37
- filterValues: TFilterValue[] | undefined;
36
+ /** Runtime-only values no filter defines (SPEC 5.8); authored values are input slots. */
37
+ adHocFilterValues: TFilterValue[] | undefined;
38
38
  selectedSheetId: string | null | undefined;
39
39
  inlineFilterValuesMap: Record<string, TFilterValue[] | undefined> | undefined;
40
40
  dashboardControls?: ControlDefinition[] | undefined;
@@ -73,4 +73,4 @@ export type CompiledCardQueryContext = Omit<CardQueryContext, 'filterCompilation
73
73
  globalDateComparisonSelection?: GlobalDateComparisonSelection;
74
74
  dateComparisonInputs?: ResolvedDashboardDateComparisonInput[];
75
75
  };
76
- export declare function buildCardQueryContext({ card, dashboard, transientContexts, cardViewState, viewerTableSettings, filters, filterValues, selectedSheetId, inlineFilterValuesMap, dashboardControls, dashboardControlValues, cardControlValuesMap, dashboardInputContext, includeAuthoredFilters, }: BuildCardQueryContextParams): CardQueryContext;
76
+ export declare function buildCardQueryContext({ card, dashboard, transientContexts, cardViewState, viewerTableSettings, adHocFilterValues, selectedSheetId, inlineFilterValuesMap, dashboardControls, dashboardControlValues, cardControlValuesMap, dashboardInputContext, includeAuthoredFilters, }: BuildCardQueryContextParams): CardQueryContext;
@@ -5,7 +5,7 @@ import { TableConfig } from '../types/query-types.js';
5
5
  import { CardQueryContext, CompiledCardQueryContext } from './build-card-query-context.js';
6
6
  import { CalendarContext } from '../../shared/report-runtime-context/index.js';
7
7
  import { DashboardCardQueryRequestPayloadBase } from '../../shared/dashboard-authoring/card-query-request.js';
8
- import { CompiledDashboardCardFilters, CompileDashboardCardFiltersParams } from './compile-dashboard-card-filters.js';
8
+ import { CardQueryBlock, CompiledDashboardCardFilters, CompileDashboardCardFiltersParams } from './compile-dashboard-card-filters.js';
9
9
  export type { DashboardCardQueryRequestPayloadBase } from '../../shared/dashboard-authoring/card-query-request.js';
10
10
  export type DashboardCardQueryContract = {
11
11
  status: 'ready';
@@ -16,12 +16,11 @@ export type DashboardCardQueryContract = {
16
16
  tableConfig: TableConfig;
17
17
  compiledFilters: CompiledDashboardCardFilters;
18
18
  };
19
- export type DashboardCardQueryContractResult = DashboardCardQueryContract | {
19
+ export type DashboardCardQueryContractResult = DashboardCardQueryContract | ({
20
20
  status: 'blocked';
21
21
  cardId: string;
22
- mappingDispositions: CompiledDashboardCardFilters['mappingDispositions'];
23
22
  tableConfig: TableConfig;
24
- };
23
+ } & CardQueryBlock);
25
24
  /** Test/invariant helper for fixtures that cannot contain mapped inputs. */
26
25
  export declare function requireReadyDashboardCardQueryContract(result: DashboardCardQueryContractResult): DashboardCardQueryContract;
27
26
  export type DashboardCardQueryExecutionOptions = {
@@ -36,11 +35,21 @@ export type DashboardCardQueryExecutionOptions = {
36
35
  resolvePaginationConfig?: (queryInputIdentity: string) => PaginationConfig | undefined;
37
36
  };
38
37
  /** One final compilation for interactive requests and immutable input captures. */
39
- export declare function compileDashboardCardQueryContext(card: TCard, context: CardQueryContext, execution: Omit<CompileDashboardCardFiltersParams, 'card' | 'cardConfig' | 'input'>): {
38
+ export declare function compileDashboardCardQueryContext(card: TCard, context: CardQueryContext, execution: Omit<CompileDashboardCardFiltersParams, 'card' | 'cardConfig' | 'input'>): ({
39
+ status: "blocked";
40
+ cardId: string;
41
+ } & {
42
+ reason: "mapping";
43
+ mappingDispositions: import('./dashboard-filter-mapping-resolution.js').DashboardFilterMappingDisposition[];
44
+ missingRequiredLabels: [];
45
+ }) | ({
40
46
  status: "blocked";
41
47
  cardId: string;
48
+ } & {
49
+ reason: "requiredInput";
42
50
  mappingDispositions: import('./dashboard-filter-mapping-resolution.js').DashboardFilterMappingDisposition[];
43
- } | {
51
+ missingRequiredLabels: string[];
52
+ }) | {
44
53
  status: "ready";
45
54
  queryContext: CompiledCardQueryContext;
46
55
  compiledFilters: CompiledDashboardCardFilters & {
@@ -6,18 +6,22 @@ import { TransientInputContext } from '../dashboard-inputs/transient-input-conte
6
6
  import { SemanticExecutionPayload } from '../types/semantic-runtime-types.js';
7
7
  import { ViewerTableSettings } from '../../shared/dashboard-viewer/index.js';
8
8
  import { CompiledCardQueryContext } from './build-card-query-context.js';
9
- import { CompiledDashboardCardFilters } from './compile-dashboard-card-filters.js';
10
9
  import { CardRequestPayload } from './card-server-request.js';
11
10
  import { DocumentSectionCardRuntime } from './document-section-card-query.js';
12
11
  import { MatrixCardCatalog, prepareMatrixCard } from '../matrix-table/matrix-card-adapter.js';
12
+ import { BlockedCardQuery } from './assemble-card-query.js';
13
13
  export type DashboardExecutionSnapshot = {
14
14
  selectedSheetId: string | null;
15
15
  filterValues: TFilterValue[];
16
16
  controlValues: Record<string, unknown>;
17
17
  };
18
18
  type BuildDashboardExecutionSnapshotParams = {
19
- dashboard: Pick<TDashboard, 'filters' | 'sheets'> | undefined;
20
- filterValues: TFilterValue[] | undefined;
19
+ dashboard: TDashboard | undefined;
20
+ /** Authored filter values: input slots (one filter model Phase 4a). */
21
+ dashboardInputValues: DashboardInputValues | undefined;
22
+ adHocFilterValues: TFilterValue[] | undefined;
23
+ /** The report calendar defaults resolve in. */
24
+ calendar: CalendarContext | null;
21
25
  selectedSheetId: string | null | undefined;
22
26
  sheetSelection?: 'current' | 'all';
23
27
  dashboardControlValues?: Record<string, unknown>;
@@ -25,7 +29,7 @@ type BuildDashboardExecutionSnapshotParams = {
25
29
  semanticExecutionPayload?: SemanticExecutionPayload;
26
30
  timezone?: string;
27
31
  };
28
- export declare function buildDashboardExecutionSnapshot({ dashboard, filterValues, selectedSheetId, sheetSelection, dashboardControlValues, cardControlValuesMap, semanticExecutionPayload, timezone, }: BuildDashboardExecutionSnapshotParams): DashboardExecutionSnapshot;
32
+ export declare function buildDashboardExecutionSnapshot({ dashboard, dashboardInputValues, adHocFilterValues, calendar, selectedSheetId, sheetSelection, dashboardControlValues, cardControlValuesMap, semanticExecutionPayload, timezone, }: BuildDashboardExecutionSnapshotParams): DashboardExecutionSnapshot;
29
33
  export type BuildDashboardCardExecutionSnapshotParams = {
30
34
  dashboard: TDashboard | undefined;
31
35
  cardId: string;
@@ -41,7 +45,7 @@ export type BuildDashboardCardExecutionSnapshotParams = {
41
45
  * sort. Required so that every caller decides; see `buildCardQueryContext`.
42
46
  */
43
47
  viewerTableSettings: Readonly<Record<string, ViewerTableSettings>> | undefined;
44
- filterValues: TFilterValue[] | undefined;
48
+ adHocFilterValues: TFilterValue[] | undefined;
45
49
  inlineFilterValuesMap: Record<string, TFilterValue[] | undefined> | undefined;
46
50
  dashboardControlValues?: Record<string, unknown> | undefined;
47
51
  cardControlValuesMap?: Record<string, Record<string, unknown> | undefined> | undefined;
@@ -80,14 +84,8 @@ export type DashboardCardExecutionSnapshot = {
80
84
  /** The request the card posts to /api/v1/query (`withRequest`; never for Matrix). */
81
85
  request?: CardRequestPayload;
82
86
  };
83
- export type DashboardCardExecutionSnapshotResult = DashboardCardExecutionSnapshot | {
84
- status: 'blocked';
85
- cardId: string;
86
- mappingDispositions: CompiledDashboardCardFilters['mappingDispositions'];
87
- reason?: 'metadata' | 'configuration' | 'coverage';
88
- message?: string;
89
- } | null;
87
+ export type DashboardCardExecutionSnapshotResult = DashboardCardExecutionSnapshot | BlockedCardQuery | null;
90
88
  export declare function requireReadyDashboardCardExecutionSnapshot(result: DashboardCardExecutionSnapshotResult): DashboardCardExecutionSnapshot | null;
91
89
  /** One card's compiled query from captured or current values, through the card query assembly. */
92
- export declare function buildDashboardCardExecutionSnapshot({ dashboard, cardId, transientContexts, cardViewStates, viewerTableSettings, semanticExecutionPayload, filterValues, inlineFilterValuesMap, dashboardControlValues, cardControlValuesMap, dashboardInputValues, calendar, matrixCatalog, cardOverride, sheetId, documentSection, editor, withRequest, }: BuildDashboardCardExecutionSnapshotParams): DashboardCardExecutionSnapshotResult;
90
+ export declare function buildDashboardCardExecutionSnapshot({ dashboard, cardId, transientContexts, cardViewStates, viewerTableSettings, semanticExecutionPayload, adHocFilterValues, inlineFilterValuesMap, dashboardControlValues, cardControlValuesMap, dashboardInputValues, calendar, matrixCatalog, cardOverride, sheetId, documentSection, editor, withRequest, }: BuildDashboardCardExecutionSnapshotParams): DashboardCardExecutionSnapshotResult;
93
91
  export {};
@@ -12,8 +12,11 @@ import { ResolvedCardDateFields } from './resolve-card-primary-date-field.js';
12
12
  * they must not merge or retarget values before handing them to the compiler.
13
13
  */
14
14
  export type DashboardCardFilterCompilationInput = {
15
- filterDefinitions: TFilter[];
16
- filterValues: TFilterValue[];
15
+ /**
16
+ * Runtime-only values no filter defines (chart clicks, summary chips;
17
+ * one filter model SPEC 5.8). Authored values live in input slots.
18
+ */
19
+ adHocFilterValues: TFilterValue[];
17
20
  selectedSheetId: string | null | undefined;
18
21
  inlineFilterValues: TFilterValue[];
19
22
  shouldApplyDashboardFilters: boolean;
@@ -44,24 +47,31 @@ export type CompiledDashboardCardFilters = {
44
47
  globalDateComparison: GlobalDateComparisonContext | undefined;
45
48
  mappingDispositions: DashboardFilterMappingDisposition[];
46
49
  };
50
+ /**
51
+ * Why a card's query cannot run (one filter model SPEC 4.8). `requiredInput`
52
+ * is reported over `mapping` when both apply: the viewer can resolve it.
53
+ */
54
+ export type CardQueryBlock = {
55
+ reason: 'mapping';
56
+ mappingDispositions: DashboardFilterMappingDisposition[];
57
+ missingRequiredLabels: [];
58
+ } | {
59
+ reason: 'requiredInput';
60
+ mappingDispositions: DashboardFilterMappingDisposition[];
61
+ missingRequiredLabels: string[];
62
+ };
47
63
  export type DashboardCardFilterCompilationResult = (CompiledDashboardCardFilters & {
48
64
  status: 'ready';
49
- }) | {
65
+ }) | ({
50
66
  status: 'blocked';
51
67
  cardId: string;
52
- mappingDispositions: DashboardFilterMappingDisposition[];
53
- };
68
+ } & CardQueryBlock);
69
+ /** What a card shows, and exports and captures refuse with, for a `requiredInput` block. */
70
+ export declare function describeMissingRequiredInputs(labels: readonly string[]): string;
54
71
  /** Test/invariant helper for call sites that construct a provably unmapped input. */
55
72
  export declare function requireReadyDashboardCardFilters(result: DashboardCardFilterCompilationResult): CompiledDashboardCardFilters & {
56
73
  status: 'ready';
57
74
  };
58
- /**
59
- * Whether a filter input still applies when a carried context turns the
60
- * dashboard's own filters off (`resolveContextAwareFilterPolicy`): only inputs
61
- * authored for specific cards and the cards' inline filters do. The one rule
62
- * for the compiler and for any reader that says which filters a view applies.
63
- */
64
- export declare function filterInputSurvivesCarriedContext(input: Pick<NormalizedDashboardInput, 'kind' | 'scope' | 'compatibility'>): boolean;
65
75
  export declare function composeCardFilterValues(card: TCard, input: DashboardCardFilterCompilationInput): {
66
76
  status: 'ready';
67
77
  filterValues: TFilterValue[];
@@ -73,6 +73,75 @@ export declare function validateDashboardFilterTargetForCard(params: {
73
73
  sourceIndex: ReturnType<typeof buildDashboardCardSourceIndex>;
74
74
  target: DashboardFilterTarget;
75
75
  }): DashboardFilterTargetValidation;
76
+ /**
77
+ * Where a filter input lands on a card: the one decision execution
78
+ * (`resolveDashboardFilterMappings`) and every description of reach (the
79
+ * dashboard outline, the change resolver's reach warnings and filter-effect
80
+ * check) make, in one order: the card's mapping entry (excluded, or a bound
81
+ * target the card must still address), then SQL Auto, then the automatic and
82
+ * inherited targets. A selected value only supplies the automatic target's
83
+ * data type when the input states none.
84
+ */
85
+ export type DashboardFilterCardTarget = {
86
+ status: 'excluded';
87
+ } | {
88
+ status: 'bound';
89
+ bindingId: string;
90
+ target: DashboardFilterTarget;
91
+ validation: Extract<DashboardFilterTargetValidation, {
92
+ status: 'valid';
93
+ }>;
94
+ }
95
+ /**
96
+ * A bound target the card can't run, no longer addresses, or whose type the
97
+ * filter's values can't take: the card blocks until it is mapped again.
98
+ */
99
+ | {
100
+ status: 'unsupportedTarget' | 'stale' | 'incompatible';
101
+ bindingId: string;
102
+ } | {
103
+ status: 'sql';
104
+ } | {
105
+ status: 'automatic';
106
+ target: DashboardFilterTarget;
107
+ }
108
+ /**
109
+ * The card's data takes the filter's field (the one applicability rule) but
110
+ * not through a source its query uses, such as a dataset it selects or
111
+ * joins: the value applies as it is, as it does for a filter with no card
112
+ * mappings.
113
+ */
114
+ | {
115
+ status: 'passthrough';
116
+ } | {
117
+ status: 'ambiguous';
118
+ } | {
119
+ status: 'notApplicable';
120
+ };
121
+ /** The filter's mapping marks the card "Don't apply" (the first step of `decideDashboardFilterCardTarget`). */
122
+ export declare function isDashboardFilterCardExcluded(input: NormalizedFilterDashboardInput, cardId: string): boolean;
123
+ export declare function decideDashboardFilterCardTarget(input: NormalizedFilterDashboardInput, card: TCard, sourceIndex?: ReturnType<typeof buildDashboardCardSourceIndex>, selectedValue?: TFilterValue): DashboardFilterCardTarget;
124
+ /** How a filter applies to a card, whatever value it holds. */
125
+ export type DashboardFilterCardReach =
126
+ /** The mapping marks the card "Don't apply". */
127
+ 'excluded'
128
+ /** The mapping binds the filter to a field of the card. */
129
+ | 'bound'
130
+ /** The card executes the filter's own field (or a proven binding's), so it applies with no mapping. */
131
+ | 'automatic'
132
+ /** A SQL card takes the filter's value as is. */
133
+ | 'sql'
134
+ /** More than one field of the card could take it: the card blocks until it is mapped. */
135
+ | 'ambiguous'
136
+ /** The mapping binds a target the card can't run or no longer has: the card blocks until it is mapped again. */
137
+ | 'blocked' | 'notApplicable';
138
+ /**
139
+ * Whether a filter in scope reaches a card, read without a value, from the
140
+ * decision execution makes (`decideDashboardFilterCardTarget`). The dashboard
141
+ * outline and the change resolver read it, so they report what the card runs
142
+ * (MCP dashboard editing SPEC 3.6, 5.4).
143
+ */
144
+ export declare function describeDashboardFilterCardReach(input: NormalizedFilterDashboardInput, card: TCard): DashboardFilterCardReach;
76
145
  export declare function resolveDashboardFilterMappings({ card, inputs, resolvedInputs, activeFilterValues, shouldApplyDashboardFilters, }: {
77
146
  card: TCard;
78
147
  inputs: NormalizedFilterDashboardInput[];