react-semaphor 0.1.568 → 0.1.569
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/README.md +0 -7
- package/dist/analytics-protocol/index.js +434 -454
- package/dist/assistant-context/index.js +1 -1
- package/dist/brand-studio/index.js +10 -12
- package/dist/briefings/index.js +4 -4
- package/dist/chunks/{_commonjsHelpers-DimLPMtv.js → _commonjsHelpers-Bid1ZNYj.js} +271 -222
- package/dist/chunks/{assistant-chat-BN5I8KuN.js → assistant-chat-Dzf2Mbph.js} +107 -109
- package/dist/chunks/{bookmark-impact-CJ-65omV.js → bookmark-impact-Czg6FGt5.js} +2 -2
- package/dist/chunks/{bookmark-state-Du3s13_V.js → bookmark-state-CflS88gq.js} +251 -250
- package/dist/chunks/{card-filter-builder-BBuB99GZ.js → card-filter-builder-BS982X7x.js} +986 -985
- package/dist/chunks/{code-editor-DJNOsgJH.js → code-editor-BsxHzm9u.js} +43 -45
- package/dist/chunks/{comparison-window-caption-CMLb3mut.js → comparison-window-caption-lLTgzOkM.js} +252 -253
- package/dist/chunks/{dashboard-YnWZC4dK.js → dashboard-BiYSbxZv.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-BF89TU2h.js → dashboard-briefing-launcher-Bdj7luOr.js} +158 -159
- package/dist/chunks/{dashboard-controls-atHc1EjP.js → dashboard-controls-TViDsnb8.js} +17 -19
- package/dist/chunks/dashboard-json-Dg9dQd9U.js +66 -0
- package/dist/chunks/{dates-CKO05ino.js → dates-BsPrWZIP.js} +8 -8
- package/dist/chunks/{edit-dashboard-visual-DdmTfn-J.js → edit-dashboard-visual-C6hoIeEJ.js} +20 -21
- package/dist/chunks/{filter-reach-copy-jZGzK_IH.js → filter-reach-copy-hcQ4os0u.js} +695 -699
- package/dist/chunks/filter-value-text-CVxEEDVl.js +146 -0
- package/dist/chunks/{index-CPNZW0mu.js → index-G4q89J6O.js} +74 -76
- package/dist/chunks/{layout-grid-0hIlqEtk.js → layout-grid-BIcoFfdS.js} +1 -1
- package/dist/chunks/{list-filter-DkgoCeBm.js → list-filter-C6tYkHyv.js} +1 -1
- package/dist/chunks/matrix-analytical-definition-dkS8szLM.js +1253 -0
- package/dist/chunks/matrix-member-presentation-DRa-9e6Q.js +169 -0
- package/dist/chunks/{matrix-operation-contract-Eb6elidS.js → matrix-operation-contract-DCVinw1o.js} +122 -122
- package/dist/chunks/{metric-comparison-ChXUFaZu.js → metric-comparison-n9NsIa-2.js} +175 -128
- package/dist/chunks/{palette-4vf2BEEg.js → palette-NjHOE_6B.js} +1 -1
- package/dist/chunks/pivot-result-contract-expectations-DkmueDTW.js +55 -0
- package/dist/chunks/{pivot-result-identity-BlbLrqaC.js → pivot-result-identity-B89X5xjb.js} +1 -1
- package/dist/chunks/raw-temporal-value-DdT0s47W.js +159 -0
- package/dist/chunks/{report-preferences-dialog-Mbd-I0wV.js → report-preferences-dialog-Xc8_GFju.js} +26 -28
- package/dist/chunks/{report-runtime-context-DnA_PiKo.js → report-runtime-context-BhPzLTbS.js} +1 -1
- package/dist/chunks/{resolve-dashboard-input-context-Du0fjN3h.js → resolve-dashboard-input-context-KqvcLcTM.js} +4784 -4764
- package/dist/chunks/{save-D6pHmSSP.js → save-C6VmEJTA.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-y8N6RvjS.js → saved-dashboard-context-BeXXyoD4.js} +6 -6
- package/dist/chunks/{semaphor-ready-indicator-BSEdUq40.js → semaphor-ready-indicator-BNkaANsG.js} +28395 -28384
- package/dist/chunks/{shelf-drop-preview-context-D7QqPl36.js → shelf-drop-preview-context-C_issPBA.js} +18 -20
- package/dist/chunks/{stored-dashboard-d3xQYxBD.js → stored-dashboard-B6_StAty.js} +263 -265
- package/dist/chunks/{table-export-sheet--DUKWk6o.js → table-export-sheet-BWP2joD1.js} +1 -1
- package/dist/chunks/{temporal-input-presentation--2r9BLr0.js → temporal-input-presentation-scSWQXAB.js} +4 -4
- package/dist/chunks/{token-types-C8JymO8s.js → token-types-iKMplaBL.js} +1 -1
- package/dist/chunks/{upload-Cf3wXZT8.js → upload-BRW4Mwrd.js} +1 -1
- package/dist/chunks/validators-B8fpdinG.js +3651 -0
- package/dist/chunks/{variable-draft-DOX03R4A.js → variable-draft-BQ3OMjvy.js} +4 -4
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +1527 -1517
- package/dist/format-utils/index.js +230 -231
- package/dist/index.js +236 -237
- package/dist/report-runtime-context/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/surfboard/filter/types.d.ts +5 -4
- package/dist/types/components/ui-custom/date-range-presets.d.ts +1 -17
- package/dist/types/index.js +9 -9
- package/dist/types/lib/hooks/use-date-filter.d.ts +3 -3
- package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +1 -1
- package/dist/types/lib/types/explorer-types.d.ts +2 -2
- package/dist/types/lib/types/index.d.ts +1 -1
- package/dist/types/lib/utils/card-definition.d.ts +7 -7
- package/dist/types/shared/analytics-protocol/agent-time-window.d.ts +84 -0
- package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +2 -2
- package/dist/types/shared/analytics-protocol/contracts.d.ts +8 -17
- package/dist/types/shared/analytics-protocol/fixtures.d.ts +3 -2
- package/dist/types/shared/analytics-protocol/index.d.ts +2 -4
- package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +4 -4
- package/dist/types/shared/analytics-protocol/relative-date/describe.d.ts +18 -0
- package/dist/types/shared/analytics-protocol/relative-date/index.d.ts +7 -0
- package/dist/types/shared/analytics-protocol/relative-date/limits.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/relative-date/presets.d.ts +11 -0
- package/dist/types/shared/analytics-protocol/relative-date/resolve.d.ts +49 -0
- package/dist/types/shared/analytics-protocol/relative-date/schemas.d.ts +76 -0
- package/dist/types/shared/analytics-protocol/relative-date/traits.d.ts +51 -0
- package/dist/types/shared/analytics-protocol/relative-date/window.d.ts +111 -0
- package/dist/types/shared/analytics-protocol/selection-contract.d.ts +1 -1
- package/dist/types/shared/assistant-protocol/context.d.ts +12 -12
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +0 -2
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +155 -1753
- package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +8 -4
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +74 -74
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +20 -20
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +3 -0
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +10 -2
- package/dist/types/shared/format-utils/filter-detail.d.ts +2 -8
- package/dist/types/shared/format-utils/filter-line.d.ts +2 -2
- package/dist/types/shared/format-utils/matrix-continuation.d.ts +3 -3
- package/dist/types/shared/temporal/index.d.ts +0 -2
- package/dist/types/shared/temporal/temporal-parity-fixtures.d.ts +2 -2
- package/package.json +2 -24
- package/DATA_APP_SDK.md +0 -339
- package/dist/chunks/dashboard-json-Cxp3inxd.js +0 -68
- package/dist/chunks/filter-value-text-7zhmth1S.js +0 -163
- package/dist/chunks/index-CuHybtft.js +0 -51
- package/dist/chunks/matrix-analytical-definition-C9xB_T84.js +0 -717
- package/dist/chunks/matrix-card-BSUeSXpD.js +0 -42
- package/dist/chunks/matrix-member-presentation-DZNgQpUq.js +0 -105
- package/dist/chunks/operators-B3zZoskU.js +0 -66
- package/dist/chunks/pivot-result-contract-expectations-Ddh1rNz5.js +0 -56
- package/dist/chunks/raw-temporal-value-Bqz8wc7L.js +0 -242
- package/dist/chunks/selection-reducer-OaJ-N5uN.js +0 -46
- package/dist/chunks/source-entity-resolution-DF6GulDn.js +0 -607
- package/dist/chunks/validators-wtjw0aw6.js +0 -3332
- package/dist/data-app-sdk/index.js +0 -1412
- package/dist/data-app-sdk-adapters/index.js +0 -361
- package/dist/data-app-sdk-validation/index.js +0 -1031
- package/dist/types/data-app-sdk/adapters.d.ts +0 -35
- package/dist/types/data-app-sdk/builders.d.ts +0 -62
- package/dist/types/data-app-sdk/contracts.d.ts +0 -419
- package/dist/types/data-app-sdk/executor.d.ts +0 -5
- package/dist/types/data-app-sdk/field-catalog-validation.d.ts +0 -29
- package/dist/types/data-app-sdk/hooks.d.ts +0 -11
- package/dist/types/data-app-sdk/index.d.ts +0 -9
- package/dist/types/data-app-sdk/provider.d.ts +0 -8
- package/dist/types/data-app-sdk/relationship-aware-field-policy.d.ts +0 -21
- package/dist/types/data-app-sdk/selection.d.ts +0 -2
- package/dist/types/data-app-sdk/validation.d.ts +0 -58
- package/dist/types/data-app-sdk-adapters.d.ts +0 -2
- package/dist/types/data-app-sdk-validation.d.ts +0 -2
- package/dist/types/data-app-sdk.d.ts +0 -2
- package/dist/types/shared/analytics-protocol/relative-date-filter.d.ts +0 -68
- package/dist/types/shared/analytics-protocol/relative-date-label.d.ts +0 -20
- package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +0 -314
- package/dist/types/shared/analytics-protocol/time-window.d.ts +0 -52
- package/dist/types/shared/temporal/relative-date.d.ts +0 -21
- package/dist/types/shared/temporal/time-window-periods.d.ts +0 -21
- package/src/data-app-sdk/README.md +0 -402
|
@@ -197,16 +197,16 @@ export declare const controlDefinitionExecutionSchema: z.ZodEffects<z.ZodObject<
|
|
|
197
197
|
valueColumn: string;
|
|
198
198
|
labelColumn?: string | undefined;
|
|
199
199
|
};
|
|
200
|
-
scope: "
|
|
200
|
+
scope: "dashboard" | "card";
|
|
201
201
|
requiredAtExecution: boolean;
|
|
202
|
-
initialValueStrategy: "saved_default" | "
|
|
202
|
+
initialValueStrategy: "saved_default" | "embed_required" | "builtin" | "schedule_snapshot";
|
|
203
203
|
defaultValue?: unknown;
|
|
204
204
|
hidden?: boolean | undefined;
|
|
205
|
-
showLabel?: boolean | undefined;
|
|
206
|
-
toolbarWidth?: number | undefined;
|
|
207
205
|
locked?: boolean | undefined;
|
|
208
206
|
helpText?: string | undefined;
|
|
209
|
-
placement?: "toolbar" | "
|
|
207
|
+
placement?: "toolbar" | "advanced" | "card_header" | undefined;
|
|
208
|
+
showLabel?: boolean | undefined;
|
|
209
|
+
toolbarWidth?: number | undefined;
|
|
210
210
|
}, {
|
|
211
211
|
type: "number" | "boolean" | "date" | "text" | "enum" | "multi_enum" | "field_selector" | "metric_selector" | "aggregation_selector" | "grain_selector";
|
|
212
212
|
id: string;
|
|
@@ -240,16 +240,16 @@ export declare const controlDefinitionExecutionSchema: z.ZodEffects<z.ZodObject<
|
|
|
240
240
|
valueColumn: string;
|
|
241
241
|
labelColumn?: string | undefined;
|
|
242
242
|
};
|
|
243
|
-
scope: "
|
|
243
|
+
scope: "dashboard" | "card";
|
|
244
244
|
requiredAtExecution: boolean;
|
|
245
|
-
initialValueStrategy: "saved_default" | "
|
|
245
|
+
initialValueStrategy: "saved_default" | "embed_required" | "builtin" | "schedule_snapshot";
|
|
246
246
|
defaultValue?: unknown;
|
|
247
247
|
hidden?: boolean | undefined;
|
|
248
|
-
showLabel?: boolean | undefined;
|
|
249
|
-
toolbarWidth?: number | undefined;
|
|
250
248
|
locked?: boolean | undefined;
|
|
251
249
|
helpText?: string | undefined;
|
|
252
|
-
placement?: "toolbar" | "
|
|
250
|
+
placement?: "toolbar" | "advanced" | "card_header" | undefined;
|
|
251
|
+
showLabel?: boolean | undefined;
|
|
252
|
+
toolbarWidth?: number | undefined;
|
|
253
253
|
}>, {
|
|
254
254
|
type: "number" | "boolean" | "date" | "text" | "enum" | "multi_enum" | "field_selector" | "metric_selector" | "aggregation_selector" | "grain_selector";
|
|
255
255
|
id: string;
|
|
@@ -283,16 +283,16 @@ export declare const controlDefinitionExecutionSchema: z.ZodEffects<z.ZodObject<
|
|
|
283
283
|
valueColumn: string;
|
|
284
284
|
labelColumn?: string | undefined;
|
|
285
285
|
};
|
|
286
|
-
scope: "
|
|
286
|
+
scope: "dashboard" | "card";
|
|
287
287
|
requiredAtExecution: boolean;
|
|
288
|
-
initialValueStrategy: "saved_default" | "
|
|
288
|
+
initialValueStrategy: "saved_default" | "embed_required" | "builtin" | "schedule_snapshot";
|
|
289
289
|
defaultValue?: unknown;
|
|
290
290
|
hidden?: boolean | undefined;
|
|
291
|
-
showLabel?: boolean | undefined;
|
|
292
|
-
toolbarWidth?: number | undefined;
|
|
293
291
|
locked?: boolean | undefined;
|
|
294
292
|
helpText?: string | undefined;
|
|
295
|
-
placement?: "toolbar" | "
|
|
293
|
+
placement?: "toolbar" | "advanced" | "card_header" | undefined;
|
|
294
|
+
showLabel?: boolean | undefined;
|
|
295
|
+
toolbarWidth?: number | undefined;
|
|
296
296
|
}, {
|
|
297
297
|
type: "number" | "boolean" | "date" | "text" | "enum" | "multi_enum" | "field_selector" | "metric_selector" | "aggregation_selector" | "grain_selector";
|
|
298
298
|
id: string;
|
|
@@ -326,16 +326,16 @@ export declare const controlDefinitionExecutionSchema: z.ZodEffects<z.ZodObject<
|
|
|
326
326
|
valueColumn: string;
|
|
327
327
|
labelColumn?: string | undefined;
|
|
328
328
|
};
|
|
329
|
-
scope: "
|
|
329
|
+
scope: "dashboard" | "card";
|
|
330
330
|
requiredAtExecution: boolean;
|
|
331
|
-
initialValueStrategy: "saved_default" | "
|
|
331
|
+
initialValueStrategy: "saved_default" | "embed_required" | "builtin" | "schedule_snapshot";
|
|
332
332
|
defaultValue?: unknown;
|
|
333
333
|
hidden?: boolean | undefined;
|
|
334
|
-
showLabel?: boolean | undefined;
|
|
335
|
-
toolbarWidth?: number | undefined;
|
|
336
334
|
locked?: boolean | undefined;
|
|
337
335
|
helpText?: string | undefined;
|
|
338
|
-
placement?: "toolbar" | "
|
|
336
|
+
placement?: "toolbar" | "advanced" | "card_header" | undefined;
|
|
337
|
+
showLabel?: boolean | undefined;
|
|
338
|
+
toolbarWidth?: number | undefined;
|
|
339
339
|
}>;
|
|
340
340
|
export declare const controlBindingExecutionSchema: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
|
|
341
341
|
controlId: z.ZodString;
|
|
@@ -10,6 +10,7 @@ import { NotEditableReason, OutlineCardSource } from '../changes/read-card-query
|
|
|
10
10
|
import { CardQuery, MatrixColumns } from '../changes/dashboard-change.js';
|
|
11
11
|
import { OutlineFilter } from './outline-filters.js';
|
|
12
12
|
import { CalendarContext } from '../../report-runtime-context/index.js';
|
|
13
|
+
import { AgentTimeWindowRefusal } from '../../analytics-protocol/agent-time-window.js';
|
|
13
14
|
/**
|
|
14
15
|
* A dashboard in the change vocabulary (MCP dashboard editing SPEC 3.6,
|
|
15
16
|
* DE-D29, DE-D34): every sheet, every card the shared traversal lists
|
|
@@ -51,6 +52,8 @@ export type OutlineCard = ({
|
|
|
51
52
|
/** Absent only when the outline is truncated. */
|
|
52
53
|
query?: CardQuery;
|
|
53
54
|
matrix?: MatrixColumns;
|
|
55
|
+
/** The query's stored window is one a card can't be saved with now: its refusal and replacements (relative-date-as-of SPEC-B 3.6). */
|
|
56
|
+
timeWindowReadOnly?: AgentTimeWindowRefusal;
|
|
54
57
|
} & CardTypeProperties &
|
|
55
58
|
/** How the card reads and shows, in the shape a change takes; absent when the outline is truncated (card appearance SPEC 3.2). */
|
|
56
59
|
Partial<CardSettingsView>) | OutlineTextCard | ({
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { TDashboard } from '../../../lib/types/common-types.js';
|
|
2
2
|
import { DashboardFilterNotReachedReason, DashboardRelationshipReachResolver } from '../../../lib/query-context/dashboard-filter-mapping-resolution.js';
|
|
3
3
|
import { FilterInputEntry } from '../filter-model/index.js';
|
|
4
|
+
import { AgentTimeWindowRefusal } from '../../analytics-protocol/agent-time-window.js';
|
|
5
|
+
import { RelativeDateWindow } from '../../analytics-protocol/relative-date/index.js';
|
|
4
6
|
import { CalendarContext } from '../../report-runtime-context/index.js';
|
|
5
|
-
import { FilterValue
|
|
7
|
+
import { FilterValue } from '../changes/dashboard-change.js';
|
|
6
8
|
/**
|
|
7
9
|
* Every dashboard filter in the change vocabulary (MCP dashboard editing
|
|
8
10
|
* DE-D58, SPEC 3.6). A field filter on one semantic dataset shown on every
|
|
@@ -23,7 +25,13 @@ export type OutlineFilter = {
|
|
|
23
25
|
/** The values it loads with, read through the default owner (a saved default first, else the definition). */
|
|
24
26
|
defaultValues?: FilterValue[];
|
|
25
27
|
/** The window it loads with, only when the loaded default keeps one (a day picker clamps a wider window to a day). */
|
|
26
|
-
defaultPeriod?:
|
|
28
|
+
defaultPeriod?: RelativeDateWindow;
|
|
29
|
+
/**
|
|
30
|
+
* The stored default is one a filter can't be given now (Plan B SPEC-B
|
|
31
|
+
* 3.6): the refusal a write of it gets, and the windows that can replace
|
|
32
|
+
* it. It stays while filter.update leaves defaultPeriod out.
|
|
33
|
+
*/
|
|
34
|
+
defaultPeriodReadOnly?: AgentTimeWindowRefusal;
|
|
27
35
|
/** For a date filter, the picker a viewer gets: one day, one month, or a range. */
|
|
28
36
|
datePicker?: 'day' | 'month' | 'range';
|
|
29
37
|
/** "all": every grid sheet. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Operator } from '../../lib/types/explorer-types.js';
|
|
2
2
|
import { TemporalBucketMetadata } from '../analytics-protocol/contracts.js';
|
|
3
|
-
import {
|
|
3
|
+
import { RelativeDateWindow } from '../analytics-protocol/relative-date/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* Filter conditions in full detail, for readers that restate a condition
|
|
6
6
|
* rather than glance at it (analytics agent Plan 1, D3a-4): the one renderer
|
|
@@ -32,7 +32,7 @@ export type FullDetailCondition = {
|
|
|
32
32
|
values: readonly unknown[];
|
|
33
33
|
reading: FilterLiteralReading;
|
|
34
34
|
/** A relative window, authoritative over the bounds it last resolved to. */
|
|
35
|
-
relative?:
|
|
35
|
+
relative?: RelativeDateWindow;
|
|
36
36
|
/** Compared with the field's latest value, resolved at run time. */
|
|
37
37
|
latestValue?: boolean;
|
|
38
38
|
/** The label a visual showed for the value. */
|
|
@@ -62,9 +62,3 @@ export declare function formatFilterLiteral(value: unknown, reading?: FilterLite
|
|
|
62
62
|
export declare function formatFilterLiteralList(values: readonly unknown[], reading?: FilterLiteralReading, max?: number): string;
|
|
63
63
|
/** How many of `count` values a list of at most `max` leaves out. */
|
|
64
64
|
export declare function omittedValueCount(count: number, max?: number): number;
|
|
65
|
-
/**
|
|
66
|
-
* What a relative window covers, in words that leave nothing to a preset
|
|
67
|
-
* name: its anchor (now, or the latest date in the data) and whether it keeps
|
|
68
|
-
* only whole periods.
|
|
69
|
-
*/
|
|
70
|
-
export declare function describeRelativeDateDefinition(relative: RelativeDateFilter): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RelativeDateWindow } from '../analytics-protocol/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* The fields of a filter value the filter line reads. A dashboard filter
|
|
4
4
|
* value fits it; the server builds a run's line from the same saved values.
|
|
@@ -39,7 +39,7 @@ export declare const FILTER_LINE_MAX_LISTED_VALUES = 10;
|
|
|
39
39
|
* card's data model, so one set of dates could be wrong for some cards. Any
|
|
40
40
|
* other relative window prints the dates it resolves to.
|
|
41
41
|
*/
|
|
42
|
-
export declare function readNamedRelativeWindow(filter: FilterLineValue):
|
|
42
|
+
export declare function readNamedRelativeWindow(filter: FilterLineValue): RelativeDateWindow | undefined;
|
|
43
43
|
/**
|
|
44
44
|
* One filter value as a readable condition, operator included: "Region not in
|
|
45
45
|
* (West)", "Amount ≥ 100". Empty for a non-null operation with no values.
|
|
@@ -96,13 +96,13 @@ export declare const matrixBatchResponseSchema: z.ZodDiscriminatedUnion<"kind",
|
|
|
96
96
|
deadlineAt: z.ZodNumber;
|
|
97
97
|
}, "strip", z.ZodTypeAny, {
|
|
98
98
|
kind: "committed";
|
|
99
|
-
sequence: number;
|
|
100
99
|
done: boolean;
|
|
100
|
+
sequence: number;
|
|
101
101
|
deadlineAt: number;
|
|
102
102
|
}, {
|
|
103
103
|
kind: "committed";
|
|
104
|
-
sequence: number;
|
|
105
104
|
done: boolean;
|
|
105
|
+
sequence: number;
|
|
106
106
|
deadlineAt: number;
|
|
107
107
|
}>]>;
|
|
108
108
|
/** Count the complete JSON envelope in UTF-8, including escaping and transport fields. */
|
|
@@ -121,8 +121,8 @@ export declare function parseMatrixBatchResponse(value: unknown, input: MatrixBa
|
|
|
121
121
|
}[];
|
|
122
122
|
} | {
|
|
123
123
|
kind: "committed";
|
|
124
|
-
sequence: number;
|
|
125
124
|
done: boolean;
|
|
125
|
+
sequence: number;
|
|
126
126
|
deadlineAt: number;
|
|
127
127
|
};
|
|
128
128
|
export declare const matrixManifestSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export * from './zoned-wall-clock.js';
|
|
2
2
|
export * from './calendar-periods.js';
|
|
3
|
-
export * from './relative-date.js';
|
|
4
|
-
export * from './time-window-periods.js';
|
|
5
3
|
export * from './calendar-day-equality.js';
|
|
6
4
|
export * from './raw-temporal-equality.js';
|
|
7
5
|
export * from './temporal-parity-fixtures.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StoredRelativeDate } from '../analytics-protocol/relative-date/index.js';
|
|
2
2
|
import { WeekStart } from '../report-runtime-context/index.js';
|
|
3
3
|
import { TemporalUnit } from './calendar-periods.js';
|
|
4
4
|
import { ZonedWallClockTime } from './zoned-wall-clock.js';
|
|
@@ -9,7 +9,7 @@ export type TemporalParityRelativeCase = {
|
|
|
9
9
|
/** The month-aligned fiscal year's first month, when the calendar has one. */
|
|
10
10
|
fiscalStart?: number;
|
|
11
11
|
anchor: string;
|
|
12
|
-
relative:
|
|
12
|
+
relative: StoredRelativeDate;
|
|
13
13
|
expected: [string, string];
|
|
14
14
|
/**
|
|
15
15
|
* The browser's old result where it differed, and the rule that changed
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"email": "support@semaphor.cloud"
|
|
6
6
|
},
|
|
7
7
|
"license": "MIT",
|
|
8
|
-
"version": "0.1.
|
|
8
|
+
"version": "0.1.569",
|
|
9
9
|
"description": "Fully interactive and customizable dashboards for your apps.",
|
|
10
10
|
"keywords": [
|
|
11
11
|
"react",
|
|
@@ -16,9 +16,7 @@
|
|
|
16
16
|
"type": "module",
|
|
17
17
|
"files": [
|
|
18
18
|
"dist",
|
|
19
|
-
"CHANGELOG.md"
|
|
20
|
-
"DATA_APP_SDK.md",
|
|
21
|
-
"src/data-app-sdk/README.md"
|
|
19
|
+
"CHANGELOG.md"
|
|
22
20
|
],
|
|
23
21
|
"main": "dist/index.js",
|
|
24
22
|
"module": "dist/index.js",
|
|
@@ -64,18 +62,6 @@
|
|
|
64
62
|
"types": "./dist/types/assistant-context.d.ts",
|
|
65
63
|
"import": "./dist/assistant-context/index.js"
|
|
66
64
|
},
|
|
67
|
-
"./data-app-sdk": {
|
|
68
|
-
"types": "./dist/types/data-app-sdk.d.ts",
|
|
69
|
-
"import": "./dist/data-app-sdk/index.js"
|
|
70
|
-
},
|
|
71
|
-
"./data-app-sdk/adapters": {
|
|
72
|
-
"types": "./dist/types/data-app-sdk-adapters.d.ts",
|
|
73
|
-
"import": "./dist/data-app-sdk-adapters/index.js"
|
|
74
|
-
},
|
|
75
|
-
"./data-app-sdk/validation": {
|
|
76
|
-
"types": "./dist/types/data-app-sdk-validation.d.ts",
|
|
77
|
-
"import": "./dist/data-app-sdk-validation/index.js"
|
|
78
|
-
},
|
|
79
65
|
"./appearance": {
|
|
80
66
|
"types": "./dist/types/appearance.d.ts",
|
|
81
67
|
"import": "./dist/appearance/index.js"
|
|
@@ -161,7 +147,6 @@
|
|
|
161
147
|
"@dnd-kit/sortable": "^10.0.0",
|
|
162
148
|
"@dnd-kit/utilities": "^3.2.2",
|
|
163
149
|
"@floating-ui/react-dom": "^2.1.8",
|
|
164
|
-
"@lexical/history": "^0.43.0",
|
|
165
150
|
"@lexical/link": "^0.43.0",
|
|
166
151
|
"@lexical/list": "^0.43.0",
|
|
167
152
|
"@lexical/react": "^0.43.0",
|
|
@@ -225,7 +210,6 @@
|
|
|
225
210
|
"react-icons": "^5.0.1",
|
|
226
211
|
"react-markdown": "^9.0.1",
|
|
227
212
|
"react-resizable-panels": "^2.1.7",
|
|
228
|
-
"react-select": "^5.9.0",
|
|
229
213
|
"react-simple-code-editor": "^0.14.1",
|
|
230
214
|
"remark-gfm": "^4.0.1",
|
|
231
215
|
"sonner": "^1.5.0",
|
|
@@ -253,15 +237,11 @@
|
|
|
253
237
|
"react-is": "19.3.0"
|
|
254
238
|
},
|
|
255
239
|
"devDependencies": {
|
|
256
|
-
"@microsoft/api-extractor": "^7.58.7",
|
|
257
240
|
"@tanstack/react-query-devtools": "^5.62.15",
|
|
258
241
|
"@testing-library/jest-dom": "^6.9.1",
|
|
259
242
|
"@testing-library/react": "^16.3.0",
|
|
260
243
|
"@testing-library/user-event": "^14.6.1",
|
|
261
|
-
"@types/chart.js": "^2.9.41",
|
|
262
244
|
"@types/culori": "^4.0.1",
|
|
263
|
-
"@types/dompurify": "^3.0.5",
|
|
264
|
-
"@types/jsoneditor": "^9.9.5",
|
|
265
245
|
"@types/lodash.merge": "^4.6.9",
|
|
266
246
|
"@types/ms": "^0.7.34",
|
|
267
247
|
"@types/node": "^20.14.2",
|
|
@@ -277,7 +257,6 @@
|
|
|
277
257
|
"@vitest/ui": "^4.0.8",
|
|
278
258
|
"and": "^0.0.3",
|
|
279
259
|
"autoprefixer": "^10.4.18",
|
|
280
|
-
"babel-plugin-react-compiler": "^19.0.0-beta-e552027-20250112",
|
|
281
260
|
"eslint": "^8.55.0",
|
|
282
261
|
"eslint-plugin-react-compiler": "^19.0.0-beta-e552027-20250112",
|
|
283
262
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
@@ -295,7 +274,6 @@
|
|
|
295
274
|
"tailwindcss": "^3.4.1",
|
|
296
275
|
"typescript": "~5.8.2",
|
|
297
276
|
"vite": "^5.0.8",
|
|
298
|
-
"vite-plugin-css-injected-by-js": "^3.5.1",
|
|
299
277
|
"vite-plugin-dts": "^4.5.0",
|
|
300
278
|
"vitest": "^4.0.8"
|
|
301
279
|
}
|
package/DATA_APP_SDK.md
DELETED
|
@@ -1,339 +0,0 @@
|
|
|
1
|
-
# Data App SDK Quick Reference
|
|
2
|
-
|
|
3
|
-
> Frozen: no new work goes into this SDK. A false start, to be retired; no
|
|
4
|
-
> replacement SDK is planned for custom looks (they go through the dashboard
|
|
5
|
-
> runtime).
|
|
6
|
-
|
|
7
|
-
Use this as the public package quick reference for the Data App SDK. Prefer
|
|
8
|
-
these patterns over inspecting `dist/types` or SDK implementation files.
|
|
9
|
-
|
|
10
|
-
## Imports
|
|
11
|
-
|
|
12
|
-
```tsx
|
|
13
|
-
import {
|
|
14
|
-
SemaphorDataAppProvider,
|
|
15
|
-
semaphor,
|
|
16
|
-
useClearInvalidSemaphorInputValue,
|
|
17
|
-
useSemaphorInput,
|
|
18
|
-
useSemaphorInputs,
|
|
19
|
-
useSemaphorSelection,
|
|
20
|
-
useSemaphorQuery,
|
|
21
|
-
} from "react-semaphor/data-app-sdk";
|
|
22
|
-
|
|
23
|
-
import type {
|
|
24
|
-
SemaphorMetricQueryResult,
|
|
25
|
-
SemaphorRecordsField,
|
|
26
|
-
SemaphorRecordsQueryResult,
|
|
27
|
-
SemaphorSourceRef,
|
|
28
|
-
} from "react-semaphor/data-app-sdk";
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Runtime Provider
|
|
32
|
-
|
|
33
|
-
```tsx
|
|
34
|
-
const runtimeToken = import.meta.env.VITE_SEMAPHOR_PROJECT_TOKEN;
|
|
35
|
-
|
|
36
|
-
export function Root() {
|
|
37
|
-
return (
|
|
38
|
-
<SemaphorDataAppProvider token={runtimeToken} debug={import.meta.env.DEV}>
|
|
39
|
-
<App />
|
|
40
|
-
</SemaphorDataAppProvider>
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
With `debug` on, each query asks the server for debug detail. For an
|
|
46
|
-
organization user, the result's `executionResult.metadata.dataAppDebug` then
|
|
47
|
-
carries the request id, duration and compiled SQL. Keep it off in production
|
|
48
|
-
embeds.
|
|
49
|
-
|
|
50
|
-
## Source And Fields
|
|
51
|
-
|
|
52
|
-
```tsx
|
|
53
|
-
const orders = semaphor.source.semantic({
|
|
54
|
-
domainId: "sales",
|
|
55
|
-
datasetName: "orders",
|
|
56
|
-
datasetId: "sales.orders",
|
|
57
|
-
}) satisfies SemaphorSourceRef;
|
|
58
|
-
|
|
59
|
-
const revenue = semaphor.field.measure("revenue", {
|
|
60
|
-
label: "Revenue",
|
|
61
|
-
dataType: "number",
|
|
62
|
-
aggregate: "SUM",
|
|
63
|
-
source: orders,
|
|
64
|
-
}) satisfies SemaphorRecordsField;
|
|
65
|
-
|
|
66
|
-
const segment = semaphor.field.dimension("segment", {
|
|
67
|
-
label: "Segment",
|
|
68
|
-
dataType: "string",
|
|
69
|
-
source: orders,
|
|
70
|
-
}) satisfies SemaphorRecordsField;
|
|
71
|
-
|
|
72
|
-
const orderDate = semaphor.field.date("order_date", {
|
|
73
|
-
label: "Order Date",
|
|
74
|
-
dataType: "date",
|
|
75
|
-
source: orders,
|
|
76
|
-
});
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
## Metric
|
|
80
|
-
|
|
81
|
-
```tsx
|
|
82
|
-
const revenueKpi = semaphor.metric({
|
|
83
|
-
id: "revenue-kpi",
|
|
84
|
-
source: orders,
|
|
85
|
-
measures: [revenue],
|
|
86
|
-
primaryMeasure: revenue,
|
|
87
|
-
dateField: orderDate,
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
const result = useSemaphorQuery(revenueKpi);
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
## Records
|
|
94
|
-
|
|
95
|
-
```tsx
|
|
96
|
-
const revenueBySegment = semaphor.records({
|
|
97
|
-
id: "revenue-by-segment",
|
|
98
|
-
source: orders,
|
|
99
|
-
fields: [segment, revenue],
|
|
100
|
-
dateField: orderDate,
|
|
101
|
-
orderBy: { field: revenue, direction: "desc" },
|
|
102
|
-
limit: 10,
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
const result = useSemaphorQuery(revenueBySegment);
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
## Click Selection
|
|
109
|
-
|
|
110
|
-
Create one selection input per source chart. Keep it separate from scalar filter
|
|
111
|
-
and control inputs, pass its handle through the `selections` query option, and
|
|
112
|
-
render its removable chips in the app.
|
|
113
|
-
|
|
114
|
-
```tsx
|
|
115
|
-
const segmentSelection = semaphor.selection({
|
|
116
|
-
id: "segment-chart-selection",
|
|
117
|
-
label: "Segment chart selection",
|
|
118
|
-
fields: [segment],
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
function SegmentDashboard() {
|
|
122
|
-
const selection = useSemaphorSelection(segmentSelection);
|
|
123
|
-
const chartResult = useSemaphorQuery(revenueBySegment);
|
|
124
|
-
const detailResult = useSemaphorQuery(revenueBySegment, {
|
|
125
|
-
selections: [selection],
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
const enterprise = {
|
|
129
|
-
conditions: [
|
|
130
|
-
{ field: segment, operator: "=" as const, value: "Enterprise" },
|
|
131
|
-
],
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
return (
|
|
135
|
-
<>
|
|
136
|
-
<SegmentChart result={chartResult} selection={selection} />
|
|
137
|
-
<button onClick={() => selection.select(enterprise, { kind: "toggle" })}>
|
|
138
|
-
Enterprise
|
|
139
|
-
</button>
|
|
140
|
-
{selection.tuples.map((tuple) => (
|
|
141
|
-
<button
|
|
142
|
-
key={JSON.stringify(tuple)}
|
|
143
|
-
onClick={() => selection.select(tuple, { kind: "toggle" })}
|
|
144
|
-
>
|
|
145
|
-
{tuple.conditions.map((condition) => String(condition.value)).join(" · ")} ×
|
|
146
|
-
</button>
|
|
147
|
-
))}
|
|
148
|
-
<RecordsTable result={detailResult} />
|
|
149
|
-
</>
|
|
150
|
-
);
|
|
151
|
-
}
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
The source chart query deliberately omits its own selection handle, so selected
|
|
155
|
-
marks stay visible. Pass the handle to every query that should respond.
|
|
156
|
-
|
|
157
|
-
A tuple combines its conditions with AND. Multiple tuples combine with OR, so
|
|
158
|
-
`(region = West AND segment = Enterprise) OR (region = East AND segment = SMB)`
|
|
159
|
-
stays grouped. The shared reducer caps a selection at 100 distinct tuples and
|
|
160
|
-
returns `limitReached`; show that outcome beside the chips. Selection handles
|
|
161
|
-
have no `toAnalyticsInput()` method and never belong in `inputs`.
|
|
162
|
-
|
|
163
|
-
## Row Access
|
|
164
|
-
|
|
165
|
-
Read row values with `columns[].key`; display `columns[].label`.
|
|
166
|
-
|
|
167
|
-
```tsx
|
|
168
|
-
function RecordsTable({ result }: { result: SemaphorRecordsQueryResult }) {
|
|
169
|
-
const records = result.records ?? [];
|
|
170
|
-
const columns = result.columns ?? [];
|
|
171
|
-
|
|
172
|
-
return (
|
|
173
|
-
<table>
|
|
174
|
-
<thead>
|
|
175
|
-
<tr>
|
|
176
|
-
{columns.map((column) => (
|
|
177
|
-
<th key={column.key}>{column.label || column.name}</th>
|
|
178
|
-
))}
|
|
179
|
-
</tr>
|
|
180
|
-
</thead>
|
|
181
|
-
<tbody>
|
|
182
|
-
{records.map((row, rowIndex) => (
|
|
183
|
-
<tr key={rowIndex}>
|
|
184
|
-
{columns.map((column) => (
|
|
185
|
-
<td key={column.key}>{String(row[column.key] ?? "")}</td>
|
|
186
|
-
))}
|
|
187
|
-
</tr>
|
|
188
|
-
))}
|
|
189
|
-
</tbody>
|
|
190
|
-
</table>
|
|
191
|
-
);
|
|
192
|
-
}
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
## Input Options
|
|
196
|
-
|
|
197
|
-
```tsx
|
|
198
|
-
const segmentFilter = semaphor.filter({
|
|
199
|
-
id: "segment",
|
|
200
|
-
label: "Segment",
|
|
201
|
-
field: segment,
|
|
202
|
-
operator: "in",
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
const segmentOptions = semaphor.inputOptions({
|
|
206
|
-
id: "segment-options",
|
|
207
|
-
inputId: "segment",
|
|
208
|
-
source: orders,
|
|
209
|
-
labelField: segment,
|
|
210
|
-
valueField: segment,
|
|
211
|
-
limit: 100,
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
function SegmentFilter() {
|
|
215
|
-
const segmentHandle = useSemaphorInput(segmentFilter);
|
|
216
|
-
const optionsResult = useSemaphorQuery(segmentOptions);
|
|
217
|
-
|
|
218
|
-
useClearInvalidSemaphorInputValue(segmentHandle, optionsResult);
|
|
219
|
-
|
|
220
|
-
const selectedValue = Array.isArray(segmentHandle.value)
|
|
221
|
-
? String(segmentHandle.value[0] ?? "")
|
|
222
|
-
: "";
|
|
223
|
-
|
|
224
|
-
return (
|
|
225
|
-
<select
|
|
226
|
-
value={selectedValue}
|
|
227
|
-
onChange={(event) => {
|
|
228
|
-
const nextValue = event.target.value || null;
|
|
229
|
-
segmentHandle.setValue(nextValue ? [nextValue] : undefined);
|
|
230
|
-
}}
|
|
231
|
-
>
|
|
232
|
-
<option value="">All segments</option>
|
|
233
|
-
{(optionsResult.options ?? []).map((option) => (
|
|
234
|
-
<option key={String(option.value)} value={String(option.value)}>
|
|
235
|
-
{option.label ?? String(option.value)}
|
|
236
|
-
</option>
|
|
237
|
-
))}
|
|
238
|
-
</select>
|
|
239
|
-
);
|
|
240
|
-
}
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
Pass the full options query result to `useClearInvalidSemaphorInputValue`.
|
|
244
|
-
Do not pass only `optionsResult.options`, because idle/loading results can also
|
|
245
|
-
expose an empty options array.
|
|
246
|
-
For shadcn/Base UI style selects, type the change callback as accepting
|
|
247
|
-
`string | null` and call `handle.clear()` or `handle.setValue(undefined)` for
|
|
248
|
-
the empty state. For multi-selects and date ranges, narrow `handle.value` with
|
|
249
|
-
`Array.isArray(...)` before indexing or displaying it.
|
|
250
|
-
|
|
251
|
-
## Shared Inputs With Source-Specific Bindings
|
|
252
|
-
|
|
253
|
-
Use `semaphor.bindInput(...)` when one visible input maps to different query
|
|
254
|
-
fields.
|
|
255
|
-
|
|
256
|
-
```tsx
|
|
257
|
-
const dateRange = semaphor.filter({
|
|
258
|
-
id: "date_range",
|
|
259
|
-
label: "Date Range",
|
|
260
|
-
field: orderDate,
|
|
261
|
-
operator: "between",
|
|
262
|
-
});
|
|
263
|
-
|
|
264
|
-
function Dashboard() {
|
|
265
|
-
const dateRangeHandle = useSemaphorInput(dateRange);
|
|
266
|
-
|
|
267
|
-
const ordersResult = useSemaphorQuery(ordersQuery, {
|
|
268
|
-
inputs: [semaphor.bindInput(dateRangeHandle, { field: orderDate })],
|
|
269
|
-
});
|
|
270
|
-
const invoicesResult = useSemaphorQuery(invoicesQuery, {
|
|
271
|
-
inputs: [semaphor.bindInput(dateRangeHandle, { field: invoiceDate })],
|
|
272
|
-
});
|
|
273
|
-
|
|
274
|
-
const range = Array.isArray(dateRangeHandle.value)
|
|
275
|
-
? dateRangeHandle.value
|
|
276
|
-
: [];
|
|
277
|
-
}
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
## Related Dimension Filters
|
|
281
|
-
|
|
282
|
-
Use a human-readable related dimension as the visible filter and preserve the
|
|
283
|
-
relationship hint for each fact query.
|
|
284
|
-
|
|
285
|
-
```tsx
|
|
286
|
-
const material = semaphor.source.semantic({
|
|
287
|
-
domainId: "ops",
|
|
288
|
-
datasetName: "dim_material",
|
|
289
|
-
});
|
|
290
|
-
|
|
291
|
-
const materialFamily = semaphor.field.dimension("material_family", {
|
|
292
|
-
label: "Material Family",
|
|
293
|
-
dataType: "string",
|
|
294
|
-
source: material,
|
|
295
|
-
});
|
|
296
|
-
|
|
297
|
-
const materialFamilyFilter = semaphor.filter<string[]>({
|
|
298
|
-
id: "material_family",
|
|
299
|
-
label: "Material Family",
|
|
300
|
-
field: materialFamily,
|
|
301
|
-
operator: "in",
|
|
302
|
-
multi: true,
|
|
303
|
-
});
|
|
304
|
-
|
|
305
|
-
const materialOptions = semaphor.inputOptions({
|
|
306
|
-
id: "material-family-options",
|
|
307
|
-
inputId: "material_family",
|
|
308
|
-
source: material,
|
|
309
|
-
labelField: materialFamily,
|
|
310
|
-
valueField: materialFamily,
|
|
311
|
-
limit: 100,
|
|
312
|
-
});
|
|
313
|
-
|
|
314
|
-
function OpsViews() {
|
|
315
|
-
const materialHandle = useSemaphorInput(materialFamilyFilter);
|
|
316
|
-
useSemaphorQuery(materialOptions);
|
|
317
|
-
|
|
318
|
-
const purchase = useSemaphorQuery(purchaseQuery, {
|
|
319
|
-
inputs: [
|
|
320
|
-
semaphor.bindInput(materialHandle, {
|
|
321
|
-
field: materialFamily,
|
|
322
|
-
relationshipHint: { relationshipIds: ["purchase_material"] },
|
|
323
|
-
}),
|
|
324
|
-
],
|
|
325
|
-
});
|
|
326
|
-
|
|
327
|
-
const sales = useSemaphorQuery(salesQuery, {
|
|
328
|
-
inputs: [
|
|
329
|
-
semaphor.bindInput(materialHandle, {
|
|
330
|
-
field: materialFamily,
|
|
331
|
-
relationshipHint: { relationshipIds: ["sales_material"] },
|
|
332
|
-
}),
|
|
333
|
-
],
|
|
334
|
-
});
|
|
335
|
-
}
|
|
336
|
-
```
|
|
337
|
-
|
|
338
|
-
The query result should remain governed by Semaphor. Do not fetch broad rows and
|
|
339
|
-
filter or join them in React to simulate related-dimension behavior.
|