@tano.page/workbench 0.15.0 → 0.16.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/package.json +35 -14
- package/src/App.vue +68 -797
- package/src/assistant/agent-identities.ts +1 -97
- package/src/assistant/agent-task-context.ts +1 -54
- package/src/assistant/attachments.ts +1 -1
- package/src/assistant/completion.ts +1 -61
- package/src/assistant/components/AssistantPanel.vue +1 -1
- package/src/assistant/connection-actions.ts +237 -0
- package/src/assistant/document-mentions.ts +1 -33
- package/src/assistant/engine.ts +1 -585
- package/src/assistant/execution.ts +6 -33
- package/src/assistant/hash.ts +1 -4
- package/src/assistant/language.ts +10 -37
- package/src/assistant/plugin-bridge-builder.ts +146 -0
- package/src/assistant/prompts.ts +1 -65
- package/src/assistant/proposal-actions.ts +336 -0
- package/src/assistant/store.ts +87 -554
- package/src/assistant/structures.ts +1 -157
- package/src/assistant/tasks.ts +8 -94
- package/src/assistant/tool-rules.ts +1 -7
- package/src/composables/use-workbench-help.ts +177 -0
- package/src/composables/use-workbench-lifecycle.ts +249 -0
- package/src/composables/use-workbench-settings.ts +185 -0
- package/src/composables/use-workbench-shortcuts.ts +37 -1022
- package/src/composables/use-workbench-views.ts +325 -0
- package/src/documents/components/DocumentActionMenu.vue +279 -0
- package/src/documents/components/DocumentInspector.vue +168 -0
- package/src/documents/components/DocumentPane.vue +482 -0
- package/src/documents/description-merge.ts +1 -9
- package/src/files/components/FileMetadataPanel.vue +49 -15
- package/src/i18n/locale-catalogs.ts +7 -6
- package/src/i18n/locale-registry.ts +8 -6
- package/src/i18n/locales/de-DE.json +23 -1
- package/src/i18n/locales/en-US.json +23 -1
- package/src/i18n/locales/es-ES.json +23 -1
- package/src/i18n/locales/ja-JP.json +23 -1
- package/src/i18n/locales/zh-TW.json +23 -1
- package/src/mail/components/MailAccountDialog.vue +1 -0
- package/src/mail/components/MailComposerDialog.vue +1 -0
- package/src/mail/components/MailWorkspaceView.vue +1 -0
- package/src/mail/components/SidebarMail.vue +1 -0
- package/src/objects/content-references.ts +6 -56
- package/src/objects/wiki-links.ts +1 -48
- package/src/objects/workspace-objects.ts +2 -3
- package/src/plans/calendar.ts +2 -2
- package/src/plans/components/CalendarAgendaView.vue +165 -0
- package/src/plans/components/CalendarFilterBar.vue +128 -0
- package/src/plans/components/CalendarMonthView.vue +224 -0
- package/src/plans/components/CalendarQuickCreateDialog.vue +269 -0
- package/src/plans/components/CalendarTimelineView.vue +517 -0
- package/src/plans/components/CalendarTopbarControls.vue +101 -0
- package/src/plans/components/CalendarView.vue +162 -2106
- package/src/plans/components/CalendarYearView.vue +138 -0
- package/src/plans/components/PlanConnectionsDialog.vue +1 -1
- package/src/plans/components/calendar-shared.css +192 -0
- package/src/plans/composables/use-calendar-interactions.ts +396 -0
- package/src/plans/composables/use-calendar-scroll.ts +420 -0
- package/src/plugins/components/PluginDetailPage.vue +10 -6
- package/src/plugins/components/PluginDeveloperArea.vue +192 -0
- package/src/plugins/components/PluginExplorer.vue +6 -4
- package/src/plugins/components/PluginImportDialog.vue +1 -1
- package/src/plugins/components/PluginInstaller.vue +269 -178
- package/src/plugins/components/PluginMaintenance.vue +37 -49
- package/src/plugins/components/PluginRepositoryStorage.vue +4 -2
- package/src/plugins/components/PluginSettingsForm.vue +2 -1
- package/src/plugins/components/PluginsTabPage.vue +61 -0
- package/src/plugins/components/plugin-center.css +5 -0
- package/src/plugins/data.ts +9 -86
- package/src/plugins/editor-plugin-adapters.ts +169 -0
- package/src/plugins/plugin-data.ts +2 -3
- package/src/plugins/plugin-rpc-router.ts +558 -0
- package/src/plugins/plugin-sdk.ts +1 -260
- package/src/plugins/plugin-ui-dialogs.ts +167 -0
- package/src/plugins/queries.ts +1 -75
- package/src/plugins/view-header.ts +2 -7
- package/src/runtime.ts +3 -2
- package/src/settings/components/SettingsPanel.vue +8 -3
- package/src/settings/components/WorkbenchSettings.vue +20 -7
- package/src/settings/components/settings-context.ts +1 -1
- package/src/settings/settings-tab.ts +1 -0
- package/src/shell/command-palette.ts +3 -3
- package/src/shell/components/EditorToolbar.vue +8 -9
- package/src/shell/components/EditorTools.vue +1 -5
- package/src/shell/components/PaneTopbar.vue +393 -0
- package/src/shell/components/SelectionToolbar.vue +0 -2
- package/src/shell/components/WorkbenchContextMenus.vue +37 -26
- package/src/shell/components/WorkbenchModals.vue +22 -18
- package/src/shell/components/WorkbenchPanes.vue +358 -1512
- package/src/shell/components/WorkbenchSidebar.vue +486 -0
- package/src/shell/pane-registry.ts +69 -0
- package/src/shell/use-surface-dismissal.ts +219 -0
- package/src/shell/use-workbench-commands.ts +599 -0
- package/src/shell/use-workbench-keybindings.ts +337 -0
- package/src/shell/use-workbench.ts +488 -1081
- package/src/shell/workbench-context.ts +30 -3
- package/src/stores/workspace-document-io.ts +807 -0
- package/src/stores/workspace-file-ops.ts +1 -1
- package/src/stores/workspace-knowledge.ts +1 -1
- package/src/stores/workspace-lifecycle.ts +459 -0
- package/src/stores/workspace-plugins-state.ts +71 -599
- package/src/stores/workspace-session.ts +287 -0
- package/src/stores/workspace-tabs-layout.ts +1 -1
- package/src/stores/workspace-types.ts +50 -0
- package/src/stores/workspace.ts +163 -1345
- package/src/styles.css +0 -1
- package/src/tabs/components/DesktopTabs.vue +19 -11
- package/src/windows/AuxiliaryWindows.vue +2 -2
- package/src/windows/use-window-event-bridge.ts +152 -0
- package/src/workspace/components/TemplateLibrary.vue +1 -1
- package/src/workspace/components/WorkspaceIconPicker.vue +5 -4
- package/src/workspace/components/WorkspacePickerMenu.vue +317 -0
- package/src/assistant/locales/de-DE.json +0 -129
- package/src/assistant/locales/en-US.json +0 -129
- package/src/assistant/locales/es-ES.json +0 -129
- package/src/assistant/locales/ja-JP.json +0 -129
- package/src/assistant/locales/zh-CN.json +0 -129
- package/src/assistant/locales/zh-TW.json +0 -129
- package/src/assistant/task-prompts.json +0 -39
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import { onBeforeUnmount, type Ref } from 'vue';
|
|
2
|
+
import { storeToRefs } from 'pinia';
|
|
3
|
+
import { isElement } from '@tano/editor/dom-realm';
|
|
4
|
+
import type { FileEntry } from '@tano/protocol';
|
|
5
|
+
import type { useAssistantStore } from '../assistant/store';
|
|
6
|
+
import type FileTree from '../files/components/FileTree.vue';
|
|
7
|
+
import { pluginShortcutCommand } from '../plugins/workbench';
|
|
8
|
+
import type { WorkbenchExtensions } from '../runtime';
|
|
9
|
+
import type { useWorkspaceStore } from '../stores/workspace';
|
|
10
|
+
import type { WindowContext } from '../windows/context';
|
|
11
|
+
import type PageSearch from './components/PageSearch.vue';
|
|
12
|
+
import { configuredEditorShortcuts } from './configured-editor-shortcuts';
|
|
13
|
+
import { isSidebarToggleShortcut, matchesShortcut, type ShortcutBindings } from './shortcuts';
|
|
14
|
+
import type { MarkdownEditor } from './workbench-async-components';
|
|
15
|
+
|
|
16
|
+
export interface WorkbenchKeybindingsDeps {
|
|
17
|
+
store: ReturnType<typeof useWorkspaceStore>;
|
|
18
|
+
assistant: ReturnType<typeof useAssistantStore>;
|
|
19
|
+
editing: WorkbenchExtensions['editing'];
|
|
20
|
+
activeWindow: Ref<WindowContext>;
|
|
21
|
+
compactPanes: Ref<boolean>;
|
|
22
|
+
sidebar: Ref<boolean>;
|
|
23
|
+
shortcuts: Ref<ShortcutBindings>;
|
|
24
|
+
updateLock: Ref<boolean>;
|
|
25
|
+
source: Ref<boolean>;
|
|
26
|
+
revealMarkdown: Ref<boolean>;
|
|
27
|
+
paneEditors: Map<string, InstanceType<typeof MarkdownEditor>>;
|
|
28
|
+
paneEditorScrolls: Map<string, HTMLElement>;
|
|
29
|
+
paneSearches: Map<string, InstanceType<typeof PageSearch>>;
|
|
30
|
+
menu: Ref<boolean>;
|
|
31
|
+
workspaceMenu: Ref<boolean>;
|
|
32
|
+
settingsPanel: Ref<boolean>;
|
|
33
|
+
commandPaletteOpened: Ref<boolean>;
|
|
34
|
+
importPanel: Ref<boolean>;
|
|
35
|
+
modal: Ref<'' | 'newTab' | 'search' | 'delete' | 'saveAs'>;
|
|
36
|
+
modalBusy: Ref<boolean>;
|
|
37
|
+
fileContextMenu: Ref<{ file: FileEntry; x: number; y: number } | null>;
|
|
38
|
+
directoryContextMenu: Ref<{ parent: string; x: number; y: number } | null>;
|
|
39
|
+
outlineContextMenu: Ref<unknown>;
|
|
40
|
+
fileTree: Ref<InstanceType<typeof FileTree> | undefined>;
|
|
41
|
+
selectedEntryIds: Ref<Set<string>>;
|
|
42
|
+
selectionAnchorId: Ref<string | null>;
|
|
43
|
+
selectedEntries: Ref<FileEntry[]>;
|
|
44
|
+
showModal: (kind: 'newTab' | 'search' | 'delete' | 'saveAs', target?: FileEntry) => void;
|
|
45
|
+
createNewDocument: () => Promise<void>;
|
|
46
|
+
printActiveDocument: () => Promise<void>;
|
|
47
|
+
openPaneSearch: (id?: string, replace?: boolean) => void;
|
|
48
|
+
toggleAssistant: () => void;
|
|
49
|
+
toggleSidebar: () => void;
|
|
50
|
+
closeFileContextMenu: (restoreFocus?: boolean) => void;
|
|
51
|
+
closeDirectoryContextMenu: () => void;
|
|
52
|
+
closeOutlineContextMenu: () => void;
|
|
53
|
+
fileMutationDisabled: (file: FileEntry) => boolean;
|
|
54
|
+
directoryHasManagedFile: (file: FileEntry) => boolean;
|
|
55
|
+
startTreeRename: (file: FileEntry) => void;
|
|
56
|
+
removeDocuments: (entries: FileEntry[]) => Promise<void>;
|
|
57
|
+
selectActiveFileInTree: () => void;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function useWorkbenchKeybindings(deps: WorkbenchKeybindingsDeps) {
|
|
61
|
+
const {
|
|
62
|
+
store,
|
|
63
|
+
assistant,
|
|
64
|
+
editing,
|
|
65
|
+
activeWindow,
|
|
66
|
+
compactPanes,
|
|
67
|
+
sidebar,
|
|
68
|
+
shortcuts,
|
|
69
|
+
updateLock,
|
|
70
|
+
source,
|
|
71
|
+
revealMarkdown,
|
|
72
|
+
paneEditors,
|
|
73
|
+
paneEditorScrolls,
|
|
74
|
+
paneSearches,
|
|
75
|
+
menu,
|
|
76
|
+
workspaceMenu,
|
|
77
|
+
settingsPanel,
|
|
78
|
+
commandPaletteOpened,
|
|
79
|
+
importPanel,
|
|
80
|
+
modal,
|
|
81
|
+
modalBusy,
|
|
82
|
+
fileContextMenu,
|
|
83
|
+
directoryContextMenu,
|
|
84
|
+
outlineContextMenu,
|
|
85
|
+
fileTree,
|
|
86
|
+
selectedEntryIds,
|
|
87
|
+
selectionAnchorId,
|
|
88
|
+
selectedEntries,
|
|
89
|
+
showModal,
|
|
90
|
+
createNewDocument,
|
|
91
|
+
printActiveDocument,
|
|
92
|
+
openPaneSearch,
|
|
93
|
+
toggleAssistant,
|
|
94
|
+
toggleSidebar,
|
|
95
|
+
closeFileContextMenu,
|
|
96
|
+
closeDirectoryContextMenu,
|
|
97
|
+
closeOutlineContextMenu,
|
|
98
|
+
fileMutationDisabled,
|
|
99
|
+
directoryHasManagedFile,
|
|
100
|
+
startTreeRename,
|
|
101
|
+
removeDocuments,
|
|
102
|
+
selectActiveFileInTree,
|
|
103
|
+
} = deps;
|
|
104
|
+
const { workspace, active, openingWorkspace } = storeToRefs(store);
|
|
105
|
+
|
|
106
|
+
const routeConfiguredEditorShortcut = configuredEditorShortcuts(
|
|
107
|
+
() => shortcuts.value,
|
|
108
|
+
() => !settingsPanel.value && !modal.value && !commandPaletteOpened.value && !updateLock.value,
|
|
109
|
+
() => paneEditorScrolls.get(store.activePaneId),
|
|
110
|
+
(id) => {
|
|
111
|
+
const action = (
|
|
112
|
+
{
|
|
113
|
+
deleteBlock: 'delete',
|
|
114
|
+
moveBlockUp: 'move-up',
|
|
115
|
+
moveBlockDown: 'move-down',
|
|
116
|
+
indentBlock: 'indent',
|
|
117
|
+
outdentBlock: 'outdent',
|
|
118
|
+
} as Record<string, string>
|
|
119
|
+
)[id];
|
|
120
|
+
if (action) paneEditors.get(store.activePaneId)?.blockShortcut(action);
|
|
121
|
+
},
|
|
122
|
+
);
|
|
123
|
+
// Register during setup, before child editors install their native capture handlers.
|
|
124
|
+
window.addEventListener('keydown', routeConfiguredEditorShortcut, true);
|
|
125
|
+
onBeforeUnmount(() => window.removeEventListener('keydown', routeConfiguredEditorShortcut, true));
|
|
126
|
+
|
|
127
|
+
function handleWorkbenchShortcut(event: KeyboardEvent) {
|
|
128
|
+
if (openingWorkspace.value) return;
|
|
129
|
+
if (
|
|
130
|
+
event.defaultPrevented ||
|
|
131
|
+
importPanel.value ||
|
|
132
|
+
settingsPanel.value ||
|
|
133
|
+
commandPaletteOpened.value ||
|
|
134
|
+
updateLock.value ||
|
|
135
|
+
modal.value
|
|
136
|
+
)
|
|
137
|
+
return;
|
|
138
|
+
let action: (() => void) | undefined;
|
|
139
|
+
const standardEditor = !!active.value && !editing.active && !editing.activeBusy;
|
|
140
|
+
if (
|
|
141
|
+
activeWindow.value.id === 'main' &&
|
|
142
|
+
workspace.value &&
|
|
143
|
+
isSidebarToggleShortcut(event, shortcuts.value)
|
|
144
|
+
)
|
|
145
|
+
action = toggleSidebar;
|
|
146
|
+
else if (matchesShortcut(event, 'save', shortcuts.value))
|
|
147
|
+
action = () => {
|
|
148
|
+
void store.flush();
|
|
149
|
+
};
|
|
150
|
+
else if (active.value && matchesShortcut(event, 'print', shortcuts.value))
|
|
151
|
+
action = () => {
|
|
152
|
+
void printActiveDocument();
|
|
153
|
+
};
|
|
154
|
+
else if (standardEditor && matchesShortcut(event, 'toggleSource', shortcuts.value))
|
|
155
|
+
action = () => {
|
|
156
|
+
source.value = !source.value;
|
|
157
|
+
};
|
|
158
|
+
else if (
|
|
159
|
+
standardEditor &&
|
|
160
|
+
!source.value &&
|
|
161
|
+
matchesShortcut(event, 'toggleMarkdownReveal', shortcuts.value)
|
|
162
|
+
)
|
|
163
|
+
action = () => {
|
|
164
|
+
revealMarkdown.value = !revealMarkdown.value;
|
|
165
|
+
};
|
|
166
|
+
else if (
|
|
167
|
+
workspace.value &&
|
|
168
|
+
assistant.available &&
|
|
169
|
+
matchesShortcut(event, 'toggleAssistant', shortcuts.value)
|
|
170
|
+
)
|
|
171
|
+
action = toggleAssistant;
|
|
172
|
+
else if (matchesShortcut(event, 'findDocument', shortcuts.value))
|
|
173
|
+
action = () => showModal('search');
|
|
174
|
+
else if (workspace.value && matchesShortcut(event, 'openDocument', shortcuts.value))
|
|
175
|
+
action = () => showModal('newTab');
|
|
176
|
+
else if (workspace.value && matchesShortcut(event, 'newDocument', shortcuts.value))
|
|
177
|
+
action = () => {
|
|
178
|
+
void createNewDocument();
|
|
179
|
+
};
|
|
180
|
+
else if (workspace.value && matchesShortcut(event, 'commandPalette', shortcuts.value))
|
|
181
|
+
action = () => {
|
|
182
|
+
commandPaletteOpened.value = true;
|
|
183
|
+
};
|
|
184
|
+
if (!action && workspace.value) {
|
|
185
|
+
const command = pluginShortcutCommand(event, store.pluginCommands, shortcuts.value);
|
|
186
|
+
if (command)
|
|
187
|
+
action = () => {
|
|
188
|
+
void store
|
|
189
|
+
.interactWithPlugin({
|
|
190
|
+
workspaceId: workspace.value!.id,
|
|
191
|
+
pluginId: command.pluginId,
|
|
192
|
+
instanceId: command.instanceId,
|
|
193
|
+
kind: 'command',
|
|
194
|
+
name: command.id,
|
|
195
|
+
payload: { workspaceId: workspace.value!.id, fileId: store.active?.id },
|
|
196
|
+
})
|
|
197
|
+
.catch(store.report);
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
if (!action) return;
|
|
201
|
+
event.preventDefault();
|
|
202
|
+
event.stopPropagation();
|
|
203
|
+
action();
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function handlePageSearchShortcut(event: KeyboardEvent) {
|
|
207
|
+
if (openingWorkspace.value) return;
|
|
208
|
+
if (
|
|
209
|
+
importPanel.value ||
|
|
210
|
+
settingsPanel.value ||
|
|
211
|
+
commandPaletteOpened.value ||
|
|
212
|
+
updateLock.value ||
|
|
213
|
+
modal.value ||
|
|
214
|
+
event.isComposing ||
|
|
215
|
+
event.keyCode === 229 ||
|
|
216
|
+
event.defaultPrevented
|
|
217
|
+
)
|
|
218
|
+
return;
|
|
219
|
+
const search = paneSearches.get(store.activePaneId);
|
|
220
|
+
if (!search) return;
|
|
221
|
+
const find = matchesShortcut(event, 'pageSearch', shortcuts.value);
|
|
222
|
+
const replace = matchesShortcut(event, 'pageReplace', shortcuts.value);
|
|
223
|
+
if (find || replace) {
|
|
224
|
+
event.preventDefault();
|
|
225
|
+
event.stopPropagation();
|
|
226
|
+
openPaneSearch(store.activePaneId, replace);
|
|
227
|
+
} else if (
|
|
228
|
+
search.isOpen() &&
|
|
229
|
+
!(isElement(event.target) && event.target.closest('.page-search')) &&
|
|
230
|
+
(matchesShortcut(event, 'closeSearch', shortcuts.value) ||
|
|
231
|
+
matchesShortcut(event, 'nextMatchFromEditor', shortcuts.value) ||
|
|
232
|
+
matchesShortcut(event, 'previousMatchFromEditor', shortcuts.value))
|
|
233
|
+
) {
|
|
234
|
+
event.preventDefault();
|
|
235
|
+
event.stopPropagation();
|
|
236
|
+
if (matchesShortcut(event, 'closeSearch', shortcuts.value)) search.close();
|
|
237
|
+
else
|
|
238
|
+
search.navigate(matchesShortcut(event, 'previousMatchFromEditor', shortcuts.value) ? -1 : 1);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
function handleFileTreeKeydown(event: KeyboardEvent, treeRow: HTMLElement): boolean {
|
|
243
|
+
if (event.key === 'F2') {
|
|
244
|
+
event.preventDefault();
|
|
245
|
+
const file = workspace.value?.files.find((entry) => entry.id === treeRow.dataset.entryId);
|
|
246
|
+
if (
|
|
247
|
+
file &&
|
|
248
|
+
!fileMutationDisabled(file) &&
|
|
249
|
+
!directoryHasManagedFile(file) &&
|
|
250
|
+
(!store.isWeb || file.kind === 'file')
|
|
251
|
+
)
|
|
252
|
+
startTreeRename(file);
|
|
253
|
+
return true;
|
|
254
|
+
}
|
|
255
|
+
if ((event.ctrlKey || event.metaKey) && event.key.toLowerCase() === 'a') {
|
|
256
|
+
event.preventDefault();
|
|
257
|
+
selectedEntryIds.value = new Set(fileTree.value?.getVisibleIds() ?? []);
|
|
258
|
+
selectionAnchorId.value = treeRow.dataset.entryId ?? null;
|
|
259
|
+
return true;
|
|
260
|
+
}
|
|
261
|
+
if (event.key === 'Delete' && selectedEntries.value.length) {
|
|
262
|
+
event.preventDefault();
|
|
263
|
+
void removeDocuments([...selectedEntries.value]);
|
|
264
|
+
return true;
|
|
265
|
+
}
|
|
266
|
+
if (event.key === 'Escape' && selectedEntryIds.value.size) {
|
|
267
|
+
event.preventDefault();
|
|
268
|
+
selectActiveFileInTree();
|
|
269
|
+
return true;
|
|
270
|
+
}
|
|
271
|
+
return false;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
function keydown(event: KeyboardEvent) {
|
|
275
|
+
const { document } = activeWindow.value;
|
|
276
|
+
if (openingWorkspace.value) return;
|
|
277
|
+
if (importPanel.value) return;
|
|
278
|
+
if (settingsPanel.value) {
|
|
279
|
+
if (event.key === 'Escape') settingsPanel.value = false;
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
if (event.key === 'Escape' && fileContextMenu.value) {
|
|
283
|
+
event.preventDefault();
|
|
284
|
+
closeFileContextMenu(true);
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
if (event.key === 'Escape' && directoryContextMenu.value) {
|
|
288
|
+
event.preventDefault();
|
|
289
|
+
closeDirectoryContextMenu();
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
if (event.key === 'Escape' && outlineContextMenu.value) {
|
|
293
|
+
event.preventDefault();
|
|
294
|
+
closeOutlineContextMenu();
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
if (updateLock.value && event.key !== 'Tab') {
|
|
298
|
+
if (event.key === 'Escape' || event.ctrlKey || event.metaKey) event.preventDefault();
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
const treeRow = (event.target as HTMLElement | null)?.closest<HTMLElement>(
|
|
302
|
+
'.tree-scroll .tree-row[data-entry-id]',
|
|
303
|
+
);
|
|
304
|
+
if (treeRow && !modal.value && handleFileTreeKeydown(event, treeRow)) {
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
if (event.key === 'Escape' && !modalBusy.value) {
|
|
308
|
+
modal.value = '';
|
|
309
|
+
menu.value = false;
|
|
310
|
+
workspaceMenu.value = false;
|
|
311
|
+
if (compactPanes.value) sidebar.value = false;
|
|
312
|
+
}
|
|
313
|
+
if (event.key === 'Tab' && modal.value) {
|
|
314
|
+
const targets = [
|
|
315
|
+
...document.querySelectorAll<HTMLElement>(
|
|
316
|
+
':is(.modal, .search-modal) :is(button:not(:disabled), input, a)',
|
|
317
|
+
),
|
|
318
|
+
];
|
|
319
|
+
const first = targets[0];
|
|
320
|
+
const last = targets.at(-1);
|
|
321
|
+
if (event.shiftKey && document.activeElement === first) {
|
|
322
|
+
event.preventDefault();
|
|
323
|
+
last?.focus();
|
|
324
|
+
} else if (!event.shiftKey && document.activeElement === last) {
|
|
325
|
+
event.preventDefault();
|
|
326
|
+
first?.focus();
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
return {
|
|
332
|
+
routeConfiguredEditorShortcut,
|
|
333
|
+
handleWorkbenchShortcut,
|
|
334
|
+
handlePageSearchShortcut,
|
|
335
|
+
keydown,
|
|
336
|
+
};
|
|
337
|
+
}
|