react-semaphor 0.1.326 → 0.1.327

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 (64) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +1 -1
  3. package/dist/brand-studio/index.cjs +1 -1
  4. package/dist/brand-studio/index.js +4 -4
  5. package/dist/chunks/{braces-dHeaioTd.js → braces-B6qRDu1H.js} +1 -1
  6. package/dist/chunks/{braces-DVaMJoCd.js → braces-BGWZEnQJ.js} +1 -1
  7. package/dist/chunks/{calendar-preferences-dialog--2jD-eKu.js → calendar-preferences-dialog-CjwbE_82.js} +3 -3
  8. package/dist/chunks/{calendar-preferences-dialog-mqU_uOmY.js → calendar-preferences-dialog-fkLUMJyR.js} +1 -1
  9. package/dist/chunks/{chevrons-up-down-CLbzBHoI.js → chevrons-up-down-BpsogQvv.js} +1 -1
  10. package/dist/chunks/{chevrons-up-down-DNQE-uEp.js → chevrons-up-down-xG-bVFD9.js} +1 -1
  11. package/dist/chunks/{dashboard-briefing-launcher-DguNfFr8.js → dashboard-briefing-launcher-Co57xBfS.js} +2 -2
  12. package/dist/chunks/{dashboard-briefing-launcher-DsjXUPFq.js → dashboard-briefing-launcher-Cy1nWZRW.js} +713 -719
  13. package/dist/chunks/{dashboard-controls-DgNkM1yT.js → dashboard-controls-BWnVEFJq.js} +7 -7
  14. package/dist/chunks/{dashboard-controls-XCa9PZuU.js → dashboard-controls-C7rOGZO-.js} +1 -1
  15. package/dist/chunks/{dashboard-json-DkA6Bf0Y.js → dashboard-json-BpRNSsF3.js} +2 -2
  16. package/dist/chunks/{dashboard-json-DiBd65Xf.js → dashboard-json-DBPMknGo.js} +1 -1
  17. package/dist/chunks/date-formatter-B4EBSe9C.js +1 -0
  18. package/dist/chunks/date-formatter-CzcPZx39.js +416 -0
  19. package/dist/chunks/edit-dashboard-visual-B2vkIKEa.js +178 -0
  20. package/dist/chunks/{edit-dashboard-visual-Q5hW5MXk.js → edit-dashboard-visual-CYf26co_.js} +8241 -7784
  21. package/dist/chunks/{index-B1-46PoR.js → index-BD90s-wf.js} +208 -202
  22. package/dist/chunks/{index-DwfDwtv2.js → index-DTlbYpxd.js} +26702 -26334
  23. package/dist/chunks/{palette-DtmNws9a.js → palette-CSF7IVJn.js} +1 -1
  24. package/dist/chunks/{palette-DpcvHAiY.js → palette-CWgEPBoG.js} +1 -1
  25. package/dist/chunks/{resource-management-panel-CGwWKZOP.js → resource-management-panel-D6nbfJY3.js} +1 -1
  26. package/dist/chunks/{resource-management-panel-D2oAQkKi.js → resource-management-panel-D893Onv8.js} +3 -3
  27. package/dist/chunks/{save-Cv_XRb94.js → save-CtQbSub2.js} +1 -1
  28. package/dist/chunks/{save-BY7WF62U.js → save-DRdFKF57.js} +1 -1
  29. package/dist/chunks/switch-DJJJD_g1.js +168 -0
  30. package/dist/chunks/{switch-j3AThLFk.js → switch-DKf6vHfP.js} +2447 -2405
  31. package/dist/chunks/{use-create-flow-overlay-state-BQPXP0AM.js → use-create-flow-overlay-state-C4LgoK8q.js} +1 -1
  32. package/dist/chunks/{use-create-flow-overlay-state-CP6GDQAX.js → use-create-flow-overlay-state-p21zs2p6.js} +4 -4
  33. package/dist/chunks/{use-visual-utils-CSXU-96k.js → use-visual-utils-BKBua6o4.js} +2 -2
  34. package/dist/chunks/{use-visual-utils-NpOW5uZ1.js → use-visual-utils-BqWm0QeW.js} +1 -1
  35. package/dist/chunks/{validators-DvTxl9i0.js → validators-DDAweCzB.js} +67 -48
  36. package/dist/chunks/validators-odlRJblR.js +2 -0
  37. package/dist/dashboard/index.cjs +1 -1
  38. package/dist/dashboard/index.js +1 -1
  39. package/dist/dashboard-authoring/index.cjs +3 -3
  40. package/dist/dashboard-authoring/index.js +907 -527
  41. package/dist/data-app-sdk/index.cjs +1 -1
  42. package/dist/data-app-sdk/index.js +1 -1
  43. package/dist/format-utils/index.cjs +4 -4
  44. package/dist/format-utils/index.js +22 -21
  45. package/dist/index.cjs +1 -1
  46. package/dist/index.js +7 -7
  47. package/dist/style.css +1 -1
  48. package/dist/surfboard/index.cjs +1 -1
  49. package/dist/surfboard/index.js +2 -2
  50. package/dist/types/analytics-protocol.d.ts +1 -0
  51. package/dist/types/dashboard-authoring.d.ts +79 -2
  52. package/dist/types/dashboard.d.ts +17 -2
  53. package/dist/types/data-app-sdk.d.ts +1 -0
  54. package/dist/types/format-utils.d.ts +25 -0
  55. package/dist/types/main.d.ts +65 -10
  56. package/dist/types/shared.d.ts +17 -2
  57. package/dist/types/surfboard.d.ts +17 -2
  58. package/dist/types/types.d.ts +32 -3
  59. package/package.json +1 -1
  60. package/dist/chunks/date-formatter-D9Bvw5Qk.js +0 -1
  61. package/dist/chunks/date-formatter-DyIOb6uC.js +0 -333
  62. package/dist/chunks/edit-dashboard-visual-BC9eOc4U.js +0 -178
  63. package/dist/chunks/switch-5aQ_jcLH.js +0 -168
  64. package/dist/chunks/validators-DJUMR5An.js +0 -2
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/index-B1-46PoR.js"),e=require("../chunks/common-types-C73-Ud1-.js"),a=require("../chunks/calendar-preferences-dialog-mqU_uOmY.js");exports.Surfboard=r.DashboardPlus;exports.CONTROL_CARD_DEFAULT_VALUE=e.CONTROL_CARD_DEFAULT_VALUE;exports.EMPTY_SELECTION=e.EMPTY_SELECTION;exports.CalendarPreferencesDialog=a.CalendarPreferencesDialog;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/index-BD90s-wf.js"),e=require("../chunks/common-types-C73-Ud1-.js"),a=require("../chunks/calendar-preferences-dialog-fkLUMJyR.js");exports.Surfboard=r.DashboardPlus;exports.CONTROL_CARD_DEFAULT_VALUE=e.CONTROL_CARD_DEFAULT_VALUE;exports.EMPTY_SELECTION=e.EMPTY_SELECTION;exports.CalendarPreferencesDialog=a.CalendarPreferencesDialog;
@@ -1,6 +1,6 @@
1
- import { a as e } from "../chunks/index-DwfDwtv2.js";
1
+ import { a as e } from "../chunks/index-DTlbYpxd.js";
2
2
  import { C, E } from "../chunks/common-types-4bjoIgvm.js";
3
- import { C as s } from "../chunks/calendar-preferences-dialog--2jD-eKu.js";
3
+ import { C as s } from "../chunks/calendar-preferences-dialog-CjwbE_82.js";
4
4
  export {
5
5
  C as CONTROL_CARD_DEFAULT_VALUE,
6
6
  s as CalendarPreferencesDialog,
@@ -294,6 +294,7 @@ export declare type SemaphorFieldRef = {
294
294
  label?: string;
295
295
  role?: 'dimension' | 'measure' | 'date' | 'id' | 'unknown';
296
296
  dataType?: 'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'unknown';
297
+ source?: SemaphorSourceRef;
297
298
  };
298
299
 
299
300
  export declare type SemaphorInputBinding = {
@@ -496,6 +496,8 @@ declare type DashboardAIContextMode = 'auto' | 'fixed';
496
496
 
497
497
  export declare type DashboardAuthoringBreakpoint = (typeof DASHBOARD_AUTHORING_BREAKPOINTS)[number];
498
498
 
499
+ export declare function dashboardAuthoringDatasetMatchesSource(dataset: unknown, source: SemaphorSourceRef | undefined): boolean;
500
+
499
501
  export declare type DashboardAuthoringDatasetRef = {
500
502
  kind: 'semantic';
501
503
  domainId: string;
@@ -512,6 +514,17 @@ export declare type DashboardAuthoringDatasetRef = {
512
514
  label?: string;
513
515
  };
514
516
 
517
+ export declare type DashboardAuthoringDatasetScopeIssue = 'invalid_dataset_count' | 'invalid_multi_dataset_scope';
518
+
519
+ export declare type DashboardAuthoringDatasetScopeResult = {
520
+ ok: true;
521
+ } | {
522
+ ok: false;
523
+ issue: DashboardAuthoringDatasetScopeIssue;
524
+ };
525
+
526
+ export declare function dashboardAuthoringFieldsReferToSameTarget(left: SemaphorFieldRef | undefined, right: SemaphorFieldRef | undefined): boolean;
527
+
515
528
  export declare type DashboardAuthoringIdFactory = {
516
529
  dashboardId?: () => string;
517
530
  sheetId?: () => string;
@@ -519,18 +532,31 @@ export declare type DashboardAuthoringIdFactory = {
519
532
  cardId: (seed?: string) => string;
520
533
  };
521
534
 
535
+ export declare function dashboardAuthoringSourceFromField(field: SemaphorFieldRef | undefined, fallback?: SemaphorSourceRef): MaterializableDashboardAuthoringSource | undefined;
536
+
537
+ export declare function dashboardAuthoringSourceKey(source: SemaphorSourceRef): string;
538
+
539
+ export declare function dashboardAuthoringSourcesReferToSameDataset(left: SemaphorSourceRef, right: SemaphorSourceRef): boolean;
540
+
522
541
  export declare type DashboardAuthoringValidationResult = {
523
542
  ok: boolean;
524
543
  errors: DashboardPlanWarning[];
525
544
  warnings: DashboardPlanWarning[];
526
545
  };
527
546
 
547
+ export declare type DashboardCardQueryFieldRef = {
548
+ name: string;
549
+ source?: DashboardAuthoringDatasetRef;
550
+ };
551
+
528
552
  export declare type DashboardCardQueryIntent = {
529
553
  metric?: string;
530
554
  metrics?: string[];
531
555
  dateField?: string;
556
+ dateFieldRef?: DashboardCardQueryFieldRef;
532
557
  timeGrain?: 'day' | 'week' | 'month' | 'quarter' | 'year';
533
558
  dimensions?: string[];
559
+ dimensionRefs?: DashboardCardQueryFieldRef[];
534
560
  limit?: number;
535
561
  };
536
562
 
@@ -774,6 +800,11 @@ export declare type DashboardSuggestion = {
774
800
  cardCount: number;
775
801
  filterCount: number;
776
802
  prompt: string;
803
+ datasets?: Array<{
804
+ name: string;
805
+ label?: string;
806
+ }>;
807
+ relationshipHints?: string[];
777
808
  };
778
809
 
779
810
  export declare type DashboardSuggestionPreviewKind = 'kpi' | 'line' | 'bar' | 'donut' | 'table';
@@ -1401,6 +1432,8 @@ declare type FilterSemanticContext = {
1401
1432
 
1402
1433
  declare type FilterValue = string | number | boolean | Date | null | [number, number] | [string, string] | string[] | number[];
1403
1434
 
1435
+ export declare function findDashboardAuthoringDatasetForSource(datasets: readonly DashboardAuthoringDatasetRef[], source: SemaphorSourceRef | undefined): DashboardAuthoringDatasetRef | undefined;
1436
+
1404
1437
  /**
1405
1438
  * Absolute fixed month/year default used by Month Picker defaults.
1406
1439
  * - `month` is 0-indexed (0=January, 11=December) to align with MonthPicker.
@@ -1434,6 +1467,16 @@ declare type FormatSpec = {
1434
1467
  sourceTimezone?: string;
1435
1468
  prefix?: string;
1436
1469
  suffix?: string;
1470
+ } | {
1471
+ type: 'duration';
1472
+ inputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1473
+ outputStyle?: 'compact' | 'digital' | 'long';
1474
+ largestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1475
+ smallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1476
+ maxUnits?: number;
1477
+ prefix?: string;
1478
+ suffix?: string;
1479
+ negativeStyle?: 'minus' | 'parentheses';
1437
1480
  } | {
1438
1481
  type: 'string';
1439
1482
  prefix?: string;
@@ -1448,6 +1491,8 @@ export declare type GeneratedDashboardCardArtifact = {
1448
1491
  warnings?: DashboardPlanWarning[];
1449
1492
  };
1450
1493
 
1494
+ export declare function getDashboardAuthoringCardSource(card: Pick<DashboardPlanCard, 'analyticsIntent'>): SemaphorSourceRef | undefined;
1495
+
1451
1496
  declare type Granularity = 'day' | 'week' | 'month' | 'quarter' | 'year' | 'hour' | 'minute' | 'second';
1452
1497
 
1453
1498
  declare interface GroupByColumn extends BaseColumn {
@@ -1545,6 +1590,10 @@ declare interface InteractionTrigger {
1545
1590
  field: Field;
1546
1591
  }
1547
1592
 
1593
+ export declare function isMaterializableDashboardAuthoringSource(value: unknown): value is MaterializableDashboardAuthoringSource;
1594
+
1595
+ export declare function isSemaphorSourceRef(value: unknown): value is SemaphorSourceRef;
1596
+
1548
1597
  declare interface Join {
1549
1598
  id: string;
1550
1599
  source: DatabaseEntityReference;
@@ -1585,6 +1634,12 @@ declare interface LinkFormat {
1585
1634
 
1586
1635
  declare type LogicalOperator = 'AND' | 'OR';
1587
1636
 
1637
+ export declare type MaterializableDashboardAuthoringSource = Extract<SemaphorSourceRef, {
1638
+ kind: 'semantic' | 'physical';
1639
+ }>;
1640
+
1641
+ export declare function mergeDashboardAuthoringSources(sources: readonly SemaphorSourceRef[]): SemaphorSourceRef[];
1642
+
1588
1643
  declare interface MetricColumn extends BaseColumn {
1589
1644
  role: 'metric';
1590
1645
  aggregate: AggregateFunction;
@@ -1716,6 +1771,10 @@ declare interface PivotByField extends Field {
1716
1771
  role: 'pivotby';
1717
1772
  }
1718
1773
 
1774
+ export declare function preferDashboardAuthoringSourceMetadata(current: SemaphorSourceRef, next: SemaphorSourceRef): SemaphorSourceRef;
1775
+
1776
+ export declare function preferredDashboardAuthoringSource(sources: readonly SemaphorSourceRef[]): SemaphorSourceRef | undefined;
1777
+
1719
1778
  declare interface QueryConfig {
1720
1779
  groupByColumns?: GroupByColumn[];
1721
1780
  pivotColumns?: GroupByColumn[];
@@ -1757,6 +1816,13 @@ declare type RelativeDateFilter = {
1757
1816
  to: number;
1758
1817
  };
1759
1818
 
1819
+ export declare function resolveDashboardAuthoringSource({ explicitSource, field, defaultSource, fallbackSources, }: {
1820
+ explicitSource?: unknown;
1821
+ field?: SemaphorFieldRef;
1822
+ defaultSource?: SemaphorSourceRef;
1823
+ fallbackSources?: readonly SemaphorSourceRef[];
1824
+ }): MaterializableDashboardAuthoringSource | undefined;
1825
+
1760
1826
  declare type SelectedEntities = SelectedEntity[];
1761
1827
 
1762
1828
  declare type SelectedEntity = DatabaseEntityReference | DataModelEntityReference | DatasetEntityReference | FileEntityReference;
@@ -1795,6 +1861,7 @@ declare type SemaphorFieldRef = {
1795
1861
  label?: string;
1796
1862
  role?: 'dimension' | 'measure' | 'date' | 'id' | 'unknown';
1797
1863
  dataType?: 'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'unknown';
1864
+ source?: SemaphorSourceRef;
1798
1865
  };
1799
1866
 
1800
1867
  declare type SemaphorInputBinding = {
@@ -2485,7 +2552,7 @@ declare type TDataLabelsConfig = {
2485
2552
  display?: 'auto' | boolean;
2486
2553
  formatMode?: 'inherit' | 'override';
2487
2554
  /** @deprecated Use formatMode + formatOptions.type */
2488
- format?: 'auto' | 'number' | 'currency' | 'percent' | 'date' | 'scientific' | 'none';
2555
+ format?: 'auto' | 'number' | 'currency' | 'percent' | 'date' | 'scientific' | 'duration' | 'none';
2489
2556
  formatOptions?: TFormatOptions;
2490
2557
  font?: {
2491
2558
  size?: number;
@@ -2623,7 +2690,7 @@ declare type TFilter = {
2623
2690
  declare type TFilterValue = FilterForString | FilterForEqual | FilterForCompare | FilterForBetween | FilterForIn | FilterForNull | FilterForDate;
2624
2691
 
2625
2692
  declare type TFormatOptions = {
2626
- type?: 'auto' | 'number' | 'currency' | 'percent' | 'scientific' | 'date';
2693
+ type?: 'auto' | 'number' | 'currency' | 'percent' | 'scientific' | 'date' | 'duration';
2627
2694
  decimalPlaces?: number;
2628
2695
  minimumFractionDigits?: number;
2629
2696
  maximumFractionDigits?: number;
@@ -2640,6 +2707,11 @@ declare type TFormatOptions = {
2640
2707
  timezone?: string;
2641
2708
  sourceTimezone?: string;
2642
2709
  relative?: boolean;
2710
+ durationInputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2711
+ durationDisplayStyle?: 'compact' | 'digital' | 'long';
2712
+ durationLargestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2713
+ durationSmallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2714
+ durationMaxUnits?: number;
2643
2715
  };
2644
2716
 
2645
2717
  declare type TFrame = {
@@ -2820,6 +2892,11 @@ declare interface URLParameter {
2820
2892
  field?: Field;
2821
2893
  }
2822
2894
 
2895
+ export declare function validateDashboardAuthoringDatasetScope({ datasets, requireAtLeastOne, }: {
2896
+ datasets: readonly unknown[];
2897
+ requireAtLeastOne: boolean;
2898
+ }): DashboardAuthoringDatasetScopeResult;
2899
+
2823
2900
  export declare function validateDashboardChangePlan(plan: DashboardChangePlan): DashboardAuthoringValidationResult;
2824
2901
 
2825
2902
  export declare function validateDashboardPlan(plan: DashboardPlan): DashboardAuthoringValidationResult;
@@ -1469,6 +1469,16 @@ declare type FormatSpec = {
1469
1469
  sourceTimezone?: string;
1470
1470
  prefix?: string;
1471
1471
  suffix?: string;
1472
+ } | {
1473
+ type: 'duration';
1474
+ inputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1475
+ outputStyle?: 'compact' | 'digital' | 'long';
1476
+ largestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1477
+ smallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1478
+ maxUnits?: number;
1479
+ prefix?: string;
1480
+ suffix?: string;
1481
+ negativeStyle?: 'minus' | 'parentheses';
1472
1482
  } | {
1473
1483
  type: 'string';
1474
1484
  prefix?: string;
@@ -2520,7 +2530,7 @@ export declare type TDataLabelsConfig = {
2520
2530
  display?: 'auto' | boolean;
2521
2531
  formatMode?: 'inherit' | 'override';
2522
2532
  /** @deprecated Use formatMode + formatOptions.type */
2523
- format?: 'auto' | 'number' | 'currency' | 'percent' | 'date' | 'scientific' | 'none';
2533
+ format?: 'auto' | 'number' | 'currency' | 'percent' | 'date' | 'scientific' | 'duration' | 'none';
2524
2534
  formatOptions?: TFormatOptions;
2525
2535
  font?: {
2526
2536
  size?: number;
@@ -2671,7 +2681,7 @@ declare type TFilter = {
2671
2681
  declare type TFilterValue = FilterForString | FilterForEqual | FilterForCompare | FilterForBetween | FilterForIn | FilterForNull | FilterForDate;
2672
2682
 
2673
2683
  export declare type TFormatOptions = {
2674
- type?: 'auto' | 'number' | 'currency' | 'percent' | 'scientific' | 'date';
2684
+ type?: 'auto' | 'number' | 'currency' | 'percent' | 'scientific' | 'date' | 'duration';
2675
2685
  decimalPlaces?: number;
2676
2686
  minimumFractionDigits?: number;
2677
2687
  maximumFractionDigits?: number;
@@ -2688,6 +2698,11 @@ export declare type TFormatOptions = {
2688
2698
  timezone?: string;
2689
2699
  sourceTimezone?: string;
2690
2700
  relative?: boolean;
2701
+ durationInputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2702
+ durationDisplayStyle?: 'compact' | 'digital' | 'long';
2703
+ durationLargestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2704
+ durationSmallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2705
+ durationMaxUnits?: number;
2691
2706
  };
2692
2707
 
2693
2708
  export declare type TFrame = {
@@ -240,6 +240,7 @@ declare type SemaphorFieldRef = {
240
240
  label?: string;
241
241
  role?: 'dimension' | 'measure' | 'date' | 'id' | 'unknown';
242
242
  dataType?: 'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'unknown';
243
+ source?: SemaphorSourceRef;
243
244
  };
244
245
 
245
246
  declare type SemaphorInputBinding = {
@@ -107,6 +107,29 @@ export declare interface DateFormatOptions {
107
107
  locale?: string;
108
108
  }
109
109
 
110
+ export declare type DurationDisplayStyle = 'compact' | 'digital' | 'long';
111
+
112
+ export declare interface DurationFormatOptions {
113
+ /** Unit represented by the raw numeric value. */
114
+ inputUnit?: DurationUnit;
115
+ /** Display style, e.g. "6min 32s", "06:32", or "6 minutes 32 seconds". */
116
+ outputStyle?: DurationDisplayStyle;
117
+ /** Largest unit to show. Defaults to day. */
118
+ largestUnit?: DurationUnit;
119
+ /** Smallest unit to show. Defaults to second. */
120
+ smallestUnit?: DurationUnit;
121
+ /** Maximum non-zero unit parts to show for compact/long output. */
122
+ maxUnits?: number;
123
+ /** Add prefix string before the formatted duration. */
124
+ prefix?: string;
125
+ /** Add suffix string after the formatted duration. */
126
+ suffix?: string;
127
+ /** Show negative durations in parentheses instead of a minus sign. */
128
+ negativeInParentheses?: boolean;
129
+ }
130
+
131
+ export declare type DurationUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
132
+
110
133
  /**
111
134
  * Escape a value for CSV output (RFC 4180 compliant)
112
135
  * Wraps in quotes if value contains delimiter, quotes, or newlines
@@ -181,6 +204,8 @@ export declare function formatCurrency(value: number | null | undefined, options
181
204
  */
182
205
  export declare const formatDate: (dateString: string | null | undefined, formatPattern: string | undefined, displayTimezone?: string, sourceTimezone?: string) => string;
183
206
 
207
+ export declare function formatDuration(value: number | string | null | undefined, options?: DurationFormatOptions): string;
208
+
184
209
  /**
185
210
  * Format a number with locale-aware formatting
186
211
  */
@@ -1170,7 +1170,7 @@ export declare type CancelBriefingRunResponse = {
1170
1170
  */
1171
1171
  export declare function cancelExport(apiServiceUrl: string, token: string, exportId: string): Promise<void>;
1172
1172
 
1173
- export declare type CanonicalFormatSpec = NumericCanonicalFormat | DateCanonicalFormat | StringCanonicalFormat;
1173
+ export declare type CanonicalFormatSpec = NumericCanonicalFormat | DateCanonicalFormat | DurationCanonicalFormat | StringCanonicalFormat;
1174
1174
 
1175
1175
  export declare interface CardConfig {
1176
1176
  groupByColumns?: GroupByField[];
@@ -1771,12 +1771,19 @@ export declare type DashboardBriefingLauncherProps = {
1771
1771
  client?: Partial<DashboardBriefingLauncherClient>;
1772
1772
  };
1773
1773
 
1774
+ declare type DashboardCardQueryFieldRef = {
1775
+ name: string;
1776
+ source?: DashboardAuthoringDatasetRef;
1777
+ };
1778
+
1774
1779
  declare type DashboardCardQueryIntent = {
1775
1780
  metric?: string;
1776
1781
  metrics?: string[];
1777
1782
  dateField?: string;
1783
+ dateFieldRef?: DashboardCardQueryFieldRef;
1778
1784
  timeGrain?: 'day' | 'week' | 'month' | 'quarter' | 'year';
1779
1785
  dimensions?: string[];
1786
+ dimensionRefs?: DashboardCardQueryFieldRef[];
1780
1787
  limit?: number;
1781
1788
  };
1782
1789
 
@@ -1818,13 +1825,8 @@ export declare interface DashboardCreateDialogBaseProps {
1818
1825
  isCreatingBlank: boolean;
1819
1826
  sources: DashboardAuthoringSource[];
1820
1827
  sourcesLoading?: boolean;
1821
- suggestDashboards: (input: {
1822
- dataset: DashboardAuthoringDatasetRef;
1823
- }) => Promise<DashboardSuggestion[]>;
1824
- planDashboard: AsyncMutation<{
1825
- prompt: string;
1826
- dataset: DashboardAuthoringDatasetRef;
1827
- }, DashboardPlan>;
1828
+ suggestDashboards: (input: DashboardSuggestionRequest) => Promise<DashboardSuggestion[]>;
1829
+ planDashboard: AsyncMutation<DashboardPlanRequest, DashboardPlan>;
1828
1830
  createDashboardFromPlan: AsyncMutation<DashboardPlan, any>;
1829
1831
  settingsSlot?: ReactNode;
1830
1832
  blankDescription?: string;
@@ -2069,6 +2071,15 @@ declare type DashboardPlanFilterInput = {
2069
2071
  defaultValue?: unknown;
2070
2072
  };
2071
2073
 
2074
+ declare type DashboardPlanRequest = {
2075
+ prompt: string;
2076
+ dataset: DashboardAuthoringDatasetRef;
2077
+ } | {
2078
+ prompt: string;
2079
+ domainId: string;
2080
+ datasetNames?: string[];
2081
+ };
2082
+
2072
2083
  declare type DashboardPlanSheet = {
2073
2084
  id: string;
2074
2085
  title: string;
@@ -2274,10 +2285,24 @@ declare type DashboardSuggestion = {
2274
2285
  cardCount: number;
2275
2286
  filterCount: number;
2276
2287
  prompt: string;
2288
+ datasets?: Array<{
2289
+ name: string;
2290
+ label?: string;
2291
+ }>;
2292
+ relationshipHints?: string[];
2277
2293
  };
2278
2294
 
2279
2295
  declare type DashboardSuggestionPreviewKind = 'kpi' | 'line' | 'bar' | 'donut' | 'table';
2280
2296
 
2297
+ declare type DashboardSuggestionRequest = {
2298
+ dataset: DashboardAuthoringDatasetRef;
2299
+ instruction?: string;
2300
+ } | {
2301
+ domainId: string;
2302
+ datasetNames?: string[];
2303
+ instruction?: string;
2304
+ };
2305
+
2281
2306
  export declare const DashboardWC: CustomElementConstructor;
2282
2307
 
2283
2308
  export declare interface DatabaseEntityReference {
@@ -2927,6 +2952,20 @@ export declare type DropdownItem = {
2927
2952
 
2928
2953
  export declare type DroppableId = 'droppable-group-by' | 'droppable-metric';
2929
2954
 
2955
+ declare type DurationCanonicalFormat = {
2956
+ type: 'duration';
2957
+ inputUnit?: DurationUnit;
2958
+ outputStyle?: 'compact' | 'digital' | 'long';
2959
+ largestUnit?: DurationUnit;
2960
+ smallestUnit?: DurationUnit;
2961
+ maxUnits?: number;
2962
+ prefix?: string;
2963
+ suffix?: string;
2964
+ negativeStyle?: 'minus' | 'parentheses';
2965
+ };
2966
+
2967
+ declare type DurationUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2968
+
2930
2969
  export declare interface DynamicDrillEvent extends BaseInteractionEvent {
2931
2970
  interactionMode: 'dynamicDrill';
2932
2971
  filterGroups: ClickFilterConditionGroup[];
@@ -3436,6 +3475,16 @@ export declare type FormatSpec = {
3436
3475
  sourceTimezone?: string;
3437
3476
  prefix?: string;
3438
3477
  suffix?: string;
3478
+ } | {
3479
+ type: 'duration';
3480
+ inputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
3481
+ outputStyle?: 'compact' | 'digital' | 'long';
3482
+ largestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
3483
+ smallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
3484
+ maxUnits?: number;
3485
+ prefix?: string;
3486
+ suffix?: string;
3487
+ negativeStyle?: 'minus' | 'parentheses';
3439
3488
  } | {
3440
3489
  type: 'string';
3441
3490
  prefix?: string;
@@ -4377,6 +4426,7 @@ declare type SemaphorFieldRef = {
4377
4426
  label?: string;
4378
4427
  role?: 'dimension' | 'measure' | 'date' | 'id' | 'unknown';
4379
4428
  dataType?: 'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'unknown';
4429
+ source?: SemaphorSourceRef;
4380
4430
  };
4381
4431
 
4382
4432
  declare type SemaphorInputBinding = {
@@ -5271,7 +5321,7 @@ export declare type TDataLabelsConfig = {
5271
5321
  display?: 'auto' | boolean;
5272
5322
  formatMode?: 'inherit' | 'override';
5273
5323
  /** @deprecated Use formatMode + formatOptions.type */
5274
- format?: 'auto' | 'number' | 'currency' | 'percent' | 'date' | 'scientific' | 'none';
5324
+ format?: 'auto' | 'number' | 'currency' | 'percent' | 'date' | 'scientific' | 'duration' | 'none';
5275
5325
  formatOptions?: TFormatOptions;
5276
5326
  font?: {
5277
5327
  size?: number;
@@ -5422,7 +5472,7 @@ export declare type TFilter = {
5422
5472
  export declare type TFilterValue = FilterForString | FilterForEqual | FilterForCompare | FilterForBetween | FilterForIn | FilterForNull | FilterForDate;
5423
5473
 
5424
5474
  export declare type TFormatOptions = {
5425
- type?: 'auto' | 'number' | 'currency' | 'percent' | 'scientific' | 'date';
5475
+ type?: 'auto' | 'number' | 'currency' | 'percent' | 'scientific' | 'date' | 'duration';
5426
5476
  decimalPlaces?: number;
5427
5477
  minimumFractionDigits?: number;
5428
5478
  maximumFractionDigits?: number;
@@ -5439,6 +5489,11 @@ export declare type TFormatOptions = {
5439
5489
  timezone?: string;
5440
5490
  sourceTimezone?: string;
5441
5491
  relative?: boolean;
5492
+ durationInputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
5493
+ durationDisplayStyle?: 'compact' | 'digital' | 'long';
5494
+ durationLargestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
5495
+ durationSmallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
5496
+ durationMaxUnits?: number;
5442
5497
  };
5443
5498
 
5444
5499
  export declare type TFrame = {
@@ -1228,6 +1228,16 @@ declare type FormatSpec = {
1228
1228
  sourceTimezone?: string;
1229
1229
  prefix?: string;
1230
1230
  suffix?: string;
1231
+ } | {
1232
+ type: 'duration';
1233
+ inputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1234
+ outputStyle?: 'compact' | 'digital' | 'long';
1235
+ largestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1236
+ smallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1237
+ maxUnits?: number;
1238
+ prefix?: string;
1239
+ suffix?: string;
1240
+ negativeStyle?: 'minus' | 'parentheses';
1231
1241
  } | {
1232
1242
  type: 'string';
1233
1243
  prefix?: string;
@@ -2098,7 +2108,7 @@ declare type TDataLabelsConfig = {
2098
2108
  display?: 'auto' | boolean;
2099
2109
  formatMode?: 'inherit' | 'override';
2100
2110
  /** @deprecated Use formatMode + formatOptions.type */
2101
- format?: 'auto' | 'number' | 'currency' | 'percent' | 'date' | 'scientific' | 'none';
2111
+ format?: 'auto' | 'number' | 'currency' | 'percent' | 'date' | 'scientific' | 'duration' | 'none';
2102
2112
  formatOptions?: TFormatOptions;
2103
2113
  font?: {
2104
2114
  size?: number;
@@ -2236,7 +2246,7 @@ declare type TFilter = {
2236
2246
  declare type TFilterValue = FilterForString | FilterForEqual | FilterForCompare | FilterForBetween | FilterForIn | FilterForNull | FilterForDate;
2237
2247
 
2238
2248
  declare type TFormatOptions = {
2239
- type?: 'auto' | 'number' | 'currency' | 'percent' | 'scientific' | 'date';
2249
+ type?: 'auto' | 'number' | 'currency' | 'percent' | 'scientific' | 'date' | 'duration';
2240
2250
  decimalPlaces?: number;
2241
2251
  minimumFractionDigits?: number;
2242
2252
  maximumFractionDigits?: number;
@@ -2253,6 +2263,11 @@ declare type TFormatOptions = {
2253
2263
  timezone?: string;
2254
2264
  sourceTimezone?: string;
2255
2265
  relative?: boolean;
2266
+ durationInputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2267
+ durationDisplayStyle?: 'compact' | 'digital' | 'long';
2268
+ durationLargestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2269
+ durationSmallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2270
+ durationMaxUnits?: number;
2256
2271
  };
2257
2272
 
2258
2273
  declare type TFrame = {
@@ -1479,6 +1479,16 @@ declare type FormatSpec = {
1479
1479
  sourceTimezone?: string;
1480
1480
  prefix?: string;
1481
1481
  suffix?: string;
1482
+ } | {
1483
+ type: 'duration';
1484
+ inputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1485
+ outputStyle?: 'compact' | 'digital' | 'long';
1486
+ largestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1487
+ smallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1488
+ maxUnits?: number;
1489
+ prefix?: string;
1490
+ suffix?: string;
1491
+ negativeStyle?: 'minus' | 'parentheses';
1482
1492
  } | {
1483
1493
  type: 'string';
1484
1494
  prefix?: string;
@@ -2532,7 +2542,7 @@ export declare type TDataLabelsConfig = {
2532
2542
  display?: 'auto' | boolean;
2533
2543
  formatMode?: 'inherit' | 'override';
2534
2544
  /** @deprecated Use formatMode + formatOptions.type */
2535
- format?: 'auto' | 'number' | 'currency' | 'percent' | 'date' | 'scientific' | 'none';
2545
+ format?: 'auto' | 'number' | 'currency' | 'percent' | 'date' | 'scientific' | 'duration' | 'none';
2536
2546
  formatOptions?: TFormatOptions;
2537
2547
  font?: {
2538
2548
  size?: number;
@@ -2683,7 +2693,7 @@ declare type TFilter = {
2683
2693
  declare type TFilterValue = FilterForString | FilterForEqual | FilterForCompare | FilterForBetween | FilterForIn | FilterForNull | FilterForDate;
2684
2694
 
2685
2695
  export declare type TFormatOptions = {
2686
- type?: 'auto' | 'number' | 'currency' | 'percent' | 'scientific' | 'date';
2696
+ type?: 'auto' | 'number' | 'currency' | 'percent' | 'scientific' | 'date' | 'duration';
2687
2697
  decimalPlaces?: number;
2688
2698
  minimumFractionDigits?: number;
2689
2699
  maximumFractionDigits?: number;
@@ -2700,6 +2710,11 @@ export declare type TFormatOptions = {
2700
2710
  timezone?: string;
2701
2711
  sourceTimezone?: string;
2702
2712
  relative?: boolean;
2713
+ durationInputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2714
+ durationDisplayStyle?: 'compact' | 'digital' | 'long';
2715
+ durationLargestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2716
+ durationSmallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2717
+ durationMaxUnits?: number;
2703
2718
  };
2704
2719
 
2705
2720
  export declare type TFrame = {
@@ -645,7 +645,7 @@ export declare type CancelBriefingRunResponse = {
645
645
  transitionApplied: boolean;
646
646
  };
647
647
 
648
- export declare type CanonicalFormatSpec = NumericCanonicalFormat | DateCanonicalFormat | StringCanonicalFormat;
648
+ export declare type CanonicalFormatSpec = NumericCanonicalFormat | DateCanonicalFormat | DurationCanonicalFormat | StringCanonicalFormat;
649
649
 
650
650
  export declare interface CardConfig {
651
651
  groupByColumns?: GroupByField[];
@@ -1737,6 +1737,20 @@ declare interface DrillUpInteraction {
1737
1737
 
1738
1738
  export declare type DroppableId = 'droppable-group-by' | 'droppable-metric';
1739
1739
 
1740
+ declare type DurationCanonicalFormat = {
1741
+ type: 'duration';
1742
+ inputUnit?: DurationUnit;
1743
+ outputStyle?: 'compact' | 'digital' | 'long';
1744
+ largestUnit?: DurationUnit;
1745
+ smallestUnit?: DurationUnit;
1746
+ maxUnits?: number;
1747
+ prefix?: string;
1748
+ suffix?: string;
1749
+ negativeStyle?: 'minus' | 'parentheses';
1750
+ };
1751
+
1752
+ declare type DurationUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1753
+
1740
1754
  declare interface DynamicDrillInteraction {
1741
1755
  mode: 'dynamicDrill';
1742
1756
  /**
@@ -2015,6 +2029,16 @@ export declare type FormatSpec = {
2015
2029
  sourceTimezone?: string;
2016
2030
  prefix?: string;
2017
2031
  suffix?: string;
2032
+ } | {
2033
+ type: 'duration';
2034
+ inputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2035
+ outputStyle?: 'compact' | 'digital' | 'long';
2036
+ largestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2037
+ smallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2038
+ maxUnits?: number;
2039
+ prefix?: string;
2040
+ suffix?: string;
2041
+ negativeStyle?: 'minus' | 'parentheses';
2018
2042
  } | {
2019
2043
  type: 'string';
2020
2044
  prefix?: string;
@@ -3302,7 +3326,7 @@ export declare type TDataLabelsConfig = {
3302
3326
  display?: 'auto' | boolean;
3303
3327
  formatMode?: 'inherit' | 'override';
3304
3328
  /** @deprecated Use formatMode + formatOptions.type */
3305
- format?: 'auto' | 'number' | 'currency' | 'percent' | 'date' | 'scientific' | 'none';
3329
+ format?: 'auto' | 'number' | 'currency' | 'percent' | 'date' | 'scientific' | 'duration' | 'none';
3306
3330
  formatOptions?: TFormatOptions;
3307
3331
  font?: {
3308
3332
  size?: number;
@@ -3453,7 +3477,7 @@ export declare type TFilter = {
3453
3477
  export declare type TFilterValue = FilterForString | FilterForEqual | FilterForCompare | FilterForBetween | FilterForIn | FilterForNull | FilterForDate;
3454
3478
 
3455
3479
  export declare type TFormatOptions = {
3456
- type?: 'auto' | 'number' | 'currency' | 'percent' | 'scientific' | 'date';
3480
+ type?: 'auto' | 'number' | 'currency' | 'percent' | 'scientific' | 'date' | 'duration';
3457
3481
  decimalPlaces?: number;
3458
3482
  minimumFractionDigits?: number;
3459
3483
  maximumFractionDigits?: number;
@@ -3470,6 +3494,11 @@ export declare type TFormatOptions = {
3470
3494
  timezone?: string;
3471
3495
  sourceTimezone?: string;
3472
3496
  relative?: boolean;
3497
+ durationInputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
3498
+ durationDisplayStyle?: 'compact' | 'digital' | 'long';
3499
+ durationLargestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
3500
+ durationSmallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
3501
+ durationMaxUnits?: number;
3473
3502
  };
3474
3503
 
3475
3504
  export declare type TFrame = {
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.326",
8
+ "version": "0.1.327",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",