@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
|
@@ -1,56 +1,195 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { t } from '../../i18n/i18n';
|
|
3
|
-
import { computed, ref } from 'vue';
|
|
3
|
+
import { computed, ref, useId } from 'vue';
|
|
4
4
|
import { CalendarPlus, Repeat2 } from 'lucide-vue-next';
|
|
5
|
-
import { parseTaskRepeat } from '@tano/protocol';
|
|
6
|
-
import type { WorkspaceObject } from '@tano/protocol';
|
|
5
|
+
import { isActionableTask, isPlanCompleted, parseTaskRepeat, validEventDate, validEventTime } from '@tano/protocol';
|
|
6
|
+
import type { TaskRepeatMode, WorkspaceObject } from '@tano/protocol';
|
|
7
7
|
import type { ObjectRecord } from '../../objects/workspace-objects';
|
|
8
8
|
import type { RepeatPreview } from '../task-repeat';
|
|
9
|
+
import { localDayKey } from '../calendar';
|
|
9
10
|
import { useWorkspaceStore } from '../../stores/workspace';
|
|
10
|
-
|
|
11
|
+
|
|
12
|
+
const props = defineProps<{
|
|
13
|
+
object: WorkspaceObject;
|
|
14
|
+
record: ObjectRecord;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
dirty: boolean;
|
|
17
|
+
workspaceId?: string;
|
|
18
|
+
personal?: boolean;
|
|
19
|
+
}>();
|
|
11
20
|
const emit = defineEmits<{ change: [value: unknown]; openRecord: [record: ObjectRecord] }>();
|
|
12
|
-
const store = useWorkspaceStore()
|
|
21
|
+
const store = useWorkspaceStore();
|
|
22
|
+
const preview = ref<RepeatPreview | null>();
|
|
23
|
+
const busy = ref(false);
|
|
24
|
+
const error = ref('');
|
|
25
|
+
const frequencyId = useId();
|
|
26
|
+
|
|
27
|
+
const checkable = computed(() => isActionableTask(props.object));
|
|
28
|
+
const supportsAfterComplete = computed(() => checkable.value && !props.personal && !!props.workspaceId);
|
|
13
29
|
const rule = computed(() => {
|
|
14
30
|
const value = props.object.properties.repeatSourceId
|
|
15
|
-
? store.objects.find(record => record.object.id === props.object.properties.repeatSourceId)?.object.properties.repeat
|
|
31
|
+
? store.objects.find((record) => record.object.id === props.object.properties.repeatSourceId)?.object.properties.repeat
|
|
16
32
|
: props.object.properties.repeat;
|
|
17
33
|
return value === undefined ? null : parseTaskRepeat(value);
|
|
18
34
|
});
|
|
19
|
-
const
|
|
35
|
+
const effectiveMode = computed<TaskRepeatMode>(() =>
|
|
36
|
+
rule.value?.mode ?? (supportsAfterComplete.value ? 'after_complete' : 'schedule'),
|
|
37
|
+
);
|
|
38
|
+
const anchor = computed(() => {
|
|
39
|
+
const p = props.object.properties;
|
|
40
|
+
if (validEventDate(p.date)) return p.date;
|
|
41
|
+
if (validEventTime(p.start)) return localDayKey(new Date(p.start));
|
|
42
|
+
if (validEventDate(p.due)) return p.due;
|
|
43
|
+
return '';
|
|
44
|
+
});
|
|
45
|
+
|
|
20
46
|
function update(key: string, value: unknown) {
|
|
21
|
-
preview.value = undefined;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
47
|
+
preview.value = undefined;
|
|
48
|
+
error.value = '';
|
|
49
|
+
if (key === 'frequency' && !value) {
|
|
50
|
+
emit('change', undefined);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
const baseMode: TaskRepeatMode | undefined = supportsAfterComplete.value
|
|
55
|
+
? rule.value?.mode
|
|
56
|
+
: 'schedule';
|
|
57
|
+
const nextRaw: Record<string, unknown> = {
|
|
58
|
+
version: 1,
|
|
59
|
+
frequency: 'weekly',
|
|
60
|
+
interval: 1,
|
|
61
|
+
anchor: anchor.value,
|
|
62
|
+
...(baseMode ? { mode: baseMode } : {}),
|
|
63
|
+
...rule.value,
|
|
64
|
+
[key]: value,
|
|
65
|
+
};
|
|
66
|
+
if (nextRaw.until === undefined) delete nextRaw.until;
|
|
67
|
+
if (nextRaw.mode === undefined) delete nextRaw.mode;
|
|
68
|
+
emit('change', parseTaskRepeat(nextRaw));
|
|
69
|
+
} catch (reason) {
|
|
70
|
+
error.value = String(reason);
|
|
71
|
+
}
|
|
25
72
|
}
|
|
73
|
+
|
|
26
74
|
async function prepare() {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
75
|
+
if (!props.workspaceId) return;
|
|
76
|
+
busy.value = true;
|
|
77
|
+
error.value = '';
|
|
78
|
+
try {
|
|
79
|
+
preview.value = await store.repeatPreview(props.record, props.workspaceId);
|
|
80
|
+
if (!preview.value) error.value = t('重复规则已结束');
|
|
81
|
+
} catch (reason) {
|
|
82
|
+
error.value = String(reason);
|
|
83
|
+
} finally {
|
|
84
|
+
busy.value = false;
|
|
85
|
+
}
|
|
31
86
|
}
|
|
87
|
+
|
|
32
88
|
async function create() {
|
|
33
|
-
if (!preview.value) return;
|
|
34
|
-
busy.value = true;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
89
|
+
if (!preview.value || !props.workspaceId) return;
|
|
90
|
+
busy.value = true;
|
|
91
|
+
error.value = '';
|
|
92
|
+
try {
|
|
93
|
+
emit('openRecord', await store.createRepeat(preview.value, props.workspaceId));
|
|
94
|
+
} catch (reason) {
|
|
95
|
+
error.value = String(reason);
|
|
96
|
+
} finally {
|
|
97
|
+
busy.value = false;
|
|
98
|
+
}
|
|
38
99
|
}
|
|
39
|
-
|
|
100
|
+
|
|
101
|
+
const people = computed(
|
|
102
|
+
() =>
|
|
103
|
+
preview.value?.relations
|
|
104
|
+
.filter((row) => row.type === 'assigned')
|
|
105
|
+
.map((row) => store.objects.find((item) => item.object.id === row.source.id)?.object.name ?? t('不可用'))
|
|
106
|
+
.join('、') || t('未分配'),
|
|
107
|
+
);
|
|
40
108
|
</script>
|
|
109
|
+
|
|
41
110
|
<template>
|
|
42
111
|
<section class="task-repeat" :aria-label="t('重复任务')">
|
|
43
|
-
<label
|
|
44
|
-
<
|
|
45
|
-
|
|
112
|
+
<label class="task-repeat-label" :for="frequencyId"><Repeat2 :size="15" />{{ t('重复') }}</label>
|
|
113
|
+
<div class="task-repeat-body">
|
|
114
|
+
<select
|
|
115
|
+
:id="frequencyId"
|
|
116
|
+
:class="{ 'is-empty': !rule }"
|
|
117
|
+
:value="rule?.frequency ?? ''"
|
|
118
|
+
:disabled="disabled || busy || !!object.properties.repeatSourceId"
|
|
119
|
+
@change="update('frequency', ($event.target as HTMLSelectElement).value)"
|
|
120
|
+
>
|
|
121
|
+
<option value="">{{ t('不重复') }}</option>
|
|
122
|
+
<option value="daily">{{ t('每天') }}</option>
|
|
123
|
+
<option value="weekly">{{ t('每周') }}</option>
|
|
124
|
+
<option value="monthly">{{ t('每月') }}</option>
|
|
125
|
+
</select>
|
|
126
|
+
<template v-if="rule">
|
|
127
|
+
<label v-if="supportsAfterComplete">
|
|
128
|
+
{{ t('重复模式') }}
|
|
129
|
+
<select
|
|
130
|
+
:value="effectiveMode"
|
|
131
|
+
:disabled="disabled || busy || !!object.properties.repeatSourceId"
|
|
132
|
+
@change="update('mode', ($event.target as HTMLSelectElement).value)"
|
|
133
|
+
>
|
|
134
|
+
<option value="after_complete">{{ t('完成后生成下一次') }}</option>
|
|
135
|
+
<option value="schedule">{{ t('按日程规律重复') }}</option>
|
|
136
|
+
</select>
|
|
137
|
+
</label>
|
|
138
|
+
<label>
|
|
139
|
+
{{ t('间隔') }}
|
|
140
|
+
<input
|
|
141
|
+
type="number"
|
|
142
|
+
min="1"
|
|
143
|
+
max="99"
|
|
144
|
+
:value="rule.interval"
|
|
145
|
+
:disabled="disabled || busy || !!object.properties.repeatSourceId"
|
|
146
|
+
@change="update('interval', Number(($event.target as HTMLInputElement).value))"
|
|
147
|
+
/>
|
|
148
|
+
</label>
|
|
149
|
+
<label>
|
|
150
|
+
{{ t('结束日期') }}
|
|
151
|
+
<input
|
|
152
|
+
type="date"
|
|
153
|
+
:value="rule.until ?? ''"
|
|
154
|
+
:disabled="disabled || busy || !!object.properties.repeatSourceId"
|
|
155
|
+
@change="update('until', ($event.target as HTMLInputElement).value || undefined)"
|
|
156
|
+
/>
|
|
157
|
+
</label>
|
|
158
|
+
<button
|
|
159
|
+
v-if="supportsAfterComplete && effectiveMode === 'after_complete'"
|
|
160
|
+
type="button"
|
|
161
|
+
:disabled="disabled || dirty || busy || !isPlanCompleted(object)"
|
|
162
|
+
@click="prepare"
|
|
163
|
+
>
|
|
164
|
+
<CalendarPlus :size="14" />{{ t('预览下一次') }}
|
|
165
|
+
</button>
|
|
166
|
+
</template>
|
|
167
|
+
<div v-if="preview" class="repeat-preview">
|
|
168
|
+
<strong>{{ preview.object.name }}</strong>
|
|
169
|
+
<span>{{ t('下一次:') }}{{ preview.object.properties.date ?? preview.object.properties.due }}</span>
|
|
170
|
+
<span>{{ t('负责人:') }}{{ people }}</span>
|
|
171
|
+
<span>{{ t('关联:') }}{{ preview.relations.length }} {{ t('项') }}</span>
|
|
172
|
+
<div>
|
|
173
|
+
<button type="button" :disabled="disabled || dirty || busy" @click="create">{{ t('确认创建下一次') }}</button>
|
|
174
|
+
<button type="button" :disabled="busy" @click="preview = undefined">{{ t('取消') }}</button>
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
46
177
|
<p v-if="error" role="alert">{{ error }}</p>
|
|
178
|
+
</div>
|
|
47
179
|
</section>
|
|
48
180
|
</template>
|
|
181
|
+
|
|
49
182
|
<style scoped>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
.repeat-
|
|
55
|
-
|
|
183
|
+
/* Laid out as one row of the detail panel's property list: label column + controls. */
|
|
184
|
+
.task-repeat { display: grid; grid-template-columns: var(--plan-row-label, 104px) minmax(0, 1fr); column-gap: 12px; align-items: start; font-size: 13px; }
|
|
185
|
+
.task-repeat-label { display: flex; align-items: center; gap: 8px; min-height: 32px; color: var(--muted); }
|
|
186
|
+
.task-repeat-body { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; min-width: 0; }
|
|
187
|
+
.task-repeat-body > label { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: 12px; }
|
|
188
|
+
input[type=number] { width: 64px; }
|
|
189
|
+
button { display: inline-flex; gap: 5px; align-items: center; min-height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; font: inherit; font-size: 12px; color: var(--text-secondary); }
|
|
190
|
+
button:hover:not(:disabled) { border-color: var(--control-border); background: var(--hover); color: var(--text); }
|
|
191
|
+
.repeat-preview { display: grid; gap: 6px; flex-basis: 100%; padding: 10px 12px; border-radius: 8px; background: var(--surface); font-size: 12px; }
|
|
192
|
+
.repeat-preview > div { display: flex; gap: 8px; margin-top: 4px; }
|
|
193
|
+
p { margin: 0; color: var(--danger); flex-basis: 100%; font-size: 12px; overflow-wrap: anywhere; }
|
|
194
|
+
@media (max-width: 420px) { .task-repeat { grid-template-columns: minmax(0, 1fr); } }
|
|
56
195
|
</style>
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/* ---- Calendar palette -----------------------------------------------------
|
|
2
|
+
Items read their colour from --tone: workspace items use the product ink,
|
|
3
|
+
personal items a quiet blue, deadlines amber, overdue the danger colour.
|
|
4
|
+
Fills and seams are mixed from the tone so every theme stays consistent. */
|
|
5
|
+
.calendar-shell {
|
|
6
|
+
--cal-ink: var(--text);
|
|
7
|
+
--cal-personal: #3d6cc9;
|
|
8
|
+
--cal-due: #b7791f;
|
|
9
|
+
--cal-overdue: var(--danger, #c24141);
|
|
10
|
+
--cal-radius: 6px;
|
|
11
|
+
--cal-today: color-mix(in srgb, var(--text) 2.5%, transparent);
|
|
12
|
+
--cal-lift: 0 1px 2px rgb(15 15 15 / 0.06), 0 6px 16px -6px rgb(15 15 15 / 0.18);
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
flex: 1;
|
|
16
|
+
min-height: 0;
|
|
17
|
+
min-width: 0;
|
|
18
|
+
background: var(--paper);
|
|
19
|
+
}
|
|
20
|
+
:root[data-theme='dark'] .calendar-shell {
|
|
21
|
+
--cal-personal: #86a6ea;
|
|
22
|
+
--cal-due: #d9b26a;
|
|
23
|
+
--cal-today: color-mix(in srgb, var(--text) 3.5%, transparent);
|
|
24
|
+
--cal-lift: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 20px -6px rgb(0 0 0 / 0.55);
|
|
25
|
+
}
|
|
26
|
+
.calendar-shell :where(.calendar-view-event, .calendar-view-date-event, .calendar-month-event, .calendar-agenda-row) {
|
|
27
|
+
--tone: var(--cal-ink);
|
|
28
|
+
}
|
|
29
|
+
.calendar-shell .is-personal { --tone: var(--cal-personal); }
|
|
30
|
+
.calendar-shell .is-due { --tone: var(--cal-due); }
|
|
31
|
+
.calendar-shell .is-overdue { --tone: var(--cal-overdue); }
|
|
32
|
+
|
|
33
|
+
/* ---- Scroll container ---------------------------------------------------- */
|
|
34
|
+
.calendar-view {
|
|
35
|
+
flex: 1;
|
|
36
|
+
min-height: 0;
|
|
37
|
+
overflow: auto;
|
|
38
|
+
background: var(--paper);
|
|
39
|
+
}
|
|
40
|
+
.calendar-view-timeline,
|
|
41
|
+
.calendar-view-month,
|
|
42
|
+
.calendar-view-year { overflow-anchor: none; }
|
|
43
|
+
/* Switching between views fades the new layout in instead of snapping. */
|
|
44
|
+
.calendar-shell :is(.calendar-view-inner, .calendar-month-view, .calendar-year-view, .calendar-agenda-view) {
|
|
45
|
+
animation: tano-fade-in var(--motion-base) var(--ease-standard);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* ---- Shared item pieces -------------------------------------------------- */
|
|
49
|
+
.calendar-shell .calendar-inline-check {
|
|
50
|
+
flex: none;
|
|
51
|
+
display: grid;
|
|
52
|
+
place-items: center;
|
|
53
|
+
width: 16px;
|
|
54
|
+
height: 16px;
|
|
55
|
+
padding: 0;
|
|
56
|
+
border-radius: 50%;
|
|
57
|
+
color: color-mix(in srgb, var(--tone, var(--text)) 55%, var(--muted));
|
|
58
|
+
}
|
|
59
|
+
.calendar-shell .calendar-inline-check:hover:not(:disabled) {
|
|
60
|
+
color: var(--tone, var(--text));
|
|
61
|
+
background: color-mix(in srgb, var(--tone, var(--text)) 12%, transparent);
|
|
62
|
+
}
|
|
63
|
+
/* Checks sit inside draggable items, which the global press motion skips. */
|
|
64
|
+
.calendar-shell .calendar-inline-check:active:not(:disabled) { scale: 0.86; }
|
|
65
|
+
.calendar-shell .calendar-inline-check:disabled { opacity: 0.45; cursor: not-allowed; }
|
|
66
|
+
.calendar-shell .is-completed .calendar-inline-check { color: var(--tone, var(--text)); }
|
|
67
|
+
.calendar-shell .calendar-due-flag { flex: none; color: var(--cal-due); }
|
|
68
|
+
.calendar-shell .is-overdue .calendar-due-flag { color: var(--cal-overdue); }
|
|
69
|
+
.calendar-shell .calendar-item-trigger {
|
|
70
|
+
flex: 1;
|
|
71
|
+
min-width: 0;
|
|
72
|
+
overflow: hidden;
|
|
73
|
+
text-overflow: ellipsis;
|
|
74
|
+
white-space: nowrap;
|
|
75
|
+
text-align: left;
|
|
76
|
+
color: inherit;
|
|
77
|
+
font: inherit;
|
|
78
|
+
}
|
|
79
|
+
.calendar-shell .calendar-item-trigger:hover { color: inherit; }
|
|
80
|
+
.calendar-shell .calendar-item-time {
|
|
81
|
+
margin-right: 5px;
|
|
82
|
+
color: var(--muted);
|
|
83
|
+
font-variant-numeric: tabular-nums;
|
|
84
|
+
}
|
|
85
|
+
.calendar-shell .is-draggable { cursor: grab; }
|
|
86
|
+
.calendar-shell .is-draggable:active { cursor: grabbing; }
|
|
87
|
+
.calendar-shell .is-dragging { opacity: 0.38; }
|
|
88
|
+
.calendar-shell .is-completed .calendar-item-trigger,
|
|
89
|
+
.calendar-shell .is-completed .calendar-view-event-body strong,
|
|
90
|
+
.calendar-shell .is-completed .calendar-agenda-item span {
|
|
91
|
+
color: var(--muted);
|
|
92
|
+
text-decoration: line-through;
|
|
93
|
+
text-decoration-color: color-mix(in srgb, var(--muted) 70%, transparent);
|
|
94
|
+
}
|
|
95
|
+
.calendar-shell .is-overdue .calendar-item-trigger { color: color-mix(in srgb, var(--tone) 75%, var(--text)); }
|
|
96
|
+
|
|
97
|
+
/* Shared today pill */
|
|
98
|
+
.calendar-shell .calendar-view-day-heading.today strong,
|
|
99
|
+
.calendar-shell .calendar-month-date.today,
|
|
100
|
+
.calendar-shell .calendar-year-days button.today > .calendar-year-date {
|
|
101
|
+
color: var(--on-accent, white);
|
|
102
|
+
background: var(--green-fill);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* Shared drop target highlight */
|
|
106
|
+
.calendar-shell .calendar-view-date-events.is-drop-target,
|
|
107
|
+
.calendar-shell .calendar-month-cell.is-drop-target {
|
|
108
|
+
background: color-mix(in srgb, var(--text) 5%, var(--paper));
|
|
109
|
+
box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--text) 45%, transparent);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* All-day chips in the timeline header and every chip in the month grid. */
|
|
113
|
+
.calendar-shell :is(.calendar-view-date-event, .calendar-month-event) {
|
|
114
|
+
flex-shrink: 0;
|
|
115
|
+
display: flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
gap: 5px;
|
|
118
|
+
box-sizing: border-box;
|
|
119
|
+
height: 22px;
|
|
120
|
+
padding: 0 7px 0 5px;
|
|
121
|
+
border-radius: 5px;
|
|
122
|
+
background: color-mix(in srgb, var(--tone) 8%, var(--paper));
|
|
123
|
+
color: var(--text);
|
|
124
|
+
font-size: 11px;
|
|
125
|
+
line-height: 22px;
|
|
126
|
+
transition:
|
|
127
|
+
background-color var(--motion-quick) var(--ease-standard),
|
|
128
|
+
box-shadow var(--motion-base) var(--ease-standard),
|
|
129
|
+
opacity var(--motion-base) var(--ease-standard);
|
|
130
|
+
}
|
|
131
|
+
.calendar-shell :is(.calendar-view-date-event, .calendar-month-event):not(:has(.calendar-inline-check, .calendar-due-flag)) {
|
|
132
|
+
padding-left: 8px;
|
|
133
|
+
}
|
|
134
|
+
.calendar-shell :is(.calendar-view-date-event, .calendar-month-event):hover,
|
|
135
|
+
.calendar-shell :is(.calendar-view-date-event, .calendar-month-event):focus-within {
|
|
136
|
+
background: color-mix(in srgb, var(--tone) 14%, var(--paper));
|
|
137
|
+
}
|
|
138
|
+
.calendar-shell :is(.calendar-view-date-event, .calendar-month-event).is-due {
|
|
139
|
+
background: color-mix(in srgb, var(--tone) 7%, var(--paper));
|
|
140
|
+
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 30%, transparent);
|
|
141
|
+
}
|
|
142
|
+
.calendar-shell :is(.calendar-view-date-event, .calendar-month-event).is-due:hover {
|
|
143
|
+
background: color-mix(in srgb, var(--tone) 13%, var(--paper));
|
|
144
|
+
}
|
|
145
|
+
.calendar-shell :is(.calendar-view-date-event, .calendar-month-event).is-completed {
|
|
146
|
+
background: color-mix(in srgb, var(--tone) 4%, var(--paper));
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/* Shared checkbox styling for filter bar and quick-create dialog */
|
|
150
|
+
.calendar-filter-completed input,
|
|
151
|
+
.calendar-create-checkable input {
|
|
152
|
+
appearance: none;
|
|
153
|
+
position: relative;
|
|
154
|
+
flex: none;
|
|
155
|
+
width: 14px;
|
|
156
|
+
height: 14px;
|
|
157
|
+
margin: 0;
|
|
158
|
+
border: 1.5px solid var(--control-border);
|
|
159
|
+
border-radius: 4px;
|
|
160
|
+
background: var(--paper);
|
|
161
|
+
cursor: pointer;
|
|
162
|
+
transition: background-color var(--motion-quick) var(--ease-standard), border-color var(--motion-quick) var(--ease-standard);
|
|
163
|
+
}
|
|
164
|
+
.calendar-filter-completed input::after,
|
|
165
|
+
.calendar-create-checkable input::after {
|
|
166
|
+
content: '';
|
|
167
|
+
position: absolute;
|
|
168
|
+
left: 3.5px;
|
|
169
|
+
top: 0.5px;
|
|
170
|
+
width: 3.5px;
|
|
171
|
+
height: 7px;
|
|
172
|
+
border: solid var(--on-accent, #fff);
|
|
173
|
+
border-width: 0 1.5px 1.5px 0;
|
|
174
|
+
rotate: 45deg;
|
|
175
|
+
scale: 0.4;
|
|
176
|
+
opacity: 0;
|
|
177
|
+
transition: scale var(--motion-spring) var(--ease-spring-bouncy), opacity var(--motion-quick) var(--ease-standard);
|
|
178
|
+
}
|
|
179
|
+
.calendar-filter-completed input:checked,
|
|
180
|
+
.calendar-create-checkable input:checked { border-color: var(--green-fill); background: var(--green-fill); }
|
|
181
|
+
.calendar-filter-completed input:checked::after,
|
|
182
|
+
.calendar-create-checkable input:checked::after { scale: 1; opacity: 1; }
|
|
183
|
+
.calendar-filter-completed:hover input:not(:checked),
|
|
184
|
+
.calendar-create-checkable:hover input:not(:checked, :disabled) { border-color: var(--text-secondary); }
|
|
185
|
+
.calendar-filter-completed input:focus-visible,
|
|
186
|
+
.calendar-create-checkable input:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
|
|
187
|
+
|
|
188
|
+
@media (prefers-reduced-motion: reduce) {
|
|
189
|
+
.calendar-shell :is(.calendar-view-inner, .calendar-month-view, .calendar-year-view, .calendar-agenda-view, .calendar-view-event, .calendar-slot-preview, .calendar-error-banner) {
|
|
190
|
+
animation: none;
|
|
191
|
+
}
|
|
192
|
+
}
|