@tano.page/workbench 0.14.0 → 0.15.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 +21 -8
- package/src/App.vue +76 -17
- 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/components/AssistantChangeList.vue +98 -21
- package/src/assistant/components/AssistantPanel.vue +424 -7
- package/src/assistant/components/PluginToolProposalCard.vue +235 -0
- package/src/assistant/engine.ts +56 -3
- package/src/assistant/files.ts +5 -13
- package/src/assistant/inbox.ts +1 -148
- package/src/assistant/locales/de-DE.json +4 -1
- package/src/assistant/locales/en-US.json +4 -1
- package/src/assistant/locales/es-ES.json +4 -1
- package/src/assistant/locales/ja-JP.json +4 -1
- package/src/assistant/locales/zh-CN.json +4 -1
- package/src/assistant/locales/zh-TW.json +4 -1
- package/src/assistant/mention-autocomplete.ts +69 -0
- package/src/assistant/prompts.ts +7 -0
- package/src/assistant/results.ts +20 -86
- package/src/assistant/store.ts +319 -12
- package/src/assistant/structures.ts +7 -5
- package/src/assistant/tasks.ts +3 -5
- 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-history.ts +2 -4
- package/src/composables/use-workbench-modals.ts +6 -1
- package/src/composables/use-workbench-outline.ts +0 -5
- package/src/composables/use-workbench-shortcuts.ts +26 -22
- package/src/data-tables/data-tables.ts +1 -2
- package/src/documents/components/DocumentHistoryPanel.vue +3 -1
- package/src/features.ts +1 -0
- 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/locales/de-DE.json +349 -3
- package/src/i18n/locales/en-US.json +349 -2
- package/src/i18n/locales/es-ES.json +349 -3
- package/src/i18n/locales/ja-JP.json +348 -2
- package/src/i18n/locales/zh-TW.json +348 -2
- package/src/mail/components/MailAccountDialog.vue +449 -0
- package/src/mail/components/MailComposerDialog.vue +325 -0
- package/src/mail/components/MailProviderIcon.vue +30 -0
- package/src/mail/components/MailWorkspaceView.vue +820 -0
- package/src/mail/components/SidebarMail.vue +133 -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/workspace-objects.ts +1 -1
- package/src/plan-sync/types.ts +6 -3
- package/src/plans/calendar-interaction.ts +194 -0
- package/src/plans/calendar.ts +63 -7
- package/src/plans/components/CalendarDayPopover.vue +172 -39
- package/src/plans/components/CalendarView.vue +1736 -276
- package/src/plans/components/PlanArchiveDialog.vue +295 -0
- 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/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 +129 -54
- package/src/plugins/components/PluginDocumentSlot.vue +63 -0
- package/src/plugins/components/PluginExplorer.vue +15 -21
- package/src/plugins/components/PluginImportDialog.vue +410 -0
- package/src/plugins/components/PluginInstaller.vue +39 -145
- package/src/plugins/components/PluginListItem.vue +3 -0
- package/src/plugins/components/PluginMaintenance.vue +21 -6
- package/src/plugins/components/PluginRuntimePanel.vue +3 -3
- package/src/plugins/components/PluginSettingsForm.vue +111 -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/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-permissions.ts +57 -0
- package/src/plugins/plugin-sdk.ts +174 -8
- 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 +3 -1
- 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/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 +101 -3
- package/src/settings/components/SettingsAppearancePage.vue +46 -0
- package/src/settings/components/SettingsDocumentsPage.vue +0 -1
- package/src/settings/components/settings-search.ts +2 -3
- package/src/shell/components/SidebarNavigation.vue +22 -2
- package/src/shell/components/WorkbenchContextMenus.vue +21 -8
- package/src/shell/components/WorkbenchModals.vue +27 -46
- package/src/shell/components/WorkbenchPanes.vue +267 -84
- package/src/shell/components/WorkspaceBreadcrumb.vue +6 -14
- package/src/shell/components/WorkspaceViewSwitcher.vue +12 -7
- package/src/shell/use-workbench.ts +116 -145
- package/src/shell/workbench-async-components.ts +14 -5
- 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-knowledge.ts +1 -113
- package/src/stores/workspace-plugins-state.ts +537 -14
- package/src/stores/workspace-tabs-layout.ts +5 -43
- package/src/stores/workspace.ts +69 -66
- 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 +1 -1
- package/src/tabs/components/DesktopTabs.vue +0 -3
- package/src/tabs/components/NewTabPicker.vue +10 -4
- package/src/tabs/tab-label.ts +0 -1
- package/src/workspace/components/WorkspaceGeneralSettings.vue +0 -13
- package/src/workspace/components/WorkspaceIconPicker.vue +28 -6
- package/src/workspace/workspace-comments.ts +11 -151
- package/src/workspace/workspace-welcome.ts +1 -1
- 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
|
@@ -39,7 +39,14 @@ import {
|
|
|
39
39
|
X,
|
|
40
40
|
} from 'lucide-vue-next';
|
|
41
41
|
import ShortcutHint from '@tano/editor/shortcut-hint';
|
|
42
|
+
import type { ExternalSlashCommand } from '@tano/editor/slash-commands';
|
|
43
|
+
import type {
|
|
44
|
+
ExternalCodeBlockRenderer,
|
|
45
|
+
ExternalEditorDecoration,
|
|
46
|
+
} from '@tano/editor/external-decorations';
|
|
42
47
|
import { vSurfaceMotion } from '@tano/editor/surface-motion';
|
|
48
|
+
import { pluginRecord } from '@tano/protocol';
|
|
49
|
+
import { createPluginUiSandbox } from '../../plugins/ui-sandbox';
|
|
43
50
|
import { isFeatureEnabled } from '../../features';
|
|
44
51
|
import { vOutlineMotion } from '../../documents/outline-motion';
|
|
45
52
|
import { layoutPanes } from '../pane-layout';
|
|
@@ -51,12 +58,12 @@ import {
|
|
|
51
58
|
DataTablePage,
|
|
52
59
|
DocumentComments,
|
|
53
60
|
EditorTools,
|
|
61
|
+
MailWorkspaceView,
|
|
54
62
|
MarkdownEditor,
|
|
55
63
|
PluginInstaller,
|
|
56
64
|
RelationGraph,
|
|
57
65
|
SourceEditor,
|
|
58
66
|
TemplateLibrary,
|
|
59
|
-
WorkspaceViewTab,
|
|
60
67
|
} from '../workbench-async-components';
|
|
61
68
|
import { workbenchContextKey } from '../workbench-context';
|
|
62
69
|
import AssistantLauncher from '../../assistant/components/AssistantLauncher.vue';
|
|
@@ -80,9 +87,12 @@ import MarkdownRevealToggle from '../../documents/components/MarkdownRevealToggl
|
|
|
80
87
|
import PageDisplayOptions from './PageDisplayOptions.vue';
|
|
81
88
|
import PageSearch from './PageSearch.vue';
|
|
82
89
|
import PluginDetailPage from '../../plugins/components/PluginDetailPage.vue';
|
|
90
|
+
import PluginDocumentSlot from '../../plugins/components/PluginDocumentSlot.vue';
|
|
83
91
|
import PluginMenu from '../../plugins/components/PluginMenu.vue';
|
|
92
|
+
import PluginSurface from '../../plugins/components/PluginSurface.vue';
|
|
84
93
|
import PluginView from '../../plugins/components/PluginView.vue';
|
|
85
94
|
import PluginViewHeader from '../../plugins/components/PluginViewHeader.vue';
|
|
95
|
+
import { resolveOverlayTabView } from '../../plugins/overlay-mapping';
|
|
86
96
|
import SourceCodeIcon from '../../documents/components/SourceCodeIcon.vue';
|
|
87
97
|
import WorkbenchSettings from '../../settings/components/WorkbenchSettings.vue';
|
|
88
98
|
import WorkspaceBreadcrumb from './WorkspaceBreadcrumb.vue';
|
|
@@ -150,10 +160,12 @@ const {
|
|
|
150
160
|
PLUGINS_TAB_ID,
|
|
151
161
|
extensionViews,
|
|
152
162
|
settingsTabView,
|
|
163
|
+
MAIL_TAB_ID,
|
|
164
|
+
mailEnabled,
|
|
165
|
+
mailTabView,
|
|
153
166
|
touchLayout,
|
|
154
167
|
showOutline,
|
|
155
168
|
touchOutlineOpen,
|
|
156
|
-
panel,
|
|
157
169
|
attachments,
|
|
158
170
|
isTableTab,
|
|
159
171
|
calendarToolItems,
|
|
@@ -165,7 +177,7 @@ const {
|
|
|
165
177
|
calendarModeOptions,
|
|
166
178
|
calendarMode,
|
|
167
179
|
selectCalendarMode,
|
|
168
|
-
|
|
180
|
+
openPlanArchive,
|
|
169
181
|
documentSuggestions,
|
|
170
182
|
editing,
|
|
171
183
|
suggestionModeBusy,
|
|
@@ -217,8 +229,6 @@ const {
|
|
|
217
229
|
tableFileId,
|
|
218
230
|
openAssistant,
|
|
219
231
|
parentPath,
|
|
220
|
-
openWorkspaceViewSourceFile,
|
|
221
|
-
openWorkspaceViewSourceObject,
|
|
222
232
|
calendarScope,
|
|
223
233
|
plans,
|
|
224
234
|
showCalendarDay,
|
|
@@ -227,7 +237,7 @@ const {
|
|
|
227
237
|
openAssistantPage,
|
|
228
238
|
viewActions,
|
|
229
239
|
SETTINGS_TAB_ID,
|
|
230
|
-
|
|
240
|
+
createPluginObject,
|
|
231
241
|
selectedVisualFontFamily,
|
|
232
242
|
visualFontSize,
|
|
233
243
|
setPaneSearch,
|
|
@@ -300,12 +310,178 @@ const {
|
|
|
300
310
|
const documentEditorPreferences = computed(() => isFeatureEnabled('markdownSpacingAutocomplete')
|
|
301
311
|
? editorPreferences.value
|
|
302
312
|
: { ...editorPreferences.value, completeTextSpacing: false });
|
|
313
|
+
|
|
314
|
+
function activeOverlayTabView(activeTabId: string) {
|
|
315
|
+
if (!workspace.value) return null;
|
|
316
|
+
return resolveOverlayTabView(activeTabId, {
|
|
317
|
+
safeMode: store.value.overlaySnapshot?.safeMode,
|
|
318
|
+
homeTabView: store.value.pluginHomeTabView,
|
|
319
|
+
newTabView: store.value.pluginNewTabView,
|
|
320
|
+
});
|
|
321
|
+
}
|
|
303
322
|
const compactPanes = computed(() => !isAuxiliaryWindow && mainCompactPanes.value);
|
|
304
323
|
// The fullscreen host is shared across windows; only its owner may mount the panel.
|
|
305
324
|
const ownsFullscreenAssistant = computed(() => {
|
|
306
325
|
const layout = store.value.windowLayouts[windowContext.id]?.layout;
|
|
307
326
|
return !!layout && layoutPanes(layout).some(pane => pane.id === assistant.value.fullscreenPaneId);
|
|
308
327
|
});
|
|
328
|
+
const documentSidebarViews = computed(() =>
|
|
329
|
+
store.value.pluginViews.filter((view) => view.location === 'documentSidebar'),
|
|
330
|
+
);
|
|
331
|
+
const activeDocumentSidebarView = computed(() =>
|
|
332
|
+
documentSidebarViews.value.find((view) => view.key === store.value.activeDocumentPluginSidebar),
|
|
333
|
+
);
|
|
334
|
+
function selectDocumentPluginSidebar(key: string) {
|
|
335
|
+
store.value.activeDocumentPluginSidebar = key;
|
|
336
|
+
const view = documentSidebarViews.value.find((item) => item.key === key);
|
|
337
|
+
if (view) {
|
|
338
|
+
try {
|
|
339
|
+
store.value.openPluginView(view.pluginId, view.id);
|
|
340
|
+
} catch {
|
|
341
|
+
/* Ignore if workspace is switching. */
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
function editorPluginSlashCommands(fileId: string): ExternalSlashCommand[] {
|
|
346
|
+
const ws = workspace.value;
|
|
347
|
+
if (!ws) return [];
|
|
348
|
+
return store.value.pluginSlashCommands.map((cmd) => ({
|
|
349
|
+
id: cmd.key,
|
|
350
|
+
label: cmd.label,
|
|
351
|
+
marker: cmd.pluginName,
|
|
352
|
+
keywords: [...(cmd.keywords ?? []), cmd.pluginName, cmd.id].join(' '),
|
|
353
|
+
description: cmd.description,
|
|
354
|
+
execute: () => {
|
|
355
|
+
void store.value
|
|
356
|
+
.interactWithPlugin({
|
|
357
|
+
workspaceId: ws.id,
|
|
358
|
+
pluginId: cmd.pluginId,
|
|
359
|
+
instanceId: cmd.instanceId,
|
|
360
|
+
kind: 'command',
|
|
361
|
+
name: cmd.command,
|
|
362
|
+
payload: { workspaceId: ws.id, fileId, source: 'slash' },
|
|
363
|
+
})
|
|
364
|
+
.catch((error) => store.value.report(String(error)));
|
|
365
|
+
},
|
|
366
|
+
}));
|
|
367
|
+
}
|
|
368
|
+
function editorPluginDecorations(fileId: string): ExternalEditorDecoration[] {
|
|
369
|
+
const ws = workspace.value;
|
|
370
|
+
if (!ws) return [];
|
|
371
|
+
return store.value.pluginDecorationsFor(fileId).map((item) => ({
|
|
372
|
+
key: item.key,
|
|
373
|
+
from: item.from,
|
|
374
|
+
to: item.to,
|
|
375
|
+
tone: item.tone,
|
|
376
|
+
badge: item.badge,
|
|
377
|
+
tooltip: item.tooltip,
|
|
378
|
+
...(item.command
|
|
379
|
+
? {
|
|
380
|
+
onClick: () => {
|
|
381
|
+
void store.value
|
|
382
|
+
.interactWithPlugin({
|
|
383
|
+
workspaceId: ws.id,
|
|
384
|
+
pluginId: item.pluginId,
|
|
385
|
+
instanceId: item.instanceId,
|
|
386
|
+
kind: 'command',
|
|
387
|
+
name: item.command!,
|
|
388
|
+
payload: {
|
|
389
|
+
workspaceId: ws.id,
|
|
390
|
+
fileId,
|
|
391
|
+
source: 'decoration',
|
|
392
|
+
decorationId: item.id,
|
|
393
|
+
from: item.from,
|
|
394
|
+
to: item.to,
|
|
395
|
+
},
|
|
396
|
+
})
|
|
397
|
+
.catch((error) => store.value.report(String(error)));
|
|
398
|
+
},
|
|
399
|
+
}
|
|
400
|
+
: {}),
|
|
401
|
+
}));
|
|
402
|
+
}
|
|
403
|
+
const codeBlockRendererCache = new Map<
|
|
404
|
+
string,
|
|
405
|
+
{ source: readonly unknown[]; list: ExternalCodeBlockRenderer[] }
|
|
406
|
+
>();
|
|
407
|
+
function editorPluginCodeBlockRenderers(fileId: string): ExternalCodeBlockRenderer[] {
|
|
408
|
+
const ws = workspace.value;
|
|
409
|
+
const source = store.value.pluginCodeBlockRenderers;
|
|
410
|
+
if (!ws || !source.length) return [];
|
|
411
|
+
const cacheKey = `${ws.id}:${fileId}`;
|
|
412
|
+
const cached = codeBlockRendererCache.get(cacheKey);
|
|
413
|
+
if (cached && cached.source === source) return cached.list;
|
|
414
|
+
const list: ExternalCodeBlockRenderer[] = source.map((renderer) => ({
|
|
415
|
+
id: `${renderer.key}:${renderer.instanceId}`,
|
|
416
|
+
languages: renderer.languages,
|
|
417
|
+
label: renderer.label ?? renderer.pluginName,
|
|
418
|
+
height: renderer.height,
|
|
419
|
+
mount(container, context) {
|
|
420
|
+
const workspaceId = ws.id;
|
|
421
|
+
const diagnostic = (level: string, message: string) => {
|
|
422
|
+
void store.value
|
|
423
|
+
.interactWithPlugin({
|
|
424
|
+
workspaceId,
|
|
425
|
+
pluginId: renderer.pluginId,
|
|
426
|
+
instanceId: renderer.instanceId,
|
|
427
|
+
name: renderer.view,
|
|
428
|
+
kind: 'diagnostic',
|
|
429
|
+
payload: { level, message },
|
|
430
|
+
})
|
|
431
|
+
.catch(() => {});
|
|
432
|
+
};
|
|
433
|
+
const buildState = (ctx: { language: string; source: string; readonly: boolean }) => ({
|
|
434
|
+
kind: 'codeBlock',
|
|
435
|
+
fileId,
|
|
436
|
+
language: ctx.language,
|
|
437
|
+
source: ctx.source,
|
|
438
|
+
readonly: ctx.readonly,
|
|
439
|
+
});
|
|
440
|
+
const sandbox = createPluginUiSandbox(
|
|
441
|
+
container,
|
|
442
|
+
renderer.bundle,
|
|
443
|
+
buildState(context),
|
|
444
|
+
async (payload) => {
|
|
445
|
+
if (
|
|
446
|
+
pluginRecord(payload) &&
|
|
447
|
+
payload.type === 'codeBlock.updateSource' &&
|
|
448
|
+
typeof payload.source === 'string' &&
|
|
449
|
+
payload.source.length <= 200 * 1024 &&
|
|
450
|
+
!context.readonly
|
|
451
|
+
) {
|
|
452
|
+
context.updateSource(payload.source);
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
await store.value.interactWithPlugin({
|
|
456
|
+
workspaceId,
|
|
457
|
+
pluginId: renderer.pluginId,
|
|
458
|
+
instanceId: renderer.instanceId,
|
|
459
|
+
name: renderer.view,
|
|
460
|
+
kind: 'message',
|
|
461
|
+
payload: { fileId, language: context.language, payload },
|
|
462
|
+
});
|
|
463
|
+
},
|
|
464
|
+
(cause) => {
|
|
465
|
+
diagnostic('error', cause);
|
|
466
|
+
},
|
|
467
|
+
diagnostic,
|
|
468
|
+
);
|
|
469
|
+
return {
|
|
470
|
+
update(nextContext) {
|
|
471
|
+
sandbox.update(buildState(nextContext));
|
|
472
|
+
},
|
|
473
|
+
dispose() {
|
|
474
|
+
sandbox.dispose();
|
|
475
|
+
},
|
|
476
|
+
};
|
|
477
|
+
},
|
|
478
|
+
}));
|
|
479
|
+
codeBlockRendererCache.set(cacheKey, { source, list });
|
|
480
|
+
if (codeBlockRendererCache.size > 32) {
|
|
481
|
+
codeBlockRendererCache.delete(codeBlockRendererCache.keys().next().value!);
|
|
482
|
+
}
|
|
483
|
+
return list;
|
|
484
|
+
}
|
|
309
485
|
</script>
|
|
310
486
|
|
|
311
487
|
<template>
|
|
@@ -480,7 +656,6 @@ const ownsFullscreenAssistant = computed(() => {
|
|
|
480
656
|
:load-document-icon="loadTreeDocumentIcon"
|
|
481
657
|
:path="tab?.path"
|
|
482
658
|
:directory="!!tab?.directory"
|
|
483
|
-
:workspace-view="tab?.workspaceView?.view"
|
|
484
659
|
:demo-label="store.isDemo ? workspaceStatusLabel : undefined"
|
|
485
660
|
:read-only="workspace?.readOnly"
|
|
486
661
|
@open="(file) => { store.focusPane(pane.id); openEntry(file); }"
|
|
@@ -505,7 +680,7 @@ const ownsFullscreenAssistant = computed(() => {
|
|
|
505
680
|
>{{ t('插件') }}</span
|
|
506
681
|
></template
|
|
507
682
|
><template
|
|
508
|
-
v-for="view in [...extensionViews, settingsTabView].filter((view) => view.id === pane.activeId)"
|
|
683
|
+
v-for="view in [...extensionViews, settingsTabView, ...(mailEnabled ? [mailTabView] : [])].filter((view) => view.id === pane.activeId)"
|
|
509
684
|
:key="view.id"
|
|
510
685
|
><component :is="view.icon" :size="14" /><span
|
|
511
686
|
class="breadcrumb-current"
|
|
@@ -524,7 +699,7 @@ const ownsFullscreenAssistant = computed(() => {
|
|
|
524
699
|
:runtime="store.pluginRuntime.find(item => item.id === tab.pluginView?.pluginId)" :execute="store.interactWithPlugin" />
|
|
525
700
|
<button v-if="active && touchLayout && showOutline" type="button" class="icon-button"
|
|
526
701
|
:aria-label="t('文档大纲')" :aria-expanded="touchOutlineOpen"
|
|
527
|
-
@click="
|
|
702
|
+
@click="touchOutlineOpen = !touchOutlineOpen">
|
|
528
703
|
<List :size="18" />
|
|
529
704
|
</button>
|
|
530
705
|
<button
|
|
@@ -652,10 +827,10 @@ const ownsFullscreenAssistant = computed(() => {
|
|
|
652
827
|
v-if="isVisible('calendar-events')"
|
|
653
828
|
type="button"
|
|
654
829
|
class="calendar-topbar-events"
|
|
655
|
-
:data-tooltip="t('
|
|
656
|
-
@click="
|
|
830
|
+
:data-tooltip="t('查看和恢复已归档事项')"
|
|
831
|
+
@click="openPlanArchive"
|
|
657
832
|
>
|
|
658
|
-
<
|
|
833
|
+
<Archive :size="15" />{{ t('已归档') }}
|
|
659
834
|
</button>
|
|
660
835
|
</div>
|
|
661
836
|
<div v-if="active && documentSuggestions.get(active.id)?.mode && !editing.isManaging(active.id)"
|
|
@@ -805,6 +980,7 @@ const ownsFullscreenAssistant = computed(() => {
|
|
|
805
980
|
</button>
|
|
806
981
|
<div class="menu-divider" role="separator" />
|
|
807
982
|
<button
|
|
983
|
+
v-if="extensions.historyEnabled && extensions.historyView"
|
|
808
984
|
@click="
|
|
809
985
|
menu = false;
|
|
810
986
|
historyPage = 'versions';
|
|
@@ -894,14 +1070,6 @@ const ownsFullscreenAssistant = computed(() => {
|
|
|
894
1070
|
:document-icons="treeDocumentIcons" :load-document-icon="loadTreeDocumentIcon"
|
|
895
1071
|
@open="(file) => { store.focusPane(pane.id); void openEntry(file); }"
|
|
896
1072
|
@up="() => { store.focusPane(pane.id); void openBreadcrumbDirectory(parentPath(tab.directory!.path)); }" />
|
|
897
|
-
<WorkspaceViewTab
|
|
898
|
-
v-if="workspace && pane.activeId.startsWith('workspace-view:')"
|
|
899
|
-
: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); }"
|
|
904
|
-
/>
|
|
905
1073
|
<CalendarView
|
|
906
1074
|
v-if="workspace && pane.activeId === CALENDAR_TAB_ID"
|
|
907
1075
|
:loading="calendarScope === 'workspace' && store.workspaceLoading.objects"
|
|
@@ -927,6 +1095,7 @@ const ownsFullscreenAssistant = computed(() => {
|
|
|
927
1095
|
</template>
|
|
928
1096
|
|
|
929
1097
|
<WorkbenchSettings v-if="pane.activeId === SETTINGS_TAB_ID" tabbed />
|
|
1098
|
+
<MailWorkspaceView v-else-if="mailEnabled && pane.activeId === MAIL_TAB_ID" />
|
|
930
1099
|
<PluginDetailPage v-if="tab?.pluginDetail" :plugin-id="tab.pluginDetail.id" />
|
|
931
1100
|
<PluginView v-else-if="pane.activeId.startsWith('plugin:')" :view-key="pane.activeId" />
|
|
932
1101
|
<main
|
|
@@ -941,7 +1110,15 @@ const ownsFullscreenAssistant = computed(() => {
|
|
|
941
1110
|
<p v-else-if="workspace.readOnly" class="tool-level-notice">
|
|
942
1111
|
{{ t('此工作区为只读,无法修改对象和关系。') }}
|
|
943
1112
|
</p>
|
|
944
|
-
<PluginInstaller @
|
|
1113
|
+
<PluginInstaller @create-object="createPluginObject">
|
|
1114
|
+
<template v-if="extensions.regions['plugin-forge']" #forge="{ canPublish, openPublishing }">
|
|
1115
|
+
<component
|
|
1116
|
+
:is="extensions.regions['plugin-forge']"
|
|
1117
|
+
:actions="extensionActions"
|
|
1118
|
+
:can-publish="canPublish"
|
|
1119
|
+
@open-publishing="openPublishing"
|
|
1120
|
+
/>
|
|
1121
|
+
</template>
|
|
945
1122
|
<template v-if="extensions.regions['plugin-publishing']" #publishing>
|
|
946
1123
|
<component :is="extensions.regions['plugin-publishing']" :actions="extensionActions" />
|
|
947
1124
|
</template>
|
|
@@ -1127,6 +1304,14 @@ const ownsFullscreenAssistant = computed(() => {
|
|
|
1127
1304
|
<DocumentSuggestions v-slot="suggestions" :document="active" :readonly="paneReadonly(active!)"
|
|
1128
1305
|
:source="paneSource(pane.activeId)"
|
|
1129
1306
|
:managed="!!editing.active" :author="extensions.commentAuthor?.() ?? { id: 'local', name: t('本机用户') }">
|
|
1307
|
+
<PluginDocumentSlot
|
|
1308
|
+
v-if="workspace && pane.id === store.activePaneId"
|
|
1309
|
+
location="documentHeader"
|
|
1310
|
+
:views="store.pluginViews"
|
|
1311
|
+
:runtimes="store.pluginRuntime"
|
|
1312
|
+
:workspace-id="workspace.id"
|
|
1313
|
+
:execute="store.interactWithPlugin"
|
|
1314
|
+
/>
|
|
1130
1315
|
<DocumentTitle
|
|
1131
1316
|
v-if="workspace && showPageTitle"
|
|
1132
1317
|
:key="`${workspace.id}:${active.id}`"
|
|
@@ -1173,6 +1358,9 @@ const ownsFullscreenAssistant = computed(() => {
|
|
|
1173
1358
|
<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
1359
|
v-else
|
|
1175
1360
|
:custom-callout-icon="CalloutIconPicker"
|
|
1361
|
+
:slash-commands="editorPluginSlashCommands(active.id)"
|
|
1362
|
+
:decorations="editorPluginDecorations(active.id)"
|
|
1363
|
+
:code-block-renderers="editorPluginCodeBlockRenderers(active.id)"
|
|
1176
1364
|
:content-revision="suggestions.viewKey"
|
|
1177
1365
|
:key="`${active.id}:${active.id === store.active?.id ? (editing.active?.key ?? 'local') : 'local'}`"
|
|
1178
1366
|
:ref="(el) => setPaneEditor(pane.id, el)"
|
|
@@ -1224,6 +1412,14 @@ const ownsFullscreenAssistant = computed(() => {
|
|
|
1224
1412
|
@template="chooseInitialTemplate(pane.id, active!.id)" />
|
|
1225
1413
|
</template>
|
|
1226
1414
|
</MarkdownEditor>
|
|
1415
|
+
<PluginDocumentSlot
|
|
1416
|
+
v-if="workspace && pane.id === store.activePaneId"
|
|
1417
|
+
location="documentFooter"
|
|
1418
|
+
:views="store.pluginViews"
|
|
1419
|
+
:runtimes="store.pluginRuntime"
|
|
1420
|
+
:workspace-id="workspace.id"
|
|
1421
|
+
:execute="store.interactWithPlugin"
|
|
1422
|
+
/>
|
|
1227
1423
|
<DocumentComments
|
|
1228
1424
|
v-if="workspace"
|
|
1229
1425
|
v-model:discussion-visible="showDocumentDiscussion"
|
|
@@ -1280,10 +1476,9 @@ const ownsFullscreenAssistant = computed(() => {
|
|
|
1280
1476
|
pane.activeId !== PLUGINS_TAB_ID &&
|
|
1281
1477
|
pane.activeId !== CALENDAR_TAB_ID &&
|
|
1282
1478
|
pane.activeId !== SETTINGS_TAB_ID &&
|
|
1479
|
+
(!mailEnabled || pane.activeId !== MAIL_TAB_ID) &&
|
|
1283
1480
|
!isTableTab(pane.activeId) &&
|
|
1284
|
-
!pane.activeId.startsWith('workspace-view:') &&
|
|
1285
1481
|
!pane.activeId.startsWith('plugin:') &&
|
|
1286
|
-
!tab?.workspaceView &&
|
|
1287
1482
|
!tab?.directory &&
|
|
1288
1483
|
!tab?.pluginView &&
|
|
1289
1484
|
!extensionViews.find((view) => view.id === pane.activeId)
|
|
@@ -1292,6 +1487,18 @@ const ownsFullscreenAssistant = computed(() => {
|
|
|
1292
1487
|
:class="{ 'workspace-no-tabs-loading': sessionPending }"
|
|
1293
1488
|
>
|
|
1294
1489
|
<DocumentLoading v-if="sessionPending" :unlimited="!limitPageWidth" :touch="touchLayout" :style="{ '--tano-prose-font-family': selectedVisualFontFamily, '--tano-prose-font-size': `${visualFontSize}px` }" />
|
|
1490
|
+
<div
|
|
1491
|
+
v-else-if="workspace && activeOverlayTabView(pane.activeId)"
|
|
1492
|
+
class="plugin-overlay-tab-host"
|
|
1493
|
+
>
|
|
1494
|
+
<PluginSurface
|
|
1495
|
+
:key="`${workspace.id}:${activeOverlayTabView(pane.activeId)!.key}`"
|
|
1496
|
+
:view="activeOverlayTabView(pane.activeId)!"
|
|
1497
|
+
:workspace-id="workspace.id"
|
|
1498
|
+
:runtime="store.pluginRuntime.find((runtime) => runtime.id === activeOverlayTabView(pane.activeId)!.pluginId)"
|
|
1499
|
+
:execute="store.interactWithPlugin"
|
|
1500
|
+
/>
|
|
1501
|
+
</div>
|
|
1295
1502
|
<EmptyEditor v-else
|
|
1296
1503
|
:create-disabled="busy || !workspace || workspace.readOnly || updateLock"
|
|
1297
1504
|
@create="createNewDocument"
|
|
@@ -1306,30 +1513,52 @@ const ownsFullscreenAssistant = computed(() => {
|
|
|
1306
1513
|
!(assistant.opened && assistant.displayMode === 'sidebar') &&
|
|
1307
1514
|
!isAuxiliaryWindow &&
|
|
1308
1515
|
pane.id === store.activePaneId &&
|
|
1309
|
-
(
|
|
1516
|
+
(activeDocumentSidebarView || (showOutline && (!touchLayout || touchOutlineOpen)))
|
|
1310
1517
|
"
|
|
1311
1518
|
v-outline-motion
|
|
1312
1519
|
class="inspector"
|
|
1313
|
-
:style="
|
|
1520
|
+
:style="!activeDocumentSidebarView ? outlinePosition : undefined"
|
|
1314
1521
|
:class="{
|
|
1315
|
-
'inspector-outline':
|
|
1316
|
-
'inspector-outline-left':
|
|
1522
|
+
'inspector-outline': !activeDocumentSidebarView,
|
|
1523
|
+
'inspector-outline-left': !activeDocumentSidebarView && outlineOnLeft,
|
|
1317
1524
|
'inspector-hover-outline':
|
|
1318
|
-
|
|
1319
|
-
'inspector-activity':
|
|
1525
|
+
!activeDocumentSidebarView && !touchLayout && hoverOutline && !outlinePinned,
|
|
1526
|
+
'inspector-activity': !!activeDocumentSidebarView,
|
|
1320
1527
|
}"
|
|
1321
|
-
:aria-label="
|
|
1528
|
+
:aria-label="
|
|
1529
|
+
activeDocumentSidebarView
|
|
1530
|
+
? `${activeDocumentSidebarView.pluginName} · ${activeDocumentSidebarView.label}`
|
|
1531
|
+
: t('文档目录')
|
|
1532
|
+
"
|
|
1322
1533
|
@contextmenu="openOutlineContextMenu"
|
|
1323
1534
|
@pointerleave="releaseOutlinePointerFocus"
|
|
1324
1535
|
>
|
|
1325
1536
|
<div class="inspector-surface">
|
|
1326
|
-
<div v-if="
|
|
1327
|
-
<button
|
|
1328
|
-
|
|
1329
|
-
|
|
1537
|
+
<div v-if="activeDocumentSidebarView || documentSidebarViews.length" class="inspector-tabs">
|
|
1538
|
+
<button
|
|
1539
|
+
:class="{ active: !activeDocumentSidebarView }"
|
|
1540
|
+
@click="store.activeDocumentPluginSidebar = ''"
|
|
1541
|
+
><List :size="14" />{{ t('大纲') }}</button>
|
|
1542
|
+
<button
|
|
1543
|
+
v-for="docView in documentSidebarViews"
|
|
1544
|
+
:key="docView.key"
|
|
1545
|
+
:class="{ active: activeDocumentSidebarView?.key === docView.key }"
|
|
1546
|
+
@click="selectDocumentPluginSidebar(docView.key)"
|
|
1547
|
+
>
|
|
1548
|
+
<Puzzle :size="14" />{{ docView.label }}
|
|
1330
1549
|
</button>
|
|
1331
1550
|
</div>
|
|
1332
|
-
<
|
|
1551
|
+
<PluginSurface
|
|
1552
|
+
v-if="activeDocumentSidebarView && workspace"
|
|
1553
|
+
:key="`${workspace.id}:${activeDocumentSidebarView.key}`"
|
|
1554
|
+
:view="activeDocumentSidebarView"
|
|
1555
|
+
:workspace-id="workspace.id"
|
|
1556
|
+
:runtime="store.pluginRuntime.find((rt) => rt.id === activeDocumentSidebarView!.pluginId)"
|
|
1557
|
+
:execute="store.interactWithPlugin"
|
|
1558
|
+
compact
|
|
1559
|
+
/>
|
|
1560
|
+
<template v-else>
|
|
1561
|
+
<div class="outline-controls">
|
|
1333
1562
|
<span>{{ t('文档大纲') }}</span>
|
|
1334
1563
|
<button v-if="touchLayout" type="button" class="outline-control" :aria-label="t('关闭文档大纲')"
|
|
1335
1564
|
@click="touchOutlineOpen = false"><X :size="18" /></button>
|
|
@@ -1368,7 +1597,7 @@ const ownsFullscreenAssistant = computed(() => {
|
|
|
1368
1597
|
<Pin :size="15" :fill="outlinePinned ? 'currentColor' : 'none'" />
|
|
1369
1598
|
</button>
|
|
1370
1599
|
</div>
|
|
1371
|
-
<div v-if="
|
|
1600
|
+
<div v-if="outlineSearchOpen" class="outline-search">
|
|
1372
1601
|
<Search :size="14" aria-hidden="true" />
|
|
1373
1602
|
<input
|
|
1374
1603
|
:ref="(el) => { context.outlineSearchInput = (el as HTMLInputElement | null) ?? undefined; }"
|
|
@@ -1381,54 +1610,8 @@ const ownsFullscreenAssistant = computed(() => {
|
|
|
1381
1610
|
@keydown.esc.stop.prevent="toggleOutlineSearch"
|
|
1382
1611
|
/>
|
|
1383
1612
|
</div>
|
|
1384
|
-
<DocumentOutline
|
|
1385
|
-
|
|
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>
|
|
1613
|
+
<DocumentOutline :items="visibleOutline" :has-headings="!!outline.length" :active-index="activeHeading" @select="jumpToHeading($event, true)" />
|
|
1614
|
+
</template>
|
|
1432
1615
|
</div>
|
|
1433
1616
|
</aside>
|
|
1434
1617
|
</div>
|
|
@@ -7,11 +7,11 @@ import { vSurfaceMotion } from '@tano/editor/surface-motion';
|
|
|
7
7
|
import { t } from '../../i18n/i18n';
|
|
8
8
|
import LoadingSkeleton from './LoadingSkeleton.vue';
|
|
9
9
|
import { computed, nextTick, onBeforeUnmount, onMounted, ref, useId, watch, type Component } from 'vue';
|
|
10
|
-
import { Check, ChevronRight
|
|
10
|
+
import { Check, ChevronRight } from 'lucide-vue-next';
|
|
11
11
|
import WorkspaceIcon from '../../workspace/components/WorkspaceIcon.vue';
|
|
12
12
|
import ResourceIcon from '../../files/components/ResourceIcon.vue';
|
|
13
13
|
import { indexFolderHomes, type FolderHomeFileName } from '../../files/folder-home';
|
|
14
|
-
import { basename, isMarkdown, isDataTableFilePath, isWorkspaceInternalPath, parentPath, type FileEntry
|
|
14
|
+
import { basename, isMarkdown, isDataTableFilePath, isWorkspaceInternalPath, parentPath, type FileEntry } from '@tano/protocol';
|
|
15
15
|
import { butterflyPerchDirective, useButterflyController, type ButterflyPerch } from '../../assistant/butterfly-vue';
|
|
16
16
|
import DocumentFileIcon from '../../documents/components/DocumentFileIcon.vue';
|
|
17
17
|
|
|
@@ -30,7 +30,6 @@ const props = defineProps<{
|
|
|
30
30
|
loadDocumentIcon?: (file: FileEntry, signal: AbortSignal) => Promise<string>;
|
|
31
31
|
path?: string;
|
|
32
32
|
directory?: boolean;
|
|
33
|
-
workspaceView?: WorkspaceViewDefinition;
|
|
34
33
|
pages?: { id: string; label: string; icon?: Component; current?: boolean; disabled?: boolean }[];
|
|
35
34
|
demoLabel?: string | null;
|
|
36
35
|
readOnly?: boolean;
|
|
@@ -47,13 +46,13 @@ const position = ref({ left: '0px', top: '0px' });
|
|
|
47
46
|
let trigger: HTMLButtonElement | undefined;
|
|
48
47
|
const currentFile = computed(() => props.entries.find(entry => entry.kind === 'file' && entry.path === props.path));
|
|
49
48
|
const homes = computed(() => indexFolderHomes(props.entries, props.folderHomeFileName));
|
|
50
|
-
const logicalPath = computed(() => props.
|
|
49
|
+
const logicalPath = computed(() => props.path ?? '');
|
|
51
50
|
const parts = computed(() => {
|
|
52
51
|
const names = logicalPath.value.split('/').filter(Boolean);
|
|
53
|
-
if (!props.directory &&
|
|
52
|
+
if (!props.directory && props.path && homes.value.get(parentPath(props.path))?.path === props.path) names.pop();
|
|
54
53
|
return names.map((name, index, all) => {
|
|
55
54
|
const path = all.slice(0, index + 1).join('/');
|
|
56
|
-
return { name, path, current:
|
|
55
|
+
return { name, path, current: index === all.length - 1, directory: !!props.directory || index < all.length - 1 || homes.value.has(path), home: homes.value.get(path) };
|
|
57
56
|
});
|
|
58
57
|
});
|
|
59
58
|
function activatePart(part: typeof parts.value[number]) {
|
|
@@ -155,7 +154,7 @@ function outside(event: Event) {
|
|
|
155
154
|
function onScroll(event: Event) {
|
|
156
155
|
if (!menu.value?.contains(event.target as Node)) placeMenu();
|
|
157
156
|
}
|
|
158
|
-
watch(() => [props.workspaceId, props.path,
|
|
157
|
+
watch(() => [props.workspaceId, props.path, logicalPath.value], () => close());
|
|
159
158
|
watch(children, async () => {
|
|
160
159
|
if (!opened.value) return;
|
|
161
160
|
if (folder.value && !props.entries.some(entry => entry.kind === 'directory' && entry.path === folder.value)) {
|
|
@@ -238,13 +237,6 @@ onBeforeUnmount(() => {
|
|
|
238
237
|
<ChevronRight :size="12" aria-hidden="true" />
|
|
239
238
|
</button>
|
|
240
239
|
</template>
|
|
241
|
-
<template v-if="workspaceView">
|
|
242
|
-
<ChevronRight v-if="!parts.length && pages?.length" :size="12" class="breadcrumb-separator" aria-hidden="true" />
|
|
243
|
-
<span class="breadcrumb-trigger breadcrumb-current" aria-current="page" :title="workspaceView.name" v-butterfly-perch="perch">
|
|
244
|
-
<component :is="workspaceView.database || workspaceView.objectDatabase ? Database : Table2" :size="14" aria-hidden="true" />
|
|
245
|
-
<span>{{ workspaceView.name }}</span>
|
|
246
|
-
</span>
|
|
247
|
-
</template>
|
|
248
240
|
<slot name="status" />
|
|
249
241
|
</nav>
|
|
250
242
|
<Teleport :to="document.body">
|
|
@@ -9,18 +9,23 @@ import { useWorkspaceStore } from '../../stores/workspace';
|
|
|
9
9
|
import { useAssistantStore } from '../../assistant/store';
|
|
10
10
|
import { computed, nextTick, onBeforeUnmount, onMounted, ref, useId, watch } from 'vue';
|
|
11
11
|
import PluginIcon from '../../plugins/components/PluginIcon.vue';
|
|
12
|
+
import { applyOverlayToWorkspaceViews } from '../../plugins/overlay-mapping';
|
|
12
13
|
import { Check, Ellipsis, FolderOpen, CalendarDays, Bot, Puzzle } from 'lucide-vue-next';
|
|
13
14
|
const store = useWorkspaceStore();
|
|
14
15
|
const assistant = useAssistantStore();
|
|
15
16
|
const props = defineProps<{ active: boolean; modelValue: string }>();
|
|
16
17
|
const emit = defineEmits<{ open: []; 'update:modelValue': [value: string] }>();
|
|
17
|
-
const views = computed(() =>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
const views = computed(() => {
|
|
19
|
+
const base = [
|
|
20
|
+
{ id: 'repository', label: t('文件'), icon: FolderOpen },
|
|
21
|
+
...(store.workspaceSettings.showPlan ? [{ id: 'events', label: t('事件与任务'), icon: CalendarDays }] : []),
|
|
22
|
+
...(assistant.available ? [{ id: 'assistant', label: t('助手'), icon: Bot }] : []),
|
|
23
|
+
...(store.workspaceSettings.showPlugins ? [{ id: 'plugin-views', label: t('插件'), icon: Puzzle }] : []),
|
|
24
|
+
...store.pluginViews.filter(view => view.location === 'sidebar').map(view => ({ id: `plugin-sidebar:${view.key}`, label: view.label, icon: PluginIcon, pluginId: view.pluginId })),
|
|
25
|
+
];
|
|
26
|
+
const snapshot = store.overlaySnapshot;
|
|
27
|
+
return applyOverlayToWorkspaceViews(base, snapshot?.hiddenSidebarItems, snapshot?.sidebarOrder);
|
|
28
|
+
});
|
|
24
29
|
type View = (typeof views.value)[number];
|
|
25
30
|
// Views are shown as one row of icon tabs. Plugin sidebars can add many entries, so anything past the
|
|
26
31
|
// row's capacity moves into a trailing "more" menu instead of wrapping or scrolling the sidebar header.
|