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,12 @@
1
+ import { TCard, TCardPreferences } from '../../../lib/types/common-types.js';
2
+ import { ConditionalRule } from './types.js';
3
+ /**
4
+ * A card's stored rules. A rule that doesn't parse is left out rather than
5
+ * failing the card: the save check refuses one (CR-D9), and a renderer shows
6
+ * the rest.
7
+ */
8
+ export declare function readCardConditionalRules(card: {
9
+ preferences?: Pick<TCardPreferences, 'conditionalFormatting'> | null;
10
+ } | undefined): readonly ConditionalRule[];
11
+ /** The card with these rules as its store; no rules removes the store. */
12
+ export declare function withCardConditionalRules<T extends Pick<TCard, 'preferences'>>(card: T, rules: readonly ConditionalRule[]): T;
@@ -0,0 +1,151 @@
1
+ import { MatrixAxis, MatrixPath } from '../../analytics-protocol/matrix-path-contract.js';
2
+ import { SemaphorResultColumn } from '../../analytics-protocol/contracts.js';
3
+ import { QueryColumnKeyMap } from '../../format-utils/pivot-result-identity.js';
4
+ /** How a rule names a column. Survives alias and aggregate changes. */
5
+ export type CardColumnRef =
6
+ /** A config card's column, by card column id (`config.*Columns[].id`). */
7
+ {
8
+ kind: 'field';
9
+ fieldId: string;
10
+ }
11
+ /** One measure under one pivot tuple: the names and order of `pivotIdentity`. */
12
+ | {
13
+ kind: 'pivot';
14
+ metricId: string;
15
+ members: Array<{
16
+ fieldId: string;
17
+ value: string | null;
18
+ }>;
19
+ }
20
+ /** A SQL or Python card's column, by result key. */
21
+ | {
22
+ kind: 'result';
23
+ key: string;
24
+ }
25
+ /** A SQL KPI's value: the first numeric result column (column formats CF-D24). */
26
+ | {
27
+ kind: 'sqlKpiValue';
28
+ }
29
+ /** A Matrix measure. */
30
+ | {
31
+ kind: 'matrixMeasure';
32
+ measureId: string;
33
+ }
34
+ /** A Matrix row or column level: formats only; rules scope levels with `target.matrix.levelId`. */
35
+ | {
36
+ kind: 'matrixLevel';
37
+ levelId: string;
38
+ };
39
+ export type TablePart = 'body' | 'header' | 'footer' | 'subtotal' | 'grandTotal';
40
+ export type MatrixFormattingRole = 'member' | 'subtotal' | 'grand_total' | 'others';
41
+ export type ComparisonOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte';
42
+ /** A rule's style, unchanged from the table rules it replaces. */
43
+ export type ConditionalStyle = {
44
+ backgroundColor?: string;
45
+ textColor?: string;
46
+ fontWeight?: 'normal' | 'medium' | 'semibold' | 'bold';
47
+ italic?: boolean;
48
+ textDecoration?: 'none' | 'underline' | 'line-through';
49
+ icon?: 'arrowUp' | 'arrowDown' | 'warning' | 'check' | 'x';
50
+ dataBar?: {
51
+ color: string;
52
+ showValue: boolean;
53
+ };
54
+ };
55
+ /**
56
+ * A rule's condition on one column's value. `TColumn` is how the column is
57
+ * named: a `CardColumnRef` when stored, a result key once a renderer has
58
+ * resolved it (`resolveConditionalRules`).
59
+ */
60
+ export type ConditionalCondition<TColumn = CardColumnRef> = {
61
+ kind: 'comparison';
62
+ column: TColumn;
63
+ operator: ComparisonOperator;
64
+ value: unknown;
65
+ } | {
66
+ kind: 'between';
67
+ column: TColumn;
68
+ min: unknown;
69
+ max: unknown;
70
+ inclusive?: boolean;
71
+ } | {
72
+ kind: 'blank';
73
+ column: TColumn;
74
+ isBlank: boolean;
75
+ } | {
76
+ kind: 'contains';
77
+ column: TColumn;
78
+ value: string;
79
+ caseSensitive?: boolean;
80
+ exact?: boolean;
81
+ } | {
82
+ kind: 'topBottom';
83
+ column: TColumn;
84
+ direction: 'top' | 'bottom';
85
+ count: number;
86
+ } | {
87
+ kind: 'colorScale';
88
+ column: TColumn;
89
+ range: 'auto' | 'manual';
90
+ min?: number;
91
+ mid?: number;
92
+ max?: number;
93
+ colors: {
94
+ min: string;
95
+ mid?: string;
96
+ max: string;
97
+ };
98
+ } | {
99
+ kind: 'dataBar';
100
+ column: TColumn;
101
+ range: 'auto' | 'manual';
102
+ min?: number;
103
+ max?: number;
104
+ color: string;
105
+ showValue?: boolean;
106
+ };
107
+ export type ConditionalTarget<TColumn = CardColumnRef> = {
108
+ level: 'cell' | 'row';
109
+ /**
110
+ * cell: the columns styled; absent means the condition's column.
111
+ * row: the columns styled in a matching row; absent means the whole row.
112
+ */
113
+ columns?: TColumn[];
114
+ tableParts?: TablePart[];
115
+ matrix?: {
116
+ axis: MatrixAxis;
117
+ levelId?: string;
118
+ oppositePath?: Array<MatrixPath[number]>;
119
+ };
120
+ rowRoles?: MatrixFormattingRole[];
121
+ depth?: number;
122
+ includeTotals?: boolean;
123
+ includeSubtotals?: boolean;
124
+ };
125
+ export type ConditionalRule<TColumn = CardColumnRef> = {
126
+ id: string;
127
+ name?: string;
128
+ enabled?: boolean;
129
+ condition: ConditionalCondition<TColumn>;
130
+ target: ConditionalTarget<TColumn>;
131
+ style?: ConditionalStyle;
132
+ };
133
+ /** `preferences.conditionalFormatting` on every card that has rules. */
134
+ export type CardConditionalFormatting = {
135
+ version: 1;
136
+ rules: ConditionalRule[];
137
+ };
138
+ /** A rule a renderer resolved to the result keys of its rows. */
139
+ export type ResolvedConditionalRule = ConditionalRule<string>;
140
+ /**
141
+ * What a renderer knows about its result, to resolve a `CardColumnRef`.
142
+ * Pass what the result carries: `columnKeyMap` resolves `field` refs,
143
+ * `resultColumns` (with `pivotIdentity`) resolves `pivot` refs, and `keys`
144
+ * (the rows' result keys in display order; for a SQL KPI, its displayed
145
+ * numeric keys, value first) checks `result` refs and names the SQL KPI value.
146
+ */
147
+ export type CardOutputColumns = {
148
+ columnKeyMap?: QueryColumnKeyMap;
149
+ resultColumns?: readonly SemaphorResultColumn[];
150
+ keys?: readonly string[];
151
+ };
@@ -0,0 +1,35 @@
1
+ import { TCard } from '../../../lib/types/common-types.js';
2
+ export type RuleChange = {
3
+ ruleId: string;
4
+ /** `moved`: into `preferences.conditionalFormatting`; `removed`: no home and never rendered. */
5
+ action: 'moved' | 'removed';
6
+ from: string;
7
+ };
8
+ export type UnresolvedRuleReason =
9
+ /** The draft trigger the rule panel starts a rule with. */
10
+ 'unassigned_trigger'
11
+ /** No card column carries the reference, and it is no simple pivot key. */
12
+ | 'no_matching_column'
13
+ /** Several card columns carry the reference. */
14
+ | 'ambiguous_column'
15
+ /** A pivot key in a form other than the simple one (CR-D12). */
16
+ | 'pivot_key_form'
17
+ /** An enabled cell rule naming no columns styles every column today; the store has no such form. */
18
+ | 'every_column';
19
+ export type UnresolvedRule = {
20
+ ruleId: string;
21
+ name?: string;
22
+ enabled: boolean;
23
+ /** Within the card, e.g. `preferences.tablePrefs.conditionalFormatting.rules[3].condition.columnId`. */
24
+ path: string;
25
+ /** The stored reference. */
26
+ reference: string;
27
+ reason: UnresolvedRuleReason;
28
+ };
29
+ export type UpgradeConditionalFormattingResult = {
30
+ card: TCard;
31
+ changes: RuleChange[];
32
+ unresolved: UnresolvedRule[];
33
+ };
34
+ /** Rewrites one card's retired rules into `preferences.conditionalFormatting`. Returns the input card when nothing changes. */
35
+ export declare function upgradeConditionalFormatting(card: TCard): UpgradeConditionalFormattingResult;