@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.
Files changed (248) hide show
  1. package/package.json +50 -16
  2. package/src/App.vue +82 -752
  3. package/src/appearance/appearance.ts +14 -4
  4. package/src/appearance/components/ThemePresetPreview.vue +52 -8
  5. package/src/appearance/interface-font.ts +99 -0
  6. package/src/appearance/theme.ts +26 -10
  7. package/src/appearance/use-interface-font.ts +30 -0
  8. package/src/assets/mail-provider-icons/NOTICE.txt +27 -0
  9. package/src/assets/mail-provider-icons/aliyun-mail.svg +3 -0
  10. package/src/assets/mail-provider-icons/gmail.svg +1 -0
  11. package/src/assets/mail-provider-icons/icloud.svg +12 -0
  12. package/src/assets/mail-provider-icons/netease-126.svg +5 -0
  13. package/src/assets/mail-provider-icons/netease-163.svg +5 -0
  14. package/src/assets/mail-provider-icons/qq.svg +9 -0
  15. package/src/assets/mail-provider-icons/tencent-exmail.svg +4 -0
  16. package/src/assistant/agent-identities.ts +1 -97
  17. package/src/assistant/agent-task-context.ts +1 -54
  18. package/src/assistant/attachments.ts +1 -1
  19. package/src/assistant/completion.ts +1 -61
  20. package/src/assistant/components/AssistantChangeList.vue +98 -21
  21. package/src/assistant/components/AssistantPanel.vue +425 -8
  22. package/src/assistant/components/PluginToolProposalCard.vue +235 -0
  23. package/src/assistant/connection-actions.ts +237 -0
  24. package/src/assistant/document-mentions.ts +1 -33
  25. package/src/assistant/engine.ts +1 -532
  26. package/src/assistant/execution.ts +6 -33
  27. package/src/assistant/files.ts +5 -13
  28. package/src/assistant/hash.ts +1 -4
  29. package/src/assistant/inbox.ts +1 -148
  30. package/src/assistant/language.ts +10 -37
  31. package/src/assistant/mention-autocomplete.ts +69 -0
  32. package/src/assistant/plugin-bridge-builder.ts +146 -0
  33. package/src/assistant/prompts.ts +1 -58
  34. package/src/assistant/proposal-actions.ts +336 -0
  35. package/src/assistant/results.ts +20 -86
  36. package/src/assistant/store.ts +167 -327
  37. package/src/assistant/structures.ts +1 -155
  38. package/src/assistant/tasks.ts +8 -96
  39. package/src/assistant/tool-rules.ts +1 -7
  40. package/src/assistant/workspace-bridge.ts +1 -1
  41. package/src/composables/use-document-actions.ts +38 -20
  42. package/src/composables/use-file-tree-controller.ts +7 -12
  43. package/src/composables/use-workbench-help.ts +177 -0
  44. package/src/composables/use-workbench-history.ts +2 -4
  45. package/src/composables/use-workbench-lifecycle.ts +249 -0
  46. package/src/composables/use-workbench-modals.ts +6 -1
  47. package/src/composables/use-workbench-outline.ts +0 -5
  48. package/src/composables/use-workbench-settings.ts +185 -0
  49. package/src/composables/use-workbench-shortcuts.ts +40 -1021
  50. package/src/composables/use-workbench-views.ts +325 -0
  51. package/src/data-tables/data-tables.ts +1 -2
  52. package/src/documents/components/DocumentActionMenu.vue +279 -0
  53. package/src/documents/components/DocumentHistoryPanel.vue +3 -1
  54. package/src/documents/components/DocumentInspector.vue +168 -0
  55. package/src/documents/components/DocumentPane.vue +482 -0
  56. package/src/documents/description-merge.ts +1 -9
  57. package/src/features.ts +1 -0
  58. package/src/files/components/FileMetadataPanel.vue +49 -15
  59. package/src/fonts/Inter-Latin-Italic.woff2 +0 -0
  60. package/src/fonts/Inter-Latin.woff2 +0 -0
  61. package/src/fonts/TanoUISansSC-Bold.woff2 +0 -0
  62. package/src/fonts/TanoUISansSC-Medium.woff2 +0 -0
  63. package/src/fonts/TanoUISansSC-Regular.woff2 +0 -0
  64. package/src/help/help-milestones.ts +3 -5
  65. package/src/i18n/locale-catalogs.ts +7 -6
  66. package/src/i18n/locale-registry.ts +8 -6
  67. package/src/i18n/locales/de-DE.json +371 -3
  68. package/src/i18n/locales/en-US.json +371 -2
  69. package/src/i18n/locales/es-ES.json +371 -3
  70. package/src/i18n/locales/ja-JP.json +370 -2
  71. package/src/i18n/locales/zh-TW.json +370 -2
  72. package/src/mail/components/MailAccountDialog.vue +450 -0
  73. package/src/mail/components/MailComposerDialog.vue +326 -0
  74. package/src/mail/components/MailProviderIcon.vue +30 -0
  75. package/src/mail/components/MailWorkspaceView.vue +821 -0
  76. package/src/mail/components/SidebarMail.vue +134 -0
  77. package/src/mail/mail-avatar.ts +17 -0
  78. package/src/mail/mail-bridge.ts +68 -0
  79. package/src/mail/mail-calendar.ts +208 -0
  80. package/src/mail/mail-markdown.ts +195 -0
  81. package/src/mail/types.ts +226 -0
  82. package/src/objects/components/ObjectDetailModal.vue +1001 -0
  83. package/src/objects/content-references.ts +6 -56
  84. package/src/objects/wiki-links.ts +1 -48
  85. package/src/objects/workspace-objects.ts +3 -4
  86. package/src/plan-sync/types.ts +6 -3
  87. package/src/plans/calendar-interaction.ts +194 -0
  88. package/src/plans/calendar.ts +65 -9
  89. package/src/plans/components/CalendarAgendaView.vue +165 -0
  90. package/src/plans/components/CalendarDayPopover.vue +172 -39
  91. package/src/plans/components/CalendarFilterBar.vue +128 -0
  92. package/src/plans/components/CalendarMonthView.vue +224 -0
  93. package/src/plans/components/CalendarQuickCreateDialog.vue +269 -0
  94. package/src/plans/components/CalendarTimelineView.vue +517 -0
  95. package/src/plans/components/CalendarTopbarControls.vue +101 -0
  96. package/src/plans/components/CalendarView.vue +264 -748
  97. package/src/plans/components/CalendarYearView.vue +138 -0
  98. package/src/plans/components/PlanArchiveDialog.vue +295 -0
  99. package/src/plans/components/PlanConnectionsDialog.vue +1 -1
  100. package/src/plans/components/PlanDateField.vue +6 -4
  101. package/src/plans/components/PlanDetailPanel.vue +227 -32
  102. package/src/plans/components/PlanEventList.vue +16 -4
  103. package/src/plans/components/SidebarPlan.vue +22 -15
  104. package/src/plans/components/TaskRepeatControls.vue +169 -30
  105. package/src/plans/components/calendar-shared.css +192 -0
  106. package/src/plans/composables/use-calendar-interactions.ts +396 -0
  107. package/src/plans/composables/use-calendar-scroll.ts +420 -0
  108. package/src/plans/local-reminders.ts +149 -0
  109. package/src/plans/personal-plans.ts +10 -1
  110. package/src/plans/plan-date.ts +8 -1
  111. package/src/plans/plan-migration.ts +95 -0
  112. package/src/plans/recurrence.ts +95 -0
  113. package/src/plans/task-repeat.ts +8 -8
  114. package/src/plans/timeline-layout.ts +92 -0
  115. package/src/plugins/assistant-bridge.ts +520 -0
  116. package/src/plugins/attachment-reader.ts +3 -1
  117. package/src/plugins/cache-storage.ts +42 -2
  118. package/src/plugins/components/PluginAutomations.vue +3 -3
  119. package/src/plugins/components/PluginCatalogBrowser.vue +17 -8
  120. package/src/plugins/components/PluginChangeSummary.vue +16 -3
  121. package/src/plugins/components/PluginConnections.vue +1 -1
  122. package/src/plugins/components/PluginCustomView.vue +2 -2
  123. package/src/plugins/components/PluginDetailPage.vue +136 -57
  124. package/src/plugins/components/PluginDeveloperArea.vue +192 -0
  125. package/src/plugins/components/PluginDocumentSlot.vue +63 -0
  126. package/src/plugins/components/PluginExplorer.vue +21 -25
  127. package/src/plugins/components/PluginImportDialog.vue +410 -0
  128. package/src/plugins/components/PluginInstaller.vue +273 -288
  129. package/src/plugins/components/PluginListItem.vue +3 -0
  130. package/src/plugins/components/PluginMaintenance.vue +37 -34
  131. package/src/plugins/components/PluginRepositoryStorage.vue +4 -2
  132. package/src/plugins/components/PluginRuntimePanel.vue +3 -3
  133. package/src/plugins/components/PluginSettingsForm.vue +112 -0
  134. package/src/plugins/components/PluginStatusBar.vue +161 -0
  135. package/src/plugins/components/PluginSurface.vue +18 -6
  136. package/src/plugins/components/PluginUiDialog.vue +452 -0
  137. package/src/plugins/components/PluginsTabPage.vue +61 -0
  138. package/src/plugins/components/plugin-center.css +5 -0
  139. package/src/plugins/data.ts +9 -86
  140. package/src/plugins/editor-plugin-adapters.ts +169 -0
  141. package/src/plugins/excalidraw/bundle.tano-plugin.json +1 -1
  142. package/src/plugins/excalidraw/manifest.json +12 -1
  143. package/src/plugins/host.ts +662 -43
  144. package/src/plugins/native.ts +2 -10
  145. package/src/plugins/overlay-mapping.ts +125 -0
  146. package/src/plugins/packages.ts +73 -1
  147. package/src/plugins/plugin-data.ts +2 -3
  148. package/src/plugins/plugin-permissions.ts +57 -0
  149. package/src/plugins/plugin-rpc-router.ts +558 -0
  150. package/src/plugins/plugin-sdk.ts +1 -94
  151. package/src/plugins/plugin-ui-dialogs.ts +167 -0
  152. package/src/plugins/policy.ts +53 -3
  153. package/src/plugins/presentation-preview/bundle.tano-plugin.json +1 -1
  154. package/src/plugins/presentation-preview/manifest.json +2 -1
  155. package/src/plugins/queries.ts +1 -73
  156. package/src/plugins/sandbox.ts +15 -1
  157. package/src/plugins/use-plugin-actions.ts +67 -20
  158. package/src/plugins/user-plugins.ts +254 -0
  159. package/src/plugins/view-header.ts +2 -7
  160. package/src/plugins/word-preview/bundle.tano-plugin.json +1 -1
  161. package/src/plugins/word-preview/manifest.json +13 -1
  162. package/src/plugins/workbench.ts +175 -2
  163. package/src/plugins/worker.js +105 -8
  164. package/src/plugins/workspace-plugin-runtime.ts +23 -7
  165. package/src/plugins/workspace-plugins.ts +212 -21
  166. package/src/runtime.ts +103 -4
  167. package/src/settings/components/SettingsAppearancePage.vue +46 -0
  168. package/src/settings/components/SettingsDocumentsPage.vue +0 -1
  169. package/src/settings/components/SettingsPanel.vue +8 -3
  170. package/src/settings/components/WorkbenchSettings.vue +20 -7
  171. package/src/settings/components/settings-context.ts +1 -1
  172. package/src/settings/components/settings-search.ts +2 -3
  173. package/src/settings/settings-tab.ts +1 -0
  174. package/src/shell/command-palette.ts +3 -3
  175. package/src/shell/components/EditorToolbar.vue +8 -9
  176. package/src/shell/components/EditorTools.vue +1 -5
  177. package/src/shell/components/PaneTopbar.vue +393 -0
  178. package/src/shell/components/SelectionToolbar.vue +0 -2
  179. package/src/shell/components/SidebarNavigation.vue +22 -2
  180. package/src/shell/components/WorkbenchContextMenus.vue +58 -34
  181. package/src/shell/components/WorkbenchModals.vue +47 -62
  182. package/src/shell/components/WorkbenchPanes.vue +371 -1342
  183. package/src/shell/components/WorkbenchSidebar.vue +486 -0
  184. package/src/shell/components/WorkspaceBreadcrumb.vue +6 -14
  185. package/src/shell/components/WorkspaceViewSwitcher.vue +12 -7
  186. package/src/shell/pane-registry.ts +69 -0
  187. package/src/shell/use-surface-dismissal.ts +219 -0
  188. package/src/shell/use-workbench-commands.ts +599 -0
  189. package/src/shell/use-workbench-keybindings.ts +337 -0
  190. package/src/shell/use-workbench.ts +531 -1153
  191. package/src/shell/workbench-async-components.ts +14 -5
  192. package/src/shell/workbench-context.ts +30 -3
  193. package/src/stores/mail.ts +414 -0
  194. package/src/stores/plan-sync.ts +2 -1
  195. package/src/stores/plans.ts +2 -9
  196. package/src/stores/workspace-document-io.ts +807 -0
  197. package/src/stores/workspace-file-ops.ts +1 -1
  198. package/src/stores/workspace-knowledge.ts +2 -114
  199. package/src/stores/workspace-lifecycle.ts +459 -0
  200. package/src/stores/workspace-plugins-state.ts +254 -259
  201. package/src/stores/workspace-session.ts +287 -0
  202. package/src/stores/workspace-tabs-layout.ts +6 -44
  203. package/src/stores/workspace-types.ts +50 -0
  204. package/src/stores/workspace.ts +184 -1363
  205. package/src/styles/agent-diff-modals.css +0 -7
  206. package/src/styles/dark-theme.css +3 -3
  207. package/src/styles/inspector.css +0 -59
  208. package/src/styles/layout-themes.css +346 -0
  209. package/src/styles/mail.css +1568 -0
  210. package/src/styles/mobile.css +2 -2
  211. package/src/styles/recent-and-media.css +0 -17
  212. package/src/styles/theme-contract.css +3 -3
  213. package/src/styles/workbench-shell.css +110 -17
  214. package/src/styles/workspace-states.css +9 -33
  215. package/src/styles.css +0 -1
  216. package/src/tabs/components/DesktopTabs.vue +19 -14
  217. package/src/tabs/components/NewTabPicker.vue +10 -4
  218. package/src/tabs/tab-label.ts +0 -1
  219. package/src/windows/AuxiliaryWindows.vue +2 -2
  220. package/src/windows/use-window-event-bridge.ts +152 -0
  221. package/src/workspace/components/TemplateLibrary.vue +1 -1
  222. package/src/workspace/components/WorkspaceGeneralSettings.vue +0 -13
  223. package/src/workspace/components/WorkspaceIconPicker.vue +30 -7
  224. package/src/workspace/components/WorkspacePickerMenu.vue +317 -0
  225. package/src/workspace/workspace-comments.ts +11 -151
  226. package/src/workspace/workspace-welcome.ts +1 -1
  227. package/src/assistant/locales/de-DE.json +0 -126
  228. package/src/assistant/locales/en-US.json +0 -126
  229. package/src/assistant/locales/es-ES.json +0 -126
  230. package/src/assistant/locales/ja-JP.json +0 -126
  231. package/src/assistant/locales/zh-CN.json +0 -126
  232. package/src/assistant/locales/zh-TW.json +0 -126
  233. package/src/assistant/task-prompts.json +0 -39
  234. package/src/documents/components/FormulaMenu.vue +0 -50
  235. package/src/files/components/FileDatabasePage.vue +0 -152
  236. package/src/files/components/FolderHomeIcon.vue +0 -12
  237. package/src/objects/components/ObjectDatabasePage.vue +0 -100
  238. package/src/objects/components/ObjectPanel.vue +0 -554
  239. package/src/plans/components/PersonalPlanDialog.vue +0 -105
  240. package/src/shell/components/WorkspaceViewPage.vue +0 -127
  241. package/src/shell/components/WorkspaceViewTab.vue +0 -24
  242. package/src/styles/object-panel.css +0 -163
  243. package/src/workspace/components/GitInspectionPanel.vue +0 -35
  244. package/src/workspace/components/WorkspaceSyncPanel.vue +0 -50
  245. package/src/workspace/welcome-slogans.ts +0 -11
  246. package/src/workspace/workspace-git.ts +0 -35
  247. package/src/workspace/workspace-sync.ts +0 -46
  248. package/src/workspace/workspace-views.ts +0 -48
@@ -1,130 +1,92 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, inject, toRefs } from 'vue';
3
- import {
4
- AlertTriangle,
5
- Archive,
6
- ArrowDownToLine,
7
- ArrowLeft,
8
- ArrowRight,
9
- ArrowUpRight,
10
- Bot,
11
- CalendarDays,
12
- Check,
13
- CheckCheck,
14
- ChevronDown,
15
- ChevronLeft,
16
- ChevronRight,
17
- Clock3,
18
- FileText,
19
- GitFork,
20
- History,
21
- List,
22
- ListTodo,
23
- ListTree,
24
- LockKeyhole,
25
- MessageSquare,
26
- MessageSquareDiff,
27
- MoreHorizontal,
28
- MoveHorizontal,
29
- PanelLeftOpen,
30
- Pin,
31
- Plus,
32
- Puzzle,
33
- Redo2,
34
- RefreshCw,
35
- Repeat2,
36
- Search,
37
- Trash2,
38
- Undo2,
39
- X,
40
- } from 'lucide-vue-next';
41
- import ShortcutHint from '@tano/editor/shortcut-hint';
42
- import { vSurfaceMotion } from '@tano/editor/surface-motion';
43
- import { isFeatureEnabled } from '../../features';
44
- import { vOutlineMotion } from '../../documents/outline-motion';
3
+ import { PanelLeftOpen } from 'lucide-vue-next';
4
+ import { fileHandlers, parentPath, relativeWorkspaceReference } from '@tano/protocol';
5
+ import { ASSISTANT_TAB_ID, openAssistantPage } from '../../assistant/navigation';
6
+ import { isTableTab, tableFileId } from '../../data-tables/data-tables';
7
+ import { GRAPH_TAB_ID } from '../../documents/document-graph';
8
+ import { t } from '../../i18n/i18n';
9
+ import { MAIL_TAB_ID } from '../../mail/types';
10
+ import { CALENDAR_TAB_ID } from '../../plans/calendar';
11
+ import { mobile } from '../../platform/platform';
12
+ import { PLUGINS_TAB_ID } from '../../plugins/workspace-plugins';
13
+ import { SETTINGS_TAB_ID } from '../../settings/settings-tab';
45
14
  import { layoutPanes } from '../pane-layout';
15
+ import { isEmptyPaneFallback } from '../pane-registry';
46
16
  import { useWindowContext } from '../../windows/context';
47
17
  import {
48
18
  AssistantPanel,
49
19
  CalendarView,
50
- CalloutIconPicker,
51
20
  DataTablePage,
52
- DocumentComments,
53
- EditorTools,
54
- MarkdownEditor,
55
- PluginInstaller,
21
+ MailWorkspaceView,
56
22
  RelationGraph,
57
- SourceEditor,
58
23
  TemplateLibrary,
59
- WorkspaceViewTab,
60
24
  } from '../workbench-async-components';
61
- import { workbenchContextKey } from '../workbench-context';
25
+ import {
26
+ workbenchDocumentsKey,
27
+ workbenchModalsKey,
28
+ workbenchPrefsKey,
29
+ workbenchShellKey,
30
+ workbenchTreeMenusKey,
31
+ } from '../workbench-context';
62
32
  import AssistantLauncher from '../../assistant/components/AssistantLauncher.vue';
63
33
  import AttachmentPreview from '../../files/components/AttachmentPreview.vue';
64
- import ButtonVisibilityGroup from './ButtonVisibilityGroup.vue';
65
34
  import DesktopTabs from '../../tabs/components/DesktopTabs.vue';
66
- import DocumentExportMenu from '../../documents/components/DocumentExportMenu.vue';
67
- import DocumentGlobalMenu from '../../documents/components/DocumentGlobalMenu.vue';
35
+ import DocumentInspector from '../../documents/components/DocumentInspector.vue';
68
36
  import DocumentLoading from '../../documents/components/DocumentLoading.vue';
69
- import DocumentOutline from '../../documents/components/DocumentOutline.vue';
70
- import DocumentPrintButton from '../../documents/components/DocumentPrintButton.vue';
71
- import DocumentScrollbar from '../../documents/components/DocumentScrollbar.vue';
72
- import DocumentStarter from '../../documents/components/DocumentStarter.vue';
73
- import DocumentStatus from '../../documents/components/DocumentStatus.vue';
74
- import DocumentSuggestions from '../../documents/components/DocumentSuggestions.vue';
75
- import DocumentTitle from '../../documents/components/DocumentTitle.vue';
37
+ import DocumentPane from '../../documents/components/DocumentPane.vue';
76
38
  import EmptyEditor from '../../documents/components/EmptyEditor.vue';
77
39
  import FolderView from '../../files/components/FolderView.vue';
78
- import LayoutDocumentChrome from './LayoutDocumentChrome.vue';
79
- import MarkdownRevealToggle from '../../documents/components/MarkdownRevealToggle.vue';
80
- import PageDisplayOptions from './PageDisplayOptions.vue';
81
- import PageSearch from './PageSearch.vue';
40
+ import PaneTopbar from './PaneTopbar.vue';
82
41
  import PluginDetailPage from '../../plugins/components/PluginDetailPage.vue';
83
- import PluginMenu from '../../plugins/components/PluginMenu.vue';
42
+ import PluginsTabPage from '../../plugins/components/PluginsTabPage.vue';
43
+ import PluginSurface from '../../plugins/components/PluginSurface.vue';
84
44
  import PluginView from '../../plugins/components/PluginView.vue';
85
- import PluginViewHeader from '../../plugins/components/PluginViewHeader.vue';
86
- import SourceCodeIcon from '../../documents/components/SourceCodeIcon.vue';
45
+ import { resolveOverlayTabView } from '../../plugins/overlay-mapping';
87
46
  import WorkbenchSettings from '../../settings/components/WorkbenchSettings.vue';
88
- import WorkspaceBreadcrumb from './WorkspaceBreadcrumb.vue';
89
47
  import WorkspacePanes from './WorkspacePanes.vue';
48
+ import type { DocumentTab } from '../../stores/workspace-types';
90
49
 
91
50
  const windowContext = useWindowContext();
92
51
  const isAuxiliaryWindow = windowContext.id !== 'main';
93
52
  function dragPaneWindow(event: MouseEvent) {
94
53
  if (event.button === 0 && event.detail === 1) void windowContext.native?.startDragging();
95
54
  }
96
- function maximizePaneWindow() { void windowContext.native?.toggleMaximize(); }
55
+ function maximizePaneWindow() {
56
+ void windowContext.native?.toggleMaximize();
57
+ }
58
+
59
+ const shell = inject(workbenchShellKey);
60
+ const prefs = inject(workbenchPrefsKey);
61
+ const documents = inject(workbenchDocumentsKey);
62
+ const treeMenus = inject(workbenchTreeMenusKey);
63
+ const modals = inject(workbenchModalsKey);
64
+ if (!shell || !prefs || !documents || !treeMenus || !modals) {
65
+ throw new Error('Workbench context is required');
66
+ }
97
67
 
98
- const context = inject(workbenchContextKey);
99
- if (!context) throw new Error('Workbench context is required');
100
68
  const {
69
+ native,
101
70
  workspace,
102
71
  startupPending,
103
72
  filesPending,
104
73
  compactPanes: mainCompactPanes,
105
- tabsEnabled,
106
- native,
107
- mobile,
108
74
  sidebar,
109
- t,
110
- shortcuts,
111
75
  toggleSidebar,
112
76
  sessionPending,
113
- tabFileDrag,
114
- assistantTab,
115
- fileDragEnd,
116
77
  store,
117
78
  createNewDocument,
118
79
  detachTab,
119
80
  assistant,
120
81
  assistantPanelMounted,
121
82
  assistantHosts,
122
- ASSISTANT_TAB_ID,
83
+ assistantTab,
123
84
  openReference,
124
- revealAssistantSelection,
125
85
  openSettings,
126
86
  extensions,
127
87
  extensionActions,
88
+ extensionViews,
89
+ viewActions,
128
90
  templateLibraryOpen,
129
91
  templatePaneId,
130
92
  templateSource,
@@ -133,1306 +95,373 @@ const {
133
95
  openEntry,
134
96
  openBreadcrumbDirectory,
135
97
  setAssistantHost,
136
- topbarVisibilityItems,
137
- GRAPH_TAB_ID,
138
- closeButtonVisibilityMenus,
139
- canNavigatePage,
140
- navigatePage,
141
- CALENDAR_TAB_ID,
98
+ mailEnabled,
142
99
  paneButterflyScope,
143
- treeDocumentIcons,
144
- loadTreeDocumentIcon,
145
- pluginViewHeader,
146
- pluginPreviewStatus,
147
- paneDocumentStatus,
148
- attachmentStatus,
149
- currentAttachmentStatus,
150
- PLUGINS_TAB_ID,
151
- extensionViews,
152
- settingsTabView,
153
100
  touchLayout,
154
- showOutline,
155
- touchOutlineOpen,
156
- panel,
157
101
  attachments,
158
- isTableTab,
159
- calendarToolItems,
160
- calendarPeriod,
102
+ plans,
103
+ calendarScope,
161
104
  calendarDate,
162
- moveCalendarPeriod,
163
- calendarModeOpen,
164
- calendarModeLabel,
165
- calendarModeOptions,
166
105
  calendarMode,
167
106
  selectCalendarMode,
168
- managePlanEvents,
169
- documentSuggestions,
170
- editing,
171
- suggestionModeBusy,
172
- toggleSuggestionMode,
173
- documentToolItems,
174
- revealMarkdown,
175
- paneSource,
176
- shortcutAriaLabel,
177
- shortcutKeys,
178
- setPaneSource,
179
- menu,
180
- toggleDocumentMenu,
181
- documentMenuTriggerKeydown,
182
- documentMenuKeydown,
183
- openPaneSearch,
184
- shortcutHint,
185
- editorReadonly,
186
- documentUndoAvailable,
187
- undoDocument,
188
- documentRedoAvailable,
189
- redoDocument,
190
- canAddDocumentProperty,
191
- addDocumentProperty,
192
- paneComments,
193
- openDocumentDiscussion,
194
- paneReadonly,
195
- referenceGraphOpened,
196
- showReferenceGraph,
197
- limitPageWidth,
198
- pageWidthWritable,
199
- setLimitPageWidth,
200
- workspaceLocked,
201
- pageLocked,
202
- togglePageLock,
203
- historyPage,
204
- historyPanel,
205
- editorPreferences,
206
- showPageTitle,
207
- showDocumentProperties,
208
- showAllLineNumbers,
209
- togglePageOption,
210
- toggleWorkspaceLock,
211
- exportBusy,
212
- exportDocument,
213
- printBusy,
214
- printActiveDocument,
215
- sessionBlocksFileMutation,
216
- removeDocument,
217
- tableFileId,
218
- openAssistant,
219
- parentPath,
220
- openWorkspaceViewSourceFile,
221
- openWorkspaceViewSourceObject,
222
- calendarScope,
223
- plans,
224
107
  showCalendarDay,
225
108
  showCalendarMonth,
226
109
  showPlanEvent,
227
- openAssistantPage,
228
- viewActions,
229
- SETTINGS_TAB_ID,
230
- showObjects,
110
+ createPluginObject,
111
+ updateLock,
112
+ busy,
113
+ } = toRefs(shell);
114
+ const {
115
+ tabsEnabled,
116
+ shortcuts,
117
+ limitPageWidth,
231
118
  selectedVisualFontFamily,
232
119
  visualFontSize,
233
- setPaneSearch,
234
- paneSourceEditors,
235
- paneEditors,
236
- paneSearchRevisions,
237
- setPaneElement,
238
- toolbarMode,
239
- scheduleActiveHeading,
240
- appearance,
241
- assistantTaskActive,
242
- beginSelectionTodo,
243
- paneEditorScrolls,
244
- paneSelections,
245
- defaultSelectionContext,
246
- showSourceTodo,
247
- selectedDiff,
248
- showModal,
249
- sourceFontSize,
250
- openPageContextMenu,
251
- safeRemoteImage,
252
- uploadFile,
253
- resourceRevision,
254
- renameDocumentTitle,
255
- insertBlockBelowTitle,
256
- commentAnchors,
257
- paneEditorReady,
258
- paneSourceSelections,
259
- insertSourceFiles,
260
- setPaneEditor,
261
- openDocumentLink,
262
- openWikiLink,
263
- openBlankBlockAssistant,
264
- startDocumentDraft,
265
- quickInitialize,
266
- chooseInitialTemplate,
267
- showDocumentDiscussion,
268
- setPaneComments,
269
- discussWithAssistant,
270
- capturePaneCommentSelection,
271
- focusPaneComment,
272
- paneCommentGeometry,
273
- paneScrolls,
120
+ developerMode,
121
+ } = toRefs(prefs);
122
+ const {
123
+ revealAssistantSelection,
124
+ showOutline,
125
+ touchOutlineOpen,
126
+ openAssistant,
274
127
  receiveAttachmentStatus,
275
- updateLock,
276
- busy,
277
- fileHandlers,
278
- relativeWorkspaceReference,
279
- outlineOnLeft,
280
- hoverOutline,
281
- outlinePinned,
282
- outlinePosition,
283
- openOutlineContextMenu,
284
- releaseOutlinePointerFocus,
285
- outlineAutoCollapse,
286
- outlineSearchOpen,
287
- toggleOutlineSearch,
288
- toggleOutlinePin,
289
- outlineSearch,
290
- visibleOutline,
291
- jumpToHeading,
292
- outline,
293
- activeHeading,
294
- localNative,
295
- agentPanel,
296
- activities,
297
- uiLocale,
298
- vButterflyPerch,
299
- } = toRefs(context);
300
- const documentEditorPreferences = computed(() => isFeatureEnabled('markdownSpacingAutocomplete')
301
- ? editorPreferences.value
302
- : { ...editorPreferences.value, completeTextSpacing: false });
128
+ } = toRefs(documents);
129
+ const { tabFileDrag, fileDragEnd, treeDocumentIcons, loadTreeDocumentIcon } = toRefs(treeMenus);
130
+ const { showModal } = toRefs(modals);
131
+
303
132
  const compactPanes = computed(() => !isAuxiliaryWindow && mainCompactPanes.value);
304
- // The fullscreen host is shared across windows; only its owner may mount the panel.
305
133
  const ownsFullscreenAssistant = computed(() => {
306
134
  const layout = store.value.windowLayouts[windowContext.id]?.layout;
307
- return !!layout && layoutPanes(layout).some(pane => pane.id === assistant.value.fullscreenPaneId);
135
+ return !!layout && layoutPanes(layout).some((pane) => pane.id === assistant.value.fullscreenPaneId);
308
136
  });
137
+ const extensionViewIds = computed(() => extensionViews.value.map((view) => view.id));
138
+ const documentSidebarViews = computed(() =>
139
+ store.value.pluginViews.filter((view) => view.location === 'documentSidebar'),
140
+ );
141
+ const activeDocumentSidebarView = computed(() =>
142
+ documentSidebarViews.value.find((view) => view.key === store.value.activeDocumentPluginSidebar),
143
+ );
144
+
145
+ function activeOverlayTabView(activeTabId: string) {
146
+ if (!workspace.value) return null;
147
+ return resolveOverlayTabView(activeTabId, {
148
+ safeMode: store.value.overlaySnapshot?.safeMode,
149
+ homeTabView: store.value.pluginHomeTabView,
150
+ newTabView: store.value.pluginNewTabView,
151
+ });
152
+ }
153
+
154
+ function showEmptyPaneFallback(activeId: string, tab?: DocumentTab) {
155
+ return isEmptyPaneFallback({
156
+ activeId,
157
+ hasWorkspace: !!workspace.value,
158
+ startupPending: startupPending.value,
159
+ mailEnabled: mailEnabled.value,
160
+ extensionViewIds: extensionViewIds.value,
161
+ tab,
162
+ });
163
+ }
309
164
  </script>
310
165
 
311
166
  <template>
312
- <WorkspacePanes
313
- v-if="workspace || startupPending || filesPending"
314
- :loading="filesPending"
167
+ <WorkspacePanes
168
+ v-if="workspace || startupPending || filesPending"
169
+ :loading="filesPending"
170
+ :compact="compactPanes"
171
+ :tabs-enabled="tabsEnabled"
172
+ :class="{ 'workspace-native-tabs': tabsEnabled && !compactPanes }"
173
+ >
174
+ <template #tabs="{ pane, rect }">
175
+ <div v-if="!compactPanes" class="workspace-tabbar" :data-tab-pane-id="pane.id">
176
+ <button
177
+ v-if="
178
+ native &&
179
+ !mobile &&
180
+ !isAuxiliaryWindow &&
181
+ !sidebar &&
182
+ rect.top === 0 &&
183
+ rect.left === 0
184
+ "
185
+ class="desktop-sidebar-toggle icon-button"
186
+ type="button"
187
+ :aria-label="t('展开侧栏')"
188
+ :data-tooltip="t('展开侧栏')"
189
+ :data-tooltip-shortcut="shortcuts.toggleSidebar"
190
+ @click="toggleSidebar"
191
+ >
192
+ <PanelLeftOpen :size="16" :stroke-width="1.6" />
193
+ </button>
194
+ <DesktopTabs
195
+ :loading="sessionPending"
196
+ :pane-id="pane.id"
197
+ :show-navigation="rect.top === 0 && rect.left === 0"
198
+ :detachable="native && !mobile"
199
+ :file-drag="tabFileDrag"
200
+ :assistant-tab="assistantTab"
201
+ @files-dropped="fileDragEnd"
202
+ @new-tab="
203
+ store.focusPane(pane.id);
204
+ store.createBlankTab();
205
+ "
206
+ @new-document="
207
+ store.focusPane(pane.id);
208
+ createNewDocument();
209
+ "
210
+ @detach-tab="detachTab"
211
+ />
212
+ <div
213
+ v-if="native && !mobile"
214
+ v-show="rect.top === 0"
215
+ class="workspace-window-drag"
216
+ :title="t('拖动窗口')"
217
+ @mousedown="dragPaneWindow"
218
+ @dblclick="maximizePaneWindow"
219
+ />
220
+ </div>
221
+ </template>
222
+ <template #sidebar>
223
+ <AssistantPanel
224
+ v-if="
225
+ assistant.available &&
226
+ assistantPanelMounted &&
227
+ (assistant.displayMode !== 'fullscreen' || ownsFullscreenAssistant)
228
+ "
315
229
  :compact="compactPanes"
316
- :tabs-enabled="tabsEnabled"
317
- :class="{ 'workspace-native-tabs': tabsEnabled && !compactPanes }"
230
+ :toggle-shortcut="shortcuts.toggleAssistant"
231
+ :fullscreen-target="assistantHosts.get(assistant.fullscreenPaneId ?? '')"
232
+ :navigation-visible="store.activeId === ASSISTANT_TAB_ID"
233
+ @show-navigation="sidebar = true"
234
+ @open-reference="openReference"
235
+ @reveal-selection="revealAssistantSelection"
236
+ @open-settings="openSettings('assistant')"
237
+ @closed="assistantPanelMounted = assistant.opened"
238
+ >
239
+ <template #quota>
240
+ <component
241
+ :is="extensions.regions['assistant-quota']"
242
+ v-if="extensions.regions['assistant-quota']"
243
+ :actions="extensionActions"
244
+ />
245
+ </template>
246
+ </AssistantPanel>
247
+ </template>
248
+ <template #default="{ pane, document: active, tab }">
249
+ <TemplateLibrary
250
+ v-if="templateLibraryOpen && pane.id === templatePaneId && workspace"
251
+ :key="workspace.id"
252
+ :source="templateSource"
253
+ :initialize="templateInitialization"
254
+ :demo-label="store.isDemo ? workspaceStatusLabel : undefined"
255
+ @close="templateLibraryOpen = false"
256
+ @open-file="(file) => { store.focusPane(pane.id); openEntry(file); }"
257
+ @open-directory="(path) => { store.focusPane(pane.id); templateLibraryOpen = false; void openBreadcrumbDirectory(path); }"
318
258
  >
319
- <template #tabs="{ pane, rect }">
320
- <div v-if="!compactPanes" class="workspace-tabbar" :data-tab-pane-id="pane.id">
259
+ <template #navigation>
260
+ <div v-if="!sidebar && !(native && !mobile && workspace)" class="topbar-navigation">
321
261
  <button
322
- v-if="
323
- native &&
324
- !mobile &&
325
- !isAuxiliaryWindow &&
326
- !sidebar &&
327
- rect.top === 0 &&
328
- rect.left === 0
329
- "
330
- class="desktop-sidebar-toggle icon-button"
331
262
  type="button"
263
+ class="icon-button"
332
264
  :aria-label="t('展开侧栏')"
333
- :data-tooltip="t('展开侧栏')" :data-tooltip-shortcut="shortcuts.toggleSidebar"
265
+ :data-tooltip="t('展开侧栏')"
266
+ :data-tooltip-shortcut="shortcuts.toggleSidebar"
334
267
  @click="toggleSidebar"
335
268
  >
336
269
  <PanelLeftOpen :size="16" :stroke-width="1.6" />
337
270
  </button>
338
- <DesktopTabs
339
- :loading="sessionPending"
340
- :pane-id="pane.id"
341
- :show-navigation="rect.top === 0 && rect.left === 0"
342
- :detachable="native && !mobile"
343
- :file-drag="tabFileDrag"
344
- :assistant-tab="assistantTab"
345
- @files-dropped="fileDragEnd"
346
- @new-tab="
347
- store.focusPane(pane.id);
348
- store.createBlankTab();
349
- "
350
- @new-document="
351
- store.focusPane(pane.id);
352
- createNewDocument();
353
- "
354
- @detach-tab="detachTab"
355
- />
356
- <div
357
- v-if="native && !mobile"
358
- v-show="rect.top === 0"
359
- class="workspace-window-drag"
360
- :title="t('拖动窗口')"
361
- @mousedown="dragPaneWindow"
362
- @dblclick="maximizePaneWindow"
363
- />
364
271
  </div>
365
272
  </template>
366
- <template #sidebar>
367
- <AssistantPanel
368
- v-if="assistant.available && assistantPanelMounted && (assistant.displayMode !== 'fullscreen' || ownsFullscreenAssistant)"
369
- :compact="compactPanes"
370
- :toggle-shortcut="shortcuts.toggleAssistant"
371
- :fullscreen-target="assistantHosts.get(assistant.fullscreenPaneId ?? '')"
372
- :navigation-visible="store.activeId === ASSISTANT_TAB_ID"
373
- @show-navigation="sidebar = true"
374
- @open-reference="openReference"
375
- @reveal-selection="revealAssistantSelection"
376
- @open-settings="openSettings('assistant')"
377
- @closed="assistantPanelMounted = assistant.opened"
378
- >
379
- <template #quota>
380
- <component :is="extensions.regions['assistant-quota']" v-if="extensions.regions['assistant-quota']" :actions="extensionActions" />
381
- </template>
382
- </AssistantPanel>
383
- </template>
384
- <template #default="{ pane, document: active, tab }">
385
-
386
- <TemplateLibrary
387
- v-if="templateLibraryOpen && pane.id === templatePaneId && workspace"
388
- :key="workspace.id"
389
- :source="templateSource"
390
- :initialize="templateInitialization"
391
- :demo-label="store.isDemo ? workspaceStatusLabel : undefined"
392
- @close="templateLibraryOpen = false"
393
- @open-file="(file) => { store.focusPane(pane.id); openEntry(file); }"
394
- @open-directory="(path) => { store.focusPane(pane.id); templateLibraryOpen = false; void openBreadcrumbDirectory(path); }"
395
- >
396
- <template #navigation>
397
- <div v-if="!sidebar && !(native && !mobile && workspace)" class="topbar-navigation">
398
- <button type="button" class="icon-button" :aria-label="t('展开侧栏')" :data-tooltip="t('展开侧栏')" :data-tooltip-shortcut="shortcuts.toggleSidebar" @click="toggleSidebar"><PanelLeftOpen :size="16" :stroke-width="1.6" /></button>
399
- </div>
400
- </template>
401
- </TemplateLibrary>
402
- <div
403
- :id="`assistant-fullscreen-${pane.id}`"
404
- :ref="(el) => setAssistantHost(pane.id, el)"
405
- v-show="assistant.isFullscreenTab(pane.activeId) && !(templateLibraryOpen && pane.id === templatePaneId)"
406
- class="assistant-fullscreen-host workspace-card"
407
- />
408
- <div v-show="!assistant.isFullscreenTab(pane.activeId) && !(templateLibraryOpen && pane.id === templatePaneId)" class="workspace-page-content"
409
- :class="{ 'workspace-card': tabsEnabled && !compactPanes }">
410
- <ButtonVisibilityGroup
411
- v-if="!isAuxiliaryWindow || pane.activeId === CALENDAR_TAB_ID || tab?.pluginView"
412
- v-slot="{ isVisible }"
413
- :items="
414
- topbarVisibilityItems(pane.activeId, !!active, pane.id === store.activePaneId)
415
- "
416
- preference-key="tano.preference.documentHiddenTools"
417
- tag="header"
418
- :group-class="pane.activeId === GRAPH_TAB_ID ? 'topbar graph-topbar' : 'topbar'"
419
- :label="pane.activeId === GRAPH_TAB_ID ? t('图谱顶部栏') : t('文档顶部栏')"
420
- :menu-label="t('顶部栏显示设置')"
421
- @open="closeButtonVisibilityMenus"
422
- >
423
- <div
424
- v-if="
425
- (native && !tabsEnabled && (isVisible('back') || isVisible('forward'))) ||
426
- (!sidebar && !(native && !mobile && workspace))
427
- "
428
- class="topbar-navigation"
429
- role="group"
430
- :aria-label="pane.activeId === GRAPH_TAB_ID ? t('图谱导航') : t('文档导航')"
431
- >
432
- <button
433
- v-if="!sidebar && !(native && !mobile && workspace)"
434
- type="button"
435
- class="icon-button"
436
- :aria-label="t('展开侧栏')"
437
- :data-tooltip="t('展开侧栏')" :data-tooltip-shortcut="shortcuts.toggleSidebar"
438
- @click="toggleSidebar"
439
- >
440
- <PanelLeftOpen :size="16" :stroke-width="1.6" />
441
- </button>
442
- <button
443
- v-if="native && !tabsEnabled && isVisible('back')"
444
- type="button"
445
- class="icon-button"
446
- :aria-label="t('后退')"
447
- :data-tooltip="t('后退')"
448
- :disabled="!canNavigatePage(-1)"
449
- @click="navigatePage(-1)"
450
- >
451
- <ArrowLeft :size="16" :stroke-width="1.6" />
452
- </button>
453
- <button
454
- v-if="native && !tabsEnabled && isVisible('forward')"
455
- type="button"
456
- class="icon-button"
457
- :aria-label="t('前进')"
458
- :data-tooltip="t('前进')"
459
- :disabled="!canNavigatePage(1)"
460
- @click="navigatePage(1)"
461
- >
462
- <ArrowRight :size="16" :stroke-width="1.6" />
463
- </button>
464
- </div>
465
- <WorkspaceBreadcrumb
466
- :loading="filesPending"
467
- :perch="{ id: `breadcrumb:${paneButterflyScope(pane.id, pane.activeId)}`, scope: paneButterflyScope(pane.id, pane.activeId), label: t('面包屑'), kind: 'component' }"
468
- v-if="
469
- isVisible('breadcrumb') &&
470
- pane.activeId !== CALENDAR_TAB_ID &&
471
- pane.activeId !== GRAPH_TAB_ID
472
- "
473
- :workspace-id="workspace?.id"
474
- :workspace-name="workspace?.name ?? 'Tano'"
475
- :workspace-icon="store.workspaceSettings.icon"
476
- :workspace-mode="store.isDemo ? 'demo' : store.isWeb ? 'web' : 'local'"
477
- :entries="workspace?.files ?? []"
478
- :folder-home-file-name="store.workspaceSettings.folderHomeFileName"
479
- :document-icons="treeDocumentIcons"
480
- :load-document-icon="loadTreeDocumentIcon"
481
- :path="tab?.path"
482
- :directory="!!tab?.directory"
483
- :workspace-view="tab?.workspaceView?.view"
484
- :demo-label="store.isDemo ? workspaceStatusLabel : undefined"
485
- :read-only="workspace?.readOnly"
486
- @open="(file) => { store.focusPane(pane.id); openEntry(file); }"
487
- @open-directory="(path) => { store.focusPane(pane.id); void openBreadcrumbDirectory(path); }"
488
- >
489
- <template #status>
490
- <DocumentStatus v-if="tab?.pluginView && isVisible('document-status')"
491
- :document-key="`${workspace?.id}:${tab.pluginView.pluginId}:${tab.pluginView.id}:${pluginViewHeader(store.pluginRuntime, tab.pluginView)?.title}`"
492
- :items="pluginPreviewStatus(store.pluginRuntime, tab.pluginView)" />
493
- <DocumentStatus v-if="active && isVisible('document-status')" :document-key="`${workspace?.id}:${active.id}`" :items="paneDocumentStatus(active)">
494
- <component :is="extensions.regions['document-status-details']"
495
- v-if="pane.id === store.activePaneId && extensions.regions['document-status-details']" :actions="extensionActions" />
496
- </DocumentStatus>
497
- <DocumentStatus v-else-if="tab?.attachment && isVisible('document-status')" :document-key="`${workspace?.id}:${tab.attachment.id}`" :items="attachmentStatus(pane.id, tab.attachment)">
498
- <button v-if="currentAttachmentStatus(pane.id, tab.attachment)?.retry" :disabled="currentAttachmentStatus(pane.id, tab.attachment)?.retryDisabled" @click="currentAttachmentStatus(pane.id, tab.attachment)?.retry?.()">{{ t('重试') }}</button>
499
- </DocumentStatus>
500
- </template>
501
- <template v-if="tab?.pluginDetail"><ChevronRight :size="12" /><Puzzle :size="14" /><span class="breadcrumb-current">{{ tab.pluginDetail.name }}</span></template>
502
- <template v-if="tab?.pluginView"><ChevronRight :size="12" /><Puzzle :size="14" /><span class="breadcrumb-current" :title="pluginViewHeader(store.pluginRuntime, tab.pluginView)?.title">{{ pluginViewHeader(store.pluginRuntime, tab.pluginView)?.title || tab.pluginView.label }}</span></template>
503
- <template v-if="pane.activeId === PLUGINS_TAB_ID"
504
- ><ChevronRight :size="12" /><Puzzle :size="14" /><span class="breadcrumb-current"
505
- >{{ t('插件') }}</span
506
- ></template
507
- ><template
508
- v-for="view in [...extensionViews, settingsTabView].filter((view) => view.id === pane.activeId)"
509
- :key="view.id"
510
- ><component :is="view.icon" :size="14" /><span
511
- class="breadcrumb-current"
512
- >{{ view.label }}</span
513
- ></template
514
- >
515
- </WorkspaceBreadcrumb>
516
- <DocumentStatus v-if="(active || tab?.attachment) && !isVisible('breadcrumb') && isVisible('document-status')"
517
- :document-key="`${workspace?.id}:${active?.id ?? tab?.attachment?.id}`" :items="active ? paneDocumentStatus(active) : attachmentStatus(pane.id, tab?.attachment)">
518
- <component v-if="active && pane.id === store.activePaneId && extensions.regions['document-status-details']" :is="extensions.regions['document-status-details']"
519
- :actions="extensionActions" />
520
- <button v-if="!active && currentAttachmentStatus(pane.id, tab?.attachment)?.retry" :disabled="currentAttachmentStatus(pane.id, tab?.attachment)?.retryDisabled" @click="currentAttachmentStatus(pane.id, tab?.attachment)?.retry?.()">{{ t('重试') }}</button>
521
- </DocumentStatus>
522
- <div class="topbar-right">
523
- <PluginViewHeader v-if="tab?.pluginView && workspace" :view="tab.pluginView" :workspace-id="workspace.id"
524
- :runtime="store.pluginRuntime.find(item => item.id === tab.pluginView?.pluginId)" :execute="store.interactWithPlugin" />
525
- <button v-if="active && touchLayout && showOutline" type="button" class="icon-button"
526
- :aria-label="t('文档大纲')" :aria-expanded="touchOutlineOpen"
527
- @click="panel = 'outline'; touchOutlineOpen = !touchOutlineOpen">
528
- <List :size="18" />
529
- </button>
530
- <button
531
- v-if="tab?.attachment && attachments && isVisible('attachment-export')"
532
- type="button"
533
- class="topbar-attachment-action"
534
- :aria-label="t('导出附件')"
535
- :data-tooltip="t('导出附件副本')"
536
- @click="
537
- attachments
538
- .exportAttachment(workspace!.id, tab.attachment.path)
539
- .catch(store.report)
540
- "
541
- >
542
- <ArrowDownToLine :size="16" /><span>{{ t('导出') }}</span>
543
- </button>
544
- <div :id="`attachment-controls-${pane.id}`" class="attachment-controls-host" v-show="!!tab?.attachment" />
545
- <component
546
- :is="extensions.regions['editing-status']"
547
- v-if="
548
- isVisible('editing-status') &&
549
- pane.id === store.activePaneId &&
550
- extensions.regions['editing-status']
551
- "
552
- :actions="extensionActions"
553
- />
554
- <span
555
- v-if="
556
- workspaceStatusLabel &&
557
- (!store.isDemo ||
558
- !isVisible('breadcrumb') ||
559
- pane.activeId === CALENDAR_TAB_ID ||
560
- pane.activeId === GRAPH_TAB_ID)
561
- "
562
- :class="store.isDemo ? 'demo-badge' : 'local-badge'"
563
- :title="store.isDemo ? t('浏览器演示 · 数据仅保存在本浏览器') : undefined"
564
- >
565
- <LockKeyhole v-if="workspace?.readOnly" :size="14" />
566
- {{ workspaceStatusLabel }}
567
- </span>
568
- <div
569
- :id="`graph-controls-${pane.id}`"
570
- v-show="pane.activeId === GRAPH_TAB_ID"
571
- class="graph-toolbar-host"
572
- />
573
- <div
574
- v-if="isTableTab(pane.activeId)"
575
- :id="`data-table-controls-${pane.id}`"
576
- />
577
- <div
578
- v-if="
579
- pane.activeId === CALENDAR_TAB_ID &&
580
- calendarToolItems.some((item) => isVisible(item.id))
581
- "
582
- class="calendar-topbar-controls"
583
- role="group"
584
- :aria-label="t('日历导航')"
585
- >
586
- <span v-if="isVisible('calendar-period')" class="calendar-topbar-period">{{
587
- calendarPeriod
588
- }}</span>
589
- <button
590
- v-if="isVisible('calendar-today')"
591
- type="button"
592
- class="calendar-topbar-today"
593
- @click="calendarDate = new Date()"
594
- >
595
- {{ t('今天') }}
596
- </button>
597
- <button
598
- v-if="isVisible('calendar-previous')"
599
- type="button"
600
- class="icon-button"
601
- :aria-label="t('上一时段')"
602
- :data-tooltip="t('上一时段')"
603
- @click="moveCalendarPeriod(-1)"
604
- >
605
- <ChevronLeft :size="17" />
606
- </button>
607
- <button
608
- v-if="isVisible('calendar-next')"
609
- type="button"
610
- class="icon-button"
611
- :aria-label="t('下一时段')"
612
- :data-tooltip="t('下一时段')"
613
- @click="moveCalendarPeriod(1)"
614
- >
615
- <ChevronRight :size="17" />
616
- </button>
617
- <div
618
- v-if="isVisible('calendar-mode')"
619
- class="calendar-view-picker"
620
- @keydown.esc.stop.prevent="calendarModeOpen = false"
621
- >
622
- <button
623
- type="button"
624
- class="calendar-topbar-mode"
625
- :aria-label="t('切换日历视图')"
626
- :data-tooltip="t('Ctrl + 滚轮:切换日历视图')"
627
- aria-haspopup="menu"
628
- :aria-expanded="calendarModeOpen"
629
- @click="calendarModeOpen = !calendarModeOpen"
630
- >
631
- {{ calendarModeLabel }}<ChevronDown :size="14" />
632
- </button>
633
- <div v-surface-motion="'App:4'"
634
- v-if="calendarModeOpen"
635
- class="calendar-view-menu"
636
- role="menu"
637
- :aria-label="t('日历视图')"
638
- >
639
- <button
640
- v-for="option in calendarModeOptions"
641
- :key="option.mode"
642
- type="button"
643
- role="menuitemradio"
644
- :aria-checked="calendarMode === option.mode"
645
- @click="selectCalendarMode(option.mode)"
646
- >
647
- {{ option.label }}<Check v-if="calendarMode === option.mode" :size="15" />
648
- </button>
649
- </div>
650
- </div>
651
- <button
652
- v-if="isVisible('calendar-events')"
653
- type="button"
654
- class="calendar-topbar-events"
655
- :data-tooltip="t('查看和管理事件')"
656
- @click="managePlanEvents"
657
- >
658
- <CalendarDays :size="15" />{{ t('管理事件') }}
659
- </button>
660
- </div>
661
- <div v-if="active && documentSuggestions.get(active.id)?.mode && !editing.isManaging(active.id)"
662
- class="suggestion-mode-badge" role="status" :aria-label="t('建议模式已开启')">
663
- <MessageSquareDiff :size="14" /><span>{{ t('建议模式') }}</span>
664
- <button type="button" :aria-label="t('退出建议模式')" :data-tooltip="t('退出建议模式')"
665
- :disabled="suggestionModeBusy || documentSuggestions.get(active.id)?.reviewing"
666
- @click="toggleSuggestionMode(active.id)"><X :size="14" /></button>
667
- </div>
668
- <template v-if="active">
669
- <div
670
- v-if="documentToolItems.some((item) => isVisible(item.id))"
671
- class="document-tool-buttons"
672
- >
673
- <MarkdownRevealToggle
674
- v-if="isVisible('markdown-reveal')"
675
- v-model="revealMarkdown"
676
- :source="paneSource(pane.activeId)"
677
- :shortcut="shortcuts.toggleMarkdownReveal"
678
- />
679
- <button
680
- v-if="isVisible('source-mode')"
681
- type="button"
682
- class="icon-button source-mode-button"
683
- :class="{ active: paneSource(pane.activeId) }"
684
- :disabled="
685
- editing.isManaging(pane.activeId) ||
686
- (pane.id === store.activePaneId && editing.activeBusy)
687
- "
688
- :aria-label="paneSource(pane.activeId) ? t('返回编辑') : t('切换源码模式')"
689
- :aria-pressed="paneSource(pane.activeId)"
690
- :aria-keyshortcuts="shortcutAriaLabel(shortcuts.toggleSource) || undefined"
691
- :data-tooltip-shortcut="shortcutKeys(shortcuts.toggleSource)[0]"
692
- :data-tooltip="
693
- editing.isManaging(pane.activeId)
694
- ? t('当前编辑扩展不支持切换源码模式')
695
- : paneSource(pane.activeId)
696
- ? t('返回编辑')
697
- : t('切换源码模式')
698
- "
699
- @click="setPaneSource(pane.activeId, !paneSource(pane.activeId))"
700
- >
701
- <SourceCodeIcon :size="17" :off="!paneSource(pane.activeId)" />
702
- </button>
703
- </div>
704
- <div class="menu-wrap">
705
- <button
706
- class="icon-button"
707
- :aria-label="t('文档操作')"
708
- v-butterfly-perch="{ id: `document-actions:${paneButterflyScope(pane.id, pane.activeId)}`, scope: paneButterflyScope(pane.id, pane.activeId), label: t('文档操作按钮'), kind: 'component' }"
709
- :aria-expanded="menu && pane.id === store.activePaneId"
710
- @click="toggleDocumentMenu"
711
- @keydown="documentMenuTriggerKeydown"
712
- >
713
- <MoreHorizontal :size="19" />
714
- </button>
715
- <div v-surface-motion="'App:5'"
716
- v-if="menu && pane.id === store.activePaneId"
717
- :ref="(el) => { context.documentMenuElement = (el as HTMLElement | null) ?? undefined; }"
718
- class="dropdown compact-action-menu document-dropdown"
719
- @keydown="documentMenuKeydown"
720
- >
721
- <PluginMenu location="document" :file-id="active.id" @selected="menu = false" />
722
- <button type="button" @click="openPaneSearch(pane.id)">
723
- <Search :size="15" />{{ t('页内搜索') }}<span class="menu-shortcut"><ShortcutHint :label="shortcutHint('pageSearch')" /></span>
724
- </button>
725
- <button type="button" @click="openPaneSearch(pane.id, true)">
726
- <Repeat2 :size="15" />{{ t('查找与替换') }}<span class="menu-shortcut"><ShortcutHint :label="shortcutHint('pageReplace')" /></span>
727
- </button>
728
- <button
729
- type="button"
730
- :disabled="editorReadonly || !documentUndoAvailable"
731
- @click="undoDocument"
732
- >
733
- <Undo2 :size="15" />{{ t('撤销') }}<kbd class="menu-shortcut" aria-hidden="true"><ShortcutHint :label="shortcutHint('undo')" /></kbd>
734
- </button>
735
- <button
736
- type="button"
737
- :disabled="editorReadonly || !documentRedoAvailable"
738
- @click="redoDocument"
739
- >
740
- <Redo2 :size="15" />{{ t('重做') }}<kbd class="menu-shortcut" aria-hidden="true"><ShortcutHint :label="shortcutHint('redo')" /></kbd>
741
- </button>
742
- <button
743
- @click="
744
- menu = false;
745
- store.flush();
746
- "
747
- >
748
- <CheckCheck :size="15" />{{ t('立即保存') }}<span class="menu-shortcut"><ShortcutHint :label="shortcutHint('save')" /></span>
749
- </button>
750
- <div class="menu-divider" role="separator" />
751
- <button type="button" :disabled="!canAddDocumentProperty" @click="addDocumentProperty">
752
- <Plus :size="15" />{{ t('添加文档属性') }}
753
- </button>
754
- <button type="button"
755
- :disabled="editorReadonly || !!editing.active || editing.activeBusy || !paneComments.has(store.activePaneId)"
756
- @click="openDocumentDiscussion">
757
- <MessageSquare :size="15" />{{ t('发起讨论') }}
758
- </button>
759
- <button type="button"
760
- :disabled="suggestionModeBusy || (!documentSuggestions.get(active.id)?.mode && (paneReadonly(active) || editing.isManaging(active.id) || editing.activeBusy)) || documentSuggestions.get(active.id)?.loading || documentSuggestions.get(active.id)?.reviewing"
761
- @click="toggleSuggestionMode(active.id)">
762
- <MessageSquareDiff :size="15" />{{ documentSuggestions.get(active.id)?.mode ? t('退出建议模式') : t('建议编辑') }}
763
- </button>
764
- <div class="menu-divider" role="separator" />
765
- <button
766
- type="button"
767
- aria-haspopup="dialog"
768
- :aria-expanded="referenceGraphOpened"
769
- @click="showReferenceGraph(pane.id, active!)"
770
- >
771
- <GitFork :size="15" />{{ t('查看关系图谱') }}
772
- </button>
773
- <button
774
- type="button"
775
- class="page-toggle-menu-item"
776
- role="switch"
777
- :aria-checked="!limitPageWidth"
778
- :aria-busy="store.capabilitySaving || undefined"
779
- :disabled="!pageWidthWritable"
780
- :data-tooltip="t('切换页面内容宽度')"
781
- @click="setLimitPageWidth(!limitPageWidth)"
782
- >
783
- <MoveHorizontal :size="15" />{{ t('全宽') }}<span
784
- class="menu-switch"
785
- :class="{ on: !limitPageWidth }"
786
- aria-hidden="true"
787
- ><span
788
- /></span>
789
- </button>
790
- <button
791
- type="button"
792
- class="page-toggle-menu-item"
793
- role="switch"
794
- :aria-checked="workspaceLocked || pageLocked"
795
- :disabled="workspaceLocked"
796
- :data-tooltip="workspaceLocked ? t('请先关闭工作区锁定,再修改页面锁定') : pageLocked ? t('退出阅读模式') : t('锁定后进入阅读模式')"
797
- @click="togglePageLock"
798
- >
799
- <LockKeyhole :size="15" />{{ t('锁定页面') }}<span
800
- class="menu-switch"
801
- :class="{ on: workspaceLocked || pageLocked }"
802
- aria-hidden="true"
803
- ><span
804
- /></span>
805
- </button>
806
- <div class="menu-divider" role="separator" />
807
- <button
808
- @click="
809
- menu = false;
810
- historyPage = 'versions';
811
- historyPanel = true;
812
- "
813
- >
814
- <Archive :size="15" />{{ t('版本历史') }}<span class="menu-beta">Beta</span>
815
- </button>
816
- <button
817
- @click="
818
- menu = false;
819
- historyPage = 'updates';
820
- historyPanel = true;
821
- "
822
- >
823
- <Clock3 :size="15" />{{ t('更新历史') }}
824
- </button>
825
- <DocumentGlobalMenu>
826
- <PageDisplayOptions :workspace-locked="workspaceLocked" :workspace-available="!!workspace"
827
- :auto-spacing="editorPreferences.autoSpacing ?? false"
828
- :show-page-title="showPageTitle"
829
- :show-document-properties="showDocumentProperties"
830
- :show-outline="showOutline"
831
- :show-all-line-numbers="showAllLineNumbers"
832
- :auxiliary-window="!!isAuxiliaryWindow"
833
- :source="paneSource(store.activeId)"
834
- @toggle="togglePageOption" @toggle-workspace-lock="toggleWorkspaceLock" />
835
- </DocumentGlobalMenu>
836
- <DocumentExportMenu :disabled="exportBusy" @select="exportDocument" />
837
- <DocumentPrintButton :busy="printBusy" :shortcut="shortcuts.print" @select="printActiveDocument" />
838
- <div class="menu-divider" role="separator" />
839
- <button
840
- class="danger-text"
841
- :disabled="
842
- editorReadonly ||
843
- sessionBlocksFileMutation(pane.activeId) ||
844
- (pane.id === store.activePaneId && editing.activeBusy)
845
- "
846
- @click="removeDocument()"
847
- >
848
- <Trash2 :size="15" />{{
849
- store.isDemo
850
- ? t('删除演示文档')
851
- : store.isWeb
852
- ? t('删除在线文档')
853
- : t('移入回收站')
854
- }}
855
- </button>
856
- </div>
857
- </div>
858
- </template>
859
- </div>
860
- </ButtonVisibilityGroup>
861
- <!-- Everything below the top bar (display: contents unless it is the card).
862
- .workspace-card marks the element that is the page's card where a layout draws cards (islands):
863
- with native tab strips the top bar belongs to the card, so the card is the whole page content;
864
- otherwise the top bar sits on the desk and the card is this body. -->
865
- <div class="workspace-page-body" :class="{ 'workspace-card': !(tabsEnabled && !compactPanes) }">
866
- <KeepAlive v-if="pane.tabs.includes(GRAPH_TAB_ID)">
867
- <RelationGraph
868
- v-if="workspace && pane.activeId === GRAPH_TAB_ID"
869
- :key="`${workspace.id}:${workspace.path}`"
870
- :open-in-new-tab="tabsEnabled"
871
- :controls-target="isAuxiliaryWindow ? undefined : `#graph-controls-${pane.id}`"
872
- />
873
- </KeepAlive>
273
+ </TemplateLibrary>
274
+ <div
275
+ :id="`assistant-fullscreen-${pane.id}`"
276
+ :ref="(el) => setAssistantHost(pane.id, el)"
277
+ v-show="assistant.isFullscreenTab(pane.activeId) && !(templateLibraryOpen && pane.id === templatePaneId)"
278
+ class="assistant-fullscreen-host workspace-card"
279
+ />
280
+ <div
281
+ v-show="!assistant.isFullscreenTab(pane.activeId) && !(templateLibraryOpen && pane.id === templatePaneId)"
282
+ class="workspace-page-content"
283
+ :class="{ 'workspace-card': tabsEnabled && !compactPanes }"
284
+ >
285
+ <PaneTopbar
286
+ v-if="!isAuxiliaryWindow || pane.activeId === CALENDAR_TAB_ID || tab?.pluginView"
287
+ :pane="pane"
288
+ :active="active"
289
+ :tab="tab"
290
+ :is-auxiliary-window="isAuxiliaryWindow"
291
+ />
292
+ <div class="workspace-page-body" :class="{ 'workspace-card': !(tabsEnabled && !compactPanes) }">
293
+ <KeepAlive v-if="pane.tabs.includes(GRAPH_TAB_ID)">
294
+ <RelationGraph
295
+ v-if="workspace && pane.activeId === GRAPH_TAB_ID"
296
+ :key="`${workspace.id}:${workspace.path}`"
297
+ :open-in-new-tab="tabsEnabled"
298
+ :controls-target="isAuxiliaryWindow ? undefined : `#graph-controls-${pane.id}`"
299
+ />
300
+ </KeepAlive>
874
301
 
875
- <div v-if="workspace && isTableTab(pane.activeId)" class="data-table-assistant-page">
876
- <DataTablePage
877
- :key="`${workspace.id}:${pane.activeId}`"
878
- :table-id="tableFileId(pane.activeId)"
879
- :touch-layout="touchLayout"
880
- :comment-author="extensions.commentAuthor?.() ?? { id: 'local', name: t('本机用户') }"
881
- :controls-target="isAuxiliaryWindow ? undefined : `#data-table-controls-${pane.id}`"
882
- />
883
- <AssistantLauncher
884
- v-if="assistant.available && !assistant.opened"
885
- :scope="paneButterflyScope(pane.id, pane.activeId)"
886
- :shortcut="shortcuts.toggleAssistant"
887
- :context-label="t('聊聊这张数据表')"
888
- :busy="assistant.busy || assistant.applying"
889
- @open="openAssistant(pane.id, pane.activeId, { forcePanel: true })"
890
- />
891
- </div>
892
- <FolderView v-if="workspace && tab?.directory" :directory="tab.directory" :entries="workspace.files"
893
- :folder-home-file-name="store.workspaceSettings.folderHomeFileName"
894
- :document-icons="treeDocumentIcons" :load-document-icon="loadTreeDocumentIcon"
895
- @open="(file) => { store.focusPane(pane.id); void openEntry(file); }"
896
- @up="() => { store.focusPane(pane.id); void openBreadcrumbDirectory(parentPath(tab.directory!.path)); }" />
897
- <WorkspaceViewTab
898
- v-if="workspace && pane.activeId.startsWith('workspace-view:')"
302
+ <div v-if="workspace && isTableTab(pane.activeId)" class="data-table-assistant-page">
303
+ <DataTablePage
899
304
  :key="`${workspace.id}:${pane.activeId}`"
900
- :tab-id="pane.activeId"
901
- @open-file="(file) => { store.focusPane(pane.id); void openWorkspaceViewSourceFile(file); }"
902
- @edit-document-properties="async (file) => { store.focusPane(pane.id); await openWorkspaceViewSourceFile(file); showDocumentProperties = true; setPaneSource(file.id, false); }"
903
- @open-object="(identity) => { store.focusPane(pane.id); openWorkspaceViewSourceObject(identity); }"
305
+ :table-id="tableFileId(pane.activeId)"
306
+ :touch-layout="touchLayout"
307
+ :comment-author="extensions.commentAuthor?.() ?? { id: 'local', name: t('本机用户') }"
308
+ :controls-target="isAuxiliaryWindow ? undefined : `#data-table-controls-${pane.id}`"
904
309
  />
905
- <CalendarView
906
- v-if="workspace && pane.activeId === CALENDAR_TAB_ID"
907
- :loading="calendarScope === 'workspace' && store.workspaceLoading.objects"
908
- :date="calendarDate"
909
- :mode="calendarMode"
910
- :records="plans.recordsFor(calendarScope)"
911
- @select-mode="selectCalendarMode"
912
- @visible-month="calendarDate = $event"
913
- @visible-year="calendarDate = $event"
914
- @visible-timeline="calendarDate = $event"
915
- @select-date="showCalendarDay"
916
- @select-month="showCalendarMonth"
917
- @select-event="showPlanEvent"
310
+ <AssistantLauncher
311
+ v-if="assistant.available && !assistant.opened"
312
+ :scope="paneButterflyScope(pane.id, pane.activeId)"
313
+ :shortcut="shortcuts.toggleAssistant"
314
+ :context-label="t('聊聊这张数据表')"
315
+ :busy="assistant.busy || assistant.applying"
316
+ @open="openAssistant(pane.id, pane.activeId, { forcePanel: true })"
918
317
  />
318
+ </div>
319
+ <FolderView
320
+ v-if="workspace && tab?.directory"
321
+ :directory="tab.directory"
322
+ :entries="workspace.files"
323
+ :folder-home-file-name="store.workspaceSettings.folderHomeFileName"
324
+ :document-icons="treeDocumentIcons"
325
+ :load-document-icon="loadTreeDocumentIcon"
326
+ @open="(file) => { store.focusPane(pane.id); void openEntry(file); }"
327
+ @up="() => { store.focusPane(pane.id); void openBreadcrumbDirectory(parentPath(tab.directory!.path)); }"
328
+ />
329
+ <CalendarView
330
+ v-if="workspace && pane.activeId === CALENDAR_TAB_ID"
331
+ :loading="calendarScope === 'workspace' && store.workspaceLoading.objects"
332
+ :date="calendarDate"
333
+ :mode="calendarMode"
334
+ :records="plans.recordsFor(calendarScope)"
335
+ @select-mode="selectCalendarMode"
336
+ @visible-month="calendarDate = $event"
337
+ @visible-year="calendarDate = $event"
338
+ @visible-timeline="calendarDate = $event"
339
+ @select-date="showCalendarDay"
340
+ @select-month="showCalendarMonth"
341
+ @select-event="showPlanEvent"
342
+ />
919
343
 
920
- <main v-if="pane.activeId === ASSISTANT_TAB_ID" class="assistant-page-placeholder"><button @click="openAssistantPage(store, assistant)">{{ t('打开助手') }}</button></main>
921
- <template v-for="view in extensionViews" :key="view.id">
922
- <component
923
- v-if="pane.activeId === view.id"
924
- :is="view.component"
925
- :actions="viewActions[view.id]"
926
- />
927
- </template>
928
-
929
- <WorkbenchSettings v-if="pane.activeId === SETTINGS_TAB_ID" tabbed />
930
- <PluginDetailPage v-if="tab?.pluginDetail" :plugin-id="tab.pluginDetail.id" />
931
- <PluginView v-else-if="pane.activeId.startsWith('plugin:')" :view-key="pane.activeId" />
932
- <main
933
- v-if="workspace && pane.tabs.includes(PLUGINS_TAB_ID)"
934
- v-show="pane.activeId === PLUGINS_TAB_ID"
935
- class="plugins-tab-page"
936
- >
937
- <div class="plugins-tab-content">
938
- <p v-if="!store.capabilities.features.objectReferences" class="tool-level-notice">
939
- {{ t('「工作区对象与引用」已关闭,插件对象和关系暂时只读。可在工作区设置中重新启用。') }}
940
- </p>
941
- <p v-else-if="workspace.readOnly" class="tool-level-notice">
942
- {{ t('此工作区为只读,无法修改对象和关系。') }}
943
- </p>
944
- <PluginInstaller @objects="showObjects()">
945
- <template v-if="extensions.regions['plugin-publishing']" #publishing>
946
- <component :is="extensions.regions['plugin-publishing']" :actions="extensionActions" />
947
- </template>
948
- </PluginInstaller>
949
- </div>
950
- </main>
951
-
952
- <DocumentLoading v-if="(!active && sessionPending) || store.restoringDocuments[pane.activeId] || store.openingDocuments[pane.id]?.tabId === pane.activeId" :unlimited="!limitPageWidth" :touch="touchLayout" :style="{ '--tano-prose-font-family': selectedVisualFontFamily, '--tano-prose-font-size': `${visualFontSize}px` }" />
953
- <template v-else-if="active">
954
- <PageSearch
955
- :shortcuts="shortcuts"
956
- :key="`search:${active.id}`"
957
- :ref="(el) => setPaneSearch(pane.id, el)"
958
- :editor="
959
- paneSource(pane.activeId)
960
- ? paneSourceEditors.get(pane.id)
961
- : paneEditors.get(pane.id)
962
- "
963
- :content="active.content"
964
- :readonly="paneReadonly(active!)"
965
- :revision="paneSearchRevisions[pane.id]"
966
- />
967
- <div :key="active.id" class="document-scroll-shell" :class="{ 'has-assistant-launcher': assistant.available }">
968
- <div
969
- :id="`document-scroll-${pane.id}`"
970
- :ref="(el) => setPaneElement('scroll', pane.id, el)"
971
- class="document-layout"
972
- :data-toolbar-dock="
973
- pane.id === store.activePaneId &&
974
- !paneSource(pane.activeId) &&
975
- !paneReadonly(active!)
976
- ? toolbarMode
977
- : undefined
978
- "
979
- @scroll.passive="scheduleActiveHeading"
980
- >
981
- <main class="document-main">
982
- <LayoutDocumentChrome :layout="appearance.layout" :path="active.path" />
983
- <EditorTools
984
- :shortcuts="shortcuts"
985
- v-model:mode="toolbarMode"
986
- :assistant="assistant.available"
987
- :assistant-disabled="assistantTaskActive()"
988
- @assistant="openAssistant(pane.id, active!.id)"
989
- annotation
990
- :todo="
991
- store.capabilities.features.objectReferences &&
992
- !paneReadonly(active!) &&
993
- !editing.isManaging(active!.id)
994
- "
995
- @todo="beginSelectionTodo(pane.id, active!.id)"
996
- @annotation="paneComments.get(pane.id)?.beginAnnotation()"
997
- :active="pane.id === store.activePaneId"
998
- :editor-element="paneEditorScrolls.get(pane.id)"
999
- :features="store.capabilities.features"
1000
- :context="paneSelections[pane.id] ?? defaultSelectionContext"
1001
- :source="paneSource(pane.activeId)"
1002
- :disabled="paneReadonly(active!)"
1003
- @command="(name, value) => paneEditors.get(pane.id)?.command(name, value)"
1004
- >
1005
- <template v-if="isAuxiliaryWindow || showSourceTodo(pane.id, active!)" #trailing>
1006
- <button
1007
- v-if="showSourceTodo(pane.id, active!)"
1008
- type="button"
1009
- class="icon-button"
1010
- :aria-label="t('从选区创建任务或事件')"
1011
- :data-tooltip="t('从选区创建任务或事件')"
1012
- @mousedown.prevent
1013
- @click="beginSelectionTodo(pane.id, active!.id)"
1014
- >
1015
- <ListTodo :size="17" />
1016
- </button>
1017
- <ButtonVisibilityGroup
1018
- v-if="isAuxiliaryWindow"
1019
- v-slot="{ isVisible }"
1020
- :items="documentToolItems"
1021
- preference-key="tano.preference.documentHiddenTools"
1022
- group-class="detached-editor-actions document-tool-buttons"
1023
- :label="t('文档工具')"
1024
- :menu-label="t('文档工具按钮显示设置')"
1025
- @open="closeButtonVisibilityMenus"
1026
- >
1027
- <MarkdownRevealToggle
1028
- v-if="isVisible('markdown-reveal')"
1029
- v-model="revealMarkdown"
1030
- :source="paneSource(pane.activeId)"
1031
- :shortcut="shortcuts.toggleMarkdownReveal"
1032
- />
1033
- <button
1034
- v-if="isVisible('source-mode')"
1035
- type="button"
1036
- class="icon-button"
1037
- :class="{ active: paneSource(pane.activeId) }"
1038
- :disabled="!!editing.active || editing.activeBusy"
1039
- :aria-label="paneSource(pane.activeId) ? t('返回编辑') : t('切换源码模式')"
1040
- :aria-pressed="paneSource(pane.activeId)"
1041
- :aria-keyshortcuts="shortcutAriaLabel(shortcuts.toggleSource) || undefined"
1042
- :data-tooltip-shortcut="shortcutKeys(shortcuts.toggleSource)[0]"
1043
- :data-tooltip="paneSource(pane.activeId) ? t('返回编辑') : t('切换源码模式')"
1044
- @click="setPaneSource(pane.activeId, !paneSource(pane.activeId))"
1045
- >
1046
- <SourceCodeIcon :size="17" :off="!paneSource(pane.activeId)" />
1047
- </button>
1048
- </ButtonVisibilityGroup>
1049
- </template>
1050
- </EditorTools>
344
+ <main v-if="pane.activeId === ASSISTANT_TAB_ID" class="assistant-page-placeholder">
345
+ <button @click="openAssistantPage(store, assistant)">{{ t('打开助手') }}</button>
346
+ </main>
347
+ <template v-for="view in extensionViews" :key="view.id">
348
+ <component
349
+ v-if="pane.activeId === view.id"
350
+ :is="view.component"
351
+ :actions="viewActions[view.id]"
352
+ />
353
+ </template>
1051
354
 
1052
- <component
1053
- :is="extensions.regions['editing-panel']"
1054
- v-if="pane.id === store.activePaneId && extensions.regions['editing-panel']"
1055
- :actions="extensionActions"
1056
- />
1057
- <p v-if="active.creating && !active.error" class="creation-status" role="status">
1058
- {{ t('正在创建… 可以继续编辑') }}
1059
- </p>
1060
- <div v-if="active.conflict" class="conflict-banner" role="alert">
1061
- <AlertTriangle :size="19" />
1062
- <div>
1063
- <strong>{{ t('这一页有两份新的想法') }}</strong>
1064
- <p>
1065
- {{ t('外部修改与你的修改重叠。你的内容已保存为 conflict 副本,原文件保留外部版本。') }}
1066
- </p>
1067
- <button @click="store.resolveConflict(active!, true)">
1068
- {{ t('打开我的副本') }} <ArrowUpRight :size="14" /></button
1069
- ><button @click="store.resolveConflict(active!, false)">
1070
- {{ t('载入磁盘版本') }}
1071
- </button>
1072
- <button
1073
- @click="
1074
- selectedDiff = {
1075
- title: active.path,
1076
- before: active.conflict.disk.content,
1077
- after: active.content,
1078
- beforeLabel: t('磁盘版本'),
1079
- afterLabel: t('我的副本'),
1080
- }
1081
- "
1082
- >
1083
- {{ t('比较两个版本') }}
1084
- </button>
1085
- </div>
1086
- </div>
1087
- <div
1088
- v-else-if="active.missing || active.error"
1089
- class="conflict-banner"
1090
- role="alert"
1091
- >
1092
- <AlertTriangle :size="19" />
1093
- <div>
1094
- <strong>{{
1095
- active.missing ? t('文件已在工作文件夹中移除') : active.creating ? t('文档尚未创建成功') : t('这次保存没有完成')
1096
- }}</strong>
1097
- <p>
1098
- {{
1099
- active.error ?? t('编辑器中的内容仍然保留,你可以把它另存为一个新文档。')
1100
- }}
1101
- </p>
1102
- <button @click="showModal('saveAs')">
1103
- {{ t('另存副本') }} <ArrowUpRight :size="14" /></button
1104
- ><button v-if="!active.missing" @click="store.flush()">{{ t('重试保存') }}</button>
1105
- </div>
1106
- </div>
1107
- <div
1108
- :ref="(el) => setPaneElement('editor', pane.id, el)"
1109
- class="editor-scroll"
1110
- :style="{
1111
- '--tano-prose-font-family': selectedVisualFontFamily,
1112
- '--tano-prose-font-size': `${visualFontSize}px`,
1113
- '--tano-source-font-size': `${sourceFontSize}px`,
1114
- }"
1115
- :class="{
1116
- 'source-view': paneSource(pane.activeId),
1117
- 'conflicted-editor': active.conflict,
1118
- 'width-unlimited': !limitPageWidth,
1119
- }"
1120
- tabindex="-1"
1121
- @mousedown.self="
1122
- !paneSource(pane.activeId) &&
1123
- paneEditors.get(pane.id)?.focusTrailingParagraph($event)
1124
- "
1125
- @contextmenu="openPageContextMenu"
1126
- >
1127
- <DocumentSuggestions v-slot="suggestions" :document="active" :readonly="paneReadonly(active!)"
1128
- :source="paneSource(pane.activeId)"
1129
- :managed="!!editing.active" :author="extensions.commentAuthor?.() ?? { id: 'local', name: t('本机用户') }">
1130
- <DocumentTitle
1131
- v-if="workspace && showPageTitle"
1132
- :key="`${workspace.id}:${active.id}`"
1133
- :workspace-id="workspace.id"
1134
- :document-id="active.id"
1135
- :path="store.displayPath(active)"
1136
- :title-source="store.workspaceSettings.pageTitleSource"
1137
- :model-value="suggestions.content"
1138
- :files="workspace.files"
1139
- :mode="store.isDemo ? 'demo' : store.isWeb ? 'web' : 'local'"
1140
- :resolve-image="(reference) => attachments ? attachments.imageUrl(workspace, active!.path, reference) : safeRemoteImage(reference)"
1141
- :upload-cover="attachments && !store.isDemo ? (file) => uploadFile(file, true, active) : undefined"
1142
- :resource-revision="resourceRevision"
1143
- :readonly="
1144
- suggestions.readonly ||
1145
- suggestions.suggesting ||
1146
- active.missing ||
1147
- sessionBlocksFileMutation(active.id) ||
1148
- editing.activeBusy
1149
- "
1150
- :rename="renameDocumentTitle"
1151
- @update:model-value="suggestions.edit($event)"
1152
- @enter="insertBlockBelowTitle"
1153
- @comment="paneComments.get(pane.id)?.showDiscussion()"
1154
- />
1155
- <SourceEditor :reference-targets="store.referenceTargets" :capabilities="store.capabilities" :preferences="documentEditorPreferences" :suggestion-marks="suggestions.sourceMarks" :translate="t"
1156
- :show-all-line-numbers="showAllLineNumbers"
1157
- v-if="paneSource(pane.activeId)"
1158
- :key="active.id"
1159
- :content-revision="suggestions.viewKey"
1160
- :ref="(el) => setPaneElement('source', pane.id, el)"
1161
- :model-value="suggestions.content"
1162
- :readonly="suggestions.readonly"
1163
- :local-native="!!attachments && !suggestions.suggesting"
1164
- :comment-anchors="commentAnchors[active.id]"
1165
- @ready="paneEditorReady(pane.id, active!.id, true)"
1166
- @selection-change="paneSourceSelections[pane.id] = $event"
1167
- @update:model-value="suggestions.edit($event)"
1168
- @files="
1169
- (files, requireImage, position) =>
1170
- insertSourceFiles(files, position, requireImage, active, pane.id)
1171
- "
1172
- />
1173
- <MarkdownEditor :shortcut-hints="{ delete: shortcutHint('deleteBlock'), 'move-up': shortcutHint('moveBlockUp'), 'move-down': shortcutHint('moveBlockDown'), indent: shortcutHint('indentBlock'), outdent: shortcutHint('outdentBlock') }" :suggestion-marks="suggestions.richMarks" :transform-change="suggestions.transformChange"
1174
- v-else
1175
- :custom-callout-icon="CalloutIconPicker"
1176
- :content-revision="suggestions.viewKey"
1177
- :key="`${active.id}:${active.id === store.active?.id ? (editing.active?.key ?? 'local') : 'local'}`"
1178
- :ref="(el) => setPaneEditor(pane.id, el)"
1179
- :document-id="active.id"
1180
- :readonly="suggestions.readonly"
1181
- :open-links-on-tap="touchLayout"
1182
- :reveal-markdown="suggestions.suggesting ? false : revealMarkdown"
1183
- :show-document-properties="showDocumentProperties"
1184
- :capabilities="store.capabilities"
1185
- :reference-targets="store.referenceTargets"
1186
- :preferences="documentEditorPreferences"
1187
- :translate="t"
1188
- :extension="
1189
- active.id === store.active?.id ? editing.active?.extension : undefined
1190
- "
1191
- :model-value="suggestions.content"
1192
- :table-layouts="active.tableLayout?.file.tables"
1193
- :comment-anchors="commentAnchors[active.id]"
1194
- :resolve-image="
1195
- (reference) =>
1196
- attachments
1197
- ? attachments.imageUrl(workspace, active!.path, reference)
1198
- : safeRemoteImage(reference)
1199
- "
1200
- :resource-revision="resourceRevision"
1201
- :import-file="
1202
- attachments && !suggestions.suggesting ? (file, image) => uploadFile(file, image, active) : undefined
1203
- "
1204
- @update:model-value="suggestions.edit($event)"
1205
- @table-layout-change="!suggestions.suggesting && store.editTableLayout(active!.id, $event)"
1206
- @error="store.report"
1207
- @ready="paneEditorReady(pane.id, active!.id, false)"
1208
- @search-change="
1209
- paneSearchRevisions[pane.id] = (paneSearchRevisions[pane.id] ?? 0) + 1
1210
- "
1211
- @open-link="
1212
- (reference, newTab) => openDocumentLink(reference, newTab, active!.path)
1213
- "
1214
- @open-wiki-link="openWikiLink"
1215
- @open-reference="openReference"
1216
- @edit-source="setPaneSource(pane.activeId, true)"
1217
- @selection-change="paneSelections[pane.id] = $event"
1218
- @blank-block-ai="openBlankBlockAssistant(pane.id, active!.id)"
1219
- >
1220
- <template v-if="!suggestions.suggesting && !active.missing && !active.conflict && !active.error" #empty-document>
1221
- <DocumentStarter :assistant="assistant.available" :assistant-busy="assistant.busy || assistant.applying || assistant.loading"
1222
- @draft="startDocumentDraft(pane.id, active!.id)"
1223
- @initialize="quickInitialize(pane.id, active!.id, $event)"
1224
- @template="chooseInitialTemplate(pane.id, active!.id)" />
1225
- </template>
1226
- </MarkdownEditor>
1227
- <DocumentComments
1228
- v-if="workspace"
1229
- v-model:discussion-visible="showDocumentDiscussion"
1230
- :ref="(el) => setPaneComments(pane.id, el)"
1231
- :workspace-id="workspace.id"
1232
- :document="active"
1233
- :assistant="assistant.available"
1234
- @assistant="discussWithAssistant(pane.id, active!.id, $event)"
1235
- :readonly="suggestions.readonly"
1236
- :author="extensions.commentAuthor?.() ?? { id: 'local', name: t('本机用户') }"
1237
- :capture-selection="() => capturePaneCommentSelection(pane.id, active!.id)"
1238
- :focus-anchor="(anchor) => focusPaneComment(pane.id, active!.id, anchor)"
1239
- :editor-element="paneEditorScrolls.get(pane.id)"
1240
- :geometry="(anchors) => paneCommentGeometry(pane.id, active!.id, anchors)"
1241
- @annotations="commentAnchors[active!.id] = $event"
1242
- />
1243
- </DocumentSuggestions>
1244
- </div>
1245
- </main>
1246
- </div>
1247
- <DocumentScrollbar v-if="!touchLayout" :scroll-element="paneScrolls.get(pane.id)" />
1248
- <AssistantLauncher
1249
- v-if="assistant.available && !assistant.opened"
1250
- :scope="paneButterflyScope(pane.id, active!.id)"
1251
- :shortcut="shortcuts.toggleAssistant"
1252
- :busy="assistant.busy || assistant.applying"
1253
- @open="openAssistant(pane.id, active!.id, { forcePanel: true })"
1254
- />
1255
- </div>
1256
- </template>
355
+ <WorkbenchSettings v-if="pane.activeId === SETTINGS_TAB_ID" tabbed />
356
+ <MailWorkspaceView v-else-if="mailEnabled && pane.activeId === MAIL_TAB_ID" />
357
+ <PluginDetailPage
358
+ v-if="tab?.pluginDetail"
359
+ :plugin-id="tab.pluginDetail.id"
360
+ :developer-mode="developerMode"
361
+ />
362
+ <PluginView v-else-if="pane.activeId.startsWith('plugin:')" :view-key="pane.activeId" />
363
+ <PluginsTabPage
364
+ v-if="workspace && pane.tabs.includes(PLUGINS_TAB_ID)"
365
+ v-show="pane.activeId === PLUGINS_TAB_ID"
366
+ :workspace="workspace"
367
+ :object-references-enabled="store.capabilities.features.objectReferences"
368
+ :developer-mode="developerMode"
369
+ :extensions="extensions"
370
+ :extension-actions="extensionActions"
371
+ @enable-developer-mode="developerMode = true"
372
+ @create-object="createPluginObject"
373
+ />
1257
374
 
1258
- <AttachmentPreview
1259
- v-else-if="workspace && pane.activeId.startsWith('attachment:')"
1260
- status-managed
1261
- @status="receiveAttachmentStatus(pane.id, $event)"
1262
- :read-only="!!workspace.readOnly || updateLock || busy"
1263
- :controls-target="isAuxiliaryWindow ? undefined : `#attachment-controls-${pane.id}`"
1264
- :file="tab?.attachment"
1265
- :workspace-id="workspace.id"
1266
- :url="
1267
- attachments && tab?.attachment && fileHandlers.resolve(tab.attachment.path).preview !== 'office'
1268
- ? attachments.imageUrl(
1269
- workspace,
1270
- '',
1271
- relativeWorkspaceReference('', tab.attachment.path),
1272
- )
1273
- : null
1274
- "
375
+ <DocumentLoading
376
+ v-if="
377
+ (!active && sessionPending) ||
378
+ store.restoringDocuments[pane.activeId] ||
379
+ store.openingDocuments[pane.id]?.tabId === pane.activeId
380
+ "
381
+ :unlimited="!limitPageWidth"
382
+ :touch="touchLayout"
383
+ :style="{
384
+ '--tano-prose-font-family': selectedVisualFontFamily,
385
+ '--tano-prose-font-size': `${visualFontSize}px`,
386
+ }"
387
+ />
388
+ <DocumentPane
389
+ v-else-if="active"
390
+ :pane="pane"
391
+ :active="active"
392
+ :is-auxiliary-window="isAuxiliaryWindow"
393
+ />
394
+ <AttachmentPreview
395
+ v-else-if="workspace && pane.activeId.startsWith('attachment:')"
396
+ status-managed
397
+ @status="receiveAttachmentStatus(pane.id, $event)"
398
+ :read-only="!!workspace.readOnly || updateLock || busy"
399
+ :controls-target="isAuxiliaryWindow ? undefined : `#attachment-controls-${pane.id}`"
400
+ :file="tab?.attachment"
401
+ :workspace-id="workspace.id"
402
+ :url="
403
+ attachments &&
404
+ tab?.attachment &&
405
+ fileHandlers.resolve(tab.attachment.path).preview !== 'office'
406
+ ? attachments.imageUrl(
407
+ workspace,
408
+ '',
409
+ relativeWorkspaceReference('', tab.attachment.path),
410
+ )
411
+ : null
412
+ "
413
+ />
414
+ <main
415
+ v-else-if="showEmptyPaneFallback(pane.activeId, tab)"
416
+ class="workspace-no-tabs"
417
+ :class="{ 'workspace-no-tabs-loading': sessionPending }"
418
+ >
419
+ <DocumentLoading
420
+ v-if="sessionPending"
421
+ :unlimited="!limitPageWidth"
422
+ :touch="touchLayout"
423
+ :style="{
424
+ '--tano-prose-font-family': selectedVisualFontFamily,
425
+ '--tano-prose-font-size': `${visualFontSize}px`,
426
+ }"
1275
427
  />
1276
- <main
1277
- v-else-if="
1278
- (workspace || startupPending) &&
1279
- pane.activeId !== GRAPH_TAB_ID &&
1280
- pane.activeId !== PLUGINS_TAB_ID &&
1281
- pane.activeId !== CALENDAR_TAB_ID &&
1282
- pane.activeId !== SETTINGS_TAB_ID &&
1283
- !isTableTab(pane.activeId) &&
1284
- !pane.activeId.startsWith('workspace-view:') &&
1285
- !pane.activeId.startsWith('plugin:') &&
1286
- !tab?.workspaceView &&
1287
- !tab?.directory &&
1288
- !tab?.pluginView &&
1289
- !extensionViews.find((view) => view.id === pane.activeId)
1290
- "
1291
- class="workspace-no-tabs"
1292
- :class="{ 'workspace-no-tabs-loading': sessionPending }"
428
+ <div
429
+ v-else-if="workspace && activeOverlayTabView(pane.activeId)"
430
+ class="plugin-overlay-tab-host"
1293
431
  >
1294
- <DocumentLoading v-if="sessionPending" :unlimited="!limitPageWidth" :touch="touchLayout" :style="{ '--tano-prose-font-family': selectedVisualFontFamily, '--tano-prose-font-size': `${visualFontSize}px` }" />
1295
- <EmptyEditor v-else
1296
- :create-disabled="busy || !workspace || workspace.readOnly || updateLock"
1297
- @create="createNewDocument"
1298
- @open="showModal('newTab')"
1299
- @search="showModal('search')"
432
+ <PluginSurface
433
+ :key="`${workspace.id}:${activeOverlayTabView(pane.activeId)!.key}`"
434
+ :view="activeOverlayTabView(pane.activeId)!"
435
+ :workspace-id="workspace.id"
436
+ :runtime="
437
+ store.pluginRuntime.find(
438
+ (runtime) => runtime.id === activeOverlayTabView(pane.activeId)!.pluginId,
439
+ )
440
+ "
441
+ :execute="store.interactWithPlugin"
1300
442
  />
1301
- </main>
1302
-
1303
- <aside
1304
- v-if="
1305
- active &&
1306
- !(assistant.opened && assistant.displayMode === 'sidebar') &&
1307
- !isAuxiliaryWindow &&
1308
- pane.id === store.activePaneId &&
1309
- (panel !== 'outline' || (showOutline && (!touchLayout || touchOutlineOpen)))
1310
- "
1311
- v-outline-motion
1312
- class="inspector"
1313
- :style="panel === 'outline' ? outlinePosition : undefined"
1314
- :class="{
1315
- 'inspector-outline': panel === 'outline',
1316
- 'inspector-outline-left': panel === 'outline' && outlineOnLeft,
1317
- 'inspector-hover-outline':
1318
- panel === 'outline' && !touchLayout && hoverOutline && !outlinePinned,
1319
- 'inspector-activity': panel === 'activity',
1320
- }"
1321
- :aria-label="panel === 'outline' ? t('文档目录') : t('文档动态')"
1322
- @contextmenu="openOutlineContextMenu"
1323
- @pointerleave="releaseOutlinePointerFocus"
1324
- >
1325
- <div class="inspector-surface">
1326
- <div v-if="panel === 'activity'" class="inspector-tabs">
1327
- <button @click="panel = 'outline'"><List :size="14" />{{ t('大纲') }}</button
1328
- ><button class="active" @click="panel = 'activity'">
1329
- <History :size="14" />{{ t('动态') }}
1330
- </button>
1331
- </div>
1332
- <div v-if="panel === 'outline'" class="outline-controls">
1333
- <span>{{ t('文档大纲') }}</span>
1334
- <button v-if="touchLayout" type="button" class="outline-control" :aria-label="t('关闭文档大纲')"
1335
- @click="touchOutlineOpen = false"><X :size="18" /></button>
1336
- <button
1337
- class="outline-control"
1338
- :class="{ active: outlineAutoCollapse }"
1339
- type="button"
1340
- :aria-label="t('自动折叠大纲')"
1341
- :data-tooltip="t('自动折叠大纲')"
1342
- :aria-pressed="outlineAutoCollapse"
1343
- @click="outlineAutoCollapse = !outlineAutoCollapse"
1344
- >
1345
- <ListTree :size="15" />
1346
- </button>
1347
- <button
1348
- class="outline-control"
1349
- :class="{ active: outlineSearchOpen }"
1350
- type="button"
1351
- :aria-label="t('搜索大纲标题')"
1352
- :data-tooltip="t('搜索大纲标题')"
1353
- :aria-expanded="outlineSearchOpen"
1354
- @click="toggleOutlineSearch"
1355
- >
1356
- <Search :size="15" />
1357
- </button>
1358
- <button
1359
- v-if="hoverOutline"
1360
- class="outline-control"
1361
- :class="{ active: outlinePinned }"
1362
- type="button"
1363
- :aria-label="outlinePinned ? t('取消固定大纲') : t('固定大纲')"
1364
- :data-tooltip="outlinePinned ? t('取消固定大纲') : t('固定大纲')"
1365
- :aria-pressed="outlinePinned"
1366
- @click="toggleOutlinePin"
1367
- >
1368
- <Pin :size="15" :fill="outlinePinned ? 'currentColor' : 'none'" />
1369
- </button>
1370
- </div>
1371
- <div v-if="panel === 'outline' && outlineSearchOpen" class="outline-search">
1372
- <Search :size="14" aria-hidden="true" />
1373
- <input
1374
- :ref="(el) => { context.outlineSearchInput = (el as HTMLInputElement | null) ?? undefined; }"
1375
- v-model="outlineSearch"
1376
- type="search"
1377
- :aria-label="t('搜索当前文档标题')"
1378
- :placeholder="t('搜索标题')"
1379
- autocomplete="off"
1380
- @keydown.enter="visibleOutline[0] && jumpToHeading(visibleOutline[0].index, true)"
1381
- @keydown.esc.stop.prevent="toggleOutlineSearch"
1382
- />
1383
- </div>
1384
- <DocumentOutline v-if="panel === 'outline'" :items="visibleOutline" :has-headings="!!outline.length" :active-index="activeHeading" @select="jumpToHeading($event, true)" />
1385
- <div v-else class="activity-list">
1386
- <p class="activity-explainer">{{ t('这个会话中的文件变化。外部编辑者身份暂不可识别。') }}</p>
1387
- <button v-if="localNative" class="secondary-button" @click="agentPanel = true">
1388
- <Bot :size="14" />{{ t('工作区指引与 MCP 活动') }}
1389
- </button>
1390
- <div v-for="item in activities" :key="item.id" class="activity-item">
1391
- <span class="activity-icon" :class="item.kind"
1392
- ><component
1393
- :is="
1394
- item.kind === 'conflict'
1395
- ? AlertTriangle
1396
- : item.kind === 'external'
1397
- ? RefreshCw
1398
- : item.kind === 'save'
1399
- ? Check
1400
- : FileText
1401
- "
1402
- :size="13"
1403
- /></span>
1404
- <div>
1405
- <strong>{{ item.label }}</strong>
1406
- <p>{{ item.detail }}</p>
1407
- <button
1408
- v-if="item.change"
1409
- class="activity-diff-button"
1410
- @click="selectedDiff = { title: item.detail, ...item.change }"
1411
- >
1412
- {{ t('查看差异') }}
1413
- </button>
1414
- <time>{{
1415
- new Date(item.time).toLocaleTimeString(uiLocale, {
1416
- hour: '2-digit',
1417
- minute: '2-digit',
1418
- })
1419
- }}</time>
1420
- </div>
1421
- </div>
1422
- </div>
1423
- <div v-if="panel === 'activity'" class="inspector-footer">
1424
- <span class="live-dot" />{{
1425
- store.isDemo
1426
- ? t('浏览器本地存储')
1427
- : store.isWeb
1428
- ? t('定期检查服务器修改')
1429
- : t('正在监听工作文件夹')
1430
- }}
1431
- </div>
1432
- </div>
1433
- </aside>
1434
443
  </div>
1435
- </div>
1436
- </template>
1437
- </WorkspacePanes>
444
+ <EmptyEditor
445
+ v-else
446
+ :create-disabled="busy || !workspace || workspace.readOnly || updateLock"
447
+ @create="createNewDocument"
448
+ @open="showModal('newTab')"
449
+ @search="showModal('search')"
450
+ />
451
+ </main>
452
+
453
+ <DocumentInspector
454
+ v-if="
455
+ active &&
456
+ !(assistant.opened && assistant.displayMode === 'sidebar') &&
457
+ !isAuxiliaryWindow &&
458
+ pane.id === store.activePaneId &&
459
+ (activeDocumentSidebarView ||
460
+ (showOutline && (!touchLayout || touchOutlineOpen)))
461
+ "
462
+ />
463
+ </div>
464
+ </div>
465
+ </template>
466
+ </WorkspacePanes>
1438
467
  </template>