react-semaphor 0.1.526 → 0.1.528

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 (180) hide show
  1. package/DATA_APP_SDK.md +5 -1
  2. package/dist/analytics-protocol/index.js +1190 -296
  3. package/dist/brand-studio/index.js +15 -15
  4. package/dist/briefings/index.js +50 -49
  5. package/dist/chunks/{calculated-field-identity-D1ofR4KJ.js → calculated-field-identity-DUu-tCQw.js} +66 -65
  6. package/dist/chunks/{card-config-utils-9sv4e-Vb.js → card-config-utils-BdPceiw8.js} +68 -65
  7. package/dist/chunks/{constants-DeLIHVAW.js → constants-DNWVy8Y3.js} +4 -4
  8. package/dist/chunks/dashboard-BkskKMck.js +14 -0
  9. package/dist/chunks/{dashboard-briefing-launcher-DXz1GhFZ.js → dashboard-briefing-launcher-Bb0RhGRC.js} +372 -359
  10. package/dist/chunks/{dashboard-controls-Df8qOSrs.js → dashboard-controls-loWTHPMi.js} +739 -686
  11. package/dist/chunks/{dashboard-json-Xldp0qww.js → dashboard-json-DUci_SOR.js} +10 -10
  12. package/dist/chunks/{edit-dashboard-visual-COHBqyic.js → edit-dashboard-visual-z9WN26w7.js} +6603 -6572
  13. package/dist/chunks/{editor-action-buttons-DahlP57T.js → editor-action-buttons-CGSFK9S-.js} +266 -267
  14. package/dist/chunks/{field-aggregations-BQjogiI1.js → field-aggregations-CdXSo1pb.js} +19 -19
  15. package/dist/chunks/{field-dependencies-v-lJNzC7.js → field-dependencies-CGYic38w.js} +1 -1
  16. package/dist/chunks/{index-CbjuruKe.js → index-CTYnXU85.js} +781 -780
  17. package/dist/chunks/{matrix-analytical-definition-BimC4XIV.js → matrix-analytical-definition-BJyH5-99.js} +1 -1
  18. package/dist/chunks/{matrix-card-CIlz0Dnp.js → matrix-card-DhykwdZs.js} +7 -6
  19. package/dist/chunks/{matrix-control-sources-2VAzGlt8.js → matrix-control-sources-BV9ywFtJ.js} +11 -11
  20. package/dist/chunks/{matrix-definition-E5gXXSTZ.js → matrix-definition-Cdn3LoxW.js} +3 -3
  21. package/dist/chunks/{semantic-format-Baqp8kD_.js → matrix-formatter-1Mm8x8w7.js} +655 -511
  22. package/dist/chunks/{matrix-member-presentation-Bw7-JCrr.js → matrix-member-presentation-BBW0n1iY.js} +1 -1
  23. package/dist/chunks/matrix-operation-contract-Dp7kFpVk.js +1383 -0
  24. package/dist/chunks/{metric-comparison-BphoJ9bq.js → metric-comparison-Crljx_XY.js} +15 -10
  25. package/dist/chunks/{numeric-presentation-VhMUHfrJ.js → numeric-presentation-LvnNY5Ma.js} +68 -68
  26. package/dist/chunks/pivot-header-presentation-CZa3556D.js +618 -0
  27. package/dist/chunks/{pivot-result-identity-BzUQiCEV.js → pivot-result-identity-CY__BuwI.js} +1 -1
  28. package/dist/chunks/{pivot-result-lifecycle-BFO354lk.js → pivot-result-lifecycle-Bqdtknud.js} +259 -204
  29. package/dist/chunks/{raw-temporal-7bFbXd2a.js → raw-temporal-CdnA_OXJ.js} +10 -10
  30. package/dist/chunks/{raw-temporal-contract-BQZIJ1fn.js → raw-temporal-contract-Bc9z83t-.js} +1 -1
  31. package/dist/chunks/relative-date-DAF9J7mt.js +456 -0
  32. package/dist/chunks/{report-preferences-dialog-BcH-0lR-.js → report-preferences-dialog-VV0-Ro6F.js} +131 -132
  33. package/dist/chunks/{report-runtime-context-CxIoGyNM.js → report-runtime-context-CtaGGlit.js} +1 -1
  34. package/dist/chunks/{selection-reducer-NF5C07yM.js → selection-reducer-IZjBSU6Z.js} +47 -26
  35. package/dist/chunks/semantic-format-BBLvfwua.js +192 -0
  36. package/dist/chunks/{semaphor-ready-indicator-BLRDuLr4.js → semaphor-ready-indicator-DbA4mVQL.js} +49909 -46207
  37. package/dist/chunks/{slider-BYIH4icg.js → slider-DpiJG8lv.js} +81 -82
  38. package/dist/chunks/{source-entity-resolution-Bzefiive.js → source-entity-resolution-Bde29mqE.js} +25 -25
  39. package/dist/chunks/switch-C4YH-W1X.js +24003 -0
  40. package/dist/chunks/{temporal-bucket-PcLFSYWX.js → temporal-bucket-DlFuhCnT.js} +6 -6
  41. package/dist/chunks/{temporal-bucket-contract-DTLDRzgV.js → temporal-bucket-contract-C6lUGPS3.js} +1 -1
  42. package/dist/chunks/temporal-input-presentation-DyMWCZYh.js +195 -0
  43. package/dist/chunks/{token-types-BC6RcUY8.js → token-types-UjyNz95-.js} +1 -1
  44. package/dist/chunks/{validators-CsdOtZI6.js → validators-CQcG0EPN.js} +852 -731
  45. package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +46 -0
  46. package/dist/dashboard/index.js +1 -1
  47. package/dist/dashboard-authoring/index.js +138 -137
  48. package/dist/data-app-sdk/index.js +12 -12
  49. package/dist/data-app-sdk-adapters/index.js +23 -22
  50. package/dist/data-app-sdk-validation/index.js +27 -26
  51. package/dist/format-utils/index.js +247 -329
  52. package/dist/index.js +165 -168
  53. package/dist/report-runtime-context/index.js +2 -2
  54. package/dist/style.css +1 -1
  55. package/dist/surfboard/index.js +1 -1
  56. package/dist/types/briefings/index.d.ts +3 -0
  57. package/dist/types/components/explorer/filters/card-date-filter.d.ts +13 -5
  58. package/dist/types/components/explorer/filters/card-date-selection.d.ts +28 -0
  59. package/dist/types/components/sharing-and-management/dashboard-actions-menu.d.ts +1 -1
  60. package/dist/types/components/sharing-and-management/hooks/use-resource-management.d.ts +0 -1
  61. package/dist/types/components/surfboard/download-settings-dialog.d.ts +8 -0
  62. package/dist/types/components/surfboard/filter/types.d.ts +8 -29
  63. package/dist/types/components/surfboard/filter/use-dashboard-filter-mapping-popover.d.ts +5 -1
  64. package/dist/types/components/ui-custom/date-range-picker.d.ts +18 -2
  65. package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -21
  66. package/dist/types/components/ui-custom/report-calendar.d.ts +18 -0
  67. package/dist/types/components/visual/aggregated-table/utils/export-utils.d.ts +3 -5
  68. package/dist/types/components/visual/data-table/data-table-toolbar.d.ts +1 -1
  69. package/dist/types/components/visual/pivot-table/utils/pivot-table-export-utils.d.ts +3 -1
  70. package/dist/types/index.js +5 -5
  71. package/dist/types/lib/api/exports-api.d.ts +3 -0
  72. package/dist/types/lib/csv-download.d.ts +9 -0
  73. package/dist/types/lib/csv-encoding-options.d.ts +6 -0
  74. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +2 -1
  75. package/dist/types/lib/dashboard-navigation/build-carried-click-context.d.ts +0 -1
  76. package/dist/types/lib/document/document-input-runtime.d.ts +2 -1
  77. package/dist/types/lib/export-utils.d.ts +17 -15
  78. package/dist/types/lib/hooks/explorer/use-filter-builder.d.ts +2 -2
  79. package/dist/types/lib/hooks/use-relative-date-summarizer.d.ts +7 -0
  80. package/dist/types/lib/matrix-table/matrix-application-adapter.d.ts +3 -2
  81. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +1 -1
  82. package/dist/types/lib/matrix-table/matrix-card-draft.d.ts +1 -1
  83. package/dist/types/lib/matrix-table/matrix-dataset-history.d.ts +47 -0
  84. package/dist/types/lib/matrix-table/matrix-delivery.d.ts +7 -3
  85. package/dist/types/lib/matrix-table/matrix-execution-context.d.ts +2 -0
  86. package/dist/types/lib/matrix-table/matrix-query-transport.d.ts +4 -1
  87. package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +105 -4
  88. package/dist/types/lib/matrix-table/matrix-runtime.d.ts +43 -2
  89. package/dist/types/lib/matrix-table/use-matrix.d.ts +6 -0
  90. package/dist/types/lib/query-context/build-card-query-context.d.ts +5 -1
  91. package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +0 -1
  92. package/dist/types/lib/query-context/build-global-date-comparison-context.d.ts +1 -2
  93. package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +1 -2
  94. package/dist/types/lib/query-context/dashboard-card-query-key.d.ts +10 -0
  95. package/dist/types/lib/query-context/query-auth-scope.d.ts +5 -0
  96. package/dist/types/lib/stores/dashboard-store.d.ts +9 -4
  97. package/dist/types/lib/temporal-filter/temporal-filter-utils.d.ts +9 -2
  98. package/dist/types/lib/types/common-types.d.ts +5 -0
  99. package/dist/types/lib/types/explorer-types.d.ts +14 -0
  100. package/dist/types/lib/types/semantic-types.d.ts +4 -2
  101. package/dist/types/lib/types/token-types.d.ts +0 -1
  102. package/dist/types/lib/utils/aggregate-expression-utils.d.ts +0 -4
  103. package/dist/types/lib/utils/card-definition.d.ts +1 -1
  104. package/dist/types/lib/utils/date-timezone-utils.d.ts +4 -46
  105. package/dist/types/lib/utils/filter-default-value-utils.d.ts +8 -2
  106. package/dist/types/lib/utils/inline-filter-utils.d.ts +3 -2
  107. package/dist/types/lib/utils/relative-date-description.d.ts +38 -0
  108. package/dist/types/shared/analytics-protocol/aggregate-expression.d.ts +89 -0
  109. package/dist/types/shared/analytics-protocol/analytics-refusal.d.ts +32 -0
  110. package/dist/types/shared/analytics-protocol/contracts.d.ts +48 -7
  111. package/dist/types/shared/analytics-protocol/index.d.ts +15 -1
  112. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +20 -20
  113. package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +10 -10
  114. package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +8 -8
  115. package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +61 -6
  116. package/dist/types/shared/analytics-protocol/measure-aggregation-profile.d.ts +63 -0
  117. package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +9 -3
  118. package/dist/types/shared/analytics-protocol/operation-temporal-state.d.ts +64 -0
  119. package/dist/types/shared/analytics-protocol/relative-date-filter.d.ts +61 -0
  120. package/dist/types/shared/analytics-protocol/relative-date-label.d.ts +20 -0
  121. package/dist/types/shared/analytics-protocol/runtime-schemas.d.ts +0 -2
  122. package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +314 -0
  123. package/dist/types/shared/analytics-protocol/time-window.d.ts +13 -0
  124. package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +8 -4
  125. package/dist/types/shared/format-utils/exporters/csv-utils.d.ts +46 -15
  126. package/dist/types/shared/format-utils/exporters/index.d.ts +2 -3
  127. package/dist/types/shared/format-utils/flat-table-export-totals.d.ts +2 -1
  128. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +2 -2
  129. package/dist/types/shared/format-utils/types/format-types.d.ts +0 -42
  130. package/dist/types/shared/temporal/calendar-periods.d.ts +56 -0
  131. package/dist/types/shared/temporal/index.d.ts +5 -0
  132. package/dist/types/shared/temporal/relative-date.d.ts +21 -0
  133. package/dist/types/shared/temporal/temporal-parity-fixtures.d.ts +73 -0
  134. package/dist/types/shared/temporal/time-window-periods.d.ts +21 -0
  135. package/dist/types/shared/temporal/zoned-wall-clock.d.ts +23 -0
  136. package/package.json +1 -17
  137. package/src/data-app-sdk/README.md +6 -3
  138. package/dist/chunks/code-highlight-994tgM9v.js +0 -22265
  139. package/dist/chunks/dashboard-CsHvEtjN.js +0 -15
  140. package/dist/chunks/dashboard-date-comparison-definition-BqNhECUr.js +0 -183
  141. package/dist/chunks/matrix-formatter-WBgtebUT.js +0 -341
  142. package/dist/chunks/matrix-operation-contract-D32U2CSw.js +0 -1802
  143. package/dist/chunks/mouse-pointer-2-BZvGk45-.js +0 -19
  144. package/dist/chunks/pivot-header-presentation-CGtudHo7.js +0 -661
  145. package/dist/chunks/pre-block-Cq1RqhZX.js +0 -3987
  146. package/dist/chunks/search-CJz-QQ0Q.js +0 -24
  147. package/dist/chunks/switch-XaAACBrJ.js +0 -2234
  148. package/dist/chunks/temporal-input-presentation-2RJrvmYL.js +0 -222
  149. package/dist/chunks/update-policy-DhAUtiC8.js +0 -913
  150. package/dist/data-app-builder/index.js +0 -3666
  151. package/dist/data-app-builder-browser-runtime/index.js +0 -8
  152. package/dist/data-app-codegen/index.js +0 -22
  153. package/dist/data-app-codegen-node/index.js +0 -1807
  154. package/dist/types/components/data-app-runtime/published-data-app-runtime.d.ts +0 -7
  155. package/dist/types/components/surfboard/json-to-csv.d.ts +0 -7
  156. package/dist/types/components/visual/data-table/utils/export-utils.d.ts +0 -31
  157. package/dist/types/data-app-builder/browser-runtime.d.ts +0 -174
  158. package/dist/types/data-app-builder/constants.d.ts +0 -14
  159. package/dist/types/data-app-builder/data-app-builder.d.ts +0 -14
  160. package/dist/types/data-app-builder/index.d.ts +0 -1
  161. package/dist/types/data-app-builder/lib/api.d.ts +0 -36
  162. package/dist/types/data-app-builder/lib/context-select.d.ts +0 -3
  163. package/dist/types/data-app-builder/lib/diagnostics.d.ts +0 -12
  164. package/dist/types/data-app-builder/lib/file-tree.d.ts +0 -2
  165. package/dist/types/data-app-builder/types.d.ts +0 -558
  166. package/dist/types/data-app-builder-browser-runtime.d.ts +0 -2
  167. package/dist/types/data-app-builder.d.ts +0 -2
  168. package/dist/types/data-app-codegen/generate-contract.d.ts +0 -26
  169. package/dist/types/data-app-codegen/generated-contract-files.d.ts +0 -7
  170. package/dist/types/data-app-codegen/generated-contract-validation.d.ts +0 -13
  171. package/dist/types/data-app-codegen/index.d.ts +0 -6
  172. package/dist/types/data-app-codegen/live-execution.d.ts +0 -42
  173. package/dist/types/data-app-codegen/node.d.ts +0 -2
  174. package/dist/types/data-app-codegen/update-policy.d.ts +0 -25
  175. package/dist/types/data-app-codegen/validation.d.ts +0 -8
  176. package/dist/types/data-app-codegen-node.d.ts +0 -2
  177. package/dist/types/data-app-codegen.d.ts +0 -2
  178. package/dist/types/shared/analytics-protocol/data-app-codegen-summary.d.ts +0 -418
  179. package/dist/types/shared/format-utils/exporters/pivot-exporter.d.ts +0 -13
  180. package/dist/types/shared/format-utils/exporters/table-exporter.d.ts +0 -10
@@ -1,4 +1,4 @@
1
- import { a, R as s, D as o } from "../chunks/report-preferences-dialog-BcH-0lR-.js";
1
+ import { a, R as s, D as o } from "../chunks/report-preferences-dialog-VV0-Ro6F.js";
2
2
  import { C as f, E as D } from "../chunks/common-types-C6cAQgyh.js";
3
3
  export {
4
4
  f as CONTROL_CARD_DEFAULT_VALUE,
@@ -1,6 +1,7 @@
1
1
  import { NumericCanonicalFormat, NumericPresentationTarget, PresentationExecutionSnapshot } from '../shared/format-utils/index.js';
2
2
  import { BriefingAppearanceSpec, BriefingFragments, BriefingThemeOverrides } from './presentation-contract.js';
3
3
  import { MatrixConfig } from '../shared/analytics-protocol/index.js';
4
+ import { CsvEncoding } from '../shared/format-utils/exporters/csv-utils.js';
4
5
  export { captureMatrixExport, buildMatrixDeliveryEnvelope, matrixDeliveryPayloadSchema, matrixDeliveryQuerySchema, type MatrixLayoutReadResult } from '../shared/dashboard-authoring/matrix-delivery.js';
5
6
  export declare const BRIEFING_KIND: "BRIEFING";
6
7
  export { DEFAULT_BRIEFING_SCHEDULE, briefingScheduleMonths, briefingScheduleDayOccurs, briefingScheduleShortMonths, buildBriefingScheduleExpr, canonicalBriefingMonthDays, describeBriefingSchedule, isValidBriefingTimezone, nextBriefingScheduleDates, parseBriefingScheduleExpr, type BriefingScheduleFrequency, type BriefingScheduleMonthDay, type BriefingScheduleMonthInterval, type BriefingScheduleMonthlyOn, type BriefingScheduleOrdinal, type BriefingScheduleViewModel, } from './schedule.js';
@@ -181,6 +182,8 @@ export type BriefingAttachmentSettings = {
181
182
  includeFilters?: boolean;
182
183
  includeTimestamp?: boolean;
183
184
  delimiter?: BriefingCsvDelimiter;
185
+ /** Absent means the dashboard's download setting decides. */
186
+ csvEncoding?: CsvEncoding;
184
187
  includeHeaders?: boolean;
185
188
  useFormattedValues?: boolean;
186
189
  sheetSelection?: BriefingSheetSelection;
@@ -1,12 +1,20 @@
1
+ import { FilterValue } from '../../../lib/types/explorer-types.js';
2
+ import { RelativeDateFilter } from '../../../shared/analytics-protocol/relative-date-filter.js';
3
+ import { CardDateSelection } from './card-date-selection.js';
1
4
  interface CardDateFilterProps {
2
- value: any;
5
+ value: FilterValue;
3
6
  operator: string;
4
- onChange: (value: any) => void;
7
+ /** The saved relative choice, for range operators. */
8
+ relativeMeta?: RelativeDateFilter;
9
+ /** The condition selects the latest value of its field (`=` only). */
10
+ latestValue?: boolean;
11
+ onChange: (selection: CardDateSelection) => void;
5
12
  className?: string;
6
13
  }
7
14
  /**
8
- * Wrapper component that adapts DateRangePicker for card filter usage
9
- * Handles different operators and value formats
15
+ * Wrapper component that adapts DateRangePicker for card filter usage.
16
+ * Range operators can save a relative choice ("This month"), which the
17
+ * server resolves on every run; Static picks save fixed dates.
10
18
  */
11
- export declare function CardDateFilter({ value, operator, onChange, className, }: CardDateFilterProps): import("react").JSX.Element;
19
+ export declare function CardDateFilter({ value, operator, relativeMeta, latestValue, onChange, className, }: CardDateFilterProps): import("react").JSX.Element;
12
20
  export {};
@@ -0,0 +1,28 @@
1
+ import { Field, FilterCondition, FilterValue, Operator } from '../../../lib/types/explorer-types.js';
2
+ import { RelativeDateFilter } from '../../../shared/analytics-protocol/relative-date-filter.js';
3
+ /** What the card date picker emits: dates, plus the relative choice when there is one. */
4
+ export type CardDateSelection = {
5
+ value: FilterValue;
6
+ relativeMeta?: RelativeDateFilter;
7
+ };
8
+ /**
9
+ * The condition without the markers the server resolves on every run: a
10
+ * relative window (`relativeMeta`) and a latest-value predicate
11
+ * (`latestValue`). Every edit of a condition's value, operator or field goes
12
+ * through it, so a new marker can't survive an edit that no longer means it
13
+ * (analytics kernel K13; linked D7).
14
+ */
15
+ export declare function withoutRunTimeMarkers(condition: FilterCondition): FilterCondition;
16
+ /**
17
+ * The next condition for a selection. A selection without `relativeMeta`
18
+ * removes the key, so a fixed pick never keeps an old relative window or a
19
+ * latest-value predicate.
20
+ */
21
+ export declare function applyCardDateSelection(condition: FilterCondition, selection: CardDateSelection): FilterCondition;
22
+ /** The condition after its operator changes: an empty value and no relative window. */
23
+ export declare function resetConditionForOperator(condition: FilterCondition, operator: Operator): FilterCondition;
24
+ /**
25
+ * The condition after its field changes: an empty value, the field type's
26
+ * default operator (`between` for dates) and no relative window.
27
+ */
28
+ export declare function resetConditionForField(condition: FilterCondition, field: Field): FilterCondition;
@@ -7,7 +7,7 @@ interface DashboardActionsMenuProps {
7
7
  showInlineEditButton?: boolean;
8
8
  showEditInMenu?: boolean;
9
9
  menuButtonClassName?: string;
10
- /** When provided (and kind !== 'data_app'), renders a "Set/Clear as default" item. */
10
+ /** When provided, renders a "Set/Clear as default" item. */
11
11
  isDefault?: boolean;
12
12
  onEditDetails?: (dashboard: ResourceListItem) => void;
13
13
  onDeleteClick?: (dashboard: ResourceListItem) => void;
@@ -9,7 +9,6 @@ export interface ResourceListItem {
9
9
  isPrivate: boolean;
10
10
  isPublic: boolean;
11
11
  version: string;
12
- currentDataAppVersionId?: string | null;
13
12
  createdBy: string | null;
14
13
  createdByTenantUser: string;
15
14
  tenantId: string;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Dashboard-wide download settings, edited while the dashboard is in edit
3
+ * mode. A change joins the edit session and is saved with the dashboard.
4
+ */
5
+ export declare function DownloadSettingsDialog({ open, onOpenChange, }: {
6
+ open: boolean;
7
+ onOpenChange: (open: boolean) => void;
8
+ }): import("react").JSX.Element;
@@ -2,6 +2,7 @@ import { DashboardInputTargetContext } from '../../../lib/dashboard-inputs/dashb
2
2
  import { NormalizedDashboardInput } from '../../../lib/types/common-types.js';
3
3
  import { CalculatedFieldFormula, Field } from '../../../lib/types/explorer-types.js';
4
4
  import { TemporalBucketMetadata } from '../../../shared/analytics-protocol/contracts.js';
5
+ import { DateUnit, RelativeDateFilter, RelativeDateUnit, SubDayDateUnit } from '../../../shared/analytics-protocol/relative-date-filter.js';
5
6
  export type DateSelectionMode = 'range' | 'months' | 'day';
6
7
  export type DateComparisonOperation = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'between' | 'not between' | 'is null' | 'is not null';
7
8
  export type FilterLocation = 'dashboard' | 'frame' | 'sheet' | undefined;
@@ -12,35 +13,8 @@ export type ComboBoxOption = {
12
13
  [key: string]: FilterOptionValue;
13
14
  };
14
15
  export type TSelectedRecord = ComboBoxOption;
15
- export type DateUnit = 'day' | 'week' | 'month' | 'quarter' | 'year';
16
- export type SubDayDateUnit = 'minute' | 'hour';
17
- export type RelativeDateUnit = DateUnit | SubDayDateUnit;
16
+ export type { DateUnit, RelativeDateFilter, RelativeDateUnit, SubDayDateUnit, };
18
17
  export type TemporalPrecision = 'minute';
19
- export type RelativeDateFilter = {
20
- mode: 'last';
21
- n: number;
22
- unit: SubDayDateUnit;
23
- complete?: false;
24
- } | {
25
- mode: 'last';
26
- n: number;
27
- unit: DateUnit;
28
- complete?: boolean;
29
- } | {
30
- mode: 'this';
31
- unit: DateUnit;
32
- toDate?: boolean;
33
- /** Only used with unit=month for single-day month-boundary presets. */
34
- boundary?: 'first_day' | 'last_day';
35
- } | {
36
- mode: 'previous';
37
- unit: DateUnit;
38
- } | {
39
- mode: 'between';
40
- unit: DateUnit;
41
- from: number;
42
- to: number;
43
- };
44
18
  /**
45
19
  * Absolute fixed month/year default used by Month Picker defaults.
46
20
  * - `month` is 0-indexed (0=January, 11=December) to align with MonthPicker.
@@ -167,6 +141,12 @@ type BaseFilter = {
167
141
  semanticContext?: FilterSemanticContext;
168
142
  /** Governed meaning for canonical grouped-temporal filter values. */
169
143
  temporalBucket?: TemporalBucketMetadata;
144
+ /**
145
+ * Set on the Global Date value bound to a card's date field. On that field
146
+ * it replaces the card's own date range for the run; any other date filter
147
+ * intersects with it (analytics kernel P2a-01).
148
+ */
149
+ dateOwner?: 'global_date';
170
150
  };
171
151
  type FilterForString = BaseFilter & {
172
152
  operation: 'like' | 'not like';
@@ -242,4 +222,3 @@ export type FilterStorageOptions = {
242
222
  */
243
223
  inputContext?: DashboardInputTargetContext;
244
224
  };
245
- export {};
@@ -1,5 +1,6 @@
1
1
  import { TFilter } from './types.js';
2
2
  import { DashboardFilterMappingAuthoringIssue, DashboardFilterMappingDraftDecision } from '../../../lib/dashboard-inputs/dashboard-filter-mapping-authoring.js';
3
+ import { DefaultsCalendar } from '../../../lib/utils/filter-default-value-utils.js';
3
4
  import { DashboardInputRuntimeTarget } from '../../../lib/dashboard-inputs/dashboard-input-values.js';
4
5
  import { GlobalDateComparisonSelection } from '../../../shared/analytics-protocol/index.js';
5
6
  import { DashboardFilterOptionDependencies, DashboardFilterOptionPopulation, DashboardFilterOptionSource } from '../../../shared/dashboard-authoring/index.js';
@@ -19,7 +20,7 @@ type DashboardFilterSettingsAcceptOptions = {
19
20
  export declare function useDashboardFilterMappingPopover(params: {
20
21
  filter: TFilter;
21
22
  stagedFilter: TFilter;
22
- dashboardTimezone?: string;
23
+ dashboardCalendar?: DefaultsCalendar;
23
24
  open: boolean;
24
25
  attentionEnabled?: boolean;
25
26
  capable: boolean;
@@ -39,6 +40,9 @@ export declare function useDashboardFilterMappingPopover(params: {
39
40
  interactionDefaults?: {
40
41
  clickToFilter: "on" | "off";
41
42
  };
43
+ exportDefaults?: {
44
+ csvEncoding?: import('../../../shared/format-utils/index.js').CsvEncoding;
45
+ };
42
46
  aiContext?: import('../../../lib/types/assistant-types.js').DashboardAIContext;
43
47
  summary?: {
44
48
  enabled?: boolean;
@@ -1,8 +1,10 @@
1
1
  import { DateRange } from 'react-day-picker';
2
2
  import { RelativeDateFilter, DateComparisonOperation, TemporalPrecision } from '../surfboard/filter/types.js';
3
+ import { RelativeDateSummary } from '../../lib/utils/relative-date-description.js';
4
+ import { WeekStart } from '../../shared/report-runtime-context/index.js';
3
5
  export type PresetOption = {
4
6
  label: string;
5
- value: (timezone: string) => DateRange;
7
+ value: (timezone: string, weekStart: WeekStart, now: Date) => DateRange;
6
8
  category: 'time' | 'year' | 'quarter' | 'month' | 'week' | 'day';
7
9
  };
8
10
  export type TemporalPrecisionChangeOptions = {
@@ -36,6 +38,20 @@ export interface DateRangePickerProps {
36
38
  buttonClassName?: string;
37
39
  /** Optional context appended to the closed picker label. */
38
40
  buttonLabelSuffix?: string;
41
+ /**
42
+ * Card filters: what the trigger shows for an applied relative value, for
43
+ * example "This month" and its current dates. The caller describes it; the
44
+ * picker only renders it.
45
+ */
46
+ relativeSummary?: Pick<RelativeDateSummary, 'label' | 'dates'> & {
47
+ /** Shown on hover, typically when there are no dates to show. */
48
+ tooltip?: string;
49
+ };
50
+ /**
51
+ * Single mode: what the trigger shows for an applied value that has no date
52
+ * of its own (a card's "Latest value"). A pick replaces it.
53
+ */
54
+ singleValueLabel?: string;
39
55
  contentClassName?: string;
40
56
  overlayContentClassName?: string;
41
57
  targetColumns?: Array<{
@@ -54,4 +70,4 @@ export interface DateRangePickerProps {
54
70
  /** Notifies nested-popover owners when this picker opens or closes. */
55
71
  onOpenChange?: (open: boolean) => void;
56
72
  }
57
- export declare function DateRangePicker({ value, onChange, selectionMode, singleValue, onSingleChange, comparisonOptions, comparisonValue, onComparisonChange, comparisonLabel, hideDateInputs, onRelativeSelect, relativeValue, placeholder, className, timezone, showRelativeTab, hideCalendar, disabled, enableTimePrecision, temporalPrecision, buttonClassName, buttonLabelSuffix, contentClassName, overlayContentClassName, targetColumns, selectedColumn, onColumnChange, inline, onApplied, supplementalFooter, onOpenChange, }: DateRangePickerProps): import("react").JSX.Element;
73
+ export declare function DateRangePicker({ value, onChange, selectionMode, singleValue, onSingleChange, comparisonOptions, comparisonValue, onComparisonChange, comparisonLabel, hideDateInputs, onRelativeSelect, relativeValue, placeholder, className, timezone, showRelativeTab, hideCalendar, disabled, enableTimePrecision, temporalPrecision, buttonClassName, buttonLabelSuffix, relativeSummary, singleValueLabel, contentClassName, overlayContentClassName, targetColumns, selectedColumn, onColumnChange, inline, onApplied, supplementalFooter, onOpenChange, }: DateRangePickerProps): import("react").JSX.Element;
@@ -19,29 +19,16 @@ export declare function resolveCalendarDayRange(date: string, timezone: string):
19
19
  export declare const isSingleDayDefaultDateFilter: (value: DefaultDateFilter | undefined) => boolean;
20
20
  export declare function resolveDefaultDateFilterForDefaults(meta: DefaultDateFilter, timezone: string, weekStart?: WeekStart): [Date, Date] | undefined;
21
21
  /**
22
- * Resolves a relative date filter to concrete start/end dates in the specified timezone.
23
- * This is a simplified frontend version - backend will re-resolve for query execution.
24
- *
25
- * Anchors "now" in the target timezone so date-fns period functions operate on
26
- * the correct calendar (not browser's calendar).
22
+ * The window a relative date names at `now` in the timezone, from the shared
23
+ * date module (analytics kernel Phase 3), so a preview matches what the server
24
+ * runs. Callers here have no fiscal calendar, so quarters and years are
25
+ * calendar periods; previews show those as labels only (K8).
27
26
  *
28
27
  * @param meta - The relative date filter metadata
29
28
  * @param timezone - IANA timezone string (e.g., "America/New_York", "UTC")
30
29
  * @param weekStart - Day the week starts on (0=Sunday, 1=Monday). Defaults to 1 (Monday/ISO).
31
- * @returns Tuple of [start, end] dates in the specified timezone
32
- */
33
- export declare function resolveRelativeDateForDefaults(meta: RelativeDateFilter, timezone: string, weekStart?: WeekStart): [Date, Date];
34
- /**
35
- * Format a `RelativeDateFilter` meta into a human-readable label.
36
- *
37
- * 1. First tries to reverse-match against `presetMetadata` so canonical
38
- * presets (Today, Last 7 days, This week, …) round-trip back to the
39
- * same wording the user originally clicked.
40
- * 2. Falls back to a generated label for ad-hoc relative ranges that
41
- * aren't in the preset list (e.g., from the Relative tab's custom
42
- * From/To dropdowns).
43
- *
44
- * Returns null if the meta can't be sensibly labelled.
30
+ * @param now - The anchor instant; a pinned calendar anchor passes its own.
31
+ * @returns `[start, inclusive end]`
45
32
  */
46
- export declare function getRelativeDateLabel(meta: RelativeDateFilter | undefined): string | null;
47
- export declare const presetMetadata: Record<string, RelativeDateFilter>;
33
+ export declare function resolveRelativeDateForDefaults(meta: RelativeDateFilter, timezone: string, weekStart?: WeekStart, now?: Date): [Date, Date];
34
+ export { findPresetLabel, getRelativeDateLabel, getRelativeOffsetLabel, presetMetadata, relativeMetaEquals, } from '../../shared/analytics-protocol/relative-date-label.js';
@@ -0,0 +1,18 @@
1
+ type ReportCalendarProps = {
2
+ /** The report's IANA time zone. */
3
+ timezone: string;
4
+ /** Any instant within the selected day. */
5
+ selected?: Date;
6
+ /** The picked day's first instant in `timezone`; undefined when unselected. */
7
+ onSelect: (day: Date | undefined) => void;
8
+ className?: string;
9
+ };
10
+ /**
11
+ * A one-day calendar on the report calendar (temporal predicate contract,
12
+ * Phase B): its days, "today" and first weekday column are the report time
13
+ * zone's and week start's, so a viewer in any time zone picks the report's
14
+ * day. Days come back as plain instants, never the calendar's zoned dates,
15
+ * which serialize with an offset and read the host's clock in date-fns.
16
+ */
17
+ export declare function ReportCalendar({ timezone, selected, onSelect, className, }: ReportCalendarProps): import("react").JSX.Element;
18
+ export {};
@@ -3,6 +3,7 @@ import { GroupByField, QueryColumnKeyMap } from '../../../../lib/types/explorer-
3
3
  import { PivotColumnSchema } from '../../pivot-table/types.js';
4
4
  import { ColumnSettingsMap } from '../../data-table/types/data-table.js';
5
5
  import { CardNumericPresentationContext } from '../../../../lib/formatters/numeric-presentation.js';
6
+ import { CsvDelimiter, CsvEncoding } from '../../../../shared/format-utils/exporters/csv-utils.js';
6
7
  import { AggregateTemporalPresentation } from './temporal-presentation.js';
7
8
  interface RowData extends Record<string, any> {
8
9
  isSubtotal?: boolean;
@@ -18,14 +19,11 @@ interface RowData extends Record<string, any> {
18
19
  * This preserves the formatted display including subtotals and grand totals
19
20
  */
20
21
  export declare function formatAggregatedTableForExport(organizedData: RowData[], grandTotalRow: RowData | undefined, groupByColumns: GroupByField[], pivotSchema: PivotColumnSchema[], card: TCard, columnSettings?: ColumnSettingsMap, options?: {
21
- delimiter?: string;
22
+ delimiter?: CsvDelimiter;
23
+ encoding?: CsvEncoding;
22
24
  includeHeaders?: boolean;
23
25
  numericPresentation?: CardNumericPresentationContext;
24
26
  temporalPresentation?: AggregateTemporalPresentation;
25
27
  columnKeyMap?: QueryColumnKeyMap;
26
28
  }): string;
27
- /**
28
- * Download CSV file
29
- */
30
- export declare function downloadCSV(csvContent: string, fileName: string): void;
31
29
  export {};
@@ -1,2 +1,2 @@
1
1
  import { DataTableToolbarProps } from './types/data-table.js';
2
- export declare function DataTableToolbar({ globalFilter, onGlobalFilterChange, totalRows, columns, selectColumnVisible, onToggleSelectColumn, onColumnVisibilityChange, card, data, exportFileName, }: DataTableToolbarProps): import("react").JSX.Element | null;
2
+ export declare function DataTableToolbar({ globalFilter, onGlobalFilterChange, totalRows, columns, selectColumnVisible, onToggleSelectColumn, onColumnVisibilityChange, }: DataTableToolbarProps): import("react").JSX.Element | null;
@@ -1,11 +1,13 @@
1
1
  import { PivotTableData } from '../pivot-table.js';
2
2
  import { TCard } from '../../../../lib/types/common-types.js';
3
+ import { CsvDelimiter, CsvEncoding } from '../../../../shared/format-utils/index.js';
3
4
  import { CardNumericPresentationContext } from '../../../../lib/formatters/numeric-presentation.js';
4
5
  type PivotTableCsvOptions = {
5
6
  includeHeaders?: boolean;
6
7
  includeSubtotals?: boolean;
7
8
  includeGrandTotal?: boolean;
8
- delimiter?: string;
9
+ delimiter?: CsvDelimiter;
10
+ encoding?: CsvEncoding;
9
11
  showRowTotals?: boolean;
10
12
  numericPresentation?: CardNumericPresentationContext;
11
13
  };
@@ -1,9 +1,9 @@
1
1
  import { C as r, E as s } from "../chunks/common-types-C6cAQgyh.js";
2
- import { C as o, D as i, L as n, P as c, f as d, g as m, k as u, j as E, l as p, e as C, c as D, b as F, d as A, n as f, h as _ } from "../chunks/validators-CsdOtZI6.js";
3
- import { c as T, g as h, f as x, b as N, e as y, d as I, a as M, h as R, r as b } from "../chunks/field-dependencies-v-lJNzC7.js";
4
- import { D as S } from "../chunks/token-types-BC6RcUY8.js";
5
- import { r as O, a as v } from "../chunks/pivot-result-identity-BzUQiCEV.js";
6
- import { D as w } from "../chunks/report-runtime-context-CxIoGyNM.js";
2
+ import { C as o, D as i, L as n, P as c, f as d, g as m, k as u, j as E, l as p, e as C, c as D, b as F, d as A, n as f, h as _ } from "../chunks/validators-CQcG0EPN.js";
3
+ import { c as T, g as h, f as x, b as N, e as y, d as I, a as M, h as R, r as b } from "../chunks/field-dependencies-CGYic38w.js";
4
+ import { D as S } from "../chunks/token-types-UjyNz95-.js";
5
+ import { r as O, a as v } from "../chunks/pivot-result-identity-CY__BuwI.js";
6
+ import { D as w } from "../chunks/report-runtime-context-CtaGGlit.js";
7
7
  const e = [
8
8
  "concatenate",
9
9
  "conditional-category",
@@ -1,4 +1,5 @@
1
1
  import { TFilterValue } from '../../components/surfboard/filter/types.js';
2
+ import { CsvEncoding } from '../../shared/format-utils/exporters/csv-utils.js';
2
3
  import { CardConfig, DataSource, TableTotalsRequest } from '../types/explorer-types.js';
3
4
  import { ControlBinding, ControlDefinition } from '../types/common-types.js';
4
5
  import { ResolvedPrimaryDateField } from '../types/semantic-runtime-types.js';
@@ -16,6 +17,8 @@ export interface ExportFormattingConfig {
16
17
  browserTimezone?: string;
17
18
  isSqlCard?: boolean;
18
19
  delimiter: ',' | ';' | '\t';
20
+ /** Resolved by the dialog: the person's choice, else the dashboard's setting. */
21
+ csvEncoding: CsvEncoding;
19
22
  includeHeaders: boolean;
20
23
  columnSettings?: Record<string, unknown>;
21
24
  visibleColumns?: string[];
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Save a CSV file in the browser. This is the only place react-semaphor
3
+ * creates a CSV Blob; `content` comes from the CSV file contract
4
+ * (`encodeCsvFile`), which owns the BOM, quoting and record separators.
5
+ */
6
+ export declare function downloadCsvFile({ content, fileName, }: {
7
+ content: string;
8
+ fileName: string;
9
+ }): void;
@@ -0,0 +1,6 @@
1
+ import { CsvEncoding } from '../shared/format-utils/index.js';
2
+ /** The two CSV encodings as people see them, in every place that offers the choice. */
3
+ export declare const CSV_ENCODING_OPTIONS: ReadonlyArray<{
4
+ value: CsvEncoding;
5
+ label: string;
6
+ }>;
@@ -1,6 +1,7 @@
1
1
  import { TFilter, TFilterValue } from '../../components/surfboard/filter/types.js';
2
2
  import { DashboardInput, DashboardInputValues } from '../types/common-types.js';
3
3
  import { DashboardInputRuntimeTarget } from './dashboard-input-values.js';
4
+ import { DefaultsCalendar } from '../utils/filter-default-value-utils.js';
4
5
  import { GlobalDateComparisonSelection } from '../../shared/analytics-protocol/index.js';
5
6
  import { DashboardFilterOptionDependencies, DashboardFilterOptionPopulation, DashboardFilterOptionSource } from '../../shared/dashboard-authoring/index.js';
6
7
  export type DashboardFilterStorageState = {
@@ -36,7 +37,7 @@ export type DashboardFilterOptionPolicy = {
36
37
  export declare function resolveFilterOptionPolicy(current: DashboardFilterOptionPolicy | undefined, settings: DashboardFilterAuthoringSettingsUpdate | undefined): DashboardFilterOptionPolicy;
37
38
  export declare function hasFilterOptionPolicy(policy: DashboardFilterOptionPolicy | undefined): boolean;
38
39
  /** Callers submit edits; the owner decides whether defaults must be reseeded. */
39
- export declare function resolveFilterAuthoringSettings(previous: TFilter | undefined, filter: TFilter, settings: DashboardFilterAuthoringSettingsUpdate | undefined, target: DashboardInputRuntimeTarget, timezone?: string): {
40
+ export declare function resolveFilterAuthoringSettings(previous: TFilter | undefined, filter: TFilter, settings: DashboardFilterAuthoringSettingsUpdate | undefined, target: DashboardInputRuntimeTarget, calendar?: DefaultsCalendar): {
40
41
  target: DashboardInputRuntimeTarget;
41
42
  defaultValueChanged: boolean;
42
43
  defaultFilterValue: TFilterValue | undefined;
@@ -39,7 +39,6 @@ export type BuildCarriedClickContextParams = {
39
39
  destinationCardIds: string[];
40
40
  semanticExecutionPayload?: SemanticExecutionPayload;
41
41
  calendarContext?: CalendarContext | null;
42
- dashboardInputReferenceTime?: string;
43
42
  resolveRelativeDateWindow?: ResolveRelativeDateWindow;
44
43
  };
45
44
  export type CarriedClickContext = {
@@ -1,9 +1,10 @@
1
1
  import { TFilterValue } from '../../components/surfboard/filter/types.js';
2
+ import { DefaultsCalendar } from '../utils/filter-default-value-utils.js';
2
3
  import { DocumentControlInputDefinition, DocumentFilterInputDefinition, DocumentInputDefinition } from '../types/common-types.js';
3
4
  export type DocumentFilterMode = 'include' | 'exclude';
4
5
  export declare function isFilterDocumentInput(input: DocumentInputDefinition): input is DocumentFilterInputDefinition;
5
6
  export declare function isControlDocumentInput(input: DocumentInputDefinition): input is DocumentControlInputDefinition;
6
- export declare function buildDefaultDocumentInputFilterValuesById(inputs: DocumentInputDefinition[], timezone?: string): Record<string, TFilterValue | undefined>;
7
+ export declare function buildDefaultDocumentInputFilterValuesById(inputs: DocumentInputDefinition[], calendar?: DefaultsCalendar): Record<string, TFilterValue | undefined>;
7
8
  export declare function buildDefaultDocumentInputControlValuesById(inputs: DocumentInputDefinition[]): Record<string, unknown>;
8
9
  export declare function getDocumentInputSignature(inputs: DocumentInputDefinition[]): string;
9
10
  export declare function getDocumentInputDefinitionSignaturesById(inputs: DocumentInputDefinition[]): Record<string, string>;
@@ -1,6 +1,7 @@
1
1
  import { TablePreferences } from '../components/visual/data-table/types/data-table.js';
2
2
  import { TCard } from './types/common-types.js';
3
3
  import { SemaphorResultColumn } from '../shared/analytics-protocol/index.js';
4
+ import { CsvDelimiter, CsvEncoding } from '../shared/format-utils/index.js';
4
5
  import { CardNumericPresentationContext } from './formatters/numeric-presentation.js';
5
6
  import { ComparisonMetadataMap } from './types/query-types.js';
6
7
  import { CardConfig, QueryColumnKeyMap } from './types/explorer-types.js';
@@ -8,7 +9,8 @@ import { FlatTableTotalsByColumnId } from './table-formatting/table-totals-setti
8
9
  import { RegularTableTemporalPresentation } from './formatters/regular-table-temporal-presentation.js';
9
10
  import { RawTemporalPresentation } from './formatters/raw-temporal-presentation.js';
10
11
  type ExportTableOptions = {
11
- delimiter?: string;
12
+ delimiter?: CsvDelimiter;
13
+ encoding?: CsvEncoding;
12
14
  includeHeaders?: boolean;
13
15
  useFormattedValues?: boolean;
14
16
  comparisonMetadata?: ComparisonMetadataMap;
@@ -23,23 +25,23 @@ type ExportTableOptions = {
23
25
  /** Build a filesystem-safe CSV filename with the export time in UTC. */
24
26
  export declare function buildCsvExportFilename(title: string | null | undefined, generatedAt?: Date): string;
25
27
  /**
26
- * Export table data as CSV with column preferences
28
+ * The CSV file for plain records (charts and other non-table cards, and the
29
+ * editor's raw download). Columns are the union of record keys in first-seen
30
+ * order, so a record missing a key gets an empty cell.
27
31
  */
28
- export declare function exportTableAsCSV(data: any[], fileName: string, tablePreferences?: TablePreferences, card?: TCard, options?: ExportTableOptions): void;
32
+ export declare function buildRecordsCsv({ records, includeHeaders, delimiter, encoding, }: {
33
+ records: readonly Record<string, unknown>[];
34
+ includeHeaders?: boolean;
35
+ delimiter?: CsvDelimiter;
36
+ encoding?: CsvEncoding;
37
+ }): string;
29
38
  /**
30
- * Export table data with aggregations (for aggregated tables)
39
+ * Export table data as CSV with column preferences
31
40
  */
32
- export declare function exportAggregatedTableAsCSV(data: any[], fileName: string, groupByColumns?: string[], metricColumns?: string[], options?: {
33
- delimiter?: string;
34
- includeHeaders?: boolean;
35
- includeSubtotals?: boolean;
36
- includeGrandTotal?: boolean;
37
- }): void;
41
+ export declare function exportTableAsCSV(data: any[], fileName: string, tablePreferences?: TablePreferences, card?: TCard, options?: ExportTableOptions): void;
38
42
  /**
39
- * Export pivot table as CSV
43
+ * The CSV file for a Table or Detail Table, or undefined when there is
44
+ * nothing exportable.
40
45
  */
41
- export declare function exportPivotTableAsCSV(data: any[], fileName: string, rowHeaders?: string[], columnHeaders?: string[], options?: {
42
- delimiter?: string;
43
- includeHeaders?: boolean;
44
- }): void;
46
+ export declare function buildTableCsv(data: any[], tablePreferences?: TablePreferences, card?: TCard, options?: ExportTableOptions): string | undefined;
45
47
  export {};
@@ -1,4 +1,4 @@
1
- import { FilterGroup, FilterCondition, LogicalOperator, Field, FilterValue } from '../../types/explorer-types.js';
1
+ import { FilterGroup, FilterCondition, LogicalOperator, Field } from '../../types/explorer-types.js';
2
2
  interface UseFilterBuilderProps {
3
3
  initialFilters?: FilterGroup | null;
4
4
  availableFields?: Field[];
@@ -12,8 +12,8 @@ export declare function useFilterBuilder({ initialFilters, availableFields: prop
12
12
  addGroup: (parentGroupId: string) => void;
13
13
  removeCondition: (groupId: string, conditionId: string) => void;
14
14
  removeGroup: (parentGroupId: string, groupId: string) => void;
15
- updateCondition: (groupId: string, conditionId: string, field: keyof FilterCondition, value: FilterValue) => void;
16
15
  updateConditionFields: (groupId: string, conditionId: string, updates: Partial<FilterCondition>) => void;
16
+ replaceCondition: (groupId: string, conditionId: string, next: FilterCondition) => void;
17
17
  updateGroupOperator: (groupId: string, operator: LogicalOperator) => void;
18
18
  updateGroupNegate: (groupId: string, negate: boolean) => void;
19
19
  reorderConditions: (groupId: string, oldIndex: number, newIndex: number) => void;
@@ -0,0 +1,7 @@
1
+ import { RelativeDateSummary } from '../utils/relative-date-description.js';
2
+ import { RelativeDateFilter } from '../../shared/analytics-protocol/relative-date-filter.js';
3
+ /**
4
+ * Summarizes relative dates in the dashboard calendar and the viewer's date
5
+ * preferences (plan D8).
6
+ */
7
+ export declare function useRelativeDateSummarizer(): (relative: RelativeDateFilter) => RelativeDateSummary;
@@ -4,10 +4,11 @@ import { Field } from '../types/explorer-types.js';
4
4
  import { MatrixCardCatalog } from './matrix-card-adapter.js';
5
5
  /** Staged transport input. Auth and catalog grounding remain server-owned. */
6
6
  type ExecutionInput = Parameters<MatrixExecutionEnvironment['execute']>[0];
7
- export declare function buildMatrixCardQueryPayload(input: Pick<ExecutionInput, 'spec' | 'window' | 'cardId' | 'runtimeSorts'> & {
7
+ export declare function buildMatrixCardQueryPayload(input: Pick<ExecutionInput, 'spec' | 'window' | 'cardId' | 'runtimeSorts' | 'temporalState'> & {
8
8
  queryContext: Pick<ExecutionInput['queryContext'], 'cardFilterValues' | 'controlDefinitions' | 'cardControlDefinitions' | 'controlBindings' | 'controlValues'> & Partial<Pick<ExecutionInput['queryContext'], 'resolvedFilters'>>;
9
9
  reportContext: Pick<ExecutionInput['reportContext'], 'calendar'>;
10
10
  }): {
11
+ temporalState?: import('../../shared/analytics-protocol/index.js').OperationTemporalState | undefined;
11
12
  active_filters: import('../types/index.js').TFilterValue[];
12
13
  calendarContext: import('../types/index.js').CalendarContext;
13
14
  controlDefinitions: import('../types/index.js').ControlDefinition[];
@@ -38,7 +39,7 @@ export declare function buildMatrixCardQueryPayload(input: Pick<ExecutionInput,
38
39
  levelId: string;
39
40
  axis: "columns" | "rows";
40
41
  direction: "asc" | "desc";
41
- nulls: "first" | "last";
42
+ nulls: "last" | "first";
42
43
  }[] | undefined;
43
44
  runtimeFilters?: import('../types/explorer-types.js').FilterGroup | undefined;
44
45
  cardId: string;
@@ -318,7 +318,7 @@ export declare function prepareMatrixCard(card: TCard, catalog: MatrixCardCatalo
318
318
  levelId: string;
319
319
  axis: "columns" | "rows";
320
320
  direction: "asc" | "desc";
321
- nulls: "first" | "last";
321
+ nulls: "last" | "first";
322
322
  }[];
323
323
  rankings: readonly import('../../shared/analytics-protocol/index.js').MatrixRanking[];
324
324
  filters?: import('../types/explorer-types.js').FilterGroup | undefined;
@@ -298,7 +298,7 @@ export declare function initializeMatrixCardDraft(card: Pick<TCard, 'config' | '
298
298
  levelId: string;
299
299
  axis: "columns" | "rows";
300
300
  direction: "asc" | "desc";
301
- nulls: "first" | "last";
301
+ nulls: "last" | "first";
302
302
  }[];
303
303
  rankings: readonly import('../../shared/analytics-protocol/index.js').MatrixRanking[];
304
304
  filters?: import('../types/index.js').FilterGroup | undefined;
@@ -0,0 +1,47 @@
1
+ import { MatrixDatasetRetention } from './matrix-runtime-types.js';
2
+ /** Matrix fetching plan MF-D3 and MF-D4. */
3
+ export declare const MATRIX_HISTORY_LIMITS: Readonly<{
4
+ /** Restorable while the oldest piece is younger than this. */
5
+ freshMs: number;
6
+ entriesPerCard: 3;
7
+ entries: 12;
8
+ bytes: number;
9
+ }>;
10
+ /**
11
+ * Dashboard-scoped store of inactive Matrix datasets (plan INV-2 to INV-8).
12
+ *
13
+ * History holds only datasets no runtime is showing. A newly mounted runtime
14
+ * may also start from a copy of another runtime's live dataset (efficiency
15
+ * plan E-D1); the two then own their copies separately. History never limits
16
+ * or evicts live data: per card it holds at most what is left of the runtime
17
+ * allowance after the usage of the card's mounted runtimes, oldest saved first
18
+ * out. Entries are written only by `save` and never mutated afterwards.
19
+ */
20
+ export declare class MatrixDatasetHistory {
21
+ private readonly now;
22
+ private entries;
23
+ private generations;
24
+ private live;
25
+ /** Copies of live datasets handed out by `peek`, so `adopt` can recognize them. */
26
+ private seeds;
27
+ private scope?;
28
+ constructor(now?: () => number);
29
+ /** A new auth or host scope drops everything saved under the previous one. */
30
+ setScope(scope: string): void;
31
+ /** The retention one runtime uses, bound to its card and query identity. */
32
+ port(binding: {
33
+ scope: string;
34
+ card: string;
35
+ dataset: string;
36
+ }): MatrixDatasetRetention;
37
+ private generation;
38
+ /**
39
+ * A copy of another mounted runtime's dataset for the same card, query
40
+ * identity and sorts, when it is current and fresh (plan E-D1). Reading it
41
+ * changes no runtime; History only remembers the copy it handed out.
42
+ */
43
+ private seed;
44
+ private usable;
45
+ /** Oldest saved first out: expired, then over the card's remainder, then over the dashboard ceilings. */
46
+ private fit;
47
+ }