react-semaphor 0.1.443 → 0.1.445

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 (133) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/analytics-protocol/index.cjs +1 -1
  3. package/dist/analytics-protocol/index.js +123 -107
  4. package/dist/appearance/index.cjs +1 -1
  5. package/dist/brand-studio/index.cjs +2 -2
  6. package/dist/brand-studio/index.js +5 -4
  7. package/dist/briefings/index.cjs +1 -1
  8. package/dist/briefings/index.js +526 -457
  9. package/dist/chunks/analyze-result-contract-BHb7sUUW.cjs +1 -0
  10. package/dist/chunks/analyze-result-contract-DUv3QnMl.js +29 -0
  11. package/dist/chunks/{braces-CbO-aIwH.js → braces-BKimshER.cjs} +1 -1
  12. package/dist/chunks/{code-editor-BpADiIlq.js → code-editor-B4gTfvc5.js} +6800 -6560
  13. package/dist/chunks/code-editor-BYVorgOf.cjs +138 -0
  14. package/dist/chunks/common-types-CQ6SHfLk.cjs +1 -0
  15. package/dist/chunks/{common-types-ClkOI-3O.js → common-types-DFsDdpH7.js} +22 -21
  16. package/dist/chunks/dashboard-CAiwJW3L.cjs +1397 -0
  17. package/dist/chunks/{dashboard-briefing-launcher-C60n8LqW.js → dashboard-briefing-launcher-2SLNOaTg.js} +26 -24
  18. package/dist/chunks/{dashboard-briefing-launcher-BYMLjZxG.js → dashboard-briefing-launcher-CHwjpUYz.cjs} +2 -2
  19. package/dist/chunks/{dashboard-controls-ti9Rcel2.js → dashboard-controls-BfL14aqO.js} +11 -9
  20. package/dist/chunks/{dashboard-controls-BH_fZYDU.js → dashboard-controls-BgGTg4yw.cjs} +2 -2
  21. package/dist/chunks/dashboard-date-comparison-definition-DZq0htjG.cjs +1 -0
  22. package/dist/chunks/dashboard-json-BOv8tCa9.cjs +1 -0
  23. package/dist/chunks/{dashboard-json-Bturr634.js → dashboard-json-BZwq3EcS.js} +14 -12
  24. package/dist/chunks/{dashboard-Bd1Quco-.js → dashboard-u61yfU6u.js} +50081 -47351
  25. package/dist/chunks/edit-dashboard-visual-BdVCH0DJ.cjs +182 -0
  26. package/dist/chunks/{edit-dashboard-visual-DglMds57.js → edit-dashboard-visual-njLPYip3.js} +6825 -6656
  27. package/dist/chunks/{editor-action-buttons-CRi0fhVW.js → editor-action-buttons-BhLX5Q6m.js} +24 -23
  28. package/dist/chunks/{editor-action-buttons-Cxo7_tNG.js → editor-action-buttons-CBVMFipA.cjs} +1 -1
  29. package/dist/chunks/{index-D7KJindZ.js → format-types-CSv0V7mm.cjs} +1 -1
  30. package/dist/chunks/{index-CnujJ3fa.js → format-types-CZH5w1lo.js} +23 -17
  31. package/dist/chunks/{layout-grid-B08pP7v6.js → layout-grid-3-HWzEwU.cjs} +1 -1
  32. package/dist/chunks/{metric-comparison-CPoDx56y.js → metric-comparison-BJ_Qu1ZF.js} +1 -1
  33. package/dist/chunks/metric-comparison-CUAJ8n4y.cjs +1 -0
  34. package/dist/chunks/{palette-C0yjT5Tv.js → palette-DW_l7Jr0.cjs} +1 -1
  35. package/dist/chunks/pivot-result-identity-B6QCWOSi.js +94 -0
  36. package/dist/chunks/pivot-result-identity-CDLRT-YG.cjs +1 -0
  37. package/dist/chunks/pivot-result-lifecycle-BM3Pl-D1.js +914 -0
  38. package/dist/chunks/pivot-result-lifecycle-DPc0ANwk.cjs +4 -0
  39. package/dist/chunks/presentation-execution-BTV-Q43g.cjs +1 -0
  40. package/dist/chunks/presentation-execution-CGlb7YZ6.js +637 -0
  41. package/dist/chunks/{report-preferences-dialog-TtwdAuNn.js → report-preferences-dialog-D_NJu2wU.js} +7 -6
  42. package/dist/chunks/report-preferences-dialog-r8QzOSFb.cjs +1 -0
  43. package/dist/chunks/report-runtime-context-C8LZFsqV.cjs +1 -0
  44. package/dist/chunks/report-runtime-context-Qzn11HQe.js +387 -0
  45. package/dist/chunks/{save-Xdc4pnys.js → save-4_uMnE6s.cjs} +1 -1
  46. package/dist/chunks/{search-Dcud9ajy.js → search-6ZmeMq55.cjs} +1 -1
  47. package/dist/chunks/temporal-bucket-BnPxGrAi.js +446 -0
  48. package/dist/chunks/temporal-bucket-authoring-BUZMuVca.js +205 -0
  49. package/dist/chunks/temporal-bucket-authoring-CPTwHzvs.cjs +1 -0
  50. package/dist/chunks/temporal-bucket-contract-B2bJ1oe4.js +108 -0
  51. package/dist/chunks/temporal-bucket-contract-ChDBWX8I.cjs +1 -0
  52. package/dist/chunks/temporal-bucket-pMnV-4Nj.cjs +1 -0
  53. package/dist/chunks/{comparison-document-migration-Dj6xZMCb.js → temporal-result-owner-Cb27SSG9.js} +152 -123
  54. package/dist/chunks/temporal-result-owner-f6-i65Fb.cjs +1 -0
  55. package/dist/chunks/token-types-BdQ8kHBm.cjs +1 -0
  56. package/dist/chunks/token-types-DLo91nOf.js +8 -0
  57. package/dist/chunks/{update-policy-DnF_74zC.js → update-policy-BxvYMYz0.cjs} +1 -1
  58. package/dist/chunks/{update-policy-De2NswtM.js → update-policy-eg59mQqv.js} +1 -1
  59. package/dist/chunks/validators-9D4KBqKD.cjs +1 -0
  60. package/dist/chunks/validators-wZ2WlNHc.js +4640 -0
  61. package/dist/dashboard/index.cjs +1 -1
  62. package/dist/dashboard/index.js +2 -2
  63. package/dist/dashboard-authoring/index.cjs +3 -3
  64. package/dist/dashboard-authoring/index.js +136 -126
  65. package/dist/data-app-builder/index.cjs +1 -1
  66. package/dist/data-app-builder/index.js +2 -2
  67. package/dist/data-app-codegen/index.cjs +1 -1
  68. package/dist/data-app-codegen/index.js +2 -2
  69. package/dist/data-app-codegen-node/index.cjs +1 -1
  70. package/dist/data-app-codegen-node/index.js +3 -3
  71. package/dist/data-app-sdk/index.cjs +2 -2
  72. package/dist/data-app-sdk/index.js +34 -35
  73. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  74. package/dist/data-app-sdk-adapters/index.js +5 -5
  75. package/dist/data-app-sdk-validation/index.cjs +1 -1
  76. package/dist/data-app-sdk-validation/index.js +9 -10
  77. package/dist/format-utils/index.cjs +3 -3
  78. package/dist/format-utils/index.js +155 -176
  79. package/dist/index.cjs +1 -1
  80. package/dist/index.js +180 -174
  81. package/dist/report-runtime-context/index.cjs +1 -1
  82. package/dist/report-runtime-context/index.js +7 -392
  83. package/dist/shared/index.cjs +1 -1
  84. package/dist/style.css +1 -1
  85. package/dist/surfboard/index.cjs +1 -1
  86. package/dist/surfboard/index.js +3 -3
  87. package/dist/types/analytics-protocol.d.ts +257 -48
  88. package/dist/types/briefings.d.ts +138 -50
  89. package/dist/types/dashboard-assistant.d.ts +207 -52
  90. package/dist/types/dashboard-authoring.d.ts +182 -50
  91. package/dist/types/dashboard.d.ts +290 -48
  92. package/dist/types/data-app-builder.d.ts +48 -42
  93. package/dist/types/data-app-codegen-node.d.ts +50 -44
  94. package/dist/types/data-app-codegen.d.ts +50 -44
  95. package/dist/types/data-app-sdk-adapters.d.ts +48 -42
  96. package/dist/types/data-app-sdk-validation.d.ts +81 -43
  97. package/dist/types/data-app-sdk.d.ts +83 -45
  98. package/dist/types/format-utils.d.ts +645 -67
  99. package/dist/types/index.cjs +1 -1
  100. package/dist/types/index.js +19 -19
  101. package/dist/types/main.d.ts +298 -94
  102. package/dist/types/report-runtime-context.d.ts +3 -0
  103. package/dist/types/shared.d.ts +116 -41
  104. package/dist/types/surfboard.d.ts +290 -48
  105. package/dist/types/types.d.ts +455 -65
  106. package/package.json +3 -1
  107. package/dist/chunks/analyze-result-contract-BswhsmWT.js +0 -1
  108. package/dist/chunks/analyze-result-contract-CfOBEwaC.js +0 -1998
  109. package/dist/chunks/code-editor-M7HTUhdF.js +0 -138
  110. package/dist/chunks/common-types-C73-Ud1-.js +0 -1
  111. package/dist/chunks/comparison-document-migration-DbU_BTxR.js +0 -1
  112. package/dist/chunks/csv-utils-BZDvO2Fw.js +0 -376
  113. package/dist/chunks/csv-utils-Co0WxHke.js +0 -4
  114. package/dist/chunks/dashboard-cB3xmTNn.js +0 -1402
  115. package/dist/chunks/dashboard-date-comparison-definition-DGZr3m-b.js +0 -1
  116. package/dist/chunks/dashboard-json-Dw_55vSZ.js +0 -1
  117. package/dist/chunks/edit-dashboard-visual-BUc3NBQ4.js +0 -182
  118. package/dist/chunks/metric-comparison-DVy3fll_.js +0 -1
  119. package/dist/chunks/numeric-presentation-BJs5lSar.js +0 -517
  120. package/dist/chunks/numeric-presentation-Dlb-Dk4c.js +0 -1
  121. package/dist/chunks/report-preferences-dialog-CCvFqH4Q.js +0 -1
  122. package/dist/chunks/source-identity-5OPV4gvg.js +0 -92
  123. package/dist/chunks/source-identity-Cbo2LOHQ.js +0 -1
  124. package/dist/chunks/validators-B2vUAqTf.js +0 -1
  125. package/dist/chunks/validators-Bce_J7Vd.js +0 -2448
  126. /package/dist/chunks/{card-config-utils-15sRtebL.js → card-config-utils-15sRtebL.cjs} +0 -0
  127. /package/dist/chunks/{catalog-field-grounding-Bnx-3tE0.js → catalog-field-grounding-Bnx-3tE0.cjs} +0 -0
  128. /package/dist/chunks/{dashboard-input-contract-DV3cshjz.js → dashboard-input-contract-DV3cshjz.cjs} +0 -0
  129. /package/dist/chunks/{index-Dpm_VET4.js → index-Dpm_VET4.cjs} +0 -0
  130. /package/dist/chunks/{index-jSrCwPQz.js → index-jSrCwPQz.cjs} +0 -0
  131. /package/dist/chunks/{normalize-dashboard-for-dirty-check-BXRUMVb2.js → normalize-dashboard-for-dirty-check-BXRUMVb2.cjs} +0 -0
  132. /package/dist/chunks/{operators-DrTQsJXv.js → operators-DrTQsJXv.cjs} +0 -0
  133. /package/dist/chunks/{use-debounced-dirty-check-XHSwAefL.js → use-debounced-dirty-check-XHSwAefL.cjs} +0 -0
@@ -137,8 +137,16 @@ declare type BaseFilter = {
137
137
  dataType?: string;
138
138
  fieldMeta?: FilterFieldMeta;
139
139
  semanticContext?: FilterSemanticContext;
140
+ /** Governed meaning for canonical grouped-temporal filter values. */
141
+ temporalBucket?: TemporalBucketMetadata;
140
142
  };
141
143
 
144
+ declare interface BaseInteractionEvent {
145
+ sourceCardId: string;
146
+ filterGroups: ClickFilterConditionGroup[];
147
+ metric?: ClickedMetricValue;
148
+ }
149
+
142
150
  declare type BaseSurfaceAppearance = {
143
151
  background?: string;
144
152
  foreground?: string;
@@ -273,9 +281,6 @@ declare interface CardConfig {
273
281
  * Configuration for on-click dashboard filters triggered by this card.
274
282
  */
275
283
  clickFilterInteractions?: ClickFilterInteraction[];
276
- showTrendline?: boolean;
277
- trendlineWindow?: number;
278
- trendlineGranularity?: 'day' | 'week' | 'month';
279
284
  summary?: {
280
285
  enabled?: boolean;
281
286
  showOnCard?: boolean;
@@ -330,6 +335,38 @@ declare type ChartAppearance = {
330
335
  axisColor?: string;
331
336
  };
332
337
 
338
+ declare interface ClickedMetricValue {
339
+ field: Field;
340
+ value: number;
341
+ formattedValue?: string;
342
+ }
343
+
344
+ declare interface ClickFilterCondition {
345
+ field: Field;
346
+ operator: Operator;
347
+ value: string | number | null;
348
+ label?: string;
349
+ /** Governed meaning for a canonical grouped-temporal scalar. */
350
+ temporalBucket?: TemporalBucketMetadata;
351
+ }
352
+
353
+ declare interface ClickFilterConditionGroup {
354
+ filters: ClickFilterCondition[];
355
+ }
356
+
357
+ declare interface ClickFilterEvent extends BaseInteractionEvent {
358
+ interactionMode: 'clickFilter';
359
+ applyToCardIds?: string[];
360
+ excludeCardIds?: string[];
361
+ /**
362
+ * Whether the source card should receive its own filter.
363
+ * When true, the source card will be filtered (not just blurred).
364
+ * Used when user selects from multiple interactions popup.
365
+ * @default false
366
+ */
367
+ filterSourceCard?: boolean;
368
+ }
369
+
333
370
  declare interface ClickFilterInteraction {
334
371
  mode: 'clickFilter';
335
372
  /**
@@ -608,7 +645,10 @@ export declare type ControlOption = {
608
645
  label: string;
609
646
  presentation?: {
610
647
  granularity?: TimeGranularity;
648
+ format?: TemporalBucketFormat;
649
+ /** Saved-dashboard compatibility only. New authoring writes `format`. */
611
650
  dateFormat?: DateFormatValue;
651
+ /** Saved-dashboard compatibility only. New authoring writes `format`. */
612
652
  customFormat?: string;
613
653
  };
614
654
  };
@@ -852,6 +892,11 @@ export declare type DashboardProps = {
852
892
  * inputs instead of documentInputValues.
853
893
  */
854
894
  dashboardInputExecutionSnapshot?: DashboardInputExecutionSnapshot;
895
+ /**
896
+ * Runtime interaction state captured for deterministic print/replay entry
897
+ * points. Ordinary dashboard consumers should leave this unset.
898
+ */
899
+ interactionExecutionSnapshot?: Record<string, InteractionState>;
855
900
  /**
856
901
  * Render target for print entry points. Generic dashboard PDF exports also
857
902
  * use cardDisplay.mode="print"; document-specific print handling must only
@@ -1180,6 +1225,43 @@ export declare type DocumentVariableRef = {
1180
1225
  key: 'generatedAt' | 'pageNumber' | 'pageCount';
1181
1226
  };
1182
1227
 
1228
+ declare interface DrillBreadcrumb {
1229
+ /**
1230
+ * The user clicked one or more segments. Each group of filters represents
1231
+ * a single segment (i.e., a single click interaction).
1232
+ *
1233
+ * - Filters within a group are AND-ed (e.g., state = 'NY' AND ship_mode = 'Standard').
1234
+ * - Across groups, they are OR-ed (e.g., ... OR state = 'CA' AND ship_mode = 'First Class').
1235
+ */
1236
+ sourceFilterGroups: ClickFilterConditionGroup[];
1237
+ /**
1238
+ * The next (group by) field the user is drilling into (e.g., 'city' after 'state').
1239
+ */
1240
+ toField?: Field;
1241
+ /**
1242
+ * Optional: If the drill target is a time field, this describes the granularity (e.g., month, year).
1243
+ */
1244
+ granularity?: TimeGranularity;
1245
+ /**
1246
+ * Optional: Indicates whether the drill is for time comparison (e.g., YoY).
1247
+ */
1248
+ timeComparison?: TimeComparison;
1249
+ /**
1250
+ * Optional: The metric the user clicked (e.g., '123 Orders'), used for display only.
1251
+ */
1252
+ metric?: ClickedMetricValue;
1253
+ }
1254
+
1255
+ declare interface DrillDownEvent extends BaseInteractionEvent {
1256
+ interactionMode: 'drillDown';
1257
+ hierarchyId: string;
1258
+ filterGroups: ClickFilterConditionGroup[];
1259
+ metric?: ClickedMetricValue;
1260
+ toField: Field;
1261
+ granularity?: TimeGranularity;
1262
+ timeComparison?: TimeComparison;
1263
+ }
1264
+
1183
1265
  declare interface DrillDownInteraction {
1184
1266
  mode: 'drillDown';
1185
1267
  /**
@@ -1211,6 +1293,12 @@ declare interface DrillHierarchyStep {
1211
1293
  linkedInsightId?: string;
1212
1294
  }
1213
1295
 
1296
+ declare interface DrillThroughEvent extends BaseInteractionEvent {
1297
+ interactionMode: 'drillThrough';
1298
+ targetDashboardId: string;
1299
+ contextMode?: 'interactionFilters' | 'full' | 'none';
1300
+ }
1301
+
1214
1302
  declare interface DrillThroughInteraction {
1215
1303
  mode: 'drillThrough';
1216
1304
  /**
@@ -1228,6 +1316,17 @@ declare interface DrillThroughInteraction {
1228
1316
  label?: string;
1229
1317
  }
1230
1318
 
1319
+ declare interface DrillToDetailEvent extends BaseInteractionEvent {
1320
+ interactionMode: 'drillToDetail';
1321
+ detailFields: Field[];
1322
+ sortBy?: SortByField[];
1323
+ limit?: number;
1324
+ detailTitle?: string;
1325
+ targetInsightId?: string;
1326
+ contextMode?: 'interactionFilters' | 'full' | 'none';
1327
+ displayMode?: 'modal' | 'replace-card';
1328
+ }
1329
+
1231
1330
  declare interface DrillToDetailInteraction {
1232
1331
  mode: 'drillToDetail';
1233
1332
  /**
@@ -1257,6 +1356,11 @@ declare interface DrillToDetailInteraction {
1257
1356
  label?: string;
1258
1357
  }
1259
1358
 
1359
+ declare interface DrillToURLEvent extends BaseInteractionEvent {
1360
+ interactionMode: 'drillToURL';
1361
+ url: string;
1362
+ }
1363
+
1260
1364
  declare interface DrillToURLInteraction {
1261
1365
  mode: 'drillToURL';
1262
1366
  /**
@@ -1300,6 +1404,15 @@ declare interface DrillUpInteraction {
1300
1404
 
1301
1405
  export declare type DroppableId = 'droppable-group-by' | 'droppable-metric';
1302
1406
 
1407
+ declare interface DynamicDrillEvent extends BaseInteractionEvent {
1408
+ interactionMode: 'dynamicDrill';
1409
+ filterGroups: ClickFilterConditionGroup[];
1410
+ metric?: ClickedMetricValue;
1411
+ toField: Field;
1412
+ granularity?: TimeGranularity;
1413
+ timeComparison?: TimeComparison;
1414
+ }
1415
+
1303
1416
  declare interface DynamicDrillInteraction {
1304
1417
  mode: 'dynamicDrill';
1305
1418
  /**
@@ -1345,8 +1458,9 @@ export declare type ExportDataPayload = {
1345
1458
 
1346
1459
  declare interface Field {
1347
1460
  /**
1348
- * Unique identifier for this field instance (for joins, UI state, etc.).
1349
- * Should be unique within the context of the query or data model.
1461
+ * Stable authored/semantic field identifier (for joins, UI state, etc.).
1462
+ * It is normally unique within a role, but one saved query may reuse it in
1463
+ * different roles; result bindings must therefore include the role.
1350
1464
  * Example: 'orders.customer_id', 'expr_12345', etc.
1351
1465
  */
1352
1466
  id: string;
@@ -1388,6 +1502,12 @@ declare interface Field {
1388
1502
  */
1389
1503
  derivedField?: SemaphorDerivedFieldDefinition;
1390
1504
  format?: FormatSpec;
1505
+ /**
1506
+ * Source-level temporal presentation keeps the semantic grain that authored
1507
+ * the format. The card's mutable `granularity` remains the active query
1508
+ * grain, so changing it cannot accidentally retarget a semantic default.
1509
+ */
1510
+ semanticTemporalPresentation?: SemanticTemporalPresentation;
1391
1511
  aggregate?: AggregateFunction;
1392
1512
  fieldScope?: FieldScope;
1393
1513
  }
@@ -1431,6 +1551,10 @@ declare interface FilterCondition {
1431
1551
  field: Field;
1432
1552
  operator: Operator;
1433
1553
  value: FilterValue;
1554
+ /** Display-only label for canonical grouped-temporal values. */
1555
+ label?: string;
1556
+ /** Governed meaning for a canonical grouped-temporal scalar. */
1557
+ temporalBucket?: TemporalBucketMetadata;
1434
1558
  }
1435
1559
 
1436
1560
  export declare type FilterDashboardInput = DashboardInputBase & {
@@ -1591,7 +1715,7 @@ declare type FormatSpec = {
1591
1715
  type: 'string';
1592
1716
  prefix?: string;
1593
1717
  suffix?: string;
1594
- };
1718
+ } | TemporalBucketFormat;
1595
1719
 
1596
1720
  export declare type GetDashboardResponse = {
1597
1721
  dashboard: TDashboard;
@@ -1620,7 +1744,7 @@ declare type GlobalDateComparisonSelection = {
1620
1744
  spec: ViewerPeriodComparisonSpec;
1621
1745
  };
1622
1746
 
1623
- declare type Granularity = 'day' | 'week' | 'month' | 'quarter' | 'year' | 'hour' | 'minute' | 'second';
1747
+ declare type Granularity = SemaphorTimeGrain;
1624
1748
 
1625
1749
  declare interface GroupByColumn extends BaseColumn {
1626
1750
  role: 'groupby';
@@ -1631,6 +1755,11 @@ declare interface GroupByColumn extends BaseColumn {
1631
1755
  declare interface GroupByField extends Field {
1632
1756
  role: 'groupby';
1633
1757
  granularity?: TimeGranularity;
1758
+ /**
1759
+ * Query transport policy for grouped temporal values. This is projected
1760
+ * into executable card config and is not persisted authoring state.
1761
+ */
1762
+ dateValueMode?: 'canonical' | 'formatted';
1634
1763
  /**
1635
1764
  * Optional SQL expression for grouping (e.g., DATE_TRUNC('month', order_date)).
1636
1765
  * If present, used in SELECT and GROUP BY instead of just the column name.
@@ -1644,6 +1773,12 @@ export declare type HtmlOptions = {
1644
1773
  html: string;
1645
1774
  };
1646
1775
 
1776
+ declare interface InlineDrillEvent extends BaseInteractionEvent {
1777
+ interactionMode: 'inlineDrill';
1778
+ fetchMode?: 'lazy' | 'preloaded';
1779
+ inlineLimit?: number;
1780
+ }
1781
+
1647
1782
  declare interface InlineDrillInteraction {
1648
1783
  mode: 'inlineDrill';
1649
1784
  /**
@@ -1686,6 +1821,60 @@ declare interface InlineDrillInteraction {
1686
1821
  */
1687
1822
  declare type Interaction = ClickFilterInteraction | DrillDownInteraction | DrillThroughInteraction | DrillToDetailInteraction | DrillToURLInteraction | InlineDrillInteraction | DrillUpInteraction | DynamicDrillInteraction;
1688
1823
 
1824
+ declare type InteractionEvent = DrillDownEvent | DynamicDrillEvent | DrillToURLEvent | DrillThroughEvent | DrillToDetailEvent | InlineDrillEvent | ClickFilterEvent;
1825
+
1826
+ declare interface InteractionState {
1827
+ /**
1828
+ * If user is in a drill hierarchy (static or dynamic), this tracks which one.
1829
+ * Undefined if not currently in a drill path.
1830
+ */
1831
+ hierarchyId?: string;
1832
+ /**
1833
+ * Breadcrumb trail representing the user's drill path.
1834
+ * Empty if no drill-down steps have occurred.
1835
+ */
1836
+ breadcrumbs: DrillBreadcrumb[];
1837
+ /**
1838
+ * All click filters applied from this card
1839
+ */
1840
+ appliedClickFilters?: ClickFilterEvent[];
1841
+ /**
1842
+ * (Optional) Track last one-off interaction (e.g., drillToDetail, drillToURL).
1843
+ * Useful for things like modals or redirection handling.
1844
+ */
1845
+ lastInteractionEvent?: InteractionEvent;
1846
+ /**
1847
+ * Context mode for drill-to-insight filtering.
1848
+ * Controls whether dashboard filters are applied alongside interaction filters.
1849
+ *
1850
+ * - 'interactionFilters': Only filters from the interaction event (no dashboard filters)
1851
+ * - 'full': Dashboard filters + interaction filters
1852
+ * - 'none': No filters applied
1853
+ *
1854
+ * Undefined for regular cards (not insights).
1855
+ */
1856
+ contextMode?: 'interactionFilters' | 'full' | 'none';
1857
+ /**
1858
+ * Source dashboard ID for drill-through navigation.
1859
+ * Used for "Back" button navigation.
1860
+ * Only set for global drill context (interactionStates['__DRILL_CONTEXT__']).
1861
+ */
1862
+ sourceDashboardId?: string;
1863
+ /**
1864
+ * Source dashboard title for drill-through navigation.
1865
+ * Used for "Back to [X]" UI display.
1866
+ * Only set for global drill context (interactionStates['__DRILL_CONTEXT__']).
1867
+ */
1868
+ sourceDashboardTitle?: string;
1869
+ /**
1870
+ * Target dashboard ID for drill-through navigation.
1871
+ * Filters only apply when current dashboard matches this ID.
1872
+ * Prevents filters from applying to source dashboard during navigation.
1873
+ * Only set for global drill context (interactionStates['__DRILL_CONTEXT__']).
1874
+ */
1875
+ targetDashboardId?: string;
1876
+ }
1877
+
1689
1878
  declare interface InteractionTargetOverride {
1690
1879
  applyToCardIds?: string[] | null;
1691
1880
  excludeCardIds?: string[] | null;
@@ -1941,6 +2130,11 @@ declare type PersistedInteraction = Interaction & {
1941
2130
 
1942
2131
  declare interface PivotByField extends Field {
1943
2132
  role: 'pivotby';
2133
+ /**
2134
+ * Query transport policy for grouped temporal pivot members. This is
2135
+ * projected into executable config and is never persisted authoring state.
2136
+ */
2137
+ dateValueMode?: 'canonical' | 'formatted';
1944
2138
  }
1945
2139
 
1946
2140
  export declare type Placeholders = {
@@ -2079,7 +2273,15 @@ export declare type ResolvedDocumentInput = {
2079
2273
  exports: Record<string, string | number | boolean | null>;
2080
2274
  };
2081
2275
 
2082
- declare type ResolvedPrimaryDateField = {
2276
+ declare type ResolvedPrimaryDateField = (ResolvedPrimaryDateFieldBase & ({
2277
+ defaultGranularity?: SemaphorTimeGrain;
2278
+ format?: undefined;
2279
+ } | {
2280
+ defaultGranularity: SemaphorTimeGrain;
2281
+ format: TemporalBucketFormat;
2282
+ })) | null;
2283
+
2284
+ declare type ResolvedPrimaryDateFieldBase = {
2083
2285
  sourceDataset: string;
2084
2286
  sourceField: string;
2085
2287
  name: string;
@@ -2089,13 +2291,10 @@ declare type ResolvedPrimaryDateField = {
2089
2291
  entityName: string;
2090
2292
  entityType: string;
2091
2293
  dataType: string;
2092
- /** Canonical dataset coordinates stamped by the temporal grounding boundary. */
2294
+ /** Canonical dataset coordinates stamped by the semantic grounding boundary. */
2093
2295
  source?: SemaphorSourceRef;
2094
- dateFormat?: string;
2095
- customFormat?: string;
2096
- defaultGranularity?: TimeGranularity;
2097
- supportedGranularities?: TimeGranularity[];
2098
- } | null;
2296
+ supportedGranularities?: SemaphorTimeGrain[];
2297
+ };
2099
2298
 
2100
2299
  declare type ResolvedValueFormatPreferences = {
2101
2300
  locale: string;
@@ -2131,6 +2330,15 @@ declare type SemanticExecutionPayload = {
2131
2330
  }>;
2132
2331
  };
2133
2332
 
2333
+ declare type SemanticTemporalPresentation = {
2334
+ granularity: SemaphorTimeGrain;
2335
+ format: TemporalBucketFormat;
2336
+ };
2337
+
2338
+ declare const SEMAPHOR_MATRIX_TIME_GRAINS: ["hour", "day", "week", "month", "quarter", "year"];
2339
+
2340
+ declare const SEMAPHOR_TIME_GRAINS: readonly ["second", "minute", "hour", "day", "week", "month", "quarter", "year"];
2341
+
2134
2342
  declare type SemaphorAggregateFunction = 'SUM' | 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'MEDIAN' | 'DISTINCT';
2135
2343
 
2136
2344
  declare type SemaphorAnalyticsFilter = SemaphorAnalyticsValueFilter | SemaphorAnalyticsNullFilter;
@@ -2184,7 +2392,7 @@ declare type SemaphorDerivedFieldDefinition = {
2184
2392
  defaultAggregate?: SemaphorAggregateFunction;
2185
2393
  aggregationBehavior?: SemaphorDerivedFieldAggregationBehavior;
2186
2394
  aggregationStrategy?: SemaphorDerivedFieldAggregationStrategy;
2187
- format?: SemaphorValueFormat;
2395
+ format?: SemaphorScalarValueFormat;
2188
2396
  tags?: string[];
2189
2397
  };
2190
2398
 
@@ -2235,7 +2443,7 @@ declare type SemaphorMatrixAxisExpansionOptions = {
2235
2443
  declare type SemaphorMatrixAxisLevel = {
2236
2444
  id?: string;
2237
2445
  field: SemaphorFieldRef;
2238
- grain?: SemaphorTimeGrain;
2446
+ grain?: SemaphorMatrixTimeGrain;
2239
2447
  label?: string;
2240
2448
  subtotal?: boolean | SemaphorMatrixSubtotalOptions;
2241
2449
  sortBy?: SemaphorMatrixAxisSortRule;
@@ -2327,6 +2535,8 @@ declare type SemaphorMatrixSubtotalOptions = {
2327
2535
  label?: string;
2328
2536
  };
2329
2537
 
2538
+ declare type SemaphorMatrixTimeGrain = (typeof SEMAPHOR_MATRIX_TIME_GRAINS)[number];
2539
+
2330
2540
  declare type SemaphorMatrixTotalCalculation = {
2331
2541
  kind: 'defaultAggregate';
2332
2542
  } | {
@@ -2362,7 +2572,7 @@ declare type SemaphorMatrixValueField = {
2362
2572
  field: SemaphorFieldRef;
2363
2573
  aggregate?: SemaphorAggregateFunction;
2364
2574
  label?: string;
2365
- format?: SemaphorValueFormat;
2575
+ format?: SemaphorScalarValueFormat;
2366
2576
  totalBehavior?: SemaphorMatrixTotalCalculation;
2367
2577
  };
2368
2578
 
@@ -2372,36 +2582,7 @@ declare type SemaphorRelationshipHint = {
2372
2582
  relationshipIds?: string[];
2373
2583
  };
2374
2584
 
2375
- declare type SemaphorSemanticSourceRef = Extract<SemaphorSourceRef, {
2376
- kind: 'semantic';
2377
- }>;
2378
-
2379
- declare type SemaphorSourceRef = {
2380
- kind: 'semantic';
2381
- domainId: string;
2382
- datasetName: string;
2383
- datasetId?: string;
2384
- label?: string;
2385
- connectionId?: string;
2386
- } | {
2387
- kind: 'physical';
2388
- connectionId: string;
2389
- connectionType?: string;
2390
- tableName: string;
2391
- databaseName?: string;
2392
- schemaName?: string;
2393
- label?: string;
2394
- dialect?: SemaphorDialect;
2395
- } | {
2396
- kind: 'sql';
2397
- connectionId: string;
2398
- dialect?: SemaphorDialect;
2399
- label?: string;
2400
- };
2401
-
2402
- declare type SemaphorTimeGrain = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
2403
-
2404
- declare type SemaphorValueFormat = {
2585
+ declare type SemaphorScalarValueFormat = {
2405
2586
  type: 'number' | 'currency' | 'percent' | 'percentage' | 'scientific';
2406
2587
  minimumFractionDigits?: number;
2407
2588
  maximumFractionDigits?: number;
@@ -2438,6 +2619,35 @@ declare type SemaphorValueFormat = {
2438
2619
  suffix?: string;
2439
2620
  };
2440
2621
 
2622
+ declare type SemaphorSemanticSourceRef = Extract<SemaphorSourceRef, {
2623
+ kind: 'semantic';
2624
+ }>;
2625
+
2626
+ declare type SemaphorSourceRef = {
2627
+ kind: 'semantic';
2628
+ domainId: string;
2629
+ datasetName: string;
2630
+ datasetId?: string;
2631
+ label?: string;
2632
+ connectionId?: string;
2633
+ } | {
2634
+ kind: 'physical';
2635
+ connectionId: string;
2636
+ connectionType?: string;
2637
+ tableName: string;
2638
+ databaseName?: string;
2639
+ schemaName?: string;
2640
+ label?: string;
2641
+ dialect?: SemaphorDialect;
2642
+ } | {
2643
+ kind: 'sql';
2644
+ connectionId: string;
2645
+ dialect?: SemaphorDialect;
2646
+ label?: string;
2647
+ };
2648
+
2649
+ declare type SemaphorTimeGrain = (typeof SEMAPHOR_TIME_GRAINS)[number];
2650
+
2441
2651
  declare interface SortByField extends Field {
2442
2652
  role: 'sortby';
2443
2653
  direction: 'asc' | 'desc';
@@ -3052,6 +3262,7 @@ export declare type TDataColumn = {
3052
3262
  calculatedFormula?: CalculatedFieldFormula;
3053
3263
  derivedField?: SemaphorDerivedFieldDefinition;
3054
3264
  format?: FormatSpec;
3265
+ granularity?: TimeGranularity;
3055
3266
  sourceField?: string;
3056
3267
  aggregate?: AggregateFunction;
3057
3268
  };
@@ -3154,6 +3365,31 @@ export declare type TDynamicVisualIntent = {
3154
3365
  includesKpis: boolean;
3155
3366
  };
3156
3367
 
3368
+ declare const TEMPORAL_BUCKET_PRESETS: readonly ["week_of_short", "week_of_long", "quarter_short", "quarter_long", "fiscal_quarter_short", "fiscal_year"];
3369
+
3370
+ declare type TemporalBucketFormat = {
3371
+ type: 'temporal_bucket';
3372
+ presentation: TemporalBucketPresentation;
3373
+ };
3374
+
3375
+ declare type TemporalBucketMetadata = {
3376
+ kind: 'temporal_bucket';
3377
+ granularity: SemaphorTimeGrain;
3378
+ calendar: Pick<CalendarContext, 'tz' | 'weekStart' | 'fiscalCalendar'>;
3379
+ };
3380
+
3381
+ declare type TemporalBucketPresentation = {
3382
+ mode: 'auto';
3383
+ } | {
3384
+ mode: 'preset';
3385
+ preset: TemporalBucketPreset;
3386
+ } | {
3387
+ mode: 'pattern';
3388
+ pattern: string;
3389
+ };
3390
+
3391
+ declare type TemporalBucketPreset = (typeof TEMPORAL_BUCKET_PRESETS)[number];
3392
+
3157
3393
  declare type TemporalPrecision = 'minute';
3158
3394
 
3159
3395
  export declare type TEvent = {
@@ -3341,6 +3577,12 @@ export declare type THeatmapConfig = {
3341
3577
 
3342
3578
  export declare type Theme = 'dark' | 'light' | 'system';
3343
3579
 
3580
+ declare interface TimeComparison {
3581
+ type: 'previous_year' | 'previous_period';
3582
+ offset: number;
3583
+ granularity: TimeGranularity;
3584
+ }
3585
+
3344
3586
  declare interface TimeDrillStep {
3345
3587
  granularity: TimeGranularity;
3346
3588
  next?: TimeGranularity;
@@ -3348,7 +3590,7 @@ declare interface TimeDrillStep {
3348
3590
  rollingWindow?: number;
3349
3591
  }
3350
3592
 
3351
- declare type TimeGranularity = 'day' | 'week' | 'month' | 'quarter' | 'year' | 'hour' | 'minute' | 'second';
3593
+ declare type TimeGranularity = SemaphorTimeGrain;
3352
3594
 
3353
3595
  /**
3354
3596
  * Inline filter definition stored on a card.
@@ -539,6 +539,10 @@ export declare type GeneratedRevision = {
539
539
 
540
540
  export declare type ReasoningEffort = 'low' | 'medium' | 'high';
541
541
 
542
+ declare const SEMAPHOR_MATRIX_TIME_GRAINS: ["hour", "day", "week", "month", "quarter", "year"];
543
+
544
+ declare const SEMAPHOR_TIME_GRAINS: readonly ["second", "minute", "hour", "day", "week", "month", "quarter", "year"];
545
+
542
546
  declare type SemaphorAbsoluteTimeWindow = {
543
547
  kind: 'absolute';
544
548
  start: string;
@@ -600,7 +604,7 @@ declare type SemaphorDerivedFieldDefinition = {
600
604
  defaultAggregate?: SemaphorAggregateFunction;
601
605
  aggregationBehavior?: SemaphorDerivedFieldAggregationBehavior;
602
606
  aggregationStrategy?: SemaphorDerivedFieldAggregationStrategy;
603
- format?: SemaphorValueFormat;
607
+ format?: SemaphorScalarValueFormat;
604
608
  tags?: string[];
605
609
  };
606
610
 
@@ -670,7 +674,7 @@ declare type SemaphorMatrixAxisExpansionOptions = {
670
674
  declare type SemaphorMatrixAxisLevel = {
671
675
  id?: string;
672
676
  field: SemaphorFieldRef;
673
- grain?: SemaphorTimeGrain;
677
+ grain?: SemaphorMatrixTimeGrain;
674
678
  label?: string;
675
679
  subtotal?: boolean | SemaphorMatrixSubtotalOptions;
676
680
  sortBy?: SemaphorMatrixAxisSortRule;
@@ -762,6 +766,8 @@ declare type SemaphorMatrixSubtotalOptions = {
762
766
  label?: string;
763
767
  };
764
768
 
769
+ declare type SemaphorMatrixTimeGrain = (typeof SEMAPHOR_MATRIX_TIME_GRAINS)[number];
770
+
765
771
  declare type SemaphorMatrixTotalCalculation = {
766
772
  kind: 'defaultAggregate';
767
773
  } | {
@@ -797,7 +803,7 @@ declare type SemaphorMatrixValueField = {
797
803
  field: SemaphorFieldRef;
798
804
  aggregate?: SemaphorAggregateFunction;
799
805
  label?: string;
800
- format?: SemaphorValueFormat;
806
+ format?: SemaphorScalarValueFormat;
801
807
  totalBehavior?: SemaphorMatrixTotalCalculation;
802
808
  };
803
809
 
@@ -892,12 +898,49 @@ declare type SemaphorRelationshipHint = {
892
898
 
893
899
  declare type SemaphorRelativeTimeWindow = {
894
900
  kind?: 'relative';
895
- unit: 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
901
+ unit: SemaphorTimeGrain;
896
902
  value: number;
897
903
  anchor?: 'now' | 'latest_available';
898
904
  completeness?: 'include_partial' | 'complete_periods';
899
905
  };
900
906
 
907
+ declare type SemaphorScalarValueFormat = {
908
+ type: 'number' | 'currency' | 'percent' | 'percentage' | 'scientific';
909
+ minimumFractionDigits?: number;
910
+ maximumFractionDigits?: number;
911
+ useGrouping?: boolean;
912
+ prefix?: string;
913
+ suffix?: string;
914
+ negativeStyle?: 'minus' | 'parentheses';
915
+ compact?: boolean;
916
+ scale?: number;
917
+ currency?: string;
918
+ percentValueMode?: 'fraction' | 'whole';
919
+ } | {
920
+ type: 'date' | 'datetime';
921
+ locale?: string;
922
+ pattern?: string;
923
+ relative?: boolean;
924
+ timezone?: string;
925
+ sourceTimezone?: string;
926
+ prefix?: string;
927
+ suffix?: string;
928
+ } | {
929
+ type: 'duration';
930
+ inputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
931
+ outputStyle?: 'compact' | 'digital' | 'long';
932
+ largestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
933
+ smallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
934
+ maxUnits?: number;
935
+ prefix?: string;
936
+ suffix?: string;
937
+ negativeStyle?: 'minus' | 'parentheses';
938
+ } | {
939
+ type: 'string';
940
+ prefix?: string;
941
+ suffix?: string;
942
+ };
943
+
901
944
  declare type SemaphorSemanticSourceRef = Extract<SemaphorSourceRef, {
902
945
  kind: 'semantic';
903
946
  }>;
@@ -943,47 +986,10 @@ declare type SemaphorSqlIntent = {
943
986
  inputs?: SemaphorInputBinding[];
944
987
  };
945
988
 
946
- declare type SemaphorTimeGrain = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
989
+ declare type SemaphorTimeGrain = (typeof SEMAPHOR_TIME_GRAINS)[number];
947
990
 
948
991
  declare type SemaphorTimeWindow = SemaphorRelativeTimeWindow | SemaphorAbsoluteTimeWindow;
949
992
 
950
- declare type SemaphorValueFormat = {
951
- type: 'number' | 'currency' | 'percent' | 'percentage' | 'scientific';
952
- minimumFractionDigits?: number;
953
- maximumFractionDigits?: number;
954
- useGrouping?: boolean;
955
- prefix?: string;
956
- suffix?: string;
957
- negativeStyle?: 'minus' | 'parentheses';
958
- compact?: boolean;
959
- scale?: number;
960
- currency?: string;
961
- percentValueMode?: 'fraction' | 'whole';
962
- } | {
963
- type: 'date' | 'datetime';
964
- locale?: string;
965
- pattern?: string;
966
- relative?: boolean;
967
- timezone?: string;
968
- sourceTimezone?: string;
969
- prefix?: string;
970
- suffix?: string;
971
- } | {
972
- type: 'duration';
973
- inputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
974
- outputStyle?: 'compact' | 'digital' | 'long';
975
- largestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
976
- smallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
977
- maxUnits?: number;
978
- prefix?: string;
979
- suffix?: string;
980
- negativeStyle?: 'minus' | 'parentheses';
981
- } | {
982
- type: 'string';
983
- prefix?: string;
984
- suffix?: string;
985
- };
986
-
987
993
  export declare type WorkspaceContext = {
988
994
  projectRoot?: string;
989
995
  framework?: string;