creevey 0.10.0-beta.8 → 0.10.0-beta.9
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/dist/client/addon/components/Panel.js +2 -2
- package/dist/client/addon/components/Panel.js.map +1 -1
- package/dist/client/addon/withCreevey.js +9 -1
- package/dist/client/addon/withCreevey.js.map +1 -1
- package/dist/client/shared/components/ImagesView/SwapView.js +12 -0
- package/dist/client/shared/components/ImagesView/SwapView.js.map +1 -1
- package/dist/client/shared/components/PageHeader/ImagePreview.js +1 -0
- package/dist/client/shared/components/PageHeader/ImagePreview.js.map +1 -1
- package/dist/client/shared/components/ResultsPage.js +23 -5
- package/dist/client/shared/components/ResultsPage.js.map +1 -1
- package/dist/client/web/CreeveyApp.js +22 -6
- package/dist/client/web/CreeveyApp.js.map +1 -1
- package/dist/client/web/CreeveyContext.d.ts +5 -0
- package/dist/client/web/CreeveyContext.js +3 -0
- package/dist/client/web/CreeveyContext.js.map +1 -1
- package/dist/client/web/CreeveyView/SideBar/Search.js +2 -2
- package/dist/client/web/CreeveyView/SideBar/Search.js.map +1 -1
- package/dist/client/web/CreeveyView/SideBar/SideBarFooter.js +49 -6
- package/dist/client/web/CreeveyView/SideBar/SideBarFooter.js.map +1 -1
- package/dist/client/web/CreeveyView/SideBar/SuiteLink.js +1 -3
- package/dist/client/web/CreeveyView/SideBar/SuiteLink.js.map +1 -1
- package/dist/client/web/CreeveyView/SideBar/TestLink.js +1 -3
- package/dist/client/web/CreeveyView/SideBar/TestLink.js.map +1 -1
- package/dist/client/web/KeyboardEventsContext.d.ts +1 -8
- package/dist/client/web/KeyboardEventsContext.js +62 -57
- package/dist/client/web/KeyboardEventsContext.js.map +1 -1
- package/dist/client/web/assets/{index-DB8lHlJw.js → index-BE9CL5_G.js} +94 -94
- package/dist/client/web/index.html +1 -1
- package/dist/server/index.js +4 -0
- package/dist/server/index.js.map +1 -1
- package/dist/server/playwright/internal.d.ts +2 -2
- package/dist/server/playwright/internal.js +10 -8
- package/dist/server/playwright/internal.js.map +1 -1
- package/dist/server/selenium/internal.d.ts +2 -2
- package/dist/server/selenium/internal.js +10 -8
- package/dist/server/selenium/internal.js.map +1 -1
- package/dist/server/utils.js +2 -3
- package/dist/server/utils.js.map +1 -1
- package/dist/server/worker/start.js +17 -4
- package/dist/server/worker/start.js.map +1 -1
- package/package.json +1 -1
- package/src/client/addon/components/Panel.tsx +2 -2
- package/src/client/addon/withCreevey.ts +6 -1
- package/src/client/shared/components/ImagesView/SwapView.tsx +18 -0
- package/src/client/shared/components/PageHeader/ImagePreview.tsx +1 -0
- package/src/client/shared/components/ResultsPage.tsx +28 -7
- package/src/client/web/CreeveyApp.tsx +25 -7
- package/src/client/web/CreeveyContext.tsx +9 -0
- package/src/client/web/CreeveyView/SideBar/Search.tsx +3 -3
- package/src/client/web/CreeveyView/SideBar/SideBarFooter.tsx +37 -6
- package/src/client/web/CreeveyView/SideBar/SuiteLink.tsx +3 -5
- package/src/client/web/CreeveyView/SideBar/TestLink.tsx +2 -4
- package/src/client/web/KeyboardEventsContext.tsx +61 -73
- package/src/server/index.ts +5 -0
- package/src/server/playwright/internal.ts +9 -9
- package/src/server/selenium/internal.ts +9 -9
- package/src/server/utils.ts +2 -3
- package/src/server/worker/start.ts +18 -5
@@ -23,18 +23,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
23
|
return result;
|
24
24
|
};
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
-
exports.KeyboardEvents =
|
26
|
+
exports.KeyboardEvents = void 0;
|
27
27
|
const react_1 = __importStar(require("react"));
|
28
28
|
const types_js_1 = require("../../types.js");
|
29
29
|
const helpers_js_1 = require("../shared/helpers.js");
|
30
30
|
const CreeveyContext_js_1 = require("./CreeveyContext.js");
|
31
|
-
exports.KeyboardEventsContext = react_1.default.createContext({
|
32
|
-
sidebarFocusedItem: [],
|
33
|
-
setSidebarFocusedItem: types_js_1.noop,
|
34
|
-
});
|
35
31
|
const KeyboardEvents = ({ children, rootSuite, filter, }) => {
|
36
|
-
const
|
37
|
-
const { onSuiteOpen, onSuiteToggle } = (0, react_1.useContext)(CreeveyContext_js_1.CreeveyContext);
|
32
|
+
const { onSuiteOpen, onSuiteToggle, sidebarFocusedItem, setSidebarFocusedItem } = (0, CreeveyContext_js_1.useCreeveyContext)();
|
38
33
|
const suiteList = (0, helpers_js_1.flattenSuite)((0, helpers_js_1.filterTests)(rootSuite, filter));
|
39
34
|
const getFocusedItemIndex = (0, react_1.useCallback)((item) => {
|
40
35
|
return suiteList.findIndex((x) => {
|
@@ -45,72 +40,82 @@ const KeyboardEvents = ({ children, rootSuite, filter, }) => {
|
|
45
40
|
const handleKeyDown = (0, react_1.useCallback)((e) => {
|
46
41
|
if (sidebarFocusedItem === null)
|
47
42
|
return;
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
43
|
+
switch (e.code) {
|
44
|
+
case 'Enter': {
|
45
|
+
if (sidebarFocusedItem.length === 0)
|
46
|
+
return;
|
47
|
+
const focusedSuite = (0, helpers_js_1.getSuiteByPath)(rootSuite, sidebarFocusedItem);
|
48
|
+
if (!focusedSuite)
|
49
|
+
return;
|
50
|
+
if (!(0, types_js_1.isTest)(focusedSuite)) {
|
51
|
+
e.preventDefault();
|
52
|
+
onSuiteOpen(focusedSuite.path, !focusedSuite.opened);
|
53
|
+
}
|
54
|
+
if ((0, types_js_1.isTest)(focusedSuite) && focusedSuite.results?.length == 0) {
|
55
|
+
e.preventDefault();
|
56
|
+
}
|
53
57
|
return;
|
54
|
-
if (!(0, types_js_1.isTest)(focusedSuite)) {
|
55
|
-
e.preventDefault();
|
56
|
-
onSuiteOpen(focusedSuite.path, !focusedSuite.opened);
|
57
58
|
}
|
58
|
-
|
59
|
+
case 'Space': {
|
59
60
|
e.preventDefault();
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
const path = (0, types_js_1.isTest)(focusedSuite) ? (0, helpers_js_1.getTestPath)(focusedSuite) : focusedSuite.path;
|
69
|
-
onSuiteToggle(path, !focusedSuite.checked);
|
70
|
-
}
|
71
|
-
if (e.code === 'ArrowDown') {
|
72
|
-
const currentIndex = sidebarFocusedItem.length === 0 ? -1 : getFocusedItemIndex(sidebarFocusedItem);
|
73
|
-
if (currentIndex === suiteList.length - 1)
|
61
|
+
// TODO handle keys in one place
|
62
|
+
if (e.altKey)
|
63
|
+
return;
|
64
|
+
const focusedSuite = (0, helpers_js_1.getSuiteByPath)(rootSuite, sidebarFocusedItem);
|
65
|
+
if (!focusedSuite)
|
66
|
+
return;
|
67
|
+
const path = (0, types_js_1.isTest)(focusedSuite) ? (0, helpers_js_1.getTestPath)(focusedSuite) : focusedSuite.path;
|
68
|
+
onSuiteToggle(path, !focusedSuite.checked);
|
74
69
|
return;
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
setSidebarFocusedItem(nextPath);
|
84
|
-
}
|
85
|
-
if (e.code === 'ArrowRight') {
|
86
|
-
if (sidebarFocusedItem.length === 0)
|
87
|
-
return;
|
88
|
-
const focusedSuite = (0, helpers_js_1.getSuiteByPath)(rootSuite, sidebarFocusedItem);
|
89
|
-
if (!focusedSuite || (0, types_js_1.isTest)(focusedSuite))
|
70
|
+
}
|
71
|
+
case 'ArrowDown': {
|
72
|
+
const currentIndex = sidebarFocusedItem.length === 0 ? -1 : getFocusedItemIndex(sidebarFocusedItem);
|
73
|
+
if (currentIndex === suiteList.length - 1)
|
74
|
+
return;
|
75
|
+
const nextSuite = suiteList[currentIndex + 1];
|
76
|
+
const nextPath = (0, types_js_1.isTest)(nextSuite.suite) ? (0, helpers_js_1.getTestPath)(nextSuite.suite) : nextSuite.suite.path;
|
77
|
+
setSidebarFocusedItem(nextPath);
|
90
78
|
return;
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
79
|
+
}
|
80
|
+
case 'ArrowUp': {
|
81
|
+
const currentIndex = sidebarFocusedItem.length === 0 ? 0 : getFocusedItemIndex(sidebarFocusedItem);
|
82
|
+
const nextSuite = currentIndex > 0 ? suiteList[currentIndex - 1].suite : rootSuite;
|
83
|
+
const nextPath = (0, types_js_1.isTest)(nextSuite) ? (0, helpers_js_1.getTestPath)(nextSuite) : nextSuite.path;
|
84
|
+
setSidebarFocusedItem(nextPath);
|
95
85
|
return;
|
96
|
-
|
97
|
-
|
86
|
+
}
|
87
|
+
case 'ArrowRight': {
|
88
|
+
if (sidebarFocusedItem.length === 0)
|
89
|
+
return;
|
90
|
+
const focusedSuite = (0, helpers_js_1.getSuiteByPath)(rootSuite, sidebarFocusedItem);
|
91
|
+
if (!focusedSuite || (0, types_js_1.isTest)(focusedSuite))
|
92
|
+
return;
|
93
|
+
onSuiteOpen(focusedSuite.path, true);
|
98
94
|
return;
|
99
|
-
|
100
|
-
|
95
|
+
}
|
96
|
+
case 'ArrowLeft': {
|
97
|
+
if (sidebarFocusedItem.length === 0)
|
98
|
+
return;
|
99
|
+
const focusedSuite = (0, helpers_js_1.getSuiteByPath)(rootSuite, sidebarFocusedItem);
|
100
|
+
if (!focusedSuite)
|
101
|
+
return;
|
102
|
+
if (!(0, types_js_1.isTest)(focusedSuite) && focusedSuite.opened) {
|
103
|
+
onSuiteOpen(focusedSuite.path, false);
|
104
|
+
return;
|
105
|
+
}
|
106
|
+
const path = (0, types_js_1.isTest)(focusedSuite) ? (0, helpers_js_1.getTestPath)(focusedSuite) : focusedSuite.path;
|
107
|
+
setSidebarFocusedItem(path.slice(0, -1));
|
101
108
|
return;
|
102
109
|
}
|
103
|
-
const path = (0, types_js_1.isTest)(focusedSuite) ? (0, helpers_js_1.getTestPath)(focusedSuite) : focusedSuite.path;
|
104
|
-
setSidebarFocusedItem(path.slice(0, -1));
|
105
110
|
}
|
106
|
-
}, [onSuiteOpen, onSuiteToggle, rootSuite, suiteList, getFocusedItemIndex, sidebarFocusedItem]);
|
111
|
+
}, [onSuiteOpen, onSuiteToggle, rootSuite, suiteList, getFocusedItemIndex, sidebarFocusedItem, setSidebarFocusedItem]);
|
107
112
|
(0, react_1.useEffect)(() => {
|
108
113
|
document.addEventListener('keydown', handleKeyDown, false);
|
109
114
|
return () => {
|
110
115
|
document.removeEventListener('keydown', handleKeyDown, false);
|
111
116
|
};
|
112
117
|
}, [handleKeyDown]);
|
113
|
-
return
|
118
|
+
return react_1.default.createElement(react_1.default.Fragment, null, children);
|
114
119
|
};
|
115
120
|
exports.KeyboardEvents = KeyboardEvents;
|
116
121
|
//# sourceMappingURL=KeyboardEventsContext.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"KeyboardEventsContext.js","sourceRoot":"","sources":["../../../src/client/web/KeyboardEventsContext.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+
|
1
|
+
{"version":3,"file":"KeyboardEventsContext.js","sourceRoot":"","sources":["../../../src/client/web/KeyboardEventsContext.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA8E;AAC9E,6CAAsD;AACtD,qDAAiH;AACjH,2DAAwD;AAEjD,MAAM,cAAc,GAAG,CAAC,EAC7B,QAAQ,EACR,SAAS,EACT,MAAM,GAIN,EAAe,EAAE;IACjB,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,GAAG,IAAA,qCAAiB,GAAE,CAAC;IAEtG,MAAM,SAAS,GAAG,IAAA,yBAAY,EAAC,IAAA,wBAAW,EAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;IAE/D,MAAM,mBAAmB,GAAG,IAAA,mBAAW,EACrC,CAAC,IAAc,EAAU,EAAE;QACzB,OAAO,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;YAC/B,MAAM,IAAI,GAAG,IAAA,iBAAM,EAAC,CAAC,CAAC,KAAK,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