@tano.page/workbench 0.14.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +50 -16
- package/src/App.vue +82 -752
- package/src/appearance/appearance.ts +14 -4
- package/src/appearance/components/ThemePresetPreview.vue +52 -8
- package/src/appearance/interface-font.ts +99 -0
- package/src/appearance/theme.ts +26 -10
- package/src/appearance/use-interface-font.ts +30 -0
- package/src/assets/mail-provider-icons/NOTICE.txt +27 -0
- package/src/assets/mail-provider-icons/aliyun-mail.svg +3 -0
- package/src/assets/mail-provider-icons/gmail.svg +1 -0
- package/src/assets/mail-provider-icons/icloud.svg +12 -0
- package/src/assets/mail-provider-icons/netease-126.svg +5 -0
- package/src/assets/mail-provider-icons/netease-163.svg +5 -0
- package/src/assets/mail-provider-icons/qq.svg +9 -0
- package/src/assets/mail-provider-icons/tencent-exmail.svg +4 -0
- package/src/assistant/agent-identities.ts +1 -97
- package/src/assistant/agent-task-context.ts +1 -54
- package/src/assistant/attachments.ts +1 -1
- package/src/assistant/completion.ts +1 -61
- package/src/assistant/components/AssistantChangeList.vue +98 -21
- package/src/assistant/components/AssistantPanel.vue +425 -8
- package/src/assistant/components/PluginToolProposalCard.vue +235 -0
- package/src/assistant/connection-actions.ts +237 -0
- package/src/assistant/document-mentions.ts +1 -33
- package/src/assistant/engine.ts +1 -532
- package/src/assistant/execution.ts +6 -33
- package/src/assistant/files.ts +5 -13
- package/src/assistant/hash.ts +1 -4
- package/src/assistant/inbox.ts +1 -148
- package/src/assistant/language.ts +10 -37
- package/src/assistant/mention-autocomplete.ts +69 -0
- package/src/assistant/plugin-bridge-builder.ts +146 -0
- package/src/assistant/prompts.ts +1 -58
- package/src/assistant/proposal-actions.ts +336 -0
- package/src/assistant/results.ts +20 -86
- package/src/assistant/store.ts +167 -327
- package/src/assistant/structures.ts +1 -155
- package/src/assistant/tasks.ts +8 -96
- package/src/assistant/tool-rules.ts +1 -7
- package/src/assistant/workspace-bridge.ts +1 -1
- package/src/composables/use-document-actions.ts +38 -20
- package/src/composables/use-file-tree-controller.ts +7 -12
- package/src/composables/use-workbench-help.ts +177 -0
- package/src/composables/use-workbench-history.ts +2 -4
- package/src/composables/use-workbench-lifecycle.ts +249 -0
- package/src/composables/use-workbench-modals.ts +6 -1
- package/src/composables/use-workbench-outline.ts +0 -5
- package/src/composables/use-workbench-settings.ts +185 -0
- package/src/composables/use-workbench-shortcuts.ts +40 -1021
- package/src/composables/use-workbench-views.ts +325 -0
- package/src/data-tables/data-tables.ts +1 -2
- package/src/documents/components/DocumentActionMenu.vue +279 -0
- package/src/documents/components/DocumentHistoryPanel.vue +3 -1
- package/src/documents/components/DocumentInspector.vue +168 -0
- package/src/documents/components/DocumentPane.vue +482 -0
- package/src/documents/description-merge.ts +1 -9
- package/src/features.ts +1 -0
- package/src/files/components/FileMetadataPanel.vue +49 -15
- package/src/fonts/Inter-Latin-Italic.woff2 +0 -0
- package/src/fonts/Inter-Latin.woff2 +0 -0
- package/src/fonts/TanoUISansSC-Bold.woff2 +0 -0
- package/src/fonts/TanoUISansSC-Medium.woff2 +0 -0
- package/src/fonts/TanoUISansSC-Regular.woff2 +0 -0
- package/src/help/help-milestones.ts +3 -5
- package/src/i18n/locale-catalogs.ts +7 -6
- package/src/i18n/locale-registry.ts +8 -6
- package/src/i18n/locales/de-DE.json +371 -3
- package/src/i18n/locales/en-US.json +371 -2
- package/src/i18n/locales/es-ES.json +371 -3
- package/src/i18n/locales/ja-JP.json +370 -2
- package/src/i18n/locales/zh-TW.json +370 -2
- package/src/mail/components/MailAccountDialog.vue +450 -0
- package/src/mail/components/MailComposerDialog.vue +326 -0
- package/src/mail/components/MailProviderIcon.vue +30 -0
- package/src/mail/components/MailWorkspaceView.vue +821 -0
- package/src/mail/components/SidebarMail.vue +134 -0
- package/src/mail/mail-avatar.ts +17 -0
- package/src/mail/mail-bridge.ts +68 -0
- package/src/mail/mail-calendar.ts +208 -0
- package/src/mail/mail-markdown.ts +195 -0
- package/src/mail/types.ts +226 -0
- package/src/objects/components/ObjectDetailModal.vue +1001 -0
- package/src/objects/content-references.ts +6 -56
- package/src/objects/wiki-links.ts +1 -48
- package/src/objects/workspace-objects.ts +3 -4
- package/src/plan-sync/types.ts +6 -3
- package/src/plans/calendar-interaction.ts +194 -0
- package/src/plans/calendar.ts +65 -9
- package/src/plans/components/CalendarAgendaView.vue +165 -0
- package/src/plans/components/CalendarDayPopover.vue +172 -39
- package/src/plans/components/CalendarFilterBar.vue +128 -0
- package/src/plans/components/CalendarMonthView.vue +224 -0
- package/src/plans/components/CalendarQuickCreateDialog.vue +269 -0
- package/src/plans/components/CalendarTimelineView.vue +517 -0
- package/src/plans/components/CalendarTopbarControls.vue +101 -0
- package/src/plans/components/CalendarView.vue +264 -748
- package/src/plans/components/CalendarYearView.vue +138 -0
- package/src/plans/components/PlanArchiveDialog.vue +295 -0
- package/src/plans/components/PlanConnectionsDialog.vue +1 -1
- package/src/plans/components/PlanDateField.vue +6 -4
- package/src/plans/components/PlanDetailPanel.vue +227 -32
- package/src/plans/components/PlanEventList.vue +16 -4
- package/src/plans/components/SidebarPlan.vue +22 -15
- package/src/plans/components/TaskRepeatControls.vue +169 -30
- package/src/plans/components/calendar-shared.css +192 -0
- package/src/plans/composables/use-calendar-interactions.ts +396 -0
- package/src/plans/composables/use-calendar-scroll.ts +420 -0
- package/src/plans/local-reminders.ts +149 -0
- package/src/plans/personal-plans.ts +10 -1
- package/src/plans/plan-date.ts +8 -1
- package/src/plans/plan-migration.ts +95 -0
- package/src/plans/recurrence.ts +95 -0
- package/src/plans/task-repeat.ts +8 -8
- package/src/plans/timeline-layout.ts +92 -0
- package/src/plugins/assistant-bridge.ts +520 -0
- package/src/plugins/attachment-reader.ts +3 -1
- package/src/plugins/cache-storage.ts +42 -2
- package/src/plugins/components/PluginAutomations.vue +3 -3
- package/src/plugins/components/PluginCatalogBrowser.vue +17 -8
- package/src/plugins/components/PluginChangeSummary.vue +16 -3
- package/src/plugins/components/PluginConnections.vue +1 -1
- package/src/plugins/components/PluginCustomView.vue +2 -2
- package/src/plugins/components/PluginDetailPage.vue +136 -57
- package/src/plugins/components/PluginDeveloperArea.vue +192 -0
- package/src/plugins/components/PluginDocumentSlot.vue +63 -0
- package/src/plugins/components/PluginExplorer.vue +21 -25
- package/src/plugins/components/PluginImportDialog.vue +410 -0
- package/src/plugins/components/PluginInstaller.vue +273 -288
- package/src/plugins/components/PluginListItem.vue +3 -0
- package/src/plugins/components/PluginMaintenance.vue +37 -34
- package/src/plugins/components/PluginRepositoryStorage.vue +4 -2
- package/src/plugins/components/PluginRuntimePanel.vue +3 -3
- package/src/plugins/components/PluginSettingsForm.vue +112 -0
- package/src/plugins/components/PluginStatusBar.vue +161 -0
- package/src/plugins/components/PluginSurface.vue +18 -6
- package/src/plugins/components/PluginUiDialog.vue +452 -0
- package/src/plugins/components/PluginsTabPage.vue +61 -0
- package/src/plugins/components/plugin-center.css +5 -0
- package/src/plugins/data.ts +9 -86
- package/src/plugins/editor-plugin-adapters.ts +169 -0
- package/src/plugins/excalidraw/bundle.tano-plugin.json +1 -1
- package/src/plugins/excalidraw/manifest.json +12 -1
- package/src/plugins/host.ts +662 -43
- package/src/plugins/native.ts +2 -10
- package/src/plugins/overlay-mapping.ts +125 -0
- package/src/plugins/packages.ts +73 -1
- package/src/plugins/plugin-data.ts +2 -3
- package/src/plugins/plugin-permissions.ts +57 -0
- package/src/plugins/plugin-rpc-router.ts +558 -0
- package/src/plugins/plugin-sdk.ts +1 -94
- package/src/plugins/plugin-ui-dialogs.ts +167 -0
- package/src/plugins/policy.ts +53 -3
- package/src/plugins/presentation-preview/bundle.tano-plugin.json +1 -1
- package/src/plugins/presentation-preview/manifest.json +2 -1
- package/src/plugins/queries.ts +1 -73
- package/src/plugins/sandbox.ts +15 -1
- package/src/plugins/use-plugin-actions.ts +67 -20
- package/src/plugins/user-plugins.ts +254 -0
- package/src/plugins/view-header.ts +2 -7
- package/src/plugins/word-preview/bundle.tano-plugin.json +1 -1
- package/src/plugins/word-preview/manifest.json +13 -1
- package/src/plugins/workbench.ts +175 -2
- package/src/plugins/worker.js +105 -8
- package/src/plugins/workspace-plugin-runtime.ts +23 -7
- package/src/plugins/workspace-plugins.ts +212 -21
- package/src/runtime.ts +103 -4
- package/src/settings/components/SettingsAppearancePage.vue +46 -0
- package/src/settings/components/SettingsDocumentsPage.vue +0 -1
- package/src/settings/components/SettingsPanel.vue +8 -3
- package/src/settings/components/WorkbenchSettings.vue +20 -7
- package/src/settings/components/settings-context.ts +1 -1
- package/src/settings/components/settings-search.ts +2 -3
- package/src/settings/settings-tab.ts +1 -0
- package/src/shell/command-palette.ts +3 -3
- package/src/shell/components/EditorToolbar.vue +8 -9
- package/src/shell/components/EditorTools.vue +1 -5
- package/src/shell/components/PaneTopbar.vue +393 -0
- package/src/shell/components/SelectionToolbar.vue +0 -2
- package/src/shell/components/SidebarNavigation.vue +22 -2
- package/src/shell/components/WorkbenchContextMenus.vue +58 -34
- package/src/shell/components/WorkbenchModals.vue +47 -62
- package/src/shell/components/WorkbenchPanes.vue +371 -1342
- package/src/shell/components/WorkbenchSidebar.vue +486 -0
- package/src/shell/components/WorkspaceBreadcrumb.vue +6 -14
- package/src/shell/components/WorkspaceViewSwitcher.vue +12 -7
- package/src/shell/pane-registry.ts +69 -0
- package/src/shell/use-surface-dismissal.ts +219 -0
- package/src/shell/use-workbench-commands.ts +599 -0
- package/src/shell/use-workbench-keybindings.ts +337 -0
- package/src/shell/use-workbench.ts +531 -1153
- package/src/shell/workbench-async-components.ts +14 -5
- package/src/shell/workbench-context.ts +30 -3
- package/src/stores/mail.ts +414 -0
- package/src/stores/plan-sync.ts +2 -1
- package/src/stores/plans.ts +2 -9
- package/src/stores/workspace-document-io.ts +807 -0
- package/src/stores/workspace-file-ops.ts +1 -1
- package/src/stores/workspace-knowledge.ts +2 -114
- package/src/stores/workspace-lifecycle.ts +459 -0
- package/src/stores/workspace-plugins-state.ts +254 -259
- package/src/stores/workspace-session.ts +287 -0
- package/src/stores/workspace-tabs-layout.ts +6 -44
- package/src/stores/workspace-types.ts +50 -0
- package/src/stores/workspace.ts +184 -1363
- package/src/styles/agent-diff-modals.css +0 -7
- package/src/styles/dark-theme.css +3 -3
- package/src/styles/inspector.css +0 -59
- package/src/styles/layout-themes.css +346 -0
- package/src/styles/mail.css +1568 -0
- package/src/styles/mobile.css +2 -2
- package/src/styles/recent-and-media.css +0 -17
- package/src/styles/theme-contract.css +3 -3
- package/src/styles/workbench-shell.css +110 -17
- package/src/styles/workspace-states.css +9 -33
- package/src/styles.css +0 -1
- package/src/tabs/components/DesktopTabs.vue +19 -14
- package/src/tabs/components/NewTabPicker.vue +10 -4
- package/src/tabs/tab-label.ts +0 -1
- package/src/windows/AuxiliaryWindows.vue +2 -2
- package/src/windows/use-window-event-bridge.ts +152 -0
- package/src/workspace/components/TemplateLibrary.vue +1 -1
- package/src/workspace/components/WorkspaceGeneralSettings.vue +0 -13
- package/src/workspace/components/WorkspaceIconPicker.vue +30 -7
- package/src/workspace/components/WorkspacePickerMenu.vue +317 -0
- package/src/workspace/workspace-comments.ts +11 -151
- package/src/workspace/workspace-welcome.ts +1 -1
- package/src/assistant/locales/de-DE.json +0 -126
- package/src/assistant/locales/en-US.json +0 -126
- package/src/assistant/locales/es-ES.json +0 -126
- package/src/assistant/locales/ja-JP.json +0 -126
- package/src/assistant/locales/zh-CN.json +0 -126
- package/src/assistant/locales/zh-TW.json +0 -126
- package/src/assistant/task-prompts.json +0 -39
- package/src/documents/components/FormulaMenu.vue +0 -50
- package/src/files/components/FileDatabasePage.vue +0 -152
- package/src/files/components/FolderHomeIcon.vue +0 -12
- package/src/objects/components/ObjectDatabasePage.vue +0 -100
- package/src/objects/components/ObjectPanel.vue +0 -554
- package/src/plans/components/PersonalPlanDialog.vue +0 -105
- package/src/shell/components/WorkspaceViewPage.vue +0 -127
- package/src/shell/components/WorkspaceViewTab.vue +0 -24
- package/src/styles/object-panel.css +0 -163
- package/src/workspace/components/GitInspectionPanel.vue +0 -35
- package/src/workspace/components/WorkspaceSyncPanel.vue +0 -50
- package/src/workspace/welcome-slogans.ts +0 -11
- package/src/workspace/workspace-git.ts +0 -35
- package/src/workspace/workspace-sync.ts +0 -46
- package/src/workspace/workspace-views.ts +0 -48
|
@@ -62,7 +62,7 @@ export function buildSettingSearchEntries(options: {
|
|
|
62
62
|
settingSearchEntry('appearance', 'appearance-color', '配色主题', '选择工作区主题插件。', 'theme 插件 风格 配色'),
|
|
63
63
|
settingSearchEntry('appearance', 'appearance-icons', '文件与目录图标', '选择工作区图标主题。', 'icon 文件夹 图标 插件'),
|
|
64
64
|
settingSearchEntry('appearance', 'appearance-layout', '布局风格', '选择页面结构,可与任意配色、图标混搭。留边布局的内容区四周留空,侧栏融入背景。', 'layout inset islands paper 贴边 留边 卡片岛 纸感 纸质 布局 结构'),
|
|
65
|
-
settingSearchEntry('appearance', 'appearance-material', '材质', '选择侧栏和页面的质感,可与任意布局、配色混搭。', 'material glass frost frosted liquid translucent 材质 玻璃 磨砂 毛玻璃 液态 液态玻璃 透明 质感'),
|
|
65
|
+
settingSearchEntry('appearance', 'appearance-material', '材质', '选择侧栏和页面的质感,可与任意布局、配色混搭。', 'material flat raised elevated bevel card glass frost frosted liquid translucent 材质 平面 立体 立体卡片 浮雕 边框 玻璃 磨砂 毛玻璃 液态 液态玻璃 透明 质感'),
|
|
66
66
|
...(frostActive
|
|
67
67
|
? [
|
|
68
68
|
settingSearchEntry('appearance', 'appearance-wallpaper', '背景图片', '玻璃材质会透出这张图片,卡片透明度会按图片自动调整以保证文字清晰。图片只保存在这台设备。', 'wallpaper background image glass overlay opacity 壁纸 背景 图片 柔化 蒙版 不透明度'),
|
|
@@ -70,6 +70,7 @@ export function buildSettingSearchEntries(options: {
|
|
|
70
70
|
: []),
|
|
71
71
|
]
|
|
72
72
|
: []),
|
|
73
|
+
settingSearchEntry('appearance', 'appearance-interface-font', '界面字体', '用于侧栏、标签、菜单和对话框,不影响文档正文。仅保存在当前设备。', 'interface UI font Inter Noto 思源黑体 system sidebar menu 界面 字体 侧栏 菜单'),
|
|
73
74
|
...(!splitFontsEnabled
|
|
74
75
|
? [
|
|
75
76
|
settingSearchEntry('appearance', 'appearance-visual-font', '可视化编辑字体', '选择内置字体,或使用本机已安装的字体。', 'font system serif mono Maple custom'),
|
|
@@ -141,8 +142,6 @@ export function buildSettingSearchEntries(options: {
|
|
|
141
142
|
settingSearchEntry('workspace', 'workspace-show-plugins', '显示插件', '在侧栏显示已安装插件与插件管理入口。', 'sidebar plugins'),
|
|
142
143
|
settingSearchEntry('workspace', 'workspace-show-collaboration-views', '显示协作应用', '在侧栏显示聊天等协作入口,不影响账户收件箱。', 'sidebar collaboration chat inbox'),
|
|
143
144
|
settingSearchEntry('workspace', 'workspace-export', '工作区内容', '将已保存的 Markdown、附件和工作区设置导出为 ZIP,保留文件夹结构。', 'export ZIP backup'),
|
|
144
|
-
settingSearchEntry('workspace', 'workspace-page-views', '保存并显示页面浏览统计', '页面浏览量统计尚未实现,当前不会收集浏览数据。', 'analytics statistics views'),
|
|
145
|
-
settingSearchEntry('workspace', 'workspace-people', '人物目录', '在工作区对象列表中显示人物;关闭后仍可通过已有引用访问人物。', 'people directory'),
|
|
146
145
|
settingSearchEntry('workspace', 'workspace-id', '工作区 ID', '', 'workspace id identifier'),
|
|
147
146
|
settingSearchEntry('workspace', 'workspace-delete', '删除当前工作区', '移除当前设备上的工作区注册。', 'workspace delete remove'),
|
|
148
147
|
settingSearchEntry('about', 'about-updates', '版本与更新', '检查并安装同页更新。', 'version update'),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const SETTINGS_TAB_ID = 'view:settings';
|
|
@@ -39,7 +39,7 @@ export function editorPaletteCommands(options: {
|
|
|
39
39
|
if (!options.editable || options.source) return [];
|
|
40
40
|
const { context, features, run } = options;
|
|
41
41
|
const blocks = blockTypes.flatMap<WorkbenchCommand>(item => {
|
|
42
|
-
if (formCommands.has(item.command) || !commandEnabled(item.command,
|
|
42
|
+
if (formCommands.has(item.command) || !commandEnabled(item.command, features)) return [];
|
|
43
43
|
if (!context.canTransform && !insertionCommands.has(item.command) && !wrappingCommands.has(item.command)) return [];
|
|
44
44
|
if (item.command === 'heading') return Array.from({ length: 6 }, (_, index) => ({
|
|
45
45
|
id: `editor.heading.${index + 1}`, category: t('格式'), label: t('转换为 {0} 级标题', [index + 1]),
|
|
@@ -52,13 +52,13 @@ export function editorPaletteCommands(options: {
|
|
|
52
52
|
run: () => run(item.command) }];
|
|
53
53
|
});
|
|
54
54
|
const inline = inlineTypes.filter(item => !formCommands.has(item.command)
|
|
55
|
-
&& commandEnabled(item.command,
|
|
55
|
+
&& commandEnabled(item.command, features)
|
|
56
56
|
&& (!context.inlineSource || ['bold', 'italic', 'code'].includes(item.command))
|
|
57
57
|
&& (context.canStyleText || !['bold', 'italic', 'code'].includes(item.command)))
|
|
58
58
|
.map(item => ({ id: `editor.${item.command}`, category: t('格式'), label: t(item.label),
|
|
59
59
|
keywords: item.type, run: () => run(item.command) }));
|
|
60
60
|
const styles = context.canStyleText && !context.inlineSource
|
|
61
|
-
? extraStyles.filter(item => commandEnabled(item.command,
|
|
61
|
+
? extraStyles.filter(item => commandEnabled(item.command, features))
|
|
62
62
|
.map(item => ({ id: `editor.${item.command}`, category: t('格式'), label: t(item.label), run: () => run(item.command) }))
|
|
63
63
|
: [];
|
|
64
64
|
return [...blocks, ...inline, ...styles];
|
|
@@ -48,7 +48,6 @@ const props = defineProps<{
|
|
|
48
48
|
context: EditorSelectionContext;
|
|
49
49
|
disabled?: boolean;
|
|
50
50
|
source?: boolean;
|
|
51
|
-
enabledLevels?: readonly number[];
|
|
52
51
|
features?: DocumentFeatures;
|
|
53
52
|
compact?: boolean;
|
|
54
53
|
compactActions?: boolean;
|
|
@@ -160,7 +159,7 @@ const availableBlocks = computed(() => blockMenuGroups
|
|
|
160
159
|
.map(types => types
|
|
161
160
|
.map(type => blockTypes.find(item => item.type === type)!)
|
|
162
161
|
.filter(item => !insertionCommands.has(item.command)
|
|
163
|
-
&& commandEnabled(item.command, props.
|
|
162
|
+
&& commandEnabled(item.command, props.features)
|
|
164
163
|
&& (props.context.availableBlockCommands?.includes(item.command)
|
|
165
164
|
?? (props.context.canTransform || wrappingCommands.has(item.command)))))
|
|
166
165
|
.filter(items => items.length > 0)
|
|
@@ -171,7 +170,7 @@ const availableBlocks = computed(() => blockMenuGroups
|
|
|
171
170
|
}))),
|
|
172
171
|
);
|
|
173
172
|
const availableInline = computed(() =>
|
|
174
|
-
inlineTypes.map(item => ({ ...item, label: t(item.label) })).filter((item) => commandEnabled(item.command, props.
|
|
173
|
+
inlineTypes.map(item => ({ ...item, label: t(item.label) })).filter((item) => commandEnabled(item.command, props.features)),
|
|
175
174
|
);
|
|
176
175
|
const useCompactActions = computed(() => props.compact || props.compactActions);
|
|
177
176
|
const primaryInline = computed(() =>
|
|
@@ -280,7 +279,7 @@ function toggleBlockMenu() {
|
|
|
280
279
|
onMounted(() => window.addEventListener('click', outside));
|
|
281
280
|
onBeforeUnmount(() => window.removeEventListener('click', outside));
|
|
282
281
|
async function run(name: string, argument?: string) {
|
|
283
|
-
if (props.disabled || props.source || !commandEnabled(name, props.
|
|
282
|
+
if (props.disabled || props.source || !commandEnabled(name, props.features))
|
|
284
283
|
return;
|
|
285
284
|
open.value = false;
|
|
286
285
|
if (['link', 'mention', 'image', 'footnote', 'file', 'embed'].includes(name)) {
|
|
@@ -447,7 +446,7 @@ onBeforeUnmount(() => { for (const element of actionMotions.keys()) clearActionM
|
|
|
447
446
|
</button>
|
|
448
447
|
</template>
|
|
449
448
|
<select v-if="compact && context.block === 'Callout'" :aria-label="t('提示块类型')"
|
|
450
|
-
:disabled="disabled || !commandEnabled('callout',
|
|
449
|
+
:disabled="disabled || !commandEnabled('callout', features)"
|
|
451
450
|
@change="run('callout', ($event.target as HTMLSelectElement).value)">
|
|
452
451
|
<option disabled selected value="">{{ t('提示类型') }}</option>
|
|
453
452
|
<option value="NOTE">{{ t('备注') }}</option><option value="TIP">{{ t('提示') }}</option>
|
|
@@ -556,7 +555,7 @@ onBeforeUnmount(() => { for (const element of actionMotions.keys()) clearActionM
|
|
|
556
555
|
<TextStyleMenu
|
|
557
556
|
v-if="context.level === 'inline' || useCompactActions"
|
|
558
557
|
:more="useCompactActions"
|
|
559
|
-
:inline-math="useCompactActions && commandEnabled('math',
|
|
558
|
+
:inline-math="useCompactActions && commandEnabled('math', features)"
|
|
560
559
|
:text-color="context.textColor"
|
|
561
560
|
:background-color="context.backgroundColor"
|
|
562
561
|
:dragging="dragging"
|
|
@@ -591,7 +590,7 @@ onBeforeUnmount(() => { for (const element of actionMotions.keys()) clearActionM
|
|
|
591
590
|
</template>
|
|
592
591
|
</TextStyleMenu>
|
|
593
592
|
<button
|
|
594
|
-
v-if="!useCompactActions && context.level === 'block' && commandEnabled('reference',
|
|
593
|
+
v-if="!useCompactActions && context.level === 'block' && commandEnabled('reference', features)"
|
|
595
594
|
type="button"
|
|
596
595
|
class="icon-button"
|
|
597
596
|
:aria-label="t('引用对象或文档')"
|
|
@@ -603,7 +602,7 @@ onBeforeUnmount(() => { for (const element of actionMotions.keys()) clearActionM
|
|
|
603
602
|
<AtSign :size="17" />
|
|
604
603
|
</button>
|
|
605
604
|
<button
|
|
606
|
-
v-if="!useCompactActions && context.level === 'block' && commandEnabled('mention',
|
|
605
|
+
v-if="!useCompactActions && context.level === 'block' && commandEnabled('mention', features)"
|
|
607
606
|
type="button"
|
|
608
607
|
class="icon-button"
|
|
609
608
|
:aria-label="t('提及文档')"
|
|
@@ -617,7 +616,7 @@ onBeforeUnmount(() => { for (const element of actionMotions.keys()) clearActionM
|
|
|
617
616
|
<select
|
|
618
617
|
v-if="!compact && context.block === 'Callout'"
|
|
619
618
|
:aria-label="t('提示块类型')"
|
|
620
|
-
:disabled="disabled || !commandEnabled('callout',
|
|
619
|
+
:disabled="disabled || !commandEnabled('callout', features)"
|
|
621
620
|
@change="run('callout', ($event.target as HTMLSelectElement).value)"
|
|
622
621
|
>
|
|
623
622
|
<option disabled selected value="">{{ t('提示类型') }}</option>
|
|
@@ -21,7 +21,6 @@ const props = defineProps<{
|
|
|
21
21
|
editorElement?: HTMLElement;
|
|
22
22
|
context: EditorSelectionContext;
|
|
23
23
|
features?: DocumentFeatures;
|
|
24
|
-
enabledLevels?: readonly number[];
|
|
25
24
|
disabled?: boolean;
|
|
26
25
|
source?: boolean;
|
|
27
26
|
assistant?: boolean;
|
|
@@ -105,7 +104,7 @@ function positionPreview() {
|
|
|
105
104
|
panel.style.top = `${position.y}px`;
|
|
106
105
|
}
|
|
107
106
|
watch(
|
|
108
|
-
[drag, previewPanel, () => props.context, () => props.features
|
|
107
|
+
[drag, previewPanel, () => props.context, () => props.features],
|
|
109
108
|
positionPreview,
|
|
110
109
|
{ flush: 'post' },
|
|
111
110
|
);
|
|
@@ -149,7 +148,6 @@ async function changeMode(mode: ToolbarMode) {
|
|
|
149
148
|
:class="{ 'toolbar-being-dragged': drag }"
|
|
150
149
|
:context="context"
|
|
151
150
|
:features="features"
|
|
152
|
-
:enabled-levels="enabledLevels"
|
|
153
151
|
:disabled="disabled"
|
|
154
152
|
:source="source"
|
|
155
153
|
:dragging="!!drag"
|
|
@@ -177,7 +175,6 @@ async function changeMode(mode: ToolbarMode) {
|
|
|
177
175
|
:editor-element="editorElement"
|
|
178
176
|
:context="context"
|
|
179
177
|
:features="features"
|
|
180
|
-
:enabled-levels="enabledLevels"
|
|
181
178
|
:mode="mode"
|
|
182
179
|
:dragging="!!drag"
|
|
183
180
|
:assistant="assistant"
|
|
@@ -213,7 +210,6 @@ async function changeMode(mode: ToolbarMode) {
|
|
|
213
210
|
:class="{ 'switchable-toolbar': drag.target === 'fixed' }"
|
|
214
211
|
:context="context"
|
|
215
212
|
:features="features"
|
|
216
|
-
:enabled-levels="enabledLevels"
|
|
217
213
|
:disabled="disabled"
|
|
218
214
|
:source="source"
|
|
219
215
|
:assistant="assistant"
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { inject, toRefs } from 'vue';
|
|
3
|
+
import {
|
|
4
|
+
ArrowDownToLine,
|
|
5
|
+
ArrowLeft,
|
|
6
|
+
ArrowRight,
|
|
7
|
+
ChevronRight,
|
|
8
|
+
List,
|
|
9
|
+
LockKeyhole,
|
|
10
|
+
MessageSquareDiff,
|
|
11
|
+
PanelLeftOpen,
|
|
12
|
+
Puzzle,
|
|
13
|
+
X,
|
|
14
|
+
} from 'lucide-vue-next';
|
|
15
|
+
import type { WorkspacePane } from '@tano/protocol';
|
|
16
|
+
import { isTableTab } from '../../data-tables/data-tables';
|
|
17
|
+
import { GRAPH_TAB_ID } from '../../documents/document-graph';
|
|
18
|
+
import { t } from '../../i18n/i18n';
|
|
19
|
+
import { CALENDAR_TAB_ID } from '../../plans/calendar';
|
|
20
|
+
import { mobile } from '../../platform/platform';
|
|
21
|
+
import { pluginPreviewStatus, pluginViewHeader } from '../../plugins/view-header';
|
|
22
|
+
import { PLUGINS_TAB_ID } from '../../plugins/workspace-plugins';
|
|
23
|
+
import type { DocumentTab, OpenDocument } from '../../stores/workspace-types';
|
|
24
|
+
import { shortcutAriaLabel, shortcutKeys } from '../shortcuts';
|
|
25
|
+
import {
|
|
26
|
+
workbenchDocumentsKey,
|
|
27
|
+
workbenchPrefsKey,
|
|
28
|
+
workbenchShellKey,
|
|
29
|
+
workbenchTreeMenusKey,
|
|
30
|
+
} from '../workbench-context';
|
|
31
|
+
import ButtonVisibilityGroup from './ButtonVisibilityGroup.vue';
|
|
32
|
+
import WorkspaceBreadcrumb from './WorkspaceBreadcrumb.vue';
|
|
33
|
+
import DocumentStatus from '../../documents/components/DocumentStatus.vue';
|
|
34
|
+
import DocumentActionMenu from '../../documents/components/DocumentActionMenu.vue';
|
|
35
|
+
import MarkdownRevealToggle from '../../documents/components/MarkdownRevealToggle.vue';
|
|
36
|
+
import SourceCodeIcon from '../../documents/components/SourceCodeIcon.vue';
|
|
37
|
+
import PluginViewHeader from '../../plugins/components/PluginViewHeader.vue';
|
|
38
|
+
import CalendarTopbarControls from '../../plans/components/CalendarTopbarControls.vue';
|
|
39
|
+
|
|
40
|
+
defineProps<{
|
|
41
|
+
pane: WorkspacePane;
|
|
42
|
+
active?: OpenDocument;
|
|
43
|
+
tab?: DocumentTab;
|
|
44
|
+
isAuxiliaryWindow: boolean;
|
|
45
|
+
}>();
|
|
46
|
+
|
|
47
|
+
const shell = inject(workbenchShellKey);
|
|
48
|
+
const prefs = inject(workbenchPrefsKey);
|
|
49
|
+
const documents = inject(workbenchDocumentsKey);
|
|
50
|
+
const treeMenus = inject(workbenchTreeMenusKey);
|
|
51
|
+
if (!shell || !prefs || !documents || !treeMenus) throw new Error('Workbench context is required');
|
|
52
|
+
|
|
53
|
+
const {
|
|
54
|
+
native,
|
|
55
|
+
workspace,
|
|
56
|
+
filesPending,
|
|
57
|
+
sidebar,
|
|
58
|
+
toggleSidebar,
|
|
59
|
+
store,
|
|
60
|
+
extensions,
|
|
61
|
+
extensionActions,
|
|
62
|
+
extensionViews,
|
|
63
|
+
settingsTabView,
|
|
64
|
+
mailEnabled,
|
|
65
|
+
mailTabView,
|
|
66
|
+
workspaceStatusLabel,
|
|
67
|
+
openEntry,
|
|
68
|
+
openBreadcrumbDirectory,
|
|
69
|
+
topbarVisibilityItems,
|
|
70
|
+
closeButtonVisibilityMenus,
|
|
71
|
+
canNavigatePage,
|
|
72
|
+
navigatePage,
|
|
73
|
+
paneButterflyScope,
|
|
74
|
+
touchLayout,
|
|
75
|
+
attachments,
|
|
76
|
+
calendarToolItems,
|
|
77
|
+
calendarPeriod,
|
|
78
|
+
calendarDate,
|
|
79
|
+
moveCalendarPeriod,
|
|
80
|
+
calendarModeOpen,
|
|
81
|
+
calendarModeLabel,
|
|
82
|
+
calendarModeOptions,
|
|
83
|
+
calendarMode,
|
|
84
|
+
selectCalendarMode,
|
|
85
|
+
openPlanArchive,
|
|
86
|
+
documentToolItems,
|
|
87
|
+
} = toRefs(shell);
|
|
88
|
+
const { tabsEnabled, shortcuts, revealMarkdown } = toRefs(prefs);
|
|
89
|
+
const {
|
|
90
|
+
paneDocumentStatus,
|
|
91
|
+
attachmentStatus,
|
|
92
|
+
currentAttachmentStatus,
|
|
93
|
+
showOutline,
|
|
94
|
+
touchOutlineOpen,
|
|
95
|
+
documentSuggestions,
|
|
96
|
+
editing,
|
|
97
|
+
suggestionModeBusy,
|
|
98
|
+
toggleSuggestionMode,
|
|
99
|
+
paneSource,
|
|
100
|
+
setPaneSource,
|
|
101
|
+
} = toRefs(documents);
|
|
102
|
+
const { treeDocumentIcons, loadTreeDocumentIcon } = toRefs(treeMenus);
|
|
103
|
+
</script>
|
|
104
|
+
|
|
105
|
+
<template>
|
|
106
|
+
<ButtonVisibilityGroup
|
|
107
|
+
v-slot="{ isVisible }"
|
|
108
|
+
:items="topbarVisibilityItems(pane.activeId, !!active, pane.id === store.activePaneId)"
|
|
109
|
+
preference-key="tano.preference.documentHiddenTools"
|
|
110
|
+
tag="header"
|
|
111
|
+
:group-class="pane.activeId === GRAPH_TAB_ID ? 'topbar graph-topbar' : 'topbar'"
|
|
112
|
+
:label="pane.activeId === GRAPH_TAB_ID ? t('图谱顶部栏') : t('文档顶部栏')"
|
|
113
|
+
:menu-label="t('顶部栏显示设置')"
|
|
114
|
+
@open="closeButtonVisibilityMenus"
|
|
115
|
+
>
|
|
116
|
+
<div
|
|
117
|
+
v-if="
|
|
118
|
+
(native && !tabsEnabled && (isVisible('back') || isVisible('forward'))) ||
|
|
119
|
+
(!sidebar && !(native && !mobile && workspace))
|
|
120
|
+
"
|
|
121
|
+
class="topbar-navigation"
|
|
122
|
+
:data-surface-role="pane.activeId === GRAPH_TAB_ID ? 'card' : undefined"
|
|
123
|
+
role="group"
|
|
124
|
+
:aria-label="pane.activeId === GRAPH_TAB_ID ? t('图谱导航') : t('文档导航')"
|
|
125
|
+
>
|
|
126
|
+
<button
|
|
127
|
+
v-if="!sidebar && !(native && !mobile && workspace)"
|
|
128
|
+
type="button"
|
|
129
|
+
class="icon-button"
|
|
130
|
+
:aria-label="t('展开侧栏')"
|
|
131
|
+
:data-tooltip="t('展开侧栏')"
|
|
132
|
+
:data-tooltip-shortcut="shortcuts.toggleSidebar"
|
|
133
|
+
@click="toggleSidebar"
|
|
134
|
+
>
|
|
135
|
+
<PanelLeftOpen :size="16" :stroke-width="1.6" />
|
|
136
|
+
</button>
|
|
137
|
+
<button
|
|
138
|
+
v-if="native && !tabsEnabled && isVisible('back')"
|
|
139
|
+
type="button"
|
|
140
|
+
class="icon-button"
|
|
141
|
+
:aria-label="t('后退')"
|
|
142
|
+
:data-tooltip="t('后退')"
|
|
143
|
+
:disabled="!canNavigatePage(-1)"
|
|
144
|
+
@click="navigatePage(-1)"
|
|
145
|
+
>
|
|
146
|
+
<ArrowLeft :size="16" :stroke-width="1.6" />
|
|
147
|
+
</button>
|
|
148
|
+
<button
|
|
149
|
+
v-if="native && !tabsEnabled && isVisible('forward')"
|
|
150
|
+
type="button"
|
|
151
|
+
class="icon-button"
|
|
152
|
+
:aria-label="t('前进')"
|
|
153
|
+
:data-tooltip="t('前进')"
|
|
154
|
+
:disabled="!canNavigatePage(1)"
|
|
155
|
+
@click="navigatePage(1)"
|
|
156
|
+
>
|
|
157
|
+
<ArrowRight :size="16" :stroke-width="1.6" />
|
|
158
|
+
</button>
|
|
159
|
+
</div>
|
|
160
|
+
<WorkspaceBreadcrumb
|
|
161
|
+
:loading="filesPending"
|
|
162
|
+
:perch="{
|
|
163
|
+
id: `breadcrumb:${paneButterflyScope(pane.id, pane.activeId)}`,
|
|
164
|
+
scope: paneButterflyScope(pane.id, pane.activeId),
|
|
165
|
+
label: t('面包屑'),
|
|
166
|
+
kind: 'component',
|
|
167
|
+
}"
|
|
168
|
+
v-if="
|
|
169
|
+
isVisible('breadcrumb') &&
|
|
170
|
+
pane.activeId !== CALENDAR_TAB_ID &&
|
|
171
|
+
pane.activeId !== GRAPH_TAB_ID
|
|
172
|
+
"
|
|
173
|
+
:workspace-id="workspace?.id"
|
|
174
|
+
:workspace-name="workspace?.name ?? 'Tano'"
|
|
175
|
+
:workspace-icon="store.workspaceSettings.icon"
|
|
176
|
+
:workspace-mode="store.isDemo ? 'demo' : store.isWeb ? 'web' : 'local'"
|
|
177
|
+
:entries="workspace?.files ?? []"
|
|
178
|
+
:folder-home-file-name="store.workspaceSettings.folderHomeFileName"
|
|
179
|
+
:document-icons="treeDocumentIcons"
|
|
180
|
+
:load-document-icon="loadTreeDocumentIcon"
|
|
181
|
+
:path="tab?.path"
|
|
182
|
+
:directory="!!tab?.directory"
|
|
183
|
+
:demo-label="store.isDemo ? workspaceStatusLabel : undefined"
|
|
184
|
+
:read-only="workspace?.readOnly"
|
|
185
|
+
@open="(file) => { store.focusPane(pane.id); openEntry(file); }"
|
|
186
|
+
@open-directory="(path) => { store.focusPane(pane.id); void openBreadcrumbDirectory(path); }"
|
|
187
|
+
>
|
|
188
|
+
<template #status>
|
|
189
|
+
<DocumentStatus
|
|
190
|
+
v-if="tab?.pluginView && isVisible('document-status')"
|
|
191
|
+
:document-key="`${workspace?.id}:${tab.pluginView.pluginId}:${tab.pluginView.id}:${pluginViewHeader(store.pluginRuntime, tab.pluginView)?.title}`"
|
|
192
|
+
:items="pluginPreviewStatus(store.pluginRuntime, tab.pluginView)"
|
|
193
|
+
/>
|
|
194
|
+
<DocumentStatus
|
|
195
|
+
v-if="active && isVisible('document-status')"
|
|
196
|
+
:document-key="`${workspace?.id}:${active.id}`"
|
|
197
|
+
:items="paneDocumentStatus(active)"
|
|
198
|
+
>
|
|
199
|
+
<component
|
|
200
|
+
:is="extensions.regions['document-status-details']"
|
|
201
|
+
v-if="pane.id === store.activePaneId && extensions.regions['document-status-details']"
|
|
202
|
+
:actions="extensionActions"
|
|
203
|
+
/>
|
|
204
|
+
</DocumentStatus>
|
|
205
|
+
<DocumentStatus
|
|
206
|
+
v-else-if="tab?.attachment && isVisible('document-status')"
|
|
207
|
+
:document-key="`${workspace?.id}:${tab.attachment.id}`"
|
|
208
|
+
:items="attachmentStatus(pane.id, tab.attachment)"
|
|
209
|
+
>
|
|
210
|
+
<button
|
|
211
|
+
v-if="currentAttachmentStatus(pane.id, tab.attachment)?.retry"
|
|
212
|
+
:disabled="currentAttachmentStatus(pane.id, tab.attachment)?.retryDisabled"
|
|
213
|
+
@click="currentAttachmentStatus(pane.id, tab.attachment)?.retry?.()"
|
|
214
|
+
>
|
|
215
|
+
{{ t('重试') }}
|
|
216
|
+
</button>
|
|
217
|
+
</DocumentStatus>
|
|
218
|
+
</template>
|
|
219
|
+
<template v-if="tab?.pluginDetail">
|
|
220
|
+
<ChevronRight :size="12" /><Puzzle :size="14" /><span class="breadcrumb-current">{{ tab.pluginDetail.name }}</span>
|
|
221
|
+
</template>
|
|
222
|
+
<template v-if="tab?.pluginView">
|
|
223
|
+
<ChevronRight :size="12" /><Puzzle :size="14" /><span
|
|
224
|
+
class="breadcrumb-current"
|
|
225
|
+
:title="pluginViewHeader(store.pluginRuntime, tab.pluginView)?.title"
|
|
226
|
+
>{{ pluginViewHeader(store.pluginRuntime, tab.pluginView)?.title || tab.pluginView.label }}</span
|
|
227
|
+
>
|
|
228
|
+
</template>
|
|
229
|
+
<template v-if="pane.activeId === PLUGINS_TAB_ID">
|
|
230
|
+
<ChevronRight :size="12" /><Puzzle :size="14" /><span class="breadcrumb-current">{{ t('插件') }}</span>
|
|
231
|
+
</template>
|
|
232
|
+
<template
|
|
233
|
+
v-for="view in [...extensionViews, settingsTabView, ...(mailEnabled ? [mailTabView] : [])].filter(
|
|
234
|
+
(view) => view.id === pane.activeId,
|
|
235
|
+
)"
|
|
236
|
+
:key="view.id"
|
|
237
|
+
>
|
|
238
|
+
<component :is="view.icon" :size="14" /><span class="breadcrumb-current">{{ view.label }}</span>
|
|
239
|
+
</template>
|
|
240
|
+
</WorkspaceBreadcrumb>
|
|
241
|
+
<DocumentStatus
|
|
242
|
+
v-if="(active || tab?.attachment) && !isVisible('breadcrumb') && isVisible('document-status')"
|
|
243
|
+
:document-key="`${workspace?.id}:${active?.id ?? tab?.attachment?.id}`"
|
|
244
|
+
:items="active ? paneDocumentStatus(active) : attachmentStatus(pane.id, tab?.attachment)"
|
|
245
|
+
>
|
|
246
|
+
<component
|
|
247
|
+
v-if="active && pane.id === store.activePaneId && extensions.regions['document-status-details']"
|
|
248
|
+
:is="extensions.regions['document-status-details']"
|
|
249
|
+
:actions="extensionActions"
|
|
250
|
+
/>
|
|
251
|
+
<button
|
|
252
|
+
v-if="!active && currentAttachmentStatus(pane.id, tab?.attachment)?.retry"
|
|
253
|
+
:disabled="currentAttachmentStatus(pane.id, tab?.attachment)?.retryDisabled"
|
|
254
|
+
@click="currentAttachmentStatus(pane.id, tab?.attachment)?.retry?.()"
|
|
255
|
+
>
|
|
256
|
+
{{ t('重试') }}
|
|
257
|
+
</button>
|
|
258
|
+
</DocumentStatus>
|
|
259
|
+
<div class="topbar-right" :data-surface-role="pane.activeId === GRAPH_TAB_ID ? 'card' : undefined">
|
|
260
|
+
<PluginViewHeader
|
|
261
|
+
v-if="tab?.pluginView && workspace"
|
|
262
|
+
:view="tab.pluginView"
|
|
263
|
+
:workspace-id="workspace.id"
|
|
264
|
+
:runtime="store.pluginRuntime.find((item) => item.id === tab?.pluginView?.pluginId)"
|
|
265
|
+
:execute="store.interactWithPlugin"
|
|
266
|
+
/>
|
|
267
|
+
<button
|
|
268
|
+
v-if="active && touchLayout && showOutline"
|
|
269
|
+
type="button"
|
|
270
|
+
class="icon-button"
|
|
271
|
+
:aria-label="t('文档大纲')"
|
|
272
|
+
:aria-expanded="touchOutlineOpen"
|
|
273
|
+
@click="touchOutlineOpen = !touchOutlineOpen"
|
|
274
|
+
>
|
|
275
|
+
<List :size="18" />
|
|
276
|
+
</button>
|
|
277
|
+
<button
|
|
278
|
+
v-if="tab?.attachment && attachments && isVisible('attachment-export')"
|
|
279
|
+
type="button"
|
|
280
|
+
class="topbar-attachment-action"
|
|
281
|
+
:aria-label="t('导出附件')"
|
|
282
|
+
:data-tooltip="t('导出附件副本')"
|
|
283
|
+
@click="attachments.exportAttachment(workspace!.id, tab!.attachment.path).catch(store.report)"
|
|
284
|
+
>
|
|
285
|
+
<ArrowDownToLine :size="16" /><span>{{ t('导出') }}</span>
|
|
286
|
+
</button>
|
|
287
|
+
<div :id="`attachment-controls-${pane.id}`" class="attachment-controls-host" v-show="!!tab?.attachment" />
|
|
288
|
+
<component
|
|
289
|
+
:is="extensions.regions['editing-status']"
|
|
290
|
+
v-if="
|
|
291
|
+
isVisible('editing-status') &&
|
|
292
|
+
pane.id === store.activePaneId &&
|
|
293
|
+
extensions.regions['editing-status']
|
|
294
|
+
"
|
|
295
|
+
:actions="extensionActions"
|
|
296
|
+
/>
|
|
297
|
+
<span
|
|
298
|
+
v-if="
|
|
299
|
+
workspaceStatusLabel &&
|
|
300
|
+
(!store.isDemo ||
|
|
301
|
+
!isVisible('breadcrumb') ||
|
|
302
|
+
pane.activeId === CALENDAR_TAB_ID ||
|
|
303
|
+
pane.activeId === GRAPH_TAB_ID)
|
|
304
|
+
"
|
|
305
|
+
:class="store.isDemo ? 'demo-badge' : 'local-badge'"
|
|
306
|
+
:title="store.isDemo ? t('浏览器演示 · 数据仅保存在本浏览器') : undefined"
|
|
307
|
+
>
|
|
308
|
+
<LockKeyhole v-if="workspace?.readOnly" :size="14" />
|
|
309
|
+
{{ workspaceStatusLabel }}
|
|
310
|
+
</span>
|
|
311
|
+
<div
|
|
312
|
+
:id="`graph-controls-${pane.id}`"
|
|
313
|
+
v-show="pane.activeId === GRAPH_TAB_ID"
|
|
314
|
+
class="graph-toolbar-host"
|
|
315
|
+
/>
|
|
316
|
+
<div v-if="isTableTab(pane.activeId)" :id="`data-table-controls-${pane.id}`" />
|
|
317
|
+
<CalendarTopbarControls
|
|
318
|
+
v-if="pane.activeId === CALENDAR_TAB_ID && calendarToolItems.some((item) => isVisible(item.id))"
|
|
319
|
+
:is-visible="isVisible"
|
|
320
|
+
:calendar-period="calendarPeriod"
|
|
321
|
+
:calendar-mode="calendarMode"
|
|
322
|
+
:calendar-mode-label="calendarModeLabel"
|
|
323
|
+
:calendar-mode-options="calendarModeOptions"
|
|
324
|
+
:calendar-mode-open="calendarModeOpen"
|
|
325
|
+
@go-today="calendarDate = new Date()"
|
|
326
|
+
@move-period="moveCalendarPeriod"
|
|
327
|
+
@update:calendar-mode-open="calendarModeOpen = $event"
|
|
328
|
+
@select-mode="selectCalendarMode"
|
|
329
|
+
@open-archive="openPlanArchive"
|
|
330
|
+
/>
|
|
331
|
+
<div
|
|
332
|
+
v-if="active && documentSuggestions.get(active.id)?.mode && !editing.isManaging(active.id)"
|
|
333
|
+
class="suggestion-mode-badge"
|
|
334
|
+
role="status"
|
|
335
|
+
:aria-label="t('建议模式已开启')"
|
|
336
|
+
>
|
|
337
|
+
<MessageSquareDiff :size="14" /><span>{{ t('建议模式') }}</span>
|
|
338
|
+
<button
|
|
339
|
+
type="button"
|
|
340
|
+
:aria-label="t('退出建议模式')"
|
|
341
|
+
:data-tooltip="t('退出建议模式')"
|
|
342
|
+
:disabled="suggestionModeBusy || documentSuggestions.get(active.id)?.reviewing"
|
|
343
|
+
@click="toggleSuggestionMode(active.id)"
|
|
344
|
+
>
|
|
345
|
+
<X :size="14" />
|
|
346
|
+
</button>
|
|
347
|
+
</div>
|
|
348
|
+
<template v-if="active">
|
|
349
|
+
<div
|
|
350
|
+
v-if="documentToolItems.some((item) => isVisible(item.id))"
|
|
351
|
+
class="document-tool-buttons"
|
|
352
|
+
>
|
|
353
|
+
<MarkdownRevealToggle
|
|
354
|
+
v-if="isVisible('markdown-reveal')"
|
|
355
|
+
v-model="revealMarkdown"
|
|
356
|
+
:source="paneSource(pane.activeId)"
|
|
357
|
+
:shortcut="shortcuts.toggleMarkdownReveal"
|
|
358
|
+
/>
|
|
359
|
+
<button
|
|
360
|
+
v-if="isVisible('source-mode')"
|
|
361
|
+
type="button"
|
|
362
|
+
class="icon-button source-mode-button"
|
|
363
|
+
:class="{ active: paneSource(pane.activeId) }"
|
|
364
|
+
:disabled="
|
|
365
|
+
editing.isManaging(pane.activeId) ||
|
|
366
|
+
(pane.id === store.activePaneId && editing.activeBusy)
|
|
367
|
+
"
|
|
368
|
+
:aria-label="paneSource(pane.activeId) ? t('返回编辑') : t('切换源码模式')"
|
|
369
|
+
:aria-pressed="paneSource(pane.activeId)"
|
|
370
|
+
:aria-keyshortcuts="shortcutAriaLabel(shortcuts.toggleSource) || undefined"
|
|
371
|
+
:data-tooltip-shortcut="shortcutKeys(shortcuts.toggleSource)[0]"
|
|
372
|
+
:data-tooltip="
|
|
373
|
+
editing.isManaging(pane.activeId)
|
|
374
|
+
? t('当前编辑扩展不支持切换源码模式')
|
|
375
|
+
: paneSource(pane.activeId)
|
|
376
|
+
? t('返回编辑')
|
|
377
|
+
: t('切换源码模式')
|
|
378
|
+
"
|
|
379
|
+
@click="setPaneSource(pane.activeId, !paneSource(pane.activeId))"
|
|
380
|
+
>
|
|
381
|
+
<SourceCodeIcon :size="17" :off="!paneSource(pane.activeId)" />
|
|
382
|
+
</button>
|
|
383
|
+
</div>
|
|
384
|
+
<DocumentActionMenu
|
|
385
|
+
:pane-id="pane.id"
|
|
386
|
+
:pane-active-id="pane.activeId"
|
|
387
|
+
:active="active"
|
|
388
|
+
:is-auxiliary-window="isAuxiliaryWindow"
|
|
389
|
+
/>
|
|
390
|
+
</template>
|
|
391
|
+
</div>
|
|
392
|
+
</ButtonVisibilityGroup>
|
|
393
|
+
</template>
|
|
@@ -25,7 +25,6 @@ const props = defineProps<{
|
|
|
25
25
|
context: EditorSelectionContext;
|
|
26
26
|
editorElement?: HTMLElement;
|
|
27
27
|
features?: DocumentFeatures;
|
|
28
|
-
enabledLevels?: readonly number[];
|
|
29
28
|
mode?: Exclude<ToolbarMode, 'fixed'>;
|
|
30
29
|
dragging?: boolean;
|
|
31
30
|
assistant?: boolean;
|
|
@@ -383,7 +382,6 @@ onBeforeUnmount(() => {
|
|
|
383
382
|
@annotation="visible && emit('annotation')"
|
|
384
383
|
:context="context"
|
|
385
384
|
:features="features"
|
|
386
|
-
:enabled-levels="enabledLevels"
|
|
387
385
|
@dismiss="dismissAndFocus"
|
|
388
386
|
@command="(name, value) => visible && emit('command', name, value)"
|
|
389
387
|
>
|
|
@@ -1,9 +1,29 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { t } from '../../i18n/i18n';
|
|
3
|
+
import {
|
|
4
|
+
isOverlaySidebarNavHidden,
|
|
5
|
+
overlaySidebarNavOrderStyle,
|
|
6
|
+
} from '../../plugins/overlay-mapping';
|
|
3
7
|
import ButtonVisibilityGroup from './ButtonVisibilityGroup.vue';
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
const props = withDefaults(
|
|
10
|
+
defineProps<{
|
|
11
|
+
items: readonly { id: string; label: string }[];
|
|
12
|
+
active?: boolean;
|
|
13
|
+
overlayHiddenIds?: readonly string[];
|
|
14
|
+
overlayOrder?: readonly string[];
|
|
15
|
+
}>(),
|
|
16
|
+
{ active: true },
|
|
17
|
+
);
|
|
6
18
|
defineEmits<{ open: [] }>();
|
|
19
|
+
|
|
20
|
+
function combinedVisible(id: string, groupVisible: (target: string) => boolean): boolean {
|
|
21
|
+
return groupVisible(id) && !isOverlaySidebarNavHidden(id, props.overlayHiddenIds);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function orderStyle(id: string) {
|
|
25
|
+
return overlaySidebarNavOrderStyle(id, props.overlayOrder);
|
|
26
|
+
}
|
|
7
27
|
</script>
|
|
8
28
|
|
|
9
29
|
<template>
|
|
@@ -18,6 +38,6 @@ defineEmits<{ open: [] }>();
|
|
|
18
38
|
:menu-label="t('导航按钮显示设置')"
|
|
19
39
|
@open="$emit('open')"
|
|
20
40
|
>
|
|
21
|
-
<slot :is-visible="isVisible" />
|
|
41
|
+
<slot :is-visible="(id: string) => combinedVisible(id, isVisible)" :order-style="orderStyle" />
|
|
22
42
|
</ButtonVisibilityGroup>
|
|
23
43
|
</template>
|