react-semaphor 0.1.559 → 0.1.561

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 +389 -378
  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-CB3oFAXk.js +658 -0
  7. package/dist/chunks/{assistant-chat-B_4bVE6I.js → assistant-chat-DiVHY3Hw.js} +209 -211
  8. package/dist/chunks/bookmark-impact-CR09dpkn.js +75 -0
  9. package/dist/chunks/bookmark-state-BusLpkb7.js +743 -0
  10. package/dist/chunks/{braces-Rdxa3H-s.js → braces-u8VorWJc.js} +1 -1
  11. package/dist/chunks/{comparison-window-caption-CKzQ5LcF.js → comparison-window-caption-DDsIWJYT.js} +201 -201
  12. package/dist/chunks/{context-DVy4HOU0.js → context-TUjw9eqr.js} +1 -1
  13. package/dist/chunks/{custom-visual-inputs-zVa9wX_o.js → custom-visual-inputs-DfolidZ9.js} +1 -1
  14. package/dist/chunks/{dashboard-BziwOVpZ.js → dashboard-BRdZBPqr.js} +1 -1
  15. package/dist/chunks/{dashboard-briefing-launcher-CbeNR-YI.js → dashboard-briefing-launcher-CgvTLndW.js} +1163 -1178
  16. package/dist/chunks/{dashboard-controls-RD6UJs1r.js → dashboard-controls-B4vfSzTF.js} +877 -941
  17. package/dist/chunks/{dashboard-json-DGpv17vL.js → dashboard-json-Y3MF59g7.js} +5 -5
  18. package/dist/chunks/document-dashboard-inputs-CvBbFTUA.js +1718 -0
  19. package/dist/chunks/{edit-dashboard-visual-AQ2pQkFp.js → edit-dashboard-visual-DwjZcxj-.js} +9080 -9354
  20. package/dist/chunks/filter-reach-copy-bijwf_-b.js +3596 -0
  21. package/dist/chunks/{filter-value-text-B4l-xqJT.js → filter-value-text-DFnhwuEW.js} +3 -3
  22. package/dist/chunks/global-date-filter-utils-BXgCpvQM.js +15142 -0
  23. package/dist/chunks/{index-B1Xr7W24.js → index-ClwbY3BL.js} +648 -674
  24. package/dist/chunks/{layout-grid-Bbz3zKif.js → layout-grid-CtvCBfOm.js} +1 -1
  25. package/dist/chunks/{list-filter-3sbH0Uy1.js → list-filter-BklYgciR.js} +1 -1
  26. package/dist/chunks/{matrix-analytical-definition-CEe3PGEo.js → matrix-analytical-definition-pU51-JmY.js} +4 -4
  27. package/dist/chunks/{matrix-card-BRNGb1C4.js → matrix-card-CUorIB7Q.js} +3 -3
  28. package/dist/chunks/{matrix-member-presentation-CEegvTqg.js → matrix-member-presentation-Df5UgCGN.js} +1 -1
  29. package/dist/chunks/{matrix-operation-contract-COxrfQTS.js → matrix-operation-contract-BSiGEXVC.js} +221 -214
  30. package/dist/chunks/{metric-comparison-DQx-uX__.js → metric-comparison-95aC0uEO.js} +6 -6
  31. package/dist/chunks/{model-change-CJEj3ZD6.js → model-change-B5wQhg5G.js} +1 -1
  32. package/dist/chunks/{palette-DMJtp3Vn.js → palette-DTnMhipt.js} +1 -1
  33. package/dist/chunks/pivot-result-contract-expectations-Bo-86vwS.js +56 -0
  34. package/dist/chunks/{pivot-result-identity-CAj8SiRL.js → pivot-result-identity-olvXJoB9.js} +1 -1
  35. package/dist/chunks/{report-preferences-dialog-0sc8B1lh.js → report-preferences-dialog-C2YUIwKG.js} +55 -55
  36. package/dist/chunks/{report-runtime-context-bYoExeWr.js → report-runtime-context-DoIUr3MP.js} +2 -2
  37. package/dist/chunks/resolve-dashboard-input-context-q_iiNXE1.js +6503 -0
  38. package/dist/chunks/{save-DSb1jTtG.js → save-DH4RyrnG.js} +1 -1
  39. package/dist/chunks/{saved-dashboard-context-BQWM3ldX.js → saved-dashboard-context-8jqfI7hI.js} +59 -59
  40. package/dist/chunks/{selection-reducer-DSzMWb4x.js → selection-reducer-CV7K4FI6.js} +1 -1
  41. package/dist/chunks/{semaphor-ready-indicator-Bz14Oma5.js → semaphor-ready-indicator-E2XWyibu.js} +40105 -41658
  42. package/dist/chunks/{shelf-drop-preview-context-DBHAkgch.js → shelf-drop-preview-context-C29EUzDp.js} +570 -570
  43. package/dist/chunks/{source-entity-resolution-BOrmNCEM.js → source-entity-resolution-BXI3nQ5Z.js} +1 -1
  44. package/dist/chunks/{switch-Dq8XPFpT.js → switch-balDSHc7.js} +3 -3
  45. package/dist/chunks/{table-export-sheet-C_RvEUyO.js → table-export-sheet-CK8tvh4d.js} +1 -1
  46. package/dist/chunks/temporal-input-presentation-B77JsAzU.js +5002 -0
  47. package/dist/chunks/{token-types-LCYMJ3pa.js → token-types-DhYH5YKb.js} +1 -1
  48. package/dist/chunks/{upload-Dr_WAxHQ.js → upload-Ufj8vjyn.js} +1 -1
  49. package/dist/chunks/{use-create-flow-overlay-state-BK3YFkfc.js → use-create-flow-overlay-state-9WsnzEO5.js} +6 -6
  50. package/dist/chunks/{validators-C87JPd-_.js → validators-BtaCFIEB.js} +1206 -1579
  51. package/dist/chunks/{zoned-wall-clock-E35Frf9v.js → zoned-wall-clock-CGLVI40Q.js} +1 -1
  52. package/dist/dashboard/index.js +2 -2
  53. package/dist/dashboard-authoring/index.js +2713 -1459
  54. package/dist/data-app-sdk/index.js +20 -20
  55. package/dist/data-app-sdk-adapters/index.js +3 -3
  56. package/dist/data-app-sdk-validation/index.js +10 -10
  57. package/dist/format-utils/index.js +262 -256
  58. package/dist/index.js +214 -215
  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/components/dashboard/summary-number-formatter.d.ts +6 -0
  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 +50 -51
  66. package/dist/types/lib/formatters/canonical-format-adapter.d.ts +2 -29
  67. package/dist/types/lib/formatters/kpi-number-formatter.d.ts +41 -0
  68. package/dist/types/lib/formatters/raw-temporal-presentation.d.ts +0 -2
  69. package/dist/types/lib/formatters/table-column-settings.d.ts +47 -0
  70. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +10 -188
  71. package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +1 -1
  72. package/dist/types/lib/matrix-table/matrix-delivery.d.ts +16 -372
  73. package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
  74. package/dist/types/lib/stores/editor-store.d.ts +48 -10
  75. package/dist/types/lib/stores/table-actions.d.ts +9 -5
  76. package/dist/types/lib/table-formatting/index.d.ts +0 -2
  77. package/dist/types/lib/table-formatting/table-conditional-formatting-range-source.d.ts +3 -2
  78. package/dist/types/lib/table-formatting/table-conditional-formatting-range.d.ts +3 -2
  79. package/dist/types/lib/table-formatting/table-formatting-normalize.d.ts +1 -2
  80. package/dist/types/lib/table-formatting/table-formatting-render-model.d.ts +9 -0
  81. package/dist/types/lib/table-formatting/table-formatting-types.d.ts +5 -95
  82. package/dist/types/lib/table-formatting/table-presentation-fields.d.ts +35 -0
  83. package/dist/types/lib/types/common-types.d.ts +40 -47
  84. package/dist/types/lib/types/explorer-types.d.ts +11 -43
  85. package/dist/types/lib/utils/card-config-utils.d.ts +8 -0
  86. package/dist/types/lib/utils/card-definition.d.ts +9 -187
  87. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +169 -513
  88. package/dist/types/shared/analytics-protocol/contracts.d.ts +32 -9
  89. package/dist/types/shared/analytics-protocol/execution-input-schemas.d.ts +108 -980
  90. package/dist/types/shared/analytics-protocol/field-validation.d.ts +1 -0
  91. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +281 -4624
  92. package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +20 -20
  93. package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +18 -18
  94. package/dist/types/shared/analytics-protocol/matrix-path-contract.d.ts +40 -40
  95. package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +3 -203
  96. package/dist/types/shared/analytics-protocol/measure-aggregation-profile.d.ts +12 -0
  97. package/dist/types/shared/analytics-protocol/scalar-value.d.ts +8 -8
  98. package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +8 -0
  99. package/dist/types/shared/assistant-protocol/context.d.ts +69 -69
  100. package/dist/types/shared/dashboard-authoring/canonical-result-keys.d.ts +13 -0
  101. package/dist/types/shared/dashboard-authoring/card-export-request.d.ts +4 -1
  102. package/dist/types/shared/dashboard-authoring/card-formats/sql-date-pattern.d.ts +10 -0
  103. package/dist/types/shared/dashboard-authoring/card-formats/upgrade-card-formats.d.ts +57 -0
  104. package/dist/types/shared/dashboard-authoring/card-settings/apply-card-settings.d.ts +11 -0
  105. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +52 -0
  106. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +14 -0
  107. package/dist/types/shared/dashboard-authoring/card-settings/carry-column-settings.d.ts +3 -0
  108. package/dist/types/shared/dashboard-authoring/card-settings/column-format-write.d.ts +8 -0
  109. package/dist/types/shared/dashboard-authoring/card-settings/column-names.d.ts +51 -0
  110. package/dist/types/shared/dashboard-authoring/card-settings/column-sources.d.ts +14 -0
  111. package/dist/types/shared/dashboard-authoring/card-settings/confirm-class.d.ts +9 -0
  112. package/dist/types/shared/dashboard-authoring/card-settings/highlight-inputs.d.ts +19 -0
  113. package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +15 -0
  114. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +102 -0
  115. package/dist/types/shared/dashboard-authoring/card-settings/read-card-settings.d.ts +10 -0
  116. package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-highlights.d.ts +14 -0
  117. package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-settings.d.ts +59 -0
  118. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +40 -0
  119. package/dist/types/shared/dashboard-authoring/card-settings/views.d.ts +28 -0
  120. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +6 -0
  121. package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +32 -0
  122. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +555 -38
  123. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +27 -8
  124. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +25 -1
  125. package/dist/types/shared/dashboard-authoring/conditional-formatting/editable.d.ts +14 -0
  126. package/dist/types/shared/dashboard-authoring/conditional-formatting/evaluate.d.ts +16 -0
  127. package/dist/types/shared/dashboard-authoring/conditional-formatting/index.d.ts +9 -0
  128. package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +7 -0
  129. package/dist/types/shared/dashboard-authoring/conditional-formatting/resolve-card-column-ref.d.ts +17 -0
  130. package/dist/types/shared/dashboard-authoring/conditional-formatting/retain.d.ts +14 -0
  131. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +4499 -0
  132. package/dist/types/shared/dashboard-authoring/conditional-formatting/store.d.ts +12 -0
  133. package/dist/types/shared/dashboard-authoring/conditional-formatting/types.d.ts +151 -0
  134. package/dist/types/shared/dashboard-authoring/conditional-formatting/upgrade.d.ts +35 -0
  135. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +62 -62
  136. package/dist/types/shared/dashboard-authoring/index.d.ts +8 -0
  137. package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +123 -0
  138. package/dist/types/shared/dashboard-authoring/matrix-authoring.d.ts +4 -5
  139. package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +24 -736
  140. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +21 -1
  141. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +10 -4
  142. package/dist/types/shared/dashboard-authoring/retired-presentation-fields.d.ts +31 -0
  143. package/dist/types/shared/dashboard-authoring/upgrade-card-presentation.d.ts +14 -0
  144. package/dist/types/shared/dashboard-viewer/bookmark-impact.d.ts +33 -0
  145. package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +13 -2
  146. package/dist/types/shared/format-utils/formatters/number-formatter.d.ts +16 -0
  147. package/dist/types/shared/format-utils/index.d.ts +2 -0
  148. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +10 -366
  149. package/dist/types/shared/format-utils/raw-temporal.d.ts +31 -1
  150. package/dist/types/shared/format-utils/resolve-column-format.d.ts +43 -0
  151. package/dist/types/shared/format-utils/retired-format-adapters.d.ts +68 -0
  152. package/dist/types/shared/format-utils/semantic-format.d.ts +5 -1
  153. package/dist/types/shared/format-utils/stored-value-format.d.ts +16 -0
  154. package/dist/types/shared/format-utils/types/format-types.d.ts +10 -12
  155. package/package.json +2 -2
  156. package/dist/chunks/analytics-base-schemas-BUFUoO6G.js +0 -472
  157. package/dist/chunks/bookmark-state-ssqrs5oP.js +0 -111
  158. package/dist/chunks/document-dashboard-inputs-ChVkcBuu.js +0 -3010
  159. package/dist/chunks/editor-draft-sync-BN5qYHPF.js +0 -15
  160. package/dist/chunks/filter-reach-copy-B5Y7FHzg.js +0 -3411
  161. package/dist/chunks/global-date-filter-utils-DBzEOX9M.js +0 -12222
  162. package/dist/chunks/pivot-result-contract-expectations-DOYhqeZb.js +0 -1926
  163. package/dist/chunks/raw-temporal-presentation-BmT7z6NH.js +0 -584
  164. package/dist/chunks/resolve-dashboard-input-context-B_C_VAJH.js +0 -5520
  165. package/dist/chunks/table-settings-DXj_zXwS.js +0 -637
  166. package/dist/chunks/temporal-input-presentation-AhLSkGPf.js +0 -2939
  167. package/dist/types/lib/table-formatting/table-conditional-formatting-evaluator.d.ts +0 -9
  168. package/dist/types/lib/table-formatting/table-formatting-validation.d.ts +0 -12
@@ -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,15 @@
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 type { ResolvedCardSettings, ResolvedColumnSettings } from './resolved.js';
13
+ export { SETTINGS_BY_KIND, cardSettingsKind, type CardSettingsKind, type SettingName } from './card-kinds.js';
14
+ export type { AxisInput, CardSettingsInput, ColumnSettingsInput, DashboardUpdateChange, FormatInput, FormatPatch, HighlightAddChange, HighlightColor, HighlightCondition, HighlightRemoveChange, HighlightStyleInput, LegendPosition, } from './inputs.js';
15
+ export type { CardSettingsView, ColumnSettingsRole, ColumnSettingsView, HighlightView } from './views.js';
@@ -0,0 +1,102 @@
1
+ import { SemaphorDateValueFormat, SemaphorDurationValueFormat, SemaphorNumericValueFormat, SemaphorValueFormat, TemporalBucketFormat } from '../../analytics-protocol/contracts.js';
2
+ /**
3
+ * CA-D18: a whole stored format (it has `type`), or a patch without `type`,
4
+ * merged onto the column's effective format (CF-D20).
5
+ */
6
+ export type FormatInput = SemaphorValueFormat | FormatPatch;
7
+ export type FormatPatch = {
8
+ type?: never;
9
+ } & Partial<Omit<SemaphorNumericValueFormat, 'type'> & Omit<SemaphorDateValueFormat, 'type'> & Omit<SemaphorDurationValueFormat, 'type'> & Omit<TemporalBucketFormat, 'type'>>;
10
+ export type ColumnSettingsInput = {
11
+ /** The header shown. Null returns it to the model's label. */
12
+ label?: string | null;
13
+ /** Hidden for everyone (CA-D16); it still computes, sorts and filters. */
14
+ hidden?: boolean;
15
+ /** Table column width in pixels; null returns it to automatic. */
16
+ width?: number | null;
17
+ /** Null removes the card's override, so the column follows the model. */
18
+ format?: FormatInput | null;
19
+ /** Read-only facts from the outline, accepted back unchanged (CA-INV-1). */
20
+ field?: string;
21
+ role?: string;
22
+ inherits?: string[];
23
+ };
24
+ export type AxisInput = {
25
+ title?: string | null;
26
+ min?: number | null;
27
+ max?: number | null;
28
+ };
29
+ export type LegendPosition = 'top' | 'bottom' | 'left' | 'right';
30
+ /** Optional fields on `card.add` and `card.update`, beside `type`, `title`, `description`, `query` and `matrix`. */
31
+ export type CardSettingsInput = {
32
+ /** Keyed by column name (SPEC 3.3). */
33
+ columns?: Record<string, ColumnSettingsInput>;
34
+ orientation?: 'vertical' | 'horizontal';
35
+ stack?: 'none' | 'stacked';
36
+ donut?: boolean;
37
+ totals?: {
38
+ row: boolean;
39
+ };
40
+ dataLabels?: {
41
+ show: boolean;
42
+ format?: SemaphorValueFormat | null;
43
+ };
44
+ legend?: {
45
+ show: boolean;
46
+ position?: LegendPosition;
47
+ };
48
+ /** As seen on screen: `x` is `xAxisConfig`, `y` is `yAxisConfig`, on a horizontal bar too. */
49
+ axes?: {
50
+ x?: AxisInput;
51
+ y?: AxisInput;
52
+ };
53
+ };
54
+ /** The filter operators (CA-D11): formatting and filtering share one condition language. */
55
+ export type HighlightCondition = {
56
+ operator: '=' | '!=' | '>' | '>=' | '<' | '<=';
57
+ value: number | string;
58
+ } | {
59
+ operator: 'between';
60
+ values: [number, number];
61
+ } | {
62
+ operator: 'contains';
63
+ value: string;
64
+ } | {
65
+ operator: 'is_null';
66
+ } | {
67
+ top: number;
68
+ } | {
69
+ bottom: number;
70
+ };
71
+ /** A theme name, `red` | `amber` | `green` | `blue` | `gray`, or `#rrggbb` (CA-D11). */
72
+ export type HighlightColor = string;
73
+ export type HighlightStyleInput = {
74
+ when: HighlightCondition;
75
+ color: HighlightColor;
76
+ } | {
77
+ scale: {
78
+ low: HighlightColor;
79
+ high: HighlightColor;
80
+ mid?: HighlightColor;
81
+ };
82
+ } | {
83
+ bars: {
84
+ color?: HighlightColor;
85
+ };
86
+ };
87
+ export type HighlightAddChange = {
88
+ op: 'highlight.add';
89
+ cardId: string;
90
+ column: string;
91
+ apply?: 'cell' | 'row';
92
+ } & HighlightStyleInput;
93
+ export type HighlightRemoveChange = {
94
+ op: 'highlight.remove';
95
+ cardId: string;
96
+ ruleId: string;
97
+ };
98
+ export type DashboardUpdateChange = {
99
+ op: 'dashboard.update';
100
+ title?: string;
101
+ description?: string | null;
102
+ };
@@ -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'];
@@ -0,0 +1,59 @@
1
+ import { TCard } from '../../../lib/types/common-types.js';
2
+ import { ModelFormats } from '../../format-utils/resolve-column-format.js';
3
+ import { StatedLabel } from '../changes/card-query-part.js';
4
+ import { ChangeDiagnostic } from '../changes/diagnostics.js';
5
+ import { ColumnCatalogs } from './column-sources.js';
6
+ import { CardSettingsInput } from './inputs.js';
7
+ import { ResolvedCardSettings } from './resolved.js';
8
+ import { HighlightsRequest } from './resolve-card-highlights.js';
9
+ export type CardSettingsRequest = {
10
+ /** Column settings and the card's own (Phase 3). */
11
+ settings?: CardSettingsInput;
12
+ /** Highlights added and removed (Phase 4). */
13
+ highlights?: HighlightsRequest;
14
+ };
15
+ /** The model formats a change's columns show: read, or unavailable when they couldn't be read (never confused with "none"). */
16
+ export type ModelFormatsRead = {
17
+ status: 'read';
18
+ formats: ModelFormats;
19
+ } | {
20
+ status: 'unavailable';
21
+ };
22
+ export type CardSettingsContext = {
23
+ /** Where the change sits in the request, for problem paths (`changes[3]`). */
24
+ path: string;
25
+ /** The card as the change names it (an id or a `$handle`), for suggested changes. */
26
+ cardRef: string;
27
+ /**
28
+ * The catalog of each semantic dataset the card's columns come from (model
29
+ * labels and formats), keyed by `columnSourceKey`; absent for SQL cards or
30
+ * when the change needs none. A column is looked up in its own source's
31
+ * catalog (ledger P2-15).
32
+ */
33
+ catalogs?: ColumnCatalogs;
34
+ /**
35
+ * The model format each column shows, by column id (a config field's id, a
36
+ * Matrix level's or measure's), as the query gives it to the renderer
37
+ * (`ChangeServices.readModelFormats`): read, or unavailable when it couldn't
38
+ * be read. Absent when the change states no format. A format patch merges
39
+ * onto what the card shows; the catalogs are never read for formats
40
+ * (ledger P2-20).
41
+ */
42
+ modelFormats?: ModelFormatsRead;
43
+ /** A SQL table's result keys, read before this call when the request names its columns. */
44
+ sqlResultColumns?: readonly string[];
45
+ /** Mints a highlight rule's id at resolve (S-7). */
46
+ newId?: () => string;
47
+ };
48
+ export type CardSettingsResolution = {
49
+ ok: true;
50
+ /** Labels go to the label owner's `relabel` operation (SPEC 4.7). */
51
+ labels: StatedLabel[];
52
+ /** Null when nothing but labels (or nothing at all) changes. */
53
+ settings: ResolvedCardSettings | null;
54
+ warnings: ChangeDiagnostic[];
55
+ } | {
56
+ ok: false;
57
+ problems: ChangeDiagnostic[];
58
+ };
59
+ export declare function resolveCardSettings(card: TCard, request: CardSettingsRequest, context: CardSettingsContext): CardSettingsResolution;
@@ -0,0 +1,40 @@
1
+ import { SemaphorValueFormat } from '../../analytics-protocol/contracts.js';
2
+ import { CardColumnRef, ConditionalRule } from '../conditional-formatting/types.js';
3
+ import { AxisConfigKey, CardVariant } from './card-display-write.js';
4
+ import { LegendPosition } from './inputs.js';
5
+ export type ResolvedColumnSettings = {
6
+ column: CardColumnRef;
7
+ hidden?: boolean;
8
+ width?: number | null;
9
+ /** Whole and validated; null removes the override. */
10
+ format?: SemaphorValueFormat | null;
11
+ };
12
+ export type ResolvedAxis = {
13
+ title?: string | null;
14
+ min?: number | null;
15
+ max?: number | null;
16
+ };
17
+ export type ResolvedCardSettings = {
18
+ /** A variant within the card's family (SPEC 4.6); a family change is a retype. */
19
+ variant?: CardVariant;
20
+ columns?: ResolvedColumnSettings[];
21
+ totals?: {
22
+ row: boolean;
23
+ };
24
+ /** Only the fields that change. */
25
+ dataLabels?: {
26
+ show?: boolean;
27
+ format?: SemaphorValueFormat | null;
28
+ };
29
+ legend?: {
30
+ show?: boolean;
31
+ position?: LegendPosition;
32
+ };
33
+ /** By stored config, on the card after its variant: `xAxisConfig` is the horizontal axis on screen (V-2). */
34
+ axes?: Partial<Record<AxisConfigKey, ResolvedAxis>>;
35
+ /** Rules added (ids minted at resolve, S-7) and rule ids removed; other rules are kept. */
36
+ highlights?: {
37
+ add?: ConditionalRule[];
38
+ remove?: string[];
39
+ };
40
+ };
@@ -0,0 +1,28 @@
1
+ import { SemaphorValueFormat } from '../../analytics-protocol/contracts.js';
2
+ import { CardSettingsInput, HighlightStyleInput } from './inputs.js';
3
+ export type ColumnSettingsRole = 'measure' | 'dimension' | 'detail' | 'result' | 'value';
4
+ export type ColumnSettingsView = {
5
+ /** The column's field; absent for SQL result columns. Read-only. */
6
+ field?: string;
7
+ role: ColumnSettingsRole;
8
+ label: string;
9
+ hidden?: true;
10
+ width?: number;
11
+ /** The card's override only; absent when the column follows the model. */
12
+ format?: SemaphorValueFormat;
13
+ /** What the column takes from the model (CA-D5). Read-only. */
14
+ inherits?: Array<'label' | 'format'>;
15
+ };
16
+ export type HighlightView = {
17
+ ruleId: string;
18
+ column: string;
19
+ apply: 'cell' | 'row';
20
+ enabled: boolean;
21
+ } & HighlightStyleInput;
22
+ export type CardSettingsView = Omit<CardSettingsInput, 'columns'> & {
23
+ /** Keyed by column name (SPEC 3.3). */
24
+ columns: Record<string, ColumnSettingsView>;
25
+ highlights: HighlightView[];
26
+ /** In the editor's words, each setting the card has that inputs can't state (CA-INV-3). */
27
+ editorOnly: string[];
28
+ };
@@ -404,6 +404,12 @@ export declare function isGroupedDate(field: {
404
404
  export type StatedLabel = {
405
405
  key: ColumnKey;
406
406
  label: string;
407
+ /**
408
+ * `semantic` writes the model's label as a refreshable one (a column's
409
+ * `labelOrigin: 'semantic'`; on a Matrix, its presentation label removed):
410
+ * a label returned to the model (card appearance CA-D5). Default `override`.
411
+ */
412
+ origin?: 'override' | 'semantic';
407
413
  };
408
414
  /**
409
415
  * Every label a query states, each on its ColumnKey, counted over every ref
@@ -1,4 +1,5 @@
1
1
  import { TChartType } from '../../../lib/charts/types.js';
2
+ import { TCard } from '../../../lib/types/common-types.js';
2
3
  /**
3
4
  * The card types an agent may set, and their rules (MCP dashboard editing
4
5
  * DE-D20, DE-D43). Public names are snake_case; each maps to one stored chart
@@ -30,5 +31,36 @@ export declare function toChartType(type: CardType): TChartType;
30
31
  export declare function toPublicCardType(chartType: TChartType | string | undefined): string;
31
32
  /** The settable card type a chart type is, or undefined when it is not one of the eight. */
32
33
  export declare function settableCardType(chartType: TChartType | string | undefined): CardType | undefined;
34
+ /** A chart variant as properties of its base type (card appearance CA-D6, CV-1). */
35
+ export type CardTypeProperties = {
36
+ orientation?: 'vertical' | 'horizontal';
37
+ stack?: 'none' | 'stacked';
38
+ donut?: boolean;
39
+ };
40
+ /**
41
+ * A card's type as one of the eight, with its variant as properties: a
42
+ * stacked bar is `bar` with `stack: 'stacked'`, a doughnut `pie` with
43
+ * `donut: true`. A bar is horizontal when it is stored as `horizontalBar` or
44
+ * draws along `chartOptions.indexAxis: 'y'`. Each base type reports only the
45
+ * properties it takes (bar: orientation and stack; line and area: stack; pie:
46
+ * donut). Undefined for a type outside the eight and their five variants.
47
+ */
48
+ export declare function readCardTypeProperties(card: Pick<TCard, 'type' | 'preferences'>): {
49
+ type: CardType;
50
+ properties: CardTypeProperties;
51
+ } | undefined;
52
+ /**
53
+ * The stored type a base type and its properties are (card appearance SPEC
54
+ * 4.6), and the axis it draws along when that isn't the type's own: a
55
+ * horizontal bar is `horizontalBar`, as the chart type picker writes it; a
56
+ * horizontal stacked bar is `stackedBar` drawn along `y`, as the orientation
57
+ * control writes it. A vertical variant asks for `x`, so a bar the
58
+ * orientation control turned comes back. A property the base type doesn't
59
+ * take is ignored.
60
+ */
61
+ export declare function storedCardTypeFor(type: CardType, properties: CardTypeProperties): {
62
+ type: TChartType;
63
+ indexAxis?: 'x' | 'y';
64
+ };
33
65
  /** A chart type as a sentence names it ("bar chart", "detail table", "KPI"). */
34
66
  export declare function cardTypeSentenceName(chartType: TChartType | string | undefined): string;