@allurereport/web-components 3.1.0 → 3.2.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";
@@ -359,8 +359,8 @@ interface TreeStatusBarProps {
359
359
  }
360
360
  declare const TreeStatusBar: FunctionalComponent<TreeStatusBarProps>;
361
361
 
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;
362
+ 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";
363
+ type I18nProp$b = (key: I18nKeys$a, props?: Record<string, unknown>) => string | undefined;
364
364
 
365
365
  type ImageDiff$1 = {
366
366
  name?: string;
@@ -371,7 +371,7 @@ type ImageDiff$1 = {
371
371
 
372
372
  type Props$f = {
373
373
  diff: ImageDiff$1;
374
- i18n?: I18nProp$a;
374
+ i18n?: I18nProp$b;
375
375
  };
376
376
  declare const ImageDiff: (props: Props$f) => preact.JSX.Element;
377
377
 
@@ -380,14 +380,14 @@ type AttachmentProps = {
380
380
  item: AttachmentTestStepResult;
381
381
  i18n?: (key: any) => string;
382
382
  };
383
- type I18nProp$9 = {
383
+ type I18nProp$a = {
384
384
  imageDiff: ComponentProps<typeof ImageDiff>["i18n"];
385
385
  };
386
386
 
387
387
  interface AttachmentTestStepResultProps {
388
388
  item: AttachmentTestStepResult;
389
389
  previewable?: boolean;
390
- i18n?: I18nProp$9;
390
+ i18n?: I18nProp$a;
391
391
  }
392
392
  declare const Attachment: (props: AttachmentTestStepResultProps) => preact.JSX.Element | null;
393
393
 
@@ -679,31 +679,31 @@ interface HeatMapWidgetProps extends HeatMapProps {
679
679
 
680
680
  declare const HeatMapWidget: FunctionalComponent<HeatMapWidgetProps>;
681
681
 
682
- type I18nKeys$8 = "no-results" | "legend.stabilityRate";
683
- type I18nProp$8 = (key: I18nKeys$8, props?: Record<string, unknown>) => string;
682
+ type I18nKeys$9 = "no-results" | "legend.stabilityRate";
683
+ type I18nProp$9 = (key: I18nKeys$9, props?: Record<string, unknown>) => string;
684
684
  type Props$a = Omit<StabilityDistributionChartData, "type"> & {
685
- i18n: I18nProp$8;
685
+ i18n: I18nProp$9;
686
686
  };
687
687
 
688
688
  declare const StabilityDistributionWidget: FunctionalComponent<Props$a>;
689
689
 
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;
690
+ type I18nKeys$8 = `status.new${TestStatus}` | `status.removed${TestStatus}` | "legend.trend" | "no-history" | "no-results" | "ticks.current" | "ticks.history" | "tooltips.current" | "tooltips.history";
691
+ type I18nProp$8 = (key: I18nKeys$8, props?: Record<string, unknown>) => string;
692
692
  type Props$9 = Omit<TestBaseGrowthDynamicsChartData, "type"> & {
693
- i18n: I18nProp$7;
693
+ i18n: I18nProp$8;
694
694
  };
695
695
 
696
696
  declare const TestBaseGrowthDynamicsChartWidget: FunctionalComponent<Props$9>;
697
697
 
698
698
  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;
699
+ type I18nKeys$7 = `status.${FBSUStatus}` | "no-history" | "no-results" | "ticks.current" | "ticks.history" | "tooltips.current" | "tooltips.history";
700
+ type I18nProp$7 = (key: I18nKeys$7, props?: Record<string, unknown>) => string;
701
+ type Props$8 = Omit<StatusAgePyramidChartData, "type" | "statuses"> & {
702
+ i18n: I18nProp$7;
703
703
  statuses: FBSUStatus[];
704
704
  };
705
705
 
706
- declare const FBSUAgePyramidChartWidget: FunctionalComponent<Props$8>;
706
+ declare const StatusAgePyramidChartWidget: FunctionalComponent<Props$8>;
707
707
 
708
708
  type Props$7 = {
709
709
  data: {
@@ -719,11 +719,11 @@ type Props$7 = {
719
719
  };
720
720
  declare const TestingPyramidWidget: (props: Props$7) => JSX.Element;
721
721
 
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;
722
+ type I18nKeys$6 = "status.passed" | "status.failed" | "status.skipped" | "status.unknown" | "status.broken" | "percentage" | "of" | "tests.new" | "tests.flaky" | "tests.retries" | "total";
723
+ type I18nProp$6 = (key: I18nKeys$6, props?: Record<string, unknown>) => string;
724
724
  type Props$6 = {
725
725
  title?: string;
726
- i18n?: I18nProp$5;
726
+ i18n?: I18nProp$6;
727
727
  data: Statistic;
728
728
  statuses?: TestStatus[];
729
729
  metric?: TestStatus;
@@ -731,8 +731,8 @@ type Props$6 = {
731
731
 
732
732
  declare const CurrentStatusChartWidget: FunctionalComponent<Props$6>;
733
733
 
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;
734
+ 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";
735
+ type I18nProp$5 = (key: I18nKeys$5, props?: Record<string, unknown>) => string;
736
736
  type Props$5 = {
737
737
  title?: string;
738
738
  data: {
@@ -743,45 +743,48 @@ type Props$5 = {
743
743
  }[];
744
744
  limit?: number;
745
745
  statuses?: TestStatus[];
746
- i18n: I18nProp$4;
746
+ i18n: I18nProp$5;
747
747
  };
748
748
 
749
749
  declare const StatusDynamicsChartWidget: FunctionalComponent<Props$5>;
750
750
 
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;
751
+ 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";
752
+ type I18nProp$4 = (key: I18nKeys$4, props?: Record<string, unknown>) => string;
753
753
  type Props$4 = Omit<StatusTransitionsChartData, "type"> & {
754
754
  statuses?: TestStatus[];
755
- i18n: I18nProp$3;
755
+ i18n: I18nProp$4;
756
756
  };
757
757
 
758
758
  declare const StatusTransitionsChartWidget: FunctionalComponent<Props$4>;
759
759
 
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;
760
+ type I18nKeys$3 = "no-history" | "no-results" | "ticks.durationRange" | "tooltips.durationRange" | "legend.value" | "legend.total";
761
+ type I18nProp$3 = (key: I18nKeys$3, props?: Record<string, unknown>) => string;
762
762
  type Props$3 = Omit<DurationsChartData, "type"> & {
763
- i18n: I18nProp$2;
763
+ i18n: I18nProp$3;
764
764
  };
765
765
 
766
766
  declare const DurationsChartWidget: FunctionalComponent<Props$3>;
767
767
 
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;
768
+ type I18nKeys$2 = `status.${TestStatus}` | `severity.${SeverityLevel | "unset"}` | "no-results" | "ticks.current";
769
+ type I18nProp$2 = (key: I18nKeys$2, props?: Record<string, unknown>) => string;
770
770
  type Props$2 = Omit<TrSeveritiesChartData, "type"> & {
771
- i18n: I18nProp$1;
771
+ i18n: I18nProp$2;
772
772
  };
773
773
 
774
774
  declare const TrSeveritiesChartWidget: FunctionalComponent<Props$2>;
775
775
 
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;
776
+ type I18nKeys$1 = "no-results" | "durations.sequential" | "durations.duration" | "durations.speedup" | "ticks.current" | "ticks.history" | "tooltips.current" | "tooltips.history" | "legend.duration" | "legend.speedup";
777
+ type I18nProp$1 = (key: I18nKeys$1, props?: Record<string, unknown>) => string;
778
778
  type Props$1 = Omit<DurationDynamicsChartData, "type"> & {
779
- i18n: I18nProp;
779
+ i18n: I18nProp$1;
780
780
  };
781
781
 
782
782
  declare const DurationDynamicsChartWidget: FunctionalComponent<Props$1>;
783
783
 
784
- type TimlineTr = Pick<TestResult, "id" | "name" | "status" | "flaky" | "hidden" | "labels" | "environment" | "start" | "stop" | "duration" | "historyId">;
784
+ type TimlineTr = Pick<TestResult, "id" | "name" | "status" | "flaky" | "hidden" | "environment" | "start" | "duration" | "historyId"> & {
785
+ host: string;
786
+ thread: string;
787
+ };
785
788
  type TimelineSegment = {
786
789
  timeRange: [Date, Date];
787
790
  val: number;
@@ -818,32 +821,32 @@ declare const Timeline: FunctionComponent<Omit<TimelineProps, "data"> & {
818
821
  dataId: string;
819
822
  }>;
820
823
 
821
- type ReportSummaryCardProps = {
822
- href: string;
824
+ type SummaryTestResult = Pick<TestResult, "name" | "id" | "status" | "duration">;
825
+ type ReportSummary = {
826
+ href?: string;
827
+ remoteHref?: string;
828
+ jobHref?: string;
829
+ pullRequestHref?: string;
823
830
  name: string;
824
- status: TestStatus;
825
831
  stats: Statistic;
826
- newTests: any[];
827
- retryTests: any[];
828
- flakyTests: any[];
832
+ status: TestStatus;
829
833
  duration: number;
830
834
  plugin?: string;
835
+ newTests?: SummaryTestResult[];
836
+ flakyTests?: SummaryTestResult[];
837
+ retryTests?: SummaryTestResult[];
831
838
  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
839
  };
846
- declare const ReportSummaryCard: FunctionalComponent<ReportSummaryCardProps>;
840
+ type StatusI18nKeys = "status.failed" | "status.broken" | "status.passed" | "status.skipped" | "status.unknown";
841
+ type MetadataI18nKeys = "metadata.new" | "metadata.retry" | "metadata.flaky";
842
+ type I18nKeys = MetadataI18nKeys | StatusI18nKeys | "in" | "new" | "retry" | "flaky" | "total" | "createdAt";
843
+ type I18nProp = (key: I18nKeys, props?: Record<string, any>) => string | undefined;
844
+
845
+ type ReportSummaryCardProps = {
846
+ i18n: I18nProp;
847
+ summary: ReportSummary;
848
+ };
849
+ declare const ReportSummaryCard: (props: ReportSummaryCardProps) => preact.JSX.Element;
847
850
 
848
851
  declare const useTheme: () => string;
849
852
  declare const ThemeProvider: (props: {
@@ -865,5 +868,5 @@ type Props = {
865
868
  };
866
869
  declare const EmptyView: FunctionalComponent<Props>;
867
870
 
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 };
871
+ 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
872
  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 };