react-semaphor 0.1.559 → 0.1.560

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 (134) hide show
  1. package/dist/analytics-protocol/index.js +368 -361
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/assistant-protocol/index.js +5 -5
  4. package/dist/brand-studio/index.js +9 -9
  5. package/dist/briefings/index.js +5 -5
  6. package/dist/chunks/analytics-base-schemas-CHLxsPfX.js +630 -0
  7. package/dist/chunks/{assistant-chat-B_4bVE6I.js → assistant-chat-Bu2fFm_I.js} +206 -207
  8. package/dist/chunks/{bookmark-state-ssqrs5oP.js → bookmark-state-BFY9oNmr.js} +3 -3
  9. package/dist/chunks/{braces-Rdxa3H-s.js → braces-Da41xfUd.js} +1 -1
  10. package/dist/chunks/{comparison-window-caption-CKzQ5LcF.js → comparison-window-caption-4FNkMrzE.js} +166 -166
  11. package/dist/chunks/{context-DVy4HOU0.js → context-BgPDzLHZ.js} +1 -1
  12. package/dist/chunks/{custom-visual-inputs-zVa9wX_o.js → custom-visual-inputs-Dz-enUNR.js} +1 -1
  13. package/dist/chunks/{dashboard-BziwOVpZ.js → dashboard-_MeBuy67.js} +1 -1
  14. package/dist/chunks/{dashboard-briefing-launcher-CbeNR-YI.js → dashboard-briefing-launcher-CEi4Pr_v.js} +1152 -1166
  15. package/dist/chunks/{dashboard-controls-RD6UJs1r.js → dashboard-controls-Bi7fyG-4.js} +98 -98
  16. package/dist/chunks/{dashboard-json-DGpv17vL.js → dashboard-json-B1mU_OMa.js} +5 -5
  17. package/dist/chunks/{document-dashboard-inputs-ChVkcBuu.js → document-dashboard-inputs-CkWfDB8c.js} +64 -64
  18. package/dist/chunks/{edit-dashboard-visual-AQ2pQkFp.js → edit-dashboard-visual-0CJN31Y3.js} +8375 -8615
  19. package/dist/chunks/filter-reach-copy-BF4w4kI2.js +3738 -0
  20. package/dist/chunks/{filter-value-text-B4l-xqJT.js → filter-value-text-CRC-K_l_.js} +3 -3
  21. package/dist/chunks/{global-date-filter-utils-DBzEOX9M.js → global-date-filter-utils-D8365uPH.js} +4068 -3401
  22. package/dist/chunks/{index-B1Xr7W24.js → index-DtHidOPV.js} +579 -604
  23. package/dist/chunks/{layout-grid-Bbz3zKif.js → layout-grid-BvsH4RY2.js} +1 -1
  24. package/dist/chunks/{list-filter-3sbH0Uy1.js → list-filter-Dg0otx5E.js} +1 -1
  25. package/dist/chunks/{matrix-analytical-definition-CEe3PGEo.js → matrix-analytical-definition-CM18W8w6.js} +4 -4
  26. package/dist/chunks/{matrix-card-BRNGb1C4.js → matrix-card-HPskLaPy.js} +3 -3
  27. package/dist/chunks/{matrix-member-presentation-CEegvTqg.js → matrix-member-presentation-Bbrfrke4.js} +1 -1
  28. package/dist/chunks/{matrix-operation-contract-COxrfQTS.js → matrix-operation-contract-WPv4R-H_.js} +110 -110
  29. package/dist/chunks/{metric-comparison-DQx-uX__.js → metric-comparison-ljMKYZKa.js} +2 -2
  30. package/dist/chunks/{model-change-CJEj3ZD6.js → model-change-Ccn1zaxl.js} +1 -1
  31. package/dist/chunks/{palette-DMJtp3Vn.js → palette-Bsh376zO.js} +1 -1
  32. package/dist/chunks/{pivot-result-contract-expectations-DOYhqeZb.js → pivot-result-contract-expectations-Bl5suy4-.js} +602 -696
  33. package/dist/chunks/{pivot-result-identity-CAj8SiRL.js → pivot-result-identity-vS9TSh4f.js} +1 -1
  34. package/dist/chunks/{raw-temporal-presentation-BmT7z6NH.js → raw-temporal-presentation-BHm7s-hz.js} +230 -274
  35. package/dist/chunks/{report-preferences-dialog-0sc8B1lh.js → report-preferences-dialog-BV8L0SeS.js} +55 -55
  36. package/dist/chunks/{report-runtime-context-bYoExeWr.js → report-runtime-context-BZQh9ywy.js} +2 -2
  37. package/dist/chunks/{resolve-dashboard-input-context-B_C_VAJH.js → resolve-dashboard-input-context-CAMiWvyR.js} +1749 -1989
  38. package/dist/chunks/{save-DSb1jTtG.js → save-B5EAsgQF.js} +1 -1
  39. package/dist/chunks/{saved-dashboard-context-BQWM3ldX.js → saved-dashboard-context-n2Wn11cV.js} +57 -57
  40. package/dist/chunks/{selection-reducer-DSzMWb4x.js → selection-reducer-D0YnaAD9.js} +1 -1
  41. package/dist/chunks/{semaphor-ready-indicator-Bz14Oma5.js → semaphor-ready-indicator-XLBLOJ2V.js} +38374 -39104
  42. package/dist/chunks/{shelf-drop-preview-context-DBHAkgch.js → shelf-drop-preview-context-DHMa54a-.js} +570 -570
  43. package/dist/chunks/{source-entity-resolution-BOrmNCEM.js → source-entity-resolution-dUG5VWRm.js} +1 -1
  44. package/dist/chunks/{switch-Dq8XPFpT.js → switch-ByxH4M7t.js} +3 -3
  45. package/dist/chunks/{table-export-sheet-C_RvEUyO.js → table-export-sheet-C_GdeTYU.js} +1 -1
  46. package/dist/chunks/{table-settings-DXj_zXwS.js → table-settings-Imz0FgWi.js} +6 -6
  47. package/dist/chunks/{temporal-input-presentation-AhLSkGPf.js → temporal-input-presentation-uvNK_tM0.js} +1109 -820
  48. package/dist/chunks/{token-types-LCYMJ3pa.js → token-types-CQtXUVMy.js} +1 -1
  49. package/dist/chunks/{upload-Dr_WAxHQ.js → upload-wbR-NVzq.js} +1 -1
  50. package/dist/chunks/{use-create-flow-overlay-state-BK3YFkfc.js → use-create-flow-overlay-state-CEBaLOKC.js} +6 -6
  51. package/dist/chunks/{validators-C87JPd-_.js → validators-CXTneCA4.js} +1206 -1579
  52. package/dist/chunks/{zoned-wall-clock-E35Frf9v.js → zoned-wall-clock-B1n_WjW3.js} +1 -1
  53. package/dist/dashboard/index.js +2 -2
  54. package/dist/dashboard-authoring/index.js +2207 -1497
  55. package/dist/data-app-sdk/index.js +5 -5
  56. package/dist/data-app-sdk-adapters/index.js +3 -3
  57. package/dist/data-app-sdk-validation/index.js +6 -6
  58. package/dist/format-utils/index.js +181 -176
  59. package/dist/index.js +22 -22
  60. package/dist/report-runtime-context/index.js +2 -2
  61. package/dist/style.css +1 -1
  62. package/dist/surfboard/index.js +2 -2
  63. package/dist/types/components/editor/editor-aside/utils.d.ts +1 -1
  64. package/dist/types/components/visual/data-table/types/data-table.d.ts +5 -20
  65. package/dist/types/index.js +6 -6
  66. package/dist/types/lib/formatters/canonical-format-adapter.d.ts +2 -29
  67. package/dist/types/lib/formatters/raw-temporal-presentation.d.ts +0 -2
  68. package/dist/types/lib/formatters/table-column-settings.d.ts +47 -0
  69. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +10 -188
  70. package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +1 -1
  71. package/dist/types/lib/matrix-table/matrix-delivery.d.ts +16 -372
  72. package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
  73. package/dist/types/lib/stores/editor-store.d.ts +39 -9
  74. package/dist/types/lib/stores/table-actions.d.ts +9 -3
  75. package/dist/types/lib/table-formatting/index.d.ts +0 -2
  76. package/dist/types/lib/table-formatting/table-conditional-formatting-range-source.d.ts +3 -2
  77. package/dist/types/lib/table-formatting/table-conditional-formatting-range.d.ts +3 -2
  78. package/dist/types/lib/table-formatting/table-formatting-normalize.d.ts +1 -2
  79. package/dist/types/lib/table-formatting/table-formatting-render-model.d.ts +9 -0
  80. package/dist/types/lib/table-formatting/table-formatting-types.d.ts +5 -95
  81. package/dist/types/lib/table-formatting/table-presentation-fields.d.ts +35 -0
  82. package/dist/types/lib/types/common-types.d.ts +40 -47
  83. package/dist/types/lib/types/explorer-types.d.ts +11 -43
  84. package/dist/types/lib/utils/card-config-utils.d.ts +8 -0
  85. package/dist/types/lib/utils/card-definition.d.ts +9 -187
  86. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +159 -513
  87. package/dist/types/shared/analytics-protocol/contracts.d.ts +32 -9
  88. package/dist/types/shared/analytics-protocol/execution-input-schemas.d.ts +108 -980
  89. package/dist/types/shared/analytics-protocol/field-validation.d.ts +1 -0
  90. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +281 -4624
  91. package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +20 -20
  92. package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +18 -18
  93. package/dist/types/shared/analytics-protocol/matrix-path-contract.d.ts +40 -40
  94. package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +3 -203
  95. package/dist/types/shared/analytics-protocol/scalar-value.d.ts +8 -8
  96. package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +8 -0
  97. package/dist/types/shared/assistant-protocol/context.d.ts +69 -69
  98. package/dist/types/shared/dashboard-authoring/canonical-result-keys.d.ts +13 -0
  99. package/dist/types/shared/dashboard-authoring/card-export-request.d.ts +4 -1
  100. package/dist/types/shared/dashboard-authoring/card-formats/sql-date-pattern.d.ts +10 -0
  101. package/dist/types/shared/dashboard-authoring/card-formats/upgrade-card-formats.d.ts +57 -0
  102. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +24 -24
  103. package/dist/types/shared/dashboard-authoring/conditional-formatting/editable.d.ts +14 -0
  104. package/dist/types/shared/dashboard-authoring/conditional-formatting/evaluate.d.ts +16 -0
  105. package/dist/types/shared/dashboard-authoring/conditional-formatting/index.d.ts +9 -0
  106. package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +14 -0
  107. package/dist/types/shared/dashboard-authoring/conditional-formatting/resolve-card-column-ref.d.ts +17 -0
  108. package/dist/types/shared/dashboard-authoring/conditional-formatting/retain.d.ts +14 -0
  109. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +4499 -0
  110. package/dist/types/shared/dashboard-authoring/conditional-formatting/store.d.ts +12 -0
  111. package/dist/types/shared/dashboard-authoring/conditional-formatting/types.d.ts +151 -0
  112. package/dist/types/shared/dashboard-authoring/conditional-formatting/upgrade.d.ts +35 -0
  113. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +62 -62
  114. package/dist/types/shared/dashboard-authoring/index.d.ts +5 -0
  115. package/dist/types/shared/dashboard-authoring/matrix-authoring.d.ts +4 -5
  116. package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +24 -736
  117. package/dist/types/shared/dashboard-authoring/retired-presentation-fields.d.ts +31 -0
  118. package/dist/types/shared/dashboard-authoring/upgrade-card-presentation.d.ts +14 -0
  119. package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +5 -1
  120. package/dist/types/shared/format-utils/formatters/number-formatter.d.ts +16 -0
  121. package/dist/types/shared/format-utils/index.d.ts +2 -0
  122. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +10 -366
  123. package/dist/types/shared/format-utils/raw-temporal.d.ts +15 -1
  124. package/dist/types/shared/format-utils/resolve-column-format.d.ts +43 -0
  125. package/dist/types/shared/format-utils/retired-format-adapters.d.ts +68 -0
  126. package/dist/types/shared/format-utils/semantic-format.d.ts +5 -1
  127. package/dist/types/shared/format-utils/stored-value-format.d.ts +16 -0
  128. package/dist/types/shared/format-utils/types/format-types.d.ts +10 -12
  129. package/package.json +1 -1
  130. package/dist/chunks/analytics-base-schemas-BUFUoO6G.js +0 -472
  131. package/dist/chunks/editor-draft-sync-BN5qYHPF.js +0 -15
  132. package/dist/chunks/filter-reach-copy-B5Y7FHzg.js +0 -3411
  133. package/dist/types/lib/table-formatting/table-conditional-formatting-evaluator.d.ts +0 -9
  134. package/dist/types/lib/table-formatting/table-formatting-validation.d.ts +0 -12
@@ -1,3 +1,2 @@
1
- import { TableBaseFormatting, TableConditionalFormatting } from './table-formatting-types.js';
1
+ import { TableBaseFormatting } from './table-formatting-types.js';
2
2
  export declare function normalizeTableBaseFormatting(input: unknown): TableBaseFormatting;
3
- export declare function normalizeConditionalFormatting(input: unknown): TableConditionalFormatting;
@@ -2,9 +2,18 @@ import { ConditionalFormatColumn, ConditionalFormattingRenderContext, TableForma
2
2
  import { TablePreferences } from '../../components/visual/data-table/types/data-table.js';
3
3
  import { TCard } from '../types/common-types.js';
4
4
  import { QueryColumnKeyMap } from '../types/explorer-types.js';
5
+ import { SemaphorResultColumn } from '../../shared/analytics-protocol/contracts.js';
6
+ /**
7
+ * A table's base formatting and the card's rules resolved to the rows' result
8
+ * keys (conditional formatting store CR-D7): rules come from the card store,
9
+ * `preferences.conditionalFormatting`, and name columns by identity. Tables
10
+ * and detail tables run rules (CR-D6).
11
+ */
5
12
  export declare function buildTableFormattingRenderModel(args: {
6
13
  card?: TCard;
7
14
  columnKeyMap?: QueryColumnKeyMap;
15
+ /** The result's columns; their `pivotIdentity` resolves pivot references. */
16
+ resultColumns?: readonly SemaphorResultColumn[];
8
17
  tableKind: TableKind;
9
18
  renderContext: ConditionalFormattingRenderContext;
10
19
  columns: ConditionalFormatColumn[];
@@ -1,7 +1,7 @@
1
1
  import { CSSProperties } from 'react';
2
2
  import { ExactNumericValue } from '../../shared/analytics-protocol/scalar-value.js';
3
- import { MatrixAxis, MatrixPath } from '../../shared/analytics-protocol/matrix-path-contract.js';
4
- import { ColumnSettings, ColumnSettingsMap, TablePreferences } from '../../components/visual/data-table/types/data-table.js';
3
+ import { ColumnSettings, TablePreferences } from '../../components/visual/data-table/types/data-table.js';
4
+ import { ConditionalStyle, ResolvedConditionalRule } from '../../shared/dashboard-authoring/conditional-formatting/types.js';
5
5
  export type TableFormattingVersion = 1;
6
6
  export type TableKind = 'table' | 'detailTable' | 'matrixTable';
7
7
  export type TablePart = 'body' | 'header' | 'footer' | 'subtotal' | 'grandTotal';
@@ -42,95 +42,6 @@ export type TableBaseFormatting = {
42
42
  footer?: TableBaseStyle;
43
43
  }>;
44
44
  };
45
- export type ConditionalFormatTarget = {
46
- /** Scope resolved by the Matrix adapter before invoking the ordinary evaluator. */
47
- matrix?: {
48
- axis: MatrixAxis;
49
- levelId?: string;
50
- oppositePath?: Array<MatrixPath[number]>;
51
- };
52
- level: 'cell' | 'row';
53
- columnIds?: string[];
54
- conditionColumnId?: string;
55
- applyToColumnIds?: string[];
56
- tableParts?: TablePart[];
57
- rowRoles?: string[];
58
- depth?: number;
59
- includeTotals?: boolean;
60
- includeSubtotals?: boolean;
61
- };
62
- export type ConditionalFormatStyle = {
63
- backgroundColor?: string;
64
- textColor?: string;
65
- fontWeight?: 'normal' | 'medium' | 'semibold' | 'bold';
66
- italic?: boolean;
67
- textDecoration?: 'none' | 'underline' | 'line-through';
68
- icon?: 'arrowUp' | 'arrowDown' | 'warning' | 'check' | 'x';
69
- dataBar?: {
70
- color: string;
71
- showValue: boolean;
72
- };
73
- };
74
- export type ComparisonOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte';
75
- export type ConditionalFormatCondition = {
76
- kind: 'comparison';
77
- columnId: string;
78
- operator: ComparisonOperator;
79
- value: unknown;
80
- } | {
81
- kind: 'between';
82
- columnId: string;
83
- min: unknown;
84
- max: unknown;
85
- inclusive?: boolean;
86
- } | {
87
- kind: 'blank';
88
- columnId: string;
89
- isBlank: boolean;
90
- } | {
91
- kind: 'contains';
92
- columnId: string;
93
- value: string;
94
- caseSensitive?: boolean;
95
- exact?: boolean;
96
- } | {
97
- kind: 'topBottom';
98
- columnId: string;
99
- direction: 'top' | 'bottom';
100
- count: number;
101
- } | {
102
- kind: 'colorScale';
103
- columnId: string;
104
- range: 'auto' | 'manual';
105
- min?: number;
106
- mid?: number;
107
- max?: number;
108
- colors: {
109
- min: string;
110
- mid?: string;
111
- max: string;
112
- };
113
- } | {
114
- kind: 'dataBar';
115
- columnId: string;
116
- range: 'auto' | 'manual';
117
- min?: number;
118
- max?: number;
119
- color: string;
120
- showValue?: boolean;
121
- };
122
- export type ConditionalFormatRule = {
123
- id: string;
124
- name?: string;
125
- enabled?: boolean;
126
- target: ConditionalFormatTarget;
127
- condition: ConditionalFormatCondition;
128
- style?: ConditionalFormatStyle;
129
- };
130
- export type TableConditionalFormatting = {
131
- version: TableFormattingVersion;
132
- rules: ConditionalFormatRule[];
133
- };
134
45
  export type TableFormattingMetadata = {
135
46
  ranges?: Record<string, {
136
47
  min: number | null;
@@ -188,7 +99,7 @@ export type ConditionalFormattingOverlay = {
188
99
  showValue: boolean;
189
100
  } | {
190
101
  kind: 'icon';
191
- icon: NonNullable<ConditionalFormatStyle['icon']>;
102
+ icon: NonNullable<ConditionalStyle['icon']>;
192
103
  };
193
104
  export type ConditionalFormattingResult = {
194
105
  cellStyle?: TableResolvedBaseStyle;
@@ -211,10 +122,9 @@ export type TableFormattingRenderModel = {
211
122
  rows: Array<Record<string, unknown>>;
212
123
  fullRows?: Array<Record<string, unknown>>;
213
124
  baseFormatting: TableBaseFormatting;
214
- conditionalFormatting: TableConditionalFormatting;
215
- columnSettingsByColumnId: ColumnSettingsMap;
125
+ /** The card's rules, resolved to the rows' result keys. */
126
+ conditionalRules: ResolvedConditionalRule[];
216
127
  rangePlan: RangeResolutionPlan;
217
128
  range: ConditionalFormattingRange;
218
129
  };
219
130
  export declare const EMPTY_TABLE_BASE_FORMATTING: TableBaseFormatting;
220
- export declare const EMPTY_TABLE_CONDITIONAL_FORMATTING: TableConditionalFormatting;
@@ -0,0 +1,35 @@
1
+ import { TCard } from '../types/common-types.js';
2
+ import { GroupByField, DetailField, MetricField, QueryColumnKeyMap, QueryColumnKeyRole } from '../types/explorer-types.js';
3
+ import { SemaphorPivotResultColumnIdentity } from '../../shared/analytics-protocol/index.js';
4
+ type PresentationField = GroupByField | DetailField | MetricField;
5
+ export type TableFieldLookup = {
6
+ columnId?: string;
7
+ columnIds?: string[];
8
+ metricId?: string;
9
+ metricAlias?: string;
10
+ fieldId?: string;
11
+ fieldRole?: QueryColumnKeyRole;
12
+ columnKeyMap?: QueryColumnKeyMap;
13
+ };
14
+ type TableResultColumns = readonly {
15
+ key: string;
16
+ pivotIdentity?: SemaphorPivotResultColumnIdentity;
17
+ }[];
18
+ /**
19
+ * How a table's column names its card field, for every reader and writer of
20
+ * its settings: the result's key map, and for one pivot value's column its
21
+ * measure (`pivotIdentity`), whose one format every pivot value shows
22
+ * (column formats CF-D23, ledger P5-29).
23
+ */
24
+ export declare function tableColumnFieldLookup(card: Pick<TCard, 'type'> | undefined, columnId: string, result: {
25
+ columnKeyMap?: QueryColumnKeyMap;
26
+ resultColumns?: TableResultColumns;
27
+ }): TableFieldLookup & {
28
+ columnId: string;
29
+ };
30
+ /** True when the field authors a format for numeric values (numeric or duration). */
31
+ export declare function hasNumericFieldFormat(field: Pick<PresentationField, 'format'> | undefined): boolean;
32
+ /** Resolve identity before presentation. A supplied map is authoritative; names
33
+ * and labels are only a unique-match adapter for results without bindings. */
34
+ export declare function resolveTablePresentationField(card: TCard | undefined, lookup: TableFieldLookup): PresentationField | undefined;
35
+ export {};
@@ -4,8 +4,8 @@ import { FontSpec } from 'chart.js';
4
4
  import { TChartType } from '../charts/types.js';
5
5
  import { QueryConfig } from './query-types.js';
6
6
  import { TablePreferences } from '../../components/visual/data-table/types/data-table.js';
7
- import { CalculatedFieldFormula, CardConfig, Field, FormatSpec, AggregateFunction, GroupByField, MetricField, PaginationConfig, DateFormatValue, EntityType, TimeGranularity, DataSource } from './explorer-types.js';
8
- import { ComparisonPresentationSpec, GlobalDateComparisonSelection, MetricComparisonPolarity, SemaphorDerivedFieldDefinition, TemporalBucketFormat } from '../../shared/analytics-protocol/index.js';
7
+ import { CalculatedFieldFormula, CardConfig, Field, AggregateFunction, GroupByField, MetricField, PaginationConfig, DateFormatValue, EntityType, TimeGranularity, DataSource } from './explorer-types.js';
8
+ import { ComparisonPresentationSpec, GlobalDateComparisonSelection, MetricComparisonPolarity, SemaphorDerivedFieldDefinition, SemaphorValueFormat, TemporalBucketFormat } from '../../shared/analytics-protocol/index.js';
9
9
  import { DashboardFilterApplication, DashboardFilterOptionSource, DashboardFilterOptionDependencies, DashboardFilterOptionPopulation } from '../../shared/dashboard-authoring/dashboard-filter-mapping-types.js';
10
10
  import { ClickToFilterSettings, LinkedClickToFilterOverrides } from '../../shared/dashboard-authoring/click-to-filter-settings.js';
11
11
  import { SelectionInputValue } from '../../shared/analytics-protocol/selection-contract.js';
@@ -17,6 +17,7 @@ import { SemanticExecutionPayload } from './semantic-runtime-types.js';
17
17
  import { ReportRuntimeContext } from '../../shared/report-runtime-context/index.js';
18
18
  import { LiveScreenPort } from '../../shared/live-channel/index.js';
19
19
  import { CsvEncoding } from '../../shared/format-utils/exporters/csv-utils.js';
20
+ import { DateCanonicalFormat } from '../../shared/format-utils/types/index.js';
20
21
  import { PresentationExecutionSnapshot, TemporalInputPresentation } from '../../shared/format-utils/index.js';
21
22
  import { JSX } from 'react';
22
23
  export type { DashboardFilterApplication, DashboardFilterBoundCardApplication, DashboardFilterCardApplication, DashboardFilterExcludedCardApplication, DashboardFilterTarget, DashboardFilterTargetField, DashboardFilterTargetSource, DashboardFilterOptionSource, } from '../../shared/dashboard-authoring/dashboard-filter-mapping-types.js';
@@ -59,7 +60,7 @@ export type TDataColumn = {
59
60
  aggregateOrigin?: import('./explorer-types.js').Field['aggregateOrigin'];
60
61
  labelOrigin?: import('./explorer-types.js').Field['labelOrigin'];
61
62
  formatOrigin?: import('./explorer-types.js').Field['formatOrigin'];
62
- format?: FormatSpec;
63
+ format?: import('../../shared/analytics-protocol/index.js').SemaphorValueFormat;
63
64
  granularity?: TimeGranularity;
64
65
  sourceField?: string;
65
66
  aggregate?: AggregateFunction;
@@ -336,7 +337,6 @@ export type NumberOptions = {
336
337
  locale: string;
337
338
  currency?: string;
338
339
  options: Intl.NumberFormatOptions;
339
- colorRanges?: ColorRange[];
340
340
  };
341
341
  export type DateOptions = {
342
342
  locale: string;
@@ -430,9 +430,14 @@ export type TFormatOptions = {
430
430
  useSuffix?: boolean;
431
431
  useGrouping?: boolean;
432
432
  negativeInParentheses?: boolean;
433
+ /** Whether a sign shows (column formats CF-D16). */
434
+ signDisplay?: 'auto' | 'always' | 'exceptZero' | 'never';
433
435
  multiplyBy?: number;
434
436
  percentValueMode?: 'fraction' | 'whole';
435
437
  dateFormat?: string;
438
+ /** `dateFormat`'s token set, as stored; absent means Semaphor tokens. */
439
+ dateDialect?: DateCanonicalFormat['dialect'];
440
+ datePreset?: DateCanonicalFormat['preset'];
436
441
  timezone?: string;
437
442
  sourceTimezone?: string;
438
443
  relative?: boolean;
@@ -443,9 +448,8 @@ export type TFormatOptions = {
443
448
  durationMaxUnits?: number;
444
449
  };
445
450
  export type TTooltipFormatConfig = {
446
- formatMode?: 'inherit' | 'override';
447
- /** @deprecated Use formatMode */
448
- mode?: 'inherit' | 'override';
451
+ /** The tooltip's own format; absent means the column's format (column formats CF-D3). */
452
+ valueFormat?: SemaphorValueFormat;
449
453
  formatOptions?: TFormatOptions;
450
454
  };
451
455
  export type TBulletRangeLabels = 'poor' | 'satisfactory' | 'good';
@@ -583,13 +587,20 @@ export type TBubbleScatterConfig = {
583
587
  };
584
588
  export type TDataLabelsConfig = {
585
589
  enabled?: boolean;
590
+ /** This surface's own format; absent means the column's format (column formats CF-D3). */
591
+ valueFormat?: SemaphorValueFormat;
586
592
  position?: 'center' | 'top' | 'bottom' | 'left' | 'right' | 'auto' | 'custom';
587
593
  anchor?: 'center' | 'start' | 'end';
588
594
  align?: 'center' | 'start' | 'end' | 'top' | 'bottom' | number;
589
595
  display?: 'auto' | boolean;
590
- formatMode?: 'inherit' | 'override';
591
- /** @deprecated Use formatMode + formatOptions.type */
596
+ /**
597
+ * A series' own labels only (per-series settings, which this type also
598
+ * describes; outside the column formats plan). The card's
599
+ * `dataLabelsConfig` stores `valueFormat`, and a saved `format` or
600
+ * `formatOptions` there is refused (column formats CF-D8).
601
+ */
592
602
  format?: 'auto' | 'number' | 'currency' | 'percent' | 'date' | 'scientific' | 'duration' | 'none';
603
+ /** A series' own labels only, with `format`. */
593
604
  formatOptions?: TFormatOptions;
594
605
  font?: {
595
606
  size?: number;
@@ -637,21 +648,6 @@ export type TChartOptions = {
637
648
  };
638
649
  treemapColorMode?: 'branch' | 'category';
639
650
  };
640
- export type NumberAxisFormat = {
641
- decimalPlaces?: number;
642
- minimumFractionDigits?: number;
643
- maximumFractionDigits?: number;
644
- suffix?: string;
645
- currency?: string;
646
- locale?: string;
647
- useGrouping?: boolean;
648
- percentValueMode?: 'fraction' | 'whole';
649
- };
650
- export type ColorRange = {
651
- start: number;
652
- end: number;
653
- color: string;
654
- };
655
651
  export type ColorConfig = {
656
652
  segments: Record<string, string>;
657
653
  };
@@ -670,16 +666,34 @@ export type AxisConfig = {
670
666
  enabled: boolean;
671
667
  rotation?: 'auto' | 0 | 45 | 90 | -45 | -90;
672
668
  };
673
- formatMode?: 'inherit' | 'override';
674
- formatOptions?: TFormatOptions;
669
+ /** This axis's own format; absent means the measures' format (column formats CF-D3). */
670
+ valueFormat?: SemaphorValueFormat;
675
671
  scale?: {
676
672
  min?: number | 'auto';
677
673
  max?: number | 'auto';
678
674
  stepSize?: number | 'auto';
679
675
  };
680
676
  };
677
+ /** A SQL or Python card's settings for one result column (column formats CF-D2). */
678
+ export type SqlColumnPresentation = {
679
+ format?: SemaphorValueFormat;
680
+ };
681
+ /**
682
+ * A SQL KPI's value column: the first numeric result column, with the second
683
+ * as its prior, so it is positional (column formats CF-D24).
684
+ */
685
+ export type SqlKpiValuePresentation = {
686
+ format?: SemaphorValueFormat;
687
+ comparisonPolarity?: MetricComparisonPolarity;
688
+ };
681
689
  export type TCardPreferences = {
682
690
  comparisonPresentation?: ComparisonPresentationSpec;
691
+ /** A SQL or Python card's column settings, by result key. */
692
+ sqlColumns?: Record<string, SqlColumnPresentation>;
693
+ /** A SQL KPI's value format and polarity. */
694
+ sqlKpiValue?: SqlKpiValuePresentation;
695
+ /** The card's conditional formatting rules, for every card kind that has them (conditional formatting store CR-D2). */
696
+ conditionalFormatting?: import('../../shared/dashboard-authoring/conditional-formatting/types.js').CardConditionalFormatting;
683
697
  /** Absence means eligible metrics inherit the Global Date comparison. */
684
698
  inheritGlobalComparison?: false;
685
699
  /** Separate two-metric KPI feature; defaults to false. */
@@ -689,23 +703,8 @@ export type TCardPreferences = {
689
703
  filterOnClickField?: string;
690
704
  filterOnClickColumnIndex?: number;
691
705
  sortChart?: 'asc' | 'desc' | 'none';
692
- formatNumber?: {
693
- decimalPlaces?: number;
694
- minimumFractionDigits?: number;
695
- maximumFractionDigits?: number;
696
- currency?: string;
697
- locale?: string;
698
- suffix?: string;
699
- prefix?: string;
700
- useGrouping?: boolean;
701
- percentValueMode?: 'fraction' | 'whole';
702
- enabled?: boolean | string;
703
- colorRanges?: ColorRange[];
704
- };
705
- numberAxisFormat?: NumberAxisFormat;
706
706
  datasetOptions?: TDatasetOptions[];
707
707
  chartOptions?: TChartOptions;
708
- columnSettings?: TColumnSetting<DisplayDataType>[];
709
708
  colorConfig?: ColorConfig;
710
709
  xAxisConfig?: AxisConfig;
711
710
  yAxisConfig?: AxisConfig;
@@ -748,12 +747,6 @@ export type TCardPreferences = {
748
747
  kpiVisualOptions?: {
749
748
  countryLogoId?: string;
750
749
  valueAlignment?: 'left' | 'center';
751
- formatOptions?: TFormatOptions;
752
- /**
753
- * Presentation-only polarity for a query-backed KPI's manually returned
754
- * current/prior value pair. Governed KPIs use per-metric polarity instead.
755
- */
756
- queryComparisonPolarity?: MetricComparisonPolarity;
757
750
  };
758
751
  displayOptions?: {
759
752
  showFilterInfo?: boolean;
@@ -1,5 +1,5 @@
1
1
  import { TimeDrillStep } from './interaction-types.js';
2
- import { SemaphorDerivedFieldDefinition, MatrixConfig, SemaphorSourceRef, SemaphorResultColumn, SemaphorPivotValue, SemaphorTimeGrain, SemanticGroupedTemporalInput, TemporalBucketMetadata, TemporalBucketFormat, MetricComparisonConfig, MetricComparisonPolarity, SemaphorConnectionType } from '../../shared/analytics-protocol/index.js';
2
+ import { SemaphorDerivedFieldDefinition, MatrixConfig, SemaphorSourceRef, SemaphorResultColumn, SemaphorPivotValue, SemaphorTimeGrain, SemanticGroupedTemporalInput, TemporalBucketMetadata, TemporalBucketFormat, SemaphorScalarValueFormat, SemaphorValueFormat, MetricComparisonConfig, MetricComparisonPolarity, SemaphorConnectionType } from '../../shared/analytics-protocol/index.js';
3
3
  import { FlatTableExportTotalsBehavior, FlatTableExportTotalsRequest, QueryColumnKeyMap as SharedQueryColumnKeyMap } from '../../shared/format-utils/index.js';
4
4
  import { CardQuerySourceRowEvidence, TemporalResultOwner } from '../../shared/dashboard-authoring/index.js';
5
5
  import { RelativeDateFilter } from '../../shared/analytics-protocol/relative-date-filter.js';
@@ -78,7 +78,13 @@ export interface Field {
78
78
  nativeDataType?: string;
79
79
  description?: string;
80
80
  qualifiedEntityName?: string;
81
+ /**
82
+ * Request only: the SQL date pattern `withSqlDatePattern` derives from
83
+ * `format` for the query builder. Never stored or read for presentation
84
+ * (column formats CF-D4, CF-D10); a saved one is refused.
85
+ */
81
86
  dateFormat?: DateFormatValue;
87
+ /** Request only, with `dateFormat: 'custom'`. */
82
88
  customFormat?: string;
83
89
  granularity?: TimeGranularity;
84
90
  entityId: string;
@@ -96,7 +102,7 @@ export interface Field {
96
102
  * runtime artifacts rather than semantic-domain definitions.
97
103
  */
98
104
  derivedField?: SemaphorDerivedFieldDefinition;
99
- format?: FormatSpec;
105
+ format?: SemaphorValueFormat;
100
106
  /**
101
107
  * Source-level temporal presentation keeps the semantic grain that authored
102
108
  * the format. The card's mutable `granularity` remains the active query
@@ -281,7 +287,7 @@ export interface DomainCalculatedMetric {
281
287
  expression: string;
282
288
  inputs: Record<string, InputReference>;
283
289
  metricType?: 'base' | 'derived' | 'calculated';
284
- format?: ScalarFormatSpec;
290
+ format?: SemaphorScalarValueFormat;
285
291
  tags?: string[];
286
292
  isCertified?: boolean;
287
293
  aggregationStrategy?: AggregationStrategy;
@@ -311,44 +317,6 @@ export type DimensionInputReference = {
311
317
  } | {
312
318
  dimension: string;
313
319
  };
314
- export type FormatSpec = {
315
- type: 'number' | 'currency' | 'percent' | 'percentage' | 'scientific';
316
- locale?: string;
317
- minimumFractionDigits?: number;
318
- maximumFractionDigits?: number;
319
- useGrouping?: boolean;
320
- prefix?: string;
321
- suffix?: string;
322
- negativeStyle?: 'minus' | 'parentheses';
323
- compact?: boolean;
324
- scale?: number;
325
- currency?: string;
326
- percentValueMode?: 'fraction' | 'whole';
327
- } | {
328
- type: 'date';
329
- locale?: string;
330
- pattern?: string;
331
- relative?: boolean;
332
- timezone?: string;
333
- sourceTimezone?: string;
334
- prefix?: string;
335
- suffix?: string;
336
- } | {
337
- type: 'duration';
338
- inputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
339
- outputStyle?: 'compact' | 'digital' | 'long';
340
- largestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
341
- smallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
342
- maxUnits?: number;
343
- prefix?: string;
344
- suffix?: string;
345
- negativeStyle?: 'minus' | 'parentheses';
346
- } | {
347
- type: 'string';
348
- prefix?: string;
349
- suffix?: string;
350
- } | TemporalBucketFormat;
351
- export type ScalarFormatSpec = Exclude<FormatSpec, TemporalBucketFormat>;
352
320
  export type AggregationStrategy = 'default' | 'symmetric_aggregate' | 'aggregate_then_join' | 'weighted';
353
321
  /**
354
322
  * IMPORTANT: Why we store qualifiedFieldNames as strings instead of Field objects
@@ -453,8 +421,6 @@ export interface PivotByField extends Field {
453
421
  */
454
422
  export interface DetailField extends Omit<Field, 'role' | 'granularity'> {
455
423
  role: 'detail';
456
- dateFormat?: DateFormatValue;
457
- customFormat?: string;
458
424
  /**
459
425
  * Optional SQL expression for calculated detail fields.
460
426
  */
@@ -729,6 +695,8 @@ export interface QueryExecutionResponse extends CardQuerySourceRowEvidence {
729
695
  pivotSchema?: any;
730
696
  pagination?: PaginationMetadata;
731
697
  columnKeyMap?: QueryColumnKeyMap;
698
+ /** The live model format of each config column that has one, by card field id (column formats CF-D23). */
699
+ modelFormats?: Record<string, SemaphorValueFormat>;
732
700
  tableTotalsByColumnId?: Record<string, string | number | null>;
733
701
  documentTableTotalsBaseSql?: string;
734
702
  metadata?: any;
@@ -2,6 +2,14 @@ import { CardConfig, DataSource, Field, FilterGroup, JoinPlan } from '../types/e
2
2
  import { TCard } from '../types/common-types.js';
3
3
  /** Matrix acquisition requires its structured definition, never an authored SQL query. */
4
4
  export declare function supportsSqlEditor(cardType: TCard['type']): boolean;
5
+ /**
6
+ * Whether a stored card opens in SQL mode: it holds SQL or Python and its
7
+ * type takes them. A card stored with both modes opens in SQL mode, as it
8
+ * runs (editor modes across tabs EM-5).
9
+ */
10
+ export declare function cardOpensInDevMode(card: Pick<TCard, 'type' | 'sql' | 'python'>): boolean;
11
+ /** A card stored with both modes, as cards were before each tab kept its mode: it opens, and saves, in SQL mode. */
12
+ export declare function cardHoldsBothModes(card: Pick<TCard, 'type' | 'sql' | 'python' | 'config'>): boolean;
5
13
  export declare function hasEditorResultsView(cardType: TCard['type']): boolean;
6
14
  export declare function hasEditorInfoView(cardType: TCard['type']): boolean;
7
15
  /** The deprecated table types every saved card of which loads as Matrix (pivot-aggregate-to-matrix). */