react-semaphor 0.1.507 → 0.1.509
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.
- package/DATA_APP_SDK.md +56 -0
- package/dist/analytics-protocol/index.cjs +1 -1
- package/dist/analytics-protocol/index.js +194 -172
- package/dist/appearance/index.cjs +1 -1
- package/dist/appearance/index.js +1 -1
- package/dist/appearance-runtime/index.cjs +1 -1
- package/dist/appearance-runtime/index.js +1 -1
- package/dist/brand-studio/index.cjs +2 -2
- package/dist/brand-studio/index.js +279 -250
- package/dist/briefings/index.cjs +1 -1
- package/dist/briefings/index.js +3 -3
- package/dist/chunks/appearance-context-DzqCdhB4.cjs +1 -0
- package/dist/chunks/{appearance-context-XviHOhWJ.js → appearance-context-VJdrKi7r.js} +2 -1
- package/dist/chunks/{appearance-runtime-provider-D0xVQWnH.js → appearance-runtime-provider-CC4HT2Gi.js} +2 -2
- package/dist/chunks/{appearance-runtime-provider-Ca8rxO86.cjs → appearance-runtime-provider-D5pkvgE4.cjs} +1 -1
- package/dist/chunks/calculated-field-identity-BiTGmnST.cjs +1 -0
- package/dist/chunks/calculated-field-identity-CJL54uFx.js +1373 -0
- package/dist/chunks/{constants-NUleP4DY.js → card-config-utils-Bq1enstT.js} +260 -260
- package/dist/chunks/card-config-utils-CMO4_zVs.cjs +1 -0
- package/dist/chunks/{dashboard-briefing-launcher-DXTpU85p.js → dashboard-briefing-launcher-B5AQu-Vb.js} +12 -12
- package/dist/chunks/{dashboard-briefing-launcher-C8nDSDnV.cjs → dashboard-briefing-launcher-BoXFrqq0.cjs} +1 -1
- package/dist/chunks/{dashboard-controls-CyL0yimg.js → dashboard-controls-CKKkSXEX.js} +16 -14
- package/dist/chunks/dashboard-controls-gUVkQm8o.cjs +52 -0
- package/dist/chunks/dashboard-json-B7fSi6_b.cjs +1 -0
- package/dist/chunks/{dashboard-json-5Jr3RudV.js → dashboard-json-CAJJquVx.js} +9 -9
- package/dist/chunks/edit-dashboard-visual-AZetLUv1.cjs +172 -0
- package/dist/chunks/{edit-dashboard-visual-C7X-um9g.js → edit-dashboard-visual-DCnbqRRn.js} +1986 -1990
- package/dist/chunks/{editor-action-buttons-CcDm8nA5.cjs → editor-action-buttons-CBQsVYdt.cjs} +2 -2
- package/dist/chunks/{editor-action-buttons-C5Wja_J4.js → editor-action-buttons-DDA5JGwO.js} +6 -6
- package/dist/chunks/field-aggregations-DUb0NU6c.js +1229 -0
- package/dist/chunks/field-aggregations-jSi77h9Z.cjs +1 -0
- package/dist/chunks/{field-dependencies-DVl2p1Nm.js → field-dependencies-Cl97kkHy.js} +30 -34
- package/dist/chunks/{field-dependencies-r_U0CGQ-.cjs → field-dependencies-DIab72rQ.cjs} +1 -1
- package/dist/chunks/{index-BVr4fcCB.js → index-0pdaQ9e1.js} +5 -5
- package/dist/chunks/{index-De2QNsqV.js → index-CL2lvhwk.js} +47783 -46019
- package/dist/chunks/{index-C9KXfCkC.js → index-CLIro-EG.js} +3 -0
- package/dist/chunks/index-Cx3qmRUB.cjs +1 -0
- package/dist/chunks/{index-BlYf8gNa.cjs → index-DhlVxvyI.cjs} +1 -1
- package/dist/chunks/index-DkEAikW8.cjs +1420 -0
- package/dist/chunks/{matrix-card-DACDwdTq.js → matrix-card-CnKQpnsj.js} +1 -1
- package/dist/chunks/{matrix-card-CRXcmAjp.cjs → matrix-card-U4c72doZ.cjs} +1 -1
- package/dist/chunks/{matrix-control-sources-ClQzIk7E.js → matrix-control-sources-CRRdP03Q.js} +165 -134
- package/dist/chunks/matrix-control-sources-FjxGIbqk.cjs +1 -0
- package/dist/chunks/{matrix-formatter-7GLTcBuy.cjs → matrix-formatter-CveLJo6S.cjs} +1 -1
- package/dist/chunks/{matrix-formatter-xsq7n_e6.js → matrix-formatter-ZVS5QOuq.js} +2 -2
- package/dist/chunks/matrix-member-presentation-CFHjdrxT.cjs +1 -0
- package/dist/chunks/matrix-member-presentation-CzGZJd3a.js +182 -0
- package/dist/chunks/matrix-operation-contract-DoiWTUbT.cjs +1 -0
- package/dist/chunks/matrix-operation-contract-xL8IhFzp.js +1802 -0
- package/dist/chunks/{pivot-header-presentation-3wqWChFd.cjs → pivot-header-presentation-Cxz8-06f.cjs} +1 -1
- package/dist/chunks/{pivot-header-presentation-D44ODZGn.js → pivot-header-presentation-DVylCBHB.js} +2 -2
- package/dist/chunks/{pivot-result-lifecycle-DZ0ZSMoM.cjs → pivot-result-lifecycle-BiERyXnS.cjs} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-BSmqVkVG.js → pivot-result-lifecycle-CmjpW7qG.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-xADifRXs.js → report-preferences-dialog-Bv2VIOKc.js} +4 -4
- package/dist/chunks/report-preferences-dialog-Wg9g9fIj.cjs +1 -0
- package/dist/chunks/{search-BHsQIWBV.js → selection-reducer-B94WgZ9V.js} +55 -11
- package/dist/chunks/selection-reducer-CGKKsaPa.cjs +26 -0
- package/dist/chunks/{semantic-format-BhIL1PXP.cjs → semantic-format-BzH69TRq.cjs} +1 -1
- package/dist/chunks/{semantic-format-C3amkGmY.js → semantic-format-CBlRO8Aw.js} +1 -1
- package/dist/chunks/{switch-DHGiC0aU.js → switch-CD4uGTZI.js} +7450 -7694
- package/dist/chunks/switch-iC1x2dcE.cjs +134 -0
- package/dist/chunks/token-types-Ahh5u4iT.cjs +1 -0
- package/dist/chunks/token-types-CPde8_LG.js +8 -0
- package/dist/chunks/{update-policy-Cc9h57pA.cjs → update-policy-COjFudhl.cjs} +1 -1
- package/dist/chunks/{update-policy-eTcz52jO.js → update-policy-D9q1Tz8k.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +3 -3
- package/dist/dashboard-authoring/index.js +734 -622
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +3 -3
- package/dist/data-app-codegen/index.cjs +1 -1
- package/dist/data-app-codegen/index.js +2 -2
- package/dist/data-app-codegen-node/index.cjs +94 -92
- package/dist/data-app-codegen-node/index.js +337 -333
- package/dist/data-app-sdk/index.cjs +9 -9
- package/dist/data-app-sdk/index.js +1091 -969
- package/dist/data-app-sdk-adapters/index.cjs +1 -1
- package/dist/data-app-sdk-adapters/index.js +104 -96
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +2 -2
- package/dist/format-utils/index.cjs +1 -1
- package/dist/format-utils/index.js +8 -8
- package/dist/index.cjs +1 -1
- package/dist/index.js +15 -15
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/brand-studio/brand-studio-draft.d.ts +3 -1
- package/dist/types/components/dashboard/card-selection-pill.d.ts +5 -0
- package/dist/types/components/dashboard/dashboard-container.d.ts +1 -1
- package/dist/types/components/dashboard/drill-breadcrumb.d.ts +1 -0
- package/dist/types/components/dashboard/drill-navigation-controls.d.ts +3 -3
- package/dist/types/components/interactions/applied-filters-display.d.ts +6 -1
- package/dist/types/components/interactions/click-to-filter-review-dialog.d.ts +21 -0
- package/dist/types/components/interactions/dashboard-drill-host.d.ts +13 -0
- package/dist/types/components/interactions/filter-badge-tooltip.d.ts +4 -4
- package/dist/types/components/interactions/insight-modal.d.ts +4 -14
- package/dist/types/components/interactions/insight-viewer.d.ts +7 -19
- package/dist/types/components/interactions/interactions-sheet.d.ts +6 -0
- package/dist/types/components/interactions/panels/click-to-filter-panel.d.ts +20 -0
- package/dist/types/components/interactions/reusable/interaction-selection-popover.d.ts +2 -2
- package/dist/types/components/interactions/sheet/action-editor.d.ts +17 -0
- package/dist/types/components/interactions/sheet/action-meta.d.ts +45 -0
- package/dist/types/components/interactions/sheet/action-picker.d.ts +7 -0
- package/dist/types/components/interactions/sheet/click-outcome-preview.d.ts +10 -0
- package/dist/types/components/interactions/sheet/interactions-home.d.ts +28 -0
- package/dist/types/components/interactions/sheet/sheet-parts.d.ts +37 -0
- package/dist/types/components/surfboard/filter/dashboard-filter-mapping-panel.d.ts +28 -1
- package/dist/types/components/surfboard/filter/selection-chip.d.ts +11 -0
- package/dist/types/components/surfboard/filter/selection-filter-section.d.ts +4 -0
- package/dist/types/components/surfboard/filter/use-dashboard-filter-mapping-popover.d.ts +3 -0
- package/dist/types/components/ui/resizable.d.ts +1 -1
- package/dist/types/components/visual/matrix-table/matrix-interaction-actions.d.ts +24 -3
- package/dist/types/components/visual/matrix-table/matrix-selection-click.d.ts +6 -0
- package/dist/types/components/visual/matrix-table/matrix-window-viewer.d.ts +1 -1
- package/dist/types/data-app-sdk/adapters.d.ts +3 -2
- package/dist/types/data-app-sdk/builders.d.ts +2 -1
- package/dist/types/data-app-sdk/contracts.d.ts +44 -2
- package/dist/types/data-app-sdk/index.d.ts +1 -0
- package/dist/types/data-app-sdk/query-request.d.ts +7 -2
- package/dist/types/data-app-sdk/selection.d.ts +2 -0
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +24 -23
- package/dist/types/lib/appearance/types.d.ts +3 -1
- package/dist/types/lib/briefings/briefing-attachment-model.d.ts +0 -2
- package/dist/types/lib/contexts/interactions-popover-context.d.ts +1 -8
- package/dist/types/lib/dashboard/click-to-filter-card-references.d.ts +23 -0
- package/dist/types/lib/dashboard-inputs/build-normalized-dashboard-inputs.d.ts +16 -2
- package/dist/types/lib/dashboard-inputs/build-selection-dashboard-inputs.d.ts +31 -0
- package/dist/types/lib/dashboard-inputs/click-to-filter-emitted-fields.d.ts +17 -0
- package/dist/types/lib/dashboard-inputs/click-to-filter-mapping-draft.d.ts +99 -0
- package/dist/types/lib/dashboard-inputs/click-to-filter-sheet-reach.d.ts +12 -0
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +18 -1
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-candidate-metadata.d.ts +4 -1
- package/dist/types/lib/dashboard-inputs/dashboard-input-scope.d.ts +10 -0
- package/dist/types/lib/dashboard-inputs/dashboard-input-snapshot.d.ts +8 -1
- package/dist/types/lib/dashboard-inputs/index.d.ts +1 -0
- package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +18 -7
- package/dist/types/lib/dashboard-inputs/resolve-field-date-comparison-coverage.d.ts +5 -2
- package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +77 -0
- package/dist/types/lib/dashboard-inputs/selection-targets.d.ts +26 -0
- package/dist/types/lib/dashboard-inputs/transient-input-context.d.ts +102 -0
- package/dist/types/lib/dashboard-navigation/build-carried-click-context.d.ts +50 -0
- package/dist/types/lib/dashboard-navigation/describe-carried-context.d.ts +11 -0
- package/dist/types/lib/dashboard-navigation/index.d.ts +1 -0
- package/dist/types/lib/dashboard-navigation/navigation-state.d.ts +120 -0
- package/dist/types/lib/dashboard-navigation/run-one-off-drill.d.ts +11 -0
- package/dist/types/lib/dashboard-navigation/use-transient-contexts.d.ts +17 -0
- package/dist/types/lib/dashboard-view-state/card-view-state.d.ts +48 -0
- package/dist/types/lib/dashboard-view-state/drill-path.d.ts +20 -0
- package/dist/types/lib/dashboard-view-state/index.d.ts +2 -0
- package/dist/types/lib/download-pdf.d.ts +0 -3
- package/dist/types/lib/formatters/metric-formatting.d.ts +1 -1
- package/dist/types/lib/hooks/ai/dashboard-context.d.ts +15 -8
- package/dist/types/lib/hooks/chartjs/use-chart-blur.d.ts +10 -2
- package/dist/types/lib/hooks/interactions/{use-event-engine.d.ts → use-drill-actions.d.ts} +28 -7
- package/dist/types/lib/hooks/selection/use-active-selections.d.ts +15 -0
- package/dist/types/lib/hooks/selection/use-click-to-filter-mapping-draft.d.ts +20 -0
- package/dist/types/lib/hooks/selection/use-selection-click.d.ts +34 -0
- package/dist/types/lib/hooks/selection/use-selection-gestures.d.ts +38 -0
- package/dist/types/lib/hooks/selection/use-table-row-selection.d.ts +46 -0
- package/dist/types/lib/hooks/use-dashboard-card.d.ts +0 -2
- package/dist/types/lib/hooks/use-dashboard-filter-mapping-candidates.d.ts +18 -0
- package/dist/types/lib/hooks/use-dashboard-frame-query.d.ts +0 -1
- package/dist/types/lib/hooks/use-dashboard.d.ts +1 -3
- package/dist/types/lib/hooks/use-interactions-popover.d.ts +1 -8
- package/dist/types/lib/hooks/use-resolved-card-config.d.ts +6 -0
- package/dist/types/lib/interactions/click-outcome.d.ts +25 -0
- package/dist/types/lib/interactions/get-click-context-from-chartjs.d.ts +3 -1
- package/dist/types/lib/interactions/get-click-context-from-matrix.d.ts +1 -1
- package/dist/types/lib/interactions/get-click-context-from-table.d.ts +7 -0
- package/dist/types/lib/interactions/interaction-utils.d.ts +17 -1
- package/dist/types/lib/matrix-table/build-matrix-drill-to-detail.d.ts +15 -0
- package/dist/types/lib/matrix-table/matrix-card-interactions.d.ts +14 -3
- package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +0 -3
- package/dist/types/lib/matrix-table/matrix-runtime.d.ts +0 -4
- package/dist/types/lib/matrix-table/{use-matrix-selection.d.ts → use-matrix-cell-focus.d.ts} +13 -17
- package/dist/types/lib/matrix-table/use-matrix.d.ts +0 -1
- package/dist/types/lib/query-context/build-card-query-context.d.ts +19 -8
- package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +5 -3
- package/dist/types/lib/query-context/build-dashboard-frame-base-query-contexts.d.ts +12 -4
- package/dist/types/lib/query-context/compile-selection-filters.d.ts +5 -0
- package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +46 -0
- package/dist/types/lib/query-context/filter-group-utils.d.ts +3 -0
- package/dist/types/lib/query-context/resolve-runtime-card-filters.d.ts +29 -0
- package/dist/types/lib/selection/click-to-filter-authoring-support.d.ts +9 -0
- package/dist/types/lib/selection/selection-from-click-context.d.ts +41 -0
- package/dist/types/lib/selection/selection-labels.d.ts +3 -0
- package/dist/types/lib/selection/selection-notices.d.ts +9 -0
- package/dist/types/lib/selection/selection-reducer.d.ts +46 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +62 -17
- package/dist/types/lib/stores/editor-store.d.ts +1 -2
- package/dist/types/lib/stores/index.d.ts +0 -2
- package/dist/types/lib/types/common-types.d.ts +60 -6
- package/dist/types/lib/types/explorer-types.d.ts +1 -22
- package/dist/types/lib/types/interaction-types.d.ts +6 -198
- package/dist/types/lib/utils/calculate-context-aware-filters.d.ts +21 -12
- package/dist/types/lib/utils/card-utils.d.ts +11 -0
- package/dist/types/lib/utils/date-hierarchy-utils.d.ts +3 -1
- package/dist/types/lib/utils/drag-and-drop-utils.d.ts +1 -1
- package/dist/types/lib/utils/interaction-icons.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/execution-input-schemas.d.ts +32 -32
- package/dist/types/shared/analytics-protocol/index.d.ts +2 -0
- package/dist/types/shared/analytics-protocol/selection-contract.d.ts +100 -0
- package/dist/types/shared/analytics-protocol/selection-filter-compiler.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/apply-group-by-override.d.ts +19 -0
- package/dist/types/shared/dashboard-authoring/click-to-filter-settings.d.ts +88 -0
- package/dist/types/shared/dashboard-authoring/contracts.d.ts +8 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +3 -0
- package/dist/types/shared/dashboard-authoring/linked-click-to-filter-overrides.d.ts +32 -0
- package/dist/types/shared/format-utils/matrix-continuation.d.ts +3 -3
- package/package.json +1 -1
- package/src/data-app-sdk/README.md +58 -1
- package/dist/chunks/appearance-context-tNjvTJj3.cjs +0 -1
- package/dist/chunks/calculated-field-identity-BTpUqfEu.js +0 -1276
- package/dist/chunks/calculated-field-identity-rMuXuzEY.cjs +0 -1
- package/dist/chunks/constants-vtu7_IUo.cjs +0 -1
- package/dist/chunks/dashboard-controls-DlxeddZN.cjs +0 -52
- package/dist/chunks/dashboard-json-DhS4yJfc.cjs +0 -1
- package/dist/chunks/edit-dashboard-visual-X3OCnivL.cjs +0 -172
- package/dist/chunks/field-aggregations-BU_3gHKR.js +0 -957
- package/dist/chunks/field-aggregations-CDCamEsQ.cjs +0 -1
- package/dist/chunks/index-C8XCKzB6.cjs +0 -1
- package/dist/chunks/index-DSa6RSdg.cjs +0 -1417
- package/dist/chunks/matrix-control-sources-CeC5EMyq.cjs +0 -1
- package/dist/chunks/matrix-member-presentation-E2B4k3ws.cjs +0 -1
- package/dist/chunks/matrix-member-presentation-qiHxv67e.js +0 -105
- package/dist/chunks/matrix-operation-contract-Cqy4EW2H.js +0 -1638
- package/dist/chunks/matrix-operation-contract-D9dLX-Wr.cjs +0 -1
- package/dist/chunks/report-preferences-dialog-7Vsc_fsG.cjs +0 -1
- package/dist/chunks/search-BqqhaMx9.cjs +0 -26
- package/dist/chunks/switch-BytP6QY8.cjs +0 -139
- package/dist/types/components/interactions/configuration-popover.d.ts +0 -1
- package/dist/types/components/interactions/interaction-card.d.ts +0 -59
- package/dist/types/components/interactions/interaction-event-handler.d.ts +0 -11
- package/dist/types/components/interactions/interactions-list.d.ts +0 -50
- package/dist/types/components/interactions/panels/cross-filter-panel.d.ts +0 -24
- package/dist/types/components/interactions/panels/inline-drill-panel.d.ts +0 -24
- package/dist/types/components/interactions/selectors/action-selector.d.ts +0 -31
- package/dist/types/components/interactions/selectors/trigger-selector.d.ts +0 -38
- package/dist/types/components/surfboard/filter/click-filter-section.d.ts +0 -5
- package/dist/types/lib/interactions/build-interaction-event.d.ts +0 -25
- package/dist/types/lib/interactions/convert-click-filters-to-filter-group.d.ts +0 -10
- package/dist/types/lib/interactions/execute-interaction-event.d.ts +0 -80
- package/dist/types/lib/interactions/field-utils.d.ts +0 -11
- package/dist/types/lib/interactions/handle-chart-click.d.ts +0 -75
- package/dist/types/lib/interactions/linked-interaction-utils.d.ts +0 -14
- package/dist/types/lib/interactions/source-card-filter-utils.d.ts +0 -9
- package/dist/types/lib/matrix-table/matrix-clipboard.d.ts +0 -45
- package/dist/types/lib/matrix-table/matrix-selection.d.ts +0 -20
- package/dist/types/lib/stores/drill-actions.d.ts +0 -139
- package/dist/types/lib/stores/interaction-store.d.ts +0 -113
- package/dist/types/lib/stores/pointer-interaction-store.d.ts +0 -18
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { CardViewStateMap } from '../dashboard-view-state/index.js';
|
|
1
2
|
import { DashboardInput, TDashboard } from '../types/common-types.js';
|
|
2
3
|
import { SemanticExecutionPayload } from '../types/semantic-runtime-types.js';
|
|
3
|
-
import { InteractionStateMap } from '../query-context/build-card-query-context.js';
|
|
4
4
|
import { FieldDateComparisonCoverage } from './dashboard-date-comparison-plan.js';
|
|
5
5
|
import { ResolveDashboardInputContextInput } from './resolve-dashboard-input-context.js';
|
|
6
6
|
import { DashboardInputRuntimeTarget } from './dashboard-input-values.js';
|
|
@@ -11,7 +11,10 @@ export declare function resolveDashboardFieldDateComparisonCoverage(params: {
|
|
|
11
11
|
}>;
|
|
12
12
|
dashboardInputTarget: DashboardInputRuntimeTarget;
|
|
13
13
|
runtimeValues: ResolveDashboardInputContextInput['runtimeValues'];
|
|
14
|
-
|
|
14
|
+
/** Carried contexts in effect on this dashboard; see `buildCardQueryContext`. */
|
|
15
|
+
transientContexts: ResolveDashboardInputContextInput['transientContexts'];
|
|
16
|
+
/** Drill paths by card: a drilled card groups by another field. */
|
|
17
|
+
cardViewStates: CardViewStateMap | undefined;
|
|
15
18
|
semanticExecutionPayload?: SemanticExecutionPayload;
|
|
16
19
|
timezone?: string;
|
|
17
20
|
}): FieldDateComparisonCoverage;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { SelectionField, SelectionInputValue } from '../../shared/analytics-protocol/selection-contract.js';
|
|
2
|
+
import { DashboardFilterTarget } from '../../shared/dashboard-authoring/index.js';
|
|
3
|
+
import { ScopedDashboardInputTarget } from './dashboard-input-scope.js';
|
|
4
|
+
import { NormalizedFilterDashboardInput, SelectionDashboardInput, TCard } from '../types/common-types.js';
|
|
5
|
+
import { FilterCondition } from '../types/explorer-types.js';
|
|
6
|
+
export type SelectionSkipReason =
|
|
7
|
+
/** A card never filters itself. */
|
|
8
|
+
'sourceCard'
|
|
9
|
+
/** card.respondsToSelections === false */
|
|
10
|
+
| 'receiverOptedOut'
|
|
11
|
+
/** settings.targets does not include the card */
|
|
12
|
+
| 'outsideTargets'
|
|
13
|
+
/** An 'excluded' card mapping */
|
|
14
|
+
| 'excludedCard'
|
|
15
|
+
/** No automatic, bound, or borrowed target */
|
|
16
|
+
| 'notApplicable';
|
|
17
|
+
export type SelectionBlockReason = 'ambiguousAutomaticTarget' | 'staleBinding' | 'incompatibleValueType';
|
|
18
|
+
/** What one clicked field does on one target card. */
|
|
19
|
+
export type SelectionConditionDisposition = {
|
|
20
|
+
status: 'apply';
|
|
21
|
+
clickedFieldKey: string;
|
|
22
|
+
target: DashboardFilterTarget;
|
|
23
|
+
provenance: 'automatic' | 'bound' | 'borrowedFromFilter';
|
|
24
|
+
/** Set when provenance is 'borrowedFromFilter'. */
|
|
25
|
+
borrowedFromInputId?: string;
|
|
26
|
+
} | {
|
|
27
|
+
status: 'skip';
|
|
28
|
+
clickedFieldKey: string;
|
|
29
|
+
reason: SelectionSkipReason;
|
|
30
|
+
} | {
|
|
31
|
+
status: 'block';
|
|
32
|
+
clickedFieldKey: string;
|
|
33
|
+
reason: SelectionBlockReason;
|
|
34
|
+
};
|
|
35
|
+
export type ResolvedCardSelection = {
|
|
36
|
+
inputId: string;
|
|
37
|
+
sourceCardId: string;
|
|
38
|
+
/** Tuples projected to the conditions this card can apply, on the target's own fields. Empty tuples removed. */
|
|
39
|
+
tuples: Array<{
|
|
40
|
+
conditions: FilterCondition[];
|
|
41
|
+
}>;
|
|
42
|
+
/** One per distinct clicked field in the value, in first-seen order. */
|
|
43
|
+
dispositions: SelectionConditionDisposition[];
|
|
44
|
+
/** 'apply' when at least one tuple survived projection. */
|
|
45
|
+
status: 'apply' | 'skip';
|
|
46
|
+
};
|
|
47
|
+
/** Where the target card sits. `cardId` always comes from the card itself. */
|
|
48
|
+
export type SelectionTargetLocation = Omit<ScopedDashboardInputTarget, 'cardId'>;
|
|
49
|
+
/**
|
|
50
|
+
* The binding a toolbar filter already accepted for the clicked field on this
|
|
51
|
+
* card. Runtime and authoring both read it here, so "Same as the Region
|
|
52
|
+
* filter" in the review dialog is exactly what a click will borrow.
|
|
53
|
+
*/
|
|
54
|
+
export declare function findBorrowedSelectionBinding(params: {
|
|
55
|
+
cardId: string;
|
|
56
|
+
clicked: SelectionField;
|
|
57
|
+
filterInputs: NormalizedFilterDashboardInput[];
|
|
58
|
+
}): {
|
|
59
|
+
inputId: string;
|
|
60
|
+
target: DashboardFilterTarget;
|
|
61
|
+
} | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Decides what one source card's selection does on one target card. A viewer's
|
|
64
|
+
* click must never take a card down: a blocked condition is dropped exactly
|
|
65
|
+
* like a skipped one, and its disposition is kept so authoring can show why.
|
|
66
|
+
* Tuple shape is preserved, so two rows stay (A AND B) OR (C AND D).
|
|
67
|
+
*/
|
|
68
|
+
export declare function resolveSelectionInputForCard(params: {
|
|
69
|
+
/** The target card. */
|
|
70
|
+
card: TCard;
|
|
71
|
+
/** Sheet, sheet kind, and document section of the target card, as the input context already knows them. */
|
|
72
|
+
target?: SelectionTargetLocation;
|
|
73
|
+
input: SelectionDashboardInput;
|
|
74
|
+
value: SelectionInputValue;
|
|
75
|
+
/** Toolbar filters, for borrowed bindings. */
|
|
76
|
+
filterInputs: NormalizedFilterDashboardInput[];
|
|
77
|
+
}): ResolvedCardSelection;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DashboardInputValues, TDashboard } from '../types/common-types.js';
|
|
2
|
+
import { ActiveSelection } from './build-selection-dashboard-inputs.js';
|
|
3
|
+
import { ResolvedCardSelection } from './resolve-selection-input.js';
|
|
4
|
+
export type SelectionTargetResolution = {
|
|
5
|
+
cardId: string;
|
|
6
|
+
cardTitle: string;
|
|
7
|
+
resolution: ResolvedCardSelection;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* What one source card's selection does on every other card, each resolved
|
|
11
|
+
* where it sits. The same resolver the query path uses, so the count on the
|
|
12
|
+
* source card and the chip can never disagree with what actually refiltered.
|
|
13
|
+
*/
|
|
14
|
+
export declare function resolveSelectionTargets(params: {
|
|
15
|
+
dashboard: Pick<TDashboard, 'sheets' | 'inputs' | 'filters' | 'controls'>;
|
|
16
|
+
selection: Pick<ActiveSelection, 'input' | 'value'>;
|
|
17
|
+
}): SelectionTargetResolution[];
|
|
18
|
+
/** Target cards this selection currently narrows. */
|
|
19
|
+
export declare function countSelectionTargets(params: Parameters<typeof resolveSelectionTargets>[0]): number;
|
|
20
|
+
/** Active selections with the number of cards each one narrows. */
|
|
21
|
+
export declare function listActiveSelectionsWithTargets(params: {
|
|
22
|
+
dashboard: Pick<TDashboard, 'sheets' | 'inputs' | 'filters' | 'controls' | 'interactionDefaults'>;
|
|
23
|
+
dashboardInputValues: DashboardInputValues | undefined;
|
|
24
|
+
}): Array<ActiveSelection & {
|
|
25
|
+
targetCount: number;
|
|
26
|
+
}>;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { TFilterValue } from '../../components/surfboard/filter/types.js';
|
|
2
|
+
import { DashboardInputValues, NormalizedDashboardInput, ResolvedDashboardInputContext, SelectionDashboardInput } from '../types/common-types.js';
|
|
3
|
+
import { SelectionInputValue, SelectionTuple } from '../../shared/analytics-protocol/selection-contract.js';
|
|
4
|
+
/**
|
|
5
|
+
* Transient input context: state carried into a destination (another
|
|
6
|
+
* dashboard after a drill-through, or an insight) as definitions plus values
|
|
7
|
+
* together. The destination resolver enumerates definitions and then reads
|
|
8
|
+
* their slots, so a value with no definition is invisible, and the source card
|
|
9
|
+
* or source filter is normally absent from the destination. A carried
|
|
10
|
+
* definition is therefore self-contained and lives under one namespace.
|
|
11
|
+
*/
|
|
12
|
+
export type InteractionContextMode = 'interactionFilters' | 'full' | 'none';
|
|
13
|
+
export type TransientInputContext = {
|
|
14
|
+
/** 'navigation:<fromDashboardId>:<depth>' or 'insight:<sourceCardId>'. */
|
|
15
|
+
namespace: string;
|
|
16
|
+
contextMode: InteractionContextMode;
|
|
17
|
+
/** Carried toolbar filters. Self-contained; see `buildTransientInputContext`. */
|
|
18
|
+
definitions: NormalizedDashboardInput[];
|
|
19
|
+
/**
|
|
20
|
+
* The carried click. Selection inputs travel on their own typed list
|
|
21
|
+
* everywhere, so no consumer can read one as a filter or a control.
|
|
22
|
+
*/
|
|
23
|
+
selectionDefinitions: SelectionDashboardInput[];
|
|
24
|
+
/** Slots keyed by the namespaced definition ids, all under `shared`. */
|
|
25
|
+
values: DashboardInputValues;
|
|
26
|
+
};
|
|
27
|
+
/** Resolves a relative date preset to the window it means right now. */
|
|
28
|
+
export type ResolveRelativeDateWindow = (relativeMeta: unknown) => [string, string] | undefined;
|
|
29
|
+
export type BuildTransientInputContextParams = {
|
|
30
|
+
namespace: string;
|
|
31
|
+
contextMode: InteractionContextMode;
|
|
32
|
+
/** The clicked selection, already grounded on the source card. Ignored for 'none'. */
|
|
33
|
+
selection?: {
|
|
34
|
+
sourceCardId: string;
|
|
35
|
+
label?: string;
|
|
36
|
+
tuples: SelectionTuple[];
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* For 'full': the source dashboard's inputs and the context resolved for the
|
|
40
|
+
* clicked card at the moment of the click. Only inputs in that resolved
|
|
41
|
+
* context are carried, so a filter scoped away from the click never travels.
|
|
42
|
+
*/
|
|
43
|
+
sourceInputs?: {
|
|
44
|
+
inputs: NormalizedDashboardInput[];
|
|
45
|
+
resolved: Pick<ResolvedDashboardInputContext, 'resolvedInputs'>;
|
|
46
|
+
/**
|
|
47
|
+
* The Global Date predicate the clicked card actually executed, from the
|
|
48
|
+
* date-materialization owner (`buildMaterializedGlobalDateFilterValue`).
|
|
49
|
+
* It names that card's primary date field, which is the field identity a
|
|
50
|
+
* Global Date input does not have on its own.
|
|
51
|
+
*/
|
|
52
|
+
materializedGlobalDate?: TFilterValue;
|
|
53
|
+
};
|
|
54
|
+
/** Card ids on the destination, for pruning carried bindings. */
|
|
55
|
+
destinationCardIds: string[];
|
|
56
|
+
/**
|
|
57
|
+
* When given, a relative preset is resolved to its window at capture time.
|
|
58
|
+
* Without it the stored values are kept. Either way the carried value holds
|
|
59
|
+
* no relative meta, so nothing re-expands it later.
|
|
60
|
+
*/
|
|
61
|
+
resolveRelativeDateWindow?: ResolveRelativeDateWindow;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Builds the context a destination resolves. Rules, applied to every carried
|
|
65
|
+
* definition in this order:
|
|
66
|
+
*
|
|
67
|
+
* 1. Materialize the effective value: only an input the source resolved to a
|
|
68
|
+
* usable filter value is carried, as a `set` slot. A cleared, default-less
|
|
69
|
+
* or invalid input does not travel.
|
|
70
|
+
* 2. Materialize the effective field identity from the anchored value.
|
|
71
|
+
* 3. Strip browsing and source-only metadata (option source, dependencies,
|
|
72
|
+
* population, compatibility, filter reference, force and required flags).
|
|
73
|
+
* 4. Rescope to the destination: namespaced id, all sheets, shared slot.
|
|
74
|
+
* 5. Namespace the alias.
|
|
75
|
+
* 6. Prune bindings to the destination's cards. Every carried filter keeps a
|
|
76
|
+
* mapping application, empty when nothing survives, so the destination
|
|
77
|
+
* resolves it per card: automatically on the same dataset, otherwise skip.
|
|
78
|
+
* 7. Never carry a Global Date input. Its executed predicate travels as an
|
|
79
|
+
* ordinary field filter with the same operator, values and precision.
|
|
80
|
+
*/
|
|
81
|
+
export declare function buildTransientInputContext(params: BuildTransientInputContextParams): TransientInputContext;
|
|
82
|
+
/** The carried selections of a set of contexts, with the value each one holds. */
|
|
83
|
+
export declare function listTransientSelections(transientContexts: readonly TransientInputContext[] | undefined): Array<{
|
|
84
|
+
input: SelectionDashboardInput;
|
|
85
|
+
value: SelectionInputValue;
|
|
86
|
+
}>;
|
|
87
|
+
/**
|
|
88
|
+
* The context mode that governs a resolution: whether the dashboard's own
|
|
89
|
+
* toolbar filters apply next to what was carried. A resolution has at most one
|
|
90
|
+
* governing context (the top navigation entry's, or an insight's runtime), so
|
|
91
|
+
* the first one decides. Undefined outside a drill: everything applies.
|
|
92
|
+
*/
|
|
93
|
+
export declare function resolveTransientContextMode(transientContexts: readonly TransientInputContext[] | undefined): InteractionContextMode | undefined;
|
|
94
|
+
/** True when a context carries a definition the resolver has to enumerate. */
|
|
95
|
+
export declare function hasCarriedTransientDefinitions(transientContexts: readonly TransientInputContext[] | undefined): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Reads carried contexts that crossed a URL or JSON boundary (a print or embed
|
|
98
|
+
* snapshot). A malformed context is dropped, never thrown on; a carried
|
|
99
|
+
* selection is validated again where it is read (`listTransientSelections`).
|
|
100
|
+
* Returns undefined when nothing usable is left.
|
|
101
|
+
*/
|
|
102
|
+
export declare function parseTransientInputContexts(value: unknown): TransientInputContext[] | undefined;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { DashboardInputRuntimeValues } from '../dashboard-inputs/resolve-dashboard-input-context.js';
|
|
2
|
+
import { InteractionContextMode, ResolveRelativeDateWindow, TransientInputContext } from '../dashboard-inputs/transient-input-context.js';
|
|
3
|
+
import { CardViewState } from '../dashboard-view-state/index.js';
|
|
4
|
+
import { TCard, TDashboard } from '../types/common-types.js';
|
|
5
|
+
import { ClickFilterCondition } from '../types/interaction-types.js';
|
|
6
|
+
import { SemanticExecutionPayload } from '../types/semantic-runtime-types.js';
|
|
7
|
+
import { CalendarContext } from '../../shared/report-runtime-context/index.js';
|
|
8
|
+
import { DashboardNavigationTrigger } from './navigation-state.js';
|
|
9
|
+
/**
|
|
10
|
+
* What a drill carries away from a click, built at the moment of the click
|
|
11
|
+
* from the state the clicked card was executing under. The one caller-side
|
|
12
|
+
* owner of that capture: drill-through and drill to insight both use it, so
|
|
13
|
+
* the context-mode table is implemented once.
|
|
14
|
+
*/
|
|
15
|
+
export type BuildCarriedClickContextParams = {
|
|
16
|
+
namespace: string;
|
|
17
|
+
contextMode: InteractionContextMode;
|
|
18
|
+
/** The clicked card, on the dashboard below. */
|
|
19
|
+
card: TCard;
|
|
20
|
+
/** Conditions the matched interaction keeps from the click. */
|
|
21
|
+
conditions: ClickFilterCondition[];
|
|
22
|
+
/** Shown by navigation and insight chrome. */
|
|
23
|
+
label?: string;
|
|
24
|
+
dashboard: TDashboard;
|
|
25
|
+
sheetId: string | null | undefined;
|
|
26
|
+
runtimeValues: DashboardInputRuntimeValues;
|
|
27
|
+
cardViewState: CardViewState | undefined;
|
|
28
|
+
/** The carried contexts the clicked card itself resolves under. */
|
|
29
|
+
sourceTransientContexts: readonly TransientInputContext[] | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Under `full`, whether the source dashboard's own toolbar filters travel.
|
|
32
|
+
* A drill-through carries them to the other dashboard. An insight renders on
|
|
33
|
+
* this dashboard, where those filters keep applying live, so carrying a
|
|
34
|
+
* frozen copy would pin the insight to a value the viewer has since changed.
|
|
35
|
+
* What the source itself received always travels under `full`.
|
|
36
|
+
*/
|
|
37
|
+
carryOwnToolbarFilters: boolean;
|
|
38
|
+
/** Card ids on the destination, for pruning carried bindings. Empty when unknown. */
|
|
39
|
+
destinationCardIds: string[];
|
|
40
|
+
semanticExecutionPayload?: SemanticExecutionPayload;
|
|
41
|
+
calendarContext?: CalendarContext | null;
|
|
42
|
+
dashboardInputReferenceTime?: string;
|
|
43
|
+
resolveRelativeDateWindow?: ResolveRelativeDateWindow;
|
|
44
|
+
};
|
|
45
|
+
export type CarriedClickContext = {
|
|
46
|
+
/** Display-only: the click as the viewer made it, in every context mode. */
|
|
47
|
+
trigger: DashboardNavigationTrigger;
|
|
48
|
+
carried: TransientInputContext;
|
|
49
|
+
};
|
|
50
|
+
export declare function buildCarriedClickContext(params: BuildCarriedClickContextParams): CarriedClickContext;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TransientInputContext } from '../dashboard-inputs/transient-input-context.js';
|
|
2
|
+
import { SelectionTuple } from '../../shared/analytics-protocol/selection-contract.js';
|
|
3
|
+
/** One line of "what came along": a field and the value it was narrowed to. */
|
|
4
|
+
export type CarriedContextItem = {
|
|
5
|
+
fieldName: string;
|
|
6
|
+
value: string;
|
|
7
|
+
};
|
|
8
|
+
/** The click, as chrome shows it. Works for a display-only trigger too. */
|
|
9
|
+
export declare function describeSelectionTuples(tuples: readonly SelectionTuple[]): CarriedContextItem[];
|
|
10
|
+
/** Everything a carried context applies: the click, then the carried toolbar filters. */
|
|
11
|
+
export declare function describeCarriedContext(context: TransientInputContext): CarriedContextItem[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './navigation-state.js';
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { BuildTransientInputContextParams, TransientInputContext } from '../dashboard-inputs/transient-input-context.js';
|
|
2
|
+
/**
|
|
3
|
+
* Navigation and insight state: where a viewer drilled through to, what they
|
|
4
|
+
* carried there, and which insights are open on which cards. Session only,
|
|
5
|
+
* never persisted. The reducers here are pure; the dashboard store applies
|
|
6
|
+
* them, each as one transition, so the dashboard to show and the context that
|
|
7
|
+
* applies on it can never be observed out of step.
|
|
8
|
+
*/
|
|
9
|
+
/** The click shown by navigation chrome, independent of what executes on the destination. */
|
|
10
|
+
export type DashboardNavigationTrigger = NonNullable<BuildTransientInputContextParams['selection']>;
|
|
11
|
+
/** One drill-through: the dashboard it left, the one it opened, and what came along. */
|
|
12
|
+
export type DashboardNavigationEntry = {
|
|
13
|
+
fromDashboardId: string;
|
|
14
|
+
fromDashboardTitle?: string;
|
|
15
|
+
toDashboardId: string;
|
|
16
|
+
toDashboardTitle?: string;
|
|
17
|
+
/** Kept even when `contextMode: 'none'` carries no executable selection. */
|
|
18
|
+
trigger: DashboardNavigationTrigger;
|
|
19
|
+
carried: TransientInputContext;
|
|
20
|
+
};
|
|
21
|
+
/** The dashboard navigation says to show. Selection of the loaded dashboard follows it. */
|
|
22
|
+
export type DashboardNavigationTarget = {
|
|
23
|
+
dashboardId: string;
|
|
24
|
+
title?: string;
|
|
25
|
+
/** Why the target changed, so a follower can tell a drill from a step back. */
|
|
26
|
+
reason: 'drillThrough' | 'back';
|
|
27
|
+
};
|
|
28
|
+
/** Transient contexts that are valid only while one dashboard is rendered. */
|
|
29
|
+
export type DashboardTransientContextScope = {
|
|
30
|
+
dashboardId: string;
|
|
31
|
+
contexts: readonly TransientInputContext[];
|
|
32
|
+
};
|
|
33
|
+
/** One insight opened from a card, with the runtime it renders under. */
|
|
34
|
+
export type InsightRenderRequest = {
|
|
35
|
+
insightId: string;
|
|
36
|
+
sourceCardId: string;
|
|
37
|
+
displayMode: 'modal' | 'replaceCard';
|
|
38
|
+
/** The only transient context the insight resolves. Namespace `insight:<sourceCardId>`. */
|
|
39
|
+
runtime: TransientInputContext;
|
|
40
|
+
};
|
|
41
|
+
export type DashboardNavigationState = {
|
|
42
|
+
/** Oldest first. The last entry is where the viewer is. */
|
|
43
|
+
navigationStack: DashboardNavigationEntry[];
|
|
44
|
+
/** Null until navigation first moves the viewer. */
|
|
45
|
+
navigationTarget: DashboardNavigationTarget | null;
|
|
46
|
+
/** Keyed by source card id: a card shows at most one insight. */
|
|
47
|
+
insightRenderRequests: Record<string, InsightRenderRequest>;
|
|
48
|
+
};
|
|
49
|
+
export declare const INITIAL_DASHBOARD_NAVIGATION_STATE: DashboardNavigationState;
|
|
50
|
+
/** The namespace of the context carried by the entry pushed at `depth`. */
|
|
51
|
+
export declare function navigationNamespace(fromDashboardId: string, depth: number): string;
|
|
52
|
+
export declare function insightNamespace(sourceCardId: string): string;
|
|
53
|
+
export type NavigationRejection =
|
|
54
|
+
/** An id is missing, so there is nowhere to go or to come back to. */
|
|
55
|
+
'incompleteEntry'
|
|
56
|
+
/** The entry does not leave the dashboard at the current end of the chain. */
|
|
57
|
+
| 'sourceMismatch'
|
|
58
|
+
/** The carried namespace is not the one this depth owns, so ids could collide with an entry already on the stack. */
|
|
59
|
+
| 'namespaceMismatch';
|
|
60
|
+
export type NavigateResult = {
|
|
61
|
+
status: 'navigated';
|
|
62
|
+
state: DashboardNavigationState;
|
|
63
|
+
} | {
|
|
64
|
+
status: 'rejected';
|
|
65
|
+
reason: NavigationRejection;
|
|
66
|
+
state: DashboardNavigationState;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Drill through: push the entry and point navigation at its destination.
|
|
70
|
+
* Insights belong to cards of the dashboard being left, so they close in the
|
|
71
|
+
* same transition. A rejected entry changes nothing.
|
|
72
|
+
*/
|
|
73
|
+
export declare function navigateToDashboardInState(state: DashboardNavigationState, entry: DashboardNavigationEntry): NavigateResult;
|
|
74
|
+
/**
|
|
75
|
+
* One step back: pop the top entry and point navigation at the dashboard it
|
|
76
|
+
* left. What applies there is whatever the new top carried, or nothing at the
|
|
77
|
+
* root. Returns the same state when there is nowhere to go back to.
|
|
78
|
+
*/
|
|
79
|
+
export declare function goBackInState(state: DashboardNavigationState): DashboardNavigationState;
|
|
80
|
+
/**
|
|
81
|
+
* Forget the drill history and stay where the viewer is: the carried context
|
|
82
|
+
* stops applying and there is nothing to go back to. Open insights stay; they
|
|
83
|
+
* belong to the cards on screen.
|
|
84
|
+
*/
|
|
85
|
+
export declare function clearNavigationInState(state: DashboardNavigationState): DashboardNavigationState;
|
|
86
|
+
/** Opens an insight on a card, replacing the one that card already showed. */
|
|
87
|
+
export declare function openInsightRequestInState(state: DashboardNavigationState, request: InsightRenderRequest): DashboardNavigationState;
|
|
88
|
+
/**
|
|
89
|
+
* Closes the insight on a card. Also the answer to a card that changes id or
|
|
90
|
+
* is removed: the runtime's ids derive from `insight:<sourceCardId>`, so a
|
|
91
|
+
* request cannot follow its card to a new id, and both are authoring actions.
|
|
92
|
+
*/
|
|
93
|
+
export declare function closeInsightRequestInState(state: DashboardNavigationState, sourceCardId: string): DashboardNavigationState;
|
|
94
|
+
export declare function closeAllInsightRequestsInState(state: DashboardNavigationState): DashboardNavigationState;
|
|
95
|
+
/**
|
|
96
|
+
* The carried context in effect on `dashboardId`: the top entry's, and only on
|
|
97
|
+
* the dashboard it was carried to. Deeper entries are history, not context; a
|
|
98
|
+
* `full` drill from B to C already re-carried what B had received from A. The
|
|
99
|
+
* result is reference-stable per entry, so it is safe as a store selector.
|
|
100
|
+
*/
|
|
101
|
+
export declare function selectActiveTransientContexts(state: Pick<DashboardNavigationState, 'navigationStack'>, dashboardId: string | null | undefined): readonly TransientInputContext[];
|
|
102
|
+
/**
|
|
103
|
+
* What every live reader resolves a dashboard's cards with. Replay and
|
|
104
|
+
* navigation-handoff contexts are accepted only for the dashboard named by
|
|
105
|
+
* their scope. Otherwise the committed navigation entry decides.
|
|
106
|
+
* Reference-stable for direct store use.
|
|
107
|
+
*/
|
|
108
|
+
export declare function selectEffectiveTransientContexts(state: Pick<DashboardNavigationState, 'navigationStack' | 'navigationTarget'> & {
|
|
109
|
+
restoredTransientContextScope: DashboardTransientContextScope | null;
|
|
110
|
+
outgoingTransientContextScope: DashboardTransientContextScope | null;
|
|
111
|
+
}, dashboardId: string | null | undefined): readonly TransientInputContext[];
|
|
112
|
+
/** The context mode governing the dashboard's own toolbar filters, or undefined outside a drill. */
|
|
113
|
+
export declare function selectNavigationContextMode(state: Pick<DashboardNavigationState, 'navigationStack'>, dashboardId: string | null | undefined): TransientInputContext['contextMode'] | undefined;
|
|
114
|
+
/** The click that opened `dashboardId`, including under context mode `none`. */
|
|
115
|
+
export declare function selectNavigationTrigger(state: Pick<DashboardNavigationState, 'navigationStack'>, dashboardId: string | null | undefined): DashboardNavigationTrigger | undefined;
|
|
116
|
+
/** Where "Back" leads from `dashboardId`, or undefined when the viewer did not drill here. */
|
|
117
|
+
export declare function selectBackDestination(state: Pick<DashboardNavigationState, 'navigationStack'>, dashboardId: string | null | undefined): {
|
|
118
|
+
dashboardId: string;
|
|
119
|
+
title?: string;
|
|
120
|
+
} | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TCard } from '../types/common-types.js';
|
|
2
|
+
import { DrillThroughEvent, DrillToDetailEvent } from '../types/interaction-types.js';
|
|
3
|
+
/** A drill that leaves the card: to another dashboard, or into an insight. */
|
|
4
|
+
export type OneOffDrillEvent = DrillThroughEvent | DrillToDetailEvent;
|
|
5
|
+
/**
|
|
6
|
+
* Runs a one-off drill from the click that raised it. The carried context is
|
|
7
|
+
* captured here, at the moment of the click, from the state the clicked card
|
|
8
|
+
* was executing under; nothing is read again later. Returns false when the
|
|
9
|
+
* drill has no target to open.
|
|
10
|
+
*/
|
|
11
|
+
export declare function runOneOffDrill(card: TCard, event: OneOffDrillEvent): boolean;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TransientInputContext } from '../dashboard-inputs/transient-input-context.js';
|
|
2
|
+
/**
|
|
3
|
+
* Set by an insight viewer around the card it renders: that card resolves only
|
|
4
|
+
* under the insight's own runtime, never under what navigation carried to the
|
|
5
|
+
* dashboard behind it.
|
|
6
|
+
*/
|
|
7
|
+
export declare const InsightRuntimeContext: import('react').Context<readonly TransientInputContext[] | null>;
|
|
8
|
+
/** The carried contexts in effect on the dashboard being rendered. */
|
|
9
|
+
export declare function useDashboardTransientContexts(): readonly TransientInputContext[];
|
|
10
|
+
/**
|
|
11
|
+
* The carried contexts a card resolves under: the enclosing insight's runtime,
|
|
12
|
+
* otherwise the dashboard's. Every live reader that resolves inputs or builds
|
|
13
|
+
* a query context for a card reads this one value for both.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useCardTransientContexts(): readonly TransientInputContext[];
|
|
16
|
+
/** Non-reactive read for code that runs outside React (exports, the assistant). */
|
|
17
|
+
export declare function getDashboardTransientContexts(): readonly TransientInputContext[];
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Field, TimeGranularity } from '../types/explorer-types.js';
|
|
2
|
+
import { ClickedMetricValue, ClickFilterCondition } from '../types/interaction-types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Card view state: session-only state that changes how one card is queried or
|
|
5
|
+
* shown without changing its authored definition. It lives in the dashboard
|
|
6
|
+
* store next to the input values, travels in the dashboard input execution
|
|
7
|
+
* snapshot, and is never persisted with the dashboard.
|
|
8
|
+
*/
|
|
9
|
+
/** One level of a drill: the member the viewer drilled into and the field the card groups by afterwards. */
|
|
10
|
+
export type DrillStep = {
|
|
11
|
+
/** The field the card groups by after this step. */
|
|
12
|
+
toField: Field;
|
|
13
|
+
/**
|
|
14
|
+
* The member that was drilled into, AND-ed. These are the card's own fields:
|
|
15
|
+
* a drill narrows the card it happened on, so its conditions stay in that
|
|
16
|
+
* card's field vocabulary and need no grounding on another source.
|
|
17
|
+
*/
|
|
18
|
+
conditions: ClickFilterCondition[];
|
|
19
|
+
/** Breadcrumb text. */
|
|
20
|
+
label: string;
|
|
21
|
+
granularity?: TimeGranularity;
|
|
22
|
+
/** The clicked metric. Display only; never part of the query. */
|
|
23
|
+
metric?: ClickedMetricValue;
|
|
24
|
+
};
|
|
25
|
+
export type CardDrillPath = {
|
|
26
|
+
/** Set while the viewer walks an authored hierarchy; absent for a dynamic drill. */
|
|
27
|
+
hierarchyId?: string;
|
|
28
|
+
steps: DrillStep[];
|
|
29
|
+
};
|
|
30
|
+
export type CardViewState = {
|
|
31
|
+
drill?: CardDrillPath;
|
|
32
|
+
};
|
|
33
|
+
export type CardViewStateMap = Record<string, CardViewState>;
|
|
34
|
+
/** Shared empty path, so selectors return a stable reference. */
|
|
35
|
+
export declare const EMPTY_DRILL_STEPS: DrillStep[];
|
|
36
|
+
export declare function drillStepLabel(toField: Field): string;
|
|
37
|
+
export declare function pushDrillStepToViewState(viewState: CardViewState | undefined, step: DrillStep, hierarchyId?: string): CardViewState;
|
|
38
|
+
/** Removes the last step. Returns undefined when nothing is left to keep for the card. */
|
|
39
|
+
export declare function popDrillStepFromViewState(viewState: CardViewState | undefined): CardViewState | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Reads card view state that crossed a serialization boundary (the print URL,
|
|
42
|
+
* a stored export request). A card whose drill path is not well formed is
|
|
43
|
+
* dropped whole: half a drill path would group by one level and filter by
|
|
44
|
+
* another.
|
|
45
|
+
*/
|
|
46
|
+
export declare function parseCardViewStateMap(value: unknown): CardViewStateMap;
|
|
47
|
+
/** Only cards that hold a drill path; an export should not carry empty entries. */
|
|
48
|
+
export declare function compactCardViewStateMap(viewStates: CardViewStateMap | undefined, cardIds?: ReadonlySet<string>): CardViewStateMap | undefined;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TCard } from '../types/common-types.js';
|
|
2
|
+
import { CardConfig, FilterGroup } from '../types/explorer-types.js';
|
|
3
|
+
import { ShelfCard } from '../utils/card-definition.js';
|
|
4
|
+
import { CardDrillPath } from './card-view-state.js';
|
|
5
|
+
/**
|
|
6
|
+
* The card's configuration at the current drill level. Matrix runtime filters
|
|
7
|
+
* travel separately from the authored definition and its interactions never
|
|
8
|
+
* replace an axis through ordinary drill shelves, so a non-shelf card keeps
|
|
9
|
+
* its configuration unchanged.
|
|
10
|
+
*/
|
|
11
|
+
export declare function applyDrillPathToCardConfig(card: TCard, drill: CardDrillPath | undefined): CardConfig;
|
|
12
|
+
/** Grouped by the last step's field, with a sort on the old grouping following it. */
|
|
13
|
+
export declare function applyDrillPathToShelfCardConfig(card: ShelfCard, drill: CardDrillPath | undefined): CardConfig;
|
|
14
|
+
/**
|
|
15
|
+
* The members drilled into, as one filter group: AND across steps, AND within
|
|
16
|
+
* a step. Each step keeps the three-level shape selections compile to (root,
|
|
17
|
+
* one group per step, one group per member) so `explore-query` sees one shape.
|
|
18
|
+
* Ids derive from position, so the same path always yields the same query key.
|
|
19
|
+
*/
|
|
20
|
+
export declare function drillPathFilterGroup(drill: CardDrillPath | undefined, cardId: string): FilterGroup | undefined;
|
|
@@ -3,7 +3,6 @@ import { AuthToken, ControlBinding, ControlDefinition, DashboardInputExecutionSn
|
|
|
3
3
|
import { TChartType } from './charts/types.js';
|
|
4
4
|
import { FastPathTableStructure } from '../shared/format-utils/table-structure.js';
|
|
5
5
|
import { PresentationExecutionSnapshot } from '../shared/format-utils/index.js';
|
|
6
|
-
import { InteractionState } from './types/interaction-types.js';
|
|
7
6
|
import { buildMatrixDeliveryPayload } from './matrix-table/matrix-delivery.js';
|
|
8
7
|
export type MatrixPdfCapture = ReturnType<typeof buildMatrixDeliveryPayload>;
|
|
9
8
|
export type DashboardParams = {
|
|
@@ -17,7 +16,6 @@ export type DashboardParams = {
|
|
|
17
16
|
selectedSheetId?: string;
|
|
18
17
|
dashboardId: string;
|
|
19
18
|
dashboardInputExecutionSnapshot?: DashboardInputExecutionSnapshot;
|
|
20
|
-
interactionExecutionSnapshot?: Record<string, InteractionState>;
|
|
21
19
|
presentationExecutionSnapshot: PresentationExecutionSnapshot;
|
|
22
20
|
timezone?: string;
|
|
23
21
|
};
|
|
@@ -35,7 +33,6 @@ export type VisualPdfParams = {
|
|
|
35
33
|
cardTitle: string;
|
|
36
34
|
dashboardId: string;
|
|
37
35
|
dashboardInputExecutionSnapshot?: DashboardInputExecutionSnapshot;
|
|
38
|
-
interactionExecutionSnapshot?: Record<string, InteractionState>;
|
|
39
36
|
presentationExecutionSnapshot: PresentationExecutionSnapshot;
|
|
40
37
|
timezone?: string;
|
|
41
38
|
};
|
|
@@ -21,7 +21,7 @@ type ContextResolution = {
|
|
|
21
21
|
export declare function hasExplicitFormatOptions(formatOptions?: TFormatOptions | null): boolean;
|
|
22
22
|
export declare function getMetricColumnKey(metric?: Pick<MetricField, 'alias' | 'label' | 'name'> | null): string | undefined;
|
|
23
23
|
export declare function findMetricFieldForColumn(card: TCard | undefined, lookup: MetricLookup): MetricField | undefined;
|
|
24
|
-
export declare function findPresentationFieldForColumn(card: TCard | undefined, lookup: MetricLookup): (
|
|
24
|
+
export declare function findPresentationFieldForColumn(card: TCard | undefined, lookup: MetricLookup): (GroupByField | MetricField | DetailField) | undefined;
|
|
25
25
|
export declare function normalizePersistedColumnSettings(settings: PersistedColumnSettings | undefined): ColumnSettings | undefined;
|
|
26
26
|
export declare function normalizePersistedColumnSettingsMap(settings: PersistedColumnSettingsMap | undefined): ColumnSettingsMap;
|
|
27
27
|
export declare function serializeEditedColumnSettings(params: {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import { CardViewStateMap } from '../../dashboard-view-state/index.js';
|
|
1
2
|
import { TFilterValue } from '../../../components/surfboard/filter/types.js';
|
|
2
3
|
import { DashboardSynopsis, AssistantCardContext, DashboardViewState } from '../../types/assistant-types.js';
|
|
3
|
-
import { TCard, TDashboard } from '../../types/common-types.js';
|
|
4
|
+
import { DashboardInputValues, TCard, TDashboard } from '../../types/common-types.js';
|
|
4
5
|
import { CalendarContext } from '../../../shared/report-runtime-context/index.js';
|
|
5
|
-
import {
|
|
6
|
+
import { TransientInputContext } from '../../dashboard-inputs/transient-input-context.js';
|
|
6
7
|
type ReplacedCardContext = {
|
|
7
8
|
insightId: string;
|
|
8
9
|
visibleCard: TCard;
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
/** The insight's own runtime: the only carried context its card resolves under. */
|
|
11
|
+
runtime: TransientInputContext;
|
|
11
12
|
};
|
|
12
13
|
export declare function buildDashboardViewState({ dashboard, selectedSheetId, activeFilters, calendarContext, }: {
|
|
13
14
|
dashboard: TDashboard;
|
|
@@ -15,19 +16,25 @@ export declare function buildDashboardViewState({ dashboard, selectedSheetId, ac
|
|
|
15
16
|
activeFilters: TFilterValue[] | undefined;
|
|
16
17
|
calendarContext?: CalendarContext;
|
|
17
18
|
}): DashboardViewState;
|
|
18
|
-
export declare function buildDashboardSynopsis({ dashboard, viewState,
|
|
19
|
+
export declare function buildDashboardSynopsis({ dashboard, viewState, transientContexts, cardViewStates, inlineFilterValuesMap, dashboardInputValues, replacedCards, }: {
|
|
19
20
|
dashboard: TDashboard;
|
|
20
21
|
viewState: DashboardViewState;
|
|
21
|
-
|
|
22
|
+
/** Carried contexts in effect on the dashboard; see `buildCardQueryContext`. */
|
|
23
|
+
transientContexts: readonly TransientInputContext[] | undefined;
|
|
24
|
+
cardViewStates?: CardViewStateMap;
|
|
22
25
|
inlineFilterValuesMap?: Record<string, TFilterValue[] | undefined>;
|
|
26
|
+
dashboardInputValues?: DashboardInputValues;
|
|
23
27
|
replacedCards?: Record<string, ReplacedCardContext>;
|
|
24
28
|
}): DashboardSynopsis;
|
|
25
|
-
export declare function buildCardContext({ dashboard, viewState, cardId, runtimeFilterValues,
|
|
29
|
+
export declare function buildCardContext({ dashboard, viewState, cardId, runtimeFilterValues, dashboardInputValues, transientContexts, cardViewStates, inlineFilterValuesMap, replacedCards, }: {
|
|
26
30
|
dashboard: TDashboard;
|
|
27
31
|
viewState: DashboardViewState;
|
|
28
32
|
cardId: string;
|
|
29
33
|
runtimeFilterValues?: TFilterValue[] | undefined;
|
|
30
|
-
|
|
34
|
+
dashboardInputValues?: DashboardInputValues;
|
|
35
|
+
/** Carried contexts in effect on the dashboard; see `buildCardQueryContext`. */
|
|
36
|
+
transientContexts: readonly TransientInputContext[] | undefined;
|
|
37
|
+
cardViewStates?: CardViewStateMap;
|
|
31
38
|
inlineFilterValuesMap?: Record<string, TFilterValue[] | undefined>;
|
|
32
39
|
replacedCards?: Record<string, ReplacedCardContext>;
|
|
33
40
|
}): AssistantCardContext;
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { TCard } from '../../types/index.js';
|
|
2
2
|
import { Chart } from 'chart.js/auto';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Source-only highlight for a chart's own selection. The caller says whether
|
|
5
|
+
* click to filter is on and which gesture the click was, so the faded marks
|
|
6
|
+
* follow the same replace and toggle rules as the selection itself.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useChartBlur(card: TCard, { isEnabled, hasSelection }: {
|
|
9
|
+
isEnabled: boolean;
|
|
10
|
+
hasSelection: boolean;
|
|
11
|
+
}): {
|
|
12
|
+
handleChartClick: (e: any, chart: Chart, intent: "replace" | "toggle") => void;
|
|
5
13
|
clearBlur: (chart: Chart | null) => void;
|
|
6
14
|
};
|