@sunsama/event-calendar 0.2.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.
- package/LICENSE +20 -0
- package/README.md +105 -0
- package/lib/commonjs/components/all-day-events.js +117 -0
- package/lib/commonjs/components/all-day-events.js.map +1 -0
- package/lib/commonjs/components/background-hours-content.js +43 -0
- package/lib/commonjs/components/background-hours-content.js.map +1 -0
- package/lib/commonjs/components/background-hours-layout.js +57 -0
- package/lib/commonjs/components/background-hours-layout.js.map +1 -0
- package/lib/commonjs/components/drag-bar.js +84 -0
- package/lib/commonjs/components/drag-bar.js.map +1 -0
- package/lib/commonjs/components/edit-event-container.js +114 -0
- package/lib/commonjs/components/edit-event-container.js.map +1 -0
- package/lib/commonjs/components/event-container.js +37 -0
- package/lib/commonjs/components/event-container.js.map +1 -0
- package/lib/commonjs/components/new-event-container.js +73 -0
- package/lib/commonjs/components/new-event-container.js.map +1 -0
- package/lib/commonjs/components/time-indicator.js +64 -0
- package/lib/commonjs/components/time-indicator.js.map +1 -0
- package/lib/commonjs/components/timed-event-container.js +91 -0
- package/lib/commonjs/components/timed-event-container.js.map +1 -0
- package/lib/commonjs/components/timed-events.js +68 -0
- package/lib/commonjs/components/timed-events.js.map +1 -0
- package/lib/commonjs/components/zoom-provider.js +109 -0
- package/lib/commonjs/components/zoom-provider.js.map +1 -0
- package/lib/commonjs/enums.js +2 -0
- package/lib/commonjs/enums.js.map +1 -0
- package/lib/commonjs/hooks/use-cloned-events.js +25 -0
- package/lib/commonjs/hooks/use-cloned-events.js.map +1 -0
- package/lib/commonjs/hooks/use-events-layout.js +34 -0
- package/lib/commonjs/hooks/use-events-layout.js.map +1 -0
- package/lib/commonjs/hooks/use-is-editing.js +83 -0
- package/lib/commonjs/hooks/use-is-editing.js.map +1 -0
- package/lib/commonjs/index.js +129 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/types.js +24 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/commonjs/utils/calendar-layout.js +113 -0
- package/lib/commonjs/utils/calendar-layout.js.map +1 -0
- package/lib/commonjs/utils/compute-positioning.js +33 -0
- package/lib/commonjs/utils/compute-positioning.js.map +1 -0
- package/lib/commonjs/utils/date-utils.js +152 -0
- package/lib/commonjs/utils/date-utils.js.map +1 -0
- package/lib/commonjs/utils/double-tap-reset-zoom-gesture.js +19 -0
- package/lib/commonjs/utils/double-tap-reset-zoom-gesture.js.map +1 -0
- package/lib/commonjs/utils/generate-event-layouts.js +198 -0
- package/lib/commonjs/utils/generate-event-layouts.js.map +1 -0
- package/lib/commonjs/utils/globals.js +11 -0
- package/lib/commonjs/utils/globals.js.map +1 -0
- package/lib/commonjs/utils/pan-edit-event-gesture.js +41 -0
- package/lib/commonjs/utils/pan-edit-event-gesture.js.map +1 -0
- package/lib/module/components/all-day-events.js +110 -0
- package/lib/module/components/all-day-events.js.map +1 -0
- package/lib/module/components/background-hours-content.js +37 -0
- package/lib/module/components/background-hours-content.js.map +1 -0
- package/lib/module/components/background-hours-layout.js +51 -0
- package/lib/module/components/background-hours-layout.js.map +1 -0
- package/lib/module/components/drag-bar.js +78 -0
- package/lib/module/components/drag-bar.js.map +1 -0
- package/lib/module/components/edit-event-container.js +107 -0
- package/lib/module/components/edit-event-container.js.map +1 -0
- package/lib/module/components/event-container.js +33 -0
- package/lib/module/components/event-container.js.map +1 -0
- package/lib/module/components/new-event-container.js +67 -0
- package/lib/module/components/new-event-container.js.map +1 -0
- package/lib/module/components/time-indicator.js +57 -0
- package/lib/module/components/time-indicator.js.map +1 -0
- package/lib/module/components/timed-event-container.js +84 -0
- package/lib/module/components/timed-event-container.js.map +1 -0
- package/lib/module/components/timed-events.js +63 -0
- package/lib/module/components/timed-events.js.map +1 -0
- package/lib/module/components/zoom-provider.js +102 -0
- package/lib/module/components/zoom-provider.js.map +1 -0
- package/lib/module/enums.js +2 -0
- package/lib/module/enums.js.map +1 -0
- package/lib/module/hooks/use-cloned-events.js +21 -0
- package/lib/module/hooks/use-cloned-events.js.map +1 -0
- package/lib/module/hooks/use-events-layout.js +29 -0
- package/lib/module/hooks/use-events-layout.js.map +1 -0
- package/lib/module/hooks/use-is-editing.js +75 -0
- package/lib/module/hooks/use-is-editing.js.map +1 -0
- package/lib/module/index.js +124 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/types.js +20 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/utils/calendar-layout.js +108 -0
- package/lib/module/utils/calendar-layout.js.map +1 -0
- package/lib/module/utils/compute-positioning.js +28 -0
- package/lib/module/utils/compute-positioning.js.map +1 -0
- package/lib/module/utils/date-utils.js +139 -0
- package/lib/module/utils/date-utils.js.map +1 -0
- package/lib/module/utils/double-tap-reset-zoom-gesture.js +15 -0
- package/lib/module/utils/double-tap-reset-zoom-gesture.js.map +1 -0
- package/lib/module/utils/generate-event-layouts.js +192 -0
- package/lib/module/utils/generate-event-layouts.js.map +1 -0
- package/lib/module/utils/globals.js +7 -0
- package/lib/module/utils/globals.js.map +1 -0
- package/lib/module/utils/pan-edit-event-gesture.js +37 -0
- package/lib/module/utils/pan-edit-event-gesture.js.map +1 -0
- package/lib/typescript/commonjs/components/all-day-events.d.ts +3 -0
- package/lib/typescript/commonjs/components/all-day-events.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/background-hours-content.d.ts +7 -0
- package/lib/typescript/commonjs/components/background-hours-content.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/background-hours-layout.d.ts +7 -0
- package/lib/typescript/commonjs/components/background-hours-layout.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/drag-bar.d.ts +14 -0
- package/lib/typescript/commonjs/components/drag-bar.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/edit-event-container.d.ts +7 -0
- package/lib/typescript/commonjs/components/edit-event-container.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/event-container.d.ts +7 -0
- package/lib/typescript/commonjs/components/event-container.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/new-event-container.d.ts +3 -0
- package/lib/typescript/commonjs/components/new-event-container.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/time-indicator.d.ts +3 -0
- package/lib/typescript/commonjs/components/time-indicator.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/timed-event-container.d.ts +9 -0
- package/lib/typescript/commonjs/components/timed-event-container.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/timed-events.d.ts +7 -0
- package/lib/typescript/commonjs/components/timed-events.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/zoom-provider.d.ts +7 -0
- package/lib/typescript/commonjs/components/zoom-provider.d.ts.map +1 -0
- package/lib/typescript/commonjs/enums.d.ts +2 -0
- package/lib/typescript/commonjs/enums.d.ts.map +1 -0
- package/lib/typescript/commonjs/hooks/use-cloned-events.d.ts +11 -0
- package/lib/typescript/commonjs/hooks/use-cloned-events.d.ts.map +1 -0
- package/lib/typescript/commonjs/hooks/use-events-layout.d.ts +13 -0
- package/lib/typescript/commonjs/hooks/use-events-layout.d.ts.map +1 -0
- package/lib/typescript/commonjs/hooks/use-is-editing.d.ts +17 -0
- package/lib/typescript/commonjs/hooks/use-is-editing.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +27 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/types.d.ts +128 -0
- package/lib/typescript/commonjs/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/__tests___/compute-positioning.test.d.ts +2 -0
- package/lib/typescript/commonjs/utils/__tests___/compute-positioning.test.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/__tests___/date-utils.test.d.ts +2 -0
- package/lib/typescript/commonjs/utils/__tests___/date-utils.test.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/__tests___/generate-event-layout.test.d.ts +2 -0
- package/lib/typescript/commonjs/utils/__tests___/generate-event-layout.test.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/calendar-layout.d.ts +36 -0
- package/lib/typescript/commonjs/utils/calendar-layout.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/compute-positioning.d.ts +10 -0
- package/lib/typescript/commonjs/utils/compute-positioning.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/date-utils.d.ts +30 -0
- package/lib/typescript/commonjs/utils/date-utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/double-tap-reset-zoom-gesture.d.ts +5 -0
- package/lib/typescript/commonjs/utils/double-tap-reset-zoom-gesture.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/generate-event-layouts.d.ts +15 -0
- package/lib/typescript/commonjs/utils/generate-event-layouts.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/globals.d.ts +5 -0
- package/lib/typescript/commonjs/utils/globals.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/pan-edit-event-gesture.d.ts +6 -0
- package/lib/typescript/commonjs/utils/pan-edit-event-gesture.d.ts.map +1 -0
- package/lib/typescript/module/components/all-day-events.d.ts +3 -0
- package/lib/typescript/module/components/all-day-events.d.ts.map +1 -0
- package/lib/typescript/module/components/background-hours-content.d.ts +7 -0
- package/lib/typescript/module/components/background-hours-content.d.ts.map +1 -0
- package/lib/typescript/module/components/background-hours-layout.d.ts +7 -0
- package/lib/typescript/module/components/background-hours-layout.d.ts.map +1 -0
- package/lib/typescript/module/components/drag-bar.d.ts +14 -0
- package/lib/typescript/module/components/drag-bar.d.ts.map +1 -0
- package/lib/typescript/module/components/edit-event-container.d.ts +7 -0
- package/lib/typescript/module/components/edit-event-container.d.ts.map +1 -0
- package/lib/typescript/module/components/event-container.d.ts +7 -0
- package/lib/typescript/module/components/event-container.d.ts.map +1 -0
- package/lib/typescript/module/components/new-event-container.d.ts +3 -0
- package/lib/typescript/module/components/new-event-container.d.ts.map +1 -0
- package/lib/typescript/module/components/time-indicator.d.ts +3 -0
- package/lib/typescript/module/components/time-indicator.d.ts.map +1 -0
- package/lib/typescript/module/components/timed-event-container.d.ts +9 -0
- package/lib/typescript/module/components/timed-event-container.d.ts.map +1 -0
- package/lib/typescript/module/components/timed-events.d.ts +7 -0
- package/lib/typescript/module/components/timed-events.d.ts.map +1 -0
- package/lib/typescript/module/components/zoom-provider.d.ts +7 -0
- package/lib/typescript/module/components/zoom-provider.d.ts.map +1 -0
- package/lib/typescript/module/enums.d.ts +2 -0
- package/lib/typescript/module/enums.d.ts.map +1 -0
- package/lib/typescript/module/hooks/use-cloned-events.d.ts +11 -0
- package/lib/typescript/module/hooks/use-cloned-events.d.ts.map +1 -0
- package/lib/typescript/module/hooks/use-events-layout.d.ts +13 -0
- package/lib/typescript/module/hooks/use-events-layout.d.ts.map +1 -0
- package/lib/typescript/module/hooks/use-is-editing.d.ts +17 -0
- package/lib/typescript/module/hooks/use-is-editing.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +27 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/types.d.ts +128 -0
- package/lib/typescript/module/types.d.ts.map +1 -0
- package/lib/typescript/module/utils/__tests___/compute-positioning.test.d.ts +2 -0
- package/lib/typescript/module/utils/__tests___/compute-positioning.test.d.ts.map +1 -0
- package/lib/typescript/module/utils/__tests___/date-utils.test.d.ts +2 -0
- package/lib/typescript/module/utils/__tests___/date-utils.test.d.ts.map +1 -0
- package/lib/typescript/module/utils/__tests___/generate-event-layout.test.d.ts +2 -0
- package/lib/typescript/module/utils/__tests___/generate-event-layout.test.d.ts.map +1 -0
- package/lib/typescript/module/utils/calendar-layout.d.ts +36 -0
- package/lib/typescript/module/utils/calendar-layout.d.ts.map +1 -0
- package/lib/typescript/module/utils/compute-positioning.d.ts +10 -0
- package/lib/typescript/module/utils/compute-positioning.d.ts.map +1 -0
- package/lib/typescript/module/utils/date-utils.d.ts +30 -0
- package/lib/typescript/module/utils/date-utils.d.ts.map +1 -0
- package/lib/typescript/module/utils/double-tap-reset-zoom-gesture.d.ts +5 -0
- package/lib/typescript/module/utils/double-tap-reset-zoom-gesture.d.ts.map +1 -0
- package/lib/typescript/module/utils/generate-event-layouts.d.ts +15 -0
- package/lib/typescript/module/utils/generate-event-layouts.d.ts.map +1 -0
- package/lib/typescript/module/utils/globals.d.ts +5 -0
- package/lib/typescript/module/utils/globals.d.ts.map +1 -0
- package/lib/typescript/module/utils/pan-edit-event-gesture.d.ts +6 -0
- package/lib/typescript/module/utils/pan-edit-event-gesture.d.ts.map +1 -0
- package/package.json +195 -0
- package/src/components/all-day-events.tsx +134 -0
- package/src/components/background-hours-content.tsx +51 -0
- package/src/components/background-hours-layout.tsx +61 -0
- package/src/components/drag-bar.tsx +120 -0
- package/src/components/edit-event-container.tsx +158 -0
- package/src/components/event-container.tsx +44 -0
- package/src/components/new-event-container.tsx +90 -0
- package/src/components/time-indicator.tsx +72 -0
- package/src/components/timed-event-container.tsx +124 -0
- package/src/components/timed-events.tsx +72 -0
- package/src/components/zoom-provider.tsx +146 -0
- package/src/enums.ts +0 -0
- package/src/hooks/use-cloned-events.ts +26 -0
- package/src/hooks/use-events-layout.ts +55 -0
- package/src/hooks/use-is-editing.tsx +109 -0
- package/src/index.tsx +165 -0
- package/src/types.ts +163 -0
- package/src/utils/__tests___/compute-positioning.test.ts +255 -0
- package/src/utils/__tests___/date-utils.test.ts +41 -0
- package/src/utils/__tests___/generate-event-layout.test.ts +277 -0
- package/src/utils/calendar-layout.ts +139 -0
- package/src/utils/compute-positioning.ts +44 -0
- package/src/utils/date-utils.ts +238 -0
- package/src/utils/double-tap-reset-zoom-gesture.ts +23 -0
- package/src/utils/generate-event-layouts.ts +314 -0
- package/src/utils/globals.ts +8 -0
- package/src/utils/pan-edit-event-gesture.ts +64 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import _partition from "lodash/partition";
|
|
4
|
+
import _reduce from "lodash/reduce";
|
|
5
|
+
import _sortBy from "lodash/sortBy";
|
|
6
|
+
import _reverse from "lodash/reverse";
|
|
7
|
+
import moment from "moment-timezone";
|
|
8
|
+
import { CalendarLayout } from "src/utils/calendar-layout";
|
|
9
|
+
import { computeCalendarDateRange, dateRangeIntersect, getDuration, getDurationInDays, isAllDayOrSpansMidnight, startOfUserWeek } from "src/utils/date-utils";
|
|
10
|
+
import computePositioning from "src/utils/compute-positioning";
|
|
11
|
+
import { EventExtend } from "src/types";
|
|
12
|
+
export const generateEventLayouts = ({
|
|
13
|
+
events,
|
|
14
|
+
startCalendarDate,
|
|
15
|
+
endCalendarDate,
|
|
16
|
+
userCalendarId,
|
|
17
|
+
calendarViewInterval = "1day",
|
|
18
|
+
startDayOfWeekOffset = 0,
|
|
19
|
+
timezone
|
|
20
|
+
}) => {
|
|
21
|
+
// Calculate spacial layout for CalendarViewDay events
|
|
22
|
+
// in month view, midnight-spanning part-day events are rendered as all-day multi-day
|
|
23
|
+
const [allDayEvents, partDayEvents] = _partition([...events], event => isAllDayOrSpansMidnight(event, timezone));
|
|
24
|
+
|
|
25
|
+
// lowest priority sort by ID for consistent ordering of otherwise equal events
|
|
26
|
+
let allDayEventsSorted = _sortBy(allDayEvents, event => event.id);
|
|
27
|
+
|
|
28
|
+
// secondary sort by length descending
|
|
29
|
+
allDayEventsSorted = _sortBy(allDayEventsSorted, event => getDurationInDays(event, timezone));
|
|
30
|
+
allDayEventsSorted = _reverse(allDayEventsSorted);
|
|
31
|
+
|
|
32
|
+
// primary sort by start ascending
|
|
33
|
+
allDayEventsSorted = _sortBy(allDayEventsSorted, event => new Date(event.start).valueOf());
|
|
34
|
+
|
|
35
|
+
// lowest priority sort by ID for consistent ordering of otherwise equal events
|
|
36
|
+
let partDayEventsSorted = _sortBy(partDayEvents, event => event.id);
|
|
37
|
+
partDayEventsSorted = _sortBy(partDayEventsSorted, event => getDuration(event)); // secondary sort by duration ascending
|
|
38
|
+
partDayEventsSorted = _sortBy(partDayEventsSorted, event => new Date(event.start).valueOf()); // primary sort by start ascending
|
|
39
|
+
const calendarViewDayEvents = [...allDayEventsSorted, ...(calendarViewInterval === "month" ? partDayEventsSorted : [])];
|
|
40
|
+
const visibleDayCount = moment.tz(endCalendarDate, timezone).diff(moment.tz(startCalendarDate, timezone), "days");
|
|
41
|
+
const visibleDays = [];
|
|
42
|
+
for (let dayCount = 0; dayCount <= visibleDayCount; dayCount++) {
|
|
43
|
+
visibleDays.push(moment.tz(startCalendarDate, timezone).add(dayCount, "day").format("YYYY-MM-DD"));
|
|
44
|
+
}
|
|
45
|
+
const calendarViewDateRanges = visibleDays.map(visibleDay => {
|
|
46
|
+
return computeCalendarDateRange(visibleDay, timezone, calendarViewInterval, startDayOfWeekOffset);
|
|
47
|
+
});
|
|
48
|
+
const result = {};
|
|
49
|
+
calendarViewDateRanges.forEach(date => {
|
|
50
|
+
const calendarLayoutOptions = {
|
|
51
|
+
visibleX: date.dayIndexes,
|
|
52
|
+
enableWeekBreaks: calendarViewInterval === "month",
|
|
53
|
+
startOfWeekXOffset: moment.tz(date.basisDate, timezone).diff(startOfUserWeek(startDayOfWeekOffset, date.basisDate, timezone), "days")
|
|
54
|
+
};
|
|
55
|
+
const calendarViewDayLayout = _reduce(calendarViewDayEvents, (calendarLayout, event) => {
|
|
56
|
+
const eventStartIndex = moment.tz(event.start, timezone).startOf("day").diff(moment.tz(date.basisDate, timezone), "days");
|
|
57
|
+
const eventDurationDays = getDurationInDays(event, timezone);
|
|
58
|
+
calendarLayout.findFitAndInsert(eventStartIndex, eventDurationDays, event);
|
|
59
|
+
return calendarLayout;
|
|
60
|
+
}, new CalendarLayout(calendarLayoutOptions));
|
|
61
|
+
const calendarViewDayRowHeight = calendarViewDayLayout.height();
|
|
62
|
+
|
|
63
|
+
// set the calendar layout for each day
|
|
64
|
+
const calendarDates = date.calendarDates || [];
|
|
65
|
+
calendarDates.forEach(calendarDate => {
|
|
66
|
+
const currentDayDate = moment.tz(calendarDate, timezone).startOf("day");
|
|
67
|
+
const startDate = currentDayDate.toDate();
|
|
68
|
+
const endDate = moment.tz(startDate, timezone).endOf("day").toDate();
|
|
69
|
+
const showHours = !["month"].includes(calendarViewInterval);
|
|
70
|
+
const dayId = calendarDate;
|
|
71
|
+
const allDayEventsLayout = [];
|
|
72
|
+
let partDayEventsLayout = [];
|
|
73
|
+
const x = moment(startDate).diff(moment.tz(date.basisDate, timezone), "days");
|
|
74
|
+
for (let y = 0; y < calendarViewDayRowHeight; ++y) {
|
|
75
|
+
const {
|
|
76
|
+
event,
|
|
77
|
+
visibleWidthDays,
|
|
78
|
+
extend = EventExtend.None,
|
|
79
|
+
isPrimaryRendered
|
|
80
|
+
} = calendarViewDayLayout.getViewAt(x, y);
|
|
81
|
+
if (event) {
|
|
82
|
+
allDayEventsLayout.push({
|
|
83
|
+
event,
|
|
84
|
+
rowIndex: y,
|
|
85
|
+
// @ts-ignore we know visibleWidthDays will be set for all day events if an event is returned
|
|
86
|
+
visibleWidthDays,
|
|
87
|
+
extend,
|
|
88
|
+
isPrimaryRendered
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Handle part day events according to view type
|
|
94
|
+
if (showHours) {
|
|
95
|
+
// Bucket, partition, sort, and handle collisions
|
|
96
|
+
partDayEventsLayout = partDayEventsLayout.concat(handleCollisions(events.filter(event => !isAllDayOrSpansMidnight(event, timezone) && dateRangeIntersect({
|
|
97
|
+
startDate: new Date(event.start),
|
|
98
|
+
endDate: new Date(event.end)
|
|
99
|
+
}, {
|
|
100
|
+
startDate,
|
|
101
|
+
endDate
|
|
102
|
+
})), userCalendarId, currentDayDate, timezone));
|
|
103
|
+
}
|
|
104
|
+
result[dayId] = {
|
|
105
|
+
allDayEventsLayout,
|
|
106
|
+
partDayEventsLayout
|
|
107
|
+
};
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
return result;
|
|
111
|
+
};
|
|
112
|
+
const combineEventPosition = (dayDate, timezone, collisionObject) => {
|
|
113
|
+
const position = computePositioning({
|
|
114
|
+
timezone,
|
|
115
|
+
collisionObject: collisionObject,
|
|
116
|
+
startOfDayMoment: dayDate
|
|
117
|
+
});
|
|
118
|
+
return {
|
|
119
|
+
...collisionObject,
|
|
120
|
+
position
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
const handleCollisions = (allEvents, userCalendarId, dayDate, timezone) => {
|
|
124
|
+
let stackableEvents = _sortBy(allEvents, event => event.id);
|
|
125
|
+
stackableEvents = _sortBy(stackableEvents, event => {
|
|
126
|
+
// current user's primary calendar should always be leftmost option
|
|
127
|
+
return event.calendarId && !event.calendarId.includes(userCalendarId);
|
|
128
|
+
});
|
|
129
|
+
stackableEvents = _sortBy(stackableEvents, event => new Date(event.start).valueOf());
|
|
130
|
+
// calculate overlap stack properties
|
|
131
|
+
const stackedEvtsByPos = {};
|
|
132
|
+
let curStack = [];
|
|
133
|
+
for (const evt of stackableEvents) {
|
|
134
|
+
// already sorted by startDate
|
|
135
|
+
for (let idx = 0; idx < curStack.length; idx++) {
|
|
136
|
+
const stackEvt = curStack[idx];
|
|
137
|
+
if (stackEvt) {
|
|
138
|
+
const stackEvtEnd = new Date(stackEvt.event.end).valueOf();
|
|
139
|
+
const stackEvtStart = new Date(stackEvt.event.start).valueOf();
|
|
140
|
+
const eventStart = new Date(evt.start).valueOf();
|
|
141
|
+
|
|
142
|
+
// events shorter than 15 minutes behave as if they had 15 minute duration.
|
|
143
|
+
// matches behavior in calendar view, where the shortest 'height' an event is given matches the height of a 15 minute event.
|
|
144
|
+
const duration = (stackEvtEnd - stackEvtStart) / (1000 * 60);
|
|
145
|
+
const endDate = duration < 15 ? stackEvtStart + 15 * 60 * 1000 : stackEvtEnd;
|
|
146
|
+
if (endDate <= eventStart) {
|
|
147
|
+
// null out this event's position in stack
|
|
148
|
+
curStack[idx] = null;
|
|
149
|
+
if (curStack.length > 1) {
|
|
150
|
+
stackEvt.collisions = {
|
|
151
|
+
total: curStack.length,
|
|
152
|
+
order: idx
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
stackedEvtsByPos[idx] ? stackedEvtsByPos[idx].push(combineEventPosition(dayDate, timezone, stackEvt)) : stackedEvtsByPos[idx] = [combineEventPosition(dayDate, timezone, stackEvt)];
|
|
156
|
+
if (!curStack.some(el => el)) {
|
|
157
|
+
curStack = [];
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// plop evt into first null placeholder we find, or just push if we don't have any.
|
|
164
|
+
const spliceIdx = curStack.findIndex(stackEvt => !stackEvt);
|
|
165
|
+
spliceIdx > -1 ? curStack.splice(spliceIdx, 1, {
|
|
166
|
+
event: evt
|
|
167
|
+
}) : curStack.splice(curStack.length, 0, {
|
|
168
|
+
event: evt
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// clean up stack if we've exhausted allEvents and it's unpopped.
|
|
173
|
+
for (let idx = 0; idx < curStack.length; idx++) {
|
|
174
|
+
const stackEvt = curStack[idx];
|
|
175
|
+
if (stackEvt) {
|
|
176
|
+
if (curStack.length > 1) {
|
|
177
|
+
stackEvt.collisions = {
|
|
178
|
+
total: curStack.length,
|
|
179
|
+
order: idx
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
stackedEvtsByPos[idx] ? stackedEvtsByPos[idx].push(combineEventPosition(dayDate, timezone, stackEvt)) : stackedEvtsByPos[idx] = [combineEventPosition(dayDate, timezone, stackEvt)];
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// always draw position 0 stack elements first.
|
|
187
|
+
let stackedEvents = [];
|
|
188
|
+
Object.keys(stackedEvtsByPos).forEach(pos => stackedEvents = stackedEvents.concat(stackedEvtsByPos[pos]));
|
|
189
|
+
return [...stackedEvents];
|
|
190
|
+
};
|
|
191
|
+
export default generateEventLayouts;
|
|
192
|
+
//# sourceMappingURL=generate-event-layouts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_partition","_reduce","_sortBy","_reverse","moment","CalendarLayout","computeCalendarDateRange","dateRangeIntersect","getDuration","getDurationInDays","isAllDayOrSpansMidnight","startOfUserWeek","computePositioning","EventExtend","generateEventLayouts","events","startCalendarDate","endCalendarDate","userCalendarId","calendarViewInterval","startDayOfWeekOffset","timezone","allDayEvents","partDayEvents","event","allDayEventsSorted","id","Date","start","valueOf","partDayEventsSorted","calendarViewDayEvents","visibleDayCount","tz","diff","visibleDays","dayCount","push","add","format","calendarViewDateRanges","map","visibleDay","result","forEach","date","calendarLayoutOptions","visibleX","dayIndexes","enableWeekBreaks","startOfWeekXOffset","basisDate","calendarViewDayLayout","calendarLayout","eventStartIndex","startOf","eventDurationDays","findFitAndInsert","calendarViewDayRowHeight","height","calendarDates","calendarDate","currentDayDate","startDate","toDate","endDate","endOf","showHours","includes","dayId","allDayEventsLayout","partDayEventsLayout","x","y","visibleWidthDays","extend","None","isPrimaryRendered","getViewAt","rowIndex","concat","handleCollisions","filter","end","combineEventPosition","dayDate","collisionObject","position","startOfDayMoment","allEvents","stackableEvents","calendarId","stackedEvtsByPos","curStack","evt","idx","length","stackEvt","stackEvtEnd","stackEvtStart","eventStart","duration","collisions","total","order","some","el","spliceIdx","findIndex","splice","stackedEvents","Object","keys","pos"],"sourceRoot":"../../../src","sources":["utils/generate-event-layouts.ts"],"mappings":";;AAAA,OAAOA,UAAU,MAAM,kBAAkB;AACzC,OAAOC,OAAO,MAAM,eAAe;AACnC,OAAOC,OAAO,MAAM,eAAe;AACnC,OAAOC,QAAQ,MAAM,gBAAgB;AACrC,OAAOC,MAAM,MAAkB,iBAAiB;AAChD,SAASC,cAAc,QAAQ,2BAA2B;AAC1D,SACEC,wBAAwB,EACxBC,kBAAkB,EAClBC,WAAW,EACXC,iBAAiB,EACjBC,uBAAuB,EACvBC,eAAe,QACV,sBAAsB;AAC7B,OAAOC,kBAAkB,MAAM,+BAA+B;AAC9D,SAKEC,WAAW,QAGN,WAAW;AAYlB,OAAO,MAAMC,oBAAoB,GAAGA,CA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AAGJ,QAAQ,CAACE,GAAG,CAAC;IAE9B,IAAIE,QAAQ,EAAE;MACZ,IAAIJ,QAAQ,CAACG,MAAM,GAAG,CAAC,EAAE;QACvBC,QAAQ,CAACK,UAAU,GAAG;UAAEC,KAAK,EAAEV,QAAQ,CAACG,MAAM;UAAEQ,KAAK,EAAET;QAAI,CAAC;MAC9D;MAEAH,gBAAgB,CAACG,GAAG,CAAC,GACjBH,gBAAgB,CAACG,GAAG,CAAC,CAAC1D,IAAI,CACxB+C,oBAAoB,CAACC,OAAO,EAAEhE,QAAQ,EAAE4E,QAAQ,CAClD,CAAC,GACAL,gBAAgB,CAACG,GAAG,CAAC,GAAG,CACvBX,oBAAoB,CAACC,OAAO,EAAEhE,QAAQ,EAAE4E,QAAQ,CAAC,CACjD;IACR;EACF;;EAEA;EACA,IAAIa,aAAuC,GAAG,EAAE;EAEhDC,MAAM,CAACC,IAAI,CAACpB,gBAAgB,CAAC,CAAChD,OAAO,CAClCqE,GAAG,IAAMH,aAAa,GAAGA,aAAa,CAAC9B,MAAM,CAACY,gBAAgB,CAACqB,GAAG,CAAC,CACtE,CAAC;EAED,OAAO,CAAC,GAAGH,aAAa,CAAC;AAC3B,CAAC;AAED,eAAehG,oBAAoB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createContext","ConfigProvider","undefined","DEFAULT_MINUTE_HEIGHT","TOP_MARGIN_PIXEL_OFFSET"],"sourceRoot":"../../../src","sources":["utils/globals.ts"],"mappings":";;AAAA,SAASA,aAAa,QAAQ,OAAO;AAGrC,OAAO,MAAMC,cAAc,gBAAGD,aAAa,CAASE,SAAkB,CAAC;AAEvE,OAAO,MAAMC,qBAAqB,GAAG,GAAG;AAExC,OAAO,MAAMC,uBAAuB,GAAG,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Gesture } from "react-native-gesture-handler";
|
|
4
|
+
import { runOnJS } from "react-native-reanimated";
|
|
5
|
+
const gesturePan = (startY, top, currentY, zoomLevel, maximumHour, height, refNewEvent, fiveMinuteInterval, isEditing, startEditing) => Gesture.Pan().blocksExternalGesture(refNewEvent).onStart(() => {
|
|
6
|
+
if (startEditing) {
|
|
7
|
+
if (isEditing) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
if (!isEditing) {
|
|
11
|
+
runOnJS(startEditing)();
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
startY.value = top.value;
|
|
15
|
+
}).onUpdate(({
|
|
16
|
+
translationY
|
|
17
|
+
}) => {
|
|
18
|
+
let freshUpdatedStartTime;
|
|
19
|
+
if (fiveMinuteInterval) {
|
|
20
|
+
// Set the updated time in 15 minute increments but make sure we never go lower
|
|
21
|
+
// than the first minute of the day
|
|
22
|
+
freshUpdatedStartTime = Math.max(0, startY.value + Math.floor(translationY / zoomLevel.value / 5) * (zoomLevel.value * 5));
|
|
23
|
+
} else {
|
|
24
|
+
// Set the updated time in 1 minute increments but make sure we never go lower
|
|
25
|
+
// than the first minute of the day
|
|
26
|
+
freshUpdatedStartTime = Math.max(0, startY.value + Math.floor(translationY / zoomLevel.value) * zoomLevel.value);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Make sure the event does not span after midnight, and if so make sure it
|
|
30
|
+
// is limited to exactly midnight
|
|
31
|
+
if (freshUpdatedStartTime > maximumHour.value - height.value) {
|
|
32
|
+
freshUpdatedStartTime = maximumHour.value - height.value;
|
|
33
|
+
}
|
|
34
|
+
currentY.value = freshUpdatedStartTime;
|
|
35
|
+
});
|
|
36
|
+
export default gesturePan;
|
|
37
|
+
//# sourceMappingURL=pan-edit-event-gesture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Gesture","runOnJS","gesturePan","startY","top","currentY","zoomLevel","maximumHour","height","refNewEvent","fiveMinuteInterval","isEditing","startEditing","Pan","blocksExternalGesture","onStart","value","onUpdate","translationY","freshUpdatedStartTime","Math","max","floor"],"sourceRoot":"../../../src","sources":["utils/pan-edit-event-gesture.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,8BAA8B;AACtD,SAASC,OAAO,QAAqB,yBAAyB;AAI9D,MAAMC,UAAU,GAAGA,CACjBC,MAA2B,EAC3BC,GAAwB,EACxBC,QAA6B,EAC7BC,SAA8B,EAC9BC,WAAgC,EAChCC,MAA2B,EAC3BC,WAA2B,EAC3BC,kBAA4B,EAC5BC,SAAyC,EACzCC,YAAyB,KAEzBZ,OAAO,CAACa,GAAG,CAAC,CAAC,CACVC,qBAAqB,CAACL,WAAW,CAAC,CAClCM,OAAO,CAAC,MAAM;EACb,IAAIH,YAAY,EAAE;IAChB,IAAID,SAAS,EAAE;MACb;IACF;IAEA,IAAI,CAACA,SAAS,EAAE;MACdV,OAAO,CAACW,YAAY,CAAC,CAAC,CAAC;IACzB;EACF;EAEAT,MAAM,CAACa,KAAK,GAAGZ,GAAG,CAACY,KAAK;AAC1B,CAAC,CAAC,CACDC,QAAQ,CAAC,CAAC;EAAEC;AAAa,CAAC,KAAK;EAC9B,IAAIC,qBAAqB;EAEzB,IAAIT,kBAAkB,EAAE;IACtB;IACA;IACAS,qBAAqB,GAAGC,IAAI,CAACC,GAAG,CAC9B,CAAC,EACDlB,MAAM,CAACa,KAAK,GACVI,IAAI,CAACE,KAAK,CAACJ,YAAY,GAAGZ,SAAS,CAACU,KAAK,GAAG,CAAC,CAAC,IAC3CV,SAAS,CAACU,KAAK,GAAG,CAAC,CAC1B,CAAC;EACH,CAAC,MAAM;IACL;IACA;IACAG,qBAAqB,GAAGC,IAAI,CAACC,GAAG,CAC9B,CAAC,EACDlB,MAAM,CAACa,KAAK,GACVI,IAAI,CAACE,KAAK,CAACJ,YAAY,GAAGZ,SAAS,CAACU,KAAK,CAAC,GAAGV,SAAS,CAACU,KAC3D,CAAC;EACH;;EAEA;EACA;EACA,IAAIG,qBAAqB,GAAGZ,WAAW,CAACS,KAAK,GAAGR,MAAM,CAACQ,KAAK,EAAE;IAC5DG,qBAAqB,GAAGZ,WAAW,CAACS,KAAK,GAAGR,MAAM,CAACQ,KAAK;EAC1D;EAEAX,QAAQ,CAACW,KAAK,GAAGG,qBAAqB;AACxC,CAAC,CAAC;AAEN,eAAejB,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"all-day-events.d.ts","sourceRoot":"","sources":["../../../../src/components/all-day-events.tsx"],"names":[],"mappings":"AAYA,QAAA,MAAM,YAAY,wEAiGjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PrefabHour } from "src/types";
|
|
2
|
+
type BackgroundHoursContentProps = {
|
|
3
|
+
hours: PrefabHour[];
|
|
4
|
+
};
|
|
5
|
+
declare const BackgroundHoursContent: import("react").MemoExoticComponent<({ hours }: BackgroundHoursContentProps) => import("react").JSX.Element>;
|
|
6
|
+
export default BackgroundHoursContent;
|
|
7
|
+
//# sourceMappingURL=background-hours-content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"background-hours-content.d.ts","sourceRoot":"","sources":["../../../../src/components/background-hours-content.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,KAAK,2BAA2B,GAAG;IACjC,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB,CAAC;AAEF,QAAA,MAAM,sBAAsB,kDACd,2BAA2B,iCA0BxC,CAAC;AAaF,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PrefabHour } from "src/types";
|
|
2
|
+
type BackgroundHoursLayoutProps = {
|
|
3
|
+
hours: PrefabHour[];
|
|
4
|
+
};
|
|
5
|
+
declare const BackgroundHoursLayout: import("react").MemoExoticComponent<({ hours }: BackgroundHoursLayoutProps) => import("react").JSX.Element>;
|
|
6
|
+
export default BackgroundHoursLayout;
|
|
7
|
+
//# sourceMappingURL=background-hours-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"background-hours-layout.d.ts","sourceRoot":"","sources":["../../../../src/components/background-hours-layout.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,KAAK,0BAA0B,GAAG;IAChC,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB,CAAC;AAEF,QAAA,MAAM,qBAAqB,kDACb,0BAA0B,iCA2BvC,CAAC;AAsBF,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SharedValue } from "react-native-reanimated";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
type DragBarProps = {
|
|
4
|
+
top?: SharedValue<number>;
|
|
5
|
+
height: SharedValue<number>;
|
|
6
|
+
render: () => ReactNode;
|
|
7
|
+
refMainContainer: React.RefObject<any>;
|
|
8
|
+
fiveMinuteInterval?: boolean;
|
|
9
|
+
zoomLevel: SharedValue<number>;
|
|
10
|
+
maximumHour: SharedValue<number>;
|
|
11
|
+
};
|
|
12
|
+
declare const DragBar: ({ top, height, render, refMainContainer, fiveMinuteInterval, zoomLevel, maximumHour, }: DragBarProps) => import("react").JSX.Element;
|
|
13
|
+
export default DragBar;
|
|
14
|
+
//# sourceMappingURL=drag-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drag-bar.d.ts","sourceRoot":"","sources":["../../../../src/components/drag-bar.tsx"],"names":[],"mappings":"AAAA,OAAiB,EAAE,WAAW,EAAkB,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,SAAS,EAAW,MAAM,OAAO,CAAC;AAI3C,KAAK,YAAY,GAAG;IAClB,GAAG,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5B,MAAM,EAAE,MAAM,SAAS,CAAC;IACxB,gBAAgB,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACvC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC/B,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAClC,CAAC;AAEF,QAAA,MAAM,OAAO,2FAQV,YAAY,gCAsFd,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RefObject } from "react";
|
|
2
|
+
type EditEventContainerProps = {
|
|
3
|
+
refNewEvent: RefObject<any>;
|
|
4
|
+
};
|
|
5
|
+
declare const EditEventContainer: import("react").MemoExoticComponent<({ refNewEvent }: EditEventContainerProps) => import("react").JSX.Element | null>;
|
|
6
|
+
export default EditEventContainer;
|
|
7
|
+
//# sourceMappingURL=edit-event-container.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit-event-container.d.ts","sourceRoot":"","sources":["../../../../src/components/edit-event-container.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EAKV,MAAM,OAAO,CAAC;AAiBf,KAAK,uBAAuB,GAAG;IAC7B,WAAW,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC;CAC7B,CAAC;AAEF,QAAA,MAAM,kBAAkB,wDACJ,uBAAuB,wCA8H1C,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AllDayEventLayoutType } from "src/types";
|
|
2
|
+
type EventContainerProps = {
|
|
3
|
+
layout: AllDayEventLayoutType;
|
|
4
|
+
};
|
|
5
|
+
declare const EventContainer: ({ layout }: EventContainerProps) => import("react").JSX.Element;
|
|
6
|
+
export default EventContainer;
|
|
7
|
+
//# sourceMappingURL=event-container.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-container.d.ts","sourceRoot":"","sources":["../../../../src/components/event-container.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAe,MAAM,WAAW,CAAC;AAE/D,KAAK,mBAAmB,GAAG;IACzB,MAAM,EAAE,qBAAqB,CAAC;CAC/B,CAAC;AAEF,QAAA,MAAM,cAAc,eAAgB,mBAAmB,gCA+BtD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-event-container.d.ts","sourceRoot":"","sources":["../../../../src/components/new-event-container.tsx"],"names":[],"mappings":"AAUA,QAAA,MAAM,iBAAiB,wEA4DtB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time-indicator.d.ts","sourceRoot":"","sources":["../../../../src/components/time-indicator.tsx"],"names":[],"mappings":"AASA,QAAA,MAAM,aAAa,wEA+ClB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RefObject } from "react";
|
|
2
|
+
import { PartDayEventLayoutType } from "src/types";
|
|
3
|
+
type TimedEventContainerProps = {
|
|
4
|
+
layout: PartDayEventLayoutType;
|
|
5
|
+
refNewEvent: RefObject<any>;
|
|
6
|
+
};
|
|
7
|
+
declare const TimedEventContainer: ({ layout, refNewEvent, }: TimedEventContainerProps) => import("react").JSX.Element;
|
|
8
|
+
export default TimedEventContainer;
|
|
9
|
+
//# sourceMappingURL=timed-event-container.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timed-event-container.d.ts","sourceRoot":"","sources":["../../../../src/components/timed-event-container.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAoC,MAAM,OAAO,CAAC;AAMpE,OAAO,EAAe,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAEhE,KAAK,wBAAwB,GAAG;IAC9B,MAAM,EAAE,sBAAsB,CAAC;IAC/B,WAAW,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC;CAC7B,CAAC;AAEF,QAAA,MAAM,mBAAmB,6BAGtB,wBAAwB,gCA8F1B,CAAC;AAMF,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RefObject } from "react";
|
|
2
|
+
type TimedEventsProps = {
|
|
3
|
+
refNewEvent: RefObject<any>;
|
|
4
|
+
};
|
|
5
|
+
declare const TimedEvents: ({ refNewEvent }: TimedEventsProps) => import("react").JSX.Element;
|
|
6
|
+
export default TimedEvents;
|
|
7
|
+
//# sourceMappingURL=timed-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timed-events.d.ts","sourceRoot":"","sources":["../../../../src/components/timed-events.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AAUvD,KAAK,gBAAgB,GAAG;IACtB,WAAW,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC;CAC7B,CAAC;AAEF,QAAA,MAAM,WAAW,oBAAqB,gBAAgB,gCAqCrD,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GestureRef } from "react-native-gesture-handler/lib/typescript/handlers/gestures/gesture";
|
|
2
|
+
type ZoomProviderProps = {
|
|
3
|
+
children: any;
|
|
4
|
+
};
|
|
5
|
+
declare const ZoomProvider: import("react").ForwardRefExoticComponent<ZoomProviderProps & import("react").RefAttributes<GestureRef>>;
|
|
6
|
+
export default ZoomProvider;
|
|
7
|
+
//# sourceMappingURL=zoom-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zoom-provider.d.ts","sourceRoot":"","sources":["../../../../src/components/zoom-provider.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,UAAU,EAAE,MAAM,uEAAuE,CAAC;AAInG,KAAK,iBAAiB,GAAG;IACvB,QAAQ,EAAE,GAAG,CAAC;CACf,CAAC;AAKF,QAAA,MAAM,YAAY,0GAqHjB,CAAC;AAQF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../../src/enums.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from "react";
|
|
2
|
+
import { CalendarEvent } from "src/types";
|
|
3
|
+
export declare let updateClonedEvents: Dispatch<SetStateAction<CalendarEvent[]>>;
|
|
4
|
+
/**
|
|
5
|
+
* Returns a cloned version of the events array if the updateLocalStateAfterEdit is set to true.
|
|
6
|
+
* We do this to make local state updates faster and more responsive. If the updateLocalStateAfterEdit is set to false,
|
|
7
|
+
* we return the original events array and don't clone it.
|
|
8
|
+
*/
|
|
9
|
+
declare const useClonedEvents: (events: CalendarEvent[], updateLocalStateAfterEdit: boolean) => CalendarEvent[];
|
|
10
|
+
export default useClonedEvents;
|
|
11
|
+
//# sourceMappingURL=use-cloned-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-cloned-events.d.ts","sourceRoot":"","sources":["../../../../src/hooks/use-cloned-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAuB,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,eAAO,IAAI,kBAAkB,EAAE,QAAQ,CAAC,cAAc,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;AAEzE;;;;GAIG;AACH,QAAA,MAAM,eAAe,WACX,aAAa,EAAE,6BACI,OAAO,oBAUnC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CalendarEvent, CalendarViewIntervalType, FullCalendarEventLayout } from "src/types";
|
|
2
|
+
export type UpdateEvent = {
|
|
3
|
+
events: CalendarEvent[];
|
|
4
|
+
userCalendarId: string;
|
|
5
|
+
timezone: string;
|
|
6
|
+
startCalendarDate: string;
|
|
7
|
+
endCalendarDate: string;
|
|
8
|
+
startDayOfWeekOffset?: number;
|
|
9
|
+
calendarViewInterval?: CalendarViewIntervalType;
|
|
10
|
+
};
|
|
11
|
+
declare const useEventsLayout: (props: UpdateEvent) => FullCalendarEventLayout;
|
|
12
|
+
export default useEventsLayout;
|
|
13
|
+
//# sourceMappingURL=use-events-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-events-layout.d.ts","sourceRoot":"","sources":["../../../../src/hooks/use-events-layout.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,aAAa,EACb,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,WAAW,CAAC;AAUnB,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,oBAAoB,CAAC,EAAE,wBAAwB,CAAC;CACjD,CAAC;AAkBF,QAAA,MAAM,eAAe,UAAW,WAAW,4BAQ1C,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { SharedValue } from "react-native-reanimated";
|
|
3
|
+
import { PartDayEventLayoutType } from "src/types";
|
|
4
|
+
interface IsEditingType {
|
|
5
|
+
isEditing: null | PartDayEventLayoutType;
|
|
6
|
+
currentY: SharedValue<number>;
|
|
7
|
+
setIsEditing: (newValue: PartDayEventLayoutType | null, updatedTimes?: {
|
|
8
|
+
updatedStart: string;
|
|
9
|
+
updatedEnd: string;
|
|
10
|
+
}) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const useIsEditing: () => IsEditingType;
|
|
13
|
+
export declare const IsEditingProvider: ({ children }: {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}) => React.JSX.Element;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=use-is-editing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-is-editing.d.ts","sourceRoot":"","sources":["../../../../src/hooks/use-is-editing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAEZ,SAAS,EAIV,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,WAAW,EAAkB,MAAM,yBAAyB,CAAC;AAItE,OAAO,EAAc,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAE/D,UAAU,aAAa;IACrB,SAAS,EAAE,IAAI,GAAG,sBAAsB,CAAC;IACzC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC9B,YAAY,EAAE,CACZ,QAAQ,EAAE,sBAAsB,GAAG,IAAI,EACvC,YAAY,CAAC,EAAE;QACb,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;KACpB,KACE,IAAI,CAAC;CACX;AAID,eAAO,MAAM,YAAY,qBAOxB,CAAC;AAGF,eAAO,MAAM,iBAAiB,iBAAkB;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,sBAuEtE,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { CalendarEvent, Config, onCreateEvent, ThemeStyle } from "src/types";
|
|
2
|
+
type EventCalenderProps = {
|
|
3
|
+
canCreateEvents?: boolean;
|
|
4
|
+
canEditEvent?: Config["canEditEvent"];
|
|
5
|
+
dayDate: string;
|
|
6
|
+
events: CalendarEvent[];
|
|
7
|
+
fiveMinuteInterval?: boolean;
|
|
8
|
+
initialZoomLevel?: number;
|
|
9
|
+
maxAllDayEvents?: number;
|
|
10
|
+
onCreateEvent?: onCreateEvent;
|
|
11
|
+
onEventEdit?: Config["onEventEdit"];
|
|
12
|
+
onPressEvent?: Config["onPressEvent"];
|
|
13
|
+
renderDragBars?: Config["renderDragBars"];
|
|
14
|
+
renderEvent: Config["renderEvent"];
|
|
15
|
+
renderNewEventContainer?: Config["renderNewEventContainer"];
|
|
16
|
+
showTimeIndicator?: boolean;
|
|
17
|
+
theme?: ThemeStyle;
|
|
18
|
+
timeFormat?: string;
|
|
19
|
+
timezone?: string;
|
|
20
|
+
updateLocalStateAfterEdit?: boolean;
|
|
21
|
+
userCalendarId?: string;
|
|
22
|
+
extraTimedComponents?: Config["extraTimedComponents"];
|
|
23
|
+
onZoomChange?: Config["onZoomChange"];
|
|
24
|
+
};
|
|
25
|
+
declare const EventCalendar: ({ events, timeFormat, dayDate, theme, initialZoomLevel, onCreateEvent, timezone, renderEvent, onPressEvent, userCalendarId, showTimeIndicator, maxAllDayEvents, canCreateEvents, renderNewEventContainer, fiveMinuteInterval, canEditEvent, onEventEdit, renderDragBars, updateLocalStateAfterEdit, extraTimedComponents, onZoomChange, }: EventCalenderProps) => import("react").JSX.Element;
|
|
26
|
+
export default EventCalendar;
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,aAAa,EACb,MAAM,EACN,aAAa,EACb,UAAU,EACX,MAAM,WAAW,CAAC;AAEnB,KAAK,kBAAkB,GAAG;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAA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