{"name":"@cucumber/react","version":"8.1.0","description":"React components for Cucumber","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/cucumber/cucumber.git"},"author":{"name":"Aslak Hellesøy"},"license":"MIT","scripts":{"nyc":"nyc --reporter=html --reporter=text mocha","test":"mocha","lint":"eslint --ext ts,tsx --max-warnings 0 src test","lint-fix":"eslint --ext ts,tsx --max-warnings 0 --fix src test","build":"tsc","storybook":"start-storybook -p 6006","build-storybook":"build-storybook"},"dependencies":{"@cucumber/gherkin-utils":"^1.0.1","@cucumber/messages":"^12.3.2","@cucumber/query":"^6.1.0","@cucumber/tag-expressions":"^2.0.4","@fortawesome/fontawesome":"^1.1.8","@fortawesome/fontawesome-svg-core":"^1.2.30","@fortawesome/free-regular-svg-icons":"^5.14.0","@fortawesome/free-solid-svg-icons":"^5.14.0","@fortawesome/react-fontawesome":"^0.1.11","@teppeis/multimaps":"^1.1.0","@types/elasticlunr":"^0.9.0","ansi-to-html":"^0.6.14","color":"^3.1.2","elasticlunr":"^0.9.5","marked":"^1.1.1","react-accessible-accordion":"^3.3.1","sanitize-html":"^1.27.2"},"peerDependencies":{"react":"^16.13.1","react-dom":"^16.13.1"},"devDependencies":{"@babel/core":"^7.10.5","@cucumber/fake-cucumber":"^7.1.0","@cucumber/gherkin":"^14.1.0","@storybook/addon-actions":"^5.3.19","@storybook/addon-links":"^5.3.19","@storybook/addons":"^5.3.19","@storybook/react":"^5.3.19","@types/color":"^3.0.1","@types/jsdom":"^16.2.3","@types/marked":"^1.1.0","@types/mocha":"^8.0.0","@types/node":"^14.0.27","@types/react":"^16.9.43","@types/react-dom":"^16.9.8","@types/sanitize-html":"^1.23.3","@types/styled-components":"^5.1.1","@typescript-eslint/eslint-plugin":"^3.7.1","@typescript-eslint/parser":"^3.7.1","awesome-typescript-loader":"^5.2.1","babel-loader":"^8.1.0","css-loader":"4.1.0","eslint":"^7.5.0","eslint-config-prettier":"^6.11.0","eslint-config-react":"^1.1.7","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react":"^7.20.5","jsdom":"^16.3.0","json-schema":"^0.2.5","mocha":"^8.0.1","node-sass":"4.14.1","nyc":"^15.1.0","prettier":"^2.0.5","raw-loader":"^4.0.1","sass":"^1.26.10","sass-loader":"^9.0.2","sinon":"^9.0.2","source-map-support":"^0.5.19","style-loader":"1.2.1","ts-node":"^8.10.2","ts-sinon":"^1.2.0","typescript":"^3.9.7","webpack":"^4.44.0","webpack-cli":"^3.3.12"},"bugs":{"url":"https://github.com/cucumber/cucumber/issues"},"homepage":"https://github.com/cucumber/cucumber#readme","directories":{"test":"test"},"keywords":[],"_id":"@cucumber/react@8.1.0","_nodeVersion":"12.16.2","_npmVersion":"6.14.5","dist":{"integrity":"sha512-xXJzz+ClSmO2bx/gEALj17EmPmJNoEnvC+pAzRkHSIRzln5hVUAnZs2PKNDNeVxaQlCRM1RGK3IEW5A3WCfRlg==","shasum":"62f67882765521e1dbc51bf824cf8489b8ab0559","tarball":"http://registry-npm.ywwl.com/@cucumber/react/download/@cucumber/react-8.1.0.tgz","fileCount":372,"unpackedSize":3537110,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIlwMCRA9TVsSAnZWagAAJScP/3EdFWj3D8mvqw0hzBIw\nsae45cWroF/On1NW/ptCgCZ2ho+KTGpEjZvhKGvRU6Nxi5JEjVkiVD9LbqXB\nKFjlGq6pUXmi9Brvzx4XZAmBZSFAFDwaZTGgT2KeU+ZGZ9RAg8QsBoF/w12C\nMstcDovd8U7gaDmqpYw8kOjh7lj8O5EayrJzgAITPsGtWiya62wOXIi52fES\nYh7fpuQj7/6ZxY0f1pFdvWAW95/btqSU+XZILScxOT+zEtLcsU44Jw2aZSBp\nZunxkLuAO/NpaVK6dtoxZax5A9nlNITaKH2T7COftf+EoEt7SjzzwKtA76Pb\n/rhtV1y7ujqJnnogdaj39QNfow79a0VDNlp+JwhXDWFvPhwjT5WAWn/Wq7P6\nTaI3erxff/7jBOwtvUiiodVG0df6IntZEf9VXYZNLtfCTnH7pPJH6qx0ohlj\n5N8MIni/z/PDIq4ZTUUYFCw6FElpKmK0D9jsfhJLb+eSD+6t5+QW/O8T9msW\ndb9vIydEPRAXlG+0c0eDjkXp+junTpkw0Iowo9MH+EyOhcGUl4Q8A1x+x4Em\nDtzIeR6nVyN4kikyyzTA8e9MQlg2W+l40mCc67Tn2CNrG696tqvbEnzVowfQ\nh0OKtyQBMo9qDXi2afrn5y0nwj0Sqe2NHkYPXNkwYZX+9upoMMadbp67LuBM\nAPDB\r\n=Zxtq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEQvKMD8xaN1lENyqOkPkIzjTMf1hCzaxO9mtR7YZwxDAiAd7elrO1UaiYL3mm/+NnjO2BNqeMglwGGx1OQl+u4ggw=="}],"size":1005710,"noattachment":false,"key":"/@cucumber/react/-/@cucumber/react-8.1.0.tgz"},"maintainers":[{"name":"aslakhellesoy","email":"aslak.hellesoy@gmail.com"},{"name":"cukebot","email":"cukebot@cucumber.io"}],"_npmUser":{"name":"cukebot","email":"cukebot@cucumber.io"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react_8.1.0_1596087308069_0.23235970501934222"},"_hasShrinkwrap":false,"deprecated":"This package is now published under @cucumber/react-components","readme":"# Cucumber-React\n\nCucumber-React is a set of React components for rendering Gherkin documents and Cucumber results.\n\n## Screenshot\n\n![Examples Tables](screenshots/examples-tables.png)\n\n## Usage\n\nThe source code for screenshots above is:\n\n```jsx\n<EnvelopesWrapper envelopes={envelopes}>\n  <GherkinDocumentList />\n</EnvelopesWrapper>\n```\n\nThe [`<GherkinDocumentList>`](src/components/app/GherkinDocumentList.tsx) React component,\nis an accordion of [`<GherkinDocument>`](src/components/gherkin/GherkinDocument.tsx).\n\nThe `<GherkinDocument>` React component and any component nested within it (such as [`<Scenario>`](src/components/gherkin/Scenario.tsx)) can be rendered standalone.\n\n## `<GherkinDocument>` features\n\nThe `<GherkinDocument>` React component is instantiated with a single `gherkinDocument` prop.\nThe value must be a [GherkinDocument](../../cucumber-messages/messages.md#io.cucumber.messages.GherkinDocument) object.\nYou can use the [Gherkin](../../gherkin) parser to generate a `GherkinDocument` object.\n\nBy default the `<GherkinDocument>` component will not display any coloured results, as the `GherkinDocument`\nmessage object does not contain results, only the [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree) of the document. \nThis is fine for simple use cases where results are not important.\n\nTo render a `<GherkinDocument>` with results and highlighted [Cucumber Expression parameters](https://cucumber.io/docs/cucumber/cucumber-expressions/) parameters it must be nested inside a \n[`<Wrapper>`](src/components/app/Wrapper.tsx) component.\n\n## Styling\n\nThe 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.\n\n### Built-in themes\n\nThese are the built-in themes:\n\n- `light` (default)\n- `dark`\n- `auto` (honours your operating system preference for either light or dark)\n\nYou can activate one of these by passing the `theme` prop to the `CucumberReact` component:\n\n```jsx\n<CucumberReact theme=\"dark\">\n  <GherkinDocument />\n</CucumberReact>\n```\n\n### Custom themes\n\nYou can also provide your own theme with a small amount of CSS. Pass the `CucumberReact` component a class name instead of a theme name:\n\n```jsx\n<CucumberReact className=\"acme-widgets\">\n  <GherkinDocument />\n</CucumberReact>\n```\n\nIn your CSS for the `acme-widgets` class, you can override the supported [custom property](https://developer.mozilla.org/en-US/docs/Web/CSS/--*) values as desired. Here's the CSS that drives the built-in \"dark\" theme:\n\n```css\n.darkTheme {\n  --cucumber-background-color: #1d1d26;\n  --cucumber-text-color: #c9c9d1;\n  --cucumber-anchor-color: #4caaee;\n  --cucumber-keyword-color: #d89077;\n  --cucumber-parameter-color: #4caaee;\n  --cucumber-tag-color: #85a658;\n  --cucumber-docstring-color: #66a565;\n  --cucumber-error-background-color: #cf6679;\n  --cucumber-error-text-color: #222;\n  --cucumber-code-background-color: #282a36;\n  --cucumber-code-text-color: #f8f8f2;\n  --cucumber-panel-background-color: #282a36;\n  --cucumber-panel-accent-color: #313442;\n  --cucumber-panel-text-color: #f8f8f2;\n}\n```\n\n### Custom styles\n\nFor more control over the styling, you can override the CSS used by individual components.\n\nLet's say you want to do something totally different with the typography of doc strings. In your own CSS, you might write something like:\n\n```css\n.acme-docstring {\n  font-weight: bold;\n  font-style: italic;\n  background-color: black;\n  color: hotpink;\n  text-shadow: 1px 1px 2px white;\n  padding: 10px;\n}\n```\n\nThen, you can provide a `customRendering` prop to the `CucumberReact` component, in the form of an object that declares which class names you're going to override and what with:\n\n```jsx\n<CucumberReact customRendering={{\n  DocString: {\n    docString: 'acme-docstring'\n  }\n}}>\n  <GherkinDocument />\n</CucumberReact>\n```\n\nSome components have multiple styling hooks - e.g. the `<Tags>` component has the `tags` class name for the list, and the `tag` class name for each item. In these cases, you can provide custom class names for just the ones you want to change, and any you omit will pick up the built-in styling like normal.\n\n### Custom rendering\n\nTo change the rendering of some components entirely, you can selectively provide your own component implementations to be used instead of the built-in ones.\n\nStaying with the doc string example, you can use the same `customRendering` prop, but this time instead of an object with class names, you provide a React functional component, giving you full control over the rendering:\n\n```jsx\n<CucumberReact customRendering={{\n  DocString: (props) => (\n    <>\n      <p>I am going to render this doc string in a textarea:</p>\n      <textarea>{props.docString.content}</textarea>\n    </>\n  )\n}}>\n  <GherkinDocument />\n</CucumberReact>\n```\n\nIn each case where you provide your own component, it will receive the same props as the default component, plus two more:\n\n- `styles` - class names for the default styling, so you can still apply these to your custom component if it makes sense\n- `DefaultRenderer` - the default React component, useful if you only want to provide your own rendering for certain cases, and otherwise fall back to the default rendering (don't forget to pass it the props)\n\n## Build / hack\n\nInstall dependencies\n\n    npm install\n\nRun tests\n\n    npm test\n\nInteractive development\n\n    npm run storybook\n\n## Ideas\n\n### `ScenarioList` component\n\nA component that renders a list of scenarios (possibly from multiple files, filtered by e.g. tag). \n\nThis component could be used to render relevant scenarios in 3rd-party tools, such as \nJIRA, Confluence and various issue trackers that support plugins.\n\n### Link to JIRA\n\nConfigure with a regexp and url function, and tags will be rendered as JIRA issue links\n\n### Search\n\nSearch by tag, but also by text. Could use http://elasticlunr.com/\nor https://lunrjs.com/ - or it could simply perform filtering on an array of `GherkinDocument` messages.\n\n### Search results\n\nEach scenario displayed underneath each other, grouped by feature file. The feature description is \"collapsed\", \n(unless it contains the search term) but can be opened.\n\n### Filtering / sorting\n\n* by tag\n* by duration (find slow ones)\n* by status\n* by recency (update timestamp) - exclude old ones\n* by flickeriness\n\n### Tag search\n\n* Render a tag cloud for all tags\n  * Size: count\n  * Color: pass/fail/undefined\n    \n### On-demand data\n\nFor large reports (especially with screenshots) it may be too heavy to store it all in the browser.\nThe GUI should request data for the current document on demand. The GUI should also be able to filter\nwhat kind of events it wants. For example, to render the initial screen.\n\n### Server / App\n\nIt should be easy to use. Just run the app (Electron). It will create a named pipe where\nit will listen. What's written here gets written straight to the React app (no websocket,\nit's in the same process). This app can be fairly small.\n\n### Rerun tests\n\nAdd a message to represent a config+cwd+env for a run, so the GUI can rerun it.\nThe config is essentially command line options. They can be modified in the gui.\nRerun on file change can also be set up. This just makes the whole DX simple.\n\n### Alerts\n\nThe app could use the OS to send screen messages (autotest like)\n\n","publish_time":1596087308278,"_cnpm_publish_time":1596087308278,"dist-tags":{"latest":"19.2.0"}}