@cucumber/react-components 22.4.1 → 23.0.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.
Files changed (239) hide show
  1. package/README.md +35 -139
  2. package/dist/src/SearchContext.d.ts +12 -0
  3. package/dist/src/SearchContext.d.ts.map +1 -0
  4. package/dist/src/SearchContext.js +7 -0
  5. package/dist/src/SearchContext.js.map +1 -0
  6. package/dist/src/ciCommitLink.d.ts +2 -2
  7. package/dist/src/ciCommitLink.d.ts.map +1 -1
  8. package/dist/src/ciCommitLink.js +1 -1
  9. package/dist/src/ciCommitLink.js.map +1 -1
  10. package/dist/src/components/app/CICommitLink.d.ts +5 -7
  11. package/dist/src/components/app/CICommitLink.d.ts.map +1 -1
  12. package/dist/src/components/app/CICommitLink.js +12 -9
  13. package/dist/src/components/app/CICommitLink.js.map +1 -1
  14. package/dist/src/components/app/CIJobLink.d.ts +5 -7
  15. package/dist/src/components/app/CIJobLink.d.ts.map +1 -1
  16. package/dist/src/components/app/CIJobLink.js +8 -9
  17. package/dist/src/components/app/CIJobLink.js.map +1 -1
  18. package/dist/src/components/app/ControlledSearchProvider.d.ts +9 -0
  19. package/dist/src/components/app/ControlledSearchProvider.d.ts.map +1 -0
  20. package/dist/src/components/app/ControlledSearchProvider.js +15 -0
  21. package/dist/src/components/app/ControlledSearchProvider.js.map +1 -0
  22. package/dist/src/components/app/CopyButton.d.ts +5 -0
  23. package/dist/src/components/app/CopyButton.d.ts.map +1 -0
  24. package/dist/src/components/app/CopyButton.js +23 -0
  25. package/dist/src/components/app/CopyButton.js.map +1 -0
  26. package/dist/src/components/app/CopyButton.module.scss +14 -0
  27. package/dist/src/components/app/EnvelopesProvider.d.ts +8 -0
  28. package/dist/src/components/app/EnvelopesProvider.d.ts.map +1 -0
  29. package/dist/src/components/app/EnvelopesProvider.js +17 -0
  30. package/dist/src/components/app/EnvelopesProvider.js.map +1 -0
  31. package/dist/src/components/app/ExecutionSummary.d.ts +2 -12
  32. package/dist/src/components/app/ExecutionSummary.d.ts.map +1 -1
  33. package/dist/src/components/app/ExecutionSummary.js +66 -65
  34. package/dist/src/components/app/ExecutionSummary.js.map +1 -1
  35. package/dist/src/components/app/ExecutionSummary.module.scss +1 -56
  36. package/dist/src/components/app/FilteredDocuments.d.ts +3 -0
  37. package/dist/src/components/app/FilteredDocuments.d.ts.map +1 -0
  38. package/dist/src/components/app/FilteredDocuments.js +15 -0
  39. package/dist/src/components/app/FilteredDocuments.js.map +1 -0
  40. package/dist/src/components/app/GherkinDocumentList.d.ts +4 -4
  41. package/dist/src/components/app/GherkinDocumentList.d.ts.map +1 -1
  42. package/dist/src/components/app/GherkinDocumentList.js +26 -25
  43. package/dist/src/components/app/GherkinDocumentList.js.map +1 -1
  44. package/dist/src/components/app/Header.d.ts +5 -0
  45. package/dist/src/components/app/Header.d.ts.map +1 -0
  46. package/dist/src/components/app/Header.js +12 -0
  47. package/dist/src/components/app/Header.js.map +1 -0
  48. package/dist/src/components/app/Header.module.scss +43 -0
  49. package/dist/src/components/app/HealthChart.d.ts +3 -0
  50. package/dist/src/components/app/HealthChart.d.ts.map +1 -0
  51. package/dist/src/components/app/HealthChart.js +15 -0
  52. package/dist/src/components/app/HealthChart.js.map +1 -0
  53. package/dist/src/components/app/HealthChart.module.scss +9 -0
  54. package/dist/src/components/app/HighLight.js +2 -2
  55. package/dist/src/components/app/HighLight.js.map +1 -1
  56. package/dist/src/components/app/ImplementationIcon.d.ts +6 -0
  57. package/dist/src/components/app/ImplementationIcon.d.ts.map +1 -0
  58. package/dist/src/components/app/ImplementationIcon.js +10 -0
  59. package/dist/src/components/app/ImplementationIcon.js.map +1 -0
  60. package/dist/src/components/app/InMemorySearchProvider.d.ts +9 -0
  61. package/dist/src/components/app/InMemorySearchProvider.d.ts.map +1 -0
  62. package/dist/src/components/app/InMemorySearchProvider.js +10 -0
  63. package/dist/src/components/app/InMemorySearchProvider.js.map +1 -0
  64. package/dist/src/components/app/NoMatchResult.d.ts +2 -6
  65. package/dist/src/components/app/NoMatchResult.d.ts.map +1 -1
  66. package/dist/src/components/app/NoMatchResult.js +2 -4
  67. package/dist/src/components/app/NoMatchResult.js.map +1 -1
  68. package/dist/src/components/app/OSIcon.d.ts +4 -3
  69. package/dist/src/components/app/OSIcon.d.ts.map +1 -1
  70. package/dist/src/components/app/OSIcon.js +3 -5
  71. package/dist/src/components/app/OSIcon.js.map +1 -1
  72. package/dist/src/components/app/QueriesProvider.d.ts +10 -0
  73. package/dist/src/components/app/QueriesProvider.d.ts.map +1 -0
  74. package/dist/src/components/app/QueriesProvider.js +6 -0
  75. package/dist/src/components/app/QueriesProvider.js.map +1 -0
  76. package/dist/src/components/app/RuntimeIcon.d.ts +4 -3
  77. package/dist/src/components/app/RuntimeIcon.d.ts.map +1 -1
  78. package/dist/src/components/app/RuntimeIcon.js +3 -5
  79. package/dist/src/components/app/RuntimeIcon.js.map +1 -1
  80. package/dist/src/components/app/SearchBar.d.ts +2 -11
  81. package/dist/src/components/app/SearchBar.d.ts.map +1 -1
  82. package/dist/src/components/app/SearchBar.js +35 -30
  83. package/dist/src/components/app/SearchBar.js.map +1 -1
  84. package/dist/src/components/app/SearchBar.module.scss +53 -55
  85. package/dist/src/components/app/StatusesSummary.d.ts +2 -7
  86. package/dist/src/components/app/StatusesSummary.d.ts.map +1 -1
  87. package/dist/src/components/app/StatusesSummary.js +4 -2
  88. package/dist/src/components/app/StatusesSummary.js.map +1 -1
  89. package/dist/src/components/app/StatusesSummary.module.scss +1 -8
  90. package/dist/src/components/app/UriProvider.d.ts +5 -0
  91. package/dist/src/components/app/UriProvider.d.ts.map +1 -0
  92. package/dist/src/components/app/UriProvider.js +6 -0
  93. package/dist/src/components/app/UriProvider.js.map +1 -0
  94. package/dist/src/components/app/UrlSearchProvider.d.ts +8 -0
  95. package/dist/src/components/app/UrlSearchProvider.d.ts.map +1 -0
  96. package/dist/src/components/app/UrlSearchProvider.js +26 -0
  97. package/dist/src/components/app/UrlSearchProvider.js.map +1 -0
  98. package/dist/src/components/app/icons/CucumberLogo.d.ts +2 -2
  99. package/dist/src/components/app/icons/CucumberLogo.d.ts.map +1 -1
  100. package/dist/src/components/app/icons/CucumberLogo.js +1 -1
  101. package/dist/src/components/app/icons/CucumberLogo.js.map +1 -1
  102. package/dist/src/components/app/icons/Jvm.d.ts +2 -2
  103. package/dist/src/components/app/icons/Jvm.d.ts.map +1 -1
  104. package/dist/src/components/app/icons/Jvm.js +1 -1
  105. package/dist/src/components/app/icons/Jvm.js.map +1 -1
  106. package/dist/src/components/app/icons/Linux.d.ts +2 -2
  107. package/dist/src/components/app/icons/Linux.d.ts.map +1 -1
  108. package/dist/src/components/app/icons/Linux.js +1 -1
  109. package/dist/src/components/app/icons/Linux.js.map +1 -1
  110. package/dist/src/components/app/icons/MacOS.d.ts +2 -2
  111. package/dist/src/components/app/icons/MacOS.d.ts.map +1 -1
  112. package/dist/src/components/app/icons/MacOS.js +1 -1
  113. package/dist/src/components/app/icons/MacOS.js.map +1 -1
  114. package/dist/src/components/app/icons/NodeJs.d.ts +2 -2
  115. package/dist/src/components/app/icons/NodeJs.d.ts.map +1 -1
  116. package/dist/src/components/app/icons/NodeJs.js +4 -32
  117. package/dist/src/components/app/icons/NodeJs.js.map +1 -1
  118. package/dist/src/components/app/icons/Ruby.d.ts +2 -2
  119. package/dist/src/components/app/icons/Ruby.d.ts.map +1 -1
  120. package/dist/src/components/app/icons/Ruby.js +1 -1
  121. package/dist/src/components/app/icons/Ruby.js.map +1 -1
  122. package/dist/src/components/app/icons/Windows.d.ts +2 -2
  123. package/dist/src/components/app/icons/Windows.d.ts.map +1 -1
  124. package/dist/src/components/app/icons/Windows.js +1 -1
  125. package/dist/src/components/app/icons/Windows.js.map +1 -1
  126. package/dist/src/components/app/index.d.ts +7 -4
  127. package/dist/src/components/app/index.d.ts.map +1 -1
  128. package/dist/src/components/app/index.js +7 -4
  129. package/dist/src/components/app/index.js.map +1 -1
  130. package/dist/src/components/app/makeSetupString.d.ts +3 -0
  131. package/dist/src/components/app/makeSetupString.d.ts.map +1 -0
  132. package/dist/src/components/app/makeSetupString.js +21 -0
  133. package/dist/src/components/app/makeSetupString.js.map +1 -0
  134. package/dist/src/components/customise/{customRendering.d.ts → CustomRendering.d.ts} +5 -2
  135. package/dist/src/components/customise/CustomRendering.d.ts.map +1 -0
  136. package/dist/src/components/customise/{customRendering.js → CustomRendering.js} +4 -1
  137. package/dist/src/components/customise/{customRendering.js.map → CustomRendering.js.map} +1 -1
  138. package/dist/src/components/{CucumberReact.module.scss → customise/CustomRendering.stories.scss} +10 -20
  139. package/dist/src/components/customise/index.d.ts +1 -1
  140. package/dist/src/components/customise/index.js +1 -1
  141. package/dist/src/components/gherkin/DocString.module.scss +0 -1
  142. package/dist/src/components/gherkin/ErrorMessage.module.scss +0 -1
  143. package/dist/src/components/gherkin/Examples.module.scss +1 -1
  144. package/dist/src/components/gherkin/HookStep.js +1 -1
  145. package/dist/src/components/gherkin/HookStep.js.map +1 -1
  146. package/dist/src/components/gherkin/HookSteps.d.ts.map +1 -1
  147. package/dist/src/components/gherkin/HookSteps.js +2 -4
  148. package/dist/src/components/gherkin/HookSteps.js.map +1 -1
  149. package/dist/src/components/gherkin/Keyword.module.scss +1 -1
  150. package/dist/src/components/gherkin/StepItem.module.scss +0 -1
  151. package/dist/src/components/gherkin/StepsList.module.scss +4 -4
  152. package/dist/src/components/gherkin/Title.module.scss +2 -2
  153. package/dist/src/components/gherkin/attachment/Attachment.module.scss +0 -1
  154. package/dist/src/components/index.d.ts +3 -4
  155. package/dist/src/components/index.d.ts.map +1 -1
  156. package/dist/src/components/index.js +3 -4
  157. package/dist/src/components/index.js.map +1 -1
  158. package/dist/src/countScenariosByStatuses.d.ts +1 -5
  159. package/dist/src/countScenariosByStatuses.d.ts.map +1 -1
  160. package/dist/src/countScenariosByStatuses.js +14 -31
  161. package/dist/src/countScenariosByStatuses.js.map +1 -1
  162. package/dist/src/filter/filterByStatus.d.ts +1 -2
  163. package/dist/src/filter/filterByStatus.d.ts.map +1 -1
  164. package/dist/src/filter/filterByStatus.js +5 -2
  165. package/dist/src/filter/filterByStatus.js.map +1 -1
  166. package/dist/src/formatExecutionDistance.d.ts +2 -0
  167. package/dist/src/formatExecutionDistance.d.ts.map +1 -0
  168. package/dist/src/formatExecutionDistance.js +7 -0
  169. package/dist/src/formatExecutionDistance.js.map +1 -0
  170. package/dist/src/formatExecutionDuration.d.ts +2 -0
  171. package/dist/src/formatExecutionDuration.d.ts.map +1 -0
  172. package/dist/src/formatExecutionDuration.js +12 -0
  173. package/dist/src/formatExecutionDuration.js.map +1 -0
  174. package/dist/src/formatStatusRate.d.ts +2 -0
  175. package/dist/src/formatStatusRate.d.ts.map +1 -0
  176. package/dist/src/formatStatusRate.js +9 -0
  177. package/dist/src/formatStatusRate.js.map +1 -0
  178. package/dist/src/hooks/useFilteredDocuments.d.ts +2 -2
  179. package/dist/src/hooks/useFilteredDocuments.d.ts.map +1 -1
  180. package/dist/src/hooks/useFilteredDocuments.js +7 -5
  181. package/dist/src/hooks/useFilteredDocuments.js.map +1 -1
  182. package/dist/src/hooks/useQueries.d.ts +2 -6
  183. package/dist/src/hooks/useQueries.d.ts.map +1 -1
  184. package/dist/src/hooks/useQueries.js +1 -3
  185. package/dist/src/hooks/useQueries.js.map +1 -1
  186. package/dist/src/hooks/useResultStatistics.js +2 -2
  187. package/dist/src/hooks/useResultStatistics.js.map +1 -1
  188. package/dist/src/hooks/useSearch.d.ts +2 -2
  189. package/dist/src/hooks/useSearch.d.ts.map +1 -1
  190. package/dist/src/hooks/useSearch.js +1 -1
  191. package/dist/src/hooks/useSearch.js.map +1 -1
  192. package/dist/src/index.d.ts +3 -8
  193. package/dist/src/index.d.ts.map +1 -1
  194. package/dist/src/index.js +3 -8
  195. package/dist/src/index.js.map +1 -1
  196. package/dist/src/statuses.d.ts +4 -0
  197. package/dist/src/statuses.d.ts.map +1 -0
  198. package/dist/src/statuses.js +12 -0
  199. package/dist/src/statuses.js.map +1 -0
  200. package/dist/src/styles/statuses.scss +8 -0
  201. package/dist/src/styles/theming.scss +0 -6
  202. package/dist/tsconfig.build.tsbuildinfo +1 -1
  203. package/package.json +15 -17
  204. package/dist/src/EnvelopesQueryContext.d.ts +0 -15
  205. package/dist/src/EnvelopesQueryContext.d.ts.map +0 -1
  206. package/dist/src/EnvelopesQueryContext.js +0 -28
  207. package/dist/src/EnvelopesQueryContext.js.map +0 -1
  208. package/dist/src/SearchQueryContext.d.ts +0 -34
  209. package/dist/src/SearchQueryContext.d.ts.map +0 -1
  210. package/dist/src/SearchQueryContext.js +0 -73
  211. package/dist/src/SearchQueryContext.js.map +0 -1
  212. package/dist/src/components/CucumberReact.d.ts +0 -10
  213. package/dist/src/components/CucumberReact.d.ts.map +0 -1
  214. package/dist/src/components/CucumberReact.js +0 -9
  215. package/dist/src/components/CucumberReact.js.map +0 -1
  216. package/dist/src/components/app/EnvelopesWrapper.d.ts +0 -8
  217. package/dist/src/components/app/EnvelopesWrapper.d.ts.map +0 -1
  218. package/dist/src/components/app/EnvelopesWrapper.js +0 -20
  219. package/dist/src/components/app/EnvelopesWrapper.js.map +0 -1
  220. package/dist/src/components/app/FilteredResults.d.ts +0 -7
  221. package/dist/src/components/app/FilteredResults.d.ts.map +0 -1
  222. package/dist/src/components/app/FilteredResults.js +0 -23
  223. package/dist/src/components/app/FilteredResults.js.map +0 -1
  224. package/dist/src/components/app/FilteredResults.module.scss +0 -7
  225. package/dist/src/components/app/QueriesWrapper.d.ts +0 -12
  226. package/dist/src/components/app/QueriesWrapper.d.ts.map +0 -1
  227. package/dist/src/components/app/QueriesWrapper.js +0 -8
  228. package/dist/src/components/app/QueriesWrapper.js.map +0 -1
  229. package/dist/src/components/app/SearchWrapper.d.ts +0 -4
  230. package/dist/src/components/app/SearchWrapper.d.ts.map +0 -1
  231. package/dist/src/components/app/SearchWrapper.js +0 -6
  232. package/dist/src/components/app/SearchWrapper.js.map +0 -1
  233. package/dist/src/components/app/statuses.d.ts +0 -4
  234. package/dist/src/components/app/statuses.d.ts.map +0 -1
  235. package/dist/src/components/app/statuses.js +0 -12
  236. package/dist/src/components/app/statuses.js.map +0 -1
  237. package/dist/src/components/customise/custom-classes.stories.scss +0 -8
  238. package/dist/src/components/customise/customRendering.d.ts.map +0 -1
  239. package/dist/src/styles/fonts.scss +0 -18
package/README.md CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  > A set of React components for rendering Gherkin documents and Cucumber results.
4
4
 
5
- ## Screenshot
5
+ Preview and examples:
6
+ https://cucumber-react-preview.netlify.app/
6
7
 
7
8
  ![Examples Tables](screenshots/examples-tables.png)
8
9
 
@@ -11,35 +12,21 @@
11
12
  - This package is distributed in ES module format only.
12
13
  - React 18 or above is required.
13
14
 
14
- The source code for screenshots above is:
15
+ The source code for the screenshot above is:
15
16
 
16
17
  ```jsx
17
- <EnvelopesWrapper envelopes={envelopes}>
18
- <GherkinDocumentList />
19
- </EnvelopesWrapper>
20
- ```
21
-
22
- The [`<GherkinDocumentList>`](src/components/app/GherkinDocumentList.tsx) React component,
23
- is an accordion of [`<GherkinDocument>`](src/components/gherkin/GherkinDocument.tsx).
24
-
25
- The `<GherkinDocument>` React component and any component nested within it (such as [`<Scenario>`](src/components/gherkin/Scenario.tsx)) can be rendered standalone.
18
+ import { EnvelopesProvider, FilteredDocuments } from '@cucumber/react-components'
26
19
 
27
- ## `<GherkinDocument>` features
28
-
29
- The `<GherkinDocument>` React component is instantiated with a single `gherkinDocument` prop.
30
- The value must be a [GherkinDocument](../../cucumber-messages/messages.md#io.cucumber.messages.GherkinDocument) object.
31
- You can use the [Gherkin](../../gherkin) parser to generate a `GherkinDocument` object.
32
-
33
- By default the `<GherkinDocument>` component will not display any coloured results, as the `GherkinDocument`
34
- message object does not contain results, only the [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree) of the document.
35
- This is fine for simple use cases where results are not important.
20
+ <EnvelopesProvider envelopes={envelopes}>
21
+ <FilteredDocuments />
22
+ </EnvelopesProvider>
23
+ ```
36
24
 
37
- To render a `<GherkinDocument>` with results and highlighted [Cucumber Expression parameters](https://cucumber.io/docs/cucumber/cucumber-expressions/) parameters it must be nested inside a
38
- [`<Wrapper>`](src/components/app/Wrapper.tsx) component.
25
+ `envelopes` should be an array of [Cucumber Messages](https://github.com/cucumber/messages) that came from a test run. You can obtain these from most Cucumber implementations by using a "Message" formatter.
39
26
 
40
27
  ## Attachments
41
28
 
42
- Attachments from test runs are shown with their corresponding steps. The baseline behaviour for attachments is a download button. However, we have some special handling for very common MIME types to make them more useful without leaving the report:
29
+ Attachments from test runs are shown with their corresponding steps. The baseline behavior for attachments is a download button. However, we have some special handling for common MIME types to make them more useful without leaving the report:
43
30
 
44
31
  - `image/*` - images are rendered with an `<img/>` tag
45
32
  - `video/*` - videos are rendered with a `<video/` tag
@@ -50,40 +37,26 @@ Attachments from test runs are shown with their corresponding steps. The baselin
50
37
 
51
38
  ## Styling
52
39
 
53
- The standard styling comes from wrapping your top-level usage with the `CucumberReact` component (sans-props). There are several ways you can apply different styling to the components.
40
+ The standard styling comes without any extra providers or configuration. There are several ways you can apply different styling to the components.
54
41
 
55
- ### Built-in themes
42
+ ### Theming
56
43
 
57
- These are the built-in themes:
58
-
59
- - `light` (default)
60
- - `dark`
61
- - `auto` (honours your operating system preference for either light or dark)
62
-
63
- You can activate one of these by passing the `theme` prop to the `CucumberReact` component:
44
+ You can provide your own theme with a small amount of CSS. Target the element above your highest-level usage of the components:
64
45
 
65
46
  ```jsx
66
- <CucumberReact theme="dark">
67
- <GherkinDocument />
68
- </CucumberReact>
47
+ <div className="dark-theme">
48
+ <EnvelopesProvider envelopes={envelopes}>
49
+ <FilteredDocuments />
50
+ </EnvelopesProvider>
51
+ </div>
69
52
  ```
70
53
 
71
- ### Custom themes
72
-
73
- You can also provide your own theme with a small amount of CSS. Pass the `CucumberReact` component a class name instead of a theme name:
74
-
75
- ```jsx
76
- <CucumberReact className="acme-widgets">
77
- <GherkinDocument />
78
- </CucumberReact>
79
- ```
80
-
81
- In your CSS for the `acme-widgets` class, you can override the supported [custom property](https://developer.mozilla.org/en-US/docs/Web/CSS/--*) values as desired. Here's the CSS that drives the built-in "dark" theme:
54
+ In your CSS, you can set the background and text colors, and override the supported [custom property](https://developer.mozilla.org/en-US/docs/Web/CSS/--*) values as desired:
82
55
 
83
56
  ```css
84
- .darkTheme {
85
- --cucumber-background-color: #1d1d26;
86
- --cucumber-text-color: #c9c9d1;
57
+ .dark-theme {
58
+ background-color: #1d1d26;
59
+ color: #c9c9d1;
87
60
  --cucumber-anchor-color: #4caaee;
88
61
  --cucumber-keyword-color: #d89077;
89
62
  --cucumber-parameter-color: #4caaee;
@@ -99,13 +72,6 @@ In your CSS for the `acme-widgets` class, you can override the supported [custom
99
72
  }
100
73
  ```
101
74
 
102
- ### Fonts
103
-
104
- By default, web-safe default font stacks are used, but you can override these so the components use your preferred fonts. These custom properties are supported:
105
-
106
- - `--cucumber-sans-font-family` - the font used for the text
107
- - `--cucumber-mono-font-family` - the font used for doc strings and attachments
108
-
109
75
  ### Custom styles
110
76
 
111
77
  For more control over the styling, you can override the CSS used by individual components.
@@ -123,16 +89,18 @@ Let's say you want to do something totally different with the typography of doc
123
89
  }
124
90
  ```
125
91
 
126
- Then, you can provide a `customRendering` prop to the `CucumberReact` component, in the form of an object that declares which class names you're going to override and what with:
92
+ Then, you can provide an `overrides` prop to the `CustomRendering` component, in the form of an object that declares which class names you're going to override and what with:
127
93
 
128
94
  ```jsx
129
- <CucumberReact customRendering={{
95
+ <CustomRendering overrides={{
130
96
  DocString: {
131
97
  docString: 'acme-docstring'
132
98
  }
133
99
  }}>
134
- <GherkinDocument />
135
- </CucumberReact>
100
+ <EnvelopesProvider envelopes={envelopes}>
101
+ <FilteredDocuments />
102
+ </EnvelopesProvider>
103
+ </CustomRendering>
136
104
  ```
137
105
 
138
106
  Some components have multiple styling hooks - e.g. the `<Tags>` component has the `tags` class name for the list, and the `tag` class name for each item. In these cases, you can provide custom class names for just the ones you want to change, and any you omit will pick up the built-in styling like normal.
@@ -141,10 +109,10 @@ Some components have multiple styling hooks - e.g. the `<Tags>` component has th
141
109
 
142
110
  To change the rendering of some components entirely, you can selectively provide your own component implementations to be used instead of the built-in ones.
143
111
 
144
- Staying with the doc string example, you can use the same `customRendering` prop, but this time instead of an object with class names, you provide a React functional component, giving you full control over the rendering:
112
+ Staying with the doc string example, you can use the same `overrides` prop, but this time instead of an object with class names, you provide a React functional component, giving you full control over the rendering:
145
113
 
146
114
  ```jsx
147
- <CucumberReact customRendering={{
115
+ <CustomRendering overrides={{
148
116
  DocString: (props) => (
149
117
  <>
150
118
  <p>I am going to render this doc string in a textarea:</p>
@@ -152,85 +120,13 @@ Staying with the doc string example, you can use the same `customRendering` prop
152
120
  </>
153
121
  )
154
122
  }}>
155
- <GherkinDocument />
156
- </CucumberReact>
123
+ <EnvelopesProvider envelopes={envelopes}>
124
+ <FilteredDocuments />
125
+ </EnvelopesProvider>
126
+ </CustomRendering>
157
127
  ```
158
128
 
159
129
  In each case where you provide your own component, it will receive the same props as the default component, plus two more:
160
130
 
161
131
  - `styles` - class names for the default styling, so you can still apply these to your custom component if it makes sense
162
- - `DefaultRenderer` - the default React component, useful if you only want to provide your own rendering for certain cases, and otherwise fall back to the default rendering (don't forget to pass it the props)
163
-
164
- ## Build / hack
165
-
166
- Install dependencies
167
-
168
- npm install
169
-
170
- Run tests
171
-
172
- npm test
173
-
174
- Interactive development
175
-
176
- npm start
177
-
178
- ## Ideas
179
-
180
- ### `ScenarioList` component
181
-
182
- A component that renders a list of scenarios (possibly from multiple files, filtered by e.g. tag).
183
-
184
- This component could be used to render relevant scenarios in 3rd-party tools, such as
185
- JIRA, Confluence and various issue trackers that support plugins.
186
-
187
- ### Link to JIRA
188
-
189
- Configure with a regexp and url function, and tags will be rendered as JIRA issue links
190
-
191
- ### Search
192
-
193
- Search by tag, but also by text. Could use http://elasticlunr.com/
194
- or https://lunrjs.com/ - or it could simply perform filtering on an array of `GherkinDocument` messages.
195
-
196
- ### Search results
197
-
198
- Each scenario displayed underneath each other, grouped by feature file. The feature description is "collapsed",
199
- (unless it contains the search term) but can be opened.
200
-
201
- ### Filtering / sorting
202
-
203
- * by tag
204
- * by duration (find slow ones)
205
- * by status
206
- * by recency (update timestamp) - exclude old ones
207
- * by flickeriness
208
-
209
- ### Tag search
210
-
211
- * Render a tag cloud for all tags
212
- * Size: count
213
- * Color: pass/fail/undefined
214
-
215
- ### On-demand data
216
-
217
- For large reports (especially with screenshots) it may be too heavy to store it all in the browser.
218
- The GUI should request data for the current document on demand. The GUI should also be able to filter
219
- what kind of events it wants. For example, to render the initial screen.
220
-
221
- ### Server / App
222
-
223
- It should be easy to use. Just run the app (Electron). It will create a named pipe where
224
- it will listen. What's written here gets written straight to the React app (no websocket,
225
- it's in the same process). This app can be fairly small.
226
-
227
- ### Rerun tests
228
-
229
- Add a message to represent a config+cwd+env for a run, so the GUI can rerun it.
230
- The config is essentially command line options. They can be modified in the gui.
231
- Rerun on file change can also be set up. This just makes the whole DX simple.
232
-
233
- ### Alerts
234
-
235
- The app could use the OS to send screen messages (autotest like)
236
-
132
+ - `DefaultRenderer` - the default React component, useful if you only want to provide your own rendering for certain cases, and otherwise fall back to the default rendering (don't forget to pass it the props)
@@ -0,0 +1,12 @@
1
+ import { TestStepResultStatus as Status } from '@cucumber/messages';
2
+ import React from 'react';
3
+ export interface SearchState {
4
+ readonly query: string;
5
+ readonly hideStatuses: readonly Status[];
6
+ }
7
+ export interface SearchContextValue extends SearchState {
8
+ update: (changes: Partial<SearchState>) => void;
9
+ }
10
+ declare const _default: React.Context<SearchContextValue>;
11
+ export default _default;
12
+ //# sourceMappingURL=SearchContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchContext.d.ts","sourceRoot":"","sources":["../../src/SearchContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,IAAI,MAAM,EAAE,MAAM,oBAAoB,CAAA;AACnE,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAA;CACzC;AAED,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,IAAI,CAAA;CAChD;;AAED,wBAIE"}
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ export default React.createContext({
3
+ query: '',
4
+ hideStatuses: [],
5
+ update: () => { },
6
+ });
7
+ //# sourceMappingURL=SearchContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchContext.js","sourceRoot":"","sources":["../../src/SearchContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAWzB,eAAe,KAAK,CAAC,aAAa,CAAqB;IACrD,KAAK,EAAE,EAAE;IACT,YAAY,EAAE,EAAE;IAChB,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC;CACjB,CAAC,CAAA"}
@@ -1,3 +1,3 @@
1
- import * as messages from '@cucumber/messages';
2
- export default function ciCommitLink(ci: messages.Ci): string | null;
1
+ import { Ci } from '@cucumber/messages';
2
+ export default function ciCommitLink(ci: Ci): string | undefined;
3
3
  //# sourceMappingURL=ciCommitLink.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ciCommitLink.d.ts","sourceRoot":"","sources":["../../src/ciCommitLink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAA;AAI9C,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,EAAE,QAAQ,CAAC,EAAE,GAAG,MAAM,GAAG,IAAI,CASnE"}
1
+ {"version":3,"file":"ciCommitLink.d.ts","sourceRoot":"","sources":["../../src/ciCommitLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AAKvC,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,EAAE,EAAE,GAAG,MAAM,GAAG,SAAS,CAQ/D"}
@@ -1,4 +1,5 @@
1
1
  import toRepositoryId from './toRepositoryId.js';
2
+ // TODO move upstream to create-meta
2
3
  export default function ciCommitLink(ci) {
3
4
  if (ci.git && ci.git.remote) {
4
5
  const repositoryId = toRepositoryId(ci.git.remote);
@@ -7,6 +8,5 @@ export default function ciCommitLink(ci) {
7
8
  return `https://${repositoryId}/commit/${ci.git.revision}`;
8
9
  }
9
10
  }
10
- return null;
11
11
  }
12
12
  //# sourceMappingURL=ciCommitLink.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ciCommitLink.js","sourceRoot":"","sources":["../../src/ciCommitLink.ts"],"names":[],"mappings":"AAEA,OAAO,cAAc,MAAM,qBAAqB,CAAA;AAEhD,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAe;IAClD,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE;QAC3B,MAAM,YAAY,GAAG,cAAc,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QAClD,MAAM,MAAM,GAAG,YAAY,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,IAAI,KAAK,gBAAgB,CAAA;QACpF,IAAI,EAAE,CAAC,GAAG,CAAC,QAAQ,IAAI,MAAM,EAAE;YAC7B,OAAO,WAAW,YAAY,WAAW,EAAE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAA;SAC3D;KACF;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
1
+ {"version":3,"file":"ciCommitLink.js","sourceRoot":"","sources":["../../src/ciCommitLink.ts"],"names":[],"mappings":"AAEA,OAAO,cAAc,MAAM,qBAAqB,CAAA;AAEhD,oCAAoC;AACpC,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAM;IACzC,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE;QAC3B,MAAM,YAAY,GAAG,cAAc,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QAClD,MAAM,MAAM,GAAG,YAAY,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,IAAI,KAAK,gBAAgB,CAAA;QACpF,IAAI,EAAE,CAAC,GAAG,CAAC,QAAQ,IAAI,MAAM,EAAE;YAC7B,OAAO,WAAW,YAAY,WAAW,EAAE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAA;SAC3D;KACF;AACH,CAAC"}
@@ -1,8 +1,6 @@
1
- import * as messages from '@cucumber/messages';
2
- import React from 'react';
3
- interface IProps {
4
- ci: messages.Ci;
5
- }
6
- export declare const CICommitLink: React.FunctionComponent<IProps>;
7
- export {};
1
+ import { Ci } from '@cucumber/messages';
2
+ import { FC } from 'react';
3
+ export declare const CICommitLink: FC<{
4
+ ci: Ci;
5
+ }>;
8
6
  //# sourceMappingURL=CICommitLink.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CICommitLink.d.ts","sourceRoot":"","sources":["../../../../src/components/app/CICommitLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAA;AAG9C,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,UAAU,MAAM;IACd,EAAE,EAAE,QAAQ,CAAC,EAAE,CAAA;CAChB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAgBxD,CAAA"}
1
+ {"version":3,"file":"CICommitLink.d.ts","sourceRoot":"","sources":["../../../../src/components/app/CICommitLink.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AAGvC,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAIjC,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC;IAC5B,EAAE,EAAE,EAAE,CAAA;CACP,CAwBA,CAAA"}
@@ -1,18 +1,21 @@
1
- import { faLink } from '@fortawesome/free-solid-svg-icons';
1
+ import { faCodeCommit } from '@fortawesome/free-solid-svg-icons';
2
2
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
3
3
  import React from 'react';
4
4
  import ciCommitLink from '../../ciCommitLink.js';
5
- export const CICommitLink = ({ ci: ci }) => {
5
+ export const CICommitLink = ({ ci }) => {
6
+ if (!ci.git) {
7
+ return null;
8
+ }
9
+ const shortHash = ci.git.revision.substring(0, 7);
6
10
  const commitLink = ciCommitLink(ci);
7
- if (commitLink && ci.git?.remote) {
11
+ if (commitLink) {
8
12
  return (React.createElement(React.Fragment, null,
9
- React.createElement(FontAwesomeIcon, { icon: faLink }),
10
- "Git Ref ",
11
- React.createElement("a", { href: commitLink }, ci.git.revision.substring(0, 7))));
13
+ React.createElement(FontAwesomeIcon, { "aria-hidden": "true", style: { opacity: 0.75 }, icon: faCodeCommit }),
14
+ React.createElement("a", { href: commitLink, target: "_blank", rel: "noreferrer" },
15
+ React.createElement("code", null, shortHash))));
12
16
  }
13
17
  return (React.createElement(React.Fragment, null,
14
- React.createElement(FontAwesomeIcon, { icon: faLink }),
15
- " Git Ref ",
16
- ci.git?.revision.substring(0, 7)));
18
+ React.createElement(FontAwesomeIcon, { "aria-hidden": "true", style: { opacity: 0.75 }, icon: faCodeCommit }),
19
+ React.createElement("code", null, shortHash)));
17
20
  };
18
21
  //# sourceMappingURL=CICommitLink.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CICommitLink.js","sourceRoot":"","sources":["../../../../src/components/app/CICommitLink.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,YAAY,MAAM,uBAAuB,CAAA;AAMhD,MAAM,CAAC,MAAM,YAAY,GAAoC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;IAC1E,MAAM,UAAU,GAAG,YAAY,CAAC,EAAE,CAAC,CAAA;IAEnC,IAAI,UAAU,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE;QAChC,OAAO,CACL;YACE,oBAAC,eAAe,IAAC,IAAI,EAAE,MAAM,GAAI;;YACzB,2BAAG,IAAI,EAAE,UAAU,IAAG,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAK,CACjE,CACJ,CAAA;KACF;IACD,OAAO,CACL;QACE,oBAAC,eAAe,IAAC,IAAI,EAAE,MAAM,GAAI;;QAAU,EAAE,CAAC,GAAG,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAC1E,CACJ,CAAA;AACH,CAAC,CAAA"}
1
+ {"version":3,"file":"CICommitLink.js","sourceRoot":"","sources":["../../../../src/components/app/CICommitLink.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,KAAa,MAAM,OAAO,CAAA;AAEjC,OAAO,YAAY,MAAM,uBAAuB,CAAA;AAEhD,MAAM,CAAC,MAAM,YAAY,GAEpB,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;IACd,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE;QACX,OAAO,IAAI,CAAA;KACZ;IAED,MAAM,SAAS,GAAG,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACjD,MAAM,UAAU,GAAG,YAAY,CAAC,EAAE,CAAC,CAAA;IAEnC,IAAI,UAAU,EAAE;QACd,OAAO,CACL;YACE,oBAAC,eAAe,mBAAa,MAAM,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,YAAY,GAAI;YACpF,2BAAG,IAAI,EAAE,UAAU,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,YAAY;gBACnD,kCAAO,SAAS,CAAQ,CACtB,CACH,CACJ,CAAA;KACF;IACD,OAAO,CACL;QACE,oBAAC,eAAe,mBAAa,MAAM,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,YAAY,GAAI;QACpF,kCAAO,SAAS,CAAQ,CACvB,CACJ,CAAA;AACH,CAAC,CAAA"}
@@ -1,8 +1,6 @@
1
- import * as messages from '@cucumber/messages';
2
- import React from 'react';
3
- interface IProps {
4
- ci: messages.Ci;
5
- }
6
- export declare const CIJobLink: React.FunctionComponent<IProps>;
7
- export {};
1
+ import { Ci } from '@cucumber/messages';
2
+ import { FC } from 'react';
3
+ export declare const CIJobLink: FC<{
4
+ ci: Ci;
5
+ }>;
8
6
  //# sourceMappingURL=CIJobLink.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CIJobLink.d.ts","sourceRoot":"","sources":["../../../../src/components/app/CIJobLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAA;AAG9C,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,UAAU,MAAM;IACd,EAAE,EAAE,QAAQ,CAAC,EAAE,CAAA;CAChB;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAUrD,CAAA"}
1
+ {"version":3,"file":"CIJobLink.d.ts","sourceRoot":"","sources":["../../../../src/components/app/CIJobLink.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AAGvC,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAEjC,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC;IACzB,EAAE,EAAE,EAAE,CAAA;CACP,CAiBA,CAAA"}
@@ -1,15 +1,14 @@
1
- import { faLink } from '@fortawesome/free-solid-svg-icons';
1
+ import { faServer } from '@fortawesome/free-solid-svg-icons';
2
2
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
3
3
  import React from 'react';
4
- export const CIJobLink = ({ ci: ci }) => {
5
- if (ci.url && ci.buildNumber) {
4
+ export const CIJobLink = ({ ci }) => {
5
+ if (ci.url) {
6
6
  return (React.createElement(React.Fragment, null,
7
- React.createElement(FontAwesomeIcon, { icon: faLink }),
8
- "Job ",
9
- React.createElement("a", { href: ci.url },
10
- " ",
11
- ci.buildNumber)));
7
+ React.createElement(FontAwesomeIcon, { "aria-hidden": "true", style: { opacity: 0.75 }, icon: faServer }),
8
+ React.createElement("a", { href: ci.url, target: "_blank", rel: "noreferrer" }, ci.name)));
12
9
  }
13
- return React.createElement(React.Fragment, null);
10
+ return (React.createElement(React.Fragment, null,
11
+ React.createElement(FontAwesomeIcon, { "aria-hidden": "true", style: { opacity: 0.75 }, icon: faServer }),
12
+ React.createElement("span", null, ci.name)));
14
13
  };
15
14
  //# sourceMappingURL=CIJobLink.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CIJobLink.js","sourceRoot":"","sources":["../../../../src/components/app/CIJobLink.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,MAAM,CAAC,MAAM,SAAS,GAAoC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;IACvE,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,WAAW,EAAE;QAC5B,OAAO,CACL;YACE,oBAAC,eAAe,IAAC,IAAI,EAAE,MAAM,GAAI;;YAC7B,2BAAG,IAAI,EAAE,EAAE,CAAC,GAAG;;gBAAI,EAAE,CAAC,WAAW,CAAK,CACzC,CACJ,CAAA;KACF;IACD,OAAO,yCAAK,CAAA;AACd,CAAC,CAAA"}
1
+ {"version":3,"file":"CIJobLink.js","sourceRoot":"","sources":["../../../../src/components/app/CIJobLink.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,KAAa,MAAM,OAAO,CAAA;AAEjC,MAAM,CAAC,MAAM,SAAS,GAEjB,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;IACd,IAAI,EAAE,CAAC,GAAG,EAAE;QACV,OAAO,CACL;YACE,oBAAC,eAAe,mBAAa,MAAM,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,GAAI;YAChF,2BAAG,IAAI,EAAE,EAAE,CAAC,GAAG,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,YAAY,IAC9C,EAAE,CAAC,IAAI,CACN,CACH,CACJ,CAAA;KACF;IACD,OAAO,CACL;QACE,oBAAC,eAAe,mBAAa,MAAM,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,GAAI;QAChF,kCAAO,EAAE,CAAC,IAAI,CAAQ,CACrB,CACJ,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { SearchState } from '../../SearchContext.js';
3
+ interface Props {
4
+ value: SearchState;
5
+ onChange: (newValue: SearchState) => void;
6
+ }
7
+ export declare const ControlledSearchProvider: FC<PropsWithChildren<Props>>;
8
+ export {};
9
+ //# sourceMappingURL=ControlledSearchProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ControlledSearchProvider.d.ts","sourceRoot":"","sources":["../../../../src/components/app/ControlledSearchProvider.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAE,iBAAiB,EAAW,MAAM,OAAO,CAAA;AAE7D,OAA2B,EAAsB,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAE5F,UAAU,KAAK;IACb,KAAK,EAAE,WAAW,CAAA;IAClB,QAAQ,EAAE,CAAC,QAAQ,EAAE,WAAW,KAAK,IAAI,CAAA;CAC1C;AAED,eAAO,MAAM,wBAAwB,EAAE,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAejE,CAAA"}
@@ -0,0 +1,15 @@
1
+ import React, { useMemo } from 'react';
2
+ import SearchQueryContext from '../../SearchContext.js';
3
+ export const ControlledSearchProvider = ({ value, onChange, children, }) => {
4
+ const contextValue = useMemo(() => {
5
+ return {
6
+ query: value.query,
7
+ hideStatuses: value.hideStatuses,
8
+ update: (newValues) => {
9
+ onChange({ ...value, ...newValues });
10
+ },
11
+ };
12
+ }, [value, onChange]);
13
+ return React.createElement(SearchQueryContext.Provider, { value: contextValue }, children);
14
+ };
15
+ //# sourceMappingURL=ControlledSearchProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ControlledSearchProvider.js","sourceRoot":"","sources":["../../../../src/components/app/ControlledSearchProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAyB,OAAO,EAAE,MAAM,OAAO,CAAA;AAE7D,OAAO,kBAAuD,MAAM,wBAAwB,CAAA;AAO5F,MAAM,CAAC,MAAM,wBAAwB,GAAiC,CAAC,EACrE,KAAK,EACL,QAAQ,EACR,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,YAAY,GAAuB,OAAO,CAAC,GAAG,EAAE;QACpD,OAAO;YACL,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,YAAY,EAAE,KAAK,CAAC,YAAY;YAChC,MAAM,EAAE,CAAC,SAA+B,EAAE,EAAE;gBAC1C,QAAQ,CAAC,EAAE,GAAG,KAAK,EAAE,GAAG,SAAS,EAAE,CAAC,CAAA;YACtC,CAAC;SACF,CAAA;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAA;IACrB,OAAO,oBAAC,kBAAkB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,IAAG,QAAQ,CAA+B,CAAA;AACnG,CAAC,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ export declare const CopyButton: FC<{
3
+ text: string;
4
+ }>;
5
+ //# sourceMappingURL=CopyButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CopyButton.d.ts","sourceRoot":"","sources":["../../../../src/components/app/CopyButton.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,EAAE,EAAY,MAAM,OAAO,CAAA;AAI3C,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CA2B3C,CAAA"}
@@ -0,0 +1,23 @@
1
+ import { faCheck, faCopy } from '@fortawesome/free-solid-svg-icons';
2
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
3
+ import React, { useState } from 'react';
4
+ import styles from './CopyButton.module.scss';
5
+ export const CopyButton = ({ text }) => {
6
+ const [copied, setCopied] = useState(false);
7
+ const handleCopy = () => {
8
+ navigator.clipboard
9
+ .writeText(text)
10
+ .then(() => {
11
+ setCopied(true);
12
+ setTimeout(() => {
13
+ setCopied(false);
14
+ }, 3000);
15
+ })
16
+ .catch((err) => {
17
+ console.error('Failed to copy', err);
18
+ });
19
+ };
20
+ return (React.createElement("button", { onClick: handleCopy, "aria-label": copied ? 'Copied' : 'Copy', disabled: copied, className: styles.button },
21
+ React.createElement(FontAwesomeIcon, { icon: copied ? faCheck : faCopy })));
22
+ };
23
+ //# sourceMappingURL=CopyButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CopyButton.js","sourceRoot":"","sources":["../../../../src/components/app/CopyButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,KAAK,EAAE,EAAM,QAAQ,EAAE,MAAM,OAAO,CAAA;AAE3C,OAAO,MAAM,MAAM,0BAA0B,CAAA;AAE7C,MAAM,CAAC,MAAM,UAAU,GAAyB,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IAC3D,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAE3C,MAAM,UAAU,GAAG,GAAG,EAAE;QACtB,SAAS,CAAC,SAAS;aAChB,SAAS,CAAC,IAAI,CAAC;aACf,IAAI,CAAC,GAAG,EAAE;YACT,SAAS,CAAC,IAAI,CAAC,CAAA;YACf,UAAU,CAAC,GAAG,EAAE;gBACd,SAAS,CAAC,KAAK,CAAC,CAAA;YAClB,CAAC,EAAE,IAAI,CAAC,CAAA;QACV,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YACb,OAAO,CAAC,KAAK,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAA;QACtC,CAAC,CAAC,CAAA;IACN,CAAC,CAAA;IAED,OAAO,CACL,gCACE,OAAO,EAAE,UAAU,gBACP,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EACtC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,CAAC,MAAM;QAExB,oBAAC,eAAe,IAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,GAAI,CAC7C,CACV,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,14 @@
1
+ @import '../../styles/theming';
2
+
3
+ .button {
4
+ background-color: transparent;
5
+ font-size: inherit;
6
+ padding: 0;
7
+ border: none;
8
+ color: $anchorColor;
9
+ cursor: pointer;
10
+
11
+ &:disabled {
12
+ cursor: unset;
13
+ }
14
+ }
@@ -0,0 +1,8 @@
1
+ import { Envelope } from '@cucumber/messages';
2
+ import { FC, PropsWithChildren } from 'react';
3
+ interface Props {
4
+ envelopes: readonly Envelope[];
5
+ }
6
+ export declare const EnvelopesProvider: FC<PropsWithChildren<Props>>;
7
+ export {};
8
+ //# sourceMappingURL=EnvelopesProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnvelopesProvider.d.ts","sourceRoot":"","sources":["../../../../src/components/app/EnvelopesProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAE7C,OAAc,EAAE,EAAE,EAAE,iBAAiB,EAAW,MAAM,OAAO,CAAA;AAI7D,UAAU,KAAK;IACb,SAAS,EAAE,SAAS,QAAQ,EAAE,CAAA;CAC/B;AAED,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAe1D,CAAA"}
@@ -0,0 +1,17 @@
1
+ import { Query as GherkinQuery } from '@cucumber/gherkin-utils';
2
+ import { Query as CucumberQuery } from '@cucumber/query';
3
+ import React, { useMemo } from 'react';
4
+ import { QueriesProvider } from './QueriesProvider.js';
5
+ export const EnvelopesProvider = ({ envelopes, children }) => {
6
+ const { gherkinQuery, cucumberQuery } = useMemo(() => {
7
+ const gherkinQuery = new GherkinQuery();
8
+ const cucumberQuery = new CucumberQuery();
9
+ for (const envelope of envelopes) {
10
+ gherkinQuery.update(envelope);
11
+ cucumberQuery.update(envelope);
12
+ }
13
+ return { gherkinQuery, cucumberQuery };
14
+ }, [envelopes]);
15
+ return (React.createElement(QueriesProvider, { gherkinQuery: gherkinQuery, cucumberQuery: cucumberQuery }, children));
16
+ };
17
+ //# sourceMappingURL=EnvelopesProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnvelopesProvider.js","sourceRoot":"","sources":["../../../../src/components/app/EnvelopesProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAE/D,OAAO,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,KAAK,EAAE,EAAyB,OAAO,EAAE,MAAM,OAAO,CAAA;AAE7D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAMtD,MAAM,CAAC,MAAM,iBAAiB,GAAiC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE;IACzF,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE;QACnD,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAA;QACvC,MAAM,aAAa,GAAG,IAAI,aAAa,EAAE,CAAA;QACzC,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;YAChC,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;YAC7B,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;SAC/B;QACD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,CAAA;IACxC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAA;IACf,OAAO,CACL,oBAAC,eAAe,IAAC,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,IACtE,QAAQ,CACO,CACnB,CAAA;AACH,CAAC,CAAA"}
@@ -1,13 +1,3 @@
1
- import * as messages from '@cucumber/messages';
2
- import { TestRunFinished, TestRunStarted } from '@cucumber/messages';
3
- import React from 'react';
4
- export interface IExecutionSummaryProps {
5
- scenarioCountByStatus: Record<messages.TestStepResultStatus, number>;
6
- totalScenarioCount: number;
7
- testRunStarted?: TestRunStarted;
8
- testRunFinished?: TestRunFinished;
9
- referenceDate?: Date;
10
- meta?: messages.Meta;
11
- }
12
- export declare const ExecutionSummary: React.FunctionComponent<IExecutionSummaryProps>;
1
+ import { FC } from 'react';
2
+ export declare const ExecutionSummary: FC;
13
3
  //# sourceMappingURL=ExecutionSummary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExecutionSummary.d.ts","sourceRoot":"","sources":["../../../../src/components/app/ExecutionSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EACL,eAAe,EACf,cAAc,EAGf,MAAM,oBAAoB,CAAA;AAI3B,OAAO,KAAK,MAAM,OAAO,CAAA;AAoBzB,MAAM,WAAW,sBAAsB;IACrC,qBAAqB,EAAE,MAAM,CAAC,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAA;IACpE,kBAAkB,EAAE,MAAM,CAAA;IAC1B,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,eAAe,CAAC,EAAE,eAAe,CAAA;IACjC,aAAa,CAAC,EAAE,IAAI,CAAA;IACpB,IAAI,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAA;CACrB;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,iBAAiB,CAAC,sBAAsB,CAwG5E,CAAA"}
1
+ {"version":3,"file":"ExecutionSummary.d.ts","sourceRoot":"","sources":["../../../../src/components/app/ExecutionSummary.tsx"],"names":[],"mappings":"AAGA,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAkBjC,eAAO,MAAM,gBAAgB,EAAE,EA+F9B,CAAA"}