@perses-dev/dashboards 0.53.1 → 0.54.0-beta.0
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/cjs/components/DashboardLinks/DashboardLinksEditor.js +366 -0
- package/dist/cjs/components/DashboardLinks/EditDashboardLinksButton.js +81 -0
- package/dist/cjs/components/DashboardLinks/index.js +31 -0
- package/dist/cjs/components/DashboardShortcuts/index.js +23 -0
- package/dist/cjs/components/DashboardShortcuts/useDashboardShortcuts.js +373 -0
- package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +16 -1
- package/dist/cjs/components/Datasources/EditDatasourcesButton.js +1 -7
- package/dist/cjs/components/GridLayout/GridItemContent.js +19 -6
- package/dist/cjs/components/{Panel/PanelLinks.js → LinksDisplay/LinksDisplay.js} +59 -10
- package/dist/cjs/components/LinksDisplay/index.js +30 -0
- package/dist/cjs/components/Panel/PanelActions.js +38 -23
- package/dist/cjs/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +4 -4
- package/dist/cjs/components/SaveDashboardButton/SaveDashboardButton.js +3 -61
- package/dist/cjs/components/Variables/ListVariableListBox.js +6 -6
- package/dist/cjs/components/Variables/Variable.js +3 -3
- package/dist/cjs/components/index.js +2 -0
- package/dist/cjs/constants/user-interface-text.js +1 -0
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +5 -1
- package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +16 -0
- package/dist/cjs/context/DashboardProvider/index.js +7 -0
- package/dist/cjs/context/DashboardProvider/links-slice.js +32 -0
- package/dist/cjs/context/DashboardProvider/panel-group-slice.js +2 -2
- package/dist/cjs/context/DashboardProvider/use-save-dashboard.js +104 -0
- package/dist/cjs/context/DatasourceStoreProvider.js +3 -9
- package/dist/cjs/context/VariableProvider/VariableProvider.js +7 -6
- package/dist/cjs/context/VariableProvider/hydrationUtils.js +3 -3
- package/dist/cjs/context/useDashboard.js +7 -4
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/keyboard-shortcuts/PanelFocusProvider.js +157 -0
- package/dist/cjs/keyboard-shortcuts/default-shortcuts/dashboard.js +75 -0
- package/dist/cjs/keyboard-shortcuts/default-shortcuts/global.js +121 -0
- package/dist/cjs/keyboard-shortcuts/default-shortcuts/index.js +33 -0
- package/dist/cjs/keyboard-shortcuts/default-shortcuts/panel.js +90 -0
- package/dist/cjs/keyboard-shortcuts/default-shortcuts/time-range.js +142 -0
- package/dist/cjs/keyboard-shortcuts/events.js +93 -0
- package/dist/cjs/keyboard-shortcuts/index.js +89 -0
- package/dist/cjs/keyboard-shortcuts/types.js +42 -0
- package/dist/cjs/keyboard-shortcuts/utils.js +76 -0
- package/dist/cjs/model/DashboardResource.js +16 -0
- package/dist/cjs/model/index.js +30 -0
- package/dist/cjs/test/render.js +18 -3
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +17 -2
- package/dist/cjs/views/ViewDashboard/ViewDashboard.js +2 -1
- package/dist/components/Dashboard/Dashboard.d.ts.map +1 -1
- package/dist/components/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/DashboardLinks/DashboardLinksEditor.d.ts +9 -0
- package/dist/components/DashboardLinks/DashboardLinksEditor.d.ts.map +1 -0
- package/dist/components/DashboardLinks/DashboardLinksEditor.js +353 -0
- package/dist/components/DashboardLinks/DashboardLinksEditor.js.map +1 -0
- package/dist/components/DashboardLinks/EditDashboardLinksButton.d.ts +18 -0
- package/dist/components/DashboardLinks/EditDashboardLinksButton.d.ts.map +1 -0
- package/dist/components/DashboardLinks/EditDashboardLinksButton.js +68 -0
- package/dist/components/DashboardLinks/EditDashboardLinksButton.js.map +1 -0
- package/dist/components/DashboardLinks/index.d.ts +3 -0
- package/dist/components/DashboardLinks/index.d.ts.map +1 -0
- package/dist/components/DashboardLinks/index.js +16 -0
- package/dist/components/DashboardLinks/index.js.map +1 -0
- package/dist/components/DashboardShortcuts/index.d.ts +3 -0
- package/dist/components/DashboardShortcuts/index.d.ts.map +1 -0
- package/dist/components/DashboardShortcuts/index.js +15 -0
- package/dist/components/DashboardShortcuts/index.js.map +1 -0
- package/dist/components/DashboardShortcuts/useDashboardShortcuts.d.ts +12 -0
- package/dist/components/DashboardShortcuts/useDashboardShortcuts.d.ts.map +1 -0
- package/dist/components/DashboardShortcuts/useDashboardShortcuts.js +365 -0
- package/dist/components/DashboardShortcuts/useDashboardShortcuts.js.map +1 -0
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts +1 -0
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.js +17 -2
- package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
- package/dist/components/Datasources/DatasourceEditor.d.ts +1 -1
- package/dist/components/Datasources/DatasourceEditor.d.ts.map +1 -1
- package/dist/components/Datasources/DatasourceEditor.js.map +1 -1
- package/dist/components/Datasources/EditDatasourcesButton.d.ts.map +1 -1
- package/dist/components/Datasources/EditDatasourcesButton.js +1 -7
- package/dist/components/Datasources/EditDatasourcesButton.js.map +1 -1
- package/dist/components/DownloadButton/serializeDashboard.d.ts +2 -2
- package/dist/components/DownloadButton/serializeDashboard.d.ts.map +1 -1
- package/dist/components/DownloadButton/serializeDashboard.js.map +1 -1
- package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
- package/dist/components/GridLayout/GridItemContent.js +21 -8
- package/dist/components/GridLayout/GridItemContent.js.map +1 -1
- package/dist/components/GridLayout/GridLayout.d.ts +1 -1
- package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
- package/dist/components/GridLayout/GridLayout.js.map +1 -1
- package/dist/components/GridLayout/GridTitle.d.ts +1 -1
- package/dist/components/GridLayout/GridTitle.js.map +1 -1
- package/dist/components/GridLayout/Row.d.ts +2 -1
- package/dist/components/GridLayout/Row.d.ts.map +1 -1
- package/dist/components/GridLayout/Row.js.map +1 -1
- package/dist/components/LeaveDialog/LeaveDialog.d.ts +3 -3
- package/dist/components/LeaveDialog/LeaveDialog.d.ts.map +1 -1
- package/dist/components/LeaveDialog/LeaveDialog.js.map +1 -1
- package/dist/components/LinksDisplay/LinksDisplay.d.ts +10 -0
- package/dist/components/LinksDisplay/LinksDisplay.d.ts.map +1 -0
- package/dist/components/{Panel/PanelLinks.js → LinksDisplay/LinksDisplay.js} +59 -10
- package/dist/components/LinksDisplay/LinksDisplay.js.map +1 -0
- package/dist/components/LinksDisplay/index.d.ts +2 -0
- package/dist/components/LinksDisplay/index.d.ts.map +1 -0
- package/dist/components/LinksDisplay/index.js +15 -0
- package/dist/components/LinksDisplay/index.js.map +1 -0
- package/dist/components/Panel/Panel.d.ts +2 -1
- package/dist/components/Panel/Panel.d.ts.map +1 -1
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/Panel/PanelActions.d.ts +1 -1
- package/dist/components/Panel/PanelActions.d.ts.map +1 -1
- package/dist/components/Panel/PanelActions.js +39 -24
- package/dist/components/Panel/PanelActions.js.map +1 -1
- package/dist/components/Panel/PanelContent.d.ts +1 -1
- package/dist/components/Panel/PanelContent.js.map +1 -1
- package/dist/components/Panel/PanelHeader.d.ts +1 -1
- package/dist/components/Panel/PanelHeader.js.map +1 -1
- package/dist/components/Panel/PanelPluginLoader.d.ts +1 -1
- package/dist/components/Panel/PanelPluginLoader.js.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts +2 -1
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.d.ts +1 -1
- package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
- package/dist/components/PanelDrawer/PanelQueriesSharedControls.d.ts +1 -1
- package/dist/components/PanelDrawer/PanelQueriesSharedControls.js.map +1 -1
- package/dist/components/PanelDrawer/usePanelEditor.d.ts +1 -1
- package/dist/components/PanelDrawer/usePanelEditor.js.map +1 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js.map +1 -1
- package/dist/components/QueryViewerDialog/QueryViewerDialog.d.ts +1 -1
- package/dist/components/QueryViewerDialog/QueryViewerDialog.js.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js +4 -62
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js.map +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.js.map +1 -1
- package/dist/components/Variables/EditVariablesButton.d.ts.map +1 -1
- package/dist/components/Variables/EditVariablesButton.js.map +1 -1
- package/dist/components/Variables/ListVariableListBox.js +1 -1
- package/dist/components/Variables/ListVariableListBox.js.map +1 -1
- package/dist/components/Variables/Variable.d.ts +1 -1
- package/dist/components/Variables/Variable.js +1 -1
- package/dist/components/Variables/Variable.js.map +1 -1
- package/dist/components/Variables/VariableEditor.d.ts +2 -1
- package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditor.js.map +1 -1
- package/dist/components/Variables/VariableList.d.ts +1 -1
- package/dist/components/Variables/VariableList.d.ts.map +1 -1
- package/dist/components/Variables/VariableList.js.map +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/constants/user-interface-text.d.ts +1 -0
- package/dist/constants/user-interface-text.d.ts.map +1 -1
- package/dist/constants/user-interface-text.js +1 -0
- package/dist/constants/user-interface-text.js.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.d.ts +8 -6
- package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.js +5 -1
- package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
- package/dist/context/DashboardProvider/common.d.ts +3 -2
- package/dist/context/DashboardProvider/common.d.ts.map +1 -1
- package/dist/context/DashboardProvider/common.js.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +15 -2
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.js +14 -0
- package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.d.ts +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/duplicate-panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/index.d.ts +2 -0
- package/dist/context/DashboardProvider/index.d.ts.map +1 -1
- package/dist/context/DashboardProvider/index.js +1 -0
- package/dist/context/DashboardProvider/index.js.map +1 -1
- package/dist/context/DashboardProvider/links-slice.d.ts +19 -0
- package/dist/context/DashboardProvider/links-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/links-slice.js +27 -0
- package/dist/context/DashboardProvider/links-slice.js.map +1 -0
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts +2 -1
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.d.ts +2 -1
- package/dist/context/DashboardProvider/panel-group-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.js +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-slice.d.ts +1 -1
- package/dist/context/DashboardProvider/panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/use-save-dashboard.d.ts +25 -0
- package/dist/context/DashboardProvider/use-save-dashboard.d.ts.map +1 -0
- package/dist/context/DashboardProvider/use-save-dashboard.js +105 -0
- package/dist/context/DashboardProvider/use-save-dashboard.js.map +1 -0
- package/dist/context/DashboardProvider/view-panel-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/view-panel-slice.js.map +1 -1
- package/dist/context/DatasourceStoreProvider.d.ts +4 -2
- package/dist/context/DatasourceStoreProvider.d.ts.map +1 -1
- package/dist/context/DatasourceStoreProvider.js +3 -9
- package/dist/context/DatasourceStoreProvider.js.map +1 -1
- package/dist/context/VariableProvider/VariableProvider.d.ts +2 -1
- package/dist/context/VariableProvider/VariableProvider.d.ts.map +1 -1
- package/dist/context/VariableProvider/VariableProvider.js +2 -1
- package/dist/context/VariableProvider/VariableProvider.js.map +1 -1
- package/dist/context/VariableProvider/hydrationUtils.d.ts +2 -1
- package/dist/context/VariableProvider/hydrationUtils.d.ts.map +1 -1
- package/dist/context/VariableProvider/hydrationUtils.js +1 -1
- package/dist/context/VariableProvider/hydrationUtils.js.map +1 -1
- package/dist/context/VariableProvider/query-params.d.ts +1 -1
- package/dist/context/VariableProvider/query-params.js.map +1 -1
- package/dist/context/VariableProvider/utils.d.ts +2 -1
- package/dist/context/VariableProvider/utils.d.ts.map +1 -1
- package/dist/context/VariableProvider/utils.js.map +1 -1
- package/dist/context/useDashboard.d.ts +11 -3
- package/dist/context/useDashboard.d.ts.map +1 -1
- package/dist/context/useDashboard.js +6 -3
- package/dist/context/useDashboard.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/keyboard-shortcuts/PanelFocusProvider.d.ts +12 -0
- package/dist/keyboard-shortcuts/PanelFocusProvider.d.ts.map +1 -0
- package/dist/keyboard-shortcuts/PanelFocusProvider.js +97 -0
- package/dist/keyboard-shortcuts/PanelFocusProvider.js.map +1 -0
- package/dist/keyboard-shortcuts/default-shortcuts/dashboard.d.ts +6 -0
- package/dist/keyboard-shortcuts/default-shortcuts/dashboard.d.ts.map +1 -0
- package/dist/keyboard-shortcuts/default-shortcuts/dashboard.js +53 -0
- package/dist/keyboard-shortcuts/default-shortcuts/dashboard.js.map +1 -0
- package/dist/keyboard-shortcuts/default-shortcuts/global.d.ts +9 -0
- package/dist/keyboard-shortcuts/default-shortcuts/global.d.ts.map +1 -0
- package/dist/keyboard-shortcuts/default-shortcuts/global.js +90 -0
- package/dist/keyboard-shortcuts/default-shortcuts/global.js.map +1 -0
- package/dist/keyboard-shortcuts/default-shortcuts/index.d.ts +5 -0
- package/dist/keyboard-shortcuts/default-shortcuts/index.d.ts.map +1 -0
- package/dist/keyboard-shortcuts/default-shortcuts/index.js +18 -0
- package/dist/keyboard-shortcuts/default-shortcuts/index.js.map +1 -0
- package/dist/keyboard-shortcuts/default-shortcuts/panel.d.ts +7 -0
- package/dist/keyboard-shortcuts/default-shortcuts/panel.d.ts.map +1 -0
- package/dist/keyboard-shortcuts/default-shortcuts/panel.js +65 -0
- package/dist/keyboard-shortcuts/default-shortcuts/panel.js.map +1 -0
- package/dist/keyboard-shortcuts/default-shortcuts/time-range.d.ts +10 -0
- package/dist/keyboard-shortcuts/default-shortcuts/time-range.d.ts.map +1 -0
- package/dist/keyboard-shortcuts/default-shortcuts/time-range.js +108 -0
- package/dist/keyboard-shortcuts/default-shortcuts/time-range.js.map +1 -0
- package/dist/keyboard-shortcuts/events.d.ts +18 -0
- package/dist/keyboard-shortcuts/events.d.ts.map +1 -0
- package/dist/keyboard-shortcuts/events.js +35 -0
- package/dist/keyboard-shortcuts/events.js.map +1 -0
- package/dist/keyboard-shortcuts/index.d.ts +9 -0
- package/dist/keyboard-shortcuts/index.d.ts.map +1 -0
- package/dist/keyboard-shortcuts/index.js +21 -0
- package/dist/keyboard-shortcuts/index.js.map +1 -0
- package/dist/keyboard-shortcuts/types.d.ts +37 -0
- package/dist/keyboard-shortcuts/types.d.ts.map +1 -0
- package/dist/keyboard-shortcuts/types.js +26 -0
- package/dist/keyboard-shortcuts/types.js.map +1 -0
- package/dist/keyboard-shortcuts/utils.d.ts +12 -0
- package/dist/keyboard-shortcuts/utils.d.ts.map +1 -0
- package/dist/keyboard-shortcuts/utils.js +51 -0
- package/dist/keyboard-shortcuts/utils.js.map +1 -0
- package/dist/model/DashboardResource.d.ts +15 -0
- package/dist/model/DashboardResource.d.ts.map +1 -0
- package/dist/model/DashboardResource.js +18 -0
- package/dist/model/DashboardResource.js.map +1 -0
- package/dist/model/index.d.ts +2 -0
- package/dist/model/index.d.ts.map +1 -0
- package/dist/model/index.js +15 -0
- package/dist/model/index.js.map +1 -0
- package/dist/test/dashboard-provider.d.ts +1 -1
- package/dist/test/dashboard-provider.d.ts.map +1 -1
- package/dist/test/dashboard-provider.js.map +1 -1
- package/dist/test/datasource-provider.js.map +1 -1
- package/dist/test/plugin-registry.js.map +1 -1
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +18 -3
- package/dist/test/render.js.map +1 -1
- package/dist/test/testDashboard.d.ts +11 -2
- package/dist/test/testDashboard.d.ts.map +1 -1
- package/dist/test/testDashboard.js.map +1 -1
- package/dist/utils/panelUtils.js.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.d.ts +5 -3
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.js +18 -3
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.js +3 -2
- package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
- package/package.json +5 -3
- package/dist/components/Panel/PanelLinks.d.ts +0 -6
- package/dist/components/Panel/PanelLinks.d.ts.map +0 -1
- package/dist/components/Panel/PanelLinks.js.map +0 -1
|
@@ -20,11 +20,11 @@ Object.defineProperty(exports, "useDashboard", {
|
|
|
20
20
|
return useDashboard;
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
|
-
const
|
|
23
|
+
const _spec = require("@perses-dev/spec");
|
|
24
24
|
const _DashboardProvider = require("./DashboardProvider");
|
|
25
25
|
const _VariableProvider = require("./VariableProvider");
|
|
26
26
|
function useDashboard() {
|
|
27
|
-
const { panels, panelGroups, panelGroupOrder, setDashboard: setDashboardResource, kind, metadata, display, duration, refreshInterval, datasources, ttl } = (0, _DashboardProvider.useDashboardStore)(({ panels, panelGroups, panelGroupOrder, setDashboard, kind, metadata, display, duration, refreshInterval, datasources, ttl })=>({
|
|
27
|
+
const { panels, panelGroups, panelGroupOrder, setDashboard: setDashboardResource, kind, metadata, display, duration, refreshInterval, datasources, links, ttl } = (0, _DashboardProvider.useDashboardStore)(({ panels, panelGroups, panelGroupOrder, setDashboard, kind, metadata, display, duration, refreshInterval, datasources, links, ttl })=>({
|
|
28
28
|
panels,
|
|
29
29
|
panelGroups,
|
|
30
30
|
panelGroupOrder,
|
|
@@ -35,6 +35,7 @@ function useDashboard() {
|
|
|
35
35
|
duration,
|
|
36
36
|
refreshInterval,
|
|
37
37
|
datasources,
|
|
38
|
+
links,
|
|
38
39
|
ttl
|
|
39
40
|
}));
|
|
40
41
|
const { setVariableDefinitions } = (0, _VariableProvider.useVariableDefinitionActions)();
|
|
@@ -50,7 +51,8 @@ function useDashboard() {
|
|
|
50
51
|
variables,
|
|
51
52
|
duration,
|
|
52
53
|
refreshInterval,
|
|
53
|
-
datasources
|
|
54
|
+
datasources,
|
|
55
|
+
links
|
|
54
56
|
}
|
|
55
57
|
} : {
|
|
56
58
|
kind,
|
|
@@ -63,6 +65,7 @@ function useDashboard() {
|
|
|
63
65
|
duration,
|
|
64
66
|
refreshInterval,
|
|
65
67
|
datasources,
|
|
68
|
+
links,
|
|
66
69
|
ttl
|
|
67
70
|
}
|
|
68
71
|
};
|
|
@@ -106,7 +109,7 @@ function convertPanelGroupsToLayouts(panelGroups, panelGroupOrder) {
|
|
|
106
109
|
y: layout.y,
|
|
107
110
|
width: layout.w,
|
|
108
111
|
height: layout.h,
|
|
109
|
-
content: (0,
|
|
112
|
+
content: (0, _spec.createPanelRef)(panelKey)
|
|
110
113
|
};
|
|
111
114
|
}),
|
|
112
115
|
repeatVariable: repeatVariable
|
package/dist/cjs/index.js
CHANGED
|
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
_export_star(require("./components"), exports);
|
|
18
18
|
_export_star(require("./context"), exports);
|
|
19
|
+
_export_star(require("./keyboard-shortcuts"), exports);
|
|
19
20
|
_export_star(require("./views"), exports);
|
|
21
|
+
_export_star(require("./model"), exports);
|
|
20
22
|
function _export_star(from, to) {
|
|
21
23
|
Object.keys(from).forEach(function(k) {
|
|
22
24
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
get PanelFocusProvider () {
|
|
25
|
+
return PanelFocusProvider;
|
|
26
|
+
},
|
|
27
|
+
get useFocusedPanel () {
|
|
28
|
+
return useFocusedPanel;
|
|
29
|
+
},
|
|
30
|
+
get usePanelFocusHandlers () {
|
|
31
|
+
return usePanelFocusHandlers;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
35
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
36
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
37
|
+
if (typeof WeakMap !== "function") return null;
|
|
38
|
+
var cacheBabelInterop = new WeakMap();
|
|
39
|
+
var cacheNodeInterop = new WeakMap();
|
|
40
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
41
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
42
|
+
})(nodeInterop);
|
|
43
|
+
}
|
|
44
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
45
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
46
|
+
return obj;
|
|
47
|
+
}
|
|
48
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
49
|
+
return {
|
|
50
|
+
default: obj
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
54
|
+
if (cache && cache.has(obj)) {
|
|
55
|
+
return cache.get(obj);
|
|
56
|
+
}
|
|
57
|
+
var newObj = {
|
|
58
|
+
__proto__: null
|
|
59
|
+
};
|
|
60
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
61
|
+
for(var key in obj){
|
|
62
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
63
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
64
|
+
if (desc && (desc.get || desc.set)) {
|
|
65
|
+
Object.defineProperty(newObj, key, desc);
|
|
66
|
+
} else {
|
|
67
|
+
newObj[key] = obj[key];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
newObj.default = obj;
|
|
72
|
+
if (cache) {
|
|
73
|
+
cache.set(obj, newObj);
|
|
74
|
+
}
|
|
75
|
+
return newObj;
|
|
76
|
+
}
|
|
77
|
+
const PanelFocusContext = /*#__PURE__*/ (0, _react.createContext)(undefined);
|
|
78
|
+
function usePanelFocusContext() {
|
|
79
|
+
const ctx = (0, _react.useContext)(PanelFocusContext);
|
|
80
|
+
if (ctx === undefined) {
|
|
81
|
+
throw new Error('Panel focus hooks must be used within a PanelFocusProvider');
|
|
82
|
+
}
|
|
83
|
+
return ctx;
|
|
84
|
+
}
|
|
85
|
+
function PanelFocusProvider({ children }) {
|
|
86
|
+
const [focusedPanelKey, setFocusedPanelKeyState] = (0, _react.useState)(null);
|
|
87
|
+
// This wrapper narrow the setter type (string-only / null-only) and provide
|
|
88
|
+
// stable references for the useMemo context value below. React guarantees
|
|
89
|
+
// setFocusedPanelKeyState is stable, but useCallback makes the stability
|
|
90
|
+
// explicit and satisfies exhaustive-deps when used in useMemo.
|
|
91
|
+
const setFocusedPanel = (0, _react.useCallback)((panelKey)=>{
|
|
92
|
+
setFocusedPanelKeyState(panelKey);
|
|
93
|
+
}, []);
|
|
94
|
+
const clearFocusedPanel = (0, _react.useCallback)(()=>{
|
|
95
|
+
setFocusedPanelKeyState(null);
|
|
96
|
+
}, []);
|
|
97
|
+
const value = (0, _react.useMemo)(()=>({
|
|
98
|
+
focusedPanelKey,
|
|
99
|
+
setFocusedPanel,
|
|
100
|
+
clearFocusedPanel
|
|
101
|
+
}), [
|
|
102
|
+
focusedPanelKey,
|
|
103
|
+
setFocusedPanel,
|
|
104
|
+
clearFocusedPanel
|
|
105
|
+
]);
|
|
106
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(PanelFocusContext.Provider, {
|
|
107
|
+
value: value,
|
|
108
|
+
children: children
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
function useFocusedPanel() {
|
|
112
|
+
return usePanelFocusContext().focusedPanelKey;
|
|
113
|
+
}
|
|
114
|
+
const PANEL_FOCUS_DEBOUNCE_MS = 50;
|
|
115
|
+
function usePanelFocusHandlers(panelKey) {
|
|
116
|
+
const { setFocusedPanel, clearFocusedPanel } = usePanelFocusContext();
|
|
117
|
+
const timerRef = (0, _react.useRef)(null);
|
|
118
|
+
const onMouseEnter = (0, _react.useCallback)((e)=>{
|
|
119
|
+
const element = e.currentTarget;
|
|
120
|
+
if (timerRef.current !== null) {
|
|
121
|
+
clearTimeout(timerRef.current);
|
|
122
|
+
}
|
|
123
|
+
timerRef.current = setTimeout(()=>{
|
|
124
|
+
setFocusedPanel(panelKey);
|
|
125
|
+
element.focus({
|
|
126
|
+
preventScroll: true
|
|
127
|
+
});
|
|
128
|
+
timerRef.current = null;
|
|
129
|
+
}, PANEL_FOCUS_DEBOUNCE_MS);
|
|
130
|
+
}, [
|
|
131
|
+
panelKey,
|
|
132
|
+
setFocusedPanel
|
|
133
|
+
]);
|
|
134
|
+
const onMouseLeave = (0, _react.useCallback)(()=>{
|
|
135
|
+
if (timerRef.current !== null) {
|
|
136
|
+
clearTimeout(timerRef.current);
|
|
137
|
+
timerRef.current = null;
|
|
138
|
+
}
|
|
139
|
+
clearFocusedPanel();
|
|
140
|
+
}, [
|
|
141
|
+
clearFocusedPanel
|
|
142
|
+
]);
|
|
143
|
+
(0, _react.useEffect)(()=>{
|
|
144
|
+
return ()=>{
|
|
145
|
+
if (timerRef.current !== null) {
|
|
146
|
+
clearTimeout(timerRef.current);
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
}, []);
|
|
150
|
+
return (0, _react.useMemo)(()=>({
|
|
151
|
+
onMouseEnter,
|
|
152
|
+
onMouseLeave
|
|
153
|
+
}), [
|
|
154
|
+
onMouseEnter,
|
|
155
|
+
onMouseLeave
|
|
156
|
+
]);
|
|
157
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
get DASHBOARD_SHORTCUTS () {
|
|
25
|
+
return DASHBOARD_SHORTCUTS;
|
|
26
|
+
},
|
|
27
|
+
get REFRESH_DASHBOARD_SHORTCUT () {
|
|
28
|
+
return REFRESH_DASHBOARD_SHORTCUT;
|
|
29
|
+
},
|
|
30
|
+
get SAVE_DASHBOARD_SHORTCUT () {
|
|
31
|
+
return SAVE_DASHBOARD_SHORTCUT;
|
|
32
|
+
},
|
|
33
|
+
get TOGGLE_EDIT_MODE_SHORTCUT () {
|
|
34
|
+
return TOGGLE_EDIT_MODE_SHORTCUT;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
const _events = require("../events");
|
|
38
|
+
const SAVE_DASHBOARD_SHORTCUT = {
|
|
39
|
+
id: 'save-dashboard',
|
|
40
|
+
hotkey: 'Mod+S',
|
|
41
|
+
name: 'Save Dashboard',
|
|
42
|
+
description: 'Save the current dashboard',
|
|
43
|
+
category: 'dashboard',
|
|
44
|
+
scope: 'dashboard',
|
|
45
|
+
event: _events.SAVE_DASHBOARD_EVENT
|
|
46
|
+
};
|
|
47
|
+
const REFRESH_DASHBOARD_SHORTCUT = {
|
|
48
|
+
id: 'refresh-dashboard',
|
|
49
|
+
sequence: [
|
|
50
|
+
'D',
|
|
51
|
+
'R'
|
|
52
|
+
],
|
|
53
|
+
name: 'Refresh Dashboard',
|
|
54
|
+
description: 'Refresh all panels',
|
|
55
|
+
category: 'dashboard',
|
|
56
|
+
scope: 'dashboard',
|
|
57
|
+
event: _events.REFRESH_DASHBOARD_EVENT
|
|
58
|
+
};
|
|
59
|
+
const TOGGLE_EDIT_MODE_SHORTCUT = {
|
|
60
|
+
id: 'toggle-edit-mode',
|
|
61
|
+
sequence: [
|
|
62
|
+
'D',
|
|
63
|
+
'M'
|
|
64
|
+
],
|
|
65
|
+
name: 'Toggle Edit Mode',
|
|
66
|
+
description: 'Toggle between edit and view mode',
|
|
67
|
+
category: 'dashboard',
|
|
68
|
+
scope: 'dashboard',
|
|
69
|
+
event: _events.TOGGLE_EDIT_MODE_EVENT
|
|
70
|
+
};
|
|
71
|
+
const DASHBOARD_SHORTCUTS = [
|
|
72
|
+
SAVE_DASHBOARD_SHORTCUT,
|
|
73
|
+
REFRESH_DASHBOARD_SHORTCUT,
|
|
74
|
+
TOGGLE_EDIT_MODE_SHORTCUT
|
|
75
|
+
];
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
get GLOBAL_SHORTCUTS () {
|
|
25
|
+
return GLOBAL_SHORTCUTS;
|
|
26
|
+
},
|
|
27
|
+
get GO_EXPLORE_SHORTCUT () {
|
|
28
|
+
return GO_EXPLORE_SHORTCUT;
|
|
29
|
+
},
|
|
30
|
+
get GO_HOME_SHORTCUT () {
|
|
31
|
+
return GO_HOME_SHORTCUT;
|
|
32
|
+
},
|
|
33
|
+
get GO_PROFILE_SHORTCUT () {
|
|
34
|
+
return GO_PROFILE_SHORTCUT;
|
|
35
|
+
},
|
|
36
|
+
get OPEN_SEARCH_SHORTCUT () {
|
|
37
|
+
return OPEN_SEARCH_SHORTCUT;
|
|
38
|
+
},
|
|
39
|
+
get SHOW_SHORTCUTS_SHORTCUT () {
|
|
40
|
+
return SHOW_SHORTCUTS_SHORTCUT;
|
|
41
|
+
},
|
|
42
|
+
get TOGGLE_THEME_SHORTCUT () {
|
|
43
|
+
return TOGGLE_THEME_SHORTCUT;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
const _events = require("../events");
|
|
47
|
+
const GO_HOME_SHORTCUT = {
|
|
48
|
+
id: 'go-home',
|
|
49
|
+
sequence: [
|
|
50
|
+
'G',
|
|
51
|
+
'H'
|
|
52
|
+
],
|
|
53
|
+
name: 'Go to Home',
|
|
54
|
+
description: 'Go to the Home page',
|
|
55
|
+
category: 'global',
|
|
56
|
+
scope: 'global'
|
|
57
|
+
};
|
|
58
|
+
const GO_EXPLORE_SHORTCUT = {
|
|
59
|
+
id: 'go-explore',
|
|
60
|
+
sequence: [
|
|
61
|
+
'G',
|
|
62
|
+
'E'
|
|
63
|
+
],
|
|
64
|
+
name: 'Go to Explore',
|
|
65
|
+
description: 'Go to the Explore page',
|
|
66
|
+
category: 'global',
|
|
67
|
+
scope: 'global'
|
|
68
|
+
};
|
|
69
|
+
const GO_PROFILE_SHORTCUT = {
|
|
70
|
+
id: 'go-profile',
|
|
71
|
+
sequence: [
|
|
72
|
+
'G',
|
|
73
|
+
'P'
|
|
74
|
+
],
|
|
75
|
+
name: 'Go to Profile',
|
|
76
|
+
description: 'Go to the Profile page',
|
|
77
|
+
category: 'global',
|
|
78
|
+
scope: 'global'
|
|
79
|
+
};
|
|
80
|
+
const OPEN_SEARCH_SHORTCUT = {
|
|
81
|
+
id: 'open-search',
|
|
82
|
+
hotkey: 'Mod+K',
|
|
83
|
+
name: 'Open Search',
|
|
84
|
+
description: 'Open the search dialog',
|
|
85
|
+
category: 'global',
|
|
86
|
+
scope: 'global',
|
|
87
|
+
event: _events.OPEN_SEARCH_EVENT
|
|
88
|
+
};
|
|
89
|
+
const SHOW_SHORTCUTS_SHORTCUT = {
|
|
90
|
+
id: 'show-shortcuts',
|
|
91
|
+
hotkey: {
|
|
92
|
+
key: '?',
|
|
93
|
+
shift: true
|
|
94
|
+
},
|
|
95
|
+
name: 'Show Keyboard Shortcuts',
|
|
96
|
+
description: 'Show all the keyboard shortcuts',
|
|
97
|
+
category: 'global',
|
|
98
|
+
scope: 'global',
|
|
99
|
+
event: _events.SHOW_SHORTCUTS_EVENT,
|
|
100
|
+
displayOverride: '?'
|
|
101
|
+
};
|
|
102
|
+
const TOGGLE_THEME_SHORTCUT = {
|
|
103
|
+
id: 'toggle-theme',
|
|
104
|
+
sequence: [
|
|
105
|
+
'C',
|
|
106
|
+
'T'
|
|
107
|
+
],
|
|
108
|
+
name: 'Change Theme',
|
|
109
|
+
description: 'Change between dark and light theme',
|
|
110
|
+
category: 'global',
|
|
111
|
+
scope: 'global',
|
|
112
|
+
event: _events.TOGGLE_THEME_EVENT
|
|
113
|
+
};
|
|
114
|
+
const GLOBAL_SHORTCUTS = [
|
|
115
|
+
GO_HOME_SHORTCUT,
|
|
116
|
+
GO_EXPLORE_SHORTCUT,
|
|
117
|
+
GO_PROFILE_SHORTCUT,
|
|
118
|
+
OPEN_SEARCH_SHORTCUT,
|
|
119
|
+
SHOW_SHORTCUTS_SHORTCUT,
|
|
120
|
+
TOGGLE_THEME_SHORTCUT
|
|
121
|
+
];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
_export_star(require("./global"), exports);
|
|
18
|
+
_export_star(require("./dashboard"), exports);
|
|
19
|
+
_export_star(require("./panel"), exports);
|
|
20
|
+
_export_star(require("./time-range"), exports);
|
|
21
|
+
function _export_star(from, to) {
|
|
22
|
+
Object.keys(from).forEach(function(k) {
|
|
23
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
24
|
+
Object.defineProperty(to, k, {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function() {
|
|
27
|
+
return from[k];
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
return from;
|
|
33
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
get PANEL_DELETE_SHORTCUT () {
|
|
25
|
+
return PANEL_DELETE_SHORTCUT;
|
|
26
|
+
},
|
|
27
|
+
get PANEL_DUPLICATE_SHORTCUT () {
|
|
28
|
+
return PANEL_DUPLICATE_SHORTCUT;
|
|
29
|
+
},
|
|
30
|
+
get PANEL_EDIT_SHORTCUT () {
|
|
31
|
+
return PANEL_EDIT_SHORTCUT;
|
|
32
|
+
},
|
|
33
|
+
get PANEL_FULLSCREEN_SHORTCUT () {
|
|
34
|
+
return PANEL_FULLSCREEN_SHORTCUT;
|
|
35
|
+
},
|
|
36
|
+
get PANEL_SHORTCUTS () {
|
|
37
|
+
return PANEL_SHORTCUTS;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const _events = require("../events");
|
|
41
|
+
const PANEL_EDIT_SHORTCUT = {
|
|
42
|
+
id: 'panel-edit',
|
|
43
|
+
hotkey: 'E',
|
|
44
|
+
name: 'Edit Panel',
|
|
45
|
+
description: 'Edit the focused panel when in edit mode',
|
|
46
|
+
category: 'focused-panel',
|
|
47
|
+
scope: 'panel',
|
|
48
|
+
event: _events.PANEL_EDIT_EVENT,
|
|
49
|
+
ignoreInputs: true
|
|
50
|
+
};
|
|
51
|
+
const PANEL_FULLSCREEN_SHORTCUT = {
|
|
52
|
+
id: 'panel-fullscreen',
|
|
53
|
+
hotkey: 'V',
|
|
54
|
+
name: 'Toggle Fullscreen',
|
|
55
|
+
description: 'Toggle fullscreen on the focused panel',
|
|
56
|
+
category: 'focused-panel',
|
|
57
|
+
scope: 'panel',
|
|
58
|
+
event: _events.PANEL_FULLSCREEN_EVENT,
|
|
59
|
+
ignoreInputs: true
|
|
60
|
+
};
|
|
61
|
+
const PANEL_DUPLICATE_SHORTCUT = {
|
|
62
|
+
id: 'panel-duplicate',
|
|
63
|
+
sequence: [
|
|
64
|
+
'P',
|
|
65
|
+
'D'
|
|
66
|
+
],
|
|
67
|
+
name: 'Duplicate Panel',
|
|
68
|
+
description: 'Duplicate the focused panel',
|
|
69
|
+
category: 'focused-panel',
|
|
70
|
+
scope: 'panel',
|
|
71
|
+
event: _events.PANEL_DUPLICATE_EVENT
|
|
72
|
+
};
|
|
73
|
+
const PANEL_DELETE_SHORTCUT = {
|
|
74
|
+
id: 'panel-delete',
|
|
75
|
+
sequence: [
|
|
76
|
+
'P',
|
|
77
|
+
'R'
|
|
78
|
+
],
|
|
79
|
+
name: 'Delete Panel',
|
|
80
|
+
description: 'Delete the focused panel',
|
|
81
|
+
category: 'focused-panel',
|
|
82
|
+
scope: 'panel',
|
|
83
|
+
event: _events.PANEL_DELETE_EVENT
|
|
84
|
+
};
|
|
85
|
+
const PANEL_SHORTCUTS = [
|
|
86
|
+
PANEL_EDIT_SHORTCUT,
|
|
87
|
+
PANEL_FULLSCREEN_SHORTCUT,
|
|
88
|
+
PANEL_DUPLICATE_SHORTCUT,
|
|
89
|
+
PANEL_DELETE_SHORTCUT
|
|
90
|
+
];
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
get TIME_COPY_SHORTCUT () {
|
|
25
|
+
return TIME_COPY_SHORTCUT;
|
|
26
|
+
},
|
|
27
|
+
get TIME_MAKE_ABSOLUTE_SHORTCUT () {
|
|
28
|
+
return TIME_MAKE_ABSOLUTE_SHORTCUT;
|
|
29
|
+
},
|
|
30
|
+
get TIME_PASTE_SHORTCUT () {
|
|
31
|
+
return TIME_PASTE_SHORTCUT;
|
|
32
|
+
},
|
|
33
|
+
get TIME_RANGE_SHORTCUTS () {
|
|
34
|
+
return TIME_RANGE_SHORTCUTS;
|
|
35
|
+
},
|
|
36
|
+
get TIME_SHIFT_BACK_SHORTCUT () {
|
|
37
|
+
return TIME_SHIFT_BACK_SHORTCUT;
|
|
38
|
+
},
|
|
39
|
+
get TIME_SHIFT_FORWARD_SHORTCUT () {
|
|
40
|
+
return TIME_SHIFT_FORWARD_SHORTCUT;
|
|
41
|
+
},
|
|
42
|
+
get TIME_ZOOM_IN_SHORTCUT () {
|
|
43
|
+
return TIME_ZOOM_IN_SHORTCUT;
|
|
44
|
+
},
|
|
45
|
+
get TIME_ZOOM_OUT_SHORTCUT () {
|
|
46
|
+
return TIME_ZOOM_OUT_SHORTCUT;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
const _events = require("../events");
|
|
50
|
+
const TIME_ZOOM_OUT_SHORTCUT = {
|
|
51
|
+
id: 'time-zoom-out',
|
|
52
|
+
sequence: [
|
|
53
|
+
'T',
|
|
54
|
+
'O'
|
|
55
|
+
],
|
|
56
|
+
name: 'Zoom Out',
|
|
57
|
+
description: 'Zoom out time range (2x)',
|
|
58
|
+
category: 'time-range',
|
|
59
|
+
scope: 'dashboard',
|
|
60
|
+
event: _events.TIME_ZOOM_OUT_EVENT
|
|
61
|
+
};
|
|
62
|
+
const TIME_ZOOM_IN_SHORTCUT = {
|
|
63
|
+
id: 'time-zoom-in',
|
|
64
|
+
sequence: [
|
|
65
|
+
'T',
|
|
66
|
+
'I'
|
|
67
|
+
],
|
|
68
|
+
name: 'Zoom In',
|
|
69
|
+
description: 'Zoom in time range (½)',
|
|
70
|
+
category: 'time-range',
|
|
71
|
+
scope: 'dashboard',
|
|
72
|
+
event: _events.TIME_ZOOM_IN_EVENT
|
|
73
|
+
};
|
|
74
|
+
const TIME_SHIFT_BACK_SHORTCUT = {
|
|
75
|
+
id: 'time-shift-back',
|
|
76
|
+
sequence: [
|
|
77
|
+
'T',
|
|
78
|
+
'ArrowLeft'
|
|
79
|
+
],
|
|
80
|
+
name: 'Shift Back',
|
|
81
|
+
description: 'Shift time range backward',
|
|
82
|
+
category: 'time-range',
|
|
83
|
+
scope: 'dashboard',
|
|
84
|
+
event: _events.TIME_SHIFT_BACK_EVENT
|
|
85
|
+
};
|
|
86
|
+
const TIME_SHIFT_FORWARD_SHORTCUT = {
|
|
87
|
+
id: 'time-shift-forward',
|
|
88
|
+
sequence: [
|
|
89
|
+
'T',
|
|
90
|
+
'ArrowRight'
|
|
91
|
+
],
|
|
92
|
+
name: 'Shift Forward',
|
|
93
|
+
description: 'Shift time range forward',
|
|
94
|
+
category: 'time-range',
|
|
95
|
+
scope: 'dashboard',
|
|
96
|
+
event: _events.TIME_SHIFT_FORWARD_EVENT
|
|
97
|
+
};
|
|
98
|
+
const TIME_MAKE_ABSOLUTE_SHORTCUT = {
|
|
99
|
+
id: 'time-make-absolute',
|
|
100
|
+
sequence: [
|
|
101
|
+
'T',
|
|
102
|
+
'A'
|
|
103
|
+
],
|
|
104
|
+
name: 'Make Absolute',
|
|
105
|
+
description: 'Convert time range to absolute',
|
|
106
|
+
category: 'time-range',
|
|
107
|
+
scope: 'dashboard',
|
|
108
|
+
event: _events.TIME_MAKE_ABSOLUTE_EVENT
|
|
109
|
+
};
|
|
110
|
+
const TIME_COPY_SHORTCUT = {
|
|
111
|
+
id: 'time-copy',
|
|
112
|
+
sequence: [
|
|
113
|
+
'T',
|
|
114
|
+
'C'
|
|
115
|
+
],
|
|
116
|
+
name: 'Copy Time Range',
|
|
117
|
+
description: 'Copy time range to clipboard',
|
|
118
|
+
category: 'time-range',
|
|
119
|
+
scope: 'dashboard',
|
|
120
|
+
event: _events.TIME_COPY_EVENT
|
|
121
|
+
};
|
|
122
|
+
const TIME_PASTE_SHORTCUT = {
|
|
123
|
+
id: 'time-paste',
|
|
124
|
+
sequence: [
|
|
125
|
+
'T',
|
|
126
|
+
'V'
|
|
127
|
+
],
|
|
128
|
+
name: 'Paste Time Range',
|
|
129
|
+
description: 'Paste time range from clipboard',
|
|
130
|
+
category: 'time-range',
|
|
131
|
+
scope: 'dashboard',
|
|
132
|
+
event: _events.TIME_PASTE_EVENT
|
|
133
|
+
};
|
|
134
|
+
const TIME_RANGE_SHORTCUTS = [
|
|
135
|
+
TIME_ZOOM_OUT_SHORTCUT,
|
|
136
|
+
TIME_ZOOM_IN_SHORTCUT,
|
|
137
|
+
TIME_SHIFT_BACK_SHORTCUT,
|
|
138
|
+
TIME_SHIFT_FORWARD_SHORTCUT,
|
|
139
|
+
TIME_MAKE_ABSOLUTE_SHORTCUT,
|
|
140
|
+
TIME_COPY_SHORTCUT,
|
|
141
|
+
TIME_PASTE_SHORTCUT
|
|
142
|
+
];
|