html-reporter 9.9.2 → 9.10.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.
- package/build/gemini.d.ts +2 -0
- package/{gemini.js → build/gemini.js} +1 -1
- package/build/gemini.js.map +1 -0
- package/build/hermione.d.ts +2 -0
- package/{hermione.js → build/hermione.js} +3 -21
- package/build/hermione.js.map +1 -0
- package/build/lib/cli-commands/gui.d.ts +2 -0
- package/{lib → build/lib}/cli-commands/gui.js +5 -7
- package/build/lib/cli-commands/gui.js.map +1 -0
- package/build/lib/cli-commands/index.d.ts +3 -0
- package/{lib → build/lib}/cli-commands/index.js +1 -1
- package/build/lib/cli-commands/index.js.map +1 -0
- package/build/lib/cli-commands/merge-reports.d.ts +2 -0
- package/{lib → build/lib}/cli-commands/merge-reports.js +11 -11
- package/build/lib/cli-commands/merge-reports.js.map +1 -0
- package/build/lib/cli-commands/remove-unused-screens/index.d.ts +2 -0
- package/{lib → build/lib}/cli-commands/remove-unused-screens/index.js +61 -110
- package/build/lib/cli-commands/remove-unused-screens/index.js.map +1 -0
- package/build/lib/cli-commands/remove-unused-screens/utils.d.ts +16 -0
- package/{lib → build/lib}/cli-commands/remove-unused-screens/utils.js +10 -48
- package/build/lib/cli-commands/remove-unused-screens/utils.js.map +1 -0
- package/build/lib/common-utils.d.ts +24 -0
- package/build/lib/common-utils.js +116 -0
- package/build/lib/common-utils.js.map +1 -0
- package/build/lib/config/custom-gui-asserts.d.ts +1 -0
- package/{lib → build/lib}/config/custom-gui-asserts.js +2 -12
- package/build/lib/config/custom-gui-asserts.js.map +1 -0
- package/build/lib/config/index.d.ts +21 -0
- package/{lib → build/lib}/config/index.js +7 -32
- package/build/lib/config/index.js.map +1 -0
- package/build/lib/constants/browser.d.ts +3 -0
- package/build/lib/constants/browser.js +5 -0
- package/build/lib/constants/browser.js.map +1 -0
- package/build/lib/constants/checked-statuses.d.ts +3 -0
- package/build/lib/constants/checked-statuses.js +7 -0
- package/build/lib/constants/checked-statuses.js.map +1 -0
- package/build/lib/constants/database.d.ts +25 -0
- package/build/lib/constants/database.js +47 -0
- package/build/lib/constants/database.js.map +1 -0
- package/build/lib/constants/defaults.d.ts +18 -0
- package/{lib → build/lib}/constants/defaults.js +1 -2
- package/build/lib/constants/defaults.js.map +1 -0
- package/build/lib/constants/diff-modes.d.ts +53 -0
- package/{lib → build/lib}/constants/diff-modes.js +2 -0
- package/build/lib/constants/diff-modes.js.map +1 -0
- package/build/lib/constants/errors.d.ts +5 -0
- package/{lib → build/lib}/constants/errors.js +1 -1
- package/build/lib/constants/errors.js.map +1 -0
- package/build/lib/constants/expand-modes.d.ts +4 -0
- package/{lib → build/lib}/constants/expand-modes.js +1 -1
- package/build/lib/constants/expand-modes.js.map +1 -0
- package/build/lib/constants/extension-points.d.ts +4 -0
- package/build/lib/constants/extension-points.js +8 -0
- package/build/lib/constants/extension-points.js.map +1 -0
- package/build/lib/constants/group-tests.d.ts +7 -0
- package/{lib → build/lib}/constants/group-tests.js +2 -0
- package/build/lib/constants/group-tests.js.map +1 -0
- package/build/lib/constants/paths.d.ts +2 -0
- package/{lib → build/lib}/constants/paths.js +1 -1
- package/build/lib/constants/paths.js.map +1 -0
- package/build/lib/constants/plugin-events.d.ts +5 -0
- package/{lib → build/lib}/constants/plugin-events.js +2 -4
- package/build/lib/constants/plugin-events.js.map +1 -0
- package/build/lib/constants/save-formats.d.ts +1 -0
- package/{lib → build/lib}/constants/save-formats.js +1 -1
- package/build/lib/constants/save-formats.js.map +1 -0
- package/build/lib/constants/test-statuses.d.ts +8 -0
- package/{lib → build/lib}/constants/test-statuses.js +1 -1
- package/build/lib/constants/test-statuses.js.map +1 -0
- package/build/lib/constants/view-modes.d.ts +5 -0
- package/{lib → build/lib}/constants/view-modes.js +1 -1
- package/build/lib/constants/view-modes.js.map +1 -0
- package/build/lib/db-utils/client.d.ts +19 -0
- package/{lib → build/lib}/db-utils/client.js +18 -45
- package/build/lib/db-utils/client.js.map +1 -0
- package/build/lib/db-utils/common.d.ts +10 -0
- package/build/lib/db-utils/common.js +56 -0
- package/build/lib/db-utils/common.js.map +1 -0
- package/build/lib/db-utils/server.d.ts +16 -0
- package/{lib → build/lib}/db-utils/server.js +15 -41
- package/build/lib/db-utils/server.js.map +1 -0
- package/build/lib/gui/api/facade.d.ts +8 -0
- package/{lib → build/lib}/gui/api/facade.js +1 -4
- package/build/lib/gui/api/facade.js.map +1 -0
- package/build/lib/gui/api/index.d.ts +9 -0
- package/{lib → build/lib}/gui/api/index.js +1 -5
- package/build/lib/gui/api/index.js.map +1 -0
- package/build/lib/gui/app.d.ts +62 -0
- package/{lib → build/lib}/gui/app.js +2 -21
- package/build/lib/gui/app.js.map +1 -0
- package/build/lib/gui/constants/client-events.d.ts +6 -0
- package/{lib → build/lib}/gui/constants/client-events.js +1 -4
- package/build/lib/gui/constants/client-events.js.map +1 -0
- package/build/lib/gui/constants/custom-gui-control-types.d.ts +2 -0
- package/{lib → build/lib}/gui/constants/custom-gui-control-types.js +1 -1
- package/build/lib/gui/constants/custom-gui-control-types.js.map +1 -0
- package/build/lib/gui/constants/gui-events.d.ts +2 -0
- package/{lib → build/lib}/gui/constants/gui-events.js +1 -1
- package/build/lib/gui/constants/gui-events.js.map +1 -0
- package/build/lib/gui/constants/server.d.ts +3 -0
- package/{lib → build/lib}/gui/constants/server.js +1 -1
- package/build/lib/gui/constants/server.js.map +1 -0
- package/build/lib/gui/event-source.d.ts +6 -0
- package/{lib → build/lib}/gui/event-source.js +2 -5
- package/build/lib/gui/event-source.js.map +1 -0
- package/build/lib/gui/index.d.ts +12 -0
- package/build/lib/gui/index.js +22 -0
- package/build/lib/gui/index.js.map +1 -0
- package/build/lib/gui/routes/plugins.d.ts +2 -0
- package/{lib → build/lib}/gui/routes/plugins.js +9 -24
- package/build/lib/gui/routes/plugins.js.map +1 -0
- package/build/lib/gui/server.d.ts +8 -0
- package/{lib → build/lib}/gui/server.js +32 -51
- package/build/lib/gui/server.js.map +1 -0
- package/build/lib/gui/tool-runner/index.d.ts +123 -0
- package/{lib → build/lib}/gui/tool-runner/index.js +42 -122
- package/build/lib/gui/tool-runner/index.js.map +1 -0
- package/build/lib/gui/tool-runner/report-subscriber.d.ts +2 -0
- package/{lib → build/lib}/gui/tool-runner/report-subscriber.js +7 -30
- package/build/lib/gui/tool-runner/report-subscriber.js.map +1 -0
- package/build/lib/gui/tool-runner/runner/all-test-runner.d.ts +4 -0
- package/{lib → build/lib}/gui/tool-runner/runner/all-test-runner.js +1 -3
- package/build/lib/gui/tool-runner/runner/all-test-runner.js.map +1 -0
- package/build/lib/gui/tool-runner/runner/index.d.ts +3 -0
- package/{lib → build/lib}/gui/tool-runner/runner/index.js +1 -2
- package/build/lib/gui/tool-runner/runner/index.js.map +1 -0
- package/build/lib/gui/tool-runner/runner/runner.d.ts +6 -0
- package/{lib → build/lib}/gui/tool-runner/runner/runner.js +1 -2
- package/build/lib/gui/tool-runner/runner/runner.js.map +1 -0
- package/build/lib/gui/tool-runner/runner/specific-test-runner.d.ts +7 -0
- package/{lib → build/lib}/gui/tool-runner/runner/specific-test-runner.js +2 -8
- package/build/lib/gui/tool-runner/runner/specific-test-runner.js.map +1 -0
- package/build/lib/gui/tool-runner/utils.d.ts +7 -0
- package/{lib → build/lib}/gui/tool-runner/utils.js +11 -35
- package/build/lib/gui/tool-runner/utils.js.map +1 -0
- package/build/lib/history-utils.d.ts +1 -0
- package/{lib → build/lib}/history-utils.js +5 -20
- package/build/lib/history-utils.js.map +1 -0
- package/build/lib/local-images-saver.d.ts +4 -0
- package/build/lib/local-images-saver.js +9 -0
- package/build/lib/local-images-saver.js.map +1 -0
- package/build/lib/merge-reports/index.d.ts +4 -0
- package/{lib → build/lib}/merge-reports/index.js +3 -8
- package/build/lib/merge-reports/index.js.map +1 -0
- package/build/lib/plugin-adapter.d.ts +32 -0
- package/{lib → build/lib}/plugin-adapter.js +8 -25
- package/build/lib/plugin-adapter.js.map +1 -0
- package/build/lib/plugin-api.d.ts +57 -0
- package/{lib → build/lib}/plugin-api.js +2 -20
- package/build/lib/plugin-api.js.map +1 -0
- package/build/lib/plugin-utils.d.ts +3 -0
- package/{lib → build/lib}/plugin-utils.js +3 -5
- package/build/lib/plugin-utils.js.map +1 -0
- package/build/lib/report-builder/gui.d.ts +73 -0
- package/{lib → build/lib}/report-builder/gui.js +33 -92
- package/build/lib/report-builder/gui.js.map +1 -0
- package/build/lib/report-builder/static.d.ts +32 -0
- package/{lib → build/lib}/report-builder/static.js +25 -64
- package/build/lib/report-builder/static.js.map +1 -0
- package/build/lib/reporter-helpers.d.ts +3 -0
- package/{lib → build/lib}/reporter-helpers.js +2 -11
- package/build/lib/reporter-helpers.js.map +1 -0
- package/build/lib/server-utils.d.ts +42 -0
- package/{lib → build/lib}/server-utils.js +37 -92
- package/build/lib/server-utils.js.map +1 -0
- package/build/lib/sqlite-adapter.d.ts +78 -0
- package/{lib → build/lib}/sqlite-adapter.js +15 -56
- package/build/lib/sqlite-adapter.js.map +1 -0
- package/build/lib/static/gui.min.css +1 -0
- package/build/lib/static/gui.min.js +124 -0
- package/build/lib/static/modules/utils.d.ts +31 -0
- package/{lib → build/lib}/static/modules/utils.js +16 -56
- package/build/lib/static/modules/utils.js.map +1 -0
- package/{lib → build/lib}/static/report.min.css +1 -1
- package/build/lib/static/report.min.js +124 -0
- package/build/lib/suite-adapter.d.ts +15 -0
- package/{lib → build/lib}/suite-adapter.js +2 -18
- package/build/lib/suite-adapter.js.map +1 -0
- package/build/lib/test-adapter.d.ts +118 -0
- package/{lib → build/lib}/test-adapter.js +38 -156
- package/build/lib/test-adapter.js.map +1 -0
- package/build/lib/tests-tree-builder/base.d.ts +70 -0
- package/{lib → build/lib}/tests-tree-builder/base.js +34 -74
- package/build/lib/tests-tree-builder/base.js.map +1 -0
- package/build/lib/tests-tree-builder/gui.d.ts +47 -0
- package/{lib → build/lib}/tests-tree-builder/gui.js +12 -63
- package/build/lib/tests-tree-builder/gui.js.map +1 -0
- package/build/lib/tests-tree-builder/static.d.ts +55 -0
- package/{lib → build/lib}/tests-tree-builder/static.js +11 -42
- package/build/lib/tests-tree-builder/static.js.map +1 -0
- package/build/lib/workers/create-workers.d.ts +2 -0
- package/{lib → build/lib}/workers/create-workers.js +1 -2
- package/build/lib/workers/create-workers.js.map +1 -0
- package/build/lib/workers/worker.d.ts +1 -0
- package/build/lib/workers/worker.js +13 -0
- package/build/lib/workers/worker.js.map +1 -0
- package/build/package.json +178 -0
- package/package.json +44 -23
- package/2html-reporter.iml +0 -9
- package/CHANGELOG.md +0 -2886
- package/docs/en/html-reporter-api.md +0 -198
- package/docs/en/html-reporter-commands.md +0 -96
- package/docs/en/html-reporter-custom-gui.md +0 -99
- package/docs/en/html-reporter-events.md +0 -125
- package/docs/en/html-reporter-plugins.md +0 -265
- package/docs/en/html-reporter-setup.md +0 -378
- package/docs/en/html-reporter.md +0 -8
- package/docs/ru/html-reporter-api.md +0 -198
- package/docs/ru/html-reporter-commands.md +0 -96
- package/docs/ru/html-reporter-custom-gui.md +0 -99
- package/docs/ru/html-reporter-events.md +0 -125
- package/docs/ru/html-reporter-plugins.md +0 -265
- package/docs/ru/html-reporter-setup.md +0 -378
- package/docs/ru/html-reporter.md +0 -8
- package/lib/common-utils.js +0 -117
- package/lib/constants/browser.js +0 -3
- package/lib/constants/database.js +0 -49
- package/lib/constants/extension-points.js +0 -6
- package/lib/db-utils/common.js +0 -76
- package/lib/gui/index.js +0 -19
- package/lib/local-images-saver.js +0 -11
- package/lib/static/components/bottom-progress-bar/index.js +0 -42
- package/lib/static/components/controls/accept-opened-button.js +0 -39
- package/lib/static/components/controls/base-host-input.js +0 -39
- package/lib/static/components/controls/browser-list/index.js +0 -239
- package/lib/static/components/controls/browser-list/index.styl +0 -52
- package/lib/static/components/controls/browser-list/label.js +0 -60
- package/lib/static/components/controls/browser-list/label.styl +0 -18
- package/lib/static/components/controls/browser-list/utils.js +0 -43
- package/lib/static/components/controls/common-controls.js +0 -75
- package/lib/static/components/controls/common-filters.js +0 -32
- package/lib/static/components/controls/control-button.js +0 -54
- package/lib/static/components/controls/controls.less +0 -109
- package/lib/static/components/controls/custom-gui-controls.js +0 -70
- package/lib/static/components/controls/find-same-diffs-button.js +0 -47
- package/lib/static/components/controls/gui-controls.js +0 -81
- package/lib/static/components/controls/menu-bar.js +0 -47
- package/lib/static/components/controls/report-controls.js +0 -21
- package/lib/static/components/controls/report-info.js +0 -31
- package/lib/static/components/controls/run-button.js +0 -27
- package/lib/static/components/controls/selects/control.js +0 -51
- package/lib/static/components/controls/selects/group-tests.js +0 -94
- package/lib/static/components/controls/selects/index.styl +0 -57
- package/lib/static/components/controls/strict-match-filter-input.js +0 -39
- package/lib/static/components/controls/test-name-filter-input.js +0 -42
- package/lib/static/components/custom-scripts.js +0 -23
- package/lib/static/components/details.js +0 -58
- package/lib/static/components/error-boundary.js +0 -26
- package/lib/static/components/extension-point.js +0 -106
- package/lib/static/components/favicon-changer.js +0 -56
- package/lib/static/components/group-tests/item.js +0 -39
- package/lib/static/components/group-tests/list.js +0 -71
- package/lib/static/components/group-tests/prop-types.js +0 -12
- package/lib/static/components/gui.js +0 -105
- package/lib/static/components/header/header.css +0 -5
- package/lib/static/components/header/index.js +0 -26
- package/lib/static/components/header/summary/dbBtn.js +0 -36
- package/lib/static/components/header/summary/dbSummary.js +0 -49
- package/lib/static/components/header/summary/index.js +0 -43
- package/lib/static/components/header/summary/item.js +0 -28
- package/lib/static/components/header/summary/summary.css +0 -77
- package/lib/static/components/icons/arrow.js +0 -24
- package/lib/static/components/icons/arrows-close.js +0 -25
- package/lib/static/components/icons/arrows-move.js +0 -24
- package/lib/static/components/icons/arrows-open.js +0 -25
- package/lib/static/components/icons/view-in-browser/index.js +0 -59
- package/lib/static/components/icons/view-in-browser/index.styl +0 -28
- package/lib/static/components/loading.js +0 -25
- package/lib/static/components/main-tree.js +0 -23
- package/lib/static/components/modals/find-same-diffs.js +0 -34
- package/lib/static/components/modals/index.js +0 -6
- package/lib/static/components/modals/modal.css +0 -3
- package/lib/static/components/modals/modal.js +0 -27
- package/lib/static/components/modals/screenshot-accepter/body.js +0 -88
- package/lib/static/components/modals/screenshot-accepter/header.js +0 -192
- package/lib/static/components/modals/screenshot-accepter/index.js +0 -228
- package/lib/static/components/modals/screenshot-accepter/meta.js +0 -32
- package/lib/static/components/modals/screenshot-accepter/style.css +0 -115
- package/lib/static/components/popup/index.js +0 -85
- package/lib/static/components/popup/index.styl +0 -37
- package/lib/static/components/progress-bar/index.js +0 -13
- package/lib/static/components/progress-bar/index.styl +0 -24
- package/lib/static/components/report.js +0 -72
- package/lib/static/components/retry-switcher/index.js +0 -36
- package/lib/static/components/retry-switcher/item.js +0 -55
- package/lib/static/components/section/body/description.js +0 -24
- package/lib/static/components/section/body/history/index.js +0 -29
- package/lib/static/components/section/body/history/index.styl +0 -4
- package/lib/static/components/section/body/index.js +0 -114
- package/lib/static/components/section/body/meta-info/content.js +0 -114
- package/lib/static/components/section/body/meta-info/index.js +0 -33
- package/lib/static/components/section/body/result.js +0 -41
- package/lib/static/components/section/body/tabs.js +0 -52
- package/lib/static/components/section/section-browser.js +0 -113
- package/lib/static/components/section/section-common.js +0 -100
- package/lib/static/components/section/section-wrapper.js +0 -20
- package/lib/static/components/section/title/browser-skipped.js +0 -22
- package/lib/static/components/section/title/browser.js +0 -74
- package/lib/static/components/section/title/simple.js +0 -82
- package/lib/static/components/state/error-details.js +0 -18
- package/lib/static/components/state/index.js +0 -208
- package/lib/static/components/state/screenshot/diff-circle.js +0 -66
- package/lib/static/components/state/screenshot/full.js +0 -28
- package/lib/static/components/state/screenshot/resized.js +0 -90
- package/lib/static/components/state/screenshot/with-encode-uri.js +0 -44
- package/lib/static/components/state/screenshot/with-synced-scale.js +0 -116
- package/lib/static/components/state/state-error.js +0 -140
- package/lib/static/components/state/state-fail/index.js +0 -161
- package/lib/static/components/state/state-fail/index.styl +0 -31
- package/lib/static/components/state/state-fail/onion-skin-diff/index.js +0 -43
- package/lib/static/components/state/state-fail/onion-skin-diff/index.styl +0 -19
- package/lib/static/components/state/state-fail/prop-types.js +0 -16
- package/lib/static/components/state/state-fail/swipe-diff/index.js +0 -138
- package/lib/static/components/state/state-fail/swipe-diff/index.styl +0 -82
- package/lib/static/components/state/state-fail/switch-diff/index.js +0 -36
- package/lib/static/components/state/state-fail/switch-diff/index.styl +0 -12
- package/lib/static/components/state/state-fail/useFitImages.js +0 -63
- package/lib/static/components/state/state-success.js +0 -23
- package/lib/static/components/sticky-header/gui.js +0 -12
- package/lib/static/components/sticky-header/index.js +0 -36
- package/lib/static/components/sticky-header/index.styl +0 -37
- package/lib/static/components/sticky-header/report.js +0 -14
- package/lib/static/components/suites.js +0 -157
- package/lib/static/containers/array/array.styl +0 -32
- package/lib/static/containers/array/index.js +0 -61
- package/lib/static/containers/modal.js +0 -43
- package/lib/static/gui.css +0 -161
- package/lib/static/gui.js +0 -14
- package/lib/static/gui.min.css +0 -1
- package/lib/static/gui.min.js +0 -124
- package/lib/static/hooks/useElementSize.js +0 -30
- package/lib/static/hooks/useEventListener.js +0 -25
- package/lib/static/hooks/useWindowSize.js +0 -25
- package/lib/static/index.js +0 -14
- package/lib/static/modules/action-names.js +0 -57
- package/lib/static/modules/actions.js +0 -332
- package/lib/static/modules/custom-queries.js +0 -27
- package/lib/static/modules/default-state.js +0 -84
- package/lib/static/modules/load-plugin.js +0 -109
- package/lib/static/modules/local-storage-wrapper.js +0 -54
- package/lib/static/modules/middlewares/local-storage.js +0 -30
- package/lib/static/modules/middlewares/metrika.js +0 -121
- package/lib/static/modules/plugins.js +0 -52
- package/lib/static/modules/query-params.js +0 -98
- package/lib/static/modules/reducers/api-values.js +0 -25
- package/lib/static/modules/reducers/auto-run.js +0 -14
- package/lib/static/modules/reducers/bottom-progress-bar.js +0 -16
- package/lib/static/modules/reducers/browsers.js +0 -43
- package/lib/static/modules/reducers/close-ids.js +0 -12
- package/lib/static/modules/reducers/config.js +0 -48
- package/lib/static/modules/reducers/date.js +0 -16
- package/lib/static/modules/reducers/db.js +0 -30
- package/lib/static/modules/reducers/fetch-db-details.js +0 -13
- package/lib/static/modules/reducers/grouped-tests/by/meta.js +0 -31
- package/lib/static/modules/reducers/grouped-tests/by/result.js +0 -57
- package/lib/static/modules/reducers/grouped-tests/helpers.js +0 -91
- package/lib/static/modules/reducers/grouped-tests/index.js +0 -52
- package/lib/static/modules/reducers/gui.js +0 -16
- package/lib/static/modules/reducers/index.js +0 -56
- package/lib/static/modules/reducers/loading.js +0 -12
- package/lib/static/modules/reducers/modals.js +0 -16
- package/lib/static/modules/reducers/notifications.js +0 -12
- package/lib/static/modules/reducers/plugins.js +0 -25
- package/lib/static/modules/reducers/processing.js +0 -21
- package/lib/static/modules/reducers/running.js +0 -19
- package/lib/static/modules/reducers/skips.js +0 -15
- package/lib/static/modules/reducers/stats.js +0 -21
- package/lib/static/modules/reducers/stopping.js +0 -16
- package/lib/static/modules/reducers/tree/helpers.js +0 -28
- package/lib/static/modules/reducers/tree/index.js +0 -314
- package/lib/static/modules/reducers/tree/nodes/browsers.js +0 -109
- package/lib/static/modules/reducers/tree/nodes/images.js +0 -59
- package/lib/static/modules/reducers/tree/nodes/results.js +0 -39
- package/lib/static/modules/reducers/tree/nodes/suites.js +0 -239
- package/lib/static/modules/reducers/view.js +0 -93
- package/lib/static/modules/selectors/grouped-tests.js +0 -8
- package/lib/static/modules/selectors/index.js +0 -3
- package/lib/static/modules/selectors/stats.js +0 -33
- package/lib/static/modules/selectors/tree.js +0 -256
- package/lib/static/modules/selectors/view.js +0 -5
- package/lib/static/modules/store.js +0 -25
- package/lib/static/modules/web-vitals.js +0 -13
- package/lib/static/modules/yandex-metrika.js +0 -50
- package/lib/static/report.min.js +0 -124
- package/lib/static/styles.css +0 -887
- package/lib/static/template.html +0 -13
- package/lib/workers/worker.js +0 -15
- package/webpack.common.js +0 -95
- package/webpack.dev.js +0 -25
- package/webpack.prod.js +0 -19
- /package/{lib → build/lib}/static/gui.html +0 -0
- /package/{lib → build/lib}/static/icons/favicon-failure.png +0 -0
- /package/{lib → build/lib}/static/icons/favicon-running.png +0 -0
- /package/{lib → build/lib}/static/icons/favicon-success.png +0 -0
- /package/{lib → build/lib}/static/icons/favicon.png +0 -0
- /package/{lib → build/lib}/static/index.html +0 -0
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
import React, {Fragment, useEffect, useState} from 'react';
|
|
4
|
-
import {connect} from 'react-redux';
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
6
|
-
import classNames from 'classnames';
|
|
7
|
-
import ResizedScreenshot from '../screenshot/resized';
|
|
8
|
-
import SwipeDiff from './swipe-diff';
|
|
9
|
-
import SwitchDiff from './switch-diff';
|
|
10
|
-
import OnionSkinDiff from './onion-skin-diff';
|
|
11
|
-
import diffModes from '../../../../constants/diff-modes';
|
|
12
|
-
import {types} from '../../modals';
|
|
13
|
-
import useFitImages from './useFitImages';
|
|
14
|
-
|
|
15
|
-
import './index.styl';
|
|
16
|
-
|
|
17
|
-
const StateFail = ({image, diffMode: diffModeProp, isScreenshotAccepterOpened}) => {
|
|
18
|
-
const [diffMode, setDiffMode] = useState(diffModeProp);
|
|
19
|
-
const [fitWidths, {expectedRef, actualRef}] = useFitImages(image, isScreenshotAccepterOpened);
|
|
20
|
-
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
setDiffMode(diffModeProp);
|
|
23
|
-
}, [diffModeProp, setDiffMode]);
|
|
24
|
-
|
|
25
|
-
const renderDiffModeItem = (mode) => {
|
|
26
|
-
const className = classNames(
|
|
27
|
-
'diff-modes__item',
|
|
28
|
-
{'diff-modes__active': diffMode === mode.id}
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<li
|
|
33
|
-
key={mode.id}
|
|
34
|
-
title={mode.description}
|
|
35
|
-
className={className}
|
|
36
|
-
onClick={() => setDiffMode(mode.id)}
|
|
37
|
-
>
|
|
38
|
-
{mode.title}
|
|
39
|
-
</li>
|
|
40
|
-
);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const renderDiffModeItems = () => {
|
|
44
|
-
const diffModeItems = Object.values(diffModes).map(renderDiffModeItem);
|
|
45
|
-
|
|
46
|
-
return (
|
|
47
|
-
<ul className="diff-modes">
|
|
48
|
-
{diffModeItems}
|
|
49
|
-
</ul>
|
|
50
|
-
);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const getLabelKey = () => {
|
|
54
|
-
const images = [image.expectedImg, image.actualImg];
|
|
55
|
-
const sizes = images.map(image => `${image.size.width}${image.size.height}`);
|
|
56
|
-
const key = sizes.join('');
|
|
57
|
-
|
|
58
|
-
return key;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const drawImageBox = (image, {label, diffClusters, width, ref} = {}) => {
|
|
62
|
-
const titleText = `${label} (${image.size.width}x${image.size.height})`;
|
|
63
|
-
const titleKey = getLabelKey();
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
<div className="image-box__image" style={{flex: image.size.width}}>
|
|
67
|
-
{label && <div key={titleKey} ref={ref} className="image-box__title">{titleText}</div>}
|
|
68
|
-
<ResizedScreenshot
|
|
69
|
-
image={image}
|
|
70
|
-
diffClusters={diffClusters}
|
|
71
|
-
overrideWidth={width}
|
|
72
|
-
/>
|
|
73
|
-
</div>
|
|
74
|
-
);
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
const renderOnlyDiff = () => {
|
|
78
|
-
const {diffImg, diffClusters} = image;
|
|
79
|
-
|
|
80
|
-
return drawImageBox(diffImg, {diffClusters});
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const drawExpectedAndActual = ({expectedImg, expectedWidth}, {actualImg, actualWidth}) => {
|
|
84
|
-
return (
|
|
85
|
-
<Fragment>
|
|
86
|
-
{drawImageBox(expectedImg, {label: 'Expected', width: expectedWidth, ref: expectedRef})}
|
|
87
|
-
{drawImageBox(actualImg, {label: 'Actual', width: actualWidth, ref: actualRef})}
|
|
88
|
-
</Fragment>
|
|
89
|
-
);
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
const renderThreeImages = (fitWidths = []) => {
|
|
93
|
-
const {expectedImg, actualImg, diffImg, diffClusters} = image;
|
|
94
|
-
const [expectedWidth, actualWidth, diffWidth] = fitWidths;
|
|
95
|
-
|
|
96
|
-
return <Fragment>
|
|
97
|
-
{drawExpectedAndActual({expectedImg, expectedWidth}, {actualImg, actualWidth})}
|
|
98
|
-
{drawImageBox(diffImg, {label: 'Diff', diffClusters, width: diffWidth})}
|
|
99
|
-
</Fragment>;
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
const renderImages = () => {
|
|
103
|
-
const {expectedImg, actualImg} = image;
|
|
104
|
-
|
|
105
|
-
switch (diffMode) {
|
|
106
|
-
case diffModes.ONLY_DIFF.id:
|
|
107
|
-
return renderOnlyDiff();
|
|
108
|
-
|
|
109
|
-
case diffModes.SWITCH.id:
|
|
110
|
-
return <SwitchDiff image1={expectedImg} image2={actualImg} />;
|
|
111
|
-
|
|
112
|
-
case diffModes.SWIPE.id:
|
|
113
|
-
return <SwipeDiff image1={expectedImg} image2={actualImg} />;
|
|
114
|
-
|
|
115
|
-
case diffModes.ONION_SKIN.id:
|
|
116
|
-
return <OnionSkinDiff image1={expectedImg} image2={actualImg} />;
|
|
117
|
-
|
|
118
|
-
case diffModes.THREE_UP_SCALED.id:
|
|
119
|
-
return <div className="image-box__scaled">
|
|
120
|
-
{renderThreeImages()}
|
|
121
|
-
</div>;
|
|
122
|
-
|
|
123
|
-
case diffModes.THREE_UP_SCALED_TO_FIT.id:
|
|
124
|
-
return <div className="image-box__scaled">
|
|
125
|
-
{renderThreeImages(fitWidths)}
|
|
126
|
-
</div>;
|
|
127
|
-
|
|
128
|
-
case diffModes.THREE_UP.id:
|
|
129
|
-
default:
|
|
130
|
-
return renderThreeImages();
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
return (
|
|
135
|
-
<Fragment>
|
|
136
|
-
{renderDiffModeItems()}
|
|
137
|
-
{renderImages()}
|
|
138
|
-
</Fragment>
|
|
139
|
-
);
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
StateFail.propTypes = {
|
|
143
|
-
image: PropTypes.shape({
|
|
144
|
-
expectedImg: PropTypes.object.isRequired,
|
|
145
|
-
actualImg: PropTypes.object.isRequired,
|
|
146
|
-
diffImg: PropTypes.object.isRequired,
|
|
147
|
-
diffClusters: PropTypes.array
|
|
148
|
-
}).isRequired,
|
|
149
|
-
// from store
|
|
150
|
-
diffMode: PropTypes.string,
|
|
151
|
-
isScreenshotAccepterOpened: PropTypes.bool.isRequired
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
export default connect(
|
|
155
|
-
({modals, view}) => {
|
|
156
|
-
const diffMode = view.diffMode;
|
|
157
|
-
const isScreenshotAccepterOpened = modals.some(modal => modal.id === types.SCREENSHOT_ACCEPTER);
|
|
158
|
-
|
|
159
|
-
return {diffMode, isScreenshotAccepterOpened};
|
|
160
|
-
}
|
|
161
|
-
)(StateFail);
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
.diff-modes
|
|
2
|
-
display: flex
|
|
3
|
-
justify-content: center
|
|
4
|
-
border-bottom: 1px solid #ccc
|
|
5
|
-
padding: 5px 0
|
|
6
|
-
margin: 10px auto
|
|
7
|
-
width: 520px
|
|
8
|
-
|
|
9
|
-
&__item
|
|
10
|
-
display: inline-block
|
|
11
|
-
padding: 0 5px
|
|
12
|
-
cursor: pointer
|
|
13
|
-
|
|
14
|
-
&__item:not(:last-child)
|
|
15
|
-
border-right: 1px solid #ccc
|
|
16
|
-
|
|
17
|
-
&__active
|
|
18
|
-
font-weight: bold
|
|
19
|
-
|
|
20
|
-
.image-box__scaled
|
|
21
|
-
display: flex
|
|
22
|
-
flex-flow: row wrap
|
|
23
|
-
|
|
24
|
-
.image-box__image
|
|
25
|
-
padding: 0 5px
|
|
26
|
-
|
|
27
|
-
&:first-child
|
|
28
|
-
padding-left: 0
|
|
29
|
-
|
|
30
|
-
&:last-child
|
|
31
|
-
padding-right: 0
|
|
@@ -1,43 +0,0 @@
|
|
|
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
|
-
const DEFAULT_IMAGE_TRANSPARENCY = 0.5;
|
|
9
|
-
|
|
10
|
-
class OnionSkinDiff extends Component {
|
|
11
|
-
static propTypes = {
|
|
12
|
-
image1: imageType.isRequired,
|
|
13
|
-
image2: imageType.isRequired,
|
|
14
|
-
// from withSyncedScale
|
|
15
|
-
syncedImage1: syncedImageType.isRequired,
|
|
16
|
-
syncedImage2: syncedImageType.isRequired
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
state = {imgTransparency: DEFAULT_IMAGE_TRANSPARENCY}
|
|
20
|
-
|
|
21
|
-
_handleChangeTransparency = (e) => {
|
|
22
|
-
return this.setState({imgTransparency: parseFloat(e.target.value)});
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
render() {
|
|
26
|
-
const {image1, image2, syncedImage1, syncedImage2} = this.props;
|
|
27
|
-
const {imgTransparency} = this.state;
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<div className='onion-skin-diff'>
|
|
31
|
-
<div className='onion-skin-diff__img-container'>
|
|
32
|
-
<FullScreenshot className='onion-skin-diff__img' image={image1} imgRef={syncedImage1.containerRef} style={{width: syncedImage1.width}} />
|
|
33
|
-
<FullScreenshot className='onion-skin-diff__img' image={image2} imgRef={syncedImage2.containerRef} style={{width: syncedImage2.width, opacity: imgTransparency}} />
|
|
34
|
-
</div>
|
|
35
|
-
<div className="onion-skin-diff__footer">
|
|
36
|
-
<input className='onion-skin-diff__slider' type="range" min={0} max={1} step={0.01} value={imgTransparency} onChange={this._handleChangeTransparency} />
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export default withSyncedScale(OnionSkinDiff);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
.onion-skin-diff
|
|
2
|
-
&__img-container
|
|
3
|
-
display: grid
|
|
4
|
-
grid-template-areas: 'one one'
|
|
5
|
-
max-width: max-content
|
|
6
|
-
|
|
7
|
-
&__img
|
|
8
|
-
max-width: 100%
|
|
9
|
-
grid-area: one
|
|
10
|
-
border: 1px solid #ccc
|
|
11
|
-
|
|
12
|
-
&__footer
|
|
13
|
-
display: flex
|
|
14
|
-
justify-content: center
|
|
15
|
-
|
|
16
|
-
&__slider
|
|
17
|
-
width: 250px
|
|
18
|
-
margin-top: 10px
|
|
19
|
-
cursor: pointer
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
|
|
3
|
-
export const imageType = PropTypes.shape({
|
|
4
|
-
path: PropTypes.string.isRequired,
|
|
5
|
-
size: PropTypes.shape({
|
|
6
|
-
width: PropTypes.number,
|
|
7
|
-
height: PropTypes.number
|
|
8
|
-
})
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
export const syncedImageType = PropTypes.shape({
|
|
12
|
-
containerRef: PropTypes.shape({
|
|
13
|
-
current: PropTypes.instanceOf(Element)
|
|
14
|
-
}),
|
|
15
|
-
width: PropTypes.number
|
|
16
|
-
});
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import React, {Component} from 'react';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import FullScreenshot from '../../screenshot/full';
|
|
5
|
-
import ArrowsMove from '../../../icons/arrows-move';
|
|
6
|
-
import withSyncedScale from '../../screenshot/with-synced-scale';
|
|
7
|
-
import {imageType, syncedImageType} from '../prop-types';
|
|
8
|
-
|
|
9
|
-
import './index.styl';
|
|
10
|
-
|
|
11
|
-
function clamp(n, min = 0, max = 100) {
|
|
12
|
-
return Math.max(Math.min(n, max), min);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
class SwipeDiff extends Component {
|
|
16
|
-
static propTypes = {
|
|
17
|
-
image1: imageType.isRequired,
|
|
18
|
-
image2: imageType.isRequired,
|
|
19
|
-
// from withSyncedScale
|
|
20
|
-
syncedImage1: syncedImageType.isRequired,
|
|
21
|
-
syncedImage2: syncedImageType.isRequired,
|
|
22
|
-
resizesNum: PropTypes.number.isRequired,
|
|
23
|
-
getRenderedImgWidth: PropTypes.func.isRequired
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
constructor(props) {
|
|
27
|
-
super(props);
|
|
28
|
-
|
|
29
|
-
this._swipeContainer = React.createRef();
|
|
30
|
-
this._swipeContainerLeft = 0;
|
|
31
|
-
|
|
32
|
-
this.state = {
|
|
33
|
-
mousePosX: 0,
|
|
34
|
-
isPressed: false,
|
|
35
|
-
dividerWasMoved: false
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
componentDidMount() {
|
|
40
|
-
this._swipeContainerLeft = this._swipeContainer.current.getBoundingClientRect().left;
|
|
41
|
-
|
|
42
|
-
this.setState({mousePosX: this._getMiddleMousePosX()});
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
componentDidUpdate(prevProps) {
|
|
46
|
-
if (this.state.dividerWasMoved || prevProps.resizesNum === this.props.resizesNum) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
this.setState({mousePosX: this._getMiddleMousePosX()});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
_getMiddleMousePosX() {
|
|
54
|
-
const {image1, syncedImage1, syncedImage2, getRenderedImgWidth} = this.props;
|
|
55
|
-
const middlePosX = Math.min(getRenderedImgWidth(syncedImage1), getRenderedImgWidth(syncedImage2)) / 2;
|
|
56
|
-
|
|
57
|
-
return clamp(middlePosX, 0, image1.size.width);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
_getMousePosX(e) {
|
|
61
|
-
const newMousePosX = e.pageX - this._swipeContainerLeft - window.scrollX;
|
|
62
|
-
return clamp(newMousePosX, 0, this.props.syncedImage1.width);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
_calcImgPosX(width) {
|
|
66
|
-
const imgPosX = this.state.mousePosX / width * 100;
|
|
67
|
-
return clamp(imgPosX, 0, 100);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
_handleMouseMove = (e) => {
|
|
71
|
-
if (!this.state.isPressed) {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
this.setState({mousePosX: this._getMousePosX(e)});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
_handleMouseDown = (e) => {
|
|
79
|
-
this.setState({mousePosX: this._getMousePosX(e), isPressed: true, dividerWasMoved: true});
|
|
80
|
-
|
|
81
|
-
window.addEventListener('mousemove', this._handleMouseMove);
|
|
82
|
-
window.addEventListener('mouseup', this._handleMouseUp);
|
|
83
|
-
|
|
84
|
-
document.body.classList.add('disable-user-select');
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
_handleMouseUp = () => {
|
|
88
|
-
this.setState({isPressed: false});
|
|
89
|
-
document.body.classList.remove('disable-user-select');
|
|
90
|
-
|
|
91
|
-
window.removeEventListener('mouseup', this._handleMouseUp);
|
|
92
|
-
window.removeEventListener('mousemove', this._handleMouseMove);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
render() {
|
|
96
|
-
const {image1, image2, syncedImage1, syncedImage2, getRenderedImgWidth} = this.props;
|
|
97
|
-
const {isPressed} = this.state;
|
|
98
|
-
|
|
99
|
-
const maxRenderedWidth = Math.max(getRenderedImgWidth(syncedImage1), getRenderedImgWidth(syncedImage2));
|
|
100
|
-
const img1PosX = 100 - this._calcImgPosX(maxRenderedWidth);
|
|
101
|
-
const img2PosX = this._calcImgPosX(maxRenderedWidth);
|
|
102
|
-
|
|
103
|
-
const className = classNames(
|
|
104
|
-
'swipe-diff',
|
|
105
|
-
{'swipe-diff_pressed': isPressed}
|
|
106
|
-
);
|
|
107
|
-
|
|
108
|
-
return (
|
|
109
|
-
<div
|
|
110
|
-
className={className}
|
|
111
|
-
style={{'--img1-pos-x': `${img1PosX}%`, '--img2-pos-x': `${img2PosX}%`}}
|
|
112
|
-
ref={this._swipeContainer}
|
|
113
|
-
onMouseDown={this._handleMouseDown}
|
|
114
|
-
>
|
|
115
|
-
<div className='swipe-diff__second'>
|
|
116
|
-
<div className='swipe-diff__frame'>
|
|
117
|
-
<FullScreenshot className='swipe-diff__img' image={image2} imgRef={syncedImage2.containerRef} style={{width: syncedImage2.width}} />
|
|
118
|
-
</div>
|
|
119
|
-
</div>
|
|
120
|
-
<div className="swipe-diff__first">
|
|
121
|
-
<div className="swipe-diff__overlay">
|
|
122
|
-
<div className='swipe-diff__frame'>
|
|
123
|
-
<FullScreenshot className='swipe-diff__img' image={image1} imgRef={syncedImage1.containerRef} style={{width: syncedImage1.width}} />
|
|
124
|
-
</div>
|
|
125
|
-
</div>
|
|
126
|
-
<div className="swipe-diff-divider">
|
|
127
|
-
<div className="swipe-diff-divider__line"></div>
|
|
128
|
-
<div className="swipe-diff-divider__arrows">
|
|
129
|
-
<ArrowsMove />
|
|
130
|
-
</div>
|
|
131
|
-
</div>
|
|
132
|
-
</div>
|
|
133
|
-
</div>
|
|
134
|
-
);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export default withSyncedScale(SwipeDiff);
|
|
@@ -1,82 +0,0 @@
|
|
|
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
|
|
@@ -1,36 +0,0 @@
|
|
|
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);
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import {useMemo} from 'react';
|
|
2
|
-
import {clamp} from 'lodash';
|
|
3
|
-
import useWindowSize from '../../../hooks/useWindowSize';
|
|
4
|
-
import useElementSize from '../../../hooks/useElementSize';
|
|
5
|
-
|
|
6
|
-
const TITLE_DEFAULT_TOP_OFFSET = 280;
|
|
7
|
-
const MIN_SHRINK_RATIO = 1;
|
|
8
|
-
const MAX_SHRINK_RATIO = 2;
|
|
9
|
-
|
|
10
|
-
export default function useFitImages(image, isScreenshotAccepterOpened) {
|
|
11
|
-
const {height: windowHeight} = useWindowSize();
|
|
12
|
-
const [expectedRef, expectedPos] = useElementSize();
|
|
13
|
-
const [actualRef, actualPos] = useElementSize();
|
|
14
|
-
|
|
15
|
-
const imagesWidth = useMemo(() => {
|
|
16
|
-
return [image.expectedImg, image.actualImg, image.diffImg].map(img => img.size.width);
|
|
17
|
-
}, [image]);
|
|
18
|
-
|
|
19
|
-
const imagesHeight = useMemo(() => {
|
|
20
|
-
return [image.expectedImg, image.actualImg, image.diffImg].map(img => img.size.height);
|
|
21
|
-
}, [image]);
|
|
22
|
-
|
|
23
|
-
const sectionsWidth = useMemo(() => {
|
|
24
|
-
const expectedWidth = expectedPos.width;
|
|
25
|
-
const actualWidth = actualPos.width;
|
|
26
|
-
const diffWidth = Math.max(expectedWidth, actualWidth);
|
|
27
|
-
|
|
28
|
-
return [expectedWidth, actualWidth, diffWidth];
|
|
29
|
-
}, [expectedPos, actualPos]);
|
|
30
|
-
|
|
31
|
-
const displayedImagesWidth = useMemo(() => {
|
|
32
|
-
return sectionsWidth.map((sectionWidth, i) => Math.min(sectionWidth, imagesWidth[i]));
|
|
33
|
-
}, [sectionsWidth, imagesWidth]);
|
|
34
|
-
|
|
35
|
-
const displayedImagesHeight = useMemo(() => {
|
|
36
|
-
return imagesHeight.map((height, i) => height * displayedImagesWidth[i] / imagesWidth[i]);
|
|
37
|
-
}, [imagesHeight, imagesWidth, displayedImagesWidth]);
|
|
38
|
-
|
|
39
|
-
const topOffsets = useMemo(() => {
|
|
40
|
-
const expectedRightBorder = expectedPos.left + expectedPos.width;
|
|
41
|
-
const actualLeftBorder = actualPos.left;
|
|
42
|
-
const imageGap = (actualLeftBorder - expectedRightBorder) / 2;
|
|
43
|
-
|
|
44
|
-
const expectedTitleOffset = isScreenshotAccepterOpened ? expectedPos.top : TITLE_DEFAULT_TOP_OFFSET;
|
|
45
|
-
const actualTitleOffset = isScreenshotAccepterOpened ? actualPos.top : TITLE_DEFAULT_TOP_OFFSET;
|
|
46
|
-
|
|
47
|
-
const expectedImageOffset = expectedTitleOffset + expectedPos.height + imageGap;
|
|
48
|
-
const actualImageOffset = actualTitleOffset + actualPos.height + imageGap;
|
|
49
|
-
const diffImageOffset = Math.min(expectedImageOffset, actualImageOffset);
|
|
50
|
-
|
|
51
|
-
return [expectedImageOffset, actualImageOffset, diffImageOffset];
|
|
52
|
-
}, [expectedPos, actualPos, isScreenshotAccepterOpened]);
|
|
53
|
-
|
|
54
|
-
return useMemo(() => {
|
|
55
|
-
const availableHeights = topOffsets.map(offset => windowHeight - offset);
|
|
56
|
-
const shrinkCoef = displayedImagesHeight.reduce((acc, height, i) => {
|
|
57
|
-
return clamp(height / availableHeights[i], acc, MAX_SHRINK_RATIO);
|
|
58
|
-
}, MIN_SHRINK_RATIO);
|
|
59
|
-
const fitWidths = displayedImagesWidth.map((width) => width / shrinkCoef);
|
|
60
|
-
|
|
61
|
-
return [fitWidths, {expectedRef, actualRef}];
|
|
62
|
-
}, [topOffsets, displayedImagesWidth, windowHeight]);
|
|
63
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
import React, {Component} from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
|
-
import ResizedScreenshot from './screenshot/resized';
|
|
6
|
-
import {isUpdatedStatus} from '../../../common-utils';
|
|
7
|
-
|
|
8
|
-
export default class StateSuccess extends Component {
|
|
9
|
-
static propTypes = {
|
|
10
|
-
status: PropTypes.string.isRequired,
|
|
11
|
-
expectedImg: PropTypes.object.isRequired
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
render() {
|
|
15
|
-
const {status, expectedImg} = this.props;
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<div className="image-box__image">
|
|
19
|
-
<ResizedScreenshot noCache={isUpdatedStatus(status)} image={expectedImg}/>
|
|
20
|
-
</div>
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import StickyHeaderTemplate from '.';
|
|
4
|
-
import ControlButtons from '../controls/gui-controls';
|
|
5
|
-
|
|
6
|
-
const StickyHeader = () => (
|
|
7
|
-
<StickyHeaderTemplate>
|
|
8
|
-
<ControlButtons />
|
|
9
|
-
</StickyHeaderTemplate>
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
export default StickyHeader;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React, {useState, useCallback} from 'react';
|
|
2
|
-
import {throttle} from 'lodash';
|
|
3
|
-
|
|
4
|
-
import './index.styl';
|
|
5
|
-
import useEventListener from '../../hooks/useEventListener';
|
|
6
|
-
|
|
7
|
-
const MAX_SHOW_HEADER = 10;
|
|
8
|
-
const MIN_HIDE_HEADER = 30;
|
|
9
|
-
|
|
10
|
-
const StickyHeader = ({children}) => {
|
|
11
|
-
const [scrollHeight, setScrollHeight] = useState(0);
|
|
12
|
-
const shouldWrap = scrollHeight > MAX_SHOW_HEADER;
|
|
13
|
-
const handleScroll = useCallback(throttle(() => {
|
|
14
|
-
const shouldShow = scroll => (scroll < MAX_SHOW_HEADER && window.scrollY > MIN_HIDE_HEADER);
|
|
15
|
-
const shouldHide = scroll => (scroll > MIN_HIDE_HEADER && window.scrollY < MAX_SHOW_HEADER);
|
|
16
|
-
const shouldUpdate = scroll => shouldShow(scroll) || shouldHide(scroll);
|
|
17
|
-
const cb = scroll => shouldUpdate(scroll)
|
|
18
|
-
? window.scrollY
|
|
19
|
-
: scroll;
|
|
20
|
-
|
|
21
|
-
setScrollHeight(cb);
|
|
22
|
-
}, 100), [setScrollHeight]);
|
|
23
|
-
|
|
24
|
-
useEventListener('scroll', handleScroll);
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<div className={`sticky-header sticky-header_${shouldWrap ? 'wrapped' : 'unwrapped'}`}>
|
|
28
|
-
<div className="sticky-header__wrap" />
|
|
29
|
-
<div className="sticky-header__content">
|
|
30
|
-
{children}
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export default StickyHeader;
|