react-semaphor 0.1.525 → 0.1.527
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/DATA_APP_SDK.md +5 -1
- package/dist/analytics-protocol/index.js +1179 -296
- package/dist/brand-studio/index.js +31 -31
- package/dist/briefings/index.js +50 -49
- package/dist/chunks/{calculated-field-identity-Dy_WpDdo.js → calculated-field-identity-DEhjPSr-.js} +77 -76
- package/dist/chunks/{card-config-utils-CAyjC5Tp.js → card-config-utils-BlIbwkuD.js} +62 -59
- package/dist/chunks/{constants-DeLIHVAW.js → constants-DNWVy8Y3.js} +4 -4
- package/dist/chunks/dashboard-JNHR0_cZ.js +14 -0
- package/dist/chunks/{dashboard-briefing-launcher-BilVIEyw.js → dashboard-briefing-launcher-D9pFByPh.js} +274 -267
- package/dist/chunks/{dashboard-controls-DyLPcvCK.js → dashboard-controls-CJI5ZWMq.js} +740 -692
- package/dist/chunks/dashboard-json-DLdrFry-.js +65 -0
- package/dist/chunks/{edit-dashboard-visual-DtmKNNdE.js → edit-dashboard-visual-D5LjWle1.js} +6760 -6728
- package/dist/chunks/editor-action-buttons-G91NQKxU.js +2070 -0
- package/dist/chunks/{field-aggregations-BQjogiI1.js → field-aggregations-DeVQLIsP.js} +19 -19
- package/dist/chunks/{field-dependencies-v-lJNzC7.js → field-dependencies-CGYic38w.js} +1 -1
- package/dist/chunks/{index-ON7Gpvcv.js → index-BvJOYbNv.js} +760 -750
- package/dist/chunks/{matrix-analytical-definition-BimC4XIV.js → matrix-analytical-definition-BJyH5-99.js} +1 -1
- package/dist/chunks/{matrix-card-CIlz0Dnp.js → matrix-card-DY45yiUM.js} +7 -6
- package/dist/chunks/{matrix-control-sources-B1K7x0SL.js → matrix-control-sources-BypfLZsK.js} +36 -36
- package/dist/chunks/{matrix-definition-E5gXXSTZ.js → matrix-definition-Cdn3LoxW.js} +3 -3
- package/dist/chunks/{semantic-format-Baqp8kD_.js → matrix-formatter-BoKU3MzZ.js} +655 -511
- package/dist/chunks/{matrix-member-presentation-Bw7-JCrr.js → matrix-member-presentation-BBW0n1iY.js} +1 -1
- package/dist/chunks/matrix-operation-contract-BV02rLhu.js +809 -0
- package/dist/chunks/{metric-comparison-BphoJ9bq.js → metric-comparison-Crljx_XY.js} +15 -10
- package/dist/chunks/{numeric-presentation-VhMUHfrJ.js → numeric-presentation-LvnNY5Ma.js} +68 -68
- package/dist/chunks/pivot-header-presentation-D5v8uyjj.js +618 -0
- package/dist/chunks/{pivot-result-identity-BzUQiCEV.js → pivot-result-identity-CY__BuwI.js} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-BFO354lk.js → pivot-result-lifecycle-BWrPhlGT.js} +259 -204
- package/dist/chunks/{raw-temporal-7bFbXd2a.js → raw-temporal-CdnA_OXJ.js} +10 -10
- package/dist/chunks/{raw-temporal-contract-BQZIJ1fn.js → raw-temporal-contract-Bc9z83t-.js} +1 -1
- package/dist/chunks/relative-date-DAF9J7mt.js +456 -0
- package/dist/chunks/report-preferences-dialog-D3hxu4sE.js +1231 -0
- package/dist/chunks/{report-runtime-context-CxIoGyNM.js → report-runtime-context-CtaGGlit.js} +1 -1
- package/dist/chunks/{selection-reducer-CvCBQbl2.js → selection-reducer-C7Um5XN-.js} +3 -3
- package/dist/chunks/semantic-format-BjBMOSoo.js +192 -0
- package/dist/chunks/{index-DYOaHuLS.js → semaphor-ready-indicator-D46I_4g7.js} +145070 -146854
- package/dist/chunks/slider-B6LELqx6.js +876 -0
- package/dist/chunks/{source-entity-resolution-Bzefiive.js → source-entity-resolution-Bde29mqE.js} +25 -25
- package/dist/chunks/{switch-CWPcwAZ4.js → switch-_7uBAbYx.js} +7950 -8545
- package/dist/chunks/{temporal-bucket-PcLFSYWX.js → temporal-bucket-DlFuhCnT.js} +6 -6
- package/dist/chunks/{temporal-bucket-contract-DTLDRzgV.js → temporal-bucket-contract-C6lUGPS3.js} +1 -1
- package/dist/chunks/temporal-input-presentation-DyMWCZYh.js +195 -0
- package/dist/chunks/{token-types-BC6RcUY8.js → token-types-UjyNz95-.js} +1 -1
- package/dist/chunks/{validators-CsdOtZI6.js → validators-CQcG0EPN.js} +852 -731
- package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +46 -0
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +138 -137
- package/dist/data-app-sdk/index.js +30 -29
- package/dist/data-app-sdk-adapters/index.js +23 -22
- package/dist/data-app-sdk-validation/index.js +27 -26
- package/dist/format-utils/index.js +247 -329
- package/dist/index.js +435 -246
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +4 -5
- package/dist/types/briefings/index.d.ts +3 -0
- package/dist/types/components/dashboard/dashboard-container.d.ts +1 -1
- package/dist/types/components/dashboard/sheet/layout-change-guard.d.ts +1 -1
- package/dist/types/components/dashboard/sheet/sheet-layout.d.ts +1 -1
- package/dist/types/components/editor/editor-main/text-card.d.ts +1 -1
- package/dist/types/components/editor/editor.d.ts +1 -1
- package/dist/types/components/explorer/filters/card-date-filter.d.ts +13 -5
- package/dist/types/components/explorer/filters/card-date-selection.d.ts +28 -0
- package/dist/types/components/providers/semaphor-context-provider.d.ts +1 -1
- package/dist/types/components/providers/theme-provider-context.d.ts +1 -1
- package/dist/types/components/providers/theme-provider.d.ts +1 -1
- package/dist/types/components/shared/unsaved-changes/use-pristine-snapshot-initializer.d.ts +1 -1
- package/dist/types/components/sharing-and-management/dashboard-actions-menu.d.ts +1 -1
- package/dist/types/components/sharing-and-management/hooks/use-resource-management.d.ts +0 -1
- package/dist/types/components/surfboard/dashboard-plus.d.ts +1 -1
- package/dist/types/components/surfboard/download-settings-dialog.d.ts +8 -0
- package/dist/types/components/surfboard/filter/types.d.ts +8 -29
- package/dist/types/components/surfboard/filter/use-dashboard-filter-mapping-popover.d.ts +5 -1
- package/dist/types/components/ui-custom/date-range-picker.d.ts +18 -2
- package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -21
- package/dist/types/components/ui-custom/report-calendar.d.ts +18 -0
- package/dist/types/components/visual/aggregated-table/utils/export-utils.d.ts +3 -5
- package/dist/types/components/visual/column-display-utils.d.ts +1 -1
- package/dist/types/components/visual/data-table/data-table-toolbar.d.ts +1 -1
- package/dist/types/components/visual/kpi-visual/kpi-utils.d.ts +1 -1
- package/dist/types/components/visual/pivot-table/utils/pivot-table-export-utils.d.ts +3 -1
- package/dist/types/components/visual/settings/color-format.d.ts +1 -1
- package/dist/types/components/visual/visual-utils.d.ts +1 -1
- package/dist/types/index.js +5 -5
- package/dist/types/lib/actions/data-point-click-action.d.ts +2 -1
- package/dist/types/lib/api/exports-api.d.ts +3 -0
- package/dist/types/lib/csv-download.d.ts +9 -0
- package/dist/types/lib/csv-encoding-options.d.ts +6 -0
- package/dist/types/lib/dashboard/normalize-dashboard-for-dirty-check.d.ts +1 -1
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +2 -1
- package/dist/types/lib/dashboard-navigation/build-carried-click-context.d.ts +0 -1
- package/dist/types/lib/document/document-input-runtime.d.ts +2 -1
- package/dist/types/lib/export-utils.d.ts +17 -15
- package/dist/types/lib/hooks/explorer/use-filter-builder.d.ts +2 -2
- package/dist/types/lib/hooks/explorer/use-schemas.d.ts +1 -1
- package/dist/types/lib/hooks/use-dashboard.d.ts +2 -2
- package/dist/types/lib/hooks/use-relative-date-summarizer.d.ts +7 -0
- package/dist/types/lib/interactions/get-click-context-from-chartjs.d.ts +1 -2
- package/dist/types/lib/matrix-table/matrix-application-adapter.d.ts +3 -2
- package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +1 -1
- package/dist/types/lib/matrix-table/matrix-card-draft.d.ts +1 -1
- package/dist/types/lib/matrix-table/matrix-dataset-history.d.ts +47 -0
- package/dist/types/lib/matrix-table/matrix-delivery.d.ts +7 -3
- package/dist/types/lib/matrix-table/matrix-execution-context.d.ts +2 -0
- package/dist/types/lib/matrix-table/matrix-query-transport.d.ts +4 -1
- package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +105 -4
- package/dist/types/lib/matrix-table/matrix-runtime.d.ts +43 -2
- package/dist/types/lib/matrix-table/use-matrix.d.ts +6 -0
- package/dist/types/lib/query-context/build-card-query-context.d.ts +5 -1
- package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +0 -1
- package/dist/types/lib/query-context/build-global-date-comparison-context.d.ts +1 -2
- package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +1 -2
- package/dist/types/lib/query-context/dashboard-card-query-key.d.ts +10 -0
- package/dist/types/lib/query-context/query-auth-scope.d.ts +5 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +9 -4
- package/dist/types/lib/stores/editor-store.d.ts +1 -2
- package/dist/types/lib/stores/table-actions.d.ts +2 -1
- package/dist/types/lib/temporal-filter/temporal-filter-utils.d.ts +9 -2
- package/dist/types/lib/types/common-types.d.ts +5 -0
- package/dist/types/lib/types/explorer-types.d.ts +14 -0
- package/dist/types/lib/types/token-types.d.ts +0 -13
- package/dist/types/lib/utils/card-definition.d.ts +1 -1
- package/dist/types/lib/utils/date-timezone-utils.d.ts +4 -46
- package/dist/types/lib/utils/filter-default-value-utils.d.ts +8 -2
- package/dist/types/lib/utils/inline-filter-utils.d.ts +3 -2
- package/dist/types/lib/utils/relative-date-description.d.ts +38 -0
- package/dist/types/lib/utils.d.ts +0 -2
- package/dist/types/shared/analytics-protocol/contracts.d.ts +10 -7
- package/dist/types/shared/analytics-protocol/index.d.ts +12 -1
- package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +20 -20
- package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +10 -10
- package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +8 -8
- package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +51 -5
- package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +9 -3
- package/dist/types/shared/analytics-protocol/operation-temporal-state.d.ts +64 -0
- package/dist/types/shared/analytics-protocol/relative-date-filter.d.ts +61 -0
- package/dist/types/shared/analytics-protocol/relative-date-label.d.ts +20 -0
- package/dist/types/shared/analytics-protocol/runtime-schemas.d.ts +0 -2
- package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +314 -0
- package/dist/types/shared/analytics-protocol/time-window.d.ts +13 -0
- package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +8 -4
- package/dist/types/shared/format-utils/exporters/csv-utils.d.ts +46 -15
- package/dist/types/shared/format-utils/exporters/index.d.ts +2 -3
- package/dist/types/shared/format-utils/flat-table-export-totals.d.ts +2 -1
- package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +2 -2
- package/dist/types/shared/format-utils/types/format-types.d.ts +0 -42
- package/dist/types/shared/temporal/calendar-periods.d.ts +56 -0
- package/dist/types/shared/temporal/index.d.ts +5 -0
- package/dist/types/shared/temporal/relative-date.d.ts +21 -0
- package/dist/types/shared/temporal/temporal-parity-fixtures.d.ts +73 -0
- package/dist/types/shared/temporal/time-window-periods.d.ts +21 -0
- package/dist/types/shared/temporal/zoned-wall-clock.d.ts +23 -0
- package/package.json +2 -17
- package/src/data-app-sdk/README.md +6 -3
- package/dist/chunks/dashboard-date-comparison-definition-BqNhECUr.js +0 -183
- package/dist/chunks/dashboard-json-QEoU-mx4.js +0 -75
- package/dist/chunks/editor-action-buttons-B9VRW3Bh.js +0 -2019
- package/dist/chunks/matrix-formatter-WBgtebUT.js +0 -341
- package/dist/chunks/matrix-operation-contract-D32U2CSw.js +0 -1802
- package/dist/chunks/mouse-pointer-2-BZvGk45-.js +0 -19
- package/dist/chunks/pivot-header-presentation-CGtudHo7.js +0 -661
- package/dist/chunks/report-preferences-dialog-BLaFmlE2.js +0 -723
- package/dist/chunks/temporal-input-presentation-2RJrvmYL.js +0 -222
- package/dist/chunks/update-policy-DhAUtiC8.js +0 -913
- package/dist/data-app-builder/index.js +0 -3666
- package/dist/data-app-builder-browser-runtime/index.js +0 -8
- package/dist/data-app-codegen/index.js +0 -22
- package/dist/data-app-codegen-node/index.js +0 -1807
- package/dist/types/components/data-app-runtime/published-data-app-runtime.d.ts +0 -7
- package/dist/types/components/surfboard/json-to-csv.d.ts +0 -7
- package/dist/types/components/visual/data-table/utils/export-utils.d.ts +0 -31
- package/dist/types/data-app-builder/browser-runtime.d.ts +0 -174
- package/dist/types/data-app-builder/constants.d.ts +0 -14
- package/dist/types/data-app-builder/data-app-builder.d.ts +0 -14
- package/dist/types/data-app-builder/index.d.ts +0 -1
- package/dist/types/data-app-builder/lib/api.d.ts +0 -36
- package/dist/types/data-app-builder/lib/context-select.d.ts +0 -3
- package/dist/types/data-app-builder/lib/diagnostics.d.ts +0 -12
- package/dist/types/data-app-builder/lib/file-tree.d.ts +0 -2
- package/dist/types/data-app-builder/types.d.ts +0 -558
- package/dist/types/data-app-builder-browser-runtime.d.ts +0 -2
- package/dist/types/data-app-builder.d.ts +0 -2
- package/dist/types/data-app-codegen/generate-contract.d.ts +0 -26
- package/dist/types/data-app-codegen/generated-contract-files.d.ts +0 -7
- package/dist/types/data-app-codegen/generated-contract-validation.d.ts +0 -13
- package/dist/types/data-app-codegen/index.d.ts +0 -6
- package/dist/types/data-app-codegen/live-execution.d.ts +0 -42
- package/dist/types/data-app-codegen/node.d.ts +0 -2
- package/dist/types/data-app-codegen/update-policy.d.ts +0 -25
- package/dist/types/data-app-codegen/validation.d.ts +0 -8
- package/dist/types/data-app-codegen-node.d.ts +0 -2
- package/dist/types/data-app-codegen.d.ts +0 -2
- package/dist/types/lib/encrypt-utils.d.ts +0 -9
- package/dist/types/shared/analytics-protocol/data-app-codegen-summary.d.ts +0 -418
- package/dist/types/shared/format-utils/exporters/pivot-exporter.d.ts +0 -13
- package/dist/types/shared/format-utils/exporters/table-exporter.d.ts +0 -10
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { RelativeDateFilter } from '../analytics-protocol/relative-date-filter.js';
|
|
2
|
+
import { WeekStart } from '../report-runtime-context/index.js';
|
|
3
|
+
import { TemporalUnit } from './calendar-periods.js';
|
|
4
|
+
import { ZonedWallClockTime } from './zoned-wall-clock.js';
|
|
5
|
+
/** A relative date resolved at an anchor: `[start, inclusive end]`. */
|
|
6
|
+
export type TemporalParityRelativeCase = {
|
|
7
|
+
tz: string;
|
|
8
|
+
weekStart: WeekStart;
|
|
9
|
+
/** The month-aligned fiscal year's first month, when the calendar has one. */
|
|
10
|
+
fiscalStart?: number;
|
|
11
|
+
anchor: string;
|
|
12
|
+
relative: RelativeDateFilter;
|
|
13
|
+
expected: [string, string];
|
|
14
|
+
/**
|
|
15
|
+
* The browser's old result where it differed, and the rule that changed
|
|
16
|
+
* it: `fiscal_periods`, the browser ignored the fiscal calendar for
|
|
17
|
+
* quarters and years. Previews still show those as labels only (K8).
|
|
18
|
+
*/
|
|
19
|
+
browser?: {
|
|
20
|
+
old: [string, string];
|
|
21
|
+
rule: 'fiscal_periods';
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
/** An instant moved by whole units in the timezone's wall clock. */
|
|
25
|
+
export type TemporalParityShiftCase = {
|
|
26
|
+
tz: string;
|
|
27
|
+
at: string;
|
|
28
|
+
unit: TemporalUnit;
|
|
29
|
+
amount: number;
|
|
30
|
+
expected: string;
|
|
31
|
+
};
|
|
32
|
+
/** The period containing an instant: `[start, endExclusive]`. */
|
|
33
|
+
export type TemporalParityPeriodCase = {
|
|
34
|
+
tz: string;
|
|
35
|
+
at: string;
|
|
36
|
+
unit: TemporalUnit;
|
|
37
|
+
weekStart?: WeekStart;
|
|
38
|
+
expected: [string, string];
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* A daylight-saving case (K7): the instant a wall clock names, or the period
|
|
42
|
+
* containing an instant. `before` is the old result, which depended on
|
|
43
|
+
* date-fns-tz's offset guess: a repeated hour took its second occurrence east
|
|
44
|
+
* of UTC, a skipped hour moved back, and a day starting after a skipped
|
|
45
|
+
* midnight started an hour early.
|
|
46
|
+
*/
|
|
47
|
+
export type TemporalParityDaylightCase = {
|
|
48
|
+
kind: 'instant';
|
|
49
|
+
tz: string;
|
|
50
|
+
wall: ZonedWallClockTime;
|
|
51
|
+
expected: string;
|
|
52
|
+
before: string;
|
|
53
|
+
} | {
|
|
54
|
+
kind: 'period';
|
|
55
|
+
tz: string;
|
|
56
|
+
at: string;
|
|
57
|
+
unit: TemporalUnit;
|
|
58
|
+
expected: [string, string];
|
|
59
|
+
before: [string, string];
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* The parity grid (analytics kernel Phase 3): units, modes, the six
|
|
63
|
+
* timezones, week starts 0 to 6, fiscal start months 1 to 12 and four
|
|
64
|
+
* anchors. Both repos run it: react-semaphor against `shared/temporal`, and
|
|
65
|
+
* semaphor-app against the server functions that delegate to it. Built by a
|
|
66
|
+
* pure call, so a bundle that doesn't use it drops it.
|
|
67
|
+
*/
|
|
68
|
+
export declare const TEMPORAL_PARITY_FIXTURES: {
|
|
69
|
+
relative: TemporalParityRelativeCase[];
|
|
70
|
+
shifts: TemporalParityShiftCase[];
|
|
71
|
+
periods: TemporalParityPeriodCase[];
|
|
72
|
+
daylight: TemporalParityDaylightCase[];
|
|
73
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TemporalCalendar, TemporalUnit } from './calendar-periods.js';
|
|
2
|
+
/** A rolling window's length: `value` units. */
|
|
3
|
+
export type TemporalSpan = {
|
|
4
|
+
unit: TemporalUnit;
|
|
5
|
+
value: number;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Where a window of `span` ending at `end` starts: elapsed time for seconds,
|
|
9
|
+
* minutes and hours; the same wall-clock time `value` units earlier for
|
|
10
|
+
* calendar units.
|
|
11
|
+
*/
|
|
12
|
+
export declare function subtractTimeSpan(end: Date, span: TemporalSpan, calendar: TemporalCalendar): Date;
|
|
13
|
+
/** The `value` whole periods before the one containing `latest`. */
|
|
14
|
+
export type CompletePeriodWindow = {
|
|
15
|
+
windowStart: Date;
|
|
16
|
+
/** The inclusive last instant: the millisecond before `latest`'s period. */
|
|
17
|
+
windowEnd: Date;
|
|
18
|
+
/** Whether `latest`'s own period, which is partial, was left out. */
|
|
19
|
+
excludedPartialPeriod: boolean;
|
|
20
|
+
};
|
|
21
|
+
export declare function completePeriodWindow(latest: Date, span: TemporalSpan, calendar: TemporalCalendar): CompletePeriodWindow;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type ZonedWallClock = {
|
|
2
|
+
year: number;
|
|
3
|
+
month: number;
|
|
4
|
+
day: number;
|
|
5
|
+
hour: number;
|
|
6
|
+
minute: number;
|
|
7
|
+
second: number;
|
|
8
|
+
};
|
|
9
|
+
export declare function zonedWallClock(instant: Date, tz: string): ZonedWallClock;
|
|
10
|
+
/** A wall-clock time, with optional milliseconds. */
|
|
11
|
+
export type ZonedWallClockTime = ZonedWallClock & {
|
|
12
|
+
millisecond?: number;
|
|
13
|
+
};
|
|
14
|
+
/** The wall clock as if it were UTC, in milliseconds. */
|
|
15
|
+
export declare function wallClockMilliseconds(wall: ZonedWallClockTime): number;
|
|
16
|
+
/**
|
|
17
|
+
* The instant a wall-clock time names in a timezone (analytics kernel K7). A
|
|
18
|
+
* repeated hour takes its first occurrence; a skipped hour moves forward by
|
|
19
|
+
* the gap, as JavaScript's Temporal API and java.time do by default. The
|
|
20
|
+
* offsets a day either side cover any one change, and no offset reaches a
|
|
21
|
+
* day, so the answer never depends on the machine.
|
|
22
|
+
*/
|
|
23
|
+
export declare function zonedWallClockToInstant(wall: ZonedWallClockTime, tz: string): Date;
|
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.527",
|
|
9
9
|
"description": "Fully interactive and customizable dashboards for your apps.",
|
|
10
10
|
"keywords": [
|
|
11
11
|
"react",
|
|
@@ -72,22 +72,6 @@
|
|
|
72
72
|
"types": "./dist/types/data-app-sdk-validation.d.ts",
|
|
73
73
|
"import": "./dist/data-app-sdk-validation/index.js"
|
|
74
74
|
},
|
|
75
|
-
"./data-app-codegen": {
|
|
76
|
-
"types": "./dist/types/data-app-codegen.d.ts",
|
|
77
|
-
"import": "./dist/data-app-codegen/index.js"
|
|
78
|
-
},
|
|
79
|
-
"./data-app-codegen/node": {
|
|
80
|
-
"types": "./dist/types/data-app-codegen-node.d.ts",
|
|
81
|
-
"import": "./dist/data-app-codegen-node/index.js"
|
|
82
|
-
},
|
|
83
|
-
"./data-app-builder": {
|
|
84
|
-
"types": "./dist/types/data-app-builder.d.ts",
|
|
85
|
-
"import": "./dist/data-app-builder/index.js"
|
|
86
|
-
},
|
|
87
|
-
"./data-app-builder/browser-runtime": {
|
|
88
|
-
"types": "./dist/types/data-app-builder-browser-runtime.d.ts",
|
|
89
|
-
"import": "./dist/data-app-builder-browser-runtime/index.js"
|
|
90
|
-
},
|
|
91
75
|
"./appearance": {
|
|
92
76
|
"types": "./dist/types/appearance.d.ts",
|
|
93
77
|
"import": "./dist/appearance/index.js"
|
|
@@ -134,6 +118,7 @@
|
|
|
134
118
|
"check:card-config-consumers": "node scripts/card-config-consumers.mjs",
|
|
135
119
|
"preview": "vite preview",
|
|
136
120
|
"test": "vitest run",
|
|
121
|
+
"test:changed": "vitest run --changed",
|
|
137
122
|
"test:watch": "vitest",
|
|
138
123
|
"test:ui": "vitest --ui",
|
|
139
124
|
"test:run": "vitest run",
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
# Data App SDK Quick Reference
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
> Frozen: no new work goes into this SDK. A replacement built on the shared
|
|
4
|
+
> analytics protocol replaces it in place (semaphor-app
|
|
5
|
+
> `docs/implementation-plans/analytics-mcp-and-sdk/PLAN-3-ANALYTICS-SDK.md`).
|
|
6
|
+
|
|
7
|
+
Use this file as the public contract quick reference for Data App SDK code.
|
|
8
|
+
Do not inspect SDK implementation internals to discover these patterns.
|
|
6
9
|
|
|
7
10
|
## Imports
|
|
8
11
|
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import { al as _ } from "./validators-CsdOtZI6.js";
|
|
2
|
-
function k(e) {
|
|
3
|
-
return `compat-filter:${e}`;
|
|
4
|
-
}
|
|
5
|
-
function j(e) {
|
|
6
|
-
return `compat-control:${e}`;
|
|
7
|
-
}
|
|
8
|
-
function z(e, n) {
|
|
9
|
-
return `compat-inline-filter:${e}:${n}`;
|
|
10
|
-
}
|
|
11
|
-
function M(e, n) {
|
|
12
|
-
return `compat-card-control:${e}:${n}`;
|
|
13
|
-
}
|
|
14
|
-
function C(e, n) {
|
|
15
|
-
const t = e.split(".").map((r) => r.trim()), i = n.split(".").map((r) => r.trim());
|
|
16
|
-
if (t.length === 0 || i.length === 0 || t.some((r) => !r) || i.some((r) => !r))
|
|
17
|
-
return !1;
|
|
18
|
-
const [s, o] = t.length <= i.length ? [t, i] : [i, t], a = o.length - s.length;
|
|
19
|
-
return s.every((r, c) => r === o[c + a]);
|
|
20
|
-
}
|
|
21
|
-
function N(e, n) {
|
|
22
|
-
const t = e.split("."), i = n.split("."), s = t.pop(), o = i.pop();
|
|
23
|
-
return !!(s && s === o && t.length > 0 && i.length > 0 && C(
|
|
24
|
-
t.join("."),
|
|
25
|
-
i.join(".")
|
|
26
|
-
));
|
|
27
|
-
}
|
|
28
|
-
function q(e) {
|
|
29
|
-
const n = e.map((i) => i.trim()).filter(Boolean);
|
|
30
|
-
if (n.every(
|
|
31
|
-
(i, s) => n.slice(s + 1).every(
|
|
32
|
-
(o) => C(i, o)
|
|
33
|
-
)
|
|
34
|
-
))
|
|
35
|
-
return [...n].sort(
|
|
36
|
-
(i, s) => s.split(".").length - i.split(".").length
|
|
37
|
-
)[0];
|
|
38
|
-
}
|
|
39
|
-
function u(e) {
|
|
40
|
-
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
41
|
-
}
|
|
42
|
-
function h(e) {
|
|
43
|
-
if (typeof e != "string") return "";
|
|
44
|
-
const n = e.split(".").map((t) => t.trim());
|
|
45
|
-
return n.length > 1 && n.every(Boolean) ? n.join(".") : "";
|
|
46
|
-
}
|
|
47
|
-
function v(e) {
|
|
48
|
-
if (typeof e != "string") return "";
|
|
49
|
-
const n = e.split(".").map((t) => t.trim());
|
|
50
|
-
return n.length > 0 && n.every(Boolean) ? n.join(".") : "";
|
|
51
|
-
}
|
|
52
|
-
function d(e) {
|
|
53
|
-
return typeof e == "string" ? e.trim() : "";
|
|
54
|
-
}
|
|
55
|
-
function D(e, n) {
|
|
56
|
-
return e.every(
|
|
57
|
-
(t, i) => e.slice(i + 1).every((s) => n(t, s))
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
function F(e, n) {
|
|
61
|
-
const t = d(e.id), i = d(e.name), s = d(n.entityId), o = d(n.entityName);
|
|
62
|
-
return !i || !s && !o ? !1 : (!s || s === t || s === i) && (!o || o === i);
|
|
63
|
-
}
|
|
64
|
-
function T(e) {
|
|
65
|
-
const n = u(e.semanticContext) ? e.semanticContext : void 0, t = u(e.fieldMeta) ? e.fieldMeta : void 0, i = d(n == null ? void 0 : n.semanticDomainId), s = Array.isArray(n == null ? void 0 : n.selectedEntities) ? n.selectedEntities.filter(
|
|
66
|
-
(y) => u(y) && y.type === "dataset"
|
|
67
|
-
) : [];
|
|
68
|
-
if (!!!(i || s.length > 0 || (t == null ? void 0 : t.entityType) === "dataset")) return;
|
|
69
|
-
if (!i)
|
|
70
|
-
return { status: "unresolved", reason: "incomplete_source_identity" };
|
|
71
|
-
const a = d(t == null ? void 0 : t.entityId), r = d(t == null ? void 0 : t.entityName), c = !!(a || r), f = c ? s.filter(
|
|
72
|
-
(y) => F(y, {
|
|
73
|
-
entityId: a,
|
|
74
|
-
entityName: r
|
|
75
|
-
})
|
|
76
|
-
) : s;
|
|
77
|
-
if (f.length > 1)
|
|
78
|
-
return { status: "unresolved", reason: "incomplete_source_identity" };
|
|
79
|
-
if (c && s.length > 0 && f.length === 0)
|
|
80
|
-
return { status: "unresolved", reason: "divergent_source_identity" };
|
|
81
|
-
const l = f[0], m = d(l == null ? void 0 : l.domainId), p = d(l == null ? void 0 : l.id), g = d(l == null ? void 0 : l.name);
|
|
82
|
-
if (m && m !== i)
|
|
83
|
-
return { status: "unresolved", reason: "divergent_source_identity" };
|
|
84
|
-
const I = p, b = g || r;
|
|
85
|
-
return b ? {
|
|
86
|
-
status: "resolved",
|
|
87
|
-
source: {
|
|
88
|
-
kind: "semantic",
|
|
89
|
-
domainId: i,
|
|
90
|
-
datasetName: b,
|
|
91
|
-
...I ? { datasetId: I } : {}
|
|
92
|
-
}
|
|
93
|
-
} : { status: "unresolved", reason: "incomplete_source_identity" };
|
|
94
|
-
}
|
|
95
|
-
function S(e, n) {
|
|
96
|
-
const t = d(e.connectionId), i = u(e.semanticContext) ? e.semanticContext : void 0, s = d(i == null ? void 0 : i.connectionId);
|
|
97
|
-
if (t && s && t !== s)
|
|
98
|
-
return { status: "unresolved", reason: "divergent_source_identity" };
|
|
99
|
-
const o = t || s, a = u(e.fieldMeta) ? e.fieldMeta : void 0, r = n.split(".").slice(0, -1).join("."), c = v(e.qualifiedTableName), f = v(
|
|
100
|
-
a == null ? void 0 : a.qualifiedEntityName
|
|
101
|
-
), l = [
|
|
102
|
-
c,
|
|
103
|
-
f,
|
|
104
|
-
r
|
|
105
|
-
].filter(Boolean), m = q(l);
|
|
106
|
-
return !m && l.length > 0 ? { status: "unresolved", reason: "divergent_source_identity" } : !o || !m ? { status: "unresolved", reason: "incomplete_source_identity" } : {
|
|
107
|
-
status: "resolved",
|
|
108
|
-
source: { kind: "physical", connectionId: o, tableName: m }
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
function A(e, n) {
|
|
112
|
-
const t = u(e.fieldMeta) ? e.fieldMeta : void 0, i = typeof (t == null ? void 0 : t.qualifiedFieldName) == "string" ? t.qualifiedFieldName.trim() : "", s = h(
|
|
113
|
-
t == null ? void 0 : t.qualifiedFieldName
|
|
114
|
-
), o = typeof e.column == "string" ? e.column.trim() : "", a = h(o), r = typeof e.qualifiedTableName == "string" ? e.qualifiedTableName.trim() : "", c = v(
|
|
115
|
-
e.qualifiedTableName
|
|
116
|
-
);
|
|
117
|
-
if (i && !s || n && r && !c || o.includes(".") && !a)
|
|
118
|
-
return { status: "unresolved", reason: "incomplete_field_identity" };
|
|
119
|
-
const f = a.split("."), l = a ? f[f.length - 1] : o, m = n && c && l ? `${c}.${l}` : "", p = [
|
|
120
|
-
s,
|
|
121
|
-
a,
|
|
122
|
-
m
|
|
123
|
-
].filter(Boolean);
|
|
124
|
-
if (!D(
|
|
125
|
-
p,
|
|
126
|
-
N
|
|
127
|
-
))
|
|
128
|
-
return { status: "unresolved", reason: "divergent_field_identity" };
|
|
129
|
-
const g = a || s || m;
|
|
130
|
-
return g ? { status: "resolved", qualifiedFieldName: g } : { status: "unresolved", reason: "incomplete_field_identity" };
|
|
131
|
-
}
|
|
132
|
-
function E(e) {
|
|
133
|
-
if (!u(e))
|
|
134
|
-
return { status: "ineligible", reason: "invalid_input" };
|
|
135
|
-
if (e.kind === "global-date")
|
|
136
|
-
return { status: "eligible", kind: "global_date" };
|
|
137
|
-
const n = _(e.dataType);
|
|
138
|
-
if (n !== "date" && n !== "datetime")
|
|
139
|
-
return { status: "ineligible", reason: "non_date_filter" };
|
|
140
|
-
const t = u(e.fieldMeta) ? e.fieldMeta : void 0, i = _(
|
|
141
|
-
t == null ? void 0 : t.dataType
|
|
142
|
-
);
|
|
143
|
-
if ((t == null ? void 0 : t.dataType) !== void 0 && i !== "date" && i !== "datetime")
|
|
144
|
-
return { status: "ineligible", reason: "non_date_filter" };
|
|
145
|
-
if (e.customFilterPreferences)
|
|
146
|
-
return { status: "ineligible", reason: "custom_filter" };
|
|
147
|
-
if (e.targetColumns !== void 0 && (!Array.isArray(e.targetColumns) || e.targetColumns.length > 0))
|
|
148
|
-
return { status: "ineligible", reason: "multi_target_filter" };
|
|
149
|
-
const s = T(e), o = A(e, s === void 0);
|
|
150
|
-
if (o.status === "unresolved")
|
|
151
|
-
return { status: "ineligible", reason: o.reason };
|
|
152
|
-
const a = s || S(e, o.qualifiedFieldName);
|
|
153
|
-
return a.status === "resolved" ? {
|
|
154
|
-
status: "eligible",
|
|
155
|
-
kind: "field_date",
|
|
156
|
-
qualifiedFieldName: o.qualifiedFieldName,
|
|
157
|
-
source: a.source
|
|
158
|
-
} : { status: "ineligible", reason: a.reason };
|
|
159
|
-
}
|
|
160
|
-
function B(e) {
|
|
161
|
-
if (!u(e) || e.kind !== "filter" || !u(e.filter))
|
|
162
|
-
return { status: "ineligible", reason: "invalid_input" };
|
|
163
|
-
const n = E(
|
|
164
|
-
e.filter
|
|
165
|
-
);
|
|
166
|
-
return n.status === "ineligible" ? n : n.kind === "field_date" && u(e.compatibility) && e.compatibility.source === "cardInlineFilter" ? { status: "ineligible", reason: "card_inline_filter" } : n;
|
|
167
|
-
}
|
|
168
|
-
function Q(e) {
|
|
169
|
-
return B(e).status === "eligible";
|
|
170
|
-
}
|
|
171
|
-
export {
|
|
172
|
-
B as a,
|
|
173
|
-
j as b,
|
|
174
|
-
z as c,
|
|
175
|
-
M as d,
|
|
176
|
-
q as e,
|
|
177
|
-
C as f,
|
|
178
|
-
k as g,
|
|
179
|
-
Q as i,
|
|
180
|
-
N as q,
|
|
181
|
-
E as r,
|
|
182
|
-
F as s
|
|
183
|
-
};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as p, useState as u, useRef as f, useEffect as b } from "react";
|
|
3
|
-
import { X as S } from "./x-CXDkqdur.js";
|
|
4
|
-
import { u as r, c as N, B as D, C as J } from "./switch-CWPcwAZ4.js";
|
|
5
|
-
import "./card-config-utils-CAyjC5Tp.js";
|
|
6
|
-
import "./validators-CsdOtZI6.js";
|
|
7
|
-
import "./matrix-operation-contract-D32U2CSw.js";
|
|
8
|
-
import "../value-format-preferences/index.js";
|
|
9
|
-
import "./index-DYOaHuLS.js";
|
|
10
|
-
import "./appearance-runtime-provider-B-M8gwlZ.js";
|
|
11
|
-
import "./appearance-context-DEYtWinQ.js";
|
|
12
|
-
import "./index-CLIro-EG.js";
|
|
13
|
-
import "./field-aggregations-BQjogiI1.js";
|
|
14
|
-
import "zod";
|
|
15
|
-
import "./matrix-continuation-C4sRcjZU.js";
|
|
16
|
-
import "./color-CJvdlFM_.js";
|
|
17
|
-
import "react-dom";
|
|
18
|
-
import "./index-ON7Gpvcv.js";
|
|
19
|
-
function F() {
|
|
20
|
-
const a = r((o) => o.dashboard), c = r((o) => o.actions.setDashboard), m = r(
|
|
21
|
-
(o) => o.showDashboardJSON
|
|
22
|
-
), h = r(
|
|
23
|
-
(o) => o.actions.setShowDashboardJSON
|
|
24
|
-
), s = p(
|
|
25
|
-
() => a ? JSON.stringify(a, null, 2) : "",
|
|
26
|
-
[a]
|
|
27
|
-
), [l, i] = u(s), t = f(s);
|
|
28
|
-
return b(() => {
|
|
29
|
-
s !== t.current && (i(s), t.current = s);
|
|
30
|
-
}, [s]), /* @__PURE__ */ d(
|
|
31
|
-
"div",
|
|
32
|
-
{
|
|
33
|
-
className: N("relative p-2", {
|
|
34
|
-
hidden: !m
|
|
35
|
-
}),
|
|
36
|
-
children: [
|
|
37
|
-
/* @__PURE__ */ d(
|
|
38
|
-
D,
|
|
39
|
-
{
|
|
40
|
-
variant: "secondary",
|
|
41
|
-
size: "sm",
|
|
42
|
-
className: "absolute right-2 top-2 z-10 h-8",
|
|
43
|
-
onClick: () => h(!1),
|
|
44
|
-
children: [
|
|
45
|
-
/* @__PURE__ */ e(S, { className: "mr-2 h-4 w-4" }),
|
|
46
|
-
"Close"
|
|
47
|
-
]
|
|
48
|
-
}
|
|
49
|
-
),
|
|
50
|
-
/* @__PURE__ */ e("div", { className: "h-[550px] overflow-hidden", children: /* @__PURE__ */ e(
|
|
51
|
-
J,
|
|
52
|
-
{
|
|
53
|
-
value: l,
|
|
54
|
-
onValueChange: (o) => {
|
|
55
|
-
i(o);
|
|
56
|
-
try {
|
|
57
|
-
const n = JSON.parse(o);
|
|
58
|
-
t.current = JSON.stringify(
|
|
59
|
-
n,
|
|
60
|
-
null,
|
|
61
|
-
2
|
|
62
|
-
), c(n);
|
|
63
|
-
} catch {
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
language: "json"
|
|
67
|
-
}
|
|
68
|
-
) })
|
|
69
|
-
]
|
|
70
|
-
}
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
export {
|
|
74
|
-
F as default
|
|
75
|
-
};
|