mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-18 10:31:50 +08:00
0f5778ac89
fix #13663 #### PR Dependency Tree * **PR #14984** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Calendar view for database blocks (month layout, entry cards, external-source support) * Workspace calendar integration and new slash-menu "Calendar View" * **Improvements** * Create/manage database rows from calendar UI; preserve durations when moving/resizing ranges * Drag-and-drop, drop-preview, and hit-testing support for calendar and docs * Redesigned in-menu View settings with multi-page navigation * Context-menu input autofocus toggle and conditional back-navigation * **Tests** * New unit and E2E suites covering calendar layout, interactions, sources, and slash-menu integration <!-- end of auto-generated comment: release notes by coderabbit.ai -->
35 lines
917 B
TypeScript
35 lines
917 B
TypeScript
import { viewType } from '../../core/view/data-view.js';
|
|
import { CalendarSingleView } from './calendar-view-manager.js';
|
|
import type { CalendarViewData } from './types.js';
|
|
|
|
export const calendarViewType = viewType('calendar');
|
|
|
|
export const calendarViewModel = calendarViewType.createModel<CalendarViewData>(
|
|
{
|
|
defaultName: 'Calendar View',
|
|
dataViewManager: CalendarSingleView,
|
|
defaultData: viewManager => {
|
|
return {
|
|
filter: {
|
|
type: 'group',
|
|
op: 'and',
|
|
conditions: [],
|
|
},
|
|
date: {},
|
|
card: {
|
|
titleColumnId: viewManager.dataSource.properties$.value.find(
|
|
id => viewManager.dataSource.propertyTypeGet(id) === 'title'
|
|
),
|
|
visiblePropertyIds: [],
|
|
},
|
|
sources: {
|
|
workspaceCalendar: {
|
|
enabled: true,
|
|
},
|
|
},
|
|
ui: {},
|
|
};
|
|
},
|
|
}
|
|
);
|