react-semaphor 0.1.509 → 0.1.511
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/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-BoXFrqq0.cjs → dashboard-briefing-launcher-BQFNo0jl.cjs} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-B5AQu-Vb.js → dashboard-briefing-launcher-CKH7Tf1f.js} +103 -103
- package/dist/chunks/{dashboard-controls-gUVkQm8o.cjs → dashboard-controls-ClFLfxq2.cjs} +1 -1
- package/dist/chunks/{dashboard-controls-CKKkSXEX.js → dashboard-controls-DmjRr3rv.js} +130 -130
- package/dist/chunks/{dashboard-json-CAJJquVx.js → dashboard-json-75yKcetl.js} +2 -2
- package/dist/chunks/{dashboard-json-B7fSi6_b.cjs → dashboard-json-DfqjM_p3.cjs} +1 -1
- package/dist/chunks/edit-dashboard-visual-BRSB4-Gg.cjs +172 -0
- package/dist/chunks/{edit-dashboard-visual-DCnbqRRn.js → edit-dashboard-visual-D--Ctlyq.js} +5604 -5597
- package/dist/chunks/{editor-action-buttons-DDA5JGwO.js → editor-action-buttons-DFrdNdTp.js} +27 -27
- package/dist/chunks/{editor-action-buttons-CBQsVYdt.cjs → editor-action-buttons-DxV1NKMw.cjs} +1 -1
- package/dist/chunks/{index-DkEAikW8.cjs → index-Bym8NiEh.cjs} +237 -238
- package/dist/chunks/{index-CL2lvhwk.js → index-bH_soNi5.js} +40505 -40547
- package/dist/chunks/{report-preferences-dialog-Bv2VIOKc.js → report-preferences-dialog-BMkvjfq4.js} +7 -7
- package/dist/chunks/{report-preferences-dialog-Wg9g9fIj.cjs → report-preferences-dialog-BrrpSEMl.cjs} +1 -1
- package/dist/chunks/{switch-iC1x2dcE.cjs → switch-BkcJCTS7.cjs} +14 -14
- package/dist/chunks/{switch-CD4uGTZI.js → switch-CrstROAR.js} +169 -161
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +50 -50
- package/dist/index.cjs +1 -1
- package/dist/index.js +216 -234
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/dashboard/dashboard-visual-error-state.d.ts +7 -1
- package/dist/types/components/error-fallbacks/fallback.d.ts +23 -11
- package/dist/types/components/visual/data-table/hooks/use-data-table-logic.d.ts +5 -0
- package/dist/types/lib/dashboard/open-card-in-visual-editor.d.ts +15 -0
- package/dist/types/lib/dashboard-pagination/dashboard-card-pagination.d.ts +24 -0
- package/dist/types/lib/hooks/use-dashboard-card.d.ts +4 -0
- package/dist/types/lib/hooks/use-dashboard-frame-query.d.ts +3 -1
- package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +4 -1
- package/dist/types/lib/query-context/dashboard-card-query-key.d.ts +14 -2
- package/dist/types/lib/stores/dashboard-store.d.ts +4 -0
- package/dist/types/lib/utils/card-loading-state.d.ts +1 -0
- package/package.json +1 -1
- package/dist/chunks/edit-dashboard-visual-AZetLUv1.cjs +0 -172
package/dist/surfboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-Bym8NiEh.cjs"),r=require("../chunks/common-types-nBuCd3u2.cjs"),o=require("../chunks/report-preferences-dialog-BrrpSEMl.cjs");exports.DisplayFormatPreferencesFields=e.DisplayFormatPreferencesFields;exports.Surfboard=e.DashboardPlus;exports.CONTROL_CARD_DEFAULT_VALUE=r.CONTROL_CARD_DEFAULT_VALUE;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;exports.ReportPreferencesDialog=o.ReportPreferencesDialog;
|
package/dist/surfboard/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { b as a, a as o } from "../chunks/index-
|
|
1
|
+
import { b as a, a as o } from "../chunks/index-bH_soNi5.js";
|
|
2
2
|
import { C as f, E } from "../chunks/common-types-C6cAQgyh.js";
|
|
3
|
-
import { R as t } from "../chunks/report-preferences-dialog-
|
|
3
|
+
import { R as t } from "../chunks/report-preferences-dialog-BMkvjfq4.js";
|
|
4
4
|
export {
|
|
5
5
|
f as CONTROL_CARD_DEFAULT_VALUE,
|
|
6
6
|
a as DisplayFormatPreferencesFields,
|
|
@@ -9,6 +9,12 @@ export declare function DashboardVisualErrorState({ onRetry, actionLabel, densit
|
|
|
9
9
|
export declare function DashboardDeclaredSqlCustomDateFormatRepairState({ onRepair, }: {
|
|
10
10
|
onRepair?: () => void;
|
|
11
11
|
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Render-failure state for a dashboard card. `onRepair` is present only when
|
|
14
|
+
* the user can edit the dashboard; whatever threw, an editor's way out is the
|
|
15
|
+
* visual editor and a viewer's is a retry.
|
|
16
|
+
*/
|
|
17
|
+
export declare function DashboardVisualErrorBoundaryFallback({ error, resetErrorBoundary, onRepair, density, }: FallbackProps & {
|
|
13
18
|
onRepair?: () => void;
|
|
19
|
+
density?: 'default' | 'compact';
|
|
14
20
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,19 +1,31 @@
|
|
|
1
|
+
import { FallbackProps } from 'react-error-boundary';
|
|
1
2
|
import { TFrame } from '../../lib/types/index.js';
|
|
2
3
|
export declare function FallbackChatVisual({ error, }: {
|
|
3
4
|
error: Error;
|
|
4
5
|
resetErrorBoundary: () => void;
|
|
5
6
|
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Render-failure state for one visual outside the dashboard grid: the editor
|
|
9
|
+
* preview, expanded view, interaction popovers and standalone visuals. Raw
|
|
10
|
+
* error text stays out of the UI (React already logs it).
|
|
11
|
+
*
|
|
12
|
+
* `onResetColumnSettings` is the editor's way out when the table's own column
|
|
13
|
+
* settings sheet failed along with the table: it runs the same reset as the
|
|
14
|
+
* sheet's "Reset all" on the unsaved draft, then retries the render.
|
|
15
|
+
*/
|
|
16
|
+
export declare function FallbackVisual({ error, resetErrorBoundary, onResetColumnSettings, }: FallbackProps & {
|
|
17
|
+
onResetColumnSettings?: () => void;
|
|
10
18
|
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export declare function
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Whole-surface net (dashboard, editor, standalone visual), reached only when
|
|
21
|
+
* every narrower boundary was bypassed. Offers a retry instead of a dead end.
|
|
22
|
+
*/
|
|
23
|
+
export declare function Fallback({ error, resetErrorBoundary }: FallbackProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
/**
|
|
25
|
+
* Sheet-grid net for a frame that failed outside its own boundaries. Keeps
|
|
26
|
+
* the card shell and hover toolbar so the card can still be edited, moved or
|
|
27
|
+
* deleted.
|
|
28
|
+
*/
|
|
29
|
+
export declare function FallbackCard({ error, resetErrorBoundary, frame, }: FallbackProps & {
|
|
18
30
|
frame: TFrame;
|
|
19
31
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -84,6 +84,11 @@ export declare function useDataTableLogic(props: DataTableLogicProps): {
|
|
|
84
84
|
totalRows: number;
|
|
85
85
|
isTablePrintDisplayMode: boolean;
|
|
86
86
|
onSortChange: ((sorting: SortingState) => void) | undefined;
|
|
87
|
+
pagination: {
|
|
88
|
+
pageIndex: number;
|
|
89
|
+
pageSize: number;
|
|
90
|
+
};
|
|
91
|
+
handlePaginationChange: (updater: import('@tanstack/table-core').PaginationState | ((old: import('@tanstack/table-core').PaginationState) => import('@tanstack/table-core').PaginationState)) => void;
|
|
87
92
|
paginationMode: import('../utils/pagination-utils.js').PaginationMode;
|
|
88
93
|
paginationMetadata: any;
|
|
89
94
|
contextTimezone: string | undefined;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useManagementStore } from '../stores/management-store.js';
|
|
2
|
+
import { TCard, TFrame } from '../types/common-types.js';
|
|
3
|
+
type ManagementState = ReturnType<typeof useManagementStore.getState>;
|
|
4
|
+
/** Saved-dashboard edit permission, as the dashboard runtime reads it. */
|
|
5
|
+
export declare function selectCanEditDashboard(state: ManagementState): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Opens the visual editor on one dashboard card from any dashboard state,
|
|
8
|
+
* including view mode. Store values are read at call time, so callers such as
|
|
9
|
+
* error fallbacks don't subscribe to dashboard or editor state to offer it.
|
|
10
|
+
*/
|
|
11
|
+
export declare function openCardInVisualEditor({ frame, card, }: {
|
|
12
|
+
frame: TFrame;
|
|
13
|
+
card: TCard;
|
|
14
|
+
}): void;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { PaginationConfig, PaginationMetadata } from '../types/explorer-types.js';
|
|
2
|
+
export type DashboardCardPaginationState = PaginationConfig & {
|
|
3
|
+
queryInputIdentity: string;
|
|
4
|
+
};
|
|
5
|
+
type ResolveDashboardCardPaginationParams = {
|
|
6
|
+
current?: DashboardCardPaginationState;
|
|
7
|
+
defaultPageSize: number;
|
|
8
|
+
queryInputIdentity: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Attaches a runtime page to the data-shaping query it belongs to. A changed
|
|
12
|
+
* query always starts on page one, while the viewer's chosen page size carries
|
|
13
|
+
* forward across filters, controls, selections, and sorts.
|
|
14
|
+
*/
|
|
15
|
+
export declare function resolveDashboardCardPagination({ current, defaultPageSize, queryInputIdentity, }: ResolveDashboardCardPaginationParams): PaginationConfig;
|
|
16
|
+
export declare function dashboardCardPaginationMatches(current: DashboardCardPaginationState | undefined, pagination: PaginationConfig, queryInputIdentity: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Keeps pagination chrome aligned with the request being rendered while React
|
|
19
|
+
* Query retains the previous response. Counts and navigation capability remain
|
|
20
|
+
* useful placeholders, but the displayed page must belong to the current query
|
|
21
|
+
* input identity.
|
|
22
|
+
*/
|
|
23
|
+
export declare function resolveDashboardPaginationMetadata(metadata: PaginationMetadata | undefined, effectivePagination: PaginationConfig | undefined): PaginationMetadata | undefined;
|
|
24
|
+
export {};
|
|
@@ -12,6 +12,8 @@ export declare function useCard(cardId: string): {
|
|
|
12
12
|
handleDatapointClick: (chart: Chart, datasetIndex: number, clickIndex: number, value: number) => void;
|
|
13
13
|
cfg: any;
|
|
14
14
|
queryKey: string[];
|
|
15
|
+
queryInputIdentity: string | undefined;
|
|
16
|
+
effectivePaginationConfig: import('../types/index.js').PaginationConfig | undefined;
|
|
15
17
|
queryRequestPayload: Record<string, unknown> | undefined;
|
|
16
18
|
pagination: import('../types/index.js').PaginationMetadata | undefined;
|
|
17
19
|
comparisonMetadata: import('../../shared/analytics-protocol/index.js').MetricComparisonMetadataMap | undefined;
|
|
@@ -30,6 +32,8 @@ export declare function useDashboardCard(card: TCard): {
|
|
|
30
32
|
handleDatapointClick: (chart: Chart, datasetIndex: number, clickIndex: number, value: number) => void;
|
|
31
33
|
cfg: any;
|
|
32
34
|
queryKey: string[];
|
|
35
|
+
queryInputIdentity: string | undefined;
|
|
36
|
+
effectivePaginationConfig: import('../types/index.js').PaginationConfig | undefined;
|
|
33
37
|
queryRequestPayload: Record<string, unknown> | undefined;
|
|
34
38
|
pagination: import('../types/index.js').PaginationMetadata | undefined;
|
|
35
39
|
comparisonMetadata: import('../../shared/analytics-protocol/index.js').MetricComparisonMetadataMap | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
2
|
import { ControlDefinition, DashboardInputValues, TCard } from '../types/common-types.js';
|
|
3
|
-
import { CardConfig, PaginationMetadata, TableTotalsRequest } from '../types/explorer-types.js';
|
|
3
|
+
import { CardConfig, PaginationConfig, PaginationMetadata, TableTotalsRequest } from '../types/explorer-types.js';
|
|
4
4
|
import { AutoJoinMetadata, ComparisonMetadataMap } from '../types/query-types.js';
|
|
5
5
|
import { SemanticExecutionPayloadAuthority } from '../query-context/use-semantic-execution-payload-for-cards.js';
|
|
6
6
|
import { TFilterValue } from '../../components/surfboard/filter/types.js';
|
|
@@ -15,6 +15,8 @@ type AdditionalState = {
|
|
|
15
15
|
isFilteringCard: boolean;
|
|
16
16
|
isSingleCardFrame: boolean;
|
|
17
17
|
queryKey: string[];
|
|
18
|
+
queryInputIdentity?: string;
|
|
19
|
+
effectivePaginationConfig?: PaginationConfig;
|
|
18
20
|
errorMessage: string;
|
|
19
21
|
errorSql: string;
|
|
20
22
|
pagination?: PaginationMetadata;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TFilterValue } from '../../components/surfboard/filter/types.js';
|
|
2
2
|
import { getCacheConfig } from '../stores/utils.js';
|
|
3
3
|
import { ControlBinding, ControlDefinition, TCard } from '../types/common-types.js';
|
|
4
|
-
import { CardConfig } from '../types/explorer-types.js';
|
|
4
|
+
import { CardConfig, PaginationConfig } from '../types/explorer-types.js';
|
|
5
5
|
import { ResolvedPrimaryDateField } from '../types/semantic-runtime-types.js';
|
|
6
6
|
import { TableConfig } from '../types/query-types.js';
|
|
7
7
|
import { CardQueryContext, CompiledCardQueryContext } from './build-card-query-context.js';
|
|
@@ -33,6 +33,8 @@ export type DashboardCardQueryRequestPayloadBase = {
|
|
|
33
33
|
export type DashboardCardQueryContract = {
|
|
34
34
|
status: 'ready';
|
|
35
35
|
queryKey: string[];
|
|
36
|
+
queryInputIdentity: string;
|
|
37
|
+
paginationConfig?: PaginationConfig;
|
|
36
38
|
requestPayloadBase: DashboardCardQueryRequestPayloadBase;
|
|
37
39
|
tableConfig: TableConfig;
|
|
38
40
|
compiledFilters: CompiledDashboardCardFilters;
|
|
@@ -51,6 +53,7 @@ export type DashboardCardQueryExecutionOptions = {
|
|
|
51
53
|
calendarContext: CalendarContext;
|
|
52
54
|
allowGlobalDateMinutePrecision?: boolean;
|
|
53
55
|
globalDateComparisonReferenceTime?: string;
|
|
56
|
+
resolvePaginationConfig?: (queryInputIdentity: string) => PaginationConfig | undefined;
|
|
54
57
|
};
|
|
55
58
|
/** One final compilation for interactive requests and immutable input captures. */
|
|
56
59
|
export declare function compileDashboardCardQueryContext(card: TCard, context: CardQueryContext, execution: Omit<CompileDashboardCardFiltersParams, 'card' | 'cardConfig' | 'input'>): {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ControlBinding, ControlDefinition, TCard } from '../types/common-types.js';
|
|
2
2
|
import { ResolvedPrimaryDateField } from '../types/semantic-runtime-types.js';
|
|
3
|
-
import { CardConfig } from '../types/explorer-types.js';
|
|
3
|
+
import { CardConfig, PaginationConfig } from '../types/explorer-types.js';
|
|
4
4
|
import { GlobalDateComparisonContext } from '../../shared/analytics-protocol/index.js';
|
|
5
5
|
import { CalendarContext } from '../../shared/report-runtime-context/index.js';
|
|
6
6
|
export declare const isPaginatedCardType: (card: TCard) => boolean;
|
|
@@ -25,4 +25,16 @@ export declare function dashboardCardQueryKeysMatch(currentQueryKey: readonly un
|
|
|
25
25
|
* lifecycle effects must depend on this value rather than array identity.
|
|
26
26
|
*/
|
|
27
27
|
export declare function serializeDashboardCardQueryKey(queryKey: readonly unknown[]): string;
|
|
28
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Builds the cache identity and the data-shaping identity from one projection.
|
|
30
|
+
* Pagination belongs in the cache key, but is deliberately excluded from the
|
|
31
|
+
* input identity so consumers can distinguish paging from a changed result set.
|
|
32
|
+
*/
|
|
33
|
+
export declare function createDashboardCardQueryIdentities(card: TCard, options: CreateDashboardCardQueryKeyOptions, identityOptions?: {
|
|
34
|
+
resolvePaginationConfig?: (queryInputIdentity: string) => PaginationConfig | undefined;
|
|
35
|
+
}): {
|
|
36
|
+
queryKey: string[];
|
|
37
|
+
queryInputIdentity: string;
|
|
38
|
+
paginationConfig: PaginationConfig | undefined;
|
|
39
|
+
};
|
|
40
|
+
export declare function createDashboardCardQueryKey(card: TCard, options: CreateDashboardCardQueryKeyOptions): string[];
|
|
@@ -16,6 +16,7 @@ import { CalendarPreferencesResponse, ReportRuntimeContext, ResolvedCalendarPref
|
|
|
16
16
|
import { ResolvedValueFormatPreferenceSources, ResolvedValueFormatPreferences } from '../../shared/value-format-preferences/index.js';
|
|
17
17
|
import { DashboardNavigationEntry, DashboardNavigationState, DashboardTransientContextScope, InsightRenderRequest, NavigationRejection } from '../dashboard-navigation/index.js';
|
|
18
18
|
import { CardViewStateMap, DrillStep } from '../dashboard-view-state/index.js';
|
|
19
|
+
import { DashboardCardPaginationState } from '../dashboard-pagination/dashboard-card-pagination.js';
|
|
19
20
|
type AddFrameOptions = {
|
|
20
21
|
position?: 'start' | 'end';
|
|
21
22
|
insertAfterFrameId?: string;
|
|
@@ -97,6 +98,8 @@ export type DashboardStore = {
|
|
|
97
98
|
dashboardInputValues: DashboardInputValues;
|
|
98
99
|
/** Session-only per-card view state (the drill path), keyed by cardId. Never persisted. */
|
|
99
100
|
cardViewState: CardViewStateMap;
|
|
101
|
+
/** Session-only server pagination, attached to the query identity that owns each page. */
|
|
102
|
+
dashboardCardPagination: Record<string, DashboardCardPaginationState>;
|
|
100
103
|
/** Fixed execution clock from a strict dashboard input replay snapshot. */
|
|
101
104
|
dashboardInputReferenceTime?: string;
|
|
102
105
|
semanticExecutionPayload: SemanticExecutionPayload;
|
|
@@ -177,6 +180,7 @@ type Actions = {
|
|
|
177
180
|
popDrillStep: (cardId: string) => void;
|
|
178
181
|
resetCardViewState: (cardId: string) => void;
|
|
179
182
|
resetAllCardViewState: () => void;
|
|
183
|
+
setDashboardCardPagination: (cardId: string, pagination: DashboardCardPaginationState) => void;
|
|
180
184
|
setDashboardControlsModel: (controls: ControlDefinition[], defaultValues?: Record<string, unknown>, options?: DashboardControlsModelOptions) => void;
|
|
181
185
|
updateDashboardControl: (controlId: string, updates: Partial<ControlDefinition>) => void;
|
|
182
186
|
reorderDashboardControls: (orderedControlIds: string[]) => void;
|
|
@@ -8,6 +8,7 @@ type CardLoadingPresentationInput = {
|
|
|
8
8
|
hasRecords?: boolean;
|
|
9
9
|
};
|
|
10
10
|
export declare function shouldUseCardSkeletonDuringRefetch(card: Pick<TCard, 'type'> | undefined): boolean;
|
|
11
|
+
export declare function showsOwnRefetchCue(card: Pick<TCard, 'type'> | undefined): boolean;
|
|
11
12
|
export declare function getCardLoadingPresentation({ card, fetchStatus, isLoading, isFetching, isPending, hasRecords, }: CardLoadingPresentationInput): {
|
|
12
13
|
isBusy: boolean;
|
|
13
14
|
showCardSkeleton: boolean;
|