@tano.page/workbench 0.14.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +50 -16
- package/src/App.vue +82 -752
- package/src/appearance/appearance.ts +14 -4
- package/src/appearance/components/ThemePresetPreview.vue +52 -8
- package/src/appearance/interface-font.ts +99 -0
- package/src/appearance/theme.ts +26 -10
- package/src/appearance/use-interface-font.ts +30 -0
- package/src/assets/mail-provider-icons/NOTICE.txt +27 -0
- package/src/assets/mail-provider-icons/aliyun-mail.svg +3 -0
- package/src/assets/mail-provider-icons/gmail.svg +1 -0
- package/src/assets/mail-provider-icons/icloud.svg +12 -0
- package/src/assets/mail-provider-icons/netease-126.svg +5 -0
- package/src/assets/mail-provider-icons/netease-163.svg +5 -0
- package/src/assets/mail-provider-icons/qq.svg +9 -0
- package/src/assets/mail-provider-icons/tencent-exmail.svg +4 -0
- package/src/assistant/agent-identities.ts +1 -97
- package/src/assistant/agent-task-context.ts +1 -54
- package/src/assistant/attachments.ts +1 -1
- package/src/assistant/completion.ts +1 -61
- package/src/assistant/components/AssistantChangeList.vue +98 -21
- package/src/assistant/components/AssistantPanel.vue +425 -8
- package/src/assistant/components/PluginToolProposalCard.vue +235 -0
- package/src/assistant/connection-actions.ts +237 -0
- package/src/assistant/document-mentions.ts +1 -33
- package/src/assistant/engine.ts +1 -532
- package/src/assistant/execution.ts +6 -33
- package/src/assistant/files.ts +5 -13
- package/src/assistant/hash.ts +1 -4
- package/src/assistant/inbox.ts +1 -148
- package/src/assistant/language.ts +10 -37
- package/src/assistant/mention-autocomplete.ts +69 -0
- package/src/assistant/plugin-bridge-builder.ts +146 -0
- package/src/assistant/prompts.ts +1 -58
- package/src/assistant/proposal-actions.ts +336 -0
- package/src/assistant/results.ts +20 -86
- package/src/assistant/store.ts +167 -327
- package/src/assistant/structures.ts +1 -155
- package/src/assistant/tasks.ts +8 -96
- package/src/assistant/tool-rules.ts +1 -7
- package/src/assistant/workspace-bridge.ts +1 -1
- package/src/composables/use-document-actions.ts +38 -20
- package/src/composables/use-file-tree-controller.ts +7 -12
- package/src/composables/use-workbench-help.ts +177 -0
- package/src/composables/use-workbench-history.ts +2 -4
- package/src/composables/use-workbench-lifecycle.ts +249 -0
- package/src/composables/use-workbench-modals.ts +6 -1
- package/src/composables/use-workbench-outline.ts +0 -5
- package/src/composables/use-workbench-settings.ts +185 -0
- package/src/composables/use-workbench-shortcuts.ts +40 -1021
- package/src/composables/use-workbench-views.ts +325 -0
- package/src/data-tables/data-tables.ts +1 -2
- package/src/documents/components/DocumentActionMenu.vue +279 -0
- package/src/documents/components/DocumentHistoryPanel.vue +3 -1
- package/src/documents/components/DocumentInspector.vue +168 -0
- package/src/documents/components/DocumentPane.vue +482 -0
- package/src/documents/description-merge.ts +1 -9
- package/src/features.ts +1 -0
- package/src/files/components/FileMetadataPanel.vue +49 -15
- package/src/fonts/Inter-Latin-Italic.woff2 +0 -0
- package/src/fonts/Inter-Latin.woff2 +0 -0
- package/src/fonts/TanoUISansSC-Bold.woff2 +0 -0
- package/src/fonts/TanoUISansSC-Medium.woff2 +0 -0
- package/src/fonts/TanoUISansSC-Regular.woff2 +0 -0
- package/src/help/help-milestones.ts +3 -5
- package/src/i18n/locale-catalogs.ts +7 -6
- package/src/i18n/locale-registry.ts +8 -6
- package/src/i18n/locales/de-DE.json +371 -3
- package/src/i18n/locales/en-US.json +371 -2
- package/src/i18n/locales/es-ES.json +371 -3
- package/src/i18n/locales/ja-JP.json +370 -2
- package/src/i18n/locales/zh-TW.json +370 -2
- package/src/mail/components/MailAccountDialog.vue +450 -0
- package/src/mail/components/MailComposerDialog.vue +326 -0
- package/src/mail/components/MailProviderIcon.vue +30 -0
- package/src/mail/components/MailWorkspaceView.vue +821 -0
- package/src/mail/components/SidebarMail.vue +134 -0
- package/src/mail/mail-avatar.ts +17 -0
- package/src/mail/mail-bridge.ts +68 -0
- package/src/mail/mail-calendar.ts +208 -0
- package/src/mail/mail-markdown.ts +195 -0
- package/src/mail/types.ts +226 -0
- package/src/objects/components/ObjectDetailModal.vue +1001 -0
- package/src/objects/content-references.ts +6 -56
- package/src/objects/wiki-links.ts +1 -48
- package/src/objects/workspace-objects.ts +3 -4
- package/src/plan-sync/types.ts +6 -3
- package/src/plans/calendar-interaction.ts +194 -0
- package/src/plans/calendar.ts +65 -9
- package/src/plans/components/CalendarAgendaView.vue +165 -0
- package/src/plans/components/CalendarDayPopover.vue +172 -39
- package/src/plans/components/CalendarFilterBar.vue +128 -0
- package/src/plans/components/CalendarMonthView.vue +224 -0
- package/src/plans/components/CalendarQuickCreateDialog.vue +269 -0
- package/src/plans/components/CalendarTimelineView.vue +517 -0
- package/src/plans/components/CalendarTopbarControls.vue +101 -0
- package/src/plans/components/CalendarView.vue +264 -748
- package/src/plans/components/CalendarYearView.vue +138 -0
- package/src/plans/components/PlanArchiveDialog.vue +295 -0
- package/src/plans/components/PlanConnectionsDialog.vue +1 -1
- package/src/plans/components/PlanDateField.vue +6 -4
- package/src/plans/components/PlanDetailPanel.vue +227 -32
- package/src/plans/components/PlanEventList.vue +16 -4
- package/src/plans/components/SidebarPlan.vue +22 -15
- package/src/plans/components/TaskRepeatControls.vue +169 -30
- package/src/plans/components/calendar-shared.css +192 -0
- package/src/plans/composables/use-calendar-interactions.ts +396 -0
- package/src/plans/composables/use-calendar-scroll.ts +420 -0
- package/src/plans/local-reminders.ts +149 -0
- package/src/plans/personal-plans.ts +10 -1
- package/src/plans/plan-date.ts +8 -1
- package/src/plans/plan-migration.ts +95 -0
- package/src/plans/recurrence.ts +95 -0
- package/src/plans/task-repeat.ts +8 -8
- package/src/plans/timeline-layout.ts +92 -0
- package/src/plugins/assistant-bridge.ts +520 -0
- package/src/plugins/attachment-reader.ts +3 -1
- package/src/plugins/cache-storage.ts +42 -2
- package/src/plugins/components/PluginAutomations.vue +3 -3
- package/src/plugins/components/PluginCatalogBrowser.vue +17 -8
- package/src/plugins/components/PluginChangeSummary.vue +16 -3
- package/src/plugins/components/PluginConnections.vue +1 -1
- package/src/plugins/components/PluginCustomView.vue +2 -2
- package/src/plugins/components/PluginDetailPage.vue +136 -57
- package/src/plugins/components/PluginDeveloperArea.vue +192 -0
- package/src/plugins/components/PluginDocumentSlot.vue +63 -0
- package/src/plugins/components/PluginExplorer.vue +21 -25
- package/src/plugins/components/PluginImportDialog.vue +410 -0
- package/src/plugins/components/PluginInstaller.vue +273 -288
- package/src/plugins/components/PluginListItem.vue +3 -0
- package/src/plugins/components/PluginMaintenance.vue +37 -34
- package/src/plugins/components/PluginRepositoryStorage.vue +4 -2
- package/src/plugins/components/PluginRuntimePanel.vue +3 -3
- package/src/plugins/components/PluginSettingsForm.vue +112 -0
- package/src/plugins/components/PluginStatusBar.vue +161 -0
- package/src/plugins/components/PluginSurface.vue +18 -6
- package/src/plugins/components/PluginUiDialog.vue +452 -0
- package/src/plugins/components/PluginsTabPage.vue +61 -0
- package/src/plugins/components/plugin-center.css +5 -0
- package/src/plugins/data.ts +9 -86
- package/src/plugins/editor-plugin-adapters.ts +169 -0
- package/src/plugins/excalidraw/bundle.tano-plugin.json +1 -1
- package/src/plugins/excalidraw/manifest.json +12 -1
- package/src/plugins/host.ts +662 -43
- package/src/plugins/native.ts +2 -10
- package/src/plugins/overlay-mapping.ts +125 -0
- package/src/plugins/packages.ts +73 -1
- package/src/plugins/plugin-data.ts +2 -3
- package/src/plugins/plugin-permissions.ts +57 -0
- package/src/plugins/plugin-rpc-router.ts +558 -0
- package/src/plugins/plugin-sdk.ts +1 -94
- package/src/plugins/plugin-ui-dialogs.ts +167 -0
- package/src/plugins/policy.ts +53 -3
- package/src/plugins/presentation-preview/bundle.tano-plugin.json +1 -1
- package/src/plugins/presentation-preview/manifest.json +2 -1
- package/src/plugins/queries.ts +1 -73
- package/src/plugins/sandbox.ts +15 -1
- package/src/plugins/use-plugin-actions.ts +67 -20
- package/src/plugins/user-plugins.ts +254 -0
- package/src/plugins/view-header.ts +2 -7
- package/src/plugins/word-preview/bundle.tano-plugin.json +1 -1
- package/src/plugins/word-preview/manifest.json +13 -1
- package/src/plugins/workbench.ts +175 -2
- package/src/plugins/worker.js +105 -8
- package/src/plugins/workspace-plugin-runtime.ts +23 -7
- package/src/plugins/workspace-plugins.ts +212 -21
- package/src/runtime.ts +103 -4
- package/src/settings/components/SettingsAppearancePage.vue +46 -0
- package/src/settings/components/SettingsDocumentsPage.vue +0 -1
- package/src/settings/components/SettingsPanel.vue +8 -3
- package/src/settings/components/WorkbenchSettings.vue +20 -7
- package/src/settings/components/settings-context.ts +1 -1
- package/src/settings/components/settings-search.ts +2 -3
- package/src/settings/settings-tab.ts +1 -0
- package/src/shell/command-palette.ts +3 -3
- package/src/shell/components/EditorToolbar.vue +8 -9
- package/src/shell/components/EditorTools.vue +1 -5
- package/src/shell/components/PaneTopbar.vue +393 -0
- package/src/shell/components/SelectionToolbar.vue +0 -2
- package/src/shell/components/SidebarNavigation.vue +22 -2
- package/src/shell/components/WorkbenchContextMenus.vue +58 -34
- package/src/shell/components/WorkbenchModals.vue +47 -62
- package/src/shell/components/WorkbenchPanes.vue +371 -1342
- package/src/shell/components/WorkbenchSidebar.vue +486 -0
- package/src/shell/components/WorkspaceBreadcrumb.vue +6 -14
- package/src/shell/components/WorkspaceViewSwitcher.vue +12 -7
- package/src/shell/pane-registry.ts +69 -0
- package/src/shell/use-surface-dismissal.ts +219 -0
- package/src/shell/use-workbench-commands.ts +599 -0
- package/src/shell/use-workbench-keybindings.ts +337 -0
- package/src/shell/use-workbench.ts +531 -1153
- package/src/shell/workbench-async-components.ts +14 -5
- package/src/shell/workbench-context.ts +30 -3
- package/src/stores/mail.ts +414 -0
- package/src/stores/plan-sync.ts +2 -1
- package/src/stores/plans.ts +2 -9
- package/src/stores/workspace-document-io.ts +807 -0
- package/src/stores/workspace-file-ops.ts +1 -1
- package/src/stores/workspace-knowledge.ts +2 -114
- package/src/stores/workspace-lifecycle.ts +459 -0
- package/src/stores/workspace-plugins-state.ts +254 -259
- package/src/stores/workspace-session.ts +287 -0
- package/src/stores/workspace-tabs-layout.ts +6 -44
- package/src/stores/workspace-types.ts +50 -0
- package/src/stores/workspace.ts +184 -1363
- package/src/styles/agent-diff-modals.css +0 -7
- package/src/styles/dark-theme.css +3 -3
- package/src/styles/inspector.css +0 -59
- package/src/styles/layout-themes.css +346 -0
- package/src/styles/mail.css +1568 -0
- package/src/styles/mobile.css +2 -2
- package/src/styles/recent-and-media.css +0 -17
- package/src/styles/theme-contract.css +3 -3
- package/src/styles/workbench-shell.css +110 -17
- package/src/styles/workspace-states.css +9 -33
- package/src/styles.css +0 -1
- package/src/tabs/components/DesktopTabs.vue +19 -14
- package/src/tabs/components/NewTabPicker.vue +10 -4
- package/src/tabs/tab-label.ts +0 -1
- package/src/windows/AuxiliaryWindows.vue +2 -2
- package/src/windows/use-window-event-bridge.ts +152 -0
- package/src/workspace/components/TemplateLibrary.vue +1 -1
- package/src/workspace/components/WorkspaceGeneralSettings.vue +0 -13
- package/src/workspace/components/WorkspaceIconPicker.vue +30 -7
- package/src/workspace/components/WorkspacePickerMenu.vue +317 -0
- package/src/workspace/workspace-comments.ts +11 -151
- package/src/workspace/workspace-welcome.ts +1 -1
- package/src/assistant/locales/de-DE.json +0 -126
- package/src/assistant/locales/en-US.json +0 -126
- package/src/assistant/locales/es-ES.json +0 -126
- package/src/assistant/locales/ja-JP.json +0 -126
- package/src/assistant/locales/zh-CN.json +0 -126
- package/src/assistant/locales/zh-TW.json +0 -126
- package/src/assistant/task-prompts.json +0 -39
- package/src/documents/components/FormulaMenu.vue +0 -50
- package/src/files/components/FileDatabasePage.vue +0 -152
- package/src/files/components/FolderHomeIcon.vue +0 -12
- package/src/objects/components/ObjectDatabasePage.vue +0 -100
- package/src/objects/components/ObjectPanel.vue +0 -554
- package/src/plans/components/PersonalPlanDialog.vue +0 -105
- package/src/shell/components/WorkspaceViewPage.vue +0 -127
- package/src/shell/components/WorkspaceViewTab.vue +0 -24
- package/src/styles/object-panel.css +0 -163
- package/src/workspace/components/GitInspectionPanel.vue +0 -35
- package/src/workspace/components/WorkspaceSyncPanel.vue +0 -50
- package/src/workspace/welcome-slogans.ts +0 -11
- package/src/workspace/workspace-git.ts +0 -35
- package/src/workspace/workspace-sync.ts +0 -46
- package/src/workspace/workspace-views.ts +0 -48
|
@@ -5,9 +5,9 @@ const ResizeObserver = (window as Window & typeof globalThis).ResizeObserver;
|
|
|
5
5
|
import { vSurfaceMotion } from '@tano/editor/surface-motion';
|
|
6
6
|
import { t } from '../../i18n/i18n';
|
|
7
7
|
import { computed, nextTick, onBeforeUnmount, onMounted, ref, shallowRef, useId, watch } from 'vue';
|
|
8
|
-
import { Archive, CalendarDays, Check, Circle, CircleCheck, Copy, Flag, ListTodo, LoaderCircle, RotateCcw, Save, X } from 'lucide-vue-next';
|
|
8
|
+
import { Archive, ArrowRightLeft, Bell, CalendarDays, Check, Circle, CircleCheck, CircleDot, Copy, ExternalLink, Flag, ListTodo, LoaderCircle, MapPin, RotateCcw, Save, SignalHigh, X } from 'lucide-vue-next';
|
|
9
9
|
import type { ReferenceIdentity, ReferenceTarget, WorkspaceObject } from '@tano/protocol';
|
|
10
|
-
import { resolveWorkspaceReference,
|
|
10
|
+
import { isPlanCompletionLocked, resolveWorkspaceReference, withPlanCompleted, withPlanStatus } from '@tano/protocol';
|
|
11
11
|
import type { ObjectRecord } from '../../objects/workspace-objects';
|
|
12
12
|
import { isCheckableEvent, isEventCompleted } from '../calendar';
|
|
13
13
|
import { readPlanDate, writePlanDate } from '../plan-date';
|
|
@@ -22,6 +22,8 @@ import ReferenceConnections from '../../objects/components/ReferenceConnections.
|
|
|
22
22
|
import TaskRepeatControls from './TaskRepeatControls.vue';
|
|
23
23
|
import { useWorkbenchRuntime } from '../../runtime';
|
|
24
24
|
import { planDocumentSource } from '../selection-todo';
|
|
25
|
+
import { extractReminders, REMINDER_PRESETS } from '../local-reminders';
|
|
26
|
+
import { movePlanBetweenScopes } from '../plan-migration';
|
|
25
27
|
|
|
26
28
|
const props = defineProps<{ record: ObjectRecord }>();
|
|
27
29
|
const emit = defineEmits<{ close: []; openReference: [identity: ReferenceIdentity]; openRecord: [record: ObjectRecord] }>();
|
|
@@ -36,6 +38,11 @@ const nameId = useId();
|
|
|
36
38
|
const nameField = ref<HTMLTextAreaElement>();
|
|
37
39
|
let nameResize: ResizeObserver | undefined;
|
|
38
40
|
const dueId = useId();
|
|
41
|
+
const statusId = useId();
|
|
42
|
+
const priorityId = useId();
|
|
43
|
+
const locationId = useId();
|
|
44
|
+
const reminderId = useId();
|
|
45
|
+
const confirmMove = ref(false);
|
|
39
46
|
const base = shallowRef(props.record);
|
|
40
47
|
const draft = ref<WorkspaceObject>(clone(props.record.object));
|
|
41
48
|
const busy = ref(false);
|
|
@@ -57,10 +64,70 @@ const disabled = computed(() => busy.value || !latest.value || !plans.canEdit(la
|
|
|
57
64
|
const dirty = computed(() => JSON.stringify(draft.value) !== JSON.stringify(base.value.object));
|
|
58
65
|
const checkable = computed(() => isCheckableEvent({ ...base.value, object: draft.value }));
|
|
59
66
|
const completed = computed(() => isEventCompleted({ ...base.value, object: draft.value }));
|
|
60
|
-
const completionLocked = computed(() =>
|
|
67
|
+
const completionLocked = computed(() => isPlanCompletionLocked(draft.value));
|
|
68
|
+
const statusOptions = computed(() => {
|
|
69
|
+
const current = typeof draft.value.properties.status === 'string' ? draft.value.properties.status.trim() : '';
|
|
70
|
+
return [...new Set(['待处理', '进行中', '已完成', ...(current ? [current] : [])])];
|
|
71
|
+
});
|
|
61
72
|
const title = computed(() => checkable.value ? t('任务详情') : t('事件详情'));
|
|
62
73
|
const planDate = computed(() => readPlanDate(draft.value.properties));
|
|
63
74
|
const canCopy = computed(() => !busy.value && inScope.value && (personal ? plans.personalWritable : plans.workspaceWritable));
|
|
75
|
+
const locationValue = computed(() =>
|
|
76
|
+
typeof draft.value.properties.location === 'string' ? draft.value.properties.location : '',
|
|
77
|
+
);
|
|
78
|
+
const locationUrl = computed(() => {
|
|
79
|
+
const match = /https?:\/\/\S+/i.exec(locationValue.value);
|
|
80
|
+
return match ? match[0] : '';
|
|
81
|
+
});
|
|
82
|
+
const reminders = computed(() => extractReminders(draft.value.properties));
|
|
83
|
+
const canMoveScope = computed(() => {
|
|
84
|
+
if (disabled.value || dirty.value || !latest.value || latest.value.object.archived) return false;
|
|
85
|
+
return personal ? plans.workspaceWritable && !!store.workspace?.id : plans.personalWritable;
|
|
86
|
+
});
|
|
87
|
+
const moveLabel = computed(() => (personal ? t('移动到工作区') : t('移动到个人')));
|
|
88
|
+
function reminderLabel(minutes: number) {
|
|
89
|
+
if (minutes === 0) return t('准时');
|
|
90
|
+
if (minutes === 10) return t('提前 10 分钟');
|
|
91
|
+
if (minutes === 30) return t('提前 30 分钟');
|
|
92
|
+
if (minutes === 60) return t('提前 1 小时');
|
|
93
|
+
return t('提前 1 天');
|
|
94
|
+
}
|
|
95
|
+
function updateLocation(event: Event) {
|
|
96
|
+
if (disabled.value) return;
|
|
97
|
+
const value = (event.target as HTMLInputElement).value;
|
|
98
|
+
if (value.trim()) draft.value.properties.location = value;
|
|
99
|
+
else delete draft.value.properties.location;
|
|
100
|
+
}
|
|
101
|
+
async function openLocationUrl() {
|
|
102
|
+
if (!locationUrl.value) return;
|
|
103
|
+
try { await openExternalUrl(locationUrl.value); } catch (reason) { error.value = String(reason); }
|
|
104
|
+
}
|
|
105
|
+
function updateReminder(event: Event) {
|
|
106
|
+
if (disabled.value) return;
|
|
107
|
+
const raw = (event.target as HTMLSelectElement).value;
|
|
108
|
+
if (raw === '') delete draft.value.properties.reminders;
|
|
109
|
+
else draft.value.properties.reminders = [Number(raw)];
|
|
110
|
+
}
|
|
111
|
+
async function executeMoveScope() {
|
|
112
|
+
if (!canMoveScope.value || !latest.value) return;
|
|
113
|
+
busy.value = true;
|
|
114
|
+
error.value = '';
|
|
115
|
+
confirmMove.value = false;
|
|
116
|
+
try {
|
|
117
|
+
const targetScope = personal ? 'workspace' : 'personal';
|
|
118
|
+
const result = await movePlanBetweenScopes(latest.value, targetScope, {
|
|
119
|
+
workspaceId: store.workspace?.id,
|
|
120
|
+
create: (value, scope, workspaceId) => plans.create(value, scope, workspaceId),
|
|
121
|
+
archive: (source) => plans.update(source, { ...source.object, archived: true }),
|
|
122
|
+
});
|
|
123
|
+
if (result.warning) error.value = result.warning;
|
|
124
|
+
emit('openRecord', result.created);
|
|
125
|
+
} catch (reason) {
|
|
126
|
+
error.value = String(reason);
|
|
127
|
+
} finally {
|
|
128
|
+
busy.value = false;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
64
131
|
const changedExternally = computed(() => latest.value && latest.value.snapshot.hash !== base.value.snapshot.hash);
|
|
65
132
|
const targets = computed(() => personal ? [] : store.referenceTargets.filter(target =>
|
|
66
133
|
target.type !== 'document' || !target.path.startsWith('.tano/')));
|
|
@@ -98,8 +165,23 @@ watch(() => latest.value?.snapshot.hash, () => {
|
|
|
98
165
|
});
|
|
99
166
|
function setCompleted(value: boolean) {
|
|
100
167
|
if (disabled.value) return;
|
|
101
|
-
draft.value.
|
|
102
|
-
|
|
168
|
+
try { draft.value = withPlanCompleted(draft.value, value); error.value = ''; }
|
|
169
|
+
catch (reason) { error.value = String(reason); }
|
|
170
|
+
}
|
|
171
|
+
function updateStatus(event: Event) {
|
|
172
|
+
if (disabled.value) return;
|
|
173
|
+
const select = event.target as HTMLSelectElement;
|
|
174
|
+
try { draft.value = withPlanStatus(draft.value, select.value); error.value = ''; }
|
|
175
|
+
catch (reason) {
|
|
176
|
+
error.value = String(reason);
|
|
177
|
+
select.value = typeof draft.value.properties.status === 'string' ? draft.value.properties.status : '';
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
function updatePriority(event: Event) {
|
|
181
|
+
if (disabled.value) return;
|
|
182
|
+
const raw = (event.target as HTMLSelectElement).value;
|
|
183
|
+
if (!raw) delete draft.value.properties.priority;
|
|
184
|
+
else draft.value.properties.priority = Number(raw);
|
|
103
185
|
}
|
|
104
186
|
function setCheckable(value: boolean) {
|
|
105
187
|
if (disabled.value || draft.value.type === 'task') return;
|
|
@@ -211,10 +293,26 @@ onBeforeUnmount(() => { nameResize?.disconnect(); if (previousFocus?.isConnected
|
|
|
211
293
|
<header>
|
|
212
294
|
<div class="plan-detail-heading"><component :is="checkable ? ListTodo : CalendarDays" :size="18" /><h2>{{ title }}</h2><span>{{ personal ? t('个人') : base.source?.name ?? store.workspace?.name }}</span></div>
|
|
213
295
|
<div class="plan-detail-actions">
|
|
296
|
+
<button
|
|
297
|
+
v-if="canMoveScope"
|
|
298
|
+
type="button"
|
|
299
|
+
class="icon-button"
|
|
300
|
+
:aria-label="moveLabel"
|
|
301
|
+
:data-tooltip="moveLabel"
|
|
302
|
+
:disabled="busy"
|
|
303
|
+
@click="confirmMove = !confirmMove"
|
|
304
|
+
><ArrowRightLeft :size="16" /></button>
|
|
214
305
|
<button type="button" class="icon-button" :class="{ 'is-archived': draft.archived }" :aria-label="draft.archived ? t('取消归档') : t('归档')" :data-tooltip="draft.archived ? t('取消归档') : t('归档')" :disabled="disabled" @click="draft.archived = !draft.archived"><Archive :size="17" /></button>
|
|
215
306
|
<button type="button" class="icon-button" :aria-label="t('关闭{0}', [title])" :data-tooltip="t('关闭')" :disabled="busy" @click="requestNavigation({ kind: 'close' })"><X :size="18" /></button>
|
|
216
307
|
</div>
|
|
217
308
|
</header>
|
|
309
|
+
<div v-if="confirmMove" class="plan-detail-move-bar" role="status">
|
|
310
|
+
<span>{{ personal ? t('将此事项复制到当前工作区并归档原个人记录?') : t('将此事项复制到个人计划并归档原工作区记录?文档引用与成员分配不会随个人事项同步。') }}</span>
|
|
311
|
+
<div>
|
|
312
|
+
<button type="button" :disabled="busy" @click="executeMoveScope">{{ t('确认移动') }}</button>
|
|
313
|
+
<button type="button" :disabled="busy" @click="confirmMove = false">{{ t('取消') }}</button>
|
|
314
|
+
</div>
|
|
315
|
+
</div>
|
|
218
316
|
<div class="plan-detail-content">
|
|
219
317
|
<button v-if="documentSource" type="button" :disabled="busy || !inScope" @click="requestNavigation({ kind: 'reference', identity: { type: 'document', id: documentSource.fileId } })">{{ t('返回原文选区') }}</button>
|
|
220
318
|
<p v-if="!inScope" class="detail-notice" role="alert">{{ t('事项所属空间已切换,当前草稿仍保留。请返回原空间后保存。') }}</p>
|
|
@@ -234,12 +332,33 @@ onBeforeUnmount(() => { nameResize?.disconnect(); if (previousFocus?.isConnected
|
|
|
234
332
|
<span class="detail-status" :class="{ 'is-completed': completed && checkable }"><span class="detail-status-dot" />{{ draft.archived ? t('已归档') : checkable ? completed ? t('已完成') : t('待完成') : t('日程') }}</span>
|
|
235
333
|
<label v-if="draft.type === 'event'" class="detail-check"><input type="checkbox" :checked="checkable" :disabled="disabled" @change="setCheckable(($event.target as HTMLInputElement).checked)" />{{ t('需要完成') }}</label>
|
|
236
334
|
</div>
|
|
237
|
-
<div class="plan-detail-
|
|
238
|
-
<
|
|
239
|
-
|
|
335
|
+
<div class="plan-detail-properties">
|
|
336
|
+
<div class="plan-detail-row plan-detail-time">
|
|
337
|
+
<span class="plan-detail-label"><CalendarDays :size="15" />{{ t('时间安排') }}</span>
|
|
338
|
+
<PlanDateField :model-value="planDate" :disabled="disabled" compact @update:model-value="updatePlanDate" />
|
|
339
|
+
</div>
|
|
340
|
+
<div class="plan-detail-row plan-detail-due"><label :for="dueId"><Flag :size="15" />{{ t('截止日期') }}</label><input :id="dueId" type="date" :class="{ 'is-empty': !draft.properties.due }" :value="draft.properties.due ?? ''" :disabled="disabled" @input="updateDue" /></div>
|
|
341
|
+
<template v-if="checkable">
|
|
342
|
+
<div class="plan-detail-row plan-detail-field"><label :for="statusId"><CircleDot :size="15" />{{ t('状态') }}</label><select :id="statusId" :class="{ 'is-empty': typeof draft.properties.status !== 'string' || !draft.properties.status }" :value="typeof draft.properties.status === 'string' ? draft.properties.status : ''" :disabled="disabled" @change="updateStatus"><option value="">{{ t('未设置') }}</option><option v-for="option in statusOptions" :key="option" :value="option">{{ t(option) }}</option></select></div>
|
|
343
|
+
<div class="plan-detail-row plan-detail-field"><label :for="priorityId"><SignalHigh :size="15" />{{ t('优先级') }}</label><select :id="priorityId" :class="{ 'is-empty': !draft.properties.priority }" :value="draft.properties.priority ?? ''" :disabled="disabled" @change="updatePriority"><option value="">{{ t('未设置') }}</option><option value="1">{{ t('高') }}</option><option value="2">{{ t('中') }}</option><option value="3">{{ t('低') }}</option></select></div>
|
|
344
|
+
</template>
|
|
345
|
+
<div class="plan-detail-row plan-detail-field">
|
|
346
|
+
<label :for="locationId"><MapPin :size="15" />{{ t('地点') }}</label>
|
|
347
|
+
<div class="plan-detail-location">
|
|
348
|
+
<input :id="locationId" type="text" :value="locationValue" :placeholder="t('会议室或链接…')" maxlength="500" :disabled="disabled" @input="updateLocation" />
|
|
349
|
+
<button v-if="locationUrl" type="button" class="icon-button" :aria-label="t('打开链接')" :data-tooltip="t('打开链接')" @click="openLocationUrl"><ExternalLink :size="14" /></button>
|
|
350
|
+
</div>
|
|
351
|
+
</div>
|
|
352
|
+
<div class="plan-detail-row plan-detail-field">
|
|
353
|
+
<label :for="reminderId"><Bell :size="15" />{{ t('提醒') }}</label>
|
|
354
|
+
<select :id="reminderId" :class="{ 'is-empty': !reminders[0] }" :value="reminders[0] ?? ''" :disabled="disabled" @change="updateReminder">
|
|
355
|
+
<option value="">{{ t('不提醒') }}</option>
|
|
356
|
+
<option v-for="preset in REMINDER_PRESETS" :key="preset" :value="preset">{{ reminderLabel(preset) }}</option>
|
|
357
|
+
</select>
|
|
358
|
+
</div>
|
|
359
|
+
<TaskRepeatControls :object="draft" :record="base" :workspace-id="personal ? undefined : scopeId" :personal="personal" :disabled="disabled" :dirty="dirty" @change="value => { if (value === undefined) { delete draft.properties.repeat; delete draft.properties.repeatSourceId; delete draft.properties.repeatOccurrence; } else draft.properties.repeat = value; }" @open-record="emit('openRecord', $event)" />
|
|
240
360
|
</div>
|
|
241
361
|
<DescriptionEditor v-model="draft.description" :disabled="disabled" :targets="previewTargets" preview @open-reference="requestNavigation({ kind: 'reference', identity: $event })" @open-link="openDescriptionLink" @open-wiki-link="openDescriptionWiki" />
|
|
242
|
-
<TaskRepeatControls v-if="checkable && !personal && scopeId" :object="draft" :record="base" :workspace-id="scopeId" :disabled="disabled" :dirty="dirty" @change="value => { if (value === undefined) { delete draft.properties.repeat; delete draft.properties.repeatSourceId; delete draft.properties.repeatOccurrence; } else draft.properties.repeat = value; }" @open-record="emit('openRecord', $event)" />
|
|
243
362
|
<component :is="objectDetails" v-if="objectDetails && !personal && latest && scopeId" :workspace-id="scopeId" :object="latest.object" :disabled="disabled || dirty" @open-reference="requestNavigation({ kind: 'reference', identity: $event })" />
|
|
244
363
|
<ReferenceConnections class="plan-detail-references" :identity="draft" :draft="draft.description" :local-targets="personalTargets" :active="inScope" @open="requestNavigation({ kind: 'reference', identity: $event })" />
|
|
245
364
|
<p v-if="error" class="detail-error" role="alert">{{ error }}</p>
|
|
@@ -263,7 +382,7 @@ onBeforeUnmount(() => { nameResize?.disconnect(); if (previousFocus?.isConnected
|
|
|
263
382
|
|
|
264
383
|
<style scoped>
|
|
265
384
|
.plan-detail-backdrop { position: fixed; inset: 0; z-index: 85; display: flex; align-items: center; justify-content: center; padding: 28px; box-sizing: border-box; background: #161a2238; backdrop-filter: blur(3px); }
|
|
266
|
-
.plan-detail-panel { display: flex; flex-direction: column; width: min(720px, 100%); height: min(740px, calc(100dvh - 56px)); min-height: 0; margin: 0; overflow: hidden; background: var(--paper); color: var(--text); border: 1px solid var(--line); border-radius:
|
|
385
|
+
.plan-detail-panel { display: flex; flex-direction: column; width: min(720px, 100%); height: min(740px, calc(100dvh - 56px)); min-height: 0; margin: 0; overflow: hidden; background: var(--paper); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--dialog-shadow, 0 20px 80px #12182026, 0 2px 8px #12182012); outline: none; }
|
|
267
386
|
header, footer { display: flex; align-items: center; gap: 10px; padding: 12px 24px; flex-shrink: 0; }
|
|
268
387
|
header { justify-content: space-between; border-bottom: 1px solid var(--line); }
|
|
269
388
|
.plan-detail-heading { display: flex; align-items: center; gap: 8px; min-width: 0; }
|
|
@@ -271,9 +390,10 @@ h2 { font-size: 12px; font-weight: 500; margin: 0; flex-shrink: 0; color: var(--
|
|
|
271
390
|
.plan-detail-heading > svg { color: var(--muted); flex-shrink: 0; width: 16px; height: 16px; }
|
|
272
391
|
.plan-detail-heading > span { padding-left: 12px; margin-left: 4px; border-left: 1px solid var(--line); font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
273
392
|
.plan-detail-actions { display: flex; gap: 6px; flex-shrink: 0; }
|
|
274
|
-
.plan-detail-actions .icon-button { width: 28px; height: 28px; color: var(--muted); }
|
|
393
|
+
.plan-detail-actions .icon-button { width: 28px; height: 28px; border-radius: 7px; color: var(--muted); }
|
|
394
|
+
.plan-detail-actions .icon-button:hover:not(:disabled) { color: var(--text); }
|
|
275
395
|
.plan-detail-actions .is-archived { color: var(--green); background: var(--accent); }
|
|
276
|
-
.plan-detail-content { flex: 1; min-height: 0; overflow: auto; padding: 28px
|
|
396
|
+
.plan-detail-content { flex: 1; min-height: 0; overflow: auto; padding: 26px 32px 28px; }
|
|
277
397
|
.detail-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
|
|
278
398
|
.plan-detail-name { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
|
|
279
399
|
.detail-completion { position: relative; display: grid; place-items: center; width: 28px; height: 38px; flex: none; color: var(--muted); }
|
|
@@ -283,22 +403,95 @@ h2 { font-size: 12px; font-weight: 500; margin: 0; flex-shrink: 0; color: var(--
|
|
|
283
403
|
.detail-completion:has(input:focus-visible) { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 4px; }
|
|
284
404
|
.detail-completion.is-disabled input { cursor: not-allowed; }
|
|
285
405
|
.plan-detail-name textarea { display: block; flex: 1; min-width: 0; width: 100%; min-height: 38px; max-height: 136px; padding: 0; margin: 0; resize: none; background: transparent; border: 0; border-radius: 3px; font: inherit; font-size: 24px; font-weight: 600; line-height: 1.55; color: var(--text); overflow-wrap: anywhere; }
|
|
286
|
-
.plan-detail-name textarea:
|
|
406
|
+
.plan-detail-name textarea { transition: background-color var(--motion-quick) var(--ease-standard), box-shadow var(--motion-quick) var(--ease-standard); }
|
|
407
|
+
.plan-detail-name textarea:hover:not(:disabled) { background: var(--surface); box-shadow: 0 0 0 4px var(--surface); }
|
|
408
|
+
.plan-detail-name textarea:focus-visible { outline: none; background: transparent; box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px var(--line); }
|
|
287
409
|
.plan-detail-name.is-completed textarea { color: var(--muted); text-decoration: line-through; }
|
|
288
|
-
.plan-detail-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin:
|
|
289
|
-
.detail-
|
|
410
|
+
.plan-detail-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0 20px 40px; }
|
|
411
|
+
.plan-detail-name:not(:has(.detail-completion)) + .plan-detail-meta { margin-left: 0; }
|
|
412
|
+
.detail-status { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px 0 8px; border-radius: 11px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 12px; color: var(--text-secondary); }
|
|
290
413
|
.detail-status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
|
|
291
|
-
.detail-status.is-completed { color: var(--
|
|
292
|
-
.detail-status.is-completed .detail-status-dot { background: var(--green); }
|
|
293
|
-
.detail-check { display: flex; align-items: center; gap:
|
|
294
|
-
.detail-check
|
|
295
|
-
.
|
|
296
|
-
.
|
|
297
|
-
.
|
|
298
|
-
.
|
|
299
|
-
.
|
|
414
|
+
.detail-status.is-completed { color: var(--text); }
|
|
415
|
+
.detail-status.is-completed .detail-status-dot { background: var(--brand-green, var(--green)); }
|
|
416
|
+
.detail-check { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 8px; margin-right: -8px; border-radius: 7px; font-size: 12px; color: var(--text-secondary); cursor: pointer; user-select: none; transition: background-color var(--motion-quick) var(--ease-standard), color var(--motion-quick) var(--ease-standard); }
|
|
417
|
+
.detail-check:hover { background: var(--hover); color: var(--text); }
|
|
418
|
+
.detail-check input { appearance: none; position: relative; flex: none; width: 14px; height: 14px; margin: 0; border: 1.5px solid var(--control-border); border-radius: 4px; background: var(--paper); cursor: pointer; transition: background-color var(--motion-quick) var(--ease-standard), border-color var(--motion-quick) var(--ease-standard); }
|
|
419
|
+
.detail-check input::after { content: ''; position: absolute; left: 3.5px; top: 0.5px; width: 3.5px; height: 7px; border: solid var(--on-accent, #fff); border-width: 0 1.5px 1.5px 0; rotate: 45deg; scale: 0.4; opacity: 0; transition: scale var(--motion-spring) var(--ease-spring-bouncy), opacity var(--motion-quick) var(--ease-standard); }
|
|
420
|
+
.detail-check input:checked { border-color: var(--green-fill); background: var(--green-fill); }
|
|
421
|
+
.detail-check input:checked::after { scale: 1; opacity: 1; }
|
|
422
|
+
.detail-check:hover input:not(:checked, :disabled) { border-color: var(--text-secondary); }
|
|
423
|
+
|
|
424
|
+
/* ---- Property list: one label column, values as quiet inline fields ---- */
|
|
425
|
+
.plan-detail-properties { --plan-row-label: 104px; display: grid; gap: 4px; padding: 14px 0 18px; border-top: 1px solid var(--line); }
|
|
426
|
+
.plan-detail-row { display: grid; grid-template-columns: var(--plan-row-label) minmax(0, 1fr); column-gap: 12px; align-items: start; min-width: 0; }
|
|
427
|
+
.plan-detail-row > label, .plan-detail-label { display: flex; align-items: center; gap: 8px; min-height: 32px; font-size: 13px; color: var(--muted); }
|
|
428
|
+
.plan-detail-row > label svg, .plan-detail-label svg, .plan-detail-properties :deep(.task-repeat-label svg) { flex: none; color: var(--muted); }
|
|
429
|
+
/* Every value control: borderless until hovered, a clear frame while focused. */
|
|
430
|
+
.plan-detail-panel .plan-detail-properties :is(input, select),
|
|
431
|
+
.plan-detail-panel .plan-detail-properties :deep(:is(.plan-date-field input, .task-repeat select, .task-repeat input)) {
|
|
432
|
+
box-sizing: border-box;
|
|
433
|
+
height: 32px;
|
|
434
|
+
min-width: 0;
|
|
435
|
+
padding: 0 8px;
|
|
436
|
+
margin: 0;
|
|
437
|
+
border: 1px solid transparent;
|
|
438
|
+
border-radius: 6px;
|
|
439
|
+
background-color: transparent;
|
|
440
|
+
color: var(--text);
|
|
441
|
+
font: inherit;
|
|
442
|
+
font-size: 13px;
|
|
443
|
+
transition: background-color var(--motion-quick) var(--ease-standard), border-color var(--motion-base) var(--ease-standard), box-shadow var(--motion-base) var(--ease-standard);
|
|
444
|
+
}
|
|
445
|
+
.plan-detail-panel .plan-detail-properties :is(input[type='date'], select),
|
|
446
|
+
.plan-detail-panel .plan-detail-properties :deep(:is(.plan-date-field input, .task-repeat select, .task-repeat input[type='date'])) { width: auto; min-width: 140px; max-width: 100%; justify-self: start; }
|
|
447
|
+
.plan-detail-panel .plan-detail-properties select,
|
|
448
|
+
.plan-detail-panel .plan-detail-properties :deep(.task-repeat select) {
|
|
449
|
+
appearance: none;
|
|
450
|
+
padding-right: 26px;
|
|
451
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8985' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
|
|
452
|
+
background-repeat: no-repeat;
|
|
453
|
+
background-position: right 8px center;
|
|
454
|
+
cursor: pointer;
|
|
455
|
+
}
|
|
456
|
+
.plan-detail-panel .plan-detail-properties :is(input, select):hover:not(:disabled, :focus),
|
|
457
|
+
.plan-detail-panel .plan-detail-properties :deep(:is(.plan-date-field input, .task-repeat select, .task-repeat input):hover:not(:disabled, :focus)) { border-color: transparent; background-color: var(--hover); }
|
|
458
|
+
.plan-detail-panel .plan-detail-properties :is(input, select):focus-visible,
|
|
459
|
+
.plan-detail-panel .plan-detail-properties :deep(:is(.plan-date-field input, .task-repeat select, .task-repeat input):focus-visible) {
|
|
460
|
+
outline: none;
|
|
461
|
+
border-color: color-mix(in srgb, var(--text) 35%, var(--line));
|
|
462
|
+
background-color: var(--paper);
|
|
463
|
+
box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 7%, transparent);
|
|
464
|
+
}
|
|
465
|
+
.plan-detail-properties :is(input, select).is-empty:not(:focus),
|
|
466
|
+
.plan-detail-properties :deep(.task-repeat select.is-empty:not(:focus)) { color: var(--muted); }
|
|
467
|
+
.plan-detail-properties input::placeholder { color: var(--muted); opacity: 0.8; }
|
|
468
|
+
.plan-detail-properties :is(input, select):disabled { cursor: not-allowed; opacity: 0.6; }
|
|
469
|
+
/* The date field sits in the value column: drop its own calendar glyph and keep
|
|
470
|
+
the precision toggle beside the mode trigger instead of across the row. */
|
|
471
|
+
.plan-detail-time :deep(.plan-date-field.is-compact .plan-date-heading) { justify-content: flex-start; gap: 2px; min-height: 32px; }
|
|
472
|
+
.plan-detail-time :deep(.plan-date-field.is-compact .plan-schedule-trigger) { gap: 4px; min-height: 32px; padding: 0 6px 0 8px; border-radius: 6px; color: var(--text); font-size: 13px; }
|
|
473
|
+
.plan-detail-time :deep(.plan-date-field.is-compact .plan-schedule-trigger > svg:first-child) { display: none; }
|
|
474
|
+
.plan-detail-time :deep(.plan-date-field.is-compact .plan-schedule-trigger > svg:last-child) { color: var(--muted); }
|
|
475
|
+
.plan-detail-time :deep(.plan-date-field.is-compact .compact-precision) { color: var(--muted); border-radius: 6px; }
|
|
476
|
+
.plan-detail-time :deep(.plan-date-field.is-compact .plan-date-inputs) { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 4px; }
|
|
477
|
+
.plan-detail-time :deep(.plan-date-field.is-compact .plan-date-input) { display: grid; gap: 0; }
|
|
478
|
+
.plan-detail-time :deep(.plan-date-field.is-compact .plan-date-label) { min-height: 0; padding: 2px 9px 0; }
|
|
479
|
+
.plan-detail-time :deep(.plan-date-field.is-compact .plan-date-label label) { font-size: 11px; color: var(--muted); }
|
|
480
|
+
.plan-detail-properties :deep(.task-repeat) { margin: 0; }
|
|
481
|
+
.plan-detail-location { display: flex; align-items: center; gap: 4px; min-width: 0; }
|
|
482
|
+
.plan-detail-location input { flex: 1; width: 100%; }
|
|
483
|
+
.plan-detail-location .icon-button { flex: none; width: 28px; height: 28px; border-radius: 6px; color: var(--muted); }
|
|
484
|
+
.plan-detail-properties + .description-editor { padding-top: 18px; border-top: 1px solid var(--line); }
|
|
485
|
+
.plan-detail-panel :deep(.with-preview .description-heading label) { font-size: 13px; color: var(--muted); }
|
|
486
|
+
.plan-detail-panel :deep(.with-preview .description-preview) { min-height: 72px; padding: 6px 8px; margin: 0 -8px; border-radius: 8px; transition: background-color var(--motion-quick) var(--ease-standard); }
|
|
487
|
+
.plan-detail-panel :deep(.with-preview .description-preview:hover) { background: var(--hover); }
|
|
488
|
+
.plan-detail-move-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 24px; border-bottom: 1px solid var(--line); background: var(--surface); font-size: 12px; color: var(--text-secondary); }
|
|
489
|
+
.plan-detail-move-bar > div { display: flex; gap: 8px; }
|
|
490
|
+
.plan-detail-move-bar button { padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); font-size: 12px; }
|
|
491
|
+
.plan-detail-move-bar button:hover:not(:disabled) { border-color: var(--control-border); background: var(--hover); }
|
|
300
492
|
.plan-detail-panel :deep(.description-heading) { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
|
|
301
493
|
.plan-detail-panel :deep(.description-actions .icon-button) { width: 26px; height: 26px; color: var(--muted); }
|
|
494
|
+
.plan-detail-panel :deep(.description-editor > textarea:focus-visible) { outline: none; border-color: color-mix(in srgb, var(--text) 40%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 8%, transparent); }
|
|
302
495
|
.plan-detail-panel :deep(.description-editor > textarea) { box-sizing: border-box; width: 100%; padding: 12px; line-height: 1.7; font-size: 13px; border: 1px solid var(--control-border); border-radius: 6px; background: var(--paper); color: var(--text); min-height: 150px; }
|
|
303
496
|
.plan-detail-panel :deep(.description-search input) { padding: 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); color: var(--text); }
|
|
304
497
|
.plan-detail-panel :deep(.plan-detail-references) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; margin-top: 24px; padding-top: 20px; }
|
|
@@ -316,22 +509,24 @@ h2 { font-size: 12px; font-weight: 500; margin: 0; flex-shrink: 0; color: var(--
|
|
|
316
509
|
.detail-notice { color: var(--muted); }
|
|
317
510
|
.detail-error { color: var(--danger); margin-top: 16px; }
|
|
318
511
|
.plan-detail-recovery { display: flex; flex-wrap: wrap; gap: 8px; }
|
|
319
|
-
.plan-detail-recovery button, .plan-detail-unsaved button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius:
|
|
512
|
+
.plan-detail-recovery button, .plan-detail-unsaved button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; background: var(--paper); font-size: 12px; }
|
|
513
|
+
.plan-detail-recovery button:hover:not(:disabled), .plan-detail-unsaved button:hover:not(:disabled) { border-color: var(--control-border); background: var(--hover); }
|
|
320
514
|
.plan-detail-unsaved { border-top: 1px solid var(--line); padding: 14px 24px; background: var(--surface); }
|
|
321
515
|
.plan-detail-unsaved strong { display: block; font-size: 13px; font-weight: 500; margin-bottom: 10px; }
|
|
322
516
|
.plan-detail-unsaved > div { display: flex; flex-wrap: wrap; gap: 8px; }
|
|
323
517
|
footer { border-top: 1px solid var(--line); padding-bottom: max(12px, env(safe-area-inset-bottom)); background: var(--surface); }
|
|
324
518
|
.detail-save-state { display: inline-flex; align-items: center; gap: 7px; flex: 1; min-width: 0; font-size: 12px; color: var(--muted); }
|
|
325
519
|
.detail-save-state.has-changes { color: var(--text-secondary); }
|
|
326
|
-
.detail-close { padding: 8px
|
|
327
|
-
.detail-close:hover:not(:disabled) { background: var(--hover); }
|
|
328
|
-
.detail-save { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex-shrink: 0; min-width: 90px; height: 36px; border-radius:
|
|
329
|
-
.detail-save:
|
|
520
|
+
.detail-close { padding: 8px 14px; height: 36px; font-size: 13px; color: var(--text-secondary); border-radius: 7px; }
|
|
521
|
+
.detail-close:hover:not(:disabled) { background: var(--hover); color: var(--text); }
|
|
522
|
+
.detail-save { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex-shrink: 0; min-width: 90px; height: 36px; border-radius: 7px; color: var(--on-accent, #fff); background: var(--green-fill); font-size: 13px; font-weight: 500; }
|
|
523
|
+
.plan-detail-panel .detail-save:disabled { opacity: 1; background: var(--hover); color: var(--muted); }
|
|
524
|
+
.detail-save:hover:not(:disabled) { background: var(--green-fill-hover); color: var(--on-accent, #fff); }
|
|
330
525
|
.plan-detail-panel button:disabled { opacity: .55; cursor: not-allowed; }
|
|
331
526
|
.plan-detail-panel :is(input, textarea):disabled { cursor: not-allowed; }
|
|
332
|
-
.plan-detail-panel :is(input,
|
|
527
|
+
.plan-detail-panel :is(input[type='checkbox'], button):focus-visible { outline: 2px solid var(--focus-ring, var(--green)); outline-offset: 2px; }
|
|
333
528
|
.detail-spinner { animation: detail-spin 1s linear infinite; }
|
|
334
529
|
@keyframes detail-spin { to { transform: rotate(360deg); } }
|
|
335
|
-
@media (max-width: 600px) { .plan-detail-backdrop { padding: 12px; } .plan-detail-panel { height: min(740px, calc(100dvh - 24px)); } header, footer { padding-left: 16px; padding-right: 16px; } .plan-detail-content { padding: 24px 20px; } .plan-detail-
|
|
336
|
-
@media (max-width: 420px) { .plan-detail-
|
|
530
|
+
@media (max-width: 600px) { .plan-detail-backdrop { padding: 12px; } .plan-detail-panel { height: min(740px, calc(100dvh - 24px)); } header, footer { padding-left: 16px; padding-right: 16px; } .plan-detail-content { padding: 24px 20px; } .plan-detail-name textarea { font-size: 22px; } .plan-detail-panel :deep(.plan-detail-references) { gap: 16px; } .detail-save-state { font-size: 11px; } }
|
|
531
|
+
@media (max-width: 420px) { .plan-detail-row { grid-template-columns: minmax(0, 1fr); } .plan-detail-meta { margin-left: 0; } .plan-detail-panel :deep(.plan-detail-references) { grid-template-columns: minmax(0, 1fr); gap: 20px; } .detail-save-state.has-changes { max-width: 98px; line-height: 1.5; } .detail-close { padding: 8px; } .detail-save { min-width: 76px; } }
|
|
337
532
|
</style>
|
|
@@ -7,9 +7,10 @@ import { t, uiLocale } from '../../i18n/i18n';
|
|
|
7
7
|
import { onBeforeUnmount, ref, TransitionGroup, watch } from 'vue';
|
|
8
8
|
import { animate } from 'motion/mini';
|
|
9
9
|
import { CalendarDays } from 'lucide-vue-next';
|
|
10
|
-
import {
|
|
10
|
+
import { isPlanCompletionLocked } from '@tano/protocol';
|
|
11
11
|
import type { ObjectRecord } from '../../objects/workspace-objects';
|
|
12
12
|
import { hasEventTime, isCheckableEvent, isEventCompleted, localDayKey } from '../calendar';
|
|
13
|
+
import { PLAN_DRAG_MIME } from '../calendar-interaction';
|
|
13
14
|
import { planKey, planSourceLabel } from '../personal-plans';
|
|
14
15
|
import { readPlanDate } from '../plan-date';
|
|
15
16
|
|
|
@@ -48,8 +49,7 @@ function visualCompleted(record: ObjectRecord) {
|
|
|
48
49
|
return completionFeedback.value[planKey(record)] ?? isEventCompleted(record);
|
|
49
50
|
}
|
|
50
51
|
function completionLocked(record: ObjectRecord) {
|
|
51
|
-
|
|
52
|
-
return !!review && review.state !== 'approved';
|
|
52
|
+
return isPlanCompletionLocked(record.object);
|
|
53
53
|
}
|
|
54
54
|
function complete(record: ObjectRecord, event: Event) {
|
|
55
55
|
const input = event.target as HTMLInputElement;
|
|
@@ -123,6 +123,16 @@ onBeforeUnmount(() => {
|
|
|
123
123
|
leavingAnimations.clear();
|
|
124
124
|
enteringAnimations.clear();
|
|
125
125
|
});
|
|
126
|
+
function canDrag(record: ObjectRecord) {
|
|
127
|
+
return !props.disabled && props.canEdit?.(record) !== false && !props.pending.includes(planKey(record));
|
|
128
|
+
}
|
|
129
|
+
function onDragStart(record: ObjectRecord, event: DragEvent) {
|
|
130
|
+
if (!canDrag(record) || !event.dataTransfer) return;
|
|
131
|
+
const key = planKey(record);
|
|
132
|
+
event.dataTransfer.effectAllowed = 'move';
|
|
133
|
+
event.dataTransfer.setData(PLAN_DRAG_MIME, key);
|
|
134
|
+
event.dataTransfer.setData('text/plain', record.object.name);
|
|
135
|
+
}
|
|
126
136
|
function eventTime(record: ObjectRecord, day: Date) {
|
|
127
137
|
if (props.showDate) {
|
|
128
138
|
const { date, time, end } = readPlanDate(record.object.properties);
|
|
@@ -156,9 +166,11 @@ function eventTime(record: ObjectRecord, day: Date) {
|
|
|
156
166
|
v-for="record in records"
|
|
157
167
|
:key="planKey(record)"
|
|
158
168
|
:data-plan-layout="planKey(record)"
|
|
159
|
-
:class="{ completed: visualCompleted(record), 'context-target': contextKey === planKey(record) }"
|
|
169
|
+
:class="{ completed: visualCompleted(record), 'context-target': contextKey === planKey(record), draggable: canDrag(record) }"
|
|
170
|
+
:draggable="canDrag(record)"
|
|
160
171
|
:aria-busy="pending.includes(planKey(record))"
|
|
161
172
|
:data-completion-transition="completionFeedback[planKey(record)] !== undefined || undefined"
|
|
173
|
+
@dragstart="onDragStart(record, $event)"
|
|
162
174
|
@contextmenu.prevent="emit('context', record, $event)"
|
|
163
175
|
@keydown="contextKeydown(record, $event)"
|
|
164
176
|
>
|
|
@@ -30,7 +30,8 @@ import {
|
|
|
30
30
|
import { useWorkspaceStore } from '../../stores/workspace';
|
|
31
31
|
import { usePlanStore } from '../../stores/plans';
|
|
32
32
|
import type { PlanScope } from '../../stores/plans';
|
|
33
|
-
import { planKey } from '../personal-plans';
|
|
33
|
+
import { planKey, sourcePlanKey } from '../personal-plans';
|
|
34
|
+
import { expandRecurringPlans, isVirtualOccurrence } from '../recurrence';
|
|
34
35
|
import { useWorkbenchRuntime } from '../../runtime';
|
|
35
36
|
import PlanEventList from './PlanEventList.vue';
|
|
36
37
|
import { createPlanListMotion } from './plan-list-motion';
|
|
@@ -40,7 +41,7 @@ import type { SyncKind } from '../../plan-sync/types';
|
|
|
40
41
|
import PlanDateField from './PlanDateField.vue';
|
|
41
42
|
import { writePlanDate } from '../plan-date';
|
|
42
43
|
import type { PlanDateValue } from '../plan-date';
|
|
43
|
-
import {
|
|
44
|
+
import { isPlanCompletionLocked, withPlanCompleted } from '@tano/protocol';
|
|
44
45
|
import type { WorkspaceObject } from '@tano/protocol';
|
|
45
46
|
import PlanEventContextMenu from './PlanEventContextMenu.vue';
|
|
46
47
|
|
|
@@ -124,7 +125,17 @@ let suppressCalendarClick = false;
|
|
|
124
125
|
let savedScrollTop = BUFFER_WEEKS * WEEK_HEIGHT;
|
|
125
126
|
let repositioning = false;
|
|
126
127
|
let resizeObserver: ResizeObserver | undefined;
|
|
127
|
-
const events = computed(() =>
|
|
128
|
+
const events = computed(() =>
|
|
129
|
+
planningEvents(
|
|
130
|
+
expandRecurringPlans(
|
|
131
|
+
plans.recordsFor(effectiveView.value),
|
|
132
|
+
start.value,
|
|
133
|
+
offsetDays(start.value, TOTAL_WEEKS * 7 - 1),
|
|
134
|
+
),
|
|
135
|
+
),
|
|
136
|
+
);
|
|
137
|
+
const canEditItem = (record: ObjectRecord) => !isVirtualOccurrence(record) && plans.canEdit(record);
|
|
138
|
+
const selectEventKey = (key: string) => emit('select-event', key.replace(/@\d{4}-\d{2}-\d{2}$/, ''));
|
|
128
139
|
const unfinished = computed(() => events.value.filter(record => !isEventCompleted(record)));
|
|
129
140
|
const completed = computed(() => events.value.filter(isEventCompleted));
|
|
130
141
|
const completedExpanded = ref(false);
|
|
@@ -162,7 +173,7 @@ async function contextAction(action: 'details' | 'complete' | 'archive') {
|
|
|
162
173
|
if (!record) return;
|
|
163
174
|
if (action === 'details') {
|
|
164
175
|
trigger?.focus({ preventScroll: true });
|
|
165
|
-
emit('select-event',
|
|
176
|
+
emit('select-event', sourcePlanKey(record));
|
|
166
177
|
return;
|
|
167
178
|
}
|
|
168
179
|
if (action === 'complete') await completeEvent(record, !isEventCompleted(record));
|
|
@@ -363,13 +374,9 @@ async function updateEvent(record: ObjectRecord, change: Partial<Pick<WorkspaceO
|
|
|
363
374
|
}
|
|
364
375
|
}
|
|
365
376
|
function completeEvent(record: ObjectRecord, completed: boolean) {
|
|
366
|
-
if (!isCheckableEvent(record)) return;
|
|
367
|
-
const
|
|
368
|
-
|
|
369
|
-
const properties = { ...record.object.properties, completed };
|
|
370
|
-
if (record.object.type === 'task')
|
|
371
|
-
Object.assign(properties, { status: completed ? 'done' : 'todo' });
|
|
372
|
-
return updateEvent(record, { properties });
|
|
377
|
+
if (!isCheckableEvent(record) || isPlanCompletionLocked(record.object)) return;
|
|
378
|
+
const next = withPlanCompleted(record.object, completed);
|
|
379
|
+
return updateEvent(record, { properties: next.properties });
|
|
373
380
|
}
|
|
374
381
|
|
|
375
382
|
async function resetScroll(date: Date) {
|
|
@@ -763,12 +770,12 @@ onBeforeUnmount(() => {
|
|
|
763
770
|
:records="agenda"
|
|
764
771
|
:date="selectedDate"
|
|
765
772
|
:disabled="false"
|
|
766
|
-
:can-edit="
|
|
773
|
+
:can-edit="canEditItem"
|
|
767
774
|
:pending="pending"
|
|
768
775
|
:context-key="context?.key"
|
|
769
776
|
:context-menu-id="contextMenuId"
|
|
770
777
|
@context="openContextMenu"
|
|
771
|
-
@select="
|
|
778
|
+
@select="selectEventKey"
|
|
772
779
|
@complete="completeEvent"
|
|
773
780
|
>
|
|
774
781
|
<template #empty>
|
|
@@ -798,12 +805,12 @@ onBeforeUnmount(() => {
|
|
|
798
805
|
:records="unscheduled"
|
|
799
806
|
:date="selectedDate"
|
|
800
807
|
:disabled="false"
|
|
801
|
-
:can-edit="
|
|
808
|
+
:can-edit="canEditItem"
|
|
802
809
|
:pending="pending"
|
|
803
810
|
:context-key="context?.key"
|
|
804
811
|
:context-menu-id="contextMenuId"
|
|
805
812
|
@context="openContextMenu"
|
|
806
|
-
@select="
|
|
813
|
+
@select="selectEventKey"
|
|
807
814
|
@complete="completeEvent"
|
|
808
815
|
>
|
|
809
816
|
<template #empty>
|