@cucumber/react-components 24.1.2 → 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 (425) 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 -18
  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 +3 -2
  350. package/dist/src/hooks/useResultStatistics.d.ts.map +1 -1
  351. package/dist/src/hooks/useResultStatistics.js +19 -2
  352. package/dist/src/hooks/useResultStatistics.js.map +1 -1
  353. package/dist/src/hooks/useSearch.d.ts +1 -1
  354. package/dist/src/hooks/useSearch.d.ts.map +1 -1
  355. package/dist/src/hooks/useSearch.js.map +1 -1
  356. package/dist/src/hooks/useTestCaseStarted.d.ts +6 -1
  357. package/dist/src/hooks/useTestCaseStarted.d.ts.map +1 -1
  358. package/dist/src/hooks/useTestCaseStarted.js +13 -10
  359. package/dist/src/hooks/useTestCaseStarted.js.map +1 -1
  360. package/dist/src/hooks/useTestRunHooks.d.ts +1 -1
  361. package/dist/src/hooks/useTestRunHooks.d.ts.map +1 -1
  362. package/dist/src/hooks/useTestRunHooks.js.map +1 -1
  363. package/dist/src/search/FeatureSearch.d.ts +12 -3
  364. package/dist/src/search/FeatureSearch.d.ts.map +1 -1
  365. package/dist/src/search/FeatureSearch.js +9 -17
  366. package/dist/src/search/FeatureSearch.js.map +1 -1
  367. package/dist/src/search/ScenarioLikeSearch.d.ts +8 -13
  368. package/dist/src/search/ScenarioLikeSearch.d.ts.map +1 -1
  369. package/dist/src/search/ScenarioLikeSearch.js +13 -17
  370. package/dist/src/search/ScenarioLikeSearch.js.map +1 -1
  371. package/dist/src/search/StepSearch.d.ts +9 -16
  372. package/dist/src/search/StepSearch.d.ts.map +1 -1
  373. package/dist/src/search/StepSearch.js +13 -17
  374. package/dist/src/search/StepSearch.js.map +1 -1
  375. package/dist/src/search/TextSearch.d.ts +11 -2
  376. package/dist/src/search/TextSearch.d.ts.map +1 -1
  377. package/dist/src/search/TextSearch.js +59 -52
  378. package/dist/src/search/TextSearch.js.map +1 -1
  379. package/dist/src/search/createSearchIndex.d.ts +7 -0
  380. package/dist/src/search/createSearchIndex.d.ts.map +1 -0
  381. package/dist/src/search/createSearchIndex.js +10 -0
  382. package/dist/src/search/createSearchIndex.js.map +1 -0
  383. package/dist/src/search/deriveLineageConstraints.d.ts +8 -0
  384. package/dist/src/search/deriveLineageConstraints.d.ts.map +1 -0
  385. package/dist/src/search/deriveLineageConstraints.js +38 -0
  386. package/dist/src/search/deriveLineageConstraints.js.map +1 -0
  387. package/dist/src/search/index.d.ts +3 -1
  388. package/dist/src/search/index.d.ts.map +1 -1
  389. package/dist/src/search/index.js +3 -1
  390. package/dist/src/search/index.js.map +1 -1
  391. package/dist/src/search/pruneGherkinDocuments.d.ts +24 -0
  392. package/dist/src/search/pruneGherkinDocuments.d.ts.map +1 -0
  393. package/dist/src/search/pruneGherkinDocuments.js +180 -0
  394. package/dist/src/search/pruneGherkinDocuments.js.map +1 -0
  395. package/dist/src/search/types.d.ts +39 -8
  396. package/dist/src/search/types.d.ts.map +1 -1
  397. package/dist/src/search/types.js +1 -1
  398. package/dist/src/search/types.js.map +1 -1
  399. package/dist/src/styles/statuses.scss +7 -13
  400. package/dist/src/toRepositoryId.d.ts +1 -1
  401. package/dist/src/toRepositoryId.d.ts.map +1 -1
  402. package/dist/src/toRepositoryId.js +7 -6
  403. package/dist/src/toRepositoryId.js.map +1 -1
  404. package/dist/tsconfig.build.tsbuildinfo +1 -1
  405. package/package.json +56 -71
  406. package/dist/src/components/results/TestStepResultDetails.d.ts +0 -4
  407. package/dist/src/components/results/TestStepResultDetails.d.ts.map +0 -1
  408. package/dist/src/components/results/TestStepResultDetails.js +0 -16
  409. package/dist/src/components/results/TestStepResultDetails.js.map +0 -1
  410. package/dist/src/countScenariosByStatuses.d.ts +0 -8
  411. package/dist/src/countScenariosByStatuses.d.ts.map +0 -1
  412. package/dist/src/countScenariosByStatuses.js +0 -22
  413. package/dist/src/countScenariosByStatuses.js.map +0 -1
  414. package/dist/src/filter/filterByStatus.d.ts +0 -5
  415. package/dist/src/filter/filterByStatus.d.ts.map +0 -1
  416. package/dist/src/filter/filterByStatus.js +0 -23
  417. package/dist/src/filter/filterByStatus.js.map +0 -1
  418. package/dist/src/search/Search.d.ts +0 -11
  419. package/dist/src/search/Search.d.ts.map +0 -1
  420. package/dist/src/search/Search.js +0 -46
  421. package/dist/src/search/Search.js.map +0 -1
  422. package/dist/src/search/TagSearch.d.ts +0 -4
  423. package/dist/src/search/TagSearch.d.ts.map +0 -1
  424. package/dist/src/search/TagSearch.js +0 -57
  425. package/dist/src/search/TagSearch.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { ErrorBoundary } from 'react-error-boundary';
3
3
  import { useCustomRendering, } from '../../customise/index.js';
4
4
  import { ErrorMessage } from '../ErrorMessage.js';
@@ -11,31 +11,28 @@ import { Unknown } from './Unknown.js';
11
11
  import { Video } from './Video.js';
12
12
  const DefaultRenderer = ({ attachment, styles, }) => {
13
13
  if (attachment.mediaType.match(/^image\//)) {
14
- return React.createElement(Image, { attachment: attachment, classes: styles });
14
+ return _jsx(Image, { attachment: attachment, classes: styles });
15
15
  }
16
- else if (attachment.mediaType.match(/^video\//)) {
17
- return React.createElement(Video, { attachment: attachment });
16
+ if (attachment.mediaType.match(/^video\//)) {
17
+ return _jsx(Video, { attachment: attachment });
18
18
  }
19
- else if (attachment.mediaType == 'text/x.cucumber.log+plain') {
20
- return React.createElement(Log, { attachment: attachment, classes: styles });
19
+ if (attachment.mediaType === 'text/x.cucumber.log+plain') {
20
+ return _jsx(Log, { attachment: attachment, classes: styles });
21
21
  }
22
- else if (attachment.mediaType == 'text/uri-list') {
23
- return React.createElement(Links, { attachment: attachment, classes: styles });
22
+ if (attachment.mediaType === 'text/uri-list') {
23
+ return _jsx(Links, { attachment: attachment, classes: styles });
24
24
  }
25
- else if (attachment.mediaType.match(/^text\//)) {
26
- return React.createElement(Text, { attachment: attachment, classes: styles });
25
+ if (attachment.mediaType.match(/^text\//)) {
26
+ return _jsx(Text, { attachment: attachment, classes: styles });
27
27
  }
28
- else if (attachment.mediaType.match(/^application\/json/)) {
29
- return React.createElement(Text, { attachment: attachment, prettify: prettyJSON, classes: styles });
30
- }
31
- else {
32
- return React.createElement(Unknown, { attachment: attachment });
28
+ if (attachment.mediaType.match(/^application\/json/)) {
29
+ return _jsx(Text, { attachment: attachment, prettify: prettyJSON, classes: styles });
33
30
  }
31
+ return _jsx(Unknown, { attachment: attachment });
34
32
  };
35
33
  export const Attachment = (props) => {
36
34
  const ResolvedRenderer = useCustomRendering('Attachment', defaultStyles, DefaultRenderer);
37
- return (React.createElement(ErrorBoundary, { fallback: React.createElement(ErrorMessage, { message: `Attachment couldn't be rendered` }) },
38
- React.createElement(ResolvedRenderer, { ...props })));
35
+ return (_jsx(ErrorBoundary, { fallback: _jsx(ErrorMessage, { message: `Attachment couldn't be rendered` }), children: _jsx(ResolvedRenderer, { ...props }) }));
39
36
  };
40
37
  function prettyJSON(s) {
41
38
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"Attachment.js","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/Attachment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD,OAAO,EAIL,kBAAkB,GACnB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,aAAa,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,MAAM,eAAe,GAAyD,CAAC,EAC7E,UAAU,EACV,MAAM,GACP,EAAE,EAAE;IACH,IAAI,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE;QAC1C,OAAO,oBAAC,KAAK,IAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAI,CAAA;KAC1D;SAAM,IAAI,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE;QACjD,OAAO,oBAAC,KAAK,IAAC,UAAU,EAAE,UAAU,GAAI,CAAA;KACzC;SAAM,IAAI,UAAU,CAAC,SAAS,IAAI,2BAA2B,EAAE;QAC9D,OAAO,oBAAC,GAAG,IAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAI,CAAA;KACxD;SAAM,IAAI,UAAU,CAAC,SAAS,IAAI,eAAe,EAAE;QAClD,OAAO,oBAAC,KAAK,IAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAI,CAAA;KAC1D;SAAM,IAAI,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE;QAChD,OAAO,oBAAC,IAAI,IAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAI,CAAA;KACzD;SAAM,IAAI,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,oBAAoB,CAAC,EAAE;QAC3D,OAAO,oBAAC,IAAI,IAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAI,CAAA;KAC/E;SAAM;QACL,OAAO,oBAAC,OAAO,IAAC,UAAU,EAAE,UAAU,GAAI,CAAA;KAC3C;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAA6C,CAAC,KAAK,EAAE,EAAE;IAC5E,MAAM,gBAAgB,GAAG,kBAAkB,CACzC,YAAY,EACZ,aAAa,EACb,eAAe,CAChB,CAAA;IACD,OAAO,CACL,oBAAC,aAAa,IAAC,QAAQ,EAAE,oBAAC,YAAY,IAAC,OAAO,EAAE,iCAAiC,GAAI;QACnF,oBAAC,gBAAgB,OAAK,KAAK,GAAI,CACjB,CACjB,CAAA;AACH,CAAC,CAAA;AAED,SAAS,UAAU,CAAC,CAAS;IAC3B,IAAI;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;KAC9C;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,CAAA;KACT;AACH,CAAC","sourcesContent":["import React from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\n\nimport {\n AttachmentClasses,\n AttachmentProps,\n DefaultComponent,\n useCustomRendering,\n} from '../../customise/index.js'\nimport { ErrorMessage } from '../ErrorMessage.js'\nimport defaultStyles from './Attachment.module.scss'\nimport { Image } from './Image.js'\nimport { Links } from './Links.js'\nimport { Log } from './Log.js'\nimport { Text } from './Text.js'\nimport { Unknown } from './Unknown.js'\nimport { Video } from './Video.js'\n\nconst DefaultRenderer: DefaultComponent<AttachmentProps, AttachmentClasses> = ({\n attachment,\n styles,\n}) => {\n if (attachment.mediaType.match(/^image\\//)) {\n return <Image attachment={attachment} classes={styles} />\n } else if (attachment.mediaType.match(/^video\\//)) {\n return <Video attachment={attachment} />\n } else if (attachment.mediaType == 'text/x.cucumber.log+plain') {\n return <Log attachment={attachment} classes={styles} />\n } else if (attachment.mediaType == 'text/uri-list') {\n return <Links attachment={attachment} classes={styles} />\n } else if (attachment.mediaType.match(/^text\\//)) {\n return <Text attachment={attachment} classes={styles} />\n } else if (attachment.mediaType.match(/^application\\/json/)) {\n return <Text attachment={attachment} prettify={prettyJSON} classes={styles} />\n } else {\n return <Unknown attachment={attachment} />\n }\n}\n\nexport const Attachment: React.FunctionComponent<AttachmentProps> = (props) => {\n const ResolvedRenderer = useCustomRendering<AttachmentProps, AttachmentClasses>(\n 'Attachment',\n defaultStyles,\n DefaultRenderer\n )\n return (\n <ErrorBoundary fallback={<ErrorMessage message={`Attachment couldn't be rendered`} />}>\n <ResolvedRenderer {...props} />\n </ErrorBoundary>\n )\n}\n\nfunction prettyJSON(s: string) {\n try {\n return JSON.stringify(JSON.parse(s), null, 2)\n } catch (_) {\n return s\n }\n}\n"]}
1
+ {"version":3,"file":"Attachment.js","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/Attachment.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD,OAAO,EAIL,kBAAkB,GACnB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,aAAa,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,MAAM,eAAe,GAAyD,CAAC,EAC7E,UAAU,EACV,MAAM,GACP,EAAE,EAAE;IACH,IAAI,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;QAC3C,OAAO,KAAC,KAAK,IAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAI,CAAA;IAC3D,CAAC;IACD,IAAI,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;QAC3C,OAAO,KAAC,KAAK,IAAC,UAAU,EAAE,UAAU,GAAI,CAAA;IAC1C,CAAC;IACD,IAAI,UAAU,CAAC,SAAS,KAAK,2BAA2B,EAAE,CAAC;QACzD,OAAO,KAAC,GAAG,IAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAI,CAAA;IACzD,CAAC;IACD,IAAI,UAAU,CAAC,SAAS,KAAK,eAAe,EAAE,CAAC;QAC7C,OAAO,KAAC,KAAK,IAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAI,CAAA;IAC3D,CAAC;IACD,IAAI,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC;QAC1C,OAAO,KAAC,IAAI,IAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAI,CAAA;IAC1D,CAAC;IACD,IAAI,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,oBAAoB,CAAC,EAAE,CAAC;QACrD,OAAO,KAAC,IAAI,IAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAI,CAAA;IAChF,CAAC;IACD,OAAO,KAAC,OAAO,IAAC,UAAU,EAAE,UAAU,GAAI,CAAA;AAC5C,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAwB,CAAC,KAAK,EAAE,EAAE;IACvD,MAAM,gBAAgB,GAAG,kBAAkB,CACzC,YAAY,EACZ,aAAa,EACb,eAAe,CAChB,CAAA;IACD,OAAO,CACL,KAAC,aAAa,IAAC,QAAQ,EAAE,KAAC,YAAY,IAAC,OAAO,EAAE,iCAAiC,GAAI,YACnF,KAAC,gBAAgB,OAAK,KAAK,GAAI,GACjB,CACjB,CAAA;AACH,CAAC,CAAA;AAED,SAAS,UAAU,CAAC,CAAS;IAC3B,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IAC/C,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,CAAA;IACV,CAAC;AACH,CAAC","sourcesContent":["import type { FC } from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\n\nimport {\n type AttachmentClasses,\n type AttachmentProps,\n type DefaultComponent,\n useCustomRendering,\n} from '../../customise/index.js'\nimport { ErrorMessage } from '../ErrorMessage.js'\nimport defaultStyles from './Attachment.module.scss'\nimport { Image } from './Image.js'\nimport { Links } from './Links.js'\nimport { Log } from './Log.js'\nimport { Text } from './Text.js'\nimport { Unknown } from './Unknown.js'\nimport { Video } from './Video.js'\n\nconst DefaultRenderer: DefaultComponent<AttachmentProps, AttachmentClasses> = ({\n attachment,\n styles,\n}) => {\n if (attachment.mediaType.match(/^image\\//)) {\n return <Image attachment={attachment} classes={styles} />\n }\n if (attachment.mediaType.match(/^video\\//)) {\n return <Video attachment={attachment} />\n }\n if (attachment.mediaType === 'text/x.cucumber.log+plain') {\n return <Log attachment={attachment} classes={styles} />\n }\n if (attachment.mediaType === 'text/uri-list') {\n return <Links attachment={attachment} classes={styles} />\n }\n if (attachment.mediaType.match(/^text\\//)) {\n return <Text attachment={attachment} classes={styles} />\n }\n if (attachment.mediaType.match(/^application\\/json/)) {\n return <Text attachment={attachment} prettify={prettyJSON} classes={styles} />\n }\n return <Unknown attachment={attachment} />\n}\n\nexport const Attachment: FC<AttachmentProps> = (props) => {\n const ResolvedRenderer = useCustomRendering<AttachmentProps, AttachmentClasses>(\n 'Attachment',\n defaultStyles,\n DefaultRenderer\n )\n return (\n <ErrorBoundary fallback={<ErrorMessage message={`Attachment couldn't be rendered`} />}>\n <ResolvedRenderer {...props} />\n </ErrorBoundary>\n )\n}\n\nfunction prettyJSON(s: string) {\n try {\n return JSON.stringify(JSON.parse(s), null, 2)\n } catch (_) {\n return s\n }\n}\n"]}
@@ -1,15 +1,25 @@
1
1
  @use '../../../styles/theming';
2
2
 
3
+ .copyButton {
4
+ position: absolute;
5
+ top: 0.5em;
6
+ right: 0.5em;
7
+ }
8
+
3
9
  .text {
4
10
  position: relative;
5
- white-space: pre-wrap;
6
- font-size: 0.875em;
7
- padding: 0.666em 0.75em;
8
- border-radius: 0.25em;
9
- margin: 0;
11
+ width: fit-content;
10
12
  overflow-x: auto;
11
13
  background-color: theming.$codeBackgroundColor;
12
14
  color: theming.$codeTextColor;
15
+
16
+ pre {
17
+ white-space: pre-wrap;
18
+ font-size: 0.875em;
19
+ padding: 0.666em 2.25em 0.666em 0.75em;
20
+ border-radius: 0.25em;
21
+ margin: 0;
22
+ }
13
23
  }
14
24
 
15
25
  .log {
@@ -1,8 +1,8 @@
1
- import * as messages from '@cucumber/messages';
2
- import { FC } from 'react';
3
- import { AttachmentClasses } from '../../customise/index.js';
1
+ import type { Attachment } from '@cucumber/messages';
2
+ import type { FC } from 'react';
3
+ import type { AttachmentClasses } from '../../customise/index.js';
4
4
  export declare const Image: FC<{
5
- attachment: messages.Attachment;
5
+ attachment: Attachment;
6
6
  classes: AttachmentClasses;
7
7
  }>;
8
8
  //# sourceMappingURL=Image.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAA;AAC9C,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAG5D,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC;IAAE,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC;IAAC,OAAO,EAAE,iBAAiB,CAAA;CAAE,CAsBrF,CAAA"}
1
+ {"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAGjE,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC;IAAE,UAAU,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,iBAAiB,CAAA;CAAE,CAsB5E,CAAA"}
@@ -1,18 +1,16 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { ErrorMessage } from '../ErrorMessage.js';
3
3
  export const Image = ({ attachment, classes, }) => {
4
- const title = attachment.fileName ?? 'Attached Image (' + attachment.mediaType + ')';
4
+ const title = attachment.fileName ?? `Attached Image (${attachment.mediaType})`;
5
5
  if (attachment.url) {
6
- return React.createElement(ImageInternal, { src: attachment.url, title: title, className: classes.image });
6
+ return _jsx(ImageInternal, { src: attachment.url, title: title, className: classes.image });
7
7
  }
8
8
  if (attachment.contentEncoding === 'BASE64') {
9
- return (React.createElement(ImageInternal, { src: `data:${attachment.mediaType};base64,${attachment.body}`, title: title, className: classes.image }));
9
+ return (_jsx(ImageInternal, { src: `data:${attachment.mediaType};base64,${attachment.body}`, title: title, className: classes.image }));
10
10
  }
11
- return (React.createElement(ErrorMessage, { message: `Couldn't display ${attachment.mediaType} image because it wasn't base64 encoded or externalised` }));
11
+ return (_jsx(ErrorMessage, { message: `Couldn't display ${attachment.mediaType} image because it wasn't base64 encoded or externalised` }));
12
12
  };
13
13
  const ImageInternal = ({ src, title, className }) => {
14
- return (React.createElement("details", null,
15
- React.createElement("summary", null, title),
16
- React.createElement("img", { alt: "", src: src, className: className })));
14
+ return (_jsxs("details", { children: [_jsx("summary", { children: title }), _jsx("img", { alt: "", src: src, className: className })] }));
17
15
  };
18
16
  //# sourceMappingURL=Image.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Image.js","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/Image.tsx"],"names":[],"mappings":"AACA,OAAO,KAAa,MAAM,OAAO,CAAA;AAGjC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEjD,MAAM,CAAC,MAAM,KAAK,GAAwE,CAAC,EACzF,UAAU,EACV,OAAO,GACR,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,UAAU,CAAC,QAAQ,IAAI,kBAAkB,GAAG,UAAU,CAAC,SAAS,GAAG,GAAG,CAAA;IACpF,IAAI,UAAU,CAAC,GAAG,EAAE;QAClB,OAAO,oBAAC,aAAa,IAAC,GAAG,EAAE,UAAU,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,KAAK,GAAI,CAAA;KACtF;IACD,IAAI,UAAU,CAAC,eAAe,KAAK,QAAQ,EAAE;QAC3C,OAAO,CACL,oBAAC,aAAa,IACZ,GAAG,EAAE,QAAQ,UAAU,CAAC,SAAS,WAAW,UAAU,CAAC,IAAI,EAAE,EAC7D,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,OAAO,CAAC,KAAK,GACxB,CACH,CAAA;KACF;IACD,OAAO,CACL,oBAAC,YAAY,IACX,OAAO,EAAE,oBAAoB,UAAU,CAAC,SAAS,yDAAyD,GAC1G,CACH,CAAA;AACH,CAAC,CAAA;AAED,MAAM,aAAa,GAId,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE;IACjC,OAAO,CACL;QACE,qCAAU,KAAK,CAAW;QAC1B,6BAAK,GAAG,EAAC,EAAE,EAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,GAAI,CACtC,CACX,CAAA;AACH,CAAC,CAAA","sourcesContent":["import * as messages from '@cucumber/messages'\nimport React, { FC } from 'react'\n\nimport { AttachmentClasses } from '../../customise/index.js'\nimport { ErrorMessage } from '../ErrorMessage.js'\n\nexport const Image: FC<{ attachment: messages.Attachment; classes: AttachmentClasses }> = ({\n attachment,\n classes,\n}) => {\n const title = attachment.fileName ?? 'Attached Image (' + attachment.mediaType + ')'\n if (attachment.url) {\n return <ImageInternal src={attachment.url} title={title} className={classes.image} />\n }\n if (attachment.contentEncoding === 'BASE64') {\n return (\n <ImageInternal\n src={`data:${attachment.mediaType};base64,${attachment.body}`}\n title={title}\n className={classes.image}\n />\n )\n }\n return (\n <ErrorMessage\n message={`Couldn't display ${attachment.mediaType} image because it wasn't base64 encoded or externalised`}\n />\n )\n}\n\nconst ImageInternal: FC<{\n src: string\n title: string\n className: string\n}> = ({ src, title, className }) => {\n return (\n <details>\n <summary>{title}</summary>\n <img alt=\"\" src={src} className={className} />\n </details>\n )\n}\n"]}
1
+ {"version":3,"file":"Image.js","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/Image.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEjD,MAAM,CAAC,MAAM,KAAK,GAA+D,CAAC,EAChF,UAAU,EACV,OAAO,GACR,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,UAAU,CAAC,QAAQ,IAAI,mBAAmB,UAAU,CAAC,SAAS,GAAG,CAAA;IAC/E,IAAI,UAAU,CAAC,GAAG,EAAE,CAAC;QACnB,OAAO,KAAC,aAAa,IAAC,GAAG,EAAE,UAAU,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,KAAK,GAAI,CAAA;IACvF,CAAC;IACD,IAAI,UAAU,CAAC,eAAe,KAAK,QAAQ,EAAE,CAAC;QAC5C,OAAO,CACL,KAAC,aAAa,IACZ,GAAG,EAAE,QAAQ,UAAU,CAAC,SAAS,WAAW,UAAU,CAAC,IAAI,EAAE,EAC7D,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,OAAO,CAAC,KAAK,GACxB,CACH,CAAA;IACH,CAAC;IACD,OAAO,CACL,KAAC,YAAY,IACX,OAAO,EAAE,oBAAoB,UAAU,CAAC,SAAS,yDAAyD,GAC1G,CACH,CAAA;AACH,CAAC,CAAA;AAED,MAAM,aAAa,GAId,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE;IACjC,OAAO,CACL,8BACE,4BAAU,KAAK,GAAW,EAC1B,cAAK,GAAG,EAAC,EAAE,EAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,GAAI,IACtC,CACX,CAAA;AACH,CAAC,CAAA","sourcesContent":["import type { Attachment } from '@cucumber/messages'\nimport type { FC } from 'react'\n\nimport type { AttachmentClasses } from '../../customise/index.js'\nimport { ErrorMessage } from '../ErrorMessage.js'\n\nexport const Image: FC<{ attachment: Attachment; classes: AttachmentClasses }> = ({\n attachment,\n classes,\n}) => {\n const title = attachment.fileName ?? `Attached Image (${attachment.mediaType})`\n if (attachment.url) {\n return <ImageInternal src={attachment.url} title={title} className={classes.image} />\n }\n if (attachment.contentEncoding === 'BASE64') {\n return (\n <ImageInternal\n src={`data:${attachment.mediaType};base64,${attachment.body}`}\n title={title}\n className={classes.image}\n />\n )\n }\n return (\n <ErrorMessage\n message={`Couldn't display ${attachment.mediaType} image because it wasn't base64 encoded or externalised`}\n />\n )\n}\n\nconst ImageInternal: FC<{\n src: string\n title: string\n className: string\n}> = ({ src, title, className }) => {\n return (\n <details>\n <summary>{title}</summary>\n <img alt=\"\" src={src} className={className} />\n </details>\n )\n}\n"]}
@@ -1,6 +1,6 @@
1
- import { Attachment } from '@cucumber/messages';
2
- import { FC } from 'react';
3
- import { AttachmentClasses } from '../../customise/index.js';
1
+ import type { Attachment } from '@cucumber/messages';
2
+ import type { FC } from 'react';
3
+ import type { AttachmentClasses } from '../../customise/index.js';
4
4
  export declare const Links: FC<{
5
5
  attachment: Attachment;
6
6
  classes: AttachmentClasses;
@@ -1 +1 @@
1
- {"version":3,"file":"Links.d.ts","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/Links.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAG/C,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAG5D,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC;IACrB,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,iBAAiB,CAAA;CAC3B,CAmBA,CAAA"}
1
+ {"version":3,"file":"Links.d.ts","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/Links.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAGpD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAGjE,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC;IACrB,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,iBAAiB,CAAA;CAC3B,CAmBA,CAAA"}
@@ -1,17 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import { faLink } from '@fortawesome/free-solid-svg-icons';
2
3
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
3
- import React from 'react';
4
4
  import { useText } from './useText.js';
5
5
  export const Links = ({ attachment, classes }) => {
6
6
  const { content } = useText(attachment);
7
- return (React.createElement("ul", { className: classes.links }, content
8
- .split('\n')
9
- .filter((line) => !!line)
10
- .map((line, index) => {
11
- return (React.createElement("li", { key: index },
12
- React.createElement("a", { href: line, target: "_blank", rel: "noreferrer" },
13
- React.createElement(FontAwesomeIcon, { icon: faLink }),
14
- line)));
15
- })));
7
+ return (_jsx("ul", { className: classes.links, children: content
8
+ .split('\n')
9
+ .filter((line) => !!line)
10
+ .map((line, index) => {
11
+ return (_jsx("li", { children: _jsxs("a", { href: line, target: "_blank", rel: "noopener nofollow noreferrer", children: [_jsx(FontAwesomeIcon, { icon: faLink }), line] }) }, index));
12
+ }) }));
16
13
  };
17
14
  //# sourceMappingURL=Links.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Links.js","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/Links.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,KAAa,MAAM,OAAO,CAAA;AAGjC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,MAAM,CAAC,MAAM,KAAK,GAGb,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,EAAE;IAC/B,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IACvC,OAAO,CACL,4BAAI,SAAS,EAAE,OAAO,CAAC,KAAK,IACzB,OAAO;SACL,KAAK,CAAC,IAAI,CAAC;SACX,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;SACxB,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QACnB,OAAO,CACL,4BAAI,GAAG,EAAE,KAAK;YACZ,2BAAG,IAAI,EAAE,IAAI,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,YAAY;gBAC7C,oBAAC,eAAe,IAAC,IAAI,EAAE,MAAM,GAAI;gBAChC,IAAI,CACH,CACD,CACN,CAAA;IACH,CAAC,CAAC,CACD,CACN,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { Attachment } from '@cucumber/messages'\nimport { faLink } from '@fortawesome/free-solid-svg-icons'\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\nimport React, { FC } from 'react'\n\nimport { AttachmentClasses } from '../../customise/index.js'\nimport { useText } from './useText.js'\n\nexport const Links: FC<{\n attachment: Attachment\n classes: AttachmentClasses\n}> = ({ attachment, classes }) => {\n const { content } = useText(attachment)\n return (\n <ul className={classes.links}>\n {content\n .split('\\n')\n .filter((line) => !!line)\n .map((line, index) => {\n return (\n <li key={index}>\n <a href={line} target=\"_blank\" rel=\"noreferrer\">\n <FontAwesomeIcon icon={faLink} />\n {line}\n </a>\n </li>\n )\n })}\n </ul>\n )\n}\n"]}
1
+ {"version":3,"file":"Links.js","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/Links.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAIhE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,MAAM,CAAC,MAAM,KAAK,GAGb,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,EAAE;IAC/B,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IACvC,OAAO,CACL,aAAI,SAAS,EAAE,OAAO,CAAC,KAAK,YACzB,OAAO;aACL,KAAK,CAAC,IAAI,CAAC;aACX,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;aACxB,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YACnB,OAAO,CACL,uBACE,aAAG,IAAI,EAAE,IAAI,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,8BAA8B,aAC/D,KAAC,eAAe,IAAC,IAAI,EAAE,MAAM,GAAI,EAChC,IAAI,IACH,IAJG,KAAK,CAKT,CACN,CAAA;QACH,CAAC,CAAC,GACD,CACN,CAAA;AACH,CAAC,CAAA","sourcesContent":["import type { Attachment } from '@cucumber/messages'\nimport { faLink } from '@fortawesome/free-solid-svg-icons'\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\nimport type { FC } from 'react'\n\nimport type { AttachmentClasses } from '../../customise/index.js'\nimport { useText } from './useText.js'\n\nexport const Links: FC<{\n attachment: Attachment\n classes: AttachmentClasses\n}> = ({ attachment, classes }) => {\n const { content } = useText(attachment)\n return (\n <ul className={classes.links}>\n {content\n .split('\\n')\n .filter((line) => !!line)\n .map((line, index) => {\n return (\n <li key={index}>\n <a href={line} target=\"_blank\" rel=\"noopener nofollow noreferrer\">\n <FontAwesomeIcon icon={faLink} />\n {line}\n </a>\n </li>\n )\n })}\n </ul>\n )\n}\n"]}
@@ -1,6 +1,6 @@
1
- import { Attachment } from '@cucumber/messages';
2
- import { FC } from 'react';
3
- import { AttachmentClasses } from '../../customise/index.js';
1
+ import type { Attachment } from '@cucumber/messages';
2
+ import type { FC } from 'react';
3
+ import type { AttachmentClasses } from '../../customise/index.js';
4
4
  export declare const Log: FC<{
5
5
  attachment: Attachment;
6
6
  classes: AttachmentClasses;
@@ -1 +1 @@
1
- {"version":3,"file":"Log.d.ts","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/Log.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAE/C,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAG5D,eAAO,MAAM,GAAG,EAAE,EAAE,CAAC;IACnB,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,iBAAiB,CAAA;CAC3B,CAOA,CAAA"}
1
+ {"version":3,"file":"Log.d.ts","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/Log.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAEpD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAGjE,eAAO,MAAM,GAAG,EAAE,EAAE,CAAC;IACnB,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,iBAAiB,CAAA;CAC3B,CAUA,CAAA"}
@@ -1,10 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import Convert from 'ansi-to-html';
2
- import React from 'react';
3
+ import { CopyButton } from '../../app/CopyButton.js';
3
4
  import { useText } from './useText.js';
4
5
  export const Log = ({ attachment, classes }) => {
5
6
  const { content } = useText(attachment);
6
- return (React.createElement("pre", { className: `${classes.text} ${classes.log}` },
7
- React.createElement("span", { dangerouslySetInnerHTML: { __html: prettyANSI(content) } })));
7
+ return (_jsxs("div", { className: `${classes.text} ${classes.log}`, children: [_jsx("pre", { children: _jsx("span", { dangerouslySetInnerHTML: { __html: prettyANSI(content) } }) }), _jsx(CopyButton, { className: classes.copyButton, text: content })] }));
8
8
  };
9
9
  function prettyANSI(s) {
10
10
  return new Convert().toHtml(s);
@@ -1 +1 @@
1
- {"version":3,"file":"Log.js","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/Log.tsx"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,cAAc,CAAA;AAClC,OAAO,KAAa,MAAM,OAAO,CAAA;AAGjC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,MAAM,CAAC,MAAM,GAAG,GAGX,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,EAAE;IAC/B,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IACvC,OAAO,CACL,6BAAK,SAAS,EAAE,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE;QAC9C,8BAAM,uBAAuB,EAAE,EAAE,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,GAAI,CAC9D,CACP,CAAA;AACH,CAAC,CAAA;AAED,SAAS,UAAU,CAAC,CAAS;IAC3B,OAAO,IAAI,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;AAChC,CAAC","sourcesContent":["import { Attachment } from '@cucumber/messages'\nimport Convert from 'ansi-to-html'\nimport React, { FC } from 'react'\n\nimport { AttachmentClasses } from '../../customise/index.js'\nimport { useText } from './useText.js'\n\nexport const Log: FC<{\n attachment: Attachment\n classes: AttachmentClasses\n}> = ({ attachment, classes }) => {\n const { content } = useText(attachment)\n return (\n <pre className={`${classes.text} ${classes.log}`}>\n <span dangerouslySetInnerHTML={{ __html: prettyANSI(content) }} />\n </pre>\n )\n}\n\nfunction prettyANSI(s: string) {\n return new Convert().toHtml(s)\n}\n"]}
1
+ {"version":3,"file":"Log.js","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/Log.tsx"],"names":[],"mappings":";AAGA,OAAO,OAAO,MAAM,cAAc,CAAA;AAGlC,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,MAAM,CAAC,MAAM,GAAG,GAGX,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,EAAE;IAC/B,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IACvC,OAAO,CACL,eAAK,SAAS,EAAE,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,aAC9C,wBACE,eAAM,uBAAuB,EAAE,EAAE,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,GAAI,GAC9D,EACN,KAAC,UAAU,IAAC,SAAS,EAAE,OAAO,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,GAAI,IACxD,CACP,CAAA;AACH,CAAC,CAAA;AAED,SAAS,UAAU,CAAC,CAAS;IAC3B,OAAO,IAAI,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;AAChC,CAAC","sourcesContent":["// biome-ignore-all lint/security/noDangerouslySetInnerHtml: pre-sanitised\n\nimport type { Attachment } from '@cucumber/messages'\nimport Convert from 'ansi-to-html'\nimport type { FC } from 'react'\n\nimport { CopyButton } from '../../app/CopyButton.js'\nimport type { AttachmentClasses } from '../../customise/index.js'\nimport { useText } from './useText.js'\n\nexport const Log: FC<{\n attachment: Attachment\n classes: AttachmentClasses\n}> = ({ attachment, classes }) => {\n const { content } = useText(attachment)\n return (\n <div className={`${classes.text} ${classes.log}`}>\n <pre>\n <span dangerouslySetInnerHTML={{ __html: prettyANSI(content) }} />\n </pre>\n <CopyButton className={classes.copyButton} text={content} />\n </div>\n )\n}\n\nfunction prettyANSI(s: string) {\n return new Convert().toHtml(s)\n}\n"]}
@@ -1,6 +1,6 @@
1
- import { Attachment } from '@cucumber/messages';
2
- import { FC } from 'react';
3
- import { AttachmentClasses } from '../../customise/index.js';
1
+ import type { Attachment } from '@cucumber/messages';
2
+ import type { FC } from 'react';
3
+ import type { AttachmentClasses } from '../../customise/index.js';
4
4
  export declare const Text: FC<{
5
5
  attachment: Attachment;
6
6
  prettify?: (body: string) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAM5D,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC;IACpB,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;IACnC,OAAO,EAAE,iBAAiB,CAAA;CAC3B,CAqBA,CAAA"}
1
+ {"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAMjE,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC;IACpB,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;IACnC,OAAO,EAAE,iBAAiB,CAAA;CAC3B,CAwBA,CAAA"}
@@ -1,4 +1,5 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { CopyButton } from '../../app/CopyButton.js';
2
3
  import { ErrorMessage } from '../ErrorMessage.js';
3
4
  import { useText } from './useText.js';
4
5
  const identity = (s) => s;
@@ -8,11 +9,8 @@ export const Text = ({ attachment, prettify = identity, classes }) => {
8
9
  return null;
9
10
  }
10
11
  if (error) {
11
- return (React.createElement(ErrorMessage, null, "There was an error when trying to fetch the content for this attachment. Check your browser console for more information on what went wrong."));
12
+ return (_jsx(ErrorMessage, { children: "There was an error when trying to fetch the content for this attachment. Check your browser console for more information on what went wrong." }));
12
13
  }
13
- return (React.createElement("details", null,
14
- React.createElement("summary", null, title),
15
- React.createElement("pre", { className: classes.text },
16
- React.createElement("span", null, prettify(content)))));
14
+ return (_jsxs("details", { children: [_jsx("summary", { children: title }), _jsxs("div", { className: classes.text, children: [_jsx("pre", { children: _jsx("span", { children: prettify(content) }) }), _jsx(CopyButton, { className: classes.copyButton, text: content })] })] }));
17
15
  };
18
16
  //# sourceMappingURL=Text.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Text.js","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAa,MAAM,OAAO,CAAA;AAGjC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAA;AAEjC,MAAM,CAAC,MAAM,IAAI,GAIZ,CAAC,EAAE,UAAU,EAAE,QAAQ,GAAG,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;IACpD,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IAC9D,IAAI,OAAO,EAAE;QACX,OAAO,IAAI,CAAA;KACZ;IACD,IAAI,KAAK,EAAE;QACT,OAAO,CACL,oBAAC,YAAY,uJAGE,CAChB,CAAA;KACF;IACD,OAAO,CACL;QACE,qCAAU,KAAK,CAAW;QAC1B,6BAAK,SAAS,EAAE,OAAO,CAAC,IAAI;YAC1B,kCAAO,QAAQ,CAAC,OAAO,CAAC,CAAQ,CAC5B,CACE,CACX,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { Attachment } from '@cucumber/messages'\nimport React, { FC } from 'react'\n\nimport { AttachmentClasses } from '../../customise/index.js'\nimport { ErrorMessage } from '../ErrorMessage.js'\nimport { useText } from './useText.js'\n\nconst identity = (s: string) => s\n\nexport const Text: FC<{\n attachment: Attachment\n prettify?: (body: string) => string\n classes: AttachmentClasses\n}> = ({ attachment, prettify = identity, classes }) => {\n const { title, loading, content, error } = useText(attachment)\n if (loading) {\n return null\n }\n if (error) {\n return (\n <ErrorMessage>\n There was an error when trying to fetch the content for this attachment. Check your browser\n console for more information on what went wrong.\n </ErrorMessage>\n )\n }\n return (\n <details>\n <summary>{title}</summary>\n <pre className={classes.text}>\n <span>{prettify(content)}</span>\n </pre>\n </details>\n )\n}\n"]}
1
+ {"version":3,"file":"Text.js","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/Text.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAA;AAEjC,MAAM,CAAC,MAAM,IAAI,GAIZ,CAAC,EAAE,UAAU,EAAE,QAAQ,GAAG,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;IACpD,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IAC9D,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,IAAI,CAAA;IACb,CAAC;IACD,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,CACL,KAAC,YAAY,+JAGE,CAChB,CAAA;IACH,CAAC;IACD,OAAO,CACL,8BACE,4BAAU,KAAK,GAAW,EAC1B,eAAK,SAAS,EAAE,OAAO,CAAC,IAAI,aAC1B,wBACE,yBAAO,QAAQ,CAAC,OAAO,CAAC,GAAQ,GAC5B,EACN,KAAC,UAAU,IAAC,SAAS,EAAE,OAAO,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,GAAI,IACxD,IACE,CACX,CAAA;AACH,CAAC,CAAA","sourcesContent":["import type { Attachment } from '@cucumber/messages'\nimport type { FC } from 'react'\n\nimport { CopyButton } from '../../app/CopyButton.js'\nimport type { AttachmentClasses } from '../../customise/index.js'\nimport { ErrorMessage } from '../ErrorMessage.js'\nimport { useText } from './useText.js'\n\nconst identity = (s: string) => s\n\nexport const Text: FC<{\n attachment: Attachment\n prettify?: (body: string) => string\n classes: AttachmentClasses\n}> = ({ attachment, prettify = identity, classes }) => {\n const { title, loading, content, error } = useText(attachment)\n if (loading) {\n return null\n }\n if (error) {\n return (\n <ErrorMessage>\n There was an error when trying to fetch the content for this attachment. Check your browser\n console for more information on what went wrong.\n </ErrorMessage>\n )\n }\n return (\n <details>\n <summary>{title}</summary>\n <div className={classes.text}>\n <pre>\n <span>{prettify(content)}</span>\n </pre>\n <CopyButton className={classes.copyButton} text={content} />\n </div>\n </details>\n )\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
2
- import { AttachmentProps } from '../../customise/index.js';
1
+ import { type FC } from 'react';
2
+ import type { AttachmentProps } from '../../customise/index.js';
3
3
  export declare const Unknown: FC<AttachmentProps>;
4
4
  //# sourceMappingURL=Unknown.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Unknown.d.ts","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/Unknown.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,EAAE,EAAoC,MAAM,OAAO,CAAA;AAGnE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAI1D,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,eAAe,CAKvC,CAAA"}
1
+ {"version":3,"file":"Unknown.d.ts","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/Unknown.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,EAAoC,MAAM,OAAO,CAAA;AAGjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAI/D,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,eAAe,CAKvC,CAAA"}
@@ -1,29 +1,26 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import { AttachmentContentEncoding } from '@cucumber/messages';
2
3
  import { faPaperclip } from '@fortawesome/free-solid-svg-icons';
3
4
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
4
- import React, { useCallback, useEffect, useState } from 'react';
5
+ import { useCallback, useEffect, useState } from 'react';
5
6
  import { NavigationButton } from '../../app/NavigationButton.js';
6
7
  import { attachmentFilename } from './attachmentFilename.js';
7
- import { base64Decode } from './base64Decode.js';
8
+ import { base64DecodeBytes } from './base64Decode.js';
8
9
  export const Unknown = ({ attachment }) => {
9
10
  if (attachment.url) {
10
- return React.createElement(UnknownExternalised, { attachment: attachment });
11
+ return _jsx(UnknownExternalised, { attachment: attachment });
11
12
  }
12
- return React.createElement(UnknownEmbedded, { attachment: attachment });
13
+ return _jsx(UnknownEmbedded, { attachment: attachment });
13
14
  };
14
15
  const UnknownExternalised = ({ attachment }) => {
15
16
  const filename = attachmentFilename(attachment);
16
17
  const onClick = () => {
17
18
  const anchor = document.createElement('a');
18
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
19
19
  anchor.href = attachment.url;
20
20
  anchor.download = filename;
21
21
  anchor.click();
22
22
  };
23
- return (React.createElement(NavigationButton, { onClick: onClick },
24
- React.createElement(FontAwesomeIcon, { icon: faPaperclip }),
25
- "Download ",
26
- filename));
23
+ return (_jsxs(NavigationButton, { onClick: onClick, children: [_jsx(FontAwesomeIcon, { icon: faPaperclip }), "Download ", filename] }));
27
24
  };
28
25
  const UnknownEmbedded = ({ attachment }) => {
29
26
  const [downloadUrl, setDownloadUrl] = useState();
@@ -44,18 +41,13 @@ const UnknownEmbedded = ({ attachment }) => {
44
41
  anchor.download = filename;
45
42
  anchor.click();
46
43
  }, [attachment, filename, downloadUrl]);
47
- return (React.createElement(NavigationButton, { onClick: onClick },
48
- React.createElement(FontAwesomeIcon, { icon: faPaperclip }),
49
- "Download ",
50
- filename));
44
+ return (_jsxs(NavigationButton, { onClick: onClick, children: [_jsx(FontAwesomeIcon, { icon: faPaperclip }), "Download ", filename] }));
51
45
  };
52
46
  function createDownloadUrl(attachment) {
53
- console.debug('Creating download url');
54
47
  const body = attachment.contentEncoding === AttachmentContentEncoding.BASE64
55
- ? base64Decode(attachment.body)
48
+ ? base64DecodeBytes(attachment.body)
56
49
  : attachment.body;
57
- const bytes = Uint8Array.from(body, (m) => m.codePointAt(0));
58
- const file = new File([bytes], 'attachment', {
50
+ const file = new File([body], 'attachment', {
59
51
  type: attachment.mediaType,
60
52
  });
61
53
  return URL.createObjectURL(file);
@@ -1 +1 @@
1
- {"version":3,"file":"Unknown.js","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/Unknown.tsx"],"names":[],"mappings":"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","sourcesContent":["import * as messages from '@cucumber/messages'\nimport { AttachmentContentEncoding } from '@cucumber/messages'\nimport { faPaperclip } from '@fortawesome/free-solid-svg-icons'\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\nimport React, { FC, useCallback, useEffect, useState } from 'react'\n\nimport { NavigationButton } from '../../app/NavigationButton.js'\nimport { AttachmentProps } from '../../customise/index.js'\nimport { attachmentFilename } from './attachmentFilename.js'\nimport { base64Decode } from './base64Decode.js'\n\nexport const Unknown: FC<AttachmentProps> = ({ attachment }) => {\n if (attachment.url) {\n return <UnknownExternalised attachment={attachment} />\n }\n return <UnknownEmbedded attachment={attachment} />\n}\n\nconst UnknownExternalised: FC<AttachmentProps> = ({ attachment }) => {\n const filename = attachmentFilename(attachment)\n const onClick = () => {\n const anchor = document.createElement('a')\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n anchor.href = attachment.url!\n anchor.download = filename\n anchor.click()\n }\n return (\n <NavigationButton onClick={onClick}>\n <FontAwesomeIcon icon={faPaperclip} />\n Download {filename}\n </NavigationButton>\n )\n}\n\nconst UnknownEmbedded: FC<AttachmentProps> = ({ attachment }) => {\n const [downloadUrl, setDownloadUrl] = useState<string>()\n useEffect(() => () => cleanupDownloadUrl(downloadUrl), [downloadUrl])\n const filename = attachmentFilename(attachment)\n const onClick = useCallback(() => {\n let href\n if (downloadUrl) {\n href = downloadUrl\n } else {\n const createdUrl = createDownloadUrl(attachment)\n setDownloadUrl(createdUrl)\n href = createdUrl\n }\n\n const anchor = document.createElement('a')\n anchor.href = href\n anchor.download = filename\n anchor.click()\n }, [attachment, filename, downloadUrl])\n return (\n <NavigationButton onClick={onClick}>\n <FontAwesomeIcon icon={faPaperclip} />\n Download {filename}\n </NavigationButton>\n )\n}\n\nfunction createDownloadUrl(attachment: messages.Attachment) {\n console.debug('Creating download url')\n const body =\n attachment.contentEncoding === AttachmentContentEncoding.BASE64\n ? base64Decode(attachment.body)\n : attachment.body\n const bytes = Uint8Array.from<string>(body, (m) => m.codePointAt(0) as number)\n const file = new File([bytes], 'attachment', {\n type: attachment.mediaType,\n })\n return URL.createObjectURL(file)\n}\n\nfunction cleanupDownloadUrl(url?: string) {\n if (url) {\n console.debug('Revoking download url')\n URL.revokeObjectURL(url)\n }\n}\n"]}
1
+ {"version":3,"file":"Unknown.js","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/Unknown.tsx"],"names":[],"mappings":"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","sourcesContent":["import { type Attachment, AttachmentContentEncoding } from '@cucumber/messages'\nimport { faPaperclip } from '@fortawesome/free-solid-svg-icons'\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\nimport { type FC, useCallback, useEffect, useState } from 'react'\n\nimport { NavigationButton } from '../../app/NavigationButton.js'\nimport type { AttachmentProps } from '../../customise/index.js'\nimport { attachmentFilename } from './attachmentFilename.js'\nimport { base64DecodeBytes } from './base64Decode.js'\n\nexport const Unknown: FC<AttachmentProps> = ({ attachment }) => {\n if (attachment.url) {\n return <UnknownExternalised attachment={attachment} />\n }\n return <UnknownEmbedded attachment={attachment} />\n}\n\nconst UnknownExternalised: FC<AttachmentProps> = ({ attachment }) => {\n const filename = attachmentFilename(attachment)\n const onClick = () => {\n const anchor = document.createElement('a')\n anchor.href = attachment.url as string\n anchor.download = filename\n anchor.click()\n }\n return (\n <NavigationButton onClick={onClick}>\n <FontAwesomeIcon icon={faPaperclip} />\n Download {filename}\n </NavigationButton>\n )\n}\n\nconst UnknownEmbedded: FC<AttachmentProps> = ({ attachment }) => {\n const [downloadUrl, setDownloadUrl] = useState<string>()\n useEffect(() => () => cleanupDownloadUrl(downloadUrl), [downloadUrl])\n const filename = attachmentFilename(attachment)\n const onClick = useCallback(() => {\n let href: string\n if (downloadUrl) {\n href = downloadUrl\n } else {\n const createdUrl = createDownloadUrl(attachment)\n setDownloadUrl(createdUrl)\n href = createdUrl\n }\n\n const anchor = document.createElement('a')\n anchor.href = href\n anchor.download = filename\n anchor.click()\n }, [attachment, filename, downloadUrl])\n return (\n <NavigationButton onClick={onClick}>\n <FontAwesomeIcon icon={faPaperclip} />\n Download {filename}\n </NavigationButton>\n )\n}\n\nfunction createDownloadUrl(attachment: Attachment): string {\n const body =\n attachment.contentEncoding === AttachmentContentEncoding.BASE64\n ? base64DecodeBytes(attachment.body)\n : attachment.body\n const file = new File([body], 'attachment', {\n type: attachment.mediaType,\n })\n return URL.createObjectURL(file)\n}\n\nfunction cleanupDownloadUrl(url?: string) {\n if (url) {\n console.debug('Revoking download url')\n URL.revokeObjectURL(url)\n }\n}\n"]}
@@ -1,6 +1,6 @@
1
- import * as messages from '@cucumber/messages';
2
- import { FC } from 'react';
1
+ import type { Attachment } from '@cucumber/messages';
2
+ import type { FC } from 'react';
3
3
  export declare const Video: FC<{
4
- attachment: messages.Attachment;
4
+ attachment: Attachment;
5
5
  }>;
6
6
  //# sourceMappingURL=Video.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Video.d.ts","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/Video.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAA;AAC9C,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAIjC,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC;IAAE,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAA;CAAE,CAezD,CAAA"}
1
+ {"version":3,"file":"Video.d.ts","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/Video.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAI/B,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC;IAAE,UAAU,EAAE,UAAU,CAAA;CAAE,CAehD,CAAA"}
@@ -1,20 +1,16 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { ErrorMessage } from '../ErrorMessage.js';
3
3
  export const Video = ({ attachment }) => {
4
- const title = attachment.fileName ?? 'Attached Video (' + attachment.mediaType + ')';
4
+ const title = attachment.fileName ?? `Attached Video (${attachment.mediaType})`;
5
5
  if (attachment.url) {
6
- return React.createElement(VideoInternal, { src: attachment.url, title: title });
6
+ return _jsx(VideoInternal, { src: attachment.url, title: title });
7
7
  }
8
8
  if (attachment.contentEncoding === 'BASE64') {
9
- return (React.createElement(VideoInternal, { src: `data:${attachment.mediaType};base64,${attachment.body}`, title: title }));
9
+ return (_jsx(VideoInternal, { src: `data:${attachment.mediaType};base64,${attachment.body}`, title: title }));
10
10
  }
11
- return (React.createElement(ErrorMessage, { message: `Couldn't display ${attachment.mediaType} video because it wasn't base64 encoded or externalised` }));
11
+ return (_jsx(ErrorMessage, { message: `Couldn't display ${attachment.mediaType} video because it wasn't base64 encoded or externalised` }));
12
12
  };
13
13
  const VideoInternal = ({ src, title }) => {
14
- return (React.createElement("details", null,
15
- React.createElement("summary", null, title),
16
- React.createElement("video", { controls: true },
17
- React.createElement("source", { src: src }),
18
- "Your browser is unable to display video")));
14
+ return (_jsxs("details", { children: [_jsx("summary", { children: title }), _jsxs("video", { controls: true, children: [_jsx("source", { src: src }), "Your browser is unable to display video"] })] }));
19
15
  };
20
16
  //# sourceMappingURL=Video.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Video.js","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/Video.tsx"],"names":[],"mappings":"AACA,OAAO,KAAa,MAAM,OAAO,CAAA;AAEjC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEjD,MAAM,CAAC,MAAM,KAAK,GAA4C,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE;IAC/E,MAAM,KAAK,GAAG,UAAU,CAAC,QAAQ,IAAI,kBAAkB,GAAG,UAAU,CAAC,SAAS,GAAG,GAAG,CAAA;IACpF,IAAI,UAAU,CAAC,GAAG,EAAE;QAClB,OAAO,oBAAC,aAAa,IAAC,GAAG,EAAE,UAAU,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,GAAI,CAAA;KAC5D;IACD,IAAI,UAAU,CAAC,eAAe,KAAK,QAAQ,EAAE;QAC3C,OAAO,CACL,oBAAC,aAAa,IAAC,GAAG,EAAE,QAAQ,UAAU,CAAC,SAAS,WAAW,UAAU,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,GAAI,CAC/F,CAAA;KACF;IACD,OAAO,CACL,oBAAC,YAAY,IACX,OAAO,EAAE,oBAAoB,UAAU,CAAC,SAAS,yDAAyD,GAC1G,CACH,CAAA;AACH,CAAC,CAAA;AAED,MAAM,aAAa,GAAuC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE;IAC3E,OAAO,CACL;QACE,qCAAU,KAAK,CAAW;QAC1B,+BAAO,QAAQ;YACb,gCAAQ,GAAG,EAAE,GAAG,GAAI;sDAEd,CACA,CACX,CAAA;AACH,CAAC,CAAA","sourcesContent":["import * as messages from '@cucumber/messages'\nimport React, { FC } from 'react'\n\nimport { ErrorMessage } from '../ErrorMessage.js'\n\nexport const Video: FC<{ attachment: messages.Attachment }> = ({ attachment }) => {\n const title = attachment.fileName ?? 'Attached Video (' + attachment.mediaType + ')'\n if (attachment.url) {\n return <VideoInternal src={attachment.url} title={title} />\n }\n if (attachment.contentEncoding === 'BASE64') {\n return (\n <VideoInternal src={`data:${attachment.mediaType};base64,${attachment.body}`} title={title} />\n )\n }\n return (\n <ErrorMessage\n message={`Couldn't display ${attachment.mediaType} video because it wasn't base64 encoded or externalised`}\n />\n )\n}\n\nconst VideoInternal: FC<{ src: string; title: string }> = ({ src, title }) => {\n return (\n <details>\n <summary>{title}</summary>\n <video controls>\n <source src={src} />\n Your browser is unable to display video\n </video>\n </details>\n )\n}\n"]}
1
+ {"version":3,"file":"Video.js","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/Video.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEjD,MAAM,CAAC,MAAM,KAAK,GAAmC,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE;IACtE,MAAM,KAAK,GAAG,UAAU,CAAC,QAAQ,IAAI,mBAAmB,UAAU,CAAC,SAAS,GAAG,CAAA;IAC/E,IAAI,UAAU,CAAC,GAAG,EAAE,CAAC;QACnB,OAAO,KAAC,aAAa,IAAC,GAAG,EAAE,UAAU,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,GAAI,CAAA;IAC7D,CAAC;IACD,IAAI,UAAU,CAAC,eAAe,KAAK,QAAQ,EAAE,CAAC;QAC5C,OAAO,CACL,KAAC,aAAa,IAAC,GAAG,EAAE,QAAQ,UAAU,CAAC,SAAS,WAAW,UAAU,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,GAAI,CAC/F,CAAA;IACH,CAAC;IACD,OAAO,CACL,KAAC,YAAY,IACX,OAAO,EAAE,oBAAoB,UAAU,CAAC,SAAS,yDAAyD,GAC1G,CACH,CAAA;AACH,CAAC,CAAA;AAED,MAAM,aAAa,GAAuC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE;IAC3E,OAAO,CACL,8BACE,4BAAU,KAAK,GAAW,EAC1B,iBAAO,QAAQ,mBACb,iBAAQ,GAAG,EAAE,GAAG,GAAI,+CAEd,IACA,CACX,CAAA;AACH,CAAC,CAAA","sourcesContent":["// biome-ignore-all lint/a11y/useMediaCaption: user-generated content\n\nimport type { Attachment } from '@cucumber/messages'\nimport type { FC } from 'react'\n\nimport { ErrorMessage } from '../ErrorMessage.js'\n\nexport const Video: FC<{ attachment: Attachment }> = ({ attachment }) => {\n const title = attachment.fileName ?? `Attached Video (${attachment.mediaType})`\n if (attachment.url) {\n return <VideoInternal src={attachment.url} title={title} />\n }\n if (attachment.contentEncoding === 'BASE64') {\n return (\n <VideoInternal src={`data:${attachment.mediaType};base64,${attachment.body}`} title={title} />\n )\n }\n return (\n <ErrorMessage\n message={`Couldn't display ${attachment.mediaType} video because it wasn't base64 encoded or externalised`}\n />\n )\n}\n\nconst VideoInternal: FC<{ src: string; title: string }> = ({ src, title }) => {\n return (\n <details>\n <summary>{title}</summary>\n <video controls>\n <source src={src} />\n Your browser is unable to display video\n </video>\n </details>\n )\n}\n"]}
@@ -1,3 +1,3 @@
1
- import { Attachment } from '@cucumber/messages';
1
+ import type { Attachment } from '@cucumber/messages';
2
2
  export declare function attachmentFilename(attachment: Attachment): string;
3
3
  //# sourceMappingURL=attachmentFilename.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"attachmentFilename.d.ts","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/attachmentFilename.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAG/C,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CASjE"}
1
+ {"version":3,"file":"attachmentFilename.d.ts","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/attachmentFilename.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAGpD,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CASjE"}
@@ -1 +1 @@
1
- {"version":3,"file":"attachmentFilename.js","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/attachmentFilename.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,MAAM,CAAA;AAE5B,MAAM,UAAU,kBAAkB,CAAC,UAAsB;IACvD,IAAI,UAAU,CAAC,QAAQ,EAAE;QACvB,OAAO,UAAU,CAAC,QAAQ,CAAA;KAC3B;IACD,MAAM,SAAS,GAAG,SAAS,CAAC,YAAY,CAAC,UAAU,CAAC,SAAS,CAAC,CAAA;IAC9D,IAAI,SAAS,EAAE;QACb,OAAO,cAAc,SAAS,EAAE,CAAA;KACjC;IACD,OAAO,YAAY,CAAA;AACrB,CAAC","sourcesContent":["import { Attachment } from '@cucumber/messages'\nimport mimeTypes from 'mime'\n\nexport function attachmentFilename(attachment: Attachment): string {\n if (attachment.fileName) {\n return attachment.fileName\n }\n const extension = mimeTypes.getExtension(attachment.mediaType)\n if (extension) {\n return `attachment.${extension}`\n }\n return 'attachment'\n}\n"]}
1
+ {"version":3,"file":"attachmentFilename.js","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/attachmentFilename.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,MAAM,CAAA;AAE5B,MAAM,UAAU,kBAAkB,CAAC,UAAsB;IACvD,IAAI,UAAU,CAAC,QAAQ,EAAE,CAAC;QACxB,OAAO,UAAU,CAAC,QAAQ,CAAA;IAC5B,CAAC;IACD,MAAM,SAAS,GAAG,SAAS,CAAC,YAAY,CAAC,UAAU,CAAC,SAAS,CAAC,CAAA;IAC9D,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,cAAc,SAAS,EAAE,CAAA;IAClC,CAAC;IACD,OAAO,YAAY,CAAA;AACrB,CAAC","sourcesContent":["import type { Attachment } from '@cucumber/messages'\nimport mimeTypes from 'mime'\n\nexport function attachmentFilename(attachment: Attachment): string {\n if (attachment.fileName) {\n return attachment.fileName\n }\n const extension = mimeTypes.getExtension(attachment.mediaType)\n if (extension) {\n return `attachment.${extension}`\n }\n return 'attachment'\n}\n"]}
@@ -1,2 +1,10 @@
1
- export declare function base64Decode(body: string): string;
1
+ /**
2
+ * Decode base64 to UTF-8 string.
3
+ */
4
+ export declare function base64DecodeText(body: string): string;
5
+ /**
6
+ * Decode base64 to raw bytes without any text encoding conversion,
7
+ * preserving byte-for-byte accuracy needed for binary content.
8
+ */
9
+ export declare function base64DecodeBytes(body: string): Uint8Array<ArrayBuffer>;
2
10
  //# sourceMappingURL=base64Decode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base64Decode.d.ts","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/base64Decode.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,UAGxC"}
1
+ {"version":3,"file":"base64Decode.d.ts","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/base64Decode.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC,WAAW,CAAC,CAOvE"}
@@ -1,5 +1,19 @@
1
- export function base64Decode(body) {
2
- // TODO handle unicode
3
- return atob(body);
1
+ /**
2
+ * Decode base64 to UTF-8 string.
3
+ */
4
+ export function base64DecodeText(body) {
5
+ return new TextDecoder('utf-8').decode(Uint8Array.from(atob(body), (c) => c.charCodeAt(0)));
6
+ }
7
+ /**
8
+ * Decode base64 to raw bytes without any text encoding conversion,
9
+ * preserving byte-for-byte accuracy needed for binary content.
10
+ */
11
+ export function base64DecodeBytes(body) {
12
+ const binary = atob(body);
13
+ const bytes = new Uint8Array(binary.length);
14
+ for (let i = 0; i < binary.length; i++) {
15
+ bytes[i] = binary.charCodeAt(i);
16
+ }
17
+ return bytes;
4
18
  }
5
19
  //# sourceMappingURL=base64Decode.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"base64Decode.js","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/base64Decode.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,sBAAsB;IACtB,OAAO,IAAI,CAAC,IAAI,CAAC,CAAA;AACnB,CAAC","sourcesContent":["export function base64Decode(body: string) {\n // TODO handle unicode\n return atob(body)\n}\n"]}
1
+ {"version":3,"file":"base64Decode.js","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/base64Decode.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,OAAO,IAAI,WAAW,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAC7F,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,CAAA;IACzB,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAC3C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;IACjC,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC","sourcesContent":["/**\n * Decode base64 to UTF-8 string.\n */\nexport function base64DecodeText(body: string): string {\n return new TextDecoder('utf-8').decode(Uint8Array.from(atob(body), (c) => c.charCodeAt(0)))\n}\n\n/**\n * Decode base64 to raw bytes without any text encoding conversion,\n * preserving byte-for-byte accuracy needed for binary content.\n */\nexport function base64DecodeBytes(body: string): Uint8Array<ArrayBuffer> {\n const binary = atob(body)\n const bytes = new Uint8Array(binary.length)\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i)\n }\n return bytes\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Attachment } from '@cucumber/messages';
1
+ import type { Attachment } from '@cucumber/messages';
2
2
  export declare function useText(attachment: Attachment): {
3
3
  title: string;
4
4
  loading: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"useText.d.ts","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/useText.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAK/C,wBAAgB,OAAO,CAAC,UAAU,EAAE,UAAU;;;;;EA0B7C"}
1
+ {"version":3,"file":"useText.d.ts","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/useText.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAKpD,wBAAgB,OAAO,CAAC,UAAU,EAAE,UAAU;;;;;EA0B7C"}
@@ -1,8 +1,8 @@
1
1
  import { useEffect, useState } from 'react';
2
- import { base64Decode } from './base64Decode.js';
2
+ import { base64DecodeText } from './base64Decode.js';
3
3
  export function useText(attachment) {
4
4
  const [loading, setLoading] = useState(false);
5
- const [content, setContent] = useState(attachment.contentEncoding === 'BASE64' ? base64Decode(attachment.body) : attachment.body);
5
+ const [content, setContent] = useState(attachment.contentEncoding === 'BASE64' ? base64DecodeText(attachment.body) : attachment.body);
6
6
  const [error, setError] = useState();
7
7
  useEffect(() => {
8
8
  if (attachment.url) {
@@ -19,7 +19,7 @@ export function useText(attachment) {
19
19
  }
20
20
  }, [attachment]);
21
21
  return {
22
- title: attachment.fileName ?? 'Attached Text (' + attachment.mediaType + ')',
22
+ title: attachment.fileName ?? `Attached Text (${attachment.mediaType})`,
23
23
  loading,
24
24
  content,
25
25
  error,