react-semaphor 0.1.587 → 0.1.588

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.
Files changed (93) hide show
  1. package/dist/analytics-protocol/index.js +341 -338
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/assistant-protocol/index.js +5 -5
  4. package/dist/brand-studio/index.js +8 -8
  5. package/dist/briefings/index.js +5 -5
  6. package/dist/chunks/{add-to-dashboard-DhP8wVtM.js → add-to-dashboard-C86FsM8D.js} +1 -1
  7. package/dist/chunks/{aggregate-measure-field-DsFXETpI.js → aggregate-measure-field-BrkXsSJp.js} +2 -2
  8. package/dist/chunks/{analytics-base-schemas-BaIQrEzX.js → analytics-base-schemas-8wz9vqn_.js} +173 -165
  9. package/dist/chunks/{assistant-chat-pfJK-T0b.js → assistant-chat-BeM6joPc.js} +19 -18
  10. package/dist/chunks/{bookmark-impact-BSpGQL1M.js → bookmark-impact-B7pbMx2e.js} +2 -2
  11. package/dist/chunks/{bookmark-state-CL4WEpgB.js → bookmark-state-Bn7k3ttp.js} +5 -5
  12. package/dist/chunks/{card-filter-builder-C8PbhHjq.js → card-filter-builder-DmodrhyI.js} +81 -81
  13. package/dist/chunks/{comparison-window-caption-CoART8BC.js → comparison-window-caption-fqijZdVd.js} +451 -395
  14. package/dist/chunks/{context-BTLBjQNh.js → context-CVXTFljo.js} +1 -1
  15. package/dist/chunks/{dashboard-CVj1oMoW.js → dashboard-Tu5wT0Cw.js} +1 -1
  16. package/dist/chunks/{dashboard-briefing-launcher-TqA58rKz.js → dashboard-briefing-launcher-D8jMxIJo.js} +249 -265
  17. package/dist/chunks/{dashboard-controls-DQ8FsxAz.js → dashboard-controls-uzeAIEkM.js} +65 -65
  18. package/dist/chunks/{dashboard-json-DM88pmk2.js → dashboard-json-i5rpFNCg.js} +5 -5
  19. package/dist/chunks/dates-BunbHJH0.js +115 -0
  20. package/dist/chunks/{edit-dashboard-visual-BpRnU_6G.js → edit-dashboard-visual-BpEK_Sls.js} +2357 -2344
  21. package/dist/chunks/{filter-line-Cu2u1K36.js → filter-line-Dza3ee4w.js} +5 -5
  22. package/dist/chunks/{filter-reach-copy-0Xp97cLk.js → filter-reach-copy-D5AmDHda.js} +944 -942
  23. package/dist/chunks/{filter-value-text-xefXzZlf.js → filter-value-text-DQw4v3nC.js} +6 -6
  24. package/dist/chunks/{index-D_QSeVKy.js → index-dGxJTaP1.js} +39 -39
  25. package/dist/chunks/{layout-grid-9nSS2SL-.js → layout-grid-XCYphks2.js} +1 -1
  26. package/dist/chunks/{list-filter-CfMPI6v4.js → list-filter-DGV3fqqv.js} +1 -1
  27. package/dist/chunks/{matrix-analytical-definition-DOVSFFuf.js → matrix-analytical-definition-SN0JUJVk.js} +3 -3
  28. package/dist/chunks/{matrix-member-presentation-BKDyxJho.js → matrix-member-presentation-DVBJR0MA.js} +1 -1
  29. package/dist/chunks/{matrix-operation-contract-BM5TveR3.js → matrix-operation-contract-JSmproo9.js} +15 -15
  30. package/dist/chunks/{metric-comparison-ZmurmEIs.js → metric-comparison-xE_J6hkg.js} +2 -2
  31. package/dist/chunks/{paintbrush-LzAje2ff.js → paintbrush-DEEZXhDj.js} +1 -1
  32. package/dist/chunks/{palette-DicJG0TC.js → palette-Bgy0H-Nt.js} +1 -1
  33. package/dist/chunks/{pivot-header-presentation-CdeTU96P.js → pivot-header-presentation-D-DfPAjb.js} +1 -1
  34. package/dist/chunks/{pivot-result-contract-expectations-Bx_BCu-7.js → pivot-result-contract-expectations-DbBahmgc.js} +545 -536
  35. package/dist/chunks/{pivot-result-identity-Bvs6Uq3v.js → pivot-result-identity-CUsMt_4r.js} +1 -1
  36. package/dist/chunks/{raw-temporal-value-DH-feMc2.js → raw-temporal-value-BnGCWJAL.js} +1 -1
  37. package/dist/chunks/{report-preferences-dialog-CXKmWyLm.js → report-preferences-dialog-CTM0xfd0.js} +14 -14
  38. package/dist/chunks/{report-runtime-context-NlOXwyRB.js → report-runtime-context-CrOgmuxO.js} +2 -2
  39. package/dist/chunks/{resolve-dashboard-input-context-zEXuitoF.js → resolve-dashboard-input-context-DFBIngUZ.js} +5617 -5485
  40. package/dist/chunks/{save-0wu1Z1U7.js → save-xnRCvMeA.js} +1 -1
  41. package/dist/chunks/{saved-dashboard-context-Cll5LipJ.js → saved-dashboard-context-DKMTP9ib.js} +17 -17
  42. package/dist/chunks/selection-filter-compiler-DkIjp1yH.js +131 -0
  43. package/dist/chunks/{semaphor-ready-indicator-Bnj3H0Dm.js → semaphor-ready-indicator-zU9reNmX.js} +45952 -45617
  44. package/dist/chunks/{shelf-drop-preview-context-B8rmn6BD.js → shelf-drop-preview-context-R9sf4oDX.js} +6 -6
  45. package/dist/chunks/{stored-dashboard-CURqJgoa.js → stored-dashboard-CksluF2S.js} +1539 -1404
  46. package/dist/chunks/{style-sheet-parts-_dGSFzDi.js → style-sheet-parts-D7NbsFL0.js} +3 -3
  47. package/dist/chunks/{table-export-sheet-Dmtqi5NV.js → table-export-sheet-ClSgERQC.js} +1 -1
  48. package/dist/chunks/{token-types-DEe_FP4l.js → token-types-DTocOcwt.js} +1 -1
  49. package/dist/chunks/{upload-CtyOkU_B.js → upload-BXGgYS4g.js} +1 -1
  50. package/dist/chunks/{validators-CJ8Jh0E8.js → validators-CrYXNnNE.js} +51 -49
  51. package/dist/chunks/{variable-draft-DIv-9y6Q.js → variable-draft-rbtGPvmX.js} +16 -14
  52. package/dist/chunks/visual-choice-DDfHfHvY.js +172 -0
  53. package/dist/dashboard/index.js +2 -2
  54. package/dist/dashboard-authoring/index.js +821 -791
  55. package/dist/format-utils/index.js +162 -158
  56. package/dist/index.js +21 -21
  57. package/dist/report-runtime-context/index.js +2 -2
  58. package/dist/style.css +1 -1
  59. package/dist/surfboard/index.js +2 -2
  60. package/dist/types/index.js +5 -5
  61. package/dist/types/lib/dashboard-view-state/card-view-state.d.ts +39 -2
  62. package/dist/types/lib/dashboard-view-state/date-zoom.d.ts +65 -0
  63. package/dist/types/lib/dashboard-view-state/grain-pick.d.ts +38 -0
  64. package/dist/types/lib/dashboard-view-state/index.d.ts +2 -0
  65. package/dist/types/lib/formatters/grouped-temporal-presentation.d.ts +6 -2
  66. package/dist/types/lib/hooks/interactions/use-drill-actions.d.ts +1 -1
  67. package/dist/types/lib/interactions/get-click-context-from-table.d.ts +2 -2
  68. package/dist/types/lib/query-context/assemble-card-query.d.ts +2 -1
  69. package/dist/types/lib/query-context/build-card-query-context.d.ts +15 -1
  70. package/dist/types/lib/query-context/describe-card-execution-snapshot.d.ts +3 -0
  71. package/dist/types/lib/query-context/resolve-runtime-card-filters.d.ts +14 -1
  72. package/dist/types/lib/stores/dashboard-store.d.ts +7 -1
  73. package/dist/types/lib/types/explorer-types.d.ts +13 -0
  74. package/dist/types/lib/utils/card-config-utils.d.ts +1 -1
  75. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +32 -0
  76. package/dist/types/shared/analytics-protocol/contracts.d.ts +30 -0
  77. package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +13 -0
  78. package/dist/types/shared/dashboard-authoring/automatic-grain.d.ts +77 -0
  79. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +1 -0
  80. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +13 -8
  81. package/dist/types/shared/dashboard-authoring/control-value-resolution.d.ts +24 -0
  82. package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
  83. package/dist/types/shared/dashboard-authoring/kpi-trend-rule.d.ts +6 -29
  84. package/dist/types/shared/dashboard-authoring/variable-draft.d.ts +1 -0
  85. package/dist/types/shared/format-utils/index.d.ts +1 -0
  86. package/dist/types/shared/format-utils/partial-period.d.ts +40 -0
  87. package/dist/types/shared/format-utils/temporal-bucket.d.ts +11 -0
  88. package/dist/types/shared/usage-events/details.d.ts +2 -2
  89. package/dist/usage-events/index.js +1 -1
  90. package/package.json +1 -1
  91. package/dist/chunks/dates-5z3b9Loo.js +0 -136
  92. package/dist/chunks/selection-filter-compiler-BReJy-uv.js +0 -92
  93. package/dist/chunks/visual-choice-BBPizkRo.js +0 -206
@@ -165,6 +165,11 @@ export declare const analyticsFilterSchema: z.ZodObject<{
165
165
  scope?: "aggregate" | "row" | undefined;
166
166
  }>;
167
167
  export declare const TIME_GRAINS: readonly ["minute", "hour", "day", "week", "month", "quarter", "year"];
168
+ /**
169
+ * Chart date grain DG-D8: a chart's date grouped by a grain that follows the
170
+ * dashboard date, the word the KPI trend's `trendGrain` already uses.
171
+ */
172
+ export declare const AUTOMATIC_TIME_GRAIN: "automatic";
168
173
  /** The largest row limit a query states. */
169
174
  export declare const MAX_QUERY_LIMIT = 1000;
170
175
  declare const queryMeasureUnion: z.ZodUnion<[z.ZodString, z.ZodObject<{
@@ -1191,7 +1196,7 @@ export declare const metricCardQuerySchema: z.ZodObject<{
1191
1196
  connectionId?: string | undefined;
1192
1197
  } | undefined;
1193
1198
  }>]>>;
1194
- timeGrain: z.ZodOptional<z.ZodEnum<["minute", "hour", "day", "week", "month", "quarter", "year"]>>;
1199
+ timeGrain: z.ZodOptional<z.ZodEnum<["minute", "hour", "day", "week", "month", "quarter", "year", "automatic"]>>;
1195
1200
  filters: z.ZodOptional<z.ZodArray<z.ZodObject<{
1196
1201
  id: z.ZodOptional<z.ZodString>;
1197
1202
  field: z.ZodUnion<[z.ZodString, z.ZodObject<{
@@ -1600,7 +1605,7 @@ export declare const metricCardQuerySchema: z.ZodObject<{
1600
1605
  connectionId?: string | undefined;
1601
1606
  } | undefined;
1602
1607
  } | undefined;
1603
- timeGrain?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year" | undefined;
1608
+ timeGrain?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year" | "automatic" | undefined;
1604
1609
  dimensions?: (string | {
1605
1610
  name: string;
1606
1611
  datasetName?: string | undefined;
@@ -1827,7 +1832,7 @@ export declare const metricCardQuerySchema: z.ZodObject<{
1827
1832
  connectionId?: string | undefined;
1828
1833
  } | undefined;
1829
1834
  } | undefined;
1830
- timeGrain?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year" | undefined;
1835
+ timeGrain?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year" | "automatic" | undefined;
1831
1836
  dimensions?: (string | {
1832
1837
  name: string;
1833
1838
  datasetName?: string | undefined;
@@ -2760,7 +2765,7 @@ declare const cardQueryPatchObject: z.ZodObject<{
2760
2765
  connectionId?: string | undefined;
2761
2766
  } | undefined;
2762
2767
  }>]>>>;
2763
- timeGrain: z.ZodOptional<z.ZodNullable<z.ZodEnum<["minute", "hour", "day", "week", "month", "quarter", "year"]>>>;
2768
+ timeGrain: z.ZodOptional<z.ZodNullable<z.ZodEnum<["minute", "hour", "day", "week", "month", "quarter", "year", "automatic"]>>>;
2764
2769
  filters: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
2765
2770
  id: z.ZodOptional<z.ZodString>;
2766
2771
  field: z.ZodUnion<[z.ZodString, z.ZodObject<{
@@ -3187,7 +3192,7 @@ declare const cardQueryPatchObject: z.ZodObject<{
3187
3192
  connectionId?: string | undefined;
3188
3193
  } | undefined;
3189
3194
  } | null | undefined;
3190
- timeGrain?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year" | null | undefined;
3195
+ timeGrain?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year" | "automatic" | null | undefined;
3191
3196
  dimensions?: (string | {
3192
3197
  name: string;
3193
3198
  datasetName?: string | undefined;
@@ -3430,7 +3435,7 @@ declare const cardQueryPatchObject: z.ZodObject<{
3430
3435
  connectionId?: string | undefined;
3431
3436
  } | undefined;
3432
3437
  } | null | undefined;
3433
- timeGrain?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year" | null | undefined;
3438
+ timeGrain?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year" | "automatic" | null | undefined;
3434
3439
  dimensions?: (string | {
3435
3440
  name: string;
3436
3441
  datasetName?: string | undefined;
@@ -4910,7 +4915,7 @@ export declare const dashboardChangeSchema: z.ZodDiscriminatedUnion<"op", [z.Zod
4910
4915
  connectionId?: string | undefined;
4911
4916
  } | undefined;
4912
4917
  } | null | undefined;
4913
- timeGrain?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year" | null | undefined;
4918
+ timeGrain?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year" | "automatic" | null | undefined;
4914
4919
  dimensions?: (string | {
4915
4920
  name: string;
4916
4921
  datasetName?: string | undefined;
@@ -5264,7 +5269,7 @@ export declare const dashboardChangeSchema: z.ZodDiscriminatedUnion<"op", [z.Zod
5264
5269
  connectionId?: string | undefined;
5265
5270
  } | undefined;
5266
5271
  } | null | undefined;
5267
- timeGrain?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year" | null | undefined;
5272
+ timeGrain?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year" | "automatic" | null | undefined;
5268
5273
  dimensions?: (string | {
5269
5274
  name: string;
5270
5275
  datasetName?: string | undefined;
@@ -30,6 +30,30 @@ export declare function resolveBindingControlValue(params: {
30
30
  definitions: Map<string, ControlDefinition>;
31
31
  controlValues?: Record<string, unknown>;
32
32
  }): string | undefined;
33
+ /**
34
+ * The value a binding applies to a card, or `undefined` when it applies
35
+ * nothing: an optional control with no value, or one set to the card's own
36
+ * default. The one rule the server's control resolution and the grain chip
37
+ * read (chart date grain review P4R-06).
38
+ */
39
+ export declare function appliedBindingControlValue(params: {
40
+ binding: ControlBinding;
41
+ definitions: Map<string, ControlDefinition>;
42
+ controlValues?: Record<string, unknown>;
43
+ }): string | undefined;
44
+ /**
45
+ * Whether a Grain control sets the card's date grain now. A Grain control
46
+ * wins over a viewer's grain pick, as it wins over the card's saved grain:
47
+ * the server applies it after the pick (chart date grain review P4R-06). A
48
+ * control that can't resolve leaves the card unrunnable, so it counts as
49
+ * setting the grain.
50
+ */
51
+ export declare function grainControlApplies(context: {
52
+ controlBindings: readonly ControlBinding[];
53
+ controlDefinitions: ControlDefinition[];
54
+ cardControlDefinitions: ControlDefinition[];
55
+ controlValues: Record<string, unknown>;
56
+ }): boolean;
33
57
  export declare function resolveScalarMappedValue(params: {
34
58
  binding: Extract<ControlBinding, {
35
59
  mapping: unknown;
@@ -1,5 +1,6 @@
1
1
  export * from './comparison-document-migration.js';
2
2
  export * from './temporal-result-owner.js';
3
+ export * from './automatic-grain.js';
3
4
  export * from './detail-date-presentation.js';
4
5
  export * from './temporal-bucket-authoring.js';
5
6
  export * from './canonical-result-keys.js';
@@ -1,14 +1,13 @@
1
1
  import { CardConfig } from '../../lib/types/explorer-types.js';
2
- import { TemporalBucketMetadata } from '../analytics-protocol/contracts.js';
2
+ import { DateGrainSource, DateWindow, TemporalBucketMetadata } from '../analytics-protocol/contracts.js';
3
+ import { DatePeriodPartial } from '../format-utils/partial-period.js';
3
4
  /** A grain a KPI's trend draws in (KT-D2): the Trend By's, the card's or Automatic's. */
4
5
  export type KpiTrendGrain = NonNullable<CardConfig['kpiTrendGrain']>;
5
6
  export declare const KPI_TREND_GRAINS: readonly KpiTrendGrain[];
6
7
  /** How many periods a history or recent span shows (KT-D4, as KL-D28). */
7
8
  export declare const KPI_TREND_PERIODS = 12;
8
- /** The most periods a trend draws; past it the trend runs no query (KT-D8). */
9
- export declare const KPI_TREND_MAX_POINTS = 400;
10
- /** Where the trend's grain came from (KT-D2). */
11
- export type KpiTrendGrainSource = 'trend_by' | 'card' | 'automatic';
9
+ /** Where the trend's grain came from (KT-D2): a chart's sources, or the Trend By. */
10
+ export type KpiTrendGrainSource = DateGrainSource | 'trend_by';
12
11
  /**
13
12
  * What the trend's periods cover (KT-D4): the period the KPI counts, cut into
14
13
  * periods (`window`); the 12 periods ending with it when it is one period of
@@ -19,7 +18,7 @@ export type KpiTrendSpan = 'window' | 'history' | 'recent';
19
18
  * A point that covers less than its whole period (KT-D9): still running at the
20
19
  * reference time, cut by the counted period's start, or cut by its end.
21
20
  */
22
- export type KpiTrendPartial = 'running' | 'start' | 'end';
21
+ export type KpiTrendPartial = DatePeriodPartial;
23
22
  /**
24
23
  * The trend's grain and calendar, as every grouped date names its buckets
25
24
  * (KPI tile layout ledger H-4), with where the grain came from and what the
@@ -34,30 +33,8 @@ export type KpiTrendMetadata = TemporalBucketMetadata & {
34
33
  * a point cut at its start or end names that date from here (ledger ED-02).
35
34
  * Absent for a recent span, which has no counted period.
36
35
  */
37
- window?: {
38
- startInclusive: string;
39
- endExclusive: string;
40
- };
36
+ window?: DateWindow;
41
37
  };
42
- /**
43
- * Automatic's grain (KT-D3) from the length of the period the KPI counts:
44
- * up to 2 days by hour, 62 days by day, 26 weeks by week, 3 years by month,
45
- * 12 years by quarter, longer by year; with no period, by month. Hour only
46
- * when the date holds a time (KT-D7); otherwise day is the finest.
47
- */
48
- export declare function automaticKpiTrendGrain(window: {
49
- startInclusive: string;
50
- endExclusive: string;
51
- } | undefined, holdsTime: boolean): KpiTrendGrain;
52
- /**
53
- * About how many points a grain draws over a counted period, for the editor's
54
- * Grain menu to disable a grain past the limit (KT-D8, ledger ED-03). An
55
- * estimate: the server counts the periods exactly and skips past the limit.
56
- */
57
- export declare function estimateKpiTrendPoints(window: {
58
- startInclusive: string;
59
- endExclusive: string;
60
- }, grain: KpiTrendGrain): number;
61
38
  /** The editor's Trend row under the Date section (KT-D11): what the line draws and where its grain came from. */
62
39
  export type KpiTrendRowWords = {
63
40
  head: string;
@@ -110,6 +110,7 @@ export declare const SHELF_FIELD_KEYS: {
110
110
  readonly semanticComparisonPolarity: "shelf";
111
111
  readonly parameters: "shelf";
112
112
  readonly direction: "shelf";
113
+ readonly grainMode: "shelf";
113
114
  };
114
115
  /** The dialog's draft for a saved variable. */
115
116
  export declare function draftFromVariable(variable: DataVariable): VariableDraft;
@@ -31,6 +31,7 @@ export { pickColumnFormat, resolveColumnFormat, withLiveModelFormats, type Colum
31
31
  export * from './presentation-execution.js';
32
32
  export * from './temporal-bucket-format-policy.js';
33
33
  export * from './temporal-bucket.js';
34
+ export * from './partial-period.js';
34
35
  export * from './raw-temporal.js';
35
36
  export * from './temporal-input-presentation.js';
36
37
  export * from './flat-table-export-totals.js';
@@ -0,0 +1,40 @@
1
+ import { DateWindow, TemporalBucketMetadata } from '../analytics-protocol/contracts.js';
2
+ import { ResolvedTemporalValueFormatPreferences } from '../value-format-preferences/value-format-preferences.js';
3
+ /** How a period covers less than its whole span: still running, cut at its start, or cut at its end. */
4
+ export type DatePeriodPartial = 'running' | 'start' | 'end';
5
+ /**
6
+ * A whole period cut to the counted window (KT-D9): it starts no earlier than
7
+ * the window and ends no later; `running` when it ends after `now`, else
8
+ * `start` or `end` when the window cut it, else whole.
9
+ */
10
+ export declare function cutDatePeriod(period: {
11
+ start: Date;
12
+ end: Date;
13
+ }, counted: {
14
+ from: Date;
15
+ to?: Date;
16
+ }, now: Date): {
17
+ start: Date;
18
+ end: Date;
19
+ partial?: DatePeriodPartial;
20
+ };
21
+ /**
22
+ * A period's name with how it is partial (KT-D10): "Nov 2026 (so far)",
23
+ * "Week of Aug 3 (from Aug 6)", "(to Nov 3)", or "(partial)" when the cut
24
+ * date can't be named. A whole period keeps its name.
25
+ */
26
+ export declare function partialPeriodLabel(name: string, partial: DatePeriodPartial | undefined, edges?: {
27
+ start: string;
28
+ end: string;
29
+ }): string;
30
+ /**
31
+ * Names where a counted window cuts a period (ledger ED-02), in the calendar
32
+ * the server counted in: for day and coarser grains, the day holding its
33
+ * start or the last day before its end ("8/6/26"); below a day, the time of
34
+ * the cut, in the viewer's time style. Undefined when the window's dates
35
+ * can't be read.
36
+ */
37
+ export declare function partialPeriodEdgeNames(window: DateWindow, metadata: TemporalBucketMetadata, preferences: ResolvedTemporalValueFormatPreferences | undefined): {
38
+ start: string;
39
+ end: string;
40
+ } | undefined;
@@ -89,6 +89,17 @@ export declare function temporalBucketPeriod(value: TemporalBucketValue, metadat
89
89
  endExclusive: string;
90
90
  timezone: string;
91
91
  } | undefined;
92
+ /**
93
+ * The calendar days a bucket covers, first and last inclusive, as
94
+ * `YYYY-MM-DD` on its own calendar (a week from its week start, a fiscal
95
+ * quarter): the whole-day form a date-only range means (chart date zoom
96
+ * DZ-D4). Undefined for a value that isn't canonical, a blank, or a grain
97
+ * finer than a day, which a whole-day range can't follow.
98
+ */
99
+ export declare function temporalBucketDays(value: TemporalBucketValue, metadata: TemporalBucketMetadata): {
100
+ first: string;
101
+ last: string;
102
+ } | undefined;
92
103
  /**
93
104
  * A bucket's grain and governed calendar in words, for a reader that restates
94
105
  * a bucketed condition ("by hour in the America/Chicago calendar; each value
@@ -165,13 +165,13 @@ export declare const queryExecutedDetailsSchema: z.ZodObject<{
165
165
  page?: number | undefined;
166
166
  rows?: number | undefined;
167
167
  dataset?: string | undefined;
168
+ card_type?: string | undefined;
168
169
  trigger?: "sort" | "page" | "refresh" | "drill" | "initial_load" | "input_change" | "click_filter" | undefined;
169
170
  dashboard_title?: string | undefined;
170
171
  project_name?: string | undefined;
171
172
  parent_query_run_id?: string | undefined;
172
173
  query_kind?: "card" | "sql" | "export" | "matrix_window" | "filter_options" | "control_options" | undefined;
173
174
  card_title?: string | undefined;
174
- card_type?: string | undefined;
175
175
  sheet_title?: string | undefined;
176
176
  connection_name?: string | undefined;
177
177
  connection_type?: string | undefined;
@@ -194,13 +194,13 @@ export declare const queryExecutedDetailsSchema: z.ZodObject<{
194
194
  page?: number | undefined;
195
195
  rows?: number | undefined;
196
196
  dataset?: string | undefined;
197
+ card_type?: string | undefined;
197
198
  trigger?: "sort" | "page" | "refresh" | "drill" | "initial_load" | "input_change" | "click_filter" | undefined;
198
199
  dashboard_title?: string | undefined;
199
200
  project_name?: string | undefined;
200
201
  parent_query_run_id?: string | undefined;
201
202
  query_kind?: "card" | "sql" | "export" | "matrix_window" | "filter_options" | "control_options" | undefined;
202
203
  card_title?: string | undefined;
203
- card_type?: string | undefined;
204
204
  sheet_title?: string | undefined;
205
205
  connection_name?: string | undefined;
206
206
  connection_type?: string | undefined;
@@ -1,5 +1,5 @@
1
1
  import { z as e } from "zod";
2
- import { g as h, l as S } from "../chunks/context-BTLBjQNh.js";
2
+ import { g as h, l as S } from "../chunks/context-CVXTFljo.js";
3
3
  import { Q as b, a as y, b as x } from "../chunks/attribution-BvoKvhcj.js";
4
4
  import { U as te, c as ne, u as ae } from "../chunks/attribution-BvoKvhcj.js";
5
5
  const r = e.string().min(1).max(128), t = e.string().max(500), m = e.array(e.string().max(500)).max(500), n = e.number().int().nonnegative(), p = e.string().refine((o) => new TextEncoder().encode(o).length <= 16 * 1024), f = e.object({
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.587",
8
+ "version": "0.1.588",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",
@@ -1,136 +0,0 @@
1
- import { d as h, e as y } from "./filter-reach-copy-0Xp97cLk.js";
2
- import { h as b, d as g, r as F, a as m, e as N } from "./resolve-dashboard-input-context-zEXuitoF.js";
3
- import "./validators-CJ8Jh0E8.js";
4
- import "./matrix-operation-contract-BM5TveR3.js";
5
- import "./analytics-base-schemas-BaIQrEzX.js";
6
- import "zod";
7
- import "./pivot-result-contract-expectations-Bx_BCu-7.js";
8
- import "../value-format-preferences/index.js";
9
- import { A as T } from "./bookmark-state-CL4WEpgB.js";
10
- import "./schema-C9NPiIru.js";
11
- import "./index-CV_Kzou0.js";
12
- import "./context-BTLBjQNh.js";
13
- import { p as C, r as P } from "./stored-dashboard-CURqJgoa.js";
14
- import { g as q } from "./saved-dashboard-context-Cll5LipJ.js";
15
- const Y = ["hour", "day", "week", "month", "quarter", "year"], j = 12, H = 400, I = 36e5, p = 24 * I;
16
- function X(a, e) {
17
- if (!a) return "month";
18
- const t = (Date.parse(a.endExclusive) - Date.parse(a.startInclusive)) / p;
19
- return t <= 2 ? e ? "hour" : "day" : t <= 62 ? "day" : t <= 183 ? "week" : t <= 3 * 366 ? "month" : t <= 12 * 366 ? "quarter" : "year";
20
- }
21
- const v = {
22
- hour: 1 / 24,
23
- day: 1,
24
- week: 7,
25
- month: 30.44,
26
- quarter: 91.31,
27
- year: 365.25
28
- };
29
- function G(a, e) {
30
- const t = (Date.parse(a.endExclusive) - Date.parse(a.startInclusive)) / p;
31
- return Number.isFinite(t) ? Math.ceil(t / v[e]) : 0;
32
- }
33
- const w = {
34
- automatic: "Automatic",
35
- card: "Set on this card",
36
- trend_by: "From Trend By"
37
- };
38
- function J(a, e, t = {}) {
39
- if (!a) return;
40
- const n = a.granularity;
41
- if (a.skipped)
42
- return {
43
- head: `Too many points by ${n}`,
44
- // A Trend By sets the grain, so the fix is there (review P3R-02).
45
- detail: a.grainSource === "trend_by" ? "Pick a coarser grain on the Trend By." : "Pick a coarser grain, or Automatic."
46
- };
47
- const i = w[a.grainSource], r = a.span === "recent" ? `The last 12 ${n}s: no date range` : a.span === "history" ? `The 12 ${n}s ending with this one` : a.window ? h({ ...a.window, timezone: a.calendar.tz }, t.now) : void 0;
48
- return {
49
- head: `By ${n} · ${e} ${e === 1 ? "point" : "points"}`,
50
- detail: r ? `${r} · ${i}` : i
51
- };
52
- }
53
- function R(a, e) {
54
- var n;
55
- if (e.status === "blocked" || (n = a.sql) != null && n.trim()) return !1;
56
- const t = new Set(
57
- e.mappingDispositions.flatMap(
58
- (i) => i.status === "apply" ? [i.filterValue.filterId] : []
59
- )
60
- );
61
- return e.cardFilterValues.some((i) => {
62
- const r = e.queryFilterDefinitions.find(
63
- (d) => d.id === i.filterId
64
- );
65
- if (!b(i)) return !1;
66
- if (!(t.has(i.filterId) || (r == null ? void 0 : r.kind) === "global-date"))
67
- return !!(r && S(
68
- [r],
69
- e.resolvedPrimaryDateField,
70
- [i]
71
- ));
72
- const o = g(i);
73
- return !!(o && F({
74
- card: a,
75
- filter: o,
76
- filterValue: i,
77
- effectiveFilterValue: i,
78
- temporalBinding: e.resolvedPrimaryDateField
79
- }).status === "eligible");
80
- });
81
- }
82
- function S(a, e, t) {
83
- if (!e) return !1;
84
- const n = e.qualifiedFieldName, i = e.qualifiedEntityName, r = i && e.name ? `${i}.${e.name}` : n;
85
- return a.some((s) => {
86
- if (!(m(s.dataType || "") === "date")) return !1;
87
- const d = y(s, t), l = d.split("."), c = l[l.length - 1] || d, D = l.length > 1 ? l.slice(0, -1).join(".") : void 0, f = s.qualifiedTableName || D, u = f ? `${f}.${c}` : void 0;
88
- return n ? u ? u === r || u.endsWith(`.${n}`) : c === e.name : u ? u === r : c === e.name;
89
- });
90
- }
91
- function _(a, e) {
92
- const t = (r) => {
93
- const s = r.field;
94
- return s ? e.id && s.id === e.id ? !0 : e.qualifiedFieldName && s.qualifiedFieldName ? s.qualifiedFieldName === e.qualifiedFieldName : s.name === e.name : !1;
95
- }, n = (r) => r.conditions.some((s) => {
96
- var o;
97
- return m(((o = s.field) == null ? void 0 : o.dataType) || "") === "date" && t(s);
98
- }) || r.groups.some(n), i = N(a);
99
- return i ? n(i) : !1;
100
- }
101
- function k(a, e) {
102
- var o, d;
103
- const t = (d = (o = a.config) == null ? void 0 : o.groupByColumns) == null ? void 0 : d.find((l) => m(l.dataType || "") === "date"), n = e.resolvedPrimaryDateField, i = t ? { id: t.id, name: t.name, label: t.label || t.name, qualifiedFieldName: t.qualifiedFieldName } : n ? { name: n.name, label: n.name, qualifiedFieldName: n.qualifiedFieldName } : void 0;
104
- if (!i) return { comparisonDate: null, dateWindow: e.status === "ready" ? "none" : "unknown" };
105
- const r = { name: i.name, label: i.label };
106
- if (_(a, i)) return { comparisonDate: r, dateWindow: "applies" };
107
- if (e.status !== "ready") return { comparisonDate: r, dateWindow: "unknown" };
108
- const s = R(a, { status: "ready", ...e.compiledFilters });
109
- return { comparisonDate: r, dateWindow: s ? "applies" : "none" };
110
- }
111
- function Z(a) {
112
- const e = C(a.dashboard), t = T(e).find((s) => s.cardId === a.cardId);
113
- if (!t || t.kind === "documentSectionCard") return { comparisonDate: null, dateWindow: "unknown" };
114
- const { runtimeValues: n, transientContexts: i } = P({ dashboard: e, capture: {}, calendar: a.calendar }), r = q({
115
- dashboard: e,
116
- location: t,
117
- runtimeValues: n,
118
- semanticExecutionPayload: a.semanticExecutionPayload,
119
- calendar: a.calendar,
120
- transientContexts: i
121
- });
122
- return k(
123
- t.card,
124
- (r == null ? void 0 : r.status) === "ready" ? { status: "ready", compiledFilters: r.compiledFilters, resolvedPrimaryDateField: r.resolvedPrimaryDateField } : { status: "blocked", resolvedPrimaryDateField: r == null ? void 0 : r.resolvedPrimaryDateField }
125
- );
126
- }
127
- export {
128
- Y as K,
129
- j as a,
130
- H as b,
131
- X as c,
132
- J as d,
133
- G as e,
134
- Z as f,
135
- k as r
136
- };
@@ -1,92 +0,0 @@
1
- function f(e, r) {
2
- return {
3
- id: r,
4
- field: e.field,
5
- operator: e.operator,
6
- value: e.value,
7
- label: e.label,
8
- temporalBucket: e.temporalBucket,
9
- ...e.rawTemporal ? { rawTemporal: e.rawTemporal } : {}
10
- };
11
- }
12
- function p(e) {
13
- var r;
14
- return JSON.stringify([
15
- ((r = e.field) == null ? void 0 : r.id) ?? "",
16
- e.operator,
17
- e.value ?? null,
18
- e.temporalBucket ?? null,
19
- e.rawTemporal ?? null
20
- ]);
21
- }
22
- function c(e) {
23
- return JSON.stringify(e.map(p).sort());
24
- }
25
- function i(e) {
26
- const r = /* @__PURE__ */ new Map();
27
- for (const t of e)
28
- for (const o of t.tuples) {
29
- const l = o.conditions.filter(
30
- (u) => {
31
- var n;
32
- return (n = u.field) == null ? void 0 : n.id;
33
- }
34
- );
35
- if (l.length === 0) continue;
36
- let a = r.get(t.sourceCardId);
37
- a || (a = /* @__PURE__ */ new Map(), r.set(t.sourceCardId, a));
38
- const s = [...l].sort(
39
- (u, n) => p(u).localeCompare(p(n))
40
- );
41
- a.set(c(s), s);
42
- }
43
- return [...r.entries()].sort(([t], [o]) => t.localeCompare(o)).map(([t, o]) => ({
44
- sourceCardId: t,
45
- tuples: [...o.entries()].sort(([l], [a]) => l.localeCompare(a)).map(([, l]) => ({ conditions: l }))
46
- }));
47
- }
48
- function d(e) {
49
- const r = i(e);
50
- if (r.length !== 0)
51
- return {
52
- id: "selection",
53
- logicalOperator: "AND",
54
- negate: !1,
55
- conditions: [],
56
- groups: r.map((t) => {
57
- const o = `selection:${t.sourceCardId}`;
58
- return {
59
- id: o,
60
- logicalOperator: "OR",
61
- negate: !1,
62
- conditions: [],
63
- groups: t.tuples.map((l, a) => {
64
- const s = `${o}:${a}`;
65
- return {
66
- id: s,
67
- logicalOperator: "AND",
68
- negate: !1,
69
- conditions: l.conditions.map((u, n) => ({
70
- ...u,
71
- id: `${s}:${n}`
72
- })),
73
- groups: []
74
- };
75
- })
76
- };
77
- })
78
- };
79
- }
80
- function m(e) {
81
- return JSON.stringify(
82
- i(e).map((r) => [
83
- r.sourceCardId,
84
- r.tuples.map((t) => t.conditions.map(p))
85
- ])
86
- );
87
- }
88
- export {
89
- d as c,
90
- m as s,
91
- f as t
92
- };