@cucumber/react-components 22.1.0 → 22.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/dist/src/components/CucumberReact.js +1 -1
- package/dist/src/components/CucumberReact.js.map +1 -1
- package/dist/src/components/customise/customRendering.d.ts +1 -1
- package/dist/src/components/customise/customRendering.d.ts.map +1 -1
- package/dist/src/components/gherkin/GherkinStep.js +1 -1
- package/dist/src/components/gherkin/GherkinStep.js.map +1 -1
- package/dist/src/components/gherkin/HookStep.js +1 -1
- package/dist/src/components/gherkin/HookStep.js.map +1 -1
- package/dist/src/components/gherkin/attachment/Attachment.d.ts +4 -0
- package/dist/src/components/gherkin/attachment/Attachment.d.ts.map +1 -0
- package/dist/src/components/gherkin/attachment/Attachment.js +48 -0
- package/dist/src/components/gherkin/attachment/Attachment.js.map +1 -0
- package/dist/src/components/gherkin/attachment/Attachment.module.scss +57 -0
- package/dist/src/components/gherkin/attachment/Image.d.ts +8 -0
- package/dist/src/components/gherkin/attachment/Image.d.ts.map +1 -0
- package/dist/src/components/gherkin/attachment/Image.js +18 -0
- package/dist/src/components/gherkin/attachment/Image.js.map +1 -0
- package/dist/src/components/gherkin/attachment/Links.d.ts +8 -0
- package/dist/src/components/gherkin/attachment/Links.d.ts.map +1 -0
- package/dist/src/components/gherkin/attachment/Links.js +17 -0
- package/dist/src/components/gherkin/attachment/Links.js.map +1 -0
- package/dist/src/components/gherkin/attachment/Log.d.ts +8 -0
- package/dist/src/components/gherkin/attachment/Log.d.ts.map +1 -0
- package/dist/src/components/gherkin/attachment/Log.js +12 -0
- package/dist/src/components/gherkin/attachment/Log.js.map +1 -0
- package/dist/src/components/gherkin/attachment/Text.d.ts +9 -0
- package/dist/src/components/gherkin/attachment/Text.d.ts.map +1 -0
- package/dist/src/components/gherkin/attachment/Text.js +18 -0
- package/dist/src/components/gherkin/attachment/Text.js.map +1 -0
- package/dist/src/components/gherkin/attachment/Unknown.d.ts +4 -0
- package/dist/src/components/gherkin/attachment/Unknown.d.ts.map +1 -0
- package/dist/src/components/gherkin/attachment/Unknown.js +69 -0
- package/dist/src/components/gherkin/attachment/Unknown.js.map +1 -0
- package/dist/src/components/gherkin/attachment/Video.d.ts +6 -0
- package/dist/src/components/gherkin/attachment/Video.d.ts.map +1 -0
- package/dist/src/components/gherkin/attachment/Video.js +20 -0
- package/dist/src/components/gherkin/attachment/Video.js.map +1 -0
- package/dist/src/components/gherkin/attachment/attachmentFilename.d.ts.map +1 -0
- package/dist/src/components/gherkin/attachment/attachmentFilename.js.map +1 -0
- package/dist/src/components/gherkin/attachment/base64Decode.d.ts +2 -0
- package/dist/src/components/gherkin/attachment/base64Decode.d.ts.map +1 -0
- package/dist/src/components/gherkin/attachment/base64Decode.js +5 -0
- package/dist/src/components/gherkin/attachment/base64Decode.js.map +1 -0
- package/dist/src/components/gherkin/attachment/index.d.ts +2 -0
- package/dist/src/components/gherkin/attachment/index.d.ts.map +1 -0
- package/dist/src/components/gherkin/attachment/index.js +2 -0
- package/dist/src/components/gherkin/attachment/index.js.map +1 -0
- package/dist/src/components/gherkin/attachment/useText.d.ts +8 -0
- package/dist/src/components/gherkin/attachment/useText.d.ts.map +1 -0
- package/dist/src/components/gherkin/attachment/useText.js +28 -0
- package/dist/src/components/gherkin/attachment/useText.js.map +1 -0
- package/dist/src/components/gherkin/index.d.ts +1 -1
- package/dist/src/components/gherkin/index.d.ts.map +1 -1
- package/dist/src/components/gherkin/index.js +1 -1
- package/dist/src/components/gherkin/index.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/dist/src/components/gherkin/Attachment.d.ts +0 -5
- package/dist/src/components/gherkin/Attachment.d.ts.map +0 -1
- package/dist/src/components/gherkin/Attachment.js +0 -125
- package/dist/src/components/gherkin/Attachment.js.map +0 -1
- package/dist/src/components/gherkin/Attachment.module.scss +0 -23
- package/dist/src/components/gherkin/attachmentFilename.d.ts.map +0 -1
- package/dist/src/components/gherkin/attachmentFilename.js.map +0 -1
- /package/dist/src/components/gherkin/{attachmentFilename.d.ts → attachment/attachmentFilename.d.ts} +0 -0
- /package/dist/src/components/gherkin/{attachmentFilename.js → attachment/attachmentFilename.js} +0 -0
package/README.md
CHANGED
|
@@ -37,6 +37,17 @@ This is fine for simple use cases where results are not important.
|
|
|
37
37
|
To render a `<GherkinDocument>` with results and highlighted [Cucumber Expression parameters](https://cucumber.io/docs/cucumber/cucumber-expressions/) parameters it must be nested inside a
|
|
38
38
|
[`<Wrapper>`](src/components/app/Wrapper.tsx) component.
|
|
39
39
|
|
|
40
|
+
## Attachments
|
|
41
|
+
|
|
42
|
+
Attachments from test runs are shown with their corresponding steps. The baseline behaviour for attachments is a download button. However, we have some special handling for very common MIME types to make them more useful without leaving the report:
|
|
43
|
+
|
|
44
|
+
- `image/*` - images are rendered with an `<img/>` tag
|
|
45
|
+
- `video/*` - videos are rendered with a `<video/` tag
|
|
46
|
+
- `text/x.cucumber.log+plain` - logs (from calls to the `log` function in Cucumber) are rendered as monospace text, and support ANSI colors
|
|
47
|
+
- `text/uri-list` - one or more URLs are rendered as links that open in a new tab
|
|
48
|
+
- `application/json` - JSON is rendered as monospace text and prettified
|
|
49
|
+
- `text/*` - other text types are rendered as monospace text
|
|
50
|
+
|
|
40
51
|
## Styling
|
|
41
52
|
|
|
42
53
|
The standard styling comes from wrapping your top-level usage with the `CucumberReact` component (sans-props). There are several ways you can apply different styling to the components.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styles from './CucumberReact.module.scss';
|
|
3
3
|
import { CustomRenderingContext } from './customise/index.js';
|
|
4
|
-
export const CucumberReact = ({ children, theme = '
|
|
4
|
+
export const CucumberReact = ({ children, theme = 'auto', customRendering = {}, className, }) => {
|
|
5
5
|
const classes = [styles.cucumberReact, styles[`${theme}Theme`], className];
|
|
6
6
|
return (React.createElement(CustomRenderingContext.Provider, { value: customRendering },
|
|
7
7
|
React.createElement("div", { "data-testid": "cucumber-react", className: classes.filter((c) => !!c).join(' ') }, children)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CucumberReact.js","sourceRoot":"","sources":["../../../src/components/CucumberReact.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAA;AAEnE,OAAO,MAAM,MAAM,6BAA6B,CAAA;AAChD,OAAO,EAAE,sBAAsB,EAAyC,MAAM,sBAAsB,CAAA;AAQpG,MAAM,CAAC,MAAM,aAAa,GAAiD,CAAC,EAC1E,QAAQ,EACR,KAAK,GAAG,
|
|
1
|
+
{"version":3,"file":"CucumberReact.js","sourceRoot":"","sources":["../../../src/components/CucumberReact.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAA;AAEnE,OAAO,MAAM,MAAM,6BAA6B,CAAA;AAChD,OAAO,EAAE,sBAAsB,EAAyC,MAAM,sBAAsB,CAAA;AAQpG,MAAM,CAAC,MAAM,aAAa,GAAiD,CAAC,EAC1E,QAAQ,EACR,KAAK,GAAG,MAAM,EACd,eAAe,GAAG,EAAE,EACpB,SAAS,GACV,EAAE,EAAE;IACH,MAAM,OAAO,GAAG,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,GAAG,KAAK,OAAO,CAAC,EAAE,SAAS,CAAC,CAAA;IAC1E,OAAO,CACL,oBAAC,sBAAsB,CAAC,QAAQ,IAAC,KAAK,EAAE,eAAe;QACrD,4CAAiB,gBAAgB,EAAC,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAC9E,QAAQ,CACL,CAC0B,CACnC,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -10,7 +10,7 @@ export type AnchorClasses = Styles<'wrapper' | 'anchor'>;
|
|
|
10
10
|
export interface AttachmentProps {
|
|
11
11
|
attachment: messages.Attachment;
|
|
12
12
|
}
|
|
13
|
-
export type AttachmentClasses = Styles<'text' | 'icon' | 'image'>;
|
|
13
|
+
export type AttachmentClasses = Styles<'text' | 'log' | 'icon' | 'image' | 'links'>;
|
|
14
14
|
export interface BackgroundProps {
|
|
15
15
|
background: messages.Background;
|
|
16
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customRendering.d.ts","sourceRoot":"","sources":["../../../../src/components/customise/customRendering.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAE,SAAS,EAAc,MAAM,OAAO,CAAA;AAkBvE,KAAK,MAAM,CAAC,CAAC,SAAS,MAAM,IAAI,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;AAEjD,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,SAAS,GAAG,QAAQ,CAAC,CAAA;AAExD,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAA;CAChC;AAED,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"customRendering.d.ts","sourceRoot":"","sources":["../../../../src/components/customise/customRendering.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAE,SAAS,EAAc,MAAM,OAAO,CAAA;AAkBvE,KAAK,MAAM,CAAC,CAAC,SAAS,MAAM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AAC,CAAA;IAC5B,QAAQ,CAAC,EAAE,UAAU,CAAC,aAAa,CAAC,CAAA;IACpC,UAAU,CAAC,EAAE,UAAU,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAA;IAC3D,IAAI,CAAC,EAAE,UAAU,CAAC,SAAS,EAAE,WAAW,CAAC,CAAA;IACzC,KAAK,CAAC,EAAE,UAAU,CAAC,UAAU,EAAE,YAAY,CAAC,CAAA;CAC7C;AAED,MAAM,CAAC,OAAO,MAAM,gBAAgB,GAAG,MAAM,sBAAsB,CAAA;AAEnE,eAAO,MAAM,sBAAsB,uCAAkD,CAAA;AAErF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,SAAS,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/F,SAAS,EAAE,gBAAgB,EAC3B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACrC,eAAe,EAAE,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,GAChD,iBAAiB,CAAC,KAAK,CAAC,CAe1B"}
|
|
@@ -5,7 +5,7 @@ import GherkinQueryContext from '../../GherkinQueryContext.js';
|
|
|
5
5
|
import { HighLight } from '../app/HighLight.js';
|
|
6
6
|
import { useCustomRendering } from '../customise/index.js';
|
|
7
7
|
import { TestStepResultDetails } from '../results/index.js';
|
|
8
|
-
import { Attachment } from './
|
|
8
|
+
import { Attachment } from './attachment/index.js';
|
|
9
9
|
import { DataTable as DataTableComponent } from './DataTable.js';
|
|
10
10
|
import { DocString as DocStringComponent } from './DocString.js';
|
|
11
11
|
import { Keyword } from './Keyword.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GherkinStep.js","sourceRoot":"","sources":["../../../../src/components/gherkin/GherkinStep.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,sBAAsB,GAKvB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,MAAM,OAAO,CAAA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EAAE;IAC9E,MAAM,gBAAgB,GAAG,kBAAkB,CAAmB,aAAa,EAAE,EAAE,EAAE,eAAe,CAAC,CAAA;IACjG,OAAO,oBAAC,gBAAgB,OAAK,KAAK,GAAI,CAAA;AACxC,CAAC,CAAA"}
|
|
@@ -4,7 +4,7 @@ import React from 'react';
|
|
|
4
4
|
import CucumberQueryContext from '../../CucumberQueryContext.js';
|
|
5
5
|
import { useCustomRendering } from '../customise/index.js';
|
|
6
6
|
import { TestStepResultDetails } from '../results/index.js';
|
|
7
|
-
import { Attachment } from './
|
|
7
|
+
import { Attachment } from './attachment/index.js';
|
|
8
8
|
import { StepItem } from './StepItem.js';
|
|
9
9
|
import { Title } from './Title.js';
|
|
10
10
|
const DefaultRenderer = ({ step }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HookStep.js","sourceRoot":"","sources":["../../../../src/components/gherkin/HookStep.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,oBAAoB,MAAM,+BAA+B,CAAA;AAChE,OAAO,EAAiB,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"HookStep.js","sourceRoot":"","sources":["../../../../src/components/gherkin/HookStep.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,oBAAoB,MAAM,+BAA+B,CAAA;AAChE,OAAO,EAAiB,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;A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
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ErrorBoundary } from 'react-error-boundary';
|
|
3
|
+
import { useCustomRendering, } from '../../customise/index.js';
|
|
4
|
+
import { ErrorMessage } from '../ErrorMessage.js';
|
|
5
|
+
import defaultStyles from './Attachment.module.scss';
|
|
6
|
+
import { Image } from './Image.js';
|
|
7
|
+
import { Links } from './Links.js';
|
|
8
|
+
import { Log } from './Log.js';
|
|
9
|
+
import { Text } from './Text.js';
|
|
10
|
+
import { Unknown } from './Unknown.js';
|
|
11
|
+
import { Video } from './Video.js';
|
|
12
|
+
const DefaultRenderer = ({ attachment, styles, }) => {
|
|
13
|
+
if (attachment.mediaType.match(/^image\//)) {
|
|
14
|
+
return React.createElement(Image, { attachment: attachment, classes: styles });
|
|
15
|
+
}
|
|
16
|
+
else if (attachment.mediaType.match(/^video\//)) {
|
|
17
|
+
return React.createElement(Video, { attachment: attachment });
|
|
18
|
+
}
|
|
19
|
+
else if (attachment.mediaType == 'text/x.cucumber.log+plain') {
|
|
20
|
+
return React.createElement(Log, { attachment: attachment, classes: styles });
|
|
21
|
+
}
|
|
22
|
+
else if (attachment.mediaType == 'text/uri-list') {
|
|
23
|
+
return React.createElement(Links, { attachment: attachment, classes: styles });
|
|
24
|
+
}
|
|
25
|
+
else if (attachment.mediaType.match(/^text\//)) {
|
|
26
|
+
return React.createElement(Text, { attachment: attachment, classes: styles });
|
|
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 });
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
export const Attachment = (props) => {
|
|
36
|
+
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 })));
|
|
39
|
+
};
|
|
40
|
+
function prettyJSON(s) {
|
|
41
|
+
try {
|
|
42
|
+
return JSON.stringify(JSON.parse(s), null, 2);
|
|
43
|
+
}
|
|
44
|
+
catch (ignore) {
|
|
45
|
+
return s;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=Attachment.js.map
|
|
@@ -0,0 +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,IAA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OAAO,MAAM,EAAE;QACf,OAAO,CAAC,CAAA;KACT;AACH,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
@import '../../../styles/theming';
|
|
2
|
+
|
|
3
|
+
.text {
|
|
4
|
+
position: relative;
|
|
5
|
+
white-space: pre-wrap;
|
|
6
|
+
font-family: $monoFamily;
|
|
7
|
+
font-size: 0.875em;
|
|
8
|
+
padding: 0.666em 0.75em;
|
|
9
|
+
border-radius: 0.25em;
|
|
10
|
+
margin: 0;
|
|
11
|
+
overflow-x: auto;
|
|
12
|
+
background-color: $codeBackgroundColor;
|
|
13
|
+
color: $codeTextColor;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.log {
|
|
17
|
+
padding-left: 3.25em;
|
|
18
|
+
|
|
19
|
+
&::before {
|
|
20
|
+
content: 'Log';
|
|
21
|
+
position: absolute;
|
|
22
|
+
top: 0.666em;
|
|
23
|
+
left: 0.75em;
|
|
24
|
+
text-transform: uppercase;
|
|
25
|
+
font-weight: bold;
|
|
26
|
+
color: $parameterColor;
|
|
27
|
+
opacity: 0.75;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.icon {
|
|
32
|
+
margin-right: 0.75em;
|
|
33
|
+
opacity: 0.333;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.image {
|
|
37
|
+
max-width: 100%;
|
|
38
|
+
margin-top: 0.5em;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.links {
|
|
42
|
+
list-style: none;
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
align-items: flex-start;
|
|
46
|
+
padding: 0;
|
|
47
|
+
margin: 0;
|
|
48
|
+
|
|
49
|
+
a {
|
|
50
|
+
text-decoration: none;
|
|
51
|
+
color: $anchorColor;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
svg {
|
|
55
|
+
margin-right: 0.5em;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as messages from '@cucumber/messages';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
import { AttachmentClasses } from '../../customise/index.js';
|
|
4
|
+
export declare const Image: FC<{
|
|
5
|
+
attachment: messages.Attachment;
|
|
6
|
+
classes: AttachmentClasses;
|
|
7
|
+
}>;
|
|
8
|
+
//# sourceMappingURL=Image.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ErrorMessage } from '../ErrorMessage.js';
|
|
3
|
+
export const Image = ({ attachment, classes, }) => {
|
|
4
|
+
const title = attachment.fileName ?? 'Attached Image (' + attachment.mediaType + ')';
|
|
5
|
+
if (attachment.url) {
|
|
6
|
+
return React.createElement(ImageInternal, { src: attachment.url, title: title, className: classes.image });
|
|
7
|
+
}
|
|
8
|
+
if (attachment.contentEncoding === 'BASE64') {
|
|
9
|
+
return (React.createElement(ImageInternal, { src: `data:${attachment.mediaType};base64,${attachment.body}`, title: title, className: classes.image }));
|
|
10
|
+
}
|
|
11
|
+
return (React.createElement(ErrorMessage, { message: `Couldn't display ${attachment.mediaType} image because it wasn't base64 encoded or externalised` }));
|
|
12
|
+
};
|
|
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 })));
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=Image.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Attachment } from '@cucumber/messages';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
import { AttachmentClasses } from '../../customise/index.js';
|
|
4
|
+
export declare const Links: FC<{
|
|
5
|
+
attachment: Attachment;
|
|
6
|
+
classes: AttachmentClasses;
|
|
7
|
+
}>;
|
|
8
|
+
//# sourceMappingURL=Links.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { faLink } from '@fortawesome/free-solid-svg-icons';
|
|
2
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { useText } from './useText.js';
|
|
5
|
+
export const Links = ({ attachment, classes }) => {
|
|
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
|
+
})));
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=Links.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Attachment } from '@cucumber/messages';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
import { AttachmentClasses } from '../../customise/index.js';
|
|
4
|
+
export declare const Log: FC<{
|
|
5
|
+
attachment: Attachment;
|
|
6
|
+
classes: AttachmentClasses;
|
|
7
|
+
}>;
|
|
8
|
+
//# sourceMappingURL=Log.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import Convert from 'ansi-to-html';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useText } from './useText.js';
|
|
4
|
+
export const Log = ({ attachment, classes }) => {
|
|
5
|
+
const { content } = useText(attachment);
|
|
6
|
+
return (React.createElement("pre", { className: `${classes.text} ${classes.log}` },
|
|
7
|
+
React.createElement("span", { dangerouslySetInnerHTML: { __html: prettyANSI(content) } })));
|
|
8
|
+
};
|
|
9
|
+
function prettyANSI(s) {
|
|
10
|
+
return new Convert().toHtml(s);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=Log.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Attachment } from '@cucumber/messages';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
import { AttachmentClasses } from '../../customise/index.js';
|
|
4
|
+
export declare const Text: FC<{
|
|
5
|
+
attachment: Attachment;
|
|
6
|
+
prettify?: (body: string) => string;
|
|
7
|
+
classes: AttachmentClasses;
|
|
8
|
+
}>;
|
|
9
|
+
//# sourceMappingURL=Text.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ErrorMessage } from '../ErrorMessage.js';
|
|
3
|
+
import { useText } from './useText.js';
|
|
4
|
+
const identity = (s) => s;
|
|
5
|
+
export const Text = ({ attachment, prettify = identity, classes }) => {
|
|
6
|
+
const { title, loading, content, error } = useText(attachment);
|
|
7
|
+
if (loading) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
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
|
+
}
|
|
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)))));
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=Text.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { AttachmentContentEncoding } from '@cucumber/messages';
|
|
2
|
+
import { faPaperclip } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
4
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
5
|
+
import { NavigationButton } from '../../app/NavigationButton.js';
|
|
6
|
+
import { attachmentFilename } from './attachmentFilename.js';
|
|
7
|
+
import { base64Decode } from './base64Decode.js';
|
|
8
|
+
export const Unknown = ({ attachment }) => {
|
|
9
|
+
if (attachment.url) {
|
|
10
|
+
return React.createElement(UnknownExternalised, { attachment: attachment });
|
|
11
|
+
}
|
|
12
|
+
return React.createElement(UnknownEmbedded, { attachment: attachment });
|
|
13
|
+
};
|
|
14
|
+
const UnknownExternalised = ({ attachment }) => {
|
|
15
|
+
const filename = attachmentFilename(attachment);
|
|
16
|
+
const onClick = () => {
|
|
17
|
+
const anchor = document.createElement('a');
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
19
|
+
anchor.href = attachment.url;
|
|
20
|
+
anchor.download = filename;
|
|
21
|
+
anchor.click();
|
|
22
|
+
};
|
|
23
|
+
return (React.createElement(NavigationButton, { onClick: onClick },
|
|
24
|
+
React.createElement(FontAwesomeIcon, { icon: faPaperclip }),
|
|
25
|
+
"Download ",
|
|
26
|
+
filename));
|
|
27
|
+
};
|
|
28
|
+
const UnknownEmbedded = ({ attachment }) => {
|
|
29
|
+
const [downloadUrl, setDownloadUrl] = useState();
|
|
30
|
+
useEffect(() => () => cleanupDownloadUrl(downloadUrl), [downloadUrl]);
|
|
31
|
+
const filename = attachmentFilename(attachment);
|
|
32
|
+
const onClick = useCallback(() => {
|
|
33
|
+
let href;
|
|
34
|
+
if (downloadUrl) {
|
|
35
|
+
href = downloadUrl;
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
const createdUrl = createDownloadUrl(attachment);
|
|
39
|
+
setDownloadUrl(createdUrl);
|
|
40
|
+
href = createdUrl;
|
|
41
|
+
}
|
|
42
|
+
const anchor = document.createElement('a');
|
|
43
|
+
anchor.href = href;
|
|
44
|
+
anchor.download = filename;
|
|
45
|
+
anchor.click();
|
|
46
|
+
}, [attachment, filename, downloadUrl]);
|
|
47
|
+
return (React.createElement(NavigationButton, { onClick: onClick },
|
|
48
|
+
React.createElement(FontAwesomeIcon, { icon: faPaperclip }),
|
|
49
|
+
"Download ",
|
|
50
|
+
filename));
|
|
51
|
+
};
|
|
52
|
+
function createDownloadUrl(attachment) {
|
|
53
|
+
console.debug('Creating download url');
|
|
54
|
+
const body = attachment.contentEncoding === AttachmentContentEncoding.BASE64
|
|
55
|
+
? base64Decode(attachment.body)
|
|
56
|
+
: attachment.body;
|
|
57
|
+
const bytes = Uint8Array.from(body, (m) => m.codePointAt(0));
|
|
58
|
+
const file = new File([bytes], 'attachment', {
|
|
59
|
+
type: attachment.mediaType,
|
|
60
|
+
});
|
|
61
|
+
return URL.createObjectURL(file);
|
|
62
|
+
}
|
|
63
|
+
function cleanupDownloadUrl(url) {
|
|
64
|
+
if (url) {
|
|
65
|
+
console.debug('Revoking download url');
|
|
66
|
+
URL.revokeObjectURL(url);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=Unknown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Unknown.js","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/Unknown.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AAC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C,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAW,CAAC,CAAA;IAC9E,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE,YAAY,EAAE;QAC3C,IAAI,EAAE,UAAU,CAAC,SAAS;KAC3B,CAAC,CAAA;IACF,OAAO,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;AAClC,CAAC;AAED,SAAS,kBAAkB,CAAC,GAAY;IACtC,IAAI,GAAG,EAAE;QACP,OAAO,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAA;QACtC,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,CAAA;KACzB;AACH,CAAC"}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ErrorMessage } from '../ErrorMessage.js';
|
|
3
|
+
export const Video = ({ attachment }) => {
|
|
4
|
+
const title = attachment.fileName ?? 'Attached Video (' + attachment.mediaType + ')';
|
|
5
|
+
if (attachment.url) {
|
|
6
|
+
return React.createElement(VideoInternal, { src: attachment.url, title: title });
|
|
7
|
+
}
|
|
8
|
+
if (attachment.contentEncoding === 'BASE64') {
|
|
9
|
+
return (React.createElement(VideoInternal, { src: `data:${attachment.mediaType};base64,${attachment.body}`, title: title }));
|
|
10
|
+
}
|
|
11
|
+
return (React.createElement(ErrorMessage, { message: `Couldn't display ${attachment.mediaType} video because it wasn't base64 encoded or externalised` }));
|
|
12
|
+
};
|
|
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")));
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=Video.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/gherkin/attachment/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { base64Decode } from './base64Decode.js';
|
|
3
|
+
export function useText(attachment) {
|
|
4
|
+
const [loading, setLoading] = useState(false);
|
|
5
|
+
const [content, setContent] = useState(attachment.contentEncoding === 'BASE64' ? base64Decode(attachment.body) : attachment.body);
|
|
6
|
+
const [error, setError] = useState();
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
if (attachment.url) {
|
|
9
|
+
setLoading(true);
|
|
10
|
+
fetch(attachment.url)
|
|
11
|
+
.then((response) => {
|
|
12
|
+
if (response.status !== 200) {
|
|
13
|
+
throw new Error('HTTP error when fetching attachment content');
|
|
14
|
+
}
|
|
15
|
+
return response.text().then((text) => setContent(text));
|
|
16
|
+
})
|
|
17
|
+
.catch((e) => setError(e))
|
|
18
|
+
.finally(() => setLoading(false));
|
|
19
|
+
}
|
|
20
|
+
}, [attachment]);
|
|
21
|
+
return {
|
|
22
|
+
title: attachment.fileName ?? 'Attached Text (' + attachment.mediaType + ')',
|
|
23
|
+
loading,
|
|
24
|
+
content,
|
|
25
|
+
error,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=useText.js.map
|