@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
package/src/App.vue
CHANGED
|
@@ -1,176 +1,64 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
ArrowDownToLine,
|
|
5
|
-
Blocks,
|
|
6
|
-
Bot,
|
|
7
|
-
CalendarDays,
|
|
8
|
-
Check,
|
|
9
|
-
ChevronDown,
|
|
10
|
-
ChevronUp,
|
|
11
|
-
CircleHelp,
|
|
12
|
-
Files,
|
|
13
|
-
FolderOpen,
|
|
14
|
-
FolderPlus,
|
|
15
|
-
GitFork,
|
|
16
|
-
House,
|
|
17
|
-
PanelLeftOpen,
|
|
18
|
-
RefreshCw,
|
|
19
|
-
Search,
|
|
20
|
-
SquarePen,
|
|
21
|
-
Trash2,
|
|
22
|
-
} from 'lucide-vue-next';
|
|
23
|
-
import ShortcutHint from '@tano/editor/shortcut-hint';
|
|
24
|
-
import { vSurfaceMotion } from '@tano/editor/surface-motion';
|
|
25
|
-
import AppMenu from './shell/components/AppMenu.vue';
|
|
26
|
-
import AppTooltip from './shell/components/AppTooltip.vue';
|
|
2
|
+
import { ref, toRefs } from 'vue';
|
|
3
|
+
import { PanelLeftOpen } from 'lucide-vue-next';
|
|
27
4
|
import AssistantButterflyLayer from './assistant/components/AssistantButterflyLayer.vue';
|
|
28
|
-
import ButtonVisibilityGroup from './shell/components/ButtonVisibilityGroup.vue';
|
|
29
|
-
import DesktopTabs from './tabs/components/DesktopTabs.vue';
|
|
30
5
|
import FileMetadataPanel from './files/components/FileMetadataPanel.vue';
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import OpenWorkspaceIcon from './shell/components/OpenWorkspaceIcon.vue';
|
|
34
|
-
import PluginExplorer from './plugins/components/PluginExplorer.vue';
|
|
35
|
-
import PluginMenu from './plugins/components/PluginMenu.vue';
|
|
36
|
-
import PluginView from './plugins/components/PluginView.vue';
|
|
6
|
+
import { t } from './i18n/i18n';
|
|
7
|
+
import { MAIL_TAB_ID } from './mail/types';
|
|
37
8
|
import ReferenceGraphPopover from './objects/components/ReferenceGraphPopover.vue';
|
|
38
|
-
import
|
|
39
|
-
import
|
|
9
|
+
import { CALENDAR_TAB_ID } from './plans/calendar';
|
|
10
|
+
import { mobile } from './platform/platform';
|
|
11
|
+
import PluginStatusBar from './plugins/components/PluginStatusBar.vue';
|
|
12
|
+
import WorkbenchSettings from './settings/components/WorkbenchSettings.vue';
|
|
13
|
+
import { SETTINGS_TAB_ID } from './settings/settings-tab';
|
|
14
|
+
import AppMenu from './shell/components/AppMenu.vue';
|
|
15
|
+
import AppTooltip from './shell/components/AppTooltip.vue';
|
|
40
16
|
import WorkbenchContextMenus from './shell/components/WorkbenchContextMenus.vue';
|
|
41
17
|
import WorkbenchModals from './shell/components/WorkbenchModals.vue';
|
|
42
18
|
import WorkbenchPanes from './shell/components/WorkbenchPanes.vue';
|
|
43
|
-
import
|
|
44
|
-
import WorkspaceIcon from './workspace/components/WorkspaceIcon.vue';
|
|
45
|
-
import WorkspaceMenuLayout from './shell/components/WorkspaceMenuLayout.vue';
|
|
19
|
+
import WorkbenchSidebar from './shell/components/WorkbenchSidebar.vue';
|
|
46
20
|
import WorkspacePanes from './shell/components/WorkspacePanes.vue';
|
|
47
|
-
import
|
|
48
|
-
import WorkspaceViewSwitcher from './shell/components/WorkspaceViewSwitcher.vue';
|
|
49
|
-
import { vScrollFade } from './shell/scroll-fade';
|
|
21
|
+
import { runWorkbenchCommandOrPlugin } from './shell/use-workbench-commands';
|
|
50
22
|
import { useWorkbench, type WorkbenchProps } from './shell/use-workbench';
|
|
51
|
-
import AuxiliaryWindows from './windows/AuxiliaryWindows.vue';
|
|
52
|
-
import WindowScope from './windows/WindowScope.vue';
|
|
53
23
|
import {
|
|
54
24
|
CalendarView,
|
|
55
25
|
InlineAssistantInput,
|
|
56
|
-
|
|
57
|
-
SidebarPlan,
|
|
26
|
+
MailWorkspaceView,
|
|
58
27
|
} from './shell/workbench-async-components';
|
|
59
|
-
import {
|
|
28
|
+
import { provideWorkbenchContexts } from './shell/workbench-context';
|
|
29
|
+
import DesktopTabs from './tabs/components/DesktopTabs.vue';
|
|
30
|
+
import AuxiliaryWindows from './windows/AuxiliaryWindows.vue';
|
|
31
|
+
import WindowScope from './windows/WindowScope.vue';
|
|
60
32
|
|
|
61
33
|
const props = defineProps<WorkbenchProps>();
|
|
62
34
|
const emit = defineEmits<{ ready: [] }>();
|
|
63
|
-
const
|
|
64
|
-
|
|
35
|
+
const { prefs, shell, documents, treeMenus, modals } = provideWorkbenchContexts(
|
|
36
|
+
useWorkbench(props, emit),
|
|
37
|
+
);
|
|
38
|
+
|
|
65
39
|
const {
|
|
66
|
-
activeWindow,
|
|
67
40
|
native,
|
|
68
|
-
|
|
41
|
+
activeWindow,
|
|
69
42
|
workspace,
|
|
70
43
|
compactPanes,
|
|
71
44
|
isAuxiliaryWindow,
|
|
72
45
|
sidebar,
|
|
73
|
-
t,
|
|
74
|
-
shortcuts,
|
|
75
46
|
toggleSidebar,
|
|
76
47
|
sessionPending,
|
|
77
|
-
tabFileDrag,
|
|
78
|
-
fileDragEnd,
|
|
79
48
|
store,
|
|
80
49
|
createNewDocument,
|
|
81
50
|
detachTab,
|
|
82
|
-
resizingSidebar,
|
|
83
|
-
moveSidebarResize,
|
|
84
|
-
finishSidebarResize,
|
|
85
51
|
butterfly,
|
|
86
|
-
fileMetadataTarget,
|
|
87
52
|
switchingWorkspace,
|
|
88
53
|
mainColumn,
|
|
89
|
-
returnHome,
|
|
90
|
-
sidebarHeaderItems,
|
|
91
|
-
closeButtonVisibilityMenus,
|
|
92
54
|
extensionViews,
|
|
93
55
|
viewActions,
|
|
94
|
-
|
|
95
|
-
sidebarNavigationItems,
|
|
96
|
-
navigationModule,
|
|
97
|
-
selectModule,
|
|
98
|
-
sidebarView,
|
|
99
|
-
draggedEntry,
|
|
100
|
-
dropFolder,
|
|
101
|
-
dropPlaceholders,
|
|
102
|
-
fileDragOver,
|
|
103
|
-
fileDragLeave,
|
|
104
|
-
fileDrop,
|
|
105
|
-
workspaceView,
|
|
106
|
-
selectWorkspaceView,
|
|
107
|
-
workspaceMenu,
|
|
108
|
-
modal,
|
|
109
|
-
settingsPanel,
|
|
110
|
-
SETTINGS_TAB_ID,
|
|
111
|
-
repositoryActionItems,
|
|
112
|
-
showModal,
|
|
113
|
-
activeId,
|
|
114
|
-
GRAPH_TAB_ID,
|
|
115
|
-
busy,
|
|
116
|
-
openDirectoryContextMenu,
|
|
56
|
+
mailEnabled,
|
|
117
57
|
startupPending,
|
|
118
58
|
filesPending,
|
|
119
|
-
treeFiles,
|
|
120
|
-
revealedHomeId,
|
|
121
|
-
treeDocumentIcons,
|
|
122
|
-
loadTreeDocumentIcon,
|
|
123
|
-
selectedEntryIds,
|
|
124
|
-
fileContextMenu,
|
|
125
|
-
canDragEntry,
|
|
126
|
-
treeRename,
|
|
127
|
-
renameTreeEntry,
|
|
128
|
-
openTreeEntry,
|
|
129
|
-
selectFileTreeEntry,
|
|
130
|
-
openFileContextMenu,
|
|
131
|
-
fileDragStart,
|
|
132
|
-
finishTreeRename,
|
|
133
|
-
noteCount,
|
|
134
|
-
showObjects,
|
|
135
|
-
sidebarCalendarDate,
|
|
136
|
-
openCalendar,
|
|
137
|
-
showPlanEvent,
|
|
138
|
-
shortcutHint,
|
|
139
|
-
tabsEnabled,
|
|
140
|
-
toggleWorkspaceMenu,
|
|
141
|
-
workspaceDropdownContextMenu,
|
|
142
|
-
selectContext,
|
|
143
|
-
extensions,
|
|
144
|
-
extensionActions,
|
|
145
|
-
commandPaletteOpened,
|
|
146
|
-
openSystemSync,
|
|
147
|
-
openImport,
|
|
148
|
-
openTemplateLibrary,
|
|
149
|
-
openSettings,
|
|
150
|
-
updates,
|
|
151
|
-
recyclePanel,
|
|
152
|
-
agentPanel,
|
|
153
|
-
createNewWorkspace,
|
|
154
|
-
openWorkspaceEntryContextMenu,
|
|
155
|
-
helpContext,
|
|
156
|
-
helpAvailability,
|
|
157
|
-
helpBlocked,
|
|
158
|
-
documentationBaseUrl,
|
|
159
|
-
menu,
|
|
160
|
-
openExternalUrl,
|
|
161
|
-
sidebarWidth,
|
|
162
|
-
defaultSidebarWidth,
|
|
163
|
-
SIDEBAR_MIN_WIDTH,
|
|
164
|
-
sidebarWidthLimit,
|
|
165
|
-
startSidebarResize,
|
|
166
|
-
resizeSidebarWithKeyboard,
|
|
167
|
-
referenceGraphTarget,
|
|
168
|
-
referenceGraphOpened,
|
|
169
|
-
referenceGraphAnchor,
|
|
170
59
|
openReference,
|
|
171
60
|
assistantTab,
|
|
172
61
|
homeContent,
|
|
173
|
-
CALENDAR_TAB_ID,
|
|
174
62
|
calendarDate,
|
|
175
63
|
calendarMode,
|
|
176
64
|
plans,
|
|
@@ -178,6 +66,7 @@ const {
|
|
|
178
66
|
selectCalendarMode,
|
|
179
67
|
showCalendarDay,
|
|
180
68
|
showCalendarMonth,
|
|
69
|
+
showPlanEvent,
|
|
181
70
|
homeExtension,
|
|
182
71
|
inlineAssistant,
|
|
183
72
|
inlineAssistantPrompt,
|
|
@@ -190,9 +79,21 @@ const {
|
|
|
190
79
|
undoInlineAssistant,
|
|
191
80
|
closeInlineAssistant,
|
|
192
81
|
workbenchCommands,
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
82
|
+
} = toRefs(shell);
|
|
83
|
+
|
|
84
|
+
const {
|
|
85
|
+
shortcuts,
|
|
86
|
+
shortcutHint,
|
|
87
|
+
tabsEnabled,
|
|
88
|
+
resizingSidebar,
|
|
89
|
+
moveSidebarResize,
|
|
90
|
+
finishSidebarResize,
|
|
91
|
+
} = toRefs(prefs);
|
|
92
|
+
|
|
93
|
+
const { referenceGraphTarget, referenceGraphOpened, referenceGraphAnchor } = toRefs(documents);
|
|
94
|
+
const { tabFileDrag, fileDragEnd, fileMetadataTarget } = toRefs(treeMenus);
|
|
95
|
+
const { commandPaletteOpened } = toRefs(modals);
|
|
96
|
+
|
|
196
97
|
const appMenuOpen = ref(false);
|
|
197
98
|
const brandButton = ref<HTMLElement | null>(null);
|
|
198
99
|
</script>
|
|
@@ -241,10 +142,11 @@ const brandButton = ref<HTMLElement | null>(null);
|
|
|
241
142
|
>
|
|
242
143
|
<!-- Liquid glass draws its rim refraction and highlights here, under everything (liquid-glass.ts). -->
|
|
243
144
|
<div class="liquid-backdrop" aria-hidden="true"></div>
|
|
244
|
-
<Teleport :to="activeWindow.overlays"
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
145
|
+
<Teleport :to="activeWindow.overlays">
|
|
146
|
+
<WindowScope :key="activeWindow.id" :context="activeWindow">
|
|
147
|
+
<AssistantButterflyLayer :controller="butterfly" />
|
|
148
|
+
</WindowScope>
|
|
149
|
+
</Teleport>
|
|
248
150
|
<Teleport :to="activeWindow.overlays">
|
|
249
151
|
<WindowScope :key="activeWindow.id" :context="activeWindow">
|
|
250
152
|
<AppMenu
|
|
@@ -252,22 +154,19 @@ const brandButton = ref<HTMLElement | null>(null);
|
|
|
252
154
|
:commands="workbenchCommands"
|
|
253
155
|
:anchor="brandButton"
|
|
254
156
|
:palette-hint="shortcutHint('commandPalette')"
|
|
255
|
-
:open-palette="
|
|
256
|
-
() => {
|
|
257
|
-
commandPaletteOpened = true;
|
|
258
|
-
}
|
|
259
|
-
"
|
|
157
|
+
:open-palette="() => { commandPaletteOpened = true; }"
|
|
260
158
|
:close-window="activeWindow.native ? () => activeWindow.native!.close() : undefined"
|
|
261
159
|
@close="appMenuOpen = false"
|
|
262
160
|
/>
|
|
263
161
|
</WindowScope>
|
|
264
162
|
</Teleport>
|
|
265
|
-
<Teleport :to="activeWindow.overlays"
|
|
266
|
-
|
|
163
|
+
<Teleport :to="activeWindow.overlays">
|
|
164
|
+
<FileMetadataPanel
|
|
267
165
|
v-if="fileMetadataTarget && !switchingWorkspace"
|
|
268
166
|
v-bind="fileMetadataTarget"
|
|
269
167
|
@close="fileMetadataTarget = null"
|
|
270
|
-
|
|
168
|
+
/>
|
|
169
|
+
</Teleport>
|
|
271
170
|
<Transition name="sidebar-dismiss">
|
|
272
171
|
<button
|
|
273
172
|
v-if="sidebar && !isAuxiliaryWindow && compactPanes"
|
|
@@ -276,597 +175,12 @@ const brandButton = ref<HTMLElement | null>(null);
|
|
|
276
175
|
@click="toggleSidebar"
|
|
277
176
|
/>
|
|
278
177
|
</Transition>
|
|
279
|
-
<WorkspaceSidebar
|
|
280
|
-
v-if="!isAuxiliaryWindow"
|
|
281
|
-
:open="sidebar"
|
|
282
|
-
:compact="compactPanes"
|
|
283
|
-
:content-element="mainColumn"
|
|
284
|
-
@dismiss="sidebar = false"
|
|
285
|
-
>
|
|
286
|
-
<div class="sidebar-header">
|
|
287
|
-
<div class="sidebar-brand-slot">
|
|
288
|
-
<button
|
|
289
|
-
v-if="native && !mobile"
|
|
290
|
-
ref="brandButton"
|
|
291
|
-
type="button"
|
|
292
|
-
class="brand brand-menu-button"
|
|
293
|
-
aria-haspopup="menu"
|
|
294
|
-
:aria-expanded="appMenuOpen"
|
|
295
|
-
:aria-label="t('同页')"
|
|
296
|
-
@click="appMenuOpen = !appMenuOpen"
|
|
297
|
-
>
|
|
298
|
-
<img src="./assets/tano-logo.svg" alt="" />
|
|
299
|
-
</button>
|
|
300
|
-
<component
|
|
301
|
-
:is="native ? 'div' : 'a'"
|
|
302
|
-
v-else
|
|
303
|
-
class="brand"
|
|
304
|
-
:href="native ? undefined : '/'"
|
|
305
|
-
:aria-label="native ? undefined : t('返回同页首页')"
|
|
306
|
-
@click="returnHome"
|
|
307
|
-
>
|
|
308
|
-
<img src="./assets/tano-logo.svg" alt="" />
|
|
309
|
-
</component>
|
|
310
|
-
</div>
|
|
311
|
-
<ButtonVisibilityGroup
|
|
312
|
-
v-slot="{ isVisible }"
|
|
313
|
-
:items="sidebarHeaderItems"
|
|
314
|
-
:active="sidebar"
|
|
315
|
-
preference-key="tano.preference.sidebarHiddenHeaderActions"
|
|
316
|
-
group-class="sidebar-header-actions"
|
|
317
|
-
:label="t('侧栏顶部按钮')"
|
|
318
|
-
:menu-label="t('侧栏顶部按钮显示设置')"
|
|
319
|
-
@open="closeButtonVisibilityMenus"
|
|
320
|
-
>
|
|
321
|
-
<template v-if="navigationModule === 'workspace'">
|
|
322
|
-
<button
|
|
323
|
-
v-if="isVisible('search')"
|
|
324
|
-
type="button"
|
|
325
|
-
class="icon-button"
|
|
326
|
-
:aria-label="t('查找文档')"
|
|
327
|
-
:data-tooltip="t('查找文档')"
|
|
328
|
-
:data-tooltip-shortcut="shortcuts.findDocument"
|
|
329
|
-
:disabled="!workspace"
|
|
330
|
-
@click="showModal('search')"
|
|
331
|
-
>
|
|
332
|
-
<Search :size="16" :stroke-width="1.6" />
|
|
333
|
-
</button>
|
|
334
|
-
<button
|
|
335
|
-
v-if="store.workspaceSettings.showGraph && isVisible('graph')"
|
|
336
|
-
type="button"
|
|
337
|
-
class="icon-button"
|
|
338
|
-
:aria-label="t('打开关系图谱')"
|
|
339
|
-
:data-tooltip="t('关系图谱')"
|
|
340
|
-
:aria-pressed="activeId === GRAPH_TAB_ID"
|
|
341
|
-
:disabled="!workspace"
|
|
342
|
-
@click="store.openGraphTab()"
|
|
343
|
-
>
|
|
344
|
-
<GitFork :size="16" :stroke-width="1.6" />
|
|
345
|
-
</button>
|
|
346
|
-
</template>
|
|
347
|
-
<template v-for="view in extensionViews" :key="`header-${view.id}`">
|
|
348
|
-
<component
|
|
349
|
-
:is="view.header"
|
|
350
|
-
v-if="
|
|
351
|
-
(view.scope === 'account' || store.workspaceSettings.showCollaborationViews) &&
|
|
352
|
-
view.header &&
|
|
353
|
-
isVisible(view.id)
|
|
354
|
-
"
|
|
355
|
-
:actions="viewActions[view.id]"
|
|
356
|
-
/>
|
|
357
|
-
</template>
|
|
358
|
-
</ButtonVisibilityGroup>
|
|
359
|
-
</div>
|
|
360
|
-
<SidebarNavigation
|
|
361
|
-
v-if="navigationContext === 'home'"
|
|
362
|
-
v-slot="{ isVisible }"
|
|
363
|
-
:items="sidebarNavigationItems"
|
|
364
|
-
:active="sidebar"
|
|
365
|
-
@open="closeButtonVisibilityMenus"
|
|
366
|
-
>
|
|
367
|
-
<button
|
|
368
|
-
type="button"
|
|
369
|
-
class="sidebar-navigation-button"
|
|
370
|
-
:aria-label="t('计划')"
|
|
371
|
-
:data-tooltip="t('计划')"
|
|
372
|
-
aria-controls="sidebar-plan-panel"
|
|
373
|
-
:aria-pressed="navigationModule === 'plan'"
|
|
374
|
-
@click="selectModule('plan')"
|
|
375
|
-
>
|
|
376
|
-
<CalendarDays :size="18" :stroke-width="1.6" aria-hidden="true" />
|
|
377
|
-
<span :aria-hidden="navigationModule !== 'plan'"
|
|
378
|
-
><span>{{ t('计划') }}</span></span
|
|
379
|
-
>
|
|
380
|
-
</button>
|
|
381
|
-
<template v-for="view in extensionViews" :key="view.id">
|
|
382
|
-
<button
|
|
383
|
-
v-if="
|
|
384
|
-
store.workspaceSettings.showCollaborationViews && view.sidebar && isVisible(view.id)
|
|
385
|
-
"
|
|
386
|
-
type="button"
|
|
387
|
-
class="sidebar-navigation-button"
|
|
388
|
-
:aria-label="view.label"
|
|
389
|
-
:data-tooltip="view.label"
|
|
390
|
-
:aria-controls="`sidebar-${view.id}`"
|
|
391
|
-
:aria-pressed="sidebarView === view.id"
|
|
392
|
-
@click="selectModule(view.id)"
|
|
393
|
-
>
|
|
394
|
-
<component :is="view.icon" :size="18" :stroke-width="1.6" aria-hidden="true" />
|
|
395
|
-
<span :aria-hidden="sidebarView !== view.id"
|
|
396
|
-
><span>{{ view.label }}</span></span
|
|
397
|
-
>
|
|
398
|
-
</button>
|
|
399
|
-
</template>
|
|
400
|
-
</SidebarNavigation>
|
|
401
|
-
<div v-show="navigationModule === 'workspace'" class="sidebar-view-header">
|
|
402
|
-
<WorkspaceViewSwitcher
|
|
403
|
-
:model-value="workspaceView"
|
|
404
|
-
@update:model-value="selectWorkspaceView"
|
|
405
|
-
:active="sidebar && !workspaceMenu && !modal && !settingsPanel"
|
|
406
|
-
@open="closeButtonVisibilityMenus"
|
|
407
|
-
/>
|
|
408
|
-
</div>
|
|
409
|
-
<!-- Workspace root row: names the tree it heads, accepts root drops and owns file-tree actions. -->
|
|
410
|
-
<div
|
|
411
|
-
v-show="navigationModule === 'workspace' && sidebarView === 'repository'"
|
|
412
|
-
class="section-label workspace-root-header"
|
|
413
|
-
:class="{ 'drop-target': draggedEntry && dropFolder === '' }"
|
|
414
|
-
@dragover="fileDragOver('', $event)"
|
|
415
|
-
@dragleave="fileDragLeave('', $event)"
|
|
416
|
-
@drop="fileDrop('', $event)"
|
|
417
|
-
@contextmenu.self.prevent="openDirectoryContextMenu('', $event)"
|
|
418
|
-
>
|
|
419
|
-
<span
|
|
420
|
-
class="workspace-root-name"
|
|
421
|
-
:title="draggedEntry ? undefined : workspace?.name"
|
|
422
|
-
@contextmenu.prevent="openDirectoryContextMenu('', $event)"
|
|
423
|
-
>{{ draggedEntry ? t('放到工作区根目录') : (workspace?.name ?? '') }}</span
|
|
424
|
-
>
|
|
425
|
-
<ButtonVisibilityGroup
|
|
426
|
-
v-slot="{ isVisible }"
|
|
427
|
-
v-show="!draggedEntry"
|
|
428
|
-
:items="repositoryActionItems"
|
|
429
|
-
:active="sidebar && sidebarView === 'repository'"
|
|
430
|
-
preference-key="tano.preference.repositoryHiddenActions"
|
|
431
|
-
group-class="repository-actions"
|
|
432
|
-
:label="t('工作区按钮')"
|
|
433
|
-
:menu-label="t('工作区按钮显示设置')"
|
|
434
|
-
@open="closeButtonVisibilityMenus"
|
|
435
|
-
>
|
|
436
|
-
<button
|
|
437
|
-
v-if="isVisible('create')"
|
|
438
|
-
type="button"
|
|
439
|
-
class="icon-button"
|
|
440
|
-
:aria-label="t('新建文档')"
|
|
441
|
-
:data-tooltip="t('新建文档')"
|
|
442
|
-
:data-tooltip-shortcut="shortcuts.newDocument"
|
|
443
|
-
:disabled="!workspace || workspace.readOnly || busy"
|
|
444
|
-
@click="createNewDocument"
|
|
445
|
-
>
|
|
446
|
-
<SquarePen :size="15" :stroke-width="1.6" />
|
|
447
|
-
</button>
|
|
448
|
-
<button
|
|
449
|
-
v-if="isVisible('folder')"
|
|
450
|
-
type="button"
|
|
451
|
-
class="icon-button"
|
|
452
|
-
:aria-label="t('新建文件夹')"
|
|
453
|
-
:data-tooltip="t('新建文件夹')"
|
|
454
|
-
:disabled="!workspace || workspace.readOnly || busy"
|
|
455
|
-
@click="createNewEntry('folder')"
|
|
456
|
-
>
|
|
457
|
-
<FolderPlus :size="15" :stroke-width="1.6" />
|
|
458
|
-
</button>
|
|
459
|
-
</ButtonVisibilityGroup>
|
|
460
|
-
</div>
|
|
461
|
-
<PluginExplorer v-if="sidebarView === 'plugin-views'" />
|
|
462
|
-
<PluginView
|
|
463
|
-
v-else-if="sidebarView.startsWith('plugin-sidebar:')"
|
|
464
|
-
:view-key="sidebarView.slice(15)"
|
|
465
|
-
/>
|
|
466
|
-
<div
|
|
467
|
-
v-show="sidebarView === 'repository'"
|
|
468
|
-
id="sidebar-repository-panel"
|
|
469
|
-
class="sidebar-content"
|
|
470
|
-
>
|
|
471
|
-
<div
|
|
472
|
-
v-scroll-fade
|
|
473
|
-
class="tree-scroll"
|
|
474
|
-
:class="{ 'drop-root': draggedEntry && dropFolder === '' && !dropPlaceholders.length }"
|
|
475
|
-
@contextmenu.self.prevent="openDirectoryContextMenu('', $event)"
|
|
476
|
-
@dragover.self="fileDragOver('', $event)"
|
|
477
|
-
@dragleave.self="fileDragLeave('', $event)"
|
|
478
|
-
@drop.self="fileDrop('', $event)"
|
|
479
|
-
>
|
|
480
|
-
<FileTree
|
|
481
|
-
:ref="(el) => { context.fileTree = (el as InstanceType<typeof FileTree> | null) ?? undefined; }"
|
|
482
|
-
v-if="workspace || startupPending || filesPending"
|
|
483
|
-
:loading="filesPending"
|
|
484
|
-
:entries="treeFiles"
|
|
485
|
-
:folder-home-file-name="store.workspaceSettings.folderHomeFileName"
|
|
486
|
-
:revealed-home-id="revealedHomeId"
|
|
487
|
-
:document-icons="treeDocumentIcons"
|
|
488
|
-
:load-document-icon="loadTreeDocumentIcon"
|
|
489
|
-
:selected-ids="selectedEntryIds"
|
|
490
|
-
:context-selected="fileContextMenu?.file.id"
|
|
491
|
-
:dragged-id="draggedEntry?.file.id"
|
|
492
|
-
:drop-target="dropFolder"
|
|
493
|
-
:drop-preview="dropPlaceholders"
|
|
494
|
-
:can-drag="canDragEntry"
|
|
495
|
-
:renaming-id="treeRename?.fileId"
|
|
496
|
-
:rename-entry="renameTreeEntry"
|
|
497
|
-
@open="openTreeEntry"
|
|
498
|
-
@select="selectFileTreeEntry"
|
|
499
|
-
@prefetch="store.prefetchFile"
|
|
500
|
-
@context="openFileContextMenu"
|
|
501
|
-
@context-blank="openDirectoryContextMenu"
|
|
502
|
-
@drag-start="fileDragStart"
|
|
503
|
-
@drag-end="fileDragEnd"
|
|
504
|
-
@drag-over="fileDragOver"
|
|
505
|
-
@drag-leave="fileDragLeave"
|
|
506
|
-
@drop="fileDrop"
|
|
507
|
-
@rename-finished="finishTreeRename"
|
|
508
|
-
/>
|
|
509
|
-
<div
|
|
510
|
-
v-if="!filesPending && !noteCount"
|
|
511
|
-
class="tree-empty"
|
|
512
|
-
@contextmenu.prevent="openDirectoryContextMenu('', $event)"
|
|
513
|
-
>
|
|
514
|
-
{{ t('你的下一页,') }}<br />{{ t('从一个新文档开始。') }}
|
|
515
|
-
</div>
|
|
516
|
-
</div>
|
|
517
|
-
</div>
|
|
518
|
-
<SidebarAssistant
|
|
519
|
-
v-if="sidebarView === 'assistant'"
|
|
520
|
-
@open="compactPanes && (sidebar = false)"
|
|
521
|
-
/>
|
|
522
|
-
<SidebarPlan
|
|
523
|
-
v-show="sidebarView === 'plan' || sidebarView === 'events'"
|
|
524
|
-
:active="sidebar && (sidebarView === 'plan' || sidebarView === 'events')"
|
|
525
|
-
:workspace-only="navigationContext === 'workspace'"
|
|
526
|
-
id="sidebar-plan-panel"
|
|
527
|
-
:date="sidebarCalendarDate"
|
|
528
|
-
@select-date="openCalendar"
|
|
529
|
-
@select-event="showPlanEvent"
|
|
530
|
-
/>
|
|
531
|
-
<template v-for="view in extensionViews" :key="view.id">
|
|
532
|
-
<div
|
|
533
|
-
v-if="view.sidebar"
|
|
534
|
-
v-show="sidebarView === view.id"
|
|
535
|
-
:id="`sidebar-${view.id}`"
|
|
536
|
-
class="extension-sidebar"
|
|
537
|
-
>
|
|
538
|
-
<component :is="view.sidebar" :actions="viewActions[view.id]" />
|
|
539
|
-
</div>
|
|
540
|
-
</template>
|
|
541
|
-
<div class="sidebar-bottom">
|
|
542
|
-
<div class="workspace-picker-wrap">
|
|
543
|
-
<button
|
|
544
|
-
class="workspace-picker"
|
|
545
|
-
:aria-expanded="workspaceMenu"
|
|
546
|
-
aria-controls="workspace-menu"
|
|
547
|
-
:aria-label="
|
|
548
|
-
filesPending
|
|
549
|
-
? t('正在打开工作区…')
|
|
550
|
-
: t('切换上下文:{0}', [
|
|
551
|
-
navigationContext === 'home' ? t('主页') : (workspace?.name ?? t('选择工作区')),
|
|
552
|
-
])
|
|
553
|
-
"
|
|
554
|
-
:data-tooltip="
|
|
555
|
-
filesPending
|
|
556
|
-
? t('正在打开工作区…')
|
|
557
|
-
: navigationContext === 'home'
|
|
558
|
-
? t('主页')
|
|
559
|
-
: (workspace?.name ?? t('选择工作区'))
|
|
560
|
-
"
|
|
561
|
-
@click="toggleWorkspaceMenu"
|
|
562
|
-
@contextmenu.stop.prevent="toggleWorkspaceMenu"
|
|
563
|
-
>
|
|
564
|
-
<span class="workspace-avatar"
|
|
565
|
-
><House v-if="navigationContext === 'home'" :size="15" /><WorkspaceIcon
|
|
566
|
-
v-else
|
|
567
|
-
:icon="store.workspaceSettings.icon"
|
|
568
|
-
:mode="store.isDemo ? 'demo' : store.isWeb ? 'web' : 'local'"
|
|
569
|
-
:size="15"
|
|
570
|
-
/></span>
|
|
571
|
-
<span class="workspace-picker-text"
|
|
572
|
-
><span v-if="filesPending" class="tano-skeleton-bar" /><strong v-else>{{
|
|
573
|
-
navigationContext === 'home' ? t('主页') : (workspace?.name ?? t('选择工作区'))
|
|
574
|
-
}}</strong></span
|
|
575
|
-
>
|
|
576
|
-
<component :is="workspaceMenu ? ChevronUp : ChevronDown" :size="12" />
|
|
577
|
-
</button>
|
|
578
|
-
<div
|
|
579
|
-
v-surface-motion="'App:3'"
|
|
580
|
-
v-if="workspaceMenu"
|
|
581
|
-
id="workspace-menu"
|
|
582
|
-
class="dropdown compact-action-menu sidebar-popover workspace-dropdown"
|
|
583
|
-
@contextmenu.stop.prevent="workspaceDropdownContextMenu"
|
|
584
|
-
>
|
|
585
|
-
<button
|
|
586
|
-
class="context-menu-item"
|
|
587
|
-
type="button"
|
|
588
|
-
:aria-current="navigationContext === 'home' ? 'true' : undefined"
|
|
589
|
-
@click="selectContext('home')"
|
|
590
|
-
>
|
|
591
|
-
<House :size="16" /><span class="recent-name">{{ t('主页') }}</span
|
|
592
|
-
><Check v-if="navigationContext === 'home'" :size="15" />
|
|
593
|
-
</button>
|
|
594
|
-
<div class="menu-divider" />
|
|
595
|
-
<PluginMenu location="workspace" @selected="workspaceMenu = false" />
|
|
596
|
-
<component
|
|
597
|
-
:is="extensions.regions['workspace-menu-layout'] ?? WorkspaceMenuLayout"
|
|
598
|
-
:navigation-context="navigationContext"
|
|
599
|
-
@select-workspace="selectContext('workspace')"
|
|
600
|
-
:actions="extensionActions"
|
|
601
|
-
>
|
|
602
|
-
<template v-if="extensions.regions['workspace-settings']" #settings>
|
|
603
|
-
<component
|
|
604
|
-
:is="extensions.regions['workspace-settings']"
|
|
605
|
-
:actions="extensionActions"
|
|
606
|
-
/>
|
|
607
|
-
</template>
|
|
608
|
-
<template #default>
|
|
609
|
-
<button
|
|
610
|
-
role="menuitem"
|
|
611
|
-
@click="
|
|
612
|
-
workspaceMenu = false;
|
|
613
|
-
commandPaletteOpened = true;
|
|
614
|
-
"
|
|
615
|
-
>
|
|
616
|
-
<Search :size="16" />{{ t('命令中心')
|
|
617
|
-
}}<span class="menu-shortcut"
|
|
618
|
-
><ShortcutHint :label="shortcutHint('commandPalette')"
|
|
619
|
-
/></span>
|
|
620
|
-
</button>
|
|
621
|
-
<component
|
|
622
|
-
:is="extensions.regions['workspace-settings']"
|
|
623
|
-
v-if="
|
|
624
|
-
extensions.regions['workspace-menu-layout'] &&
|
|
625
|
-
extensions.regions['workspace-settings']
|
|
626
|
-
"
|
|
627
|
-
:actions="extensionActions"
|
|
628
|
-
/>
|
|
629
|
-
<button
|
|
630
|
-
v-if="workspace && native && !mobile && !store.isWeb"
|
|
631
|
-
role="menuitem"
|
|
632
|
-
@click="openSystemSync()"
|
|
633
|
-
>
|
|
634
|
-
<RefreshCw :size="16" />{{ t('Git 与同步') }}
|
|
635
|
-
</button>
|
|
636
|
-
<button
|
|
637
|
-
v-if="workspace"
|
|
638
|
-
role="menuitem"
|
|
639
|
-
:disabled="workspace.readOnly || busy"
|
|
640
|
-
@click="openImport"
|
|
641
|
-
>
|
|
642
|
-
<ArrowDownToLine :size="16" />{{ t('导入') }}
|
|
643
|
-
</button>
|
|
644
|
-
<button
|
|
645
|
-
v-if="workspace"
|
|
646
|
-
role="menuitem"
|
|
647
|
-
:disabled="workspace.readOnly || busy"
|
|
648
|
-
@click="
|
|
649
|
-
workspaceMenu = false;
|
|
650
|
-
openTemplateLibrary();
|
|
651
|
-
"
|
|
652
|
-
>
|
|
653
|
-
<Files :size="16" />{{ t('文档模板') }}
|
|
654
|
-
</button>
|
|
655
|
-
<button role="menuitem" @click="showObjects()">
|
|
656
|
-
<Blocks :size="16" />{{ t('工作区对象') }}
|
|
657
|
-
</button>
|
|
658
|
-
<button role="menuitem" @click="openSettings('about')">
|
|
659
|
-
<CircleHelp :size="16" />{{ t('关于 Tano / 同页')
|
|
660
|
-
}}{{ updates.state.candidate ? t(' · 有新版本') : '' }}
|
|
661
|
-
</button>
|
|
662
|
-
<div v-if="extensions.regions['account-note']" class="menu-divider" />
|
|
663
|
-
<component
|
|
664
|
-
:is="extensions.regions['account-note']"
|
|
665
|
-
v-if="extensions.regions['account-note']"
|
|
666
|
-
:actions="extensionActions"
|
|
667
|
-
/>
|
|
668
|
-
<div
|
|
669
|
-
v-if="
|
|
670
|
-
extensions.regions['mode-switch'] ||
|
|
671
|
-
workspace ||
|
|
672
|
-
extensions.regions['workspace-history'] ||
|
|
673
|
-
extensions.regions['sign-out']
|
|
674
|
-
"
|
|
675
|
-
class="menu-divider"
|
|
676
|
-
/>
|
|
677
|
-
<component
|
|
678
|
-
:is="extensions.regions['mode-switch']"
|
|
679
|
-
v-if="extensions.regions['mode-switch']"
|
|
680
|
-
:actions="extensionActions"
|
|
681
|
-
/>
|
|
682
|
-
<button
|
|
683
|
-
v-if="mobile && workspace"
|
|
684
|
-
role="menuitem"
|
|
685
|
-
@click="
|
|
686
|
-
workspaceMenu = false;
|
|
687
|
-
recyclePanel = true;
|
|
688
|
-
"
|
|
689
|
-
>
|
|
690
|
-
<Trash2 :size="16" />{{ t('手机回收站') }}
|
|
691
|
-
</button>
|
|
692
|
-
<button
|
|
693
|
-
v-if="workspace"
|
|
694
|
-
role="menuitem"
|
|
695
|
-
@click="
|
|
696
|
-
workspaceMenu = false;
|
|
697
|
-
agentPanel = true;
|
|
698
|
-
"
|
|
699
|
-
>
|
|
700
|
-
<Bot :size="16" />{{ t('与 Agent 一起工作') }}
|
|
701
|
-
</button>
|
|
702
|
-
<component
|
|
703
|
-
:is="extensions.regions['workspace-history']"
|
|
704
|
-
v-if="extensions.regions['workspace-history']"
|
|
705
|
-
:actions="extensionActions"
|
|
706
|
-
/>
|
|
707
|
-
<component
|
|
708
|
-
:is="extensions.regions['sign-out']"
|
|
709
|
-
v-if="extensions.regions['sign-out']"
|
|
710
|
-
:actions="extensionActions"
|
|
711
|
-
/>
|
|
712
|
-
</template>
|
|
713
|
-
<template #workspaces>
|
|
714
|
-
<button
|
|
715
|
-
class="context-menu-item"
|
|
716
|
-
v-if="
|
|
717
|
-
workspace &&
|
|
718
|
-
!store.recent.some((item) => item.id === workspace?.id) &&
|
|
719
|
-
!extensions.regions['workspace-menu-layout']
|
|
720
|
-
"
|
|
721
|
-
type="button"
|
|
722
|
-
:data-workspace-entry-id="workspace.id"
|
|
723
|
-
:aria-current="navigationContext === 'workspace' ? 'true' : undefined"
|
|
724
|
-
@click="selectContext('workspace')"
|
|
725
|
-
>
|
|
726
|
-
<WorkspaceIcon
|
|
727
|
-
:icon="store.workspaceSettings.icon"
|
|
728
|
-
:mode="store.isDemo ? 'demo' : store.isWeb ? 'web' : 'local'"
|
|
729
|
-
:size="16"
|
|
730
|
-
/><span class="recent-name">{{ workspace.name }}</span
|
|
731
|
-
><Check v-if="navigationContext === 'workspace'" :size="15" />
|
|
732
|
-
</button>
|
|
733
|
-
<component
|
|
734
|
-
v-if="extensions.regions['workspace-menu']"
|
|
735
|
-
:is="extensions.regions['workspace-menu']"
|
|
736
|
-
:actions="extensionActions"
|
|
737
|
-
/>
|
|
738
|
-
<template v-else>
|
|
739
|
-
<button
|
|
740
|
-
v-if="store.isDemo || mobile"
|
|
741
|
-
:disabled="busy"
|
|
742
|
-
@click="
|
|
743
|
-
workspaceMenu = false;
|
|
744
|
-
store.isDemo && workspace ? openSettings('about') : store.openWorkspace();
|
|
745
|
-
"
|
|
746
|
-
>
|
|
747
|
-
<FolderOpen :size="16" />{{
|
|
748
|
-
store.isDemo
|
|
749
|
-
? workspace
|
|
750
|
-
? t('了解演示存储')
|
|
751
|
-
: t('打开演示工作区')
|
|
752
|
-
: t('打开默认手机空间')
|
|
753
|
-
}}
|
|
754
|
-
</button>
|
|
755
178
|
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
<div class="workspace-recent-heading">
|
|
762
|
-
<span class="recent-label">{{
|
|
763
|
-
store.isDemo ? t('最近工作空间') : t('本地工作区')
|
|
764
|
-
}}</span>
|
|
765
|
-
<button
|
|
766
|
-
v-if="!store.isDemo && !mobile"
|
|
767
|
-
type="button"
|
|
768
|
-
class="workspace-recent-open"
|
|
769
|
-
:aria-label="t('打开新的本地文件夹')"
|
|
770
|
-
:data-tooltip="t('打开新的本地文件夹')"
|
|
771
|
-
:disabled="busy"
|
|
772
|
-
@click="
|
|
773
|
-
workspaceMenu = false;
|
|
774
|
-
store.openWorkspace();
|
|
775
|
-
"
|
|
776
|
-
>
|
|
777
|
-
<OpenWorkspaceIcon :size="16" />
|
|
778
|
-
</button>
|
|
779
|
-
</div>
|
|
780
|
-
<button
|
|
781
|
-
class="context-menu-item"
|
|
782
|
-
v-for="item in store.recent.slice(0, 5)"
|
|
783
|
-
:key="item.id"
|
|
784
|
-
:data-tooltip="item.path"
|
|
785
|
-
:disabled="busy"
|
|
786
|
-
:aria-current="
|
|
787
|
-
navigationContext === 'workspace' && item.id === workspace?.id
|
|
788
|
-
? 'true'
|
|
789
|
-
: undefined
|
|
790
|
-
"
|
|
791
|
-
:data-workspace-entry-id="item.id"
|
|
792
|
-
@mousedown.right.stop.prevent="openWorkspaceEntryContextMenu(item, $event)"
|
|
793
|
-
@contextmenu.stop.prevent="openWorkspaceEntryContextMenu(item, $event)"
|
|
794
|
-
@click="
|
|
795
|
-
workspaceMenu = false;
|
|
796
|
-
item.id === workspace?.id
|
|
797
|
-
? selectContext('workspace')
|
|
798
|
-
: store.openWorkspace(item.path);
|
|
799
|
-
"
|
|
800
|
-
>
|
|
801
|
-
<span class="workspace-list-avatar"
|
|
802
|
-
><WorkspaceIcon
|
|
803
|
-
:icon="item.id === workspace?.id ? store.workspaceSettings.icon : item.icon"
|
|
804
|
-
:mode="store.isDemo ? 'demo' : store.isWeb ? 'web' : 'local'"
|
|
805
|
-
:size="16"
|
|
806
|
-
/></span>
|
|
807
|
-
<span class="recent-name">{{ item.name }}</span>
|
|
808
|
-
<Check
|
|
809
|
-
v-if="navigationContext === 'workspace' && item.id === workspace?.id"
|
|
810
|
-
:size="15"
|
|
811
|
-
/>
|
|
812
|
-
</button>
|
|
813
|
-
</template>
|
|
814
|
-
</template>
|
|
815
|
-
</template>
|
|
816
|
-
</component>
|
|
817
|
-
</div>
|
|
818
|
-
</div>
|
|
819
|
-
<component
|
|
820
|
-
:is="extensions.regions['sidebar-footer']"
|
|
821
|
-
v-if="extensions.regions['sidebar-footer']"
|
|
822
|
-
:actions="extensionActions"
|
|
823
|
-
/>
|
|
824
|
-
<component
|
|
825
|
-
:is="extensions.regions['local-menu-login']"
|
|
826
|
-
v-if="extensions.regions['local-menu-login']"
|
|
827
|
-
:actions="extensionActions"
|
|
828
|
-
/>
|
|
829
|
-
<SidebarUpdateButton
|
|
830
|
-
:enabled="native && !mobile && !isAuxiliaryWindow"
|
|
831
|
-
:state="updates.state"
|
|
832
|
-
@download="updates.download()"
|
|
833
|
-
@install="updates.install()"
|
|
834
|
-
>
|
|
835
|
-
<HelpLauncher
|
|
836
|
-
:context="helpContext"
|
|
837
|
-
:availability="helpAvailability"
|
|
838
|
-
:available="sidebar && !isAuxiliaryWindow"
|
|
839
|
-
:blocked="helpBlocked"
|
|
840
|
-
:scope="`${navigationContext}:${workspace?.id ?? 'home'}:${activeId}`"
|
|
841
|
-
:documentation-base-url="documentationBaseUrl"
|
|
842
|
-
:native="native"
|
|
843
|
-
@open="
|
|
844
|
-
workspaceMenu = false;
|
|
845
|
-
menu = false;
|
|
846
|
-
"
|
|
847
|
-
@settings="openSettings"
|
|
848
|
-
@documentation="openExternalUrl($event).catch(store.report)"
|
|
849
|
-
/>
|
|
850
|
-
</SidebarUpdateButton>
|
|
851
|
-
</div>
|
|
852
|
-
<div
|
|
853
|
-
v-if="!compactPanes && !switchingWorkspace"
|
|
854
|
-
class="sidebar-resize-handle"
|
|
855
|
-
role="separator"
|
|
856
|
-
:aria-label="t('调整侧栏宽度')"
|
|
857
|
-
:data-tooltip="t('拖动调宽,向左拖到底收起')"
|
|
858
|
-
:data-tooltip-shortcut="shortcuts.toggleSidebar"
|
|
859
|
-
data-tooltip-anchor="pointer"
|
|
860
|
-
data-tooltip-delay="700"
|
|
861
|
-
aria-orientation="vertical"
|
|
862
|
-
:aria-valuenow="sidebarWidth ?? defaultSidebarWidth()"
|
|
863
|
-
:aria-valuemin="SIDEBAR_MIN_WIDTH"
|
|
864
|
-
:aria-valuemax="sidebarWidthLimit()"
|
|
865
|
-
tabindex="0"
|
|
866
|
-
@pointerdown="startSidebarResize"
|
|
867
|
-
@keydown="resizeSidebarWithKeyboard"
|
|
868
|
-
/>
|
|
869
|
-
</WorkspaceSidebar>
|
|
179
|
+
<WorkbenchSidebar
|
|
180
|
+
:app-menu-open="appMenuOpen"
|
|
181
|
+
@toggle-app-menu="appMenuOpen = !appMenuOpen"
|
|
182
|
+
@brand-button="brandButton = $event"
|
|
183
|
+
/>
|
|
870
184
|
|
|
871
185
|
<!-- Without workbench panes (home, extension views, empty) the whole column is the page card. -->
|
|
872
186
|
<div
|
|
@@ -883,8 +197,8 @@ const brandButton = ref<HTMLElement | null>(null);
|
|
|
883
197
|
>
|
|
884
198
|
<PanelLeftOpen :size="18" />
|
|
885
199
|
</button>
|
|
886
|
-
<Teleport :to="activeWindow.overlays"
|
|
887
|
-
|
|
200
|
+
<Teleport :to="activeWindow.overlays">
|
|
201
|
+
<WindowScope :key="activeWindow.id" :context="activeWindow">
|
|
888
202
|
<ReferenceGraphPopover
|
|
889
203
|
v-if="referenceGraphTarget && !switchingWorkspace"
|
|
890
204
|
v-model:opened="referenceGraphOpened"
|
|
@@ -893,8 +207,9 @@ const brandButton = ref<HTMLElement | null>(null);
|
|
|
893
207
|
:label="referenceGraphTarget.path.replace(/\.(md|markdown)$/i, '')"
|
|
894
208
|
:anchor="referenceGraphAnchor"
|
|
895
209
|
@open="openReference"
|
|
896
|
-
/>
|
|
897
|
-
|
|
210
|
+
/>
|
|
211
|
+
</WindowScope>
|
|
212
|
+
</Teleport>
|
|
898
213
|
<div
|
|
899
214
|
v-if="
|
|
900
215
|
compactPanes &&
|
|
@@ -931,12 +246,14 @@ const brandButton = ref<HTMLElement | null>(null);
|
|
|
931
246
|
</template>
|
|
932
247
|
<template #default="{ pane }">
|
|
933
248
|
<WorkbenchSettings v-if="pane.activeId === SETTINGS_TAB_ID" tabbed />
|
|
934
|
-
<
|
|
935
|
-
|
|
249
|
+
<MailWorkspaceView v-else-if="mailEnabled && pane.activeId === MAIL_TAB_ID" />
|
|
250
|
+
<template v-for="view in extensionViews" :key="view.id">
|
|
251
|
+
<component
|
|
936
252
|
v-if="pane.activeId === view.id"
|
|
937
253
|
:is="view.component"
|
|
938
254
|
:actions="viewActions[view.id]"
|
|
939
|
-
|
|
255
|
+
/>
|
|
256
|
+
</template>
|
|
940
257
|
</template>
|
|
941
258
|
</WorkspacePanes>
|
|
942
259
|
<template v-else-if="homeContent && !startupPending">
|
|
@@ -953,6 +270,7 @@ const brandButton = ref<HTMLElement | null>(null);
|
|
|
953
270
|
@select-month="showCalendarMonth"
|
|
954
271
|
@select-event="showPlanEvent"
|
|
955
272
|
/>
|
|
273
|
+
<MailWorkspaceView v-else-if="mailEnabled && homeContent === MAIL_TAB_ID" />
|
|
956
274
|
<component
|
|
957
275
|
v-else-if="homeExtension"
|
|
958
276
|
:is="homeExtension.component"
|
|
@@ -960,8 +278,19 @@ const brandButton = ref<HTMLElement | null>(null);
|
|
|
960
278
|
/>
|
|
961
279
|
</template>
|
|
962
280
|
<div v-else class="editor-empty"><div class="editor-empty-mark" aria-hidden="true" /></div>
|
|
963
|
-
<
|
|
964
|
-
|
|
281
|
+
<PluginStatusBar
|
|
282
|
+
v-if="workspace && !isAuxiliaryWindow"
|
|
283
|
+
:items="store.pluginStatusBarItems"
|
|
284
|
+
:workspace-id="workspace.id"
|
|
285
|
+
:active-document-id="store.active?.id"
|
|
286
|
+
:execute="store.interactWithPlugin"
|
|
287
|
+
:safe-mode="store.overlaySnapshot?.safeMode"
|
|
288
|
+
:pinned-commands="store.overlaySnapshot?.pinnedCommands"
|
|
289
|
+
@exit-safe-mode="store.setSafeMode(false)"
|
|
290
|
+
@run-pinned-command="runWorkbenchCommandOrPlugin($event, workbenchCommands, store)"
|
|
291
|
+
/>
|
|
292
|
+
<Teleport :to="activeWindow.overlays">
|
|
293
|
+
<WindowScope :key="activeWindow.id" :context="activeWindow">
|
|
965
294
|
<InlineAssistantInput
|
|
966
295
|
v-if="inlineAssistant && !switchingWorkspace"
|
|
967
296
|
:anchor="inlineAssistant.anchor"
|
|
@@ -976,8 +305,9 @@ const brandButton = ref<HTMLElement | null>(null);
|
|
|
976
305
|
@conversation="continueInlineConversation"
|
|
977
306
|
@undo="undoInlineAssistant"
|
|
978
307
|
@close="closeInlineAssistant"
|
|
979
|
-
/>
|
|
980
|
-
|
|
308
|
+
/>
|
|
309
|
+
</WindowScope>
|
|
310
|
+
</Teleport>
|
|
981
311
|
</div>
|
|
982
312
|
|
|
983
313
|
<WorkbenchContextMenus />
|