react-semaphor 0.1.558 → 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 (139) hide show
  1. package/dist/analytics-protocol/index.js +368 -358
  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-BCWoP6Rf.js → assistant-chat-Bu2fFm_I.js} +206 -207
  8. package/dist/chunks/{bookmark-state-PjQpxbG7.js → bookmark-state-BFY9oNmr.js} +3 -3
  9. package/dist/chunks/{braces-D5Ucy7q1.js → braces-Da41xfUd.js} +1 -1
  10. package/dist/chunks/{comparison-window-caption-Dc7BaCMz.js → comparison-window-caption-4FNkMrzE.js} +213 -213
  11. package/dist/chunks/{context-DVy4HOU0.js → context-BgPDzLHZ.js} +1 -1
  12. package/dist/chunks/{custom-visual-inputs-B-DLRGrV.js → custom-visual-inputs-Dz-enUNR.js} +1 -1
  13. package/dist/chunks/{dashboard-wK6Bai4V.js → dashboard-_MeBuy67.js} +1 -1
  14. package/dist/chunks/{dashboard-briefing-launcher-Coqghdn6.js → dashboard-briefing-launcher-CEi4Pr_v.js} +1152 -1166
  15. package/dist/chunks/{dashboard-controls-BYWSM2RM.js → dashboard-controls-Bi7fyG-4.js} +98 -98
  16. package/dist/chunks/{dashboard-json-pPTB5gj0.js → dashboard-json-B1mU_OMa.js} +5 -5
  17. package/dist/chunks/{document-dashboard-inputs-PY_7Xm55.js → document-dashboard-inputs-CkWfDB8c.js} +64 -64
  18. package/dist/chunks/{edit-dashboard-visual-BODxuUeq.js → edit-dashboard-visual-0CJN31Y3.js} +8274 -8514
  19. package/dist/chunks/filter-reach-copy-BF4w4kI2.js +3738 -0
  20. package/dist/chunks/{filter-value-text-CUBpotVN.js → filter-value-text-CRC-K_l_.js} +3 -3
  21. package/dist/chunks/{global-date-filter-utils-BsFqnnbA.js → global-date-filter-utils-D8365uPH.js} +4088 -3416
  22. package/dist/chunks/{index-DP_wQl0v.js → index-DtHidOPV.js} +579 -604
  23. package/dist/chunks/{layout-grid-CkoXmv0L.js → layout-grid-BvsH4RY2.js} +1 -1
  24. package/dist/chunks/{list-filter-B4i25kuc.js → list-filter-Dg0otx5E.js} +1 -1
  25. package/dist/chunks/{matrix-analytical-definition-4GTUDheD.js → matrix-analytical-definition-CM18W8w6.js} +41 -41
  26. package/dist/chunks/{matrix-card-fS_4O7zA.js → matrix-card-HPskLaPy.js} +3 -3
  27. package/dist/chunks/{matrix-member-presentation-Dj7HaAHC.js → matrix-member-presentation-Bbrfrke4.js} +1 -1
  28. package/dist/chunks/{matrix-operation-contract-CpgLZ7E5.js → matrix-operation-contract-WPv4R-H_.js} +130 -130
  29. package/dist/chunks/{metric-comparison-C8LY7GG5.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-stlpjVk4.js → palette-Bsh376zO.js} +1 -1
  32. package/dist/chunks/{pivot-result-contract-expectations-DMk-mKhG.js → pivot-result-contract-expectations-Bl5suy4-.js} +602 -696
  33. package/dist/chunks/{pivot-result-identity-CrQ54Xbj.js → pivot-result-identity-vS9TSh4f.js} +1 -1
  34. package/dist/chunks/{raw-temporal-presentation-BI2z2LlB.js → raw-temporal-presentation-BHm7s-hz.js} +230 -274
  35. package/dist/chunks/{report-preferences-dialog-Dc-YyVwf.js → report-preferences-dialog-BV8L0SeS.js} +55 -55
  36. package/dist/chunks/{report-runtime-context-CohdtiMg.js → report-runtime-context-BZQh9ywy.js} +2 -2
  37. package/dist/chunks/{resolve-dashboard-input-context-BZYI1hB0.js → resolve-dashboard-input-context-CAMiWvyR.js} +2021 -2239
  38. package/dist/chunks/{save-C1dgxgAu.js → save-B5EAsgQF.js} +1 -1
  39. package/dist/chunks/{saved-dashboard-context-CIBoMq46.js → saved-dashboard-context-n2Wn11cV.js} +57 -57
  40. package/dist/chunks/{selection-reducer-_d6aKJnj.js → selection-reducer-D0YnaAD9.js} +1 -1
  41. package/dist/chunks/{semaphor-ready-indicator-ERTLU7B4.js → semaphor-ready-indicator-XLBLOJ2V.js} +38446 -39176
  42. package/dist/chunks/{shelf-drop-preview-context-fEnx6iL_.js → shelf-drop-preview-context-DHMa54a-.js} +570 -570
  43. package/dist/chunks/source-entity-resolution-dUG5VWRm.js +607 -0
  44. package/dist/chunks/{switch-BqUan2mN.js → switch-ByxH4M7t.js} +3 -3
  45. package/dist/chunks/{table-export-sheet-CTCTA_bd.js → table-export-sheet-C_GdeTYU.js} +1 -1
  46. package/dist/chunks/{table-settings-DF1gdVQR.js → table-settings-Imz0FgWi.js} +8 -8
  47. package/dist/chunks/{temporal-input-presentation-DoSniQj1.js → temporal-input-presentation-uvNK_tM0.js} +1109 -820
  48. package/dist/chunks/{token-types-DFyLflLY.js → token-types-CQtXUVMy.js} +1 -1
  49. package/dist/chunks/{upload-DcoyjkRV.js → upload-wbR-NVzq.js} +1 -1
  50. package/dist/chunks/{use-create-flow-overlay-state-xhb9YFg-.js → use-create-flow-overlay-state-CEBaLOKC.js} +6 -6
  51. package/dist/chunks/validators-CXTneCA4.js +3453 -0
  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 -1496
  55. package/dist/data-app-sdk/index.js +20 -20
  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 +13 -44
  84. package/dist/types/lib/utils/card-config-utils.d.ts +9 -1
  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/analytics-protocol/source-capabilities.d.ts +21 -0
  97. package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +8 -0
  98. package/dist/types/shared/assistant-protocol/context.d.ts +69 -69
  99. package/dist/types/shared/dashboard-authoring/canonical-result-keys.d.ts +13 -0
  100. package/dist/types/shared/dashboard-authoring/card-export-request.d.ts +4 -1
  101. package/dist/types/shared/dashboard-authoring/card-formats/sql-date-pattern.d.ts +10 -0
  102. package/dist/types/shared/dashboard-authoring/card-formats/upgrade-card-formats.d.ts +57 -0
  103. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +24 -24
  104. package/dist/types/shared/dashboard-authoring/conditional-formatting/editable.d.ts +14 -0
  105. package/dist/types/shared/dashboard-authoring/conditional-formatting/evaluate.d.ts +16 -0
  106. package/dist/types/shared/dashboard-authoring/conditional-formatting/index.d.ts +9 -0
  107. package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +14 -0
  108. package/dist/types/shared/dashboard-authoring/conditional-formatting/resolve-card-column-ref.d.ts +17 -0
  109. package/dist/types/shared/dashboard-authoring/conditional-formatting/retain.d.ts +14 -0
  110. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +4499 -0
  111. package/dist/types/shared/dashboard-authoring/conditional-formatting/store.d.ts +12 -0
  112. package/dist/types/shared/dashboard-authoring/conditional-formatting/types.d.ts +151 -0
  113. package/dist/types/shared/dashboard-authoring/conditional-formatting/upgrade.d.ts +35 -0
  114. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +62 -62
  115. package/dist/types/shared/dashboard-authoring/dashboard-card-source-index.d.ts +2 -0
  116. package/dist/types/shared/dashboard-authoring/index.d.ts +5 -0
  117. package/dist/types/shared/dashboard-authoring/legacy-table-routing.d.ts +4 -2
  118. package/dist/types/shared/dashboard-authoring/matrix-authoring.d.ts +4 -5
  119. package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +24 -736
  120. package/dist/types/shared/dashboard-authoring/retired-presentation-fields.d.ts +31 -0
  121. package/dist/types/shared/dashboard-authoring/upgrade-card-presentation.d.ts +14 -0
  122. package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +5 -1
  123. package/dist/types/shared/format-utils/formatters/number-formatter.d.ts +16 -0
  124. package/dist/types/shared/format-utils/index.d.ts +2 -0
  125. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +10 -366
  126. package/dist/types/shared/format-utils/raw-temporal.d.ts +15 -1
  127. package/dist/types/shared/format-utils/resolve-column-format.d.ts +43 -0
  128. package/dist/types/shared/format-utils/retired-format-adapters.d.ts +68 -0
  129. package/dist/types/shared/format-utils/semantic-format.d.ts +5 -1
  130. package/dist/types/shared/format-utils/stored-value-format.d.ts +16 -0
  131. package/dist/types/shared/format-utils/types/format-types.d.ts +10 -12
  132. package/package.json +1 -1
  133. package/dist/chunks/analytics-base-schemas-BUFUoO6G.js +0 -472
  134. package/dist/chunks/editor-draft-sync-BN5qYHPF.js +0 -15
  135. package/dist/chunks/filter-reach-copy-BvJH9JO-.js +0 -3411
  136. package/dist/chunks/source-entity-resolution-DXW1HpKf.js +0 -816
  137. package/dist/chunks/validators-hmfNNQz8.js +0 -3595
  138. package/dist/types/lib/table-formatting/table-conditional-formatting-evaluator.d.ts +0 -9
  139. package/dist/types/lib/table-formatting/table-formatting-validation.d.ts +0 -12
@@ -0,0 +1,31 @@
1
+ import { TCard } from '../../lib/types/common-types.js';
2
+ export type RetiredPresentationField = {
3
+ /** Where the field is, e.g. `sheets[id=s1].frames[id=f1].cards[id=c1].preferences.formatNumber`. */
4
+ path: string;
5
+ /** The retired field's name, e.g. `formatNumber`. */
6
+ field: string;
7
+ /** What to write instead. */
8
+ replacement: string;
9
+ };
10
+ /**
11
+ * Whether a stored record holds a key, whatever its value (`null`, `{}` and
12
+ * `[]` included): what the save check refuses, and so what the upgrades must
13
+ * clear (column formats ledger P5-18).
14
+ */
15
+ export declare function hasStoredKey(record: unknown, key: string): boolean;
16
+ /** Every retired presentation field on one card; `at` is the card's path. */
17
+ export declare function findRetiredCardPresentationFields(card: TCard, at: string): RetiredPresentationField[];
18
+ /** Every retired presentation field in a dashboard template or a library visual frame. */
19
+ export declare function findRetiredPresentationFields(template: unknown): RetiredPresentationField[];
20
+ export type PresentationStoreIssue = {
21
+ code: 'retired_presentation_field' | 'invalid_conditional_formatting';
22
+ path: string;
23
+ message: string;
24
+ };
25
+ /**
26
+ * What the save check refuses in a dashboard template or a library visual
27
+ * frame (column formats CF-D8, conditional formatting store CR-D9): every
28
+ * retired presentation field, and a rule store whose shape is wrong or whose
29
+ * rules name a column the card doesn't have. Empty when the template saves.
30
+ */
31
+ export declare function checkPresentationStores(template: unknown): PresentationStoreIssue[];
@@ -0,0 +1,14 @@
1
+ import { TCard } from '../../lib/types/common-types.js';
2
+ import { UpgradeCardFormatsOptions, UpgradeCardFormatsResult } from './card-formats/upgrade-card-formats.js';
3
+ import { UpgradeConditionalFormattingResult } from './conditional-formatting/upgrade.js';
4
+ export type UpgradeCardPresentationOptions = UpgradeCardFormatsOptions & {
5
+ /** One part only; omitted, both. */
6
+ only?: 'formats' | 'rules';
7
+ };
8
+ export type UpgradeCardPresentationResult = {
9
+ /** The input card itself when nothing changed. */
10
+ card: TCard;
11
+ formats?: UpgradeCardFormatsResult;
12
+ rules?: UpgradeConditionalFormattingResult;
13
+ };
14
+ export declare function upgradeCardPresentation(card: TCard, options?: UpgradeCardPresentationOptions): UpgradeCardPresentationResult;
@@ -29,7 +29,11 @@ export declare function matrixLevelLabels(input: {
29
29
  visible: boolean;
30
30
  total: boolean;
31
31
  }>;
32
- /** Shared viewer/export adapter. Arithmetic, precision and temporal rules stay shared. */
32
+ /**
33
+ * Shared viewer/export adapter: a Matrix measure's or level's format, its
34
+ * override, else its catalog (model) format, in the one precedence
35
+ * (`pickColumnFormat`). Arithmetic, precision and temporal rules stay shared.
36
+ */
33
37
  export declare function resolveMatrixValueFormat(override: SemaphorValueFormat | undefined, semantic: SemaphorValueFormat | undefined): import('../semantic-format.js').AdaptedCanonicalFormatSpec | undefined;
34
38
  /** One card's prepared formats: every Matrix surface (screen, Layout CSV, Flat CSV, PDF) formats through it. */
35
39
  export type MatrixFormatting = ReturnType<typeof prepareMatrixFormatting>;
@@ -20,6 +20,22 @@ export declare function formatPercent(value: NumericValue | null | undefined, op
20
20
  * Format a number in scientific notation
21
21
  */
22
22
  export declare function formatScientific(value: NumericValue | null | undefined, options?: NumberFormatOptions): string;
23
+ /**
24
+ * What `signDisplay` (column formats CF-D16) does to a value: `never` drops
25
+ * its sign, `always` and `exceptZero` put a plus before a positive one;
26
+ * absent means `auto`. The one sign rule for every number formatter.
27
+ */
28
+ export declare function applySignDisplay(value: NumericValue, signDisplay: NumericCanonicalFormat['signDisplay']): {
29
+ value: NumericValue;
30
+ plus: boolean;
31
+ };
32
+ /**
33
+ * The format a change between two values shows with (a comparison's
34
+ * difference, a KPI's delta): its measure's, without the measure's
35
+ * `signDisplay`, which describes the values, not a change. The surface that
36
+ * shows the change puts its direction on it, once (column formats ledger P5-46).
37
+ */
38
+ export declare function changeFormat<T extends object | undefined>(format: T): T;
23
39
  export declare function formatNumericCanonical(value: number | ExactNumericValue | null | undefined, format: NumericCanonicalFormat): string;
24
40
  /**
25
41
  * Formats a table measure value with its resolved format: numeric styles go
@@ -25,6 +25,7 @@ export type * from './table-structure.js';
25
25
  export * from './pdf-export-policy.js';
26
26
  export * from './pdf-delivery.js';
27
27
  export * from './numeric-presentation.js';
28
+ export { pickColumnFormat, resolveColumnFormat, withLiveModelFormats, type ColumnFormatSource, type FormatSurface, type ModelFormats, type ResolvedColumnFormat, } from './resolve-column-format.js';
28
29
  export * from './presentation-execution.js';
29
30
  export * from './temporal-bucket-format-policy.js';
30
31
  export * from './temporal-bucket.js';
@@ -38,6 +39,7 @@ export { describeFilterValueInFullDetail, type FullDetailFilterValue, } from './
38
39
  export { describeConditionInFullDetail, type FilterClauseText } from './filter-detail.js';
39
40
  export { formatCanonicalComparisonRange } from '../../lib/utils/comparison-window-caption.js';
40
41
  export { PDF_GROUP_CONTINUATION_CLASS } from './grouped-table-presentation.js';
42
+ export { toStoredValueFormat } from './stored-value-format.js';
41
43
  export { SEMAPHOR_GENERATED_COUNT_METRIC_ID } from '../analytics-protocol/contracts.js';
42
44
  export { resolveMetricResultAlias } from '../analytics-protocol/metric-comparison.js';
43
45
  export * from './pivot-header-presentation.js';
@@ -133,186 +133,8 @@ export declare function buildMatrixPrintTable(input: {
133
133
  };
134
134
  levelLabels: Readonly<Record<string, string>>;
135
135
  measureLabels: Readonly<Record<string, string>>;
136
- levelFormats: Readonly<Record<string, import('../analytics-protocol/index.js').TemporalBucketFormat | {
137
- type: "date" | "datetime";
138
- pattern?: string | undefined;
139
- locale?: string | undefined;
140
- prefix?: string | undefined;
141
- suffix?: string | undefined;
142
- relative?: boolean | undefined;
143
- timezone?: string | undefined;
144
- sourceTimezone?: string | undefined;
145
- } | {
146
- type: "duration";
147
- prefix?: string | undefined;
148
- suffix?: string | undefined;
149
- negativeStyle?: "minus" | "parentheses" | undefined;
150
- inputUnit?: "second" | "minute" | "hour" | "day" | "millisecond" | undefined;
151
- outputStyle?: "compact" | "digital" | "long" | undefined;
152
- largestUnit?: "second" | "minute" | "hour" | "day" | "millisecond" | undefined;
153
- smallestUnit?: "second" | "minute" | "hour" | "day" | "millisecond" | undefined;
154
- maxUnits?: number | undefined;
155
- } | {
156
- type: "string";
157
- prefix?: string | undefined;
158
- suffix?: string | undefined;
159
- } | {
160
- type: "number" | "currency" | "percent" | "percentage" | "scientific";
161
- currency?: string | undefined;
162
- minimumFractionDigits?: number | undefined;
163
- maximumFractionDigits?: number | undefined;
164
- useGrouping?: boolean | undefined;
165
- prefix?: string | undefined;
166
- suffix?: string | undefined;
167
- negativeStyle?: "minus" | "parentheses" | undefined;
168
- compact?: boolean | undefined;
169
- scale?: number | undefined;
170
- percentValueMode?: "fraction" | "whole" | undefined;
171
- }>>;
172
- measureFormats: Readonly<Record<string, import('../analytics-protocol/index.js').TemporalBucketFormat | {
173
- type: "date" | "datetime";
174
- pattern?: string | undefined;
175
- locale?: string | undefined;
176
- prefix?: string | undefined;
177
- suffix?: string | undefined;
178
- relative?: boolean | undefined;
179
- timezone?: string | undefined;
180
- sourceTimezone?: string | undefined;
181
- } | {
182
- type: "duration";
183
- prefix?: string | undefined;
184
- suffix?: string | undefined;
185
- negativeStyle?: "minus" | "parentheses" | undefined;
186
- inputUnit?: "second" | "minute" | "hour" | "day" | "millisecond" | undefined;
187
- outputStyle?: "compact" | "digital" | "long" | undefined;
188
- largestUnit?: "second" | "minute" | "hour" | "day" | "millisecond" | undefined;
189
- smallestUnit?: "second" | "minute" | "hour" | "day" | "millisecond" | undefined;
190
- maxUnits?: number | undefined;
191
- } | {
192
- type: "string";
193
- prefix?: string | undefined;
194
- suffix?: string | undefined;
195
- } | {
196
- type: "number" | "currency" | "percent" | "percentage" | "scientific";
197
- currency?: string | undefined;
198
- minimumFractionDigits?: number | undefined;
199
- maximumFractionDigits?: number | undefined;
200
- useGrouping?: boolean | undefined;
201
- prefix?: string | undefined;
202
- suffix?: string | undefined;
203
- negativeStyle?: "minus" | "parentheses" | undefined;
204
- compact?: boolean | undefined;
205
- scale?: number | undefined;
206
- percentValueMode?: "fraction" | "whole" | undefined;
207
- }>>;
208
- conditionalFormatting?: {
209
- version: 1;
210
- rules: {
211
- id: string;
212
- target: {
213
- level: "row" | "cell";
214
- matrix?: {
215
- axis: "columns" | "rows";
216
- levelId?: string | undefined;
217
- oppositePath?: {
218
- member: {
219
- value: string | number | boolean | {
220
- value: string;
221
- type: "integer" | "decimal";
222
- kind: "exact_number";
223
- } | null;
224
- kind: "value";
225
- } | {
226
- kind: "others";
227
- rankingId: string;
228
- };
229
- levelId: string;
230
- }[] | undefined;
231
- } | undefined;
232
- columnIds?: string[] | undefined;
233
- conditionColumnId?: string | undefined;
234
- applyToColumnIds?: string[] | undefined;
235
- tableParts?: ("subtotal" | "body" | "header" | "footer" | "grandTotal")[] | undefined;
236
- rowRoles?: ("member" | "subtotal" | "grand_total" | "others")[] | undefined;
237
- depth?: number | undefined;
238
- includeTotals?: boolean | undefined;
239
- includeSubtotals?: boolean | undefined;
240
- };
241
- condition: {
242
- value: string | number | boolean | {
243
- value: string;
244
- type: "integer" | "decimal";
245
- kind: "exact_number";
246
- } | null;
247
- kind: "comparison";
248
- operator: "eq" | "neq" | "gt" | "gte" | "lt" | "lte";
249
- columnId: string;
250
- } | {
251
- kind: "between";
252
- columnId: string;
253
- min: string | number | boolean | {
254
- value: string;
255
- type: "integer" | "decimal";
256
- kind: "exact_number";
257
- } | null;
258
- max: string | number | boolean | {
259
- value: string;
260
- type: "integer" | "decimal";
261
- kind: "exact_number";
262
- } | null;
263
- inclusive?: boolean | undefined;
264
- } | {
265
- kind: "blank";
266
- columnId: string;
267
- isBlank: boolean;
268
- } | {
269
- value: string;
270
- kind: "contains";
271
- columnId: string;
272
- exact?: boolean | undefined;
273
- caseSensitive?: boolean | undefined;
274
- } | {
275
- kind: "topBottom";
276
- count: number;
277
- columnId: string;
278
- direction: "top" | "bottom";
279
- } | {
280
- kind: "colorScale";
281
- columnId: string;
282
- range: "auto" | "manual";
283
- colors: {
284
- min: string;
285
- max: string;
286
- mid?: string | undefined;
287
- };
288
- min?: number | undefined;
289
- max?: number | undefined;
290
- mid?: number | undefined;
291
- } | {
292
- kind: "dataBar";
293
- columnId: string;
294
- range: "auto" | "manual";
295
- color: string;
296
- min?: number | undefined;
297
- max?: number | undefined;
298
- showValue?: boolean | undefined;
299
- };
300
- name?: string | undefined;
301
- enabled?: boolean | undefined;
302
- style?: {
303
- dataBar?: {
304
- color: string;
305
- showValue: boolean;
306
- } | undefined;
307
- backgroundColor?: string | undefined;
308
- textColor?: string | undefined;
309
- fontWeight?: "normal" | "medium" | "semibold" | "bold" | undefined;
310
- italic?: boolean | undefined;
311
- textDecoration?: "none" | "underline" | "line-through" | undefined;
312
- icon?: "arrowUp" | "arrowDown" | "warning" | "check" | "x" | undefined;
313
- } | undefined;
314
- }[];
315
- } | undefined;
136
+ levelFormats: Readonly<Record<string, import('../analytics-protocol/index.js').SemaphorValueFormat>>;
137
+ measureFormats: Readonly<Record<string, import('../analytics-protocol/index.js').SemaphorValueFormat>>;
316
138
  };
317
139
  mode: "layout";
318
140
  format: "csv" | "xlsx" | "pdf";
@@ -328,11 +150,11 @@ export declare function buildMatrixPrintTable(input: {
328
150
  kind: "physical";
329
151
  connectionId: string;
330
152
  tableName: string;
153
+ dialect?: "postgres" | "mysql" | "mssql" | "snowflake" | "clickhouse" | "bigquery" | "redshift" | "duckdb" | "sqlite" | "unknown" | undefined;
331
154
  label?: string | undefined;
332
155
  connectionType?: string | undefined;
333
156
  databaseName?: string | undefined;
334
157
  schemaName?: string | undefined;
335
- dialect?: "postgres" | "mysql" | "mssql" | "snowflake" | "clickhouse" | "bigquery" | "redshift" | "duckdb" | "sqlite" | "unknown" | undefined;
336
158
  };
337
159
  columns: readonly import('../analytics-protocol/index.js').MatrixLevel[];
338
160
  measures: readonly ({
@@ -374,8 +196,8 @@ export declare function buildMatrixPrintTable(input: {
374
196
  parent: readonly {
375
197
  member: {
376
198
  value: string | number | boolean | {
377
- value: string;
378
199
  type: "integer" | "decimal";
200
+ value: string;
379
201
  kind: "exact_number";
380
202
  } | null;
381
203
  kind: "value";
@@ -407,8 +229,8 @@ export declare function buildMatrixPrintTable(input: {
407
229
  path: readonly {
408
230
  member: {
409
231
  value: string | number | boolean | {
410
- value: string;
411
232
  type: "integer" | "decimal";
233
+ value: string;
412
234
  kind: "exact_number";
413
235
  } | null;
414
236
  kind: "value";
@@ -427,8 +249,8 @@ export declare function buildMatrixPrintTable(input: {
427
249
  path: readonly {
428
250
  member: {
429
251
  value: string | number | boolean | {
430
- value: string;
431
252
  type: "integer" | "decimal";
253
+ value: string;
432
254
  kind: "exact_number";
433
255
  } | null;
434
256
  kind: "value";
@@ -486,186 +308,8 @@ export declare function buildMatrixPrintTable(input: {
486
308
  };
487
309
  levelLabels: Readonly<Record<string, string>>;
488
310
  measureLabels: Readonly<Record<string, string>>;
489
- levelFormats: Readonly<Record<string, import('../analytics-protocol/index.js').TemporalBucketFormat | {
490
- type: "date" | "datetime";
491
- pattern?: string | undefined;
492
- locale?: string | undefined;
493
- prefix?: string | undefined;
494
- suffix?: string | undefined;
495
- relative?: boolean | undefined;
496
- timezone?: string | undefined;
497
- sourceTimezone?: string | undefined;
498
- } | {
499
- type: "duration";
500
- prefix?: string | undefined;
501
- suffix?: string | undefined;
502
- negativeStyle?: "minus" | "parentheses" | undefined;
503
- inputUnit?: "second" | "minute" | "hour" | "day" | "millisecond" | undefined;
504
- outputStyle?: "compact" | "digital" | "long" | undefined;
505
- largestUnit?: "second" | "minute" | "hour" | "day" | "millisecond" | undefined;
506
- smallestUnit?: "second" | "minute" | "hour" | "day" | "millisecond" | undefined;
507
- maxUnits?: number | undefined;
508
- } | {
509
- type: "string";
510
- prefix?: string | undefined;
511
- suffix?: string | undefined;
512
- } | {
513
- type: "number" | "currency" | "percent" | "percentage" | "scientific";
514
- currency?: string | undefined;
515
- minimumFractionDigits?: number | undefined;
516
- maximumFractionDigits?: number | undefined;
517
- useGrouping?: boolean | undefined;
518
- prefix?: string | undefined;
519
- suffix?: string | undefined;
520
- negativeStyle?: "minus" | "parentheses" | undefined;
521
- compact?: boolean | undefined;
522
- scale?: number | undefined;
523
- percentValueMode?: "fraction" | "whole" | undefined;
524
- }>>;
525
- measureFormats: Readonly<Record<string, import('../analytics-protocol/index.js').TemporalBucketFormat | {
526
- type: "date" | "datetime";
527
- pattern?: string | undefined;
528
- locale?: string | undefined;
529
- prefix?: string | undefined;
530
- suffix?: string | undefined;
531
- relative?: boolean | undefined;
532
- timezone?: string | undefined;
533
- sourceTimezone?: string | undefined;
534
- } | {
535
- type: "duration";
536
- prefix?: string | undefined;
537
- suffix?: string | undefined;
538
- negativeStyle?: "minus" | "parentheses" | undefined;
539
- inputUnit?: "second" | "minute" | "hour" | "day" | "millisecond" | undefined;
540
- outputStyle?: "compact" | "digital" | "long" | undefined;
541
- largestUnit?: "second" | "minute" | "hour" | "day" | "millisecond" | undefined;
542
- smallestUnit?: "second" | "minute" | "hour" | "day" | "millisecond" | undefined;
543
- maxUnits?: number | undefined;
544
- } | {
545
- type: "string";
546
- prefix?: string | undefined;
547
- suffix?: string | undefined;
548
- } | {
549
- type: "number" | "currency" | "percent" | "percentage" | "scientific";
550
- currency?: string | undefined;
551
- minimumFractionDigits?: number | undefined;
552
- maximumFractionDigits?: number | undefined;
553
- useGrouping?: boolean | undefined;
554
- prefix?: string | undefined;
555
- suffix?: string | undefined;
556
- negativeStyle?: "minus" | "parentheses" | undefined;
557
- compact?: boolean | undefined;
558
- scale?: number | undefined;
559
- percentValueMode?: "fraction" | "whole" | undefined;
560
- }>>;
561
- conditionalFormatting?: {
562
- version: 1;
563
- rules: {
564
- id: string;
565
- target: {
566
- level: "row" | "cell";
567
- matrix?: {
568
- axis: "columns" | "rows";
569
- levelId?: string | undefined;
570
- oppositePath?: {
571
- member: {
572
- value: string | number | boolean | {
573
- value: string;
574
- type: "integer" | "decimal";
575
- kind: "exact_number";
576
- } | null;
577
- kind: "value";
578
- } | {
579
- kind: "others";
580
- rankingId: string;
581
- };
582
- levelId: string;
583
- }[] | undefined;
584
- } | undefined;
585
- columnIds?: string[] | undefined;
586
- conditionColumnId?: string | undefined;
587
- applyToColumnIds?: string[] | undefined;
588
- tableParts?: ("subtotal" | "body" | "header" | "footer" | "grandTotal")[] | undefined;
589
- rowRoles?: ("member" | "subtotal" | "grand_total" | "others")[] | undefined;
590
- depth?: number | undefined;
591
- includeTotals?: boolean | undefined;
592
- includeSubtotals?: boolean | undefined;
593
- };
594
- condition: {
595
- value: string | number | boolean | {
596
- value: string;
597
- type: "integer" | "decimal";
598
- kind: "exact_number";
599
- } | null;
600
- kind: "comparison";
601
- operator: "eq" | "neq" | "gt" | "gte" | "lt" | "lte";
602
- columnId: string;
603
- } | {
604
- kind: "between";
605
- columnId: string;
606
- min: string | number | boolean | {
607
- value: string;
608
- type: "integer" | "decimal";
609
- kind: "exact_number";
610
- } | null;
611
- max: string | number | boolean | {
612
- value: string;
613
- type: "integer" | "decimal";
614
- kind: "exact_number";
615
- } | null;
616
- inclusive?: boolean | undefined;
617
- } | {
618
- kind: "blank";
619
- columnId: string;
620
- isBlank: boolean;
621
- } | {
622
- value: string;
623
- kind: "contains";
624
- columnId: string;
625
- exact?: boolean | undefined;
626
- caseSensitive?: boolean | undefined;
627
- } | {
628
- kind: "topBottom";
629
- count: number;
630
- columnId: string;
631
- direction: "top" | "bottom";
632
- } | {
633
- kind: "colorScale";
634
- columnId: string;
635
- range: "auto" | "manual";
636
- colors: {
637
- min: string;
638
- max: string;
639
- mid?: string | undefined;
640
- };
641
- min?: number | undefined;
642
- max?: number | undefined;
643
- mid?: number | undefined;
644
- } | {
645
- kind: "dataBar";
646
- columnId: string;
647
- range: "auto" | "manual";
648
- color: string;
649
- min?: number | undefined;
650
- max?: number | undefined;
651
- showValue?: boolean | undefined;
652
- };
653
- name?: string | undefined;
654
- enabled?: boolean | undefined;
655
- style?: {
656
- dataBar?: {
657
- color: string;
658
- showValue: boolean;
659
- } | undefined;
660
- backgroundColor?: string | undefined;
661
- textColor?: string | undefined;
662
- fontWeight?: "normal" | "medium" | "semibold" | "bold" | undefined;
663
- italic?: boolean | undefined;
664
- textDecoration?: "none" | "underline" | "line-through" | undefined;
665
- icon?: "arrowUp" | "arrowDown" | "warning" | "check" | "x" | undefined;
666
- } | undefined;
667
- }[];
668
- } | undefined;
311
+ levelFormats: Readonly<Record<string, import('../analytics-protocol/index.js').SemaphorValueFormat>>;
312
+ measureFormats: Readonly<Record<string, import('../analytics-protocol/index.js').SemaphorValueFormat>>;
669
313
  };
670
314
  mode: "flat";
671
315
  format: "csv" | "xlsx";
@@ -681,11 +325,11 @@ export declare function buildMatrixPrintTable(input: {
681
325
  kind: "physical";
682
326
  connectionId: string;
683
327
  tableName: string;
328
+ dialect?: "postgres" | "mysql" | "mssql" | "snowflake" | "clickhouse" | "bigquery" | "redshift" | "duckdb" | "sqlite" | "unknown" | undefined;
684
329
  label?: string | undefined;
685
330
  connectionType?: string | undefined;
686
331
  databaseName?: string | undefined;
687
332
  schemaName?: string | undefined;
688
- dialect?: "postgres" | "mysql" | "mssql" | "snowflake" | "clickhouse" | "bigquery" | "redshift" | "duckdb" | "sqlite" | "unknown" | undefined;
689
333
  };
690
334
  columns: readonly import('../analytics-protocol/index.js').MatrixLevel[];
691
335
  measures: readonly ({
@@ -727,8 +371,8 @@ export declare function buildMatrixPrintTable(input: {
727
371
  parent: readonly {
728
372
  member: {
729
373
  value: string | number | boolean | {
730
- value: string;
731
374
  type: "integer" | "decimal";
375
+ value: string;
732
376
  kind: "exact_number";
733
377
  } | null;
734
378
  kind: "value";
@@ -1,10 +1,21 @@
1
1
  import { ExportWallClock } from './exporters/export-cells.js';
2
2
  import { CalendarContext } from '../report-runtime-context/report-runtime-context.js';
3
- import { RawTemporalValueKind, RawTemporalValueMetadata } from '../analytics-protocol/contracts.js';
3
+ import { RawDatePreset, RawTemporalValueKind, RawTemporalValueMetadata } from '../analytics-protocol/contracts.js';
4
4
  import { parseRawTemporalValueMetadata, validateRawTemporalResultColumn } from '../analytics-protocol/raw-temporal-contract.js';
5
5
  import { LocaleStyle, ResolvedValueFormatPreferences } from '../value-format-preferences/index.js';
6
6
  import { RawTemporalFormat, RawTemporalPatternDialect } from './types/format-types.js';
7
7
  export type { RawTemporalFormat, RawTemporalPatternDialect };
8
+ /**
9
+ * A stored raw date format's presentation (column formats CF-D4, CF-D16): its
10
+ * preset, its pattern in its dialect (unnamed means Semaphor tokens), else
11
+ * automatic. The one mapping for every raw date reader: detail columns and
12
+ * Matrix levels (ledger P5-44).
13
+ */
14
+ export declare function storedRawDatePresentation(format: {
15
+ pattern?: string;
16
+ dialect?: RawTemporalPatternDialect;
17
+ preset?: RawDatePreset;
18
+ }): RawTemporalFormat['presentation'];
8
19
  export { parseRawTemporalValueMetadata, validateRawTemporalResultColumn, type RawTemporalValueKind, type RawTemporalValueMetadata, };
9
20
  export type ResolvedTemporalStyleSet = {
10
21
  dateStyle: LocaleStyle;
@@ -26,6 +37,9 @@ export type ResolvedRawTemporalFormat = {
26
37
  mode: 'pattern';
27
38
  dialect: RawTemporalPatternDialect;
28
39
  pattern: string;
40
+ } | {
41
+ mode: 'preset';
42
+ preset: RawDatePreset;
29
43
  };
30
44
  };
31
45
  export type RawTemporalFormatResult = {
@@ -0,0 +1,43 @@
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 '../dashboard-authoring/conditional-formatting/types.js';
5
+ /** Where a format shows. Only chart surfaces have a `valueFormat` of their own. */
6
+ export type FormatSurface = 'tableCell' | 'tableTotal' | 'kpiValue' | 'kpiDelta' | 'valueAxis' | 'tooltip' | 'dataLabel' | 'pieLabel' | 'export';
7
+ export type ColumnFormatSource = 'surface' | 'override' | 'model' | 'snapshot' | 'automatic';
8
+ export type ResolvedColumnFormat = {
9
+ /** The stored format to present; absent when the source is `automatic`. */
10
+ format?: SemaphorValueFormat;
11
+ source: ColumnFormatSource;
12
+ };
13
+ /** Live model formats by card field id, as the query response carries them (CF-D23). */
14
+ export type ModelFormats = Readonly<Record<string, SemaphorValueFormat>>;
15
+ type FormatCard = Pick<TCard, 'config' | 'preferences'>;
16
+ /** A card column by id, from every list a format can sit on. */
17
+ export declare function findCardColumn(card: FormatCard, fieldId: string): Field | undefined;
18
+ /**
19
+ * The one precedence (CF-D5), over the formats a caller found for a column:
20
+ * the surface's own, the card's override, the live model format, a snapshot;
21
+ * else automatic. `resolveColumnFormat` finds them on a card; the Matrix
22
+ * formatter, which holds a presentation and a catalog rather than a card,
23
+ * passes its own.
24
+ */
25
+ export declare function pickColumnFormat(candidates: {
26
+ surface?: SemaphorValueFormat;
27
+ override?: SemaphorValueFormat;
28
+ model?: SemaphorValueFormat;
29
+ snapshot?: SemaphorValueFormat;
30
+ }): ResolvedColumnFormat;
31
+ export declare function resolveColumnFormat(input: {
32
+ card: FormatCard;
33
+ column: CardColumnRef;
34
+ /** Where it shows; absent when only the column's own format is asked for. */
35
+ surface?: FormatSurface;
36
+ modelFormats?: ModelFormats;
37
+ /** A Matrix measure's or level's catalog format, its model format. */
38
+ catalogFormat?: SemaphorValueFormat;
39
+ }): ResolvedColumnFormat;
40
+ export declare function withLiveModelFormats<T extends NonNullable<TCard['config']>>(config: T | undefined, result: {
41
+ modelFormats?: ModelFormats;
42
+ } | undefined): T | undefined;
43
+ export {};