@allurereport/web-components 3.1.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as preact from 'preact';
2
- import { SVGAttributes, ComponentChild, FunctionalComponent, JSX, HTMLAttributes, VNode, ComponentChildren, FunctionComponent, ComponentProps } from 'preact';
2
+ import { SVGAttributes, ComponentChild, JSX, FunctionalComponent, HTMLAttributes, VNode, ComponentChildren, FunctionComponent, ComponentProps } from 'preact';
3
3
  import { Placement } from '@floating-ui/dom';
4
4
  import * as preact_compat from 'preact/compat';
5
5
  import { MutableRefObject, HTMLAttributes as HTMLAttributes$1, CSSProperties } from 'preact/compat';
@@ -8,7 +8,7 @@ import { AttachmentTestStepResult, Statistic, TestStatus, TestStatusTransition,
8
8
  import { RecursiveTree, Status } from 'global';
9
9
  import { AttachmentData, LangLocale, TreeMapTooltipAccessor } from '@allurereport/web-commons';
10
10
  import { Options } from 'sortablejs';
11
- import { ChartMode, PieChartValues, TreeMapNode, ChartType, StabilityDistributionChartData, TestBaseGrowthDynamicsChartData, FBSUAgePyramidChartData, StatusTransitionsChartData, DurationsChartData, TrSeveritiesChartData, DurationDynamicsChartData } from '@allurereport/charts-api';
11
+ import { ChartMode, PieChartValues, TreeMapNode, ChartType, StabilityDistributionChartData, TestBaseGrowthDynamicsChartData, StatusAgePyramidChartData, StatusTransitionsChartData, DurationsChartData, TrSeveritiesChartData, DurationDynamicsChartData } from '@allurereport/charts-api';
12
12
  import { Serie as Serie$1 } from '@/components/Charts/TrendChart';
13
13
  import { AxisProps } from '@nivo/axes';
14
14
  import { Serie as Serie$2, Datum as Datum$1, LineSvgProps, Point } from '@nivo/line';
@@ -153,7 +153,7 @@ type SpinnerProps = {
153
153
  };
154
154
  declare const Spinner: ({ size }: SpinnerProps) => preact.JSX.Element;
155
155
 
156
- type TextProps = ({
156
+ type TextProps<Tag extends keyof JSX.IntrinsicElements = "span"> = ({
157
157
  type?: "paragraph";
158
158
  size?: "s" | "m" | "l";
159
159
  } | {
@@ -162,9 +162,9 @@ type TextProps = ({
162
162
  }) & {
163
163
  className?: string;
164
164
  bold?: boolean;
165
- tag?: keyof JSX.IntrinsicElements;
166
- } & Omit<HTMLAttributes<HTMLElement>, "type" | "size" | "className" | "bold" | "tag">;
167
- declare const Text: FunctionalComponent<TextProps>;
165
+ tag?: Tag;
166
+ } & Omit<JSX.IntrinsicElements[Tag], "type" | "size" | "className" | "bold" | "tag">;
167
+ declare const Text: <Tag extends keyof JSX.IntrinsicElements = "span">({ size, tag: ElementTag, type, bold, className, children, ...rest }: TextProps<Tag>) => JSX.Element | null;
168
168
  type CodeProps = {
169
169
  type?: "paragraph" | "ui";
170
170
  size?: "s" | "m";
@@ -311,15 +311,16 @@ declare const Tree: FunctionalComponent<TreeProps>;
311
311
  interface TreeHeaderProps {
312
312
  statistic?: Statistic;
313
313
  reportStatistic?: Statistic;
314
- categoryTitle: string;
314
+ categoryTitle: ComponentChildren;
315
315
  isOpened: boolean;
316
316
  toggleTree: () => void;
317
317
  statusFilter?: Status;
318
+ style?: Record<string, string>;
318
319
  }
319
320
  declare const TreeHeader: FunctionComponent<TreeHeaderProps>;
320
321
 
321
322
  interface TreeSectionProps {
322
- title: string;
323
+ title: ComponentChildren;
323
324
  isOpened: boolean;
324
325
  toggleTree: () => void;
325
326
  icon?: string;
@@ -328,7 +329,7 @@ declare const TreeSection: FunctionComponent<TreeSectionProps>;
328
329
 
329
330
  interface TreeItemProps {
330
331
  name: string;
331
- status: TestStatus;
332
+ status?: TestStatus;
332
333
  duration?: number;
333
334
  retriesCount?: number;
334
335
  flaky?: boolean;
@@ -338,7 +339,7 @@ interface TreeItemProps {
338
339
  groupOrder: number;
339
340
  marked?: boolean;
340
341
  navigateTo: (id: string) => void;
341
- tooltips: Record<string, string>;
342
+ tooltips?: Record<string, string>;
342
343
  }
343
344
  declare const TreeItem: FunctionComponent<TreeItemProps>;
344
345
 
@@ -359,8 +360,8 @@ interface TreeStatusBarProps {
359
360
  }
360
361
  declare const TreeStatusBar: FunctionalComponent<TreeStatusBarProps>;
361
362
 
362
- type I18nKeys$9 = "mode.diff" | "mode.actual" | "mode.expected" | "mode.side-by-side" | "mode.overlay" | "empty.failed-to-load" | "image.diff" | "image.actual" | "image.expected";
363
- type I18nProp$a = (key: I18nKeys$9, props?: Record<string, unknown>) => string | undefined;
363
+ type I18nKeys$a = "mode.diff" | "mode.actual" | "mode.expected" | "mode.side-by-side" | "mode.overlay" | "empty.failed-to-load" | "image.diff" | "image.actual" | "image.expected";
364
+ type I18nProp$b = (key: I18nKeys$a, props?: Record<string, unknown>) => string | undefined;
364
365
 
365
366
  type ImageDiff$1 = {
366
367
  name?: string;
@@ -371,7 +372,7 @@ type ImageDiff$1 = {
371
372
 
372
373
  type Props$f = {
373
374
  diff: ImageDiff$1;
374
- i18n?: I18nProp$a;
375
+ i18n?: I18nProp$b;
375
376
  };
376
377
  declare const ImageDiff: (props: Props$f) => preact.JSX.Element;
377
378
 
@@ -380,14 +381,14 @@ type AttachmentProps = {
380
381
  item: AttachmentTestStepResult;
381
382
  i18n?: (key: any) => string;
382
383
  };
383
- type I18nProp$9 = {
384
+ type I18nProp$a = {
384
385
  imageDiff: ComponentProps<typeof ImageDiff>["i18n"];
385
386
  };
386
387
 
387
388
  interface AttachmentTestStepResultProps {
388
389
  item: AttachmentTestStepResult;
389
390
  previewable?: boolean;
390
- i18n?: I18nProp$9;
391
+ i18n?: I18nProp$a;
391
392
  }
392
393
  declare const Attachment: (props: AttachmentTestStepResultProps) => preact.JSX.Element | null;
393
394
 
@@ -679,31 +680,31 @@ interface HeatMapWidgetProps extends HeatMapProps {
679
680
 
680
681
  declare const HeatMapWidget: FunctionalComponent<HeatMapWidgetProps>;
681
682
 
682
- type I18nKeys$8 = "no-results" | "legend.stabilityRate";
683
- type I18nProp$8 = (key: I18nKeys$8, props?: Record<string, unknown>) => string;
683
+ type I18nKeys$9 = "no-results" | "legend.stabilityRate";
684
+ type I18nProp$9 = (key: I18nKeys$9, props?: Record<string, unknown>) => string;
684
685
  type Props$a = Omit<StabilityDistributionChartData, "type"> & {
685
- i18n: I18nProp$8;
686
+ i18n: I18nProp$9;
686
687
  };
687
688
 
688
689
  declare const StabilityDistributionWidget: FunctionalComponent<Props$a>;
689
690
 
690
- type I18nKeys$7 = `status.new${TestStatus}` | `status.removed${TestStatus}` | "legend.trend" | "no-history" | "no-results" | "ticks.current" | "ticks.history" | "tooltips.current" | "tooltips.history";
691
- type I18nProp$7 = (key: I18nKeys$7, props?: Record<string, unknown>) => string;
691
+ type I18nKeys$8 = `status.new${TestStatus}` | `status.removed${TestStatus}` | "legend.trend" | "no-history" | "no-results" | "ticks.current" | "ticks.history" | "tooltips.current" | "tooltips.history";
692
+ type I18nProp$8 = (key: I18nKeys$8, props?: Record<string, unknown>) => string;
692
693
  type Props$9 = Omit<TestBaseGrowthDynamicsChartData, "type"> & {
693
- i18n: I18nProp$7;
694
+ i18n: I18nProp$8;
694
695
  };
695
696
 
696
697
  declare const TestBaseGrowthDynamicsChartWidget: FunctionalComponent<Props$9>;
697
698
 
698
699
  type FBSUStatus = Exclude<TestStatus, "passed">;
699
- type I18nKeys$6 = `status.${FBSUStatus}` | "no-history" | "no-results" | "ticks.current" | "ticks.history" | "tooltips.current" | "tooltips.history";
700
- type I18nProp$6 = (key: I18nKeys$6, props?: Record<string, unknown>) => string;
701
- type Props$8 = Omit<FBSUAgePyramidChartData, "type" | "statuses"> & {
702
- i18n: I18nProp$6;
700
+ type I18nKeys$7 = `status.${FBSUStatus}` | "no-history" | "no-results" | "ticks.current" | "ticks.history" | "tooltips.current" | "tooltips.history";
701
+ type I18nProp$7 = (key: I18nKeys$7, props?: Record<string, unknown>) => string;
702
+ type Props$8 = Omit<StatusAgePyramidChartData, "type" | "statuses"> & {
703
+ i18n: I18nProp$7;
703
704
  statuses: FBSUStatus[];
704
705
  };
705
706
 
706
- declare const FBSUAgePyramidChartWidget: FunctionalComponent<Props$8>;
707
+ declare const StatusAgePyramidChartWidget: FunctionalComponent<Props$8>;
707
708
 
708
709
  type Props$7 = {
709
710
  data: {
@@ -719,11 +720,11 @@ type Props$7 = {
719
720
  };
720
721
  declare const TestingPyramidWidget: (props: Props$7) => JSX.Element;
721
722
 
722
- type I18nKeys$5 = "status.passed" | "status.failed" | "status.skipped" | "status.unknown" | "status.broken" | "percentage" | "of" | "tests.new" | "tests.flaky" | "tests.retries" | "total";
723
- type I18nProp$5 = (key: I18nKeys$5, props?: Record<string, unknown>) => string;
723
+ type I18nKeys$6 = "status.passed" | "status.failed" | "status.skipped" | "status.unknown" | "status.broken" | "percentage" | "of" | "tests.new" | "tests.flaky" | "tests.retries" | "total";
724
+ type I18nProp$6 = (key: I18nKeys$6, props?: Record<string, unknown>) => string;
724
725
  type Props$6 = {
725
726
  title?: string;
726
- i18n?: I18nProp$5;
727
+ i18n?: I18nProp$6;
727
728
  data: Statistic;
728
729
  statuses?: TestStatus[];
729
730
  metric?: TestStatus;
@@ -731,8 +732,8 @@ type Props$6 = {
731
732
 
732
733
  declare const CurrentStatusChartWidget: FunctionalComponent<Props$6>;
733
734
 
734
- type I18nKeys$4 = "status.passed" | "status.failed" | "status.skipped" | "status.unknown" | "status.broken" | "no-history" | "no-results" | "ticks.current" | "ticks.history" | "tooltips.current" | "tooltips.history";
735
- type I18nProp$4 = (key: I18nKeys$4, props?: Record<string, unknown>) => string;
735
+ type I18nKeys$5 = "status.passed" | "status.failed" | "status.skipped" | "status.unknown" | "status.broken" | "no-history" | "no-results" | "ticks.current" | "ticks.history" | "tooltips.current" | "tooltips.history";
736
+ type I18nProp$5 = (key: I18nKeys$5, props?: Record<string, unknown>) => string;
736
737
  type Props$5 = {
737
738
  title?: string;
738
739
  data: {
@@ -743,45 +744,48 @@ type Props$5 = {
743
744
  }[];
744
745
  limit?: number;
745
746
  statuses?: TestStatus[];
746
- i18n: I18nProp$4;
747
+ i18n: I18nProp$5;
747
748
  };
748
749
 
749
750
  declare const StatusDynamicsChartWidget: FunctionalComponent<Props$5>;
750
751
 
751
- type I18nKeys$3 = "transitions.new" | "transitions.fixed" | "transitions.regressed" | "transitions.malfunctioned" | "legend.trend" | "no-history" | "no-results" | "ticks.current" | "ticks.history" | "tooltips.current" | "tooltips.history";
752
- type I18nProp$3 = (key: I18nKeys$3, props?: Record<string, unknown>) => string;
752
+ type I18nKeys$4 = "transitions.new" | "transitions.fixed" | "transitions.regressed" | "transitions.malfunctioned" | "legend.trend" | "no-history" | "no-results" | "ticks.current" | "ticks.history" | "tooltips.current" | "tooltips.history";
753
+ type I18nProp$4 = (key: I18nKeys$4, props?: Record<string, unknown>) => string;
753
754
  type Props$4 = Omit<StatusTransitionsChartData, "type"> & {
754
755
  statuses?: TestStatus[];
755
- i18n: I18nProp$3;
756
+ i18n: I18nProp$4;
756
757
  };
757
758
 
758
759
  declare const StatusTransitionsChartWidget: FunctionalComponent<Props$4>;
759
760
 
760
- type I18nKeys$2 = "no-history" | "no-results" | "ticks.durationRange" | "tooltips.durationRange" | "legend.value" | "legend.total";
761
- type I18nProp$2 = (key: I18nKeys$2, props?: Record<string, unknown>) => string;
761
+ type I18nKeys$3 = "no-history" | "no-results" | "ticks.durationRange" | "tooltips.durationRange" | "legend.value" | "legend.total";
762
+ type I18nProp$3 = (key: I18nKeys$3, props?: Record<string, unknown>) => string;
762
763
  type Props$3 = Omit<DurationsChartData, "type"> & {
763
- i18n: I18nProp$2;
764
+ i18n: I18nProp$3;
764
765
  };
765
766
 
766
767
  declare const DurationsChartWidget: FunctionalComponent<Props$3>;
767
768
 
768
- type I18nKeys$1 = `status.${TestStatus}` | `severity.${SeverityLevel | "unset"}` | "no-results" | "ticks.current";
769
- type I18nProp$1 = (key: I18nKeys$1, props?: Record<string, unknown>) => string;
769
+ type I18nKeys$2 = `status.${TestStatus}` | `severity.${SeverityLevel | "unset"}` | "no-results" | "ticks.current";
770
+ type I18nProp$2 = (key: I18nKeys$2, props?: Record<string, unknown>) => string;
770
771
  type Props$2 = Omit<TrSeveritiesChartData, "type"> & {
771
- i18n: I18nProp$1;
772
+ i18n: I18nProp$2;
772
773
  };
773
774
 
774
775
  declare const TrSeveritiesChartWidget: FunctionalComponent<Props$2>;
775
776
 
776
- type I18nKeys = "no-results" | "durations.sequential" | "durations.duration" | "durations.speedup" | "ticks.current" | "ticks.history" | "tooltips.current" | "tooltips.history" | "legend.duration" | "legend.speedup";
777
- type I18nProp = (key: I18nKeys, props?: Record<string, unknown>) => string;
777
+ type I18nKeys$1 = "no-results" | "durations.sequential" | "durations.duration" | "durations.speedup" | "ticks.current" | "ticks.history" | "tooltips.current" | "tooltips.history" | "legend.duration" | "legend.speedup";
778
+ type I18nProp$1 = (key: I18nKeys$1, props?: Record<string, unknown>) => string;
778
779
  type Props$1 = Omit<DurationDynamicsChartData, "type"> & {
779
- i18n: I18nProp;
780
+ i18n: I18nProp$1;
780
781
  };
781
782
 
782
783
  declare const DurationDynamicsChartWidget: FunctionalComponent<Props$1>;
783
784
 
784
- type TimlineTr = Pick<TestResult, "id" | "name" | "status" | "flaky" | "hidden" | "labels" | "environment" | "start" | "stop" | "duration" | "historyId">;
785
+ type TimlineTr = Pick<TestResult, "id" | "name" | "status" | "flaky" | "hidden" | "environment" | "start" | "duration" | "historyId"> & {
786
+ host: string;
787
+ thread: string;
788
+ };
785
789
  type TimelineSegment = {
786
790
  timeRange: [Date, Date];
787
791
  val: number;
@@ -818,32 +822,32 @@ declare const Timeline: FunctionComponent<Omit<TimelineProps, "data"> & {
818
822
  dataId: string;
819
823
  }>;
820
824
 
821
- type ReportSummaryCardProps = {
822
- href: string;
825
+ type SummaryTestResult = Pick<TestResult, "name" | "id" | "status" | "duration">;
826
+ type ReportSummary = {
827
+ href?: string;
828
+ remoteHref?: string;
829
+ jobHref?: string;
830
+ pullRequestHref?: string;
823
831
  name: string;
824
- status: TestStatus;
825
832
  stats: Statistic;
826
- newTests: any[];
827
- retryTests: any[];
828
- flakyTests: any[];
833
+ status: TestStatus;
829
834
  duration: number;
830
835
  plugin?: string;
836
+ newTests?: SummaryTestResult[];
837
+ flakyTests?: SummaryTestResult[];
838
+ retryTests?: SummaryTestResult[];
831
839
  createdAt?: number;
832
- localeIso?: string;
833
- locales?: {
834
- in?: string;
835
- new?: string;
836
- flaky?: string;
837
- retry?: string;
838
- total?: string;
839
- failed?: string;
840
- broken?: string;
841
- passed?: string;
842
- skipped?: string;
843
- unknown?: string;
844
- };
845
840
  };
846
- declare const ReportSummaryCard: FunctionalComponent<ReportSummaryCardProps>;
841
+ type StatusI18nKeys = "status.failed" | "status.broken" | "status.passed" | "status.skipped" | "status.unknown";
842
+ type MetadataI18nKeys = "metadata.new" | "metadata.retry" | "metadata.flaky";
843
+ type I18nKeys = MetadataI18nKeys | StatusI18nKeys | "in" | "new" | "retry" | "flaky" | "total" | "createdAt";
844
+ type I18nProp = (key: I18nKeys, props?: Record<string, any>) => string | undefined;
845
+
846
+ type ReportSummaryCardProps = {
847
+ i18n: I18nProp;
848
+ summary: ReportSummary;
849
+ };
850
+ declare const ReportSummaryCard: (props: ReportSummaryCardProps) => preact.JSX.Element;
847
851
 
848
852
  declare const useTheme: () => string;
849
853
  declare const ThemeProvider: (props: {
@@ -865,5 +869,5 @@ type Props = {
865
869
  };
866
870
  declare const EmptyView: FunctionalComponent<Props>;
867
871
 
868
- export { ArrowButton, Attachment, AttachmentCode, AttachmentEmpty, AttachmentImage, AttachmentVideo, Button, ButtonLink, Code, CodeViewer, Counter, CurrentStatusChartWidget, DEFAULT_HEAT_MAP_EMPTY_ARIA_LABEL, DEFAULT_HEAT_MAP_EMPTY_COLOR, DEFAULT_HEAT_MAP_EMPTY_LABEL, DEFAULT_HEAT_MAP_FORCE_SQUARE, DEFAULT_HEAT_MAP_HEIGHT, DEFAULT_HEAT_MAP_VALUE_FORMAT, DEFAULT_HEAT_MAP_WIDTH, DEFAULT_HEAT_MAP_X_INNER_PADDING, DEFAULT_HEAT_MAP_Y_INNER_PADDING, DropdownButton, DurationDynamicsChartWidget, DurationsChartWidget, EmptyView, FBSUAgePyramidChartWidget, Grid, GridItem, Heading, HeatMap, HeatMapWidget, HtmlPreview, IconButton, IconLabel, ImageDiff, Label, LanguagePicker, Link, Loadable, Menu, Modal, PageLoader, ReportLogo, ReportLogoFull, ReportSummaryCard, SearchBox, Spinner, StabilityDistributionWidget, StatusDynamicsChartWidget, StatusLabel, StatusTransitionsChartWidget, SuccessRatePieChart, SvgIcon, Tag, TestBaseGrowthDynamicsChartWidget, TestingPyramidWidget, Text, ThemeButton, ThemeProvider, Timeline, Toggle, Tooltip, TooltipWrapper, TrSeveritiesChartWidget, Tree, TreeHeader, TreeItem, TreeItemIcon, TreeMapChart, TreeMapChartWidget, TreeSection, TreeStatusBar, TrendChart, TrendChartKind, TrendChartWidget, Widget, allureIcons, defaultHeatMapAxisLeftConfig, defaultHeatMapAxisTopConfig, defaultHeatMapLegendConfig, defaultHeatMapMarginConfig, defaultTreeChartConfig, defaultTrendChartAxisBottomConfig, defaultTrendChartAxisLeftConfig, defaultTrendChartConfig, defaultTrendChartLegendConfig, defaultTrendChartMarginConfig, defaultTrendChartXScaleConfig, defaultTrendChartYScaleConfig, makeSymlogScale, makeSymlogScaleBySeries, useCoverageDiffColors, useCoverageDiffTextColors, useSuccessRateDistributionColors, useTheme, useTooltip };
872
+ export { ArrowButton, Attachment, AttachmentCode, AttachmentEmpty, AttachmentImage, AttachmentVideo, Button, ButtonLink, Code, CodeViewer, Counter, CurrentStatusChartWidget, DEFAULT_HEAT_MAP_EMPTY_ARIA_LABEL, DEFAULT_HEAT_MAP_EMPTY_COLOR, DEFAULT_HEAT_MAP_EMPTY_LABEL, DEFAULT_HEAT_MAP_FORCE_SQUARE, DEFAULT_HEAT_MAP_HEIGHT, DEFAULT_HEAT_MAP_VALUE_FORMAT, DEFAULT_HEAT_MAP_WIDTH, DEFAULT_HEAT_MAP_X_INNER_PADDING, DEFAULT_HEAT_MAP_Y_INNER_PADDING, DropdownButton, DurationDynamicsChartWidget, DurationsChartWidget, EmptyView, Grid, GridItem, Heading, HeatMap, HeatMapWidget, HtmlPreview, IconButton, IconLabel, ImageDiff, Label, LanguagePicker, Link, Loadable, Menu, Modal, PageLoader, ReportLogo, ReportLogoFull, ReportSummaryCard, SearchBox, Spinner, StabilityDistributionWidget, StatusAgePyramidChartWidget, StatusDynamicsChartWidget, StatusLabel, StatusTransitionsChartWidget, SuccessRatePieChart, SvgIcon, Tag, TestBaseGrowthDynamicsChartWidget, TestingPyramidWidget, Text, ThemeButton, ThemeProvider, Timeline, Toggle, Tooltip, TooltipWrapper, TrSeveritiesChartWidget, Tree, TreeHeader, TreeItem, TreeItemIcon, TreeMapChart, TreeMapChartWidget, TreeSection, TreeStatusBar, TrendChart, TrendChartKind, TrendChartWidget, Widget, allureIcons, defaultHeatMapAxisLeftConfig, defaultHeatMapAxisTopConfig, defaultHeatMapLegendConfig, defaultHeatMapMarginConfig, defaultTreeChartConfig, defaultTrendChartAxisBottomConfig, defaultTrendChartAxisLeftConfig, defaultTrendChartConfig, defaultTrendChartLegendConfig, defaultTrendChartMarginConfig, defaultTrendChartXScaleConfig, defaultTrendChartYScaleConfig, makeSymlogScale, makeSymlogScaleBySeries, useCoverageDiffColors, useCoverageDiffTextColors, useSuccessRateDistributionColors, useTheme, useTooltip };
869
873
  export type { Datum, GridItemProps, GridProps, HeatMapProps, HeatMapWidgetProps, LanguagePickerProps, MeshTrendChartProps, ModalDataProps, ModalGalleryProps, ModalTranslations, ModalTranslationsProps, ParentLabelControlOptions, ReportSummaryCardProps, ResponsiveTreeChartProps, Serie, Slice, SlicesTrendChartProps, SymlogScaleOptions, TagProps, TagSkin, Theme, ThemeButtonProps, TreeMapChartNode, TreeMapChartProps, TreeMapChartWidgetProps, TrendChartKindConfig, TrendChartProps, TrendChartSliceClickHandler, TrendChartSliceTouchHandler };