redux-connected-devtools 0.0.13 → 1.0.2
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/.env +2 -0
- package/.prettierrc.js +10 -0
- package/.vscode/settings.json +12 -0
- package/.vscode/tasks.json +33 -0
- package/LICENSE +21 -0
- package/README.md +5 -0
- package/index.html +58 -0
- package/jest.config.js +8 -0
- package/package.json +47 -62
- package/public/devtools.html +8 -0
- package/public/icon.png +0 -0
- package/public/manifest.json +29 -0
- package/public/options.html +12 -0
- package/public/panel.html +39 -0
- package/public/popup.html +12 -0
- package/src/__tests__/sum.ts +9 -0
- package/src/background.ts +49 -0
- package/src/components/DevInspector/DevInspector.scss +2 -0
- package/src/components/DevInspector/DevInspector.style.tsx +8 -0
- package/src/components/DevInspector/DevInspector.tsx +34 -0
- package/src/components/DevList/DevList.scss +2 -0
- package/src/components/DevList/DevList.style.tsx +34 -0
- package/src/components/DevList/DevList.tsx +62 -0
- package/src/components/DevMenu/DevMenu.scss +2 -0
- package/src/components/DevMenu/DevMenu.style.tsx +53 -0
- package/src/components/DevMenu/DevMenu.tsx +76 -0
- package/src/components/DevPanel/DevPanel.scss +2 -0
- package/src/components/DevPanel/DevPanel.style.tsx +16 -0
- package/src/components/DevPanel/DevPanel.tsx +51 -0
- package/src/components/JourneyRow/JourneyRow.scss +2 -0
- package/src/components/JourneyRow/JourneyRow.style.tsx +46 -0
- package/src/components/JourneyRow/JourneyRow.tsx +58 -0
- package/src/components/JsonViewer/JsonViewer.scss +2 -0
- package/src/components/JsonViewer/JsonViewer.style.tsx +31 -0
- package/src/components/JsonViewer/JsonViewer.tsx +24 -0
- package/src/components/Lifecycle/Lifecycle.scss +2 -0
- package/src/components/Lifecycle/Lifecycle.style.tsx +6 -0
- package/src/components/Lifecycle/Lifecycle.tsx +31 -0
- package/src/components/LogsViewer/LogsViewer.scss +2 -0
- package/src/components/LogsViewer/LogsViewer.style.tsx +5 -0
- package/src/components/LogsViewer/LogsViewer.tsx +14 -0
- package/src/components/RequestDetails/RequestDetails.scss +2 -0
- package/src/components/RequestDetails/RequestDetails.style.tsx +20 -0
- package/src/components/RequestDetails/RequestDetails.tsx +60 -0
- package/src/components/RequestJourney/RequestJourney.scss +2 -0
- package/src/components/RequestJourney/RequestJourney.style.tsx +6 -0
- package/src/components/RequestJourney/RequestJourney.tsx +33 -0
- package/src/components/RequestRow/RequestRow.scss +2 -0
- package/src/components/RequestRow/RequestRow.style.tsx +31 -0
- package/src/components/RequestRow/RequestRow.tsx +37 -0
- package/src/components/Time/Time.scss +2 -0
- package/src/components/Time/Time.style.tsx +17 -0
- package/src/components/Time/Time.tsx +25 -0
- package/src/containers/DevMenuContainer.tsx +28 -0
- package/src/containers/DevPanelContainer.tsx +10 -0
- package/src/containers/EndpointConfigsContainer.tsx +12 -0
- package/src/containers/EndpointStatusContainer.tsx +12 -0
- package/src/containers/GlobalSettingsContainer.tsx +12 -0
- package/src/containers/GlobalStatsContainer.tsx +12 -0
- package/src/containers/LifecycleApiErrorContainer.tsx +11 -0
- package/src/containers/LifecycleGeneralErrorContainer.tsx +11 -0
- package/src/containers/LifecycleInQueueContainer.tsx +11 -0
- package/src/containers/LifecyclePendingApiContainer.tsx +11 -0
- package/src/containers/LifecyclePostActionContainer.tsx +11 -0
- package/src/containers/LifecycleReceivedContainer.tsx +11 -0
- package/src/content_script.ts +19 -0
- package/src/data/devComponents.tsx +25 -0
- package/src/data/devRoutes.ts +83 -0
- package/src/devtools.tsx +29 -0
- package/src/index.ts +1 -0
- package/src/injected_script.ts +9 -0
- package/src/options.tsx +77 -0
- package/src/panel.tsx +30 -0
- package/src/popup.tsx +63 -0
- package/src/store/initialState.ts +42 -0
- package/src/store/selectors.ts +205 -0
- package/src/sum.ts +3 -0
- package/src/types.ts +1 -0
- package/src/utils/date.ts +3 -0
- package/tsconfig.json +24 -0
- package/vite.config.ts +45 -0
- package/webpack/webpack.common.js +46 -0
- package/webpack/webpack.dev.js +7 -0
- package/webpack/webpack.prod.js +6 -0
- package/esm/components/Config/Config.d.ts +0 -6
- package/esm/components/Config/Config.js +0 -15
- package/esm/components/DevTools/DevTools.d.ts +0 -4
- package/esm/components/DevTools/DevTools.js +0 -19
- package/esm/components/Dispatcher/Dispatcher.d.ts +0 -8
- package/esm/components/Dispatcher/Dispatcher.js +0 -62
- package/esm/components/GlobalSettings/GlobalSettings.d.ts +0 -6
- package/esm/components/GlobalSettings/GlobalSettings.js +0 -16
- package/esm/components/Group/Group.d.ts +0 -9
- package/esm/components/Group/Group.js +0 -14
- package/esm/components/Json/Json.d.ts +0 -7
- package/esm/components/Json/Json.js +0 -9
- package/esm/components/Logs/Logs.d.ts +0 -6
- package/esm/components/Logs/Logs.js +0 -49
- package/esm/components/Monitor/Monitor.d.ts +0 -6
- package/esm/components/Monitor/Monitor.js +0 -52
- package/esm/components/OverlayManager/OverlayManager.d.ts +0 -6
- package/esm/components/OverlayManager/OverlayManager.js +0 -17
- package/esm/components/Panel/Panel.d.ts +0 -14
- package/esm/components/Panel/Panel.js +0 -46
- package/esm/components/Preview/Preview.d.ts +0 -19
- package/esm/components/Preview/Preview.js +0 -58
- package/esm/components/Redux/Redux.d.ts +0 -6
- package/esm/components/Redux/Redux.js +0 -72
- package/esm/components/ReduxSettings/ReduxSettings.d.ts +0 -9
- package/esm/components/ReduxSettings/ReduxSettings.js +0 -60
- package/esm/components/Requests/Requests.d.ts +0 -6
- package/esm/components/Requests/Requests.js +0 -61
- package/esm/components/Status/Status.d.ts +0 -6
- package/esm/components/Status/Status.js +0 -16
- package/esm/components/TaskManager/TaskManager.d.ts +0 -9
- package/esm/components/TaskManager/TaskManager.js +0 -22
- package/esm/components/Toggle/Toggle.d.ts +0 -9
- package/esm/components/Toggle/Toggle.js +0 -8
- package/esm/components/VirtualList/VirtualList.d.ts +0 -19
- package/esm/components/VirtualList/VirtualList.js +0 -30
- package/esm/components/Visual/Visual.d.ts +0 -6
- package/esm/components/Visual/Visual.js +0 -38
- package/esm/components/prefix.d.ts +0 -2
- package/esm/components/prefix.js +0 -2
- package/esm/data/boxSizes.d.ts +0 -2
- package/esm/data/boxSizes.js +0 -10
- package/esm/data/dispatcherActions.d.ts +0 -5
- package/esm/data/dispatcherActions.js +0 -35
- package/esm/data/panels.d.ts +0 -2
- package/esm/data/panels.js +0 -74
- package/esm/data/panelsArrangements.d.ts +0 -19
- package/esm/data/panelsArrangements.js +0 -19
- package/esm/data/reduxFilterOptions.d.ts +0 -20
- package/esm/data/reduxFilterOptions.js +0 -223
- package/esm/data/widgets.d.ts +0 -2
- package/esm/data/widgets.js +0 -85
- package/esm/hooks/index.d.ts +0 -7
- package/esm/hooks/index.js +0 -7
- package/esm/hooks/misc/hookState.d.ts +0 -8
- package/esm/hooks/misc/hookState.js +0 -6
- package/esm/hooks/misc/util.d.ts +0 -5
- package/esm/hooks/misc/util.js +0 -21
- package/esm/hooks/useBoolean.d.ts +0 -3
- package/esm/hooks/useBoolean.js +0 -3
- package/esm/hooks/useClickAway.d.ts +0 -3
- package/esm/hooks/useClickAway.js +0 -27
- package/esm/hooks/useEvent.d.ts +0 -13
- package/esm/hooks/useEvent.js +0 -35
- package/esm/hooks/useKey.d.ts +0 -12
- package/esm/hooks/useKey.js +0 -29
- package/esm/hooks/useList.d.ts +0 -57
- package/esm/hooks/useList.js +0 -74
- package/esm/hooks/useLocalstorage.d.ts +0 -10
- package/esm/hooks/useLocalstorage.js +0 -75
- package/esm/hooks/usePanels.d.ts +0 -10
- package/esm/hooks/usePanels.js +0 -43
- package/esm/hooks/useSetState.d.ts +0 -2
- package/esm/hooks/useSetState.js +0 -10
- package/esm/hooks/useToggle.d.ts +0 -2
- package/esm/hooks/useToggle.js +0 -6
- package/esm/hooks/useUpdate.d.ts +0 -1
- package/esm/hooks/useUpdate.js +0 -6
- package/esm/index.d.ts +0 -3
- package/esm/index.js +0 -3
- package/esm/selectors/selectors.d.ts +0 -21
- package/esm/selectors/selectors.js +0 -20
- package/esm/theme/devtoolsTheme.d.ts +0 -2
- package/esm/theme/devtoolsTheme.js +0 -95
- package/esm/utils/filter.d.ts +0 -3
- package/esm/utils/filter.js +0 -25
- package/esm/utils/localStorage.d.ts +0 -2
- package/esm/utils/localStorage.js +0 -21
- package/lib/components/Colors copy.css +0 -3
- package/lib/components/Colors copy.css.map +0 -1
- package/lib/components/Colors.css +0 -3
- package/lib/components/Colors.css.map +0 -1
- package/lib/components/ColorsDark.css +0 -3
- package/lib/components/ColorsDark.css.map +0 -1
- package/lib/components/Config/Config.css +0 -15
- package/lib/components/Config/Config.css.map +0 -1
- package/lib/components/Config/Config.d.ts +0 -6
- package/lib/components/Config/Config.js +0 -20
- package/lib/components/DevTools/DevTools.css +0 -3
- package/lib/components/DevTools/DevTools.css.map +0 -1
- package/lib/components/DevTools/DevTools.d.ts +0 -4
- package/lib/components/DevTools/DevTools.js +0 -24
- package/lib/components/Dispatcher/Dispatcher.css +0 -15
- package/lib/components/Dispatcher/Dispatcher.css.map +0 -1
- package/lib/components/Dispatcher/Dispatcher.d.ts +0 -8
- package/lib/components/Dispatcher/Dispatcher.js +0 -66
- package/lib/components/GlobalSettings/GlobalSettings.css +0 -3
- package/lib/components/GlobalSettings/GlobalSettings.css.map +0 -1
- package/lib/components/GlobalSettings/GlobalSettings.d.ts +0 -6
- package/lib/components/GlobalSettings/GlobalSettings.js +0 -21
- package/lib/components/Group/Group.css +0 -41
- package/lib/components/Group/Group.css.map +0 -1
- package/lib/components/Group/Group.d.ts +0 -9
- package/lib/components/Group/Group.js +0 -19
- package/lib/components/Json/Json.css +0 -3
- package/lib/components/Json/Json.css.map +0 -1
- package/lib/components/Json/Json.d.ts +0 -7
- package/lib/components/Json/Json.js +0 -14
- package/lib/components/Logs/Logs.css +0 -3
- package/lib/components/Logs/Logs.css.map +0 -1
- package/lib/components/Logs/Logs.d.ts +0 -6
- package/lib/components/Logs/Logs.js +0 -54
- package/lib/components/Monitor/Monitor.css +0 -3
- package/lib/components/Monitor/Monitor.css.map +0 -1
- package/lib/components/Monitor/Monitor.d.ts +0 -6
- package/lib/components/Monitor/Monitor.js +0 -57
- package/lib/components/OverlayManager/OverlayManager.css +0 -72
- package/lib/components/OverlayManager/OverlayManager.css.map +0 -1
- package/lib/components/OverlayManager/OverlayManager.d.ts +0 -6
- package/lib/components/OverlayManager/OverlayManager.js +0 -22
- package/lib/components/Panel/Panel.css +0 -35
- package/lib/components/Panel/Panel.css.map +0 -1
- package/lib/components/Panel/Panel.d.ts +0 -14
- package/lib/components/Panel/Panel.js +0 -51
- package/lib/components/Prefix copy.css +0 -3
- package/lib/components/Prefix copy.css.map +0 -1
- package/lib/components/Prefix.css +0 -3
- package/lib/components/Prefix.css.map +0 -1
- package/lib/components/Preview/Preview.css +0 -29
- package/lib/components/Preview/Preview.css.map +0 -1
- package/lib/components/Preview/Preview.d.ts +0 -19
- package/lib/components/Preview/Preview.js +0 -64
- package/lib/components/Reading.css +0 -107
- package/lib/components/Reading.css.map +0 -1
- package/lib/components/Redux/Redux.css +0 -86
- package/lib/components/Redux/Redux.css.map +0 -1
- package/lib/components/Redux/Redux.d.ts +0 -6
- package/lib/components/Redux/Redux.js +0 -77
- package/lib/components/ReduxSettings/ReduxSettings.css +0 -10
- package/lib/components/ReduxSettings/ReduxSettings.css.map +0 -1
- package/lib/components/ReduxSettings/ReduxSettings.d.ts +0 -9
- package/lib/components/ReduxSettings/ReduxSettings.js +0 -64
- package/lib/components/Requests/Requests.css +0 -8
- package/lib/components/Requests/Requests.css.map +0 -1
- package/lib/components/Requests/Requests.d.ts +0 -6
- package/lib/components/Requests/Requests.js +0 -66
- package/lib/components/Status/Status.css +0 -15
- package/lib/components/Status/Status.css.map +0 -1
- package/lib/components/Status/Status.d.ts +0 -6
- package/lib/components/Status/Status.js +0 -21
- package/lib/components/TaskManager/TaskManager.css +0 -9
- package/lib/components/TaskManager/TaskManager.css.map +0 -1
- package/lib/components/TaskManager/TaskManager.d.ts +0 -9
- package/lib/components/TaskManager/TaskManager.js +0 -28
- package/lib/components/Toggle/Toggle.css +0 -3
- package/lib/components/Toggle/Toggle.css.map +0 -1
- package/lib/components/Toggle/Toggle.d.ts +0 -9
- package/lib/components/Toggle/Toggle.js +0 -13
- package/lib/components/Variables.css +0 -3
- package/lib/components/Variables.css.map +0 -1
- package/lib/components/VirtualList/VirtualList.css +0 -13
- package/lib/components/VirtualList/VirtualList.css.map +0 -1
- package/lib/components/VirtualList/VirtualList.d.ts +0 -19
- package/lib/components/VirtualList/VirtualList.js +0 -35
- package/lib/components/Visual/Visual.css +0 -56
- package/lib/components/Visual/Visual.css.map +0 -1
- package/lib/components/Visual/Visual.d.ts +0 -6
- package/lib/components/Visual/Visual.js +0 -43
- package/lib/components/prefix.d.ts +0 -2
- package/lib/components/prefix.js +0 -5
- package/lib/data/boxSizes.d.ts +0 -2
- package/lib/data/boxSizes.js +0 -13
- package/lib/data/dispatcherActions.d.ts +0 -5
- package/lib/data/dispatcherActions.js +0 -38
- package/lib/data/panels.d.ts +0 -2
- package/lib/data/panels.js +0 -77
- package/lib/data/panelsArrangements.d.ts +0 -19
- package/lib/data/panelsArrangements.js +0 -22
- package/lib/data/reduxFilterOptions.d.ts +0 -20
- package/lib/data/reduxFilterOptions.js +0 -227
- package/lib/data/widgets.d.ts +0 -2
- package/lib/data/widgets.js +0 -89
- package/lib/hooks/index.d.ts +0 -7
- package/lib/hooks/index.js +0 -17
- package/lib/hooks/misc/hookState.d.ts +0 -8
- package/lib/hooks/misc/hookState.js +0 -10
- package/lib/hooks/misc/util.d.ts +0 -5
- package/lib/hooks/misc/util.js +0 -27
- package/lib/hooks/useBoolean.d.ts +0 -3
- package/lib/hooks/useBoolean.js +0 -7
- package/lib/hooks/useClickAway.d.ts +0 -3
- package/lib/hooks/useClickAway.js +0 -31
- package/lib/hooks/useEvent.d.ts +0 -13
- package/lib/hooks/useEvent.js +0 -37
- package/lib/hooks/useKey.d.ts +0 -12
- package/lib/hooks/useKey.js +0 -34
- package/lib/hooks/useList.d.ts +0 -57
- package/lib/hooks/useList.js +0 -79
- package/lib/hooks/useLocalstorage.d.ts +0 -10
- package/lib/hooks/useLocalstorage.js +0 -79
- package/lib/hooks/usePanels.d.ts +0 -10
- package/lib/hooks/usePanels.js +0 -47
- package/lib/hooks/useSetState.d.ts +0 -2
- package/lib/hooks/useSetState.js +0 -14
- package/lib/hooks/useToggle.d.ts +0 -2
- package/lib/hooks/useToggle.js +0 -10
- package/lib/hooks/useUpdate.d.ts +0 -1
- package/lib/hooks/useUpdate.js +0 -9
- package/lib/index.css +0 -488
- package/lib/index.css.map +0 -1
- package/lib/index.d.ts +0 -3
- package/lib/index.js +0 -9
- package/lib/selectors/selectors.d.ts +0 -21
- package/lib/selectors/selectors.js +0 -24
- package/lib/theme/devtoolsTheme.d.ts +0 -2
- package/lib/theme/devtoolsTheme.js +0 -97
- package/lib/utils/filter.d.ts +0 -3
- package/lib/utils/filter.js +0 -29
- package/lib/utils/localStorage.d.ts +0 -2
- package/lib/utils/localStorage.js +0 -26
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.findPreset = exports.presets = exports.readingsFilters = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
exports.readingsFilters = [
|
|
6
|
-
{
|
|
7
|
-
id: 'root',
|
|
8
|
-
label: 'Show root',
|
|
9
|
-
isShow: true,
|
|
10
|
-
include: function (reading) {
|
|
11
|
-
var action = reading.action;
|
|
12
|
-
return action['@@redux-store-generator/AUTO_GENERATED_ACTION'];
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
id: 'apiState',
|
|
17
|
-
label: 'Show API state',
|
|
18
|
-
isShow: true,
|
|
19
|
-
include: function (reading) {
|
|
20
|
-
var action = reading.action;
|
|
21
|
-
return action['@@redux-connected/STATUS_ACTION'];
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
id: 'apiConfig',
|
|
26
|
-
label: 'Show API config',
|
|
27
|
-
isShow: true,
|
|
28
|
-
include: function (reading) {
|
|
29
|
-
var action = reading.action;
|
|
30
|
-
return action['@@redux-connected/CONFIG_ACTION'];
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
id: 'sagasMessages',
|
|
35
|
-
label: 'Show sagas messages',
|
|
36
|
-
isShow: true,
|
|
37
|
-
include: function (reading) {
|
|
38
|
-
var action = reading.action;
|
|
39
|
-
return (action['@@redux-saga/SAGA_ACTION'] &&
|
|
40
|
-
action.type !== 'LOG' &&
|
|
41
|
-
!action['@@redux-store-generator/AUTO_GENERATED_ACTION']);
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
id: 'globalStats',
|
|
46
|
-
label: 'Show global stats',
|
|
47
|
-
isShow: true,
|
|
48
|
-
include: function (reading) {
|
|
49
|
-
var action = reading.action;
|
|
50
|
-
return action['@@redux-connected/GLOBAL_STATS_ACTION'];
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
id: 'globalSettings',
|
|
55
|
-
label: 'Show global settings',
|
|
56
|
-
isShow: true,
|
|
57
|
-
include: function (reading) {
|
|
58
|
-
var action = reading.action;
|
|
59
|
-
return action['@@redux-connected/GLOBAL_SETTINGS_ACTION'];
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
id: 'sagasInfo',
|
|
64
|
-
label: 'Show sagas info',
|
|
65
|
-
isShow: true,
|
|
66
|
-
include: function (reading) {
|
|
67
|
-
var action = reading.action;
|
|
68
|
-
return action['@@redux-connected/SAGA_ACTION'];
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
id: 'log',
|
|
73
|
-
label: 'Show log',
|
|
74
|
-
isShow: true,
|
|
75
|
-
include: function (reading) {
|
|
76
|
-
var action = reading.action;
|
|
77
|
-
return action.type === 'LOG';
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
id: 'hideGet',
|
|
82
|
-
label: 'Hide get',
|
|
83
|
-
exclude: function (reading, apiInfo) {
|
|
84
|
-
if (apiInfo === void 0) { apiInfo = {}; }
|
|
85
|
-
var action = reading.action;
|
|
86
|
-
var info = apiInfo[action.type];
|
|
87
|
-
return info === null || info === void 0 ? void 0 : info.isGet;
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
id: 'hidePatch',
|
|
92
|
-
label: 'Hide patch',
|
|
93
|
-
exclude: function (reading, apiInfo) {
|
|
94
|
-
if (apiInfo === void 0) { apiInfo = {}; }
|
|
95
|
-
var action = reading.action;
|
|
96
|
-
var info = apiInfo[action.type];
|
|
97
|
-
return (info === null || info === void 0 ? void 0 : info.verb) === 'patch';
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
id: 'hideSetAll',
|
|
102
|
-
label: 'Hide setAll',
|
|
103
|
-
exclude: function (reading, apiInfo) {
|
|
104
|
-
if (apiInfo === void 0) { apiInfo = {}; }
|
|
105
|
-
var action = reading.action;
|
|
106
|
-
var info = apiInfo[action.type];
|
|
107
|
-
return (info === null || info === void 0 ? void 0 : info.verb) === 'setAll';
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
id: 'hideSet',
|
|
112
|
-
label: 'Hide set',
|
|
113
|
-
exclude: function (reading, apiInfo) {
|
|
114
|
-
if (apiInfo === void 0) { apiInfo = {}; }
|
|
115
|
-
var action = reading.action;
|
|
116
|
-
var info = apiInfo[action.type];
|
|
117
|
-
return (info === null || info === void 0 ? void 0 : info.verb) === 'set';
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
id: 'hideDelete',
|
|
122
|
-
label: 'Hide delete',
|
|
123
|
-
exclude: function (reading, apiInfo) {
|
|
124
|
-
if (apiInfo === void 0) { apiInfo = {}; }
|
|
125
|
-
var action = reading.action;
|
|
126
|
-
var info = apiInfo[action.type];
|
|
127
|
-
return (info === null || info === void 0 ? void 0 : info.verb) === 'delete';
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
id: 'hidePush',
|
|
132
|
-
label: 'Hide push',
|
|
133
|
-
exclude: function (reading, apiInfo) {
|
|
134
|
-
if (apiInfo === void 0) { apiInfo = {}; }
|
|
135
|
-
var action = reading.action;
|
|
136
|
-
var info = apiInfo[action.type];
|
|
137
|
-
return (info === null || info === void 0 ? void 0 : info.verb) === 'push';
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
id: 'hidePop',
|
|
142
|
-
label: 'Hide pop',
|
|
143
|
-
exclude: function (reading, apiInfo) {
|
|
144
|
-
if (apiInfo === void 0) { apiInfo = {}; }
|
|
145
|
-
var action = reading.action;
|
|
146
|
-
var info = apiInfo[action.type];
|
|
147
|
-
return (info === null || info === void 0 ? void 0 : info.verb) === 'pop';
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
id: 'hideClear',
|
|
152
|
-
label: 'Hide clear',
|
|
153
|
-
exclude: function (reading, apiInfo) {
|
|
154
|
-
if (apiInfo === void 0) { apiInfo = {}; }
|
|
155
|
-
var action = reading.action;
|
|
156
|
-
var info = apiInfo[action.type];
|
|
157
|
-
return (info === null || info === void 0 ? void 0 : info.verb) === 'clear';
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
];
|
|
161
|
-
exports.presets = [
|
|
162
|
-
{
|
|
163
|
-
key: 'custom',
|
|
164
|
-
text: 'Custom',
|
|
165
|
-
isCustom: true,
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
key: 'default',
|
|
169
|
-
text: 'Default',
|
|
170
|
-
selectedItems: ['root'].sort(),
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
key: 'connected',
|
|
174
|
-
text: 'Connected',
|
|
175
|
-
selectedItems: [
|
|
176
|
-
'apiState',
|
|
177
|
-
'apiConfig',
|
|
178
|
-
'sagasMessages',
|
|
179
|
-
'globalStats',
|
|
180
|
-
'globalSettings',
|
|
181
|
-
'log',
|
|
182
|
-
'sagasInfo',
|
|
183
|
-
].sort(),
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
key: 'get',
|
|
187
|
-
text: 'GET',
|
|
188
|
-
selectedItems: [
|
|
189
|
-
'root',
|
|
190
|
-
'hidePatch',
|
|
191
|
-
'hideSetAll',
|
|
192
|
-
'hideSet',
|
|
193
|
-
'hideDelete',
|
|
194
|
-
'hidePush',
|
|
195
|
-
'hidePop',
|
|
196
|
-
'hideClear',
|
|
197
|
-
].sort(),
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
key: 'all',
|
|
201
|
-
text: 'All',
|
|
202
|
-
selectedItems: [
|
|
203
|
-
'root',
|
|
204
|
-
'apiState',
|
|
205
|
-
'apiConfig',
|
|
206
|
-
'sagasMessages',
|
|
207
|
-
'globalStats',
|
|
208
|
-
'globalSettings',
|
|
209
|
-
'sagasInfo',
|
|
210
|
-
].sort(),
|
|
211
|
-
},
|
|
212
|
-
];
|
|
213
|
-
var sameArray = function (array1, array2) {
|
|
214
|
-
var sortedArray1 = tslib_1.__spreadArray([], array1).sort();
|
|
215
|
-
var sortedArray2 = tslib_1.__spreadArray([], array2).sort();
|
|
216
|
-
return (sortedArray1.length === sortedArray2.length &&
|
|
217
|
-
sortedArray1.every(function (value, index) { return value === sortedArray2[index]; }));
|
|
218
|
-
};
|
|
219
|
-
var findPreset = function (filters) {
|
|
220
|
-
var checkedFilters = Object.keys(filters)
|
|
221
|
-
.filter(function (key) { return filters[key]; })
|
|
222
|
-
.sort();
|
|
223
|
-
return (exports.presets.find(function (preset) {
|
|
224
|
-
return preset && sameArray(preset.selectedItems || [], checkedFilters);
|
|
225
|
-
}) || exports.presets[0]);
|
|
226
|
-
};
|
|
227
|
-
exports.findPreset = findPreset;
|
package/lib/data/widgets.d.ts
DELETED
package/lib/data/widgets.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.widgets = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
var boxSizes_1 = require("./boxSizes");
|
|
7
|
-
var Monitor_1 = tslib_1.__importDefault(require("../components/Monitor/Monitor"));
|
|
8
|
-
var Requests_1 = tslib_1.__importDefault(require("../components/Requests/Requests"));
|
|
9
|
-
var Redux_1 = tslib_1.__importDefault(require("../components/Redux/Redux"));
|
|
10
|
-
var Config_1 = tslib_1.__importDefault(require("../components/Config/Config"));
|
|
11
|
-
var Status_1 = tslib_1.__importDefault(require("../components/Status/Status"));
|
|
12
|
-
var Preview_1 = tslib_1.__importDefault(require("../components/Preview/Preview"));
|
|
13
|
-
var Logs_1 = tslib_1.__importDefault(require("../components/Logs/Logs"));
|
|
14
|
-
var Visual_1 = tslib_1.__importDefault(require("../components/Visual/Visual"));
|
|
15
|
-
var GlobalSettings_1 = tslib_1.__importDefault(require("../components/GlobalSettings/GlobalSettings"));
|
|
16
|
-
exports.widgets = {
|
|
17
|
-
processes: {
|
|
18
|
-
id: 'processes',
|
|
19
|
-
widgetId: 'processes',
|
|
20
|
-
title: 'Processes',
|
|
21
|
-
description: 'Start & stop processes',
|
|
22
|
-
dimension: boxSizes_1.boxSizes[0],
|
|
23
|
-
component: react_1.default.createElement(Monitor_1.default, { isWide: false }),
|
|
24
|
-
},
|
|
25
|
-
requests: {
|
|
26
|
-
id: 'requests',
|
|
27
|
-
widgetId: 'requests',
|
|
28
|
-
title: 'Requests',
|
|
29
|
-
description: 'Monitor API requests',
|
|
30
|
-
dimension: boxSizes_1.boxSizes[0],
|
|
31
|
-
component: react_1.default.createElement(Requests_1.default, { isWide: false }),
|
|
32
|
-
},
|
|
33
|
-
redux: {
|
|
34
|
-
id: 'redux',
|
|
35
|
-
widgetId: 'redux',
|
|
36
|
-
title: 'Redux devtools',
|
|
37
|
-
description: 'Watch actions and state changes',
|
|
38
|
-
dimension: boxSizes_1.boxSizes[1],
|
|
39
|
-
component: react_1.default.createElement(Redux_1.default, { isWide: true }),
|
|
40
|
-
},
|
|
41
|
-
endpoints: {
|
|
42
|
-
id: 'endpoints',
|
|
43
|
-
widgetId: 'endpoints',
|
|
44
|
-
title: 'Endpoints Configuration',
|
|
45
|
-
description: 'Configure API for root nodes ',
|
|
46
|
-
dimension: boxSizes_1.boxSizes[0],
|
|
47
|
-
component: react_1.default.createElement(Config_1.default, { isWide: false }),
|
|
48
|
-
},
|
|
49
|
-
apiStatus: {
|
|
50
|
-
id: 'apiStatus',
|
|
51
|
-
widgetId: 'apiStatus',
|
|
52
|
-
title: 'API Status',
|
|
53
|
-
description: 'Connection status for root nodes',
|
|
54
|
-
dimension: boxSizes_1.boxSizes[0],
|
|
55
|
-
component: react_1.default.createElement(Status_1.default, { isWide: false }),
|
|
56
|
-
},
|
|
57
|
-
logs: {
|
|
58
|
-
id: 'logs',
|
|
59
|
-
widgetId: 'logs',
|
|
60
|
-
title: 'Logs',
|
|
61
|
-
description: 'Watch console logs',
|
|
62
|
-
dimension: boxSizes_1.boxSizes[0],
|
|
63
|
-
component: react_1.default.createElement(Logs_1.default, { isWide: false }),
|
|
64
|
-
},
|
|
65
|
-
visual: {
|
|
66
|
-
id: 'visual',
|
|
67
|
-
widgetId: 'visual',
|
|
68
|
-
title: 'Visual',
|
|
69
|
-
description: 'High-level requests visualization by root node',
|
|
70
|
-
dimension: boxSizes_1.boxSizes[0],
|
|
71
|
-
component: react_1.default.createElement(Visual_1.default, { isWide: false }),
|
|
72
|
-
},
|
|
73
|
-
settings: {
|
|
74
|
-
id: 'settings',
|
|
75
|
-
widgetId: 'settings',
|
|
76
|
-
title: 'Settings',
|
|
77
|
-
description: 'Global settings',
|
|
78
|
-
dimension: boxSizes_1.boxSizes[0],
|
|
79
|
-
component: react_1.default.createElement(GlobalSettings_1.default, { isWide: false }),
|
|
80
|
-
},
|
|
81
|
-
preview: {
|
|
82
|
-
id: 'preview',
|
|
83
|
-
widgetId: 'preview',
|
|
84
|
-
title: 'Preview',
|
|
85
|
-
description: 'Preview a specific datapoint',
|
|
86
|
-
dimension: boxSizes_1.boxSizes[0],
|
|
87
|
-
component: react_1.default.createElement(Preview_1.default, { isWide: false }),
|
|
88
|
-
},
|
|
89
|
-
};
|
package/lib/hooks/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { useBoolean } from './useBoolean';
|
|
2
|
-
export { useClickAway } from './useClickAway';
|
|
3
|
-
export { useKey } from './useKey';
|
|
4
|
-
export { useList } from './useList';
|
|
5
|
-
export { useLocalstorage } from './useLocalstorage';
|
|
6
|
-
export { useSetState } from './useSetState';
|
|
7
|
-
export { useToggle } from './useToggle';
|
package/lib/hooks/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useToggle = exports.useSetState = exports.useLocalstorage = exports.useList = exports.useKey = exports.useClickAway = exports.useBoolean = void 0;
|
|
4
|
-
var useBoolean_1 = require("./useBoolean");
|
|
5
|
-
Object.defineProperty(exports, "useBoolean", { enumerable: true, get: function () { return useBoolean_1.useBoolean; } });
|
|
6
|
-
var useClickAway_1 = require("./useClickAway");
|
|
7
|
-
Object.defineProperty(exports, "useClickAway", { enumerable: true, get: function () { return useClickAway_1.useClickAway; } });
|
|
8
|
-
var useKey_1 = require("./useKey");
|
|
9
|
-
Object.defineProperty(exports, "useKey", { enumerable: true, get: function () { return useKey_1.useKey; } });
|
|
10
|
-
var useList_1 = require("./useList");
|
|
11
|
-
Object.defineProperty(exports, "useList", { enumerable: true, get: function () { return useList_1.useList; } });
|
|
12
|
-
var useLocalstorage_1 = require("./useLocalstorage");
|
|
13
|
-
Object.defineProperty(exports, "useLocalstorage", { enumerable: true, get: function () { return useLocalstorage_1.useLocalstorage; } });
|
|
14
|
-
var useSetState_1 = require("./useSetState");
|
|
15
|
-
Object.defineProperty(exports, "useSetState", { enumerable: true, get: function () { return useSetState_1.useSetState; } });
|
|
16
|
-
var useToggle_1 = require("./useToggle");
|
|
17
|
-
Object.defineProperty(exports, "useToggle", { enumerable: true, get: function () { return useToggle_1.useToggle; } });
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare type IHookStateInitialSetter<S> = () => S;
|
|
2
|
-
export declare type IHookStateInitAction<S> = S | IHookStateInitialSetter<S>;
|
|
3
|
-
export declare type IHookStateSetter<S> = ((prevState: S) => S) | (() => S);
|
|
4
|
-
export declare type IHookStateSetAction<S> = S | IHookStateSetter<S>;
|
|
5
|
-
export declare type IHookStateResolvable<S> = S | IHookStateInitialSetter<S> | IHookStateSetter<S>;
|
|
6
|
-
export declare function resolveHookState<S>(nextState: IHookStateInitAction<S>): S;
|
|
7
|
-
export declare function resolveHookState<S, C extends S>(nextState: IHookStateSetAction<S>, currentState?: C): S;
|
|
8
|
-
export declare function resolveHookState<S, C extends S>(nextState: IHookStateResolvable<S>, currentState?: C): S;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveHookState = void 0;
|
|
4
|
-
function resolveHookState(nextState, currentState) {
|
|
5
|
-
if (typeof nextState === 'function') {
|
|
6
|
-
return nextState.length ? nextState(currentState) : nextState();
|
|
7
|
-
}
|
|
8
|
-
return nextState;
|
|
9
|
-
}
|
|
10
|
-
exports.resolveHookState = resolveHookState;
|
package/lib/hooks/misc/util.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const noop: () => void;
|
|
2
|
-
export declare function on<T extends Window | Document | HTMLElement | EventTarget>(obj: T | null, ...args: Parameters<T['addEventListener']> | [string, Function | null, ...any]): void;
|
|
3
|
-
export declare function off<T extends Window | Document | HTMLElement | EventTarget>(obj: T | null, ...args: Parameters<T['removeEventListener']> | [string, Function | null, ...any]): void;
|
|
4
|
-
export declare const isBrowser: boolean;
|
|
5
|
-
export declare const isNavigator: boolean;
|
package/lib/hooks/misc/util.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isNavigator = exports.isBrowser = exports.off = exports.on = exports.noop = void 0;
|
|
4
|
-
var noop = function () { };
|
|
5
|
-
exports.noop = noop;
|
|
6
|
-
function on(obj) {
|
|
7
|
-
var args = [];
|
|
8
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
9
|
-
args[_i - 1] = arguments[_i];
|
|
10
|
-
}
|
|
11
|
-
if (obj && obj.addEventListener) {
|
|
12
|
-
obj.addEventListener.apply(obj, args);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.on = on;
|
|
16
|
-
function off(obj) {
|
|
17
|
-
var args = [];
|
|
18
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
19
|
-
args[_i - 1] = arguments[_i];
|
|
20
|
-
}
|
|
21
|
-
if (obj && obj.removeEventListener) {
|
|
22
|
-
obj.removeEventListener.apply(obj, args);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
exports.off = off;
|
|
26
|
-
exports.isBrowser = typeof window !== 'undefined';
|
|
27
|
-
exports.isNavigator = typeof navigator !== 'undefined';
|
package/lib/hooks/useBoolean.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useBoolean = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var useToggle_1 = tslib_1.__importDefault(require("./useToggle"));
|
|
6
|
-
exports.useBoolean = useToggle_1.default;
|
|
7
|
-
exports.default = useToggle_1.default;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useClickAway = void 0;
|
|
4
|
-
var react_1 = require("react");
|
|
5
|
-
var util_1 = require("./misc/util");
|
|
6
|
-
var defaultEvents = ['mousedown', 'touchstart'];
|
|
7
|
-
var useClickAway = function (ref, onClickAway, events) {
|
|
8
|
-
if (events === void 0) { events = defaultEvents; }
|
|
9
|
-
var savedCallback = react_1.useRef(onClickAway);
|
|
10
|
-
react_1.useEffect(function () {
|
|
11
|
-
savedCallback.current = onClickAway;
|
|
12
|
-
}, [onClickAway]);
|
|
13
|
-
react_1.useEffect(function () {
|
|
14
|
-
var handler = function (event) {
|
|
15
|
-
var el = ref.current;
|
|
16
|
-
el && !el.contains(event.target) && savedCallback.current(event);
|
|
17
|
-
};
|
|
18
|
-
for (var _i = 0, events_1 = events; _i < events_1.length; _i++) {
|
|
19
|
-
var eventName = events_1[_i];
|
|
20
|
-
util_1.on(document, eventName, handler);
|
|
21
|
-
}
|
|
22
|
-
return function () {
|
|
23
|
-
for (var _i = 0, events_2 = events; _i < events_2.length; _i++) {
|
|
24
|
-
var eventName = events_2[_i];
|
|
25
|
-
util_1.off(document, eventName, handler);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
}, [events, ref]);
|
|
29
|
-
};
|
|
30
|
-
exports.useClickAway = useClickAway;
|
|
31
|
-
exports.default = exports.useClickAway;
|
package/lib/hooks/useEvent.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface ListenerType1 {
|
|
2
|
-
addEventListener(name: string, handler: (event?: any) => void, ...args: any[]): any;
|
|
3
|
-
removeEventListener(name: string, handler: (event?: any) => void, ...args: any[]): any;
|
|
4
|
-
}
|
|
5
|
-
export interface ListenerType2 {
|
|
6
|
-
on(name: string, handler: (event?: any) => void, ...args: any[]): any;
|
|
7
|
-
off(name: string, handler: (event?: any) => void, ...args: any[]): any;
|
|
8
|
-
}
|
|
9
|
-
export declare type UseEventTarget = ListenerType1 | ListenerType2;
|
|
10
|
-
declare type AddEventListener<T> = T extends ListenerType1 ? T['addEventListener'] : T extends ListenerType2 ? T['on'] : never;
|
|
11
|
-
export declare type UseEventOptions<T> = Parameters<AddEventListener<T>>[2];
|
|
12
|
-
declare const useEvent: <T extends UseEventTarget>(name: Parameters<AddEventListener<T>>[0], handler?: Parameters<AddEventListener<T>>[1] | null | undefined, target?: Window | T | null, options?: UseEventOptions<T> | undefined) => void;
|
|
13
|
-
export default useEvent;
|
package/lib/hooks/useEvent.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var react_1 = require("react");
|
|
4
|
-
var util_1 = require("./misc/util");
|
|
5
|
-
var defaultTarget = util_1.isBrowser ? window : null;
|
|
6
|
-
var isListenerType1 = function (target) {
|
|
7
|
-
return !!target.addEventListener;
|
|
8
|
-
};
|
|
9
|
-
var isListenerType2 = function (target) {
|
|
10
|
-
return !!target.on;
|
|
11
|
-
};
|
|
12
|
-
var useEvent = function (name, handler, target, options) {
|
|
13
|
-
if (target === void 0) { target = defaultTarget; }
|
|
14
|
-
react_1.useEffect(function () {
|
|
15
|
-
if (!handler) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
if (!target) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
if (isListenerType1(target)) {
|
|
22
|
-
util_1.on(target, name, handler, options);
|
|
23
|
-
}
|
|
24
|
-
else if (isListenerType2(target)) {
|
|
25
|
-
target.on(name, handler, options);
|
|
26
|
-
}
|
|
27
|
-
return function () {
|
|
28
|
-
if (isListenerType1(target)) {
|
|
29
|
-
util_1.off(target, name, handler, options);
|
|
30
|
-
}
|
|
31
|
-
else if (isListenerType2(target)) {
|
|
32
|
-
target.off(name, handler, options);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
}, [name, handler, target, JSON.stringify(options)]);
|
|
36
|
-
};
|
|
37
|
-
exports.default = useEvent;
|
package/lib/hooks/useKey.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { DependencyList } from 'react';
|
|
2
|
-
import { UseEventOptions, UseEventTarget } from './useEvent';
|
|
3
|
-
export declare type KeyPredicate = (event: KeyboardEvent) => boolean;
|
|
4
|
-
export declare type KeyFilter = null | undefined | string | ((event: KeyboardEvent) => boolean);
|
|
5
|
-
export declare type Handler = (event: KeyboardEvent) => void;
|
|
6
|
-
export interface UseKeyOptions<T extends UseEventTarget> {
|
|
7
|
-
event?: 'keydown' | 'keypress' | 'keyup';
|
|
8
|
-
target?: T | null;
|
|
9
|
-
options?: UseEventOptions<T>;
|
|
10
|
-
}
|
|
11
|
-
export declare const useKey: <T extends UseEventTarget>(key: KeyFilter, fn?: Handler, opts?: UseKeyOptions<T>, deps?: DependencyList) => void;
|
|
12
|
-
export default useKey;
|
package/lib/hooks/useKey.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useKey = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var react_1 = require("react");
|
|
6
|
-
var useEvent_1 = tslib_1.__importDefault(require("./useEvent"));
|
|
7
|
-
var util_1 = require("./misc/util");
|
|
8
|
-
var createKeyPredicate = function (keyFilter) {
|
|
9
|
-
return typeof keyFilter === 'function'
|
|
10
|
-
? keyFilter
|
|
11
|
-
: typeof keyFilter === 'string'
|
|
12
|
-
? function (event) { return event.key === keyFilter; }
|
|
13
|
-
: keyFilter
|
|
14
|
-
? function () { return true; }
|
|
15
|
-
: function () { return false; };
|
|
16
|
-
};
|
|
17
|
-
var useKey = function (key, fn, opts, deps) {
|
|
18
|
-
if (fn === void 0) { fn = util_1.noop; }
|
|
19
|
-
if (opts === void 0) { opts = {}; }
|
|
20
|
-
if (deps === void 0) { deps = [key]; }
|
|
21
|
-
var _a = opts.event, event = _a === void 0 ? 'keydown' : _a, target = opts.target, options = opts.options;
|
|
22
|
-
var useMemoHandler = react_1.useMemo(function () {
|
|
23
|
-
var predicate = createKeyPredicate(key);
|
|
24
|
-
var handler = function (handlerEvent) {
|
|
25
|
-
if (predicate(handlerEvent)) {
|
|
26
|
-
return fn(handlerEvent);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
return handler;
|
|
30
|
-
}, deps);
|
|
31
|
-
useEvent_1.default(event, useMemoHandler, target, options);
|
|
32
|
-
};
|
|
33
|
-
exports.useKey = useKey;
|
|
34
|
-
exports.default = exports.useKey;
|
package/lib/hooks/useList.d.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { IHookStateInitAction, IHookStateSetAction } from './misc/hookState';
|
|
2
|
-
export interface ListActions<T> {
|
|
3
|
-
/**
|
|
4
|
-
* @description Set new list instead old one
|
|
5
|
-
*/
|
|
6
|
-
set: (newList: IHookStateSetAction<T[]>) => void;
|
|
7
|
-
/**
|
|
8
|
-
* @description Add item(s) at the end of list
|
|
9
|
-
*/
|
|
10
|
-
push: (...items: T[]) => void;
|
|
11
|
-
/**
|
|
12
|
-
* @description Replace item at given position. If item at given position not exists it will be set.
|
|
13
|
-
*/
|
|
14
|
-
updateAt: (index: number, item: T) => void;
|
|
15
|
-
/**
|
|
16
|
-
* @description Insert item at given position, all items to the right will be shifted.
|
|
17
|
-
*/
|
|
18
|
-
insertAt: (index: number, item: T) => void;
|
|
19
|
-
/**
|
|
20
|
-
* @description Replace all items that matches predicate with given one.
|
|
21
|
-
*/
|
|
22
|
-
update: (predicate: (a: T, b: T) => boolean, newItem: T) => void;
|
|
23
|
-
/**
|
|
24
|
-
* @description Replace first item matching predicate with given one.
|
|
25
|
-
*/
|
|
26
|
-
updateFirst: (predicate: (a: T, b: T) => boolean, newItem: T) => void;
|
|
27
|
-
/**
|
|
28
|
-
* @description Like `updateFirst` bit in case of predicate miss - pushes item to the list
|
|
29
|
-
*/
|
|
30
|
-
upsert: (predicate: (a: T, b: T) => boolean, newItem: T) => void;
|
|
31
|
-
/**
|
|
32
|
-
* @description Sort list with given sorting function
|
|
33
|
-
*/
|
|
34
|
-
sort: (compareFn?: (a: T, b: T) => number) => void;
|
|
35
|
-
/**
|
|
36
|
-
* @description Same as native Array's method
|
|
37
|
-
*/
|
|
38
|
-
filter: (callbackFn: (value: T, index?: number, array?: T[]) => boolean, thisArg?: any) => void;
|
|
39
|
-
/**
|
|
40
|
-
* @description Removes item at given position. All items to the right from removed will be shifted.
|
|
41
|
-
*/
|
|
42
|
-
removeAt: (index: number) => void;
|
|
43
|
-
/**
|
|
44
|
-
* @deprecated Use removeAt method instead
|
|
45
|
-
*/
|
|
46
|
-
remove: (index: number) => void;
|
|
47
|
-
/**
|
|
48
|
-
* @description Make the list empty
|
|
49
|
-
*/
|
|
50
|
-
clear: () => void;
|
|
51
|
-
/**
|
|
52
|
-
* @description Reset list to initial value
|
|
53
|
-
*/
|
|
54
|
-
reset: () => void;
|
|
55
|
-
}
|
|
56
|
-
export declare function useList<T>(initialList?: IHookStateInitAction<T[]>): [T[], ListActions<T>];
|
|
57
|
-
export default useList;
|