react-semaphor 0.1.601 → 0.1.602

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 (75) hide show
  1. package/dist/analytics-protocol/index.js +9 -9
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/brand-studio/index.js +7 -7
  4. package/dist/briefings/index.js +4 -4
  5. package/dist/chunks/{assistant-chat-BE0XXzZP.js → assistant-chat-BWF3GYip.js} +12 -12
  6. package/dist/chunks/{bookmark-impact-DXDAN5AY.js → bookmark-impact-BF3iRx5a.js} +3 -3
  7. package/dist/chunks/{bookmark-state-BMyB3Tb6.js → bookmark-state-CBSTdW6q.js} +4 -4
  8. package/dist/chunks/{card-filter-builder-CE0-YVN5.js → card-filter-builder-B8XHwMY6.js} +394 -394
  9. package/dist/chunks/{comparison-window-caption-Dxj2CHOa.js → comparison-window-caption-W83qB4V5.js} +4 -4
  10. package/dist/chunks/{dashboard-mJKPFRbb.js → dashboard-DG5EIYYB.js} +1 -1
  11. package/dist/chunks/{dashboard-briefing-launcher-CntwKyiZ.js → dashboard-briefing-launcher-CBSrhyWZ.js} +727 -718
  12. package/dist/chunks/{dashboard-controls-XO089DMg.js → dashboard-controls-D6ECO4N1.js} +15 -15
  13. package/dist/chunks/{dashboard-json-CQRiydUv.js → dashboard-json-DrJftBSL.js} +4 -4
  14. package/dist/chunks/{dates-B-Urp5OD.js → dates-Bz-qM5px.js} +10 -10
  15. package/dist/chunks/{edit-dashboard-visual-f-Dm-BLR.js → edit-dashboard-visual-BDYAJIbb.js} +1565 -1544
  16. package/dist/chunks/{filter-line-CKNMyNTQ.js → filter-line-BXT6y303.js} +6 -6
  17. package/dist/chunks/{filter-reach-copy-B8GGyVuR.js → filter-reach-copy-BukhZmzm.js} +1661 -1950
  18. package/dist/chunks/{filter-value-text-CRtKecI5.js → filter-value-text-D3-bf3_b.js} +4 -4
  19. package/dist/chunks/{index-DoPApnxg.js → index-BW0yozjs.js} +5 -5
  20. package/dist/chunks/{layout-grid-CiSCZdIr.js → layout-grid-Ds0diMeY.js} +1 -1
  21. package/dist/chunks/{matrix-analytical-definition-myf3D3Qx.js → matrix-analytical-definition-CgQgVeeI.js} +4 -4
  22. package/dist/chunks/{matrix-member-presentation-g0c_NpDW.js → matrix-member-presentation-DSBIIudt.js} +1 -1
  23. package/dist/chunks/{matrix-operation-contract-C1SuOHLZ.js → matrix-operation-contract--DkNCOzd.js} +517 -514
  24. package/dist/chunks/{metric-comparison-Cm0G893W.js → metric-comparison-zMylnIkc.js} +1 -1
  25. package/dist/chunks/{paintbrush-DQIwqlck.js → paintbrush-CX8pao1j.js} +1 -1
  26. package/dist/chunks/{palette-Cun747Rg.js → palette-CuA0HlzF.js} +1 -1
  27. package/dist/chunks/{pivot-result-contract-expectations-C1Dyx8du.js → pivot-result-contract-expectations-C8KL7hPx.js} +8 -8
  28. package/dist/chunks/{pivot-result-identity-CBS-ssEp.js → pivot-result-identity-C1AOH1PS.js} +1 -1
  29. package/dist/chunks/{raw-temporal-value-DN_l-Tss.js → raw-temporal-value-E416F-0L.js} +1 -1
  30. package/dist/chunks/{report-preferences-dialog-SDZEcG2x.js → report-preferences-dialog-CbuVNDGi.js} +13 -13
  31. package/dist/chunks/{report-runtime-context-BbedQdtc.js → report-runtime-context-E7USjN7E.js} +1 -1
  32. package/dist/chunks/{resolve-dashboard-input-context-DRBS0eRa.js → resolve-dashboard-input-context-CULCE_hM.js} +8417 -7052
  33. package/dist/chunks/{save-Dj5bjm7P.js → save-BKHlDONy.js} +1 -1
  34. package/dist/chunks/{saved-dashboard-context-DWVlJcsa.js → saved-dashboard-context-C1WlOx5z.js} +32 -32
  35. package/dist/chunks/{selection-filter-compiler-DmAr7yqC.js → selection-filter-compiler-ifT8JCXS.js} +1 -1
  36. package/dist/chunks/{semaphor-ready-indicator-OFOoAY-A.js → semaphor-ready-indicator-CBIRcDWs.js} +33414 -31523
  37. package/dist/chunks/{shelf-drop-preview-context-2swWypXu.js → shelf-drop-preview-context-xR69SMA8.js} +53 -53
  38. package/dist/chunks/{stored-dashboard-NtOuEX6a.js → stored-dashboard-BuM8vnWf.js} +739 -717
  39. package/dist/chunks/{style-sheet-parts-Qv4UcLAo.js → style-sheet-parts-Bt9ZNre8.js} +2 -2
  40. package/dist/chunks/{table-export-sheet-Do7ZB0_F.js → table-export-sheet-DVljtHkG.js} +1 -1
  41. package/dist/chunks/{token-types-Dy_aXO-U.js → token-types-D_xKgyVS.js} +1 -1
  42. package/dist/chunks/{upload-Bq-puSVy.js → upload-Dll_M7XQ.js} +1 -1
  43. package/dist/chunks/{validators-C7DFk3QK.js → validators-ClWHpYql.js} +2 -2
  44. package/dist/chunks/{variable-draft-Cy03qnEi.js → variable-draft-CDGGl53R.js} +27 -28
  45. package/dist/dashboard/index.js +2 -2
  46. package/dist/dashboard-authoring/index.js +3086 -2578
  47. package/dist/format-utils/index.js +14 -14
  48. package/dist/index.js +71 -73
  49. package/dist/report-runtime-context/index.js +1 -1
  50. package/dist/style.css +1 -1
  51. package/dist/surfboard/index.js +2 -2
  52. package/dist/types/components/dashboard/dashboard-web-component.d.ts +7 -0
  53. package/dist/types/index.js +5 -5
  54. package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +1 -1
  55. package/dist/types/lib/query-context/assemble-card-query.d.ts +6 -1
  56. package/dist/types/lib/stores/dashboard-store.d.ts +30 -0
  57. package/dist/types/shared/analytics-protocol/aggregate-expression.d.ts +15 -0
  58. package/dist/types/shared/dashboard-authoring/calculations/calculated-column.d.ts +52 -0
  59. package/dist/types/shared/dashboard-authoring/calculations/definition.d.ts +129 -0
  60. package/dist/types/shared/dashboard-authoring/calculations/resolve-dashboard-field-copies.d.ts +46 -0
  61. package/dist/types/shared/dashboard-authoring/calculations/tokens.d.ts +36 -0
  62. package/dist/types/shared/dashboard-authoring/changes/calculation-change.d.ts +399 -0
  63. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +144 -2
  64. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +21 -2
  65. package/dist/types/shared/dashboard-authoring/changes/domain-change.d.ts +143 -266
  66. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +2 -0
  67. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +46 -0
  68. package/dist/types/shared/dashboard-authoring/index.d.ts +7 -1
  69. package/dist/types/shared/dashboard-authoring/operations/calculated-field-operations.d.ts +133 -0
  70. package/dist/types/shared/dashboard-authoring/operations/card-operations.d.ts +71 -0
  71. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +18 -5
  72. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +21 -0
  73. package/dist/types/shared/usage-events/details.d.ts +2 -2
  74. package/dist/types/shared/usage-events/envelope.d.ts +2 -2
  75. package/package.json +1 -1
@@ -0,0 +1,71 @@
1
+ import { Immer } from 'immer';
2
+ import { TCard, TDashboard, TFrame, TSheet } from '../../../lib/types/common-types.js';
3
+ import { SheetLayoutChange } from '../../layouts/index.js';
4
+ import { SentenceClause } from './operation-sentences.js';
5
+ import { CardUpdate, CreatedEntity, DashboardOperation, DashboardRuntimeEffect, OperationFailureCode } from './operation-types.js';
6
+ /**
7
+ * The card operations of the dashboard reducer (MCP dashboard editing SPEC
8
+ * 3.3): add, remove, rename and retype. Pure: each returns a new dashboard
9
+ * that shares everything it did not touch, and never mints ids or reads the
10
+ * clock.
11
+ */
12
+ /** Drafts are finalized unfrozen, so callers own a plain document. */
13
+ export declare const reducerImmer: Immer;
14
+ export declare class OperationFailure extends Error {
15
+ readonly code: OperationFailureCode;
16
+ readonly fix?: string | undefined;
17
+ readonly details?: Record<string, unknown> | undefined;
18
+ constructor(code: OperationFailureCode, message: string, fix?: string | undefined, details?: Record<string, unknown> | undefined);
19
+ }
20
+ export type OperationOutcome = {
21
+ dashboard: TDashboard;
22
+ created?: CreatedEntity[];
23
+ /** Frames to load metadata for, beyond the frames of created and touched cards: a variable's, from the one writer (P2-28). */
24
+ queryFrames?: TFrame[];
25
+ /** Existing cards this operation changed in place (`DashboardOperationResult.touched`). */
26
+ touched?: string[];
27
+ runtimeEffects?: DashboardRuntimeEffect[];
28
+ clauses: SentenceClause[];
29
+ /**
30
+ * The operation made a frame that showed a library visual the dashboard's
31
+ * own (DE-D50). The confirmation reads this, never the sentence that says so.
32
+ */
33
+ detached?: boolean;
34
+ };
35
+ export type FrameCardLocation = {
36
+ sheetIndex: number;
37
+ frameIndex: number;
38
+ cardIndex: number;
39
+ sheet: TSheet;
40
+ frame: TFrame;
41
+ card: TCard;
42
+ };
43
+ /** A card in a frame on a grid sheet. Document-section cards are not frame cards. */
44
+ export declare function locateFrameCard(dashboard: TDashboard, cardId: string): FrameCardLocation | undefined;
45
+ export declare const sheetName: (sheet: TSheet | undefined) => string;
46
+ export declare function requireCard(dashboard: TDashboard, cardId: string): FrameCardLocation;
47
+ export declare function addCard(dashboard: TDashboard, operation: Extract<DashboardOperation, {
48
+ op: 'card.add';
49
+ }>): OperationOutcome;
50
+ /**
51
+ * The sheet after a layout change: the layout engine's frames, and its layouts
52
+ * and customized breakpoints when they changed (responsive layouts SPEC §3.1,
53
+ * §6.1). `sheet` is the sheet before the change.
54
+ */
55
+ export declare function withSheetLayoutChange(sheet: TSheet, change: SheetLayoutChange): TSheet;
56
+ /**
57
+ * Removes one card (DE-D42). With other tabs left, the frame stays and its
58
+ * first card becomes active, through the editor's own tab close rule
59
+ * (`withoutFrameCard`); a linked frame
60
+ * becomes local. The last card takes the frame and its layout entries on
61
+ * every breakpoint. Every input reference to the card goes with it.
62
+ */
63
+ export declare function removeCard(dashboard: TDashboard, cardId: string): OperationOutcome;
64
+ export declare function updateCard(dashboard: TDashboard, cardId: string, update: CardUpdate): OperationOutcome;
65
+ /** Replaces one card of a frame (and clears a link to a library visual, DE-D50); optionally resizes the frame's layouts. */
66
+ export declare function replaceFrameCard(dashboard: TDashboard, at: FrameCardLocation, card: TCard, options: {
67
+ resize: boolean;
68
+ }): {
69
+ dashboard: TDashboard;
70
+ detached: boolean;
71
+ };
@@ -1,4 +1,5 @@
1
1
  import { DataVariable, EmbeddedFilterDashboardInput, TDashboard, TFrame, TInlineFilter, TextCardRichContent } from '../../../lib/types/common-types.js';
2
+ import { CalculatedFieldOperation } from './calculated-field-operations.js';
2
3
  import { DocumentEdit } from '../../../lib/document/document-edits.js';
3
4
  import { ResolvedCardSettings } from '../card-settings/resolved.js';
4
5
  import { MeasureCalculationsUpdate } from '../measure-calculations/resolve.js';
@@ -73,10 +74,14 @@ export type FrameCommit = {
73
74
  frame: TFrame;
74
75
  /** Other frames on the sheet rewritten during the edit (calculated-field renames), applied with it. */
75
76
  rewrittenFrames?: TFrame[];
76
- /** Sheet calculated fields from the edited frame, persisted on the sheet. */
77
+ /** Sheet calculated fields from the edited frame, persisted on the sheet (sheet scope is retired; existing ones stay editable until release 2). */
77
78
  sheetCalculatedFields?: Field[];
78
- /** Dashboard calculated fields rewritten during the edit. */
79
- dashboardCalculatedFields?: Field[];
79
+ /**
80
+ * The editor's dashboard-field adds, changes and removals during the edit,
81
+ * in order, applied through the `calculatedField.*` operations after the
82
+ * frame (MC-D11): the commit never replaces the dashboard's list.
83
+ */
84
+ calculatedFieldOps?: CalculatedFieldOperation[];
80
85
  /** True when committed from the visual editor: resize the frame's layouts if its type changed. */
81
86
  resizeLayouts: boolean;
82
87
  };
@@ -206,7 +211,9 @@ export type DashboardOperation = ({
206
211
  edit: Extract<DocumentEdit, {
207
212
  type: 'updateText' | 'updateRegionText';
208
213
  }>;
209
- }) & {
214
+ }
215
+ /** A dashboard field added, changed (every copy follows) or removed (calculated fields one core MC-D10). */
216
+ | CalculatedFieldOperation) & {
210
217
  /** Set by the resolver: the public change this operation came from. Descriptions group by it. */
211
218
  changeIndex?: number;
212
219
  };
@@ -287,7 +294,13 @@ export type OperationFailureCode = 'sheet_not_found'
287
294
  /** A data variable the one writer refuses (data variables spec 2.11); `details.issues` has its issues. */
288
295
  | 'variable_invalid' | 'variable_not_found'
289
296
  /** A Document edit its writer refuses (`DocumentEditError`), or a sheet that is no Document. */
290
- | 'document_invalid';
297
+ | 'document_invalid'
298
+ /** A dashboard field with that identity key or name exists already (calculated fields one core). */
299
+ | 'calculated_field_taken' | 'calculated_field_not_found'
300
+ /** `calculatedField.remove` while a copy remains; `details.usedBy` names the cards and filters. */
301
+ | 'calculated_field_in_use'
302
+ /** A measure's formula moving between per row and over aggregates while something uses it (ledger P4-08). */
303
+ | 'calculated_field_stage_change';
291
304
  export type DashboardOperationResult = {
292
305
  ok: true;
293
306
  dashboard: TDashboard;
@@ -164,6 +164,25 @@ export type OutlineLayoutRow = {
164
164
  width: FrameWidth;
165
165
  }>;
166
166
  };
167
+ /** A dashboard field read back so an agent can send it again (MC-INV-3). */
168
+ export type OutlineCalculatedField = {
169
+ domainId: string;
170
+ dataset: string;
171
+ name: string;
172
+ label?: string;
173
+ description?: string;
174
+ /** Named {token}s over `inputs`, as `toNamedTokens` writes them. */
175
+ expression: string;
176
+ inputs: Record<string, {
177
+ dataset: string;
178
+ field: string;
179
+ aggregate?: string;
180
+ }>;
181
+ use: 'aggregate' | 'group_or_filter';
182
+ dataType: string;
183
+ /** Card ids and dashboard filter ids whose columns copy it. */
184
+ usedBy: string[];
185
+ };
167
186
  export type DashboardOutline = {
168
187
  dashboardId: string;
169
188
  title: string;
@@ -185,6 +204,8 @@ export type DashboardOutline = {
185
204
  variables: OutlineVariable[];
186
205
  /** What `dashboard.style` sets, read back in its words, and what the dashboard shows. */
187
206
  style: OutlineStyle;
207
+ /** The dashboard's own calculated fields, in the words `calculation.add` takes (calculated fields one core MC-INV-3). */
208
+ calculatedFields?: OutlineCalculatedField[];
188
209
  /** In the editor's words: what the dashboard holds that no change can state (the parity backlog, DV-D13). */
189
210
  editorOnly?: string[];
190
211
  /** Queries left out because the dashboard has more than `maxQueryCards` cards (DE-D34). */
@@ -273,18 +273,18 @@ export declare const exportCompletedDetailsSchema: z.ZodObject<{
273
273
  mechanism: "rendered" | "job" | "matrix_direct";
274
274
  scope?: "dashboard" | "card" | "visual" | undefined;
275
275
  rows?: number | undefined;
276
+ stage?: "create" | "acquire" | "deadline" | "render" | undefined;
276
277
  chunks?: number | undefined;
277
278
  bytes?: number | undefined;
278
- stage?: "create" | "acquire" | "deadline" | "render" | undefined;
279
279
  export_id?: string | undefined;
280
280
  }, {
281
281
  format: "csv" | "xlsx" | "pdf" | "png";
282
282
  mechanism: "rendered" | "job" | "matrix_direct";
283
283
  scope?: "dashboard" | "card" | "visual" | undefined;
284
284
  rows?: number | undefined;
285
+ stage?: "create" | "acquire" | "deadline" | "render" | undefined;
285
286
  chunks?: number | undefined;
286
287
  bytes?: number | undefined;
287
- stage?: "create" | "acquire" | "deadline" | "render" | undefined;
288
288
  export_id?: string | undefined;
289
289
  }>;
290
290
  export type ExportCompletedDetails = z.infer<typeof exportCompletedDetailsSchema>;
@@ -108,7 +108,7 @@ export declare const usageEventEnvelopeSchema: z.ZodObject<{
108
108
  release: string;
109
109
  org_id: string | null;
110
110
  tenant_id: string | null;
111
- actor_type: "system" | "tenant" | "tenant_user" | "anonymous" | "org_user" | "api_key";
111
+ actor_type: "system" | "tenant" | "anonymous" | "tenant_user" | "org_user" | "api_key";
112
112
  org_user_id: string | null;
113
113
  tenant_user_id: string | null;
114
114
  session_id: string | null;
@@ -137,7 +137,7 @@ export declare const usageEventEnvelopeSchema: z.ZodObject<{
137
137
  release: string;
138
138
  org_id: string | null;
139
139
  tenant_id: string | null;
140
- actor_type: "system" | "tenant" | "tenant_user" | "anonymous" | "org_user" | "api_key";
140
+ actor_type: "system" | "tenant" | "anonymous" | "tenant_user" | "org_user" | "api_key";
141
141
  org_user_id: string | null;
142
142
  tenant_user_id: string | null;
143
143
  session_id: string | null;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.601",
8
+ "version": "0.1.602",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",