@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
|
@@ -35,7 +35,6 @@ import { resolveWikiLink } from '../objects/wiki-links';
|
|
|
35
35
|
import type { WindowContext } from '../windows/context';
|
|
36
36
|
import type { DocumentComments, MarkdownEditor, SourceEditor } from '../shell/workbench-async-components';
|
|
37
37
|
import type PageSearch from '../shell/components/PageSearch.vue';
|
|
38
|
-
import type { createWorkspaceSync } from '../workspace/workspace-sync';
|
|
39
38
|
import { pageLockPreferenceKey, readPreference } from './use-workbench-preferences';
|
|
40
39
|
|
|
41
40
|
export interface DocumentActionsDeps {
|
|
@@ -43,7 +42,6 @@ export interface DocumentActionsDeps {
|
|
|
43
42
|
activeWindow: Ref<WindowContext>;
|
|
44
43
|
editing: WorkbenchExtensions['editing'];
|
|
45
44
|
extensions: WorkbenchExtensions;
|
|
46
|
-
workspaceSync: ReturnType<typeof createWorkspaceSync>;
|
|
47
45
|
attachments: AttachmentService | undefined;
|
|
48
46
|
localNative: boolean;
|
|
49
47
|
compactPanes: Ref<boolean>;
|
|
@@ -75,7 +73,6 @@ export function useDocumentActions(deps: DocumentActionsDeps) {
|
|
|
75
73
|
activeWindow,
|
|
76
74
|
editing,
|
|
77
75
|
extensions,
|
|
78
|
-
workspaceSync,
|
|
79
76
|
attachments,
|
|
80
77
|
localNative,
|
|
81
78
|
compactPanes,
|
|
@@ -352,14 +349,43 @@ export function useDocumentActions(deps: DocumentActionsDeps) {
|
|
|
352
349
|
() => pendingTransfers.clear(),
|
|
353
350
|
);
|
|
354
351
|
|
|
355
|
-
store.setPluginEditor(
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
352
|
+
store.setPluginEditor({
|
|
353
|
+
applyEdit: async (fileId, before, after) => {
|
|
354
|
+
const pane = store.panes.find((item) => item.activeId === fileId);
|
|
355
|
+
if (!pane) return false;
|
|
356
|
+
const target = paneSource(fileId) ? paneSourceEditors.get(pane.id) : paneEditors.get(pane.id);
|
|
357
|
+
if (!target) return false;
|
|
358
|
+
target.applyPluginEdit(before, after);
|
|
359
|
+
await nextTick();
|
|
360
|
+
return true;
|
|
361
|
+
},
|
|
362
|
+
activeEditor: () => {
|
|
363
|
+
const pane = store.panes.find((item) => item.id === store.activePaneId);
|
|
364
|
+
if (!pane) return null;
|
|
365
|
+
const doc = store.documentForTab(pane.activeId);
|
|
366
|
+
if (!doc) return null;
|
|
367
|
+
const isSource = paneSource(doc.id);
|
|
368
|
+
const target = isSource ? paneSourceEditors.get(pane.id) : paneEditors.get(pane.id);
|
|
369
|
+
const sel = target?.pluginSelection?.();
|
|
370
|
+
if (!sel) return null;
|
|
371
|
+
return {
|
|
372
|
+
fileId: doc.id,
|
|
373
|
+
mode: isSource ? 'source' : 'rich',
|
|
374
|
+
readOnly: paneReadonly(doc),
|
|
375
|
+
selection: { from: sel.from, to: sel.to, empty: sel.empty },
|
|
376
|
+
selectedText: sel.selectedText,
|
|
377
|
+
blockType: sel.blockType,
|
|
378
|
+
};
|
|
379
|
+
},
|
|
380
|
+
applySelectionEdit: async (fileId, text, mode) => {
|
|
381
|
+
const pane = store.panes.find((item) => item.activeId === fileId);
|
|
382
|
+
if (!pane) return false;
|
|
383
|
+
const target = paneSource(fileId) ? paneSourceEditors.get(pane.id) : paneEditors.get(pane.id);
|
|
384
|
+
if (!target?.applyPluginSelectionEdit) return false;
|
|
385
|
+
const ok = target.applyPluginSelectionEdit(text, mode);
|
|
386
|
+
await nextTick();
|
|
387
|
+
return ok;
|
|
388
|
+
},
|
|
363
389
|
});
|
|
364
390
|
onBeforeUnmount(() => store.setPluginEditor());
|
|
365
391
|
|
|
@@ -470,15 +496,7 @@ export function useDocumentActions(deps: DocumentActionsDeps) {
|
|
|
470
496
|
(doc.id === store.active?.id
|
|
471
497
|
? pageLocked.value
|
|
472
498
|
: readPreference(pageLockPreferenceKey(workspace.value?.id ?? '', doc.id), false));
|
|
473
|
-
|
|
474
|
-
if (!sync && workspaceSync.state.value.backend === 'git') {
|
|
475
|
-
if (workspaceSync.state.value.conflicts.includes(doc.path))
|
|
476
|
-
sync = { kind: 'error', detail: t('当前文章存在 Git 同步冲突。') };
|
|
477
|
-
else if (workspaceSync.error.value)
|
|
478
|
-
sync = { kind: 'error', detail: workspaceSync.error.value };
|
|
479
|
-
else if (workspaceSync.operation.value === 'run')
|
|
480
|
-
sync = { kind: 'syncing', detail: t('工作区正在进行 Git 同步。') };
|
|
481
|
-
}
|
|
499
|
+
const sync: DocumentSyncStatus | undefined = extensions.documentStatus?.(doc.id);
|
|
482
500
|
return documentStatusItems({
|
|
483
501
|
document: doc,
|
|
484
502
|
locked,
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
validatePath,
|
|
11
11
|
type FileEntry,
|
|
12
12
|
type RecentWorkspace,
|
|
13
|
-
type ReferenceIdentity,
|
|
14
13
|
type WorkspaceAdapter,
|
|
15
14
|
} from '@tano/protocol';
|
|
16
15
|
import { openWorkspaceEntry, workspaceEntryPath, type AttachmentService } from '../files/attachments';
|
|
@@ -50,8 +49,7 @@ export interface FileTreeControllerDeps {
|
|
|
50
49
|
selectContext: (context: 'home' | 'workspace') => void;
|
|
51
50
|
openEntry: (file: FileEntry, newTab?: boolean) => Promise<void>;
|
|
52
51
|
openImport: () => void;
|
|
53
|
-
|
|
54
|
-
createNewEntry: (kind: 'document' | 'folder', parent?: string) => Promise<void>;
|
|
52
|
+
createNewEntry: (kind: 'document' | 'folder' | 'table', parent?: string) => Promise<void>;
|
|
55
53
|
removeDocument: (target?: FileEntry) => Promise<void>;
|
|
56
54
|
removeDocuments: (entries: FileEntry[]) => Promise<void>;
|
|
57
55
|
}
|
|
@@ -76,7 +74,6 @@ export function useFileTreeController(deps: FileTreeControllerDeps) {
|
|
|
76
74
|
selectContext,
|
|
77
75
|
openEntry,
|
|
78
76
|
openImport,
|
|
79
|
-
showFileObject,
|
|
80
77
|
createNewEntry,
|
|
81
78
|
removeDocument,
|
|
82
79
|
removeDocuments,
|
|
@@ -713,7 +710,7 @@ export function useFileTreeController(deps: FileTreeControllerDeps) {
|
|
|
713
710
|
}
|
|
714
711
|
|
|
715
712
|
async function directoryContextAction(
|
|
716
|
-
action: 'document' | 'folder' | 'import' | 'duplicate' | 'copy' | 'rename' | 'delete',
|
|
713
|
+
action: 'document' | 'folder' | 'table' | 'import' | 'duplicate' | 'copy' | 'rename' | 'delete',
|
|
717
714
|
) {
|
|
718
715
|
const parent = directoryContextMenu.value?.parent ?? '';
|
|
719
716
|
const target = parent
|
|
@@ -790,8 +787,10 @@ export function useFileTreeController(deps: FileTreeControllerDeps) {
|
|
|
790
787
|
action:
|
|
791
788
|
| 'open'
|
|
792
789
|
| 'open-new-tab'
|
|
790
|
+
| 'open-markdown-source'
|
|
793
791
|
| 'document'
|
|
794
792
|
| 'folder'
|
|
793
|
+
| 'table'
|
|
795
794
|
| 'rename'
|
|
796
795
|
| 'delete'
|
|
797
796
|
| 'copy'
|
|
@@ -843,12 +842,8 @@ export function useFileTreeController(deps: FileTreeControllerDeps) {
|
|
|
843
842
|
await openEntry(file, action === 'open-new-tab');
|
|
844
843
|
return;
|
|
845
844
|
}
|
|
846
|
-
if (action === '
|
|
847
|
-
|
|
848
|
-
showFileObject({
|
|
849
|
-
type: isMarkdown(file.path) ? 'document' : 'asset',
|
|
850
|
-
id: file.id,
|
|
851
|
-
});
|
|
845
|
+
if (action === 'open-markdown-source') {
|
|
846
|
+
await store.openFile(file, { rawSource: true });
|
|
852
847
|
return;
|
|
853
848
|
}
|
|
854
849
|
if (action === 'metadata' && workspace.value) {
|
|
@@ -927,7 +922,7 @@ export function useFileTreeController(deps: FileTreeControllerDeps) {
|
|
|
927
922
|
await removeDocument(file);
|
|
928
923
|
return;
|
|
929
924
|
}
|
|
930
|
-
if (action === 'document' || action === 'folder') {
|
|
925
|
+
if (action === 'document' || action === 'folder' || action === 'table') {
|
|
931
926
|
await createNewEntry(action, file.path);
|
|
932
927
|
return;
|
|
933
928
|
}
|
|
@@ -2,7 +2,7 @@ import { ref, watch, type Ref } from 'vue';
|
|
|
2
2
|
import { storeToRefs } from 'pinia';
|
|
3
3
|
import { isMarkdown } from '@tano/protocol';
|
|
4
4
|
import { native } from '../workspace/adapter';
|
|
5
|
-
import { isTableTab, tableFileId
|
|
5
|
+
import { isTableTab, tableFileId } from '../data-tables/data-tables';
|
|
6
6
|
import { t } from '../i18n/i18n';
|
|
7
7
|
import type { useWorkspaceStore } from '../stores/workspace';
|
|
8
8
|
import { pageRoutePath, parsePageRoute } from '../shell/web-navigation';
|
|
@@ -135,9 +135,7 @@ export function useWorkbenchHistory(deps: WorkbenchHistoryDeps) {
|
|
|
135
135
|
if (workspace.value?.id !== route.workspaceId) {
|
|
136
136
|
store.report(t('链接中的工作区不存在或你已失去访问权限'));
|
|
137
137
|
} else if (isTableTab(route.fileId)) {
|
|
138
|
-
await store.openDataTable(
|
|
139
|
-
route.fileId === TABLES_TAB_ID ? undefined : tableFileId(route.fileId),
|
|
140
|
-
);
|
|
138
|
+
await store.openDataTable(tableFileId(route.fileId));
|
|
141
139
|
} else if (route.fileId.startsWith('plugin:')) {
|
|
142
140
|
const view = store.pluginViews.find(
|
|
143
141
|
(view) => view.key === route.fileId && view.location === 'tab',
|
|
@@ -266,7 +266,7 @@ export function useWorkbenchModals(deps: WorkbenchModalsDeps) {
|
|
|
266
266
|
await removeDocuments(entries);
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
-
async function createNewEntry(kind: 'document' | 'folder', parent = '') {
|
|
269
|
+
async function createNewEntry(kind: 'document' | 'folder' | 'table', parent = '') {
|
|
270
270
|
if (store.busy || workspace.value?.readOnly || updateLock.value) return;
|
|
271
271
|
markInitialPageRouteSuperseded();
|
|
272
272
|
menu.value = false;
|
|
@@ -279,6 +279,11 @@ export function useWorkbenchModals(deps: WorkbenchModalsDeps) {
|
|
|
279
279
|
await store.createUntitledFolder(parent);
|
|
280
280
|
return;
|
|
281
281
|
}
|
|
282
|
+
if (kind === 'table') {
|
|
283
|
+
await store.createDataTable('blank', parent);
|
|
284
|
+
if (compactPanes.value) sidebar.value = false;
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
282
287
|
await store.createUntitledDocument(parent);
|
|
283
288
|
if (compactPanes.value) sidebar.value = false;
|
|
284
289
|
await nextTick();
|
|
@@ -37,7 +37,6 @@ export function useWorkbenchOutline(deps: WorkbenchOutlineDeps) {
|
|
|
37
37
|
} = deps;
|
|
38
38
|
|
|
39
39
|
const hoverOutline = window.matchMedia('(hover: hover)').matches;
|
|
40
|
-
const panel = ref<'outline' | 'activity'>('outline');
|
|
41
40
|
const showOutline = ref(readPreference('showOutline', true));
|
|
42
41
|
const touchOutlineOpen = ref(false);
|
|
43
42
|
watch(activeId, () => {
|
|
@@ -155,7 +154,6 @@ export function useWorkbenchOutline(deps: WorkbenchOutlineDeps) {
|
|
|
155
154
|
function releaseOutlinePointerFocus(event: PointerEvent) {
|
|
156
155
|
const { document } = activeWindow.value;
|
|
157
156
|
if (
|
|
158
|
-
panel.value !== 'outline' ||
|
|
159
157
|
touchLayout.value ||
|
|
160
158
|
!hoverOutline ||
|
|
161
159
|
outlinePinned.value ||
|
|
@@ -180,7 +178,6 @@ export function useWorkbenchOutline(deps: WorkbenchOutlineDeps) {
|
|
|
180
178
|
|
|
181
179
|
function openOutlineContextMenu(event: MouseEvent) {
|
|
182
180
|
const { window: activeWin } = activeWindow.value;
|
|
183
|
-
if (panel.value !== 'outline') return;
|
|
184
181
|
event.preventDefault();
|
|
185
182
|
closeOtherContextMenus();
|
|
186
183
|
if (hoverOutline && !outlinePinned.value) toggleOutlinePin(event);
|
|
@@ -318,7 +315,6 @@ export function useWorkbenchOutline(deps: WorkbenchOutlineDeps) {
|
|
|
318
315
|
|
|
319
316
|
function resetOnActiveChange() {
|
|
320
317
|
closeOutlineContextMenu();
|
|
321
|
-
panel.value = 'outline';
|
|
322
318
|
outlineSearchOpen.value = false;
|
|
323
319
|
outlineSearch.value = '';
|
|
324
320
|
activeHeading.value = 0;
|
|
@@ -327,7 +323,6 @@ export function useWorkbenchOutline(deps: WorkbenchOutlineDeps) {
|
|
|
327
323
|
|
|
328
324
|
return {
|
|
329
325
|
hoverOutline,
|
|
330
|
-
panel,
|
|
331
326
|
showOutline,
|
|
332
327
|
touchOutlineOpen,
|
|
333
328
|
outlineOnLeft,
|
|
@@ -69,7 +69,8 @@ export interface WorkbenchShortcutsDeps {
|
|
|
69
69
|
commandPaletteOpened: Ref<boolean>;
|
|
70
70
|
importPanel: Ref<boolean>;
|
|
71
71
|
agentPanel: Ref<boolean>;
|
|
72
|
-
|
|
72
|
+
objectDetail: Ref<unknown>;
|
|
73
|
+
planArchiveOpen: Ref<boolean>;
|
|
73
74
|
recyclePanel: Ref<boolean>;
|
|
74
75
|
historyPanel: Ref<boolean>;
|
|
75
76
|
historyPage: Ref<'versions' | 'updates'>;
|
|
@@ -92,7 +93,7 @@ export interface WorkbenchShortcutsDeps {
|
|
|
92
93
|
selectedEntries: Ref<FileEntry[]>;
|
|
93
94
|
showModal: (kind: 'newTab' | 'search' | 'delete' | 'saveAs', target?: FileEntry) => void;
|
|
94
95
|
createNewDocument: () => Promise<void>;
|
|
95
|
-
createNewEntry: (kind: 'document' | 'folder', parent?: string) => Promise<void>;
|
|
96
|
+
createNewEntry: (kind: 'document' | 'folder' | 'table', parent?: string) => Promise<void>;
|
|
96
97
|
detachTab: (id: string) => Promise<void>;
|
|
97
98
|
openImport: () => void;
|
|
98
99
|
openTemplateLibrary: () => void;
|
|
@@ -110,7 +111,6 @@ export interface WorkbenchShortcutsDeps {
|
|
|
110
111
|
toggleWorkspaceMenu: () => void;
|
|
111
112
|
selectModule: (id: string) => void;
|
|
112
113
|
openCalendar: (date?: Date) => void;
|
|
113
|
-
openSystemSync: (event?: Event) => void;
|
|
114
114
|
openSettings: (page?: SettingsPageId) => void;
|
|
115
115
|
closeFileContextMenu: (restoreFocus?: boolean) => void;
|
|
116
116
|
closeDirectoryContextMenu: () => void;
|
|
@@ -168,7 +168,8 @@ export function useWorkbenchShortcuts(deps: WorkbenchShortcutsDeps) {
|
|
|
168
168
|
commandPaletteOpened,
|
|
169
169
|
importPanel,
|
|
170
170
|
agentPanel,
|
|
171
|
-
|
|
171
|
+
objectDetail,
|
|
172
|
+
planArchiveOpen,
|
|
172
173
|
recyclePanel,
|
|
173
174
|
historyPanel,
|
|
174
175
|
historyPage,
|
|
@@ -209,7 +210,6 @@ export function useWorkbenchShortcuts(deps: WorkbenchShortcutsDeps) {
|
|
|
209
210
|
toggleWorkspaceMenu,
|
|
210
211
|
selectModule,
|
|
211
212
|
openCalendar,
|
|
212
|
-
openSystemSync,
|
|
213
213
|
openSettings,
|
|
214
214
|
closeFileContextMenu,
|
|
215
215
|
closeDirectoryContextMenu,
|
|
@@ -330,6 +330,15 @@ export function useWorkbenchShortcuts(deps: WorkbenchShortcutsDeps) {
|
|
|
330
330
|
available: writableWorkspace,
|
|
331
331
|
run: () => createNewEntry('folder'),
|
|
332
332
|
},
|
|
333
|
+
{
|
|
334
|
+
id: 'workbench.table',
|
|
335
|
+
category: t('文档'),
|
|
336
|
+
get label() {
|
|
337
|
+
return t('新建数据表');
|
|
338
|
+
},
|
|
339
|
+
available: writableWorkspace,
|
|
340
|
+
run: () => createNewEntry('table'),
|
|
341
|
+
},
|
|
333
342
|
{
|
|
334
343
|
id: 'workbench.import',
|
|
335
344
|
category: t('文档'),
|
|
@@ -566,15 +575,6 @@ export function useWorkbenchShortcuts(deps: WorkbenchShortcutsDeps) {
|
|
|
566
575
|
available: store.workspaceSettings.showGraph,
|
|
567
576
|
run: () => store.openGraphTab(),
|
|
568
577
|
},
|
|
569
|
-
// Dev-only prototype; the native command is compiled out of release builds.
|
|
570
|
-
{
|
|
571
|
-
id: 'workbench.git',
|
|
572
|
-
category: t('工作区'),
|
|
573
|
-
label: 'Git 与同步',
|
|
574
|
-
keywords: 'Git 状态 差异 提交 历史 同步',
|
|
575
|
-
available: native && !mobile && !!workspace.value && !store.isWeb,
|
|
576
|
-
run: () => openSystemSync(),
|
|
577
|
-
},
|
|
578
578
|
{
|
|
579
579
|
id: 'workbench.plugins',
|
|
580
580
|
category: t('工作区'),
|
|
@@ -602,7 +602,7 @@ export function useWorkbenchShortcuts(deps: WorkbenchShortcutsDeps) {
|
|
|
602
602
|
get label() {
|
|
603
603
|
return t('文档版本历史');
|
|
604
604
|
},
|
|
605
|
-
available: hasDocument && !!extensions.historyEnabled,
|
|
605
|
+
available: hasDocument && !!extensions.historyEnabled && !!extensions.historyView,
|
|
606
606
|
run: () => {
|
|
607
607
|
historyPage.value = 'versions';
|
|
608
608
|
historyPanel.value = true;
|
|
@@ -903,7 +903,7 @@ export function useWorkbenchShortcuts(deps: WorkbenchShortcutsDeps) {
|
|
|
903
903
|
}
|
|
904
904
|
const layer = [
|
|
905
905
|
agentPanel,
|
|
906
|
-
|
|
906
|
+
planArchiveOpen,
|
|
907
907
|
recyclePanel,
|
|
908
908
|
historyPanel,
|
|
909
909
|
referenceGraphOpened,
|
|
@@ -948,18 +948,22 @@ export function useWorkbenchShortcuts(deps: WorkbenchShortcutsDeps) {
|
|
|
948
948
|
? () => {
|
|
949
949
|
selectedDiff.value = undefined;
|
|
950
950
|
}
|
|
951
|
-
:
|
|
951
|
+
: objectDetail.value
|
|
952
952
|
? () => {
|
|
953
|
-
|
|
953
|
+
objectDetail.value = undefined;
|
|
954
954
|
}
|
|
955
|
-
:
|
|
955
|
+
: selectionTodo.value
|
|
956
956
|
? () => {
|
|
957
|
-
|
|
957
|
+
selectionTodo.value = undefined;
|
|
958
958
|
}
|
|
959
|
-
:
|
|
959
|
+
: layer
|
|
960
960
|
? () => {
|
|
961
|
-
|
|
961
|
+
layer.value = false;
|
|
962
962
|
}
|
|
963
|
+
: compactPanes.value && sidebar.value
|
|
964
|
+
? () => {
|
|
965
|
+
sidebar.value = false;
|
|
966
|
+
}
|
|
963
967
|
: assistant.opened
|
|
964
968
|
? () => {
|
|
965
969
|
assistant.opened = false;
|
|
@@ -10,14 +10,13 @@ import type {
|
|
|
10
10
|
DataValue,
|
|
11
11
|
DataView,
|
|
12
12
|
} from '@tano/protocol';
|
|
13
|
-
export const TABLES_TAB_ID = 'tables';
|
|
14
13
|
export const tableTabId = (id: string) => `table:${id}`;
|
|
15
14
|
// A table may be opened more than once from the file context menu. Keep the
|
|
16
15
|
// file id at the start of the tab id so routes and persisted table state still
|
|
17
16
|
// resolve to the same table, while the optional suffix gives each tab its own
|
|
18
17
|
// identity.
|
|
19
18
|
export const tableFileId = (id: string) => id.slice(6).split(':', 1)[0] ?? '';
|
|
20
|
-
export const isTableTab = (id: string) =>
|
|
19
|
+
export const isTableTab = (id: string) => /^table:[0-9a-f]{6}(?::[a-z0-9-]+)?$/.test(id);
|
|
21
20
|
export const tableItemId = () => crypto.randomUUID().replaceAll('-', '');
|
|
22
21
|
export const copyTable = <T>(value: T): T => JSON.parse(JSON.stringify(value));
|
|
23
22
|
export function newDataView(name = '全部记录'): DataView {
|
|
@@ -36,7 +36,7 @@ const emit = defineEmits<{
|
|
|
36
36
|
close: [];
|
|
37
37
|
diff: [value: { title: string; before: string; after: string }];
|
|
38
38
|
}>();
|
|
39
|
-
const page = ref<Page>(props.initialPage ?? 'versions');
|
|
39
|
+
const page = ref<Page>(props.historyView ? (props.initialPage ?? 'versions') : 'updates');
|
|
40
40
|
const firstNav = ref<HTMLButtonElement>();
|
|
41
41
|
const originalFocus = document.activeElement as HTMLElement | null;
|
|
42
42
|
|
|
@@ -84,6 +84,7 @@ onBeforeUnmount(() => originalFocus?.focus());
|
|
|
84
84
|
</div>
|
|
85
85
|
<nav>
|
|
86
86
|
<button
|
|
87
|
+
v-if="historyView"
|
|
87
88
|
ref="firstNav"
|
|
88
89
|
:class="{ active: page === 'versions' }"
|
|
89
90
|
:aria-current="page === 'versions' ? 'page' : undefined"
|
|
@@ -94,6 +95,7 @@ onBeforeUnmount(() => originalFocus?.focus());
|
|
|
94
95
|
<small>Beta</small>
|
|
95
96
|
</button>
|
|
96
97
|
<button
|
|
98
|
+
:ref="(el) => { if (!historyView) firstNav = (el as HTMLButtonElement | null) ?? undefined; }"
|
|
97
99
|
:class="{ active: page === 'updates' }"
|
|
98
100
|
:aria-current="page === 'updates' ? 'page' : undefined"
|
|
99
101
|
@click="page = 'updates'"
|
package/src/features.ts
CHANGED
|
@@ -13,6 +13,7 @@ export type { FeatureChannel, FeatureDefinition };
|
|
|
13
13
|
|
|
14
14
|
export const features = defineFeatures({
|
|
15
15
|
assistantClipboardAttachments: { status: 'dev', note: 'Paste local files and images into the assistant composer.' },
|
|
16
|
+
desktopMailClient: { status: 'dev', note: 'Desktop native IMAP/SMTP mail client with calendar and document integration.' },
|
|
16
17
|
markdownSpacingAutocomplete: { status: 'dev', note: 'Insert real Markdown spaces at mixed-script boundaries while editing.' },
|
|
17
18
|
});
|
|
18
19
|
// Optional env keeps the pure API usable in Node as well as Vite consumers.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { documentLinkDetails, parseDocumentMarkdown } from '@tano/editor/document-links';
|
|
2
|
-
import { validEventDate, validEventTime } from '@tano/protocol';
|
|
2
|
+
import { isActionableTask, isPlanCompleted, isPlanObject, validEventDate, validEventTime } from '@tano/protocol';
|
|
3
3
|
import type { WorkspaceObject } from '@tano/protocol';
|
|
4
4
|
import type { Root, RootContent } from 'mdast';
|
|
5
5
|
import type { HelpChecklistId } from './help-content';
|
|
@@ -66,15 +66,13 @@ export function newMarkdownMilestones(before: string, after: string): HelpCheckl
|
|
|
66
66
|
|
|
67
67
|
/** Receives only successfully saved user changes, not hydrated or remote records. */
|
|
68
68
|
export function planMilestones(before: WorkspaceObject | undefined, after: WorkspaceObject): HelpChecklistId[] {
|
|
69
|
-
if (!
|
|
69
|
+
if (!isPlanObject(after)) return [];
|
|
70
70
|
const result: HelpChecklistId[] = before ? [] : ['plan'];
|
|
71
71
|
const previous = before?.properties ?? {}, current = after.properties;
|
|
72
72
|
if ((validEventDate(current.date) && current.date !== previous.date) ||
|
|
73
73
|
(validEventTime(current.start) && validEventTime(current.end) &&
|
|
74
74
|
(current.start !== previous.start || current.end !== previous.end))) result.push('plan-date');
|
|
75
75
|
if (after.description.trim() && after.description !== before?.description) result.push('plan-description');
|
|
76
|
-
|
|
77
|
-
(object?.type === 'task' && ['done', 'completed'].includes(String(object.properties.status)));
|
|
78
|
-
if ((after.type === 'task' || current.checkable === true) && complete(after) && !complete(before)) result.push('plan-complete');
|
|
76
|
+
if (isActionableTask(after) && isPlanCompleted(after) && !(before && isPlanCompleted(before))) result.push('plan-complete');
|
|
79
77
|
return result;
|
|
80
78
|
}
|