@tano.page/workbench 0.14.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 +50 -16
- package/src/App.vue +82 -752
- package/src/appearance/appearance.ts +14 -4
- package/src/appearance/components/ThemePresetPreview.vue +52 -8
- package/src/appearance/interface-font.ts +99 -0
- package/src/appearance/theme.ts +26 -10
- package/src/appearance/use-interface-font.ts +30 -0
- package/src/assets/mail-provider-icons/NOTICE.txt +27 -0
- package/src/assets/mail-provider-icons/aliyun-mail.svg +3 -0
- package/src/assets/mail-provider-icons/gmail.svg +1 -0
- package/src/assets/mail-provider-icons/icloud.svg +12 -0
- package/src/assets/mail-provider-icons/netease-126.svg +5 -0
- package/src/assets/mail-provider-icons/netease-163.svg +5 -0
- package/src/assets/mail-provider-icons/qq.svg +9 -0
- package/src/assets/mail-provider-icons/tencent-exmail.svg +4 -0
- 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/AssistantChangeList.vue +98 -21
- package/src/assistant/components/AssistantPanel.vue +425 -8
- package/src/assistant/components/PluginToolProposalCard.vue +235 -0
- package/src/assistant/connection-actions.ts +237 -0
- package/src/assistant/document-mentions.ts +1 -33
- package/src/assistant/engine.ts +1 -532
- package/src/assistant/execution.ts +6 -33
- package/src/assistant/files.ts +5 -13
- package/src/assistant/hash.ts +1 -4
- package/src/assistant/inbox.ts +1 -148
- package/src/assistant/language.ts +10 -37
- package/src/assistant/mention-autocomplete.ts +69 -0
- package/src/assistant/plugin-bridge-builder.ts +146 -0
- package/src/assistant/prompts.ts +1 -58
- package/src/assistant/proposal-actions.ts +336 -0
- package/src/assistant/results.ts +20 -86
- package/src/assistant/store.ts +167 -327
- package/src/assistant/structures.ts +1 -155
- package/src/assistant/tasks.ts +8 -96
- package/src/assistant/tool-rules.ts +1 -7
- package/src/assistant/workspace-bridge.ts +1 -1
- package/src/composables/use-document-actions.ts +38 -20
- package/src/composables/use-file-tree-controller.ts +7 -12
- package/src/composables/use-workbench-help.ts +177 -0
- package/src/composables/use-workbench-history.ts +2 -4
- package/src/composables/use-workbench-lifecycle.ts +249 -0
- package/src/composables/use-workbench-modals.ts +6 -1
- package/src/composables/use-workbench-outline.ts +0 -5
- package/src/composables/use-workbench-settings.ts +185 -0
- package/src/composables/use-workbench-shortcuts.ts +40 -1021
- package/src/composables/use-workbench-views.ts +325 -0
- package/src/data-tables/data-tables.ts +1 -2
- package/src/documents/components/DocumentActionMenu.vue +279 -0
- package/src/documents/components/DocumentHistoryPanel.vue +3 -1
- 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/features.ts +1 -0
- package/src/files/components/FileMetadataPanel.vue +49 -15
- package/src/fonts/Inter-Latin-Italic.woff2 +0 -0
- package/src/fonts/Inter-Latin.woff2 +0 -0
- package/src/fonts/TanoUISansSC-Bold.woff2 +0 -0
- package/src/fonts/TanoUISansSC-Medium.woff2 +0 -0
- package/src/fonts/TanoUISansSC-Regular.woff2 +0 -0
- package/src/help/help-milestones.ts +3 -5
- package/src/i18n/locale-catalogs.ts +7 -6
- package/src/i18n/locale-registry.ts +8 -6
- package/src/i18n/locales/de-DE.json +371 -3
- package/src/i18n/locales/en-US.json +371 -2
- package/src/i18n/locales/es-ES.json +371 -3
- package/src/i18n/locales/ja-JP.json +370 -2
- package/src/i18n/locales/zh-TW.json +370 -2
- package/src/mail/components/MailAccountDialog.vue +450 -0
- package/src/mail/components/MailComposerDialog.vue +326 -0
- package/src/mail/components/MailProviderIcon.vue +30 -0
- package/src/mail/components/MailWorkspaceView.vue +821 -0
- package/src/mail/components/SidebarMail.vue +134 -0
- package/src/mail/mail-avatar.ts +17 -0
- package/src/mail/mail-bridge.ts +68 -0
- package/src/mail/mail-calendar.ts +208 -0
- package/src/mail/mail-markdown.ts +195 -0
- package/src/mail/types.ts +226 -0
- package/src/objects/components/ObjectDetailModal.vue +1001 -0
- package/src/objects/content-references.ts +6 -56
- package/src/objects/wiki-links.ts +1 -48
- package/src/objects/workspace-objects.ts +3 -4
- package/src/plan-sync/types.ts +6 -3
- package/src/plans/calendar-interaction.ts +194 -0
- package/src/plans/calendar.ts +65 -9
- package/src/plans/components/CalendarAgendaView.vue +165 -0
- package/src/plans/components/CalendarDayPopover.vue +172 -39
- 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 +264 -748
- package/src/plans/components/CalendarYearView.vue +138 -0
- package/src/plans/components/PlanArchiveDialog.vue +295 -0
- package/src/plans/components/PlanConnectionsDialog.vue +1 -1
- package/src/plans/components/PlanDateField.vue +6 -4
- package/src/plans/components/PlanDetailPanel.vue +227 -32
- package/src/plans/components/PlanEventList.vue +16 -4
- package/src/plans/components/SidebarPlan.vue +22 -15
- package/src/plans/components/TaskRepeatControls.vue +169 -30
- 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/plans/local-reminders.ts +149 -0
- package/src/plans/personal-plans.ts +10 -1
- package/src/plans/plan-date.ts +8 -1
- package/src/plans/plan-migration.ts +95 -0
- package/src/plans/recurrence.ts +95 -0
- package/src/plans/task-repeat.ts +8 -8
- package/src/plans/timeline-layout.ts +92 -0
- package/src/plugins/assistant-bridge.ts +520 -0
- package/src/plugins/attachment-reader.ts +3 -1
- package/src/plugins/cache-storage.ts +42 -2
- package/src/plugins/components/PluginAutomations.vue +3 -3
- package/src/plugins/components/PluginCatalogBrowser.vue +17 -8
- package/src/plugins/components/PluginChangeSummary.vue +16 -3
- package/src/plugins/components/PluginConnections.vue +1 -1
- package/src/plugins/components/PluginCustomView.vue +2 -2
- package/src/plugins/components/PluginDetailPage.vue +136 -57
- package/src/plugins/components/PluginDeveloperArea.vue +192 -0
- package/src/plugins/components/PluginDocumentSlot.vue +63 -0
- package/src/plugins/components/PluginExplorer.vue +21 -25
- package/src/plugins/components/PluginImportDialog.vue +410 -0
- package/src/plugins/components/PluginInstaller.vue +273 -288
- package/src/plugins/components/PluginListItem.vue +3 -0
- package/src/plugins/components/PluginMaintenance.vue +37 -34
- package/src/plugins/components/PluginRepositoryStorage.vue +4 -2
- package/src/plugins/components/PluginRuntimePanel.vue +3 -3
- package/src/plugins/components/PluginSettingsForm.vue +112 -0
- package/src/plugins/components/PluginStatusBar.vue +161 -0
- package/src/plugins/components/PluginSurface.vue +18 -6
- package/src/plugins/components/PluginUiDialog.vue +452 -0
- 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/excalidraw/bundle.tano-plugin.json +1 -1
- package/src/plugins/excalidraw/manifest.json +12 -1
- package/src/plugins/host.ts +662 -43
- package/src/plugins/native.ts +2 -10
- package/src/plugins/overlay-mapping.ts +125 -0
- package/src/plugins/packages.ts +73 -1
- package/src/plugins/plugin-data.ts +2 -3
- package/src/plugins/plugin-permissions.ts +57 -0
- package/src/plugins/plugin-rpc-router.ts +558 -0
- package/src/plugins/plugin-sdk.ts +1 -94
- package/src/plugins/plugin-ui-dialogs.ts +167 -0
- package/src/plugins/policy.ts +53 -3
- package/src/plugins/presentation-preview/bundle.tano-plugin.json +1 -1
- package/src/plugins/presentation-preview/manifest.json +2 -1
- package/src/plugins/queries.ts +1 -73
- package/src/plugins/sandbox.ts +15 -1
- package/src/plugins/use-plugin-actions.ts +67 -20
- package/src/plugins/user-plugins.ts +254 -0
- package/src/plugins/view-header.ts +2 -7
- package/src/plugins/word-preview/bundle.tano-plugin.json +1 -1
- package/src/plugins/word-preview/manifest.json +13 -1
- package/src/plugins/workbench.ts +175 -2
- package/src/plugins/worker.js +105 -8
- package/src/plugins/workspace-plugin-runtime.ts +23 -7
- package/src/plugins/workspace-plugins.ts +212 -21
- package/src/runtime.ts +103 -4
- package/src/settings/components/SettingsAppearancePage.vue +46 -0
- package/src/settings/components/SettingsDocumentsPage.vue +0 -1
- 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/components/settings-search.ts +2 -3
- 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/SidebarNavigation.vue +22 -2
- package/src/shell/components/WorkbenchContextMenus.vue +58 -34
- package/src/shell/components/WorkbenchModals.vue +47 -62
- package/src/shell/components/WorkbenchPanes.vue +371 -1342
- package/src/shell/components/WorkbenchSidebar.vue +486 -0
- package/src/shell/components/WorkspaceBreadcrumb.vue +6 -14
- package/src/shell/components/WorkspaceViewSwitcher.vue +12 -7
- 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 +531 -1153
- package/src/shell/workbench-async-components.ts +14 -5
- package/src/shell/workbench-context.ts +30 -3
- package/src/stores/mail.ts +414 -0
- package/src/stores/plan-sync.ts +2 -1
- package/src/stores/plans.ts +2 -9
- package/src/stores/workspace-document-io.ts +807 -0
- package/src/stores/workspace-file-ops.ts +1 -1
- package/src/stores/workspace-knowledge.ts +2 -114
- package/src/stores/workspace-lifecycle.ts +459 -0
- package/src/stores/workspace-plugins-state.ts +254 -259
- package/src/stores/workspace-session.ts +287 -0
- package/src/stores/workspace-tabs-layout.ts +6 -44
- package/src/stores/workspace-types.ts +50 -0
- package/src/stores/workspace.ts +184 -1363
- package/src/styles/agent-diff-modals.css +0 -7
- package/src/styles/dark-theme.css +3 -3
- package/src/styles/inspector.css +0 -59
- package/src/styles/layout-themes.css +346 -0
- package/src/styles/mail.css +1568 -0
- package/src/styles/mobile.css +2 -2
- package/src/styles/recent-and-media.css +0 -17
- package/src/styles/theme-contract.css +3 -3
- package/src/styles/workbench-shell.css +110 -17
- package/src/styles/workspace-states.css +9 -33
- package/src/styles.css +0 -1
- package/src/tabs/components/DesktopTabs.vue +19 -14
- package/src/tabs/components/NewTabPicker.vue +10 -4
- package/src/tabs/tab-label.ts +0 -1
- 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/WorkspaceGeneralSettings.vue +0 -13
- package/src/workspace/components/WorkspaceIconPicker.vue +30 -7
- package/src/workspace/components/WorkspacePickerMenu.vue +317 -0
- package/src/workspace/workspace-comments.ts +11 -151
- package/src/workspace/workspace-welcome.ts +1 -1
- package/src/assistant/locales/de-DE.json +0 -126
- package/src/assistant/locales/en-US.json +0 -126
- package/src/assistant/locales/es-ES.json +0 -126
- package/src/assistant/locales/ja-JP.json +0 -126
- package/src/assistant/locales/zh-CN.json +0 -126
- package/src/assistant/locales/zh-TW.json +0 -126
- package/src/assistant/task-prompts.json +0 -39
- package/src/documents/components/FormulaMenu.vue +0 -50
- package/src/files/components/FileDatabasePage.vue +0 -152
- package/src/files/components/FolderHomeIcon.vue +0 -12
- package/src/objects/components/ObjectDatabasePage.vue +0 -100
- package/src/objects/components/ObjectPanel.vue +0 -554
- package/src/plans/components/PersonalPlanDialog.vue +0 -105
- package/src/shell/components/WorkspaceViewPage.vue +0 -127
- package/src/shell/components/WorkspaceViewTab.vue +0 -24
- package/src/styles/object-panel.css +0 -163
- package/src/workspace/components/GitInspectionPanel.vue +0 -35
- package/src/workspace/components/WorkspaceSyncPanel.vue +0 -50
- package/src/workspace/welcome-slogans.ts +0 -11
- package/src/workspace/workspace-git.ts +0 -35
- package/src/workspace/workspace-sync.ts +0 -46
- package/src/workspace/workspace-views.ts +0 -48
|
@@ -0,0 +1,486 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { inject, ref, toRefs } from 'vue';
|
|
3
|
+
import { CalendarDays, FolderPlus, GitFork, Mail, Search, SquarePen } from 'lucide-vue-next';
|
|
4
|
+
import { GRAPH_TAB_ID } from '../../documents/document-graph';
|
|
5
|
+
import { openExternalUrl } from '../../files/attachments';
|
|
6
|
+
import FileTree from '../../files/components/FileTree.vue';
|
|
7
|
+
import HelpLauncher from '../../help/components/HelpLauncher.vue';
|
|
8
|
+
import { t } from '../../i18n/i18n';
|
|
9
|
+
import { MAIL_TAB_ID } from '../../mail/types';
|
|
10
|
+
import { mobile } from '../../platform/platform';
|
|
11
|
+
import PluginExplorer from '../../plugins/components/PluginExplorer.vue';
|
|
12
|
+
import PluginView from '../../plugins/components/PluginView.vue';
|
|
13
|
+
import { isOverlaySidebarNavHidden } from '../../plugins/overlay-mapping';
|
|
14
|
+
import WorkspacePickerMenu from '../../workspace/components/WorkspacePickerMenu.vue';
|
|
15
|
+
import { vScrollFade } from '../scroll-fade';
|
|
16
|
+
import {
|
|
17
|
+
SidebarAssistant,
|
|
18
|
+
SidebarMail,
|
|
19
|
+
SidebarPlan,
|
|
20
|
+
} from '../workbench-async-components';
|
|
21
|
+
import {
|
|
22
|
+
workbenchDocumentsKey,
|
|
23
|
+
workbenchModalsKey,
|
|
24
|
+
workbenchPrefsKey,
|
|
25
|
+
workbenchShellKey,
|
|
26
|
+
workbenchTreeMenusKey,
|
|
27
|
+
} from '../workbench-context';
|
|
28
|
+
import ButtonVisibilityGroup from './ButtonVisibilityGroup.vue';
|
|
29
|
+
import SidebarNavigation from './SidebarNavigation.vue';
|
|
30
|
+
import SidebarUpdateButton from './SidebarUpdateButton.vue';
|
|
31
|
+
import WorkspaceSidebar from './WorkspaceSidebar.vue';
|
|
32
|
+
import WorkspaceViewSwitcher from './WorkspaceViewSwitcher.vue';
|
|
33
|
+
|
|
34
|
+
const props = defineProps<{
|
|
35
|
+
appMenuOpen: boolean;
|
|
36
|
+
}>();
|
|
37
|
+
|
|
38
|
+
const emit = defineEmits<{
|
|
39
|
+
'toggle-app-menu': [];
|
|
40
|
+
'brand-button': [el: HTMLElement | null];
|
|
41
|
+
}>();
|
|
42
|
+
|
|
43
|
+
const shell = inject(workbenchShellKey);
|
|
44
|
+
const prefs = inject(workbenchPrefsKey);
|
|
45
|
+
const documents = inject(workbenchDocumentsKey);
|
|
46
|
+
const treeMenus = inject(workbenchTreeMenusKey);
|
|
47
|
+
const modals = inject(workbenchModalsKey);
|
|
48
|
+
if (!shell || !prefs || !documents || !treeMenus || !modals) {
|
|
49
|
+
throw new Error('Workbench context is required');
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const {
|
|
53
|
+
native,
|
|
54
|
+
workspace,
|
|
55
|
+
compactPanes,
|
|
56
|
+
isAuxiliaryWindow,
|
|
57
|
+
sidebar,
|
|
58
|
+
store,
|
|
59
|
+
busy,
|
|
60
|
+
activeId,
|
|
61
|
+
startupPending,
|
|
62
|
+
filesPending,
|
|
63
|
+
switchingWorkspace,
|
|
64
|
+
mainColumn,
|
|
65
|
+
returnHome,
|
|
66
|
+
sidebarHeaderItems,
|
|
67
|
+
closeButtonVisibilityMenus,
|
|
68
|
+
extensionViews,
|
|
69
|
+
viewActions,
|
|
70
|
+
navigationContext,
|
|
71
|
+
sidebarNavigationItems,
|
|
72
|
+
navigationModule,
|
|
73
|
+
selectModule,
|
|
74
|
+
sidebarView,
|
|
75
|
+
workspaceView,
|
|
76
|
+
selectWorkspaceView,
|
|
77
|
+
workspaceMenu,
|
|
78
|
+
mailEnabled,
|
|
79
|
+
openMail,
|
|
80
|
+
repositoryActionItems,
|
|
81
|
+
createNewDocument,
|
|
82
|
+
createNewEntry,
|
|
83
|
+
noteCount,
|
|
84
|
+
sidebarCalendarDate,
|
|
85
|
+
openCalendar,
|
|
86
|
+
showPlanEvent,
|
|
87
|
+
extensions,
|
|
88
|
+
extensionActions,
|
|
89
|
+
openSettings,
|
|
90
|
+
updates,
|
|
91
|
+
helpContext,
|
|
92
|
+
helpAvailability,
|
|
93
|
+
helpBlocked,
|
|
94
|
+
documentationBaseUrl,
|
|
95
|
+
} = toRefs(shell);
|
|
96
|
+
|
|
97
|
+
const {
|
|
98
|
+
shortcuts,
|
|
99
|
+
sidebarWidth,
|
|
100
|
+
defaultSidebarWidth,
|
|
101
|
+
SIDEBAR_MIN_WIDTH,
|
|
102
|
+
sidebarWidthLimit,
|
|
103
|
+
startSidebarResize,
|
|
104
|
+
resizeSidebarWithKeyboard,
|
|
105
|
+
} = toRefs(prefs);
|
|
106
|
+
|
|
107
|
+
const { menu } = toRefs(documents);
|
|
108
|
+
|
|
109
|
+
const {
|
|
110
|
+
setFileTree,
|
|
111
|
+
draggedEntry,
|
|
112
|
+
dropFolder,
|
|
113
|
+
dropPlaceholders,
|
|
114
|
+
fileDragOver,
|
|
115
|
+
fileDragLeave,
|
|
116
|
+
fileDrop,
|
|
117
|
+
openDirectoryContextMenu,
|
|
118
|
+
treeFiles,
|
|
119
|
+
revealedHomeId,
|
|
120
|
+
treeDocumentIcons,
|
|
121
|
+
loadTreeDocumentIcon,
|
|
122
|
+
selectedEntryIds,
|
|
123
|
+
fileContextMenu,
|
|
124
|
+
canDragEntry,
|
|
125
|
+
treeRename,
|
|
126
|
+
renameTreeEntry,
|
|
127
|
+
openTreeEntry,
|
|
128
|
+
selectFileTreeEntry,
|
|
129
|
+
openFileContextMenu,
|
|
130
|
+
fileDragStart,
|
|
131
|
+
fileDragEnd,
|
|
132
|
+
finishTreeRename,
|
|
133
|
+
} = toRefs(treeMenus);
|
|
134
|
+
|
|
135
|
+
const { modal, settingsPanel, showModal } = toRefs(modals);
|
|
136
|
+
|
|
137
|
+
const brandButton = ref<HTMLElement | null>(null);
|
|
138
|
+
function setBrandButton(el: unknown) {
|
|
139
|
+
brandButton.value = (el as HTMLElement | null) ?? null;
|
|
140
|
+
emit('brand-button', brandButton.value);
|
|
141
|
+
}
|
|
142
|
+
</script>
|
|
143
|
+
|
|
144
|
+
<template>
|
|
145
|
+
<WorkspaceSidebar
|
|
146
|
+
v-if="!isAuxiliaryWindow"
|
|
147
|
+
:open="sidebar"
|
|
148
|
+
:compact="compactPanes"
|
|
149
|
+
:content-element="mainColumn"
|
|
150
|
+
@dismiss="sidebar = false"
|
|
151
|
+
>
|
|
152
|
+
<div class="sidebar-header">
|
|
153
|
+
<div class="sidebar-brand-slot">
|
|
154
|
+
<button
|
|
155
|
+
v-if="native && !mobile"
|
|
156
|
+
:ref="setBrandButton"
|
|
157
|
+
type="button"
|
|
158
|
+
class="brand brand-menu-button"
|
|
159
|
+
aria-haspopup="menu"
|
|
160
|
+
:aria-expanded="props.appMenuOpen"
|
|
161
|
+
:aria-label="t('同页')"
|
|
162
|
+
@click="emit('toggle-app-menu')"
|
|
163
|
+
>
|
|
164
|
+
<img src="../../assets/tano-logo.svg" alt="" />
|
|
165
|
+
</button>
|
|
166
|
+
<component
|
|
167
|
+
:is="native ? 'div' : 'a'"
|
|
168
|
+
v-else
|
|
169
|
+
class="brand"
|
|
170
|
+
:href="native ? undefined : '/'"
|
|
171
|
+
:aria-label="native ? undefined : t('返回同页首页')"
|
|
172
|
+
@click="returnHome"
|
|
173
|
+
>
|
|
174
|
+
<img src="../../assets/tano-logo.svg" alt="" />
|
|
175
|
+
</component>
|
|
176
|
+
</div>
|
|
177
|
+
<ButtonVisibilityGroup
|
|
178
|
+
v-slot="{ isVisible }"
|
|
179
|
+
:items="sidebarHeaderItems"
|
|
180
|
+
:active="sidebar"
|
|
181
|
+
preference-key="tano.preference.sidebarHiddenHeaderActions"
|
|
182
|
+
group-class="sidebar-header-actions"
|
|
183
|
+
:label="t('侧栏顶部按钮')"
|
|
184
|
+
:menu-label="t('侧栏顶部按钮显示设置')"
|
|
185
|
+
@open="closeButtonVisibilityMenus"
|
|
186
|
+
>
|
|
187
|
+
<template v-if="navigationModule === 'workspace'">
|
|
188
|
+
<button
|
|
189
|
+
v-if="isVisible('search') && !isOverlaySidebarNavHidden('search', store.overlaySnapshot?.hiddenSidebarItems)"
|
|
190
|
+
type="button"
|
|
191
|
+
class="icon-button"
|
|
192
|
+
:aria-label="t('查找文档')"
|
|
193
|
+
:data-tooltip="t('查找文档')"
|
|
194
|
+
:data-tooltip-shortcut="shortcuts.findDocument"
|
|
195
|
+
:disabled="!workspace"
|
|
196
|
+
@click="showModal('search')"
|
|
197
|
+
>
|
|
198
|
+
<Search :size="16" :stroke-width="1.6" />
|
|
199
|
+
</button>
|
|
200
|
+
<button
|
|
201
|
+
v-if="store.workspaceSettings.showGraph && isVisible('graph') && !isOverlaySidebarNavHidden('graph', store.overlaySnapshot?.hiddenSidebarItems)"
|
|
202
|
+
type="button"
|
|
203
|
+
class="icon-button"
|
|
204
|
+
:aria-label="t('打开关系图谱')"
|
|
205
|
+
:data-tooltip="t('关系图谱')"
|
|
206
|
+
:aria-pressed="activeId === GRAPH_TAB_ID"
|
|
207
|
+
:disabled="!workspace"
|
|
208
|
+
@click="store.openGraphTab()"
|
|
209
|
+
>
|
|
210
|
+
<GitFork :size="16" :stroke-width="1.6" />
|
|
211
|
+
</button>
|
|
212
|
+
</template>
|
|
213
|
+
<template v-for="view in extensionViews" :key="`header-${view.id}`">
|
|
214
|
+
<component
|
|
215
|
+
:is="view.header"
|
|
216
|
+
v-if="
|
|
217
|
+
(view.scope === 'account' || store.workspaceSettings.showCollaborationViews) &&
|
|
218
|
+
view.header &&
|
|
219
|
+
isVisible(view.id)
|
|
220
|
+
"
|
|
221
|
+
:actions="viewActions[view.id]"
|
|
222
|
+
/>
|
|
223
|
+
</template>
|
|
224
|
+
</ButtonVisibilityGroup>
|
|
225
|
+
</div>
|
|
226
|
+
|
|
227
|
+
<SidebarNavigation
|
|
228
|
+
v-if="navigationContext === 'home'"
|
|
229
|
+
v-slot="{ isVisible, orderStyle }"
|
|
230
|
+
:items="sidebarNavigationItems"
|
|
231
|
+
:active="sidebar"
|
|
232
|
+
:overlay-hidden-ids="store.overlaySnapshot?.hiddenSidebarItems"
|
|
233
|
+
:overlay-order="store.overlaySnapshot?.sidebarOrder"
|
|
234
|
+
@open="closeButtonVisibilityMenus"
|
|
235
|
+
>
|
|
236
|
+
<button
|
|
237
|
+
v-if="isVisible('plan')"
|
|
238
|
+
type="button"
|
|
239
|
+
class="sidebar-navigation-button"
|
|
240
|
+
:style="orderStyle('plan')"
|
|
241
|
+
:aria-label="t('计划')"
|
|
242
|
+
:data-tooltip="t('计划')"
|
|
243
|
+
aria-controls="sidebar-plan-panel"
|
|
244
|
+
:aria-pressed="navigationModule === 'plan'"
|
|
245
|
+
@click="selectModule('plan')"
|
|
246
|
+
>
|
|
247
|
+
<CalendarDays :size="18" :stroke-width="1.6" aria-hidden="true" />
|
|
248
|
+
<span :aria-hidden="navigationModule !== 'plan'"><span>{{ t('计划') }}</span></span>
|
|
249
|
+
</button>
|
|
250
|
+
<button
|
|
251
|
+
v-if="mailEnabled && isVisible(MAIL_TAB_ID)"
|
|
252
|
+
type="button"
|
|
253
|
+
class="sidebar-navigation-button"
|
|
254
|
+
:style="orderStyle(MAIL_TAB_ID)"
|
|
255
|
+
:aria-label="t('邮箱')"
|
|
256
|
+
:data-tooltip="t('邮箱')"
|
|
257
|
+
:aria-controls="`sidebar-${MAIL_TAB_ID}`"
|
|
258
|
+
:aria-pressed="sidebarView === MAIL_TAB_ID"
|
|
259
|
+
@click="openMail()"
|
|
260
|
+
>
|
|
261
|
+
<Mail :size="18" :stroke-width="1.6" aria-hidden="true" />
|
|
262
|
+
<span :aria-hidden="sidebarView !== MAIL_TAB_ID"><span>{{ t('邮箱') }}</span></span>
|
|
263
|
+
</button>
|
|
264
|
+
<template v-for="view in extensionViews" :key="view.id">
|
|
265
|
+
<button
|
|
266
|
+
v-if="
|
|
267
|
+
store.workspaceSettings.showCollaborationViews && view.sidebar && isVisible(view.id)
|
|
268
|
+
"
|
|
269
|
+
type="button"
|
|
270
|
+
class="sidebar-navigation-button"
|
|
271
|
+
:style="orderStyle(view.id)"
|
|
272
|
+
:aria-label="view.label"
|
|
273
|
+
:data-tooltip="view.label"
|
|
274
|
+
:aria-controls="`sidebar-${view.id}`"
|
|
275
|
+
:aria-pressed="sidebarView === view.id"
|
|
276
|
+
@click="selectModule(view.id)"
|
|
277
|
+
>
|
|
278
|
+
<component :is="view.icon" :size="18" :stroke-width="1.6" aria-hidden="true" />
|
|
279
|
+
<span :aria-hidden="sidebarView !== view.id"><span>{{ view.label }}</span></span>
|
|
280
|
+
</button>
|
|
281
|
+
</template>
|
|
282
|
+
</SidebarNavigation>
|
|
283
|
+
|
|
284
|
+
<div v-show="navigationModule === 'workspace'" class="sidebar-view-header">
|
|
285
|
+
<WorkspaceViewSwitcher
|
|
286
|
+
:model-value="workspaceView"
|
|
287
|
+
@update:model-value="selectWorkspaceView"
|
|
288
|
+
:active="sidebar && !workspaceMenu && !modal && !settingsPanel"
|
|
289
|
+
@open="closeButtonVisibilityMenus"
|
|
290
|
+
/>
|
|
291
|
+
</div>
|
|
292
|
+
|
|
293
|
+
<div
|
|
294
|
+
v-show="navigationModule === 'workspace' && sidebarView === 'repository'"
|
|
295
|
+
class="section-label workspace-root-header"
|
|
296
|
+
:class="{ 'drop-target': draggedEntry && dropFolder === '' }"
|
|
297
|
+
@dragover="fileDragOver('', $event)"
|
|
298
|
+
@dragleave="fileDragLeave('', $event)"
|
|
299
|
+
@drop="fileDrop('', $event)"
|
|
300
|
+
@contextmenu.self.prevent="openDirectoryContextMenu('', $event)"
|
|
301
|
+
>
|
|
302
|
+
<span
|
|
303
|
+
class="workspace-root-name"
|
|
304
|
+
:title="draggedEntry ? undefined : workspace?.name"
|
|
305
|
+
@contextmenu.prevent="openDirectoryContextMenu('', $event)"
|
|
306
|
+
>{{ draggedEntry ? t('放到工作区根目录') : (workspace?.name ?? '') }}</span
|
|
307
|
+
>
|
|
308
|
+
<ButtonVisibilityGroup
|
|
309
|
+
v-slot="{ isVisible }"
|
|
310
|
+
v-show="!draggedEntry"
|
|
311
|
+
:items="repositoryActionItems"
|
|
312
|
+
:active="sidebar && sidebarView === 'repository'"
|
|
313
|
+
preference-key="tano.preference.repositoryHiddenActions"
|
|
314
|
+
group-class="repository-actions"
|
|
315
|
+
:label="t('工作区按钮')"
|
|
316
|
+
:menu-label="t('工作区按钮显示设置')"
|
|
317
|
+
@open="closeButtonVisibilityMenus"
|
|
318
|
+
>
|
|
319
|
+
<button
|
|
320
|
+
v-if="isVisible('create')"
|
|
321
|
+
type="button"
|
|
322
|
+
class="icon-button"
|
|
323
|
+
:aria-label="t('新建文档')"
|
|
324
|
+
:data-tooltip="t('新建文档')"
|
|
325
|
+
:data-tooltip-shortcut="shortcuts.newDocument"
|
|
326
|
+
:disabled="!workspace || workspace.readOnly || busy"
|
|
327
|
+
@click="createNewDocument"
|
|
328
|
+
>
|
|
329
|
+
<SquarePen :size="15" :stroke-width="1.6" />
|
|
330
|
+
</button>
|
|
331
|
+
<button
|
|
332
|
+
v-if="isVisible('folder')"
|
|
333
|
+
type="button"
|
|
334
|
+
class="icon-button"
|
|
335
|
+
:aria-label="t('新建文件夹')"
|
|
336
|
+
:data-tooltip="t('新建文件夹')"
|
|
337
|
+
:disabled="!workspace || workspace.readOnly || busy"
|
|
338
|
+
@click="createNewEntry('folder')"
|
|
339
|
+
>
|
|
340
|
+
<FolderPlus :size="15" :stroke-width="1.6" />
|
|
341
|
+
</button>
|
|
342
|
+
</ButtonVisibilityGroup>
|
|
343
|
+
</div>
|
|
344
|
+
|
|
345
|
+
<PluginExplorer v-if="sidebarView === 'plugin-views'" />
|
|
346
|
+
<PluginView
|
|
347
|
+
v-else-if="sidebarView.startsWith('plugin-sidebar:')"
|
|
348
|
+
:view-key="sidebarView.slice(15)"
|
|
349
|
+
/>
|
|
350
|
+
<div
|
|
351
|
+
v-show="sidebarView === 'repository'"
|
|
352
|
+
id="sidebar-repository-panel"
|
|
353
|
+
class="sidebar-content"
|
|
354
|
+
>
|
|
355
|
+
<div
|
|
356
|
+
v-scroll-fade
|
|
357
|
+
class="tree-scroll"
|
|
358
|
+
:class="{ 'drop-root': draggedEntry && dropFolder === '' && !dropPlaceholders.length }"
|
|
359
|
+
@contextmenu.self.prevent="openDirectoryContextMenu('', $event)"
|
|
360
|
+
@dragover.self="fileDragOver('', $event)"
|
|
361
|
+
@dragleave.self="fileDragLeave('', $event)"
|
|
362
|
+
@drop.self="fileDrop('', $event)"
|
|
363
|
+
>
|
|
364
|
+
<FileTree
|
|
365
|
+
:ref="setFileTree"
|
|
366
|
+
v-if="workspace || startupPending || filesPending"
|
|
367
|
+
:loading="filesPending"
|
|
368
|
+
:entries="treeFiles"
|
|
369
|
+
:folder-home-file-name="store.workspaceSettings.folderHomeFileName"
|
|
370
|
+
:revealed-home-id="revealedHomeId"
|
|
371
|
+
:document-icons="treeDocumentIcons"
|
|
372
|
+
:load-document-icon="loadTreeDocumentIcon"
|
|
373
|
+
:selected-ids="selectedEntryIds"
|
|
374
|
+
:context-selected="fileContextMenu?.file.id"
|
|
375
|
+
:dragged-id="draggedEntry?.file.id"
|
|
376
|
+
:drop-target="dropFolder"
|
|
377
|
+
:drop-preview="dropPlaceholders"
|
|
378
|
+
:can-drag="canDragEntry"
|
|
379
|
+
:renaming-id="treeRename?.fileId"
|
|
380
|
+
:rename-entry="renameTreeEntry"
|
|
381
|
+
@open="openTreeEntry"
|
|
382
|
+
@select="selectFileTreeEntry"
|
|
383
|
+
@prefetch="store.prefetchFile"
|
|
384
|
+
@context="openFileContextMenu"
|
|
385
|
+
@context-blank="openDirectoryContextMenu"
|
|
386
|
+
@drag-start="fileDragStart"
|
|
387
|
+
@drag-end="fileDragEnd"
|
|
388
|
+
@drag-over="fileDragOver"
|
|
389
|
+
@drag-leave="fileDragLeave"
|
|
390
|
+
@drop="fileDrop"
|
|
391
|
+
@rename-finished="finishTreeRename"
|
|
392
|
+
/>
|
|
393
|
+
<div
|
|
394
|
+
v-if="!filesPending && !noteCount"
|
|
395
|
+
class="tree-empty"
|
|
396
|
+
@contextmenu.prevent="openDirectoryContextMenu('', $event)"
|
|
397
|
+
>
|
|
398
|
+
{{ t('你的下一页,') }}<br />{{ t('从一个新文档开始。') }}
|
|
399
|
+
</div>
|
|
400
|
+
</div>
|
|
401
|
+
</div>
|
|
402
|
+
|
|
403
|
+
<SidebarAssistant
|
|
404
|
+
v-if="sidebarView === 'assistant'"
|
|
405
|
+
@open="compactPanes && (sidebar = false)"
|
|
406
|
+
/>
|
|
407
|
+
<SidebarPlan
|
|
408
|
+
v-show="sidebarView === 'plan' || sidebarView === 'events'"
|
|
409
|
+
:active="sidebar && (sidebarView === 'plan' || sidebarView === 'events')"
|
|
410
|
+
:workspace-only="navigationContext === 'workspace'"
|
|
411
|
+
id="sidebar-plan-panel"
|
|
412
|
+
:date="sidebarCalendarDate"
|
|
413
|
+
@select-date="openCalendar"
|
|
414
|
+
@select-event="showPlanEvent"
|
|
415
|
+
/>
|
|
416
|
+
<SidebarMail
|
|
417
|
+
v-if="mailEnabled && sidebarView === MAIL_TAB_ID"
|
|
418
|
+
:id="`sidebar-${MAIL_TAB_ID}`"
|
|
419
|
+
@open-mail="openMail"
|
|
420
|
+
/>
|
|
421
|
+
<template v-for="view in extensionViews" :key="view.id">
|
|
422
|
+
<div
|
|
423
|
+
v-if="view.sidebar"
|
|
424
|
+
v-show="sidebarView === view.id"
|
|
425
|
+
:id="`sidebar-${view.id}`"
|
|
426
|
+
class="extension-sidebar"
|
|
427
|
+
>
|
|
428
|
+
<component :is="view.sidebar" :actions="viewActions[view.id]" />
|
|
429
|
+
</div>
|
|
430
|
+
</template>
|
|
431
|
+
|
|
432
|
+
<div class="sidebar-bottom">
|
|
433
|
+
<WorkspacePickerMenu />
|
|
434
|
+
<component
|
|
435
|
+
:is="extensions.regions['sidebar-footer']"
|
|
436
|
+
v-if="extensions.regions['sidebar-footer']"
|
|
437
|
+
:actions="extensionActions"
|
|
438
|
+
/>
|
|
439
|
+
<component
|
|
440
|
+
:is="extensions.regions['local-menu-login']"
|
|
441
|
+
v-if="extensions.regions['local-menu-login']"
|
|
442
|
+
:actions="extensionActions"
|
|
443
|
+
/>
|
|
444
|
+
<SidebarUpdateButton
|
|
445
|
+
:enabled="native && !mobile && !isAuxiliaryWindow"
|
|
446
|
+
:state="updates.state"
|
|
447
|
+
@download="updates.download()"
|
|
448
|
+
@install="updates.install()"
|
|
449
|
+
>
|
|
450
|
+
<HelpLauncher
|
|
451
|
+
:context="helpContext"
|
|
452
|
+
:availability="helpAvailability"
|
|
453
|
+
:available="sidebar && !isAuxiliaryWindow"
|
|
454
|
+
:blocked="helpBlocked"
|
|
455
|
+
:scope="`${navigationContext}:${workspace?.id ?? 'home'}:${activeId}`"
|
|
456
|
+
:documentation-base-url="documentationBaseUrl"
|
|
457
|
+
:native="native"
|
|
458
|
+
@open="
|
|
459
|
+
workspaceMenu = false;
|
|
460
|
+
menu = false;
|
|
461
|
+
"
|
|
462
|
+
@settings="openSettings"
|
|
463
|
+
@documentation="openExternalUrl($event).catch(store.report)"
|
|
464
|
+
/>
|
|
465
|
+
</SidebarUpdateButton>
|
|
466
|
+
</div>
|
|
467
|
+
|
|
468
|
+
<div
|
|
469
|
+
v-if="!compactPanes && !switchingWorkspace"
|
|
470
|
+
class="sidebar-resize-handle"
|
|
471
|
+
role="separator"
|
|
472
|
+
:aria-label="t('调整侧栏宽度')"
|
|
473
|
+
:data-tooltip="t('拖动调宽,向左拖到底收起')"
|
|
474
|
+
:data-tooltip-shortcut="shortcuts.toggleSidebar"
|
|
475
|
+
data-tooltip-anchor="pointer"
|
|
476
|
+
data-tooltip-delay="700"
|
|
477
|
+
aria-orientation="vertical"
|
|
478
|
+
:aria-valuenow="sidebarWidth ?? defaultSidebarWidth()"
|
|
479
|
+
:aria-valuemin="SIDEBAR_MIN_WIDTH"
|
|
480
|
+
:aria-valuemax="sidebarWidthLimit()"
|
|
481
|
+
tabindex="0"
|
|
482
|
+
@pointerdown="startSidebarResize"
|
|
483
|
+
@keydown="resizeSidebarWithKeyboard"
|
|
484
|
+
/>
|
|
485
|
+
</WorkspaceSidebar>
|
|
486
|
+
</template>
|
|
@@ -7,11 +7,11 @@ import { vSurfaceMotion } from '@tano/editor/surface-motion';
|
|
|
7
7
|
import { t } from '../../i18n/i18n';
|
|
8
8
|
import LoadingSkeleton from './LoadingSkeleton.vue';
|
|
9
9
|
import { computed, nextTick, onBeforeUnmount, onMounted, ref, useId, watch, type Component } from 'vue';
|
|
10
|
-
import { Check, ChevronRight
|
|
10
|
+
import { Check, ChevronRight } from 'lucide-vue-next';
|
|
11
11
|
import WorkspaceIcon from '../../workspace/components/WorkspaceIcon.vue';
|
|
12
12
|
import ResourceIcon from '../../files/components/ResourceIcon.vue';
|
|
13
13
|
import { indexFolderHomes, type FolderHomeFileName } from '../../files/folder-home';
|
|
14
|
-
import { basename, isMarkdown, isDataTableFilePath, isWorkspaceInternalPath, parentPath, type FileEntry
|
|
14
|
+
import { basename, isMarkdown, isDataTableFilePath, isWorkspaceInternalPath, parentPath, type FileEntry } from '@tano/protocol';
|
|
15
15
|
import { butterflyPerchDirective, useButterflyController, type ButterflyPerch } from '../../assistant/butterfly-vue';
|
|
16
16
|
import DocumentFileIcon from '../../documents/components/DocumentFileIcon.vue';
|
|
17
17
|
|
|
@@ -30,7 +30,6 @@ const props = defineProps<{
|
|
|
30
30
|
loadDocumentIcon?: (file: FileEntry, signal: AbortSignal) => Promise<string>;
|
|
31
31
|
path?: string;
|
|
32
32
|
directory?: boolean;
|
|
33
|
-
workspaceView?: WorkspaceViewDefinition;
|
|
34
33
|
pages?: { id: string; label: string; icon?: Component; current?: boolean; disabled?: boolean }[];
|
|
35
34
|
demoLabel?: string | null;
|
|
36
35
|
readOnly?: boolean;
|
|
@@ -47,13 +46,13 @@ const position = ref({ left: '0px', top: '0px' });
|
|
|
47
46
|
let trigger: HTMLButtonElement | undefined;
|
|
48
47
|
const currentFile = computed(() => props.entries.find(entry => entry.kind === 'file' && entry.path === props.path));
|
|
49
48
|
const homes = computed(() => indexFolderHomes(props.entries, props.folderHomeFileName));
|
|
50
|
-
const logicalPath = computed(() => props.
|
|
49
|
+
const logicalPath = computed(() => props.path ?? '');
|
|
51
50
|
const parts = computed(() => {
|
|
52
51
|
const names = logicalPath.value.split('/').filter(Boolean);
|
|
53
|
-
if (!props.directory &&
|
|
52
|
+
if (!props.directory && props.path && homes.value.get(parentPath(props.path))?.path === props.path) names.pop();
|
|
54
53
|
return names.map((name, index, all) => {
|
|
55
54
|
const path = all.slice(0, index + 1).join('/');
|
|
56
|
-
return { name, path, current:
|
|
55
|
+
return { name, path, current: index === all.length - 1, directory: !!props.directory || index < all.length - 1 || homes.value.has(path), home: homes.value.get(path) };
|
|
57
56
|
});
|
|
58
57
|
});
|
|
59
58
|
function activatePart(part: typeof parts.value[number]) {
|
|
@@ -155,7 +154,7 @@ function outside(event: Event) {
|
|
|
155
154
|
function onScroll(event: Event) {
|
|
156
155
|
if (!menu.value?.contains(event.target as Node)) placeMenu();
|
|
157
156
|
}
|
|
158
|
-
watch(() => [props.workspaceId, props.path,
|
|
157
|
+
watch(() => [props.workspaceId, props.path, logicalPath.value], () => close());
|
|
159
158
|
watch(children, async () => {
|
|
160
159
|
if (!opened.value) return;
|
|
161
160
|
if (folder.value && !props.entries.some(entry => entry.kind === 'directory' && entry.path === folder.value)) {
|
|
@@ -238,13 +237,6 @@ onBeforeUnmount(() => {
|
|
|
238
237
|
<ChevronRight :size="12" aria-hidden="true" />
|
|
239
238
|
</button>
|
|
240
239
|
</template>
|
|
241
|
-
<template v-if="workspaceView">
|
|
242
|
-
<ChevronRight v-if="!parts.length && pages?.length" :size="12" class="breadcrumb-separator" aria-hidden="true" />
|
|
243
|
-
<span class="breadcrumb-trigger breadcrumb-current" aria-current="page" :title="workspaceView.name" v-butterfly-perch="perch">
|
|
244
|
-
<component :is="workspaceView.database || workspaceView.objectDatabase ? Database : Table2" :size="14" aria-hidden="true" />
|
|
245
|
-
<span>{{ workspaceView.name }}</span>
|
|
246
|
-
</span>
|
|
247
|
-
</template>
|
|
248
240
|
<slot name="status" />
|
|
249
241
|
</nav>
|
|
250
242
|
<Teleport :to="document.body">
|
|
@@ -9,18 +9,23 @@ import { useWorkspaceStore } from '../../stores/workspace';
|
|
|
9
9
|
import { useAssistantStore } from '../../assistant/store';
|
|
10
10
|
import { computed, nextTick, onBeforeUnmount, onMounted, ref, useId, watch } from 'vue';
|
|
11
11
|
import PluginIcon from '../../plugins/components/PluginIcon.vue';
|
|
12
|
+
import { applyOverlayToWorkspaceViews } from '../../plugins/overlay-mapping';
|
|
12
13
|
import { Check, Ellipsis, FolderOpen, CalendarDays, Bot, Puzzle } from 'lucide-vue-next';
|
|
13
14
|
const store = useWorkspaceStore();
|
|
14
15
|
const assistant = useAssistantStore();
|
|
15
16
|
const props = defineProps<{ active: boolean; modelValue: string }>();
|
|
16
17
|
const emit = defineEmits<{ open: []; 'update:modelValue': [value: string] }>();
|
|
17
|
-
const views = computed(() =>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
const views = computed(() => {
|
|
19
|
+
const base = [
|
|
20
|
+
{ id: 'repository', label: t('文件'), icon: FolderOpen },
|
|
21
|
+
...(store.workspaceSettings.showPlan ? [{ id: 'events', label: t('事件与任务'), icon: CalendarDays }] : []),
|
|
22
|
+
...(assistant.available ? [{ id: 'assistant', label: t('助手'), icon: Bot }] : []),
|
|
23
|
+
...(store.workspaceSettings.showPlugins ? [{ id: 'plugin-views', label: t('插件'), icon: Puzzle }] : []),
|
|
24
|
+
...store.pluginViews.filter(view => view.location === 'sidebar').map(view => ({ id: `plugin-sidebar:${view.key}`, label: view.label, icon: PluginIcon, pluginId: view.pluginId })),
|
|
25
|
+
];
|
|
26
|
+
const snapshot = store.overlaySnapshot;
|
|
27
|
+
return applyOverlayToWorkspaceViews(base, snapshot?.hiddenSidebarItems, snapshot?.sidebarOrder);
|
|
28
|
+
});
|
|
24
29
|
type View = (typeof views.value)[number];
|
|
25
30
|
// Views are shown as one row of icon tabs. Plugin sidebars can add many entries, so anything past the
|
|
26
31
|
// row's capacity moves into a trailing "more" menu instead of wrapping or scrolling the sidebar header.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { ASSISTANT_TAB_ID } from '../assistant/navigation';
|
|
2
|
+
import { isTableTab } from '../data-tables/data-tables';
|
|
3
|
+
import { GRAPH_TAB_ID } from '../documents/document-graph';
|
|
4
|
+
import { MAIL_TAB_ID } from '../mail/types';
|
|
5
|
+
import { CALENDAR_TAB_ID } from '../plans/calendar';
|
|
6
|
+
import { PLUGINS_TAB_ID } from '../plugins/workspace-plugins';
|
|
7
|
+
import { SETTINGS_TAB_ID } from '../settings/settings-tab';
|
|
8
|
+
import type { DocumentTab, OpenDocument } from '../stores/workspace-types';
|
|
9
|
+
|
|
10
|
+
export type PaneViewKind =
|
|
11
|
+
| 'graph'
|
|
12
|
+
| 'table'
|
|
13
|
+
| 'directory'
|
|
14
|
+
| 'calendar'
|
|
15
|
+
| 'assistant'
|
|
16
|
+
| 'extension'
|
|
17
|
+
| 'settings'
|
|
18
|
+
| 'mail'
|
|
19
|
+
| 'plugin-detail'
|
|
20
|
+
| 'plugin-view'
|
|
21
|
+
| 'plugins'
|
|
22
|
+
| 'document'
|
|
23
|
+
| 'attachment'
|
|
24
|
+
| 'empty';
|
|
25
|
+
|
|
26
|
+
export interface PaneViewMatchContext {
|
|
27
|
+
activeId: string;
|
|
28
|
+
hasWorkspace: boolean;
|
|
29
|
+
mailEnabled: boolean;
|
|
30
|
+
extensionViewIds: readonly string[];
|
|
31
|
+
tab?: DocumentTab;
|
|
32
|
+
document?: OpenDocument;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Declaratively resolves the active view kind for a workbench pane, replacing
|
|
37
|
+
* ad-hoc negative `v-else-if` chains across pane shells.
|
|
38
|
+
*/
|
|
39
|
+
export function resolvePaneViewKind(ctx: PaneViewMatchContext): PaneViewKind {
|
|
40
|
+
const { activeId, hasWorkspace, mailEnabled, extensionViewIds, tab, document } = ctx;
|
|
41
|
+
if (hasWorkspace && activeId === GRAPH_TAB_ID) return 'graph';
|
|
42
|
+
if (hasWorkspace && isTableTab(activeId)) return 'table';
|
|
43
|
+
if (hasWorkspace && tab?.directory) return 'directory';
|
|
44
|
+
if (hasWorkspace && activeId === CALENDAR_TAB_ID) return 'calendar';
|
|
45
|
+
if (activeId === ASSISTANT_TAB_ID) return 'assistant';
|
|
46
|
+
if (extensionViewIds.includes(activeId)) return 'extension';
|
|
47
|
+
if (activeId === SETTINGS_TAB_ID) return 'settings';
|
|
48
|
+
if (mailEnabled && activeId === MAIL_TAB_ID) return 'mail';
|
|
49
|
+
if (tab?.pluginDetail) return 'plugin-detail';
|
|
50
|
+
if (activeId.startsWith('plugin:')) return 'plugin-view';
|
|
51
|
+
if (hasWorkspace && activeId === PLUGINS_TAB_ID) return 'plugins';
|
|
52
|
+
if (document) return 'document';
|
|
53
|
+
if (hasWorkspace && activeId.startsWith('attachment:')) return 'attachment';
|
|
54
|
+
return 'empty';
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function isEmptyPaneFallback(ctx: PaneViewMatchContext & { startupPending: boolean }): boolean {
|
|
58
|
+
if (!ctx.hasWorkspace && !ctx.startupPending) return false;
|
|
59
|
+
if (ctx.activeId === GRAPH_TAB_ID) return false;
|
|
60
|
+
if (ctx.activeId === PLUGINS_TAB_ID) return false;
|
|
61
|
+
if (ctx.activeId === CALENDAR_TAB_ID) return false;
|
|
62
|
+
if (ctx.activeId === SETTINGS_TAB_ID) return false;
|
|
63
|
+
if (ctx.mailEnabled && ctx.activeId === MAIL_TAB_ID) return false;
|
|
64
|
+
if (isTableTab(ctx.activeId)) return false;
|
|
65
|
+
if (ctx.activeId.startsWith('plugin:')) return false;
|
|
66
|
+
if (ctx.tab?.directory || ctx.tab?.pluginView) return false;
|
|
67
|
+
if (ctx.extensionViewIds.includes(ctx.activeId)) return false;
|
|
68
|
+
return true;
|
|
69
|
+
}
|