@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
|
@@ -1,10 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import {
|
|
2
|
+
ObjectTypeRegistry,
|
|
3
|
+
objectTypeRegistry,
|
|
4
|
+
parseObjectPlugin,
|
|
5
|
+
parsePluginManifest,
|
|
6
|
+
parsePluginPackage,
|
|
7
|
+
parsePluginPathScopes,
|
|
8
|
+
parsePluginSettings,
|
|
9
|
+
parsePluginPolicy,
|
|
10
|
+
canonicalPluginJson,
|
|
11
|
+
externalizeHeavyIconAssets,
|
|
12
|
+
hasRasterIconAssets,
|
|
13
|
+
hydratePluginPackageAssets,
|
|
14
|
+
} from '@tano/protocol';
|
|
15
|
+
import type { PluginManifest, PluginMode, PluginPackage, Workspace, WorkspaceAdapter, WorkspacePersonalPluginPolicy, WorkspacePluginRule } from '@tano/protocol';
|
|
16
|
+
import { canManageWorkspacePlugins, loadPluginPolicy, savePluginRule, saveWorkspacePersonalPluginPolicy } from './policy';
|
|
4
17
|
import type { PluginPolicySnapshot } from './policy';
|
|
5
18
|
import { PluginPackageCache, type PluginPackageRepository } from './packages';
|
|
6
19
|
import { systemPlugin } from './system';
|
|
20
|
+
import {
|
|
21
|
+
installUserPlugin,
|
|
22
|
+
readUserPlugins,
|
|
23
|
+
resolveUserPlugins,
|
|
24
|
+
setUserPluginEnabled,
|
|
25
|
+
setUserPluginGlobalAuthorization,
|
|
26
|
+
setUserPluginSettings,
|
|
27
|
+
uninstallUserPlugin,
|
|
28
|
+
type PluginInstallScope,
|
|
29
|
+
} from './user-plugins';
|
|
7
30
|
|
|
31
|
+
export type { PluginInstallScope } from './user-plugins';
|
|
8
32
|
export const retiredSystemPlugin = (id: string) => id === 'git-inspector';
|
|
9
33
|
const retiredMessage = 'Git 功能已内置,请从工作区菜单打开“Git 与同步”,无需安装或授权插件';
|
|
10
34
|
|
|
@@ -13,6 +37,16 @@ export const PLUGINS_TAB_ID = 'view:plugins';
|
|
|
13
37
|
export interface InstalledObjectPlugin {
|
|
14
38
|
/** Product-owned registration; never copied from untrusted package metadata. */
|
|
15
39
|
system?: boolean;
|
|
40
|
+
/** Where the active plugin installation originates. */
|
|
41
|
+
scope?: PluginInstallScope;
|
|
42
|
+
/** True when a workspace rule shadows a user-scoped plugin with the same ID. */
|
|
43
|
+
shadowedUserPlugin?: boolean;
|
|
44
|
+
/** True when a user-scoped v2 plugin has exact-version authorization across owned workspaces. */
|
|
45
|
+
globallyAuthorized?: boolean;
|
|
46
|
+
/** Effective team workspace policy applied to user-scoped executable plugins. */
|
|
47
|
+
personalCodePolicy?: WorkspacePersonalPluginPolicy;
|
|
48
|
+
/** Effective directory prefix allowlist restricting document/attachment access. */
|
|
49
|
+
pathScopes?: string[];
|
|
16
50
|
manifest: PluginManifest;
|
|
17
51
|
enabled: boolean;
|
|
18
52
|
rule?: WorkspacePluginRule;
|
|
@@ -20,9 +54,19 @@ export interface InstalledObjectPlugin {
|
|
|
20
54
|
}
|
|
21
55
|
const keyFor = (workspace: string) => `tano.object-plugins.v1.${encodeURIComponent(workspace)}`;
|
|
22
56
|
export type PluginChange =
|
|
23
|
-
|
|
57
|
+
| {
|
|
58
|
+
install: PluginManifest;
|
|
59
|
+
package?: PluginPackage;
|
|
60
|
+
binaryAssets?: Record<string, Uint8Array>;
|
|
61
|
+
sourceUrl?: string;
|
|
62
|
+
scope?: 'workspace' | 'user';
|
|
63
|
+
}
|
|
64
|
+
| { id: string; enabled: boolean; scope?: 'workspace' | 'user' }
|
|
65
|
+
| { uninstall: string; scope?: 'workspace' | 'user' }
|
|
24
66
|
| { id: string; forgetVersion: string }
|
|
25
|
-
| { id: string; mode: PluginMode; settings: Record<string, unknown>; sourceUrl?: string }
|
|
67
|
+
| { id: string; mode: PluginMode; settings: Record<string, unknown>; sourceUrl?: string; pathScopes?: string[] }
|
|
68
|
+
| { id: string; settings: Record<string, unknown>; pathScopes?: string[]; scope: 'user' }
|
|
69
|
+
| { personalCodePlugins: WorkspacePersonalPluginPolicy };
|
|
26
70
|
|
|
27
71
|
/** Portable administrator rules and device/account-scoped activation and authorization. */
|
|
28
72
|
export class WorkspacePluginHost {
|
|
@@ -97,6 +141,7 @@ export class WorkspacePluginHost {
|
|
|
97
141
|
return plugins;
|
|
98
142
|
}
|
|
99
143
|
async change(workspace: string, change: PluginChange) {
|
|
144
|
+
if ('personalCodePlugins' in change) throw new Error('仅共享工作区支持配置个人代码插件策略');
|
|
100
145
|
const id = 'install' in change ? change.install.id : 'uninstall' in change ? change.uninstall : change.id;
|
|
101
146
|
if (this.systemIds.includes(id)) throw new Error('系统插件随应用更新,不能导入替换或卸载');
|
|
102
147
|
if (retiredSystemPlugin(id) && !('uninstall' in change)) throw new Error(retiredMessage);
|
|
@@ -142,28 +187,117 @@ export class WorkspacePluginHost {
|
|
|
142
187
|
preferences[id] = { ...preferences[id], ...value };
|
|
143
188
|
this.storage.setItem(`tano.plugin-preferences.v1.${encodeURIComponent(this.principal)}.${encodeURIComponent(workspace)}`, JSON.stringify(preferences));
|
|
144
189
|
}
|
|
145
|
-
|
|
190
|
+
userPluginIntegrities(): Set<string> {
|
|
191
|
+
try {
|
|
192
|
+
return new Set(readUserPlugins(this.storage, this.principal).map((row) => row.integrity));
|
|
193
|
+
} catch {
|
|
194
|
+
return new Set();
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
authorize(
|
|
198
|
+
workspace: string,
|
|
199
|
+
id: string,
|
|
200
|
+
integrity: string | undefined,
|
|
201
|
+
expectedAuthorization?: string,
|
|
202
|
+
options?: { allWorkspaces?: boolean },
|
|
203
|
+
) {
|
|
146
204
|
if (this.systemIds.includes(id)) throw new Error('系统插件无需单独授权,请使用启用或停用');
|
|
147
205
|
if (workspace !== this.workspaceId) throw new Error('工作区已切换');
|
|
148
206
|
const rule = this.shared?.policy.plugins.find(row => row.manifest.id === id);
|
|
149
|
-
if (
|
|
207
|
+
if (rule) {
|
|
208
|
+
if (integrity && rule.integrity !== integrity) throw new Error('插件版本已变化,请重新查看权限');
|
|
209
|
+
if (expectedAuthorization !== undefined && this.preferences(workspace)[id]?.integrity !== expectedAuthorization)
|
|
210
|
+
throw new Error('原版本授权已撤销或变化,开发会话已停止');
|
|
211
|
+
this.setPreference(workspace, id, { integrity: integrity ?? '' });
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
const userRecord = readUserPlugins(this.storage, this.principal).find(row => row.id === id);
|
|
215
|
+
if (!userRecord || (integrity && userRecord.integrity !== integrity))
|
|
216
|
+
throw new Error('插件版本已变化,请重新查看权限');
|
|
150
217
|
if (expectedAuthorization !== undefined && this.preferences(workspace)[id]?.integrity !== expectedAuthorization)
|
|
151
218
|
throw new Error('原版本授权已撤销或变化,开发会话已停止');
|
|
152
219
|
this.setPreference(workspace, id, { integrity: integrity ?? '' });
|
|
220
|
+
if (!integrity) setUserPluginGlobalAuthorization(id, undefined, this.storage, this.principal);
|
|
221
|
+
else if (options?.allWorkspaces) setUserPluginGlobalAuthorization(id, integrity, this.storage, this.principal);
|
|
222
|
+
}
|
|
223
|
+
personalCodePluginPolicy(): WorkspacePersonalPluginPolicy {
|
|
224
|
+
return this.shared?.policy.personalCodePlugins ?? 'allow';
|
|
153
225
|
}
|
|
154
|
-
async loadWorkspace(adapter: WorkspaceAdapter, workspace: Workspace) {
|
|
226
|
+
async loadWorkspace(adapter: WorkspaceAdapter, workspace: Workspace, repository?: PluginPackageRepository) {
|
|
155
227
|
const shared = await loadPluginPolicy(adapter, workspace);
|
|
156
228
|
this.workspaceId = workspace.id;
|
|
157
229
|
this.shared = shared;
|
|
230
|
+
const personalPolicy = shared.policy.personalCodePlugins ?? 'allow';
|
|
158
231
|
const preferences = this.preferences(workspace.id);
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
232
|
+
const cache = new PluginPackageCache(this.storage);
|
|
233
|
+
const plugins: InstalledObjectPlugin[] = shared.snapshot
|
|
234
|
+
? await Promise.all(
|
|
235
|
+
shared.policy.plugins
|
|
236
|
+
.filter(rule => !retiredSystemPlugin(rule.manifest.id) && !this.systemIds.includes(rule.manifest.id))
|
|
237
|
+
.map(async rule => {
|
|
238
|
+
let manifest = rule.manifest;
|
|
239
|
+
if (rule.manifest.appearance?.iconRefs?.length && rule.integrity) {
|
|
240
|
+
const pkg = await cache.resolve(workspace.id, rule, AbortSignal.timeout(15000), repository).catch(() => null);
|
|
241
|
+
if (pkg) manifest = hydratePluginPackageAssets(rule.manifest, pkg);
|
|
242
|
+
}
|
|
243
|
+
return {
|
|
244
|
+
manifest,
|
|
245
|
+
scope: 'workspace' as const,
|
|
246
|
+
rule,
|
|
247
|
+
...(rule.pathScopes?.length ? { pathScopes: [...rule.pathScopes] } : {}),
|
|
248
|
+
enabled: rule.mode === 'required' || (rule.mode !== 'disabled' && (preferences[rule.manifest.id]?.enabled ?? rule.mode === 'recommended')),
|
|
249
|
+
authorized: rule.manifest.manifestVersion === 1 || preferences[rule.manifest.id]?.integrity === rule.integrity,
|
|
250
|
+
};
|
|
251
|
+
}),
|
|
252
|
+
)
|
|
253
|
+
: this.read(workspace.id)
|
|
254
|
+
.filter(item => !retiredSystemPlugin(item.manifest.id) && !this.systemIds.includes(item.manifest.id))
|
|
255
|
+
.map(item => ({ ...item, scope: 'workspace' as const }));
|
|
256
|
+
const workspaceById = new Map(plugins.map(item => [item.manifest.id, item]));
|
|
257
|
+
const canUseGlobalAuth = canManageWorkspacePlugins(adapter, workspace) && personalPolicy === 'allow';
|
|
258
|
+
for (const { record, pkg } of await resolveUserPlugins(this.storage, this.principal)) {
|
|
259
|
+
if (retiredSystemPlugin(record.id) || this.systemIds.includes(record.id)) continue;
|
|
260
|
+
const shadowed = workspaceById.get(record.id);
|
|
261
|
+
if (shadowed) {
|
|
262
|
+
// Workspace rules (including mode: 'disabled') always take precedence over user-scope plugins.
|
|
263
|
+
shadowed.shadowedUserPlugin = true;
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
const hydratedManifest = hydratePluginPackageAssets(pkg.manifest, pkg);
|
|
267
|
+
const isCode = pkg.manifest.manifestVersion === 2;
|
|
268
|
+
const globallyAuthorized = isCode && record.authorizedIntegrity === record.integrity;
|
|
269
|
+
const authorized =
|
|
270
|
+
!isCode ||
|
|
271
|
+
(personalPolicy !== 'block' &&
|
|
272
|
+
(preferences[record.id]?.integrity === record.integrity || (canUseGlobalAuth && globallyAuthorized)));
|
|
273
|
+
plugins.push({
|
|
274
|
+
manifest: hydratedManifest,
|
|
275
|
+
scope: 'user',
|
|
276
|
+
enabled: record.enabled,
|
|
277
|
+
authorized,
|
|
278
|
+
globallyAuthorized,
|
|
279
|
+
...(isCode ? { personalCodePolicy: personalPolicy } : {}),
|
|
280
|
+
...(record.pathScopes?.length ? { pathScopes: [...record.pathScopes] } : {}),
|
|
281
|
+
rule: {
|
|
282
|
+
manifest: pkg.manifest,
|
|
283
|
+
integrity: record.integrity,
|
|
284
|
+
mode: 'optional',
|
|
285
|
+
settings: record.settings,
|
|
286
|
+
...(record.pathScopes?.length ? { pathScopes: [...record.pathScopes] } : {}),
|
|
287
|
+
...(record.sourceUrl ? { sourceUrl: record.sourceUrl } : {}),
|
|
288
|
+
},
|
|
289
|
+
});
|
|
290
|
+
}
|
|
163
291
|
for (const id of this.systemIds) {
|
|
164
292
|
const { pkg, integrity } = await systemPlugin(id);
|
|
165
|
-
plugins.push({
|
|
166
|
-
|
|
293
|
+
plugins.push({
|
|
294
|
+
manifest: pkg.manifest,
|
|
295
|
+
system: true,
|
|
296
|
+
scope: 'system',
|
|
297
|
+
enabled: preferences[id]?.enabled ?? true,
|
|
298
|
+
authorized: true,
|
|
299
|
+
rule: { manifest: pkg.manifest, integrity, mode: 'recommended', settings: {} },
|
|
300
|
+
});
|
|
167
301
|
}
|
|
168
302
|
this.validate(plugins);
|
|
169
303
|
this.apply(plugins);
|
|
@@ -172,6 +306,12 @@ export class WorkspacePluginHost {
|
|
|
172
306
|
async changeWorkspace(adapter: WorkspaceAdapter, workspace: Workspace, change: PluginChange,
|
|
173
307
|
assertCurrent: () => void, repository?: PluginPackageRepository) {
|
|
174
308
|
if (this.workspaceId !== workspace.id || !this.shared) throw new Error('请先载入工作区插件规则');
|
|
309
|
+
if ('personalCodePlugins' in change) {
|
|
310
|
+
if (!canManageWorkspacePlugins(adapter, workspace)) throw new Error('仅工作区管理员可以修改插件规则');
|
|
311
|
+
assertCurrent();
|
|
312
|
+
this.shared = await saveWorkspacePersonalPluginPolicy(adapter, this.shared, change.personalCodePlugins, assertCurrent);
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
175
315
|
const id = 'install' in change ? change.install.id : 'uninstall' in change ? change.uninstall : change.id;
|
|
176
316
|
if (this.systemIds.includes(id)) {
|
|
177
317
|
assertCurrent();
|
|
@@ -180,6 +320,34 @@ export class WorkspacePluginHost {
|
|
|
180
320
|
}
|
|
181
321
|
if (retiredSystemPlugin(id) && !('uninstall' in change)) throw new Error(retiredMessage);
|
|
182
322
|
const rule = this.shared.policy.plugins.find(row => row.manifest.id === id);
|
|
323
|
+
const hasWorkspaceRecord = !!rule || (!this.shared.snapshot && this.read(workspace.id).some(row => row.manifest.id === id));
|
|
324
|
+
const hasUserRecord = readUserPlugins(this.storage, this.principal).some(row => row.id === id);
|
|
325
|
+
if ('install' in change && change.scope === 'user') {
|
|
326
|
+
assertCurrent();
|
|
327
|
+
await installUserPlugin(change.install, change.package, {
|
|
328
|
+
storage: this.storage,
|
|
329
|
+
principal: this.principal,
|
|
330
|
+
sourceUrl: change.sourceUrl,
|
|
331
|
+
binaryAssets: change.binaryAssets,
|
|
332
|
+
});
|
|
333
|
+
assertCurrent();
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
if ('settings' in change && !('mode' in change) && change.scope === 'user') {
|
|
337
|
+
assertCurrent();
|
|
338
|
+
setUserPluginSettings(id, change.settings, this.storage, this.principal, change.pathScopes);
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
if ('enabled' in change && (change.scope === 'user' || (change.scope === undefined && !hasWorkspaceRecord && hasUserRecord))) {
|
|
342
|
+
assertCurrent();
|
|
343
|
+
setUserPluginEnabled(id, change.enabled, this.storage, this.principal);
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
if ('uninstall' in change && (change.scope === 'user' || (change.scope === undefined && !hasWorkspaceRecord && hasUserRecord))) {
|
|
347
|
+
assertCurrent();
|
|
348
|
+
uninstallUserPlugin(id, this.storage, this.principal);
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
183
351
|
if ('enabled' in change && this.shared.snapshot) {
|
|
184
352
|
if (!rule) throw new Error('插件已被卸载,请刷新后重试');
|
|
185
353
|
if (rule.mode === 'required' || rule.mode === 'disabled') throw new Error('此插件由工作区管理员统一控制');
|
|
@@ -189,17 +357,33 @@ export class WorkspacePluginHost {
|
|
|
189
357
|
if (!canManageWorkspacePlugins(adapter, workspace)) throw new Error('仅工作区管理员可以修改插件规则');
|
|
190
358
|
let desired: WorkspacePluginRule | null = null;
|
|
191
359
|
if ('install' in change) {
|
|
192
|
-
|
|
360
|
+
let manifest = parsePluginManifest(change.install);
|
|
193
361
|
let integrity: string | undefined;
|
|
194
|
-
|
|
195
|
-
|
|
362
|
+
let sourceUrl = change.sourceUrl;
|
|
363
|
+
if (manifest.manifestVersion === 2 || manifest.appearance?.iconRefs?.length || hasRasterIconAssets(manifest)) {
|
|
364
|
+
const inputPkg =
|
|
365
|
+
change.package && canonicalPluginJson(change.package.manifest) === canonicalPluginJson(manifest)
|
|
366
|
+
? parsePluginPackage(JSON.stringify(change.package))
|
|
367
|
+
: manifest.manifestVersion === 1 && !manifest.appearance?.iconRefs?.length
|
|
368
|
+
? parsePluginPackage(JSON.stringify({ packageVersion: 1, manifest }))
|
|
369
|
+
: (() => {
|
|
370
|
+
throw new Error(
|
|
371
|
+
manifest.manifestVersion === 2
|
|
372
|
+
? '请导入包含此版本脚本的插件包'
|
|
373
|
+
: '请导入包含此版本图标资产的完整插件包',
|
|
374
|
+
);
|
|
375
|
+
})();
|
|
376
|
+
const normalizedPkg = externalizeHeavyIconAssets(inputPkg);
|
|
377
|
+
if (canonicalPluginJson(normalizedPkg) !== canonicalPluginJson(inputPkg)) sourceUrl = undefined;
|
|
378
|
+
manifest = normalizedPkg.manifest;
|
|
196
379
|
const cache = new PluginPackageCache(this.storage);
|
|
197
|
-
integrity = await cache.put(change.
|
|
380
|
+
integrity = await cache.put(normalizedPkg, change.binaryAssets);
|
|
198
381
|
assertCurrent();
|
|
199
|
-
if (repository) await repository.publish(workspace.id, integrity, canonicalPluginJson(
|
|
382
|
+
if (repository) await repository.publish(workspace.id, integrity, canonicalPluginJson(normalizedPkg));
|
|
200
383
|
}
|
|
201
384
|
desired = { manifest, mode: rule?.mode ?? 'recommended', settings: rule?.settings ?? {},
|
|
202
|
-
...(
|
|
385
|
+
...(rule?.pathScopes?.length ? { pathScopes: rule.pathScopes } : {}),
|
|
386
|
+
...(integrity ? { integrity } : {}), ...(sourceUrl ? { sourceUrl } : {}) };
|
|
203
387
|
if (rule) {
|
|
204
388
|
const same = rule.integrity === integrity && canonicalPluginJson(rule.manifest) === canonicalPluginJson(manifest);
|
|
205
389
|
const previous = { manifest: rule.manifest, ...(rule.integrity ? { integrity: rule.integrity } : {}), ...(rule.sourceUrl ? { sourceUrl: rule.sourceUrl } : {}), recordedAt: new Date().toISOString() };
|
|
@@ -212,7 +396,14 @@ export class WorkspacePluginHost {
|
|
|
212
396
|
desired = { ...rule, history: rule.history.filter(version => version.integrity !== change.forgetVersion) };
|
|
213
397
|
} else if ('mode' in change) {
|
|
214
398
|
if (!rule) throw new Error('插件已被卸载,请刷新后重试');
|
|
215
|
-
|
|
399
|
+
const nextScopes = change.pathScopes === undefined ? rule.pathScopes : parsePluginPathScopes(change.pathScopes);
|
|
400
|
+
desired = {
|
|
401
|
+
...rule,
|
|
402
|
+
mode: change.mode,
|
|
403
|
+
settings: parsePluginSettings(change.settings),
|
|
404
|
+
sourceUrl: change.sourceUrl || undefined,
|
|
405
|
+
...(nextScopes?.length ? { pathScopes: nextScopes } : { pathScopes: undefined }),
|
|
406
|
+
};
|
|
216
407
|
} else if ('enabled' in change) {
|
|
217
408
|
const legacy = this.read(workspace.id).find(row => row.manifest.id === id);
|
|
218
409
|
if (!legacy) throw new Error('插件已被卸载');
|
package/src/runtime.ts
CHANGED
|
@@ -72,6 +72,85 @@ export interface WorkbenchObjectDetailsProps {
|
|
|
72
72
|
object: WorkspaceObject;
|
|
73
73
|
disabled: boolean;
|
|
74
74
|
}
|
|
75
|
+
export interface WorkbenchPinnedCommand {
|
|
76
|
+
id: string;
|
|
77
|
+
label: string;
|
|
78
|
+
command: string;
|
|
79
|
+
description?: string;
|
|
80
|
+
}
|
|
81
|
+
export interface WorkbenchOverlaySnapshot {
|
|
82
|
+
readonly safeMode: boolean;
|
|
83
|
+
readonly hiddenSidebarItems?: readonly string[];
|
|
84
|
+
readonly sidebarOrder?: readonly string[];
|
|
85
|
+
readonly pinnedCommands?: readonly WorkbenchPinnedCommand[];
|
|
86
|
+
readonly homeTabViewKey?: string;
|
|
87
|
+
readonly newTabViewKey?: string;
|
|
88
|
+
}
|
|
89
|
+
export interface WorkbenchOverlayExtension {
|
|
90
|
+
readonly snapshot: WorkbenchOverlaySnapshot;
|
|
91
|
+
setSafeMode(enabled: boolean): void;
|
|
92
|
+
syncContext?(workspaceId: string, activeDocumentPath?: string): void;
|
|
93
|
+
dispose?(): void;
|
|
94
|
+
}
|
|
95
|
+
export interface WorkbenchAssistantToolExecutionContext {
|
|
96
|
+
workspaceId: string;
|
|
97
|
+
workspacePath: string;
|
|
98
|
+
runId: string;
|
|
99
|
+
activeDocumentId?: string;
|
|
100
|
+
signal: AbortSignal;
|
|
101
|
+
}
|
|
102
|
+
export type WorkbenchAssistantToolExecutionResult =
|
|
103
|
+
| { kind: 'result'; data: unknown }
|
|
104
|
+
| { kind: 'proposal'; proposal: import('@tano/protocol').AssistantProposal };
|
|
105
|
+
export interface WorkbenchAssistantStarter {
|
|
106
|
+
id: string;
|
|
107
|
+
label: string;
|
|
108
|
+
prompt: string;
|
|
109
|
+
icon?: Component;
|
|
110
|
+
requiresActiveDocument?: boolean;
|
|
111
|
+
}
|
|
112
|
+
export interface WorkbenchAssistantCapabilityNote {
|
|
113
|
+
id: string;
|
|
114
|
+
label: string;
|
|
115
|
+
detail?: string;
|
|
116
|
+
tone?: 'default' | 'warning';
|
|
117
|
+
}
|
|
118
|
+
export interface WorkbenchAssistantProposalCardDescriptor {
|
|
119
|
+
component: Component;
|
|
120
|
+
kindLabel?: string;
|
|
121
|
+
applyLabel?: string;
|
|
122
|
+
defaultOpen?: boolean;
|
|
123
|
+
hideDefaultDiff?: boolean;
|
|
124
|
+
hideDefaultActions?: boolean;
|
|
125
|
+
}
|
|
126
|
+
export interface WorkbenchAssistantExtension {
|
|
127
|
+
listTools(context: {
|
|
128
|
+
workspaceReadOnly: boolean;
|
|
129
|
+
inline: boolean;
|
|
130
|
+
background: boolean;
|
|
131
|
+
}): NonNullable<import('@tano/protocol').AssistantRequest['tools']>;
|
|
132
|
+
toolLabel?(name: string): string | undefined;
|
|
133
|
+
promptHints?(context: { workspaceReadOnly: boolean }): string[];
|
|
134
|
+
executeTool(
|
|
135
|
+
name: string,
|
|
136
|
+
args: Record<string, unknown>,
|
|
137
|
+
context: WorkbenchAssistantToolExecutionContext,
|
|
138
|
+
): Promise<WorkbenchAssistantToolExecutionResult | undefined>;
|
|
139
|
+
applyProposal?(
|
|
140
|
+
proposal: import('@tano/protocol').AssistantProposal,
|
|
141
|
+
parsedArgs: Record<string, unknown>,
|
|
142
|
+
): Promise<{ before?: string; after: string; hash: string; fileId: string; undoSnapshot?: string } | undefined>;
|
|
143
|
+
canUndoProposal?(proposal: import('@tano/protocol').AssistantProposal): boolean;
|
|
144
|
+
undoProposal?(proposal: import('@tano/protocol').AssistantProposal): Promise<boolean>;
|
|
145
|
+
proposalCard?(
|
|
146
|
+
proposal: import('@tano/protocol').AssistantProposal,
|
|
147
|
+
): WorkbenchAssistantProposalCardDescriptor | undefined;
|
|
148
|
+
starters?(context: { demo: boolean }): readonly WorkbenchAssistantStarter[];
|
|
149
|
+
capabilitySummary?(context: {
|
|
150
|
+
workspaceReadOnly: boolean;
|
|
151
|
+
safeMode: boolean;
|
|
152
|
+
}): readonly WorkbenchAssistantCapabilityNote[];
|
|
153
|
+
}
|
|
75
154
|
export interface WorkbenchExtensions {
|
|
76
155
|
commands?: import('./shell/command-palette').WorkbenchCommand[];
|
|
77
156
|
editing: EditingSession;
|
|
@@ -80,15 +159,18 @@ export interface WorkbenchExtensions {
|
|
|
80
159
|
/**
|
|
81
160
|
* workspace-menu-layout can wrap built-in workspace actions through its default slot.
|
|
82
161
|
* plugin-publishing receives WorkbenchActions in the plugin center's My submissions view.
|
|
162
|
+
* plugin-forge receives WorkbenchActions + { canPublish } in the plugin center's Forge & Overlay view.
|
|
83
163
|
*/
|
|
84
164
|
regions: Record<string, Component>;
|
|
85
165
|
views?: readonly WorkbenchView[];
|
|
166
|
+
/** Optional product-owned workbench overlay hook (Safe Mode, sidebar overrides, home/new tab views). */
|
|
167
|
+
overlay?: WorkbenchOverlayExtension;
|
|
168
|
+
/** Optional product-owned assistant tools, prompt hints, and proposal appliers. */
|
|
169
|
+
assistant?: WorkbenchAssistantExtension;
|
|
86
170
|
/** Receives WorkbenchObjectDetailsProps for a saved workspace object. */
|
|
87
171
|
objectDetails?: Component;
|
|
88
172
|
commentAuthor?: () => CommentAuthor;
|
|
89
173
|
settingsPages?: SettingsPage[];
|
|
90
|
-
/** Optional cloud backend configuration; system owns the common entry point. */
|
|
91
|
-
sync?: { readonly enabled: boolean; open(): void; disconnect(): Promise<void> };
|
|
92
174
|
historyView?: Component;
|
|
93
175
|
readonly historyEnabled?: boolean;
|
|
94
176
|
refresh(): Promise<unknown>;
|
|
@@ -111,6 +193,10 @@ export interface WorkbenchRuntime {
|
|
|
111
193
|
accountImports?: ImportAccountHost;
|
|
112
194
|
native: boolean;
|
|
113
195
|
mobile: boolean;
|
|
196
|
+
/** Optional stateless overlay hook available before workspace store initialization. */
|
|
197
|
+
overlay?: WorkbenchOverlayExtension;
|
|
198
|
+
/** Optional stateless assistant extension hook available before workspace store initialization. */
|
|
199
|
+
assistantExtension?: WorkbenchAssistantExtension;
|
|
114
200
|
extensions?: () => WorkbenchExtensions;
|
|
115
201
|
}
|
|
116
202
|
|
|
@@ -119,6 +205,10 @@ export interface WorkbenchRuntime {
|
|
|
119
205
|
export const CLOUD_EXTENSION_API_VERSION = 1 as const;
|
|
120
206
|
export interface CloudExtension {
|
|
121
207
|
readonly apiVersion: typeof CLOUD_EXTENSION_API_VERSION;
|
|
208
|
+
/** Optional stateless overlay hook resolved without instantiating workspace-bound extensions. */
|
|
209
|
+
readonly overlay?: WorkbenchOverlayExtension;
|
|
210
|
+
/** Optional stateless assistant extension hook resolved without instantiating workspace-bound extensions. */
|
|
211
|
+
readonly assistant?: WorkbenchAssistantExtension;
|
|
122
212
|
createWorkbenchExtensions(pinia: Pinia): WorkbenchExtensions;
|
|
123
213
|
}
|
|
124
214
|
|
|
@@ -132,16 +222,24 @@ export function configureWorkbench(pinia: Pinia, runtime: WorkbenchRuntime) {
|
|
|
132
222
|
}
|
|
133
223
|
export function configureWorkbenchWithCloudExtension(
|
|
134
224
|
pinia: Pinia,
|
|
135
|
-
runtime: Omit<WorkbenchRuntime, 'extensions'>,
|
|
225
|
+
runtime: Omit<WorkbenchRuntime, 'extensions' | 'overlay' | 'assistantExtension'>,
|
|
136
226
|
cloud: CloudExtension,
|
|
137
227
|
) {
|
|
138
228
|
if (cloud.apiVersion !== CLOUD_EXTENSION_API_VERSION)
|
|
139
229
|
throw new Error(`不支持的云扩展接口版本:${cloud.apiVersion}`);
|
|
140
230
|
return configureWorkbench(pinia, {
|
|
141
231
|
...runtime,
|
|
232
|
+
...(cloud.overlay ? { overlay: cloud.overlay } : {}),
|
|
233
|
+
...(cloud.assistant ? { assistantExtension: cloud.assistant } : {}),
|
|
142
234
|
extensions: () => cloud.createWorkbenchExtensions(pinia),
|
|
143
235
|
});
|
|
144
236
|
}
|
|
237
|
+
export function resolveOverlayExtension(runtime: WorkbenchRuntime): WorkbenchOverlayExtension | undefined {
|
|
238
|
+
return runtime.overlay ?? runtime.extensions?.().overlay;
|
|
239
|
+
}
|
|
240
|
+
export function resolveAssistantExtension(runtime: WorkbenchRuntime): WorkbenchAssistantExtension | undefined {
|
|
241
|
+
return runtime.assistantExtension ?? runtime.extensions?.().assistant;
|
|
242
|
+
}
|
|
145
243
|
export function useWorkbenchRuntime(): WorkbenchRuntime {
|
|
146
244
|
const pinia = getActivePinia();
|
|
147
245
|
const runtime = pinia && runtimes.get(pinia);
|
|
@@ -9,6 +9,8 @@ import { uiLocaleOptions } from '../../i18n/locale';
|
|
|
9
9
|
import { settingHint } from '../setting-examples';
|
|
10
10
|
import type { ThemePreference } from '../../appearance/theme';
|
|
11
11
|
import { useEditorFontFamily } from '../../appearance/use-editor-font';
|
|
12
|
+
import { type InterfaceFontChoice } from '../../appearance/interface-font';
|
|
13
|
+
import { useInterfaceFont } from '../../appearance/use-interface-font';
|
|
12
14
|
import GlassWallpaperSetting from '../../appearance/components/GlassWallpaperSetting.vue';
|
|
13
15
|
import ThemePresetPicker from '../../appearance/components/ThemePresetPicker.vue';
|
|
14
16
|
import { settingsPanelContextKey } from './settings-context';
|
|
@@ -93,6 +95,14 @@ function customFontInput(event: Event, target: FontTarget = 'unified') {
|
|
|
93
95
|
});
|
|
94
96
|
}
|
|
95
97
|
|
|
98
|
+
const { preference: interfaceFont, update: updateInterfaceFont } = useInterfaceFont();
|
|
99
|
+
function interfaceFontInput(event: Event) {
|
|
100
|
+
const input = event.target as HTMLInputElement;
|
|
101
|
+
const value = sanitizeCustomFontName(input.value);
|
|
102
|
+
if (input.value !== value) input.value = value;
|
|
103
|
+
updateInterfaceFont({ customName: value });
|
|
104
|
+
}
|
|
105
|
+
|
|
96
106
|
type MotionOptionKey =
|
|
97
107
|
| 'smoothCaret'
|
|
98
108
|
| 'typingMotion'
|
|
@@ -237,6 +247,42 @@ const { preferences: helpPreferences, setEnabled: setHelpEnabled } = useHelpPref
|
|
|
237
247
|
</div>
|
|
238
248
|
</section>
|
|
239
249
|
|
|
250
|
+
<section class="settings-section" :aria-label="t('界面字体')">
|
|
251
|
+
<h3>{{ t('界面字体') }}</h3>
|
|
252
|
+
<div class="settings-card">
|
|
253
|
+
<div class="settings-row" data-settings-key="appearance-interface-font">
|
|
254
|
+
<div>
|
|
255
|
+
<strong>{{ t('界面字体') }}</strong>
|
|
256
|
+
<p>{{ t('用于侧栏、标签、菜单和对话框,不影响文档正文。仅保存在当前设备。') }}</p>
|
|
257
|
+
</div>
|
|
258
|
+
<select
|
|
259
|
+
:value="interfaceFont.choice"
|
|
260
|
+
:aria-label="t('界面字体')"
|
|
261
|
+
@change="updateInterfaceFont({ choice: ($event.target as HTMLSelectElement).value as InterfaceFontChoice })"
|
|
262
|
+
>
|
|
263
|
+
<option value="builtin">{{ t('内置(Inter + 思源黑体)') }}</option>
|
|
264
|
+
<option value="system">{{ t('系统字体') }}</option>
|
|
265
|
+
<option value="custom">{{ t('自定义字体') }}</option>
|
|
266
|
+
</select>
|
|
267
|
+
</div>
|
|
268
|
+
<div v-if="interfaceFont.choice === 'custom'" class="settings-row settings-custom-font-row" data-settings-key="appearance-interface-custom-font">
|
|
269
|
+
<div>
|
|
270
|
+
<strong>{{ t('界面字体名称') }}</strong>
|
|
271
|
+
<p>{{ t('输入本机字体名称;未安装时会回退到系统字体。') }}</p>
|
|
272
|
+
</div>
|
|
273
|
+
<input
|
|
274
|
+
:value="interfaceFont.customName"
|
|
275
|
+
type="text"
|
|
276
|
+
maxlength="80"
|
|
277
|
+
autocomplete="off"
|
|
278
|
+
:aria-label="t('自定义界面字体名称')"
|
|
279
|
+
:placeholder="t('例如:HarmonyOS Sans SC')"
|
|
280
|
+
@input="interfaceFontInput"
|
|
281
|
+
/>
|
|
282
|
+
</div>
|
|
283
|
+
</div>
|
|
284
|
+
</section>
|
|
285
|
+
|
|
240
286
|
<section class="settings-section" data-settings-key="appearance-custom-font" :aria-label="t('编辑字体与字号')">
|
|
241
287
|
<h3>{{ t('编辑字体与字号') }}</h3>
|
|
242
288
|
<div class="settings-card settings-font-card">
|
|
@@ -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'),
|
|
@@ -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>
|