react-semaphor 0.1.546 → 0.1.548
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 +71 -68
- package/dist/assistant-context/index.js +1 -1
- package/dist/briefings/index.js +1 -1
- package/dist/chunks/applied-constraints-DU-wndZ7.js +47 -0
- package/dist/chunks/{assistant-chat-BPXhulAx.js → assistant-chat-DCcWsoGm.js} +106 -106
- package/dist/chunks/{bookmark-state-C4vetoa0.js → bookmark-state-Cu-a5ie_.js} +2 -8
- package/dist/chunks/{custom-visual-inputs-CkJW9pBS.js → custom-visual-inputs-BTRnwsfd.js} +1 -1
- package/dist/chunks/{dashboard-C3CoKbGY.js → dashboard-BZHL9a-z.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-Be4h-7My.js → dashboard-briefing-launcher-DML-cAzB.js} +528 -528
- package/dist/chunks/{dashboard-controls-bxPrlSyp.js → dashboard-controls-BGoBTPS7.js} +45 -45
- package/dist/chunks/{dashboard-json-BrjxIiRt.js → dashboard-json-iHPsdn3j.js} +1 -1
- package/dist/chunks/{document-dashboard-inputs-CRVHpIHp.js → document-dashboard-inputs-B2AqPfrq.js} +94 -94
- package/dist/chunks/{edit-dashboard-visual-DYYYDjY6.js → edit-dashboard-visual-CLEFFf2T.js} +281 -281
- package/dist/chunks/{column-catalog-BYnochWQ.js → filter-reach-copy-ByzGadUk.js} +978 -861
- package/dist/chunks/{global-date-filter-utils-9d6m9-FE.js → global-date-filter-utils-CeeFJ1CP.js} +4070 -3792
- package/dist/chunks/{index-DkQkMKa1.js → index-DeDHr3iz.js} +30 -30
- package/dist/chunks/{raw-temporal-presentation-CBzrDOjM.js → raw-temporal-presentation-CrUM2I_o.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-4QEZWe5U.js → report-preferences-dialog-CM7kXmXp.js} +59 -59
- package/dist/chunks/{resolve-dashboard-input-context-UpK_LBpL.js → resolve-dashboard-input-context-BmWF9hSl.js} +1511 -1612
- package/dist/chunks/{saved-dashboard-context-D_I3Lxk0.js → saved-dashboard-context-qtfzl9Eb.js} +5 -5
- package/dist/chunks/{semaphor-ready-indicator-4zpRHE-X.js → semaphor-ready-indicator-Ol6VcaR7.js} +36548 -35855
- package/dist/chunks/{shelf-drop-preview-context-Cfw7TRAx.js → shelf-drop-preview-context-C2SEC3I9.js} +80 -80
- package/dist/chunks/{source-entity-resolution-BIGRvtbG.js → source-entity-resolution-D195CrYS.js} +221 -192
- package/dist/chunks/{table-settings-CunhoDUi.js → table-settings-WysCBj62.js} +133 -124
- package/dist/chunks/{use-create-flow-overlay-state-DZBZiiD-.js → use-create-flow-overlay-state-CbGIjaVD.js} +2 -2
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +1419 -1340
- package/dist/data-app-sdk-validation/index.js +1 -1
- package/dist/index.js +14 -14
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/surfboard/filter/types.d.ts +7 -0
- package/dist/types/components/surfboard/screen-size-preview-button.d.ts +7 -4
- package/dist/types/components/visual/matrix-table/matrix-card-view.d.ts +3 -0
- package/dist/types/index.js +2 -2
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +383 -22
- package/dist/types/lib/dashboard-inputs/dashboard-filter-value-identity.d.ts +65 -0
- package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +3 -3
- package/dist/types/lib/hooks/use-dashboard-card.d.ts +2 -0
- package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +1 -1
- package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +9 -1
- package/dist/types/lib/matrix-table/matrix-runtime.d.ts +5 -1
- package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +83 -13
- package/dist/types/lib/stores/dashboard-store.d.ts +12 -0
- package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +57 -1
- package/dist/types/shared/assistant-protocol/context.d.ts +8 -8
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/click-to-filter-settings.d.ts +3 -3
- package/dist/types/shared/dashboard-authoring/dashboard-filter-automatic-target.d.ts +4 -4
- package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +3 -1
- package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-types.d.ts +27 -1
- package/dist/types/shared/dashboard-authoring/dashboard-filter-value-compatibility.d.ts +12 -3
- package/dist/types/shared/dashboard-authoring/filter-reach-copy.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/filter-reach-preview.d.ts +97 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +5 -1
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +26 -4
- package/dist/types/shared/dashboard-authoring/semantic-auto-join-card.d.ts +22 -0
- package/package.json +1 -1
|
@@ -10,9 +10,18 @@ export declare function isDashboardFilterOperationCompatible(dataType: unknown,
|
|
|
10
10
|
export declare const DASHBOARD_FILTER_OPERATIONS: ReadonlySet<string>;
|
|
11
11
|
export type DashboardFilterScalarType = keyof typeof OPERATIONS_BY_DATA_TYPE;
|
|
12
12
|
/**
|
|
13
|
-
* The values a filter operation takes: how many, and of which scalar type.
|
|
14
13
|
* The one rule for stored filter values, in authored defaults and in saved
|
|
15
|
-
* bookmarks
|
|
14
|
+
* bookmarks: the values a filter operation takes (how many, and of which
|
|
15
|
+
* scalar type), and a date window that runs to now. A dashboard filter's
|
|
16
|
+
* dates never count back from the latest data (relationship filter reach
|
|
17
|
+
* RF-INV-13): the Cards tab previews reach without a value, and a route can't
|
|
18
|
+
* carry a data anchor (P-6, ledger R-15). MCP edits already refuse such a
|
|
19
|
+
* default. Appends a message naming `location` (the stored value) for the
|
|
20
|
+
* first problem.
|
|
16
21
|
*/
|
|
17
|
-
export declare function validateDashboardFilterValues(
|
|
22
|
+
export declare function validateDashboardFilterValues(value: {
|
|
23
|
+
operation: unknown;
|
|
24
|
+
values: readonly unknown[];
|
|
25
|
+
relativeMeta?: unknown;
|
|
26
|
+
}, valueType: DashboardFilterScalarType | undefined, location: string, errors: string[]): void;
|
|
18
27
|
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SemaphorRelationshipRoute, SemaphorSkippedConstraintReason } from '../analytics-protocol/index.js';
|
|
2
|
+
/** "Project" to "Projects", "Category" to "Categories"; a label ending in "s" stays. */
|
|
3
|
+
export declare function pluralDatasetLabel(label: string): string;
|
|
4
|
+
/**
|
|
5
|
+
* P-8 and P-11: "through Project" for a to-one route; "Projects with at least
|
|
6
|
+
* one matching Dashboard" for a to-many route, where Dashboard is the dataset
|
|
7
|
+
* its first to-many step reaches. A route of more than one step names the
|
|
8
|
+
* datasets it passes through, not the filter's own, which it always ends at
|
|
9
|
+
* ("through Crew" for a Company filter; ledger R-21).
|
|
10
|
+
*/
|
|
11
|
+
export declare function describeRelationshipRoute(route: SemaphorRelationshipRoute): string;
|
|
12
|
+
/** P-1: a persisted route the domain no longer has. */
|
|
13
|
+
export declare const RELATIONSHIP_ROUTE_CHANGED_MESSAGE = "The relationship this card used changed; choose it again";
|
|
14
|
+
/** P-2, P-3, P-6, P-7: why a value was not applied to a card. */
|
|
15
|
+
export declare function describeRelationshipSkip(reason: SemaphorSkippedConstraintReason, cardDataset?: {
|
|
16
|
+
name: string;
|
|
17
|
+
label?: string;
|
|
18
|
+
}): string;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { SemaphorRelationshipRoute, SemaphorSkippedConstraintReason } from '../analytics-protocol/index.js';
|
|
2
|
+
import { TFilter } from '../../components/surfboard/filter/types.js';
|
|
3
|
+
import { DashboardFilterOptionSource, DashboardFilterRelationshipTarget } from './dashboard-filter-mapping-types.js';
|
|
4
|
+
/**
|
|
5
|
+
* The Cards tab's relationship preview (relationship filter reach, Phase 3):
|
|
6
|
+
* `POST /api/v1/filter-reach` resolves each in-scope card the way its query
|
|
7
|
+
* will, without a value. Authoring only, never on the card query path.
|
|
8
|
+
*/
|
|
9
|
+
export type FilterReachRequest = {
|
|
10
|
+
dashboardId: string;
|
|
11
|
+
/** The filter as staged in the settings popover (unsaved edits included). */
|
|
12
|
+
filter: TFilter;
|
|
13
|
+
/** The draft's Option Source; absent when the draft has none (ledger R-04). */
|
|
14
|
+
optionSource?: DashboardFilterOptionSource;
|
|
15
|
+
/** In-scope cards, each as the draft runs it. */
|
|
16
|
+
cards: FilterReachPreviewCard[];
|
|
17
|
+
};
|
|
18
|
+
/** A card to preview, with the route the draft runs it with (ledger R-02). */
|
|
19
|
+
export type FilterReachPreviewCard = {
|
|
20
|
+
cardId: string;
|
|
21
|
+
/**
|
|
22
|
+
* The card's chosen route as the draft stands (RF-D10): a staged choice,
|
|
23
|
+
* else the saved one unless the author dropped it. Absent: the card has no
|
|
24
|
+
* entry of its own, and the preview says what the domain's relationships do.
|
|
25
|
+
*/
|
|
26
|
+
target?: DashboardFilterRelationshipTarget;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* What the domain's relationships do for a card as the draft runs it
|
|
30
|
+
* (relationship filter reach S-D).
|
|
31
|
+
*/
|
|
32
|
+
export type FilterReachCardOutcome = {
|
|
33
|
+
status: 'applied';
|
|
34
|
+
route: SemaphorRelationshipRoute;
|
|
35
|
+
} | {
|
|
36
|
+
status: 'skipped';
|
|
37
|
+
reason: SemaphorSkippedConstraintReason;
|
|
38
|
+
}
|
|
39
|
+
/** More than one equally preferred path: the card skips the filter until one is chosen (P-7). */
|
|
40
|
+
| {
|
|
41
|
+
status: 'needsPath';
|
|
42
|
+
} | {
|
|
43
|
+
status: 'blocked';
|
|
44
|
+
message: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The card applies the value as one of its own filters: the value's dataset
|
|
48
|
+
* is one its query already uses (its own filters included), so no route is
|
|
49
|
+
* needed (ledger R-05).
|
|
50
|
+
*/
|
|
51
|
+
| {
|
|
52
|
+
status: 'kept';
|
|
53
|
+
}
|
|
54
|
+
/** Reached another way, or not a semantic auto-join card. */
|
|
55
|
+
| {
|
|
56
|
+
status: 'notRelationship';
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* One card's preview: the outcome for the decision it answers, and the
|
|
60
|
+
* card's paths. A reader shows the outcome only while the card's decision is
|
|
61
|
+
* still the one named in `answers` (RF-INV-15); the paths don't depend on the
|
|
62
|
+
* decision (RF-D27).
|
|
63
|
+
*/
|
|
64
|
+
export type FilterReachCardPreview = {
|
|
65
|
+
cardId: string;
|
|
66
|
+
/** The decision this outcome is for: the path ids the request carried for the card, or none. */
|
|
67
|
+
answers: {
|
|
68
|
+
relationshipIds?: string[];
|
|
69
|
+
};
|
|
70
|
+
outcome: FilterReachCardOutcome;
|
|
71
|
+
/** The card's equally preferred paths, worked out with no path chosen; empty without a tie. */
|
|
72
|
+
paths: FilterReachPathOption[];
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* One path an author can choose, with the target that saves it: built by the
|
|
76
|
+
* server from the filter's value field in the card's domain, never from the
|
|
77
|
+
* browser's guess of that field (ledger R-16).
|
|
78
|
+
*/
|
|
79
|
+
export type FilterReachPathOption = {
|
|
80
|
+
route: SemaphorRelationshipRoute;
|
|
81
|
+
target: DashboardFilterRelationshipTarget;
|
|
82
|
+
};
|
|
83
|
+
export type FilterReachResponse = {
|
|
84
|
+
previews: FilterReachCardPreview[];
|
|
85
|
+
/** Present only when the caller can edit the domain the routes run in. */
|
|
86
|
+
manageRelationships?: {
|
|
87
|
+
href: string;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
/** Whether a preview answers a card's decision as it stands: the same path, or no path for both (RF-INV-15). */
|
|
91
|
+
export declare function filterReachPreviewAnswers(preview: Pick<FilterReachCardPreview, 'answers'>, relationshipIds: readonly string[] | undefined): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Reads a `/api/v1/filter-reach` response body. A malformed preview is
|
|
94
|
+
* dropped whole: one with no decision it answers, an unknown outcome, a
|
|
95
|
+
* malformed path, or a tie with fewer than two paths.
|
|
96
|
+
*/
|
|
97
|
+
export declare function readFilterReachResponse(body: unknown): FilterReachResponse;
|
|
@@ -48,10 +48,14 @@ export * from './outline/outline-dashboard.js';
|
|
|
48
48
|
export * from './column-catalog.js';
|
|
49
49
|
export { prepareLoadedDashboard } from '../../lib/dashboard-inputs/prepare-loaded-dashboard.js';
|
|
50
50
|
export { buildFilterInputFromField, buildFilterInputFromDefinition, applyFilterSettingsChange } from '../../lib/dashboard-inputs/filter-settings.js';
|
|
51
|
+
export { relationshipRouteTarget } from '../../lib/dashboard-inputs/dashboard-filter-value-identity.js';
|
|
51
52
|
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 { describeDashboardFilterCardReach, describeDashboardFilterCardReachDetail, type DashboardFilterCardReach, type DashboardFilterCardReachDetail, type DashboardRelationshipReachResolver, } from '../../lib/query-context/dashboard-filter-mapping-resolution.js';
|
|
53
54
|
export { changeCardType, sharedCardPreferences, type CardTypeChange, type CardTypeChangeOptions, } from '../../lib/utils/card-type-change.js';
|
|
54
55
|
export { buildSavedEditorCard } from '../../lib/utils/build-saved-editor-card.js';
|
|
55
56
|
export { getCardDefinition, type AuthoredCardFields } from '../../lib/utils/card-definition.js';
|
|
56
57
|
export { changeMatrixEditor, dropMatrixEditorField, matrixEditorCatalogFromFields, } from '../../lib/matrix-table/matrix-editor.js';
|
|
57
58
|
export * from './filter-applicability.js';
|
|
59
|
+
export * from './semantic-auto-join-card.js';
|
|
60
|
+
export * from './filter-reach-preview.js';
|
|
61
|
+
export * from './filter-reach-copy.js';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DashboardRelationshipReachResolver } from '../../../lib/query-context/dashboard-filter-mapping-resolution.js';
|
|
1
2
|
import { TDashboard } from '../../../lib/types/common-types.js';
|
|
2
3
|
import { FrameWidth } from '../../layouts/index.js';
|
|
3
4
|
import { NotEditableReason, OutlineCardSource } from '../changes/read-card-query.js';
|
|
@@ -26,6 +27,12 @@ export type OutlineViewer = {
|
|
|
26
27
|
maxQueryCards?: number;
|
|
27
28
|
/** The report calendar filter defaults are read in; without one, a fixed calendar at `updatedAt` (S-INV-8). */
|
|
28
29
|
calendar?: CalendarContext;
|
|
30
|
+
/**
|
|
31
|
+
* Server side only: resolves relationship reach the way the card query
|
|
32
|
+
* does, with each card's domain preloaded (relationship filter reach RF-D15).
|
|
33
|
+
* Without one, such cards are listed under `relationshipPending`.
|
|
34
|
+
*/
|
|
35
|
+
relationshipReach?: DashboardRelationshipReachResolver;
|
|
29
36
|
};
|
|
30
37
|
export type OutlineCard = {
|
|
31
38
|
cardId: string;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { TDashboard } from '../../../lib/types/common-types.js';
|
|
2
|
+
import { DashboardRelationshipReachResolver } from '../../../lib/query-context/dashboard-filter-mapping-resolution.js';
|
|
3
|
+
import { SemaphorSkippedConstraintReason } from '../../analytics-protocol/index.js';
|
|
2
4
|
import { FilterInputEntry } from '../filter-model/index.js';
|
|
3
5
|
import { CalendarContext } from '../../report-runtime-context/index.js';
|
|
4
6
|
import { FilterValue, TimeWindow } from '../changes/dashboard-change.js';
|
|
@@ -35,11 +37,12 @@ export type OutlineFilter = {
|
|
|
35
37
|
reaches: string[];
|
|
36
38
|
/** Card ids excluded explicitly. */
|
|
37
39
|
excluded: string[];
|
|
38
|
-
/** In scope, not matched. */
|
|
40
|
+
/** In scope, not matched; with a resolver (server side), the reason relationship reach gave. */
|
|
39
41
|
notReached: Array<{
|
|
40
42
|
cardId: string;
|
|
41
43
|
title: string;
|
|
42
44
|
datasetName?: string;
|
|
45
|
+
reason?: SemaphorSkippedConstraintReason;
|
|
43
46
|
}>;
|
|
44
47
|
/** In scope, and blocked when the filter has a value: a binding the card can't run, or two fields it could take. */
|
|
45
48
|
blocked?: Array<{
|
|
@@ -47,6 +50,16 @@ export type OutlineFilter = {
|
|
|
47
50
|
title: string;
|
|
48
51
|
reason: 'blocked' | 'ambiguous';
|
|
49
52
|
}>;
|
|
53
|
+
/**
|
|
54
|
+
* In scope, on another dataset of the card's domain: the server decides
|
|
55
|
+
* when the card runs, through the domain's relationships, whether the
|
|
56
|
+
* filter applies. Never counted as reached.
|
|
57
|
+
*/
|
|
58
|
+
relationshipPending?: Array<{
|
|
59
|
+
cardId: string;
|
|
60
|
+
title: string;
|
|
61
|
+
datasetName?: string;
|
|
62
|
+
}>;
|
|
50
63
|
} | {
|
|
51
64
|
filterId: string;
|
|
52
65
|
label: string;
|
|
@@ -63,6 +76,15 @@ export type OutlineFilter = {
|
|
|
63
76
|
title: string;
|
|
64
77
|
reason: 'blocked' | 'ambiguous';
|
|
65
78
|
}>;
|
|
79
|
+
relationshipPending?: Array<{
|
|
80
|
+
cardId: string;
|
|
81
|
+
title: string;
|
|
82
|
+
datasetName?: string;
|
|
83
|
+
}>;
|
|
84
|
+
};
|
|
85
|
+
/** Server-side readers resolve relationship reach the way the card query does (RF-D15). */
|
|
86
|
+
export type OutlineReachOptions = {
|
|
87
|
+
relationshipReach?: DashboardRelationshipReachResolver;
|
|
66
88
|
};
|
|
67
89
|
/**
|
|
68
90
|
* The calendar a summary reads defaults in: the report's, else a fixed one at
|
|
@@ -71,8 +93,8 @@ export type OutlineFilter = {
|
|
|
71
93
|
* resolves to.
|
|
72
94
|
*/
|
|
73
95
|
export declare function outlineCalendar(calendar: CalendarContext | undefined, updatedAt: string | undefined): CalendarContext;
|
|
74
|
-
export declare function summarizeFilter(dashboard: TDashboard, entry: FilterInputEntry, calendar?: CalendarContext): OutlineFilter;
|
|
96
|
+
export declare function summarizeFilter(dashboard: TDashboard, entry: FilterInputEntry, calendar?: CalendarContext, options?: OutlineReachOptions): OutlineFilter;
|
|
75
97
|
/** Every filter on the dashboard, in the filter model's order. */
|
|
76
|
-
export declare function outlineFilters(dashboard: TDashboard, calendar?: CalendarContext): OutlineFilter[];
|
|
98
|
+
export declare function outlineFilters(dashboard: TDashboard, calendar?: CalendarContext, options?: OutlineReachOptions): OutlineFilter[];
|
|
77
99
|
/** One filter by its input id, or undefined. */
|
|
78
|
-
export declare function outlineFilter(dashboard: TDashboard, filterId: string, calendar?: CalendarContext): OutlineFilter | undefined;
|
|
100
|
+
export declare function outlineFilter(dashboard: TDashboard, filterId: string, calendar?: CalendarContext, options?: OutlineReachOptions): OutlineFilter | undefined;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TFilterValue } from '../../components/surfboard/filter/types.js';
|
|
2
|
+
import { TCard } from '../../lib/types/common-types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Where relationship filter reach runs (relationship filter reach RF-D18): a
|
|
5
|
+
* card on a semantic domain with no explicit join plan. The join plan is read
|
|
6
|
+
* as the card's filter source index reads it: a Matrix card's from its spec,
|
|
7
|
+
* every other card's from its config. The browser decides only whether to
|
|
8
|
+
* send a value (`decideDashboardFilterCardTarget`, `relationship`); the server
|
|
9
|
+
* decides reach through the domain's relationships. Both call this.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isSemanticAutoJoinCard(card: Pick<TCard, 'type' | 'dataSource' | 'config'> & {
|
|
12
|
+
sql?: string;
|
|
13
|
+
python?: string;
|
|
14
|
+
}): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* The one semantic dataset a filter value's field reads, with its domain:
|
|
17
|
+
* undefined when the value names no dataset, several, or no semantic domain.
|
|
18
|
+
*/
|
|
19
|
+
export declare function filterValueSemanticDataset(value: Pick<TFilterValue, 'fieldMeta' | 'semanticContext'>): {
|
|
20
|
+
domainId: string;
|
|
21
|
+
datasetName: string;
|
|
22
|
+
} | undefined;
|