@cucumber/react-components 24.2.0 → 24.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.
Files changed (415) hide show
  1. package/LICENSE +1 -1
  2. package/dist/src/CucumberQueryContext.d.ts +1 -2
  3. package/dist/src/CucumberQueryContext.d.ts.map +1 -1
  4. package/dist/src/CucumberQueryContext.js +2 -2
  5. package/dist/src/CucumberQueryContext.js.map +1 -1
  6. package/dist/src/GherkinQueryContext.d.ts +1 -2
  7. package/dist/src/GherkinQueryContext.d.ts.map +1 -1
  8. package/dist/src/GherkinQueryContext.js +2 -2
  9. package/dist/src/GherkinQueryContext.js.map +1 -1
  10. package/dist/src/SearchContext.d.ts +11 -5
  11. package/dist/src/SearchContext.d.ts.map +1 -1
  12. package/dist/src/SearchContext.js +4 -2
  13. package/dist/src/SearchContext.js.map +1 -1
  14. package/dist/src/ciCommitLink.d.ts +1 -1
  15. package/dist/src/ciCommitLink.d.ts.map +1 -1
  16. package/dist/src/ciCommitLink.js +1 -1
  17. package/dist/src/ciCommitLink.js.map +1 -1
  18. package/dist/src/components/app/CICommitLink.d.ts +2 -2
  19. package/dist/src/components/app/CICommitLink.d.ts.map +1 -1
  20. package/dist/src/components/app/CICommitLink.js +3 -8
  21. package/dist/src/components/app/CICommitLink.js.map +1 -1
  22. package/dist/src/components/app/CIJobLink.d.ts +2 -2
  23. package/dist/src/components/app/CIJobLink.d.ts.map +1 -1
  24. package/dist/src/components/app/CIJobLink.js +3 -7
  25. package/dist/src/components/app/CIJobLink.js.map +1 -1
  26. package/dist/src/components/app/ControlledSearchProvider.d.ts +2 -2
  27. package/dist/src/components/app/ControlledSearchProvider.d.ts.map +1 -1
  28. package/dist/src/components/app/ControlledSearchProvider.js +24 -2
  29. package/dist/src/components/app/ControlledSearchProvider.js.map +1 -1
  30. package/dist/src/components/app/CopyButton.d.ts +2 -1
  31. package/dist/src/components/app/CopyButton.d.ts.map +1 -1
  32. package/dist/src/components/app/CopyButton.js +4 -4
  33. package/dist/src/components/app/CopyButton.js.map +1 -1
  34. package/dist/src/components/app/DocumentAccordion.d.ts +3 -3
  35. package/dist/src/components/app/DocumentAccordion.d.ts.map +1 -1
  36. package/dist/src/components/app/DocumentAccordion.js +12 -20
  37. package/dist/src/components/app/DocumentAccordion.js.map +1 -1
  38. package/dist/src/components/app/DocumentAccordion.module.scss +15 -7
  39. package/dist/src/components/app/EnvelopesProvider.d.ts +2 -2
  40. package/dist/src/components/app/EnvelopesProvider.d.ts.map +1 -1
  41. package/dist/src/components/app/EnvelopesProvider.js +3 -2
  42. package/dist/src/components/app/EnvelopesProvider.js.map +1 -1
  43. package/dist/src/components/app/ExecutionSummary.d.ts +1 -1
  44. package/dist/src/components/app/ExecutionSummary.d.ts.map +1 -1
  45. package/dist/src/components/app/ExecutionSummary.js +3 -49
  46. package/dist/src/components/app/ExecutionSummary.js.map +1 -1
  47. package/dist/src/components/app/FilteredDocuments.d.ts +1 -1
  48. package/dist/src/components/app/FilteredDocuments.d.ts.map +1 -1
  49. package/dist/src/components/app/FilteredDocuments.js +4 -4
  50. package/dist/src/components/app/FilteredDocuments.js.map +1 -1
  51. package/dist/src/components/app/GherkinDocumentList.d.ts +3 -3
  52. package/dist/src/components/app/GherkinDocumentList.d.ts.map +1 -1
  53. package/dist/src/components/app/GherkinDocumentList.js +8 -9
  54. package/dist/src/components/app/GherkinDocumentList.js.map +1 -1
  55. package/dist/src/components/app/Header.d.ts +1 -1
  56. package/dist/src/components/app/Header.d.ts.map +1 -1
  57. package/dist/src/components/app/Header.js +4 -4
  58. package/dist/src/components/app/Header.js.map +1 -1
  59. package/dist/src/components/app/HealthChart.d.ts +1 -1
  60. package/dist/src/components/app/HealthChart.d.ts.map +1 -1
  61. package/dist/src/components/app/HealthChart.js +6 -7
  62. package/dist/src/components/app/HealthChart.js.map +1 -1
  63. package/dist/src/components/app/HighLight.d.ts +2 -2
  64. package/dist/src/components/app/HighLight.d.ts.map +1 -1
  65. package/dist/src/components/app/HighLight.js +15 -9
  66. package/dist/src/components/app/HighLight.js.map +1 -1
  67. package/dist/src/components/app/ImplementationIcon.d.ts +2 -2
  68. package/dist/src/components/app/ImplementationIcon.d.ts.map +1 -1
  69. package/dist/src/components/app/ImplementationIcon.js +2 -2
  70. package/dist/src/components/app/ImplementationIcon.js.map +1 -1
  71. package/dist/src/components/app/InMemorySearchProvider.d.ts +2 -2
  72. package/dist/src/components/app/InMemorySearchProvider.d.ts.map +1 -1
  73. package/dist/src/components/app/InMemorySearchProvider.js +3 -2
  74. package/dist/src/components/app/InMemorySearchProvider.js.map +1 -1
  75. package/dist/src/components/app/NavigationButton.d.ts +1 -1
  76. package/dist/src/components/app/NavigationButton.d.ts.map +1 -1
  77. package/dist/src/components/app/NavigationButton.js +2 -2
  78. package/dist/src/components/app/NavigationButton.js.map +1 -1
  79. package/dist/src/components/app/OSIcon.d.ts +2 -2
  80. package/dist/src/components/app/OSIcon.d.ts.map +1 -1
  81. package/dist/src/components/app/OSIcon.js +4 -4
  82. package/dist/src/components/app/OSIcon.js.map +1 -1
  83. package/dist/src/components/app/QueriesProvider.d.ts +3 -3
  84. package/dist/src/components/app/QueriesProvider.d.ts.map +1 -1
  85. package/dist/src/components/app/QueriesProvider.js +4 -3
  86. package/dist/src/components/app/QueriesProvider.js.map +1 -1
  87. package/dist/src/components/app/Report.d.ts +1 -1
  88. package/dist/src/components/app/Report.d.ts.map +1 -1
  89. package/dist/src/components/app/Report.js +2 -11
  90. package/dist/src/components/app/Report.js.map +1 -1
  91. package/dist/src/components/app/RuntimeIcon.d.ts +2 -2
  92. package/dist/src/components/app/RuntimeIcon.d.ts.map +1 -1
  93. package/dist/src/components/app/RuntimeIcon.js +4 -4
  94. package/dist/src/components/app/RuntimeIcon.js.map +1 -1
  95. package/dist/src/components/app/SearchBar.d.ts +1 -1
  96. package/dist/src/components/app/SearchBar.d.ts.map +1 -1
  97. package/dist/src/components/app/SearchBar.js +9 -24
  98. package/dist/src/components/app/SearchBar.js.map +1 -1
  99. package/dist/src/components/app/StatusesSummary.d.ts +1 -1
  100. package/dist/src/components/app/StatusesSummary.d.ts.map +1 -1
  101. package/dist/src/components/app/StatusesSummary.js +8 -11
  102. package/dist/src/components/app/StatusesSummary.js.map +1 -1
  103. package/dist/src/components/app/TestRunHooks.d.ts +1 -1
  104. package/dist/src/components/app/TestRunHooks.d.ts.map +1 -1
  105. package/dist/src/components/app/TestRunHooks.js +5 -5
  106. package/dist/src/components/app/TestRunHooks.js.map +1 -1
  107. package/dist/src/components/app/UrlSearchProvider.d.ts +1 -1
  108. package/dist/src/components/app/UrlSearchProvider.d.ts.map +1 -1
  109. package/dist/src/components/app/UrlSearchProvider.js +6 -3
  110. package/dist/src/components/app/UrlSearchProvider.js.map +1 -1
  111. package/dist/src/components/app/icons/CucumberLogo.d.ts +1 -1
  112. package/dist/src/components/app/icons/CucumberLogo.d.ts.map +1 -1
  113. package/dist/src/components/app/icons/CucumberLogo.js +2 -6
  114. package/dist/src/components/app/icons/CucumberLogo.js.map +1 -1
  115. package/dist/src/components/app/icons/Jvm.d.ts +1 -1
  116. package/dist/src/components/app/icons/Jvm.d.ts.map +1 -1
  117. package/dist/src/components/app/icons/Jvm.js +2 -7
  118. package/dist/src/components/app/icons/Jvm.js.map +1 -1
  119. package/dist/src/components/app/icons/Linux.d.ts +1 -1
  120. package/dist/src/components/app/icons/Linux.d.ts.map +1 -1
  121. package/dist/src/components/app/icons/Linux.js +2 -17
  122. package/dist/src/components/app/icons/Linux.js.map +1 -1
  123. package/dist/src/components/app/icons/MacOS.d.ts +1 -1
  124. package/dist/src/components/app/icons/MacOS.d.ts.map +1 -1
  125. package/dist/src/components/app/icons/MacOS.js +2 -3
  126. package/dist/src/components/app/icons/MacOS.js.map +1 -1
  127. package/dist/src/components/app/icons/NodeJs.d.ts +1 -1
  128. package/dist/src/components/app/icons/NodeJs.d.ts.map +1 -1
  129. package/dist/src/components/app/icons/NodeJs.js +2 -5
  130. package/dist/src/components/app/icons/NodeJs.js.map +1 -1
  131. package/dist/src/components/app/icons/Ruby.d.ts +1 -1
  132. package/dist/src/components/app/icons/Ruby.d.ts.map +1 -1
  133. package/dist/src/components/app/icons/Ruby.js +2 -3
  134. package/dist/src/components/app/icons/Ruby.js.map +1 -1
  135. package/dist/src/components/app/icons/Windows.d.ts +1 -1
  136. package/dist/src/components/app/icons/Windows.d.ts.map +1 -1
  137. package/dist/src/components/app/icons/Windows.js +2 -3
  138. package/dist/src/components/app/icons/Windows.js.map +1 -1
  139. package/dist/src/components/app/makeSetupString.d.ts +1 -1
  140. package/dist/src/components/app/makeSetupString.d.ts.map +1 -1
  141. package/dist/src/components/app/makeSetupString.js.map +1 -1
  142. package/dist/src/components/app/markdownComponents.d.ts +9 -0
  143. package/dist/src/components/app/markdownComponents.d.ts.map +1 -0
  144. package/dist/src/components/app/markdownComponents.js +6 -0
  145. package/dist/src/components/app/markdownComponents.js.map +1 -0
  146. package/dist/src/components/app/rehypePlugins.d.ts +2 -2
  147. package/dist/src/components/app/rehypePlugins.d.ts.map +1 -1
  148. package/dist/src/components/app/rehypePlugins.js.map +1 -1
  149. package/dist/src/components/app/remarkPlugins.d.ts +2 -2
  150. package/dist/src/components/app/remarkPlugins.d.ts.map +1 -1
  151. package/dist/src/components/app/remarkPlugins.js.map +1 -1
  152. package/dist/src/components/customise/CustomRendering.d.ts +18 -18
  153. package/dist/src/components/customise/CustomRendering.d.ts.map +1 -1
  154. package/dist/src/components/customise/CustomRendering.js +10 -9
  155. package/dist/src/components/customise/CustomRendering.js.map +1 -1
  156. package/dist/src/components/customise/CustomRendering.stories.scss +0 -17
  157. package/dist/src/components/gherkin/Anchor.d.ts +3 -3
  158. package/dist/src/components/gherkin/Anchor.d.ts.map +1 -1
  159. package/dist/src/components/gherkin/Anchor.js +3 -6
  160. package/dist/src/components/gherkin/Anchor.js.map +1 -1
  161. package/dist/src/components/gherkin/Background.d.ts +3 -3
  162. package/dist/src/components/gherkin/Background.d.ts.map +1 -1
  163. package/dist/src/components/gherkin/Background.js +4 -10
  164. package/dist/src/components/gherkin/Background.js.map +1 -1
  165. package/dist/src/components/gherkin/Children.d.ts +3 -3
  166. package/dist/src/components/gherkin/Children.d.ts.map +1 -1
  167. package/dist/src/components/gherkin/Children.js +3 -3
  168. package/dist/src/components/gherkin/Children.js.map +1 -1
  169. package/dist/src/components/gherkin/DataTable.d.ts +3 -3
  170. package/dist/src/components/gherkin/DataTable.d.ts.map +1 -1
  171. package/dist/src/components/gherkin/DataTable.js +4 -6
  172. package/dist/src/components/gherkin/DataTable.js.map +1 -1
  173. package/dist/src/components/gherkin/Description.d.ts +3 -3
  174. package/dist/src/components/gherkin/Description.d.ts.map +1 -1
  175. package/dist/src/components/gherkin/Description.js +3 -4
  176. package/dist/src/components/gherkin/Description.js.map +1 -1
  177. package/dist/src/components/gherkin/DocString.d.ts +3 -3
  178. package/dist/src/components/gherkin/DocString.d.ts.map +1 -1
  179. package/dist/src/components/gherkin/DocString.js +3 -4
  180. package/dist/src/components/gherkin/DocString.js.map +1 -1
  181. package/dist/src/components/gherkin/ErrorMessage.d.ts +2 -2
  182. package/dist/src/components/gherkin/ErrorMessage.d.ts.map +1 -1
  183. package/dist/src/components/gherkin/ErrorMessage.js +5 -3
  184. package/dist/src/components/gherkin/ErrorMessage.js.map +1 -1
  185. package/dist/src/components/gherkin/ErrorMessage.module.scss +17 -5
  186. package/dist/src/components/gherkin/Examples.d.ts +3 -3
  187. package/dist/src/components/gherkin/Examples.d.ts.map +1 -1
  188. package/dist/src/components/gherkin/Examples.js +7 -18
  189. package/dist/src/components/gherkin/Examples.js.map +1 -1
  190. package/dist/src/components/gherkin/Feature.d.ts +3 -3
  191. package/dist/src/components/gherkin/Feature.d.ts.map +1 -1
  192. package/dist/src/components/gherkin/Feature.js +14 -24
  193. package/dist/src/components/gherkin/Feature.js.map +1 -1
  194. package/dist/src/components/gherkin/GherkinDocument.d.ts +3 -3
  195. package/dist/src/components/gherkin/GherkinDocument.d.ts.map +1 -1
  196. package/dist/src/components/gherkin/GherkinDocument.js +3 -3
  197. package/dist/src/components/gherkin/GherkinDocument.js.map +1 -1
  198. package/dist/src/components/gherkin/Keyword.d.ts +2 -2
  199. package/dist/src/components/gherkin/Keyword.d.ts.map +1 -1
  200. package/dist/src/components/gherkin/Keyword.js +3 -3
  201. package/dist/src/components/gherkin/Keyword.js.map +1 -1
  202. package/dist/src/components/gherkin/Keyword.module.scss +0 -1
  203. package/dist/src/components/gherkin/Parameter.d.ts +3 -3
  204. package/dist/src/components/gherkin/Parameter.d.ts.map +1 -1
  205. package/dist/src/components/gherkin/Parameter.js +4 -4
  206. package/dist/src/components/gherkin/Parameter.js.map +1 -1
  207. package/dist/src/components/gherkin/Rule.d.ts +3 -3
  208. package/dist/src/components/gherkin/Rule.d.ts.map +1 -1
  209. package/dist/src/components/gherkin/Rule.js +11 -21
  210. package/dist/src/components/gherkin/Rule.js.map +1 -1
  211. package/dist/src/components/gherkin/Scenario.d.ts +3 -3
  212. package/dist/src/components/gherkin/Scenario.d.ts.map +1 -1
  213. package/dist/src/components/gherkin/Scenario.js +5 -14
  214. package/dist/src/components/gherkin/Scenario.js.map +1 -1
  215. package/dist/src/components/gherkin/StatusIcon.d.ts +2 -2
  216. package/dist/src/components/gherkin/StatusIcon.d.ts.map +1 -1
  217. package/dist/src/components/gherkin/StatusIcon.js +10 -10
  218. package/dist/src/components/gherkin/StatusIcon.js.map +1 -1
  219. package/dist/src/components/gherkin/StepsList.d.ts +1 -1
  220. package/dist/src/components/gherkin/StepsList.d.ts.map +1 -1
  221. package/dist/src/components/gherkin/StepsList.js +2 -2
  222. package/dist/src/components/gherkin/StepsList.js.map +1 -1
  223. package/dist/src/components/gherkin/Tags.d.ts +3 -3
  224. package/dist/src/components/gherkin/Tags.d.ts.map +1 -1
  225. package/dist/src/components/gherkin/Tags.js +4 -5
  226. package/dist/src/components/gherkin/Tags.js.map +1 -1
  227. package/dist/src/components/gherkin/Title.d.ts +3 -3
  228. package/dist/src/components/gherkin/Title.d.ts.map +1 -1
  229. package/dist/src/components/gherkin/Title.js +3 -4
  230. package/dist/src/components/gherkin/Title.js.map +1 -1
  231. package/dist/src/components/gherkin/attachment/Attachment.d.ts +3 -3
  232. package/dist/src/components/gherkin/attachment/Attachment.d.ts.map +1 -1
  233. package/dist/src/components/gherkin/attachment/Attachment.js +14 -17
  234. package/dist/src/components/gherkin/attachment/Attachment.js.map +1 -1
  235. package/dist/src/components/gherkin/attachment/Attachment.module.scss +15 -5
  236. package/dist/src/components/gherkin/attachment/Image.d.ts +4 -4
  237. package/dist/src/components/gherkin/attachment/Image.d.ts.map +1 -1
  238. package/dist/src/components/gherkin/attachment/Image.js +6 -8
  239. package/dist/src/components/gherkin/attachment/Image.js.map +1 -1
  240. package/dist/src/components/gherkin/attachment/Links.d.ts +3 -3
  241. package/dist/src/components/gherkin/attachment/Links.d.ts.map +1 -1
  242. package/dist/src/components/gherkin/attachment/Links.js +7 -10
  243. package/dist/src/components/gherkin/attachment/Links.js.map +1 -1
  244. package/dist/src/components/gherkin/attachment/Log.d.ts +3 -3
  245. package/dist/src/components/gherkin/attachment/Log.d.ts.map +1 -1
  246. package/dist/src/components/gherkin/attachment/Log.js +3 -3
  247. package/dist/src/components/gherkin/attachment/Log.js.map +1 -1
  248. package/dist/src/components/gherkin/attachment/Text.d.ts +3 -3
  249. package/dist/src/components/gherkin/attachment/Text.d.ts.map +1 -1
  250. package/dist/src/components/gherkin/attachment/Text.js +4 -6
  251. package/dist/src/components/gherkin/attachment/Text.js.map +1 -1
  252. package/dist/src/components/gherkin/attachment/Unknown.d.ts +2 -2
  253. package/dist/src/components/gherkin/attachment/Unknown.d.ts.map +1 -1
  254. package/dist/src/components/gherkin/attachment/Unknown.js +9 -17
  255. package/dist/src/components/gherkin/attachment/Unknown.js.map +1 -1
  256. package/dist/src/components/gherkin/attachment/Video.d.ts +3 -3
  257. package/dist/src/components/gherkin/attachment/Video.d.ts.map +1 -1
  258. package/dist/src/components/gherkin/attachment/Video.js +6 -10
  259. package/dist/src/components/gherkin/attachment/Video.js.map +1 -1
  260. package/dist/src/components/gherkin/attachment/attachmentFilename.d.ts +1 -1
  261. package/dist/src/components/gherkin/attachment/attachmentFilename.d.ts.map +1 -1
  262. package/dist/src/components/gherkin/attachment/attachmentFilename.js.map +1 -1
  263. package/dist/src/components/gherkin/attachment/base64Decode.d.ts +9 -1
  264. package/dist/src/components/gherkin/attachment/base64Decode.d.ts.map +1 -1
  265. package/dist/src/components/gherkin/attachment/base64Decode.js +17 -3
  266. package/dist/src/components/gherkin/attachment/base64Decode.js.map +1 -1
  267. package/dist/src/components/gherkin/attachment/useText.d.ts +1 -1
  268. package/dist/src/components/gherkin/attachment/useText.d.ts.map +1 -1
  269. package/dist/src/components/gherkin/attachment/useText.js +3 -3
  270. package/dist/src/components/gherkin/attachment/useText.js.map +1 -1
  271. package/dist/src/components/gherkin/composeHookStepTitle.d.ts +1 -1
  272. package/dist/src/components/gherkin/composeHookStepTitle.d.ts.map +1 -1
  273. package/dist/src/components/gherkin/composeHookStepTitle.js +1 -1
  274. package/dist/src/components/gherkin/composeHookStepTitle.js.map +1 -1
  275. package/dist/src/components/gherkin/composePickleStepTitle.d.ts +1 -1
  276. package/dist/src/components/gherkin/composePickleStepTitle.d.ts.map +1 -1
  277. package/dist/src/components/gherkin/composePickleStepTitle.js +2 -2
  278. package/dist/src/components/gherkin/composePickleStepTitle.js.map +1 -1
  279. package/dist/src/components/gherkin/statusName.d.ts +2 -2
  280. package/dist/src/components/gherkin/statusName.d.ts.map +1 -1
  281. package/dist/src/components/gherkin/statusName.js.map +1 -1
  282. package/dist/src/components/results/AmbiguousResult.d.ts +8 -0
  283. package/dist/src/components/results/AmbiguousResult.d.ts.map +1 -0
  284. package/dist/src/components/results/AmbiguousResult.js +11 -0
  285. package/dist/src/components/results/AmbiguousResult.js.map +1 -0
  286. package/dist/src/components/results/AmbiguousResult.module.scss +22 -0
  287. package/dist/src/components/results/FailedResult.d.ts +8 -0
  288. package/dist/src/components/results/FailedResult.d.ts.map +1 -0
  289. package/dist/src/components/results/FailedResult.js +15 -0
  290. package/dist/src/components/results/FailedResult.js.map +1 -0
  291. package/dist/src/components/results/PendingResult.d.ts +8 -0
  292. package/dist/src/components/results/PendingResult.d.ts.map +1 -0
  293. package/dist/src/components/results/PendingResult.js +12 -0
  294. package/dist/src/components/results/PendingResult.js.map +1 -0
  295. package/dist/src/components/results/ResultNote.d.ts +3 -0
  296. package/dist/src/components/results/ResultNote.d.ts.map +1 -0
  297. package/dist/src/components/results/ResultNote.js +6 -0
  298. package/dist/src/components/results/ResultNote.js.map +1 -0
  299. package/dist/src/components/results/ResultNote.module.scss +6 -0
  300. package/dist/src/components/results/SkippedResult.d.ts +8 -0
  301. package/dist/src/components/results/SkippedResult.d.ts.map +1 -0
  302. package/dist/src/components/results/SkippedResult.js +12 -0
  303. package/dist/src/components/results/SkippedResult.js.map +1 -0
  304. package/dist/src/components/results/SourceReference.d.ts +8 -0
  305. package/dist/src/components/results/SourceReference.d.ts.map +1 -0
  306. package/dist/src/components/results/SourceReference.js +13 -0
  307. package/dist/src/components/results/SourceReference.js.map +1 -0
  308. package/dist/src/components/results/SourceReference.module.scss +10 -0
  309. package/dist/src/components/results/TestCaseOutcome.d.ts +2 -2
  310. package/dist/src/components/results/TestCaseOutcome.d.ts.map +1 -1
  311. package/dist/src/components/results/TestCaseOutcome.js +5 -9
  312. package/dist/src/components/results/TestCaseOutcome.js.map +1 -1
  313. package/dist/src/components/results/TestRunHookOutcome.d.ts +2 -2
  314. package/dist/src/components/results/TestRunHookOutcome.d.ts.map +1 -1
  315. package/dist/src/components/results/TestRunHookOutcome.js +4 -13
  316. package/dist/src/components/results/TestRunHookOutcome.js.map +1 -1
  317. package/dist/src/components/results/TestStepAttachments.d.ts +2 -2
  318. package/dist/src/components/results/TestStepAttachments.d.ts.map +1 -1
  319. package/dist/src/components/results/TestStepAttachments.js +4 -5
  320. package/dist/src/components/results/TestStepAttachments.js.map +1 -1
  321. package/dist/src/components/results/TestStepDuration.d.ts +2 -2
  322. package/dist/src/components/results/TestStepDuration.d.ts.map +1 -1
  323. package/dist/src/components/results/TestStepDuration.js +4 -2
  324. package/dist/src/components/results/TestStepDuration.js.map +1 -1
  325. package/dist/src/components/results/TestStepOutcome.d.ts +2 -2
  326. package/dist/src/components/results/TestStepOutcome.d.ts.map +1 -1
  327. package/dist/src/components/results/TestStepOutcome.js +18 -27
  328. package/dist/src/components/results/TestStepOutcome.js.map +1 -1
  329. package/dist/src/components/results/TestStepOutcome.module.scss +1 -1
  330. package/dist/src/components/results/UndefinedResult.d.ts +8 -0
  331. package/dist/src/components/results/UndefinedResult.d.ts.map +1 -0
  332. package/dist/src/components/results/UndefinedResult.js +18 -0
  333. package/dist/src/components/results/UndefinedResult.js.map +1 -0
  334. package/dist/src/components/results/UndefinedResult.module.scss +14 -0
  335. package/dist/src/components/results/index.d.ts +1 -1
  336. package/dist/src/components/results/index.d.ts.map +1 -1
  337. package/dist/src/components/results/index.js +1 -1
  338. package/dist/src/components/results/index.js.map +1 -1
  339. package/dist/src/formatExecutionDuration.js.map +1 -1
  340. package/dist/src/hooks/helpers.js.map +1 -1
  341. package/dist/src/hooks/useFilteredDocuments.d.ts +2 -2
  342. package/dist/src/hooks/useFilteredDocuments.d.ts.map +1 -1
  343. package/dist/src/hooks/useFilteredDocuments.js +70 -34
  344. package/dist/src/hooks/useFilteredDocuments.js.map +1 -1
  345. package/dist/src/hooks/useMostSevereStatusByUri.js.map +1 -1
  346. package/dist/src/hooks/useQueries.d.ts +2 -2
  347. package/dist/src/hooks/useQueries.d.ts.map +1 -1
  348. package/dist/src/hooks/useQueries.js.map +1 -1
  349. package/dist/src/hooks/useResultStatistics.d.ts +1 -1
  350. package/dist/src/hooks/useResultStatistics.d.ts.map +1 -1
  351. package/dist/src/hooks/useResultStatistics.js.map +1 -1
  352. package/dist/src/hooks/useSearch.d.ts +1 -1
  353. package/dist/src/hooks/useSearch.d.ts.map +1 -1
  354. package/dist/src/hooks/useSearch.js.map +1 -1
  355. package/dist/src/hooks/useTestCaseStarted.d.ts +6 -1
  356. package/dist/src/hooks/useTestCaseStarted.d.ts.map +1 -1
  357. package/dist/src/hooks/useTestCaseStarted.js +13 -10
  358. package/dist/src/hooks/useTestCaseStarted.js.map +1 -1
  359. package/dist/src/hooks/useTestRunHooks.d.ts +1 -1
  360. package/dist/src/hooks/useTestRunHooks.d.ts.map +1 -1
  361. package/dist/src/hooks/useTestRunHooks.js.map +1 -1
  362. package/dist/src/search/FeatureSearch.d.ts +12 -3
  363. package/dist/src/search/FeatureSearch.d.ts.map +1 -1
  364. package/dist/src/search/FeatureSearch.js +9 -17
  365. package/dist/src/search/FeatureSearch.js.map +1 -1
  366. package/dist/src/search/ScenarioLikeSearch.d.ts +8 -13
  367. package/dist/src/search/ScenarioLikeSearch.d.ts.map +1 -1
  368. package/dist/src/search/ScenarioLikeSearch.js +13 -17
  369. package/dist/src/search/ScenarioLikeSearch.js.map +1 -1
  370. package/dist/src/search/StepSearch.d.ts +9 -16
  371. package/dist/src/search/StepSearch.d.ts.map +1 -1
  372. package/dist/src/search/StepSearch.js +13 -17
  373. package/dist/src/search/StepSearch.js.map +1 -1
  374. package/dist/src/search/TextSearch.d.ts +11 -2
  375. package/dist/src/search/TextSearch.d.ts.map +1 -1
  376. package/dist/src/search/TextSearch.js +59 -52
  377. package/dist/src/search/TextSearch.js.map +1 -1
  378. package/dist/src/search/createSearchIndex.d.ts +7 -0
  379. package/dist/src/search/createSearchIndex.d.ts.map +1 -0
  380. package/dist/src/search/createSearchIndex.js +10 -0
  381. package/dist/src/search/createSearchIndex.js.map +1 -0
  382. package/dist/src/search/deriveLineageConstraints.d.ts +8 -0
  383. package/dist/src/search/deriveLineageConstraints.d.ts.map +1 -0
  384. package/dist/src/search/deriveLineageConstraints.js +38 -0
  385. package/dist/src/search/deriveLineageConstraints.js.map +1 -0
  386. package/dist/src/search/index.d.ts +3 -1
  387. package/dist/src/search/index.d.ts.map +1 -1
  388. package/dist/src/search/index.js +3 -1
  389. package/dist/src/search/index.js.map +1 -1
  390. package/dist/src/search/pruneGherkinDocuments.d.ts +24 -0
  391. package/dist/src/search/pruneGherkinDocuments.d.ts.map +1 -0
  392. package/dist/src/search/pruneGherkinDocuments.js +180 -0
  393. package/dist/src/search/pruneGherkinDocuments.js.map +1 -0
  394. package/dist/src/search/types.d.ts +39 -8
  395. package/dist/src/search/types.d.ts.map +1 -1
  396. package/dist/src/search/types.js +1 -1
  397. package/dist/src/search/types.js.map +1 -1
  398. package/dist/src/toRepositoryId.d.ts +1 -1
  399. package/dist/src/toRepositoryId.d.ts.map +1 -1
  400. package/dist/src/toRepositoryId.js +7 -6
  401. package/dist/src/toRepositoryId.js.map +1 -1
  402. package/dist/tsconfig.build.tsbuildinfo +1 -1
  403. package/package.json +56 -69
  404. package/dist/src/components/results/TestStepResultDetails.d.ts +0 -4
  405. package/dist/src/components/results/TestStepResultDetails.d.ts.map +0 -1
  406. package/dist/src/components/results/TestStepResultDetails.js +0 -16
  407. package/dist/src/components/results/TestStepResultDetails.js.map +0 -1
  408. package/dist/src/search/Search.d.ts +0 -11
  409. package/dist/src/search/Search.d.ts.map +0 -1
  410. package/dist/src/search/Search.js +0 -51
  411. package/dist/src/search/Search.js.map +0 -1
  412. package/dist/src/search/TagSearch.d.ts +0 -4
  413. package/dist/src/search/TagSearch.d.ts.map +0 -1
  414. package/dist/src/search/TagSearch.js +0 -57
  415. package/dist/src/search/TagSearch.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/search/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,cAAc,YAAY,CAAA","sourcesContent":["export { createSearch } from './Search.js'\nexport * from './types.js'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/search/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,YAAY,CAAA","sourcesContent":["export * from './createSearchIndex.js'\nexport * from './deriveLineageConstraints.js'\nexport * from './pruneGherkinDocuments.js'\nexport * from './types.js'\n"]}
@@ -0,0 +1,24 @@
1
+ import type { GherkinDocument } from '@cucumber/messages';
2
+ import type { LineageConstraints, SearchHits } from './types.js';
3
+ /**
4
+ * Returns abridged copies of the given documents, with lineage constraints and search hits used
5
+ * to filter out nodes that shouldn't be shown
6
+ *
7
+ * @param gherkinDocuments - the original documents to prune
8
+ * @param constraints - the set of AST node IDs to retain, derived from pickle lineage
9
+ * @param searchHits - if provided, further narrows results to nodes matching a search query
10
+ *
11
+ * @remarks
12
+ * The two filtering mechanisms behave a little differently.
13
+ *
14
+ * `lineageConstraints` are strictly enforced at every level - any node of the covered types must
15
+ * have its id included otherwise it will be filtered off. This check is performed eagerly at every
16
+ * level so for e.g. a Rule that isn't matched, we won't even look at its child Scenarios.
17
+ *
18
+ * `searchHits` has cascading behaviour - a match at a higher level (Feature, Rule, or Background)
19
+ * ensures all of its descendants will be retained, and a match at a lower level (Scenario, Step)
20
+ * ensures all of its ascendants (but not siblings) will be retained. A `false` value means there
21
+ * were no hits at all, so no documents will be returned.
22
+ */
23
+ export declare function pruneGherkinDocuments(gherkinDocuments: ReadonlyArray<GherkinDocument>, constraints: LineageConstraints, searchHits?: SearchHits | false): ReadonlyArray<GherkinDocument>;
24
+ //# sourceMappingURL=pruneGherkinDocuments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pruneGherkinDocuments.d.ts","sourceRoot":"","sources":["../../../src/search/pruneGherkinDocuments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAKV,eAAe,EAMhB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAsB,kBAAkB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEpF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,qBAAqB,CACnC,gBAAgB,EAAE,aAAa,CAAC,eAAe,CAAC,EAChD,WAAW,EAAE,kBAAkB,EAC/B,UAAU,CAAC,EAAE,UAAU,GAAG,KAAK,GAC9B,aAAa,CAAC,eAAe,CAAC,CAsBhC"}
@@ -0,0 +1,180 @@
1
+ /**
2
+ * Returns abridged copies of the given documents, with lineage constraints and search hits used
3
+ * to filter out nodes that shouldn't be shown
4
+ *
5
+ * @param gherkinDocuments - the original documents to prune
6
+ * @param constraints - the set of AST node IDs to retain, derived from pickle lineage
7
+ * @param searchHits - if provided, further narrows results to nodes matching a search query
8
+ *
9
+ * @remarks
10
+ * The two filtering mechanisms behave a little differently.
11
+ *
12
+ * `lineageConstraints` are strictly enforced at every level - any node of the covered types must
13
+ * have its id included otherwise it will be filtered off. This check is performed eagerly at every
14
+ * level so for e.g. a Rule that isn't matched, we won't even look at its child Scenarios.
15
+ *
16
+ * `searchHits` has cascading behaviour - a match at a higher level (Feature, Rule, or Background)
17
+ * ensures all of its descendants will be retained, and a match at a lower level (Scenario, Step)
18
+ * ensures all of its ascendants (but not siblings) will be retained. A `false` value means there
19
+ * were no hits at all, so no documents will be returned.
20
+ */
21
+ export function pruneGherkinDocuments(gherkinDocuments, constraints, searchHits) {
22
+ if (searchHits === false) {
23
+ return [];
24
+ }
25
+ const results = [];
26
+ for (const gherkinDocument of gherkinDocuments) {
27
+ if (!gherkinDocument.uri) {
28
+ continue;
29
+ }
30
+ if (!constraints.gherkinDocument.has(gherkinDocument.uri)) {
31
+ continue;
32
+ }
33
+ const documentHits = searchHits?.get(gherkinDocument.uri);
34
+ if (searchHits && !documentHits) {
35
+ continue;
36
+ }
37
+ const pruned = pruneGherkinDocument(gherkinDocument, constraints, documentHits);
38
+ if (pruned) {
39
+ results.push(pruned);
40
+ }
41
+ }
42
+ return results;
43
+ }
44
+ function pruneGherkinDocument(gherkinDocument, constraints, searchHits) {
45
+ if (searchHits?.feature) {
46
+ searchHits = undefined;
47
+ }
48
+ const feature = filterFeature(gherkinDocument.feature, constraints, searchHits);
49
+ if (feature) {
50
+ return {
51
+ ...gherkinDocument,
52
+ feature,
53
+ };
54
+ }
55
+ }
56
+ function filterFeature(feature, constraints, searchHits) {
57
+ if (!feature) {
58
+ return undefined;
59
+ }
60
+ if (searchHits && matchesOnBackground(feature.children, searchHits)) {
61
+ searchHits = undefined;
62
+ }
63
+ const children = feature.children
64
+ .map((child) => filterFeatureChild(child, constraints, searchHits))
65
+ .filter((child) => !!child);
66
+ if (children.some((child) => !child.background)) {
67
+ return {
68
+ ...feature,
69
+ children,
70
+ };
71
+ }
72
+ }
73
+ function filterFeatureChild(child, constraints, searchHits) {
74
+ if (child.background) {
75
+ const background = filterBackground(child.background, constraints);
76
+ if (background) {
77
+ return {
78
+ background,
79
+ };
80
+ }
81
+ }
82
+ if (child.scenario) {
83
+ const scenario = filterScenario(child.scenario, constraints, searchHits);
84
+ if (scenario) {
85
+ return {
86
+ scenario,
87
+ };
88
+ }
89
+ }
90
+ if (child.rule) {
91
+ const rule = filterRule(child.rule, constraints, searchHits);
92
+ if (rule) {
93
+ return {
94
+ rule,
95
+ };
96
+ }
97
+ }
98
+ return undefined;
99
+ }
100
+ function filterBackground(background, constraints) {
101
+ return constraints.background.has(background.id) ? background : undefined;
102
+ }
103
+ function filterRule(rule, constraints, searchHits) {
104
+ if (!constraints.rule.has(rule.id)) {
105
+ return undefined;
106
+ }
107
+ if (searchHits &&
108
+ (searchHits.rule.includes(rule.id) || matchesOnBackground(rule.children, searchHits))) {
109
+ searchHits = undefined;
110
+ }
111
+ const children = rule.children
112
+ .map((child) => filterRuleChild(child, constraints, searchHits))
113
+ .filter((child) => !!child);
114
+ if (children.some((child) => !child.background)) {
115
+ return {
116
+ ...rule,
117
+ children,
118
+ };
119
+ }
120
+ }
121
+ function filterRuleChild(child, constraints, searchHits) {
122
+ if (child.background) {
123
+ const background = filterBackground(child.background, constraints);
124
+ if (background) {
125
+ return {
126
+ background,
127
+ };
128
+ }
129
+ }
130
+ if (child.scenario) {
131
+ const scenario = filterScenario(child.scenario, constraints, searchHits);
132
+ if (scenario) {
133
+ return {
134
+ scenario,
135
+ };
136
+ }
137
+ }
138
+ return undefined;
139
+ }
140
+ function filterScenario(scenario, constraints, searchHits) {
141
+ if (!constraints.scenario.has(scenario.id)) {
142
+ return undefined;
143
+ }
144
+ if (searchHits &&
145
+ !searchHits.scenario.includes(scenario.id) &&
146
+ !matchesOnSteps(scenario.steps, searchHits)) {
147
+ return undefined;
148
+ }
149
+ return {
150
+ ...scenario,
151
+ examples: scenario.examples
152
+ .map((examples) => filterExamplesTable(examples, constraints))
153
+ .filter((examples) => !!examples),
154
+ };
155
+ }
156
+ function filterExamplesTable(examples, constraints) {
157
+ if (!constraints.examples.has(examples.id)) {
158
+ return undefined;
159
+ }
160
+ return {
161
+ ...examples,
162
+ tableBody: examples.tableBody
163
+ .map((row) => filterExampleRow(row, constraints))
164
+ .filter((row) => !!row),
165
+ };
166
+ }
167
+ function filterExampleRow(row, constraints) {
168
+ return constraints.example.has(row.id) ? row : undefined;
169
+ }
170
+ function matchesOnBackground(children, searchHits) {
171
+ return children
172
+ .map((child) => child.background)
173
+ .filter((background) => !!background)
174
+ .some((background) => searchHits.background.includes(background.id) ||
175
+ matchesOnSteps(background.steps, searchHits));
176
+ }
177
+ function matchesOnSteps(steps, searchHits) {
178
+ return steps.some((step) => searchHits.step.includes(step.id));
179
+ }
180
+ //# sourceMappingURL=pruneGherkinDocuments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pruneGherkinDocuments.js","sourceRoot":"","sources":["../../../src/search/pruneGherkinDocuments.ts"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,qBAAqB,CACnC,gBAAgD,EAChD,WAA+B,EAC/B,UAA+B;IAE/B,IAAI,UAAU,KAAK,KAAK,EAAE,CAAC;QACzB,OAAO,EAAE,CAAA;IACX,CAAC;IACD,MAAM,OAAO,GAAsB,EAAE,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AAC;KAC1B,CAAA;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,GAAa,EAAE,WAA+B;IACtE,OAAO,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAA;AAC1D,CAAC;AAED,SAAS,mBAAmB,CAC1B,QAAkC,EAClC,UAA8B;IAE9B,OAAO,QAAQ;SACZ,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC;SAChC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;SACpC,IAAI,CACH,CAAC,UAAU,EAAE,EAAE,CACb,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QAC7C,cAAc,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,CAC/C,CAAA;AACL,CAAC;AAED,SAAS,cAAc,CAAC,KAA0B,EAAE,UAA8B;IAChF,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;AAChE,CAAC","sourcesContent":["import type {\n Background,\n Examples,\n Feature,\n FeatureChild,\n GherkinDocument,\n Rule,\n RuleChild,\n Scenario,\n Step,\n TableRow,\n} from '@cucumber/messages'\nimport type { DocumentSearchHits, LineageConstraints, SearchHits } from './types.js'\n\n/**\n * Returns abridged copies of the given documents, with lineage constraints and search hits used\n * to filter out nodes that shouldn't be shown\n *\n * @param gherkinDocuments - the original documents to prune\n * @param constraints - the set of AST node IDs to retain, derived from pickle lineage\n * @param searchHits - if provided, further narrows results to nodes matching a search query\n *\n * @remarks\n * The two filtering mechanisms behave a little differently.\n *\n * `lineageConstraints` are strictly enforced at every level - any node of the covered types must\n * have its id included otherwise it will be filtered off. This check is performed eagerly at every\n * level so for e.g. a Rule that isn't matched, we won't even look at its child Scenarios.\n *\n * `searchHits` has cascading behaviour - a match at a higher level (Feature, Rule, or Background)\n * ensures all of its descendants will be retained, and a match at a lower level (Scenario, Step)\n * ensures all of its ascendants (but not siblings) will be retained. A `false` value means there\n * were no hits at all, so no documents will be returned.\n */\nexport function pruneGherkinDocuments(\n gherkinDocuments: ReadonlyArray<GherkinDocument>,\n constraints: LineageConstraints,\n searchHits?: SearchHits | false\n): ReadonlyArray<GherkinDocument> {\n if (searchHits === false) {\n return []\n }\n const results: GherkinDocument[] = []\n for (const gherkinDocument of gherkinDocuments) {\n if (!gherkinDocument.uri) {\n continue\n }\n if (!constraints.gherkinDocument.has(gherkinDocument.uri)) {\n continue\n }\n const documentHits = searchHits?.get(gherkinDocument.uri)\n if (searchHits && !documentHits) {\n continue\n }\n const pruned = pruneGherkinDocument(gherkinDocument, constraints, documentHits)\n if (pruned) {\n results.push(pruned)\n }\n }\n return results\n}\n\nfunction pruneGherkinDocument(\n gherkinDocument: GherkinDocument,\n constraints: LineageConstraints,\n searchHits?: DocumentSearchHits\n): GherkinDocument | undefined {\n if (searchHits?.feature) {\n searchHits = undefined\n }\n\n const feature = filterFeature(gherkinDocument.feature, constraints, searchHits)\n if (feature) {\n return {\n ...gherkinDocument,\n feature,\n }\n }\n}\n\nfunction filterFeature(\n feature: Feature | undefined,\n constraints: LineageConstraints,\n searchHits?: DocumentSearchHits\n): Feature | undefined {\n if (!feature) {\n return undefined\n }\n\n if (searchHits && matchesOnBackground(feature.children, searchHits)) {\n searchHits = undefined\n }\n\n const children = feature.children\n .map((child) => filterFeatureChild(child, constraints, searchHits))\n .filter((child) => !!child)\n\n if (children.some((child) => !child.background)) {\n return {\n ...feature,\n children,\n }\n }\n}\n\nfunction filterFeatureChild(\n child: FeatureChild,\n constraints: LineageConstraints,\n searchHits?: DocumentSearchHits\n): FeatureChild | undefined {\n if (child.background) {\n const background = filterBackground(child.background, constraints)\n if (background) {\n return {\n background,\n }\n }\n }\n if (child.scenario) {\n const scenario = filterScenario(child.scenario, constraints, searchHits)\n if (scenario) {\n return {\n scenario,\n }\n }\n }\n if (child.rule) {\n const rule = filterRule(child.rule, constraints, searchHits)\n if (rule) {\n return {\n rule,\n }\n }\n }\n return undefined\n}\n\nfunction filterBackground(background: Background, constraints: LineageConstraints) {\n return constraints.background.has(background.id) ? background : undefined\n}\n\nfunction filterRule(\n rule: Rule,\n constraints: LineageConstraints,\n searchHits?: DocumentSearchHits\n): Rule | undefined {\n if (!constraints.rule.has(rule.id)) {\n return undefined\n }\n\n if (\n searchHits &&\n (searchHits.rule.includes(rule.id) || matchesOnBackground(rule.children, searchHits))\n ) {\n searchHits = undefined\n }\n\n const children = rule.children\n .map((child) => filterRuleChild(child, constraints, searchHits))\n .filter((child) => !!child)\n\n if (children.some((child) => !child.background)) {\n return {\n ...rule,\n children,\n }\n }\n}\n\nfunction filterRuleChild(\n child: RuleChild,\n constraints: LineageConstraints,\n searchHits?: DocumentSearchHits\n): RuleChild | undefined {\n if (child.background) {\n const background = filterBackground(child.background, constraints)\n if (background) {\n return {\n background,\n }\n }\n }\n if (child.scenario) {\n const scenario = filterScenario(child.scenario, constraints, searchHits)\n if (scenario) {\n return {\n scenario,\n }\n }\n }\n return undefined\n}\n\nfunction filterScenario(\n scenario: Scenario,\n constraints: LineageConstraints,\n searchHits?: DocumentSearchHits\n): Scenario | undefined {\n if (!constraints.scenario.has(scenario.id)) {\n return undefined\n }\n if (\n searchHits &&\n !searchHits.scenario.includes(scenario.id) &&\n !matchesOnSteps(scenario.steps, searchHits)\n ) {\n return undefined\n }\n return {\n ...scenario,\n examples: scenario.examples\n .map((examples) => filterExamplesTable(examples, constraints))\n .filter((examples) => !!examples),\n }\n}\n\nfunction filterExamplesTable(\n examples: Examples,\n constraints: LineageConstraints\n): Examples | undefined {\n if (!constraints.examples.has(examples.id)) {\n return undefined\n }\n return {\n ...examples,\n tableBody: examples.tableBody\n .map((row) => filterExampleRow(row, constraints))\n .filter((row) => !!row),\n }\n}\n\nfunction filterExampleRow(row: TableRow, constraints: LineageConstraints): TableRow | undefined {\n return constraints.example.has(row.id) ? row : undefined\n}\n\nfunction matchesOnBackground(\n children: ReadonlyArray<RuleChild>,\n searchHits: DocumentSearchHits\n): boolean {\n return children\n .map((child) => child.background)\n .filter((background) => !!background)\n .some(\n (background) =>\n searchHits.background.includes(background.id) ||\n matchesOnSteps(background.steps, searchHits)\n )\n}\n\nfunction matchesOnSteps(steps: ReadonlyArray<Step>, searchHits: DocumentSearchHits): boolean {\n return steps.some((step) => searchHits.step.includes(step.id))\n}\n"]}
@@ -1,14 +1,45 @@
1
- import { GherkinDocument } from '@cucumber/messages';
1
+ export declare const ID_SEPARATOR = "\0";
2
+ export interface IndexHit {
3
+ uri: string;
4
+ id: string;
5
+ }
6
+ /**
7
+ * Facade for an index that supports adding items of a given type and returning hits as an array
8
+ * of uri/id pairs
9
+ */
10
+ export interface TypedIndex<SourceType = unknown> {
11
+ search: (query: string) => Promise<ReadonlyArray<IndexHit>>;
12
+ add: (item: SourceType, uri: string) => Promise<this>;
13
+ }
2
14
  /**
3
- * Facade for an index that supports searching for and adding items of a given
4
- * type. Also supports a different type being added if needed.
15
+ * Interface for the top-level document search index
5
16
  */
6
- export interface TypedIndex<ReturnedType, SourceType = ReturnedType> {
7
- search: (query: string) => Promise<readonly ReturnedType[]>;
8
- add: (item: SourceType) => Promise<this>;
17
+ export interface SearchIndex {
18
+ search: (query: string) => Promise<SearchHits | false>;
9
19
  }
10
20
  /**
11
- * Shorthand type for an index of Gherkin documents.
21
+ * Collection of Gherkin node ids that matched a search term for a single document, grouped by
22
+ * node type
12
23
  */
13
- export type Searchable = TypedIndex<GherkinDocument>;
24
+ export interface DocumentSearchHits {
25
+ feature: boolean;
26
+ background: Array<string>;
27
+ rule: Array<string>;
28
+ scenario: Array<string>;
29
+ step: Array<string>;
30
+ }
31
+ export type SearchHits = ReadonlyMap<string, DocumentSearchHits>;
32
+ /**
33
+ * Collection of Gherkin node ids harvested from executed test cases, grouped by node type
34
+ * @remarks
35
+ * In the case of `gherkinDocument`, the values are URIs
36
+ */
37
+ export interface LineageConstraints {
38
+ gherkinDocument: ReadonlySet<string>;
39
+ background: ReadonlySet<string>;
40
+ rule: ReadonlySet<string>;
41
+ scenario: ReadonlySet<string>;
42
+ examples: ReadonlySet<string>;
43
+ example: ReadonlySet<string>;
44
+ }
14
45
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/search/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAEpD;;;GAGG;AACH,MAAM,WAAW,UAAU,CAAC,YAAY,EAAE,UAAU,GAAG,YAAY;IACjE,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,YAAY,EAAE,CAAC,CAAA;IAC3D,GAAG,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACzC;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,eAAe,CAAC,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/search/types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,OAAO,CAAA;AAEhC,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAA;IACX,EAAE,EAAE,MAAM,CAAA;CACX;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU,CAAC,UAAU,GAAG,OAAO;IAC9C,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAA;IAC3D,GAAG,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACtD;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,GAAG,KAAK,CAAC,CAAA;CACvD;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACzB,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACnB,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACvB,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CACpB;AAED,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAA;AAEhE;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IACpC,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC/B,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IACzB,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC7B,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC7B,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAC7B"}
@@ -1,2 +1,2 @@
1
- export {};
1
+ export const ID_SEPARATOR = '\0';
2
2
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/search/types.ts"],"names":[],"mappings":"","sourcesContent":["import { GherkinDocument } from '@cucumber/messages'\n\n/**\n * Facade for an index that supports searching for and adding items of a given\n * type. Also supports a different type being added if needed.\n */\nexport interface TypedIndex<ReturnedType, SourceType = ReturnedType> {\n search: (query: string) => Promise<readonly ReturnedType[]>\n add: (item: SourceType) => Promise<this>\n}\n\n/**\n * Shorthand type for an index of Gherkin documents.\n */\nexport type Searchable = TypedIndex<GherkinDocument>\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/search/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAA","sourcesContent":["export const ID_SEPARATOR = '\\0'\n\nexport interface IndexHit {\n uri: string\n id: string\n}\n\n/**\n * Facade for an index that supports adding items of a given type and returning hits as an array\n * of uri/id pairs\n */\nexport interface TypedIndex<SourceType = unknown> {\n search: (query: string) => Promise<ReadonlyArray<IndexHit>>\n add: (item: SourceType, uri: string) => Promise<this>\n}\n\n/**\n * Interface for the top-level document search index\n */\nexport interface SearchIndex {\n search: (query: string) => Promise<SearchHits | false>\n}\n\n/**\n * Collection of Gherkin node ids that matched a search term for a single document, grouped by\n * node type\n */\nexport interface DocumentSearchHits {\n feature: boolean\n background: Array<string>\n rule: Array<string>\n scenario: Array<string>\n step: Array<string>\n}\n\nexport type SearchHits = ReadonlyMap<string, DocumentSearchHits>\n\n/**\n * Collection of Gherkin node ids harvested from executed test cases, grouped by node type\n * @remarks\n * In the case of `gherkinDocument`, the values are URIs\n */\nexport interface LineageConstraints {\n gherkinDocument: ReadonlySet<string>\n background: ReadonlySet<string>\n rule: ReadonlySet<string>\n scenario: ReadonlySet<string>\n examples: ReadonlySet<string>\n example: ReadonlySet<string>\n}\n"]}
@@ -1,2 +1,2 @@
1
- export default function toRepositoryId(s: string): string;
1
+ export default function toRepositoryId(remote: string): string;
2
2
  //# sourceMappingURL=toRepositoryId.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toRepositoryId.d.ts","sourceRoot":"","sources":["../../src/toRepositoryId.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CASxD"}
1
+ {"version":3,"file":"toRepositoryId.d.ts","sourceRoot":"","sources":["../../src/toRepositoryId.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAU7D"}
@@ -1,11 +1,12 @@
1
- export default function toRepositoryId(s) {
2
- if (!s.includes('://') && s.includes(':')) {
1
+ export default function toRepositoryId(remote) {
2
+ let result = remote;
3
+ if (!remote.includes('://') && remote.includes(':')) {
3
4
  // scp style URL (not really a URL)
4
- const [host, path] = s.split(':', 2);
5
- s = `ssh://${host}/${path}`;
5
+ const [host, path] = remote.split(':', 2);
6
+ result = `ssh://${host}/${path}`;
6
7
  }
7
- s = s.replace(/\.git$/, '');
8
- const url = new URL(s);
8
+ result = result.replace(/\.git$/, '');
9
+ const url = new URL(result);
9
10
  return `${url.hostname}${url.pathname}`;
10
11
  }
11
12
  //# sourceMappingURL=toRepositoryId.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toRepositoryId.js","sourceRoot":"","sources":["../../src/toRepositoryId.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAS;IAC9C,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACzC,mCAAmC;QACnC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;QACpC,CAAC,GAAG,SAAS,IAAI,IAAI,IAAI,EAAE,CAAA;KAC5B;IACD,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;IAC3B,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAA;IACtB,OAAO,GAAG,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAA;AACzC,CAAC","sourcesContent":["export default function toRepositoryId(s: string): string {\n if (!s.includes('://') && s.includes(':')) {\n // scp style URL (not really a URL)\n const [host, path] = s.split(':', 2)\n s = `ssh://${host}/${path}`\n }\n s = s.replace(/\\.git$/, '')\n const url = new URL(s)\n return `${url.hostname}${url.pathname}`\n}\n"]}
1
+ {"version":3,"file":"toRepositoryId.js","sourceRoot":"","sources":["../../src/toRepositoryId.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,MAAc;IACnD,IAAI,MAAM,GAAG,MAAM,CAAA;IACnB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACpD,mCAAmC;QACnC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;QACzC,MAAM,GAAG,SAAS,IAAI,IAAI,IAAI,EAAE,CAAA;IAClC,CAAC;IACD,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;IACrC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAA;IAC3B,OAAO,GAAG,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAA;AACzC,CAAC","sourcesContent":["export default function toRepositoryId(remote: string): string {\n let result = remote\n if (!remote.includes('://') && remote.includes(':')) {\n // scp style URL (not really a URL)\n const [host, path] = remote.split(':', 2)\n result = `ssh://${host}/${path}`\n }\n result = result.replace(/\\.git$/, '')\n const url = new URL(result)\n return `${url.hostname}${url.pathname}`\n}\n"]}