html-reporter 8.4.3 → 9.1.1

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 (49) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +33 -1
  3. package/lib/config/index.js +17 -6
  4. package/lib/constants/defaults.js +2 -1
  5. package/lib/constants/diff-modes.js +32 -0
  6. package/lib/constants/plugin-events.js +2 -1
  7. package/lib/server-utils.js +1 -1
  8. package/lib/static/components/controls/common-controls.js +17 -15
  9. package/lib/static/components/controls/control-select/index.js +50 -0
  10. package/lib/static/components/controls/control-select/index.styl +44 -0
  11. package/lib/static/components/controls/controls.less +0 -31
  12. package/lib/static/components/icons/arrows-move.js +24 -0
  13. package/lib/static/components/modals/screenshot-accepter/body.js +4 -12
  14. package/lib/static/components/modals/screenshot-accepter/header.js +3 -32
  15. package/lib/static/components/state/index.js +2 -9
  16. package/lib/static/components/state/{diff-circle.js → screenshot/diff-circle.js} +1 -1
  17. package/lib/static/components/state/screenshot/full.js +28 -0
  18. package/lib/static/components/state/{screenshot.js → screenshot/resized.js} +28 -30
  19. package/lib/static/components/state/screenshot/with-encode-uri.js +44 -0
  20. package/lib/static/components/state/screenshot/with-synced-scale.js +116 -0
  21. package/lib/static/components/state/state-error.js +3 -3
  22. package/lib/static/components/state/state-fail/index.js +142 -0
  23. package/lib/static/components/state/state-fail/index.styl +31 -0
  24. package/lib/static/components/state/state-fail/onion-skin-diff/index.js +43 -0
  25. package/lib/static/components/state/state-fail/onion-skin-diff/index.styl +19 -0
  26. package/lib/static/components/state/state-fail/prop-types.js +16 -0
  27. package/lib/static/components/state/state-fail/swipe-diff/index.js +138 -0
  28. package/lib/static/components/state/state-fail/swipe-diff/index.styl +82 -0
  29. package/lib/static/components/state/state-fail/switch-diff/index.js +36 -0
  30. package/lib/static/components/state/state-fail/switch-diff/index.styl +12 -0
  31. package/lib/static/components/state/state-success.js +2 -2
  32. package/lib/static/gui.html +13 -0
  33. package/lib/static/gui.min.css +678 -0
  34. package/lib/static/gui.min.js +106 -0
  35. package/lib/static/index.html +13 -0
  36. package/lib/static/modules/action-names.js +6 -2
  37. package/lib/static/modules/actions.js +27 -3
  38. package/lib/static/modules/default-state.js +2 -2
  39. package/lib/static/modules/middlewares/local-storage.js +1 -2
  40. package/lib/static/modules/middlewares/metrika.js +6 -2
  41. package/lib/static/modules/reducers/view.js +27 -12
  42. package/lib/static/report.min.css +678 -0
  43. package/lib/static/report.min.js +106 -0
  44. package/lib/static/styles.css +3 -11
  45. package/lib/test-adapter.js +11 -2
  46. package/package.json +4 -2
  47. package/webpack.common.js +7 -0
  48. package/lib/static/components/controls/view-select.js +0 -50
  49. package/lib/static/components/state/state-fail.js +0 -56
@@ -0,0 +1,82 @@
1
+ .swipe-diff
2
+ display: grid
3
+ grid-template-areas: 'one one'
4
+ max-width: max-content
5
+ overflow: hidden
6
+ cursor: move
7
+
8
+ &_pressed .swipe-diff-divider__arrows
9
+ opacity: 0
10
+
11
+ &__overlay
12
+ overflow: hidden
13
+
14
+ &__img
15
+ max-width: 100%
16
+ pointer-events: none
17
+ user-select: none
18
+ border: 1px solid #ccc
19
+
20
+ &__first
21
+ grid-area: one
22
+ line-height: 0
23
+ transform: translateX(calc(var(--img1-pos-x) * -1))
24
+
25
+ .swipe-diff__frame
26
+ transform: translateX(var(--img1-pos-x))
27
+
28
+ &__second
29
+ line-height: 0
30
+ grid-area: one
31
+ transform: translateX(var(--img2-pos-x))
32
+ overflow: hidden
33
+
34
+ .swipe-diff__frame
35
+ transform: translateX(calc(var(--img2-pos-x) * -1))
36
+
37
+ &-divider
38
+ transform: translateX(50%)
39
+ position: absolute
40
+ height: 100%
41
+ top: 0
42
+ right: 0
43
+ display: flex
44
+ align-items: flex-end
45
+ justify-content: center
46
+ flex-direction: column
47
+
48
+ &__line
49
+ position: absolute
50
+ height: 100%
51
+ width: 100%
52
+ left: 0
53
+ top: 0
54
+ display: flex
55
+ align-items: center
56
+ justify-content: center
57
+ flex-direction: column
58
+
59
+ &:after
60
+ content: ''
61
+ display: block
62
+ height: 100%
63
+ border-left-width: 1px
64
+ border-left-style: solid
65
+ border-left-color: black
66
+
67
+ &__arrows
68
+ pointer-events: none
69
+ box-sizing: border-box
70
+ margin-left: 1px
71
+ transform: translateX(-0.5px)
72
+ opacity: 1
73
+ transition: opacity 500ms
74
+
75
+ .arrows-move
76
+ width: 60px
77
+
78
+ &__icon
79
+ stroke: black
80
+
81
+ .disable-user-select
82
+ user-select: none
@@ -0,0 +1,36 @@
1
+ import React, {Component} from 'react';
2
+ import FullScreenshot from '../../screenshot/full';
3
+ import withSyncedScale from '../../screenshot/with-synced-scale';
4
+ import {imageType, syncedImageType} from '../prop-types';
5
+
6
+ import './index.styl';
7
+
8
+ class SwitchDiff extends Component {
9
+ static propTypes = {
10
+ image1: imageType.isRequired,
11
+ image2: imageType.isRequired,
12
+ // from withSyncedScale
13
+ syncedImage1: syncedImageType.isRequired,
14
+ syncedImage2: syncedImageType.isRequired
15
+ }
16
+
17
+ state = {showFirst: true}
18
+
19
+ _handleClick = () => this.setState({showFirst: !this.state.showFirst})
20
+
21
+ render() {
22
+ const {image1, image2, syncedImage1, syncedImage2} = this.props;
23
+ const {showFirst} = this.state;
24
+ const displayImage1 = showFirst ? 'visible' : 'hidden';
25
+ const displayImage2 = !showFirst ? 'visible' : 'hidden';
26
+
27
+ return (
28
+ <div className={'switch-diff'} onClick={this._handleClick} >
29
+ <FullScreenshot className='switch-diff__img' image={image1} imgRef={syncedImage1.containerRef} style={{width: syncedImage1.width, visibility: displayImage1}} />
30
+ <FullScreenshot className='switch-diff__img' image={image2} imgRef={syncedImage2.containerRef} style={{width: syncedImage2.width, visibility: displayImage2}} />
31
+ </div>
32
+ );
33
+ }
34
+ }
35
+
36
+ export default withSyncedScale(SwitchDiff);
@@ -0,0 +1,12 @@
1
+ .switch-diff
2
+ display: grid
3
+ grid-template-areas: 'one one'
4
+ max-width: max-content
5
+ cursor: pointer
6
+
7
+ &__img
8
+ grid-area: one
9
+ max-width: 100%
10
+ pointer-events: none
11
+ user-select: none
12
+ border: 1px solid #ccc
@@ -2,7 +2,7 @@
2
2
 
3
3
  import React, {Component} from 'react';
4
4
  import PropTypes from 'prop-types';
5
- import Screenshot from './screenshot';
5
+ import ResizedScreenshot from './screenshot/resized';
6
6
  import {isUpdatedStatus} from '../../../common-utils';
7
7
 
8
8
  export default class StateSuccess extends Component {
@@ -16,7 +16,7 @@ export default class StateSuccess extends Component {
16
16
 
17
17
  return (
18
18
  <div className="image-box__image">
19
- <Screenshot noCache={isUpdatedStatus(status)} image={expectedImg}/>
19
+ <ResizedScreenshot noCache={isUpdatedStatus(status)} image={expectedImg}/>
20
20
  </div>
21
21
  );
22
22
  }
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Gui report</title>
5
+ <meta charset="utf-8">
6
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"/>
7
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css"/>
8
+ <link id="dynamic-favicon" rel="icon" type="image/png" href="icons/favicon.png" />
9
+ <link href="gui.min.css" rel="stylesheet"></head>
10
+ <body class="report">
11
+ <div id="app"></div>
12
+ <script type="text/javascript" src="sql-wasm.js"></script><script type="text/javascript" src="gui.min.js"></script></body>
13
+ </html>