react-semaphor 0.1.545 → 0.1.546

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 (141) hide show
  1. package/dist/analytics-protocol/index.js +405 -442
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/assistant-protocol/index.js +100 -76
  4. package/dist/brand-studio/index.js +4 -4
  5. package/dist/briefings/index.js +6 -6
  6. package/dist/chunks/{add-to-dashboard-BuAqfA2Y.js → add-to-dashboard-BQRAAnc3.js} +55 -33
  7. package/dist/chunks/{analytics-base-schemas-BFAoRlkU.js → analytics-base-schemas-BKs3flFS.js} +2 -2
  8. package/dist/chunks/{assistant-chat-D7sWTypJ.js → assistant-chat-BPXhulAx.js} +2826 -2595
  9. package/dist/chunks/{bookmark-state-CXw7lZ50.js → bookmark-state-C4vetoa0.js} +7 -8
  10. package/dist/chunks/column-catalog-BYnochWQ.js +3363 -0
  11. package/dist/chunks/comparison-window-caption-C2xF-eWw.js +1433 -0
  12. package/dist/chunks/{context-ClREvqCZ.js → context-BerEBuFR.js} +11 -6
  13. package/dist/chunks/custom-visual-inputs-CkJW9pBS.js +295 -0
  14. package/dist/chunks/{dashboard-B1tMju0u.js → dashboard-C3CoKbGY.js} +1 -1
  15. package/dist/chunks/dashboard-briefing-launcher-Be4h-7My.js +3734 -0
  16. package/dist/chunks/dashboard-controls-bxPrlSyp.js +2307 -0
  17. package/dist/chunks/{dashboard-json-CoYRPqxx.js → dashboard-json-BrjxIiRt.js} +5 -5
  18. package/dist/chunks/{document-dashboard-inputs-BesAHZvB.js → document-dashboard-inputs-CRVHpIHp.js} +872 -974
  19. package/dist/chunks/{edit-dashboard-visual-JPtNfJRb.js → edit-dashboard-visual-DYYYDjY6.js} +2361 -2447
  20. package/dist/chunks/{filter-value-text-ff7osJr7.js → filter-value-text-Ddf55Ku1.js} +9 -9
  21. package/dist/chunks/global-date-filter-utils-9d6m9-FE.js +11859 -0
  22. package/dist/chunks/index-CtoK1Lgu.js +586 -0
  23. package/dist/chunks/{index-DRWiuqyd.js → index-DkQkMKa1.js} +80 -79
  24. package/dist/chunks/list-filter-DsaTbM3J.js +15 -0
  25. package/dist/chunks/matrix-analytical-definition-B9vW-osb.js +717 -0
  26. package/dist/chunks/{matrix-card-DjwWcCo8.js → matrix-card-LiMEipvq.js} +3 -3
  27. package/dist/chunks/{matrix-formatter-DnCyRXJE.js → matrix-formatter-DWEeC0_c.js} +44 -44
  28. package/dist/chunks/{matrix-member-presentation-CQGdVks6.js → matrix-member-presentation-DqzG-UhQ.js} +1 -1
  29. package/dist/chunks/{matrix-operation-contract-8OIO4gob.js → matrix-operation-contract-D6vYkZK4.js} +72 -72
  30. package/dist/chunks/{metric-comparison-DEwi9uc2.js → metric-comparison-zpGw4lD6.js} +2 -2
  31. package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +119 -0
  32. package/dist/chunks/{pivot-header-presentation-DHcx1XGQ.js → pivot-header-presentation-CQnIDtUv.js} +1 -1
  33. package/dist/chunks/{pivot-result-identity-DJhXXcns.js → pivot-result-identity-C-Q1j1Wb.js} +1 -1
  34. package/dist/chunks/{pivot-result-lifecycle-DM4CyGKs.js → pivot-result-lifecycle-pwq3b7LC.js} +571 -380
  35. package/dist/chunks/{raw-temporal-contract-C51YG48G.js → raw-temporal-contract-WuXA8jBP.js} +1 -1
  36. package/dist/chunks/{raw-temporal-presentation-C3mUgnEx.js → raw-temporal-presentation-CBzrDOjM.js} +8 -8
  37. package/dist/chunks/{report-preferences-dialog-DUtuUL_5.js → report-preferences-dialog-4QEZWe5U.js} +111 -112
  38. package/dist/chunks/{report-runtime-context-Dq8XyODK.js → report-runtime-context-hWiTCzFV.js} +2 -2
  39. package/dist/chunks/resolve-dashboard-input-context-UpK_LBpL.js +5677 -0
  40. package/dist/chunks/{saved-dashboard-context-LrF_kW0l.js → saved-dashboard-context-D_I3Lxk0.js} +34 -34
  41. package/dist/chunks/{selection-reducer-Dj_8xD69.js → selection-reducer-CJzkTZio.js} +15 -15
  42. package/dist/chunks/{semaphor-ready-indicator-BxF96Yhv.js → semaphor-ready-indicator-4zpRHE-X.js} +45823 -47304
  43. package/dist/chunks/{shelf-drop-preview-context-CNaM_Gmh.js → shelf-drop-preview-context-Cfw7TRAx.js} +84 -84
  44. package/dist/chunks/{source-entity-resolution-BYn9giz3.js → source-entity-resolution-BIGRvtbG.js} +13 -13
  45. package/dist/chunks/{switch-uDtPgQlQ.js → switch-CEBOR4n7.js} +3 -3
  46. package/dist/chunks/{table-export-sheet-YzMioA7Y.js → table-export-sheet-4X9mAG3V.js} +1 -1
  47. package/dist/chunks/table-settings-CunhoDUi.js +605 -0
  48. package/dist/chunks/{temporal-bucket-D7NBrrtL.js → temporal-bucket-CQOSbv9-.js} +26 -26
  49. package/dist/chunks/{token-types-DBbZVQsm.js → token-types-BMqRmT-C.js} +1 -1
  50. package/dist/chunks/{use-create-flow-overlay-state-CjB7ig1o.js → use-create-flow-overlay-state-DZBZiiD-.js} +101 -101
  51. package/dist/chunks/{validators-DMHTpf7a.js → validators-C-aOQlTB.js} +713 -658
  52. package/dist/chunks/{relative-date-label-Bk2j94pA.js → zoned-wall-clock-MulfA26h.js} +64 -21
  53. package/dist/dashboard/index.js +2 -2
  54. package/dist/dashboard-authoring/index.js +1802 -1149
  55. package/dist/data-app-sdk/index.js +6 -6
  56. package/dist/data-app-sdk-adapters/index.js +3 -3
  57. package/dist/data-app-sdk-validation/index.js +14 -14
  58. package/dist/format-utils/index.js +133 -133
  59. package/dist/index.js +192 -186
  60. package/dist/layouts/index.js +5 -242
  61. package/dist/report-runtime-context/index.js +2 -2
  62. package/dist/shared/index.js +4 -5
  63. package/dist/style.css +1 -1
  64. package/dist/surfboard/index.js +2 -2
  65. package/dist/types/components/index.d.ts +2 -0
  66. package/dist/types/components/surfboard/arrange-layout-button.d.ts +8 -0
  67. package/dist/types/components/surfboard/screen-size-preview-button.d.ts +7 -0
  68. package/dist/types/index.js +6 -6
  69. package/dist/types/lib/charts/table-chart-types.d.ts +4 -0
  70. package/dist/types/lib/charts/types.d.ts +2 -2
  71. package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +6 -0
  72. package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +2 -0
  73. package/dist/types/lib/dashboard-inputs/prepare-loaded-dashboard.d.ts +15 -0
  74. package/dist/types/lib/matrix-table/matrix-editor.d.ts +52 -0
  75. package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +69 -0
  76. package/dist/types/lib/stores/dashboard-store.d.ts +125 -6
  77. package/dist/types/lib/types/common-types.d.ts +8 -0
  78. package/dist/types/lib/types/explorer-types.d.ts +10 -0
  79. package/dist/types/lib/types/semantic-types.d.ts +84 -0
  80. package/dist/types/lib/utils/build-saved-editor-card.d.ts +20 -0
  81. package/dist/types/lib/utils/card-type-change.d.ts +16 -0
  82. package/dist/types/lib/utils/field-availability-context.d.ts +25 -0
  83. package/dist/types/lib/utils/field-placement.d.ts +96 -0
  84. package/dist/types/lib/utils/field-state-calculator.d.ts +161 -0
  85. package/dist/types/lib/utils/qualified-entity-name.d.ts +2 -0
  86. package/dist/types/shared/analytics-protocol/field-provenance.d.ts +89 -0
  87. package/dist/types/shared/analytics-protocol/index.d.ts +2 -0
  88. package/dist/types/shared/analytics-protocol/query-policies.d.ts +52 -0
  89. package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +1 -1
  90. package/dist/types/shared/analytics-protocol/time-window.d.ts +40 -1
  91. package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +4 -1
  92. package/dist/types/shared/assistant-protocol/answer-text.d.ts +20 -0
  93. package/dist/types/shared/assistant-protocol/context.d.ts +21 -21
  94. package/dist/types/shared/assistant-protocol/index.d.ts +1 -0
  95. package/dist/types/shared/assistant-protocol/limits.d.ts +6 -1
  96. package/dist/types/shared/assistant-protocol/parts.d.ts +43 -3
  97. package/dist/types/shared/assistant-protocol/request.d.ts +14 -2
  98. package/dist/types/shared/dashboard-authoring/calculated-field-identity.d.ts +3 -0
  99. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +487 -0
  100. package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +34 -0
  101. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +7886 -0
  102. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +43 -0
  103. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +54 -0
  104. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +89 -0
  105. package/dist/types/shared/dashboard-authoring/column-catalog.d.ts +32 -0
  106. package/dist/types/shared/dashboard-authoring/contracts.d.ts +0 -55
  107. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +24 -14
  108. package/dist/types/shared/dashboard-authoring/dashboard-card-source-index.d.ts +9 -1
  109. package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +26 -0
  110. package/dist/types/shared/dashboard-authoring/filter-applicability.d.ts +75 -0
  111. package/dist/types/shared/dashboard-authoring/index.d.ts +18 -2
  112. package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +10 -37
  113. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +189 -0
  114. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +94 -0
  115. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +78 -0
  116. package/dist/types/shared/dashboard-authoring/validators.d.ts +1 -2
  117. package/dist/types/shared/layouts/engine/grid.d.ts +25 -0
  118. package/dist/types/shared/layouts/engine/index.d.ts +4 -0
  119. package/dist/types/shared/layouts/engine/sheet-layout.d.ts +7 -0
  120. package/dist/types/shared/layouts/engine/types.d.ts +125 -0
  121. package/dist/types/shared/layouts/index.d.ts +1 -2
  122. package/package.json +2 -2
  123. package/dist/chunks/apply-dashboard-operations-CZEMsx8E.js +0 -2080
  124. package/dist/chunks/calendar-day-equality-dvoQp1xW.js +0 -410
  125. package/dist/chunks/comparison-window-caption-D4E6IHPD.js +0 -1624
  126. package/dist/chunks/custom-visual-inputs-DLCD9Y5V.js +0 -329
  127. package/dist/chunks/dashboard-briefing-launcher-CePgIu0Z.js +0 -3720
  128. package/dist/chunks/dashboard-controls-Cq05n3e0.js +0 -2315
  129. package/dist/chunks/dashboard-filter-value-compatibility-CwQ_iSNb.js +0 -108
  130. package/dist/chunks/matrix-analytical-definition-C7Gb0e12.js +0 -117
  131. package/dist/chunks/normalize-dashboard-for-dirty-check-Bk3VYv_q.js +0 -67
  132. package/dist/chunks/numeric-presentation-7X_IrD58.js +0 -5226
  133. package/dist/chunks/resolve-dashboard-input-context-DJ2tICwz.js +0 -9415
  134. package/dist/chunks/stable-serialize-CfqXeiBP.js +0 -6
  135. package/dist/chunks/table-settings-CLZocegs.js +0 -501
  136. package/dist/chunks/use-debounced-dirty-check-BwAbnX_5.js +0 -59
  137. package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +0 -46
  138. package/dist/types/shared/dashboard-authoring/change-compiler.d.ts +0 -7
  139. package/dist/types/shared/dashboard-authoring/layout-compiler.d.ts +0 -2
  140. package/dist/types/shared/layouts/create-frame-layouts.d.ts +0 -27
  141. package/dist/types/shared/layouts/frame-layouts.d.ts +0 -23
@@ -1,5 +1,5 @@
1
- import { a, R as s, D as o } from "../chunks/report-preferences-dialog-DUtuUL_5.js";
2
- import { C as f, E as D } from "../chunks/table-settings-CLZocegs.js";
1
+ import { a, R as s, D as o } from "../chunks/report-preferences-dialog-4QEZWe5U.js";
2
+ import { C as f, E as D } from "../chunks/table-settings-CunhoDUi.js";
3
3
  export {
4
4
  f as CONTROL_CARD_DEFAULT_VALUE,
5
5
  a as DisplayFormatPreferencesFields,
@@ -35,6 +35,8 @@ export { VisualEditingControls } from './editor/editor-main/visual-editing-contr
35
35
  export { AdvancedModeToggle } from './editor/editor-main/advanced-mode-toggle.js';
36
36
  export { AssistantProvider } from './assistant/assistant-provider.js';
37
37
  export { AssistantPanel, AssistantToolbarButton } from './assistant/assistant-entry-points.js';
38
+ export { ArrangeLayoutButton } from './surfboard/arrange-layout-button.js';
39
+ export { ScreenSizePreviewButton } from './surfboard/screen-size-preview-button.js';
38
40
  export type { AssistantPanelSurface } from './assistant/assistant-entry-points.js';
39
41
  export { useAssistant } from './assistant/use-assistant.js';
40
42
  export * from '../lib/types/common-types.js';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Arrange in the dashboard toolbar (responsive layouts RL-D13): lays the
3
+ * selected grid sheet out by kind on every screen size, or tidies it in its
4
+ * current order, with Undo on the toast (RL-INV-7). Shown while editing a
5
+ * grid sheet. Reads only the dashboard store, so semaphor-app mounts it in
6
+ * its own toolbar as well as the package's.
7
+ */
8
+ export declare function ArrangeLayoutButton(): import("react").JSX.Element | null;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Preview screen sizes without editing (responsive layouts RL-D19): opens the
3
+ * sheet's floating size control, look-only, at the size the grid shows now.
4
+ * The host places it beside the Activity bell for people who can edit the dashboard. Reads
5
+ * only the dashboard store, so semaphor-app mounts it in its own toolbar too.
6
+ */
7
+ export declare function ScreenSizePreviewButton(): import("react").JSX.Element | null;
@@ -1,9 +1,9 @@
1
- import { C as s, E as r, V as l, i as o, c as i, g as n, f as d, b as m, e as u, d as E, a as c, u as p, s as C, h as T, j as D, q as A, o as I, m as _, n as F, p as S, k as b, l as L, r as f, t as N } from "../chunks/table-settings-CLZocegs.js";
2
- import { C as y, D as M, L as g, P as h, e as x, g as O, j as V, h as k, k as w, d as U, b as B, i as K, c as z, n as v, f as P } from "../chunks/validators-DMHTpf7a.js";
3
- import { D as q } from "../chunks/token-types-DBbZVQsm.js";
4
- import { B as Q, a as j, p as W, r as J } from "../chunks/bookmark-state-CXw7lZ50.js";
5
- import { r as H, a as Z } from "../chunks/pivot-result-identity-DJhXXcns.js";
6
- import { D as ee } from "../chunks/report-runtime-context-Dq8XyODK.js";
1
+ import { C as s, E as r, V as l, i as o, c as i, g as n, f as d, b as m, e as u, d as E, a as c, u as p, s as C, h as T, j as D, q as A, o as I, m as _, n as F, p as S, k as b, l as L, r as f, t as N } from "../chunks/table-settings-CunhoDUi.js";
2
+ import { C as y, D as M, L as g, P as h, e as x, g as O, j as V, h as k, k as w, d as U, b as B, i as K, c as z, n as v, f as P } from "../chunks/validators-C-aOQlTB.js";
3
+ import { D as q } from "../chunks/token-types-BMqRmT-C.js";
4
+ import { B as Q, a as j, p as W, r as J } from "../chunks/bookmark-state-C4vetoa0.js";
5
+ import { r as H, a as Z } from "../chunks/pivot-result-identity-C-Q1j1Wb.js";
6
+ import { D as ee } from "../chunks/report-runtime-context-hWiTCzFV.js";
7
7
  const e = [
8
8
  "concatenate",
9
9
  "conditional-category",
@@ -0,0 +1,4 @@
1
+ import { TChartType } from './types.js';
2
+ /** The chart types that render as tables. No runtime imports: server-safe code reads these. */
3
+ export declare const TABLE_CHART_TYPES: readonly ["table", "pivotTable", "aggregateTable", "matrixTable", "detailTable"];
4
+ export declare function isTableChartType(chartType: TChartType | string | undefined | null): boolean;
@@ -7,6 +7,7 @@ import { SemaphorResultColumn } from '../../shared/analytics-protocol/index.js';
7
7
  import { PresentationExecutionSnapshot } from '../../shared/format-utils/index.js';
8
8
  import { CartesianTemporalPresentation } from '../formatters/cartesian-temporal-presentation.js';
9
9
  import { CartesianFieldRoles } from './cartesian-fields.js';
10
+ import { TABLE_CHART_TYPES, isTableChartType } from './table-chart-types.js';
10
11
  export type ChartConfigParams = {
11
12
  card: TCard;
12
13
  data: any[];
@@ -49,8 +50,7 @@ export type BlurEffectProps = {
49
50
  blurColor?: string;
50
51
  };
51
52
  export type TChartType = 'bar' | 'horizontalBar' | 'line' | 'area' | 'stackedArea' | 'combo' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'aggregateTable' | 'matrixTable' | 'detailTable' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'bullet' | 'heatmap' | 'treemap' | 'custom';
52
- export declare const TABLE_CHART_TYPES: readonly ["table", "pivotTable", "aggregateTable", "matrixTable", "detailTable"];
53
- export declare function isTableChartType(chartType: TChartType | string | undefined | null): boolean;
53
+ export { TABLE_CHART_TYPES, isTableChartType };
54
54
  export declare function isChartJsVisualType(chartType: TChartType | string | undefined | null): boolean;
55
55
  export declare const REGULAR_TABLE_SETTINGS_CHART_TYPES: readonly ["table", "matrixTable", "pivotTable", "aggregateTable", "detailTable"];
56
56
  export declare function supportsRegularTableSettings(chartType: TChartType | string | undefined | null): boolean;
@@ -80,3 +80,9 @@ export declare function removeDashboardInputSlotsById(values: DashboardInputValu
80
80
  * are the stored slots, read without building the model.
81
81
  */
82
82
  export declare function savedDefaultInputValues(dashboard: Pick<TDashboard, 'defaultInputValues' | 'defaultFilterValues'>): DashboardInputValues | undefined;
83
+ /**
84
+ * Every value an input holds, saved or live, removed: its shared slot and its
85
+ * slot on every sheet, card and Document section. Shared by the store's
86
+ * input removal and the dashboard reducer's `filter.remove`.
87
+ */
88
+ export declare function removeDashboardInputFromValues(values: DashboardInputValues | undefined, inputId: string): DashboardInputValues;
@@ -108,6 +108,8 @@ export declare function buildFilterInputFromField(params: {
108
108
  scope: DashboardInputScope;
109
109
  existingInputs: readonly DashboardInput[];
110
110
  createId?: () => string;
111
+ /** The filter's label (and variable name); default the field's label. */
112
+ label?: string;
111
113
  }): EmbeddedFilterDashboardInput;
112
114
  /**
113
115
  * A new filter input holding this definition (one filter model Phase 5):
@@ -0,0 +1,15 @@
1
+ import { TDashboard } from '../types/common-types.js';
2
+ /**
3
+ * A saved dashboard as it enters a runtime (one filter model SPEC 5.1): the
4
+ * filter model's stored shape, every filter an embedded input, when the
5
+ * model reads it without issues; otherwise the template as received, read
6
+ * tolerantly (rejected inputs left out) and refused on save. Then the
7
+ * Include / Exclude repair. Loading never throws on model issues.
8
+ *
9
+ * The one entry for every runtime: the client load (`useDashboard`), the
10
+ * store's replace and load (`setDashboard`, `setDashboardWithFilterValues`)
11
+ * and the server's saved-dashboard reader, so they all hold the same shape.
12
+ * The same object when nothing changes. Alias-based text is bound to stable
13
+ * input ids before the upgrade (`upgradeToStoredDashboard`, ledger P5-11).
14
+ */
15
+ export declare function prepareLoadedDashboard<TDashboardShape extends TDashboard>(dashboard: TDashboardShape): TDashboardShape;
@@ -0,0 +1,52 @@
1
+ import { ContainerId, Field } from '../types/explorer-types.js';
2
+ import { TCard } from '../types/common-types.js';
3
+ import { FieldPlacement, FieldPlacementContext, FieldPlacementOutcome } from '../utils/field-placement.js';
4
+ import { MatrixViewState, MatrixConfig, MatrixSpec } from '../../shared/analytics-protocol/index.js';
5
+ import { MatrixAuthoringChange, MatrixAuthoringNotice } from '../../shared/dashboard-authoring/matrix-authoring.js';
6
+ import { MatrixCardCatalog } from './matrix-card-adapter.js';
7
+ /** Source-panel fields already carry catalog identity; do not infer it from names or SQL. */
8
+ export declare function matrixEditorCatalogFromFields(card: Pick<TCard, 'dataSource'> & {
9
+ config?: {
10
+ matrix?: {
11
+ spec: Pick<MatrixSpec, 'source'>;
12
+ };
13
+ };
14
+ }, fields: readonly Field[]): MatrixCardCatalog;
15
+ export type MatrixEditorChange = {
16
+ card: TCard;
17
+ notices: readonly MatrixAuthoringNotice[];
18
+ };
19
+ export declare function changeMatrixEditor(card: TCard, config: MatrixConfig, change: MatrixAuthoringChange, catalog: MatrixCardCatalog): MatrixEditorChange;
20
+ /**
21
+ * Copy the live session into the authored config: expansion on both axes
22
+ * becomes defaultView and effective sorts become the authored sorts. This is
23
+ * the one explicit path from exploration to persisted state.
24
+ */
25
+ export declare function persistMatrixEditorView(card: TCard, config: MatrixConfig, view: MatrixViewState, catalog: MatrixCardCatalog): MatrixEditorChange;
26
+ /** All editor surfaces replace the canonical config and its bindings atomically. */
27
+ export declare function applyMatrixEditorResult(card: TCard, result: {
28
+ config: MatrixConfig;
29
+ bindings: readonly NonNullable<TCard['controlBindings']>[number][];
30
+ notices: readonly MatrixAuthoringNotice[];
31
+ }): MatrixEditorChange;
32
+ /**
33
+ * Field placement for Matrix cards: the field-list entity gate, then the one
34
+ * spec transaction. Side-effect-free; the new instance id is context input.
35
+ * Called through `evaluateFieldPlacement` by both the drop and its preview.
36
+ */
37
+ export declare function evaluateMatrixPlacement(card: TCard, placement: FieldPlacement, context: FieldPlacementContext): FieldPlacementOutcome;
38
+ /**
39
+ * One atomic mutation for source drops, cross-shelf moves and reordering.
40
+ * A field-list drop creates an instance and needs `newInstanceId`; the
41
+ * committing adapter mints it, so this function reads no random source.
42
+ */
43
+ export declare function dropMatrixEditorField(card: TCard, catalog: MatrixCardCatalog, input: {
44
+ field: Field;
45
+ from: ContainerId;
46
+ to: ContainerId;
47
+ beforeId?: string;
48
+ newInstanceId?: string;
49
+ }): MatrixEditorChange;
50
+ export declare function removeMatrixEditorField(card: TCard, zone: ContainerId, id: string, catalog: MatrixCardCatalog): MatrixEditorChange;
51
+ /** Scope storage stays with calculated-field transitions; this owns selected Matrix copies. */
52
+ export declare function reconcileMatrixCalculatedField(card: TCard, fields: readonly Field[], previous: Field | undefined, updated?: Field): MatrixEditorChange;
@@ -73,6 +73,75 @@ export declare function validateDashboardFilterTargetForCard(params: {
73
73
  sourceIndex: ReturnType<typeof buildDashboardCardSourceIndex>;
74
74
  target: DashboardFilterTarget;
75
75
  }): DashboardFilterTargetValidation;
76
+ /**
77
+ * Where a filter input lands on a card: the one decision execution
78
+ * (`resolveDashboardFilterMappings`) and every description of reach (the
79
+ * dashboard outline, the change resolver's reach warnings and filter-effect
80
+ * check) make, in one order: the card's mapping entry (excluded, or a bound
81
+ * target the card must still address), then SQL Auto, then the automatic and
82
+ * inherited targets. A selected value only supplies the automatic target's
83
+ * data type when the input states none.
84
+ */
85
+ export type DashboardFilterCardTarget = {
86
+ status: 'excluded';
87
+ } | {
88
+ status: 'bound';
89
+ bindingId: string;
90
+ target: DashboardFilterTarget;
91
+ validation: Extract<DashboardFilterTargetValidation, {
92
+ status: 'valid';
93
+ }>;
94
+ }
95
+ /**
96
+ * A bound target the card can't run, no longer addresses, or whose type the
97
+ * filter's values can't take: the card blocks until it is mapped again.
98
+ */
99
+ | {
100
+ status: 'unsupportedTarget' | 'stale' | 'incompatible';
101
+ bindingId: string;
102
+ } | {
103
+ status: 'sql';
104
+ } | {
105
+ status: 'automatic';
106
+ target: DashboardFilterTarget;
107
+ }
108
+ /**
109
+ * The card's data takes the filter's field (the one applicability rule) but
110
+ * not through a source its query uses, such as a dataset it selects or
111
+ * joins: the value applies as it is, as it does for a filter with no card
112
+ * mappings.
113
+ */
114
+ | {
115
+ status: 'passthrough';
116
+ } | {
117
+ status: 'ambiguous';
118
+ } | {
119
+ status: 'notApplicable';
120
+ };
121
+ /** The filter's mapping marks the card "Don't apply" (the first step of `decideDashboardFilterCardTarget`). */
122
+ export declare function isDashboardFilterCardExcluded(input: NormalizedFilterDashboardInput, cardId: string): boolean;
123
+ export declare function decideDashboardFilterCardTarget(input: NormalizedFilterDashboardInput, card: TCard, sourceIndex?: ReturnType<typeof buildDashboardCardSourceIndex>, selectedValue?: TFilterValue): DashboardFilterCardTarget;
124
+ /** How a filter applies to a card, whatever value it holds. */
125
+ export type DashboardFilterCardReach =
126
+ /** The mapping marks the card "Don't apply". */
127
+ 'excluded'
128
+ /** The mapping binds the filter to a field of the card. */
129
+ | 'bound'
130
+ /** The card executes the filter's own field (or a proven binding's), so it applies with no mapping. */
131
+ | 'automatic'
132
+ /** A SQL card takes the filter's value as is. */
133
+ | 'sql'
134
+ /** More than one field of the card could take it: the card blocks until it is mapped. */
135
+ | 'ambiguous'
136
+ /** The mapping binds a target the card can't run or no longer has: the card blocks until it is mapped again. */
137
+ | 'blocked' | 'notApplicable';
138
+ /**
139
+ * Whether a filter in scope reaches a card, read without a value, from the
140
+ * decision execution makes (`decideDashboardFilterCardTarget`). The dashboard
141
+ * outline and the change resolver read it, so they report what the card runs
142
+ * (MCP dashboard editing SPEC 3.6, 5.4).
143
+ */
144
+ export declare function describeDashboardFilterCardReach(input: NormalizedFilterDashboardInput, card: TCard): DashboardFilterCardReach;
76
145
  export declare function resolveDashboardFilterMappings({ card, inputs, resolvedInputs, activeFilterValues, shouldApplyDashboardFilters, }: {
77
146
  card: TCard;
78
147
  inputs: NormalizedFilterDashboardInput[];
@@ -9,7 +9,8 @@ import { TFilter, TFilterValue } from '../../components/surfboard/filter/types.j
9
9
  import { TransientInputContext } from '../dashboard-inputs/transient-input-context.js';
10
10
  import { MissingPrintInputs } from '../print/print-inputs.js';
11
11
  import { default as ReactGridLayout } from 'react-grid-layout';
12
- import { DashboardFramePlacement } from '../../shared/dashboard-authoring/operations/apply-dashboard-operations.js';
12
+ import { CustomizableBreakpoint, EditableBreakpoint, FramePlacement, GridEditBreakpoint, LayoutItem } from '../../shared/layouts/index.js';
13
+ import { DashboardOperation, OperationContext } from '../../shared/dashboard-authoring/operations/apply-dashboard-operations.js';
13
14
  import { FilterGroup, Field } from '../types/explorer-types.js';
14
15
  import { DashboardControlsModelOptions } from '../controls/control-authoring-types.js';
15
16
  import { SemanticExecutionPayload } from '../types/semantic-runtime-types.js';
@@ -26,15 +27,86 @@ import { CardViewStateMap, DrillStep } from '../dashboard-view-state/index.js';
26
27
  import { DashboardCardPaginationState } from '../dashboard-pagination/dashboard-card-pagination.js';
27
28
  export declare function mergeSemanticExecutionPayloadIntoTarget(target: SemanticExecutionPayload, incoming?: SemanticExecutionPayload): void;
28
29
  type AddFrameOptions = {
29
- /** Default `end`; beside a frame is how a duplicate lands next to its original. */
30
- placement?: DashboardFramePlacement;
30
+ /** By intent; absent: placed by kind (RL-D12). A duplicate passes `{ position: { beside: originalId } }`. */
31
+ placement?: FramePlacement;
31
32
  semanticExecutionPayload?: SemanticExecutionPayload;
32
33
  };
34
+ /**
35
+ * A proposal the assistant applied in this edit session (analytics agent
36
+ * Plan 1, spec 8.1, D7-20): the document before and after it, for Undo.
37
+ */
38
+ export type AppliedProposal = {
39
+ proposalId: string;
40
+ before: TDashboard;
41
+ beforePayload: SemanticExecutionPayload;
42
+ after: TDashboard;
43
+ };
44
+ export type ApplyProposalInput = {
45
+ proposalId: string;
46
+ operations: DashboardOperation[];
47
+ /** The context the proposal was resolved with: its pinned calendar. */
48
+ context: OperationContext;
49
+ /** The exact document the proposal was built from (D7-19). */
50
+ basedOn: TDashboard;
51
+ /** Metadata loaded for cards the loaded metadata doesn't cover. */
52
+ semanticExecutionPayload?: SemanticExecutionPayload;
53
+ };
54
+ export type ApplyProposalRefusal = {
55
+ ok: false;
56
+ reason: 'dashboard_changed' | 'not_editable' | 'refused' | 'previous_not_applied';
57
+ message: string;
58
+ };
59
+ export type ApplyProposalResult = {
60
+ ok: true;
61
+ after: TDashboard;
62
+ } | ApplyProposalRefusal;
63
+ export type UndoProposalResult = {
64
+ ok: true;
65
+ } | {
66
+ ok: false;
67
+ reason: 'changed_since' | 'not_found' | 'not_editable';
68
+ };
69
+ /** Arrange from the toolbar (responsive layouts SPEC §6.4, RL-D13). */
70
+ export type ArrangeSheetResult = {
71
+ ok: true;
72
+ } | {
73
+ ok: false;
74
+ reason: 'not_editable' | 'not_a_grid';
75
+ };
76
+ export type UndoArrangeResult = {
77
+ ok: true;
78
+ } | {
79
+ ok: false;
80
+ reason: 'changed_since' | 'not_found';
81
+ };
82
+ /** The last toolbar Arrange: `after` is the store's own document, so Undo can tell whether anything changed since (RL-INV-7). */
83
+ export type LastArrange = {
84
+ sheetId: string;
85
+ before: TDashboard;
86
+ after: TDashboard;
87
+ };
88
+ /** The words for a proposal the dashboard could not take, for the viewer. */
89
+ export declare const PROPOSAL_REFUSALS: {
90
+ readonly dashboard_changed: "Not applied: the dashboard changed while I was answering.";
91
+ readonly not_editable: "Not applied: close the editor and ask again.";
92
+ readonly no_save: "Not applied: changes to this dashboard can't be saved here.";
93
+ /** A change built on one that wasn't applied here: nothing to build on (P7-46). */
94
+ readonly previous_not_applied: "Not applied: the change before it wasn't applied.";
95
+ };
33
96
  export type DashboardStore = {
34
97
  isDownloadingPdf?: boolean;
35
98
  isSessionExpired: boolean;
36
99
  authToken?: AuthToken;
100
+ /** The breakpoint the sheet grid renders: from the container width in view mode, `layoutEditBreakpoint` while editing, `lg` in print (responsive layouts SPEC §6.3). semaphor-app's BreakpointIndicator reads it. */
37
101
  currentBreakpoint: Breakpoint;
102
+ /** The breakpoint the editor edits (RL-D11). Reset to `lg` on dashboard load and on leaving edit mode. */
103
+ layoutEditBreakpoint: EditableBreakpoint;
104
+ /**
105
+ * A screen size shown look-only, or Laptop or Small phone while editing
106
+ * (responsive layouts RL-D18, RL-D19). null: no preview. Never saved; cleared
107
+ * on load, on entering or leaving edit mode, and when an editable size is chosen.
108
+ */
109
+ layoutPreviewBreakpoint: Breakpoint | null;
38
110
  theme?: 'light' | 'dark' | 'system';
39
111
  themeStyle?: StyleProps;
40
112
  filteringCards?: TCard[];
@@ -70,6 +142,14 @@ export type DashboardStore = {
70
142
  dashboard: TDashboard;
71
143
  semanticExecutionPayload: SemanticExecutionPayload;
72
144
  } | null;
145
+ /**
146
+ * The assistant's proposals applied in this edit session, oldest first
147
+ * (analytics agent Plan 1, spec 8.1, D7-20). Leaving edit mode, and every
148
+ * replacement of the document but a proposal's own Undo, clears them.
149
+ */
150
+ appliedProposals: AppliedProposal[];
151
+ /** The last toolbar Arrange, for its Undo. Cleared by any dashboard load, leaving edit mode, or a successful undo (responsive layouts SPEC §6.4). */
152
+ lastArrange?: LastArrange;
73
153
  isVisualEditing: boolean;
74
154
  showDashboardJSON: boolean;
75
155
  showFilters: boolean;
@@ -273,7 +353,20 @@ type Actions = {
273
353
  clearDocumentInputRuntime: (sheetId?: string) => void;
274
354
  setSelectedSheetId: (sheetId: string | null) => void;
275
355
  setSheetLayout: (sheetId: string, layout: ReactGridLayout.Layout[]) => void;
276
- setSheetLayouts: (sheetId: string, layouts: ReactGridLayout.Layouts) => void;
356
+ /** The grid's items at the edited breakpoint after a drag or resize stop, through the layout engine (`grid_edited`). */
357
+ editSheetLayout: (sheetId: string, breakpoint: GridEditBreakpoint, items: LayoutItem[]) => void;
358
+ /** Shows a screen size look-only, or ends the preview with null (RL-D19). */
359
+ setLayoutPreviewBreakpoint: (breakpoint: Breakpoint | null) => void;
360
+ /** The screen size the editor edits: Desktop, Tablet or Phone (RL-D11). */
361
+ setLayoutEditBreakpoint: (breakpoint: EditableBreakpoint) => void;
362
+ /** "Back to automatic" for a customized Tablet or Phone layout, through the layout engine (`reset_to_automatic`). */
363
+ resetSheetLayout: (sheetId: string, breakpoint: CustomizableBreakpoint) => void;
364
+ /** Arrange from the toolbar: the `layout.arrange` operation, with edit mode on and an undo record (RL-D13, RL-INV-7). */
365
+ arrangeSheet: (sheetId: string, options?: {
366
+ keepOrder?: boolean;
367
+ }) => ArrangeSheetResult;
368
+ /** Restores the dashboard from before the last toolbar Arrange while it is still what the Arrange left. */
369
+ undoArrange: () => UndoArrangeResult;
277
370
  setSelectedCardId: (sheetId: string, cardId: string | null) => void;
278
371
  setSelectedFrameId: (frameId: string) => void;
279
372
  clearSelectedFrameId: () => void;
@@ -281,7 +374,7 @@ type Actions = {
281
374
  setCardInfo: (cardId: string, info: string) => void;
282
375
  setCardSql: (sheetId: string, cardId: string, sql: string) => void;
283
376
  setCardPython: (cardId: string, pythonCode: string) => void;
284
- setCardDescription: (sheetId: string, cardId: string, description: string, preferences?: TCard['preferences']) => void;
377
+ setCardDescription: (sheetId: string, cardId: string, description: string) => void;
285
378
  setCardKpiOptions: (sheetId: string, cardId: string, kpiOptions: Record<string, any>) => void;
286
379
  updateCardFilters: (cardId: string, filters: FilterGroup | undefined) => void;
287
380
  clearCardFilters: (cardId: string) => void;
@@ -301,7 +394,7 @@ type Actions = {
301
394
  clearAllInlineFilterValues: () => void;
302
395
  setInlineFilterValuesMap: (map: Record<string, TFilterValue[]>) => void;
303
396
  setCardInlineFilterDefaultValues: (sheetId: string, cardId: string, filterId: string, defaultValues: (string | number)[] | undefined) => void;
304
- addFrame: (sheetId: string, frame: TFrame, positionOrOptions?: 'start' | 'end' | AddFrameOptions) => void;
397
+ addFrame: (sheetId: string, frame: TFrame, options?: AddFrameOptions) => void;
305
398
  updateFrame: (sheetId: string, frame: TFrame, options?: {
306
399
  semanticExecutionPayload?: SemanticExecutionPayload;
307
400
  }) => void;
@@ -315,6 +408,15 @@ type Actions = {
315
408
  removeFrame: (sheetId: string, frameId: string) => void;
316
409
  removeCard: (sheetId: string, card: TCard) => void;
317
410
  setIsDashboardEditing: (editing: boolean) => void;
411
+ /**
412
+ * Applies an assistant proposal to the dashboard on screen (spec 8.1,
413
+ * D7-18, D7-27): only while the dashboard is still `basedOn`, checked and
414
+ * written in one step, with edit mode on and an undo record. Callers go
415
+ * through `useApplyProposal`, which loads the metadata first.
416
+ */
417
+ applyProposal: (input: ApplyProposalInput) => ApplyProposalResult;
418
+ /** Undoes the newest applied proposal while the dashboard is still what it left (D7-20). */
419
+ undoProposal: (proposalId: string) => UndoProposalResult;
318
420
  setShowDashboardJSON: (show: boolean) => void;
319
421
  setIsVisualEditing: (editing: boolean) => void;
320
422
  setShowFilters: (show: boolean) => void;
@@ -435,6 +537,23 @@ export type ViewerRequestToken = {
435
537
  * editing turned on, else the dashboard as it is now. Both toolbars' "before
436
538
  * editing" capture reads this.
437
539
  */
540
+ /**
541
+ * Whether a toolbar that owns the edit session (the package's or the app's)
542
+ * is mounted: each registers its unsaved-changes check while mounted. Where
543
+ * none is, there is no Save, so nothing changes the dashboard (D7-32).
544
+ */
545
+ export declare function selectHasEditingToolbar(state: Pick<DashboardStore, 'checkUnsavedDashboardChanges'>): boolean;
546
+ /**
547
+ * Where an applied proposal stands for its block (spec 8.1, D7-20):
548
+ * `undoable` while it is the newest and the dashboard is still what it left,
549
+ * `older` with a newer one after it while the dashboard is still what the
550
+ * newest left, `changed_since` for every record after the person's own edit
551
+ * (their change may have undone this one, P7-36), `none` when its record is
552
+ * gone.
553
+ */
554
+ export type ProposalRecordState = 'undoable' | 'older' | 'changed_since' | 'none';
555
+ export declare function selectProposalRecordState(state: Pick<DashboardStore, 'appliedProposals' | 'dashboard'>, proposalId: string): ProposalRecordState;
556
+ export declare function selectProposalUndoable(state: Pick<DashboardStore, 'appliedProposals' | 'dashboard'>, proposalId: string): boolean;
438
557
  export declare function selectEditSessionStart(state: Pick<DashboardStore, 'editingStartedWith' | 'dashboard' | 'semanticExecutionPayload'>): {
439
558
  dashboard: TDashboard;
440
559
  semanticExecutionPayload: SemanticExecutionPayload;
@@ -315,6 +315,8 @@ export type AuthToken = {
315
315
  refreshToken?: string;
316
316
  };
317
317
  export type Breakpoint = 'lg' | 'md' | 'sm' | 'xs' | 'xxs';
318
+ /** The breakpoints a person may customize on purpose: Tablet and Phone (responsive layouts RL-D14). */
319
+ export type CustomizableBreakpoint = Extract<Breakpoint, 'sm' | 'xs'>;
318
320
  type FilterOnClick = {
319
321
  expression?: string;
320
322
  columnIndex: number;
@@ -1521,6 +1523,12 @@ export type TSheet = {
1521
1523
  description?: string;
1522
1524
  layout?: ReactGridLayout.Layout[];
1523
1525
  layouts?: ReactGridLayout.Layouts;
1526
+ /**
1527
+ * The breakpoints edited on purpose (responsive layouts RL-D3); every other
1528
+ * breakpoint but `lg` is derived from `lg` by the layout engine
1529
+ * (`src/shared/layouts`). Absent on a sheet the engine has never written.
1530
+ */
1531
+ customizedBreakpoints?: CustomizableBreakpoint[];
1524
1532
  cards?: TCard[];
1525
1533
  frames?: TFrame[];
1526
1534
  calculatedFields?: Field[];
@@ -212,6 +212,14 @@ export interface MetricField extends Field {
212
212
  * pre-aggregated metric input.
213
213
  */
214
214
  isPreAggregated?: boolean;
215
+ /**
216
+ * The governed compiler's aggregate provenance, saved with every card it
217
+ * compiles (semaphor-app `buildMetricField`): the semantic model's
218
+ * aggregate, the one applied, and where it came from.
219
+ */
220
+ semanticAggregate?: AggregateFunction;
221
+ effectiveAggregate?: AggregateFunction;
222
+ aggregateSource?: 'semantic_model' | 'caller_override' | 'default_sum';
215
223
  comparison?: MetricComparisonConfig;
216
224
  comparisonPolarity?: MetricComparisonPolarity;
217
225
  /** Governed runtime annotation. When present, authoring polarity is read-only. */
@@ -478,6 +486,8 @@ export interface FilterCondition {
478
486
  * it was saved.
479
487
  */
480
488
  latestValue?: true;
489
+ /** Set when the governed compiler added the latest-value condition by a snapshot dataset's policy (no stated window), not someone's choice: a read leaves it unstated and a recompile adds it again. */
490
+ latestValuePolicy?: 'snapshot';
481
491
  }
482
492
  export interface FilterGroup {
483
493
  id: string;
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Joinability types: the response of GET /api/v1/domains/[domainId]/joinability,
3
+ * used by field draggability states in the query builder.
4
+ *
5
+ * The domain template contract (datasets, fields, metrics, relationships) has one
6
+ * owner, semaphor-app (`src/lib/semantic/template/contract.ts`); it is not copied
7
+ * here. If a react-semaphor consumer ever needs template types, move the contract
8
+ * into react-semaphor's shared contracts and have the app import it, rather than
9
+ * copy it (domain template 2.1, ledger P2-20).
10
+ */
11
+ /**
12
+ * Joinability map for a semantic domain
13
+ *
14
+ * Maps each dataset to the datasets it can join with, including both direct (1-hop)
15
+ * and indirect (2-hop) joins. This is a lightweight topology representation used by
16
+ * the frontend for UX feedback (field draggability states).
17
+ *
18
+ * The backend generates this from the full relationship definitions and serves it
19
+ * via GET /api/v1/domains/[domainId]/joinability
20
+ */
21
+ export interface JoinabilityMap {
22
+ [datasetName: string]: {
23
+ /**
24
+ * Datasets that can be joined directly (1-hop)
25
+ * Example: orders.canJoinTo = ['customers', 'products']
26
+ */
27
+ canJoinTo: string[];
28
+ /**
29
+ * Datasets that require multi-hop joins (2-hop)
30
+ * Key: target dataset name
31
+ * Value: array of intermediate datasets to traverse
32
+ *
33
+ * Example: orders.indirectJoins = { countries: ['stores'] }
34
+ * Means: orders → stores → countries
35
+ */
36
+ indirectJoins: {
37
+ [targetDataset: string]: string[];
38
+ };
39
+ /**
40
+ * Datasets related by an ACTIVE relationship that is not set to join
41
+ * automatically. The query engine will not auto-join these; the user
42
+ * has to enable automatic join on the relationship or configure the
43
+ * join on the chart. Drives the "Requires setup" field state.
44
+ * Optional: older servers omit it.
45
+ */
46
+ manualJoins?: string[];
47
+ /**
48
+ * Direct neighbours connected by MORE THAN ONE active auto-join
49
+ * relationship, with the count. The engine picks by join priority,
50
+ * so this is informational ("Multiple relationships; highest
51
+ * priority is used"), never blocking. Optional.
52
+ */
53
+ ambiguousJoins?: {
54
+ [targetDataset: string]: number;
55
+ };
56
+ /**
57
+ * Cardinality of the direct auto-join, from THIS dataset's side.
58
+ * `one_to_many` means one row here matches many rows there, so an
59
+ * aggregate over this dataset's values joined to that dataset may
60
+ * repeat. `unknown` when the relationship has no authored cardinality
61
+ * (the planner refuses repeat-sensitive measures across it).
62
+ * Informational; drives a warning, never a block. Optional.
63
+ */
64
+ cardinality?: {
65
+ [targetDataset: string]: 'one_to_one' | 'one_to_many' | 'many_to_one' | 'many_to_many' | 'unknown';
66
+ };
67
+ };
68
+ }
69
+ /**
70
+ * Response from the joinability map API
71
+ */
72
+ export interface JoinabilityMapResponse {
73
+ /** Lightweight joinability map for field state calculation */
74
+ joinabilityMap: JoinabilityMap;
75
+ /** Minimal dataset information */
76
+ datasets: Array<{
77
+ name: string;
78
+ label: string;
79
+ type: string;
80
+ table?: string | null;
81
+ catalog?: string | null;
82
+ schema?: string | null;
83
+ }>;
84
+ }
@@ -0,0 +1,20 @@
1
+ import { TCard } from '../types/common-types.js';
2
+ type BuildSavedEditorCardOptions = {
3
+ isDevMode: boolean;
4
+ cardSql?: string;
5
+ selectedSchemaName?: string;
6
+ selectedDatabaseName?: string;
7
+ selectedTableName?: string;
8
+ selectedConnectionId?: string;
9
+ remoteChartSettings?: unknown;
10
+ stripConfig: (config: TCard['config']) => TCard['config'];
11
+ };
12
+ /**
13
+ * The card the editor saves. The editor's picker selection (database,
14
+ * schema, table, data model) is not written onto the card: a card's source is
15
+ * its `dataSource`, so Done with no change leaves the card as it was
16
+ * (MCP dashboard editing ledger V-50, V-58). A stored card's older copies of
17
+ * the picker stay as they are, read by nothing at run time.
18
+ */
19
+ export declare function buildSavedEditorCard(card: TCard, { isDevMode, cardSql, selectedSchemaName, selectedDatabaseName, selectedTableName, selectedConnectionId, remoteChartSettings, stripConfig, }: BuildSavedEditorCardOptions): TCard;
20
+ export {};
@@ -8,6 +8,11 @@ export type CardTypeChangeOptions = {
8
8
  catalogLoading?: boolean;
9
9
  /** A plugin visual chosen as `custom`. */
10
10
  customVisual?: TCustomCardPreferences;
11
+ /**
12
+ * Mints the ids the conversion needs (Matrix field instances), in order.
13
+ * Default `crypto.randomUUID`; a replayed change passes its stored ids (DE-D54).
14
+ */
15
+ createId?: () => string;
11
16
  };
12
17
  export type CardTypeChange = {
13
18
  status: 'refused';
@@ -19,6 +24,8 @@ export type CardTypeChange = {
19
24
  card: TCard;
20
25
  /** Labels of authored parts the new type could not keep. */
21
26
  leftOut: readonly string[];
27
+ /** Chart-scoped preference keys the new type drops (DE-D43). */
28
+ droppedPreferences: readonly (keyof TCardPreferences)[];
22
29
  crossedMatrixBoundary: boolean;
23
30
  forcesSqlMode: boolean;
24
31
  };
@@ -28,3 +35,12 @@ export type CardTypeChange = {
28
35
  * the editor store applies the result.
29
36
  */
30
37
  export declare function changeCardType(card: TCard, type: TCard['type'], options?: CardTypeChangeOptions): CardTypeChange;
38
+ /**
39
+ * A type change as a person makes it in the editor (MCP dashboard editing
40
+ * DE-D51, ledger P2-01): the chart picker is `changeCardType`; between table
41
+ * kinds the table editor's tabs are `switchTableType`. A detail table is
42
+ * reached only through the tabs, so a change into or out of one goes through
43
+ * a table, as the editor's two steps do. The dashboard reducer's `retype`
44
+ * calls this; the editor keeps calling each half from its own control.
45
+ */
46
+ export declare function changeCardTypeAsEditor(card: TCard, type: TCard['type'], options?: CardTypeChangeOptions): CardTypeChange;