@tano.page/workbench 0.15.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 +35 -14
- package/src/App.vue +68 -797
- 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/AssistantPanel.vue +1 -1
- package/src/assistant/connection-actions.ts +237 -0
- package/src/assistant/document-mentions.ts +1 -33
- package/src/assistant/engine.ts +1 -585
- package/src/assistant/execution.ts +6 -33
- package/src/assistant/hash.ts +1 -4
- package/src/assistant/language.ts +10 -37
- package/src/assistant/plugin-bridge-builder.ts +146 -0
- package/src/assistant/prompts.ts +1 -65
- package/src/assistant/proposal-actions.ts +336 -0
- package/src/assistant/store.ts +87 -554
- package/src/assistant/structures.ts +1 -157
- package/src/assistant/tasks.ts +8 -94
- package/src/assistant/tool-rules.ts +1 -7
- package/src/composables/use-workbench-help.ts +177 -0
- package/src/composables/use-workbench-lifecycle.ts +249 -0
- package/src/composables/use-workbench-settings.ts +185 -0
- package/src/composables/use-workbench-shortcuts.ts +37 -1022
- package/src/composables/use-workbench-views.ts +325 -0
- package/src/documents/components/DocumentActionMenu.vue +279 -0
- 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/files/components/FileMetadataPanel.vue +49 -15
- package/src/i18n/locale-catalogs.ts +7 -6
- package/src/i18n/locale-registry.ts +8 -6
- package/src/i18n/locales/de-DE.json +23 -1
- package/src/i18n/locales/en-US.json +23 -1
- package/src/i18n/locales/es-ES.json +23 -1
- package/src/i18n/locales/ja-JP.json +23 -1
- package/src/i18n/locales/zh-TW.json +23 -1
- package/src/mail/components/MailAccountDialog.vue +1 -0
- package/src/mail/components/MailComposerDialog.vue +1 -0
- package/src/mail/components/MailWorkspaceView.vue +1 -0
- package/src/mail/components/SidebarMail.vue +1 -0
- package/src/objects/content-references.ts +6 -56
- package/src/objects/wiki-links.ts +1 -48
- package/src/objects/workspace-objects.ts +2 -3
- package/src/plans/calendar.ts +2 -2
- package/src/plans/components/CalendarAgendaView.vue +165 -0
- 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 +162 -2106
- package/src/plans/components/CalendarYearView.vue +138 -0
- package/src/plans/components/PlanConnectionsDialog.vue +1 -1
- 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/plugins/components/PluginDetailPage.vue +10 -6
- package/src/plugins/components/PluginDeveloperArea.vue +192 -0
- package/src/plugins/components/PluginExplorer.vue +6 -4
- package/src/plugins/components/PluginImportDialog.vue +1 -1
- package/src/plugins/components/PluginInstaller.vue +269 -178
- package/src/plugins/components/PluginMaintenance.vue +37 -49
- package/src/plugins/components/PluginRepositoryStorage.vue +4 -2
- package/src/plugins/components/PluginSettingsForm.vue +2 -1
- 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/plugin-data.ts +2 -3
- package/src/plugins/plugin-rpc-router.ts +558 -0
- package/src/plugins/plugin-sdk.ts +1 -260
- package/src/plugins/plugin-ui-dialogs.ts +167 -0
- package/src/plugins/queries.ts +1 -75
- package/src/plugins/view-header.ts +2 -7
- package/src/runtime.ts +3 -2
- 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/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/WorkbenchContextMenus.vue +37 -26
- package/src/shell/components/WorkbenchModals.vue +22 -18
- package/src/shell/components/WorkbenchPanes.vue +358 -1512
- package/src/shell/components/WorkbenchSidebar.vue +486 -0
- 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 +488 -1081
- package/src/shell/workbench-context.ts +30 -3
- package/src/stores/workspace-document-io.ts +807 -0
- package/src/stores/workspace-file-ops.ts +1 -1
- package/src/stores/workspace-knowledge.ts +1 -1
- package/src/stores/workspace-lifecycle.ts +459 -0
- package/src/stores/workspace-plugins-state.ts +71 -599
- package/src/stores/workspace-session.ts +287 -0
- package/src/stores/workspace-tabs-layout.ts +1 -1
- package/src/stores/workspace-types.ts +50 -0
- package/src/stores/workspace.ts +163 -1345
- package/src/styles.css +0 -1
- package/src/tabs/components/DesktopTabs.vue +19 -11
- 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/WorkspaceIconPicker.vue +5 -4
- package/src/workspace/components/WorkspacePickerMenu.vue +317 -0
- package/src/assistant/locales/de-DE.json +0 -129
- package/src/assistant/locales/en-US.json +0 -129
- package/src/assistant/locales/es-ES.json +0 -129
- package/src/assistant/locales/ja-JP.json +0 -129
- package/src/assistant/locales/zh-CN.json +0 -129
- package/src/assistant/locales/zh-TW.json +0 -129
- package/src/assistant/task-prompts.json +0 -39
|
@@ -4,6 +4,7 @@ const { window, document } = useWindowContext();
|
|
|
4
4
|
|
|
5
5
|
import { vSurfaceMotion } from '@tano/editor/surface-motion';
|
|
6
6
|
import { computed, ref, watch, onMounted, onBeforeUnmount } from 'vue';
|
|
7
|
+
import { X } from 'lucide-vue-next';
|
|
7
8
|
import { useWorkspaceStore } from '../../stores/workspace';
|
|
8
9
|
import type { FileMetadataState } from '../file-metadata';
|
|
9
10
|
import { t } from '../../i18n/i18n';
|
|
@@ -13,6 +14,11 @@ const props = defineProps<{ fileId: string; workspaceId: string }>();
|
|
|
13
14
|
const emit = defineEmits<{ close: [] }>();
|
|
14
15
|
const store = useWorkspaceStore();
|
|
15
16
|
const file = computed(() => store.workspace?.id === props.workspaceId ? store.fileRegistry?.get(props.fileId) : undefined);
|
|
17
|
+
function formatSize(bytes: number): string {
|
|
18
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
19
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
20
|
+
return `${(bytes / (1024 * 1024)).toFixed(2)} MB`;
|
|
21
|
+
}
|
|
16
22
|
const state = ref<FileMetadataState>();
|
|
17
23
|
const tags = ref(''); const properties = ref('{}'); const error = ref(''); const busy = ref(false);
|
|
18
24
|
const owner = ref(''); const status = ref(''); const linkTarget = ref('');
|
|
@@ -81,27 +87,37 @@ async function save() {
|
|
|
81
87
|
<div v-surface-motion="'FileMetadataPanel:0'" class="file-metadata-backdrop" @click.self="!busy && emit('close')" @keydown.esc.stop="!busy && emit('close')">
|
|
82
88
|
<section ref="panel" role="dialog" aria-modal="true" :aria-label="t('文件属性')" class="file-metadata-panel" @keydown="trapFocus">
|
|
83
89
|
<div ref="scrollElement" class="file-metadata-scroll"><div>
|
|
84
|
-
<div class="heading"><
|
|
90
|
+
<div class="heading"><h2>{{ t('文件属性') }}</h2><button type="button" class="icon-button" :aria-label="t('关闭')" :disabled="busy" @click="emit('close')"><X :size="18" /></button></div>
|
|
85
91
|
<template v-if="file">
|
|
86
|
-
<dl><dt>{{ t('路径') }}</dt><dd>{{ file.path }}</dd><dt>
|
|
87
|
-
<p v-if="isMarkdown(file.path)">{{ t('Markdown 属性在文档内编辑,关联来自正文引用。') }}</p>
|
|
92
|
+
<dl class="summary-meta"><dt>{{ t('路径') }}</dt><dd>{{ file.path }}</dd><dt>{{ t('大小') }}</dt><dd>{{ formatSize(file.size) }}</dd></dl>
|
|
93
|
+
<p v-if="isMarkdown(file.path)" class="meta-hint">{{ t('Markdown 属性在文档内编辑,关联来自正文引用。') }}</p>
|
|
88
94
|
<template v-else>
|
|
89
95
|
<form @submit.prevent="save">
|
|
90
96
|
<label>{{ t('负责人') }}<input v-model="owner" :disabled="busy || !state || store.workspace?.readOnly || file.readOnly" maxlength="200" /></label>
|
|
91
97
|
<label>{{ t('状态') }}<input v-model="status" list="file-status-options" :disabled="busy || !state || store.workspace?.readOnly || file.readOnly" maxlength="100" /></label>
|
|
92
98
|
<datalist id="file-status-options"><option>{{ t('待处理') }}</option><option>{{ t('进行中') }}</option><option>{{ t('已完成') }}</option></datalist>
|
|
93
99
|
<label>{{ t('标签(逗号分隔)') }}<input v-model="tags" :disabled="busy || !state || workspaceId !== store.workspace?.id || store.workspace?.readOnly || file.readOnly" /></label>
|
|
94
|
-
<
|
|
95
|
-
|
|
100
|
+
<details class="technical-details">
|
|
101
|
+
<summary>{{ t('技术详情') }}</summary>
|
|
102
|
+
<dl class="tech-meta"><dt>File ID</dt><dd><code>{{ file.id }}</code></dd><dt>MIME</dt><dd><code>{{ file.mimeType }}</code></dd><dt>SHA-256</dt><dd><code>{{ file.revision || '—' }}</code></dd></dl>
|
|
103
|
+
<label>{{ t('属性(JSON)') }}<textarea class="panel-scrollbar" v-model="properties" rows="6" :disabled="busy || !state || store.workspace?.readOnly || file.readOnly" spellcheck="false" /></label>
|
|
104
|
+
</details>
|
|
105
|
+
<div class="form-actions"><button type="submit" class="primary-button" :disabled="busy || !state || store.workspace?.readOnly || file.readOnly">{{ t('保存') }}</button></div>
|
|
96
106
|
</form>
|
|
97
|
-
<section :aria-label="t('关联对象')">
|
|
107
|
+
<section class="relations-section" :aria-label="t('关联对象')">
|
|
98
108
|
<h3>{{ t('关联对象') }}</h3>
|
|
99
|
-
<ul><li v-for="row in links" :key="row.id">{{ targets.find(target => referenceKey(target) === referenceKey(linkedTarget(row)))?.name ?? referenceKey(linkedTarget(row)) }}
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
|
|
109
|
+
<ul v-if="links.length" class="link-list"><li v-for="row in links" :key="row.id"><span>{{ targets.find(target => referenceKey(target) === referenceKey(linkedTarget(row)))?.name ?? referenceKey(linkedTarget(row)) }}</span><button type="button" class="secondary-button" :disabled="busy || store.workspace?.readOnly" @click="removeLink(row)">{{ t('移除关联') }}</button></li></ul>
|
|
110
|
+
<div class="link-picker">
|
|
111
|
+
<select v-model="linkTarget" :aria-label="t('选择对象')" :disabled="busy || store.workspace?.readOnly || !store.capabilities.features.objectReferences"><option value="">{{ t('选择对象') }}</option><option v-for="target in targets" :key="referenceKey(target)" :value="referenceKey(target)">{{ target.name }} · {{ target.type }}</option></select>
|
|
112
|
+
<button type="button" class="secondary-button" :disabled="busy || !linkTarget || store.workspace?.readOnly" @click="addLink">{{ t('添加关联') }}</button>
|
|
113
|
+
</div>
|
|
114
|
+
<p v-if="!store.capabilities.features.objectReferences" class="meta-hint">{{ t('请在工作区设置中启用「工作区对象与引用」。') }}</p>
|
|
103
115
|
</section>
|
|
104
116
|
</template>
|
|
117
|
+
<details v-if="isMarkdown(file.path)" class="technical-details">
|
|
118
|
+
<summary>{{ t('技术详情') }}</summary>
|
|
119
|
+
<dl class="tech-meta"><dt>File ID</dt><dd><code>{{ file.id }}</code></dd><dt>MIME</dt><dd><code>{{ file.mimeType }}</code></dd><dt>SHA-256</dt><dd><code>{{ file.revision || '—' }}</code></dd></dl>
|
|
120
|
+
</details>
|
|
105
121
|
</template>
|
|
106
122
|
<p v-else role="status">{{ t('文件已移动或删除。') }}</p>
|
|
107
123
|
<p v-if="error" role="alert">{{ error }}</p>
|
|
@@ -113,9 +129,27 @@ async function save() {
|
|
|
113
129
|
<style scoped>
|
|
114
130
|
.file-metadata-backdrop { position: fixed; inset: 0; z-index: 1200; background: #0006; display: grid; place-items: center; padding: 16px; }
|
|
115
131
|
.file-metadata-panel { background: var(--surface, var(--paper)); color: var(--text); width: min(520px, 100%); max-height: 90dvh; overflow: hidden; display: flex; padding: 0; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px #0003; }
|
|
116
|
-
.file-metadata-scroll { flex: 1; min-width: 0; min-height: 0; overflow: auto; padding: 24px; }
|
|
117
|
-
.heading { display: flex; justify-content: space-between; align-items: center; }
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
132
|
+
.file-metadata-scroll { flex: 1; min-width: 0; min-height: 0; overflow: auto; padding: 22px 24px; }
|
|
133
|
+
.heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
|
|
134
|
+
.heading h2 { margin: 0; font-size: 16px; font-weight: 600; }
|
|
135
|
+
dl { display: grid; grid-template-columns: 76px 1fr; gap: 6px 10px; font-size: 13px; margin: 10px 0 14px; }
|
|
136
|
+
dt { color: var(--muted); }
|
|
137
|
+
dd { margin: 0; overflow-wrap: anywhere; }
|
|
138
|
+
code { font: 12px/1.4 var(--font-mono); color: var(--text-secondary, var(--muted)); }
|
|
139
|
+
.meta-hint { font-size: 12px; color: var(--muted); margin: 8px 0 12px; }
|
|
140
|
+
label { display: grid; gap: 6px; margin: 12px 0; font-size: 13px; }
|
|
141
|
+
input, textarea, select { width: 100%; box-sizing: border-box; background: var(--paper); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px; font: inherit; }
|
|
142
|
+
textarea { font: 12.5px/1.5 var(--font-mono); }
|
|
143
|
+
.technical-details { margin: 14px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
|
|
144
|
+
.technical-details > summary { cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--muted); user-select: none; }
|
|
145
|
+
.tech-meta { margin: 10px 0 6px; font-size: 12px; }
|
|
146
|
+
.form-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
|
|
147
|
+
.relations-section { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
|
|
148
|
+
.relations-section h3 { margin: 0 0 10px; font-size: 13.5px; font-weight: 600; }
|
|
149
|
+
.link-list { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
|
|
150
|
+
.link-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
|
|
151
|
+
.link-picker { display: flex; gap: 8px; align-items: center; }
|
|
152
|
+
.link-picker select { flex: 1; min-width: 0; }
|
|
153
|
+
.link-picker button { flex-shrink: 0; }
|
|
154
|
+
[role=alert] { color: var(--danger, #b33); overflow-wrap: anywhere; font-size: 13px; }
|
|
121
155
|
</style>
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
assistantCatalog as protocolAssistantCatalog,
|
|
3
|
+
type AssistantCopy,
|
|
4
|
+
} from '@tano/protocol/assistant-language';
|
|
1
5
|
import { localeDefinition, type UiLocale } from './locale-registry';
|
|
2
|
-
// Small synchronous fallbacks also serve non-UI consumers of assistantCopy().
|
|
3
|
-
import chineseAssistant from '../assistant/locales/zh-CN.json';
|
|
4
|
-
import englishAssistant from '../assistant/locales/en-US.json';
|
|
5
6
|
import type { PluralCatalog } from './plurals';
|
|
6
7
|
|
|
7
8
|
export type Messages = Readonly<Record<string, string>>;
|
|
8
|
-
export interface LocaleCatalogs { messages: Messages; icons: Messages; assistant:
|
|
9
|
+
export interface LocaleCatalogs { messages: Messages; icons: Messages; assistant: AssistantCopy; plurals: PluralCatalog }
|
|
9
10
|
const catalogs = new Map<UiLocale, LocaleCatalogs>();
|
|
10
11
|
const pending = new Map<UiLocale, Promise<void>>();
|
|
11
12
|
|
|
12
13
|
export function loadedLocale(locale: UiLocale) { return catalogs.get(locale); }
|
|
13
|
-
export function assistantCatalog(locale: UiLocale) {
|
|
14
|
-
return catalogs.get(locale)?.assistant ?? (locale
|
|
14
|
+
export function assistantCatalog(locale: UiLocale): AssistantCopy {
|
|
15
|
+
return catalogs.get(locale)?.assistant ?? protocolAssistantCatalog(locale);
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
/** Deduplicate concurrent imports; a failed request remains retryable. */
|
|
@@ -1,45 +1,47 @@
|
|
|
1
|
+
import { loadAssistantLocale } from '@tano/protocol/assistant-language';
|
|
2
|
+
|
|
1
3
|
/** One registration per language, including small recovery copy and lazy catalogs. */
|
|
2
4
|
export const localeRegistry = [
|
|
3
5
|
{ value: 'zh-CN', label: '简体中文', language: 'Simplified Chinese',
|
|
4
6
|
startup: { opening: '正在打开同页...', loading: '正在加载工作台,首次启动可能需要一些时间', retry: '重新加载', failure: '无法打开同页', timeout: '打开同页超时,工作台加载已超过 30 秒,请重新加载。' },
|
|
5
7
|
loadMessages: async () => ({}),
|
|
6
8
|
loadIcons: async () => ({}),
|
|
7
|
-
loadAssistant: () =>
|
|
9
|
+
loadAssistant: () => loadAssistantLocale('zh-CN'),
|
|
8
10
|
loadPlurals: async () => ({}),
|
|
9
11
|
},
|
|
10
12
|
{ value: 'en-US', label: 'English', language: 'English',
|
|
11
13
|
startup: { opening: 'Opening Tano...', loading: 'Loading the workbench. The first launch may take a moment.', retry: 'Reload', failure: 'Unable to open Tano', timeout: 'Opening Tano timed out after 30 seconds. Please reload.' },
|
|
12
14
|
loadMessages: () => import('./locales/en-US.json').then(module => module.default),
|
|
13
15
|
loadIcons: () => import('./locales/icon-labels-en.json').then(module => module.default),
|
|
14
|
-
loadAssistant: () =>
|
|
16
|
+
loadAssistant: () => loadAssistantLocale('en-US'),
|
|
15
17
|
loadPlurals: () => import('./locales/plurals-en-US.json').then(module => module.default),
|
|
16
18
|
},
|
|
17
19
|
{ value: 'zh-TW', label: '繁體中文', language: 'Traditional Chinese',
|
|
18
20
|
startup: { opening: '正在開啟同頁...', loading: '正在載入工作臺,首次啟動可能需要一些時間', retry: '重新載入', failure: '無法開啟同頁', timeout: '開啟同頁已超過 30 秒,請重新載入。' },
|
|
19
21
|
loadMessages: () => import('./locales/zh-TW.json').then(module => module.default),
|
|
20
22
|
loadIcons: () => import('./locales/icon-labels-zh-TW.json').then(module => module.default),
|
|
21
|
-
loadAssistant: () =>
|
|
23
|
+
loadAssistant: () => loadAssistantLocale('zh-TW'),
|
|
22
24
|
loadPlurals: async () => ({}),
|
|
23
25
|
},
|
|
24
26
|
{ value: 'ja-JP', label: '日本語', language: 'Japanese',
|
|
25
27
|
startup: { opening: 'Tano を開いています...', loading: 'ワークスペースを読み込んでいます。初回起動には時間がかかることがあります。', retry: '再読み込み', failure: 'Tano を開けませんでした', timeout: 'Tano の起動が 30 秒でタイムアウトしました。再読み込みしてください。' },
|
|
26
28
|
loadMessages: () => import('./locales/ja-JP.json').then(module => module.default),
|
|
27
29
|
loadIcons: () => import('./locales/icon-labels-ja-JP.json').then(module => module.default),
|
|
28
|
-
loadAssistant: () =>
|
|
30
|
+
loadAssistant: () => loadAssistantLocale('ja-JP'),
|
|
29
31
|
loadPlurals: async () => ({}),
|
|
30
32
|
},
|
|
31
33
|
{ value: 'es-ES', label: 'Español', language: 'Spanish',
|
|
32
34
|
startup: { opening: 'Abriendo Tano...', loading: 'Cargando el espacio de trabajo. El primer inicio puede tardar un momento.', retry: 'Recargar', failure: 'No se pudo abrir Tano', timeout: 'Tano no se ha abierto en 30 segundos. Recarga la página.' },
|
|
33
35
|
loadMessages: () => import('./locales/es-ES.json').then(module => module.default),
|
|
34
36
|
loadIcons: () => import('./locales/icon-labels-es-ES.json').then(module => module.default),
|
|
35
|
-
loadAssistant: () =>
|
|
37
|
+
loadAssistant: () => loadAssistantLocale('es-ES'),
|
|
36
38
|
loadPlurals: () => import('./locales/plurals-es-ES.json').then(module => module.default),
|
|
37
39
|
},
|
|
38
40
|
{ value: 'de-DE', label: 'Deutsch', language: 'German',
|
|
39
41
|
startup: { opening: 'Tano wird geöffnet...', loading: 'Der Arbeitsbereich wird geladen. Der erste Start kann einen Moment dauern.', retry: 'Neu laden', failure: 'Tano konnte nicht geöffnet werden', timeout: 'Tano konnte innerhalb von 30 Sekunden nicht geöffnet werden. Bitte neu laden.' },
|
|
40
42
|
loadMessages: () => import('./locales/de-DE.json').then(module => module.default),
|
|
41
43
|
loadIcons: () => import('./locales/icon-labels-de-DE.json').then(module => module.default),
|
|
42
|
-
loadAssistant: () =>
|
|
44
|
+
loadAssistant: () => loadAssistantLocale('de-DE'),
|
|
43
45
|
loadPlurals: () => import('./locales/plurals-de-DE.json').then(module => module.default),
|
|
44
46
|
},
|
|
45
47
|
] as const;
|
|
@@ -3967,5 +3967,27 @@
|
|
|
3967
3967
|
"邮箱账号": "E-Mail-Konto",
|
|
3968
3968
|
"邮箱账号管理": "E-Mail-Konten verwalten",
|
|
3969
3969
|
"附件({0})": "Anhänge ({0})",
|
|
3970
|
-
"(无主题)": "(Kein Betreff)"
|
|
3970
|
+
"(无主题)": "(Kein Betreff)",
|
|
3971
|
+
"技术详情": "Technische Details",
|
|
3972
|
+
"导入 .ics 文件中的待办任务。": "Aufgaben aus einer .ics-Datei importieren.",
|
|
3973
|
+
"内置模板与当前工作区模板": "Integrierte Vorlagen und Vorlagen dieses Arbeitsbereichs",
|
|
3974
|
+
"副本已保存,原文件保持不变": "Kopie gespeichert; die Originaldatei blieb unverändert",
|
|
3975
|
+
"已恢复本地草稿": "Lokaler Entwurf wiederhergestellt",
|
|
3976
|
+
"本地草稿损坏,原记录已备份,当前显示磁盘文件。": "Der lokale Entwurf war beschädigt. Eine Sicherung wurde behalten und die Datei auf der Festplatte wird angezeigt.",
|
|
3977
|
+
"本地草稿无法保存,请保存文件或另存副本后再关闭。": "Der lokale Entwurf konnte nicht gespeichert werden. Bitte speichere die Datei oder eine Kopie vor dem Schließen.",
|
|
3978
|
+
"插件开发者区": "Plugin-Entwicklerbereich",
|
|
3979
|
+
"开发者工具导航": "Entwicklerwerkzeug-Navigation",
|
|
3980
|
+
"导入与调试": "Import & Debugging",
|
|
3981
|
+
"插件工坊": "Plugin-Werkstatt",
|
|
3982
|
+
"导入本地插件包": "Lokales Plugin-Paket importieren",
|
|
3983
|
+
"导入 .tano-plugin.zip 归档包或声明式 JSON 清单,也可载入内置示例或仅缓存到当前设备用于调试。": "Importiere ein .tano-plugin.zip-Archiv oder ein deklaratives JSON-Manifest, lade ein integriertes Beispiel oder speichere es zum Debuggen lokal auf diesem Gerät.",
|
|
3984
|
+
"导入插件包…": "Plugin-Paket importieren…",
|
|
3985
|
+
"本地开发监听运行中": "Lokale Entwicklungsüberwachung aktiv",
|
|
3986
|
+
"插件归档包不能超过 16 MiB": "Das Plugin-Archiv darf höchstens 16 MiB groß sein",
|
|
3987
|
+
"工作台微调": "Arbeitsbereich anpassen",
|
|
3988
|
+
"开发者": "Entwickler",
|
|
3989
|
+
"去发现适合你的插件,扩展你的工作台能力。": "Entdecke passende Plugins, um deinen Arbeitsbereich zu erweitern.",
|
|
3990
|
+
"开启开发者模式以导入或开发插件": "Entwicklermodus aktivieren, um Plugins zu importieren oder zu erstellen",
|
|
3991
|
+
"开启后,可在插件中心访问开发者区(导入、工坊、调试与投稿),也可右键顶部标签栏空白处打开调试窗口。": "Aktiviert den Entwickler-Tab im Plugin-Center (Import, Werkstatt, Debugging, Veröffentlichen) sowie DevTools über das Kontextmenü der Tableiste.",
|
|
3992
|
+
"开启后,可在插件中心访问开发者区(导入插件、工坊、开发监听、运行日志与投稿)。": "Aktiviert den Entwickler-Tab im Plugin-Center (Import, Werkstatt, Dev-Watch, Laufzeitprotokolle und Veröffentlichen)."
|
|
3971
3993
|
}
|
|
@@ -3967,5 +3967,27 @@
|
|
|
3967
3967
|
"邮箱账号": "Email account",
|
|
3968
3968
|
"邮箱账号管理": "Email account management",
|
|
3969
3969
|
"附件({0})": "Attachments ({0})",
|
|
3970
|
-
"(无主题)": "(No subject)"
|
|
3970
|
+
"(无主题)": "(No subject)",
|
|
3971
|
+
"技术详情": "Technical details",
|
|
3972
|
+
"导入 .ics 文件中的待办任务。": "Import to-do tasks from an .ics file.",
|
|
3973
|
+
"内置模板与当前工作区模板": "Built-in and current workspace templates",
|
|
3974
|
+
"副本已保存,原文件保持不变": "Copy saved; the original file was not changed",
|
|
3975
|
+
"已恢复本地草稿": "Local draft restored",
|
|
3976
|
+
"本地草稿损坏,原记录已备份,当前显示磁盘文件。": "The local draft was corrupted. A backup was kept and the file on disk is shown.",
|
|
3977
|
+
"本地草稿无法保存,请保存文件或另存副本后再关闭。": "Could not save the local draft. Save the file or save a copy before closing.",
|
|
3978
|
+
"插件开发者区": "Plugin Developer Area",
|
|
3979
|
+
"开发者工具导航": "Developer tools navigation",
|
|
3980
|
+
"导入与调试": "Import & Debug",
|
|
3981
|
+
"插件工坊": "Plugin Forge",
|
|
3982
|
+
"导入本地插件包": "Import local plugin package",
|
|
3983
|
+
"导入 .tano-plugin.zip 归档包或声明式 JSON 清单,也可载入内置示例或仅缓存到当前设备用于调试。": "Import a .tano-plugin.zip archive or declarative JSON manifest, load a built-in example, or cache it on this device for debugging.",
|
|
3984
|
+
"导入插件包…": "Import Plugin Package…",
|
|
3985
|
+
"本地开发监听运行中": "Local development watcher active",
|
|
3986
|
+
"插件归档包不能超过 16 MiB": "Plugin archive cannot exceed 16 MiB",
|
|
3987
|
+
"工作台微调": "Workbench Tweaks",
|
|
3988
|
+
"开发者": "Developer",
|
|
3989
|
+
"去发现适合你的插件,扩展你的工作台能力。": "Discover plugins to extend your workbench.",
|
|
3990
|
+
"开启开发者模式以导入或开发插件": "Enable Developer Mode to import or build plugins",
|
|
3991
|
+
"开启后,可在插件中心访问开发者区(导入、工坊、调试与投稿),也可右键顶部标签栏空白处打开调试窗口。": "When enabled, unlocks the Developer tab in Plugin Center (import, forge, debugging, publishing) and DevTools from the tab bar context menu.",
|
|
3992
|
+
"开启后,可在插件中心访问开发者区(导入插件、工坊、开发监听、运行日志与投稿)。": "When enabled, unlocks the Developer tab in Plugin Center (import plugins, forge, dev watch, runtime logs, and publishing)."
|
|
3971
3993
|
}
|
|
@@ -3967,5 +3967,27 @@
|
|
|
3967
3967
|
"邮箱账号": "Cuenta de correo",
|
|
3968
3968
|
"邮箱账号管理": "Gestión de cuentas de correo",
|
|
3969
3969
|
"附件({0})": "Adjuntos ({0})",
|
|
3970
|
-
"(无主题)": "(Sin asunto)"
|
|
3970
|
+
"(无主题)": "(Sin asunto)",
|
|
3971
|
+
"技术详情": "Detalles técnicos",
|
|
3972
|
+
"导入 .ics 文件中的待办任务。": "Importar tareas pendientes desde un archivo .ics.",
|
|
3973
|
+
"内置模板与当前工作区模板": "Plantillas integradas y del espacio de trabajo actual",
|
|
3974
|
+
"副本已保存,原文件保持不变": "Copia guardada; el archivo original no ha cambiado",
|
|
3975
|
+
"已恢复本地草稿": "Borrador local restaurado",
|
|
3976
|
+
"本地草稿损坏,原记录已备份,当前显示磁盘文件。": "El borrador local estaba dañado. Se conservó una copia de seguridad y se muestra el archivo del disco.",
|
|
3977
|
+
"本地草稿无法保存,请保存文件或另存副本后再关闭。": "No se pudo guardar el borrador local. Guarda el archivo o una copia antes de cerrar.",
|
|
3978
|
+
"插件开发者区": "Área de desarrolladores de plugins",
|
|
3979
|
+
"开发者工具导航": "Navegación de herramientas de desarrollo",
|
|
3980
|
+
"导入与调试": "Importar y depurar",
|
|
3981
|
+
"插件工坊": "Taller de plugins",
|
|
3982
|
+
"导入本地插件包": "Importar paquete de plugin local",
|
|
3983
|
+
"导入 .tano-plugin.zip 归档包或声明式 JSON 清单,也可载入内置示例或仅缓存到当前设备用于调试。": "Importa un archivo .tano-plugin.zip o un manifiesto JSON declarativo, carga un ejemplo integrado o guárdalo en caché en este dispositivo para depurar.",
|
|
3984
|
+
"导入插件包…": "Importar paquete de plugin…",
|
|
3985
|
+
"本地开发监听运行中": "Observador de desarrollo local activo",
|
|
3986
|
+
"插件归档包不能超过 16 MiB": "El archivo del plugin no puede superar los 16 MiB",
|
|
3987
|
+
"工作台微调": "Ajustes del espacio",
|
|
3988
|
+
"开发者": "Desarrollador",
|
|
3989
|
+
"去发现适合你的插件,扩展你的工作台能力。": "Descubre plugins para ampliar las capacidades de tu espacio de trabajo.",
|
|
3990
|
+
"开启开发者模式以导入或开发插件": "Activa el modo desarrollador para importar o crear plugins",
|
|
3991
|
+
"开启后,可在插件中心访问开发者区(导入、工坊、调试与投稿),也可右键顶部标签栏空白处打开调试窗口。": "Al activarlo, desbloquea la pestaña Desarrollador en el Centro de plugins (importación, taller, depuración y publicación) y DevTools desde el menú contextual de la barra de pestañas.",
|
|
3992
|
+
"开启后,可在插件中心访问开发者区(导入插件、工坊、开发监听、运行日志与投稿)。": "Al activarlo, desbloquea la pestaña Desarrollador en el Centro de plugins (importar plugins, taller, observador de desarrollo, registros de ejecución y publicación)."
|
|
3971
3993
|
}
|
|
@@ -3967,5 +3967,27 @@
|
|
|
3967
3967
|
"邮箱账号": "メールアカウント",
|
|
3968
3968
|
"邮箱账号管理": "メールアカウント管理",
|
|
3969
3969
|
"附件({0})": "添付ファイル({0})",
|
|
3970
|
-
"(无主题)": "(件名なし)"
|
|
3970
|
+
"(无主题)": "(件名なし)",
|
|
3971
|
+
"技术详情": "技術的な詳細",
|
|
3972
|
+
"导入 .ics 文件中的待办任务。": ".ics ファイルからタスクをインポートします。",
|
|
3973
|
+
"内置模板与当前工作区模板": "組み込みテンプレートと現在のワークスペースのテンプレート",
|
|
3974
|
+
"副本已保存,原文件保持不变": "コピーを保存しました。元のファイルは変更されていません",
|
|
3975
|
+
"已恢复本地草稿": "ローカル下書きを復元しました",
|
|
3976
|
+
"本地草稿损坏,原记录已备份,当前显示磁盘文件。": "ローカル下書きが破損していたためバックアップを保持し、ディスク上のファイルを表示しています。",
|
|
3977
|
+
"本地草稿无法保存,请保存文件或另存副本后再关闭。": "ローカル下書きを保存できません。閉じる前にファイルを保存するかコピーを保存してください。",
|
|
3978
|
+
"插件开发者区": "プラグイン開発者エリア",
|
|
3979
|
+
"开发者工具导航": "開発者ツールナビゲーション",
|
|
3980
|
+
"导入与调试": "インポートとデバッグ",
|
|
3981
|
+
"插件工坊": "プラグイン工房",
|
|
3982
|
+
"导入本地插件包": "ローカルプラグインパッケージをインポート",
|
|
3983
|
+
"导入 .tano-plugin.zip 归档包或声明式 JSON 清单,也可载入内置示例或仅缓存到当前设备用于调试。": ".tano-plugin.zip アーカイブまたは宣言型 JSON マニフェストをインポートするか、内蔵サンプルを読み込んでこの端末にデバッグ用キャッシュとして保存します。",
|
|
3984
|
+
"导入插件包…": "プラグインパッケージをインポート…",
|
|
3985
|
+
"本地开发监听运行中": "ローカル開発ウォッチャー稼働中",
|
|
3986
|
+
"插件归档包不能超过 16 MiB": "プラグインアーカイブは 16 MiB 以内にしてください",
|
|
3987
|
+
"工作台微调": "ワークベンチ調整",
|
|
3988
|
+
"开发者": "開発者",
|
|
3989
|
+
"去发现适合你的插件,扩展你的工作台能力。": "ワークベンチを拡張するプラグインを見つけましょう。",
|
|
3990
|
+
"开启开发者模式以导入或开发插件": "開発者モードを有効にしてプラグインをインポート・開発する",
|
|
3991
|
+
"开启后,可在插件中心访问开发者区(导入、工坊、调试与投稿),也可右键顶部标签栏空白处打开调试窗口。": "有効にすると、プラグインセンターの開発者タブ(インポート、工房、デバッグ、公開)が利用でき、タブバー余白の右クリックからデバッグウィンドウを開けます。",
|
|
3992
|
+
"开启后,可在插件中心访问开发者区(导入插件、工坊、开发监听、运行日志与投稿)。": "有効にすると、プラグインセンターの開発者タブ(インポート、工房、開発監視、実行ログ、公開)が利用できます。"
|
|
3971
3993
|
}
|
|
@@ -3967,5 +3967,27 @@
|
|
|
3967
3967
|
"邮箱账号": "信箱帳號",
|
|
3968
3968
|
"邮箱账号管理": "信箱帳號管理",
|
|
3969
3969
|
"附件({0})": "附件({0})",
|
|
3970
|
-
"(无主题)": "(無主旨)"
|
|
3970
|
+
"(无主题)": "(無主旨)",
|
|
3971
|
+
"技术详情": "技術詳情",
|
|
3972
|
+
"导入 .ics 文件中的待办任务。": "匯入 .ics 檔案中的待辦任務。",
|
|
3973
|
+
"内置模板与当前工作区模板": "內建範本與目前工作區範本",
|
|
3974
|
+
"副本已保存,原文件保持不变": "副本已儲存,原檔案保持不變",
|
|
3975
|
+
"已恢复本地草稿": "已還原本機草稿",
|
|
3976
|
+
"本地草稿损坏,原记录已备份,当前显示磁盘文件。": "本機草稿已損毀,原記錄已備份,目前顯示磁碟檔案。",
|
|
3977
|
+
"本地草稿无法保存,请保存文件或另存副本后再关闭。": "無法儲存本機草稿,請先儲存檔案或另存副本後再關閉。",
|
|
3978
|
+
"插件开发者区": "外掛開發者區",
|
|
3979
|
+
"开发者工具导航": "開發者工具導覽",
|
|
3980
|
+
"导入与调试": "匯入與偵錯",
|
|
3981
|
+
"插件工坊": "外掛工坊",
|
|
3982
|
+
"导入本地插件包": "匯入本機外掛套件",
|
|
3983
|
+
"导入 .tano-plugin.zip 归档包或声明式 JSON 清单,也可载入内置示例或仅缓存到当前设备用于调试。": "匯入 .tano-plugin.zip 封存檔或宣告式 JSON 清單,也可載入內建範例或僅快取到目前裝置以供偵錯。",
|
|
3984
|
+
"导入插件包…": "匯入外掛套件…",
|
|
3985
|
+
"本地开发监听运行中": "本機開發監聽執行中",
|
|
3986
|
+
"插件归档包不能超过 16 MiB": "外掛封存檔不能超過 16 MiB",
|
|
3987
|
+
"工作台微调": "工作台微調",
|
|
3988
|
+
"开发者": "開發者",
|
|
3989
|
+
"去发现适合你的插件,扩展你的工作台能力。": "探索適合你的外掛,擴充你的工作台能力。",
|
|
3990
|
+
"开启开发者模式以导入或开发插件": "開啟開發者模式以匯入或開發外掛",
|
|
3991
|
+
"开启后,可在插件中心访问开发者区(导入、工坊、调试与投稿),也可右键顶部标签栏空白处打开调试窗口。": "開啟後,可在外掛中心存取開發者區(匯入、工坊、偵錯與投稿),也可在頂部分頁列空白處按右鍵開啟偵錯視窗。",
|
|
3992
|
+
"开启后,可在插件中心访问开发者区(导入插件、工坊、开发监听、运行日志与投稿)。": "開啟後,可在外掛中心存取開發者區(匯入外掛、工坊、開發監聽、執行日誌與投稿)。"
|
|
3971
3993
|
}
|
|
@@ -1,56 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
source: ReferenceTarget;
|
|
8
|
-
target: ReferenceIdentity;
|
|
9
|
-
name: string;
|
|
10
|
-
path?: string;
|
|
11
|
-
excerpt: string;
|
|
12
|
-
missing: boolean;
|
|
13
|
-
archived: boolean;
|
|
14
|
-
}
|
|
15
|
-
export interface ReferenceContext { outgoing: ContentReference[]; incoming: ContentReference[]; errors: string[] }
|
|
16
|
-
|
|
17
|
-
/** A rebuildable directed index. Content is authoritative; no duplicate relation rows are persisted. */
|
|
18
|
-
export function contentReferences(targets: readonly ReferenceTarget[], contents: ReadonlyMap<string, string>,
|
|
19
|
-
readLinks: (content: string) => readonly DocumentLinkDetail[] = documentLinkDetails): ContentReference[] {
|
|
20
|
-
const counts = new Map<string, number>();
|
|
21
|
-
for (const target of targets) counts.set(referenceKey(target), (counts.get(referenceKey(target)) ?? 0) + 1);
|
|
22
|
-
const byKey = new Map(targets.filter(target => counts.get(referenceKey(target)) === 1).map(target => [referenceKey(target), target]));
|
|
23
|
-
const documents = targets.filter(target => target.type === 'document')
|
|
24
|
-
.map(target => ({ id: target.id, path: target.path, name: target.name, kind: 'file' as const, size: 0, modified: 0 }));
|
|
25
|
-
const edges: ContentReference[] = [];
|
|
26
|
-
for (const source of targets) {
|
|
27
|
-
if (counts.get(referenceKey(source)) !== 1) continue;
|
|
28
|
-
const content = contents.get(referenceKey(source));
|
|
29
|
-
if (content === undefined) continue;
|
|
30
|
-
const seen = new Set<string>();
|
|
31
|
-
for (const link of readLinks(content)) {
|
|
32
|
-
let identity = parseReferenceUrl(link.target);
|
|
33
|
-
if (!identity && link.kind === 'wiki') {
|
|
34
|
-
const resolved = resolveWikiLink(documents, source.path, link.target);
|
|
35
|
-
if ('file' in resolved) identity = { type: 'document', id: resolved.file.id };
|
|
36
|
-
} else if (!identity) {
|
|
37
|
-
const path = resolveWorkspaceReference(source.path, link.target);
|
|
38
|
-
const target = targets.find(target => ['document', 'asset'].includes(target.type) && target.path === path);
|
|
39
|
-
if (target) identity = { type: target.type, id: target.id };
|
|
40
|
-
}
|
|
41
|
-
if (!identity || seen.has(referenceKey(identity))) continue;
|
|
42
|
-
seen.add(referenceKey(identity));
|
|
43
|
-
const target = byKey.get(referenceKey(identity));
|
|
44
|
-
const origin = { workspace: source.workspace, type: source.type, id: source.id, name: source.name, path: source.path, archived: source.archived };
|
|
45
|
-
edges.push({ source: origin, target: identity, name: target?.name ?? link.label ?? link.target,
|
|
46
|
-
path: target?.path, excerpt: link.excerpt, missing: !target, archived: !!target?.archived });
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return edges;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export function referenceContext(edges: readonly ContentReference[], identity: ReferenceIdentity, errors: string[] = []): ReferenceContext {
|
|
53
|
-
const key = referenceKey(identity);
|
|
54
|
-
return { outgoing: edges.filter(edge => referenceKey(edge.source) === key),
|
|
55
|
-
incoming: edges.filter(edge => referenceKey(edge.target) === key), errors };
|
|
56
|
-
}
|
|
1
|
+
export {
|
|
2
|
+
contentReferences,
|
|
3
|
+
referenceContext,
|
|
4
|
+
type ContentReference,
|
|
5
|
+
type ReferenceContext,
|
|
6
|
+
} from '@tano/editor/content-references';
|
|
@@ -1,48 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { FileEntry } from '@tano/protocol';
|
|
3
|
-
|
|
4
|
-
type WikiResolution =
|
|
5
|
-
{ file: FileEntry; heading: string } | { error: 'invalid' | 'missing' | 'ambiguous' };
|
|
6
|
-
|
|
7
|
-
/** Resolve Obsidian-style forward links without depending on a path as file identity. */
|
|
8
|
-
export function resolveWikiLink(
|
|
9
|
-
files: FileEntry[],
|
|
10
|
-
currentPath: string,
|
|
11
|
-
target: string,
|
|
12
|
-
): WikiResolution {
|
|
13
|
-
const separator = target.indexOf('#');
|
|
14
|
-
const name = (separator < 0 ? target : target.slice(0, separator)).trim();
|
|
15
|
-
const heading = separator < 0 ? '' : target.slice(separator + 1).trim();
|
|
16
|
-
const notes = files.filter((file) => file.kind === 'file' && isMarkdown(file.path));
|
|
17
|
-
const current = notes.find((file) => file.path === currentPath);
|
|
18
|
-
if (!name) return current && heading ? { file: current, heading } : { error: 'invalid' };
|
|
19
|
-
if (/^[\\/]|[\\:\u0000-\u001f]/.test(name) || name.includes('\\')) return { error: 'invalid' };
|
|
20
|
-
|
|
21
|
-
const spellings = isMarkdown(name) ? [name] : [`${name}.md`, `${name}.markdown`];
|
|
22
|
-
const paths: string[] = [];
|
|
23
|
-
for (const spelling of spellings) {
|
|
24
|
-
const relative = resolveWorkspaceReference(currentPath, spelling);
|
|
25
|
-
if (relative) paths.push(relative);
|
|
26
|
-
if (!spelling.includes('/')) {
|
|
27
|
-
const parents = currentPath.split('/').slice(0, -1);
|
|
28
|
-
for (let depth = parents.length - 1; depth >= 0; depth--)
|
|
29
|
-
paths.push([...parents.slice(0, depth), spelling].join('/'));
|
|
30
|
-
} else if (!spelling.startsWith('../') && !spelling.startsWith('./')) paths.push(spelling);
|
|
31
|
-
}
|
|
32
|
-
for (const path of paths) {
|
|
33
|
-
const exact = notes.find((file) => file.path === path);
|
|
34
|
-
if (exact) return { file: exact, heading };
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// A short wiki target can name a page anywhere in the workspace. Never pick
|
|
38
|
-
// an arbitrary page when multiple folders contain the same title.
|
|
39
|
-
const names = new Set(spellings.map((spelling) => spelling.toLocaleLowerCase()));
|
|
40
|
-
const matches = notes.filter((file) => {
|
|
41
|
-
const path = file.path.toLocaleLowerCase();
|
|
42
|
-
return name.includes('/')
|
|
43
|
-
? spellings.some((spelling) => path.endsWith(`/${spelling.toLocaleLowerCase()}`))
|
|
44
|
-
: names.has(path.split('/').at(-1)!);
|
|
45
|
-
});
|
|
46
|
-
if (matches.length === 1) return { file: matches[0], heading };
|
|
47
|
-
return { error: matches.length ? 'ambiguous' : 'missing' };
|
|
48
|
-
}
|
|
1
|
+
export { resolveWikiLink } from '@tano/editor/content-references';
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
validateObjectProperties,
|
|
7
7
|
} from '@tano/protocol';
|
|
8
8
|
import type { FileSnapshot, Workspace, WorkspaceAdapter, WorkspaceObject } from '@tano/protocol';
|
|
9
|
-
import {
|
|
9
|
+
import { mergeObject } from '@tano/editor/workspace-objects';
|
|
10
10
|
|
|
11
11
|
export interface ObjectRecord {
|
|
12
12
|
object: WorkspaceObject;
|
|
@@ -44,8 +44,7 @@ export async function loadObjects(adapter: Pick<ObjectStorage, 'read'>, workspac
|
|
|
44
44
|
if (count > 1) errors.push(`对象 ID ${id} 重复,引用已停用;请修复重复文件`);
|
|
45
45
|
return { records: records.filter((record) => ids.get(record.object.id) === 1), errors };
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
export const mergeObject = (base: WorkspaceObject, ours: WorkspaceObject, theirs: WorkspaceObject) => mergeWorkspaceObject(base, ours, theirs, mergeDescription);
|
|
47
|
+
export { mergeObject };
|
|
49
48
|
export async function saveObject(
|
|
50
49
|
adapter: Pick<ObjectStorage, 'write'> & Partial<Pick<ObjectStorage, 'create'>>,
|
|
51
50
|
record: ObjectRecord,
|
package/src/plans/calendar.ts
CHANGED
|
@@ -7,13 +7,13 @@ import {
|
|
|
7
7
|
validateObjectProperties,
|
|
8
8
|
} from '@tano/protocol';
|
|
9
9
|
import type { ObjectRecord } from '../objects/workspace-objects';
|
|
10
|
+
import { localDayKey } from '@tano/protocol/assistant-tasks';
|
|
10
11
|
import { uiLocale } from '../i18n/i18n';
|
|
11
12
|
|
|
12
13
|
export const CALENDAR_TAB_ID = 'view:calendar';
|
|
13
14
|
export type CalendarViewMode = 'day' | 'four-days' | 'week' | 'month' | 'year' | 'agenda';
|
|
14
15
|
|
|
15
|
-
export
|
|
16
|
-
`${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`;
|
|
16
|
+
export { localDayKey };
|
|
17
17
|
export const localDateTime = (date: Date) =>
|
|
18
18
|
`${localDayKey(date)}T${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}`;
|
|
19
19
|
export function weekDays(date: Date) {
|