react-semaphor 0.1.560 → 0.1.562

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 (168) hide show
  1. package/dist/analytics-protocol/index.js +450 -423
  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 → analytics-base-schemas-BaIQrEzX.js} +221 -188
  7. package/dist/chunks/{assistant-chat-Bu2fFm_I.js → assistant-chat-R_yT8xH4.js} +116 -117
  8. package/dist/chunks/bookmark-impact-D4Kl4amw.js +75 -0
  9. package/dist/chunks/bookmark-state-CWeoGbrx.js +743 -0
  10. package/dist/chunks/{braces-Da41xfUd.js → braces-DzgoQC64.js} +1 -1
  11. package/dist/chunks/{comparison-window-caption-4FNkMrzE.js → comparison-window-caption-D1EUXzaR.js} +550 -425
  12. package/dist/chunks/{context-BgPDzLHZ.js → context-R31TSL5V.js} +1 -1
  13. package/dist/chunks/{dashboard-_MeBuy67.js → dashboard-Bp1y5oun.js} +1 -1
  14. package/dist/chunks/{dashboard-briefing-launcher-CEi4Pr_v.js → dashboard-briefing-launcher-S5FB3aUW.js} +236 -236
  15. package/dist/chunks/dashboard-controls-CfC_6Ztn.js +2277 -0
  16. package/dist/chunks/{dashboard-json-B1mU_OMa.js → dashboard-json-gYZT7ZQY.js} +5 -5
  17. package/dist/chunks/dates-DFY7Gfss.js +91 -0
  18. package/dist/chunks/{edit-dashboard-visual-0CJN31Y3.js → edit-dashboard-visual-u7OI_g8Q.js} +7119 -7198
  19. package/dist/chunks/filter-reach-copy-CvV7W5dd.js +3965 -0
  20. package/dist/chunks/{filter-value-text-CRC-K_l_.js → filter-value-text-CPwFkrMz.js} +11 -10
  21. package/dist/chunks/global-date-filter-utils-N1kcsOFE.js +16722 -0
  22. package/dist/chunks/{index-DtHidOPV.js → index-CNGkfUp4.js} +269 -264
  23. package/dist/chunks/{layout-grid-BvsH4RY2.js → layout-grid-BM65viQh.js} +1 -1
  24. package/dist/chunks/{list-filter-Dg0otx5E.js → list-filter-BoeLBfL3.js} +1 -1
  25. package/dist/chunks/{matrix-analytical-definition-CM18W8w6.js → matrix-analytical-definition-hEucouWM.js} +4 -4
  26. package/dist/chunks/{matrix-card-HPskLaPy.js → matrix-card-CCh9JjP1.js} +3 -3
  27. package/dist/chunks/{matrix-member-presentation-Bbrfrke4.js → matrix-member-presentation-DsAUbuoL.js} +1 -1
  28. package/dist/chunks/{matrix-operation-contract-WPv4R-H_.js → matrix-operation-contract-DsLdFdSa.js} +365 -349
  29. package/dist/chunks/{metric-comparison-ljMKYZKa.js → metric-comparison-Bnso1cm1.js} +6 -6
  30. package/dist/chunks/{model-change-Ccn1zaxl.js → model-change-T1cRkh3m.js} +1 -1
  31. package/dist/chunks/{palette-Bsh376zO.js → palette-p1XSJFgB.js} +1 -1
  32. package/dist/chunks/pivot-result-contract-expectations-B53jqszr.js +56 -0
  33. package/dist/chunks/{pivot-result-identity-vS9TSh4f.js → pivot-result-identity-Dq5jm-EC.js} +1 -1
  34. package/dist/chunks/{zoned-wall-clock-B1n_WjW3.js → raw-temporal-value-Bqz8wc7L.js} +97 -46
  35. package/dist/chunks/{report-preferences-dialog-BV8L0SeS.js → report-preferences-dialog-C4RAR8u5.js} +68 -63
  36. package/dist/chunks/{report-runtime-context-BZQh9ywy.js → report-runtime-context-BITkNSDa.js} +2 -2
  37. package/dist/chunks/resolve-dashboard-input-context-DaDrZGuA.js +8214 -0
  38. package/dist/chunks/{save-B5EAsgQF.js → save-CHV1B1fL.js} +1 -1
  39. package/dist/chunks/{saved-dashboard-context-n2Wn11cV.js → saved-dashboard-context-DFYBrE6O.js} +93 -94
  40. package/dist/chunks/{selection-filter-compiler-BKXmyLrS.js → selection-filter-compiler-CUDRnUxc.js} +19 -18
  41. package/dist/chunks/{selection-reducer-D0YnaAD9.js → selection-reducer-Bz5aywT4.js} +1 -1
  42. package/dist/chunks/{semaphor-ready-indicator-XLBLOJ2V.js → semaphor-ready-indicator-Cfuafnem.js} +38188 -40344
  43. package/dist/chunks/{shelf-drop-preview-context-DHMa54a-.js → shelf-drop-preview-context-BR2GEYog.js} +81 -82
  44. package/dist/chunks/{source-entity-resolution-dUG5VWRm.js → source-entity-resolution-DdDVXFB8.js} +6 -6
  45. package/dist/chunks/{switch-ByxH4M7t.js → switch-BW4yXSYs.js} +3 -3
  46. package/dist/chunks/{table-export-sheet-C_GdeTYU.js → table-export-sheet-bSXxGn-v.js} +1 -1
  47. package/dist/chunks/temporal-input-presentation-sk9gqLi6.js +4960 -0
  48. package/dist/chunks/{token-types-CQtXUVMy.js → token-types-BUK06hU2.js} +1 -1
  49. package/dist/chunks/{upload-wbR-NVzq.js → upload-BnmuyPqW.js} +1 -1
  50. package/dist/chunks/{use-create-flow-overlay-state-CEBaLOKC.js → use-create-flow-overlay-state-DyzhWvRJ.js} +6 -6
  51. package/dist/chunks/{validators-CXTneCA4.js → validators-BIM0FE31.js} +774 -895
  52. package/dist/dashboard/index.js +2 -2
  53. package/dist/dashboard-authoring/index.js +2477 -2685
  54. package/dist/data-app-sdk/index.js +30 -30
  55. package/dist/data-app-sdk-adapters/index.js +3 -3
  56. package/dist/data-app-sdk-validation/index.js +25 -25
  57. package/dist/format-utils/index.js +274 -267
  58. package/dist/index.js +59 -59
  59. package/dist/report-runtime-context/index.js +2 -2
  60. package/dist/style.css +1 -1
  61. package/dist/surfboard/index.js +2 -2
  62. package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
  63. package/dist/types/components/dashboard/dashboard-create-dialog.d.ts +23 -0
  64. package/dist/types/components/dashboard/summary-number-formatter.d.ts +6 -0
  65. package/dist/types/components/index.d.ts +1 -2
  66. package/dist/types/components/surfboard/filter/types.d.ts +3 -1
  67. package/dist/types/index.js +50 -51
  68. package/dist/types/lib/formatters/kpi-number-formatter.d.ts +41 -0
  69. package/dist/types/lib/formatters/raw-temporal-presentation.d.ts +59 -2
  70. package/dist/types/lib/interactions/get-click-context-from-matrix.d.ts +5 -0
  71. package/dist/types/lib/interactions/get-click-context-from-table.d.ts +45 -0
  72. package/dist/types/lib/print/print-inputs.d.ts +2 -1
  73. package/dist/types/lib/query-context/assemble-card-query.d.ts +2 -0
  74. package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +5 -0
  75. package/dist/types/lib/selection/selection-from-click-context.d.ts +41 -0
  76. package/dist/types/lib/stores/editor-store.d.ts +9 -1
  77. package/dist/types/lib/stores/table-actions.d.ts +0 -2
  78. package/dist/types/lib/types/common-types.d.ts +6 -0
  79. package/dist/types/lib/types/explorer-types.d.ts +7 -1
  80. package/dist/types/lib/types/interaction-types.d.ts +3 -1
  81. package/dist/types/lib/types/token-types.d.ts +0 -1
  82. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +13 -1
  83. package/dist/types/shared/analytics-protocol/contracts.d.ts +9 -40
  84. package/dist/types/shared/analytics-protocol/measure-aggregation-profile.d.ts +12 -0
  85. package/dist/types/shared/analytics-protocol/selection-contract.d.ts +12 -2
  86. package/dist/types/shared/analytics-protocol/validators.d.ts +1 -2
  87. package/dist/types/shared/assistant-protocol/context.d.ts +8 -8
  88. package/dist/types/shared/dashboard-authoring/card-formats/sql-date-pattern.d.ts +7 -1
  89. package/dist/types/shared/dashboard-authoring/card-settings/apply-card-settings.d.ts +11 -0
  90. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +76 -0
  91. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +14 -0
  92. package/dist/types/shared/dashboard-authoring/card-settings/carry-column-settings.d.ts +3 -0
  93. package/dist/types/shared/dashboard-authoring/card-settings/column-format-write.d.ts +8 -0
  94. package/dist/types/shared/dashboard-authoring/card-settings/column-names.d.ts +51 -0
  95. package/dist/types/shared/dashboard-authoring/card-settings/column-polarity-write.d.ts +5 -0
  96. package/dist/types/shared/dashboard-authoring/card-settings/column-sources.d.ts +14 -0
  97. package/dist/types/shared/dashboard-authoring/card-settings/confirm-class.d.ts +9 -0
  98. package/dist/types/shared/dashboard-authoring/card-settings/highlight-inputs.d.ts +19 -0
  99. package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +17 -0
  100. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +117 -0
  101. package/dist/types/shared/dashboard-authoring/card-settings/read-card-settings.d.ts +10 -0
  102. package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-highlights.d.ts +14 -0
  103. package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-settings.d.ts +59 -0
  104. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +51 -0
  105. package/dist/types/shared/dashboard-authoring/card-settings/views.d.ts +30 -0
  106. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +6 -0
  107. package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +32 -0
  108. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +3402 -4313
  109. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +49 -8
  110. package/dist/types/shared/dashboard-authoring/changes/field-ref.d.ts +91 -0
  111. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +7 -0
  112. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +52 -2
  113. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-create.d.ts +26 -0
  114. package/dist/types/shared/dashboard-authoring/click-to-filter-settings.d.ts +2 -1
  115. package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +1 -8
  116. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +20 -20
  117. package/dist/types/shared/dashboard-authoring/detail-date-presentation.d.ts +9 -0
  118. package/dist/types/shared/dashboard-authoring/index.d.ts +11 -6
  119. package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +123 -0
  120. package/dist/types/shared/dashboard-authoring/measure-calculations/apply.d.ts +8 -0
  121. package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +16 -0
  122. package/dist/types/shared/dashboard-authoring/measure-calculations/dates.d.ts +41 -0
  123. package/dist/types/shared/dashboard-authoring/measure-calculations/index.d.ts +17 -0
  124. package/dist/types/shared/dashboard-authoring/measure-calculations/options.d.ts +63 -0
  125. package/dist/types/shared/dashboard-authoring/measure-calculations/read.d.ts +16 -0
  126. package/dist/types/shared/dashboard-authoring/measure-calculations/resolve.d.ts +79 -0
  127. package/dist/types/shared/dashboard-authoring/measure-calculations/schemas.d.ts +934 -0
  128. package/dist/types/shared/dashboard-authoring/measure-calculations/sentences.d.ts +4 -0
  129. package/dist/types/shared/dashboard-authoring/measure-calculations/set.d.ts +11 -0
  130. package/dist/types/shared/dashboard-authoring/measure-calculations/transform.d.ts +63 -0
  131. package/dist/types/shared/dashboard-authoring/measure-calculations/window-transforms.d.ts +60 -0
  132. package/dist/types/shared/dashboard-authoring/new-card.d.ts +12 -1
  133. package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +2 -1
  134. package/dist/types/shared/dashboard-authoring/operations/operation-sentences.d.ts +46 -0
  135. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +73 -3
  136. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +21 -3
  137. package/dist/types/shared/dashboard-authoring/text-card-words/blocks.d.ts +58 -0
  138. package/dist/types/shared/dashboard-authoring/text-card-words/index.d.ts +55 -0
  139. package/dist/types/shared/dashboard-authoring/text-card-words/rich-content.d.ts +18 -0
  140. package/dist/types/shared/dashboard-viewer/bookmark-impact.d.ts +33 -0
  141. package/dist/types/shared/format-utils/document-print.d.ts +82 -0
  142. package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +8 -1
  143. package/dist/types/shared/format-utils/index.d.ts +1 -0
  144. package/dist/types/shared/format-utils/raw-temporal.d.ts +18 -7
  145. package/dist/types/shared/temporal/index.d.ts +1 -0
  146. package/dist/types/shared/temporal/raw-temporal-equality.d.ts +19 -0
  147. package/dist/types/shared/temporal/raw-temporal-value.d.ts +29 -0
  148. package/dist/types/shared/temporal/zoned-wall-clock.d.ts +6 -0
  149. package/package.json +2 -2
  150. package/dist/chunks/bookmark-state-BFY9oNmr.js +0 -111
  151. package/dist/chunks/custom-visual-inputs-Dz-enUNR.js +0 -292
  152. package/dist/chunks/dashboard-controls-Bi7fyG-4.js +0 -2339
  153. package/dist/chunks/document-dashboard-inputs-CkWfDB8c.js +0 -3010
  154. package/dist/chunks/filter-reach-copy-BF4w4kI2.js +0 -3738
  155. package/dist/chunks/global-date-filter-utils-D8365uPH.js +0 -12889
  156. package/dist/chunks/pivot-result-contract-expectations-Bl5suy4-.js +0 -1832
  157. package/dist/chunks/raw-temporal-presentation-BHm7s-hz.js +0 -540
  158. package/dist/chunks/resolve-dashboard-input-context-CAMiWvyR.js +0 -5280
  159. package/dist/chunks/table-settings-Imz0FgWi.js +0 -637
  160. package/dist/chunks/temporal-input-presentation-uvNK_tM0.js +0 -3228
  161. package/dist/types/components/dashboard/ai-dashboard-create-dialog.d.ts +0 -38
  162. package/dist/types/components/dashboard/dashboard-create-template.d.ts +0 -10
  163. package/dist/types/lib/hooks/use-dashboard-authoring.d.ts +0 -49
  164. package/dist/types/shared/dashboard-authoring/artifact-compiler.d.ts +0 -6
  165. package/dist/types/shared/dashboard-authoring/contracts.d.ts +0 -106
  166. package/dist/types/shared/dashboard-authoring/protocol-adapter.d.ts +0 -7
  167. package/dist/types/shared/dashboard-authoring/source-matching.d.ts +0 -34
  168. package/dist/types/shared/dashboard-authoring/validators.d.ts +0 -2
@@ -136,46 +136,6 @@ export type SemaphorDerivedFieldDefinition = {
136
136
  format?: SemaphorScalarValueFormat;
137
137
  tags?: string[];
138
138
  };
139
- export type SemaphorResultColumnRef = {
140
- columnKey: string;
141
- } | {
142
- field: SemaphorFieldRef;
143
- };
144
- export type SemaphorResultCalculationOutput = {
145
- key: string;
146
- label?: string;
147
- dataType?: SemaphorFieldRef['dataType'];
148
- format?: SemaphorScalarValueFormat;
149
- };
150
- export type SemaphorResultCalculationDenominator = {
151
- scope: 'returned_result';
152
- } | {
153
- scope: 'population';
154
- metric: SemaphorFieldRef;
155
- filters?: SemaphorAnalyticsFilter[];
156
- };
157
- export type SemaphorResultCalculation = {
158
- id: string;
159
- label: string;
160
- kind: 'percent_of_total';
161
- input: SemaphorResultColumnRef;
162
- denominator?: SemaphorResultCalculationDenominator;
163
- output: SemaphorResultCalculationOutput;
164
- } | {
165
- id: string;
166
- label: string;
167
- kind: 'rank';
168
- input: SemaphorResultColumnRef;
169
- order?: 'asc' | 'desc';
170
- output: SemaphorResultCalculationOutput;
171
- } | {
172
- id: string;
173
- label: string;
174
- kind: 'running_total' | 'previous_row_delta';
175
- input: SemaphorResultColumnRef;
176
- orderBy?: SemaphorResultColumnRef;
177
- output: SemaphorResultCalculationOutput;
178
- };
179
139
  export type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'contains' | 'not_contains' | 'between' | 'not_between' | '>' | '>=' | '<' | '<=';
180
140
  export type SemaphorAnalyticsFilterOperator = SemaphorInputOperator | 'not_contains' | 'is_null' | 'is_not_null';
181
141
  export type SemaphorAnalyticsValueFilterOperator = Exclude<SemaphorAnalyticsFilterOperator, 'is_null' | 'is_not_null'>;
@@ -337,6 +297,15 @@ export type RawTemporalValueMetadata = {
337
297
  kind: 'raw_temporal';
338
298
  valueKind: RawTemporalValueKind;
339
299
  };
300
+ /**
301
+ * What a raw date value in a selection names (column formats CF-D4, ledger
302
+ * P7-04): the kind its result column returned it as, and the report timezone
303
+ * a wall clock was read in. A filter compares the source column against the
304
+ * instants it names (`readRawTemporalEquality`), never against its text.
305
+ */
306
+ export type RawTemporalSelection = RawTemporalValueMetadata & {
307
+ tz: string;
308
+ };
340
309
  export declare const RAW_TEMPORAL_CONTRACT_ERROR_CODES: {
341
310
  readonly invalidMetadata: "invalid_raw_temporal_metadata";
342
311
  };
@@ -1,4 +1,5 @@
1
1
  import { AggregationFunctionKind } from './aggregate-expression.js';
2
+ import { AnalyticsCatalogDataType } from './catalog-field-grounding.js';
2
3
  /** The structural fields of a measure the profile reads. */
3
4
  export type MeasureProfileField = {
4
5
  name?: string;
@@ -61,3 +62,14 @@ export type MeasureAggregationProfile = {
61
62
  * field and its nested `calculatedFormula.inputFields`.
62
63
  */
63
64
  export declare function resolveMeasureAggregationProfile(field: MeasureProfileField): MeasureAggregationProfile;
65
+ /**
66
+ * A measure's result type: what its aggregation makes of its field, through
67
+ * the profile. MIN and MAX keep the field's type; every other aggregate is a
68
+ * number, so a COUNT of a text or date column is a number (Excel exports
69
+ * ledger P2b-12). A measure the profile can't resolve keeps the field's type.
70
+ * The one owner of this job: the canonical result, card settings' format
71
+ * check and the window transforms read it (card appearance ledger P2-16).
72
+ */
73
+ export declare function measureResultDataType(metric: (MeasureProfileField & {
74
+ dataType?: string;
75
+ }) | undefined): AnalyticsCatalogDataType;
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { SemaphorFieldRef, SemaphorSourceRef, TemporalBucketMetadata } from './contracts.js';
2
+ import { RawTemporalSelection, SemaphorFieldRef, SemaphorSourceRef, TemporalBucketMetadata } from './contracts.js';
3
3
  /**
4
4
  * A selection is what a viewer picked by clicking marks, rows, or members on
5
5
  * one card. It is a dashboard input value: other cards narrow to it the same
@@ -20,6 +20,11 @@ export type SelectionField = {
20
20
  dataType: 'string' | 'number' | 'boolean' | 'date' | 'datetime';
21
21
  /** Physical column when it differs from the semantic name. */
22
22
  sourceField?: string;
23
+ /**
24
+ * The column's database type, from the clicked field: a condition on this
25
+ * same column compiles its literals with it (ledger P7-06). Never identity.
26
+ */
27
+ nativeDataType?: string;
23
28
  };
24
29
  /** One field condition from a click, grounded on the source card's own executable source. */
25
30
  export type SelectionCondition = {
@@ -30,6 +35,8 @@ export type SelectionCondition = {
30
35
  label?: string;
31
36
  /** Present when the value is a canonical grouped-temporal scalar. */
32
37
  temporalBucket?: TemporalBucketMetadata;
38
+ /** Present when the value is a raw date-time from a result, in its report timezone (CF-D4, ledger P7-04). */
39
+ rawTemporal?: RawTemporalSelection;
33
40
  };
34
41
  /** One selected item. Conditions are AND-ed. */
35
42
  export type SelectionTuple = {
@@ -48,6 +55,7 @@ export type AnalyticsSelectionCondition = {
48
55
  operator: '=' | 'isNull';
49
56
  value: string | number | null;
50
57
  temporalBucket?: TemporalBucketMetadata;
58
+ rawTemporal?: RawTemporalSelection;
51
59
  };
52
60
  export type AnalyticsSelectionTuple = {
53
61
  conditions: AnalyticsSelectionCondition[];
@@ -74,7 +82,9 @@ export declare function sourceCardIdFromSelectionInputId(inputId: string): strin
74
82
  * fiscal calendars is two different selections.
75
83
  */
76
84
  export declare function temporalBucketIdentityKey(bucket: TemporalBucketMetadata | undefined): string;
77
- /** Identity of one condition: field, operator, value and bucket meaning. Labels excluded. */
85
+ /** Identity of a raw date-time's meaning: the same wall clock in two timezones names two instants. */
86
+ export declare function rawTemporalIdentityKey(raw: RawTemporalSelection | undefined): string;
87
+ /** Identity of one condition: field, operator, value and temporal meaning. Labels excluded. */
78
88
  export declare function selectionConditionKey(condition: SelectionCondition): string;
79
89
  /** Stable, order-insensitive identity of a tuple. Labels are display only and excluded. */
80
90
  export declare function selectionTupleKey(tuple: SelectionTuple): string;
@@ -1,4 +1,4 @@
1
- import { SemaphorAnalyticsIntent, SemaphorAnalyticsRecoveryPlan, SemaphorAnalyticsValidationResult, SemaphorDashboardIntent, SemaphorOperationIntent, SemaphorResultCalculation, SemaphorValidationResult } from './contracts.js';
1
+ import { SemaphorAnalyticsIntent, SemaphorAnalyticsRecoveryPlan, SemaphorAnalyticsValidationResult, SemaphorDashboardIntent, SemaphorOperationIntent, SemaphorValidationResult } from './contracts.js';
2
2
  export { validateSemaphorDerivedFieldDefinition } from './field-validation.js';
3
3
  export declare function parseSemaphorIsoTimeWindowBoundary(value: unknown): Date | null;
4
4
  export declare function parseSemaphorIsoInstant(value: unknown): Date | null;
@@ -14,7 +14,6 @@ export type SemaphorOptionDependencyValidationProfile = 'protocol' | 'dashboard'
14
14
  * intent validator, not here.
15
15
  */
16
16
  export declare function validateSemaphorOptionDependencies(value: unknown, profile?: SemaphorOptionDependencyValidationProfile): SemaphorValidationResult;
17
- export declare function validateSemaphorResultCalculation(calculation: SemaphorResultCalculation): SemaphorValidationResult;
18
17
  export declare function validateSemaphorAnalyticsIntent(intent: SemaphorAnalyticsIntent): SemaphorAnalyticsValidationResult;
19
18
  export declare function validateSemaphorOperationIntent(intent: SemaphorOperationIntent): SemaphorAnalyticsValidationResult;
20
19
  export declare function validateSemaphorAnalyticsRecoveryPlan(plan: SemaphorAnalyticsRecoveryPlan): SemaphorAnalyticsValidationResult;
@@ -247,14 +247,14 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
247
247
  kind: "set";
248
248
  text: string;
249
249
  fingerprint: string;
250
- notApplied?: "opened_from_another_dashboard" | undefined;
251
250
  omittedValues?: number | undefined;
251
+ notApplied?: "opened_from_another_dashboard" | undefined;
252
252
  }, {
253
253
  kind: "set";
254
254
  text: string;
255
255
  fingerprint: string;
256
- notApplied?: "opened_from_another_dashboard" | undefined;
257
256
  omittedValues?: number | undefined;
257
+ notApplied?: "opened_from_another_dashboard" | undefined;
258
258
  }>, z.ZodObject<{
259
259
  kind: z.ZodLiteral<"varies">;
260
260
  }, "strict", z.ZodTypeAny, {
@@ -268,8 +268,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
268
268
  kind: "set";
269
269
  text: string;
270
270
  fingerprint: string;
271
- notApplied?: "opened_from_another_dashboard" | undefined;
272
271
  omittedValues?: number | undefined;
272
+ notApplied?: "opened_from_another_dashboard" | undefined;
273
273
  } | {
274
274
  kind: "varies";
275
275
  };
@@ -281,8 +281,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
281
281
  kind: "set";
282
282
  text: string;
283
283
  fingerprint: string;
284
- notApplied?: "opened_from_another_dashboard" | undefined;
285
284
  omittedValues?: number | undefined;
285
+ notApplied?: "opened_from_another_dashboard" | undefined;
286
286
  } | {
287
287
  kind: "varies";
288
288
  };
@@ -610,8 +610,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
610
610
  kind: "set";
611
611
  text: string;
612
612
  fingerprint: string;
613
- notApplied?: "opened_from_another_dashboard" | undefined;
614
613
  omittedValues?: number | undefined;
614
+ notApplied?: "opened_from_another_dashboard" | undefined;
615
615
  } | {
616
616
  kind: "varies";
617
617
  };
@@ -702,8 +702,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
702
702
  kind: "set";
703
703
  text: string;
704
704
  fingerprint: string;
705
- notApplied?: "opened_from_another_dashboard" | undefined;
706
705
  omittedValues?: number | undefined;
706
+ notApplied?: "opened_from_another_dashboard" | undefined;
707
707
  } | {
708
708
  kind: "varies";
709
709
  };
@@ -794,8 +794,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
794
794
  kind: "set";
795
795
  text: string;
796
796
  fingerprint: string;
797
- notApplied?: "opened_from_another_dashboard" | undefined;
798
797
  omittedValues?: number | undefined;
798
+ notApplied?: "opened_from_another_dashboard" | undefined;
799
799
  } | {
800
800
  kind: "varies";
801
801
  };
@@ -886,8 +886,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
886
886
  kind: "set";
887
887
  text: string;
888
888
  fingerprint: string;
889
- notApplied?: "opened_from_another_dashboard" | undefined;
890
889
  omittedValues?: number | undefined;
890
+ notApplied?: "opened_from_another_dashboard" | undefined;
891
891
  } | {
892
892
  kind: "varies";
893
893
  };
@@ -6,5 +6,11 @@ export type SqlDates = 'raw' | 'grouped';
6
6
  * names a preset is that preset, any other is a custom pattern.
7
7
  */
8
8
  export declare function withSqlDatePattern<T extends object>(field: T, format: unknown, dates: SqlDates): T;
9
+ /** Whether a connection's detail-table dates come back raw for the browser to draw, never formatted in SQL. */
10
+ export declare function drawsDetailDatesInBrowser(connectionType: unknown): boolean;
11
+ /** A field without the request-only SQL date pattern. */
12
+ export declare function withoutSqlDatePattern<T extends object>(field: T): T;
13
+ /** A detail column with the SQL date pattern its format calls for, unless the connection's browser draws its dates. */
14
+ export declare function withDetailSqlDatePattern<T extends object>(field: T, format: unknown, connectionType: unknown): T;
9
15
  /** A card config whose fields carry the SQL date patterns their formats call for, as `executeQuery` builds SQL from it. */
10
- export declare function withCardConfigSqlDatePatterns<T extends CardConfig | undefined>(config: T): T;
16
+ export declare function withCardConfigSqlDatePatterns<T extends CardConfig | undefined>(config: T, connectionType?: unknown): T;
@@ -0,0 +1,11 @@
1
+ import { TCard } from '../../../lib/types/common-types.js';
2
+ import { ResolvedCardSettings } from './resolved.js';
3
+ export type DroppedSetting = {
4
+ setting: string;
5
+ reason: string;
6
+ };
7
+ export type AppliedCardSettings = {
8
+ card: TCard;
9
+ dropped: DroppedSetting[];
10
+ };
11
+ export declare function applyCardSettings(card: TCard, settings: ResolvedCardSettings): AppliedCardSettings;
@@ -0,0 +1,76 @@
1
+ import { TChartType } from '../../../lib/charts/types.js';
2
+ import { AxisConfig, TCard, TCardPreferences, TLegendOptions } from '../../../lib/types/common-types.js';
3
+ import { SemaphorValueFormat } from '../../analytics-protocol/contracts.js';
4
+ import { ComparisonPresentationSpec } from '../../analytics-protocol/metric-comparison.js';
5
+ import { ResolvedComparisonDisplay } from './resolved.js';
6
+ /** A stored chart variant: its type, and the axis it draws along when that isn't the type's own (SPEC 4.6). */
7
+ export type CardVariant = {
8
+ type: TChartType;
9
+ indexAxis?: 'x' | 'y';
10
+ };
11
+ /** The stored axis configs a change names: `xAxisConfig` is the horizontal axis on screen, `yAxisConfig` the vertical (V-2). */
12
+ export type AxisConfigKey = 'xAxisConfig' | 'yAxisConfig';
13
+ /**
14
+ * A flip between vertical and horizontal (CA-D22): the chart's scales and
15
+ * the stored axis configs swap, so each axis's title and range stay with its
16
+ * role: the value axis's range stays on the value axis.
17
+ */
18
+ export declare function flipChartOrientation(preferences: TCardPreferences | undefined): TCardPreferences;
19
+ /**
20
+ * The axis a chart draws along, as the orientation control sets it. A bar
21
+ * that turns between vertical and horizontal flips its axes (CA-D22); any
22
+ * other chart swaps only its scales, as it always has.
23
+ */
24
+ export declare function writeChartOrientation<T extends Pick<TCard, 'type' | 'preferences'>>(card: T, indexAxis: 'x' | 'y'): T;
25
+ /**
26
+ * A variant within the card's family, set in place (CA-D21): its type, and
27
+ * its axis when it needs one; every other preference is kept. A change that
28
+ * turns the chart flips its axes (CA-D22).
29
+ */
30
+ export declare function writeCardVariant<T extends Pick<TCard, 'type' | 'preferences'>>(card: T, variant: CardVariant): T;
31
+ /** A config table's total row on or off, as the table settings' toggle writes it. */
32
+ export declare function writeTotalsRow(preferences: TCardPreferences | undefined, row: boolean): TCardPreferences;
33
+ /**
34
+ * A chart's data labels shown or hidden, and their own format, onto the
35
+ * stored config filled with the chart's defaults, as the data labels panel
36
+ * writes them: showing sets `enabled` and `display` together (V-5); a null
37
+ * format removes the labels' own, so they follow the measure (CF-D3).
38
+ */
39
+ export declare function writeDataLabels(card: Pick<TCard, 'type' | 'preferences'>, change: {
40
+ show?: boolean;
41
+ format?: SemaphorValueFormat | null;
42
+ }): TCardPreferences;
43
+ /** Legend options merged onto the stored legend, as the legend panel writes them. */
44
+ export declare function writeLegendOptions(preferences: TCardPreferences | undefined, options: TLegendOptions): TCardPreferences;
45
+ /** An axis title's fields, onto the stored title: the axis panel's switch, text and font, and the MCP's title. */
46
+ export declare function withAxisName(config: AxisConfig | undefined, name: Partial<NonNullable<AxisConfig['name']>>): AxisConfig;
47
+ /** An axis range's bounds; null returns a bound to automatic, as the axis panel's empty field does. */
48
+ export declare function withAxisScale(config: AxisConfig | undefined, scale: {
49
+ min?: number | null;
50
+ max?: number | null;
51
+ stepSize?: number | null;
52
+ }): AxisConfig;
53
+ /** One stored axis config replaced, as the axis panel writes it. */
54
+ export declare function writeAxisConfig(preferences: TCardPreferences | undefined, key: AxisConfigKey | 'secondaryYAxisConfig', config: AxisConfig): TCardPreferences;
55
+ /**
56
+ * The card's comparison display (reports by conversation RC-D4), merged onto
57
+ * `preferences.comparisonPresentation` as the comparison panel writes it: only
58
+ * the stated fields change; a null precision removes the stored one; an
59
+ * emptied presentation is removed (SPEC S-6). The panel's indicator, colors,
60
+ * labels and position are kept as they are.
61
+ */
62
+ export declare function writeComparisonDisplay(preferences: TCardPreferences | undefined, display: ResolvedComparisonDisplay): TCardPreferences;
63
+ /**
64
+ * An edit of the comparison panel's fields, as the comparison panel and the
65
+ * table's settings make it: what a word states (show, mode, precision)
66
+ * through `writeComparisonDisplay`, so the editor and the MCP write the same
67
+ * JSON (RC-INV-2); the indicator, colors, labels and position merged as they
68
+ * are, since no word states them. A precision set to undefined is cleared.
69
+ */
70
+ export declare function writeComparisonPresentation(preferences: TCardPreferences | undefined, updates: Partial<ComparisonPresentationSpec>): TCardPreferences;
71
+ /**
72
+ * Whether measures without a comparison of their own follow the dashboard's
73
+ * (RC-D16), as the panel's "Inherit Global Date comparison" switch writes it:
74
+ * `false` stored, `true` the key removed.
75
+ */
76
+ export declare function writeInheritComparison(preferences: TCardPreferences | undefined, inherit: boolean): TCardPreferences;
@@ -0,0 +1,14 @@
1
+ import { TCard } from '../../../lib/types/common-types.js';
2
+ import { CardType } from '../changes/card-types.js';
3
+ export type SettingName = 'columns.label' | 'columns.format' | 'columns.hidden' | 'columns.width' | 'orientation' | 'stack' | 'donut' | 'totals' | 'dataLabels' | 'legend' | 'axes' | 'highlights' | 'columns.polarity' | 'comparisonDisplay' | 'inheritComparison';
4
+ export declare const SETTINGS_BY_KIND: Readonly<Record<CardType, readonly SettingName[]>>;
5
+ export type CardSettingsKind = {
6
+ type: CardType;
7
+ /** The card's result comes from SQL (or Python): columns are named by result key. */
8
+ sql: boolean;
9
+ /** A config table with pivot columns: a measure has a column per pivot value. */
10
+ pivoted: boolean;
11
+ settings: ReadonlySet<SettingName>;
12
+ };
13
+ /** The card's kind and the settings it takes; undefined outside the eight types and their variants. */
14
+ export declare function cardSettingsKind(card: Pick<TCard, 'type' | 'preferences' | 'sql' | 'python' | 'config'>): CardSettingsKind | undefined;
@@ -0,0 +1,3 @@
1
+ import { TCard } from '../../../lib/types/common-types.js';
2
+ /** `after` with its table settings under its columns' new result keys; `after` itself when no key moved. */
3
+ export declare function carryColumnSettings(before: TCard, after: TCard): TCard;
@@ -0,0 +1,8 @@
1
+ import { TCard } from '../../../lib/types/common-types.js';
2
+ import { Field } from '../../../lib/types/explorer-types.js';
3
+ import { SemaphorValueFormat } from '../../analytics-protocol/contracts.js';
4
+ import { CardColumnRef } from '../conditional-formatting/types.js';
5
+ /** A column with this format as its override; none removes the override, so it follows its model (CF-D20). */
6
+ export declare function withFormatOverride<T extends Pick<Field, 'format' | 'formatOrigin'>>(column: T, format: SemaphorValueFormat | undefined): T;
7
+ /** Writes or removes the card's own format for one column, at its stored place. */
8
+ export declare function writeColumnFormat(card: TCard, column: CardColumnRef, format: SemaphorValueFormat | undefined): TCard;
@@ -0,0 +1,51 @@
1
+ import { TCard } from '../../../lib/types/common-types.js';
2
+ import { ColumnKey } from '../changes/card-query-part.js';
3
+ import { CardColumnRef } from '../conditional-formatting/types.js';
4
+ import { CardSettingsKind } from './card-kinds.js';
5
+ import { ColumnSettingsRole } from './views.js';
6
+ import { ChangeDiagnostic } from '../changes/diagnostics.js';
7
+ export type NamedColumn = {
8
+ /** Unique within the card (S-3). */
9
+ name: string;
10
+ /** What formats and rules are keyed by. */
11
+ ref: CardColumnRef;
12
+ /** What labels are written by (`planCardLabels`); absent where a label can't be set. */
13
+ labelKey?: ColumnKey;
14
+ field?: string;
15
+ role: ColumnSettingsRole;
16
+ /** The header as the card shows it. */
17
+ label: string;
18
+ /** The key its result-keyed table settings are stored under; absent where hidden and width don't apply. */
19
+ resultKey?: string;
20
+ /** The label is the model's, not the card's own. */
21
+ labelInherited: boolean;
22
+ /** Tells two columns of one field apart in a name. */
23
+ qualifier?: string;
24
+ /** The type of the values the column shows, which decides the formats it takes: a measure's is its aggregation's result type (`measureResultDataType`). Absent for SQL result columns. */
25
+ dataType?: string;
26
+ /** A grouped date's grain: its formats are temporal buckets at this grain. */
27
+ granularity?: string;
28
+ /**
29
+ * A SQL result column's name: `verified` when a run of the card's query
30
+ * returned it, `inferred` when only a stored setting names it (the outline
31
+ * runs no query). A change may name verified columns only (ledger P2-24).
32
+ */
33
+ sqlName?: 'verified' | 'inferred';
34
+ };
35
+ /** The card's named columns, in card order (SPEC 3.3). */
36
+ export declare function nameCardColumns(card: TCard, kind: CardSettingsKind, sqlResultColumns?: readonly string[]): NamedColumn[];
37
+ /**
38
+ * The column an input names: its name, a disambiguated name, or its field
39
+ * when exactly one column has it (SPEC 3.3). Two matches are refused
40
+ * `column_ambiguous`, none `column_not_found`, each listing the card's names.
41
+ */
42
+ export declare function findNamedColumn(columns: readonly NamedColumn[], said: string, where: {
43
+ path: string;
44
+ cardTitle: string;
45
+ }): {
46
+ ok: true;
47
+ column: NamedColumn;
48
+ } | {
49
+ ok: false;
50
+ problem: ChangeDiagnostic;
51
+ };
@@ -0,0 +1,5 @@
1
+ import { TCard } from '../../../lib/types/common-types.js';
2
+ import { CardColumnRef } from '../conditional-formatting/types.js';
3
+ import { Polarity } from './inputs.js';
4
+ /** The card with the column's polarity set, or removed when undefined; the card itself when it has no such column. */
5
+ export declare function writeColumnPolarity(card: TCard, column: CardColumnRef, polarity: Polarity | undefined): TCard;
@@ -0,0 +1,14 @@
1
+ import { TCard } from '../../../lib/types/common-types.js';
2
+ import { Field } from '../../../lib/types/explorer-types.js';
3
+ import { CardColumnRef } from '../conditional-formatting/types.js';
4
+ export type ColumnSource = {
5
+ domainId: string;
6
+ datasetName: string;
7
+ };
8
+ /** The catalogs a resolve reads, one per source, keyed by `columnSourceKey`. */
9
+ export type ColumnCatalogs = Readonly<Record<string, readonly Field[]>>;
10
+ export declare const columnSourceKey: (source: ColumnSource) => string;
11
+ /** Every distinct semantic source a card's columns come from: the catalogs to load. */
12
+ export declare function cardColumnSources(card: TCard): ColumnSource[];
13
+ /** The catalog field a column comes from, found in its own source's catalog. */
14
+ export declare function catalogFieldOfColumn(card: TCard, ref: CardColumnRef, catalogs: ColumnCatalogs | undefined): Field | undefined;
@@ -0,0 +1,9 @@
1
+ import { DashboardOperation } from '../operations/operation-types.js';
2
+ export type ConfirmClass = 'needed' | 'not_needed';
3
+ /** Counted only, so the class needs no viewer data: one entry per thing a change removes from viewers' saved state. */
4
+ export type ConfirmImpact = readonly unknown[];
5
+ export declare function confirmClassFor(input: {
6
+ operations: readonly DashboardOperation[];
7
+ impact: ConfirmImpact;
8
+ detaches: boolean;
9
+ }): ConfirmClass;
@@ -0,0 +1,19 @@
1
+ import { CardColumnRef, ConditionalRule } from '../conditional-formatting/types.js';
2
+ import { HighlightAddChange, HighlightStyleInput } from './inputs.js';
3
+ import { HighlightView } from './views.js';
4
+ /** A stored rule as the outline shows it, or undefined when part of it has no input word. */
5
+ export declare function readHighlight(rule: ConditionalRule, nameOf: (ref: CardColumnRef) => string | undefined): HighlightView | undefined;
6
+ /** A highlight change's rule, without its op and card. */
7
+ export type HighlightRuleInput = Pick<HighlightAddChange, 'column' | 'apply'> & HighlightStyleInput;
8
+ /**
9
+ * A highlight input as the rule the rule panel writes for the same choices
10
+ * (`createConditionalRule`): on its column, on the table's body, named as
11
+ * the panel names a new rule ("Margin rule 3", the card's third rule), on.
12
+ * A theme color stores the panel's background and text pair; a hex stores a
13
+ * background; a color scale stores backgrounds; a data bar its color, blue
14
+ * when none is given (V-6).
15
+ */
16
+ export declare function highlightRule(input: HighlightRuleInput, column: {
17
+ ref: CardColumnRef;
18
+ label: string;
19
+ }, id: string, index: number): ConditionalRule;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The one owner of how a card reads and shows (card appearance CA-D2, SPEC 4):
3
+ * the outline, the change resolver, the reducer and the editor's panels read
4
+ * and write a card's settings through it.
5
+ */
6
+ export { readCardSettings } from './read-card-settings.js';
7
+ export { resolveCardSettings, type CardSettingsContext, type CardSettingsRequest, type CardSettingsResolution, } from './resolve-card-settings.js';
8
+ export { applyCardSettings, type AppliedCardSettings, type DroppedSetting } from './apply-card-settings.js';
9
+ export { carryColumnSettings } from './carry-column-settings.js';
10
+ export { confirmClassFor, type ConfirmClass } from './confirm-class.js';
11
+ export { writeColumnFormat, withFormatOverride } from './column-format-write.js';
12
+ export { writeColumnPolarity } from './column-polarity-write.js';
13
+ export { writeComparisonDisplay, writeComparisonPresentation, writeInheritComparison } from './card-display-write.js';
14
+ export type { ResolvedCardSettings, ResolvedColumnSettings, ResolvedComparisonDisplay } from './resolved.js';
15
+ export { SETTINGS_BY_KIND, cardSettingsKind, type CardSettingsKind, type SettingName } from './card-kinds.js';
16
+ export type { AxisInput, CardSettingsInput, ColumnSettingsInput, ComparisonDisplayInput, DashboardUpdateChange, FormatInput, FormatPatch, HighlightAddChange, HighlightColor, HighlightCondition, HighlightRemoveChange, HighlightStyleInput, LegendPosition, Polarity, } from './inputs.js';
17
+ export type { CardSettingsView, ColumnSettingsRole, ColumnSettingsView, HighlightView } from './views.js';
@@ -0,0 +1,117 @@
1
+ import { MetricComparisonPolarity } from '../../analytics-protocol/metric-comparison.js';
2
+ import { SemaphorDateValueFormat, SemaphorDurationValueFormat, SemaphorNumericValueFormat, SemaphorValueFormat, TemporalBucketFormat } from '../../analytics-protocol/contracts.js';
3
+ /**
4
+ * CA-D18: a whole stored format (it has `type`), or a patch without `type`,
5
+ * merged onto the column's effective format (CF-D20).
6
+ */
7
+ export type FormatInput = SemaphorValueFormat | FormatPatch;
8
+ export type FormatPatch = {
9
+ type?: never;
10
+ } & Partial<Omit<SemaphorNumericValueFormat, 'type'> & Omit<SemaphorDateValueFormat, 'type'> & Omit<SemaphorDurationValueFormat, 'type'> & Omit<TemporalBucketFormat, 'type'>>;
11
+ /** Which way is good for a measure (reports by conversation RC-D3): the stored values and the model's word. */
12
+ export type Polarity = MetricComparisonPolarity;
13
+ export type ColumnSettingsInput = {
14
+ /** The header shown. Null returns it to the model's label. */
15
+ label?: string | null;
16
+ /** Hidden for everyone (CA-D16); it still computes, sorts and filters. */
17
+ hidden?: boolean;
18
+ /** Table column width in pixels; null returns it to automatic. */
19
+ width?: number | null;
20
+ /** Null removes the card's override, so the column follows the model. */
21
+ format?: FormatInput | null;
22
+ /** The card's own polarity; null removes it. Refused where the model sets a different one (RC-D3). */
23
+ polarity?: Polarity | null;
24
+ /** Read-only facts from the outline, accepted back unchanged (CA-INV-1). */
25
+ field?: string;
26
+ role?: string;
27
+ inherits?: string[];
28
+ };
29
+ export type AxisInput = {
30
+ title?: string | null;
31
+ min?: number | null;
32
+ max?: number | null;
33
+ };
34
+ export type LegendPosition = 'top' | 'bottom' | 'left' | 'right';
35
+ /** How a card shows its comparisons (RC-D4): a patch of the card's one comparison display. */
36
+ export type ComparisonDisplayInput = {
37
+ show?: boolean;
38
+ mode?: 'difference' | 'percent_change' | 'both' | 'ratio';
39
+ /** Decimals of a percent change or ratio, an integer 0 to 6; null returns to the surface's default. */
40
+ precision?: number | null;
41
+ };
42
+ /** Optional fields on `card.add` and `card.update`, beside `type`, `title`, `description`, `query` and `matrix`. */
43
+ export type CardSettingsInput = {
44
+ /** Keyed by column name (SPEC 3.3). */
45
+ columns?: Record<string, ColumnSettingsInput>;
46
+ orientation?: 'vertical' | 'horizontal';
47
+ stack?: 'none' | 'stacked';
48
+ donut?: boolean;
49
+ totals?: {
50
+ row: boolean;
51
+ };
52
+ dataLabels?: {
53
+ show: boolean;
54
+ format?: SemaphorValueFormat | null;
55
+ };
56
+ legend?: {
57
+ show: boolean;
58
+ position?: LegendPosition;
59
+ };
60
+ /** As seen on screen: `x` is `xAxisConfig`, `y` is `yAxisConfig`, on a horizontal bar too. */
61
+ axes?: {
62
+ x?: AxisInput;
63
+ y?: AxisInput;
64
+ };
65
+ comparisonDisplay?: ComparisonDisplayInput;
66
+ /** false: measures without a comparison of their own ignore the dashboard's; true removes the stored opt-out (RC-D16). */
67
+ inheritComparison?: boolean;
68
+ };
69
+ /** The filter operators (CA-D11): formatting and filtering share one condition language. */
70
+ export type HighlightCondition = {
71
+ operator: '=' | '!=' | '>' | '>=' | '<' | '<=';
72
+ value: number | string;
73
+ } | {
74
+ operator: 'between';
75
+ values: [number, number];
76
+ } | {
77
+ operator: 'contains';
78
+ value: string;
79
+ } | {
80
+ operator: 'is_null';
81
+ } | {
82
+ top: number;
83
+ } | {
84
+ bottom: number;
85
+ };
86
+ /** A theme name, `red` | `amber` | `green` | `blue` | `gray`, or `#rrggbb` (CA-D11). */
87
+ export type HighlightColor = string;
88
+ export type HighlightStyleInput = {
89
+ when: HighlightCondition;
90
+ color: HighlightColor;
91
+ } | {
92
+ scale: {
93
+ low: HighlightColor;
94
+ high: HighlightColor;
95
+ mid?: HighlightColor;
96
+ };
97
+ } | {
98
+ bars: {
99
+ color?: HighlightColor;
100
+ };
101
+ };
102
+ export type HighlightAddChange = {
103
+ op: 'highlight.add';
104
+ cardId: string;
105
+ column: string;
106
+ apply?: 'cell' | 'row';
107
+ } & HighlightStyleInput;
108
+ export type HighlightRemoveChange = {
109
+ op: 'highlight.remove';
110
+ cardId: string;
111
+ ruleId: string;
112
+ };
113
+ export type DashboardUpdateChange = {
114
+ op: 'dashboard.update';
115
+ title?: string;
116
+ description?: string | null;
117
+ };
@@ -0,0 +1,10 @@
1
+ import { TCard } from '../../../lib/types/common-types.js';
2
+ import { CardSettingsView } from './views.js';
3
+ /** The card's settings as the outline shows them (SPEC 3.2, 4.1). */
4
+ export declare function readCardSettings(card: TCard): CardSettingsView;
5
+ /**
6
+ * Whether a chart draws its data labels: a stored config off only when switched off or hidden (SPEC 3.5,
7
+ * V-5); with none stored, what the chart draws without one (ledger P3-09). The resolver and the sentences
8
+ * compare with this, not with the view's absence.
9
+ */
10
+ export declare function dataLabelsShown(card: Pick<TCard, 'type' | 'preferences'>): boolean;
@@ -0,0 +1,14 @@
1
+ import { TCard } from '../../../lib/types/common-types.js';
2
+ import { ChangeDiagnostic } from '../changes/diagnostics.js';
3
+ import { CardSettingsKind } from './card-kinds.js';
4
+ import { NamedColumn } from './column-names.js';
5
+ import { HighlightRuleInput } from './highlight-inputs.js';
6
+ import { ResolvedCardSettings } from './resolved.js';
7
+ export type HighlightsRequest = {
8
+ add?: HighlightRuleInput[];
9
+ remove?: string[];
10
+ };
11
+ export declare function resolveCardHighlights(card: TCard, kind: CardSettingsKind, named: readonly NamedColumn[], request: HighlightsRequest, context: {
12
+ path: string;
13
+ newId?: () => string;
14
+ }, problems: ChangeDiagnostic[]): ResolvedCardSettings['highlights'];