react-semaphor 0.1.506 → 0.1.508

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 (247) hide show
  1. package/DATA_APP_SDK.md +56 -0
  2. package/dist/analytics-protocol/index.cjs +1 -1
  3. package/dist/analytics-protocol/index.js +194 -172
  4. package/dist/appearance/index.cjs +1 -1
  5. package/dist/appearance/index.js +1 -1
  6. package/dist/appearance-runtime/index.cjs +1 -1
  7. package/dist/appearance-runtime/index.js +1 -1
  8. package/dist/brand-studio/index.cjs +2 -2
  9. package/dist/brand-studio/index.js +139 -119
  10. package/dist/briefings/index.cjs +1 -1
  11. package/dist/briefings/index.js +3 -3
  12. package/dist/chunks/appearance-context-DzqCdhB4.cjs +1 -0
  13. package/dist/chunks/{appearance-context-XviHOhWJ.js → appearance-context-VJdrKi7r.js} +2 -1
  14. package/dist/chunks/{appearance-runtime-provider-D0xVQWnH.js → appearance-runtime-provider-CC4HT2Gi.js} +2 -2
  15. package/dist/chunks/{appearance-runtime-provider-Ca8rxO86.cjs → appearance-runtime-provider-D5pkvgE4.cjs} +1 -1
  16. package/dist/chunks/calculated-field-identity-BiTGmnST.cjs +1 -0
  17. package/dist/chunks/calculated-field-identity-CJL54uFx.js +1373 -0
  18. package/dist/chunks/{constants-NUleP4DY.js → card-config-utils-Bq1enstT.js} +260 -260
  19. package/dist/chunks/card-config-utils-CMO4_zVs.cjs +1 -0
  20. package/dist/chunks/{dashboard-briefing-launcher-DXTpU85p.js → dashboard-briefing-launcher-B9l0ZAbv.js} +12 -12
  21. package/dist/chunks/{dashboard-briefing-launcher-C8nDSDnV.cjs → dashboard-briefing-launcher-C4zsM3Hd.cjs} +1 -1
  22. package/dist/chunks/{dashboard-controls-CyL0yimg.js → dashboard-controls-BCQv4xWM.js} +16 -14
  23. package/dist/chunks/dashboard-controls-CWwllVOe.cjs +52 -0
  24. package/dist/chunks/{dashboard-json-5Jr3RudV.js → dashboard-json-BtU_q_0A.js} +9 -9
  25. package/dist/chunks/dashboard-json-DVj2xLsH.cjs +1 -0
  26. package/dist/chunks/edit-dashboard-visual-CO2IVBOq.cjs +172 -0
  27. package/dist/chunks/{edit-dashboard-visual-C7X-um9g.js → edit-dashboard-visual-RgFUx-py.js} +1986 -1990
  28. package/dist/chunks/{editor-action-buttons-CcDm8nA5.cjs → editor-action-buttons-BE8Fby6n.cjs} +2 -2
  29. package/dist/chunks/{editor-action-buttons-C5Wja_J4.js → editor-action-buttons-D-MaqTIs.js} +6 -6
  30. package/dist/chunks/field-aggregations-DUb0NU6c.js +1229 -0
  31. package/dist/chunks/field-aggregations-jSi77h9Z.cjs +1 -0
  32. package/dist/chunks/{field-dependencies-DVl2p1Nm.js → field-dependencies-Cl97kkHy.js} +30 -34
  33. package/dist/chunks/{field-dependencies-r_U0CGQ-.cjs → field-dependencies-DIab72rQ.cjs} +1 -1
  34. package/dist/chunks/{index-BVr4fcCB.js → index-0pdaQ9e1.js} +5 -5
  35. package/dist/chunks/index-BaIrLSBb.cjs +1422 -0
  36. package/dist/chunks/{index-De2QNsqV.js → index-ByiS9sB4.js} +45343 -43665
  37. package/dist/chunks/{index-C9KXfCkC.js → index-CLIro-EG.js} +3 -0
  38. package/dist/chunks/index-Cx3qmRUB.cjs +1 -0
  39. package/dist/chunks/{index-BlYf8gNa.cjs → index-DhlVxvyI.cjs} +1 -1
  40. package/dist/chunks/{matrix-card-DACDwdTq.js → matrix-card-CnKQpnsj.js} +1 -1
  41. package/dist/chunks/{matrix-card-CRXcmAjp.cjs → matrix-card-U4c72doZ.cjs} +1 -1
  42. package/dist/chunks/{matrix-control-sources-ClQzIk7E.js → matrix-control-sources-CRRdP03Q.js} +165 -134
  43. package/dist/chunks/matrix-control-sources-FjxGIbqk.cjs +1 -0
  44. package/dist/chunks/{matrix-formatter-7GLTcBuy.cjs → matrix-formatter-CveLJo6S.cjs} +1 -1
  45. package/dist/chunks/{matrix-formatter-xsq7n_e6.js → matrix-formatter-ZVS5QOuq.js} +2 -2
  46. package/dist/chunks/matrix-member-presentation-CFHjdrxT.cjs +1 -0
  47. package/dist/chunks/matrix-member-presentation-CzGZJd3a.js +182 -0
  48. package/dist/chunks/matrix-operation-contract-DoiWTUbT.cjs +1 -0
  49. package/dist/chunks/matrix-operation-contract-xL8IhFzp.js +1802 -0
  50. package/dist/chunks/{pivot-header-presentation-3wqWChFd.cjs → pivot-header-presentation-Cxz8-06f.cjs} +1 -1
  51. package/dist/chunks/{pivot-header-presentation-D44ODZGn.js → pivot-header-presentation-DVylCBHB.js} +2 -2
  52. package/dist/chunks/{pivot-result-lifecycle-DZ0ZSMoM.cjs → pivot-result-lifecycle-BiERyXnS.cjs} +1 -1
  53. package/dist/chunks/{pivot-result-lifecycle-BSmqVkVG.js → pivot-result-lifecycle-CmjpW7qG.js} +1 -1
  54. package/dist/chunks/{report-preferences-dialog-xADifRXs.js → report-preferences-dialog-BbkXcnnn.js} +4 -4
  55. package/dist/chunks/report-preferences-dialog-C9rpWgQZ.cjs +1 -0
  56. package/dist/chunks/{search-BHsQIWBV.js → selection-reducer-B94WgZ9V.js} +55 -11
  57. package/dist/chunks/selection-reducer-CGKKsaPa.cjs +26 -0
  58. package/dist/chunks/{semantic-format-BhIL1PXP.cjs → semantic-format-BzH69TRq.cjs} +1 -1
  59. package/dist/chunks/{semantic-format-C3amkGmY.js → semantic-format-CBlRO8Aw.js} +1 -1
  60. package/dist/chunks/{switch-DHGiC0aU.js → switch-CD4uGTZI.js} +7450 -7694
  61. package/dist/chunks/switch-iC1x2dcE.cjs +134 -0
  62. package/dist/chunks/token-types-Ahh5u4iT.cjs +1 -0
  63. package/dist/chunks/token-types-CPde8_LG.js +8 -0
  64. package/dist/chunks/{update-policy-Cc9h57pA.cjs → update-policy-COjFudhl.cjs} +1 -1
  65. package/dist/chunks/{update-policy-eTcz52jO.js → update-policy-D9q1Tz8k.js} +1 -1
  66. package/dist/dashboard/index.cjs +1 -1
  67. package/dist/dashboard/index.js +1 -1
  68. package/dist/dashboard-authoring/index.cjs +3 -3
  69. package/dist/dashboard-authoring/index.js +734 -622
  70. package/dist/data-app-builder/index.cjs +1 -1
  71. package/dist/data-app-builder/index.js +3 -3
  72. package/dist/data-app-codegen/index.cjs +1 -1
  73. package/dist/data-app-codegen/index.js +2 -2
  74. package/dist/data-app-codegen-node/index.cjs +94 -92
  75. package/dist/data-app-codegen-node/index.js +337 -333
  76. package/dist/data-app-sdk/index.cjs +9 -9
  77. package/dist/data-app-sdk/index.js +1091 -969
  78. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  79. package/dist/data-app-sdk-adapters/index.js +104 -96
  80. package/dist/data-app-sdk-validation/index.cjs +1 -1
  81. package/dist/data-app-sdk-validation/index.js +2 -2
  82. package/dist/format-utils/index.cjs +1 -1
  83. package/dist/format-utils/index.js +8 -8
  84. package/dist/index.cjs +1 -1
  85. package/dist/index.js +15 -15
  86. package/dist/style.css +1 -1
  87. package/dist/surfboard/index.cjs +1 -1
  88. package/dist/surfboard/index.js +2 -2
  89. package/dist/types/brand-studio/brand-studio-draft.d.ts +3 -1
  90. package/dist/types/components/dashboard/card-selection-pill.d.ts +5 -0
  91. package/dist/types/components/dashboard/dashboard-container.d.ts +1 -1
  92. package/dist/types/components/dashboard/drill-breadcrumb.d.ts +1 -0
  93. package/dist/types/components/dashboard/drill-navigation-controls.d.ts +3 -3
  94. package/dist/types/components/interactions/applied-filters-display.d.ts +6 -1
  95. package/dist/types/components/interactions/click-to-filter-review-dialog.d.ts +21 -0
  96. package/dist/types/components/interactions/dashboard-drill-host.d.ts +13 -0
  97. package/dist/types/components/interactions/filter-badge-tooltip.d.ts +4 -4
  98. package/dist/types/components/interactions/insight-modal.d.ts +4 -14
  99. package/dist/types/components/interactions/insight-viewer.d.ts +7 -19
  100. package/dist/types/components/interactions/interactions-sheet.d.ts +6 -0
  101. package/dist/types/components/interactions/panels/click-to-filter-panel.d.ts +20 -0
  102. package/dist/types/components/interactions/reusable/interaction-selection-popover.d.ts +2 -2
  103. package/dist/types/components/interactions/sheet/action-editor.d.ts +17 -0
  104. package/dist/types/components/interactions/sheet/action-meta.d.ts +45 -0
  105. package/dist/types/components/interactions/sheet/action-picker.d.ts +7 -0
  106. package/dist/types/components/interactions/sheet/click-outcome-preview.d.ts +10 -0
  107. package/dist/types/components/interactions/sheet/interactions-home.d.ts +28 -0
  108. package/dist/types/components/interactions/sheet/sheet-parts.d.ts +37 -0
  109. package/dist/types/components/surfboard/filter/dashboard-filter-mapping-panel.d.ts +28 -1
  110. package/dist/types/components/surfboard/filter/selection-chip.d.ts +11 -0
  111. package/dist/types/components/surfboard/filter/selection-filter-section.d.ts +4 -0
  112. package/dist/types/components/surfboard/filter/use-dashboard-filter-mapping-popover.d.ts +3 -0
  113. package/dist/types/components/ui/resizable.d.ts +1 -1
  114. package/dist/types/components/visual/matrix-table/matrix-interaction-actions.d.ts +13 -1
  115. package/dist/types/components/visual/matrix-table/matrix-selection-click.d.ts +6 -0
  116. package/dist/types/data-app-sdk/adapters.d.ts +3 -2
  117. package/dist/types/data-app-sdk/builders.d.ts +2 -1
  118. package/dist/types/data-app-sdk/contracts.d.ts +44 -2
  119. package/dist/types/data-app-sdk/index.d.ts +1 -0
  120. package/dist/types/data-app-sdk/query-request.d.ts +7 -2
  121. package/dist/types/data-app-sdk/selection.d.ts +2 -0
  122. package/dist/types/index.cjs +1 -1
  123. package/dist/types/index.js +24 -23
  124. package/dist/types/lib/appearance/types.d.ts +3 -1
  125. package/dist/types/lib/briefings/briefing-attachment-model.d.ts +0 -2
  126. package/dist/types/lib/contexts/interactions-popover-context.d.ts +1 -8
  127. package/dist/types/lib/dashboard/click-to-filter-card-references.d.ts +23 -0
  128. package/dist/types/lib/dashboard-inputs/build-normalized-dashboard-inputs.d.ts +16 -2
  129. package/dist/types/lib/dashboard-inputs/build-selection-dashboard-inputs.d.ts +31 -0
  130. package/dist/types/lib/dashboard-inputs/click-to-filter-emitted-fields.d.ts +17 -0
  131. package/dist/types/lib/dashboard-inputs/click-to-filter-mapping-draft.d.ts +99 -0
  132. package/dist/types/lib/dashboard-inputs/click-to-filter-sheet-reach.d.ts +12 -0
  133. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +18 -1
  134. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-candidate-metadata.d.ts +4 -1
  135. package/dist/types/lib/dashboard-inputs/dashboard-input-scope.d.ts +10 -0
  136. package/dist/types/lib/dashboard-inputs/dashboard-input-snapshot.d.ts +8 -1
  137. package/dist/types/lib/dashboard-inputs/index.d.ts +1 -0
  138. package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +18 -7
  139. package/dist/types/lib/dashboard-inputs/resolve-field-date-comparison-coverage.d.ts +5 -2
  140. package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +77 -0
  141. package/dist/types/lib/dashboard-inputs/selection-targets.d.ts +26 -0
  142. package/dist/types/lib/dashboard-inputs/transient-input-context.d.ts +102 -0
  143. package/dist/types/lib/dashboard-navigation/build-carried-click-context.d.ts +50 -0
  144. package/dist/types/lib/dashboard-navigation/describe-carried-context.d.ts +11 -0
  145. package/dist/types/lib/dashboard-navigation/index.d.ts +1 -0
  146. package/dist/types/lib/dashboard-navigation/navigation-state.d.ts +120 -0
  147. package/dist/types/lib/dashboard-navigation/run-one-off-drill.d.ts +11 -0
  148. package/dist/types/lib/dashboard-navigation/use-transient-contexts.d.ts +17 -0
  149. package/dist/types/lib/dashboard-view-state/card-view-state.d.ts +48 -0
  150. package/dist/types/lib/dashboard-view-state/drill-path.d.ts +20 -0
  151. package/dist/types/lib/dashboard-view-state/index.d.ts +2 -0
  152. package/dist/types/lib/download-pdf.d.ts +0 -3
  153. package/dist/types/lib/formatters/metric-formatting.d.ts +1 -1
  154. package/dist/types/lib/hooks/ai/dashboard-context.d.ts +15 -8
  155. package/dist/types/lib/hooks/chartjs/use-chart-blur.d.ts +10 -2
  156. package/dist/types/lib/hooks/interactions/{use-event-engine.d.ts → use-drill-actions.d.ts} +28 -7
  157. package/dist/types/lib/hooks/selection/use-active-selections.d.ts +15 -0
  158. package/dist/types/lib/hooks/selection/use-click-to-filter-mapping-draft.d.ts +20 -0
  159. package/dist/types/lib/hooks/selection/use-selection-click.d.ts +34 -0
  160. package/dist/types/lib/hooks/selection/use-selection-gestures.d.ts +38 -0
  161. package/dist/types/lib/hooks/selection/use-table-row-selection.d.ts +46 -0
  162. package/dist/types/lib/hooks/use-dashboard-card.d.ts +0 -2
  163. package/dist/types/lib/hooks/use-dashboard-filter-mapping-candidates.d.ts +18 -0
  164. package/dist/types/lib/hooks/use-dashboard-frame-query.d.ts +0 -1
  165. package/dist/types/lib/hooks/use-dashboard.d.ts +1 -3
  166. package/dist/types/lib/hooks/use-interactions-popover.d.ts +1 -8
  167. package/dist/types/lib/hooks/use-resolved-card-config.d.ts +6 -0
  168. package/dist/types/lib/interactions/click-outcome.d.ts +25 -0
  169. package/dist/types/lib/interactions/get-click-context-from-chartjs.d.ts +3 -1
  170. package/dist/types/lib/interactions/get-click-context-from-matrix.d.ts +1 -1
  171. package/dist/types/lib/interactions/get-click-context-from-table.d.ts +7 -0
  172. package/dist/types/lib/interactions/interaction-utils.d.ts +17 -1
  173. package/dist/types/lib/matrix-table/build-matrix-drill-to-detail.d.ts +15 -0
  174. package/dist/types/lib/matrix-table/matrix-card-interactions.d.ts +14 -3
  175. package/dist/types/lib/query-context/build-card-query-context.d.ts +19 -8
  176. package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +5 -3
  177. package/dist/types/lib/query-context/build-dashboard-frame-base-query-contexts.d.ts +12 -4
  178. package/dist/types/lib/query-context/compile-selection-filters.d.ts +5 -0
  179. package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +46 -0
  180. package/dist/types/lib/query-context/filter-group-utils.d.ts +3 -0
  181. package/dist/types/lib/query-context/resolve-runtime-card-filters.d.ts +29 -0
  182. package/dist/types/lib/selection/click-to-filter-authoring-support.d.ts +9 -0
  183. package/dist/types/lib/selection/selection-from-click-context.d.ts +41 -0
  184. package/dist/types/lib/selection/selection-labels.d.ts +3 -0
  185. package/dist/types/lib/selection/selection-notices.d.ts +9 -0
  186. package/dist/types/lib/selection/selection-reducer.d.ts +46 -0
  187. package/dist/types/lib/stores/dashboard-store.d.ts +62 -17
  188. package/dist/types/lib/stores/editor-store.d.ts +1 -2
  189. package/dist/types/lib/stores/index.d.ts +0 -2
  190. package/dist/types/lib/types/common-types.d.ts +60 -6
  191. package/dist/types/lib/types/explorer-types.d.ts +1 -22
  192. package/dist/types/lib/types/interaction-types.d.ts +6 -198
  193. package/dist/types/lib/utils/calculate-context-aware-filters.d.ts +21 -12
  194. package/dist/types/lib/utils/card-utils.d.ts +11 -0
  195. package/dist/types/lib/utils/date-hierarchy-utils.d.ts +3 -1
  196. package/dist/types/lib/utils/drag-and-drop-utils.d.ts +1 -1
  197. package/dist/types/lib/utils/interaction-icons.d.ts +1 -1
  198. package/dist/types/shared/analytics-protocol/execution-input-schemas.d.ts +32 -32
  199. package/dist/types/shared/analytics-protocol/index.d.ts +2 -0
  200. package/dist/types/shared/analytics-protocol/selection-contract.d.ts +100 -0
  201. package/dist/types/shared/analytics-protocol/selection-filter-compiler.d.ts +12 -0
  202. package/dist/types/shared/dashboard-authoring/apply-group-by-override.d.ts +19 -0
  203. package/dist/types/shared/dashboard-authoring/click-to-filter-settings.d.ts +88 -0
  204. package/dist/types/shared/dashboard-authoring/contracts.d.ts +8 -0
  205. package/dist/types/shared/dashboard-authoring/index.d.ts +3 -0
  206. package/dist/types/shared/dashboard-authoring/linked-click-to-filter-overrides.d.ts +32 -0
  207. package/dist/types/shared/format-utils/matrix-continuation.d.ts +3 -3
  208. package/package.json +1 -1
  209. package/src/data-app-sdk/README.md +58 -1
  210. package/dist/chunks/appearance-context-tNjvTJj3.cjs +0 -1
  211. package/dist/chunks/calculated-field-identity-BTpUqfEu.js +0 -1276
  212. package/dist/chunks/calculated-field-identity-rMuXuzEY.cjs +0 -1
  213. package/dist/chunks/constants-vtu7_IUo.cjs +0 -1
  214. package/dist/chunks/dashboard-controls-DlxeddZN.cjs +0 -52
  215. package/dist/chunks/dashboard-json-DhS4yJfc.cjs +0 -1
  216. package/dist/chunks/edit-dashboard-visual-X3OCnivL.cjs +0 -172
  217. package/dist/chunks/field-aggregations-BU_3gHKR.js +0 -957
  218. package/dist/chunks/field-aggregations-CDCamEsQ.cjs +0 -1
  219. package/dist/chunks/index-C8XCKzB6.cjs +0 -1
  220. package/dist/chunks/index-DSa6RSdg.cjs +0 -1417
  221. package/dist/chunks/matrix-control-sources-CeC5EMyq.cjs +0 -1
  222. package/dist/chunks/matrix-member-presentation-E2B4k3ws.cjs +0 -1
  223. package/dist/chunks/matrix-member-presentation-qiHxv67e.js +0 -105
  224. package/dist/chunks/matrix-operation-contract-Cqy4EW2H.js +0 -1638
  225. package/dist/chunks/matrix-operation-contract-D9dLX-Wr.cjs +0 -1
  226. package/dist/chunks/report-preferences-dialog-7Vsc_fsG.cjs +0 -1
  227. package/dist/chunks/search-BqqhaMx9.cjs +0 -26
  228. package/dist/chunks/switch-BytP6QY8.cjs +0 -139
  229. package/dist/types/components/interactions/configuration-popover.d.ts +0 -1
  230. package/dist/types/components/interactions/interaction-card.d.ts +0 -59
  231. package/dist/types/components/interactions/interaction-event-handler.d.ts +0 -11
  232. package/dist/types/components/interactions/interactions-list.d.ts +0 -50
  233. package/dist/types/components/interactions/panels/cross-filter-panel.d.ts +0 -24
  234. package/dist/types/components/interactions/panels/inline-drill-panel.d.ts +0 -24
  235. package/dist/types/components/interactions/selectors/action-selector.d.ts +0 -31
  236. package/dist/types/components/interactions/selectors/trigger-selector.d.ts +0 -38
  237. package/dist/types/components/surfboard/filter/click-filter-section.d.ts +0 -5
  238. package/dist/types/lib/interactions/build-interaction-event.d.ts +0 -25
  239. package/dist/types/lib/interactions/convert-click-filters-to-filter-group.d.ts +0 -10
  240. package/dist/types/lib/interactions/execute-interaction-event.d.ts +0 -80
  241. package/dist/types/lib/interactions/field-utils.d.ts +0 -11
  242. package/dist/types/lib/interactions/handle-chart-click.d.ts +0 -75
  243. package/dist/types/lib/interactions/linked-interaction-utils.d.ts +0 -14
  244. package/dist/types/lib/interactions/source-card-filter-utils.d.ts +0 -9
  245. package/dist/types/lib/stores/drill-actions.d.ts +0 -139
  246. package/dist/types/lib/stores/interaction-store.d.ts +0 -113
  247. package/dist/types/lib/stores/pointer-interaction-store.d.ts +0 -18
@@ -1,6 +1,6 @@
1
- import { MatrixSpec, MatrixWindowRequest, MatrixWindow, MatrixOperationRequest, MatrixExecutionResult, SemaphorAnalyticsFilter, SemaphorOptionDependencyOutcome, SemaphorOptionMatchResult, SemaphorAnalyticsExecutionResult, SemaphorAnalyticsExecutionStatus, SemaphorAnalyticsIntent, SemaphorAnalyticsValidationIssue, SemaphorAnalyticsValidationResult, SemaphorDerivedFieldDefinition, SemaphorFieldRef, SemaphorInputBinding, SemaphorInputOptionSource, SemaphorInputOperator, SemaphorMetricIntent, SemaphorRelationshipHint, SemaphorMatrixIntent, SemaphorOptionDependencies, SemaphorOptionPopulation, SemaphorPaginationMetadata, SemaphorPaginationRequest, SemaphorRecordsIntent, SemaphorResultColumn, SemaphorSqlIntent, SemaphorSourceRef, SemaphorTimeGrain, SemaphorTimeWindow } from '../shared/analytics-protocol/index.js';
1
+ import { MatrixSpec, MatrixWindowRequest, MatrixWindow, MatrixOperationRequest, MatrixExecutionResult, AnalyticsSelection, AnalyticsSelectionTuple, SemaphorAnalyticsFilter, SemaphorOptionDependencyOutcome, SemaphorOptionMatchResult, SemaphorAnalyticsExecutionResult, SemaphorAnalyticsExecutionStatus, SemaphorAnalyticsIntent, SemaphorAnalyticsValidationIssue, SemaphorAnalyticsValidationResult, SemaphorDerivedFieldDefinition, SemaphorFieldRef, SemaphorInputBinding, SemaphorInputOptionSource, SemaphorInputOperator, SemaphorMetricIntent, SemaphorRelationshipHint, SemaphorMatrixIntent, SemaphorOptionDependencies, SemaphorOptionPopulation, SemaphorPaginationMetadata, SemaphorPaginationRequest, SemaphorRecordsIntent, SemaphorResultColumn, SemaphorSqlIntent, SemaphorSourceRef, SemaphorTimeGrain, SemaphorTimeWindow } from '../shared/analytics-protocol/index.js';
2
2
  import { CalendarContext } from '../lib/types/token-types.js';
3
- export type { SemaphorAnalyticsFilter, SemaphorDerivedFieldDefinition, SemaphorFieldRef, SemaphorInputBinding, SemaphorInputOptionSource, SemaphorInputOperator, SemaphorPaginationMetadata, SemaphorPaginationRequest, SemaphorOptionDependencies, SemaphorOptionPopulation, SemaphorResultColumn, SemaphorMatrixIntent, SemaphorSourceRef, SemaphorTimeWindow, } from '../shared/analytics-protocol/index.js';
3
+ export type { AnalyticsSelection, AnalyticsSelectionCondition, AnalyticsSelectionTuple, SemaphorAnalyticsFilter, SemaphorDerivedFieldDefinition, SemaphorFieldRef, SemaphorInputBinding, SemaphorInputOptionSource, SemaphorInputOperator, SemaphorPaginationMetadata, SemaphorPaginationRequest, SemaphorOptionDependencies, SemaphorOptionPopulation, SemaphorResultColumn, SemaphorMatrixIntent, SemaphorSourceRef, SemaphorTimeWindow, } from '../shared/analytics-protocol/index.js';
4
4
  export type SemaphorScalar = string | number | boolean | null;
5
5
  export type SemaphorInputValue = SemaphorScalar | SemaphorScalar[];
6
6
  export type SemaphorOptionValue = string | number | boolean;
@@ -64,6 +64,45 @@ export type SemaphorInputHandle<TValue extends SemaphorInputValue = SemaphorInpu
64
64
  clear(): void;
65
65
  toAnalyticsInput(): SemaphorActiveInput<TValue>;
66
66
  };
67
+ export type SemaphorSelectionBase = {
68
+ id: string;
69
+ label?: string;
70
+ multipleSelection?: boolean;
71
+ tuples?: AnalyticsSelectionTuple[];
72
+ defaultTuples?: AnalyticsSelectionTuple[];
73
+ onTuplesChange?: {
74
+ bivarianceHack(tuples: AnalyticsSelectionTuple[]): void;
75
+ }['bivarianceHack'];
76
+ };
77
+ export type SemaphorSelectionInputSpec = SemaphorSelectionBase & {
78
+ kind: 'selection';
79
+ fields: SemaphorQueryField[];
80
+ };
81
+ export type SemaphorSelectionGesture = {
82
+ kind: 'replace';
83
+ } | {
84
+ kind: 'toggle';
85
+ } | {
86
+ kind: 'range';
87
+ anchor: AnalyticsSelectionTuple;
88
+ ordered: AnalyticsSelectionTuple[];
89
+ };
90
+ export type SemaphorSelectionOutcome = 'selected' | 'added' | 'removed' | 'cleared' | 'rangeSelected' | 'limitReached';
91
+ export type SemaphorSelectionHandle = {
92
+ id: string;
93
+ kind: 'selection';
94
+ label?: string;
95
+ fields: SemaphorQueryField[];
96
+ tuples: AnalyticsSelectionTuple[];
97
+ isActive: boolean;
98
+ select(tuple: AnalyticsSelectionTuple, gesture?: SemaphorSelectionGesture): {
99
+ tuples: AnalyticsSelectionTuple[];
100
+ outcome: SemaphorSelectionOutcome;
101
+ };
102
+ clear(): void;
103
+ toAnalyticsSelection(): AnalyticsSelection | undefined;
104
+ };
105
+ export type SemaphorSelectionReference = AnalyticsSelection | SemaphorSelectionHandle;
67
106
  export type SemaphorInputBindingReference<TValue extends SemaphorInputValue = SemaphorInputValue> = {
68
107
  toAnalyticsInput(): SemaphorActiveInput<TValue>;
69
108
  };
@@ -195,6 +234,7 @@ export type SemaphorDataAppDefinition = {
195
234
  title?: string;
196
235
  description?: string;
197
236
  inputs?: Record<string, SemaphorInputSpec> | SemaphorInputSpec[];
237
+ selections?: Record<string, SemaphorSelectionInputSpec> | SemaphorSelectionInputSpec[];
198
238
  queries?: Record<string, SemaphorQueryDefinition>;
199
239
  views: SemaphorDataAppViewDefinition[];
200
240
  };
@@ -230,6 +270,7 @@ export type SemaphorQueryDebugOptions = {
230
270
  };
231
271
  export type SemaphorQueryRuntimeOptions = {
232
272
  inputs?: SemaphorInputReference[];
273
+ selections?: SemaphorSelectionReference[];
233
274
  debug?: SemaphorQueryDebugOptions;
234
275
  };
235
276
  export type SemaphorQueryStatus = 'idle' | 'loading' | 'success' | 'error';
@@ -509,6 +550,7 @@ export type SemaphorQueryExecutorContext = {
509
550
  token?: string;
510
551
  apiBaseUrl?: string;
511
552
  activeInputs?: SemaphorActiveInput[];
553
+ selections?: AnalyticsSelection[];
512
554
  debug?: SemaphorDataAppDebugConfig;
513
555
  };
514
556
  export type SemaphorQueryExecutor = {
@@ -4,6 +4,7 @@ export type { SemaphorDevtoolsInspectButtonProps, SemaphorDevtoolsProps, } from
4
4
  export { createSemaphorQueryExecutor } from './executor.js';
5
5
  export { semaphorMetricAggregate, semaphorMetricMeasureBindingKey, } from '../shared/analytics-protocol/index.js';
6
6
  export { isSemaphorInputValueValidForOptions, useClearInvalidSemaphorInputValue, useSemaphorInput, useSemaphorInputs, useSemaphorQuery, } from './hooks.js';
7
+ export { useSemaphorSelection } from './selection.js';
7
8
  export { SemaphorDataAppProvider } from './provider.js';
8
9
  export type * from './contracts.js';
9
10
  export type { SemaphorBindInputSpec, SemaphorControlBuilderSpec, SemaphorFieldBuilderSpec, SemaphorSemanticSourceBuilderSpec, SemaphorSqlParamInputSpec, SemaphorSqlSourceBuilderSpec, } from './builders.js';
@@ -1,14 +1,19 @@
1
- import { SemaphorAnalysisPayload, SemaphorAnalysisQueryOptions, SemaphorAnalysisQuerySpec, SemaphorDataAppQueryError, SemaphorInputOptionsPayload, SemaphorInputOptionsQuerySpec, SemaphorActiveInput, SemaphorMatrixPayload, SemaphorMatrixQuerySpec, SemaphorMetricPayload, SemaphorMetricQuerySpec, SemaphorRecordsQuerySpec, SemaphorRecordsPayload, SemaphorSqlPayload, SemaphorSqlQuerySpec } from './contracts.js';
2
- import { SemaphorAnalyticsExecutionResult, SemaphorAnalyticsIntent, SemaphorAnalyticsValidationIssue, SemaphorAnalyticsValidationResult, SemaphorMatrixIntent, SemaphorMetricIntent, SemaphorRecordsIntent, SemaphorSqlIntent, MatrixWindowRequest } from '../shared/analytics-protocol/index.js';
1
+ import { SemaphorAnalysisPayload, SemaphorAnalysisQueryOptions, SemaphorAnalysisQuerySpec, SemaphorDataAppQueryError, SemaphorInputOptionsPayload, SemaphorInputOptionsQuerySpec, SemaphorActiveInput, SemaphorMatrixPayload, SemaphorMatrixQuerySpec, SemaphorMetricPayload, SemaphorMetricQuerySpec, SemaphorRecordsQuerySpec, SemaphorRecordsPayload, SemaphorSqlPayload, SemaphorSqlQuerySpec, SemaphorSelectionReference } from './contracts.js';
2
+ import { SemaphorAnalyticsExecutionResult, AnalyticsSelection, SemaphorAnalyticsIntent, SemaphorAnalyticsValidationIssue, SemaphorAnalyticsValidationResult, SemaphorMatrixIntent, SemaphorMetricIntent, SemaphorRecordsIntent, SemaphorSqlIntent, MatrixWindowRequest } from '../shared/analytics-protocol/index.js';
3
3
  export type SemaphorQueryRequest<TIntent, TData> = {
4
4
  intent?: TIntent;
5
5
  error: SemaphorDataAppQueryError | null;
6
6
  activeInputs?: SemaphorActiveInput[];
7
+ selections?: AnalyticsSelection[];
7
8
  analysisOptions?: SemaphorAnalysisQueryOptions;
8
9
  matrixWindowRequest?: MatrixWindowRequest;
9
10
  queryKey: string;
10
11
  idleData: TData;
11
12
  };
13
+ export declare function attachSemaphorSelectionsToRequest<TRequest extends {
14
+ queryKey: string;
15
+ selections?: AnalyticsSelection[];
16
+ }>(request: TRequest, selections: SemaphorSelectionReference[] | undefined): TRequest;
12
17
  export declare function buildAnalysisRequest(spec: SemaphorAnalysisQuerySpec): SemaphorQueryRequest<SemaphorMetricIntent, SemaphorAnalysisPayload>;
13
18
  export declare function buildMetricRequest(spec: SemaphorMetricQuerySpec): SemaphorQueryRequest<SemaphorMetricIntent, SemaphorMetricPayload>;
14
19
  export declare function buildRecordsRequest<TRecord extends Record<string, unknown> = Record<string, unknown>>(spec: SemaphorRecordsQuerySpec): SemaphorQueryRequest<SemaphorRecordsIntent, SemaphorRecordsPayload<TRecord>>;
@@ -0,0 +1,2 @@
1
+ import { SemaphorSelectionHandle, SemaphorSelectionInputSpec } from './contracts.js';
2
+ export declare function useSemaphorSelection(spec: SemaphorSelectionInputSpec): SemaphorSelectionHandle;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../chunks/common-types-nBuCd3u2.cjs"),e=require("../chunks/validators-DVYAnnX0.cjs"),t=require("../chunks/field-dependencies-r_U0CGQ-.cjs"),a=require("../chunks/pivot-result-identity-uTiylUNr.cjs"),r=require("../chunks/report-runtime-context-DzvHBPxl.cjs");exports.CONTROL_CARD_DEFAULT_VALUE=l.CONTROL_CARD_DEFAULT_VALUE;exports.EMPTY_SELECTION=l.EMPTY_SELECTION;exports.CALCULATED_FIELD_ENTITY_MARKER=e.CALCULATED_FIELD_ENTITY_MARKER;exports.DATE_FORMAT_VALUES=e.DATE_FORMAT_VALUES;exports.LEGACY_CALCULATED_FIELD_ENTITY_MARKER=e.LEGACY_CALCULATED_FIELD_ENTITY_MARKER;exports.PivotMarkerEnum=e.PivotMarkerEnum;exports.getCalculatedFieldComputeStage=e.getCalculatedFieldComputeStage;exports.getFieldRuntimeColumnName=e.getFieldRuntimeColumnName;exports.hasCalculatedFieldMarker=e.hasCalculatedFieldMarker;exports.hasCalculatedFormulaInputs=e.hasCalculatedFormulaInputs;exports.hasSyntheticCalculatedFieldOwner=e.hasSyntheticCalculatedFieldOwner;exports.inspectCalculatedField=e.inspectCalculatedField;exports.isCalculatedDimension=e.isCalculatedDimension;exports.isCalculatedMetric=e.isCalculatedMetric;exports.isDerivedField=e.isDerivedField;exports.normalizeCalculatedFieldRepresentation=e.normalizeCalculatedFieldRepresentation;exports.shouldDropInheritedCalculationAggregate=e.shouldDropInheritedCalculationAggregate;exports.DEFAULT_SEMANTIC_DOMAIN_ACCESS=t.DEFAULT_SEMANTIC_DOMAIN_ACCESS;exports.collectDatasetNamesFromExplorerField=t.collectDatasetNamesFromExplorerField;exports.collectDatasetNamesFromFilterGroup=t.collectDatasetNamesFromFilterGroup;exports.collectExecutionDatasetNamesFromExplorerField=t.collectExecutionDatasetNamesFromExplorerField;exports.collectPreferredDatasetNamesFromExplorerField=t.collectPreferredDatasetNamesFromExplorerField;exports.collectQualifiedDatasetNamesFromExplorerField=t.collectQualifiedDatasetNamesFromExplorerField;exports.datasetRefFromSource=t.datasetRefFromSource;exports.dependencyDisplayIdentity=t.dependencyDisplayIdentity;exports.humanizeDatasetName=t.humanizeDatasetName;exports.resolveFieldDatasetDependencies=t.resolveFieldDatasetDependencies;exports.resolveQueryColumnKeyMapEntry=a.resolveQueryColumnKeyMapEntry;exports.resolveUniqueQueryColumnKeyMapEntry=a.resolveUniqueQueryColumnKeyMapEntry;exports.DEFAULT_CALENDAR_CONTEXT=r.DEFAULT_CALENDAR_CONTEXT;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../chunks/common-types-nBuCd3u2.cjs"),e=require("../chunks/validators-DVYAnnX0.cjs"),t=require("../chunks/field-dependencies-DIab72rQ.cjs"),r=require("../chunks/token-types-Ahh5u4iT.cjs"),a=require("../chunks/pivot-result-identity-uTiylUNr.cjs"),i=require("../chunks/report-runtime-context-DzvHBPxl.cjs");exports.CONTROL_CARD_DEFAULT_VALUE=l.CONTROL_CARD_DEFAULT_VALUE;exports.EMPTY_SELECTION=l.EMPTY_SELECTION;exports.CALCULATED_FIELD_ENTITY_MARKER=e.CALCULATED_FIELD_ENTITY_MARKER;exports.DATE_FORMAT_VALUES=e.DATE_FORMAT_VALUES;exports.LEGACY_CALCULATED_FIELD_ENTITY_MARKER=e.LEGACY_CALCULATED_FIELD_ENTITY_MARKER;exports.PivotMarkerEnum=e.PivotMarkerEnum;exports.getCalculatedFieldComputeStage=e.getCalculatedFieldComputeStage;exports.getFieldRuntimeColumnName=e.getFieldRuntimeColumnName;exports.hasCalculatedFieldMarker=e.hasCalculatedFieldMarker;exports.hasCalculatedFormulaInputs=e.hasCalculatedFormulaInputs;exports.hasSyntheticCalculatedFieldOwner=e.hasSyntheticCalculatedFieldOwner;exports.inspectCalculatedField=e.inspectCalculatedField;exports.isCalculatedDimension=e.isCalculatedDimension;exports.isCalculatedMetric=e.isCalculatedMetric;exports.isDerivedField=e.isDerivedField;exports.normalizeCalculatedFieldRepresentation=e.normalizeCalculatedFieldRepresentation;exports.shouldDropInheritedCalculationAggregate=e.shouldDropInheritedCalculationAggregate;exports.collectDatasetNamesFromExplorerField=t.collectDatasetNamesFromExplorerField;exports.collectDatasetNamesFromFilterGroup=t.collectDatasetNamesFromFilterGroup;exports.collectExecutionDatasetNamesFromExplorerField=t.collectExecutionDatasetNamesFromExplorerField;exports.collectPreferredDatasetNamesFromExplorerField=t.collectPreferredDatasetNamesFromExplorerField;exports.collectQualifiedDatasetNamesFromExplorerField=t.collectQualifiedDatasetNamesFromExplorerField;exports.datasetRefFromSource=t.datasetRefFromSource;exports.dependencyDisplayIdentity=t.dependencyDisplayIdentity;exports.humanizeDatasetName=t.humanizeDatasetName;exports.resolveFieldDatasetDependencies=t.resolveFieldDatasetDependencies;exports.DEFAULT_SEMANTIC_DOMAIN_ACCESS=r.DEFAULT_SEMANTIC_DOMAIN_ACCESS;exports.resolveQueryColumnKeyMapEntry=a.resolveQueryColumnKeyMapEntry;exports.resolveUniqueQueryColumnKeyMapEntry=a.resolveUniqueQueryColumnKeyMapEntry;exports.DEFAULT_CALENDAR_CONTEXT=i.DEFAULT_CALENDAR_CONTEXT;
@@ -1,37 +1,38 @@
1
- import { C as s, E as l } from "../chunks/common-types-C6cAQgyh.js";
2
- import { C as r, D as o, L as i, P as d, d as E, g as c, e as m, h as C, f as n, c as u, a as D, i as F, b as A, n as p, s as _ } from "../chunks/validators-BDYzZFgs.js";
3
- import { D as L, c as N, g as M, f as R, b as f, e as x, d as y, a as I, h, r as g } from "../chunks/field-dependencies-DVl2p1Nm.js";
4
- import { r as U, a as O } from "../chunks/pivot-result-identity-BSudrDLN.js";
5
- import { D as K } from "../chunks/report-runtime-context-DWvUf1HT.js";
1
+ import { C as s, E as t } from "../chunks/common-types-C6cAQgyh.js";
2
+ import { C as r, D as o, L as i, P as d, d as E, g as m, e as c, h as C, f as n, c as u, a as D, i as F, b as p, n as A, s as _ } from "../chunks/validators-BDYzZFgs.js";
3
+ import { c as L, g as N, f, b as x, e as M, d as R, a as y, h as I, r as h } from "../chunks/field-dependencies-Cl97kkHy.js";
4
+ import { D as S } from "../chunks/token-types-CPde8_LG.js";
5
+ import { r as O, a as v } from "../chunks/pivot-result-identity-BSudrDLN.js";
6
+ import { D as P } from "../chunks/report-runtime-context-DWvUf1HT.js";
6
7
  export {
7
8
  r as CALCULATED_FIELD_ENTITY_MARKER,
8
9
  s as CONTROL_CARD_DEFAULT_VALUE,
9
10
  o as DATE_FORMAT_VALUES,
10
- K as DEFAULT_CALENDAR_CONTEXT,
11
- L as DEFAULT_SEMANTIC_DOMAIN_ACCESS,
12
- l as EMPTY_SELECTION,
11
+ P as DEFAULT_CALENDAR_CONTEXT,
12
+ S as DEFAULT_SEMANTIC_DOMAIN_ACCESS,
13
+ t as EMPTY_SELECTION,
13
14
  i as LEGACY_CALCULATED_FIELD_ENTITY_MARKER,
14
15
  d as PivotMarkerEnum,
15
- N as collectDatasetNamesFromExplorerField,
16
- M as collectDatasetNamesFromFilterGroup,
17
- R as collectExecutionDatasetNamesFromExplorerField,
18
- f as collectPreferredDatasetNamesFromExplorerField,
19
- x as collectQualifiedDatasetNamesFromExplorerField,
20
- y as datasetRefFromSource,
21
- I as dependencyDisplayIdentity,
16
+ L as collectDatasetNamesFromExplorerField,
17
+ N as collectDatasetNamesFromFilterGroup,
18
+ f as collectExecutionDatasetNamesFromExplorerField,
19
+ x as collectPreferredDatasetNamesFromExplorerField,
20
+ M as collectQualifiedDatasetNamesFromExplorerField,
21
+ R as datasetRefFromSource,
22
+ y as dependencyDisplayIdentity,
22
23
  E as getCalculatedFieldComputeStage,
23
- c as getFieldRuntimeColumnName,
24
- m as hasCalculatedFieldMarker,
24
+ m as getFieldRuntimeColumnName,
25
+ c as hasCalculatedFieldMarker,
25
26
  C as hasCalculatedFormulaInputs,
26
27
  n as hasSyntheticCalculatedFieldOwner,
27
- h as humanizeDatasetName,
28
+ I as humanizeDatasetName,
28
29
  u as inspectCalculatedField,
29
30
  D as isCalculatedDimension,
30
31
  F as isCalculatedMetric,
31
- A as isDerivedField,
32
- p as normalizeCalculatedFieldRepresentation,
33
- g as resolveFieldDatasetDependencies,
34
- U as resolveQueryColumnKeyMapEntry,
35
- O as resolveUniqueQueryColumnKeyMapEntry,
32
+ p as isDerivedField,
33
+ A as normalizeCalculatedFieldRepresentation,
34
+ h as resolveFieldDatasetDependencies,
35
+ O as resolveQueryColumnKeyMapEntry,
36
+ v as resolveUniqueQueryColumnKeyMapEntry,
36
37
  _ as shouldDropInheritedCalculationAggregate
37
38
  };
@@ -2,7 +2,9 @@ export declare const APPEARANCE_SPEC_VERSION: 1;
2
2
  export type AppearanceMode = 'light' | 'dark' | 'system';
3
3
  export type ResolvedAppearanceMode = 'light' | 'dark';
4
4
  export type AppearanceDensity = 'compact' | 'comfortable' | 'spacious';
5
- export type AppearanceColorToken = 'background' | 'foreground' | 'muted' | 'mutedForeground' | 'border' | 'input' | 'primary' | 'primaryForeground' | 'accent' | 'accentForeground' | 'card' | 'cardForeground' | 'positive' | 'negative' | 'warning' | 'info' | 'destructive' | 'destructiveForeground';
5
+ export type AppearanceColorToken = 'background' | 'foreground' | 'muted' | 'mutedForeground' | 'border' | 'input' | 'primary' | 'primaryForeground' | 'accent' | 'accentForeground'
6
+ /** What a viewer selected to filter by: table rows, matrix cells. */
7
+ | 'selection' | 'card' | 'cardForeground' | 'positive' | 'negative' | 'warning' | 'info' | 'destructive' | 'destructiveForeground';
6
8
  export type AppearanceColorTokens = Partial<Record<AppearanceColorToken, string>>;
7
9
  export type AppearanceTokens = {
8
10
  color?: AppearanceColorTokens;
@@ -2,7 +2,6 @@ import { BriefingAttachment, BriefingAttachmentFormat, BriefingAttachmentSetting
2
2
  import { ControlBinding, ControlDefinition, DashboardInputValues, TDashboard } from '../types/common-types.js';
3
3
  import { TFilter, TFilterValue } from '../../components/surfboard/filter/types.js';
4
4
  import { SemanticExecutionPayload } from '../types/semantic-runtime-types.js';
5
- import { InteractionStateMap } from '../query-context/build-card-query-context.js';
6
5
  import { MatrixConfig } from '../../shared/analytics-protocol/index.js';
7
6
  import { MatrixCardCatalog } from '../matrix-table/matrix-card-adapter.js';
8
7
  export type BriefingAttachmentOptionKind = 'dashboard' | 'dashboard_sheet' | 'document_sheet' | 'card';
@@ -39,7 +38,6 @@ export type BriefingAttachmentRuntimeInput = {
39
38
  dashboardControls?: ControlDefinition[];
40
39
  dashboardInputValues?: DashboardInputValues;
41
40
  semanticExecutionPayload?: SemanticExecutionPayload;
42
- interactionStates?: InteractionStateMap;
43
41
  timezone?: string;
44
42
  };
45
43
  export type BriefingAttachmentBuildResult = {
@@ -3,14 +3,7 @@ type InteractionsPopoverContextType = {
3
3
  open: boolean;
4
4
  frameId: string | null;
5
5
  cardId: string | null;
6
- triggerElement: HTMLElement | null;
7
- anchorPosition: {
8
- left: number;
9
- top: number;
10
- width: number;
11
- height: number;
12
- } | null;
13
- openPopover: (frameId: string, cardId: string, triggerElement: HTMLElement) => void;
6
+ openPopover: (frameId: string, cardId: string) => void;
14
7
  closePopover: () => void;
15
8
  };
16
9
  declare const InteractionsPopoverContext: import('react').Context<InteractionsPopoverContextType>;
@@ -0,0 +1,23 @@
1
+ import { DashboardInputValues, TCard, TDashboard } from '../types/common-types.js';
2
+ type Target = {
3
+ dashboard: Pick<TDashboard, 'sheets' | 'defaultInputValues'>;
4
+ dashboardInputValues: DashboardInputValues;
5
+ };
6
+ /**
7
+ * Rewrites every click-to-filter reference a card holds. Mutates the card, so
8
+ * it works on a store draft and on a fresh clone alike. The walkers are the
9
+ * shared ones; this only says which members of a card carry card ids.
10
+ */
11
+ export declare function remapCardClickToFilterReferences(card: TCard, cardIds: Map<string, string>): void;
12
+ /**
13
+ * A card's id changed (renamed, or a document section's card replaced). Every
14
+ * other card that names it keeps reaching it, and a live selection it holds
15
+ * moves with it. Without this the save succeeds and filtering silently stops.
16
+ */
17
+ export declare function retargetClickToFilterCardId(target: Target, previousCardId: string, nextCardId: string): void;
18
+ /**
19
+ * Cards were deleted. The cards that remain stop naming them, and a selection
20
+ * a deleted card held goes with it, so no dangling id is ever saved from here.
21
+ */
22
+ export declare function removeClickToFilterCardReferences(target: Target, removedCardIds: Set<string>): void;
23
+ export {};
@@ -1,20 +1,34 @@
1
1
  import { DashboardInputValues, NormalizedDashboardInput, TCard, TDashboard } from '../types/common-types.js';
2
+ import { TransientInputContext } from './transient-input-context.js';
2
3
  export type BuildNormalizedDashboardInputsInput = {
3
4
  dashboard: Pick<TDashboard, 'inputs' | 'filters' | 'controls' | 'sheets'>;
4
5
  card?: TCard | null;
5
6
  availableSheetIds?: string[];
6
7
  availableCardIds?: string[];
8
+ /**
9
+ * Carried definitions for a runtime resolution. Authoring callers leave it
10
+ * out: a carried definition is never part of the dashboard being edited.
11
+ */
12
+ transientContexts?: readonly TransientInputContext[];
7
13
  };
8
14
  export type BuildNormalizedDashboardInputsOutput = {
9
15
  authoredInputs: NormalizedDashboardInput[];
10
16
  compatibilityInputs: NormalizedDashboardInput[];
17
+ /** Carried definitions, already normalized and self-contained. */
18
+ transientInputs: NormalizedDashboardInput[];
11
19
  allInputs: NormalizedDashboardInput[];
12
20
  };
13
- export declare function requiresDashboardInputResolution({ dashboard, dashboardInputValues, }: {
21
+ export declare function requiresDashboardInputResolution({ dashboard, dashboardInputValues, transientContexts, }: {
14
22
  dashboard: Pick<TDashboard, 'inputs' | 'filters' | 'controls' | 'defaultInputValues'>;
15
23
  dashboardInputValues?: DashboardInputValues;
24
+ /**
25
+ * Carried definitions are inputs of this resolution too, so a dashboard with
26
+ * no inputs of its own still has to resolve them. Required so that every
27
+ * caller decides.
28
+ */
29
+ transientContexts: readonly TransientInputContext[] | undefined;
16
30
  }): boolean;
17
- export declare function buildNormalizedDashboardInputs({ dashboard, card, availableSheetIds, availableCardIds, }: BuildNormalizedDashboardInputsInput): BuildNormalizedDashboardInputsOutput;
31
+ export declare function buildNormalizedDashboardInputs({ dashboard, card, availableSheetIds, availableCardIds, transientContexts, }: BuildNormalizedDashboardInputsInput): BuildNormalizedDashboardInputsOutput;
18
32
  /** An Input the tolerant normalization rejected, kept identifiable. */
19
33
  export type RejectedDashboardInput = {
20
34
  inputId: string;
@@ -0,0 +1,31 @@
1
+ import { SelectionInputValue } from '../../shared/analytics-protocol/selection-contract.js';
2
+ import { DashboardInputValues, SelectionDashboardInput, TCard, TDashboard } from '../types/common-types.js';
3
+ type SelectionDashboard = Pick<TDashboard, 'sheets' | 'interactionDefaults'>;
4
+ /** Every selection lives in the shared slot map: it is dashboard-wide and survives sheet switches. */
5
+ export declare const SELECTION_RUNTIME_TARGET: {};
6
+ /** The slot address of a source card's selection. */
7
+ export declare function selectionSlotAddress(sourceCardId: string): Pick<SelectionDashboardInput, 'id' | 'runtimeScope'>;
8
+ /**
9
+ * The selection input of one source card, or undefined when click to filter is
10
+ * off for it. Settings come from the normalizer, so a legacy cross-filter
11
+ * interaction yields the same input an authored `clickToFilter` would.
12
+ */
13
+ export declare function buildSelectionDashboardInput(card: TCard, dashboard: Pick<TDashboard, 'interactionDefaults' | 'sheets'>): SelectionDashboardInput | undefined;
14
+ /** A set, schema-valid selection value, or undefined. A malformed slot is ignored, never thrown on. */
15
+ export declare function readSelectionValue(values: DashboardInputValues | undefined, sourceCardId: string): SelectionInputValue | undefined;
16
+ export type ActiveSelection = {
17
+ input: SelectionDashboardInput;
18
+ value: SelectionInputValue;
19
+ sourceCard: TCard;
20
+ };
21
+ /**
22
+ * The selections currently in effect, in slot order. Driven by the values, not
23
+ * by the cards: a dashboard pays nothing for cards nobody has clicked. A slot
24
+ * whose source card is gone, or whose card no longer has click to filter on,
25
+ * is not in effect.
26
+ */
27
+ export declare function listActiveSelections(params: {
28
+ dashboard: SelectionDashboard;
29
+ dashboardInputValues: DashboardInputValues | undefined;
30
+ }): ActiveSelection[];
31
+ export {};
@@ -0,0 +1,17 @@
1
+ import { SelectionField } from '../../shared/analytics-protocol/selection-contract.js';
2
+ import { ClickToFilterFieldsRule, DashboardCardFilterSourceInventory } from '../../shared/dashboard-authoring/index.js';
3
+ import { Field } from '../types/explorer-types.js';
4
+ export type ClickToFilterDimension = {
5
+ key: string;
6
+ field: SelectionField;
7
+ /** The authored field, for its label. */
8
+ authored: Field;
9
+ };
10
+ /**
11
+ * The dimension fields of a card that a click can carry, grounded the same way
12
+ * a click grounds them. A calculated field or one with no data type is left
13
+ * out here exactly as it is left out of a tuple.
14
+ */
15
+ export declare function clickToFilterDimensions(dimensions: Field[], sourceIndex: DashboardCardFilterSourceInventory): ClickToFilterDimension[];
16
+ /** The fields the rule lets a click carry. Whole row and clicked cell can carry any dimension. */
17
+ export declare function clickToFilterEmittedFields(dimensions: ClickToFilterDimension[], rule: ClickToFilterFieldsRule): SelectionField[];
@@ -0,0 +1,99 @@
1
+ import { SelectionField } from '../../shared/analytics-protocol/selection-contract.js';
2
+ import { ClickToFilterCardMapping, ClickToFilterSettings } from '../../shared/dashboard-authoring/index.js';
3
+ import { NormalizedFilterDashboardInput, TCard, TDashboard } from '../types/common-types.js';
4
+ import { DashboardFilterMappingCandidateCatalog, DashboardFilterMappingDraftRow } from './dashboard-filter-mapping-authoring.js';
5
+ /** Why a card gets nothing from this source, decided before any field is looked at. */
6
+ export type ClickToFilterDraftCardState = 'listening'
7
+ /** An 'excluded' card mapping: the author chose "Don't apply to this card". */
8
+ | 'excluded'
9
+ /** `card.respondsToSelections === false`, set on the target card itself. */
10
+ | 'receiverOptedOut'
11
+ /** `settings.targets` does not reach the card. */
12
+ | 'outsideTargets'
13
+ /** SQL and unconfigured cards: a selection compiles to card filter conditions, which only config cards execute. */
14
+ | 'notSupported';
15
+ export type ClickToFilterMappingDraftRow = {
16
+ /** Target card. */
17
+ cardId: string;
18
+ clickedFieldKey: string;
19
+ clickedField: SelectionField;
20
+ /** The toolbar filter's row type, unchanged, so `MappingRow` renders it. */
21
+ row: DashboardFilterMappingDraftRow;
22
+ /**
23
+ * Set when the card has fields to choose from but none the click matches.
24
+ * The click drops this field here, which is ordinary and needs no decision;
25
+ * `row.status` is 'excluded' so the row reads "Not applied" and stays choosable.
26
+ */
27
+ unmapped?: true;
28
+ /** Shows "Same as <filter> filter". A borrowed binding is never persisted here. */
29
+ provenanceHint?: 'borrowedFromFilter';
30
+ borrowedFromInputId?: string;
31
+ };
32
+ export type ClickToFilterMappingDraftCard = {
33
+ cardId: string;
34
+ cardTitle: string;
35
+ cardType: TCard['type'];
36
+ sheetId: string;
37
+ state: ClickToFilterDraftCardState;
38
+ /** One per emitted field. Empty unless the card is listening or excluded. */
39
+ rows: ClickToFilterMappingDraftRow[];
40
+ /** A suggestion to accept, an ambiguous match, or a mapping that went stale. */
41
+ needsReview: boolean;
42
+ };
43
+ export type ClickToFilterMappingDraft = {
44
+ sourceCardId: string;
45
+ /** Cards that need review first, then dashboard order. */
46
+ cards: ClickToFilterMappingDraftCard[];
47
+ rows: ClickToFilterMappingDraftRow[];
48
+ /** Per target card. */
49
+ counts: {
50
+ /** At least one clicked field applies. */
51
+ covered: number;
52
+ toReview: number;
53
+ /** Listening, but no clicked field applies. */
54
+ skipped: number;
55
+ /** Excluded by the author, opted out, outside the targets, or not supported. */
56
+ notApplied: number;
57
+ };
58
+ };
59
+ /**
60
+ * What one source card's clicks do on every other card, as review rows. It
61
+ * reads the same settings the runtime resolver reads, in the same order, so
62
+ * the dialog never promises a match a click will not make.
63
+ */
64
+ export declare function buildClickToFilterMappingDraft(params: {
65
+ sourceCard: Pick<TCard, 'id'>;
66
+ settings: ClickToFilterSettings;
67
+ dashboard: Pick<TDashboard, 'sheets'>;
68
+ /** Fields a click on the source card can carry under its fields rule. */
69
+ emittedFields: SelectionField[];
70
+ candidatesByCardId: Record<string, DashboardFilterMappingCandidateCatalog | undefined>;
71
+ /** Toolbar filters, for borrowed bindings. */
72
+ filterInputs: NormalizedFilterDashboardInput[];
73
+ }): ClickToFilterMappingDraft;
74
+ export type ClickToFilterMappingDraftIssue = {
75
+ cardId: string;
76
+ clickedFieldKey: string;
77
+ message: string;
78
+ };
79
+ /**
80
+ * Mirrors `acceptDashboardFilterMappingDraft`: fails while any row of a
81
+ * listening card is ambiguous, has no metadata, or holds a stale mapping. The
82
+ * result is sparse: automatic, suggested and borrowed rows write nothing.
83
+ */
84
+ export declare function acceptClickToFilterMappingDraft(params: {
85
+ draft: ClickToFilterMappingDraft;
86
+ settings: ClickToFilterSettings;
87
+ }): {
88
+ ok: true;
89
+ cardMappings: ClickToFilterCardMapping[];
90
+ } | {
91
+ ok: false;
92
+ issues: ClickToFilterMappingDraftIssue[];
93
+ };
94
+ /** Binds one clicked field on one card. Choosing a field re-includes an excluded card. */
95
+ export declare function bindClickToFilterField(settings: ClickToFilterSettings, binding: Extract<ClickToFilterCardMapping, {
96
+ kind: 'bound';
97
+ }>): ClickToFilterSettings;
98
+ /** "Don't apply to this card". Bindings are kept, so re-including restores them. */
99
+ export declare function setClickToFilterCardExcluded(settings: ClickToFilterSettings, cardId: string, excluded: boolean): ClickToFilterSettings;
@@ -0,0 +1,12 @@
1
+ import { DashboardInputScope, TDashboard } from '../types/common-types.js';
2
+ /**
3
+ * A click filters cards on its own sheet, and only those. This is a product
4
+ * rule, not a saved setting: `settings.targets` keeps whatever the author or a
5
+ * legacy entry stored, and is narrowed here on the way to every reader (the
6
+ * runtime input and the authoring draft), so lifting the rule later is a change
7
+ * to this one function.
8
+ *
9
+ * A source card that is not on the dashboard (an editor preview) has no sheet
10
+ * to narrow to, and its targets are returned as they are.
11
+ */
12
+ export declare function restrictClickToFilterTargetsToSourceSheet(targets: DashboardInputScope, sourceCardId: string, dashboard: Pick<TDashboard, 'sheets'>): DashboardInputScope;
@@ -1,6 +1,6 @@
1
1
  import { TFilter } from '../../components/surfboard/filter/types.js';
2
2
  import { DashboardInputScope, ReferencedFilterDashboardInput, TDashboard } from '../types/common-types.js';
3
- import { DashboardFilterCardApplication, DashboardFilterOptionSource, DashboardFilterTarget, DashboardFilterTargetField } from '../../shared/dashboard-authoring/index.js';
3
+ import { buildDashboardCardSourceIndex, DashboardFilterCardApplication, DashboardFilterOptionSource, DashboardFilterTarget, DashboardFilterTargetField } from '../../shared/dashboard-authoring/index.js';
4
4
  import { DashboardFilterOptionPolicy } from './dashboard-filter-mapping-storage-transition.js';
5
5
  export type DashboardFilterMappingCandidateCatalog = {
6
6
  status: 'ready';
@@ -116,6 +116,23 @@ export declare function buildDashboardFilterMappingOuterScope(params: {
116
116
  filter: Pick<TFilter, 'sheetId' | 'applyToSheetIds' | 'excludeSheetIds'>;
117
117
  dashboard: Pick<TDashboard, 'sheets'>;
118
118
  }): DashboardFilterMappingDraft['outerScope'];
119
+ /**
120
+ * One Cards row for a source-qualified value field that is not a toolbar
121
+ * filter, such as a field a click carries. It is the same decision chain the
122
+ * toolbar filter's rows go through (`rowFromCandidates`), so automatic,
123
+ * suggested, mapped, excluded and needs-mapping mean the same thing on every
124
+ * authoring surface. Equality is the only operation a click applies.
125
+ */
126
+ export declare function buildDashboardFilterMappingDraftRowForValueField(params: {
127
+ card: Parameters<typeof buildDashboardCardSourceIndex>[0];
128
+ sheetId: string;
129
+ valueField: DashboardFilterTargetField;
130
+ catalog: DashboardFilterMappingCandidateCatalog | undefined;
131
+ decision?: DashboardFilterMappingDraftDecision;
132
+ persistedApplication?: DashboardFilterCardApplication;
133
+ /** Bindings already accepted elsewhere for this value field, offered as inherited matches. */
134
+ acceptedTargets?: DashboardFilterTarget[];
135
+ }): DashboardFilterMappingDraftRow;
119
136
  /** The reference-backed Input for a dashboard filter, mapped or not. */
120
137
  export declare function findReferencedDashboardFilterInput(dashboard: Pick<TDashboard, 'inputs'>, filterId: string): ReferencedFilterDashboardInput | undefined;
121
138
  export declare function acceptDashboardFilterInputDraft(params: {
@@ -58,7 +58,9 @@ type DashboardFilterMappingOuterScope = Extract<DashboardInputScope, {
58
58
  */
59
59
  export declare function dashboardFilterMappingSourceRequestKey(source: DashboardFilterTargetSource): string;
60
60
  export declare function resolveDashboardFilterMappingColumnsRequest(source: DashboardFilterTargetSource, capabilities?: Pick<SemaphorConnectionCapabilities, 'prefixLevels'>): DashboardFilterMappingColumnsRequestResolution;
61
- export declare function collectDashboardFilterMappingSourceRequests(dashboard: Pick<TDashboard, 'sheets'>, outerScope?: DashboardFilterMappingOuterScope, capabilitiesByConnectionId?: ReadonlyMap<string, Pick<SemaphorConnectionCapabilities, 'prefixLevels'>>): DashboardFilterMappingSourceRequest[];
61
+ export declare function collectDashboardFilterMappingSourceRequests(dashboard: Pick<TDashboard, 'sheets'>, outerScope?: DashboardFilterMappingOuterScope, capabilitiesByConnectionId?: ReadonlyMap<string, Pick<SemaphorConnectionCapabilities, 'prefixLevels'>>, options?: {
62
+ includeDocumentSections?: boolean;
63
+ }): DashboardFilterMappingSourceRequest[];
62
64
  /**
63
65
  * Builds the label lookup from live column metadata. A field label is
64
66
  * recorded only when it differs from the column name. Semantic columns also
@@ -99,6 +101,7 @@ export declare function toMappingDisplayField(labels: DashboardFilterMappingFiel
99
101
  export declare function buildDashboardFilterMappingCandidateCatalogs(params: {
100
102
  dashboard: Pick<TDashboard, 'sheets'>;
101
103
  outerScope?: DashboardFilterMappingOuterScope;
104
+ includeDocumentSections?: boolean;
102
105
  metadataBySourceKey: ReadonlyMap<string, DashboardFilterMappingSourceMetadata>;
103
106
  }): Record<string, DashboardFilterMappingCandidateCatalog | undefined>;
104
107
  export {};
@@ -0,0 +1,10 @@
1
+ import { DashboardInputBase } from '../types/common-types.js';
2
+ import { DashboardInputRuntimeTarget } from './dashboard-input-values.js';
3
+ export type ScopedDashboardInputTarget = DashboardInputRuntimeTarget & {
4
+ sheetKind?: 'dashboard' | 'document';
5
+ };
6
+ /**
7
+ * The one interpreter of `DashboardInputScope`. Filters, controls, and
8
+ * click-to-filter targets all decide "does this reach that card" here.
9
+ */
10
+ export declare function doesDashboardInputApplyToTarget(input: Pick<DashboardInputBase, 'scope' | 'compatibility'>, target: ScopedDashboardInputTarget): boolean;
@@ -1,6 +1,7 @@
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
3
  import { DashboardInputRuntimeValues } from './resolve-dashboard-input-context.js';
4
+ import { TransientInputContext } from './transient-input-context.js';
4
5
  /**
5
6
  * Converts replacement snapshot semantics into self-describing slots at the
6
7
  * ingestion seam. Consumers can then resolve every slot with one precedence
@@ -20,6 +21,12 @@ export type BuildDashboardInputExecutionSnapshotParams = {
20
21
  sheetKind?: 'dashboard' | 'document';
21
22
  mode: DashboardInputExecutionSnapshot['mode'];
22
23
  runtimeValues: DashboardInputRuntimeValues;
24
+ /**
25
+ * The carried contexts in effect on the dashboard being captured. Required
26
+ * so that every caller decides: an export of a dashboard a viewer drilled
27
+ * through to has to replay what was carried there.
28
+ */
29
+ transientContexts: readonly TransientInputContext[] | undefined;
23
30
  generatedAt?: string;
24
31
  timezone?: string;
25
32
  };
@@ -45,7 +52,7 @@ export type BuildDashboardSheetsInputExecutionSnapshotParams = Omit<BuildDashboa
45
52
  sheetIds: string[];
46
53
  sheetKind?: 'dashboard' | 'document';
47
54
  };
48
- export declare function buildDashboardInputExecutionSnapshot({ dashboard, sheetId, card, sectionId, sheetKind, mode, runtimeValues, generatedAt, timezone, }: BuildDashboardInputExecutionSnapshotParams): BuildDashboardInputExecutionSnapshotResult;
55
+ export declare function buildDashboardInputExecutionSnapshot({ dashboard, sheetId, card, sectionId, sheetKind, mode, runtimeValues, transientContexts, generatedAt, timezone, }: BuildDashboardInputExecutionSnapshotParams): BuildDashboardInputExecutionSnapshotResult;
49
56
  export declare function getDocumentDashboardInputMissingRequiredLabels({ sectionIds, ...params }: BuildDocumentDashboardInputExecutionSnapshotParams): string[];
50
57
  export declare function buildDashboardSheetsInputExecutionSnapshot({ sheetIds, sheetKind, ...params }: BuildDashboardSheetsInputExecutionSnapshotParams): BuildDashboardInputExecutionSnapshotResult;
51
58
  export declare function buildDocumentDashboardInputExecutionSnapshot({ sectionIds, ...params }: BuildDocumentDashboardInputExecutionSnapshotParams): BuildDashboardInputExecutionSnapshotResult;
@@ -9,3 +9,4 @@ export * from './dashboard-input-text.js';
9
9
  export * from './dashboard-input-values.js';
10
10
  export * from './document-input-prototype-normalizer.js';
11
11
  export * from './resolve-dashboard-input-context.js';
12
+ export * from './transient-input-context.js';
@@ -1,6 +1,10 @@
1
+ import { CardViewStateMap } from '../dashboard-view-state/index.js';
1
2
  import { TFilterValue } from '../../components/surfboard/filter/types.js';
2
- import { DashboardInputBase, DashboardInputValues, NormalizedDashboardInput, ResolvedDashboardInput, ResolvedDashboardInputContext, TCard, TDashboard } from '../types/common-types.js';
3
+ import { DashboardInputValues, NormalizedDashboardInput, ResolvedDashboardInput, ResolvedDashboardInputContext, TCard, TDashboard } from '../types/common-types.js';
3
4
  import { DashboardInputRuntimeTarget } from './dashboard-input-values.js';
5
+ import { doesDashboardInputApplyToTarget } from './dashboard-input-scope.js';
6
+ import { TransientInputContext } from './transient-input-context.js';
7
+ export { doesDashboardInputApplyToTarget };
4
8
  export type DashboardInputResolveMode = 'interactive' | 'editor' | 'print' | 'schedule' | 'export';
5
9
  export type DashboardInputRuntimeValues = {
6
10
  dashboardInputValues?: DashboardInputValues;
@@ -8,6 +12,11 @@ export type DashboardInputRuntimeValues = {
8
12
  controlValues?: Record<string, unknown>;
9
13
  inlineFilterValuesMap?: Record<string, TFilterValue[] | undefined>;
10
14
  cardControlValuesMap?: Record<string, Record<string, unknown>>;
15
+ /**
16
+ * Drill paths by card. Input resolution never reads them; an execution
17
+ * snapshot built from these runtime values carries them.
18
+ */
19
+ cardViewState?: CardViewStateMap;
11
20
  };
12
21
  export type ResolveDashboardInputContextInput = {
13
22
  dashboard: TDashboard;
@@ -16,20 +25,23 @@ export type ResolveDashboardInputContextInput = {
16
25
  sectionId?: string | null;
17
26
  sheetKind?: 'dashboard' | 'document';
18
27
  runtimeValues: DashboardInputRuntimeValues;
28
+ /**
29
+ * State carried into this dashboard by a drill-through, or into an insight:
30
+ * definitions and values together, resolved like authored inputs. Required
31
+ * so that every caller decides; a caller that leaves carried state out
32
+ * would show or query the destination without what the viewer drilled on.
33
+ */
34
+ transientContexts: readonly TransientInputContext[] | undefined;
19
35
  mode?: DashboardInputResolveMode;
20
36
  timezone?: string;
21
37
  };
22
- type ScopedDashboardInputTarget = DashboardInputRuntimeTarget & {
23
- sheetKind?: 'dashboard' | 'document';
24
- };
25
- export declare function resolveDashboardInputContext({ dashboard, sheetId, card, sectionId, sheetKind, runtimeValues, mode, timezone, }: ResolveDashboardInputContextInput): ResolvedDashboardInputContext;
38
+ export declare function resolveDashboardInputContext({ dashboard, sheetId, card, sectionId, sheetKind, runtimeValues: authoredRuntimeValues, transientContexts, mode, timezone, }: ResolveDashboardInputContextInput): ResolvedDashboardInputContext;
26
39
  /**
27
40
  * The Global Date rule: exactly one Global Date input may exist. Returns every
28
41
  * Global Date input after the first, in order. The strict resolver fails on
29
42
  * any conflict; the tolerant option context excludes the conflicts.
30
43
  */
31
44
  export declare function findGlobalDateInputConflicts(inputs: NormalizedDashboardInput[]): NormalizedDashboardInput[];
32
- export declare function doesDashboardInputApplyToTarget(input: Pick<DashboardInputBase, 'scope' | 'compatibility'>, target: ScopedDashboardInputTarget): boolean;
33
45
  export declare function removeShadowedCompatibilityInputs(inputs: NormalizedDashboardInput[]): NormalizedDashboardInput[];
34
46
  export declare function resolveDashboardInput(params: {
35
47
  dashboard: TDashboard;
@@ -54,4 +66,3 @@ export declare function findScopedAuthoredAliasConflicts(inputs: NormalizedDashb
54
66
  input: NormalizedDashboardInput;
55
67
  previousInputId: string;
56
68
  }>;
57
- export {};