@dayflow/core 2.0.7 → 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 (171) 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 +2126 -3107
  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 -48
  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/contextMenu/components/EventContextMenu.d.ts +0 -13
  30. package/dist/components/contextMenu/components/GridContextMenu.d.ts +0 -13
  31. package/dist/components/contextMenu/components/Primitives.d.ts +0 -41
  32. package/dist/components/contextMenu/index.d.ts +0 -4
  33. package/dist/components/contextMenu/utils.d.ts +0 -5
  34. package/dist/components/dayView/DayContent.d.ts +0 -55
  35. package/dist/components/dayView/RightPanel.d.ts +0 -16
  36. package/dist/components/dayView/util.d.ts +0 -8
  37. package/dist/components/eventLayout/constants.d.ts +0 -8
  38. package/dist/components/eventLayout/index.d.ts +0 -129
  39. package/dist/components/eventLayout/types.d.ts +0 -23
  40. package/dist/components/eventLayout/utils.d.ts +0 -5
  41. package/dist/components/mobileEventDrawer/DefaultMobileEventDrawer.d.ts +0 -3
  42. package/dist/components/mobileEventDrawer/components/Switch.d.ts +0 -7
  43. package/dist/components/mobileEventDrawer/components/TimePickerWheel.d.ts +0 -7
  44. package/dist/components/mobileEventDrawer/index.d.ts +0 -3
  45. package/dist/components/monthView/MonthDragIndicator.d.ts +0 -12
  46. package/dist/components/monthView/MultiDayEvent.d.ts +0 -31
  47. package/dist/components/monthView/WeekComponent.d.ts +0 -52
  48. package/dist/components/monthView/util.d.ts +0 -11
  49. package/dist/components/rangePicker/components/CalendarGrid.d.ts +0 -13
  50. package/dist/components/rangePicker/components/CalendarHeader.d.ts +0 -11
  51. package/dist/components/rangePicker/components/RangePickerPanel.d.ts +0 -25
  52. package/dist/components/rangePicker/components/TimeSelector.d.ts +0 -21
  53. package/dist/components/rangePicker/constants.d.ts +0 -5
  54. package/dist/components/rangePicker/index.d.ts +0 -4
  55. package/dist/components/rangePicker/types.d.ts +0 -23
  56. package/dist/components/rangePicker/utils.d.ts +0 -2
  57. package/dist/components/search/MobileSearchDialog.d.ts +0 -14
  58. package/dist/components/search/SearchDrawer.d.ts +0 -13
  59. package/dist/components/search/SearchResultsList.d.ts +0 -11
  60. package/dist/components/sidebar/DefaultCalendarSidebar.d.ts +0 -4
  61. package/dist/components/sidebar/components/CalendarList.d.ts +0 -16
  62. package/dist/components/sidebar/components/DeleteCalendarDialog.d.ts +0 -14
  63. package/dist/components/sidebar/components/ImportCalendarDialog.d.ts +0 -11
  64. package/dist/components/sidebar/components/MergeCalendarDialog.d.ts +0 -9
  65. package/dist/components/sidebar/components/MergeMenuItem.d.ts +0 -9
  66. package/dist/components/sidebar/components/SidebarHeader.d.ts +0 -7
  67. package/dist/components/weekView/AllDayRow.d.ts +0 -49
  68. package/dist/components/weekView/DragIndicator/DefaultDragIndicator.d.ts +0 -2
  69. package/dist/components/weekView/DragIndicator/DragIndicatorComponent.d.ts +0 -7
  70. package/dist/components/weekView/TimeGrid.d.ts +0 -52
  71. package/dist/components/weekView/util.d.ts +0 -9
  72. package/dist/components/yearView/DefaultYearView.d.ts +0 -14
  73. package/dist/components/yearView/FixedWeekYearView.d.ts +0 -17
  74. package/dist/components/yearView/YearDayCell.d.ts +0 -13
  75. package/dist/components/yearView/YearMultiDayEvent.d.ts +0 -22
  76. package/dist/components/yearView/YearRowComponent.d.ts +0 -26
  77. package/dist/components/yearView/utils.d.ts +0 -19
  78. package/dist/contexts/ThemeContext.d.ts +0 -38
  79. package/dist/core/CalendarApp.d.ts +0 -85
  80. package/dist/core/DayFlowCalendar.d.ts +0 -20
  81. package/dist/core/calendarRegistry.d.ts +0 -121
  82. package/dist/core/config.d.ts +0 -60
  83. package/dist/core/index.d.ts +0 -6
  84. package/dist/core/useCalendarApp.d.ts +0 -2
  85. package/dist/factories/ViewAdapter.d.ts +0 -4
  86. package/dist/factories/createDayView.d.ts +0 -3
  87. package/dist/factories/createMonthView.d.ts +0 -3
  88. package/dist/factories/createWeekView.d.ts +0 -3
  89. package/dist/factories/createYearView.d.ts +0 -3
  90. package/dist/factories/index.d.ts +0 -10
  91. package/dist/hooks/drag/index.d.ts +0 -7
  92. package/dist/hooks/drag/useDrag.d.ts +0 -2
  93. package/dist/hooks/drag/useDragCommon.d.ts +0 -2
  94. package/dist/hooks/drag/useDragHandlers.d.ts +0 -2
  95. package/dist/hooks/drag/useDragManager.d.ts +0 -2
  96. package/dist/hooks/drag/useDragState.d.ts +0 -2
  97. package/dist/hooks/drag/useMonthDrag.d.ts +0 -2
  98. package/dist/hooks/drag/useWeekDayDrag.d.ts +0 -2
  99. package/dist/hooks/useCalendarDrop.d.ts +0 -19
  100. package/dist/hooks/useKeyboardShortcuts.d.ts +0 -12
  101. package/dist/hooks/virtualScroll/index.d.ts +0 -2
  102. package/dist/hooks/virtualScroll/useVirtualMonthScroll.d.ts +0 -7
  103. package/dist/hooks/virtualScroll/useVirtualScroll.d.ts +0 -48
  104. package/dist/locale/LocaleContext.d.ts +0 -10
  105. package/dist/locale/LocaleProvider.d.ts +0 -8
  106. package/dist/locale/index.d.ts +0 -7
  107. package/dist/locale/intl.d.ts +0 -16
  108. package/dist/locale/locales/de.d.ts +0 -3
  109. package/dist/locale/locales/en.d.ts +0 -3
  110. package/dist/locale/locales/es.d.ts +0 -3
  111. package/dist/locale/locales/fr.d.ts +0 -3
  112. package/dist/locale/locales/index.d.ts +0 -18
  113. package/dist/locale/locales/ja.d.ts +0 -3
  114. package/dist/locale/locales/ko.d.ts +0 -3
  115. package/dist/locale/locales/zh.d.ts +0 -3
  116. package/dist/locale/translator.d.ts +0 -9
  117. package/dist/locale/types.d.ts +0 -8
  118. package/dist/locale/useLocale.d.ts +0 -5
  119. package/dist/locale/utils.d.ts +0 -10
  120. package/dist/plugins/dragPlugin.d.ts +0 -5
  121. package/dist/plugins/eventsPlugin.d.ts +0 -3
  122. package/dist/plugins/index.d.ts +0 -6
  123. package/dist/setupTests.d.ts +0 -1
  124. package/dist/styles/classNames.d.ts +0 -381
  125. package/dist/types/calendar.d.ts +0 -26
  126. package/dist/types/calendarTypes.d.ts +0 -68
  127. package/dist/types/config.d.ts +0 -19
  128. package/dist/types/core.d.ts +0 -265
  129. package/dist/types/dragIndicator.d.ts +0 -160
  130. package/dist/types/event.d.ts +0 -18
  131. package/dist/types/eventDetail.d.ts +0 -74
  132. package/dist/types/factory.d.ts +0 -156
  133. package/dist/types/hook.d.ts +0 -103
  134. package/dist/types/index.d.ts +0 -13
  135. package/dist/types/layout.d.ts +0 -113
  136. package/dist/types/mobileEvent.d.ts +0 -21
  137. package/dist/types/monthView.d.ts +0 -65
  138. package/dist/types/plugin.d.ts +0 -80
  139. package/dist/types/search.d.ts +0 -35
  140. package/dist/utils/calendarDataUtils.d.ts +0 -83
  141. package/dist/utils/clipboardStore.d.ts +0 -10
  142. package/dist/utils/colorUtils.d.ts +0 -27
  143. package/dist/utils/compareUtils.d.ts +0 -5
  144. package/dist/utils/dateConstants.d.ts +0 -22
  145. package/dist/utils/dateFormat.d.ts +0 -15
  146. package/dist/utils/dateRangeUtils.d.ts +0 -24
  147. package/dist/utils/dateTimeUtils.d.ts +0 -49
  148. package/dist/utils/eventHelpers.d.ts +0 -143
  149. package/dist/utils/eventUtils.d.ts +0 -115
  150. package/dist/utils/helpers.d.ts +0 -27
  151. package/dist/utils/ics/icsDateUtils.d.ts +0 -37
  152. package/dist/utils/ics/icsGenerator.d.ts +0 -23
  153. package/dist/utils/ics/icsParser.d.ts +0 -15
  154. package/dist/utils/ics/index.d.ts +0 -16
  155. package/dist/utils/ics/types.d.ts +0 -91
  156. package/dist/utils/index.d.ts +0 -10
  157. package/dist/utils/logger.d.ts +0 -15
  158. package/dist/utils/rangePicker.d.ts +0 -8
  159. package/dist/utils/searchUtils.d.ts +0 -35
  160. package/dist/utils/styleUtils.d.ts +0 -24
  161. package/dist/utils/temporal.d.ts +0 -100
  162. package/dist/utils/temporalTypeGuards.d.ts +0 -63
  163. package/dist/utils/testDataUtils.d.ts +0 -14
  164. package/dist/utils/themeUtils.d.ts +0 -93
  165. package/dist/utils/throttle.d.ts +0 -11
  166. package/dist/utils/timeUtils.d.ts +0 -38
  167. package/dist/utils/utilityFunctions.d.ts +0 -11
  168. package/dist/views/DayView.d.ts +0 -4
  169. package/dist/views/MonthView.d.ts +0 -4
  170. package/dist/views/WeekView.d.ts +0 -4
  171. package/dist/views/YearView.d.ts +0 -15
@@ -1,27 +0,0 @@
1
- /**
2
- * Color Utilities
3
- *
4
- * This module provides utilities for resolving event colors using the calendar registry.
5
- * All color functions return actual color values (not CSS classes) for inline styles.
6
- */
7
- import { CalendarRegistry } from '../core/calendarRegistry';
8
- /**
9
- * Get event background color (actual color value, not CSS class)
10
- * Use this for inline styles
11
- */
12
- export declare const getEventBgColor: (calendarIdOrColor: string, registry?: CalendarRegistry) => string;
13
- /**
14
- * Get event text color (actual color value, not CSS class)
15
- * Use this for inline styles
16
- */
17
- export declare const getEventTextColor: (calendarIdOrColor: string, registry?: CalendarRegistry) => string;
18
- /**
19
- * Get selected background color
20
- * Now uses the calendar registry for color resolution
21
- */
22
- export declare const getSelectedBgColor: (calendarIdOrColor: string, registry?: CalendarRegistry) => string;
23
- /**
24
- * Get line color
25
- * Now uses the calendar registry for color resolution
26
- */
27
- export declare const getLineColor: (calendarIdOrColor: string, registry?: CalendarRegistry) => string;
@@ -1,5 +0,0 @@
1
- /**
2
- * Performs a deep comparison between two values to determine if they are equivalent.
3
- * Supports primitives, Date objects, and plain objects/arrays.
4
- */
5
- export declare function isDeepEqual(a: any, b: any): boolean;
@@ -1,22 +0,0 @@
1
- /**
2
- * Date Constants
3
- *
4
- * This module provides constant arrays for day and month names in various formats.
5
- * Used throughout the application for displaying date information.
6
- */
7
- /**
8
- * Week day abbreviations (Mon-Sun)
9
- */
10
- export declare const weekDays: string[];
11
- /**
12
- * Full week day names (Monday-Sunday)
13
- */
14
- export declare const weekDaysFullName: string[];
15
- /**
16
- * Full month names (January-December)
17
- */
18
- export declare const monthNames: string[];
19
- /**
20
- * Month abbreviations (Jan-Dec)
21
- */
22
- export declare const shortMonthNames: string[];
@@ -1,15 +0,0 @@
1
- import { Temporal } from 'temporal-polyfill';
2
- /**
3
- * Format date to DD/MM/YYYY format
4
- * Ensures consistent server and client rendering
5
- */
6
- export declare const formatDateConsistent: (date?: Date | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime) => string;
7
- /**
8
- * Format month and year to consistent format
9
- */
10
- export declare const formatMonthYear: (date: Date) => string;
11
- /**
12
- * Format date to "DD MMM YYYY" format (e.g., "15 Jan 2025")
13
- * Used for event detail display
14
- */
15
- export declare const formatDate: (temporal: Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime) => string;
@@ -1,24 +0,0 @@
1
- /**
2
- * Date Range Utilities
3
- *
4
- * This module provides utilities for calculating date ranges, particularly
5
- * for week-based operations (Monday-Sunday).
6
- */
7
- /**
8
- * Get the Monday-Sunday range for a given date
9
- * @param date Input date
10
- * @returns Object with monday and sunday dates
11
- */
12
- export declare const getWeekRange: (date: Date) => {
13
- monday: Date;
14
- sunday: Date;
15
- };
16
- /**
17
- * Get current week dates (Monday-Sunday) with today indicator
18
- * @returns Array of 7 date objects with date, month, and isToday flag
19
- */
20
- export declare const getCurrentWeekDates: () => {
21
- date: number;
22
- month: string;
23
- isToday: boolean;
24
- }[];
@@ -1,49 +0,0 @@
1
- /**
2
- * Date and Time Conversion Utilities
3
- *
4
- * This module provides utilities for converting between Date and Temporal API objects,
5
- * extracting time components, and performing date comparisons.
6
- *
7
- * All functions support both legacy Date objects and modern Temporal API types
8
- * for backward compatibility and future-proofing.
9
- */
10
- import { Temporal } from 'temporal-polyfill';
11
- /**
12
- * Extract hour number from Date or Temporal object (with decimal for minutes, e.g., 14.5 = 14:30)
13
- * @param dateTime Date or Temporal object
14
- * @returns Hour number (0-24, supports decimals)
15
- */
16
- export declare const extractHourFromDate: (dateTime: Date | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime) => number;
17
- /**
18
- * Create a new date-time object based on given date but set to specified hour
19
- * @param baseDateTime Base date-time
20
- * @param hour Hour number (supports decimals, e.g., 14.5 = 14:30)
21
- * @returns Date or Temporal (PlainDateTime or ZonedDateTime)
22
- */
23
- export declare const createDateWithHour: (baseDateTime: Date | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime, hour: number) => Date | Temporal.PlainDateTime | Temporal.ZonedDateTime;
24
- /**
25
- * Get start of day (00:00:00.000)
26
- * @param dateTime Date-time
27
- * @returns Start of day
28
- */
29
- export declare const getStartOfDay: (dateTime: Date | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime) => Date | Temporal.ZonedDateTime;
30
- /**
31
- * Get end of day (23:59:59.999)
32
- * @param dateTime Date-time
33
- * @returns End of day
34
- */
35
- export declare const getEndOfDay: (dateTime: Date | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime) => Date | Temporal.ZonedDateTime;
36
- /**
37
- * Check if two dates are on the same day
38
- * @param date1 Date 1
39
- * @param date2 Date 2
40
- * @returns Whether they are the same day
41
- */
42
- export declare const isSameDay: (date1: Date | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime, date2: Date | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime) => boolean;
43
- /**
44
- * Check if event spans multiple days
45
- * @param start Start time
46
- * @param end End time
47
- * @returns Whether it's a multi-day event
48
- */
49
- export declare const isMultiDayEvent: (start: Date | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime, end: Date | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime) => boolean;
@@ -1,143 +0,0 @@
1
- /**
2
- * Event Helper Functions
3
- *
4
- * This module provides simplified APIs for creating events.
5
- * Provides multiple layers of abstraction:
6
- * - Simple API: createSimpleEvent() - for local events without timezone complexity
7
- * - Advanced API: createEventWithTimeZone() - for timezone-aware events
8
- * - Direct API: Users can still use Temporal API directly for full control
9
- */
10
- import { Temporal } from 'temporal-polyfill';
11
- import { Event } from '../types';
12
- /**
13
- * Event creation parameters - supports both Date and Temporal types
14
- * For local events (no timezone)
15
- */
16
- export interface CreateEventParams {
17
- id: string;
18
- title: string;
19
- description?: string;
20
- start: Date | Temporal.PlainDate | Temporal.PlainDateTime;
21
- end: Date | Temporal.PlainDate | Temporal.PlainDateTime;
22
- allDay?: boolean;
23
- calendarId?: string;
24
- meta?: Record<string, any>;
25
- }
26
- /**
27
- * Timezone event creation parameters
28
- * For events that need explicit timezone handling
29
- */
30
- export interface CreateTimezoneEventParams {
31
- id: string;
32
- title: string;
33
- description?: string;
34
- start: Date | Temporal.ZonedDateTime;
35
- end: Date | Temporal.ZonedDateTime;
36
- timeZone: string;
37
- calendarId?: string;
38
- meta?: Record<string, any>;
39
- }
40
- /**
41
- * Create local event (recommended for most use cases)
42
- *
43
- * Supports flexible input types:
44
- * - Date objects (automatically converted)
45
- * - Temporal.PlainDate (for all-day events)
46
- * - Temporal.PlainDateTime (for timed events)
47
- *
48
- * @example
49
- * // Using Date objects
50
- * createEvent({
51
- * id: '1',
52
- * title: 'Team Meeting',
53
- * start: new Date(2025, 0, 15, 14, 30),
54
- * end: new Date(2025, 0, 15, 16, 0),
55
- * });
56
- *
57
- * @example
58
- * // Using Temporal.PlainDateTime
59
- * createEvent({
60
- * id: '2',
61
- * title: 'Workshop',
62
- * start: Temporal.PlainDateTime.from('2025-01-15T09:00'),
63
- * end: Temporal.PlainDateTime.from('2025-01-15T17:00'),
64
- * });
65
- *
66
- * @example
67
- * // All-day event
68
- * createEvent({
69
- * id: '3',
70
- * title: 'Birthday',
71
- * start: new Date(2025, 0, 15),
72
- * end: new Date(2025, 0, 15),
73
- * allDay: true,
74
- * });
75
- */
76
- export declare function createEvent(params: CreateEventParams): Event;
77
- /**
78
- * Create timezone-aware event
79
- *
80
- * Use this when you need explicit timezone control, such as:
81
- * - International meetings across timezones
82
- * - Flight schedules
83
- * - Events that need to show in different timezones
84
- *
85
- * Supports flexible input types:
86
- * - Date objects (converted using specified timezone)
87
- * - Temporal.ZonedDateTime (used directly)
88
- *
89
- * @example
90
- * // Using Date objects
91
- * createTimezoneEvent({
92
- * id: '1',
93
- * title: 'International Conference',
94
- * start: new Date(2025, 0, 15, 14, 0),
95
- * end: new Date(2025, 0, 15, 16, 0),
96
- * timeZone: 'America/New_York'
97
- * });
98
- *
99
- * @example
100
- * // Using ZonedDateTime
101
- * createTimezoneEvent({
102
- * id: '2',
103
- * title: 'Asia-US Sync',
104
- * start: Temporal.ZonedDateTime.from('2025-01-15T09:00[Asia/Shanghai]'),
105
- * end: Temporal.ZonedDateTime.from('2025-01-15T10:00[Asia/Shanghai]'),
106
- * timeZone: 'Asia/Shanghai', // Only used if start/end are Date objects
107
- * });
108
- */
109
- export declare function createTimezoneEvent(params: CreateTimezoneEventParams): Event;
110
- /**
111
- * Create multiple local events at once
112
- */
113
- export declare function createEvents(paramsArray: CreateEventParams[]): Event[];
114
- /**
115
- * Create multiple timezone-aware events at once
116
- */
117
- export declare function createTimezoneEvents(paramsArray: CreateTimezoneEventParams[]): Event[];
118
- /**
119
- * Quick create all-day event
120
- */
121
- export declare function createAllDayEvent(id: string, title: string, date: Date, options?: Omit<CreateEventParams, 'id' | 'title' | 'start' | 'end' | 'allDay'>): Event;
122
- /**
123
- * Quick create timed event
124
- */
125
- export declare function createTimedEvent(id: string, title: string, start: Date, end: Date, options?: Omit<CreateEventParams, 'id' | 'title' | 'start' | 'end'>): Event;
126
- /**
127
- * Convert legacy Date-based event to Temporal-based event
128
- * @deprecated Use createEvent() directly with Date objects instead
129
- */
130
- export declare function convertDateEvent(id: string, title: string, startDate: Date, endDate: Date, allDay?: boolean, options?: {
131
- description?: string;
132
- calendarId?: string;
133
- meta?: Record<string, any>;
134
- }): Event;
135
- /**
136
- * Convert legacy Date-based event to timezone-aware event
137
- * @deprecated Use createTimezoneEvent() directly with Date objects instead
138
- */
139
- export declare function convertDateEventWithTimeZone(id: string, title: string, startDate: Date, endDate: Date, timeZone: string, options?: {
140
- description?: string;
141
- calendarId?: string;
142
- meta?: Record<string, any>;
143
- }): Event;
@@ -1,115 +0,0 @@
1
- /**
2
- * Event Utilities
3
- *
4
- * This module provides utilities for event operations including:
5
- * - Filtering events by day and type
6
- * - Calculating day indices based on week start dates
7
- * - Creating and updating events with proper date/time handling
8
- * - Converting between Date and Temporal API objects
9
- */
10
- import { Event } from '../types';
11
- /**
12
- * Get regular (non-all-day) events for a specific day index
13
- * @param dayIndex Day index (0-6, Monday-Sunday)
14
- * @param events Array of events
15
- * @returns Filtered events
16
- */
17
- export declare const getEventsForDay: (dayIndex: number, events: Event[]) => Event[];
18
- /**
19
- * Get all-day events for a specific day index
20
- * Supports date range checking when weekStart is provided
21
- * @param dayIndex Day index (0-6, Monday-Sunday)
22
- * @param events Array of events
23
- * @param weekStart Optional week start date for accurate date range checking
24
- * @returns Filtered all-day events
25
- */
26
- export declare const getAllDayEventsForDay: (dayIndex: number, events: Event[], weekStart?: Date) => Event[];
27
- /**
28
- * Get Date object for a specific day index relative to week start
29
- * @param weekStart Week start date
30
- * @param dayIndex Day index (0-6)
31
- * @returns Date object
32
- */
33
- export declare const getDateByDayIndex: (weekStart: Date, dayIndex: number) => Date;
34
- /**
35
- * Update event's date and dayIndex
36
- * @param event Event to update
37
- * @param newDayIndex New day index
38
- * @param weekStart Week start date
39
- * @returns Updated event
40
- */
41
- export declare const updateEventDateAndDay: (event: Event, newDayIndex: number, weekStart: Date) => Event;
42
- /**
43
- * Create new event with Date fields set
44
- * @param eventData Event data without start/end
45
- * @param weekStart Week start date
46
- * @returns Complete event with Temporal start/end
47
- */
48
- export declare const createEventWithDate: (eventData: Omit<Event, "start" | "end">, weekStart: Date) => Event;
49
- /**
50
- * Calculate day index based on real date and current week start
51
- * @param eventDate Event date
52
- * @param weekStart Week start date
53
- * @returns Day index (can be outside 0-6 range for events outside current week)
54
- */
55
- export declare const calculateDayIndex: (eventDate: Date, weekStart: Date) => number;
56
- /**
57
- * Check if event is within current week range
58
- * @param eventDate Event date
59
- * @param weekStart Week start date
60
- * @returns Whether event is in the week
61
- */
62
- export declare const isEventInWeek: (eventDate: Date, weekStart: Date) => boolean;
63
- /**
64
- * Recalculate day field for all events (based on current week)
65
- * @param events Array of events
66
- * @param weekStart Week start date
67
- * @returns Events with updated day indices
68
- */
69
- export declare const recalculateEventDays: (events: Event[], weekStart: Date) => Event[];
70
- /**
71
- * Get day index by Date (relative to week start)
72
- * @param weekStart Week start date
73
- * @param targetDate Target date
74
- * @returns Day index
75
- */
76
- export declare const getDayIndexByDate: (weekStart: Date, targetDate: Date) => number;
77
- /**
78
- * Get events within specified week range
79
- * @param events Array of events
80
- * @param weekStart Week start date
81
- * @returns Filtered and recalculated events
82
- */
83
- export declare const getEventsForWeek: (events: Event[], weekStart: Date) => Event[];
84
- /**
85
- * Create event with real date
86
- * @param eventData Event data without start/end
87
- * @param weekStart Week start date
88
- * @returns Complete event
89
- */
90
- export declare const createEventWithRealDate: (eventData: Omit<Event, "start" | "end">, weekStart: Date) => Event;
91
- /**
92
- * Update event with real date
93
- * @param event Event to update
94
- * @param newDayIndex New day index
95
- * @param weekStart Week start date
96
- * @returns Updated event
97
- */
98
- export declare const updateEventWithRealDate: (event: Event, newDayIndex: number, weekStart: Date) => Event;
99
- /**
100
- * Create event with PlainDateTime (default for local events)
101
- * This is the recommended function for creating events without timezone complexity
102
- */
103
- export declare const createEventWithPlainDateTime: (eventData: Omit<Event, "start" | "end">, weekStart: Date) => Event;
104
- /**
105
- * Create event with ZonedDateTime (for timezone-aware events)
106
- * Use when explicit timezone control is needed
107
- */
108
- export declare const createEventWithZonedDateTime: (eventData: Omit<Event, "start" | "end">, weekStart: Date, timeZone: string) => Event;
109
- /**
110
- * Compare two events for equality
111
- * @param event1 First event
112
- * @param event2 Second event
113
- * @returns Whether events are equal in content
114
- */
115
- export declare const isEventEqual: (event1: Event | null, event2: Event | null) => boolean;
@@ -1,27 +0,0 @@
1
- /**
2
- * Helpers Module - Backward Compatibility Exports
3
- *
4
- * This file has been refactored into multiple specialized modules for better organization.
5
- * All functions are re-exported here for backward compatibility with existing code.
6
- *
7
- * New code should import directly from the specific utility modules:
8
- * - dateTimeUtils.ts - Date/time conversion and comparison functions
9
- * - colorUtils.ts - Color resolution functions
10
- * - timeUtils.ts - Time formatting and calculations
11
- * - dateConstants.ts - Day and month name constants
12
- * - dateRangeUtils.ts - Week range calculations
13
- * - calendarDataUtils.ts - Calendar data generation
14
- * - eventUtils.ts - Event filtering and manipulation
15
- * - testDataUtils.ts - Test/demo data generation
16
- * - utilityFunctions.ts - General utility functions
17
- */
18
- export { extractHourFromDate, createDateWithHour, getStartOfDay, getEndOfDay, isSameDay, isMultiDayEvent, } from './dateTimeUtils';
19
- export { getEventBgColor, getEventTextColor, getSelectedBgColor, getLineColor, } from './colorUtils';
20
- export { TIME_STEP, formatTime, formatEventTimeRange, roundToTimeStep, getEventEndHour, } from './timeUtils';
21
- export { weekDays, weekDaysFullName, monthNames, shortMonthNames, } from './dateConstants';
22
- export { getWeekRange, getCurrentWeekDates } from './dateRangeUtils';
23
- export { generateDayData, generateWeekData, getMonthYearOfWeek, generateWeeksData, generateWeekRange, } from './calendarDataUtils';
24
- export { getEventsForDay, getAllDayEventsForDay, getDateByDayIndex, updateEventDateAndDay, createEventWithDate, calculateDayIndex, isEventInWeek, recalculateEventDays, getDayIndexByDate, getEventsForWeek, createEventWithRealDate, updateEventWithRealDate, isEventEqual, } from './eventUtils';
25
- export { getTestEvents } from './testDataUtils';
26
- export { generateUniKey } from './utilityFunctions';
27
- export { isDeepEqual } from './compareUtils';
@@ -1,37 +0,0 @@
1
- /**
2
- * ICS Date Utilities
3
- *
4
- * Convert between ICS date formats (RFC 5545) and Temporal API types.
5
- *
6
- * ICS Date Formats:
7
- * 1. DATE (all-day): YYYYMMDD (e.g., 20250115)
8
- * 2. DATE-TIME (local): YYYYMMDDTHHMMSS (e.g., 20250115T143000)
9
- * 3. DATE-TIME (UTC): YYYYMMDDTHHMMSSZ (e.g., 20250115T143000Z)
10
- * 4. DATE-TIME (with TZID): DTSTART;TZID=America/New_York:20250115T143000
11
- */
12
- import { Temporal } from 'temporal-polyfill';
13
- import { ICSDateParams } from './types';
14
- /**
15
- * Parse ICS date string to Temporal type
16
- *
17
- * @param dateStr - ICS date string
18
- * @param params - Date parameters (VALUE, TZID)
19
- * @param defaultTimeZone - Default timezone when none specified
20
- * @returns Temporal.PlainDate, PlainDateTime, or ZonedDateTime
21
- */
22
- export declare function parseICSDate(dateStr: string, params?: ICSDateParams, defaultTimeZone?: string): Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime;
23
- /**
24
- * Format Temporal type to ICS date string
25
- *
26
- * @param temporal - Temporal date/time object
27
- * @param allDay - Force all-day format
28
- * @returns Object with value and optional params
29
- */
30
- export declare function formatICSDate(temporal: Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime, allDay?: boolean): {
31
- value: string;
32
- params?: Record<string, string>;
33
- };
34
- /**
35
- * Format a Date to ICS timestamp (UTC format for DTSTAMP)
36
- */
37
- export declare function formatDateToICSTimestamp(date: Date): string;
@@ -1,23 +0,0 @@
1
- /**
2
- * ICS Generator
3
- *
4
- * Generates iCalendar (.ics) files from DayFlow Event objects.
5
- * Supports standard RFC 5545 components.
6
- */
7
- import { Event } from '../../types/event';
8
- import { ICSExportOptions } from './types';
9
- /**
10
- * Generate ICS content string from events
11
- *
12
- * @param events - List of DayFlow events to export
13
- * @param options - Export options
14
- * @returns ICS file content string
15
- */
16
- export declare function generateICS(events: Event[], options?: ICSExportOptions): string;
17
- /**
18
- * Trigger download of ICS file (Browser only)
19
- *
20
- * @param events - Events to export
21
- * @param options - Export options
22
- */
23
- export declare function downloadICS(events: Event[], options?: ICSExportOptions): void;
@@ -1,15 +0,0 @@
1
- /**
2
- * ICS Parser
3
- *
4
- * Parses iCalendar (.ics) format into DayFlow Event objects.
5
- * Supports standard RFC 5545 VEVENT components.
6
- */
7
- import { ICSImportOptions, ICSImportResult } from './types';
8
- /**
9
- * Main function to parse ICS content string
10
- *
11
- * @param icsContent - Raw string content of the .ics file
12
- * @param options - Import options
13
- * @returns Result object containing success flag, events, and errors
14
- */
15
- export declare function parseICS(icsContent: string, options?: ICSImportOptions): ICSImportResult;
@@ -1,16 +0,0 @@
1
- /**
2
- * ICS Utilities Module
3
- */
4
- import { ICSImportResult, ICSImportOptions } from './types';
5
- export * from './types';
6
- export * from './icsDateUtils';
7
- export * from './icsParser';
8
- export * from './icsGenerator';
9
- /**
10
- * Import events from an ICS file object
11
- *
12
- * @param file - The File object (from input[type="file"])
13
- * @param options - Import options
14
- * @returns Promise resolving to import result
15
- */
16
- export declare function importICSFile(file: File, options?: ICSImportOptions): Promise<ICSImportResult>;
@@ -1,91 +0,0 @@
1
- /**
2
- * ICS (iCalendar) Types
3
- *
4
- * Type definitions for ICS file import/export functionality.
5
- * Based on RFC 5545 iCalendar specification.
6
- */
7
- import { Event } from '../../types/event';
8
- /**
9
- * ICS VEVENT raw data structure (intermediate format after parsing)
10
- */
11
- export interface ICSVEvent {
12
- /** Unique identifier */
13
- uid: string;
14
- /** Event summary/title */
15
- summary: string;
16
- /** Event description */
17
- description?: string;
18
- /** Start date/time in ICS format */
19
- dtstart: string;
20
- /** End date/time in ICS format */
21
- dtend: string;
22
- /** DTSTART parameters */
23
- dtstartParams?: ICSDateParams;
24
- /** DTEND parameters */
25
- dtendParams?: ICSDateParams;
26
- /** Event location */
27
- location?: string;
28
- /** Event categories */
29
- categories?: string[];
30
- }
31
- /**
32
- * ICS date/time parameters
33
- */
34
- export interface ICSDateParams {
35
- /** Value type: DATE for all-day, DATE-TIME for timed events */
36
- value?: 'DATE' | 'DATE-TIME';
37
- /** Timezone identifier (e.g., "America/New_York") */
38
- tzid?: string;
39
- }
40
- /**
41
- * ICS import options
42
- */
43
- export interface ICSImportOptions {
44
- /** Default calendar ID for imported events */
45
- calendarId?: string;
46
- /** Generate new IDs for imported events (default: true) */
47
- generateNewIds?: boolean;
48
- /** ID prefix for generated IDs (default: "ics-") */
49
- idPrefix?: string;
50
- /** Default timezone when ICS has no timezone info */
51
- defaultTimeZone?: string;
52
- }
53
- /**
54
- * ICS export options
55
- */
56
- export interface ICSExportOptions {
57
- /** Calendar name in exported file */
58
- calendarName?: string;
59
- /** Product identifier */
60
- productId?: string;
61
- /** Include timezone information */
62
- includeTimezone?: boolean;
63
- /** Export filename (without extension) */
64
- filename?: string;
65
- }
66
- /**
67
- * ICS import result
68
- */
69
- export interface ICSImportResult {
70
- /** Whether import completed without errors */
71
- success: boolean;
72
- /** Successfully imported events */
73
- events: Event[];
74
- /** Parse errors encountered */
75
- errors: ICSParseError[];
76
- /** Total VEVENTs found in file */
77
- totalParsed: number;
78
- /** Successfully imported event count */
79
- totalImported: number;
80
- }
81
- /**
82
- * ICS parse error
83
- */
84
- export interface ICSParseError {
85
- /** Line number where error occurred */
86
- line?: number;
87
- /** Error message */
88
- message: string;
89
- /** UID of the event that failed (if available) */
90
- eventUid?: string;
91
- }
@@ -1,10 +0,0 @@
1
- export * from './helpers';
2
- export * from './dateFormat';
3
- export { isPlainDate, isPlainDateTime, isZonedDateTime, temporalToDate, plainDateToDate, plainDateTimeToDate, dateToPlainDate, dateToPlainDateTime, dateToZonedDateTime, extractHourFromTemporal, setHourInTemporal, isSameTemporal, getPlainDate, } from './temporalTypeGuards';
4
- export { isDate, zonedDateTimeToDate, createTemporalWithHour, isSamePlainDate, isMultiDayTemporalEvent, getStartOfTemporal, getEndOfTemporal, daysBetween, daysDifference, addDays, now, today, } from './temporal';
5
- export * from './rangePicker';
6
- export * from './styleUtils';
7
- export * from './themeUtils';
8
- export * from './eventHelpers';
9
- export * from './searchUtils';
10
- export * from './ics';
@@ -1,15 +0,0 @@
1
- /**
2
- * Logger utility for DayFlow calendar
3
- * Only logs in development mode
4
- */
5
- declare class Logger {
6
- private isDevelopment;
7
- constructor();
8
- private formatMessage;
9
- log(message: string, ...args: any[]): void;
10
- warn(message: string, ...args: any[]): void;
11
- error(message: string, ...args: any[]): void;
12
- debug(message: string, ...args: any[]): void;
13
- }
14
- export declare const logger: Logger;
15
- export {};
@@ -1,8 +0,0 @@
1
- import { Temporal } from 'temporal-polyfill';
2
- export declare const pad: (input: number) => string;
3
- export declare const mergeFormatTemplate: (dateFormat: string, timeFormat: string) => string;
4
- export declare const buildParseRegExp: (template: string) => RegExp;
5
- export declare const parseTemporalString: (input: string, regExp: RegExp, reference: Temporal.ZonedDateTime, zoneId: string) => Temporal.ZonedDateTime | null;
6
- export declare const getZoneId: (value: Temporal.ZonedDateTime) => string;
7
- export declare const normalizeToZoned: (input: Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime, fallbackZone?: string, fallbackTemporal?: Temporal.ZonedDateTime) => Temporal.ZonedDateTime;
8
- export declare const formatTemporal: (value: Temporal.ZonedDateTime, format: string, timeFormat: string) => string;