react-semaphor 0.1.544 → 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.
- package/dist/analytics-protocol/index.js +405 -441
- package/dist/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +100 -76
- package/dist/brand-studio/index.js +5 -5
- package/dist/briefings/index.js +55 -52
- package/dist/chunks/{class-utils-Df1OVOT1.js → _commonjsHelpers-DimLPMtv.js} +124 -98
- package/dist/chunks/{add-to-dashboard-BuAqfA2Y.js → add-to-dashboard-BQRAAnc3.js} +55 -33
- package/dist/chunks/{analytics-base-schemas-BFAoRlkU.js → analytics-base-schemas-BKs3flFS.js} +2 -2
- package/dist/chunks/{assistant-chat-BNLkCDml.js → assistant-chat-BPXhulAx.js} +2792 -2562
- package/dist/chunks/{bookmark-state-CXw7lZ50.js → bookmark-state-C4vetoa0.js} +7 -8
- package/dist/chunks/column-catalog-BYnochWQ.js +3363 -0
- package/dist/chunks/comparison-window-caption-C2xF-eWw.js +1433 -0
- package/dist/chunks/{context-ClREvqCZ.js → context-BerEBuFR.js} +11 -6
- package/dist/chunks/custom-visual-inputs-CkJW9pBS.js +295 -0
- package/dist/chunks/{dashboard-g5a4DKWq.js → dashboard-C3CoKbGY.js} +1 -1
- package/dist/chunks/dashboard-briefing-launcher-Be4h-7My.js +3734 -0
- package/dist/chunks/dashboard-controls-bxPrlSyp.js +2307 -0
- package/dist/chunks/{dashboard-json-7qT9jmfL.js → dashboard-json-BrjxIiRt.js} +6 -6
- package/dist/chunks/document-dashboard-inputs-CRVHpIHp.js +3010 -0
- package/dist/chunks/{edit-dashboard-visual-BfJwnRIZ.js → edit-dashboard-visual-DYYYDjY6.js} +5986 -6063
- package/dist/chunks/{filter-value-text-CYsVYPuD.js → filter-value-text-Ddf55Ku1.js} +8 -8
- package/dist/chunks/global-date-filter-utils-9d6m9-FE.js +11859 -0
- package/dist/chunks/index-CtoK1Lgu.js +586 -0
- package/dist/chunks/{index-DkAyQvC6.js → index-DkQkMKa1.js} +385 -339
- package/dist/chunks/list-filter-DsaTbM3J.js +15 -0
- package/dist/chunks/matrix-analytical-definition-B9vW-osb.js +717 -0
- package/dist/chunks/{matrix-card-DjwWcCo8.js → matrix-card-LiMEipvq.js} +3 -3
- package/dist/chunks/{matrix-formatter-CxJLkztA.js → matrix-formatter-DWEeC0_c.js} +55 -55
- package/dist/chunks/{matrix-member-presentation-CQGdVks6.js → matrix-member-presentation-DqzG-UhQ.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-8OIO4gob.js → matrix-operation-contract-D6vYkZK4.js} +72 -72
- package/dist/chunks/{metric-comparison-DEwi9uc2.js → metric-comparison-zpGw4lD6.js} +2 -2
- package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +119 -0
- package/dist/chunks/{pivot-header-presentation-DHcx1XGQ.js → pivot-header-presentation-CQnIDtUv.js} +1 -1
- package/dist/chunks/{pivot-result-identity-DJhXXcns.js → pivot-result-identity-C-Q1j1Wb.js} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-DM4CyGKs.js → pivot-result-lifecycle-pwq3b7LC.js} +571 -380
- package/dist/chunks/{raw-temporal-contract-C51YG48G.js → raw-temporal-contract-WuXA8jBP.js} +1 -1
- package/dist/chunks/{raw-temporal-presentation-CLiVi90c.js → raw-temporal-presentation-CBzrDOjM.js} +8 -8
- package/dist/chunks/rendered-file-D8xEuVVx.js +108 -0
- package/dist/chunks/{report-preferences-dialog-Df7VpRVW.js → report-preferences-dialog-4QEZWe5U.js} +637 -610
- package/dist/chunks/{report-runtime-context-Dq8XyODK.js → report-runtime-context-hWiTCzFV.js} +2 -2
- package/dist/chunks/resolve-dashboard-input-context-UpK_LBpL.js +5677 -0
- package/dist/chunks/{saved-dashboard-context-B-mQ--nV.js → saved-dashboard-context-D_I3Lxk0.js} +184 -212
- package/dist/chunks/selection-filter-compiler-BKXmyLrS.js +79 -0
- package/dist/chunks/{selection-reducer-Dj_8xD69.js → selection-reducer-CJzkTZio.js} +15 -15
- package/dist/chunks/{semaphor-ready-indicator-DDAxk8us.js → semaphor-ready-indicator-4zpRHE-X.js} +56832 -59068
- package/dist/chunks/{shelf-drop-preview-context-BSRPwaED.js → shelf-drop-preview-context-Cfw7TRAx.js} +890 -871
- package/dist/chunks/{source-entity-resolution-BYn9giz3.js → source-entity-resolution-BIGRvtbG.js} +13 -13
- package/dist/chunks/{switch-C3jLxlG0.js → switch-CEBOR4n7.js} +47 -48
- package/dist/chunks/{table-export-sheet-CPfGAQ9X.js → table-export-sheet-4X9mAG3V.js} +1 -1
- package/dist/chunks/table-settings-CunhoDUi.js +605 -0
- package/dist/chunks/{temporal-bucket-D7NBrrtL.js → temporal-bucket-CQOSbv9-.js} +26 -26
- package/dist/chunks/{token-types-DBbZVQsm.js → token-types-BMqRmT-C.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-BxzFviM-.js → use-create-flow-overlay-state-DZBZiiD-.js} +83 -83
- package/dist/chunks/{validators-DMHTpf7a.js → validators-C-aOQlTB.js} +713 -658
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +1800 -1135
- package/dist/data-app-sdk/index.js +6 -6
- package/dist/data-app-sdk-adapters/index.js +3 -3
- package/dist/data-app-sdk-validation/index.js +14 -14
- package/dist/format-utils/index.js +198 -187
- package/dist/index.js +359 -325
- package/dist/layouts/index.js +5 -242
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/shared/index.js +4 -5
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
- package/dist/types/briefings/attachments.d.ts +33 -6
- package/dist/types/briefings/index.d.ts +6 -5
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/surfboard/arrange-layout-button.d.ts +8 -0
- package/dist/types/components/surfboard/filter/types.d.ts +0 -14
- package/dist/types/components/surfboard/screen-size-preview-button.d.ts +7 -0
- package/dist/types/index.js +6 -6
- package/dist/types/lib/charts/table-chart-types.d.ts +4 -0
- package/dist/types/lib/charts/types.d.ts +2 -2
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +68 -82
- package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +0 -8
- package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +41 -1
- package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +201 -0
- package/dist/types/lib/dashboard-inputs/prepare-loaded-dashboard.d.ts +15 -0
- package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +7 -2
- package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +1 -1
- package/dist/types/lib/dashboard-viewer/captured-runtime-values.d.ts +40 -0
- package/dist/types/lib/dashboard-viewer/compatibility-input-storage.d.ts +16 -16
- package/dist/types/lib/dashboard-viewer/viewer-state.d.ts +11 -9
- package/dist/types/lib/download-pdf.d.ts +75 -1
- package/dist/types/lib/hooks/use-date-filter.d.ts +5 -0
- package/dist/types/lib/hooks/use-text-filter.d.ts +5 -0
- package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +5 -4
- package/dist/types/lib/matrix-table/matrix-editor.d.ts +52 -0
- package/dist/types/lib/query-context/assemble-card-query.d.ts +158 -0
- package/dist/types/lib/query-context/build-card-query-context.d.ts +3 -3
- package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +15 -6
- package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +11 -13
- package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +22 -12
- package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +69 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +159 -56
- package/dist/types/lib/stores/editor-store.d.ts +0 -3
- package/dist/types/lib/types/common-types.d.ts +29 -6
- package/dist/types/lib/types/explorer-types.d.ts +10 -0
- package/dist/types/lib/types/semantic-types.d.ts +84 -0
- package/dist/types/lib/utils/build-saved-editor-card.d.ts +20 -0
- package/dist/types/lib/utils/card-type-change.d.ts +16 -0
- package/dist/types/lib/utils/field-availability-context.d.ts +25 -0
- package/dist/types/lib/utils/field-placement.d.ts +96 -0
- package/dist/types/lib/utils/field-state-calculator.d.ts +161 -0
- package/dist/types/lib/utils/qualified-entity-name.d.ts +2 -0
- package/dist/types/shared/analytics-protocol/field-provenance.d.ts +89 -0
- package/dist/types/shared/analytics-protocol/index.d.ts +2 -0
- package/dist/types/shared/analytics-protocol/query-policies.d.ts +52 -0
- package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/time-window.d.ts +40 -1
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +8 -12
- package/dist/types/shared/assistant-protocol/answer-text.d.ts +20 -0
- package/dist/types/shared/assistant-protocol/context.d.ts +21 -21
- package/dist/types/shared/assistant-protocol/index.d.ts +1 -0
- package/dist/types/shared/assistant-protocol/limits.d.ts +6 -1
- package/dist/types/shared/assistant-protocol/parts.d.ts +43 -3
- package/dist/types/shared/assistant-protocol/request.d.ts +14 -2
- package/dist/types/shared/dashboard-authoring/calculated-field-identity.d.ts +3 -0
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +487 -0
- package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +34 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +7886 -0
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +43 -0
- package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +54 -0
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +89 -0
- package/dist/types/shared/dashboard-authoring/column-catalog.d.ts +32 -0
- package/dist/types/shared/dashboard-authoring/contracts.d.ts +0 -55
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +16 -6
- package/dist/types/shared/dashboard-authoring/dashboard-card-source-index.d.ts +9 -1
- package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +118 -0
- package/dist/types/shared/dashboard-authoring/filter-applicability.d.ts +75 -0
- package/dist/types/shared/dashboard-authoring/filter-model/ad-hoc-filter-values.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/filter-model/filter-definitions.d.ts +29 -0
- package/dist/types/shared/dashboard-authoring/filter-model/filter-values.d.ts +58 -0
- package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/filter-model/prototype-document-inputs.d.ts +15 -0
- package/dist/types/shared/dashboard-authoring/filter-model/read-dashboard-filter-model.d.ts +78 -0
- package/dist/types/shared/dashboard-authoring/filter-model/stored-dashboard.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/filter-model/toolbar-filter-reach.d.ts +23 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +20 -2
- package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +10 -37
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +189 -0
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +94 -0
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +78 -0
- package/dist/types/shared/dashboard-authoring/validators.d.ts +1 -2
- package/dist/types/shared/format-utils/exporters/index.d.ts +2 -0
- package/dist/types/shared/format-utils/exporters/rendered-file.d.ts +106 -0
- package/dist/types/shared/layouts/engine/grid.d.ts +25 -0
- package/dist/types/shared/layouts/engine/index.d.ts +4 -0
- package/dist/types/shared/layouts/engine/sheet-layout.d.ts +7 -0
- package/dist/types/shared/layouts/engine/types.d.ts +125 -0
- package/dist/types/shared/layouts/index.d.ts +1 -2
- package/package.json +2 -2
- package/dist/chunks/_commonjsHelpers-BkfeUUK-.js +0 -28
- package/dist/chunks/apply-dashboard-operations-Bz4n1Lq6.js +0 -2260
- package/dist/chunks/calendar-day-equality-BmJAWduY.js +0 -460
- package/dist/chunks/comparison-window-caption-BTkrN3W4.js +0 -1623
- package/dist/chunks/custom-visual-inputs-DUtpYZOk.js +0 -323
- package/dist/chunks/dashboard-briefing-launcher-DQ_8O_e2.js +0 -3725
- package/dist/chunks/dashboard-controls-8RyBTQUO.js +0 -2315
- package/dist/chunks/dashboard-filter-value-compatibility-CwQ_iSNb.js +0 -108
- package/dist/chunks/document-dashboard-inputs-BC6p-ESg.js +0 -8087
- package/dist/chunks/document-sheet-utils-Duo9uLoH.js +0 -3619
- package/dist/chunks/matrix-analytical-definition-C7Gb0e12.js +0 -117
- package/dist/chunks/normalize-dashboard-for-dirty-check-Bk3VYv_q.js +0 -67
- package/dist/chunks/numeric-presentation-DESvLiu9.js +0 -5227
- package/dist/chunks/sort-target-MT1WK1vX.js +0 -29
- package/dist/chunks/stable-serialize-CfqXeiBP.js +0 -6
- package/dist/chunks/table-settings-CLZocegs.js +0 -501
- package/dist/chunks/use-debounced-dirty-check-BwAbnX_5.js +0 -59
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +0 -88
- package/dist/types/lib/dashboard-inputs/dashboard-input-scope.d.ts +0 -10
- package/dist/types/shared/dashboard-authoring/change-compiler.d.ts +0 -7
- package/dist/types/shared/dashboard-authoring/layout-compiler.d.ts +0 -2
- package/dist/types/shared/layouts/create-frame-layouts.d.ts +0 -27
- package/dist/types/shared/layouts/frame-layouts.d.ts +0 -23
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { TFilter, TFilterValue } from '../../../components/surfboard/filter/types.js';
|
|
2
|
+
import { DashboardInputValues, NormalizedFilterDashboardInput, TDashboard } from '../../../lib/types/common-types.js';
|
|
3
|
+
import { CalendarContext } from '../../report-runtime-context/index.js';
|
|
4
|
+
import { DashboardInputRuntimeTarget } from '../../../lib/dashboard-inputs/dashboard-input-values.js';
|
|
5
|
+
import { DashboardInputRuntimeValues } from '../../../lib/dashboard-inputs/resolve-dashboard-input-context.js';
|
|
6
|
+
/**
|
|
7
|
+
* M5, the filter value adapters (one filter model SPEC 4.7): they move values
|
|
8
|
+
* between the old filter value list, keyed by `filterId`, and input slots.
|
|
9
|
+
* They decide no precedence.
|
|
10
|
+
*/
|
|
11
|
+
/** A host filter default: a full filter value, or the short `{ filterId, values }` embed form. */
|
|
12
|
+
export type HostFilterValue = TFilterValue | {
|
|
13
|
+
readonly filterId: string;
|
|
14
|
+
readonly values: string[] | number[];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* A host value as a filter value of this definition (today's hydration rule).
|
|
18
|
+
* The short embed form names no operation: it takes the filter's own, so the
|
|
19
|
+
* slot passes the input's validation (ledger P4a-03).
|
|
20
|
+
*/
|
|
21
|
+
export declare function hostFilterValueFor(filter: TFilter, hostValue: HostFilterValue, calendar: CalendarContext | null | undefined): TFilterValue;
|
|
22
|
+
/**
|
|
23
|
+
* Host overlay in: each value goes to the input owning its `filterId`, as a
|
|
24
|
+
* runtime slot over saved defaults. A `shared` input gets one slot; a
|
|
25
|
+
* `perSheet` input gets one on every tab the input is on (a host default is
|
|
26
|
+
* dashboard-wide, as today). A value whose `filterId` owns no input, or
|
|
27
|
+
* whose input holds one value per card or section, is dropped and listed.
|
|
28
|
+
* The values that own no input are also returned as they were listed: the
|
|
29
|
+
* caller decides whether they are ad-hoc values (SPEC 5.8, 5.9).
|
|
30
|
+
*/
|
|
31
|
+
export declare function hostFilterValuesToSlots(dashboard: TDashboard, values: readonly HostFilterValue[] | undefined, options: {
|
|
32
|
+
calendar: CalendarContext | null | undefined;
|
|
33
|
+
}): {
|
|
34
|
+
slots: DashboardInputValues;
|
|
35
|
+
adHocFilterValues: TFilterValue[];
|
|
36
|
+
droppedFilterIds: string[];
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* List out, tab-wide: each filter shown on this tab with its effective value
|
|
40
|
+
* (the inputs the tab-presence rule places on it, in model order, each
|
|
41
|
+
* through the hydration owner), followed by the tab's ad-hoc values. Inputs
|
|
42
|
+
* with no value, or cleared, are left out. Used by `onFilterValuesChange`,
|
|
43
|
+
* captures and every reader that reports a tab's filters.
|
|
44
|
+
*/
|
|
45
|
+
export declare function readFilterValueList(params: {
|
|
46
|
+
dashboard: TDashboard;
|
|
47
|
+
runtimeValues: Pick<DashboardInputRuntimeValues, 'dashboardInputValues'>;
|
|
48
|
+
adHocFilterValues: readonly TFilterValue[] | undefined;
|
|
49
|
+
sheetId: string | null | undefined;
|
|
50
|
+
sheetKind: 'dashboard' | 'document';
|
|
51
|
+
calendar: CalendarContext | null;
|
|
52
|
+
}): TFilterValue[];
|
|
53
|
+
/**
|
|
54
|
+
* Every runtime target a filter input holds a value at: one for a `shared`
|
|
55
|
+
* input, each tab it is on for `perSheet`, each card it reaches for
|
|
56
|
+
* `perCard`, each section it reaches for `perDocumentSection`.
|
|
57
|
+
*/
|
|
58
|
+
export declare function listFilterInputValueTargets(dashboard: TDashboard, input: NormalizedFilterDashboardInput): DashboardInputRuntimeTarget[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './read-dashboard-filter-model.js';
|
|
2
|
+
export * from './toolbar-filter-reach.js';
|
|
3
|
+
export { foldPrototypeDocumentInputs } from './prototype-document-inputs.js';
|
|
4
|
+
export * from './filter-values.js';
|
|
5
|
+
export * from './filter-definitions.js';
|
|
6
|
+
export * from './ad-hoc-filter-values.js';
|
|
7
|
+
export { upgradeToStoredDashboard } from './stored-dashboard.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DashboardInput, DocumentInputDefinition, TDashboard } from '../../../lib/types/common-types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The prototype Document input fold (one filter model SPEC 4.3 step 3), moved
|
|
4
|
+
* unchanged from `document-input-prototype-normalizer.ts`: inputs stored in
|
|
5
|
+
* `sheet.document.inputs` (the earliest Document shape) become Dashboard
|
|
6
|
+
* Inputs scoped to their tab, with variable names and control ids aligned as
|
|
7
|
+
* before. Returns the input dashboard when nothing changes.
|
|
8
|
+
*/
|
|
9
|
+
export declare function foldPrototypeDocumentInputs(dashboard: TDashboard): TDashboard;
|
|
10
|
+
/** The ids of the prototype Document inputs the fold would add (not already stored). */
|
|
11
|
+
export declare function listUnfoldedPrototypeDocumentInputs(dashboard: Pick<TDashboard, 'inputs' | 'sheets'>): Array<{
|
|
12
|
+
sheetId: string;
|
|
13
|
+
input: DocumentInputDefinition;
|
|
14
|
+
}>;
|
|
15
|
+
export declare function prototypeDocumentInputToDashboardInput(input: DocumentInputDefinition, sheetId: string): DashboardInput;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { TFilter } from '../../../components/surfboard/filter/types.js';
|
|
2
|
+
import { DashboardInputScope, DashboardInputValues, EmbeddedFilterDashboardInput, NormalizedFilterDashboardInput, TDashboard } from '../../../lib/types/common-types.js';
|
|
3
|
+
import { DashboardFilterMappingContractIssue } from '../dashboard-filter-mapping-contract.js';
|
|
4
|
+
import { DashboardCardLocation } from '../document-section-cards.js';
|
|
5
|
+
/**
|
|
6
|
+
* The filter model (one filter model M1): every stored filter shape read as a
|
|
7
|
+
* filter input. One entry point, `readDashboardFilterModel`, used by the
|
|
8
|
+
* client runtime and by the server alike. Pure, never throws, memoized per
|
|
9
|
+
* dashboard object.
|
|
10
|
+
*/
|
|
11
|
+
/** A filter, by its filter id or by an input id (a legacy `compat-filter:` id included). */
|
|
12
|
+
export type FilterRef = {
|
|
13
|
+
filterId: string;
|
|
14
|
+
} | {
|
|
15
|
+
inputId: string;
|
|
16
|
+
};
|
|
17
|
+
export type FilterInputOrigin = 'embeddedInput' | 'referencedInput' | 'prototypeDocumentInput' | 'toolbarFilter';
|
|
18
|
+
export type FilterInputEntry = {
|
|
19
|
+
/** What the runtime consumes; see the runtime view in SPEC 4.3. */
|
|
20
|
+
input: NormalizedFilterDashboardInput;
|
|
21
|
+
origin: FilterInputOrigin;
|
|
22
|
+
};
|
|
23
|
+
/** The shared card location plus its tab kind. */
|
|
24
|
+
export type ReachedCard = DashboardCardLocation & {
|
|
25
|
+
sheetKind: 'dashboard' | 'document';
|
|
26
|
+
};
|
|
27
|
+
export type FilterModelIssueCode = 'contract' | 'duplicate_filter_owner' | 'compat_id_conflict' | 'duplicate_global_date';
|
|
28
|
+
export type FilterModelIssue = {
|
|
29
|
+
code: FilterModelIssueCode;
|
|
30
|
+
/** A customer-safe sentence, in the style of the template validator's messages. */
|
|
31
|
+
message: string;
|
|
32
|
+
/** JSON path in the template that was read. */
|
|
33
|
+
path: string;
|
|
34
|
+
inputId?: string;
|
|
35
|
+
filterId?: string;
|
|
36
|
+
contractIssue?: DashboardFilterMappingContractIssue;
|
|
37
|
+
};
|
|
38
|
+
export type DashboardFilterModel = {
|
|
39
|
+
/** Accepted filter inputs: stored inputs in stored order, then prototype Document inputs, then toolbar filters. */
|
|
40
|
+
readonly inputs: readonly FilterInputEntry[];
|
|
41
|
+
readonly issues: readonly FilterModelIssue[];
|
|
42
|
+
/** Ids of stored inputs left out because of an issue. */
|
|
43
|
+
readonly rejectedInputIds: ReadonlySet<string>;
|
|
44
|
+
readonly globalDateInput: FilterInputEntry | undefined;
|
|
45
|
+
/** True when `toStoredDashboard()` would change anything. */
|
|
46
|
+
readonly needsUpgrade: boolean;
|
|
47
|
+
/** The saved defaults the runtime reads: stored `defaultInputValues` with owned `defaultFilterValues` entries moved in. */
|
|
48
|
+
readonly defaultInputValues: DashboardInputValues;
|
|
49
|
+
/**
|
|
50
|
+
* The variable name today's lift gives every toolbar filter, owned ones
|
|
51
|
+
* included, in filter order. Inputs named after toolbar filters (dashboard
|
|
52
|
+
* control compatibility inputs) are named against these, so their aliases
|
|
53
|
+
* stay what they are today (OF-INV-3).
|
|
54
|
+
*/
|
|
55
|
+
readonly toolbarFilterVariableNames: readonly string[];
|
|
56
|
+
/** The owning entry. `{ inputId: 'compat-filter:x' }` resolves to the entry holding filter x, whatever its id. */
|
|
57
|
+
findFilterInput(ref: FilterRef): FilterInputEntry | undefined;
|
|
58
|
+
/** Card locations in dashboard order the input reaches (`options.scope` instead of its own when given). */
|
|
59
|
+
reachedCards(ref: FilterRef, options?: {
|
|
60
|
+
scope?: DashboardInputScope;
|
|
61
|
+
}): readonly ReachedCard[];
|
|
62
|
+
/** The template with every filter as an embedded input. The same object when `needsUpgrade` is false. Throws `FilterModelError` when `issues` is not empty. */
|
|
63
|
+
toStoredDashboard(): TDashboard;
|
|
64
|
+
};
|
|
65
|
+
export declare class FilterModelError extends Error {
|
|
66
|
+
readonly issues: readonly FilterModelIssue[];
|
|
67
|
+
constructor(issues: readonly FilterModelIssue[]);
|
|
68
|
+
}
|
|
69
|
+
/** One message for a persistence error: each issue's `message`, joined by "\n". */
|
|
70
|
+
export declare function formatFilterModelIssues(issues: readonly FilterModelIssue[]): string;
|
|
71
|
+
export declare function readDashboardFilterModel(dashboard: TDashboard): DashboardFilterModel;
|
|
72
|
+
/**
|
|
73
|
+
* The input fields a toolbar filter's own fields give it (step 4), for a
|
|
74
|
+
* writer that creates or updates its input before Phase 5. The variable name
|
|
75
|
+
* is not among them: it depends on the dashboard's other inputs (use the
|
|
76
|
+
* model's entry).
|
|
77
|
+
*/
|
|
78
|
+
export declare function toolbarFilterInputFields(dashboard: Pick<TDashboard, 'sheets'>, filter: TFilter): Pick<EmbeddedFilterDashboardInput, 'label' | 'scope' | 'presentation' | 'exports'>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TDashboard } from '../../../lib/types/common-types.js';
|
|
2
|
+
/**
|
|
3
|
+
* A template in the stored shape (one filter model SPEC 5.1, 5.4): every
|
|
4
|
+
* filter an embedded input. The one upgrade, for the load
|
|
5
|
+
* (`prepareLoadedDashboard`) and every template write (the app's
|
|
6
|
+
* `prepareDashboardDocument`).
|
|
7
|
+
*
|
|
8
|
+
* The old shape's toolbar list also reserved names that compatibility
|
|
9
|
+
* aliases (dashboard controls, card controls, card inline filters) were
|
|
10
|
+
* allocated around; without it those aliases can change (`region3` becomes
|
|
11
|
+
* `region2`). So alias-based text is first bound to stable input ids against
|
|
12
|
+
* the template as read, then the model writes the stored shape (OF-INV-3,
|
|
13
|
+
* ledger P5-11).
|
|
14
|
+
*
|
|
15
|
+
* The same object when nothing needs upgrading. Throws `FilterModelError`
|
|
16
|
+
* when the model reports issues, as `toStoredDashboard()` does.
|
|
17
|
+
*/
|
|
18
|
+
export declare function upgradeToStoredDashboard(dashboard: TDashboard): TDashboard;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TFilter } from '../../../components/surfboard/filter/types.js';
|
|
2
|
+
import { DashboardInputScope, TDashboard } from '../../../lib/types/common-types.js';
|
|
3
|
+
/**
|
|
4
|
+
* The reach conversion from a toolbar filter's own reach fields to a
|
|
5
|
+
* `DashboardInputScope` (one filter model SPEC 4.2), owned by the filter
|
|
6
|
+
* model. Since Phase 5 only the upgrade reads it: a stored filter has no
|
|
7
|
+
* reach fields, so nothing converts a scope back.
|
|
8
|
+
*/
|
|
9
|
+
/** The `TFilter` fields that store reach on the old shape. */
|
|
10
|
+
export declare const TOOLBAR_FILTER_REACH_FIELDS: readonly ["sheetId", "applyToSheetIds", "excludeSheetIds", "applyToCardIds", "excludeCardIds"];
|
|
11
|
+
export type ToolbarFilterReachField = (typeof TOOLBAR_FILTER_REACH_FIELDS)[number];
|
|
12
|
+
/** Today's `doesFilterApplyToSheet`: does the toolbar filter reach this tab? */
|
|
13
|
+
export declare function doesToolbarFilterReachTab(filter: TFilter, sheetId: string): boolean;
|
|
14
|
+
/** Whether a toolbar filter stores any reach field. */
|
|
15
|
+
export declare function hasToolbarFilterReachField(filter: TFilter): boolean;
|
|
16
|
+
/** The filter without its reach fields (S-3). The same object when it has none. */
|
|
17
|
+
export declare function withoutToolbarFilterReachFields(filter: TFilter): TFilter;
|
|
18
|
+
/**
|
|
19
|
+
* Toolbar filter reach to scope (SPEC 4.2): the first matching row wins; for
|
|
20
|
+
* arrays "set" means `!== undefined`, for `sheetId` truthy; every id kept names
|
|
21
|
+
* an existing tab or card. Tab reach is the regular tabs the filter reaches.
|
|
22
|
+
*/
|
|
23
|
+
export declare function toolbarFilterScope(filter: TFilter, dashboard: Pick<TDashboard, 'sheets'>): DashboardInputScope;
|
|
@@ -2,9 +2,7 @@ export * from './contracts.js';
|
|
|
2
2
|
export * from './comparison-document-migration.js';
|
|
3
3
|
export * from './source-matching.js';
|
|
4
4
|
export * from './validators.js';
|
|
5
|
-
export * from './layout-compiler.js';
|
|
6
5
|
export * from './artifact-compiler.js';
|
|
7
|
-
export * from './change-compiler.js';
|
|
8
6
|
export * from './protocol-adapter.js';
|
|
9
7
|
export * from './temporal-result-owner.js';
|
|
10
8
|
export * from './temporal-bucket-authoring.js';
|
|
@@ -16,6 +14,8 @@ export * from './dashboard-filter-automatic-target.js';
|
|
|
16
14
|
export * from './dashboard-filter-sql-subscription.js';
|
|
17
15
|
export * from './dashboard-filter-sql-target.js';
|
|
18
16
|
export * from './dashboard-filter-mapping-contract.js';
|
|
17
|
+
export * from './dashboard-input-scope.js';
|
|
18
|
+
export * from './filter-model/index.js';
|
|
19
19
|
export * from './dashboard-filter-value-compatibility.js';
|
|
20
20
|
export * from './card-reference-remapping.js';
|
|
21
21
|
export * from './apply-group-by-override.js';
|
|
@@ -37,3 +37,21 @@ export { matrixCatalogSources, matrixExecutionSources } from './matrix-control-s
|
|
|
37
37
|
export * from './dashboard-option-dependencies.js';
|
|
38
38
|
export * from './new-card.js';
|
|
39
39
|
export * from './operations/apply-dashboard-operations.js';
|
|
40
|
+
export * from './changes/card-types.js';
|
|
41
|
+
export * from './changes/diagnostics.js';
|
|
42
|
+
export * from './changes/card-query-part.js';
|
|
43
|
+
export * from './changes/read-card-query.js';
|
|
44
|
+
export * from './changes/dashboard-change.js';
|
|
45
|
+
export * from './changes/resolve-dashboard-changes.js';
|
|
46
|
+
export * from './outline/outline-filters.js';
|
|
47
|
+
export * from './outline/outline-dashboard.js';
|
|
48
|
+
export * from './column-catalog.js';
|
|
49
|
+
export { prepareLoadedDashboard } from '../../lib/dashboard-inputs/prepare-loaded-dashboard.js';
|
|
50
|
+
export { buildFilterInputFromField, buildFilterInputFromDefinition, applyFilterSettingsChange } from '../../lib/dashboard-inputs/filter-settings.js';
|
|
51
|
+
export type { FilterSettingsChange, FilterValueEffect } from '../../lib/dashboard-inputs/filter-settings.js';
|
|
52
|
+
export { describeDashboardFilterCardReach, type DashboardFilterCardReach } from '../../lib/query-context/dashboard-filter-mapping-resolution.js';
|
|
53
|
+
export { changeCardType, sharedCardPreferences, type CardTypeChange, type CardTypeChangeOptions, } from '../../lib/utils/card-type-change.js';
|
|
54
|
+
export { buildSavedEditorCard } from '../../lib/utils/build-saved-editor-card.js';
|
|
55
|
+
export { getCardDefinition, type AuthoredCardFields } from '../../lib/utils/card-definition.js';
|
|
56
|
+
export { changeMatrixEditor, dropMatrixEditorField, matrixEditorCatalogFromFields, } from '../../lib/matrix-table/matrix-editor.js';
|
|
57
|
+
export * from './filter-applicability.js';
|
|
@@ -1,40 +1,13 @@
|
|
|
1
|
-
import { TDashboard
|
|
1
|
+
import { TDashboard } from '../../../lib/types/common-types.js';
|
|
2
|
+
import { DashboardOperation, DashboardOperationResult, OperationContext } from './operation-types.js';
|
|
3
|
+
export type { CardUpdate, CreatedEntity, DashboardOperation, DashboardOperationResult, DashboardRuntimeEffect, FrameCommit, FramePlacement, OperationContext, OperationDescription, OperationFailureCode, } from './operation-types.js';
|
|
2
4
|
/**
|
|
3
5
|
* Edits to a dashboard as operations on one pure reducer (analytics agent
|
|
4
|
-
* Plan 1
|
|
5
|
-
*
|
|
6
|
-
* server
|
|
7
|
-
*
|
|
6
|
+
* Plan 1 AG-D14; MCP dashboard editing SPEC 3.3, 3.8). The one writer of the
|
|
7
|
+
* saved document for these edits: the editor stores, the change resolver's
|
|
8
|
+
* dry run and the server's apply all call it. It writes only the document; it
|
|
9
|
+
* returns what it created, one plain sentence per change, and the runtime
|
|
10
|
+
* effects a live editor applies to its own state (DE-D49). It never mints ids
|
|
11
|
+
* and never reads the clock (S-INV-1).
|
|
8
12
|
*/
|
|
9
|
-
|
|
10
|
-
export type DashboardFramePlacement = 'start' | 'end' | {
|
|
11
|
-
beside: string;
|
|
12
|
-
};
|
|
13
|
-
export type DashboardOperation = {
|
|
14
|
-
op: 'frame.add';
|
|
15
|
-
sheetId: string;
|
|
16
|
-
/** The frame with its cards, ids included. */
|
|
17
|
-
frame: TFrame;
|
|
18
|
-
/** Default `end`. */
|
|
19
|
-
placement?: DashboardFramePlacement;
|
|
20
|
-
};
|
|
21
|
-
export type DashboardOperationFailureCode = 'sheet_not_found'
|
|
22
|
-
/** A document sheet places cards through its document, not its grid. */
|
|
23
|
-
| 'sheet_not_a_grid' | 'frame_id_taken';
|
|
24
|
-
export type DashboardOperationResult = {
|
|
25
|
-
ok: true;
|
|
26
|
-
dashboard: TDashboard;
|
|
27
|
-
} | {
|
|
28
|
-
ok: false;
|
|
29
|
-
failedAt: {
|
|
30
|
-
index: number;
|
|
31
|
-
op: DashboardOperation['op'];
|
|
32
|
-
code: DashboardOperationFailureCode;
|
|
33
|
-
message: string;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* Applies the operations in order, all or nothing. Never changes its input:
|
|
38
|
-
* the result shares every sheet it did not touch.
|
|
39
|
-
*/
|
|
40
|
-
export declare function applyDashboardOperations(dashboard: TDashboard, operations: DashboardOperation[]): DashboardOperationResult;
|
|
13
|
+
export declare function applyDashboardOperations(dashboard: TDashboard, operations: readonly DashboardOperation[], context: OperationContext): DashboardOperationResult;
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { EmbeddedFilterDashboardInput, TDashboard, TFrame } from '../../../lib/types/common-types.js';
|
|
2
|
+
import { FilterSettingsChange, FilterValueEffect } from '../../../lib/dashboard-inputs/filter-settings.js';
|
|
3
|
+
import { DashboardFilterBoundCardApplication } from '../dashboard-filter-mapping-types.js';
|
|
4
|
+
import { Field } from '../../../lib/types/explorer-types.js';
|
|
5
|
+
import { TChartType } from '../../../lib/charts/types.js';
|
|
6
|
+
import { CalendarContext } from '../../report-runtime-context/index.js';
|
|
7
|
+
import { CardQueryPart, StatedLabel } from '../changes/card-query-part.js';
|
|
8
|
+
import { FramePlacement } from '../../layouts/index.js';
|
|
9
|
+
/**
|
|
10
|
+
* The resolved operations the dashboard reducer applies (MCP dashboard
|
|
11
|
+
* editing SPEC 3.3, 3.8). Every id an operation creates is in it; the reducer
|
|
12
|
+
* never generates ids and never reads the clock (S-INV-1).
|
|
13
|
+
*/
|
|
14
|
+
/** Where a new frame goes on its sheet, by intent (responsive layouts SPEC §2.4). Absent: placed by kind. */
|
|
15
|
+
export type { FramePlacement };
|
|
16
|
+
export type CardUpdate =
|
|
17
|
+
/** Inline title and description edits; `description: null` removes it. */
|
|
18
|
+
{
|
|
19
|
+
kind: 'rename';
|
|
20
|
+
title?: string;
|
|
21
|
+
description?: string | null;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A type transition: the editor's `changeCardType`, then the layout resize.
|
|
25
|
+
* `catalog` is the loaded column catalog a Matrix crossing needs; `newIds`
|
|
26
|
+
* every id the conversion mints, in the order it asks for them (DE-D54).
|
|
27
|
+
*/
|
|
28
|
+
| {
|
|
29
|
+
kind: 'retype';
|
|
30
|
+
type: TChartType;
|
|
31
|
+
catalog?: readonly Field[];
|
|
32
|
+
newIds: string[];
|
|
33
|
+
}
|
|
34
|
+
/** A new computed part for the card's current type; presentation is carried (SPEC 3.4). */
|
|
35
|
+
| {
|
|
36
|
+
kind: 'requery';
|
|
37
|
+
query: CardQueryPart;
|
|
38
|
+
}
|
|
39
|
+
/** Labels a change states on columns it doesn't rebuild, set in place by the label owner; nothing is recompiled (DE-D61). */
|
|
40
|
+
| {
|
|
41
|
+
kind: 'relabel';
|
|
42
|
+
labels: StatedLabel[];
|
|
43
|
+
};
|
|
44
|
+
/** Everything the editor's "Done", Save & Apply and Apply Local commit persists, as one operation (DE-D13). */
|
|
45
|
+
export type FrameCommit = {
|
|
46
|
+
sheetId: string;
|
|
47
|
+
/** The edited frame as the editor built it. Apply Local passes `visualId: undefined`. */
|
|
48
|
+
frame: TFrame;
|
|
49
|
+
/** Other frames on the sheet rewritten during the edit (calculated-field renames), applied with it. */
|
|
50
|
+
rewrittenFrames?: TFrame[];
|
|
51
|
+
/** Sheet calculated fields from the edited frame, persisted on the sheet. */
|
|
52
|
+
sheetCalculatedFields?: Field[];
|
|
53
|
+
/** Dashboard calculated fields rewritten during the edit. */
|
|
54
|
+
dashboardCalculatedFields?: Field[];
|
|
55
|
+
/** True when committed from the visual editor: resize the frame's layouts if its type changed. */
|
|
56
|
+
resizeLayouts: boolean;
|
|
57
|
+
};
|
|
58
|
+
export type DashboardOperation = ({
|
|
59
|
+
op: 'card.add';
|
|
60
|
+
sheetId: string;
|
|
61
|
+
/** The frame with its cards, ids included. */
|
|
62
|
+
frame: TFrame;
|
|
63
|
+
/** By intent; absent: placed by kind (responsive layouts SPEC §4.2). */
|
|
64
|
+
placement?: FramePlacement;
|
|
65
|
+
} | {
|
|
66
|
+
op: 'card.update';
|
|
67
|
+
cardId: string;
|
|
68
|
+
update: CardUpdate;
|
|
69
|
+
} | {
|
|
70
|
+
op: 'card.remove';
|
|
71
|
+
cardId: string;
|
|
72
|
+
}
|
|
73
|
+
/** Arrange a grid sheet by kind (responsive layouts RL-D7, SPEC §4.4); `keepOrder` keeps the reading order. */
|
|
74
|
+
| {
|
|
75
|
+
op: 'layout.arrange';
|
|
76
|
+
sheetId: string;
|
|
77
|
+
keepOrder?: boolean;
|
|
78
|
+
}
|
|
79
|
+
/** The editor's whole-frame commit; never produced by the resolver. */
|
|
80
|
+
| {
|
|
81
|
+
op: 'frame.commit';
|
|
82
|
+
commit: FrameCommit;
|
|
83
|
+
}
|
|
84
|
+
/** A new filter input, ids included; its defaults are in its definition, as the editor adds one. */
|
|
85
|
+
| {
|
|
86
|
+
op: 'filter.add';
|
|
87
|
+
input: EmbeddedFilterDashboardInput;
|
|
88
|
+
}
|
|
89
|
+
/** Settings through the editor's core (`applyFilterSettingsChange`); `filterId` is the input id. */
|
|
90
|
+
| {
|
|
91
|
+
op: 'filter.update';
|
|
92
|
+
filterId: string;
|
|
93
|
+
settings: FilterSettingsChange;
|
|
94
|
+
} | {
|
|
95
|
+
op: 'filter.remove';
|
|
96
|
+
filterId: string;
|
|
97
|
+
}
|
|
98
|
+
/** The card's bound entry in the filter's mapping, built as the mapping editor builds one. */
|
|
99
|
+
| {
|
|
100
|
+
op: 'filter.bind';
|
|
101
|
+
filterId: string;
|
|
102
|
+
cardId: string;
|
|
103
|
+
binding: DashboardFilterBoundCardApplication;
|
|
104
|
+
} | {
|
|
105
|
+
op: 'filter.exclude';
|
|
106
|
+
filterId: string;
|
|
107
|
+
cardId: string;
|
|
108
|
+
}) & {
|
|
109
|
+
/** Set by the resolver: the public change this operation came from. Descriptions group by it. */
|
|
110
|
+
changeIndex?: number;
|
|
111
|
+
};
|
|
112
|
+
export type OperationContext = {
|
|
113
|
+
/** The report calendar; filter defaults resolve in it. A proposal's has a fixed anchor (DE-D59). */
|
|
114
|
+
calendar: CalendarContext | null;
|
|
115
|
+
};
|
|
116
|
+
export type CreatedEntity = {
|
|
117
|
+
kind: 'card' | 'filter';
|
|
118
|
+
id: string;
|
|
119
|
+
title: string;
|
|
120
|
+
changeIndex?: number;
|
|
121
|
+
};
|
|
122
|
+
export type OperationDescription = {
|
|
123
|
+
/** Operations with the same changeIndex share one description. */
|
|
124
|
+
changeIndex?: number;
|
|
125
|
+
/** Indexes into the operations list. */
|
|
126
|
+
operations: number[];
|
|
127
|
+
sentence: string;
|
|
128
|
+
};
|
|
129
|
+
/** What a live editor must do to its own state after an operation. The server ignores them (DE-D49). */
|
|
130
|
+
export type DashboardRuntimeEffect =
|
|
131
|
+
/** card.remove, and frame.commit dropping tabs: drop live state keyed by these cards. */
|
|
132
|
+
{
|
|
133
|
+
kind: 'cards_removed';
|
|
134
|
+
cardIds: string[];
|
|
135
|
+
}
|
|
136
|
+
/** frame.commit: re-sync inline filter runtime values from the frame before and after. */
|
|
137
|
+
| {
|
|
138
|
+
kind: 'frame_committed';
|
|
139
|
+
sheetId: string;
|
|
140
|
+
before: TFrame;
|
|
141
|
+
after: TFrame;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* filter.update: `applyFilterSettingsChange`'s value effects, unchanged. One
|
|
145
|
+
* per update, even with none: the store still re-resolves forced selections,
|
|
146
|
+
* as `saveFilterSettings` always has (ledger P3-02).
|
|
147
|
+
*/
|
|
148
|
+
| {
|
|
149
|
+
kind: 'filter_value';
|
|
150
|
+
effects: FilterValueEffect[];
|
|
151
|
+
}
|
|
152
|
+
/** filter.remove: drop the input's live values. */
|
|
153
|
+
| {
|
|
154
|
+
kind: 'input_removed';
|
|
155
|
+
inputId: string;
|
|
156
|
+
};
|
|
157
|
+
export type OperationFailureCode = 'sheet_not_found'
|
|
158
|
+
/** A document sheet places cards through its document, not its grid. */
|
|
159
|
+
| 'sheet_not_a_grid' | 'frame_id_taken' | 'frame_not_found' | 'card_not_found' | 'filter_not_found' | 'filter_id_taken'
|
|
160
|
+
/** The filter settings or mapping fail the input contract; `details.issues` has the core's issues. */
|
|
161
|
+
| 'filter_invalid'
|
|
162
|
+
/** A requery part compiled for another type than the card's. */
|
|
163
|
+
| 'query_type_mismatch'
|
|
164
|
+
/** A requery part that doesn't make a valid card (a Matrix definition the Matrix contract refuses). */
|
|
165
|
+
| 'query_invalid'
|
|
166
|
+
/** A requery would change a part of the card its change doesn't state (DE-D61). */
|
|
167
|
+
| 'query_not_kept'
|
|
168
|
+
/** A conversion asked for more ids than the operation carries. */
|
|
169
|
+
| 'ids_exhausted'
|
|
170
|
+
/** A retype across the Matrix boundary without a catalog. */
|
|
171
|
+
| 'catalog_loading';
|
|
172
|
+
export type DashboardOperationResult = {
|
|
173
|
+
ok: true;
|
|
174
|
+
dashboard: TDashboard;
|
|
175
|
+
created: CreatedEntity[];
|
|
176
|
+
/** One plain sentence per public change (or per operation without a changeIndex). */
|
|
177
|
+
descriptions: OperationDescription[];
|
|
178
|
+
runtimeEffects: DashboardRuntimeEffect[];
|
|
179
|
+
} | {
|
|
180
|
+
ok: false;
|
|
181
|
+
failedAt: {
|
|
182
|
+
index: number;
|
|
183
|
+
op: DashboardOperation['op'];
|
|
184
|
+
code: OperationFailureCode;
|
|
185
|
+
message: string;
|
|
186
|
+
fix?: string;
|
|
187
|
+
details?: Record<string, unknown>;
|
|
188
|
+
};
|
|
189
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { TDashboard } from '../../../lib/types/common-types.js';
|
|
2
|
+
import { FrameWidth } from '../../layouts/index.js';
|
|
3
|
+
import { NotEditableReason, OutlineCardSource } from '../changes/read-card-query.js';
|
|
4
|
+
import { CardQuery, MatrixColumns } from '../changes/dashboard-change.js';
|
|
5
|
+
import { OutlineFilter } from './outline-filters.js';
|
|
6
|
+
import { CalendarContext } from '../../report-runtime-context/index.js';
|
|
7
|
+
/**
|
|
8
|
+
* A dashboard in the change vocabulary (MCP dashboard editing SPEC 3.6,
|
|
9
|
+
* DE-D29, DE-D34): every sheet, every card the shared traversal lists
|
|
10
|
+
* (Document-section cards included, read only), every filter, and what the
|
|
11
|
+
* viewer may do. A pure function of the hydrated dashboard and the viewer
|
|
12
|
+
* (S-INV-8): no clock, no catalog, no network.
|
|
13
|
+
*/
|
|
14
|
+
export type OutlineViewer = {
|
|
15
|
+
dashboardId: string;
|
|
16
|
+
/** `Dashboard.updatedAt`, ISO 8601; the staleness token, never called "version" (DE-D37). */
|
|
17
|
+
updatedAt: string;
|
|
18
|
+
access: {
|
|
19
|
+
canEdit: boolean;
|
|
20
|
+
canCopy: boolean;
|
|
21
|
+
};
|
|
22
|
+
sql: boolean;
|
|
23
|
+
sheetIds?: string[];
|
|
24
|
+
cardIds?: string[];
|
|
25
|
+
/** Above this many cards (after narrowing), queries are left out. Default 50 (DE-D34). */
|
|
26
|
+
maxQueryCards?: number;
|
|
27
|
+
/** The report calendar filter defaults are read in; without one, a fixed calendar at `updatedAt` (S-INV-8). */
|
|
28
|
+
calendar?: CalendarContext;
|
|
29
|
+
};
|
|
30
|
+
export type OutlineCard = {
|
|
31
|
+
cardId: string;
|
|
32
|
+
title: string;
|
|
33
|
+
/** The public type name (DE-D43). */
|
|
34
|
+
type: string;
|
|
35
|
+
source: OutlineCardSource;
|
|
36
|
+
/** Shows a library visual; changing it makes it local (DE-D50). */
|
|
37
|
+
linkedVisualId?: string;
|
|
38
|
+
editable: true;
|
|
39
|
+
/** Absent only when the outline is truncated. */
|
|
40
|
+
query?: CardQuery;
|
|
41
|
+
matrix?: MatrixColumns;
|
|
42
|
+
} | {
|
|
43
|
+
cardId: string;
|
|
44
|
+
title: string;
|
|
45
|
+
type: string;
|
|
46
|
+
source?: OutlineCardSource;
|
|
47
|
+
linkedVisualId?: string;
|
|
48
|
+
editable: false;
|
|
49
|
+
notEditable: {
|
|
50
|
+
reason: NotEditableReason;
|
|
51
|
+
message: string;
|
|
52
|
+
detail?: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
export type OutlineSheet = {
|
|
56
|
+
sheetId: string;
|
|
57
|
+
title: string;
|
|
58
|
+
/** Cards can be added only to "dashboard" sheets. */
|
|
59
|
+
kind: 'dashboard' | 'document';
|
|
60
|
+
/** On a Document sheet, its sections' cards (never editable). */
|
|
61
|
+
cards: OutlineCard[];
|
|
62
|
+
/**
|
|
63
|
+
* Grid sheets only: the desktop layout as rows, top to bottom, from the
|
|
64
|
+
* layout engine (responsive layouts RL-D10). Always the whole sheet, even
|
|
65
|
+
* when `cardIds` narrows the cards. Absent on Document sheets.
|
|
66
|
+
*/
|
|
67
|
+
layout?: OutlineLayoutRow[];
|
|
68
|
+
};
|
|
69
|
+
/** One row of a sheet's desktop layout. A tile is a frame: its cards, active first, and its width by intent. Never coordinates (RL-INV-5). */
|
|
70
|
+
export type OutlineLayoutRow = {
|
|
71
|
+
tiles: Array<{
|
|
72
|
+
cardIds: string[];
|
|
73
|
+
width: FrameWidth;
|
|
74
|
+
}>;
|
|
75
|
+
};
|
|
76
|
+
export type DashboardOutline = {
|
|
77
|
+
dashboardId: string;
|
|
78
|
+
title: string;
|
|
79
|
+
updatedAt: string;
|
|
80
|
+
access: {
|
|
81
|
+
canEdit: boolean;
|
|
82
|
+
canCopy: boolean;
|
|
83
|
+
};
|
|
84
|
+
/** Every dataset a card or filter uses. */
|
|
85
|
+
datasets: Array<{
|
|
86
|
+
domainId: string;
|
|
87
|
+
datasetName: string;
|
|
88
|
+
}>;
|
|
89
|
+
sheets: OutlineSheet[];
|
|
90
|
+
filters: OutlineFilter[];
|
|
91
|
+
/** Queries left out because the dashboard has more than `maxQueryCards` cards (DE-D34). */
|
|
92
|
+
truncated?: true;
|
|
93
|
+
};
|
|
94
|
+
export declare function outlineDashboard(dashboard: TDashboard, viewer: OutlineViewer): DashboardOutline;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { TDashboard } from '../../../lib/types/common-types.js';
|
|
2
|
+
import { FilterInputEntry } from '../filter-model/index.js';
|
|
3
|
+
import { CalendarContext } from '../../report-runtime-context/index.js';
|
|
4
|
+
import { FilterValue, TimeWindow } from '../changes/dashboard-change.js';
|
|
5
|
+
/**
|
|
6
|
+
* Every dashboard filter in the change vocabulary (MCP dashboard editing
|
|
7
|
+
* DE-D58, SPEC 3.6). A field filter on one semantic dataset shown on every
|
|
8
|
+
* grid sheet or a list of sheets is editable; any other filter is a
|
|
9
|
+
* read-only summary with its reach and a reason, never left out and never
|
|
10
|
+
* given invented coordinates. Reach is read the way each card runs the
|
|
11
|
+
* filter (`describeDashboardFilterCardReach`).
|
|
12
|
+
*/
|
|
13
|
+
export type FilterNotEditableReason = 'global_date' | 'not_semantic' | 'scope_not_expressible';
|
|
14
|
+
export type OutlineFilter = {
|
|
15
|
+
filterId: string;
|
|
16
|
+
label: string;
|
|
17
|
+
editable: true;
|
|
18
|
+
domainId: string;
|
|
19
|
+
datasetName: string;
|
|
20
|
+
field: string;
|
|
21
|
+
selection: 'single' | 'multiple';
|
|
22
|
+
/** The values it loads with, read through the default owner (a saved default first, else the definition). */
|
|
23
|
+
defaultValues?: FilterValue[];
|
|
24
|
+
/** The window it loads with, only when the loaded default keeps one (a day picker clamps a wider window to a day). */
|
|
25
|
+
defaultPeriod?: TimeWindow;
|
|
26
|
+
/** For a date filter, the picker a viewer gets: one day, one month, or a range. */
|
|
27
|
+
datePicker?: 'day' | 'month' | 'range';
|
|
28
|
+
/** "all": every grid sheet. */
|
|
29
|
+
sheetIds: string[] | 'all';
|
|
30
|
+
/** With "all": the sheets it leaves out ("every sheet except"); a sheet added later is reached. */
|
|
31
|
+
exceptSheetIds?: string[];
|
|
32
|
+
/** With "all": it also shows on Document sheets (their sections' cards). */
|
|
33
|
+
includesDocumentSheets?: true;
|
|
34
|
+
/** Card ids the filter applies to. */
|
|
35
|
+
reaches: string[];
|
|
36
|
+
/** Card ids excluded explicitly. */
|
|
37
|
+
excluded: string[];
|
|
38
|
+
/** In scope, not matched. */
|
|
39
|
+
notReached: Array<{
|
|
40
|
+
cardId: string;
|
|
41
|
+
title: string;
|
|
42
|
+
datasetName?: string;
|
|
43
|
+
}>;
|
|
44
|
+
/** In scope, and blocked when the filter has a value: a binding the card can't run, or two fields it could take. */
|
|
45
|
+
blocked?: Array<{
|
|
46
|
+
cardId: string;
|
|
47
|
+
title: string;
|
|
48
|
+
reason: 'blocked' | 'ambiguous';
|
|
49
|
+
}>;
|
|
50
|
+
} | {
|
|
51
|
+
filterId: string;
|
|
52
|
+
label: string;
|
|
53
|
+
editable: false;
|
|
54
|
+
kind: 'global_date' | 'field' | 'other';
|
|
55
|
+
notEditable: {
|
|
56
|
+
reason: FilterNotEditableReason;
|
|
57
|
+
message: string;
|
|
58
|
+
};
|
|
59
|
+
reaches: string[];
|
|
60
|
+
excluded: string[];
|
|
61
|
+
blocked?: Array<{
|
|
62
|
+
cardId: string;
|
|
63
|
+
title: string;
|
|
64
|
+
reason: 'blocked' | 'ambiguous';
|
|
65
|
+
}>;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* The calendar a summary reads defaults in: the report's, else a fixed one at
|
|
69
|
+
* the dashboard's own time, so a summary stays a pure function of its inputs.
|
|
70
|
+
* Only whether a default keeps its window is reported, never the dates it
|
|
71
|
+
* resolves to.
|
|
72
|
+
*/
|
|
73
|
+
export declare function outlineCalendar(calendar: CalendarContext | undefined, updatedAt: string | undefined): CalendarContext;
|
|
74
|
+
export declare function summarizeFilter(dashboard: TDashboard, entry: FilterInputEntry, calendar?: CalendarContext): OutlineFilter;
|
|
75
|
+
/** Every filter on the dashboard, in the filter model's order. */
|
|
76
|
+
export declare function outlineFilters(dashboard: TDashboard, calendar?: CalendarContext): OutlineFilter[];
|
|
77
|
+
/** One filter by its input id, or undefined. */
|
|
78
|
+
export declare function outlineFilter(dashboard: TDashboard, filterId: string, calendar?: CalendarContext): OutlineFilter | undefined;
|