@tano.page/workbench 0.14.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/package.json +21 -8
  2. package/src/App.vue +76 -17
  3. package/src/appearance/appearance.ts +14 -4
  4. package/src/appearance/components/ThemePresetPreview.vue +52 -8
  5. package/src/appearance/interface-font.ts +99 -0
  6. package/src/appearance/theme.ts +26 -10
  7. package/src/appearance/use-interface-font.ts +30 -0
  8. package/src/assets/mail-provider-icons/NOTICE.txt +27 -0
  9. package/src/assets/mail-provider-icons/aliyun-mail.svg +3 -0
  10. package/src/assets/mail-provider-icons/gmail.svg +1 -0
  11. package/src/assets/mail-provider-icons/icloud.svg +12 -0
  12. package/src/assets/mail-provider-icons/netease-126.svg +5 -0
  13. package/src/assets/mail-provider-icons/netease-163.svg +5 -0
  14. package/src/assets/mail-provider-icons/qq.svg +9 -0
  15. package/src/assets/mail-provider-icons/tencent-exmail.svg +4 -0
  16. package/src/assistant/components/AssistantChangeList.vue +98 -21
  17. package/src/assistant/components/AssistantPanel.vue +424 -7
  18. package/src/assistant/components/PluginToolProposalCard.vue +235 -0
  19. package/src/assistant/engine.ts +56 -3
  20. package/src/assistant/files.ts +5 -13
  21. package/src/assistant/inbox.ts +1 -148
  22. package/src/assistant/locales/de-DE.json +4 -1
  23. package/src/assistant/locales/en-US.json +4 -1
  24. package/src/assistant/locales/es-ES.json +4 -1
  25. package/src/assistant/locales/ja-JP.json +4 -1
  26. package/src/assistant/locales/zh-CN.json +4 -1
  27. package/src/assistant/locales/zh-TW.json +4 -1
  28. package/src/assistant/mention-autocomplete.ts +69 -0
  29. package/src/assistant/prompts.ts +7 -0
  30. package/src/assistant/results.ts +20 -86
  31. package/src/assistant/store.ts +319 -12
  32. package/src/assistant/structures.ts +7 -5
  33. package/src/assistant/tasks.ts +3 -5
  34. package/src/assistant/workspace-bridge.ts +1 -1
  35. package/src/composables/use-document-actions.ts +38 -20
  36. package/src/composables/use-file-tree-controller.ts +7 -12
  37. package/src/composables/use-workbench-history.ts +2 -4
  38. package/src/composables/use-workbench-modals.ts +6 -1
  39. package/src/composables/use-workbench-outline.ts +0 -5
  40. package/src/composables/use-workbench-shortcuts.ts +26 -22
  41. package/src/data-tables/data-tables.ts +1 -2
  42. package/src/documents/components/DocumentHistoryPanel.vue +3 -1
  43. package/src/features.ts +1 -0
  44. package/src/fonts/Inter-Latin-Italic.woff2 +0 -0
  45. package/src/fonts/Inter-Latin.woff2 +0 -0
  46. package/src/fonts/TanoUISansSC-Bold.woff2 +0 -0
  47. package/src/fonts/TanoUISansSC-Medium.woff2 +0 -0
  48. package/src/fonts/TanoUISansSC-Regular.woff2 +0 -0
  49. package/src/help/help-milestones.ts +3 -5
  50. package/src/i18n/locales/de-DE.json +349 -3
  51. package/src/i18n/locales/en-US.json +349 -2
  52. package/src/i18n/locales/es-ES.json +349 -3
  53. package/src/i18n/locales/ja-JP.json +348 -2
  54. package/src/i18n/locales/zh-TW.json +348 -2
  55. package/src/mail/components/MailAccountDialog.vue +449 -0
  56. package/src/mail/components/MailComposerDialog.vue +325 -0
  57. package/src/mail/components/MailProviderIcon.vue +30 -0
  58. package/src/mail/components/MailWorkspaceView.vue +820 -0
  59. package/src/mail/components/SidebarMail.vue +133 -0
  60. package/src/mail/mail-avatar.ts +17 -0
  61. package/src/mail/mail-bridge.ts +68 -0
  62. package/src/mail/mail-calendar.ts +208 -0
  63. package/src/mail/mail-markdown.ts +195 -0
  64. package/src/mail/types.ts +226 -0
  65. package/src/objects/components/ObjectDetailModal.vue +1001 -0
  66. package/src/objects/workspace-objects.ts +1 -1
  67. package/src/plan-sync/types.ts +6 -3
  68. package/src/plans/calendar-interaction.ts +194 -0
  69. package/src/plans/calendar.ts +63 -7
  70. package/src/plans/components/CalendarDayPopover.vue +172 -39
  71. package/src/plans/components/CalendarView.vue +1736 -276
  72. package/src/plans/components/PlanArchiveDialog.vue +295 -0
  73. package/src/plans/components/PlanDateField.vue +6 -4
  74. package/src/plans/components/PlanDetailPanel.vue +227 -32
  75. package/src/plans/components/PlanEventList.vue +16 -4
  76. package/src/plans/components/SidebarPlan.vue +22 -15
  77. package/src/plans/components/TaskRepeatControls.vue +169 -30
  78. package/src/plans/local-reminders.ts +149 -0
  79. package/src/plans/personal-plans.ts +10 -1
  80. package/src/plans/plan-date.ts +8 -1
  81. package/src/plans/plan-migration.ts +95 -0
  82. package/src/plans/recurrence.ts +95 -0
  83. package/src/plans/task-repeat.ts +8 -8
  84. package/src/plans/timeline-layout.ts +92 -0
  85. package/src/plugins/assistant-bridge.ts +520 -0
  86. package/src/plugins/attachment-reader.ts +3 -1
  87. package/src/plugins/cache-storage.ts +42 -2
  88. package/src/plugins/components/PluginAutomations.vue +3 -3
  89. package/src/plugins/components/PluginCatalogBrowser.vue +17 -8
  90. package/src/plugins/components/PluginChangeSummary.vue +16 -3
  91. package/src/plugins/components/PluginConnections.vue +1 -1
  92. package/src/plugins/components/PluginCustomView.vue +2 -2
  93. package/src/plugins/components/PluginDetailPage.vue +129 -54
  94. package/src/plugins/components/PluginDocumentSlot.vue +63 -0
  95. package/src/plugins/components/PluginExplorer.vue +15 -21
  96. package/src/plugins/components/PluginImportDialog.vue +410 -0
  97. package/src/plugins/components/PluginInstaller.vue +39 -145
  98. package/src/plugins/components/PluginListItem.vue +3 -0
  99. package/src/plugins/components/PluginMaintenance.vue +21 -6
  100. package/src/plugins/components/PluginRuntimePanel.vue +3 -3
  101. package/src/plugins/components/PluginSettingsForm.vue +111 -0
  102. package/src/plugins/components/PluginStatusBar.vue +161 -0
  103. package/src/plugins/components/PluginSurface.vue +18 -6
  104. package/src/plugins/components/PluginUiDialog.vue +452 -0
  105. package/src/plugins/excalidraw/bundle.tano-plugin.json +1 -1
  106. package/src/plugins/excalidraw/manifest.json +12 -1
  107. package/src/plugins/host.ts +662 -43
  108. package/src/plugins/native.ts +2 -10
  109. package/src/plugins/overlay-mapping.ts +125 -0
  110. package/src/plugins/packages.ts +73 -1
  111. package/src/plugins/plugin-permissions.ts +57 -0
  112. package/src/plugins/plugin-sdk.ts +174 -8
  113. package/src/plugins/policy.ts +53 -3
  114. package/src/plugins/presentation-preview/bundle.tano-plugin.json +1 -1
  115. package/src/plugins/presentation-preview/manifest.json +2 -1
  116. package/src/plugins/queries.ts +3 -1
  117. package/src/plugins/sandbox.ts +15 -1
  118. package/src/plugins/use-plugin-actions.ts +67 -20
  119. package/src/plugins/user-plugins.ts +254 -0
  120. package/src/plugins/word-preview/bundle.tano-plugin.json +1 -1
  121. package/src/plugins/word-preview/manifest.json +13 -1
  122. package/src/plugins/workbench.ts +175 -2
  123. package/src/plugins/worker.js +105 -8
  124. package/src/plugins/workspace-plugin-runtime.ts +23 -7
  125. package/src/plugins/workspace-plugins.ts +212 -21
  126. package/src/runtime.ts +101 -3
  127. package/src/settings/components/SettingsAppearancePage.vue +46 -0
  128. package/src/settings/components/SettingsDocumentsPage.vue +0 -1
  129. package/src/settings/components/settings-search.ts +2 -3
  130. package/src/shell/components/SidebarNavigation.vue +22 -2
  131. package/src/shell/components/WorkbenchContextMenus.vue +21 -8
  132. package/src/shell/components/WorkbenchModals.vue +27 -46
  133. package/src/shell/components/WorkbenchPanes.vue +267 -84
  134. package/src/shell/components/WorkspaceBreadcrumb.vue +6 -14
  135. package/src/shell/components/WorkspaceViewSwitcher.vue +12 -7
  136. package/src/shell/use-workbench.ts +116 -145
  137. package/src/shell/workbench-async-components.ts +14 -5
  138. package/src/stores/mail.ts +414 -0
  139. package/src/stores/plan-sync.ts +2 -1
  140. package/src/stores/plans.ts +2 -9
  141. package/src/stores/workspace-knowledge.ts +1 -113
  142. package/src/stores/workspace-plugins-state.ts +537 -14
  143. package/src/stores/workspace-tabs-layout.ts +5 -43
  144. package/src/stores/workspace.ts +69 -66
  145. package/src/styles/agent-diff-modals.css +0 -7
  146. package/src/styles/dark-theme.css +3 -3
  147. package/src/styles/inspector.css +0 -59
  148. package/src/styles/layout-themes.css +346 -0
  149. package/src/styles/mail.css +1568 -0
  150. package/src/styles/mobile.css +2 -2
  151. package/src/styles/recent-and-media.css +0 -17
  152. package/src/styles/theme-contract.css +3 -3
  153. package/src/styles/workbench-shell.css +110 -17
  154. package/src/styles/workspace-states.css +9 -33
  155. package/src/styles.css +1 -1
  156. package/src/tabs/components/DesktopTabs.vue +0 -3
  157. package/src/tabs/components/NewTabPicker.vue +10 -4
  158. package/src/tabs/tab-label.ts +0 -1
  159. package/src/workspace/components/WorkspaceGeneralSettings.vue +0 -13
  160. package/src/workspace/components/WorkspaceIconPicker.vue +28 -6
  161. package/src/workspace/workspace-comments.ts +11 -151
  162. package/src/workspace/workspace-welcome.ts +1 -1
  163. package/src/documents/components/FormulaMenu.vue +0 -50
  164. package/src/files/components/FileDatabasePage.vue +0 -152
  165. package/src/files/components/FolderHomeIcon.vue +0 -12
  166. package/src/objects/components/ObjectDatabasePage.vue +0 -100
  167. package/src/objects/components/ObjectPanel.vue +0 -554
  168. package/src/plans/components/PersonalPlanDialog.vue +0 -105
  169. package/src/shell/components/WorkspaceViewPage.vue +0 -127
  170. package/src/shell/components/WorkspaceViewTab.vue +0 -24
  171. package/src/styles/object-panel.css +0 -163
  172. package/src/workspace/components/GitInspectionPanel.vue +0 -35
  173. package/src/workspace/components/WorkspaceSyncPanel.vue +0 -50
  174. package/src/workspace/welcome-slogans.ts +0 -11
  175. package/src/workspace/workspace-git.ts +0 -35
  176. package/src/workspace/workspace-sync.ts +0 -46
  177. package/src/workspace/workspace-views.ts +0 -48
@@ -2,14 +2,51 @@
2
2
  import { useWindowContext } from '../../windows/context';
3
3
  const { window, document } = useWindowContext();
4
4
  const ResizeObserver = (window as Window & typeof globalThis).ResizeObserver;
5
+ import { vSurfaceMotion } from '@tano/editor/surface-motion';
5
6
  import LoadingSkeleton from '../../shell/components/LoadingSkeleton.vue';
6
7
  import { t, uiLocale } from '../../i18n/i18n';
7
8
  import { computed, nextTick, onMounted, onUnmounted, ref, shallowRef, useId, watch } from 'vue';
8
- import { calendarEvents, eventsOnDay, hasEventTime, localDayKey, monthDays, plannedEventsOnDay, planningEvents, shiftCalendarDate, visibleCalendarDays, weekDays } from '../calendar';
9
- import type { CalendarViewMode } from '../calendar';
9
+ import { CalendarDays, Circle, CircleCheck, Flag, FolderOpen, ListTodo, Plus, Search, X } from 'lucide-vue-next';
10
+ import { isPlanCompletionLocked, withPlanCompleted } from '@tano/protocol';
11
+ import type { WorkspaceObject } from '@tano/protocol';
12
+ import {
13
+ calendarDayEntries,
14
+ calendarEvents,
15
+ filterCalendarRecords,
16
+ hasEventTime,
17
+ isCheckableEvent,
18
+ isEventCompleted,
19
+ isEventOverdue,
20
+ localDayKey,
21
+ monthDays,
22
+ planningEvents,
23
+ shiftCalendarDate,
24
+ visibleCalendarDays,
25
+ weekDays,
26
+ } from '../calendar';
27
+ import type { CalendarDayEntry, CalendarFilter, CalendarViewMode } from '../calendar';
28
+ import {
29
+ formatMinutesLabel,
30
+ MIN_DURATION_MINUTES,
31
+ minutesFromOffsetY,
32
+ moveRecordToDay,
33
+ moveRecordToSlot,
34
+ PLAN_DRAG_MIME,
35
+ planDateFromSlot,
36
+ resizeRecordEnd,
37
+ selectionRangeFromOffsets,
38
+ snapMinutes,
39
+ } from '../calendar-interaction';
40
+ import { layoutDayTimedEvents } from '../timeline-layout';
41
+ import type { TimedEventBlock } from '../timeline-layout';
10
42
  import type { ObjectRecord } from '../../objects/workspace-objects';
11
43
  import { usePlanStore } from '../../stores/plans';
12
- import { planKey, planSourceLabel } from '../personal-plans';
44
+ import type { PlanScope } from '../../stores/plans';
45
+ import { planKey, planSourceLabel, sourcePlanKey } from '../personal-plans';
46
+ import { expandRecurringPlans, isVirtualOccurrence } from '../recurrence';
47
+ import { writePlanDate } from '../plan-date';
48
+ import type { PlanDateValue } from '../plan-date';
49
+ import PlanDateField from './PlanDateField.vue';
13
50
  import CalendarDayPopover from './CalendarDayPopover.vue';
14
51
 
15
52
  const props = defineProps<{ date: Date; mode: CalendarViewMode; records?: ObjectRecord[]; loading?: boolean }>();
@@ -24,22 +61,374 @@ const emit = defineEmits<{
24
61
  }>();
25
62
  const plans = usePlanStore();
26
63
  const scroll = ref<HTMLElement>();
27
- const events = computed(() => calendarEvents(props.records ?? plans.records));
28
- const planned = computed(() => planningEvents(props.records ?? plans.records));
29
- const dateOnly = computed(() => planned.value.filter(record => record.object.properties.allDay === true || (!hasEventTime(record) && record.object.properties.date)));
30
- const dateOnlyEvents = (day: Date) => plannedEventsOnDay(dateOnly.value, day);
31
- const hasVisibleDateOnly = computed(() => visibleCalendarDays(props.date, props.mode).some(day => dateOnlyEvents(day).length > 0));
32
- const yearDay = shallowRef<{ date: Date; anchor: HTMLElement; scrollTop: number; scrollLeft: number }>();
64
+ const filter = ref<CalendarFilter>({ kind: 'all', showCompleted: true, query: '' });
65
+ const pending = ref<string[]>([]);
66
+ const interactionError = ref('');
67
+ const nowMinutes = ref(currentMinutes());
68
+ let nowTimer: ReturnType<typeof setInterval> | undefined;
69
+
70
+ function currentMinutes() {
71
+ const now = new Date();
72
+ return now.getHours() * 60 + now.getMinutes();
73
+ }
74
+
75
+ const rawPlanned = computed(() => planningEvents(props.records ?? plans.records));
76
+ const visibleWindow = computed<[Date, Date]>(() => {
77
+ if (timeline.value && timelineDays.value.length) {
78
+ return [timelineDays.value[0]!, timelineDays.value.at(-1)!];
79
+ }
80
+ if (props.mode === 'month' && scrollingWeeks.value.length) {
81
+ const last = scrollingWeeks.value.at(-1)!;
82
+ return [scrollingWeeks.value[0]!, new Date(last.getFullYear(), last.getMonth(), last.getDate() + 6)];
83
+ }
84
+ if (props.mode === 'year' && scrollingYears.value.length) {
85
+ return [new Date(scrollingYears.value[0]!, 0, 1), new Date(scrollingYears.value.at(-1)!, 11, 31)];
86
+ }
87
+ return [
88
+ new Date(props.date.getFullYear(), props.date.getMonth(), 1),
89
+ new Date(props.date.getFullYear(), props.date.getMonth() + 1, 0),
90
+ ];
91
+ });
92
+ const expandedPlanned = computed(() =>
93
+ expandRecurringPlans(rawPlanned.value, visibleWindow.value[0], visibleWindow.value[1]),
94
+ );
95
+ const planned = computed(() => filterCalendarRecords(expandedPlanned.value, filter.value));
96
+ const events = computed(() => calendarEvents(planned.value));
97
+
98
+ const canCreateWorkspace = computed(() => Boolean(plans.workspaceWritable));
99
+ const canCreatePersonal = computed(() => Boolean(plans.personalWritable));
100
+ const canCreate = computed(
101
+ () => typeof plans.create === 'function' && (canCreateWorkspace.value || canCreatePersonal.value),
102
+ );
103
+
104
+ const bannerEntries = (day: Date) =>
105
+ calendarDayEntries(planned.value, day).filter((entry) => entry.kind !== 'timed');
106
+ const hasVisibleBanner = computed(() =>
107
+ visibleCalendarDays(props.date, props.mode).some((day) => bannerEntries(day).length > 0),
108
+ );
109
+ // The all-day row is shared by every rendered day, including the buffered
110
+ // days off screen. Size it from the days in view so a busy day two weeks away
111
+ // does not leave a tall empty band; busier cells scroll inside themselves.
112
+ const BANNER_ITEM_HEIGHT = 22;
113
+ const BANNER_GAP = 3;
114
+ const bannerRowHeight = computed(() => {
115
+ const most = Math.max(0, ...visibleCalendarDays(props.date, props.mode).map((day) => bannerEntries(day).length));
116
+ // Show half of a fourth row so an overflowing cell reads as scrollable.
117
+ const rows = Math.min(3.5, Math.max(1, most));
118
+ return Math.round(12 + rows * BANNER_ITEM_HEIGHT + Math.max(0, Math.ceil(rows) - 1) * BANNER_GAP);
119
+ });
120
+ const dayPopover = shallowRef<{ date: Date; anchor: HTMLElement; scrollTop: number; scrollLeft: number }>();
33
121
  const dayPopoverId = useId();
34
- const yearDayKey = computed(() => yearDay.value && localDayKey(yearDay.value.date));
35
- const yearDayRecords = (day: Date) => plannedEventsOnDay(planned.value, day);
36
- function openYearDay(day: Date, event: MouseEvent) {
37
- yearDay.value = yearDayKey.value === localDayKey(day)
38
- ? undefined : {
39
- date: day, anchor: event.currentTarget as HTMLElement,
40
- scrollTop: scroll.value?.scrollTop ?? 0, scrollLeft: scroll.value?.scrollLeft ?? 0,
41
- };
122
+ const dayPopoverKey = computed(() => dayPopover.value && localDayKey(dayPopover.value.date));
123
+ const dayPopoverEntries = (day: Date) => calendarDayEntries(planned.value, day);
124
+
125
+ function openDayPopover(day: Date, event: MouseEvent) {
126
+ dayPopover.value = dayPopoverKey.value === localDayKey(day)
127
+ ? undefined
128
+ : {
129
+ date: day,
130
+ anchor: event.currentTarget as HTMLElement,
131
+ scrollTop: scroll.value?.scrollTop ?? 0,
132
+ scrollLeft: scroll.value?.scrollLeft ?? 0,
133
+ };
134
+ }
135
+
136
+ function canEditRecord(record: ObjectRecord) {
137
+ if (isVirtualOccurrence(record)) return false;
138
+ return typeof plans.canEdit === 'function' ? plans.canEdit(record) : false;
139
+ }
140
+ function canDragRecord(record: ObjectRecord) {
141
+ return (
142
+ canEditRecord(record) &&
143
+ typeof plans.update === 'function' &&
144
+ !pending.value.includes(planKey(record))
145
+ );
146
+ }
147
+ function canToggleComplete(record: ObjectRecord) {
148
+ return (
149
+ isCheckableEvent(record) &&
150
+ !isPlanCompletionLocked(record.object) &&
151
+ canEditRecord(record) &&
152
+ typeof plans.update === 'function' &&
153
+ !pending.value.includes(planKey(record))
154
+ );
155
+ }
156
+ async function updateRecordObject(record: ObjectRecord, next: WorkspaceObject) {
157
+ const key = planKey(record);
158
+ if (!canEditRecord(record) || typeof plans.update !== 'function' || pending.value.includes(key)) return;
159
+ pending.value.push(key);
160
+ interactionError.value = '';
161
+ try {
162
+ await plans.update(record, next);
163
+ } catch (reason) {
164
+ interactionError.value = String(reason);
165
+ } finally {
166
+ pending.value = pending.value.filter((id) => id !== key);
167
+ }
168
+ }
169
+ function toggleComplete(record: ObjectRecord) {
170
+ if (!canToggleComplete(record)) return;
171
+ return updateRecordObject(record, withPlanCompleted(record.object, !isEventCompleted(record)));
172
+ }
173
+
174
+ // --- Direct Manipulation: Quick-Create Dialog ---
175
+ interface QuickCreateDraft {
176
+ name: string;
177
+ checkable: boolean;
178
+ planDate: PlanDateValue;
179
+ scope: PlanScope;
180
+ }
181
+ const createDraft = ref<QuickCreateDraft>();
182
+ const createSaving = ref(false);
183
+ const createError = ref('');
184
+ const createNameInput = ref<HTMLInputElement>();
185
+ const createScopeId = useId();
186
+
187
+ async function openQuickCreate(planDate: PlanDateValue, checkable = false) {
188
+ if (!canCreate.value || createSaving.value) return;
189
+ const preferred: PlanScope = plans.defaultScope === 'personal' ? 'personal' : 'workspace';
190
+ const scope: PlanScope =
191
+ preferred === 'personal'
192
+ ? (canCreatePersonal.value ? 'personal' : 'workspace')
193
+ : (canCreateWorkspace.value ? 'workspace' : 'personal');
194
+ createError.value = '';
195
+ createDraft.value = { name: '', checkable, planDate, scope };
196
+ await nextTick();
197
+ createNameInput.value?.focus();
198
+ }
199
+ function closeQuickCreate() {
200
+ if (createSaving.value) return;
201
+ createDraft.value = undefined;
202
+ createError.value = '';
203
+ }
204
+ async function submitQuickCreate() {
205
+ const draft = createDraft.value;
206
+ if (!draft || createSaving.value || !draft.name.trim() || typeof plans.create !== 'function') return;
207
+ createSaving.value = true;
208
+ createError.value = '';
209
+ try {
210
+ const properties = writePlanDate({ checkable: draft.checkable, completed: false }, draft.planDate);
211
+ await plans.create(
212
+ {
213
+ type: 'event',
214
+ name: draft.name.trim(),
215
+ description: '',
216
+ archived: false,
217
+ properties,
218
+ },
219
+ draft.scope,
220
+ plans.workspaceId,
221
+ );
222
+ createDraft.value = undefined;
223
+ } catch (reason) {
224
+ createError.value = String(reason);
225
+ } finally {
226
+ createSaving.value = false;
227
+ }
228
+ }
229
+
230
+ // --- Direct Manipulation: Timeline Slot Selection (Click / Drag-to-Create) ---
231
+ interface SlotSelection {
232
+ day: Date;
233
+ dayKey: string;
234
+ anchorY: number;
235
+ currentY: number;
236
+ column: HTMLElement;
237
+ }
238
+ const slotSelect = ref<SlotSelection>();
239
+ const slotPreview = computed(() => {
240
+ if (!slotSelect.value) return undefined;
241
+ const range = selectionRangeFromOffsets(slotSelect.value.anchorY, slotSelect.value.currentY, hourHeight);
242
+ return {
243
+ dayKey: slotSelect.value.dayKey,
244
+ top: (range.startMinutes / 60) * hourHeight,
245
+ height: Math.max(22, ((range.endMinutes - range.startMinutes) / 60) * hourHeight),
246
+ label: `${formatMinutesLabel(range.startMinutes)} – ${formatMinutesLabel(range.endMinutes)}`,
247
+ ...range,
248
+ };
249
+ });
250
+
251
+ function startSlotSelection(day: Date, event: PointerEvent) {
252
+ if (event.button !== 0 || !canCreate.value || event.target !== event.currentTarget || resizing.value) return;
253
+ const column = event.currentTarget as HTMLElement;
254
+ const rect = column.getBoundingClientRect();
255
+ const y = Math.max(0, Math.min(rect.height || 24 * hourHeight, event.clientY - rect.top));
256
+ slotSelect.value = { day, dayKey: localDayKey(day), anchorY: y, currentY: y, column };
257
+ window.addEventListener('pointermove', moveSlotSelection);
258
+ window.addEventListener('pointerup', endSlotSelection);
259
+ window.addEventListener('pointercancel', cancelSlotSelection);
260
+ }
261
+ function moveSlotSelection(event: PointerEvent) {
262
+ if (!slotSelect.value) return;
263
+ const rect = slotSelect.value.column.getBoundingClientRect();
264
+ slotSelect.value.currentY = Math.max(0, Math.min(rect.height || 24 * hourHeight, event.clientY - rect.top));
265
+ }
266
+ function cleanupSlotListeners() {
267
+ window.removeEventListener('pointermove', moveSlotSelection);
268
+ window.removeEventListener('pointerup', endSlotSelection);
269
+ window.removeEventListener('pointercancel', cancelSlotSelection);
270
+ }
271
+ function cancelSlotSelection() {
272
+ cleanupSlotListeners();
273
+ slotSelect.value = undefined;
274
+ }
275
+ function endSlotSelection() {
276
+ const current = slotSelect.value;
277
+ const preview = slotPreview.value;
278
+ cleanupSlotListeners();
279
+ slotSelect.value = undefined;
280
+ if (!current || !preview) return;
281
+ void openQuickCreate(planDateFromSlot(current.day, preview.startMinutes, preview.endMinutes), false);
282
+ }
283
+
284
+ // --- Direct Manipulation: Bottom-Edge Resize ---
285
+ interface ResizeState {
286
+ record: ObjectRecord;
287
+ key: string;
288
+ day: Date;
289
+ dayKey: string;
290
+ startY: number;
291
+ startMinutes: number;
292
+ initialEndMinutes: number;
293
+ previewEndMinutes: number;
294
+ }
295
+ const resizing = ref<ResizeState>();
296
+
297
+ function startResize(item: TimedEventBlock, day: Date, event: PointerEvent) {
298
+ if (event.button !== 0 || !canDragRecord(item.record) || item.point) return;
299
+ const dayStart = new Date(day.getFullYear(), day.getMonth(), day.getDate()).getTime();
300
+ const startMinutes = Math.max(0, Math.round((item.visibleStart - dayStart) / 60_000));
301
+ const initialEndMinutes = Math.max(startMinutes + MIN_DURATION_MINUTES, Math.round((item.visibleEnd - dayStart) / 60_000));
302
+ resizing.value = {
303
+ record: item.record,
304
+ key: planKey(item.record),
305
+ day,
306
+ dayKey: localDayKey(day),
307
+ startY: event.clientY,
308
+ startMinutes,
309
+ initialEndMinutes,
310
+ previewEndMinutes: initialEndMinutes,
311
+ };
312
+ window.addEventListener('pointermove', moveResize);
313
+ window.addEventListener('pointerup', endResize);
314
+ window.addEventListener('pointercancel', cancelResize);
315
+ }
316
+ function moveResize(event: PointerEvent) {
317
+ if (!resizing.value) return;
318
+ const deltaMinutes = ((event.clientY - resizing.value.startY) / hourHeight) * 60;
319
+ resizing.value.previewEndMinutes = Math.max(
320
+ resizing.value.startMinutes + MIN_DURATION_MINUTES,
321
+ Math.min(24 * 60, snapMinutes(resizing.value.initialEndMinutes + deltaMinutes)),
322
+ );
323
+ }
324
+ function cleanupResizeListeners() {
325
+ window.removeEventListener('pointermove', moveResize);
326
+ window.removeEventListener('pointerup', endResize);
327
+ window.removeEventListener('pointercancel', cancelResize);
328
+ }
329
+ function cancelResize() {
330
+ cleanupResizeListeners();
331
+ resizing.value = undefined;
332
+ }
333
+ function endResize() {
334
+ const state = resizing.value;
335
+ cleanupResizeListeners();
336
+ resizing.value = undefined;
337
+ if (!state || state.previewEndMinutes === state.initialEndMinutes) return;
338
+ const next = resizeRecordEnd(state.record.object, state.day, state.previewEndMinutes);
339
+ void updateRecordObject(state.record, next);
340
+ }
341
+
342
+ // --- Direct Manipulation: Drag Move & Sidebar Drop Timeblocking ---
343
+ const draggingKey = ref<string>();
344
+ const dropTarget = ref<{ zone: 'timeline' | 'day'; dayKey: string; minutes?: number }>();
345
+
346
+ function allEditablePool(): readonly ObjectRecord[] {
347
+ const fromStore = typeof plans.recordsFor === 'function' ? plans.recordsFor('all') : [];
348
+ if (fromStore.length) return fromStore;
349
+ return props.records ?? plans.records;
350
+ }
351
+ function resolveDraggedRecord(event: DragEvent): ObjectRecord | undefined {
352
+ const key = event.dataTransfer?.getData(PLAN_DRAG_MIME) || draggingKey.value;
353
+ if (!key) return undefined;
354
+ return allEditablePool().find((record) => planKey(record) === key);
42
355
  }
356
+ function hasPlanDrag(event: DragEvent) {
357
+ const types = event.dataTransfer?.types;
358
+ return Boolean(draggingKey.value || (types && [...types].includes(PLAN_DRAG_MIME)));
359
+ }
360
+ function onEventDragStart(record: ObjectRecord, event: DragEvent) {
361
+ if (!canDragRecord(record) || !event.dataTransfer) {
362
+ event.preventDefault();
363
+ return;
364
+ }
365
+ const key = planKey(record);
366
+ draggingKey.value = key;
367
+ event.dataTransfer.effectAllowed = 'move';
368
+ event.dataTransfer.setData(PLAN_DRAG_MIME, key);
369
+ event.dataTransfer.setData('text/plain', record.object.name);
370
+ }
371
+ function onEventDragEnd() {
372
+ draggingKey.value = undefined;
373
+ dropTarget.value = undefined;
374
+ }
375
+ function onTimelineDragOver(day: Date, event: DragEvent) {
376
+ if (!hasPlanDrag(event)) return;
377
+ event.preventDefault();
378
+ if (event.dataTransfer) event.dataTransfer.dropEffect = 'move';
379
+ const rect = (event.currentTarget as HTMLElement).getBoundingClientRect();
380
+ const minutes = minutesFromOffsetY(event.clientY - rect.top, hourHeight);
381
+ dropTarget.value = { zone: 'timeline', dayKey: localDayKey(day), minutes };
382
+ }
383
+ function onTimelineDrop(day: Date, event: DragEvent) {
384
+ const record = resolveDraggedRecord(event);
385
+ const rect = (event.currentTarget as HTMLElement).getBoundingClientRect();
386
+ const minutes = minutesFromOffsetY(event.clientY - rect.top, hourHeight);
387
+ draggingKey.value = undefined;
388
+ dropTarget.value = undefined;
389
+ if (!record || !canDragRecord(record)) return;
390
+ const next = moveRecordToSlot(record.object, day, minutes);
391
+ void updateRecordObject(record, next);
392
+ }
393
+ function onDayDragOver(day: Date, event: DragEvent) {
394
+ if (!hasPlanDrag(event)) return;
395
+ event.preventDefault();
396
+ if (event.dataTransfer) event.dataTransfer.dropEffect = 'move';
397
+ dropTarget.value = { zone: 'day', dayKey: localDayKey(day) };
398
+ }
399
+ function onDayDrop(day: Date, event: DragEvent) {
400
+ const record = resolveDraggedRecord(event);
401
+ draggingKey.value = undefined;
402
+ dropTarget.value = undefined;
403
+ if (!record || !canDragRecord(record)) return;
404
+ const next = moveRecordToDay(record.object, day);
405
+ void updateRecordObject(record, next);
406
+ }
407
+ function onDragLeave(event: DragEvent) {
408
+ const related = event.relatedTarget as Node | null;
409
+ if (!related || !(event.currentTarget as HTMLElement).contains(related)) {
410
+ dropTarget.value = undefined;
411
+ }
412
+ }
413
+
414
+ function itemClasses(record: ObjectRecord, kind?: CalendarDayEntry['kind']) {
415
+ const checkable = isCheckableEvent(record);
416
+ const completed = isEventCompleted(record);
417
+ const overdue = isEventOverdue(record, today.value);
418
+ return {
419
+ 'is-task': checkable,
420
+ 'is-schedule': !checkable,
421
+ 'is-completed': completed,
422
+ 'is-overdue': overdue,
423
+ 'is-due': kind === 'due',
424
+ 'is-timed': kind === 'timed',
425
+ 'is-personal': record.source?.scope === 'personal',
426
+ 'is-synced': !!record.object.properties.syncConnection,
427
+ 'is-draggable': kind !== 'due' && canDragRecord(record),
428
+ 'is-dragging': draggingKey.value === planKey(record),
429
+ };
430
+ }
431
+
43
432
  const timeline = computed(() => props.mode === 'day' || props.mode === 'four-days' || props.mode === 'week');
44
433
  const timelineDays = ref<Date[]>([]);
45
434
  const timelineDayWidth = ref(120);
@@ -55,13 +444,14 @@ const agendaDates = computed(() => {
55
444
  const month = props.date.getMonth();
56
445
  const length = new Date(year, month + 1, 0).getDate();
57
446
  return Array.from({ length }, (_, index) => new Date(year, month, index + 1))
58
- .filter(day => dayRecords(day).length > 0);
447
+ .filter((day) => dayEntries(day).length > 0);
59
448
  });
60
449
  const weekdays = computed(() => uiLocale.value === 'zh-CN' ? ['一', '二', '三', '四', '五', '六', '日']
61
450
  : Array.from({ length: 7 }, (_, index) => new Intl.DateTimeFormat(uiLocale.value, { weekday: 'short' }).format(new Date(2024, 0, 1 + index))));
62
451
  const hours = Array.from({ length: 24 }, (_, hour) => hour);
63
452
  const hourHeight = 56;
64
453
  const today = computed(() => localDayKey(new Date()));
454
+ const nowLineTop = computed(() => `${(nowMinutes.value / 60) * hourHeight}px`);
65
455
  const viewLabel = computed(() => ({
66
456
  day: t('日视图'), 'four-days': t('4 天视图'), week: t('周视图'),
67
457
  month: t('月视图'), year: t('年视图'), agenda: t('日程视图'),
@@ -192,11 +582,14 @@ function weekRow(date: Date) {
192
582
  .find(row => row.dataset.week === key);
193
583
  }
194
584
  async function scrollToWeek(date: Date) {
195
- const key = weekKey(weekDays(date)[0]!);
196
- if (!scrollingWeeks.value.some(week => weekKey(week) === key)) fillWeeks(date);
585
+ // Month navigation lands on the week holding the 1st, so the whole month is
586
+ // in view and the dominant-month check in onMonthScroll agrees with it.
587
+ const monthStart = new Date(date.getFullYear(), date.getMonth(), 1);
588
+ const key = weekKey(weekDays(monthStart)[0]!);
589
+ if (!scrollingWeeks.value.some(week => weekKey(week) === key)) fillWeeks(monthStart);
197
590
  await nextTick();
198
591
  const container = scroll.value;
199
- const row = weekRow(date);
592
+ const row = weekRow(monthStart);
200
593
  if (!container || !row) return;
201
594
  container.scrollTop += row.getBoundingClientRect().top - container.getBoundingClientRect().top - 40;
202
595
  }
@@ -224,12 +617,30 @@ async function extendWeeks(direction: -1 | 1) {
224
617
  function onMonthScroll() {
225
618
  const container = scroll.value;
226
619
  if (props.mode !== 'month' || !container || !scrollingWeeks.value.length || extendingWeeks) return;
227
- const marker = container.getBoundingClientRect().top + 45;
228
- const row = [...container.querySelectorAll<HTMLElement>('.calendar-month-week')]
229
- .find(element => element.getBoundingClientRect().bottom > marker);
230
- const visible = scrollingWeeks.value.find(week => weekKey(week) === row?.dataset.week);
231
- const visibleMonth = visible && weekDays(visible).some(day => monthKey(day) === monthKey(props.date))
232
- ? props.date : visible;
620
+ // The month in view is the one with the most on-screen day area. A week that
621
+ // straddles two months no longer decides it on its own.
622
+ const bounds = container.getBoundingClientRect();
623
+ const viewTop = bounds.top + (container.querySelector<HTMLElement>('.calendar-month-weekdays')?.offsetHeight ?? 0);
624
+ const area = new Map<string, { month: Date; size: number }>();
625
+ for (const row of container.querySelectorAll<HTMLElement>('.calendar-month-week')) {
626
+ const rect = row.getBoundingClientRect();
627
+ const size = Math.min(rect.bottom, bounds.bottom) - Math.max(rect.top, viewTop);
628
+ if (size <= 0) continue;
629
+ const week = scrollingWeeks.value.find(item => weekKey(item) === row.dataset.week);
630
+ if (!week) continue;
631
+ for (const day of weekDays(week)) {
632
+ const key = monthKey(day);
633
+ const entry = area.get(key) ?? { month: day, size: 0 };
634
+ entry.size += size;
635
+ area.set(key, entry);
636
+ }
637
+ }
638
+ // A little hysteresis keeps the label from flickering when two months
639
+ // share the screen almost evenly.
640
+ let visibleMonth: Date | undefined;
641
+ let best = (area.get(monthKey(props.date))?.size ?? 0) * 1.15;
642
+ for (const { month, size } of area.values())
643
+ if (size > best) { best = size; visibleMonth = month; }
233
644
  if (visibleMonth && monthKey(visibleMonth) !== monthKey(props.date)) {
234
645
  reportedMonthKey = monthKey(visibleMonth);
235
646
  emit('visible-month', new Date(visibleMonth.getFullYear(), visibleMonth.getMonth(), 1));
@@ -297,41 +708,71 @@ function onYearScroll() {
297
708
  function onCalendarScroll() {
298
709
  // Focusing a date can queue a scroll event before its click opens the panel.
299
710
  // Only dismiss for a scroll that actually moves the calendar after opening.
300
- if (yearDay.value && scroll.value && (
301
- yearDay.value.scrollTop !== scroll.value.scrollTop || yearDay.value.scrollLeft !== scroll.value.scrollLeft
302
- )) yearDay.value = undefined;
711
+ if (dayPopover.value && scroll.value && (
712
+ dayPopover.value.scrollTop !== scroll.value.scrollTop || dayPopover.value.scrollLeft !== scroll.value.scrollLeft
713
+ )) dayPopover.value = undefined;
303
714
  if (timeline.value) onTimelineScroll();
304
715
  else if (props.mode === 'month') onMonthScroll();
305
716
  else if (props.mode === 'year') onYearScroll();
306
717
  }
718
+
719
+ // Alternate months get a faint fill. Keep it clearly lighter than the sidebar
720
+ // (--sidebar) so the first column never reads as part of it.
307
721
  function monthShade(day: Date) {
308
722
  return (day.getFullYear() * 12 + day.getMonth()) % 2 === 1;
309
723
  }
310
724
 
311
- function dayRecords(day: Date) {
312
- return plannedEventsOnDay(planned.value, day);
725
+ function dayEntries(day: Date) {
726
+ return calendarDayEntries(planned.value, day);
727
+ }
728
+ function clockLabel(value: unknown) {
729
+ return new Date(String(value)).toLocaleTimeString(uiLocale.value, { hour: '2-digit', minute: '2-digit', hour12: false });
313
730
  }
314
731
  function timedEvents(day: Date) {
315
- const start = new Date(day.getFullYear(), day.getMonth(), day.getDate()).getTime();
316
- const end = new Date(day.getFullYear(), day.getMonth(), day.getDate() + 1).getTime();
317
- return eventsOnDay(events.value, day).filter(record => !record.object.properties.allDay).map((record) => {
318
- const from = Date.parse(String(record.object.properties.start));
319
- const to = Date.parse(String(record.object.properties.end));
320
- const visibleStart = Math.max(from, start);
321
- const visibleEnd = Math.min(Math.max(to, from + 30 * 60_000), end);
322
- const top = (visibleStart - start) / 3_600_000 * hourHeight;
323
- const point = from === to;
324
- const height = point ? 24 : Math.max(22, (visibleEnd - visibleStart) / 3_600_000 * hourHeight);
325
- return { record, top, height, point, time: eventTime(record) };
732
+ return layoutDayTimedEvents(events.value, day, hourHeight).map((block) => {
733
+ const { start, end } = block.record.object.properties;
734
+ const time = entryTime({ record: block.record, kind: 'timed' });
735
+ return {
736
+ ...block,
737
+ time: block.point || !end || Date.parse(String(end)) === Date.parse(String(start))
738
+ ? time
739
+ : `${time} – ${clockLabel(end)}`,
740
+ // Short blocks put the time beside the title instead of below it.
741
+ compact: !block.point && block.height < 44,
742
+ };
326
743
  });
327
744
  }
328
- function eventTime(record: ObjectRecord) {
745
+ function timedEventStyle(item: TimedEventBlock, day: Date) {
746
+ const widthPct = 100 / item.columnCount;
747
+ const leftPct = item.column * widthPct;
748
+ let height = item.height;
749
+ if (resizing.value && resizing.value.key === planKey(item.record) && resizing.value.dayKey === localDayKey(day)) {
750
+ height = Math.max(22, ((resizing.value.previewEndMinutes - resizing.value.startMinutes) / 60) * hourHeight);
751
+ }
752
+ return {
753
+ top: `${item.top}px`,
754
+ height: `${height}px`,
755
+ left: `calc(${leftPct}% + 2px)`,
756
+ width: `calc(${widthPct}% - 4px)`,
757
+ };
758
+ }
759
+ function entryTime(entry: CalendarDayEntry) {
760
+ if (entry.kind === 'due') return t('截止');
761
+ const { record } = entry;
329
762
  if (record.object.properties.allDay === true) return t('全天');
330
763
  if (!hasEventTime(record)) return t('仅日期');
331
764
  return new Date(String(record.object.properties.start)).toLocaleTimeString(uiLocale.value, {
332
765
  hour: '2-digit', minute: '2-digit', hour12: false,
333
766
  });
334
767
  }
768
+ function entryTooltip(entry: CalendarDayEntry, time = entryTime(entry)) {
769
+ const suffix = isEventOverdue(entry.record, today.value)
770
+ ? ` · ${t('逾期')}`
771
+ : isEventCompleted(entry.record)
772
+ ? t(' · 已完成')
773
+ : '';
774
+ return `${entry.record.object.name} · ${time} · ${planSourceLabel(entry.record)}${suffix}`;
775
+ }
335
776
  function weekday(day: Date) {
336
777
  return weekdays.value[(day.getDay() + 6) % 7];
337
778
  }
@@ -355,18 +796,24 @@ async function positionTimeline() {
355
796
  }
356
797
  onMounted(() => {
357
798
  void positionTimeline();
799
+ nowTimer = setInterval(() => { nowMinutes.value = currentMinutes(); }, 60_000);
358
800
  if (scroll.value && typeof ResizeObserver !== 'undefined') {
359
801
  timelineResizeObserver = new ResizeObserver(() => { void resizeTimeline(); });
360
802
  timelineResizeObserver.observe(scroll.value);
361
803
  }
362
804
  });
363
- onUnmounted(() => timelineResizeObserver?.disconnect());
805
+ onUnmounted(() => {
806
+ if (nowTimer) clearInterval(nowTimer);
807
+ cleanupSlotListeners();
808
+ cleanupResizeListeners();
809
+ timelineResizeObserver?.disconnect();
810
+ });
364
811
  watch(() => props.mode, () => {
365
- yearDay.value = undefined;
812
+ dayPopover.value = undefined;
366
813
  void positionTimeline();
367
814
  });
368
815
  watch(() => props.date, (date) => {
369
- yearDay.value = undefined;
816
+ dayPopover.value = undefined;
370
817
  if (props.mode === 'month') {
371
818
  if (reportedMonthKey === monthKey(date)) {
372
819
  reportedMonthKey = '';
@@ -392,175 +839,612 @@ watch(() => props.date, (date) => {
392
839
  </script>
393
840
 
394
841
  <template>
395
- <main
396
- ref="scroll"
397
- class="calendar-view"
398
- :class="{ 'calendar-view-timeline': timeline, 'calendar-view-month': mode === 'month', 'calendar-view-year': mode === 'year' }"
399
- :aria-label="t('日历{0}', [viewLabel])"
400
- @scroll.passive="onCalendarScroll"
401
- @wheel="onCalendarWheel"
402
- >
403
- <LoadingSkeleton v-if="loading" variant="document" :rows="6" />
404
- <div v-show="!loading" class="component-loading-content">
405
- <div
406
- v-if="timeline"
407
- class="calendar-view-inner"
408
- :style="{
409
- '--calendar-day-count': timelineDays.length,
410
- '--calendar-day-width': `${timelineDayWidth}px`,
411
- width: `${64 + timelineDays.length * timelineDayWidth}px`,
412
- }"
842
+ <div class="calendar-shell">
843
+ <div class="calendar-filter-bar" role="region" :aria-label="t('日历筛选')">
844
+ <div class="calendar-filter-kinds" role="group" :aria-label="t('筛选')">
845
+ <button
846
+ v-for="option in ([
847
+ { value: 'all', label: t('全部') },
848
+ { value: 'task', label: t('任务') },
849
+ { value: 'event', label: t('日程') },
850
+ ] as const)"
851
+ :key="option.value"
852
+ type="button"
853
+ :aria-pressed="filter.kind === option.value"
854
+ @click="filter.kind = option.value"
855
+ >{{ option.label }}</button>
856
+ </div>
857
+ <label class="calendar-filter-completed">
858
+ <input v-model="filter.showCompleted" type="checkbox" />
859
+ <span>{{ t('显示已完成') }}</span>
860
+ </label>
861
+ <label class="calendar-filter-search">
862
+ <Search :size="13" aria-hidden="true" />
863
+ <input
864
+ v-model="filter.query"
865
+ type="search"
866
+ :aria-label="t('搜索事项…')"
867
+ :placeholder="t('搜索事项…')"
868
+ maxlength="100"
869
+ />
870
+ </label>
871
+ </div>
872
+ <p v-if="interactionError" class="calendar-error-banner" role="alert">
873
+ <span>{{ interactionError }}</span>
874
+ <button type="button" :aria-label="t('关闭')" @click="interactionError = ''"><X :size="14" /></button>
875
+ </p>
876
+ <main
877
+ ref="scroll"
878
+ class="calendar-view"
879
+ :class="{ 'calendar-view-timeline': timeline, 'calendar-view-month': mode === 'month', 'calendar-view-year': mode === 'year' }"
880
+ :aria-label="t('日历{0}', [viewLabel])"
881
+ @scroll.passive="onCalendarScroll"
882
+ @wheel="onCalendarWheel"
413
883
  >
414
- <div class="calendar-view-days">
415
- <span class="calendar-view-zone">GMT{{ -new Date().getTimezoneOffset() / 60 >= 0 ? '+' : '' }}{{ -new Date().getTimezoneOffset() / 60 }}</span>
884
+ <LoadingSkeleton v-if="loading" variant="document" :rows="6" />
885
+ <div v-show="!loading" class="component-loading-content">
886
+ <div
887
+ v-if="timeline"
888
+ class="calendar-view-inner"
889
+ :style="{
890
+ '--calendar-day-count': timelineDays.length,
891
+ '--calendar-day-width': `${timelineDayWidth}px`,
892
+ width: `${64 + timelineDays.length * timelineDayWidth}px`,
893
+ }"
894
+ >
416
895
  <div
417
- v-for="day in timelineDays"
418
- :key="localDayKey(day)"
419
- class="calendar-view-day-heading"
420
- :class="{ today: localDayKey(day) === today }"
896
+ class="calendar-view-days"
897
+ :class="{ 'has-banner': hasVisibleBanner || draggingKey }"
898
+ :style="{ '--calendar-banner-height': `${bannerRowHeight}px` }"
421
899
  >
422
- <span>{{ uiLocale === 'zh-CN' ? t('周') : '' }}{{ weekday(day) }}</span>
423
- <strong>{{ day.getDate() }}</strong>
424
- </div>
425
- <template v-if="hasVisibleDateOnly">
426
- <span class="calendar-view-date-label">{{ t('全天') }}</span>
427
- <div v-for="day in timelineDays" :key="`date-${localDayKey(day)}`" class="calendar-view-date-events">
428
- <button
429
- v-for="record in dateOnlyEvents(day)"
430
- :key="planKey(record)"
431
- type="button"
432
- class="calendar-view-date-event"
433
- :data-tooltip="`${planSourceLabel(record)} · ${record.object.name} · ${eventTime(record)}`"
434
- @click="emit('select-event', planKey(record))"
435
- >{{ record.object.name }}</button>
900
+ <span class="calendar-view-zone">GMT{{ -new Date().getTimezoneOffset() / 60 >= 0 ? '+' : '' }}{{ -new Date().getTimezoneOffset() / 60 }}</span>
901
+ <div
902
+ v-for="day in timelineDays"
903
+ :key="localDayKey(day)"
904
+ class="calendar-view-day-heading"
905
+ :class="{ today: localDayKey(day) === today }"
906
+ >
907
+ <span>{{ uiLocale === 'zh-CN' ? t('周') : '' }}{{ weekday(day) }}</span>
908
+ <strong>{{ day.getDate() }}</strong>
436
909
  </div>
437
- </template>
438
- </div>
439
- <div class="calendar-view-grid">
440
- <div class="calendar-view-hours" aria-hidden="true">
441
- <span v-for="hour in hours" :key="hour" :style="{ top: `${hour * hourHeight}px` }">{{ String(hour).padStart(2, '0') }}:00</span>
910
+ <template v-if="hasVisibleBanner || draggingKey">
911
+ <span class="calendar-view-date-label">{{ t('全天') }}</span>
912
+ <div
913
+ v-for="day in timelineDays"
914
+ :key="`date-${localDayKey(day)}`"
915
+ class="calendar-view-date-events"
916
+ :class="{ 'is-drop-target': dropTarget?.zone === 'day' && dropTarget.dayKey === localDayKey(day) }"
917
+ :data-day="localDayKey(day)"
918
+ @dragover="onDayDragOver(day, $event)"
919
+ @dragleave="onDragLeave"
920
+ @drop.prevent="onDayDrop(day, $event)"
921
+ >
922
+ <div
923
+ v-for="entry in bannerEntries(day)"
924
+ :key="`${planKey(entry.record)}:${entry.kind}`"
925
+ class="calendar-view-date-event"
926
+ :class="itemClasses(entry.record, entry.kind)"
927
+ :draggable="entry.kind !== 'due' && canDragRecord(entry.record)"
928
+ :data-tooltip="entryTooltip(entry)"
929
+ @dragstart="onEventDragStart(entry.record, $event)"
930
+ @dragend="onEventDragEnd"
931
+ >
932
+ <button
933
+ v-if="isCheckableEvent(entry.record)"
934
+ type="button"
935
+ class="calendar-inline-check"
936
+ :aria-label="`${isEventCompleted(entry.record) ? t('标记未完成') : t('完成')}:${entry.record.object.name}`"
937
+ :disabled="!canToggleComplete(entry.record)"
938
+ @click.stop="toggleComplete(entry.record)"
939
+ >
940
+ <CircleCheck v-if="isEventCompleted(entry.record)" :size="12" aria-hidden="true" />
941
+ <Circle v-else :size="12" aria-hidden="true" />
942
+ </button>
943
+ <Flag v-if="entry.kind === 'due'" :size="11" class="calendar-due-flag" aria-hidden="true" />
944
+ <button
945
+ type="button"
946
+ class="calendar-item-trigger"
947
+ @click="emit('select-event', sourcePlanKey(entry.record))"
948
+ >{{ entry.record.object.name }}</button>
949
+ </div>
950
+ </div>
951
+ </template>
442
952
  </div>
443
- <div v-for="day in timelineDays" :key="localDayKey(day)" class="calendar-view-day-column">
444
- <button
445
- v-for="item in timedEvents(day)"
446
- :key="planKey(item.record)"
447
- type="button"
448
- class="calendar-view-event"
449
- :class="{ 'calendar-view-point': item.point }"
450
- :style="{ top: `${item.top}px`, height: `${item.height}px` }"
451
- :data-tooltip="`${planSourceLabel(item.record)} · ${item.record.object.name} · ${item.time}`"
452
- @click="emit('select-event', planKey(item.record))"
953
+ <div class="calendar-view-grid">
954
+ <div class="calendar-view-hours" aria-hidden="true">
955
+ <span v-for="hour in hours" :key="hour" :style="{ top: `${hour * hourHeight}px` }">{{ String(hour).padStart(2, '0') }}:00</span>
956
+ </div>
957
+ <div
958
+ v-for="day in timelineDays"
959
+ :key="localDayKey(day)"
960
+ class="calendar-view-day-column"
961
+ :class="{ 'is-creatable': canCreate, 'is-today': localDayKey(day) === today }"
962
+ :data-day="localDayKey(day)"
963
+ @pointerdown="startSlotSelection(day, $event)"
964
+ @dragover="onTimelineDragOver(day, $event)"
965
+ @dragleave="onDragLeave"
966
+ @drop.prevent="onTimelineDrop(day, $event)"
453
967
  >
454
- <strong>{{ item.record.object.name }}</strong>
455
- <span>{{ planSourceLabel(item.record) }} · {{ item.time }}</span>
456
- </button>
968
+ <div v-if="localDayKey(day) === today" class="calendar-now-line" :style="{ top: nowLineTop }" aria-hidden="true" />
969
+ <div
970
+ v-if="slotPreview && slotPreview.dayKey === localDayKey(day)"
971
+ class="calendar-slot-preview"
972
+ :style="{ top: `${slotPreview.top}px`, height: `${slotPreview.height}px` }"
973
+ aria-hidden="true"
974
+ >{{ slotPreview.label }}</div>
975
+ <div
976
+ v-if="dropTarget?.zone === 'timeline' && dropTarget.dayKey === localDayKey(day) && dropTarget.minutes !== undefined"
977
+ class="calendar-drop-indicator"
978
+ :style="{ top: `${(dropTarget.minutes / 60) * hourHeight}px` }"
979
+ aria-hidden="true"
980
+ ><span>{{ formatMinutesLabel(dropTarget.minutes) }}</span></div>
981
+ <div
982
+ v-for="item in timedEvents(day)"
983
+ :key="planKey(item.record)"
984
+ class="calendar-view-event"
985
+ :class="[
986
+ { 'calendar-view-point': item.point, 'is-compact': item.compact, 'is-resizing': resizing?.key === planKey(item.record) },
987
+ itemClasses(item.record, 'timed'),
988
+ ]"
989
+ :style="timedEventStyle(item, day)"
990
+ :draggable="canDragRecord(item.record) && !resizing"
991
+ :data-tooltip="entryTooltip({ record: item.record, kind: 'timed' }, item.time)"
992
+ @dragstart="onEventDragStart(item.record, $event)"
993
+ @dragend="onEventDragEnd"
994
+ >
995
+ <button
996
+ v-if="isCheckableEvent(item.record)"
997
+ type="button"
998
+ class="calendar-inline-check"
999
+ :aria-label="`${isEventCompleted(item.record) ? t('标记未完成') : t('完成')}:${item.record.object.name}`"
1000
+ :disabled="!canToggleComplete(item.record)"
1001
+ @click.stop="toggleComplete(item.record)"
1002
+ >
1003
+ <CircleCheck v-if="isEventCompleted(item.record)" :size="12" aria-hidden="true" />
1004
+ <Circle v-else :size="12" aria-hidden="true" />
1005
+ </button>
1006
+ <button
1007
+ type="button"
1008
+ class="calendar-view-event-body"
1009
+ @click="emit('select-event', sourcePlanKey(item.record))"
1010
+ >
1011
+ <strong>{{ item.record.object.name }}</strong>
1012
+ <span>{{ item.time }}</span>
1013
+ </button>
1014
+ <div
1015
+ v-if="!item.point && canDragRecord(item.record)"
1016
+ class="calendar-event-resize-handle"
1017
+ role="separator"
1018
+ :aria-label="t('调整时长')"
1019
+ @pointerdown.stop.prevent="startResize(item, day, $event)"
1020
+ />
1021
+ </div>
1022
+ </div>
457
1023
  </div>
458
1024
  </div>
459
- </div>
460
1025
 
461
- <div v-else-if="mode === 'month'" class="calendar-month-view">
462
- <div class="calendar-month-weekdays" aria-hidden="true">
463
- <span v-for="name in weekdays" :key="name">{{ uiLocale === 'zh-CN' ? t('周') : '' }}{{ name }}</span>
464
- </div>
465
- <div
466
- v-for="week in scrollingWeeks"
467
- :key="weekKey(week)"
468
- class="calendar-month-week"
469
- :data-week="weekKey(week)"
470
- >
1026
+ <div v-else-if="mode === 'month'" class="calendar-month-view">
1027
+ <div class="calendar-month-weekdays" aria-hidden="true">
1028
+ <span v-for="name in weekdays" :key="name">{{ uiLocale === 'zh-CN' ? t('周') : '' }}{{ name }}</span>
1029
+ </div>
471
1030
  <div
472
- v-for="day in weekDays(week)"
473
- :key="localDayKey(day)"
474
- class="calendar-month-cell"
475
- :class="{ shaded: monthShade(day) }"
1031
+ v-for="week in scrollingWeeks"
1032
+ :key="weekKey(week)"
1033
+ class="calendar-month-week"
1034
+ :data-week="weekKey(week)"
476
1035
  >
477
- <button
478
- type="button"
479
- class="calendar-month-date"
480
- :class="{ today: localDayKey(day) === today, 'month-start': day.getDate() === 1 }"
481
- :aria-label="t('{0},查看日视图', [localDayKey(day)])"
482
- @click="emit('select-date', day)"
483
- >{{ day.getDate() === 1 ? t('{0} 月 1 日', [day.getMonth() + 1]) : day.getDate() }}</button>
484
- <button
485
- v-for="record in dayRecords(day).slice(0, 3)"
486
- :key="planKey(record)"
487
- type="button"
488
- class="calendar-month-event"
489
- :data-tooltip="`${planSourceLabel(record)} · ${record.object.name} · ${eventTime(record)}`"
490
- @click="emit('select-event', planKey(record))"
491
- >{{ planSourceLabel(record) }} · {{ eventTime(record) }} {{ record.object.name }}</button>
492
- <span v-if="dayRecords(day).length > 3" class="calendar-month-more">{{ t('另有 {0} 项', [dayRecords(day).length - 3]) }}</span>
493
- </div>
494
- </div>
495
- </div>
496
-
497
- <div v-else-if="mode === 'year'" class="calendar-year-view">
498
- <section v-for="year in scrollingYears" :key="year" class="calendar-year-section" :data-year="year">
499
- <h2 class="calendar-year-heading">{{ new Date(year, 0, 1).toLocaleDateString(uiLocale, { year: 'numeric' }) }}</h2>
500
- <div class="calendar-year-grid">
501
- <section v-for="month in monthsForYear(year)" :key="month.date.getMonth()" class="calendar-year-month">
502
- <button type="button" class="calendar-year-month-title" @click="emit('select-month', month.date)">
503
- {{ month.date.toLocaleDateString(uiLocale, { month: 'long' }) }}
504
- </button>
505
- <div class="calendar-year-weekdays" aria-hidden="true">
506
- <span v-for="name in weekdays" :key="name">{{ name }}</span>
1036
+ <div
1037
+ v-for="day in weekDays(week)"
1038
+ :key="localDayKey(day)"
1039
+ class="calendar-month-cell"
1040
+ :class="{
1041
+ shaded: monthShade(day),
1042
+ 'is-drop-target': dropTarget?.zone === 'day' && dropTarget.dayKey === localDayKey(day),
1043
+ }"
1044
+ :data-day="localDayKey(day)"
1045
+ @dblclick.self="openQuickCreate({ date: localDayKey(day), time: '', end: '' }, false)"
1046
+ @dragover="onDayDragOver(day, $event)"
1047
+ @dragleave="onDragLeave"
1048
+ @drop.prevent="onDayDrop(day, $event)"
1049
+ >
1050
+ <div class="calendar-month-cell-header">
1051
+ <button
1052
+ v-if="canCreate"
1053
+ type="button"
1054
+ class="calendar-month-add"
1055
+ :aria-label="t('为 {0} 添加事件', [localDayKey(day)])"
1056
+ @click.stop="openQuickCreate({ date: localDayKey(day), time: '', end: '' }, false)"
1057
+ ><Plus :size="12" aria-hidden="true" /></button>
1058
+ <button
1059
+ type="button"
1060
+ class="calendar-month-date"
1061
+ :class="{ today: localDayKey(day) === today, 'month-start': day.getDate() === 1 }"
1062
+ :aria-label="t('{0},查看日视图', [localDayKey(day)])"
1063
+ @click="emit('select-date', day)"
1064
+ >{{ day.getDate() === 1 ? t('{0} 月 1 日', [day.getMonth() + 1]) : day.getDate() }}</button>
507
1065
  </div>
508
- <div class="calendar-year-days">
509
- <template v-for="day in month.days" :key="localDayKey(day)">
510
- <span v-if="day.getMonth() !== month.date.getMonth()" aria-hidden="true" />
511
- <button
512
- v-else
513
- type="button"
514
- :class="{ today: localDayKey(day) === today, selected: localDayKey(day) === yearDayKey }"
515
- :aria-label="t('{0},{1} 个事件', [localDayKey(day), yearDayRecords(day).length])"
516
- aria-haspopup="dialog"
517
- :aria-expanded="localDayKey(day) === yearDayKey"
518
- :aria-controls="localDayKey(day) === yearDayKey ? dayPopoverId : undefined"
519
- @click="openYearDay(day, $event)"
520
- >
521
- <span class="calendar-year-date">{{ day.getDate() }}</span>
522
- <i v-if="yearDayRecords(day).length" class="calendar-year-event-dot" aria-hidden="true" />
523
- </button>
524
- </template>
1066
+ <div
1067
+ v-for="entry in dayEntries(day).slice(0, 3)"
1068
+ :key="`${planKey(entry.record)}:${entry.kind}`"
1069
+ class="calendar-month-event"
1070
+ :class="itemClasses(entry.record, entry.kind)"
1071
+ :draggable="entry.kind !== 'due' && canDragRecord(entry.record)"
1072
+ :data-tooltip="entryTooltip(entry)"
1073
+ @dragstart="onEventDragStart(entry.record, $event)"
1074
+ @dragend="onEventDragEnd"
1075
+ >
1076
+ <button
1077
+ v-if="isCheckableEvent(entry.record)"
1078
+ type="button"
1079
+ class="calendar-inline-check"
1080
+ :aria-label="`${isEventCompleted(entry.record) ? t('标记未完成') : t('完成')}:${entry.record.object.name}`"
1081
+ :disabled="!canToggleComplete(entry.record)"
1082
+ @click.stop="toggleComplete(entry.record)"
1083
+ >
1084
+ <CircleCheck v-if="isEventCompleted(entry.record)" :size="11" aria-hidden="true" />
1085
+ <Circle v-else :size="11" aria-hidden="true" />
1086
+ </button>
1087
+ <Flag v-if="entry.kind === 'due'" :size="10" class="calendar-due-flag" aria-hidden="true" />
1088
+ <button
1089
+ type="button"
1090
+ class="calendar-item-trigger"
1091
+ @click="emit('select-event', sourcePlanKey(entry.record))"
1092
+ ><time v-if="entry.kind === 'timed'" class="calendar-item-time">{{ entryTime(entry) }}</time>{{ entry.record.object.name }}</button>
525
1093
  </div>
526
- </section>
1094
+ <button
1095
+ v-if="dayEntries(day).length > 3"
1096
+ type="button"
1097
+ class="calendar-month-more"
1098
+ aria-haspopup="dialog"
1099
+ :aria-expanded="localDayKey(day) === dayPopoverKey"
1100
+ :aria-controls="localDayKey(day) === dayPopoverKey ? dayPopoverId : undefined"
1101
+ @click="openDayPopover(day, $event)"
1102
+ >{{ t('另有 {0} 项', [dayEntries(day).length - 3]) }}</button>
1103
+ </div>
527
1104
  </div>
528
- </section>
529
- </div>
1105
+ </div>
530
1106
 
531
- <div v-else class="calendar-agenda-view">
532
- <p v-if="!agendaDates.length" class="calendar-agenda-empty">{{ t('本月没有日程') }}</p>
533
- <section v-for="day in agendaDates" :key="localDayKey(day)" class="calendar-agenda-day">
534
- <time class="calendar-agenda-date" :datetime="localDayKey(day)">
535
- {{ day.toLocaleDateString(uiLocale, { month: 'short', day: 'numeric' }) }}
536
- </time>
537
- <div class="calendar-agenda-events">
538
- <button
539
- v-for="record in dayRecords(day)"
540
- :key="planKey(record)"
541
- type="button"
542
- @click="emit('select-event', planKey(record))"
1107
+ <div v-else-if="mode === 'year'" class="calendar-year-view">
1108
+ <section v-for="year in scrollingYears" :key="year" class="calendar-year-section" :data-year="year">
1109
+ <h2 class="calendar-year-heading">{{ new Date(year, 0, 1).toLocaleDateString(uiLocale, { year: 'numeric' }) }}</h2>
1110
+ <div class="calendar-year-grid">
1111
+ <section v-for="month in monthsForYear(year)" :key="month.date.getMonth()" class="calendar-year-month">
1112
+ <button type="button" class="calendar-year-month-title" @click="emit('select-month', month.date)">
1113
+ {{ month.date.toLocaleDateString(uiLocale, { month: 'long' }) }}
1114
+ </button>
1115
+ <div class="calendar-year-weekdays" aria-hidden="true">
1116
+ <span v-for="name in weekdays" :key="name">{{ name }}</span>
1117
+ </div>
1118
+ <div class="calendar-year-days">
1119
+ <template v-for="day in month.days" :key="localDayKey(day)">
1120
+ <span v-if="day.getMonth() !== month.date.getMonth()" aria-hidden="true" />
1121
+ <button
1122
+ v-else
1123
+ type="button"
1124
+ :class="{ today: localDayKey(day) === today, selected: localDayKey(day) === dayPopoverKey }"
1125
+ :aria-label="t('{0},{1} 个事件', [localDayKey(day), dayPopoverEntries(day).length])"
1126
+ aria-haspopup="dialog"
1127
+ :aria-expanded="localDayKey(day) === dayPopoverKey"
1128
+ :aria-controls="localDayKey(day) === dayPopoverKey ? dayPopoverId : undefined"
1129
+ @click="openDayPopover(day, $event)"
1130
+ >
1131
+ <span class="calendar-year-date">{{ day.getDate() }}</span>
1132
+ <i v-if="dayPopoverEntries(day).length" class="calendar-year-event-dot" aria-hidden="true" />
1133
+ </button>
1134
+ </template>
1135
+ </div>
1136
+ </section>
1137
+ </div>
1138
+ </section>
1139
+ </div>
1140
+
1141
+ <div v-else class="calendar-agenda-view">
1142
+ <p v-if="!agendaDates.length" class="calendar-agenda-empty">{{ t('本月没有日程') }}</p>
1143
+ <section v-for="day in agendaDates" :key="localDayKey(day)" class="calendar-agenda-day">
1144
+ <time
1145
+ class="calendar-agenda-date"
1146
+ :class="{ today: localDayKey(day) === today }"
1147
+ :datetime="localDayKey(day)"
1148
+ :aria-label="day.toLocaleDateString(uiLocale, { month: 'short', day: 'numeric', weekday: 'long' })"
543
1149
  >
544
- <time>{{ eventTime(record) }}</time>
545
- <span>{{ record.object.name }} <small>{{ planSourceLabel(record) }}</small></span>
546
- </button>
547
- </div>
1150
+ <strong>{{ day.getDate() }}</strong>
1151
+ <span>{{ day.toLocaleDateString(uiLocale, { month: 'short' }) }} · {{ uiLocale === 'zh-CN' ? t('周') : '' }}{{ weekday(day) }}</span>
1152
+ </time>
1153
+ <div class="calendar-agenda-events">
1154
+ <div
1155
+ v-for="entry in dayEntries(day)"
1156
+ :key="`${planKey(entry.record)}:${entry.kind}`"
1157
+ class="calendar-agenda-row"
1158
+ :class="itemClasses(entry.record, entry.kind)"
1159
+ >
1160
+ <button
1161
+ v-if="isCheckableEvent(entry.record)"
1162
+ type="button"
1163
+ class="calendar-inline-check"
1164
+ :aria-label="`${isEventCompleted(entry.record) ? t('标记未完成') : t('完成')}:${entry.record.object.name}`"
1165
+ :disabled="!canToggleComplete(entry.record)"
1166
+ @click.stop="toggleComplete(entry.record)"
1167
+ >
1168
+ <CircleCheck v-if="isEventCompleted(entry.record)" :size="15" aria-hidden="true" />
1169
+ <Circle v-else :size="15" aria-hidden="true" />
1170
+ </button>
1171
+ <span v-else class="calendar-agenda-marker" aria-hidden="true" />
1172
+ <button
1173
+ type="button"
1174
+ class="calendar-agenda-item"
1175
+ @click="emit('select-event', sourcePlanKey(entry.record))"
1176
+ >
1177
+ <time>{{ entryTime(entry) }}</time>
1178
+ <span>
1179
+ <Flag v-if="entry.kind === 'due'" :size="12" class="calendar-due-flag" aria-hidden="true" />
1180
+ {{ entry.record.object.name }}
1181
+ <small>{{ planSourceLabel(entry.record) }}<template v-if="isEventOverdue(entry.record, today)"> · {{ t('逾期') }}</template></small>
1182
+ </span>
1183
+ </button>
1184
+ </div>
1185
+ </div>
1186
+ </section>
1187
+ </div>
1188
+ </div>
1189
+ </main>
1190
+ </div>
1191
+ <Teleport :to="document.body">
1192
+ <div
1193
+ v-if="createDraft"
1194
+ v-surface-motion="'CalendarView:create'"
1195
+ class="calendar-create-backdrop"
1196
+ @mousedown.self="closeQuickCreate"
1197
+ >
1198
+ <section
1199
+ class="calendar-create-dialog"
1200
+ role="dialog"
1201
+ aria-modal="true"
1202
+ :aria-label="t('新建事件')"
1203
+ @keydown.esc.stop.prevent="closeQuickCreate"
1204
+ >
1205
+ <header>
1206
+ <h2>{{ t('新建事件') }}</h2>
1207
+ <button type="button" class="calendar-create-close" :aria-label="t('关闭')" :disabled="createSaving" @click="closeQuickCreate"><X :size="16" /></button>
1208
+ </header>
1209
+ <form @submit.prevent="submitQuickCreate">
1210
+ <input
1211
+ ref="createNameInput"
1212
+ v-model="createDraft.name"
1213
+ class="calendar-create-title"
1214
+ :aria-label="t('事件名称')"
1215
+ :placeholder="t('记下一件事…')"
1216
+ autocomplete="off"
1217
+ required
1218
+ maxlength="200"
1219
+ :disabled="createSaving"
1220
+ />
1221
+ <div class="calendar-create-properties">
1222
+ <div class="calendar-create-row calendar-create-time">
1223
+ <span class="calendar-create-label"><CalendarDays :size="15" aria-hidden="true" />{{ t('时间安排') }}</span>
1224
+ <PlanDateField
1225
+ v-model="createDraft.planDate"
1226
+ :default-date="localDayKey(date)"
1227
+ :required="!createDraft.checkable"
1228
+ :disabled="createSaving"
1229
+ compact
1230
+ />
1231
+ </div>
1232
+ <div class="calendar-create-row">
1233
+ <span class="calendar-create-label"><ListTodo :size="15" aria-hidden="true" />{{ t('类型') }}</span>
1234
+ <label class="calendar-create-checkable">
1235
+ <input v-model="createDraft.checkable" type="checkbox" :disabled="createSaving" />
1236
+ <span>{{ t('需要完成') }}</span>
1237
+ </label>
1238
+ </div>
1239
+ <div class="calendar-create-row">
1240
+ <label class="calendar-create-label" :for="createScopeId"><FolderOpen :size="15" aria-hidden="true" />{{ t('保存到') }}</label>
1241
+ <select :id="createScopeId" v-model="createDraft.scope" class="calendar-create-scope" :disabled="createSaving">
1242
+ <option value="workspace" :disabled="!canCreateWorkspace">{{ t('工作区') }}</option>
1243
+ <option value="personal" :disabled="!canCreatePersonal">{{ t('个人') }}</option>
1244
+ </select>
1245
+ </div>
1246
+ </div>
1247
+ <p v-if="createError" class="calendar-create-error" role="alert">{{ createError }}</p>
1248
+ <footer>
1249
+ <button type="button" :disabled="createSaving" @click="closeQuickCreate">{{ t('取消') }}</button>
1250
+ <button type="submit" class="calendar-create-submit" :disabled="createSaving || !createDraft.name.trim()">
1251
+ {{ createSaving ? t('保存中…') : t('创建') }}
1252
+ </button>
1253
+ </footer>
1254
+ </form>
548
1255
  </section>
549
1256
  </div>
550
- </div>
551
- </main>
1257
+ </Teleport>
552
1258
  <CalendarDayPopover
553
- v-if="mode === 'year' && yearDay"
1259
+ v-if="(mode === 'year' || mode === 'month') && dayPopover"
554
1260
  :id="dayPopoverId"
555
- :date="yearDay.date"
556
- :anchor="yearDay.anchor"
557
- :records="yearDayRecords(yearDay.date)"
558
- @close="yearDay = undefined"
1261
+ :date="dayPopover.date"
1262
+ :anchor="dayPopover.anchor"
1263
+ :records="dayPopoverEntries(dayPopover.date).map(entry => entry.record)"
1264
+ :entries="dayPopoverEntries(dayPopover.date)"
1265
+ :can-edit="canEditRecord"
1266
+ :pending="pending"
1267
+ @close="dayPopover = undefined"
559
1268
  @select-event="emit('select-event', $event)"
1269
+ @toggle-complete="toggleComplete"
560
1270
  />
561
1271
  </template>
562
1272
 
563
1273
  <style scoped>
1274
+ /* ---- Calendar palette -----------------------------------------------------
1275
+ Items read their colour from --tone: workspace items use the product ink,
1276
+ personal items a quiet blue, deadlines amber, overdue the danger colour.
1277
+ Fills and seams are mixed from the tone so every theme stays consistent. */
1278
+ .calendar-shell {
1279
+ --cal-ink: var(--text);
1280
+ --cal-personal: #3d6cc9;
1281
+ --cal-due: #b7791f;
1282
+ --cal-overdue: var(--danger, #c24141);
1283
+ --cal-radius: 6px;
1284
+ --cal-today: color-mix(in srgb, var(--text) 2.5%, transparent);
1285
+ --cal-lift: 0 1px 2px rgb(15 15 15 / 0.06), 0 6px 16px -6px rgb(15 15 15 / 0.18);
1286
+ display: flex;
1287
+ flex-direction: column;
1288
+ flex: 1;
1289
+ min-height: 0;
1290
+ min-width: 0;
1291
+ background: var(--paper);
1292
+ }
1293
+ :root[data-theme='dark'] .calendar-shell {
1294
+ --cal-personal: #86a6ea;
1295
+ --cal-due: #d9b26a;
1296
+ --cal-today: color-mix(in srgb, var(--text) 3.5%, transparent);
1297
+ --cal-lift: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 20px -6px rgb(0 0 0 / 0.55);
1298
+ }
1299
+ :where(.calendar-view-event, .calendar-view-date-event, .calendar-month-event, .calendar-agenda-row) {
1300
+ --tone: var(--cal-ink);
1301
+ }
1302
+ .is-personal { --tone: var(--cal-personal); }
1303
+ .is-due { --tone: var(--cal-due); }
1304
+ .is-overdue { --tone: var(--cal-overdue); }
1305
+
1306
+ /* ---- Filter bar -------------------------------------------------------- */
1307
+ .calendar-filter-bar {
1308
+ display: flex;
1309
+ flex-wrap: wrap;
1310
+ align-items: center;
1311
+ gap: 12px;
1312
+ padding: 8px 14px;
1313
+ border-bottom: 1px solid var(--line);
1314
+ background: var(--paper);
1315
+ font-size: 12px;
1316
+ }
1317
+ .calendar-filter-kinds {
1318
+ display: inline-flex;
1319
+ gap: 2px;
1320
+ padding: 2px;
1321
+ border-radius: 7px;
1322
+ background: var(--surface);
1323
+ box-shadow: inset 0 0 0 1px var(--line);
1324
+ }
1325
+ .calendar-filter-kinds button {
1326
+ min-height: 24px;
1327
+ padding: 0 10px;
1328
+ border-radius: 5px;
1329
+ font-size: 12px;
1330
+ color: var(--muted);
1331
+ }
1332
+ .calendar-filter-kinds button:hover { color: var(--text); background: color-mix(in srgb, var(--hover) 70%, transparent); }
1333
+ .calendar-filter-kinds button[aria-pressed='true'] {
1334
+ background: var(--paper);
1335
+ color: var(--text);
1336
+ font-weight: 500;
1337
+ box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgb(15 15 15 / 0.08);
1338
+ }
1339
+ .calendar-filter-completed {
1340
+ display: inline-flex;
1341
+ align-items: center;
1342
+ gap: 6px;
1343
+ min-height: 28px;
1344
+ padding: 0 8px 0 6px;
1345
+ border-radius: 6px;
1346
+ color: var(--text-secondary);
1347
+ cursor: pointer;
1348
+ user-select: none;
1349
+ transition: background-color var(--motion-quick) var(--ease-standard), color var(--motion-quick) var(--ease-standard);
1350
+ }
1351
+ .calendar-filter-completed:hover { background: var(--hover); color: var(--text); }
1352
+ .calendar-filter-completed input,
1353
+ .calendar-create-checkable input {
1354
+ appearance: none;
1355
+ position: relative;
1356
+ flex: none;
1357
+ width: 14px;
1358
+ height: 14px;
1359
+ margin: 0;
1360
+ border: 1.5px solid var(--control-border);
1361
+ border-radius: 4px;
1362
+ background: var(--paper);
1363
+ cursor: pointer;
1364
+ transition: background-color var(--motion-quick) var(--ease-standard), border-color var(--motion-quick) var(--ease-standard);
1365
+ }
1366
+ .calendar-filter-completed input::after,
1367
+ .calendar-create-checkable input::after {
1368
+ content: '';
1369
+ position: absolute;
1370
+ left: 3.5px;
1371
+ top: 0.5px;
1372
+ width: 3.5px;
1373
+ height: 7px;
1374
+ border: solid var(--on-accent, #fff);
1375
+ border-width: 0 1.5px 1.5px 0;
1376
+ rotate: 45deg;
1377
+ scale: 0.4;
1378
+ opacity: 0;
1379
+ transition: scale var(--motion-spring) var(--ease-spring-bouncy), opacity var(--motion-quick) var(--ease-standard);
1380
+ }
1381
+ .calendar-filter-completed input:checked,
1382
+ .calendar-create-checkable input:checked { border-color: var(--green-fill); background: var(--green-fill); }
1383
+ .calendar-filter-completed input:checked::after,
1384
+ .calendar-create-checkable input:checked::after { scale: 1; opacity: 1; }
1385
+ .calendar-filter-completed:hover input:not(:checked),
1386
+ .calendar-create-checkable:hover input:not(:checked, :disabled) { border-color: var(--text-secondary); }
1387
+ .calendar-filter-completed input:focus-visible,
1388
+ .calendar-create-checkable input:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
1389
+ .calendar-filter-search {
1390
+ display: inline-flex;
1391
+ align-items: center;
1392
+ gap: 6px;
1393
+ margin-left: auto;
1394
+ min-height: 28px;
1395
+ padding: 0 9px;
1396
+ border: 1px solid var(--line);
1397
+ border-radius: 7px;
1398
+ background: var(--surface);
1399
+ color: var(--muted);
1400
+ cursor: text;
1401
+ transition: border-color var(--motion-base) var(--ease-standard), background-color var(--motion-base) var(--ease-standard), box-shadow var(--motion-base) var(--ease-standard);
1402
+ }
1403
+ .calendar-filter-search:hover { border-color: var(--control-border); }
1404
+ .calendar-filter-search:focus-within {
1405
+ border-color: color-mix(in srgb, var(--text) 35%, var(--line));
1406
+ background: var(--paper);
1407
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 7%, transparent);
1408
+ color: var(--text-secondary);
1409
+ }
1410
+ .calendar-filter-search input {
1411
+ width: 140px;
1412
+ border: 0;
1413
+ padding: 0;
1414
+ background: transparent;
1415
+ color: var(--text);
1416
+ font: inherit;
1417
+ font-size: 12px;
1418
+ outline: none;
1419
+ transition: width var(--motion-spring) var(--ease-spring-smooth);
1420
+ }
1421
+ .calendar-filter-search input:focus,
1422
+ .calendar-filter-search input:not(:placeholder-shown) { width: 200px; }
1423
+ .calendar-filter-search input:focus-visible { outline: none; }
1424
+ .calendar-error-banner {
1425
+ display: flex;
1426
+ align-items: center;
1427
+ justify-content: space-between;
1428
+ gap: 10px;
1429
+ margin: 0;
1430
+ padding: 6px 14px;
1431
+ border-bottom: 1px solid var(--line);
1432
+ background: color-mix(in srgb, var(--danger, #c24141) 10%, var(--paper));
1433
+ color: var(--danger, #c24141);
1434
+ font-size: 12px;
1435
+ animation: tano-rise-in var(--motion-spring) var(--ease-spring-smooth);
1436
+ }
1437
+ .calendar-error-banner button {
1438
+ display: grid;
1439
+ place-items: center;
1440
+ width: 22px;
1441
+ height: 22px;
1442
+ border-radius: 5px;
1443
+ color: inherit;
1444
+ }
1445
+ .calendar-error-banner button:hover { background: color-mix(in srgb, var(--danger, #c24141) 14%, transparent); color: inherit; }
1446
+
1447
+ /* ---- Scroll container ---------------------------------------------------- */
564
1448
  .calendar-view {
565
1449
  flex: 1;
566
1450
  min-height: 0;
@@ -570,6 +1454,61 @@ watch(() => props.date, (date) => {
570
1454
  .calendar-view-timeline { overflow-anchor: none; }
571
1455
  .calendar-view-month,
572
1456
  .calendar-view-year { overflow-anchor: none; }
1457
+ /* Switching between views fades the new layout in instead of snapping. */
1458
+ .calendar-view-inner,
1459
+ .calendar-month-view,
1460
+ .calendar-year-view,
1461
+ .calendar-agenda-view { animation: tano-fade-in var(--motion-base) var(--ease-standard); }
1462
+
1463
+ /* ---- Shared item pieces -------------------------------------------------- */
1464
+ .calendar-inline-check {
1465
+ flex: none;
1466
+ display: grid;
1467
+ place-items: center;
1468
+ width: 16px;
1469
+ height: 16px;
1470
+ padding: 0;
1471
+ border-radius: 50%;
1472
+ color: color-mix(in srgb, var(--tone, var(--text)) 55%, var(--muted));
1473
+ }
1474
+ .calendar-inline-check:hover:not(:disabled) {
1475
+ color: var(--tone, var(--text));
1476
+ background: color-mix(in srgb, var(--tone, var(--text)) 12%, transparent);
1477
+ }
1478
+ /* Checks sit inside draggable items, which the global press motion skips. */
1479
+ .calendar-inline-check:active:not(:disabled) { scale: 0.86; }
1480
+ .calendar-inline-check:disabled { opacity: 0.45; cursor: not-allowed; }
1481
+ .is-completed .calendar-inline-check { color: var(--tone, var(--text)); }
1482
+ .calendar-due-flag { flex: none; color: var(--cal-due); }
1483
+ .is-overdue .calendar-due-flag { color: var(--cal-overdue); }
1484
+ .calendar-item-trigger {
1485
+ flex: 1;
1486
+ min-width: 0;
1487
+ overflow: hidden;
1488
+ text-overflow: ellipsis;
1489
+ white-space: nowrap;
1490
+ text-align: left;
1491
+ color: inherit;
1492
+ font: inherit;
1493
+ }
1494
+ .calendar-item-trigger:hover { color: inherit; }
1495
+ .calendar-item-time {
1496
+ margin-right: 5px;
1497
+ color: var(--muted);
1498
+ font-variant-numeric: tabular-nums;
1499
+ }
1500
+ .is-draggable { cursor: grab; }
1501
+ .is-draggable:active { cursor: grabbing; }
1502
+ .is-dragging { opacity: 0.38; }
1503
+ .is-completed .calendar-item-trigger,
1504
+ .is-completed .calendar-view-event-body strong,
1505
+ .is-completed .calendar-agenda-item span {
1506
+ color: var(--muted);
1507
+ text-decoration: line-through;
1508
+ text-decoration-color: color-mix(in srgb, var(--muted) 70%, transparent);
1509
+ }
1510
+
1511
+ /* ---- Timeline (day / 4 days / week) ------------------------------------- */
573
1512
  .calendar-view-days,
574
1513
  .calendar-view-grid {
575
1514
  display: grid;
@@ -578,13 +1517,15 @@ watch(() => props.date, (date) => {
578
1517
  .calendar-view-days {
579
1518
  position: sticky;
580
1519
  top: 0;
581
- z-index: 2;
1520
+ z-index: 4;
582
1521
  grid-template-rows: 70px;
583
1522
  min-height: 70px;
584
1523
  align-items: center;
585
1524
  background: var(--paper);
586
1525
  border-bottom: 1px solid var(--line);
1526
+ transition: grid-template-rows var(--motion-spring) var(--ease-spring-smooth);
587
1527
  }
1528
+ .calendar-view-days.has-banner { grid-template-rows: 70px var(--calendar-banner-height, auto); }
588
1529
  .calendar-view-zone {
589
1530
  position: sticky;
590
1531
  left: 0;
@@ -602,19 +1543,28 @@ watch(() => props.date, (date) => {
602
1543
  align-items: center;
603
1544
  justify-content: center;
604
1545
  gap: 7px;
1546
+ align-self: stretch;
605
1547
  color: var(--text-secondary);
606
1548
  }
607
- .calendar-view-day-heading span { font-size: 12px; }
1549
+ .calendar-view-day-heading span { font-size: 12px; color: var(--muted); }
608
1550
  .calendar-view-day-heading strong {
609
1551
  display: grid;
610
1552
  place-items: center;
611
- width: 30px;
612
- height: 30px;
613
- border-radius: 50%;
1553
+ min-width: 32px;
1554
+ height: 32px;
1555
+ padding: 0 4px;
1556
+ border-radius: 16px;
614
1557
  font-size: 18px;
615
1558
  font-weight: 500;
1559
+ font-variant-numeric: tabular-nums;
1560
+ }
1561
+ .calendar-view-day-heading.today span { color: var(--text); font-weight: 500; }
1562
+ .calendar-view-day-heading.today strong,
1563
+ .calendar-month-date.today,
1564
+ .calendar-year-days button.today > .calendar-year-date {
1565
+ color: var(--on-accent, white);
1566
+ background: var(--green-fill);
616
1567
  }
617
- .calendar-view-day-heading.today { color: var(--green); }
618
1568
  .calendar-view-date-label {
619
1569
  position: sticky;
620
1570
  left: 0;
@@ -630,71 +1580,291 @@ watch(() => props.date, (date) => {
630
1580
  display: flex;
631
1581
  flex-direction: column;
632
1582
  align-self: stretch;
633
- gap: 4px;
634
- max-height: 104px;
1583
+ gap: 3px;
1584
+ min-height: 0;
635
1585
  overflow: auto;
1586
+ overscroll-behavior: contain;
1587
+ scrollbar-width: none;
636
1588
  padding: 6px 4px;
637
1589
  border-top: 1px solid var(--line);
638
1590
  border-left: 1px solid var(--line);
1591
+ transition: background-color var(--motion-quick) var(--ease-standard), box-shadow var(--motion-quick) var(--ease-standard);
1592
+ }
1593
+ .calendar-view-date-events::-webkit-scrollbar { display: none; }
1594
+ .calendar-view-date-events.is-drop-target,
1595
+ .calendar-month-cell.is-drop-target {
1596
+ background: color-mix(in srgb, var(--text) 5%, var(--paper));
1597
+ box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--text) 45%, transparent);
639
1598
  }
640
- .calendar-view-date-event {
1599
+
1600
+ /* All-day chips in the timeline header and every chip in the month grid. */
1601
+ .calendar-view-date-event,
1602
+ .calendar-month-event {
641
1603
  flex-shrink: 0;
642
- padding: 4px 6px;
643
- overflow: hidden;
644
- text-overflow: ellipsis;
645
- white-space: nowrap;
646
- border-radius: 4px;
647
- background: var(--accent);
1604
+ display: flex;
1605
+ align-items: center;
1606
+ gap: 5px;
1607
+ box-sizing: border-box;
1608
+ height: 22px;
1609
+ padding: 0 7px 0 5px;
1610
+ border-radius: 5px;
1611
+ background: color-mix(in srgb, var(--tone) 8%, var(--paper));
648
1612
  color: var(--text);
649
- text-align: left;
650
1613
  font-size: 11px;
1614
+ line-height: 22px;
1615
+ transition:
1616
+ background-color var(--motion-quick) var(--ease-standard),
1617
+ box-shadow var(--motion-base) var(--ease-standard),
1618
+ opacity var(--motion-base) var(--ease-standard);
651
1619
  }
652
- .calendar-view-date-event:hover { background: var(--hover); }
653
- .calendar-view-date-event:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
654
- .calendar-view-day-heading.today strong,
655
- .calendar-month-date.today,
656
- .calendar-year-days button.today > .calendar-year-date { color: var(--on-accent, white); background: var(--green-fill); }
1620
+ .calendar-view-date-event:not(:has(.calendar-inline-check, .calendar-due-flag)),
1621
+ .calendar-month-event:not(:has(.calendar-inline-check, .calendar-due-flag)) { padding-left: 8px; }
1622
+ .calendar-view-date-event:hover,
1623
+ .calendar-month-event:hover,
1624
+ .calendar-view-date-event:focus-within,
1625
+ .calendar-month-event:focus-within { background: color-mix(in srgb, var(--tone) 14%, var(--paper)); }
1626
+ /* Deadlines are not time on the calendar: an outlined chip in the deadline tone. */
1627
+ .calendar-view-date-event.is-due,
1628
+ .calendar-month-event.is-due {
1629
+ background: color-mix(in srgb, var(--tone) 7%, var(--paper));
1630
+ box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 30%, transparent);
1631
+ }
1632
+ .calendar-view-date-event.is-due:hover,
1633
+ .calendar-month-event.is-due:hover { background: color-mix(in srgb, var(--tone) 13%, var(--paper)); }
1634
+ .is-overdue .calendar-item-trigger { color: color-mix(in srgb, var(--tone) 75%, var(--text)); }
1635
+ .calendar-view-date-event.is-completed,
1636
+ .calendar-month-event.is-completed { background: color-mix(in srgb, var(--tone) 4%, var(--paper)); }
1637
+
657
1638
  .calendar-view-grid { height: 1344px; }
658
- .calendar-view-hours { position: sticky; left: 0; z-index: 1; background: var(--paper); }
1639
+ .calendar-view-hours { position: sticky; left: 0; z-index: 3; background: var(--paper); }
659
1640
  .calendar-view-hours span {
660
1641
  position: absolute;
661
1642
  right: 9px;
662
- transform: translateY(-8px);
663
- font-size: 11px;
1643
+ transform: translateY(-7px);
1644
+ font-size: 10.5px;
664
1645
  color: var(--muted);
665
1646
  font-variant-numeric: tabular-nums;
666
1647
  }
1648
+ .calendar-view-hours span:first-child { display: none; }
667
1649
  .calendar-view-day-column {
668
1650
  position: relative;
1651
+ /* Own stacking context: event, preview and drop layers stay under the sticky header. */
1652
+ z-index: 0;
669
1653
  border-left: 1px solid var(--line);
670
- background: repeating-linear-gradient(to bottom, var(--line) 0, var(--line) 1px, transparent 1px, transparent 56px);
1654
+ background-image: repeating-linear-gradient(to bottom, var(--line) 0, var(--line) 1px, transparent 1px, transparent 56px);
1655
+ }
1656
+ .calendar-view-day-column.is-today { background-color: var(--cal-today); }
1657
+ .calendar-now-line {
1658
+ position: absolute;
1659
+ left: -1px;
1660
+ right: 0;
1661
+ z-index: 3;
1662
+ height: 2px;
1663
+ margin-top: -1px;
1664
+ background: var(--cal-overdue);
1665
+ pointer-events: none;
1666
+ }
1667
+ .calendar-now-line::before {
1668
+ content: '';
1669
+ position: absolute;
1670
+ left: -4px;
1671
+ top: -3px;
1672
+ width: 8px;
1673
+ height: 8px;
1674
+ border-radius: 50%;
1675
+ background: var(--cal-overdue);
1676
+ box-shadow: 0 0 0 2px var(--paper);
1677
+ }
1678
+ .calendar-slot-preview {
1679
+ position: absolute;
1680
+ left: 3px;
1681
+ right: 3px;
1682
+ z-index: 4;
1683
+ box-sizing: border-box;
1684
+ padding: 4px 8px 4px 10px;
1685
+ border-radius: var(--cal-radius);
1686
+ background: color-mix(in srgb, var(--text) 9%, var(--paper));
1687
+ box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 28%, transparent), var(--cal-lift);
1688
+ color: var(--text);
1689
+ font-size: 11px;
1690
+ font-weight: 500;
1691
+ font-variant-numeric: tabular-nums;
1692
+ pointer-events: none;
1693
+ animation: tano-fade-in var(--motion-quick) var(--ease-standard);
1694
+ }
1695
+ .calendar-slot-preview::before {
1696
+ content: '';
1697
+ position: absolute;
1698
+ left: 3px;
1699
+ top: 3px;
1700
+ bottom: 3px;
1701
+ width: 3px;
1702
+ border-radius: 2px;
1703
+ background: color-mix(in srgb, var(--text) 55%, var(--paper));
1704
+ }
1705
+ .calendar-drop-indicator {
1706
+ position: absolute;
1707
+ left: -1px;
1708
+ right: 0;
1709
+ z-index: 6;
1710
+ height: 0;
1711
+ border-top: 2px solid var(--green-fill);
1712
+ pointer-events: none;
1713
+ transition: top 90ms var(--ease-standard);
1714
+ }
1715
+ .calendar-drop-indicator::before {
1716
+ content: '';
1717
+ position: absolute;
1718
+ left: -4px;
1719
+ top: -5px;
1720
+ width: 8px;
1721
+ height: 8px;
1722
+ border-radius: 50%;
1723
+ background: var(--green-fill);
1724
+ }
1725
+ .calendar-drop-indicator span {
1726
+ position: absolute;
1727
+ left: 8px;
1728
+ top: 3px;
1729
+ padding: 1px 6px;
1730
+ border-radius: 4px;
1731
+ background: var(--green-fill);
1732
+ color: var(--on-accent, #fff);
1733
+ font-size: 10px;
1734
+ font-weight: 600;
1735
+ font-variant-numeric: tabular-nums;
1736
+ line-height: 16px;
671
1737
  }
1738
+
1739
+ /* Timed blocks: a tinted card with an inset tone bar. */
672
1740
  .calendar-view-event {
673
1741
  position: absolute;
674
1742
  z-index: 1;
675
- left: 3px;
676
- width: calc(100% - 6px);
1743
+ box-sizing: border-box;
677
1744
  display: flex;
678
- flex-direction: column;
679
1745
  align-items: flex-start;
680
- gap: 2px;
1746
+ gap: 4px;
681
1747
  overflow: hidden;
682
- padding: 4px 6px;
683
- border-left: 3px solid var(--green);
684
- border-radius: 4px;
685
- background: color-mix(in srgb, var(--green) 17%, var(--paper));
1748
+ padding: 4px 6px 6px 11px;
1749
+ border-radius: var(--cal-radius);
1750
+ background: color-mix(in srgb, var(--tone) 8%, var(--paper));
1751
+ box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 9%, transparent);
686
1752
  color: var(--text);
687
1753
  text-align: left;
688
1754
  font-size: 11px;
1755
+ animation: tano-fade-in var(--motion-base) var(--ease-standard);
1756
+ transition:
1757
+ background-color var(--motion-quick) var(--ease-standard),
1758
+ box-shadow var(--motion-base) var(--ease-standard),
1759
+ opacity var(--motion-base) var(--ease-standard),
1760
+ height var(--motion-quick) var(--ease-standard);
1761
+ }
1762
+ .calendar-view-event::before {
1763
+ content: '';
1764
+ position: absolute;
1765
+ left: 3px;
1766
+ top: 3px;
1767
+ bottom: 3px;
1768
+ width: 3px;
1769
+ border-radius: 2px;
1770
+ background: color-mix(in srgb, var(--tone) 58%, var(--paper));
1771
+ transition: background-color var(--motion-quick) var(--ease-standard);
689
1772
  }
690
1773
  .calendar-view-event:hover,
691
- .calendar-view-event:focus-visible { background: color-mix(in srgb, var(--green) 27%, var(--paper)); }
692
- .calendar-view-event strong,
693
- .calendar-view-event span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
694
- .calendar-view-event strong { font-size: 12px; font-weight: 500; }
695
- .calendar-view-point { flex-direction: row; align-items: center; gap: 5px; padding: 2px 4px 2px 13px; border-left: 0; background: transparent; }
696
- .calendar-view-point::before { content: ''; position: absolute; left: 3px; width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
697
- .calendar-view-point span { color: var(--muted); }
1774
+ .calendar-view-event:focus-within {
1775
+ z-index: 3;
1776
+ background: color-mix(in srgb, var(--tone) 12%, var(--paper));
1777
+ box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 16%, transparent), var(--cal-lift);
1778
+ }
1779
+ .calendar-view-event:hover::before,
1780
+ .calendar-view-event:focus-within::before { background: color-mix(in srgb, var(--tone) 80%, var(--paper)); }
1781
+ .calendar-view-event.is-completed { opacity: 0.62; }
1782
+ .calendar-view-event.is-completed:hover { opacity: 0.9; }
1783
+ .calendar-view-event.is-dragging { opacity: 0.38; box-shadow: none; }
1784
+ .calendar-view-event.is-resizing {
1785
+ z-index: 5;
1786
+ transition: none;
1787
+ background: color-mix(in srgb, var(--tone) 14%, var(--paper));
1788
+ box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 22%, transparent), var(--cal-lift);
1789
+ }
1790
+ .calendar-view-event .calendar-inline-check { margin-top: 1px; }
1791
+ .calendar-view-event-body {
1792
+ flex: 1;
1793
+ min-width: 0;
1794
+ display: flex;
1795
+ flex-direction: column;
1796
+ align-items: flex-start;
1797
+ gap: 1px;
1798
+ padding: 0;
1799
+ text-align: left;
1800
+ color: inherit;
1801
+ font: inherit;
1802
+ }
1803
+ .calendar-view-event-body:hover { color: inherit; }
1804
+ .calendar-view-event-body strong,
1805
+ .calendar-view-event-body span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1806
+ .calendar-view-event-body strong { font-size: 12px; font-weight: 500; line-height: 1.4; }
1807
+ .calendar-view-event-body span {
1808
+ color: color-mix(in srgb, var(--tone) 35%, var(--muted));
1809
+ font-size: 11px;
1810
+ font-variant-numeric: tabular-nums;
1811
+ }
1812
+ .calendar-view-event.is-compact { align-items: center; padding-top: 1px; padding-bottom: 1px; }
1813
+ .calendar-view-event.is-compact .calendar-inline-check { margin-top: 0; }
1814
+ .calendar-view-event.is-compact .calendar-view-event-body { flex-direction: row; align-items: baseline; gap: 6px; }
1815
+ .calendar-view-event.is-compact .calendar-view-event-body strong { flex: 0 1 auto; min-width: 2.5em; }
1816
+ .calendar-view-event.is-compact .calendar-view-event-body span { flex: 1 1 0; min-width: 0; }
1817
+ .calendar-event-resize-handle {
1818
+ position: absolute;
1819
+ left: 0;
1820
+ right: 0;
1821
+ bottom: 0;
1822
+ height: 8px;
1823
+ cursor: ns-resize;
1824
+ }
1825
+ .calendar-event-resize-handle::after {
1826
+ content: '';
1827
+ position: absolute;
1828
+ left: 50%;
1829
+ bottom: 3px;
1830
+ width: 20px;
1831
+ height: 3px;
1832
+ margin-left: -10px;
1833
+ border-radius: 2px;
1834
+ background: color-mix(in srgb, var(--tone) 45%, transparent);
1835
+ opacity: 0;
1836
+ scale: 0.6 1;
1837
+ transition: opacity var(--motion-quick) var(--ease-standard), scale var(--motion-spring) var(--ease-spring);
1838
+ }
1839
+ .calendar-view-event:hover .calendar-event-resize-handle::after,
1840
+ .calendar-view-event.is-resizing .calendar-event-resize-handle::after { opacity: 1; scale: 1; }
1841
+ .calendar-event-resize-handle:hover::after { background: color-mix(in srgb, var(--tone) 75%, transparent); }
1842
+ /* Zero-length items: a slim row with a tone dot rather than a card. */
1843
+ .calendar-view-point {
1844
+ align-items: center;
1845
+ gap: 5px;
1846
+ padding: 0 6px 0 15px;
1847
+ background: transparent;
1848
+ box-shadow: none;
1849
+ }
1850
+ .calendar-view-point::before {
1851
+ top: 50%;
1852
+ bottom: auto;
1853
+ left: 6px;
1854
+ width: 6px;
1855
+ height: 6px;
1856
+ margin-top: -3px;
1857
+ border-radius: 50%;
1858
+ background: var(--tone);
1859
+ }
1860
+ .calendar-view-point.is-task { padding-left: 4px; }
1861
+ .calendar-view-point.is-task::before { display: none; }
1862
+ .calendar-view-point:hover,
1863
+ .calendar-view-point:focus-within { background: color-mix(in srgb, var(--tone) 9%, var(--paper)); box-shadow: var(--cal-lift); }
1864
+ .calendar-view-point .calendar-view-event-body { flex-direction: row; align-items: baseline; gap: 6px; }
1865
+ .calendar-view-point .calendar-view-event-body span { flex: none; }
1866
+
1867
+ /* ---- Month ---------------------------------------------------------------- */
698
1868
  .calendar-month-view { min-width: 630px; }
699
1869
  .calendar-month-weekdays,
700
1870
  .calendar-month-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
@@ -706,97 +1876,387 @@ watch(() => props.date, (date) => {
706
1876
  border-bottom: 1px solid var(--line);
707
1877
  }
708
1878
  .calendar-month-weekdays span {
709
- padding: 12px 8px;
1879
+ padding: 11px 8px;
710
1880
  color: var(--muted);
711
1881
  font-size: 12px;
712
1882
  text-align: center;
713
1883
  }
714
1884
  .calendar-month-cell {
715
- min-height: 100px;
716
- padding: 7px 6px;
1885
+ display: flex;
1886
+ flex-direction: column;
1887
+ gap: 2px;
1888
+ min-height: 108px;
1889
+ min-width: 0;
1890
+ padding: 6px;
717
1891
  border-right: 1px solid var(--line);
718
1892
  border-bottom: 1px solid var(--line);
719
1893
  overflow: hidden;
1894
+ transition: background-color var(--motion-quick) var(--ease-standard), box-shadow var(--motion-quick) var(--ease-standard);
1895
+ }
1896
+ .calendar-month-cell.shaded { background: color-mix(in srgb, var(--surface) 55%, var(--paper)); }
1897
+ .calendar-month-cell-header {
1898
+ display: flex;
1899
+ align-items: center;
1900
+ justify-content: flex-end;
1901
+ gap: 4px;
1902
+ margin-bottom: 3px;
720
1903
  }
721
- .calendar-month-cell.shaded { background: var(--surface); }
1904
+ .calendar-month-add {
1905
+ display: grid;
1906
+ place-items: center;
1907
+ width: 22px;
1908
+ height: 22px;
1909
+ margin-right: auto;
1910
+ border-radius: 6px;
1911
+ color: var(--muted);
1912
+ opacity: 0;
1913
+ scale: 0.8;
1914
+ transition:
1915
+ opacity var(--motion-quick) var(--ease-standard),
1916
+ scale var(--motion-spring) var(--ease-spring),
1917
+ background-color var(--motion-quick) var(--ease-standard),
1918
+ color var(--motion-quick) var(--ease-standard);
1919
+ }
1920
+ .calendar-month-cell:hover .calendar-month-add,
1921
+ .calendar-month-add:focus-visible { opacity: 1; scale: 1; }
1922
+ .calendar-month-add:hover { background: var(--hover); color: var(--text); }
722
1923
  .calendar-month-date,
723
1924
  .calendar-year-days button {
724
1925
  display: grid;
725
1926
  place-items: center;
726
- width: 27px;
727
- height: 27px;
728
- border-radius: 50%;
1927
+ width: 26px;
1928
+ height: 26px;
1929
+ border-radius: 13px;
729
1930
  font-variant-numeric: tabular-nums;
730
1931
  }
731
- .calendar-month-date { margin: 0 0 5px auto; font-size: 12px; }
732
- .calendar-month-date.month-start { width: auto; min-width: 27px; padding: 0 5px; font-weight: 500; }
733
- .calendar-month-date:hover,
734
- .calendar-year-days button:hover { background: var(--hover); }
735
- .calendar-month-event {
1932
+ .calendar-month-date { margin: 0; color: var(--text-secondary); font-size: 12px; }
1933
+ .calendar-month-date.month-start { width: auto; min-width: 26px; padding: 0 8px; color: var(--text); font-weight: 600; }
1934
+ .calendar-month-date:hover:not(.today) { background: var(--hover); color: var(--text); }
1935
+ .calendar-month-date.today:hover { background: var(--green-fill-hover); color: var(--on-accent, white); }
1936
+ .calendar-month-event { width: 100%; }
1937
+ /* Timed items in a day cell are listed, not blocked out: dot + time + title. */
1938
+ .calendar-month-event.is-timed:not(.is-due) { background: transparent; }
1939
+ .calendar-month-event.is-timed:not(.is-due):not(:has(.calendar-inline-check))::before {
1940
+ content: '';
1941
+ flex: none;
1942
+ width: 6px;
1943
+ height: 6px;
1944
+ margin-left: -2px;
1945
+ border-radius: 50%;
1946
+ background: color-mix(in srgb, var(--tone) 70%, var(--paper));
1947
+ }
1948
+ .calendar-month-event.is-timed:not(.is-due):hover,
1949
+ .calendar-month-event.is-timed:not(.is-due):focus-within { background: color-mix(in srgb, var(--tone) 8%, var(--paper)); }
1950
+ .calendar-month-more {
736
1951
  display: block;
737
1952
  width: 100%;
738
- overflow: hidden;
739
- margin-top: 3px;
740
- padding: 3px 5px;
741
- border-radius: 4px;
742
- background: var(--accent);
743
- color: var(--text);
1953
+ margin-top: 1px;
1954
+ padding: 2px 6px;
1955
+ border-radius: 5px;
1956
+ color: var(--muted);
744
1957
  font-size: 11px;
1958
+ font-weight: 500;
745
1959
  text-align: left;
746
- text-overflow: ellipsis;
747
- white-space: nowrap;
748
1960
  }
749
- .calendar-month-event:hover { background: var(--hover); }
750
- .calendar-month-more { display: block; padding: 4px; color: var(--muted); font-size: 11px; }
1961
+ .calendar-month-more:hover,
1962
+ .calendar-month-more[aria-expanded='true'] { background: var(--hover); color: var(--text); }
1963
+
1964
+ /* ---- Year ----------------------------------------------------------------- */
751
1965
  .calendar-year-heading {
752
1966
  max-width: 1200px;
753
1967
  margin: 0 auto;
754
- padding: 22px 28px 0;
1968
+ padding: 26px 28px 0;
755
1969
  color: var(--text);
756
- font-size: 16px;
1970
+ font-size: 18px;
757
1971
  font-weight: 600;
758
1972
  }
759
1973
  .calendar-year-grid {
760
1974
  display: grid;
761
1975
  grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
762
- gap: 28px 22px;
1976
+ gap: 12px 14px;
763
1977
  max-width: 1200px;
764
1978
  margin: 0 auto;
765
- padding: 28px;
1979
+ padding: 18px 20px 28px;
1980
+ }
1981
+ .calendar-year-month {
1982
+ min-width: 0;
1983
+ padding: 10px 8px 12px;
1984
+ border-radius: 10px;
1985
+ transition: background-color var(--motion-base) var(--ease-standard);
766
1986
  }
767
- .calendar-year-month { min-width: 0; }
768
- .calendar-year-month-title { margin-bottom: 11px; color: var(--text); font-size: 15px; font-weight: 600; }
769
- .calendar-year-month-title:hover { color: var(--text); }
1987
+ .calendar-year-month:hover { background: color-mix(in srgb, var(--surface) 45%, var(--paper)); }
1988
+ .calendar-year-month-title {
1989
+ margin: 0 0 8px;
1990
+ padding: 3px 8px;
1991
+ border-radius: 6px;
1992
+ color: var(--text);
1993
+ font-size: 14px;
1994
+ font-weight: 600;
1995
+ }
1996
+ .calendar-year-month-title:hover { background: var(--hover); color: var(--text); }
770
1997
  .calendar-year-weekdays,
771
1998
  .calendar-year-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; }
772
1999
  .calendar-year-weekdays span { padding-bottom: 4px; color: var(--muted); font-size: 10px; }
773
2000
  .calendar-year-days button,
774
2001
  .calendar-year-days > span { width: 28px; height: 28px; margin: auto; font-size: 11px; }
775
- .calendar-year-days button { position: relative; padding: 0; }
776
- .calendar-year-date { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; }
2002
+ .calendar-year-days button { position: relative; padding: 0; border-radius: 50%; color: var(--text-secondary); }
2003
+ .calendar-year-days button:hover { background: none; }
2004
+ .calendar-year-date {
2005
+ display: grid;
2006
+ place-items: center;
2007
+ width: 22px;
2008
+ height: 22px;
2009
+ border-radius: 50%;
2010
+ transition: background-color var(--motion-quick) var(--ease-standard), color var(--motion-quick) var(--ease-standard), scale var(--motion-spring) var(--ease-spring);
2011
+ }
2012
+ .calendar-year-days button:hover:not(.today) > .calendar-year-date { background: var(--hover); color: var(--text); }
777
2013
  .calendar-year-event-dot {
778
2014
  position: absolute;
779
- bottom: 1px;
780
- width: 3px;
781
- height: 3px;
2015
+ bottom: 0;
2016
+ left: 50%;
2017
+ width: 4px;
2018
+ height: 4px;
2019
+ margin-left: -2px;
782
2020
  border-radius: 50%;
783
- background: var(--green);
2021
+ background: color-mix(in srgb, var(--text) 55%, var(--paper));
784
2022
  }
785
- .calendar-year-days button.selected { color: var(--green); background: var(--accent); }
786
- .calendar-year-days button:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
787
- .calendar-agenda-view { max-width: 900px; margin: 0 auto; padding: 28px 32px; }
2023
+ .calendar-year-days button.selected:not(.today) > .calendar-year-date { color: var(--text); background: var(--selected); box-shadow: inset 0 0 0 1px var(--control-border); }
2024
+ .calendar-year-days button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
2025
+
2026
+ /* ---- Agenda --------------------------------------------------------------- */
2027
+ .calendar-agenda-view { max-width: 900px; margin: 0 auto; padding: 20px 32px 40px; }
788
2028
  .calendar-agenda-empty { padding: 60px 0; color: var(--muted); text-align: center; }
789
- .calendar-agenda-day { display: flex; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line); line-height: 20px; }
790
- .calendar-agenda-date { display: flex; align-items: center; width: 120px; flex-shrink: 0; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
2029
+ .calendar-agenda-day { display: flex; align-items: flex-start; gap: 24px; padding: 14px 0; border-bottom: 1px solid var(--line); line-height: 20px; }
2030
+ .calendar-agenda-day:last-child { border-bottom: 0; }
2031
+ .calendar-agenda-date {
2032
+ position: sticky;
2033
+ top: 12px;
2034
+ display: flex;
2035
+ align-items: baseline;
2036
+ gap: 8px;
2037
+ width: 112px;
2038
+ flex-shrink: 0;
2039
+ padding: 7px 0;
2040
+ color: var(--muted);
2041
+ font-size: 12px;
2042
+ font-variant-numeric: tabular-nums;
2043
+ white-space: nowrap;
2044
+ }
2045
+ .calendar-agenda-date strong {
2046
+ display: inline-grid;
2047
+ place-items: center;
2048
+ min-width: 28px;
2049
+ height: 28px;
2050
+ padding: 0 4px;
2051
+ border-radius: 14px;
2052
+ color: var(--text);
2053
+ font-size: 18px;
2054
+ font-weight: 500;
2055
+ }
2056
+ .calendar-agenda-date.today strong { color: var(--on-accent, white); background: var(--green-fill); font-size: 14px; }
2057
+ .calendar-agenda-date.today span { color: var(--text); }
791
2058
  .calendar-agenda-events { flex: 1; min-width: 0; }
792
- .calendar-agenda-events button { display: flex; align-items: center; gap: 20px; width: 100%; padding: 10px 12px; border-radius: 6px; color: var(--text); text-align: left; }
793
- .calendar-agenda-events button:hover { background: var(--hover); }
794
- .calendar-agenda-events time { width: 46px; flex-shrink: 0; color: var(--muted); font-size: 12px; }
2059
+ .calendar-agenda-row {
2060
+ display: flex;
2061
+ align-items: center;
2062
+ gap: 10px;
2063
+ padding: 0 8px;
2064
+ border-radius: 7px;
2065
+ transition: background-color var(--motion-quick) var(--ease-standard);
2066
+ }
2067
+ .calendar-agenda-row:hover,
2068
+ .calendar-agenda-row:focus-within { background: var(--hover); }
2069
+ .calendar-agenda-row .calendar-inline-check { width: 18px; height: 18px; }
2070
+ .calendar-agenda-marker {
2071
+ flex: none;
2072
+ display: grid;
2073
+ place-items: center;
2074
+ width: 18px;
2075
+ height: 18px;
2076
+ }
2077
+ .calendar-agenda-marker::before {
2078
+ content: '';
2079
+ width: 7px;
2080
+ height: 7px;
2081
+ border-radius: 50%;
2082
+ background: color-mix(in srgb, var(--tone) 65%, var(--paper));
2083
+ }
2084
+ .calendar-agenda-item { flex: 1; min-width: 0; display: flex; align-items: center; gap: 16px; padding: 8px 0; color: var(--text); text-align: left; }
2085
+ .calendar-agenda-item:hover { color: var(--text); }
2086
+ .calendar-agenda-item time { width: 46px; flex-shrink: 0; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
2087
+ .calendar-agenda-item span { display: inline-flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
2088
+ .calendar-agenda-item span .calendar-due-flag { align-self: center; }
2089
+ .calendar-agenda-item small { color: var(--muted); font-size: 11px; }
2090
+ .calendar-agenda-row.is-overdue .calendar-agenda-item small { color: var(--cal-overdue); }
2091
+
2092
+ /* ---- Quick create dialog (teleported: keep its own tokens) ------------------ */
2093
+ .calendar-create-backdrop {
2094
+ position: fixed;
2095
+ inset: 0;
2096
+ z-index: 80;
2097
+ display: grid;
2098
+ place-items: center;
2099
+ padding: 16px;
2100
+ background: #161a2233;
2101
+ backdrop-filter: blur(3px);
2102
+ }
2103
+ .calendar-create-dialog {
2104
+ --create-label: 92px;
2105
+ width: min(520px, 100%);
2106
+ padding: 16px 20px 18px;
2107
+ border: 1px solid var(--line);
2108
+ border-radius: var(--radius-dialog, 14px);
2109
+ background: var(--paper);
2110
+ color: var(--text);
2111
+ box-shadow: var(--dialog-shadow, 0 16px 48px #0003);
2112
+ }
2113
+ .calendar-create-dialog header {
2114
+ display: flex;
2115
+ align-items: center;
2116
+ justify-content: space-between;
2117
+ gap: 12px;
2118
+ margin-bottom: 6px;
2119
+ }
2120
+ .calendar-create-dialog h2 { margin: 0; color: var(--text-secondary); font-size: 12px; font-weight: 500; }
2121
+ .calendar-create-close {
2122
+ display: grid;
2123
+ place-items: center;
2124
+ width: 28px;
2125
+ height: 28px;
2126
+ margin-right: -6px;
2127
+ border-radius: 7px;
2128
+ color: var(--muted);
2129
+ }
2130
+ .calendar-create-close:hover:not(:disabled) { background: var(--hover); color: var(--text); }
2131
+ /* The title is the dialog's headline, written in place like the detail panel. */
2132
+ .calendar-create-title {
2133
+ box-sizing: border-box;
2134
+ width: calc(100% + 16px);
2135
+ margin: 0 -8px 10px;
2136
+ padding: 6px 8px;
2137
+ border: 1px solid transparent;
2138
+ border-radius: 8px;
2139
+ background: transparent;
2140
+ color: var(--text);
2141
+ font: inherit;
2142
+ font-size: 20px;
2143
+ font-weight: 600;
2144
+ line-height: 1.4;
2145
+ }
2146
+ .calendar-create-title::placeholder { color: var(--muted); opacity: 0.7; font-weight: 500; }
2147
+ .calendar-create-title:hover:not(:disabled, :focus) { background: var(--hover); }
2148
+ .calendar-create-title:focus,
2149
+ .calendar-create-title:focus-visible { outline: none; background: transparent; }
2150
+ /* Property rows share the detail panel's layout: label column + quiet values. */
2151
+ .calendar-create-properties { display: grid; gap: 4px; padding: 12px 0 4px; border-top: 1px solid var(--line); }
2152
+ .calendar-create-row { display: grid; grid-template-columns: var(--create-label) minmax(0, 1fr); column-gap: 12px; align-items: start; min-width: 0; }
2153
+ .calendar-create-label { display: flex; align-items: center; gap: 8px; min-height: 32px; color: var(--muted); font-size: 13px; }
2154
+ .calendar-create-label svg { flex: none; }
2155
+ .calendar-create-dialog .calendar-create-scope,
2156
+ .calendar-create-dialog .calendar-create-time :deep(.plan-date-field input) {
2157
+ box-sizing: border-box;
2158
+ height: 32px;
2159
+ min-width: 140px;
2160
+ max-width: 100%;
2161
+ justify-self: start;
2162
+ margin: 0;
2163
+ padding: 0 8px;
2164
+ border: 1px solid transparent;
2165
+ border-radius: 6px;
2166
+ background-color: transparent;
2167
+ color: var(--text);
2168
+ font: inherit;
2169
+ font-size: 13px;
2170
+ 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);
2171
+ }
2172
+ .calendar-create-dialog .calendar-create-time :deep(.plan-date-field input) { width: auto; }
2173
+ .calendar-create-dialog .calendar-create-scope {
2174
+ appearance: none;
2175
+ padding-right: 26px;
2176
+ 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");
2177
+ background-repeat: no-repeat;
2178
+ background-position: right 8px center;
2179
+ cursor: pointer;
2180
+ }
2181
+ .calendar-create-dialog .calendar-create-scope:hover:not(:disabled, :focus),
2182
+ .calendar-create-dialog .calendar-create-time :deep(.plan-date-field input:hover:not(:disabled, :focus)) { border-color: transparent; background-color: var(--hover); }
2183
+ .calendar-create-dialog .calendar-create-scope:focus-visible,
2184
+ .calendar-create-dialog .calendar-create-time :deep(.plan-date-field input:focus-visible) {
2185
+ outline: none;
2186
+ border-color: color-mix(in srgb, var(--text) 35%, var(--line));
2187
+ background-color: var(--paper);
2188
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 7%, transparent);
2189
+ }
2190
+ .calendar-create-time :deep(.plan-date-field.is-compact .plan-date-heading) { justify-content: flex-start; gap: 2px; min-height: 32px; }
2191
+ .calendar-create-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; }
2192
+ .calendar-create-time :deep(.plan-date-field.is-compact .plan-schedule-trigger > svg:first-child) { display: none; }
2193
+ .calendar-create-time :deep(.plan-date-field.is-compact .plan-schedule-trigger > svg:last-child) { color: var(--muted); }
2194
+ .calendar-create-time :deep(.plan-date-field.is-compact .compact-precision) { color: var(--muted); border-radius: 6px; }
2195
+ .calendar-create-time :deep(.plan-date-field.is-compact .plan-date-inputs) { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 4px; }
2196
+ .calendar-create-time :deep(.plan-date-field.is-compact .plan-date-input) { display: grid; gap: 0; }
2197
+ .calendar-create-time :deep(.plan-date-field.is-compact .plan-date-label) { min-height: 0; padding: 2px 9px 0; }
2198
+ .calendar-create-time :deep(.plan-date-field.is-compact .plan-date-label label) { font-size: 11px; color: var(--muted); }
2199
+ .calendar-create-checkable {
2200
+ display: inline-flex;
2201
+ align-items: center;
2202
+ justify-self: start;
2203
+ gap: 7px;
2204
+ min-height: 32px;
2205
+ padding: 0 8px;
2206
+ border-radius: 6px;
2207
+ font-size: 13px;
2208
+ color: var(--text);
2209
+ cursor: pointer;
2210
+ user-select: none;
2211
+ transition: background-color var(--motion-quick) var(--ease-standard);
2212
+ }
2213
+ .calendar-create-checkable:hover { background: var(--hover); }
2214
+ .calendar-create-error { margin: 10px 0 0; color: var(--danger, #c24141); font-size: 12px; }
2215
+ .calendar-create-dialog footer {
2216
+ display: flex;
2217
+ justify-content: flex-end;
2218
+ gap: 8px;
2219
+ margin-top: 14px;
2220
+ padding-top: 14px;
2221
+ border-top: 1px solid var(--line);
2222
+ }
2223
+ .calendar-create-dialog footer button {
2224
+ min-height: 32px;
2225
+ padding: 0 14px;
2226
+ border: 1px solid var(--line);
2227
+ border-radius: 7px;
2228
+ color: var(--text-secondary);
2229
+ font-size: 13px;
2230
+ }
2231
+ .calendar-create-dialog footer button:hover:not(:disabled) { background: var(--hover); color: var(--text); }
2232
+ .calendar-create-dialog footer .calendar-create-submit {
2233
+ min-width: 72px;
2234
+ border-color: transparent;
2235
+ background: var(--green-fill);
2236
+ color: var(--on-accent, #fff);
2237
+ font-weight: 500;
2238
+ }
2239
+ .calendar-create-dialog footer .calendar-create-submit:hover:not(:disabled) { background: var(--green-fill-hover); color: var(--on-accent, #fff); }
2240
+ .calendar-create-dialog footer .calendar-create-submit:disabled { opacity: 1; background: var(--hover); color: var(--muted); }
2241
+ @media (prefers-reduced-motion: reduce) {
2242
+ .calendar-view-inner,
2243
+ .calendar-month-view,
2244
+ .calendar-year-view,
2245
+ .calendar-agenda-view,
2246
+ .calendar-view-event,
2247
+ .calendar-slot-preview,
2248
+ .calendar-error-banner { animation: none; }
2249
+ }
795
2250
  @media (max-width: 700px) {
2251
+ .calendar-filter-bar { padding: 6px 10px; gap: 8px; }
2252
+ .calendar-filter-search input,
2253
+ .calendar-filter-search input:focus,
2254
+ .calendar-filter-search input:not(:placeholder-shown) { width: 110px; }
796
2255
  .calendar-year-heading { padding: 18px 18px 0; }
797
- .calendar-year-grid { padding: 18px; }
2256
+ .calendar-year-grid { padding: 12px; }
798
2257
  .calendar-agenda-view { padding: 18px; }
799
2258
  .calendar-agenda-day { gap: 10px; }
800
- .calendar-agenda-date { width: 88px; }
2259
+ .calendar-agenda-date { width: 88px; flex-direction: column; gap: 2px; }
2260
+ .calendar-create-row { grid-template-columns: minmax(0, 1fr); }
801
2261
  }
802
2262
  </style>