@dayflow/core 2.0.6 → 3.0.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 (164) hide show
  1. package/dist/index.d.ts +2555 -39
  2. package/dist/index.esm.js +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/styles.css +2128 -3113
  5. package/package.json +14 -24
  6. package/LICENSE +0 -21
  7. package/README.ja.md +0 -47
  8. package/README.md +0 -49
  9. package/README.zh.md +0 -47
  10. package/dist/components/calendarEvent/components/AllDayContent.d.ts +0 -9
  11. package/dist/components/calendarEvent/components/MonthAllDayContent.d.ts +0 -8
  12. package/dist/components/calendarEvent/components/MonthRegularContent.d.ts +0 -11
  13. package/dist/components/calendarEvent/components/RegularEventContent.d.ts +0 -20
  14. package/dist/components/calendarEvent/index.d.ts +0 -4
  15. package/dist/components/calendarEvent/types.d.ts +0 -49
  16. package/dist/components/common/CalendarHeader.d.ts +0 -4
  17. package/dist/components/common/CalendarPicker.d.ts +0 -19
  18. package/dist/components/common/ColorPicker.d.ts +0 -19
  19. package/dist/components/common/ContextMenu.d.ts +0 -25
  20. package/dist/components/common/CreateCalendarDialog.d.ts +0 -3
  21. package/dist/components/common/DefaultEventDetailDialog.d.ts +0 -12
  22. package/dist/components/common/DefaultEventDetailPanel.d.ts +0 -11
  23. package/dist/components/common/EventDetailPanelWithContent.d.ts +0 -11
  24. package/dist/components/common/MiniCalendar.d.ts +0 -11
  25. package/dist/components/common/QuickCreateEventPopup.d.ts +0 -10
  26. package/dist/components/common/TodayBox.d.ts +0 -7
  27. package/dist/components/common/ViewHeader.d.ts +0 -33
  28. package/dist/components/common/ViewSwitcher.d.ts +0 -8
  29. package/dist/components/dayView/DayContent.d.ts +0 -55
  30. package/dist/components/dayView/RightPanel.d.ts +0 -16
  31. package/dist/components/dayView/util.d.ts +0 -8
  32. package/dist/components/eventLayout/constants.d.ts +0 -8
  33. package/dist/components/eventLayout/index.d.ts +0 -129
  34. package/dist/components/eventLayout/types.d.ts +0 -23
  35. package/dist/components/eventLayout/utils.d.ts +0 -5
  36. package/dist/components/mobileEventDrawer/DefaultMobileEventDrawer.d.ts +0 -3
  37. package/dist/components/mobileEventDrawer/components/Switch.d.ts +0 -7
  38. package/dist/components/mobileEventDrawer/components/TimePickerWheel.d.ts +0 -7
  39. package/dist/components/mobileEventDrawer/index.d.ts +0 -3
  40. package/dist/components/monthView/MonthDragIndicator.d.ts +0 -12
  41. package/dist/components/monthView/MultiDayEvent.d.ts +0 -31
  42. package/dist/components/monthView/WeekComponent.d.ts +0 -53
  43. package/dist/components/monthView/util.d.ts +0 -11
  44. package/dist/components/rangePicker/components/CalendarGrid.d.ts +0 -13
  45. package/dist/components/rangePicker/components/CalendarHeader.d.ts +0 -11
  46. package/dist/components/rangePicker/components/RangePickerPanel.d.ts +0 -25
  47. package/dist/components/rangePicker/components/TimeSelector.d.ts +0 -21
  48. package/dist/components/rangePicker/constants.d.ts +0 -5
  49. package/dist/components/rangePicker/index.d.ts +0 -4
  50. package/dist/components/rangePicker/types.d.ts +0 -23
  51. package/dist/components/rangePicker/utils.d.ts +0 -2
  52. package/dist/components/search/MobileSearchDialog.d.ts +0 -14
  53. package/dist/components/search/SearchDrawer.d.ts +0 -13
  54. package/dist/components/search/SearchResultsList.d.ts +0 -11
  55. package/dist/components/sidebar/DefaultCalendarSidebar.d.ts +0 -4
  56. package/dist/components/sidebar/components/CalendarList.d.ts +0 -16
  57. package/dist/components/sidebar/components/DeleteCalendarDialog.d.ts +0 -14
  58. package/dist/components/sidebar/components/ImportCalendarDialog.d.ts +0 -11
  59. package/dist/components/sidebar/components/MergeCalendarDialog.d.ts +0 -9
  60. package/dist/components/sidebar/components/MergeMenuItem.d.ts +0 -9
  61. package/dist/components/sidebar/components/SidebarHeader.d.ts +0 -7
  62. package/dist/components/weekView/AllDayRow.d.ts +0 -49
  63. package/dist/components/weekView/DragIndicator/DefaultDragIndicator.d.ts +0 -2
  64. package/dist/components/weekView/DragIndicator/DragIndicatorComponent.d.ts +0 -7
  65. package/dist/components/weekView/TimeGrid.d.ts +0 -52
  66. package/dist/components/weekView/util.d.ts +0 -9
  67. package/dist/components/yearView/DefaultYearView.d.ts +0 -11
  68. package/dist/components/yearView/FixedWeekYearView.d.ts +0 -14
  69. package/dist/components/yearView/YearDayCell.d.ts +0 -12
  70. package/dist/components/yearView/YearMultiDayEvent.d.ts +0 -23
  71. package/dist/components/yearView/YearRowComponent.d.ts +0 -27
  72. package/dist/components/yearView/utils.d.ts +0 -19
  73. package/dist/contexts/ThemeContext.d.ts +0 -38
  74. package/dist/core/CalendarApp.d.ts +0 -85
  75. package/dist/core/DayFlowCalendar.d.ts +0 -20
  76. package/dist/core/calendarRegistry.d.ts +0 -121
  77. package/dist/core/config.d.ts +0 -60
  78. package/dist/core/index.d.ts +0 -6
  79. package/dist/core/useCalendarApp.d.ts +0 -2
  80. package/dist/factories/ViewAdapter.d.ts +0 -4
  81. package/dist/factories/createDayView.d.ts +0 -3
  82. package/dist/factories/createMonthView.d.ts +0 -3
  83. package/dist/factories/createWeekView.d.ts +0 -3
  84. package/dist/factories/createYearView.d.ts +0 -3
  85. package/dist/factories/index.d.ts +0 -10
  86. package/dist/hooks/drag/index.d.ts +0 -7
  87. package/dist/hooks/drag/useDrag.d.ts +0 -2
  88. package/dist/hooks/drag/useDragCommon.d.ts +0 -2
  89. package/dist/hooks/drag/useDragHandlers.d.ts +0 -2
  90. package/dist/hooks/drag/useDragManager.d.ts +0 -2
  91. package/dist/hooks/drag/useDragState.d.ts +0 -2
  92. package/dist/hooks/drag/useMonthDrag.d.ts +0 -2
  93. package/dist/hooks/drag/useWeekDayDrag.d.ts +0 -2
  94. package/dist/hooks/useCalendarDrop.d.ts +0 -20
  95. package/dist/hooks/virtualScroll/index.d.ts +0 -2
  96. package/dist/hooks/virtualScroll/useVirtualMonthScroll.d.ts +0 -7
  97. package/dist/hooks/virtualScroll/useVirtualScroll.d.ts +0 -48
  98. package/dist/locale/LocaleContext.d.ts +0 -10
  99. package/dist/locale/LocaleProvider.d.ts +0 -8
  100. package/dist/locale/index.d.ts +0 -7
  101. package/dist/locale/intl.d.ts +0 -16
  102. package/dist/locale/locales/de.d.ts +0 -3
  103. package/dist/locale/locales/en.d.ts +0 -3
  104. package/dist/locale/locales/es.d.ts +0 -3
  105. package/dist/locale/locales/fr.d.ts +0 -3
  106. package/dist/locale/locales/index.d.ts +0 -18
  107. package/dist/locale/locales/ja.d.ts +0 -3
  108. package/dist/locale/locales/ko.d.ts +0 -3
  109. package/dist/locale/locales/zh.d.ts +0 -3
  110. package/dist/locale/translator.d.ts +0 -9
  111. package/dist/locale/types.d.ts +0 -8
  112. package/dist/locale/useLocale.d.ts +0 -5
  113. package/dist/locale/utils.d.ts +0 -10
  114. package/dist/plugins/dragPlugin.d.ts +0 -5
  115. package/dist/plugins/eventsPlugin.d.ts +0 -3
  116. package/dist/plugins/index.d.ts +0 -6
  117. package/dist/setupTests.d.ts +0 -1
  118. package/dist/styles/classNames.d.ts +0 -381
  119. package/dist/types/calendar.d.ts +0 -26
  120. package/dist/types/calendarTypes.d.ts +0 -68
  121. package/dist/types/config.d.ts +0 -19
  122. package/dist/types/core.d.ts +0 -265
  123. package/dist/types/dragIndicator.d.ts +0 -160
  124. package/dist/types/event.d.ts +0 -18
  125. package/dist/types/eventDetail.d.ts +0 -74
  126. package/dist/types/factory.d.ts +0 -155
  127. package/dist/types/hook.d.ts +0 -103
  128. package/dist/types/index.d.ts +0 -13
  129. package/dist/types/layout.d.ts +0 -113
  130. package/dist/types/mobileEvent.d.ts +0 -21
  131. package/dist/types/monthView.d.ts +0 -65
  132. package/dist/types/plugin.d.ts +0 -80
  133. package/dist/types/search.d.ts +0 -35
  134. package/dist/utils/calendarDataUtils.d.ts +0 -83
  135. package/dist/utils/colorUtils.d.ts +0 -27
  136. package/dist/utils/compareUtils.d.ts +0 -5
  137. package/dist/utils/dateConstants.d.ts +0 -22
  138. package/dist/utils/dateFormat.d.ts +0 -15
  139. package/dist/utils/dateRangeUtils.d.ts +0 -24
  140. package/dist/utils/dateTimeUtils.d.ts +0 -49
  141. package/dist/utils/eventHelpers.d.ts +0 -143
  142. package/dist/utils/eventUtils.d.ts +0 -115
  143. package/dist/utils/helpers.d.ts +0 -27
  144. package/dist/utils/ics/icsDateUtils.d.ts +0 -37
  145. package/dist/utils/ics/icsGenerator.d.ts +0 -23
  146. package/dist/utils/ics/icsParser.d.ts +0 -15
  147. package/dist/utils/ics/index.d.ts +0 -16
  148. package/dist/utils/ics/types.d.ts +0 -91
  149. package/dist/utils/index.d.ts +0 -10
  150. package/dist/utils/logger.d.ts +0 -15
  151. package/dist/utils/rangePicker.d.ts +0 -8
  152. package/dist/utils/searchUtils.d.ts +0 -35
  153. package/dist/utils/styleUtils.d.ts +0 -24
  154. package/dist/utils/temporal.d.ts +0 -100
  155. package/dist/utils/temporalTypeGuards.d.ts +0 -63
  156. package/dist/utils/testDataUtils.d.ts +0 -14
  157. package/dist/utils/themeUtils.d.ts +0 -93
  158. package/dist/utils/throttle.d.ts +0 -11
  159. package/dist/utils/timeUtils.d.ts +0 -38
  160. package/dist/utils/utilityFunctions.d.ts +0 -11
  161. package/dist/views/DayView.d.ts +0 -13
  162. package/dist/views/MonthView.d.ts +0 -11
  163. package/dist/views/WeekView.d.ts +0 -11
  164. package/dist/views/YearView.d.ts +0 -12
@@ -1,9 +0,0 @@
1
- import { Event, EventLayout } from '@/types';
2
- export declare const calculateEventLayouts: (currentWeekEvents: Event[], currentWeekStart: Date) => Map<number, Map<string, EventLayout>>;
3
- export declare const getWeekStart: (date: Date) => Date;
4
- export declare const filterWeekEvents: (events: Event[], currentWeekStart: Date) => Event[];
5
- export declare const organizeAllDaySegments: (currentWeekEvents: Event[], currentWeekStart: Date) => (import("../monthView/WeekComponent").MultiDayEventSegment & {
6
- row: number;
7
- })[];
8
- export declare const calculateNewEventLayout: (targetDay: number, startHour: number, endHour: number, currentWeekEvents: Event[]) => EventLayout | null;
9
- export declare const calculateDragLayout: (draggedEvent: Event, targetDay: number, targetStartHour: number, targetEndHour: number, currentWeekEvents: Event[]) => EventLayout | null;
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import { CalendarApp } from '@/core';
3
- import { EventDetailContentRenderer, EventDetailDialogRenderer } from '@/types';
4
- export interface YearViewProps {
5
- app: CalendarApp;
6
- calendarRef: React.RefObject<HTMLDivElement>;
7
- customDetailPanelContent?: EventDetailContentRenderer;
8
- customEventDetailDialog?: EventDetailDialogRenderer;
9
- config?: any;
10
- }
11
- export declare const DefaultYearView: React.FC<YearViewProps>;
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import { CalendarApp } from '@/core';
3
- import { EventDetailContentRenderer, EventDetailDialogRenderer } from '@/types';
4
- interface FixedWeekYearViewProps {
5
- app: CalendarApp;
6
- calendarRef: React.RefObject<HTMLDivElement>;
7
- customDetailPanelContent?: EventDetailContentRenderer;
8
- customEventDetailDialog?: EventDetailDialogRenderer;
9
- config?: {
10
- showTimedEventsInYearView?: boolean;
11
- };
12
- }
13
- export declare const FixedWeekYearView: React.FC<FixedWeekYearViewProps>;
14
- export {};
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- interface YearDayCellProps {
3
- date: Date;
4
- isToday: boolean;
5
- locale: string;
6
- onSelectDate: (date: Date) => void;
7
- onCreateStart?: (e: React.MouseEvent | React.TouchEvent, targetDate: Date) => void;
8
- onMoreEventsClick?: (date: Date) => void;
9
- moreCount?: number;
10
- }
11
- export declare const YearDayCell: React.FC<YearDayCellProps>;
12
- export {};
@@ -1,23 +0,0 @@
1
- import React from 'react';
2
- import { Event, EventDetailContentRenderer, EventDetailDialogRenderer } from '@/types';
3
- import { YearMultiDaySegment } from './utils';
4
- import { CalendarApp } from '@/core';
5
- interface YearMultiDayEventProps {
6
- segment: YearMultiDaySegment;
7
- columnsPerRow: number;
8
- isDragging: boolean;
9
- isSelected: boolean;
10
- onMoveStart?: (e: React.MouseEvent | React.TouchEvent, event: Event) => void;
11
- onResizeStart?: (e: React.MouseEvent<HTMLDivElement, MouseEvent> | React.TouchEvent<HTMLDivElement>, event: Event, direction: string) => void;
12
- onEventSelect?: (eventId: string | null) => void;
13
- detailPanelEventId?: string | null;
14
- onDetailPanelToggle?: (eventId: string | null) => void;
15
- newlyCreatedEventId?: string | null;
16
- onDetailPanelOpen?: () => void;
17
- customDetailPanelContent?: EventDetailContentRenderer;
18
- customEventDetailDialog?: EventDetailDialogRenderer;
19
- app?: CalendarApp;
20
- calendarRef?: React.RefObject<HTMLDivElement>;
21
- }
22
- export declare const YearMultiDayEvent: React.FC<YearMultiDayEventProps>;
23
- export {};
@@ -1,27 +0,0 @@
1
- import React from 'react';
2
- import { Event, MonthEventDragState, EventDetailContentRenderer, EventDetailDialogRenderer } from '@/types';
3
- import { CalendarApp } from '@/core';
4
- interface YearRowComponentProps {
5
- rowDays: Date[];
6
- events: Event[];
7
- columnsPerRow: number;
8
- app: CalendarApp;
9
- calendarRef: React.RefObject<HTMLDivElement>;
10
- locale: string;
11
- isDragging: boolean;
12
- dragState: MonthEventDragState;
13
- onMoveStart?: (e: React.MouseEvent | React.TouchEvent, event: Event) => void;
14
- onResizeStart?: (e: React.MouseEvent<HTMLDivElement, MouseEvent> | React.TouchEvent<HTMLDivElement>, event: Event, direction: string) => void;
15
- onCreateStart?: (e: React.MouseEvent | React.TouchEvent, targetDate: Date) => void;
16
- selectedEventId: string | null;
17
- onEventSelect: (eventId: string | null) => void;
18
- onMoreEventsClick?: (date: Date) => void;
19
- newlyCreatedEventId?: string | null;
20
- onDetailPanelOpen?: () => void;
21
- detailPanelEventId: string | null;
22
- onDetailPanelToggle: (eventId: string | null) => void;
23
- customDetailPanelContent?: EventDetailContentRenderer;
24
- customEventDetailDialog?: EventDetailDialogRenderer;
25
- }
26
- export declare const YearRowComponent: React.FC<YearRowComponentProps>;
27
- export {};
@@ -1,19 +0,0 @@
1
- import { Event } from '@/types';
2
- export interface YearMultiDaySegment {
3
- id: string;
4
- event: Event;
5
- startCellIndex: number;
6
- endCellIndex: number;
7
- isFirstSegment: boolean;
8
- isLastSegment: boolean;
9
- visualRowIndex: number;
10
- }
11
- /**
12
- * Groups an array of days into rows based on the number of columns per row.
13
- */
14
- export declare function groupDaysIntoRows(yearDays: Date[], columnsPerRow: number): Date[][];
15
- /**
16
- * Analyzes events for a specific row of days and returns segments for multi-day events.
17
- * It also calculates the vertical layout (visualRowIndex) to prevent overlaps.
18
- */
19
- export declare function analyzeMultiDayEventsForRow(events: Event[], rowDays: Date[], columnsPerRow: number): YearMultiDaySegment[];
@@ -1,38 +0,0 @@
1
- import React from 'react';
2
- import { ThemeMode } from '../types/calendarTypes';
3
- /**
4
- * Theme Context Type
5
- */
6
- export interface ThemeContextType {
7
- /** Current theme mode (can be 'auto') */
8
- theme: ThemeMode;
9
- /** Effective theme (resolved, never 'auto') */
10
- effectiveTheme: 'light' | 'dark';
11
- /** Set theme mode */
12
- setTheme: (mode: ThemeMode) => void;
13
- }
14
- /**
15
- * Theme Provider Props
16
- */
17
- export interface ThemeProviderProps {
18
- children: React.ReactNode;
19
- /** Initial theme mode */
20
- initialTheme?: ThemeMode;
21
- /** Callback when theme changes */
22
- onThemeChange?: (theme: ThemeMode, effectiveTheme: 'light' | 'dark') => void;
23
- }
24
- /**
25
- * Theme Provider Component
26
- *
27
- * Manages theme state and applies it to the document root.
28
- * Supports 'light', 'dark', and 'auto' modes.
29
- *
30
- * @example
31
- * ```tsx
32
- * <ThemeProvider initialTheme="auto">
33
- * <App />
34
- * </ThemeProvider>
35
- * ```
36
- */
37
- export declare const ThemeProvider: React.FC<ThemeProviderProps>;
38
- export declare const useTheme: () => ThemeContextType;
@@ -1,85 +0,0 @@
1
- import React from 'react';
2
- import { CalendarApp as ICalendarApp, CalendarAppConfig, CalendarAppState, CalendarView, ViewType, SidebarConfig, CalendarType, MobileEventRenderer, ReadOnlyConfig } from '../types';
3
- import { Event } from '../types';
4
- import { CalendarRegistry } from './calendarRegistry';
5
- import { ThemeMode } from '../types/calendarTypes';
6
- export declare class CalendarApp implements ICalendarApp {
7
- state: CalendarAppState;
8
- private callbacks;
9
- private calendarRegistry;
10
- private sidebarConfig;
11
- private visibleMonth;
12
- private useEventDetailDialog;
13
- private useCalendarHeader;
14
- private customMobileEventRenderer?;
15
- private themeChangeListeners;
16
- constructor(config: CalendarAppConfig);
17
- private resolveLocale;
18
- getReadOnlyConfig: () => ReadOnlyConfig;
19
- /**
20
- * Helper to check if the calendar is in any form of read-only mode.
21
- * If readOnly config is present, it's considered non-editable.
22
- */
23
- private isInternalEditable;
24
- changeView: (view: ViewType) => void;
25
- getCurrentView: () => CalendarView;
26
- setCurrentDate: (date: Date) => void;
27
- getCurrentDate: () => Date;
28
- setVisibleMonth: (date: Date) => void;
29
- getVisibleMonth: () => Date;
30
- goToToday: () => void;
31
- goToPrevious: () => void;
32
- goToNext: () => void;
33
- selectDate: (date: Date) => void;
34
- addEvent: (event: Event) => void;
35
- updateEvent: (id: string, eventUpdate: Partial<Event>, isPending?: boolean) => void;
36
- deleteEvent: (id: string) => void;
37
- getAllEvents: () => Event[];
38
- onEventClick: (event: Event) => void;
39
- onMoreEventsClick: (date: Date) => void;
40
- highlightEvent: (eventId: string | null) => void;
41
- getEvents: () => Event[];
42
- getCalendars: () => CalendarType[];
43
- reorderCalendars: (fromIndex: number, toIndex: number) => void;
44
- setCalendarVisibility: (calendarId: string, visible: boolean) => void;
45
- setAllCalendarsVisibility: (visible: boolean) => void;
46
- updateCalendar: (id: string, updates: Partial<CalendarType>) => void;
47
- createCalendar: (calendar: CalendarType) => void;
48
- deleteCalendar: (id: string) => void;
49
- mergeCalendars: (sourceId: string, targetId: string) => void;
50
- getSidebarConfig: () => SidebarConfig;
51
- getCalendarHeaderConfig: () => boolean | ((props: any) => React.ReactNode);
52
- private installPlugin;
53
- getPlugin: <T = unknown>(name: string) => T | undefined;
54
- hasPlugin: (name: string) => boolean;
55
- render: () => React.ReactElement;
56
- getPluginConfig: (pluginName: string) => Record<string, unknown>;
57
- updatePluginConfig: (pluginName: string, config: Record<string, unknown>) => void;
58
- getViewConfig: (viewType: ViewType) => Record<string, unknown>;
59
- triggerRender: () => void;
60
- getCalendarRegistry: () => CalendarRegistry;
61
- getUseEventDetailDialog: () => boolean;
62
- getCustomMobileEventRenderer: () => MobileEventRenderer | undefined;
63
- updateConfig: (config: Partial<CalendarAppConfig>) => void;
64
- /**
65
- * Set theme mode
66
- * @param mode - Theme mode ('light', 'dark', or 'auto')
67
- */
68
- setTheme: (mode: ThemeMode) => void;
69
- /**
70
- * Get current theme mode
71
- * @returns Current theme mode
72
- */
73
- getTheme: () => ThemeMode;
74
- /**
75
- * Subscribe to theme changes
76
- * @param callback - Function to call when theme changes
77
- * @returns Unsubscribe function
78
- */
79
- subscribeThemeChange: (callback: (theme: ThemeMode) => void) => (() => void);
80
- /**
81
- * Unsubscribe from theme changes
82
- * @param callback - Function to remove from listeners
83
- */
84
- unsubscribeThemeChange: (callback: (theme: ThemeMode) => void) => void;
85
- }
@@ -1,20 +0,0 @@
1
- import React from 'react';
2
- import { EventDetailContentRenderer, EventDetailDialogRenderer, UseCalendarAppReturn } from '../types';
3
- import { CalendarSearchProps } from '../types/search';
4
- import { LocaleMessages } from '../locale/types';
5
- interface DayFlowCalendarProps {
6
- calendar: UseCalendarAppReturn;
7
- className?: string;
8
- style?: React.CSSProperties | undefined;
9
- /** Custom event detail content component (content only, will be wrapped in default panel) */
10
- customDetailPanelContent?: EventDetailContentRenderer;
11
- /** Custom event detail dialog component (Dialog mode) */
12
- customEventDetailDialog?: EventDetailDialogRenderer;
13
- meta?: Record<string, any>;
14
- /** Custom localization messages to override defaults */
15
- customMessages?: LocaleMessages;
16
- /** Search configuration */
17
- search?: CalendarSearchProps;
18
- }
19
- export declare const DayFlowCalendar: React.FC<DayFlowCalendarProps>;
20
- export default DayFlowCalendar;
@@ -1,121 +0,0 @@
1
- import { CalendarType, ThemeMode, CalendarColors } from '../types/calendarTypes';
2
- /**
3
- * Default calendar types
4
- */
5
- export declare const DEFAULT_CALENDAR_TYPES: CalendarType[];
6
- /**
7
- * Calendar Registry
8
- * Manages calendar types and provides color resolution
9
- */
10
- export declare class CalendarRegistry {
11
- private calendars;
12
- private defaultCalendarId;
13
- private currentTheme;
14
- constructor(customCalendars?: CalendarType[], defaultCalendarId?: string, theme?: ThemeMode);
15
- /**
16
- * Register a new calendar type
17
- */
18
- register(calendar: CalendarType): void;
19
- /**
20
- * Unregister a calendar type
21
- */
22
- unregister(calendarId: string): boolean;
23
- /**
24
- * Get a calendar type by ID
25
- */
26
- get(calendarId: string): CalendarType | undefined;
27
- /**
28
- * Get all calendar types
29
- */
30
- getAll(): CalendarType[];
31
- /**
32
- * Get visible calendar types
33
- */
34
- getVisible(): CalendarType[];
35
- /**
36
- * Check if a calendar exists
37
- */
38
- has(calendarId: string): boolean;
39
- /**
40
- * Reorder calendars
41
- * @param fromIndex - Source index
42
- * @param toIndex - Destination index
43
- */
44
- reorder(fromIndex: number, toIndex: number): void;
45
- /**
46
- * Update visibility of a specific calendar type
47
- */
48
- setVisibility(calendarId: string, visible: boolean): void;
49
- /**
50
- * Update visibility for all calendar types
51
- */
52
- setAllVisibility(visible: boolean): void;
53
- /**
54
- * Update calendar properties
55
- */
56
- updateCalendar(calendarId: string, updates: Partial<CalendarType>): void;
57
- /**
58
- * Set the default calendar ID
59
- */
60
- setDefaultCalendar(calendarId: string): void;
61
- /**
62
- * Get the default calendar ID
63
- */
64
- getDefaultCalendarId(): string;
65
- /**
66
- * Get the default calendar type
67
- */
68
- getDefaultCalendar(): CalendarType;
69
- /**
70
- * Set the current theme
71
- */
72
- setTheme(theme: ThemeMode): void;
73
- /**
74
- * Get the current theme
75
- */
76
- getTheme(): ThemeMode;
77
- /**
78
- * Resolve colors for a calendar ID based on current theme
79
- */
80
- resolveColors(calendarId?: string, theme?: ThemeMode): CalendarColors;
81
- /**
82
- * Get selected background color
83
- */
84
- getSelectedBgColor(calendarId?: string, theme?: ThemeMode): string;
85
- /**
86
- * Get line color
87
- */
88
- getLineColor(calendarId?: string, theme?: ThemeMode): string;
89
- /**
90
- * Get text color
91
- */
92
- getTextColor(calendarId?: string, theme?: ThemeMode): string;
93
- /**
94
- * Check if the current theme is dark
95
- */
96
- private isDarkTheme;
97
- /**
98
- * Validate calendar configuration
99
- */
100
- validate(calendar: Partial<CalendarType>): string[];
101
- }
102
- /**
103
- * Get the default calendar registry
104
- * Used internally by helper functions for color resolution
105
- * @internal
106
- */
107
- export declare function getDefaultCalendarRegistry(): CalendarRegistry;
108
- /**
109
- * Set the default calendar registry
110
- * Used internally by CalendarApp to sync its registry with the global default
111
- * @internal
112
- */
113
- export declare function setDefaultCalendarRegistry(registry: CalendarRegistry): void;
114
- /**
115
- * Get calendar colors for a specific hex color
116
- * Tries to match with default calendar types, otherwise generates generic colors
117
- */
118
- export declare function getCalendarColorsForHex(hex: string): {
119
- colors: CalendarColors;
120
- darkColors?: CalendarColors;
121
- };
@@ -1,60 +0,0 @@
1
- import { CalendarConfig } from '../types';
2
- export declare const defaultDragConfig: {
3
- HOUR_HEIGHT: number;
4
- FIRST_HOUR: number;
5
- LAST_HOUR: number;
6
- MIN_DURATION: number;
7
- TIME_COLUMN_WIDTH: number;
8
- ALL_DAY_HEIGHT: number;
9
- getLineColor: (color: string) => string;
10
- getDynamicPadding: (drag: {
11
- endHour: number;
12
- startHour: number;
13
- }) => "p-1" | "px-1 py-0";
14
- };
15
- export declare const defaultViewConfigs: {
16
- day: {
17
- showWeekends: boolean;
18
- showAllDay: boolean;
19
- scrollToCurrentTime: boolean;
20
- };
21
- week: {
22
- showWeekends: boolean;
23
- showAllDay: boolean;
24
- startOfWeek: number;
25
- scrollToCurrentTime: boolean;
26
- };
27
- month: {
28
- showWeekends: boolean;
29
- showAllDay: boolean;
30
- showOtherMonth: boolean;
31
- weekHeight: number;
32
- };
33
- };
34
- export declare const defaultCalendarConfig: CalendarConfig;
35
- export declare function deepMerge<T extends Record<string, any>>(target: T, ...sources: Partial<T>[]): T;
36
- export declare function createCalendarConfig(overrides?: Partial<CalendarConfig>): CalendarConfig;
37
- export declare function createDragConfig(overrides?: Partial<typeof defaultDragConfig>): any;
38
- export declare function createViewConfig(viewType: 'day' | 'week' | 'month', overrides?: Record<string, any>): any;
39
- export declare function validateCalendarConfig(config: Partial<CalendarConfig>): string[];
40
- export declare class ConfigManager {
41
- private config;
42
- constructor(initialConfig?: Partial<CalendarConfig>);
43
- getConfig(): CalendarConfig;
44
- getDragConfig(): {
45
- HOUR_HEIGHT: number;
46
- FIRST_HOUR: number;
47
- LAST_HOUR: number;
48
- MIN_DURATION: number;
49
- TIME_COLUMN_WIDTH: number;
50
- ALL_DAY_HEIGHT: number;
51
- getLineColor: (color: string) => string;
52
- getDynamicPadding: (drag: {
53
- endHour: number;
54
- startHour: number;
55
- }) => string;
56
- };
57
- getViewConfig(viewType: 'day' | 'week' | 'month'): Record<string, unknown>;
58
- updateConfig(updates: Partial<CalendarConfig>): void;
59
- resetConfig(newConfig?: Partial<CalendarConfig>): void;
60
- }
@@ -1,6 +0,0 @@
1
- export * from './useCalendarApp';
2
- export * from './config';
3
- export * from './DayFlowCalendar';
4
- export { CalendarApp } from './CalendarApp';
5
- export { ViewType } from '../types';
6
- export type { CalendarPlugin, CalendarView, CalendarCallbacks, CalendarAppConfig, CalendarAppState, CalendarApp as ICalendarApp, UseCalendarAppReturn, CalendarConfig, } from '../types';
@@ -1,2 +0,0 @@
1
- import { CalendarAppConfig, UseCalendarAppReturn } from '../types';
2
- export declare function useCalendarApp(config: CalendarAppConfig): UseCalendarAppReturn;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { ViewAdapterProps } from '../types';
3
- export declare const ViewAdapter: React.FC<ViewAdapterProps>;
4
- export default ViewAdapter;
@@ -1,3 +0,0 @@
1
- import { DayViewConfig, ViewFactory } from '../types';
2
- export declare const createDayView: ViewFactory<DayViewConfig>;
3
- export default createDayView;
@@ -1,3 +0,0 @@
1
- import { MonthViewConfig, ViewFactory } from '../types';
2
- export declare const createMonthView: ViewFactory<MonthViewConfig>;
3
- export default createMonthView;
@@ -1,3 +0,0 @@
1
- import { WeekViewConfig, ViewFactory } from '../types';
2
- export declare const createWeekView: ViewFactory<WeekViewConfig>;
3
- export default createWeekView;
@@ -1,3 +0,0 @@
1
- import { YearViewConfig, ViewFactory } from '../types';
2
- export declare const createYearView: ViewFactory<YearViewConfig>;
3
- export default createYearView;
@@ -1,10 +0,0 @@
1
- export * from './createDayView';
2
- export * from './createWeekView';
3
- export * from './createMonthView';
4
- export * from './createYearView';
5
- export type { BaseViewProps, DayViewProps, WeekViewProps, MonthViewProps, ViewFactoryConfig, DayViewConfig, WeekViewConfig, MonthViewConfig, ViewFactory, ViewAdapterProps, } from '../types';
6
- export declare function createStandardViews(config?: {
7
- day?: Partial<import('../types').DayViewConfig>;
8
- week?: Partial<import('../types').WeekViewConfig>;
9
- month?: Partial<import('../types').MonthViewConfig>;
10
- }): import("..").CalendarView[];
@@ -1,7 +0,0 @@
1
- export * from './useDrag';
2
- export * from './useDragCommon';
3
- export * from './useDragState';
4
- export * from './useDragManager';
5
- export * from './useDragHandlers';
6
- export * from './useWeekDayDrag';
7
- export * from './useMonthDrag';
@@ -1,2 +0,0 @@
1
- import { useDragProps, useDragReturn } from '../../types';
2
- export declare const useDrag: (options: useDragProps) => useDragReturn;
@@ -1,2 +0,0 @@
1
- import { useDragProps, UseDragCommonReturn } from '../../types';
2
- export declare const useDragCommon: (options: useDragProps) => UseDragCommonReturn;
@@ -1,2 +0,0 @@
1
- import { UseDragHandlersReturn, UseDragHandlersParams } from '../../types';
2
- export declare const useDragHandlers: (params: UseDragHandlersParams) => UseDragHandlersReturn;
@@ -1,2 +0,0 @@
1
- import { useDragProps, UseDragManagerReturn } from '../../types';
2
- export declare const useDragManager: (options: useDragProps) => UseDragManagerReturn;
@@ -1,2 +0,0 @@
1
- import { useDragProps, UseDragStateReturn } from '../../types';
2
- export declare const useDragState: (options: useDragProps) => UseDragStateReturn;
@@ -1,2 +0,0 @@
1
- import { UseMonthDragParams, UseMonthDragReturn } from '../../types';
2
- export declare const useMonthDrag: (params: UseMonthDragParams) => UseMonthDragReturn;
@@ -1,2 +0,0 @@
1
- import { UseWeekDayDragParams, UseWeekDayDragReturn } from '../../types';
2
- export declare const useWeekDayDrag: (params: UseWeekDayDragParams) => UseWeekDayDragReturn;
@@ -1,20 +0,0 @@
1
- import { CalendarApp } from '../core';
2
- import { Event, CalendarColors } from '../types';
3
- export interface CalendarDropData {
4
- calendarId: string;
5
- calendarName: string;
6
- calendarColors: CalendarColors;
7
- calendarIcon?: string;
8
- }
9
- export interface CalendarDropOptions {
10
- app: CalendarApp;
11
- onEventCreated?: (event: Event) => void;
12
- }
13
- export interface CalendarDropReturn {
14
- handleDrop: (e: React.DragEvent, dropDate: Date, dropHour?: number, isAllDay?: boolean) => Event | null;
15
- handleDragOver: (e: React.DragEvent) => void;
16
- }
17
- /**
18
- * Hook to handle dropping calendar from sidebar to create events
19
- */
20
- export declare function useCalendarDrop(options: CalendarDropOptions): CalendarDropReturn;
@@ -1,2 +0,0 @@
1
- export * from './useVirtualScroll';
2
- export * from './useVirtualMonthScroll';
@@ -1,7 +0,0 @@
1
- import { UseVirtualMonthScrollProps, UseVirtualMonthScrollReturn } from '../../types/monthView';
2
- export declare const useResponsiveMonthConfig: () => {
3
- weekHeight: number;
4
- screenSize: "mobile" | "tablet" | "desktop";
5
- weeksPerView: number;
6
- };
7
- export declare const useVirtualMonthScroll: ({ currentDate, weekHeight, onCurrentMonthChange, initialWeeksToLoad, locale, isEnabled, }: UseVirtualMonthScrollProps) => UseVirtualMonthScrollReturn;
@@ -1,48 +0,0 @@
1
- import { UseVirtualScrollProps, UseVirtualScrollReturn } from '../../types';
2
- export declare const VIRTUAL_SCROLL_CONFIG: {
3
- readonly OVERSCAN: 0;
4
- readonly BUFFER_SIZE: 20;
5
- readonly MIN_YEAR: 1970;
6
- readonly MAX_YEAR: 2100;
7
- readonly SCROLL_THROTTLE: 8;
8
- readonly SCROLL_DEBOUNCE: 100;
9
- readonly CACHE_CLEANUP_THRESHOLD: 30;
10
- readonly MOBILE_YEAR_HEIGHT: 1200;
11
- readonly TABLET_YEAR_HEIGHT: 900;
12
- readonly YEAR_HEIGHT: 700;
13
- };
14
- export declare class VirtualScrollPerformance {
15
- private static metrics;
16
- static trackScrollEvent(scrollDelta?: number): void;
17
- static trackRenderTime(time: number): void;
18
- static trackCacheHit(): void;
19
- static trackCacheMiss(): void;
20
- static getMetrics(): {
21
- scrollEvents: number;
22
- avgRenderTime: number;
23
- cacheHitRate: number;
24
- uptime: number;
25
- scrollEventsPerSecond: number;
26
- estimatedFPS: number;
27
- frameDrops: number;
28
- avgScrollDelta: number;
29
- };
30
- static reset(): void;
31
- }
32
- export declare class YearDataCache<T> {
33
- private cache;
34
- private accessOrder;
35
- private maxSize;
36
- constructor(maxSize?: number);
37
- get(year: number): T | undefined;
38
- set(year: number, data: T): void;
39
- private updateAccessOrder;
40
- getSize(): number;
41
- getHitRate(): number;
42
- clear(): void;
43
- }
44
- export declare const useResponsiveConfig: () => {
45
- yearHeight: typeof VIRTUAL_SCROLL_CONFIG.YEAR_HEIGHT | typeof VIRTUAL_SCROLL_CONFIG.MOBILE_YEAR_HEIGHT | typeof VIRTUAL_SCROLL_CONFIG.TABLET_YEAR_HEIGHT;
46
- screenSize: "mobile" | "tablet" | "desktop";
47
- };
48
- export declare const useVirtualScroll: ({ currentDate, yearHeight, onCurrentYearChange, }: UseVirtualScrollProps) => UseVirtualScrollReturn;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import type { LocaleCode, TranslationKey } from './types';
3
- export interface LocaleContextValue {
4
- locale: LocaleCode;
5
- t: (key: TranslationKey, vars?: Record<string, string>) => string;
6
- getWeekDaysLabels: (locale: string, format?: 'long' | 'short' | 'narrow') => string[];
7
- getMonthLabels: (locale: string, format?: 'long' | 'short' | 'narrow' | 'numeric' | '2-digit') => string[];
8
- isDefault?: boolean;
9
- }
10
- export declare const LocaleContext: React.Context<LocaleContextValue>;
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import type { LocaleCode, LocaleMessages, Locale } from './types';
3
- export interface LocaleProviderProps {
4
- locale?: LocaleCode | Locale;
5
- messages?: LocaleMessages;
6
- children?: React.ReactNode;
7
- }
8
- export declare const LocaleProvider: React.FC<LocaleProviderProps>;
@@ -1,7 +0,0 @@
1
- export * from './types';
2
- export * from './translator';
3
- export * from './intl';
4
- export * from './locales';
5
- export * from './utils';
6
- export * from './LocaleContext';
7
- export * from './useLocale';