@perses-dev/dashboards 0.53.1 → 0.54.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +21 -8
- 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/PanelDrawer/PanelEditorForm.js +2 -2
- 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/defaults.js +32 -0
- package/dist/cjs/constants/index.js +1 -0
- package/dist/cjs/constants/user-interface-text.js +1 -0
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +8 -4
- 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 +3 -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 +92 -0
- package/dist/cjs/keyboard-shortcuts/types.js +42 -0
- package/dist/cjs/keyboard-shortcuts/utils.js +87 -0
- package/dist/cjs/model/DashboardResource.js +16 -0
- package/dist/cjs/model/PanelGroupDefinition.js +25 -0
- package/dist/cjs/model/VariableDefinition.js +16 -0
- package/dist/cjs/model/index.js +31 -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 +5 -4
- 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 +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 +2 -2
- 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/defaults.d.ts +4 -0
- package/dist/constants/defaults.d.ts.map +1 -0
- package/dist/constants/defaults.js +16 -0
- package/dist/constants/defaults.js.map +1 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +1 -0
- package/dist/constants/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 +6 -2
- 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 +14 -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.d.ts +1 -1
- package/dist/context/DashboardProvider/delete-panel-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/duplicate-panel-slice.d.ts +1 -1
- package/dist/context/DashboardProvider/duplicate-panel-slice.d.ts.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 +3 -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 +1 -1
- 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 +10 -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 +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -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 +20 -0
- package/dist/keyboard-shortcuts/utils.d.ts.map +1 -0
- package/dist/keyboard-shortcuts/utils.js +64 -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/PanelGroupDefinition.d.ts +59 -0
- package/dist/model/PanelGroupDefinition.d.ts.map +1 -0
- package/dist/model/PanelGroupDefinition.js +19 -0
- package/dist/model/PanelGroupDefinition.js.map +1 -0
- package/dist/model/VariableDefinition.d.ts +50 -0
- package/dist/model/VariableDefinition.d.ts.map +1 -0
- package/dist/model/VariableDefinition.js +20 -0
- package/dist/model/VariableDefinition.js.map +1 -0
- package/dist/model/index.d.ts +3 -0
- package/dist/model/index.d.ts.map +1 -0
- package/dist/model/index.js +16 -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/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.d.ts +1 -1
- package/dist/utils/panelUtils.d.ts.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
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
import { createPanelRef } from '@perses-dev/
|
|
13
|
+
import { createPanelRef } from '@perses-dev/spec';
|
|
14
14
|
import { useDashboardStore } from './DashboardProvider';
|
|
15
15
|
import { useVariableDefinitionActions, useVariableDefinitions } from './VariableProvider';
|
|
16
16
|
export function useDashboard() {
|
|
17
|
-
const { panels, panelGroups, panelGroupOrder, setDashboard: setDashboardResource, kind, metadata, display, duration, refreshInterval, datasources, ttl } = useDashboardStore(({ panels, panelGroups, panelGroupOrder, setDashboard, kind, metadata, display, duration, refreshInterval, datasources, ttl })=>({
|
|
17
|
+
const { panels, panelGroups, panelGroupOrder, setDashboard: setDashboardResource, kind, metadata, display, duration, refreshInterval, datasources, links, ttl } = useDashboardStore(({ panels, panelGroups, panelGroupOrder, setDashboard, kind, metadata, display, duration, refreshInterval, datasources, links, ttl })=>({
|
|
18
18
|
panels,
|
|
19
19
|
panelGroups,
|
|
20
20
|
panelGroupOrder,
|
|
@@ -25,6 +25,7 @@ export function useDashboard() {
|
|
|
25
25
|
duration,
|
|
26
26
|
refreshInterval,
|
|
27
27
|
datasources,
|
|
28
|
+
links,
|
|
28
29
|
ttl
|
|
29
30
|
}));
|
|
30
31
|
const { setVariableDefinitions } = useVariableDefinitionActions();
|
|
@@ -40,7 +41,8 @@ export function useDashboard() {
|
|
|
40
41
|
variables,
|
|
41
42
|
duration,
|
|
42
43
|
refreshInterval,
|
|
43
|
-
datasources
|
|
44
|
+
datasources,
|
|
45
|
+
links
|
|
44
46
|
}
|
|
45
47
|
} : {
|
|
46
48
|
kind,
|
|
@@ -53,6 +55,7 @@ export function useDashboard() {
|
|
|
53
55
|
duration,
|
|
54
56
|
refreshInterval,
|
|
55
57
|
datasources,
|
|
58
|
+
links,
|
|
56
59
|
ttl
|
|
57
60
|
}
|
|
58
61
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/context/useDashboard.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/context/useDashboard.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { createPanelRef, DashboardSpec, DurationString, GridDefinition, PanelGroupId } from '@perses-dev/spec';\nimport { DashboardResource, PanelGroupDefinition } from '../model';\n\nimport { useDashboardStore } from './DashboardProvider';\nimport { useVariableDefinitionActions, useVariableDefinitions } from './VariableProvider';\n\ntype DashboardType = Omit<DashboardResource, 'spec'> & { spec: DashboardSpec & { ttl?: DurationString } };\nexport function useDashboard(): {\n dashboard: DashboardType;\n setDashboard: (dashboardResource: DashboardResource) => void;\n} {\n const {\n panels,\n panelGroups,\n panelGroupOrder,\n setDashboard: setDashboardResource,\n kind,\n metadata,\n display,\n duration,\n refreshInterval,\n datasources,\n links,\n ttl,\n } = useDashboardStore(\n ({\n panels,\n panelGroups,\n panelGroupOrder,\n setDashboard,\n kind,\n metadata,\n display,\n duration,\n refreshInterval,\n datasources,\n links,\n ttl,\n }) => ({\n panels,\n panelGroups,\n panelGroupOrder,\n setDashboard,\n kind,\n metadata,\n display,\n duration,\n refreshInterval,\n datasources,\n links,\n ttl,\n })\n );\n const { setVariableDefinitions } = useVariableDefinitionActions();\n const variables = useVariableDefinitions();\n const layouts = convertPanelGroupsToLayouts(panelGroups, panelGroupOrder);\n\n const dashboard: DashboardType =\n kind === 'Dashboard'\n ? {\n kind,\n metadata,\n spec: {\n display,\n panels,\n layouts,\n variables,\n duration,\n refreshInterval,\n datasources,\n links,\n },\n }\n : {\n kind,\n metadata,\n spec: {\n display,\n panels,\n layouts,\n variables,\n duration,\n refreshInterval,\n datasources,\n links,\n ttl,\n },\n };\n\n const setDashboard = (dashboardResource: DashboardResource): void => {\n setVariableDefinitions(dashboardResource.spec.variables);\n setDashboardResource(dashboardResource);\n };\n\n return {\n dashboard,\n setDashboard,\n };\n}\n\nfunction convertPanelGroupsToLayouts(\n panelGroups: Record<number, PanelGroupDefinition>,\n panelGroupOrder: PanelGroupId[]\n): GridDefinition[] {\n const layouts: GridDefinition[] = [];\n panelGroupOrder.map((groupOrderId) => {\n const group = panelGroups[groupOrderId];\n if (group === undefined) {\n throw new Error('panel group not found');\n }\n const { title, isCollapsed, repeatVariable, itemLayouts, itemPanelKeys } = group;\n let display = undefined;\n if (title || isCollapsed !== undefined) {\n display = {\n title: title ?? '',\n collapse: {\n open: !isCollapsed,\n },\n };\n }\n const layout: GridDefinition = {\n kind: 'Grid',\n spec: {\n display,\n items: itemLayouts.map((layout) => {\n const panelKey = itemPanelKeys[layout.i];\n if (panelKey === undefined) {\n throw new Error(`Missing panel key of layout ${layout.i}`);\n }\n return {\n x: layout.x,\n y: layout.y,\n width: layout.w,\n height: layout.h,\n content: createPanelRef(panelKey),\n };\n }),\n repeatVariable: repeatVariable,\n },\n };\n layouts.push(layout);\n });\n\n return layouts;\n}\n"],"names":["createPanelRef","useDashboardStore","useVariableDefinitionActions","useVariableDefinitions","useDashboard","panels","panelGroups","panelGroupOrder","setDashboard","setDashboardResource","kind","metadata","display","duration","refreshInterval","datasources","links","ttl","setVariableDefinitions","variables","layouts","convertPanelGroupsToLayouts","dashboard","spec","dashboardResource","map","groupOrderId","group","undefined","Error","title","isCollapsed","repeatVariable","itemLayouts","itemPanelKeys","collapse","open","layout","items","panelKey","i","x","y","width","w","height","h","content","push"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,cAAc,QAAqE,mBAAmB;AAG/G,SAASC,iBAAiB,QAAQ,sBAAsB;AACxD,SAASC,4BAA4B,EAAEC,sBAAsB,QAAQ,qBAAqB;AAG1F,OAAO,SAASC;IAId,MAAM,EACJC,MAAM,EACNC,WAAW,EACXC,eAAe,EACfC,cAAcC,oBAAoB,EAClCC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,QAAQ,EACRC,eAAe,EACfC,WAAW,EACXC,KAAK,EACLC,GAAG,EACJ,GAAGhB,kBACF,CAAC,EACCI,MAAM,EACNC,WAAW,EACXC,eAAe,EACfC,YAAY,EACZE,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,QAAQ,EACRC,eAAe,EACfC,WAAW,EACXC,KAAK,EACLC,GAAG,EACJ,GAAM,CAAA;YACLZ;YACAC;YACAC;YACAC;YACAE;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;QACF,CAAA;IAEF,MAAM,EAAEC,sBAAsB,EAAE,GAAGhB;IACnC,MAAMiB,YAAYhB;IAClB,MAAMiB,UAAUC,4BAA4Bf,aAAaC;IAEzD,MAAMe,YACJZ,SAAS,cACL;QACEA;QACAC;QACAY,MAAM;YACJX;YACAP;YACAe;YACAD;YACAN;YACAC;YACAC;YACAC;QACF;IACF,IACA;QACEN;QACAC;QACAY,MAAM;YACJX;YACAP;YACAe;YACAD;YACAN;YACAC;YACAC;YACAC;YACAC;QACF;IACF;IAEN,MAAMT,eAAe,CAACgB;QACpBN,uBAAuBM,kBAAkBD,IAAI,CAACJ,SAAS;QACvDV,qBAAqBe;IACvB;IAEA,OAAO;QACLF;QACAd;IACF;AACF;AAEA,SAASa,4BACPf,WAAiD,EACjDC,eAA+B;IAE/B,MAAMa,UAA4B,EAAE;IACpCb,gBAAgBkB,GAAG,CAAC,CAACC;QACnB,MAAMC,QAAQrB,WAAW,CAACoB,aAAa;QACvC,IAAIC,UAAUC,WAAW;YACvB,MAAM,IAAIC,MAAM;QAClB;QACA,MAAM,EAAEC,KAAK,EAAEC,WAAW,EAAEC,cAAc,EAAEC,WAAW,EAAEC,aAAa,EAAE,GAAGP;QAC3E,IAAIf,UAAUgB;QACd,IAAIE,SAASC,gBAAgBH,WAAW;YACtChB,UAAU;gBACRkB,OAAOA,SAAS;gBAChBK,UAAU;oBACRC,MAAM,CAACL;gBACT;YACF;QACF;QACA,MAAMM,SAAyB;YAC7B3B,MAAM;YACNa,MAAM;gBACJX;gBACA0B,OAAOL,YAAYR,GAAG,CAAC,CAACY;oBACtB,MAAME,WAAWL,aAAa,CAACG,OAAOG,CAAC,CAAC;oBACxC,IAAID,aAAaX,WAAW;wBAC1B,MAAM,IAAIC,MAAM,CAAC,4BAA4B,EAAEQ,OAAOG,CAAC,EAAE;oBAC3D;oBACA,OAAO;wBACLC,GAAGJ,OAAOI,CAAC;wBACXC,GAAGL,OAAOK,CAAC;wBACXC,OAAON,OAAOO,CAAC;wBACfC,QAAQR,OAAOS,CAAC;wBAChBC,SAAS/C,eAAeuC;oBAC1B;gBACF;gBACAP,gBAAgBA;YAClB;QACF;QACAZ,QAAQ4B,IAAI,CAACX;IACf;IAEA,OAAOjB;AACT"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
export * from './components';
|
|
14
14
|
export * from './context';
|
|
15
|
+
export * from './keyboard-shortcuts';
|
|
15
16
|
export * from './views';
|
|
17
|
+
export * from './model';
|
|
18
|
+
export * from './constants';
|
|
16
19
|
|
|
17
20
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './components';\nexport * from './context';\nexport * from './views';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,eAAe;AAC7B,cAAc,YAAY;AAC1B,cAAc,UAAU"}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './components';\nexport * from './context';\nexport * from './keyboard-shortcuts';\nexport * from './views';\nexport * from './model';\nexport * from './constants';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,eAAe;AAC7B,cAAc,YAAY;AAC1B,cAAc,uBAAuB;AACrC,cAAc,UAAU;AACxB,cAAc,UAAU;AACxB,cAAc,cAAc"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { ReactElement, ReactNode } from 'react';
|
|
2
|
+
/** Tracks which dashboard panel is currently focused (hovered) for panel-scoped shortcuts. */
|
|
3
|
+
export declare function PanelFocusProvider({ children }: {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}): ReactElement;
|
|
6
|
+
export declare function useFocusedPanel(): string | null;
|
|
7
|
+
/** Debounced mouse enter/leave handlers for panel focus. Add `tabIndex={-1}` to the panel element. */
|
|
8
|
+
export declare function usePanelFocusHandlers(panelKey: string): {
|
|
9
|
+
onMouseEnter: (e: React.MouseEvent<HTMLElement>) => void;
|
|
10
|
+
onMouseLeave: () => void;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=PanelFocusProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PanelFocusProvider.d.ts","sourceRoot":"","sources":["../../src/keyboard-shortcuts/PanelFocusProvider.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,EAEZ,YAAY,EACZ,SAAS,EAOV,MAAM,OAAO,CAAC;AAkBf,8FAA8F;AAC9F,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,YAAY,CAyBtF;AAED,wBAAgB,eAAe,IAAI,MAAM,GAAG,IAAI,CAE/C;AAID,sGAAsG;AACtG,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG;IACvD,YAAY,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACzD,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B,CAoCA"}
|
|
@@ -0,0 +1,97 @@
|
|
|
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
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import React, { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
15
|
+
const PanelFocusContext = /*#__PURE__*/ createContext(undefined);
|
|
16
|
+
function usePanelFocusContext() {
|
|
17
|
+
const ctx = useContext(PanelFocusContext);
|
|
18
|
+
if (ctx === undefined) {
|
|
19
|
+
throw new Error('Panel focus hooks must be used within a PanelFocusProvider');
|
|
20
|
+
}
|
|
21
|
+
return ctx;
|
|
22
|
+
}
|
|
23
|
+
/** Tracks which dashboard panel is currently focused (hovered) for panel-scoped shortcuts. */ export function PanelFocusProvider({ children }) {
|
|
24
|
+
const [focusedPanelKey, setFocusedPanelKeyState] = useState(null);
|
|
25
|
+
// This wrapper narrow the setter type (string-only / null-only) and provide
|
|
26
|
+
// stable references for the useMemo context value below. React guarantees
|
|
27
|
+
// setFocusedPanelKeyState is stable, but useCallback makes the stability
|
|
28
|
+
// explicit and satisfies exhaustive-deps when used in useMemo.
|
|
29
|
+
const setFocusedPanel = useCallback((panelKey)=>{
|
|
30
|
+
setFocusedPanelKeyState(panelKey);
|
|
31
|
+
}, []);
|
|
32
|
+
const clearFocusedPanel = useCallback(()=>{
|
|
33
|
+
setFocusedPanelKeyState(null);
|
|
34
|
+
}, []);
|
|
35
|
+
const value = useMemo(()=>({
|
|
36
|
+
focusedPanelKey,
|
|
37
|
+
setFocusedPanel,
|
|
38
|
+
clearFocusedPanel
|
|
39
|
+
}), [
|
|
40
|
+
focusedPanelKey,
|
|
41
|
+
setFocusedPanel,
|
|
42
|
+
clearFocusedPanel
|
|
43
|
+
]);
|
|
44
|
+
return /*#__PURE__*/ _jsx(PanelFocusContext.Provider, {
|
|
45
|
+
value: value,
|
|
46
|
+
children: children
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
export function useFocusedPanel() {
|
|
50
|
+
return usePanelFocusContext().focusedPanelKey;
|
|
51
|
+
}
|
|
52
|
+
const PANEL_FOCUS_DEBOUNCE_MS = 50;
|
|
53
|
+
/** Debounced mouse enter/leave handlers for panel focus. Add `tabIndex={-1}` to the panel element. */ export function usePanelFocusHandlers(panelKey) {
|
|
54
|
+
const { setFocusedPanel, clearFocusedPanel } = usePanelFocusContext();
|
|
55
|
+
const timerRef = useRef(null);
|
|
56
|
+
const onMouseEnter = useCallback((e)=>{
|
|
57
|
+
const element = e.currentTarget;
|
|
58
|
+
if (timerRef.current !== null) {
|
|
59
|
+
clearTimeout(timerRef.current);
|
|
60
|
+
}
|
|
61
|
+
timerRef.current = setTimeout(()=>{
|
|
62
|
+
setFocusedPanel(panelKey);
|
|
63
|
+
element.focus({
|
|
64
|
+
preventScroll: true
|
|
65
|
+
});
|
|
66
|
+
timerRef.current = null;
|
|
67
|
+
}, PANEL_FOCUS_DEBOUNCE_MS);
|
|
68
|
+
}, [
|
|
69
|
+
panelKey,
|
|
70
|
+
setFocusedPanel
|
|
71
|
+
]);
|
|
72
|
+
const onMouseLeave = useCallback(()=>{
|
|
73
|
+
if (timerRef.current !== null) {
|
|
74
|
+
clearTimeout(timerRef.current);
|
|
75
|
+
timerRef.current = null;
|
|
76
|
+
}
|
|
77
|
+
clearFocusedPanel();
|
|
78
|
+
}, [
|
|
79
|
+
clearFocusedPanel
|
|
80
|
+
]);
|
|
81
|
+
useEffect(()=>{
|
|
82
|
+
return ()=>{
|
|
83
|
+
if (timerRef.current !== null) {
|
|
84
|
+
clearTimeout(timerRef.current);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}, []);
|
|
88
|
+
return useMemo(()=>({
|
|
89
|
+
onMouseEnter,
|
|
90
|
+
onMouseLeave
|
|
91
|
+
}), [
|
|
92
|
+
onMouseEnter,
|
|
93
|
+
onMouseLeave
|
|
94
|
+
]);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
//# sourceMappingURL=PanelFocusProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/keyboard-shortcuts/PanelFocusProvider.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport React, {\n createContext,\n ReactElement,\n ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\ninterface PanelFocusContextValue {\n focusedPanelKey: string | null;\n setFocusedPanel: (panelKey: string) => void;\n clearFocusedPanel: () => void;\n}\n\nconst PanelFocusContext = createContext<PanelFocusContextValue | undefined>(undefined);\n\nfunction usePanelFocusContext(): PanelFocusContextValue {\n const ctx = useContext(PanelFocusContext);\n if (ctx === undefined) {\n throw new Error('Panel focus hooks must be used within a PanelFocusProvider');\n }\n return ctx;\n}\n\n/** Tracks which dashboard panel is currently focused (hovered) for panel-scoped shortcuts. */\nexport function PanelFocusProvider({ children }: { children: ReactNode }): ReactElement {\n const [focusedPanelKey, setFocusedPanelKeyState] = useState<string | null>(null);\n\n // This wrapper narrow the setter type (string-only / null-only) and provide\n // stable references for the useMemo context value below. React guarantees\n // setFocusedPanelKeyState is stable, but useCallback makes the stability\n // explicit and satisfies exhaustive-deps when used in useMemo.\n const setFocusedPanel = useCallback((panelKey: string) => {\n setFocusedPanelKeyState(panelKey);\n }, []);\n\n const clearFocusedPanel = useCallback(() => {\n setFocusedPanelKeyState(null);\n }, []);\n\n const value = useMemo(\n (): PanelFocusContextValue => ({\n focusedPanelKey,\n setFocusedPanel,\n clearFocusedPanel,\n }),\n [focusedPanelKey, setFocusedPanel, clearFocusedPanel]\n );\n\n return <PanelFocusContext.Provider value={value}>{children}</PanelFocusContext.Provider>;\n}\n\nexport function useFocusedPanel(): string | null {\n return usePanelFocusContext().focusedPanelKey;\n}\n\nconst PANEL_FOCUS_DEBOUNCE_MS = 50;\n\n/** Debounced mouse enter/leave handlers for panel focus. Add `tabIndex={-1}` to the panel element. */\nexport function usePanelFocusHandlers(panelKey: string): {\n onMouseEnter: (e: React.MouseEvent<HTMLElement>) => void;\n onMouseLeave: () => void;\n} {\n const { setFocusedPanel, clearFocusedPanel } = usePanelFocusContext();\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const onMouseEnter = useCallback(\n (e: React.MouseEvent<HTMLElement>) => {\n const element = e.currentTarget;\n if (timerRef.current !== null) {\n clearTimeout(timerRef.current);\n }\n timerRef.current = setTimeout(() => {\n setFocusedPanel(panelKey);\n element.focus({ preventScroll: true });\n timerRef.current = null;\n }, PANEL_FOCUS_DEBOUNCE_MS);\n },\n [panelKey, setFocusedPanel]\n );\n\n const onMouseLeave = useCallback(() => {\n if (timerRef.current !== null) {\n clearTimeout(timerRef.current);\n timerRef.current = null;\n }\n clearFocusedPanel();\n }, [clearFocusedPanel]);\n\n useEffect(() => {\n return (): void => {\n if (timerRef.current !== null) {\n clearTimeout(timerRef.current);\n }\n };\n }, []);\n\n return useMemo(() => ({ onMouseEnter, onMouseLeave }), [onMouseEnter, onMouseLeave]);\n}\n"],"names":["React","createContext","useCallback","useContext","useEffect","useMemo","useRef","useState","PanelFocusContext","undefined","usePanelFocusContext","ctx","Error","PanelFocusProvider","children","focusedPanelKey","setFocusedPanelKeyState","setFocusedPanel","panelKey","clearFocusedPanel","value","Provider","useFocusedPanel","PANEL_FOCUS_DEBOUNCE_MS","usePanelFocusHandlers","timerRef","onMouseEnter","e","element","currentTarget","current","clearTimeout","setTimeout","focus","preventScroll","onMouseLeave"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,OAAOA,SACLC,aAAa,EAGbC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,QAAQ;AAQf,MAAMC,kCAAoBP,cAAkDQ;AAE5E,SAASC;IACP,MAAMC,MAAMR,WAAWK;IACvB,IAAIG,QAAQF,WAAW;QACrB,MAAM,IAAIG,MAAM;IAClB;IACA,OAAOD;AACT;AAEA,4FAA4F,GAC5F,OAAO,SAASE,mBAAmB,EAAEC,QAAQ,EAA2B;IACtE,MAAM,CAACC,iBAAiBC,wBAAwB,GAAGT,SAAwB;IAE3E,4EAA4E;IAC5E,0EAA0E;IAC1E,yEAAyE;IACzE,+DAA+D;IAC/D,MAAMU,kBAAkBf,YAAY,CAACgB;QACnCF,wBAAwBE;IAC1B,GAAG,EAAE;IAEL,MAAMC,oBAAoBjB,YAAY;QACpCc,wBAAwB;IAC1B,GAAG,EAAE;IAEL,MAAMI,QAAQf,QACZ,IAA+B,CAAA;YAC7BU;YACAE;YACAE;QACF,CAAA,GACA;QAACJ;QAAiBE;QAAiBE;KAAkB;IAGvD,qBAAO,KAACX,kBAAkBa,QAAQ;QAACD,OAAOA;kBAAQN;;AACpD;AAEA,OAAO,SAASQ;IACd,OAAOZ,uBAAuBK,eAAe;AAC/C;AAEA,MAAMQ,0BAA0B;AAEhC,oGAAoG,GACpG,OAAO,SAASC,sBAAsBN,QAAgB;IAIpD,MAAM,EAAED,eAAe,EAAEE,iBAAiB,EAAE,GAAGT;IAC/C,MAAMe,WAAWnB,OAA6C;IAE9D,MAAMoB,eAAexB,YACnB,CAACyB;QACC,MAAMC,UAAUD,EAAEE,aAAa;QAC/B,IAAIJ,SAASK,OAAO,KAAK,MAAM;YAC7BC,aAAaN,SAASK,OAAO;QAC/B;QACAL,SAASK,OAAO,GAAGE,WAAW;YAC5Bf,gBAAgBC;YAChBU,QAAQK,KAAK,CAAC;gBAAEC,eAAe;YAAK;YACpCT,SAASK,OAAO,GAAG;QACrB,GAAGP;IACL,GACA;QAACL;QAAUD;KAAgB;IAG7B,MAAMkB,eAAejC,YAAY;QAC/B,IAAIuB,SAASK,OAAO,KAAK,MAAM;YAC7BC,aAAaN,SAASK,OAAO;YAC7BL,SAASK,OAAO,GAAG;QACrB;QACAX;IACF,GAAG;QAACA;KAAkB;IAEtBf,UAAU;QACR,OAAO;YACL,IAAIqB,SAASK,OAAO,KAAK,MAAM;gBAC7BC,aAAaN,SAASK,OAAO;YAC/B;QACF;IACF,GAAG,EAAE;IAEL,OAAOzB,QAAQ,IAAO,CAAA;YAAEqB;YAAcS;QAAa,CAAA,GAAI;QAACT;QAAcS;KAAa;AACrF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PersesShortcutDef } from '../types';
|
|
2
|
+
export declare const SAVE_DASHBOARD_SHORTCUT: PersesShortcutDef;
|
|
3
|
+
export declare const REFRESH_DASHBOARD_SHORTCUT: PersesShortcutDef;
|
|
4
|
+
export declare const TOGGLE_EDIT_MODE_SHORTCUT: PersesShortcutDef;
|
|
5
|
+
export declare const DASHBOARD_SHORTCUTS: PersesShortcutDef[];
|
|
6
|
+
//# sourceMappingURL=dashboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../../src/keyboard-shortcuts/default-shortcuts/dashboard.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,eAAO,MAAM,uBAAuB,EAAE,iBAQrC,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,iBAQxC,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,iBAQvC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,iBAAiB,EAIlD,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
import { SAVE_DASHBOARD_EVENT, REFRESH_DASHBOARD_EVENT, TOGGLE_EDIT_MODE_EVENT } from '../events';
|
|
14
|
+
export const SAVE_DASHBOARD_SHORTCUT = {
|
|
15
|
+
id: 'save-dashboard',
|
|
16
|
+
hotkey: 'Mod+S',
|
|
17
|
+
name: 'Save Dashboard',
|
|
18
|
+
description: 'Save the current dashboard',
|
|
19
|
+
category: 'dashboard',
|
|
20
|
+
scope: 'dashboard',
|
|
21
|
+
event: SAVE_DASHBOARD_EVENT
|
|
22
|
+
};
|
|
23
|
+
export const REFRESH_DASHBOARD_SHORTCUT = {
|
|
24
|
+
id: 'refresh-dashboard',
|
|
25
|
+
sequence: [
|
|
26
|
+
'D',
|
|
27
|
+
'R'
|
|
28
|
+
],
|
|
29
|
+
name: 'Refresh Dashboard',
|
|
30
|
+
description: 'Refresh all panels',
|
|
31
|
+
category: 'dashboard',
|
|
32
|
+
scope: 'dashboard',
|
|
33
|
+
event: REFRESH_DASHBOARD_EVENT
|
|
34
|
+
};
|
|
35
|
+
export const TOGGLE_EDIT_MODE_SHORTCUT = {
|
|
36
|
+
id: 'toggle-edit-mode',
|
|
37
|
+
sequence: [
|
|
38
|
+
'D',
|
|
39
|
+
'M'
|
|
40
|
+
],
|
|
41
|
+
name: 'Toggle Edit Mode',
|
|
42
|
+
description: 'Toggle between edit and view mode',
|
|
43
|
+
category: 'dashboard',
|
|
44
|
+
scope: 'dashboard',
|
|
45
|
+
event: TOGGLE_EDIT_MODE_EVENT
|
|
46
|
+
};
|
|
47
|
+
export const DASHBOARD_SHORTCUTS = [
|
|
48
|
+
SAVE_DASHBOARD_SHORTCUT,
|
|
49
|
+
REFRESH_DASHBOARD_SHORTCUT,
|
|
50
|
+
TOGGLE_EDIT_MODE_SHORTCUT
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=dashboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/keyboard-shortcuts/default-shortcuts/dashboard.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { PersesShortcutDef } from '../types';\nimport { SAVE_DASHBOARD_EVENT, REFRESH_DASHBOARD_EVENT, TOGGLE_EDIT_MODE_EVENT } from '../events';\n\nexport const SAVE_DASHBOARD_SHORTCUT: PersesShortcutDef = {\n id: 'save-dashboard',\n hotkey: 'Mod+S',\n name: 'Save Dashboard',\n description: 'Save the current dashboard',\n category: 'dashboard',\n scope: 'dashboard',\n event: SAVE_DASHBOARD_EVENT,\n};\n\nexport const REFRESH_DASHBOARD_SHORTCUT: PersesShortcutDef = {\n id: 'refresh-dashboard',\n sequence: ['D', 'R'],\n name: 'Refresh Dashboard',\n description: 'Refresh all panels',\n category: 'dashboard',\n scope: 'dashboard',\n event: REFRESH_DASHBOARD_EVENT,\n};\n\nexport const TOGGLE_EDIT_MODE_SHORTCUT: PersesShortcutDef = {\n id: 'toggle-edit-mode',\n sequence: ['D', 'M'],\n name: 'Toggle Edit Mode',\n description: 'Toggle between edit and view mode',\n category: 'dashboard',\n scope: 'dashboard',\n event: TOGGLE_EDIT_MODE_EVENT,\n};\n\nexport const DASHBOARD_SHORTCUTS: PersesShortcutDef[] = [\n SAVE_DASHBOARD_SHORTCUT,\n REFRESH_DASHBOARD_SHORTCUT,\n TOGGLE_EDIT_MODE_SHORTCUT,\n];\n"],"names":["SAVE_DASHBOARD_EVENT","REFRESH_DASHBOARD_EVENT","TOGGLE_EDIT_MODE_EVENT","SAVE_DASHBOARD_SHORTCUT","id","hotkey","name","description","category","scope","event","REFRESH_DASHBOARD_SHORTCUT","sequence","TOGGLE_EDIT_MODE_SHORTCUT","DASHBOARD_SHORTCUTS"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,oBAAoB,EAAEC,uBAAuB,EAAEC,sBAAsB,QAAQ,YAAY;AAElG,OAAO,MAAMC,0BAA6C;IACxDC,IAAI;IACJC,QAAQ;IACRC,MAAM;IACNC,aAAa;IACbC,UAAU;IACVC,OAAO;IACPC,OAAOV;AACT,EAAE;AAEF,OAAO,MAAMW,6BAAgD;IAC3DP,IAAI;IACJQ,UAAU;QAAC;QAAK;KAAI;IACpBN,MAAM;IACNC,aAAa;IACbC,UAAU;IACVC,OAAO;IACPC,OAAOT;AACT,EAAE;AAEF,OAAO,MAAMY,4BAA+C;IAC1DT,IAAI;IACJQ,UAAU;QAAC;QAAK;KAAI;IACpBN,MAAM;IACNC,aAAa;IACbC,UAAU;IACVC,OAAO;IACPC,OAAOR;AACT,EAAE;AAEF,OAAO,MAAMY,sBAA2C;IACtDX;IACAQ;IACAE;CACD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PersesShortcutDef } from '../types';
|
|
2
|
+
export declare const GO_HOME_SHORTCUT: PersesShortcutDef;
|
|
3
|
+
export declare const GO_EXPLORE_SHORTCUT: PersesShortcutDef;
|
|
4
|
+
export declare const GO_PROFILE_SHORTCUT: PersesShortcutDef;
|
|
5
|
+
export declare const OPEN_SEARCH_SHORTCUT: PersesShortcutDef;
|
|
6
|
+
export declare const SHOW_SHORTCUTS_SHORTCUT: PersesShortcutDef;
|
|
7
|
+
export declare const TOGGLE_THEME_SHORTCUT: PersesShortcutDef;
|
|
8
|
+
export declare const GLOBAL_SHORTCUTS: PersesShortcutDef[];
|
|
9
|
+
//# sourceMappingURL=global.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../../src/keyboard-shortcuts/default-shortcuts/global.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,eAAO,MAAM,gBAAgB,EAAE,iBAO9B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,iBAOjC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,iBAOjC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,iBAQlC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,iBASrC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,iBAQnC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,iBAAiB,EAO/C,CAAC"}
|
|
@@ -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
|
+
import { OPEN_SEARCH_EVENT, SHOW_SHORTCUTS_EVENT, TOGGLE_THEME_EVENT } from '../events';
|
|
14
|
+
export const GO_HOME_SHORTCUT = {
|
|
15
|
+
id: 'go-home',
|
|
16
|
+
sequence: [
|
|
17
|
+
'G',
|
|
18
|
+
'H'
|
|
19
|
+
],
|
|
20
|
+
name: 'Go to Home',
|
|
21
|
+
description: 'Go to the Home page',
|
|
22
|
+
category: 'global',
|
|
23
|
+
scope: 'global'
|
|
24
|
+
};
|
|
25
|
+
export const GO_EXPLORE_SHORTCUT = {
|
|
26
|
+
id: 'go-explore',
|
|
27
|
+
sequence: [
|
|
28
|
+
'G',
|
|
29
|
+
'E'
|
|
30
|
+
],
|
|
31
|
+
name: 'Go to Explore',
|
|
32
|
+
description: 'Go to the Explore page',
|
|
33
|
+
category: 'global',
|
|
34
|
+
scope: 'global'
|
|
35
|
+
};
|
|
36
|
+
export const GO_PROFILE_SHORTCUT = {
|
|
37
|
+
id: 'go-profile',
|
|
38
|
+
sequence: [
|
|
39
|
+
'G',
|
|
40
|
+
'P'
|
|
41
|
+
],
|
|
42
|
+
name: 'Go to Profile',
|
|
43
|
+
description: 'Go to the Profile page',
|
|
44
|
+
category: 'global',
|
|
45
|
+
scope: 'global'
|
|
46
|
+
};
|
|
47
|
+
export const OPEN_SEARCH_SHORTCUT = {
|
|
48
|
+
id: 'open-search',
|
|
49
|
+
hotkey: 'Mod+K',
|
|
50
|
+
name: 'Open Search',
|
|
51
|
+
description: 'Open the search dialog',
|
|
52
|
+
category: 'global',
|
|
53
|
+
scope: 'global',
|
|
54
|
+
event: OPEN_SEARCH_EVENT
|
|
55
|
+
};
|
|
56
|
+
export const SHOW_SHORTCUTS_SHORTCUT = {
|
|
57
|
+
id: 'show-shortcuts',
|
|
58
|
+
hotkey: {
|
|
59
|
+
key: '?',
|
|
60
|
+
shift: true
|
|
61
|
+
},
|
|
62
|
+
name: 'Show Keyboard Shortcuts',
|
|
63
|
+
description: 'Show all the keyboard shortcuts',
|
|
64
|
+
category: 'global',
|
|
65
|
+
scope: 'global',
|
|
66
|
+
event: SHOW_SHORTCUTS_EVENT,
|
|
67
|
+
displayOverride: '?'
|
|
68
|
+
};
|
|
69
|
+
export const TOGGLE_THEME_SHORTCUT = {
|
|
70
|
+
id: 'toggle-theme',
|
|
71
|
+
sequence: [
|
|
72
|
+
'C',
|
|
73
|
+
'T'
|
|
74
|
+
],
|
|
75
|
+
name: 'Change Theme',
|
|
76
|
+
description: 'Change between dark and light theme',
|
|
77
|
+
category: 'global',
|
|
78
|
+
scope: 'global',
|
|
79
|
+
event: TOGGLE_THEME_EVENT
|
|
80
|
+
};
|
|
81
|
+
export const GLOBAL_SHORTCUTS = [
|
|
82
|
+
GO_HOME_SHORTCUT,
|
|
83
|
+
GO_EXPLORE_SHORTCUT,
|
|
84
|
+
GO_PROFILE_SHORTCUT,
|
|
85
|
+
OPEN_SEARCH_SHORTCUT,
|
|
86
|
+
SHOW_SHORTCUTS_SHORTCUT,
|
|
87
|
+
TOGGLE_THEME_SHORTCUT
|
|
88
|
+
];
|
|
89
|
+
|
|
90
|
+
//# sourceMappingURL=global.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/keyboard-shortcuts/default-shortcuts/global.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { PersesShortcutDef } from '../types';\nimport { OPEN_SEARCH_EVENT, SHOW_SHORTCUTS_EVENT, TOGGLE_THEME_EVENT } from '../events';\n\nexport const GO_HOME_SHORTCUT: PersesShortcutDef = {\n id: 'go-home',\n sequence: ['G', 'H'],\n name: 'Go to Home',\n description: 'Go to the Home page',\n category: 'global',\n scope: 'global',\n};\n\nexport const GO_EXPLORE_SHORTCUT: PersesShortcutDef = {\n id: 'go-explore',\n sequence: ['G', 'E'],\n name: 'Go to Explore',\n description: 'Go to the Explore page',\n category: 'global',\n scope: 'global',\n};\n\nexport const GO_PROFILE_SHORTCUT: PersesShortcutDef = {\n id: 'go-profile',\n sequence: ['G', 'P'],\n name: 'Go to Profile',\n description: 'Go to the Profile page',\n category: 'global',\n scope: 'global',\n};\n\nexport const OPEN_SEARCH_SHORTCUT: PersesShortcutDef = {\n id: 'open-search',\n hotkey: 'Mod+K',\n name: 'Open Search',\n description: 'Open the search dialog',\n category: 'global',\n scope: 'global',\n event: OPEN_SEARCH_EVENT,\n};\n\nexport const SHOW_SHORTCUTS_SHORTCUT: PersesShortcutDef = {\n id: 'show-shortcuts',\n hotkey: { key: '?', shift: true },\n name: 'Show Keyboard Shortcuts',\n description: 'Show all the keyboard shortcuts',\n category: 'global',\n scope: 'global',\n event: SHOW_SHORTCUTS_EVENT,\n displayOverride: '?',\n};\n\nexport const TOGGLE_THEME_SHORTCUT: PersesShortcutDef = {\n id: 'toggle-theme',\n sequence: ['C', 'T'],\n name: 'Change Theme',\n description: 'Change between dark and light theme',\n category: 'global',\n scope: 'global',\n event: TOGGLE_THEME_EVENT,\n};\n\nexport const GLOBAL_SHORTCUTS: PersesShortcutDef[] = [\n GO_HOME_SHORTCUT,\n GO_EXPLORE_SHORTCUT,\n GO_PROFILE_SHORTCUT,\n OPEN_SEARCH_SHORTCUT,\n SHOW_SHORTCUTS_SHORTCUT,\n TOGGLE_THEME_SHORTCUT,\n];\n"],"names":["OPEN_SEARCH_EVENT","SHOW_SHORTCUTS_EVENT","TOGGLE_THEME_EVENT","GO_HOME_SHORTCUT","id","sequence","name","description","category","scope","GO_EXPLORE_SHORTCUT","GO_PROFILE_SHORTCUT","OPEN_SEARCH_SHORTCUT","hotkey","event","SHOW_SHORTCUTS_SHORTCUT","key","shift","displayOverride","TOGGLE_THEME_SHORTCUT","GLOBAL_SHORTCUTS"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,iBAAiB,EAAEC,oBAAoB,EAAEC,kBAAkB,QAAQ,YAAY;AAExF,OAAO,MAAMC,mBAAsC;IACjDC,IAAI;IACJC,UAAU;QAAC;QAAK;KAAI;IACpBC,MAAM;IACNC,aAAa;IACbC,UAAU;IACVC,OAAO;AACT,EAAE;AAEF,OAAO,MAAMC,sBAAyC;IACpDN,IAAI;IACJC,UAAU;QAAC;QAAK;KAAI;IACpBC,MAAM;IACNC,aAAa;IACbC,UAAU;IACVC,OAAO;AACT,EAAE;AAEF,OAAO,MAAME,sBAAyC;IACpDP,IAAI;IACJC,UAAU;QAAC;QAAK;KAAI;IACpBC,MAAM;IACNC,aAAa;IACbC,UAAU;IACVC,OAAO;AACT,EAAE;AAEF,OAAO,MAAMG,uBAA0C;IACrDR,IAAI;IACJS,QAAQ;IACRP,MAAM;IACNC,aAAa;IACbC,UAAU;IACVC,OAAO;IACPK,OAAOd;AACT,EAAE;AAEF,OAAO,MAAMe,0BAA6C;IACxDX,IAAI;IACJS,QAAQ;QAAEG,KAAK;QAAKC,OAAO;IAAK;IAChCX,MAAM;IACNC,aAAa;IACbC,UAAU;IACVC,OAAO;IACPK,OAAOb;IACPiB,iBAAiB;AACnB,EAAE;AAEF,OAAO,MAAMC,wBAA2C;IACtDf,IAAI;IACJC,UAAU;QAAC;QAAK;KAAI;IACpBC,MAAM;IACNC,aAAa;IACbC,UAAU;IACVC,OAAO;IACPK,OAAOZ;AACT,EAAE;AAEF,OAAO,MAAMkB,mBAAwC;IACnDjB;IACAO;IACAC;IACAC;IACAG;IACAI;CACD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/keyboard-shortcuts/default-shortcuts/index.ts"],"names":[],"mappings":"AAaA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
export * from './global';
|
|
14
|
+
export * from './dashboard';
|
|
15
|
+
export * from './panel';
|
|
16
|
+
export * from './time-range';
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/keyboard-shortcuts/default-shortcuts/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './global';\nexport * from './dashboard';\nexport * from './panel';\nexport * from './time-range';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,WAAW;AACzB,cAAc,cAAc;AAC5B,cAAc,UAAU;AACxB,cAAc,eAAe"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PersesShortcutDef } from '../types';
|
|
2
|
+
export declare const PANEL_EDIT_SHORTCUT: PersesShortcutDef;
|
|
3
|
+
export declare const PANEL_FULLSCREEN_SHORTCUT: PersesShortcutDef;
|
|
4
|
+
export declare const PANEL_DUPLICATE_SHORTCUT: PersesShortcutDef;
|
|
5
|
+
export declare const PANEL_DELETE_SHORTCUT: PersesShortcutDef;
|
|
6
|
+
export declare const PANEL_SHORTCUTS: PersesShortcutDef[];
|
|
7
|
+
//# sourceMappingURL=panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel.d.ts","sourceRoot":"","sources":["../../../src/keyboard-shortcuts/default-shortcuts/panel.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,eAAO,MAAM,mBAAmB,EAAE,iBASjC,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,iBASvC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,iBAQtC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,iBAQnC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,iBAAiB,EAK9C,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
import { PANEL_EDIT_EVENT, PANEL_FULLSCREEN_EVENT, PANEL_DUPLICATE_EVENT, PANEL_DELETE_EVENT } from '../events';
|
|
14
|
+
export const PANEL_EDIT_SHORTCUT = {
|
|
15
|
+
id: 'panel-edit',
|
|
16
|
+
hotkey: 'E',
|
|
17
|
+
name: 'Edit Panel',
|
|
18
|
+
description: 'Edit the focused panel when in edit mode',
|
|
19
|
+
category: 'focused-panel',
|
|
20
|
+
scope: 'panel',
|
|
21
|
+
event: PANEL_EDIT_EVENT,
|
|
22
|
+
ignoreInputs: true
|
|
23
|
+
};
|
|
24
|
+
export const PANEL_FULLSCREEN_SHORTCUT = {
|
|
25
|
+
id: 'panel-fullscreen',
|
|
26
|
+
hotkey: 'V',
|
|
27
|
+
name: 'Toggle Fullscreen',
|
|
28
|
+
description: 'Toggle fullscreen on the focused panel',
|
|
29
|
+
category: 'focused-panel',
|
|
30
|
+
scope: 'panel',
|
|
31
|
+
event: PANEL_FULLSCREEN_EVENT,
|
|
32
|
+
ignoreInputs: true
|
|
33
|
+
};
|
|
34
|
+
export const PANEL_DUPLICATE_SHORTCUT = {
|
|
35
|
+
id: 'panel-duplicate',
|
|
36
|
+
sequence: [
|
|
37
|
+
'P',
|
|
38
|
+
'D'
|
|
39
|
+
],
|
|
40
|
+
name: 'Duplicate Panel',
|
|
41
|
+
description: 'Duplicate the focused panel',
|
|
42
|
+
category: 'focused-panel',
|
|
43
|
+
scope: 'panel',
|
|
44
|
+
event: PANEL_DUPLICATE_EVENT
|
|
45
|
+
};
|
|
46
|
+
export const PANEL_DELETE_SHORTCUT = {
|
|
47
|
+
id: 'panel-delete',
|
|
48
|
+
sequence: [
|
|
49
|
+
'P',
|
|
50
|
+
'R'
|
|
51
|
+
],
|
|
52
|
+
name: 'Delete Panel',
|
|
53
|
+
description: 'Delete the focused panel',
|
|
54
|
+
category: 'focused-panel',
|
|
55
|
+
scope: 'panel',
|
|
56
|
+
event: PANEL_DELETE_EVENT
|
|
57
|
+
};
|
|
58
|
+
export const PANEL_SHORTCUTS = [
|
|
59
|
+
PANEL_EDIT_SHORTCUT,
|
|
60
|
+
PANEL_FULLSCREEN_SHORTCUT,
|
|
61
|
+
PANEL_DUPLICATE_SHORTCUT,
|
|
62
|
+
PANEL_DELETE_SHORTCUT
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
//# sourceMappingURL=panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/keyboard-shortcuts/default-shortcuts/panel.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { PersesShortcutDef } from '../types';\nimport { PANEL_EDIT_EVENT, PANEL_FULLSCREEN_EVENT, PANEL_DUPLICATE_EVENT, PANEL_DELETE_EVENT } from '../events';\n\nexport const PANEL_EDIT_SHORTCUT: PersesShortcutDef = {\n id: 'panel-edit',\n hotkey: 'E',\n name: 'Edit Panel',\n description: 'Edit the focused panel when in edit mode',\n category: 'focused-panel',\n scope: 'panel',\n event: PANEL_EDIT_EVENT,\n ignoreInputs: true,\n};\n\nexport const PANEL_FULLSCREEN_SHORTCUT: PersesShortcutDef = {\n id: 'panel-fullscreen',\n hotkey: 'V',\n name: 'Toggle Fullscreen',\n description: 'Toggle fullscreen on the focused panel',\n category: 'focused-panel',\n scope: 'panel',\n event: PANEL_FULLSCREEN_EVENT,\n ignoreInputs: true,\n};\n\nexport const PANEL_DUPLICATE_SHORTCUT: PersesShortcutDef = {\n id: 'panel-duplicate',\n sequence: ['P', 'D'],\n name: 'Duplicate Panel',\n description: 'Duplicate the focused panel',\n category: 'focused-panel',\n scope: 'panel',\n event: PANEL_DUPLICATE_EVENT,\n};\n\nexport const PANEL_DELETE_SHORTCUT: PersesShortcutDef = {\n id: 'panel-delete',\n sequence: ['P', 'R'],\n name: 'Delete Panel',\n description: 'Delete the focused panel',\n category: 'focused-panel',\n scope: 'panel',\n event: PANEL_DELETE_EVENT,\n};\n\nexport const PANEL_SHORTCUTS: PersesShortcutDef[] = [\n PANEL_EDIT_SHORTCUT,\n PANEL_FULLSCREEN_SHORTCUT,\n PANEL_DUPLICATE_SHORTCUT,\n PANEL_DELETE_SHORTCUT,\n];\n"],"names":["PANEL_EDIT_EVENT","PANEL_FULLSCREEN_EVENT","PANEL_DUPLICATE_EVENT","PANEL_DELETE_EVENT","PANEL_EDIT_SHORTCUT","id","hotkey","name","description","category","scope","event","ignoreInputs","PANEL_FULLSCREEN_SHORTCUT","PANEL_DUPLICATE_SHORTCUT","sequence","PANEL_DELETE_SHORTCUT","PANEL_SHORTCUTS"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,gBAAgB,EAAEC,sBAAsB,EAAEC,qBAAqB,EAAEC,kBAAkB,QAAQ,YAAY;AAEhH,OAAO,MAAMC,sBAAyC;IACpDC,IAAI;IACJC,QAAQ;IACRC,MAAM;IACNC,aAAa;IACbC,UAAU;IACVC,OAAO;IACPC,OAAOX;IACPY,cAAc;AAChB,EAAE;AAEF,OAAO,MAAMC,4BAA+C;IAC1DR,IAAI;IACJC,QAAQ;IACRC,MAAM;IACNC,aAAa;IACbC,UAAU;IACVC,OAAO;IACPC,OAAOV;IACPW,cAAc;AAChB,EAAE;AAEF,OAAO,MAAME,2BAA8C;IACzDT,IAAI;IACJU,UAAU;QAAC;QAAK;KAAI;IACpBR,MAAM;IACNC,aAAa;IACbC,UAAU;IACVC,OAAO;IACPC,OAAOT;AACT,EAAE;AAEF,OAAO,MAAMc,wBAA2C;IACtDX,IAAI;IACJU,UAAU;QAAC;QAAK;KAAI;IACpBR,MAAM;IACNC,aAAa;IACbC,UAAU;IACVC,OAAO;IACPC,OAAOR;AACT,EAAE;AAEF,OAAO,MAAMc,kBAAuC;IAClDb;IACAS;IACAC;IACAE;CACD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PersesShortcutDef } from '../types';
|
|
2
|
+
export declare const TIME_ZOOM_OUT_SHORTCUT: PersesShortcutDef;
|
|
3
|
+
export declare const TIME_ZOOM_IN_SHORTCUT: PersesShortcutDef;
|
|
4
|
+
export declare const TIME_SHIFT_BACK_SHORTCUT: PersesShortcutDef;
|
|
5
|
+
export declare const TIME_SHIFT_FORWARD_SHORTCUT: PersesShortcutDef;
|
|
6
|
+
export declare const TIME_MAKE_ABSOLUTE_SHORTCUT: PersesShortcutDef;
|
|
7
|
+
export declare const TIME_COPY_SHORTCUT: PersesShortcutDef;
|
|
8
|
+
export declare const TIME_PASTE_SHORTCUT: PersesShortcutDef;
|
|
9
|
+
export declare const TIME_RANGE_SHORTCUTS: PersesShortcutDef[];
|
|
10
|
+
//# sourceMappingURL=time-range.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time-range.d.ts","sourceRoot":"","sources":["../../../src/keyboard-shortcuts/default-shortcuts/time-range.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAW7C,eAAO,MAAM,sBAAsB,EAAE,iBAQpC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,iBAQnC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,iBAQtC,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,iBAQzC,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,iBAQzC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,iBAQhC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,iBAQjC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,EAQnD,CAAC"}
|