react-semaphor 0.1.603 → 0.1.605
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.
- package/dist/activity/index.js +1 -73
- package/dist/analytics-protocol/index.js +1 -1491
- package/dist/appearance/index.js +1 -12
- package/dist/appearance-runtime/index.js +1 -5
- package/dist/assistant-context/index.js +1 -11
- package/dist/assistant-protocol/index.js +1 -152
- package/dist/brand-studio/index.js +3 -1598
- package/dist/briefings/index.js +1 -70
- package/dist/chunks/add-to-dashboard-CEmZUf9o.js +12 -0
- package/dist/chunks/analytics-base-schemas-DMFrDqn_.js +1 -0
- package/dist/chunks/appearance-provider-CfoAVQuG.js +608 -0
- package/dist/chunks/appearance-runtime-provider-Bx8H-moR.js +1 -0
- package/dist/chunks/applied-constraints-CinevlKD.js +1 -0
- package/dist/chunks/assistant-chat-DgUaCE9k.js +51 -0
- package/dist/chunks/attachment-filter-line-C_zHMhGh.js +1 -0
- package/dist/chunks/attribution-BEFSsbNn.js +1 -0
- package/dist/chunks/availability-3AIOf6Z-.js +1 -0
- package/dist/chunks/bookmark-impact-BAtemeyK.js +1 -0
- package/dist/chunks/bookmark-state-DScd31KT.js +1 -0
- package/dist/chunks/brand-C9APUFaP.js +1 -0
- package/dist/chunks/card-filter-builder-ClWrXB7P.js +11 -0
- package/dist/chunks/column-bands-DwxbZ6UI.js +1 -0
- package/dist/chunks/comparison-window-caption-tguyN24S.js +1 -0
- package/dist/chunks/context-CntvtZwC.js +2 -0
- package/dist/chunks/conversation-JMK2kyTK.js +1 -0
- package/dist/chunks/dashboard-ChIcbVTx.js +1 -0
- package/dist/chunks/dashboard-briefing-launcher-CwMlhkxV.js +42 -0
- package/dist/chunks/dashboard-controls-UCSAFCGA.js +42 -0
- package/dist/chunks/dashboard-json-B120hYDa.js +1 -0
- package/dist/chunks/dashboard-temporal-snapshot-BFJKbp_6.js +1 -0
- package/dist/chunks/edit-dashboard-visual-DvHp03h_.js +73 -0
- package/dist/chunks/export-file-format-B-wQNHIn.js +4 -0
- package/dist/chunks/filter-line-WwUV5JzN.js +1 -0
- package/dist/chunks/filter-reach-preview-C5M5_hf_.js +1 -0
- package/dist/chunks/filter-value-text-DqTHe_vu.js +1 -0
- package/dist/chunks/index-DViPGDFj.js +1 -0
- package/dist/chunks/index-bkP6SnYu.js +1 -0
- package/dist/chunks/kpi-trend-rule-B87LNzcz.js +1 -0
- package/dist/chunks/layout-grid-CFzqJ7GC.js +6 -0
- package/dist/chunks/matrix-analytical-definition-5T-2euHZ.js +1 -0
- package/dist/chunks/matrix-member-presentation-vVAv-aqg.js +1 -0
- package/dist/chunks/matrix-operation-contract-CWvcEsQ0.js +1 -0
- package/dist/chunks/normalize-dashboard-for-dirty-check-ILKfqgL3.js +1 -0
- package/dist/chunks/numeric-range-options-C8tr-Bls.js +1 -0
- package/dist/chunks/palette-NvEIuXHN.js +6 -0
- package/dist/chunks/pivot-result-contract-expectations-BNWhS8mv.js +1 -0
- package/dist/chunks/pivot-result-identity-B0eWVMXg.js +1 -0
- package/dist/chunks/raw-temporal-value-BHQ-ldpW.js +1 -0
- package/dist/chunks/rendered-file-BbvwaU6z.js +1 -0
- package/dist/chunks/report-preferences-dialog-Bseb2Rlg.js +1 -0
- package/dist/chunks/report-runtime-context-Cd1b5pku.js +1 -0
- package/dist/chunks/resolve-dashboard-input-context-BDY7KwRe.js +8 -0
- package/dist/chunks/resolver-CjsW8Rz0.js +1 -0
- package/dist/chunks/saved-dashboard-context-C3lWc4Dx.js +1 -0
- package/dist/chunks/schema-O1Y3WTGF.js +4 -0
- package/dist/chunks/selection-filter-compiler-kYsRugss.js +1 -0
- package/dist/chunks/semaphor-ready-indicator-BQarSo6S.js +612 -0
- package/dist/chunks/set-6mOnfQeH.js +1 -0
- package/dist/chunks/slider-BPnHdMGq.js +4 -0
- package/dist/chunks/stored-dashboard-DfrxDLhR.js +1 -0
- package/dist/chunks/table-export-sheet-xaczzWZF.js +2 -0
- package/dist/chunks/token-types-1vzMWjI-.js +1 -0
- package/dist/chunks/validators-Dg2kyF4_.js +1 -0
- package/dist/chunks/variable-draft-B4_xqr4Y.js +1 -0
- package/dist/chunks/visual-choice-DgEFfkE-.js +1 -0
- package/dist/dashboard/index.js +1 -7
- package/dist/dashboard-authoring/index.js +1 -4614
- package/dist/format-utils/index.js +1 -425
- package/dist/index.js +1 -554
- package/dist/layouts/index.js +1 -7
- package/dist/live-channel/index.js +1 -124
- package/dist/pdf-export-policy/index.js +1 -92
- package/dist/pdf-table-layout/index.js +1 -993
- package/dist/report-runtime-context/index.js +1 -9
- package/dist/shared/index.js +1 -6
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -9
- package/dist/types/brand-studio/brand-studio-draft.d.ts +45 -13
- package/dist/types/brand-studio/brand-studio-editor.d.ts +13 -2
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/visual/data-table/hooks/use-data-table-logic.d.ts +17 -6
- package/dist/types/components/visual/data-table/types/data-table.d.ts +52 -42
- package/dist/types/index.js +1 -88
- package/dist/types/lib/appearance/aliases.d.ts +3 -0
- package/dist/types/lib/appearance/index.d.ts +1 -0
- package/dist/types/lib/appearance/table-density.d.ts +18 -0
- package/dist/types/lib/appearance/types.d.ts +39 -1
- package/dist/types/lib/dashboard-viewer/column-header-actions.d.ts +100 -0
- package/dist/types/lib/dashboard-viewer/table-view-edit.d.ts +0 -27
- package/dist/types/lib/dashboard-viewer/table-view.d.ts +26 -2
- package/dist/types/lib/dashboard-viewer/use-table-view.d.ts +2 -0
- package/dist/types/lib/filter-values/build-card-filter-definition.d.ts +32 -0
- package/dist/types/lib/hooks/use-add-new-frame.d.ts +7 -0
- package/dist/types/lib/hooks/use-dashboard-card.d.ts +4 -0
- package/dist/types/lib/interactions/get-click-context-from-chartjs.d.ts +8 -0
- package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +9 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +14 -2
- package/dist/types/lib/stores/explorer-actions.d.ts +7 -10
- package/dist/types/lib/types/common-types.d.ts +1 -2
- package/dist/types/lib/types/semantic-types.d.ts +6 -10
- package/dist/types/lib/utils/card-config-utils.d.ts +13 -0
- package/dist/types/lib/utils/field-placement.d.ts +17 -0
- package/dist/types/lib/utils/field-state-calculator.d.ts +7 -19
- package/dist/types/shared/analytics-protocol/analytics-refusal.d.ts +21 -1
- package/dist/types/shared/analytics-protocol/field-provenance.d.ts +7 -4
- package/dist/types/shared/dashboard-authoring/calculations/definition.d.ts +13 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-base.d.ts +125 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-field-folders.d.ts +55 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-joins.d.ts +114 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-prune.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-catalog.d.ts +60 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-folders.d.ts +180 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/index.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/join-reach.d.ts +42 -0
- package/dist/types/shared/dashboard-authoring/card-field-places.d.ts +28 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +2 -8
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/column-display-values.d.ts +5 -0
- package/dist/types/shared/dashboard-authoring/card-settings/column-display.d.ts +52 -0
- package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +9 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +4 -0
- package/dist/types/shared/dashboard-authoring/card-settings/table-viewer-switches.d.ts +15 -0
- package/dist/types/shared/dashboard-authoring/card-settings/views.d.ts +5 -0
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +6 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +132 -3
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +3 -1
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
- package/dist/types/shared/dashboard-authoring/conditional-formatting/store.d.ts +10 -1
- package/dist/types/shared/dashboard-authoring/field-aggregations.d.ts +9 -2
- package/dist/types/shared/dashboard-authoring/field-folders/field-folders.d.ts +116 -0
- package/dist/types/shared/dashboard-authoring/field-folders/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/filter-reach-decision.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +7 -1
- package/dist/types/shared/dashboard-authoring/operations/card-operations.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +7 -2
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +6 -2
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +7 -22
- package/dist/types/shared/dashboard-authoring/sheet-kinds.d.ts +36 -0
- package/dist/types/shared/dashboard-authoring/table-sheet-shape.d.ts +140 -0
- package/dist/types/shared/dashboard-viewer/table-column-move.d.ts +15 -0
- package/dist/types/shared/dashboard-viewer/table-settings.d.ts +8 -2
- package/dist/types/shared/format-utils/types/format-types.d.ts +1 -1
- package/dist/usage-events/index.js +1 -285
- package/dist/value-format-preferences/index.js +1 -635
- package/package.json +5 -2
- package/dist/chunks/add-to-dashboard-CFF-wFU-.js +0 -291
- package/dist/chunks/analytics-base-schemas-DsUh5Q3C.js +0 -680
- package/dist/chunks/appearance-context-BwBp25ZG.js +0 -162
- package/dist/chunks/appearance-runtime-provider-BRHYELkC.js +0 -80
- package/dist/chunks/applied-constraints-DU-wndZ7.js +0 -47
- package/dist/chunks/assistant-chat-B6hNQI1t.js +0 -6115
- package/dist/chunks/attribution-BvoKvhcj.js +0 -32
- package/dist/chunks/availability-Bp5Gfu1I.js +0 -44
- package/dist/chunks/bookmark-impact-Ba2PLcGp.js +0 -76
- package/dist/chunks/bookmark-state-n7AaNzR_.js +0 -1667
- package/dist/chunks/brand-BoUV0iHF.js +0 -54
- package/dist/chunks/card-filter-builder-Y22HizVx.js +0 -4069
- package/dist/chunks/column-bands-RdM-kjDe.js +0 -47
- package/dist/chunks/comparison-window-caption-Ck2TIbnR.js +0 -741
- package/dist/chunks/context-UCQ7sere.js +0 -369
- package/dist/chunks/conversation-sQiWYUOb.js +0 -16
- package/dist/chunks/dashboard-BghI99oY.js +0 -14
- package/dist/chunks/dashboard-briefing-launcher-DtBAnGiH.js +0 -4875
- package/dist/chunks/dashboard-controls-CtFXlyjV.js +0 -2290
- package/dist/chunks/dashboard-json-DfGBUtCd.js +0 -66
- package/dist/chunks/dates-BnrXF4bb.js +0 -185
- package/dist/chunks/edit-9df1zOWe.js +0 -226
- package/dist/chunks/edit-dashboard-visual-oxt3x1wb.js +0 -18397
- package/dist/chunks/export-file-format-C-tJsxsf.js +0 -111
- package/dist/chunks/filter-line-Cy5YYqRL.js +0 -703
- package/dist/chunks/filter-reach-copy-CE_ZX147.js +0 -5111
- package/dist/chunks/filter-value-text-fWvSDwkl.js +0 -153
- package/dist/chunks/index-BVKzKl5d.js +0 -90
- package/dist/chunks/index-CV_Kzou0.js +0 -595
- package/dist/chunks/index-D5rxbtS4.js +0 -2795
- package/dist/chunks/layout-grid-9LndRoLa.js +0 -16
- package/dist/chunks/matrix-analytical-definition-CCp48UCw.js +0 -1233
- package/dist/chunks/matrix-member-presentation-zNehruXR.js +0 -391
- package/dist/chunks/matrix-operation-contract-DPBj69D8.js +0 -1413
- package/dist/chunks/metric-comparison-B0FR-Q8I.js +0 -600
- package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +0 -119
- package/dist/chunks/paintbrush-58FQYY-y.js +0 -27
- package/dist/chunks/palette-Be62Tkoa.js +0 -23
- package/dist/chunks/pickers-DkqmtnTL.js +0 -2403
- package/dist/chunks/pivot-result-contract-expectations-BYqAmG9n.js +0 -5092
- package/dist/chunks/pivot-result-identity-CAP4--iq.js +0 -77
- package/dist/chunks/raw-temporal-value-Dg_MTFF7.js +0 -3778
- package/dist/chunks/rendered-file-D8xEuVVx.js +0 -108
- package/dist/chunks/report-preferences-dialog-uJp9GBTM.js +0 -1651
- package/dist/chunks/report-runtime-context-c77_KF9v.js +0 -388
- package/dist/chunks/resolve-dashboard-input-context-Rtl1ffmE.js +0 -25324
- package/dist/chunks/resolver-DG_tfEpt.js +0 -156
- package/dist/chunks/save-C5A0JnEV.js +0 -21
- package/dist/chunks/saved-dashboard-context-tcyTU8jm.js +0 -618
- package/dist/chunks/schema-C9NPiIru.js +0 -2568
- package/dist/chunks/selection-filter-compiler-DNijjI5y.js +0 -150
- package/dist/chunks/semaphor-ready-indicator-FBvunj6S.js +0 -145603
- package/dist/chunks/shelf-drop-preview-context-QKStrcK9.js +0 -2466
- package/dist/chunks/stored-dashboard-CHozcAY9.js +0 -4075
- package/dist/chunks/style-sheet-parts-CDCG-8Ej.js +0 -8681
- package/dist/chunks/table-export-sheet-ZFIvs6Sj.js +0 -949
- package/dist/chunks/token-types-XbM6QByy.js +0 -8
- package/dist/chunks/upload-H15d7uHK.js +0 -15
- package/dist/chunks/validators-Baf3VIf5.js +0 -3686
- package/dist/chunks/variable-draft-C2y8Jp6Z.js +0 -242
- package/dist/chunks/visual-choice-DDfHfHvY.js +0 -172
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { TCard } from '../types/common-types.js';
|
|
2
|
+
import { ShapeGrain } from '../../shared/dashboard-authoring/table-sheet-shape.js';
|
|
3
|
+
import { TableColumnEdit, TableView } from './table-view.js';
|
|
4
|
+
/**
|
|
5
|
+
* Pin, Unpin, Move left and Move right in a table column's header menu (table
|
|
6
|
+
* sheets spec M5). Who acts decides where it goes: a viewer's edit goes to
|
|
7
|
+
* their own table settings (`computeTableColumnEdit`), an author's to the
|
|
8
|
+
* card through the one writers (`writeTableColumnPinned`,
|
|
9
|
+
* `writeTableColumnOrder`), so the editor, a Table sheet's panel and the MCP
|
|
10
|
+
* store the same card. Pure.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* A drag that carries a table column's field (its id on the card) onto a
|
|
14
|
+
* Table sheet's Group rows by or Columns across (Rohit, 2026-11-15;
|
|
15
|
+
* TS-P6-I4). A Columns panel row carries it; a header doesn't, since a
|
|
16
|
+
* Table sheet's headers reorder from their menu. The drop runs the same
|
|
17
|
+
* shape move as the header menu.
|
|
18
|
+
*/
|
|
19
|
+
export declare const SHAPE_FIELD_DRAG_TYPE = "application/x-table-shape-field";
|
|
20
|
+
export type ColumnHeaderActor =
|
|
21
|
+
/** A viewer, with the card's customization on (TS-D17). */
|
|
22
|
+
{
|
|
23
|
+
kind: 'viewer';
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The card editor, or a Table sheet's authoring session. `shapes` on a Table
|
|
27
|
+
* sheet's table (TS-D30): Group rows by, Spread across and Remove, with the
|
|
28
|
+
* date fields (by id) that group and spread at a grain; Column settings and,
|
|
29
|
+
* for the number fields (by id), Highlight cells (TS-D35).
|
|
30
|
+
*/
|
|
31
|
+
| {
|
|
32
|
+
kind: 'author';
|
|
33
|
+
shapes?: ColumnShapes;
|
|
34
|
+
} | {
|
|
35
|
+
kind: 'none';
|
|
36
|
+
};
|
|
37
|
+
export type ColumnHeaderAction = {
|
|
38
|
+
type: 'pin';
|
|
39
|
+
} | {
|
|
40
|
+
type: 'unpin';
|
|
41
|
+
} | {
|
|
42
|
+
type: 'step';
|
|
43
|
+
direction: 'left' | 'right';
|
|
44
|
+
} | {
|
|
45
|
+
type: 'hide';
|
|
46
|
+
}
|
|
47
|
+
/** Group rows by this column, a date at a grain (TS-D30, TS-D33); the sheet's session does it. */
|
|
48
|
+
| {
|
|
49
|
+
type: 'group';
|
|
50
|
+
grain?: ShapeGrain;
|
|
51
|
+
}
|
|
52
|
+
/** Spread this column's values across columns (TS-D33); the sheet's session does it. */
|
|
53
|
+
| {
|
|
54
|
+
type: 'spread';
|
|
55
|
+
grain?: ShapeGrain;
|
|
56
|
+
}
|
|
57
|
+
/** Take the column out of the query, not only out of sight (TS-D34); the sheet's session does it. */
|
|
58
|
+
| {
|
|
59
|
+
type: 'remove';
|
|
60
|
+
}
|
|
61
|
+
/** The column's field settings, the card editor's own, under its header (TS-D35). */
|
|
62
|
+
| {
|
|
63
|
+
type: 'settings';
|
|
64
|
+
}
|
|
65
|
+
/** The column's highlight rules, the card editor's conditional formatting for this column (TS-D35). */
|
|
66
|
+
| {
|
|
67
|
+
type: 'highlight';
|
|
68
|
+
};
|
|
69
|
+
/** The grains a date groups or spreads at on a Table sheet: never by day (TS-D33). */
|
|
70
|
+
export type { ShapeGrain };
|
|
71
|
+
/**
|
|
72
|
+
* What a Table sheet author's header menu offers for its columns, from the
|
|
73
|
+
* shape owner: how each column groups and spreads (`shapeFieldGrains`), and
|
|
74
|
+
* which can be highlighted (`shapeNumberFieldIds`).
|
|
75
|
+
*/
|
|
76
|
+
export type ColumnShapes = {
|
|
77
|
+
readonly grains: ReadonlyMap<string, readonly (ShapeGrain | undefined)[]>;
|
|
78
|
+
readonly numberFieldIds?: ReadonlySet<string>;
|
|
79
|
+
};
|
|
80
|
+
type Listed = {
|
|
81
|
+
action: ColumnHeaderAction;
|
|
82
|
+
enabled: boolean;
|
|
83
|
+
};
|
|
84
|
+
/** The actions this column's menu shows, each enabled or not (an edge, an unpinnable column). */
|
|
85
|
+
export declare function listColumnHeaderActions(view: TableView, outputKey: string, actor: ColumnHeaderActor): readonly Listed[];
|
|
86
|
+
/** The card field a Table sheet's Group, Spread or Remove acts on: a dimension's field id, or a measure's id. */
|
|
87
|
+
export declare function shapeFieldId(view: TableView, outputKey: string): string | undefined;
|
|
88
|
+
/** The viewer's edit for the action; undefined when it changes nothing. */
|
|
89
|
+
export declare function columnHeaderEdit(view: TableView, outputKey: string, action: ColumnHeaderAction): TableColumnEdit | undefined;
|
|
90
|
+
/** The author's card after the action: their pins, or their column order over the field order. */
|
|
91
|
+
export declare function applyColumnHeaderAction<T extends Pick<TCard, 'preferences'>>(card: T, view: TableView, outputKey: string, action: ColumnHeaderAction): T;
|
|
92
|
+
/**
|
|
93
|
+
* An author's edit from a Table sheet's Columns panel (TS-D23, TS-D24): the
|
|
94
|
+
* panel the viewer edits their own settings with, writing the author's card
|
|
95
|
+
* instead, through the one writers: order (`writeTableColumnOrder`), hidden
|
|
96
|
+
* for everyone (`writeTableColumnSettings`), the header (`planCardLabels`)
|
|
97
|
+
* and pins (`writeTableColumnPinned`). Sort, width and Reset are a viewer's;
|
|
98
|
+
* the card itself comes back for them.
|
|
99
|
+
*/
|
|
100
|
+
export declare function applyAuthorColumnEdit(card: TCard, view: TableView, edit: TableColumnEdit): TCard;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ViewerTableSettings } from '../../shared/dashboard-viewer/table-settings.js';
|
|
2
|
-
import { TableColumnMoveResult } from '../../shared/dashboard-viewer/table-column-move.js';
|
|
3
2
|
import { TableColumnEdit, TableView } from './table-view.js';
|
|
4
3
|
export type TableColumnEditResult = {
|
|
5
4
|
readonly settings: ViewerTableSettings | undefined;
|
|
@@ -13,29 +12,3 @@ export type TableColumnEditResult = {
|
|
|
13
12
|
* for columns this result does not show (a drill can hide them) are kept.
|
|
14
13
|
*/
|
|
15
14
|
export declare function computeTableColumnEdit(view: TableView, edit: TableColumnEdit, stored?: ViewerTableSettings | undefined): TableColumnEditResult;
|
|
16
|
-
/**
|
|
17
|
-
* Where a header drop lands, as the table draws it (table column order
|
|
18
|
-
* TCO-D8, ledger P2-01): a measure's comparison column has no place of its
|
|
19
|
-
* own, so a drop on it, or after the measure, lands after the measure's last
|
|
20
|
-
* comparison column. Any other drop lands where it was made.
|
|
21
|
-
*/
|
|
22
|
-
export declare function resolveHeaderDropTarget(view: TableView, target: {
|
|
23
|
-
readonly outputKey: string;
|
|
24
|
-
readonly side: 'before' | 'after';
|
|
25
|
-
}): {
|
|
26
|
-
outputKey: string;
|
|
27
|
-
side: 'before' | 'after';
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* The author's header drag (table column order TCO-D7, TCO-D9): the column
|
|
31
|
-
* dragged by its header and the header it lands on, by output key, as the
|
|
32
|
-
* move rule decides it over the author's arrangement. Only a movable column
|
|
33
|
-
* moves. It lands on another movable column, or after a measure by way of
|
|
34
|
-
* the measure's comparison column (TCO-D8). The editor stores a successful
|
|
35
|
-
* move with `writeTableColumnOrder` against `view.author.fieldOrder`.
|
|
36
|
-
*/
|
|
37
|
-
export declare function resolveHeaderColumnMove(view: TableView, drag: {
|
|
38
|
-
readonly outputKey: string;
|
|
39
|
-
readonly targetOutputKey: string;
|
|
40
|
-
readonly side: 'before' | 'after';
|
|
41
|
-
}): TableColumnMoveResult;
|
|
@@ -3,6 +3,7 @@ import { CardConfig, DetailField, GroupByField, MetricField, QueryColumnKeyMap }
|
|
|
3
3
|
import { ComparisonMetadataMap } from '../types/query-types.js';
|
|
4
4
|
import { SemaphorResultColumn } from '../../shared/analytics-protocol/index.js';
|
|
5
5
|
import { TableColumnId, ViewerTableSettings } from '../../shared/dashboard-viewer/table-settings.js';
|
|
6
|
+
import { TableColumnPlacement } from '../../shared/dashboard-viewer/table-column-move.js';
|
|
6
7
|
export type TableResultShape = {
|
|
7
8
|
/** Output keys present in the result rows, in transport order. */
|
|
8
9
|
readonly keys: readonly string[];
|
|
@@ -31,6 +32,12 @@ export type TableViewInput = {
|
|
|
31
32
|
readonly settings?: ViewerTableSettings;
|
|
32
33
|
/** Default `screen`. */
|
|
33
34
|
readonly projection?: TableViewProjection;
|
|
35
|
+
/**
|
|
36
|
+
* Who the panel is for. Default `viewer`. An author's panel (a Table sheet's
|
|
37
|
+
* Columns, TS-D24) is offered whatever the viewers' switch says: the switch
|
|
38
|
+
* says what viewers may change, not the author.
|
|
39
|
+
*/
|
|
40
|
+
readonly audience?: 'viewer' | 'author';
|
|
34
41
|
};
|
|
35
42
|
export type TableViewColumn = {
|
|
36
43
|
readonly outputKey: string;
|
|
@@ -52,6 +59,10 @@ export type TableViewColumn = {
|
|
|
52
59
|
* another column in its area. Comparison columns move with their measure.
|
|
53
60
|
*/
|
|
54
61
|
readonly movable: boolean;
|
|
62
|
+
/** Held at the left edge on screen (table sheets PIN-1); a comparison column with its measure. */
|
|
63
|
+
readonly pinned: boolean;
|
|
64
|
+
/** Can be pinned (PIN-2): an addressable base column; in a pivoted table, a row dimension only. */
|
|
65
|
+
readonly pinnable: boolean;
|
|
55
66
|
};
|
|
56
67
|
/** A base column with an id: the columns a viewer's sort and widths address. */
|
|
57
68
|
export declare function isAddressableBaseColumn(column: Pick<TableViewColumn, 'part' | 'columnId'>): column is Pick<TableViewColumn, 'part'> & {
|
|
@@ -124,19 +135,32 @@ export type TableView = {
|
|
|
124
135
|
readonly author: {
|
|
125
136
|
readonly order: readonly TableColumnId[];
|
|
126
137
|
readonly fieldOrder: readonly TableColumnId[];
|
|
138
|
+
/** The author's pins this result can show (PIN-1): a viewer's equal to these are not stored. */
|
|
139
|
+
readonly pinned: readonly TableColumnId[];
|
|
127
140
|
};
|
|
128
141
|
/** Pivot rule A applies to moves (TCO-D6): see `isPivotedTableCard`. */
|
|
129
142
|
readonly pivoted: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* The output keys held at the left edge, in view column order (PIN-3): what
|
|
145
|
+
* the table pins. Screen projection only; `[]` for export and print. Pins
|
|
146
|
+
* never reorder `columns` or `visibleKeys`.
|
|
147
|
+
*/
|
|
148
|
+
readonly pinnedKeys: readonly string[];
|
|
130
149
|
};
|
|
131
150
|
export type TableColumnEdit = {
|
|
132
151
|
readonly type: 'hide' | 'show';
|
|
133
152
|
readonly columnId: TableColumnId;
|
|
134
153
|
}
|
|
135
|
-
/** `
|
|
154
|
+
/** To a placement, as the one move rule takes it (`{ before: null }`: the end). */
|
|
136
155
|
| {
|
|
137
156
|
readonly type: 'move';
|
|
138
157
|
readonly columnId: TableColumnId;
|
|
139
|
-
readonly
|
|
158
|
+
readonly to: TableColumnPlacement;
|
|
159
|
+
}
|
|
160
|
+
/** Held at the left edge, or let go (table sheets PIN-1). */
|
|
161
|
+
| {
|
|
162
|
+
readonly type: 'pin' | 'unpin';
|
|
163
|
+
readonly columnId: TableColumnId;
|
|
140
164
|
}
|
|
141
165
|
/** An empty name or the author's label clears the rename. */
|
|
142
166
|
| {
|
|
@@ -28,6 +28,8 @@ export declare function useTableView(card: TCard, result: TableResultShape | und
|
|
|
28
28
|
*/
|
|
29
29
|
export type ViewerDataTable = ExportViewerTable & {
|
|
30
30
|
readonly view?: TableView;
|
|
31
|
+
/** A viewer's column edit from the table itself (its header menu: pin, move): into their settings, never the dashboard. */
|
|
32
|
+
readonly edit?: (edit: TableColumnEdit) => void;
|
|
31
33
|
};
|
|
32
34
|
/**
|
|
33
35
|
* The sizing props a viewer's table takes (`TableVisual`'s controlled
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { TFilter } from '../../components/surfboard/filter/types.js';
|
|
2
|
+
import { DataSource, Field } from '../types/explorer-types.js';
|
|
3
|
+
export type CardFilterDefinition = Pick<TFilter, 'column' | 'title' | 'dataType' | 'nativeDataType' | 'qualifiedTableName' | 'connectionId' | 'operation' | 'sql' | 'fieldMeta' | 'semanticContext'> & {
|
|
4
|
+
table: string;
|
|
5
|
+
database: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The source a card's filters are built against: its data source and its
|
|
9
|
+
* connection, read in one order for every caller (the card filter builder's
|
|
10
|
+
* value browse, a pinned filter, a column filter). The editor's picked
|
|
11
|
+
* connection leads, then the data source's, then the card's own, since a card
|
|
12
|
+
* may store its connection only at card level.
|
|
13
|
+
*/
|
|
14
|
+
export declare function cardFilterSource(card: {
|
|
15
|
+
dataSource?: DataSource | null;
|
|
16
|
+
connectionId?: string;
|
|
17
|
+
}, selectedConnectionId?: string): {
|
|
18
|
+
dataSource?: DataSource | null;
|
|
19
|
+
connectionId?: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* The one mapping from an explorer `Field` on a card to the filter
|
|
23
|
+
* definition the filter-values route understands.
|
|
24
|
+
*
|
|
25
|
+
* Used for card inline filters and for browsing values inside the card
|
|
26
|
+
* filter builder, so both read the same catalog coordinates (semantic
|
|
27
|
+
* context, field metadata, qualified table) for the same field.
|
|
28
|
+
*/
|
|
29
|
+
export declare function buildCardFilterDefinition(field: Field, source: {
|
|
30
|
+
dataSource?: DataSource | null;
|
|
31
|
+
connectionId?: string;
|
|
32
|
+
}): CardFilterDefinition;
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { TFrame } from '../types/common-types.js';
|
|
2
|
+
import { DatabaseEntityReference } from '../types/explorer-types.js';
|
|
2
3
|
export declare function useAddNewFrame(): {
|
|
3
4
|
handleAddNewFrame: (options?: {
|
|
4
5
|
openVisualEditor?: boolean;
|
|
5
6
|
sheetId?: string;
|
|
6
7
|
}) => Promise<TFrame | undefined>;
|
|
8
|
+
handleAddTableSheet: (input: {
|
|
9
|
+
title: string;
|
|
10
|
+
source?: DatabaseEntityReference;
|
|
11
|
+
}) => string | undefined;
|
|
12
|
+
/** The source a new card starts on unless one is picked: the dialog's first check (TS-D25). */
|
|
13
|
+
newCardSource: DatabaseEntityReference | undefined;
|
|
7
14
|
canAddFrame: boolean;
|
|
8
15
|
};
|
|
@@ -5,6 +5,8 @@ export declare function useCard(cardId: string): {
|
|
|
5
5
|
card: TCard;
|
|
6
6
|
isPending: boolean;
|
|
7
7
|
isError: boolean;
|
|
8
|
+
/** The query's error, for an author's error surface (a Table sheet, TS-D23). */
|
|
9
|
+
errorMessage: string;
|
|
8
10
|
isLoading: boolean;
|
|
9
11
|
isFetching: boolean;
|
|
10
12
|
fetchStatus: import('@tanstack/query-core').FetchStatus;
|
|
@@ -26,6 +28,8 @@ export declare function useCard(cardId: string): {
|
|
|
26
28
|
export declare function useDashboardCard(card: TCard): {
|
|
27
29
|
isPending: boolean;
|
|
28
30
|
isError: boolean;
|
|
31
|
+
/** The query's error, for an author's error surface (a Table sheet, TS-D23). */
|
|
32
|
+
errorMessage: string;
|
|
29
33
|
isLoading: boolean;
|
|
30
34
|
isFetching: boolean;
|
|
31
35
|
fetchStatus: import('@tanstack/query-core').FetchStatus;
|
|
@@ -18,6 +18,14 @@ export interface ClickContextResult {
|
|
|
18
18
|
resultColumnKey?: string;
|
|
19
19
|
/** What the click site offers for See records; a menu opened from this context shows it. */
|
|
20
20
|
seeRecords?: SeeRecordsOffer;
|
|
21
|
+
/**
|
|
22
|
+
* A table cell's text and its row's, for Copy value and Copy row: a right-click
|
|
23
|
+
* on a cell opens the card's menu with them first (table style TS-D19).
|
|
24
|
+
*/
|
|
25
|
+
copy?: {
|
|
26
|
+
value: string;
|
|
27
|
+
row?: string;
|
|
28
|
+
};
|
|
21
29
|
}
|
|
22
30
|
export declare function getClickContextFromChartJs({ resolvedCardConfig, card, records, chart, clickEvent, columnKeyMap, resultColumns, valueFormatPreferences, }: {
|
|
23
31
|
resolvedCardConfig: CardConfig;
|
|
@@ -187,6 +187,15 @@ export type DashboardFilterCardReach =
|
|
|
187
187
|
| 'relationship'
|
|
188
188
|
/** A server-side resolver confirmed the route the card will apply (RF-D15). */
|
|
189
189
|
| 'relationshipApplied' | 'notApplicable';
|
|
190
|
+
/** The reaches a reader counts as reaching the card: bound, the card's own field, a SQL card's plain helper, a confirmed route. */
|
|
191
|
+
export type DashboardFilterCardReached = 'bound' | 'automatic' | 'sql' | 'relationshipApplied';
|
|
192
|
+
/**
|
|
193
|
+
* Whether a reach is one a reader counts as reaching the card: the one rule
|
|
194
|
+
* the MCP outline, the filter pickers and an agent's pinned filter read
|
|
195
|
+
* (dashboard filter fields DF-D2). `relationship` (decided when the card runs)
|
|
196
|
+
* and `sqlTemplate` (decided by the card's SQL) are never counted.
|
|
197
|
+
*/
|
|
198
|
+
export declare function isFilterCardReached(reach: DashboardFilterCardReach): reach is DashboardFilterCardReached;
|
|
190
199
|
/**
|
|
191
200
|
* Why a filter in scope doesn't reach a card: a relationship resolver's
|
|
192
201
|
* reason, or `sql_no_filter_reference` for a SQL card whose SQL names no
|
|
@@ -84,6 +84,14 @@ export type UndoProposalResult = {
|
|
|
84
84
|
reason: 'changed_since' | 'not_found' | 'not_editable';
|
|
85
85
|
};
|
|
86
86
|
/** Arrange from the toolbar (responsive layouts SPEC §6.4, RL-D13). */
|
|
87
|
+
/** 'editor': the card editor's Accept. 'sheet': a Table sheet's authoring session (TS-D6). */
|
|
88
|
+
export type FrameCommitOrigin = 'editor' | 'sheet';
|
|
89
|
+
export type AddFrameResult = {
|
|
90
|
+
ok: true;
|
|
91
|
+
} | {
|
|
92
|
+
ok: false;
|
|
93
|
+
reason: string;
|
|
94
|
+
};
|
|
87
95
|
export type ArrangeSheetResult = {
|
|
88
96
|
ok: true;
|
|
89
97
|
} | {
|
|
@@ -399,7 +407,8 @@ type Actions = {
|
|
|
399
407
|
setDashboardDescription: (description: string) => void;
|
|
400
408
|
setDashboardExportDefaults: (exportDefaults: TDashboard['exportDefaults']) => void;
|
|
401
409
|
setSheets: (sheets: TSheet[]) => void;
|
|
402
|
-
|
|
410
|
+
/** Adds a sheet through the reducer; false when it refuses (a Table sheet without its frame). */
|
|
411
|
+
addSheet: (sheet: TSheet) => boolean;
|
|
403
412
|
duplicateSheet: (sheetId: string) => string | null;
|
|
404
413
|
deleteSheet: (sheetId: string) => void;
|
|
405
414
|
setSheetTitle: (sheetId: string, title: string) => void;
|
|
@@ -476,9 +485,12 @@ type Actions = {
|
|
|
476
485
|
clearAllInlineFilterValues: () => void;
|
|
477
486
|
setInlineFilterValuesMap: (map: Record<string, TFilterValue[]>) => void;
|
|
478
487
|
setCardInlineFilterDefaultValues: (sheetId: string, cardId: string, filterId: string, defaultValues: (string | number)[] | undefined) => void;
|
|
479
|
-
|
|
488
|
+
/** Adds a card's frame through the reducer; a refusal (a Document or a Table sheet) says why. */
|
|
489
|
+
addFrame: (sheetId: string, frame: TFrame, options?: AddFrameOptions) => AddFrameResult;
|
|
480
490
|
updateFrame: (sheetId: string, frame: TFrame, options?: {
|
|
481
491
|
semanticExecutionPayload?: SemanticExecutionPayload;
|
|
492
|
+
/** Where the commit comes from; without one it is a plain frame write that refuses quietly. */
|
|
493
|
+
origin?: FrameCommitOrigin;
|
|
482
494
|
}) => void;
|
|
483
495
|
updateDashboardCalculatedFields: (calculatedFields: Field[]) => void;
|
|
484
496
|
/** Whether the field changes a Document section card's edit made would apply with that card committed; asked before writing it. */
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import { CardConfig, DataSource, GroupByField, MetricField, FilterGroup,
|
|
1
|
+
import { CardConfig, DataSource, GroupByField, MetricField, FilterGroup, PivotByField, SortByField } from '../types/explorer-types.js';
|
|
2
2
|
import { TCard, TFrame } from '../types/common-types.js';
|
|
3
3
|
import { EditorStore } from './editor-store.js';
|
|
4
|
+
import { ReachedDatasetInfo } from '../../shared/dashboard-authoring/card-data-source/card-base.js';
|
|
5
|
+
/** A config write's context: the domain's datasets, when the writer has them (ledger P9-04). */
|
|
6
|
+
export type CardWriteOptions = {
|
|
7
|
+
datasets?: readonly ReachedDatasetInfo[];
|
|
8
|
+
};
|
|
4
9
|
export interface ExplorerActions {
|
|
5
10
|
updateFrame: (updates: Partial<TFrame>) => void;
|
|
6
11
|
setActiveCardInFrame: (cardId: string) => void;
|
|
7
12
|
addCard: () => void;
|
|
8
13
|
removeCard: (cardId: string) => void;
|
|
9
|
-
updateCard: (cardId: string, updates: Partial<TCard
|
|
14
|
+
updateCard: (cardId: string, updates: Partial<TCard>, options?: CardWriteOptions) => void;
|
|
10
15
|
setActiveCard: (cardId: string) => void;
|
|
11
16
|
setActiveTabCard: (cardId: string | null) => void;
|
|
12
17
|
updateDataSource: (dataSource: DataSource) => void;
|
|
@@ -24,22 +29,14 @@ export interface ExplorerActions {
|
|
|
24
29
|
updateCardConfig: (cardId: string, config: Partial<CardConfig>) => void;
|
|
25
30
|
updateRowLimit: (cardId: string, rowLimit: number) => void;
|
|
26
31
|
addGroupByColumn: (cardId: string, column: GroupByField) => void;
|
|
27
|
-
removeGroupByColumn: (cardId: string, columnId: string) => void;
|
|
28
32
|
updateGroupByColumn: (cardId: string, columnId: string, updates: Partial<GroupByField>) => void;
|
|
29
33
|
addMetricColumn: (cardId: string, column: MetricField) => void;
|
|
30
|
-
removeMetricColumn: (cardId: string, columnId: string) => void;
|
|
31
34
|
updateMetricColumn: (cardId: string, columnId: string, updates: Partial<MetricField>) => void;
|
|
32
35
|
addPivotByColumn: (cardId: string, column: PivotByField) => void;
|
|
33
|
-
removePivotByColumn: (cardId: string, columnId: string) => void;
|
|
34
36
|
updatePivotByColumn: (cardId: string, columnId: string, updates: Partial<PivotByField>) => void;
|
|
35
37
|
addSortByColumn: (cardId: string, column: SortByField) => void;
|
|
36
|
-
removeSortByColumn: (cardId: string, columnId: string) => void;
|
|
37
38
|
updateSortByColumn: (cardId: string, columnId: string, updates: Partial<SortByField>) => void;
|
|
38
39
|
updateFilters: (cardId: string, filters: FilterGroup) => void;
|
|
39
40
|
clearFilters: (cardId: string) => void;
|
|
40
|
-
addJoin: (cardId: string, join: Join) => void;
|
|
41
|
-
removeJoin: (cardId: string, joinId: string) => void;
|
|
42
|
-
updateJoin: (cardId: string, joinId: string, updates: Partial<Join>) => void;
|
|
43
|
-
reorderJoins: (cardId: string, joinIds: string[]) => void;
|
|
44
41
|
}
|
|
45
42
|
export declare const createExplorerActions: (set: (fn: (draft: EditorStore) => void) => void, get: () => EditorStore) => ExplorerActions;
|
|
@@ -1543,7 +1543,6 @@ export type DocumentTableSection = {
|
|
|
1543
1543
|
totalsRow?: boolean;
|
|
1544
1544
|
columnFormatting?: Record<string, unknown>;
|
|
1545
1545
|
repeatHeaderOnPageBreak?: boolean;
|
|
1546
|
-
rowHeightPx?: number;
|
|
1547
1546
|
/** Print nothing, and take no space, while the result is empty (Plan 2). */
|
|
1548
1547
|
hideWhenEmpty?: boolean;
|
|
1549
1548
|
/** Matrix sections only: how the Document prints the Matrix (Plan 2). */
|
|
@@ -1612,7 +1611,7 @@ export type DocumentDefinition = {
|
|
|
1612
1611
|
};
|
|
1613
1612
|
export type TSheet = {
|
|
1614
1613
|
id: string;
|
|
1615
|
-
kind?: 'dashboard' | 'document';
|
|
1614
|
+
kind?: 'dashboard' | 'document' | 'table';
|
|
1616
1615
|
title?: string;
|
|
1617
1616
|
description?: string;
|
|
1618
1617
|
layout?: ReactGridLayout.Layout[];
|
|
@@ -1,13 +1,4 @@
|
|
|
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
|
-
*/
|
|
1
|
+
import { JoinReachMap } from '../../shared/dashboard-authoring/card-data-source/join-reach.js';
|
|
11
2
|
/**
|
|
12
3
|
* Joinability map for a semantic domain
|
|
13
4
|
*
|
|
@@ -72,6 +63,11 @@ export interface JoinabilityMap {
|
|
|
72
63
|
export interface JoinabilityMapResponse {
|
|
73
64
|
/** Lightweight joinability map for field state calculation */
|
|
74
65
|
joinabilityMap: JoinabilityMap;
|
|
66
|
+
/**
|
|
67
|
+
* Per dataset, the datasets a card based on it reaches and the keys each
|
|
68
|
+
* step joins on, as the query would join them (one base per card OB-D15).
|
|
69
|
+
*/
|
|
70
|
+
reach: JoinReachMap;
|
|
75
71
|
/** Minimal dataset information */
|
|
76
72
|
datasets: Array<{
|
|
77
73
|
name: string;
|
|
@@ -59,6 +59,19 @@ export declare function convertMatrixRepresentation(card: TCard, nextType: TCard
|
|
|
59
59
|
createId?: () => string): MatrixRepresentationChange;
|
|
60
60
|
/** The switch reads the catalog only when it has something to carry. */
|
|
61
61
|
export declare function matrixSwitchNeedsCatalog(card: TCard, nextType: TCard['type']): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Each shelf field that carries goes through the drop a drag uses, in shelf
|
|
64
|
+
* order, keeping its aggregate and date grain. The Matrix catalog is the
|
|
65
|
+
* carried fields themselves, as for a drop with no loaded source list.
|
|
66
|
+
*/
|
|
67
|
+
/**
|
|
68
|
+
* A count of rows (`COUNT(*)`): no catalog field, so a type change carries it
|
|
69
|
+
* by name, as the query contract reads it (the flat builder's generated
|
|
70
|
+
* count, the Matrix binding's `resolveCountStar`).
|
|
71
|
+
*/
|
|
72
|
+
export declare const isRowCountField: (field: Pick<Field, "name"> & {
|
|
73
|
+
aggregate?: string;
|
|
74
|
+
}) => boolean;
|
|
62
75
|
/** Replacing the base dataset starts a new definition; metadata refresh does not. */
|
|
63
76
|
export declare function withAuthoredCardDataSource(card: TCard, dataSource: DataSource): Partial<TCard>;
|
|
64
77
|
export declare function getAuthoredCardJoinPlan(card: Pick<TCard, 'type' | 'config'>): JoinPlan | undefined;
|
|
@@ -70,6 +70,12 @@ export type FieldPlacementContext = {
|
|
|
70
70
|
matrixCatalog: MatrixCardCatalog;
|
|
71
71
|
/** A string exactly when `needsNewFieldId` is true. */
|
|
72
72
|
newFieldId: string | null;
|
|
73
|
+
/**
|
|
74
|
+
* The folder a field from a related dataset sits in, as the field list
|
|
75
|
+
* names it ("Organization"); undefined for the card's own dataset. A new
|
|
76
|
+
* column from there is named after it (`relatedColumnLabel`).
|
|
77
|
+
*/
|
|
78
|
+
relatedFolderLabel?: (field: Field) => string | undefined;
|
|
73
79
|
};
|
|
74
80
|
/** Reserved id for standard-card previews. Never matches a minted id and never reaches the store. */
|
|
75
81
|
export declare const PLACEMENT_PREVIEW_FIELD_ID = "__placement-preview__";
|
|
@@ -89,6 +95,17 @@ export declare function needsNewFieldId(cardType: TCard['type'] | undefined, pla
|
|
|
89
95
|
* shelf identity resolved and a label defaulted from the name.
|
|
90
96
|
*/
|
|
91
97
|
export declare function readStandardShelf(config: CardConfig | undefined, zone: ContainerId): Field[];
|
|
98
|
+
/**
|
|
99
|
+
* Take placements off their shelves: the one rule for removing a field from
|
|
100
|
+
* a standard card, for the editor's shelves and a Table sheet alike (Astra 3).
|
|
101
|
+
* Each placement leaves its shelf (by its index there); a removed field's
|
|
102
|
+
* sorts leave with it unless another placement of the same field stays (a
|
|
103
|
+
* detail table may hold one field twice, DT-D4; review R2-02). Pure.
|
|
104
|
+
*/
|
|
105
|
+
export declare function withoutShelfPlacements(config: CardConfig, removals: ReadonlyArray<{
|
|
106
|
+
zone: ShelfZone;
|
|
107
|
+
index: number;
|
|
108
|
+
}>): CardConfig;
|
|
92
109
|
export declare function evaluateStandardPlacement(card: TCard, placement: FieldPlacement, context: FieldPlacementContext): FieldPlacementOutcome;
|
|
93
110
|
/** The one evaluation. Dispatches on card type. Side-effect-free. */
|
|
94
111
|
export declare function evaluateFieldPlacement(card: TCard, placement: FieldPlacement, context: FieldPlacementContext): FieldPlacementOutcome;
|
|
@@ -5,6 +5,7 @@ import { resolveFieldDatasetDependencies, FieldDatasetDependency } from './field
|
|
|
5
5
|
import { getQualifiedEntityName } from './qualified-entity-name.js';
|
|
6
6
|
export interface DatasetIdentityAlias {
|
|
7
7
|
name: string;
|
|
8
|
+
label?: string | null;
|
|
8
9
|
table?: string | null;
|
|
9
10
|
catalog?: string | null;
|
|
10
11
|
schema?: string | null;
|
|
@@ -90,7 +91,12 @@ export interface FieldStateContext {
|
|
|
90
91
|
selectedFields: Field[];
|
|
91
92
|
joinPlan?: JoinPlan;
|
|
92
93
|
autoJoinMetadata?: AutoJoinMetadata;
|
|
93
|
-
|
|
94
|
+
/**
|
|
95
|
+
* The card's base (`cardBaseEntity`), read through the same identity as
|
|
96
|
+
* every other dataset here: a direct table by its qualified name, a domain
|
|
97
|
+
* dataset by its name (ledger P9-02, P9-07).
|
|
98
|
+
*/
|
|
99
|
+
baseEntity?: DatasetAnchorRef;
|
|
94
100
|
datasetAliases?: DatasetIdentityAlias[];
|
|
95
101
|
/**
|
|
96
102
|
* Whether the card reads from a semantic domain. Drives the fallback when
|
|
@@ -140,22 +146,4 @@ export declare function getFieldStateCopy(state: FieldDraggableState | undefined
|
|
|
140
146
|
* dataset
|
|
141
147
|
*/
|
|
142
148
|
export declare function calculateFieldState(field: Field, context: FieldStateContext): FieldStateResult;
|
|
143
|
-
/** One data-source dataset's connection to the visual's base, for the Datasets panel. */
|
|
144
|
-
export interface DataSourceConnection {
|
|
145
|
-
/** Dataset identity (name in semantic mode, qualified table in physical). */
|
|
146
|
-
entityName: string;
|
|
147
|
-
label: string;
|
|
148
|
-
state: FieldDraggableState;
|
|
149
|
-
reason?: string;
|
|
150
|
-
action?: string;
|
|
151
|
-
mentions?: string[];
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* How each selected dataset connects to the visual's base dataset, using
|
|
155
|
-
* the same identity, base cascade, and per-dataset evaluation as the field
|
|
156
|
-
* list. The Datasets panel shows this at selection time so the customer
|
|
157
|
-
* learns about an unconnected dataset before the first drag. Order and
|
|
158
|
-
* verdicts match `calculateFieldState` for a field of that dataset.
|
|
159
|
-
*/
|
|
160
|
-
export declare function describeDataSourceConnections(context: FieldStateContext): DataSourceConnection[];
|
|
161
149
|
export { resolveFieldDatasetDependencies, type FieldDatasetDependency };
|
|
@@ -29,4 +29,24 @@ export declare function analyticsRefusal(code: AnalyticsRefusalCode, message: st
|
|
|
29
29
|
}): AnalyticsRefusal;
|
|
30
30
|
/** Reads a refusal carried on a value (an error, a result, a response). */
|
|
31
31
|
export declare function readAnalyticsRefusal(value: unknown): AnalyticsRefusal | undefined;
|
|
32
|
-
|
|
32
|
+
/**
|
|
33
|
+
* What an `unsafe_join` refusal is about, in the model's own words (labels,
|
|
34
|
+
* never dataset names or SQL), so the copy can name the measure and the fix
|
|
35
|
+
* (Rohit, 2026-11-15). The planner attaches it as `details.subject`.
|
|
36
|
+
*/
|
|
37
|
+
export type UnsafeJoinSubject = {
|
|
38
|
+
/** The measure as the card names it ("Count of Name"). */
|
|
39
|
+
measure: string;
|
|
40
|
+
aggregate?: string;
|
|
41
|
+
/** The dataset the measure counts or adds up ("Organizations"). */
|
|
42
|
+
measureDataset: string;
|
|
43
|
+
/** The dataset the query is based on ("Dashboard Requests"). */
|
|
44
|
+
baseDataset: string;
|
|
45
|
+
};
|
|
46
|
+
export declare function readUnsafeJoinSubject(details: Record<string, unknown> | undefined): UnsafeJoinSubject | undefined;
|
|
47
|
+
/** The one wording of a measure that would count related rows more than once, for every surface. */
|
|
48
|
+
export declare function unsafeJoinCopy(subject: UnsafeJoinSubject): {
|
|
49
|
+
message: string;
|
|
50
|
+
nextStep: string;
|
|
51
|
+
};
|
|
52
|
+
export declare function publicAnalyticsRefusal(refusal: Pick<AnalyticsRefusal, 'code'> & Partial<Pick<AnalyticsRefusal, 'status' | 'retryable' | 'details'>>): AnalyticsRefusal;
|
|
@@ -28,11 +28,14 @@ export type LabelProvenance = {
|
|
|
28
28
|
};
|
|
29
29
|
/**
|
|
30
30
|
* The aggregate a measure gets when nobody chooses one, the one rule the
|
|
31
|
-
* editor (a field dropped on the measures),
|
|
32
|
-
* reader share: the semantic model's,
|
|
33
|
-
* known) and
|
|
31
|
+
* editor (a field dropped on the measures), a Table sheet, an agent's card
|
|
32
|
+
* change, the governed compiler and every reader share: the semantic model's,
|
|
33
|
+
* else SUM for a number (or a type not known) and the count of distinct values
|
|
34
|
+
* for anything else (Rohit, 2026-11-15: "how many statuses" is 3, not 10,000;
|
|
35
|
+
* it is also the only count that stays right across a join). A count of rows
|
|
36
|
+
* is asked for as such (`__count`, `COUNT(*)`).
|
|
34
37
|
*/
|
|
35
|
-
export declare function defaultMetricAggregate<A extends string>(semanticAggregate: A | undefined, dataType?: string): A | 'SUM' | '
|
|
38
|
+
export declare function defaultMetricAggregate<A extends string>(semanticAggregate: A | undefined, dataType?: string): A | 'SUM' | 'DISTINCT';
|
|
36
39
|
/**
|
|
37
40
|
* The compiler's record of a measure's aggregate: the aggregate it runs, and
|
|
38
41
|
* whether that is the default or an override. Asking for SUM on a SUM measure
|
|
@@ -127,3 +127,16 @@ export declare function dashboardFieldFromCompiled(input: {
|
|
|
127
127
|
description?: string;
|
|
128
128
|
id: string;
|
|
129
129
|
}): MetricField | GroupByField;
|
|
130
|
+
/** The semantic domain a dashboard calculated field's inputs read, when they name one. */
|
|
131
|
+
export declare function calculatedFieldDomainId(field: Field): string | undefined;
|
|
132
|
+
/**
|
|
133
|
+
* The one domain dataset a calculated field reads, when it reads exactly one:
|
|
134
|
+
* its inputs' dataset and their semantic domain (source identity is domain
|
|
135
|
+
* plus dataset). The MCP outline lists a dashboard calculation by it, and the
|
|
136
|
+
* filter pickers put the field in that dataset's folder (dashboard filter
|
|
137
|
+
* fields, review P6-04). Undefined for a field over several datasets or none.
|
|
138
|
+
*/
|
|
139
|
+
export declare function calculatedFieldSemanticSource(field: Field): {
|
|
140
|
+
domainId: string;
|
|
141
|
+
datasetName: string;
|
|
142
|
+
} | undefined;
|