@burdenoff/microfe-calendar 2026.510.109
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +88 -0
- package/dist/CalendarRoot.d.ts +33 -0
- package/dist/CalendarRoot.d.ts.map +1 -0
- package/dist/CalendarRoot.js +81 -0
- package/dist/CalendarRoot.js.map +1 -0
- package/dist/CalendarRoutes.d.ts +21 -0
- package/dist/CalendarRoutes.d.ts.map +1 -0
- package/dist/CalendarRoutes.js +69 -0
- package/dist/CalendarRoutes.js.map +1 -0
- package/dist/components/AgendaView.d.ts +6 -0
- package/dist/components/AgendaView.d.ts.map +1 -0
- package/dist/components/AgendaView.js +102 -0
- package/dist/components/AgendaView.js.map +1 -0
- package/dist/components/ConfirmDialog.d.ts +16 -0
- package/dist/components/ConfirmDialog.d.ts.map +1 -0
- package/dist/components/ConfirmDialog.js +79 -0
- package/dist/components/ConfirmDialog.js.map +1 -0
- package/dist/components/DayView.d.ts +6 -0
- package/dist/components/DayView.d.ts.map +1 -0
- package/dist/components/DayView.js +73 -0
- package/dist/components/DayView.js.map +1 -0
- package/dist/components/EventBlock.d.ts +8 -0
- package/dist/components/EventBlock.d.ts.map +1 -0
- package/dist/components/EventBlock.js +38 -0
- package/dist/components/EventBlock.js.map +1 -0
- package/dist/components/EventFormModal.d.ts +14 -0
- package/dist/components/EventFormModal.d.ts.map +1 -0
- package/dist/components/EventFormModal.js +545 -0
- package/dist/components/EventFormModal.js.map +1 -0
- package/dist/components/MiniCalendar.d.ts +6 -0
- package/dist/components/MiniCalendar.d.ts.map +1 -0
- package/dist/components/MiniCalendar.js +73 -0
- package/dist/components/MiniCalendar.js.map +1 -0
- package/dist/components/MonthView.d.ts +6 -0
- package/dist/components/MonthView.d.ts.map +1 -0
- package/dist/components/MonthView.js +70 -0
- package/dist/components/MonthView.js.map +1 -0
- package/dist/components/TimelineView.d.ts +6 -0
- package/dist/components/TimelineView.d.ts.map +1 -0
- package/dist/components/TimelineView.js +99 -0
- package/dist/components/TimelineView.js.map +1 -0
- package/dist/components/ViewSwitcher.d.ts +6 -0
- package/dist/components/ViewSwitcher.d.ts.map +1 -0
- package/dist/components/ViewSwitcher.js +51 -0
- package/dist/components/ViewSwitcher.js.map +1 -0
- package/dist/components/WeekView.d.ts +6 -0
- package/dist/components/WeekView.d.ts.map +1 -0
- package/dist/components/WeekView.js +77 -0
- package/dist/components/WeekView.js.map +1 -0
- package/dist/components/YearView.d.ts +6 -0
- package/dist/components/YearView.d.ts.map +1 -0
- package/dist/components/YearView.js +69 -0
- package/dist/components/YearView.js.map +1 -0
- package/dist/constants/permissions.d.ts +90 -0
- package/dist/constants/permissions.d.ts.map +1 -0
- package/dist/constants/permissions.js +70 -0
- package/dist/constants/permissions.js.map +1 -0
- package/dist/dev/main.d.ts +2 -0
- package/dist/dev/main.d.ts.map +1 -0
- package/dist/generated/global-operations.d.ts +2 -0
- package/dist/generated/global-operations.d.ts.map +1 -0
- package/dist/generated/global-types.d.ts +20716 -0
- package/dist/generated/global-types.d.ts.map +1 -0
- package/dist/generated/wspace-operations.d.ts +906 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -0
- package/dist/generated/wspace-operations.js +456 -0
- package/dist/generated/wspace-operations.js.map +1 -0
- package/dist/generated/wspace-types.d.ts +53363 -0
- package/dist/generated/wspace-types.d.ts.map +1 -0
- package/dist/graphql/calendarDocuments.d.ts +25 -0
- package/dist/graphql/calendarDocuments.d.ts.map +1 -0
- package/dist/graphql/calendarDocuments.js +360 -0
- package/dist/graphql/calendarDocuments.js.map +1 -0
- package/dist/hooks/index.d.ts +11 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/useCalendarPermissions.d.ts +14 -0
- package/dist/hooks/useCalendarPermissions.d.ts.map +1 -0
- package/dist/hooks/useCalendarPermissions.js +48 -0
- package/dist/hooks/useCalendarPermissions.js.map +1 -0
- package/dist/hooks/useEventPermissions.d.ts +15 -0
- package/dist/hooks/useEventPermissions.d.ts.map +1 -0
- package/dist/hooks/useEventPermissions.js +34 -0
- package/dist/hooks/useEventPermissions.js.map +1 -0
- package/dist/hooks/useEvents.d.ts +15 -0
- package/dist/hooks/useEvents.d.ts.map +1 -0
- package/dist/hooks/useEvents.js +199 -0
- package/dist/hooks/useEvents.js.map +1 -0
- package/dist/hooks/useSafePermissions.d.ts +6 -0
- package/dist/hooks/useSafePermissions.d.ts.map +1 -0
- package/dist/hooks/useSafePermissions.js +17 -0
- package/dist/hooks/useSafePermissions.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/pages/CalendarPage.d.ts +5 -0
- package/dist/pages/CalendarPage.d.ts.map +1 -0
- package/dist/pages/CalendarPage.js +239 -0
- package/dist/pages/CalendarPage.js.map +1 -0
- package/dist/pages/EventDetailsPage.d.ts +6 -0
- package/dist/pages/EventDetailsPage.d.ts.map +1 -0
- package/dist/pages/EventDetailsPage.js +625 -0
- package/dist/pages/EventDetailsPage.js.map +1 -0
- package/dist/pages/ResourcesPage.d.ts +6 -0
- package/dist/pages/ResourcesPage.d.ts.map +1 -0
- package/dist/pages/ResourcesPage.js +391 -0
- package/dist/pages/ResourcesPage.js.map +1 -0
- package/dist/pages/SettingsPage.d.ts +2 -0
- package/dist/pages/SettingsPage.d.ts.map +1 -0
- package/dist/pages/SettingsPage.js +798 -0
- package/dist/pages/SettingsPage.js.map +1 -0
- package/dist/pages/SubscriptionsPage.d.ts +6 -0
- package/dist/pages/SubscriptionsPage.d.ts.map +1 -0
- package/dist/pages/SubscriptionsPage.js +170 -0
- package/dist/pages/SubscriptionsPage.js.map +1 -0
- package/dist/providers/CalendarProvider.d.ts +31 -0
- package/dist/providers/CalendarProvider.d.ts.map +1 -0
- package/dist/providers/CalendarProvider.js +53 -0
- package/dist/providers/CalendarProvider.js.map +1 -0
- package/dist/store/calendarStore.d.ts +69 -0
- package/dist/store/calendarStore.d.ts.map +1 -0
- package/dist/store/calendarStore.js +82 -0
- package/dist/store/calendarStore.js.map +1 -0
- package/dist/types/index.d.ts +341 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/utils/dateHelpers.d.ts +115 -0
- package/dist/utils/dateHelpers.d.ts.map +1 -0
- package/dist/utils/dateHelpers.js +86 -0
- package/dist/utils/dateHelpers.js.map +1 -0
- package/dist/utils/icalHelpers.d.ts +19 -0
- package/dist/utils/icalHelpers.d.ts.map +1 -0
- package/dist/utils/icalHelpers.js +57 -0
- package/dist/utils/icalHelpers.js.map +1 -0
- package/dist/utils/nativeBridge.d.ts +3 -0
- package/dist/utils/nativeBridge.d.ts.map +1 -0
- package/dist/utils/nativeBridge.js +2 -0
- package/dist/utils/recurrenceHelpers.d.ts +15 -0
- package/dist/utils/recurrenceHelpers.d.ts.map +1 -0
- package/dist/utils/timezoneHelpers.d.ts +39 -0
- package/dist/utils/timezoneHelpers.d.ts.map +1 -0
- package/package.json +109 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendarStore.js","names":[],"sources":["../../src/store/calendarStore.ts"],"sourcesContent":["import { create } from 'zustand';\nimport { devtools, persist } from 'zustand/middleware';\nimport { createProfileScopedStorage } from '@burdenoff/fe-libs/shared/utils';\nimport type { CalendarViewType, CalendarFilter, CalendarEvent, TimeSlot } from '../types';\n\ninterface CalendarState {\n // View state\n currentView: CalendarViewType;\n currentDate: Date;\n selectedTimeZone: string;\n\n // Calendar filters\n visibleCalendars: Set<string>;\n eventFilter: CalendarFilter;\n\n // Selected items\n selectedEvent: CalendarEvent | null;\n selectedSlot: TimeSlot | null;\n\n // Drag-drop state\n draggedEvent: CalendarEvent | null;\n\n // Mini calendar state\n miniCalendarVisible: boolean;\n\n // Actions\n setView: (view: CalendarViewType) => void;\n setCurrentDate: (date: Date) => void;\n navigateDate: (direction: 'prev' | 'next' | 'today') => void;\n setTimeZone: (timezone: string) => void;\n\n toggleCalendarVisibility: (calendarId: string) => void;\n setVisibleCalendars: (calendarIds: string[]) => void;\n updateEventFilter: (filter: Partial<CalendarFilter>) => void;\n clearFilters: () => void;\n\n selectEvent: (event: CalendarEvent | null) => void;\n selectSlot: (slot: TimeSlot | null) => void;\n\n startDragEvent: (event: CalendarEvent) => void;\n endDragEvent: () => void;\n\n toggleMiniCalendar: () => void;\n setMiniCalendarVisible: (visible: boolean) => void;\n\n reset: () => void;\n}\n\n// Default state\nconst getDefaultState = () => ({\n currentView: 'week' as CalendarViewType,\n currentDate: new Date(),\n selectedTimeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n visibleCalendars: new Set<string>(),\n eventFilter: {},\n selectedEvent: null,\n selectedSlot: null,\n draggedEvent: null,\n miniCalendarVisible: false,\n});\n\nexport const useCalendarStore = create<CalendarState>()(\n devtools(\n persist(\n (set, get) => ({\n ...getDefaultState(),\n\n setView: (view) => set({ currentView: view }),\n\n setCurrentDate: (date) => set({ currentDate: date }),\n\n navigateDate: (direction) => {\n const { currentDate, currentView } = get();\n let newDate = new Date(currentDate);\n\n if (direction === 'today') {\n newDate = new Date();\n } else {\n const increment = direction === 'next' ? 1 : -1;\n switch (currentView) {\n case 'day':\n newDate.setDate(newDate.getDate() + increment);\n break;\n case 'week':\n newDate.setDate(newDate.getDate() + 7 * increment);\n break;\n case 'month':\n newDate.setMonth(newDate.getMonth() + increment);\n break;\n case 'year':\n newDate.setFullYear(newDate.getFullYear() + increment);\n break;\n case 'agenda':\n case 'timeline':\n // For agenda and timeline, navigate by week\n newDate.setDate(newDate.getDate() + 7 * increment);\n break;\n }\n }\n\n set({ currentDate: newDate });\n },\n\n setTimeZone: (timezone) => set({ selectedTimeZone: timezone }),\n\n toggleCalendarVisibility: (calendarId) =>\n set((state) => {\n const newVisible = new Set(state.visibleCalendars);\n if (newVisible.has(calendarId)) {\n newVisible.delete(calendarId);\n } else {\n newVisible.add(calendarId);\n }\n return { visibleCalendars: newVisible };\n }),\n\n setVisibleCalendars: (calendarIds) => set({ visibleCalendars: new Set(calendarIds) }),\n\n updateEventFilter: (filter) =>\n set((state) => ({\n eventFilter: { ...state.eventFilter, ...filter },\n })),\n\n clearFilters: () =>\n set({\n eventFilter: {},\n visibleCalendars: new Set(),\n }),\n\n selectEvent: (event) => set({ selectedEvent: event }),\n\n selectSlot: (slot) => set({ selectedSlot: slot }),\n\n startDragEvent: (event) => set({ draggedEvent: event }),\n\n endDragEvent: () => set({ draggedEvent: null }),\n\n toggleMiniCalendar: () =>\n set((state) => ({ miniCalendarVisible: !state.miniCalendarVisible })),\n\n setMiniCalendarVisible: (visible) => set({ miniCalendarVisible: visible }),\n\n reset: () => set(getDefaultState()),\n }),\n {\n name: 'burdenoff-calendar-storage',\n storage: createProfileScopedStorage(),\n partialize: (state) => ({\n currentView: state.currentView,\n selectedTimeZone: state.selectedTimeZone,\n visibleCalendars: Array.from(state.visibleCalendars),\n miniCalendarVisible: state.miniCalendarVisible,\n }),\n }\n ),\n {\n name: 'Calendar Store',\n enabled: import.meta.env?.DEV ?? false,\n }\n )\n);\n"],"mappings":";;;;AAiDA,IAAM,WAAyB;CAC7B,aAAa;CACb,6BAAa,IAAI,MAAM;CACvB,kBAAkB,KAAK,gBAAgB,CAAC,iBAAiB,CAAC;CAC1D,kCAAkB,IAAI,KAAa;CACnC,aAAa,EAAE;CACf,eAAe;CACf,cAAc;CACd,cAAc;CACd,qBAAqB;CACtB,GAEY,IAAmB,GAAuB,CACrD,EACE,GACG,GAAK,OAAS;CACb,GAAG,GAAiB;CAEpB,UAAU,MAAS,EAAI,EAAE,aAAa,GAAM,CAAC;CAE7C,iBAAiB,MAAS,EAAI,EAAE,aAAa,GAAM,CAAC;CAEpD,eAAe,MAAc;EAC3B,IAAM,EAAE,gBAAa,mBAAgB,GAAK,EACtC,IAAU,IAAI,KAAK,EAAY;AAEnC,MAAI,MAAc,QAChB,qBAAU,IAAI,MAAM;OACf;GACL,IAAM,IAAY,MAAc,SAAS,IAAI;AAC7C,WAAQ,GAAR;IACE,KAAK;AACH,OAAQ,QAAQ,E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AAa,EAAM;EACnB,kBAAkB,EAAM;EACxB,kBAAkB,MAAM,KAAK,EAAM,iBAAiB;EACpD,qBAAqB,EAAM;EAC5B;CACF,CACF,EACD;CACE,MAAM;CACN,SAAA;CACD,CACF,CACF"}
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import { MicrofrontendRootProps } from '@burdenoff/fe-libs/shared/types';
|
|
2
|
+
import { NavItem, FooterItem } from '@burdenoff/fe-libs/shared/hooks/shell';
|
|
3
|
+
|
|
4
|
+
export type { NavItem, FooterItem };
|
|
5
|
+
/**
|
|
6
|
+
* Props for the CalendarRoot component
|
|
7
|
+
*/
|
|
8
|
+
export interface CalendarRootProps extends MicrofrontendRootProps {
|
|
9
|
+
/**
|
|
10
|
+
* Optional callback when an event is selected
|
|
11
|
+
*/
|
|
12
|
+
onEventSelect?: (event: CalendarEventSummary) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Optional callback when an event is created
|
|
15
|
+
*/
|
|
16
|
+
onEventCreate?: (event: CalendarEventSummary) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Optional callback when a resource is booked
|
|
19
|
+
*/
|
|
20
|
+
onResourceBook?: (booking: ResourceBookingSummary) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Default calendar view to show
|
|
23
|
+
*/
|
|
24
|
+
defaultView?: CalendarViewType;
|
|
25
|
+
/**
|
|
26
|
+
* Default time zone
|
|
27
|
+
*/
|
|
28
|
+
defaultTimeZone?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Optional function to register navigation items with the shell
|
|
31
|
+
*/
|
|
32
|
+
registerNavItems?: (items: NavItem | NavItem[]) => () => void;
|
|
33
|
+
/**
|
|
34
|
+
* Optional function to register footer items with the shell
|
|
35
|
+
*/
|
|
36
|
+
registerFooterItems?: (items: FooterItem | FooterItem[]) => () => void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Calendar view types
|
|
40
|
+
*/
|
|
41
|
+
export type CalendarViewType = 'day' | 'week' | 'month' | 'year' | 'agenda' | 'timeline';
|
|
42
|
+
/**
|
|
43
|
+
* Event privacy levels
|
|
44
|
+
*/
|
|
45
|
+
export type EventPrivacy = 'PUBLIC' | 'PRIVATE' | 'CONFIDENTIAL';
|
|
46
|
+
/**
|
|
47
|
+
* Event status
|
|
48
|
+
*/
|
|
49
|
+
export type EventStatus = 'CONFIRMED' | 'TENTATIVE' | 'CANCELLED';
|
|
50
|
+
/**
|
|
51
|
+
* RSVP status for attendees
|
|
52
|
+
*/
|
|
53
|
+
export type RSVPStatus = 'ACCEPTED' | 'DECLINED' | 'TENTATIVE' | 'PENDING';
|
|
54
|
+
/**
|
|
55
|
+
* Recurrence pattern types
|
|
56
|
+
*/
|
|
57
|
+
export type RecurrencePattern = 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'YEARLY' | 'CUSTOM';
|
|
58
|
+
/**
|
|
59
|
+
* Resource types
|
|
60
|
+
*/
|
|
61
|
+
export type ResourceType = 'CONFERENCE_ROOM' | 'EQUIPMENT' | 'DESK' | 'VEHICLE' | 'CUSTOM';
|
|
62
|
+
/**
|
|
63
|
+
* Resource booking status
|
|
64
|
+
*/
|
|
65
|
+
export type BookingStatus = 'PENDING' | 'APPROVED' | 'REJECTED';
|
|
66
|
+
/**
|
|
67
|
+
* Permission levels for calendar sharing
|
|
68
|
+
*/
|
|
69
|
+
export type CalendarPermission = 'VIEW' | 'EDIT' | 'ADMIN';
|
|
70
|
+
/**
|
|
71
|
+
* Calendar visibility options
|
|
72
|
+
*/
|
|
73
|
+
export type CalendarVisibility = 'PRIVATE' | 'WORKSPACE' | 'PUBLIC' | 'CUSTOM';
|
|
74
|
+
/**
|
|
75
|
+
* Reminder method
|
|
76
|
+
*/
|
|
77
|
+
export type ReminderMethod = 'EMAIL' | 'NOTIFICATION' | 'SMS';
|
|
78
|
+
/**
|
|
79
|
+
* Summary of a calendar event for callbacks
|
|
80
|
+
*/
|
|
81
|
+
export interface CalendarEventSummary {
|
|
82
|
+
id: string;
|
|
83
|
+
title: string;
|
|
84
|
+
startTime: Date;
|
|
85
|
+
endTime: Date;
|
|
86
|
+
isAllDay: boolean;
|
|
87
|
+
calendarId: string;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Summary of a resource booking for callbacks
|
|
91
|
+
*/
|
|
92
|
+
export interface ResourceBookingSummary {
|
|
93
|
+
id: string;
|
|
94
|
+
resourceId: string;
|
|
95
|
+
resourceName: string;
|
|
96
|
+
eventId: string;
|
|
97
|
+
startTime: Date;
|
|
98
|
+
endTime: Date;
|
|
99
|
+
status: BookingStatus;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Calendar entity
|
|
103
|
+
*/
|
|
104
|
+
export interface Calendar {
|
|
105
|
+
id: string;
|
|
106
|
+
name: string;
|
|
107
|
+
description?: string;
|
|
108
|
+
color: string;
|
|
109
|
+
ownerId: string;
|
|
110
|
+
visibility: CalendarVisibility;
|
|
111
|
+
shares?: CalendarShare[];
|
|
112
|
+
settings?: CalendarSettings;
|
|
113
|
+
createdAt: Date;
|
|
114
|
+
updatedAt: Date;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Calendar sharing configuration
|
|
118
|
+
*/
|
|
119
|
+
export interface CalendarShare {
|
|
120
|
+
id: string;
|
|
121
|
+
calendarId: string;
|
|
122
|
+
userId: string;
|
|
123
|
+
userEmail: string;
|
|
124
|
+
userName: string;
|
|
125
|
+
permission: CalendarPermission;
|
|
126
|
+
createdAt: Date;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Calendar settings
|
|
130
|
+
*/
|
|
131
|
+
export interface CalendarSettings {
|
|
132
|
+
timeZone?: string;
|
|
133
|
+
workingHours?: WorkingHours;
|
|
134
|
+
defaultEventDuration?: number;
|
|
135
|
+
defaultReminders?: Reminder[];
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Working hours configuration
|
|
139
|
+
*/
|
|
140
|
+
export interface WorkingHours {
|
|
141
|
+
enabled: boolean;
|
|
142
|
+
days: number[];
|
|
143
|
+
startTime: string;
|
|
144
|
+
endTime: string;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Calendar event
|
|
148
|
+
*/
|
|
149
|
+
export interface CalendarEvent {
|
|
150
|
+
id: string;
|
|
151
|
+
calendarId: string;
|
|
152
|
+
calendarName?: string;
|
|
153
|
+
calendarColor?: string;
|
|
154
|
+
title: string;
|
|
155
|
+
description?: string;
|
|
156
|
+
location?: string;
|
|
157
|
+
locationAddress?: string;
|
|
158
|
+
locationUrl?: string;
|
|
159
|
+
locationType?: 'PHYSICAL' | 'ONLINE' | 'HYBRID' | 'TBD';
|
|
160
|
+
startTime: Date;
|
|
161
|
+
endTime: Date;
|
|
162
|
+
isAllDay: boolean;
|
|
163
|
+
privacy: EventPrivacy;
|
|
164
|
+
status: EventStatus;
|
|
165
|
+
eventType?: 'MEETING' | 'TASK' | 'MILESTONE' | 'PROMPT';
|
|
166
|
+
isRecurring?: boolean;
|
|
167
|
+
rrule?: string;
|
|
168
|
+
organizerId: string;
|
|
169
|
+
organizer?: User;
|
|
170
|
+
attendees?: Attendee[];
|
|
171
|
+
recurrence?: RecurrenceRule;
|
|
172
|
+
reminders?: Reminder[];
|
|
173
|
+
category?: EventCategory;
|
|
174
|
+
resourceBookings?: ResourceBooking[];
|
|
175
|
+
attachments?: EventAttachment[];
|
|
176
|
+
videoCallLink?: string;
|
|
177
|
+
onlineMeetingProvider?: string;
|
|
178
|
+
maxAttendees?: number;
|
|
179
|
+
currentAttendeeCount?: number;
|
|
180
|
+
checkInEnabled?: boolean;
|
|
181
|
+
tags?: string[];
|
|
182
|
+
metadata?: Record<string, unknown>;
|
|
183
|
+
sourceKind?: 'calendar' | 'scheduler';
|
|
184
|
+
deepLink?: string;
|
|
185
|
+
createdAt: Date;
|
|
186
|
+
updatedAt: Date;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Event attendee
|
|
190
|
+
*/
|
|
191
|
+
export interface Attendee {
|
|
192
|
+
userId: string;
|
|
193
|
+
email: string;
|
|
194
|
+
name: string;
|
|
195
|
+
status: RSVPStatus;
|
|
196
|
+
isRequired: boolean;
|
|
197
|
+
responseTime?: Date;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Recurrence rule
|
|
201
|
+
*/
|
|
202
|
+
export interface RecurrenceRule {
|
|
203
|
+
pattern: RecurrencePattern;
|
|
204
|
+
interval: number;
|
|
205
|
+
daysOfWeek?: number[];
|
|
206
|
+
dayOfMonth?: number;
|
|
207
|
+
monthOfYear?: number;
|
|
208
|
+
weekOfMonth?: number;
|
|
209
|
+
endDate?: Date;
|
|
210
|
+
count?: number;
|
|
211
|
+
exceptions?: Date[];
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Event reminder
|
|
215
|
+
*/
|
|
216
|
+
export interface Reminder {
|
|
217
|
+
id?: string;
|
|
218
|
+
minutesBefore: number;
|
|
219
|
+
method: ReminderMethod;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Event category
|
|
223
|
+
*/
|
|
224
|
+
export interface EventCategory {
|
|
225
|
+
id: string;
|
|
226
|
+
name: string;
|
|
227
|
+
color: string;
|
|
228
|
+
icon?: string;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Resource entity
|
|
232
|
+
*/
|
|
233
|
+
export interface Resource {
|
|
234
|
+
id: string;
|
|
235
|
+
name: string;
|
|
236
|
+
type: ResourceType;
|
|
237
|
+
description?: string;
|
|
238
|
+
capacity?: number;
|
|
239
|
+
location?: string;
|
|
240
|
+
amenities?: string[];
|
|
241
|
+
metadata?: Record<string, unknown>;
|
|
242
|
+
availability?: TimeSlot[];
|
|
243
|
+
bookings?: ResourceBooking[];
|
|
244
|
+
requiresApproval: boolean;
|
|
245
|
+
createdAt: Date;
|
|
246
|
+
updatedAt: Date;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Resource booking
|
|
250
|
+
*/
|
|
251
|
+
export interface ResourceBooking {
|
|
252
|
+
id: string;
|
|
253
|
+
resourceId: string;
|
|
254
|
+
resourceName: string;
|
|
255
|
+
resourceType?: string;
|
|
256
|
+
resourceLocation?: string;
|
|
257
|
+
notes?: string;
|
|
258
|
+
eventId: string;
|
|
259
|
+
startTime: Date;
|
|
260
|
+
endTime: Date;
|
|
261
|
+
status: BookingStatus;
|
|
262
|
+
approvedBy?: User;
|
|
263
|
+
approvedAt?: Date;
|
|
264
|
+
createdAt: Date;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Time slot for availability
|
|
268
|
+
*/
|
|
269
|
+
export interface TimeSlot {
|
|
270
|
+
start: Date;
|
|
271
|
+
end: Date;
|
|
272
|
+
eventTitle?: string;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* User availability
|
|
276
|
+
*/
|
|
277
|
+
export interface UserAvailability {
|
|
278
|
+
userId: string;
|
|
279
|
+
freeSlots: TimeSlot[];
|
|
280
|
+
busySlots: TimeSlot[];
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Event attachment
|
|
284
|
+
*/
|
|
285
|
+
export interface EventAttachment {
|
|
286
|
+
id: string;
|
|
287
|
+
name: string;
|
|
288
|
+
url: string;
|
|
289
|
+
size: number;
|
|
290
|
+
mimeType: string;
|
|
291
|
+
fileId?: string;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* User reference
|
|
295
|
+
*/
|
|
296
|
+
export interface User {
|
|
297
|
+
id: string;
|
|
298
|
+
email: string;
|
|
299
|
+
name: string;
|
|
300
|
+
avatar?: string;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Calendar filter
|
|
304
|
+
*/
|
|
305
|
+
export interface CalendarFilter {
|
|
306
|
+
calendarIds?: string[];
|
|
307
|
+
categoryIds?: string[];
|
|
308
|
+
attendeeIds?: string[];
|
|
309
|
+
search?: string;
|
|
310
|
+
privacy?: EventPrivacy[];
|
|
311
|
+
status?: EventStatus[];
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Suggested meeting time
|
|
315
|
+
*/
|
|
316
|
+
export interface SuggestedTime {
|
|
317
|
+
start: Date;
|
|
318
|
+
end: Date;
|
|
319
|
+
availableCount: number;
|
|
320
|
+
totalCount: number;
|
|
321
|
+
unavailableAttendees: string[];
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Calendar subscription URL
|
|
325
|
+
*/
|
|
326
|
+
export interface CalendarSubscription {
|
|
327
|
+
id: string;
|
|
328
|
+
calendarId: string;
|
|
329
|
+
url: string;
|
|
330
|
+
type: 'ICAL' | 'CALDAV';
|
|
331
|
+
isPublic: boolean;
|
|
332
|
+
createdAt: Date;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Date range
|
|
336
|
+
*/
|
|
337
|
+
export interface DateRange {
|
|
338
|
+
start: Date;
|
|
339
|
+
end: Date;
|
|
340
|
+
}
|
|
341
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAEjF,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AAEpC;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,sBAAsB;IAC/D;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAEtD;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAEtD;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,sBAAsB,KAAK,IAAI,CAAC;IA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AAG,QAAQ,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,IAAI,CAAC;IACZ,GAAG,EAAE,IAAI,CAAC;CACX"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Date manipulation helpers for calendar operations
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Get the start of the day
|
|
6
|
+
*/
|
|
7
|
+
export declare function startOfDay(date: Date): Date;
|
|
8
|
+
/**
|
|
9
|
+
* Get the end of the day
|
|
10
|
+
*/
|
|
11
|
+
export declare function endOfDay(date: Date): Date;
|
|
12
|
+
/**
|
|
13
|
+
* Get the start of the week (Sunday)
|
|
14
|
+
*/
|
|
15
|
+
export declare function startOfWeek(date: Date): Date;
|
|
16
|
+
/**
|
|
17
|
+
* Get the end of the week (Saturday)
|
|
18
|
+
*/
|
|
19
|
+
export declare function endOfWeek(date: Date): Date;
|
|
20
|
+
/**
|
|
21
|
+
* Get the start of the month
|
|
22
|
+
*/
|
|
23
|
+
export declare function startOfMonth(date: Date): Date;
|
|
24
|
+
/**
|
|
25
|
+
* Get the end of the month
|
|
26
|
+
*/
|
|
27
|
+
export declare function endOfMonth(date: Date): Date;
|
|
28
|
+
/**
|
|
29
|
+
* Get the start of the year
|
|
30
|
+
*/
|
|
31
|
+
export declare function startOfYear(date: Date): Date;
|
|
32
|
+
/**
|
|
33
|
+
* Get the end of the year
|
|
34
|
+
*/
|
|
35
|
+
export declare function endOfYear(date: Date): Date;
|
|
36
|
+
/**
|
|
37
|
+
* Add days to a date
|
|
38
|
+
*/
|
|
39
|
+
export declare function addDays(date: Date, days: number): Date;
|
|
40
|
+
/**
|
|
41
|
+
* Add hours to a date
|
|
42
|
+
*/
|
|
43
|
+
export declare function addHours(date: Date, hours: number): Date;
|
|
44
|
+
/**
|
|
45
|
+
* Add minutes to a date
|
|
46
|
+
*/
|
|
47
|
+
export declare function addMinutes(date: Date, minutes: number): Date;
|
|
48
|
+
/**
|
|
49
|
+
* Check if two dates are on the same day
|
|
50
|
+
*/
|
|
51
|
+
export declare function isSameDay(date1: Date, date2: Date): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Check if a date is today
|
|
54
|
+
*/
|
|
55
|
+
export declare function isToday(date: Date): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Check if a date is in the past
|
|
58
|
+
*/
|
|
59
|
+
export declare function isPast(date: Date): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Check if a date is in the future
|
|
62
|
+
*/
|
|
63
|
+
export declare function isFuture(date: Date): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Format time (HH:mm)
|
|
66
|
+
*/
|
|
67
|
+
export declare function formatTime(date: Date): string;
|
|
68
|
+
/**
|
|
69
|
+
* Format date (MM/DD/YYYY)
|
|
70
|
+
*/
|
|
71
|
+
export declare function formatDate(date: Date): string;
|
|
72
|
+
/**
|
|
73
|
+
* Format date and time
|
|
74
|
+
*/
|
|
75
|
+
export declare function formatDateTime(date: Date): string;
|
|
76
|
+
/**
|
|
77
|
+
* Format time range
|
|
78
|
+
*/
|
|
79
|
+
export declare function formatTimeRange(start: Date, end: Date): string;
|
|
80
|
+
/**
|
|
81
|
+
* Get the number of days in a month
|
|
82
|
+
*/
|
|
83
|
+
export declare function getDaysInMonth(date: Date): number;
|
|
84
|
+
/**
|
|
85
|
+
* Get an array of dates for a given month (including padding)
|
|
86
|
+
*/
|
|
87
|
+
export declare function getMonthDates(date: Date): Date[];
|
|
88
|
+
/**
|
|
89
|
+
* Get an array of dates for a given week
|
|
90
|
+
*/
|
|
91
|
+
export declare function getWeekDates(date: Date): Date[];
|
|
92
|
+
/**
|
|
93
|
+
* Calculate duration between two dates in minutes
|
|
94
|
+
*/
|
|
95
|
+
export declare function getDurationMinutes(start: Date, end: Date): number;
|
|
96
|
+
/**
|
|
97
|
+
* Calculate duration between two dates in hours
|
|
98
|
+
*/
|
|
99
|
+
export declare function getDurationHours(start: Date, end: Date): number;
|
|
100
|
+
/**
|
|
101
|
+
* Format duration (e.g., "1h 30m", "30m", "2h")
|
|
102
|
+
*/
|
|
103
|
+
export declare function formatDuration(minutes: number): string;
|
|
104
|
+
/**
|
|
105
|
+
* Parse time string (HH:mm) to hours and minutes
|
|
106
|
+
*/
|
|
107
|
+
export declare function parseTime(time: string): {
|
|
108
|
+
hours: number;
|
|
109
|
+
minutes: number;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Create a date from time string
|
|
113
|
+
*/
|
|
114
|
+
export declare function dateFromTime(date: Date, time: string): Date;
|
|
115
|
+
//# sourceMappingURL=dateHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateHelpers.d.ts","sourceRoot":"","sources":["../../src/utils/dateHelpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAI3C;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAIzC;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAM5C;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAI1C;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAI7C;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAI3C;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAI5C;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAI1C;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,IAAI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jE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,GAAG,MAAM,CAE/D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAatD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAG1E;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAK3D"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
//#region src/utils/dateHelpers.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
let t = new Date(e);
|
|
4
|
+
return t.setHours(0, 0, 0, 0), t;
|
|
5
|
+
}
|
|
6
|
+
function t(e) {
|
|
7
|
+
let t = new Date(e);
|
|
8
|
+
return t.setHours(23, 59, 59, 999), t;
|
|
9
|
+
}
|
|
10
|
+
function n(t) {
|
|
11
|
+
let n = new Date(t), r = n.getDay(), i = n.getDate() - r;
|
|
12
|
+
return n.setDate(i), e(n);
|
|
13
|
+
}
|
|
14
|
+
function r(e) {
|
|
15
|
+
let r = n(e);
|
|
16
|
+
return r.setDate(r.getDate() + 6), t(r);
|
|
17
|
+
}
|
|
18
|
+
function i(t) {
|
|
19
|
+
let n = new Date(t);
|
|
20
|
+
return n.setDate(1), e(n);
|
|
21
|
+
}
|
|
22
|
+
function a(e) {
|
|
23
|
+
let n = new Date(e);
|
|
24
|
+
return n.setMonth(n.getMonth() + 1, 0), t(n);
|
|
25
|
+
}
|
|
26
|
+
function o(t) {
|
|
27
|
+
let n = new Date(t);
|
|
28
|
+
return n.setMonth(0, 1), e(n);
|
|
29
|
+
}
|
|
30
|
+
function s(e) {
|
|
31
|
+
let n = new Date(e);
|
|
32
|
+
return n.setMonth(11, 31), t(n);
|
|
33
|
+
}
|
|
34
|
+
function c(e, t) {
|
|
35
|
+
let n = new Date(e);
|
|
36
|
+
return n.setDate(n.getDate() + t), n;
|
|
37
|
+
}
|
|
38
|
+
function l(e, t) {
|
|
39
|
+
return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate();
|
|
40
|
+
}
|
|
41
|
+
function u(e) {
|
|
42
|
+
return l(e, /* @__PURE__ */ new Date());
|
|
43
|
+
}
|
|
44
|
+
function d(e) {
|
|
45
|
+
return e.toLocaleTimeString("en-US", {
|
|
46
|
+
hour: "2-digit",
|
|
47
|
+
minute: "2-digit",
|
|
48
|
+
hour12: !1
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function f(e) {
|
|
52
|
+
return e.toLocaleDateString("en-US", {
|
|
53
|
+
month: "2-digit",
|
|
54
|
+
day: "2-digit",
|
|
55
|
+
year: "numeric"
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function p(e) {
|
|
59
|
+
return e.toLocaleString("en-US", {
|
|
60
|
+
month: "short",
|
|
61
|
+
day: "numeric",
|
|
62
|
+
year: "numeric",
|
|
63
|
+
hour: "numeric",
|
|
64
|
+
minute: "2-digit"
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function m(e) {
|
|
68
|
+
let t = i(e), o = a(e), s = n(t), l = r(o), u = [], d = new Date(s);
|
|
69
|
+
for (; d <= l;) u.push(new Date(d)), d = c(d, 1);
|
|
70
|
+
return u;
|
|
71
|
+
}
|
|
72
|
+
function h(e) {
|
|
73
|
+
let t = n(e), r = [];
|
|
74
|
+
for (let e = 0; e < 7; e++) r.push(c(t, e));
|
|
75
|
+
return r;
|
|
76
|
+
}
|
|
77
|
+
function g(e, t) {
|
|
78
|
+
return Math.floor((t.getTime() - e.getTime()) / (1e3 * 60));
|
|
79
|
+
}
|
|
80
|
+
function _(e, t) {
|
|
81
|
+
return g(e, t) / 60;
|
|
82
|
+
}
|
|
83
|
+
//#endregion
|
|
84
|
+
export { c as addDays, t as endOfDay, a as endOfMonth, r as endOfWeek, s as endOfYear, f as formatDate, p as formatDateTime, d as formatTime, _ as getDurationHours, m as getMonthDates, h as getWeekDates, l as isSameDay, u as isToday, e as startOfDay, i as startOfMonth, n as startOfWeek, o as startOfYear };
|
|
85
|
+
|
|
86
|
+
//# sourceMappingURL=dateHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateHelpers.js","names":[],"sources":["../../src/utils/dateHelpers.ts"],"sourcesContent":["/**\n * Date manipulation helpers for calendar operations\n */\n\n/**\n * Get the start of the day\n */\nexport function startOfDay(date: Date): Date {\n const newDate = new Date(date);\n newDate.setHours(0, 0, 0, 0);\n return newDate;\n}\n\n/**\n * Get the end of the day\n */\nexport function endOfDay(date: Date): Date {\n const newDate = new Date(date);\n newDate.setHours(23, 59, 59, 999);\n return newDate;\n}\n\n/**\n * Get the start of the week (Sunday)\n */\nexport function startOfWeek(date: Date): Date {\n const newDate = new Date(date);\n const day = newDate.getDay();\n const diff = newDate.getDate() - day;\n newDate.setDate(diff);\n return startOfDay(newDate);\n}\n\n/**\n * Get the end of the week (Saturday)\n */\nexport function endOfWeek(date: Date): Date {\n const newDate = startOfWeek(date);\n newDate.setDate(newDate.getDate() + 6);\n return endOfDay(newDate);\n}\n\n/**\n * Get the start of the month\n */\nexport function startOfMonth(date: Date): Date {\n const newDate = new Date(date);\n newDate.setDate(1);\n return startOfDay(newDate);\n}\n\n/**\n * Get the end of the month\n */\nexport function endOfMonth(date: Date): Date {\n const newDate = new Date(date);\n newDate.setMonth(newDate.getMonth() + 1, 0);\n return endOfDay(newDate);\n}\n\n/**\n * Get the start of the year\n */\nexport function startOfYear(date: Date): Date {\n const newDate = new Date(date);\n newDate.setMonth(0, 1);\n return startOfDay(newDate);\n}\n\n/**\n * Get the end of the year\n */\nexport function endOfYear(date: Date): Date {\n const newDate = new Date(date);\n newDate.setMonth(11, 31);\n return endOfDay(newDate);\n}\n\n/**\n * Add days to a date\n */\nexport function addDays(date: Date, days: number): Date {\n const newDate = new Date(date);\n newDate.setDate(newDate.getDate() + days);\n return newDate;\n}\n\n/**\n * Add hours to a date\n */\nexport function addHours(date: Date, hours: number): Date {\n const newDate = new Date(date);\n newDate.setHours(newDate.getHours() + hours);\n return newDate;\n}\n\n/**\n * Add minutes to a date\n */\nexport function addMinutes(date: Date, minutes: number): Date {\n const newDate = new Date(date);\n newDate.setMinutes(newDate.getMinutes() + minutes);\n return newDate;\n}\n\n/**\n * Check if two dates are on the same day\n */\nexport function isSameDay(date1: Date, date2: Date): boolean {\n return (\n date1.getFullYear() === date2.getFullYear() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getDate() === date2.getDate()\n );\n}\n\n/**\n * Check if a date is today\n */\nexport function isToday(date: Date): boolean {\n return isSameDay(date, new Date());\n}\n\n/**\n * Check if a date is in the past\n */\nexport function isPast(date: Date): boolean {\n return date < new Date();\n}\n\n/**\n * Check if a date is in the future\n */\nexport function isFuture(date: Date): boolean {\n return date > new Date();\n}\n\n/**\n * Format time (HH:mm)\n */\nexport function formatTime(date: Date): string {\n return date.toLocaleTimeString('en-US', {\n hour: '2-digit',\n minute: '2-digit',\n hour12: false,\n });\n}\n\n/**\n * Format date (MM/DD/YYYY)\n */\nexport function formatDate(date: Date): string {\n return date.toLocaleDateString('en-US', {\n month: '2-digit',\n day: '2-digit',\n year: 'numeric',\n });\n}\n\n/**\n * Format date and time\n */\nexport function formatDateTime(date: Date): string {\n return date.toLocaleString('en-US', {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n });\n}\n\n/**\n * Format time range\n */\nexport function formatTimeRange(start: Date, end: Date): string {\n return `${formatTime(start)} - ${formatTime(end)}`;\n}\n\n/**\n * Get the number of days in a month\n */\nexport function getDaysInMonth(date: Date): number {\n return new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();\n}\n\n/**\n * Get an array of dates for a given month (including padding)\n */\nexport function getMonthDates(date: Date): Date[] {\n const start = startOfMonth(date);\n const end = endOfMonth(date);\n const startWeek = startOfWeek(start);\n const endWeek = endOfWeek(end);\n\n const dates: Date[] = [];\n let current = new Date(startWeek);\n\n while (current <= endWeek) {\n dates.push(new Date(current));\n current = addDays(current, 1);\n }\n\n return dates;\n}\n\n/**\n * Get an array of dates for a given week\n */\nexport function getWeekDates(date: Date): Date[] {\n const start = startOfWeek(date);\n const dates: Date[] = [];\n\n for (let i = 0; i < 7; i++) {\n dates.push(addDays(start, i));\n }\n\n return dates;\n}\n\n/**\n * Calculate duration between two dates in minutes\n */\nexport function getDurationMinutes(start: Date, end: Date): number {\n return Math.floor((end.getTime() - start.getTime()) / (1000 * 60));\n}\n\n/**\n * Calculate duration between two dates in hours\n */\nexport function getDurationHours(start: Date, end: Date): number {\n return getDurationMinutes(start, end) / 60;\n}\n\n/**\n * Format duration (e.g., \"1h 30m\", \"30m\", \"2h\")\n */\nexport function formatDuration(minutes: number): string {\n const hours = Math.floor(minutes / 60);\n const mins = minutes % 60;\n\n if (hours === 0) {\n return `${mins}m`;\n }\n\n if (mins === 0) {\n return `${hours}h`;\n }\n\n return `${hours}h ${mins}m`;\n}\n\n/**\n * Parse time string (HH:mm) to hours and minutes\n */\nexport function parseTime(time: string): { hours: number; minutes: number } {\n const [hours, minutes] = time.split(':').map(Number);\n return { hours, minutes };\n}\n\n/**\n * Create a date from time string\n */\nexport function dateFromTime(date: Date, time: string): Date {\n const { hours, minutes } = parseTime(time);\n const newDate = new Date(date);\n newDate.setHours(hours, minutes, 0, 0);\n return newDate;\n}\n"],"mappings":";AAOA,SAAgB,EAAW,GAAkB;CAC3C,IAAM,IAAU,IAAI,KAAK,EAAK;AAE9B,QADA,EAAQ,SAAS,GAAG,GAAG,GAAG,EAAE,EACrB;;AAMT,SAAgB,EAAS,GAAkB;CACzC,IAAM,IAAU,IAAI,KAAK,EAAK;AAE9B,QADA,EAAQ,SAAS,IAAI,IAAI,IAAI,I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,SAAS;EACtC,MAAM;EACN,QAAQ;EACR,QAAQ;EACT,CAAC;;AAMJ,SAAgB,EAAW,GAAoB;AAC7C,QAAO,EAAK,mBAAmB,SAAS;EACtC,OAAO;EACP,KAAK;EACL,MAAM;EACP,CAAC;;AAMJ,SAAgB,EAAe,GAAoB;AACjD,QAAO,EAAK,eAAe,SAAS;EAClC,OAAO;EACP,KAAK;EACL,MAAM;EACN,MAAM;EACN,QAAQ;EACT,CAAC;;AAoBJ,SAAgB,EAAc,GAAoB;CAChD,IAAM,IAAQ,EAAa,EAAK,EAC1B,IAAM,EAAW,EAAK,EACtB,IAAY,EAAY,EAAM,EAC9B,IAAU,EAAU,EAAI,EAExB,IAAgB,EAAE,EACpB,IAAU,IAAI,KAAK,EAAU;AAEjC,QAAO,KAAW,GAEhB,CADA,EAAM,KAAK,IAAI,KAAK,EAAQ,CAAC,EAC7B,IAAU,EAAQ,GAAS,EAAE;AAG/B,QAAO;;AAMT,SAAgB,EAAa,GAAoB;CAC/C,IAAM,IAAQ,EAAY,EAAK,EACzB,IAAgB,EAAE;AAExB,MAAK,IAAI,IAAI,GAAG,IAAI,GAAG,IACrB,GAAM,KAAK,EAAQ,GAAO,EAAE,CAAC;AAG/B,QAAO;;AAMT,SAAgB,EAAmB,GAAa,GAAmB;AACjE,QAAO,KAAK,OAAO,EAAI,SAAS,GAAG,EAAM,SAAS,KAAK,MAAO,IAAI;;AAMpE,SAAgB,EAAiB,GAAa,GAAmB;AAC/D,QAAO,EAAmB,GAAO,EAAI,GAAG"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CalendarEvent } from '../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Generate iCal format string for an event
|
|
5
|
+
*/
|
|
6
|
+
export declare function generateICalEvent(event: CalendarEvent): string;
|
|
7
|
+
/**
|
|
8
|
+
* Generate full iCal calendar
|
|
9
|
+
*/
|
|
10
|
+
export declare function generateICalCalendar(events: CalendarEvent[], calendarName?: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Download iCal file
|
|
13
|
+
*/
|
|
14
|
+
export declare function downloadICalFile(content: string, filename?: string): void;
|
|
15
|
+
/**
|
|
16
|
+
* Parse simple iCal content (basic implementation)
|
|
17
|
+
*/
|
|
18
|
+
export declare function parseICalContent(content: string): Partial<CalendarEvent>[];
|
|
19
|
+
//# sourceMappingURL=icalHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icalHelpers.d.ts","sourceRoot":"","sources":["../../src/utils/icalHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,UAAU,CAAC;AAE9D;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAyF9D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,aAAa,EAAE,EACvB,YAAY,GAAE,MAAmB,GAChC,MAAM,CAmBR;AAgFD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAuB,GAAG,IAAI,CAUzF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,EAAE,CA+B1E"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
//#region src/utils/icalHelpers.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
let t = [];
|
|
4
|
+
if (t.push("BEGIN:VEVENT"), t.push(`UID:${e.id}`), t.push(`DTSTAMP:${n(/* @__PURE__ */ new Date())}`), t.push(`DTSTART:${n(e.startTime)}`), t.push(`DTEND:${n(e.endTime)}`), t.push(`SUMMARY:${r(e.title)}`), e.description && t.push(`DESCRIPTION:${r(e.description)}`), e.location && t.push(`LOCATION:${r(e.location)}`), e.organizer && t.push(`ORGANIZER;CN="${e.organizer.name}":mailto:${e.organizer.email}`), e.attendees && e.attendees.length > 0 && e.attendees.forEach((e) => {
|
|
5
|
+
let n = e.status === "ACCEPTED" ? "ACCEPTED" : e.status === "DECLINED" ? "DECLINED" : e.status === "TENTATIVE" ? "TENTATIVE" : "NEEDS-ACTION", r = e.isRequired ? "REQ-PARTICIPANT" : "OPT-PARTICIPANT";
|
|
6
|
+
t.push(`ATTENDEE;CN="${e.name}";ROLE=${r};PARTSTAT=${n};RSVP=TRUE:mailto:${e.email}`);
|
|
7
|
+
}), e.recurrence) {
|
|
8
|
+
let r = i(e.recurrence);
|
|
9
|
+
if (r && t.push(`RRULE:${r}`), e.recurrence.exceptions && e.recurrence.exceptions.length > 0) {
|
|
10
|
+
let r = e.recurrence.exceptions.map((e) => n(e)).join(",");
|
|
11
|
+
t.push(`EXDATE:${r}`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return e.reminders && e.reminders.length > 0 && e.reminders.forEach((n) => {
|
|
15
|
+
t.push("BEGIN:VALARM"), t.push("ACTION:DISPLAY"), t.push(`DESCRIPTION:${r(e.title)}`), t.push(`TRIGGER:-PT${n.minutesBefore}M`), t.push("END:VALARM");
|
|
16
|
+
}), t.push(`STATUS:${e.status}`), e.privacy === "PRIVATE" || e.privacy === "CONFIDENTIAL" ? t.push(`CLASS:${e.privacy}`) : t.push("CLASS:PUBLIC"), e.category && t.push(`CATEGORIES:${r(e.category.name)}`), e.videoCallLink && t.push(`URL:${e.videoCallLink}`), t.push("END:VEVENT"), t.join("\r\n");
|
|
17
|
+
}
|
|
18
|
+
function t(t, n = "Calendar") {
|
|
19
|
+
let i = [];
|
|
20
|
+
return i.push("BEGIN:VCALENDAR"), i.push("VERSION:2.0"), i.push("PRODID:-//Burdenoff//Calendar//EN"), i.push(`X-WR-CALNAME:${r(n)}`), i.push("X-WR-TIMEZONE:UTC"), i.push("CALSCALE:GREGORIAN"), i.push("METHOD:PUBLISH"), t.forEach((t) => {
|
|
21
|
+
let n = e(t).split("\r\n");
|
|
22
|
+
i.push(...n);
|
|
23
|
+
}), i.push("END:VCALENDAR"), i.join("\r\n");
|
|
24
|
+
}
|
|
25
|
+
function n(e) {
|
|
26
|
+
return `${e.getUTCFullYear()}${String(e.getUTCMonth() + 1).padStart(2, "0")}${String(e.getUTCDate()).padStart(2, "0")}T${String(e.getUTCHours()).padStart(2, "0")}${String(e.getUTCMinutes()).padStart(2, "0")}${String(e.getUTCSeconds()).padStart(2, "0")}Z`;
|
|
27
|
+
}
|
|
28
|
+
function r(e) {
|
|
29
|
+
return e.replace(/\\/g, "\\\\").replace(/;/g, "\\;").replace(/,/g, "\\,").replace(/\n/g, "\\n");
|
|
30
|
+
}
|
|
31
|
+
function i(e) {
|
|
32
|
+
let t = [];
|
|
33
|
+
if (t.push(`FREQ=${e.pattern}`), e.interval > 1 && t.push(`INTERVAL=${e.interval}`), e.daysOfWeek && e.daysOfWeek.length > 0) {
|
|
34
|
+
let n = e.daysOfWeek.map(a).join(",");
|
|
35
|
+
t.push(`BYDAY=${n}`);
|
|
36
|
+
}
|
|
37
|
+
return e.dayOfMonth && t.push(`BYMONTHDAY=${e.dayOfMonth}`), e.monthOfYear !== void 0 && t.push(`BYMONTH=${e.monthOfYear + 1}`), e.weekOfMonth && t.push(`BYSETPOS=${e.weekOfMonth}`), e.endDate ? t.push(`UNTIL=${n(e.endDate)}`) : e.count && t.push(`COUNT=${e.count}`), t.join(";");
|
|
38
|
+
}
|
|
39
|
+
function a(e) {
|
|
40
|
+
return [
|
|
41
|
+
"SU",
|
|
42
|
+
"MO",
|
|
43
|
+
"TU",
|
|
44
|
+
"WE",
|
|
45
|
+
"TH",
|
|
46
|
+
"FR",
|
|
47
|
+
"SA"
|
|
48
|
+
][e];
|
|
49
|
+
}
|
|
50
|
+
function o(e, t = "calendar.ics") {
|
|
51
|
+
let n = new Blob([e], { type: "text/calendar;charset=utf-8" }), r = URL.createObjectURL(n), i = document.createElement("a");
|
|
52
|
+
i.href = r, i.download = t, document.body.appendChild(i), i.click(), document.body.removeChild(i), URL.revokeObjectURL(r);
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
export { o as downloadICalFile, t as generateICalCalendar };
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=icalHelpers.js.map
|