@sunsama/event-calendar 0.2.1 → 0.2.2
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/lib/commonjs/components/all-day-events.js +2 -2
- package/lib/commonjs/components/background-hours-content.js +1 -1
- package/lib/commonjs/components/background-hours-content.js.map +1 -1
- package/lib/commonjs/components/background-hours-layout.js +1 -1
- package/lib/commonjs/components/background-hours-layout.js.map +1 -1
- package/lib/commonjs/components/edit-event-container.js +5 -5
- package/lib/commonjs/components/event-container.js +2 -2
- package/lib/commonjs/components/event-container.js.map +1 -1
- package/lib/commonjs/components/new-event-container.js +2 -2
- package/lib/commonjs/components/new-event-container.js.map +1 -1
- package/lib/commonjs/components/time-indicator.js +1 -1
- package/lib/commonjs/components/timed-event-container.js +5 -5
- package/lib/commonjs/components/timed-event-container.js.map +1 -1
- package/lib/commonjs/components/timed-events.js +8 -8
- package/lib/commonjs/components/timed-events.js.map +1 -1
- package/lib/commonjs/components/zoom-provider.js +3 -3
- package/lib/commonjs/components/zoom-provider.js.map +1 -1
- package/lib/commonjs/hooks/use-is-editing.js +3 -3
- package/lib/commonjs/hooks/use-is-editing.js.map +1 -1
- package/lib/commonjs/index.js +7 -7
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/utils/calendar-layout.js +1 -1
- package/lib/commonjs/utils/generate-event-layouts.js +4 -4
- package/lib/commonjs/utils/generate-event-layouts.js.map +1 -1
- package/lib/module/components/all-day-events.js +2 -2
- package/lib/module/components/all-day-events.js.map +1 -1
- package/lib/module/components/background-hours-content.js +1 -1
- package/lib/module/components/background-hours-content.js.map +1 -1
- package/lib/module/components/background-hours-layout.js +1 -1
- package/lib/module/components/background-hours-layout.js.map +1 -1
- package/lib/module/components/edit-event-container.js +5 -5
- package/lib/module/components/edit-event-container.js.map +1 -1
- package/lib/module/components/event-container.js +2 -2
- package/lib/module/components/event-container.js.map +1 -1
- package/lib/module/components/new-event-container.js +2 -2
- package/lib/module/components/new-event-container.js.map +1 -1
- package/lib/module/components/time-indicator.js +1 -1
- package/lib/module/components/time-indicator.js.map +1 -1
- package/lib/module/components/timed-event-container.js +5 -5
- package/lib/module/components/timed-event-container.js.map +1 -1
- package/lib/module/components/timed-events.js +8 -8
- package/lib/module/components/timed-events.js.map +1 -1
- package/lib/module/components/zoom-provider.js +3 -3
- package/lib/module/components/zoom-provider.js.map +1 -1
- package/lib/module/hooks/use-is-editing.js +3 -3
- package/lib/module/hooks/use-is-editing.js.map +1 -1
- package/lib/module/index.js +7 -7
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/calendar-layout.js +1 -1
- package/lib/module/utils/calendar-layout.js.map +1 -1
- package/lib/module/utils/generate-event-layouts.js +4 -4
- package/lib/module/utils/generate-event-layouts.js.map +1 -1
- package/lib/typescript/commonjs/components/background-hours-content.d.ts +1 -1
- package/lib/typescript/commonjs/components/background-hours-content.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/background-hours-layout.d.ts +1 -1
- package/lib/typescript/commonjs/components/background-hours-layout.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/event-container.d.ts +1 -1
- package/lib/typescript/commonjs/components/event-container.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/timed-event-container.d.ts +1 -1
- package/lib/typescript/commonjs/components/timed-event-container.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/zoom-provider.d.ts +1 -2
- package/lib/typescript/commonjs/components/zoom-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/hooks/use-cloned-events.d.ts +1 -1
- package/lib/typescript/commonjs/hooks/use-cloned-events.d.ts.map +1 -1
- package/lib/typescript/commonjs/hooks/use-events-layout.d.ts +1 -1
- package/lib/typescript/commonjs/hooks/use-events-layout.d.ts.map +1 -1
- package/lib/typescript/commonjs/hooks/use-is-editing.d.ts +1 -1
- package/lib/typescript/commonjs/hooks/use-is-editing.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +1 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/calendar-layout.d.ts +1 -1
- package/lib/typescript/commonjs/utils/calendar-layout.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/compute-positioning.d.ts +1 -1
- package/lib/typescript/commonjs/utils/compute-positioning.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/date-utils.d.ts +1 -1
- package/lib/typescript/commonjs/utils/date-utils.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/double-tap-reset-zoom-gesture.d.ts +1 -1
- package/lib/typescript/commonjs/utils/double-tap-reset-zoom-gesture.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/generate-event-layouts.d.ts +1 -1
- package/lib/typescript/commonjs/utils/generate-event-layouts.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/globals.d.ts +1 -1
- package/lib/typescript/commonjs/utils/globals.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/pan-edit-event-gesture.d.ts +1 -1
- package/lib/typescript/commonjs/utils/pan-edit-event-gesture.d.ts.map +1 -1
- package/lib/typescript/module/components/background-hours-content.d.ts +1 -1
- package/lib/typescript/module/components/background-hours-content.d.ts.map +1 -1
- package/lib/typescript/module/components/background-hours-layout.d.ts +1 -1
- package/lib/typescript/module/components/background-hours-layout.d.ts.map +1 -1
- package/lib/typescript/module/components/event-container.d.ts +1 -1
- package/lib/typescript/module/components/event-container.d.ts.map +1 -1
- package/lib/typescript/module/components/timed-event-container.d.ts +1 -1
- package/lib/typescript/module/components/timed-event-container.d.ts.map +1 -1
- package/lib/typescript/module/components/zoom-provider.d.ts +1 -2
- package/lib/typescript/module/components/zoom-provider.d.ts.map +1 -1
- package/lib/typescript/module/hooks/use-cloned-events.d.ts +1 -1
- package/lib/typescript/module/hooks/use-cloned-events.d.ts.map +1 -1
- package/lib/typescript/module/hooks/use-events-layout.d.ts +1 -1
- package/lib/typescript/module/hooks/use-events-layout.d.ts.map +1 -1
- package/lib/typescript/module/hooks/use-is-editing.d.ts +1 -1
- package/lib/typescript/module/hooks/use-is-editing.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +1 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/utils/calendar-layout.d.ts +1 -1
- package/lib/typescript/module/utils/calendar-layout.d.ts.map +1 -1
- package/lib/typescript/module/utils/compute-positioning.d.ts +1 -1
- package/lib/typescript/module/utils/compute-positioning.d.ts.map +1 -1
- package/lib/typescript/module/utils/date-utils.d.ts +1 -1
- package/lib/typescript/module/utils/date-utils.d.ts.map +1 -1
- package/lib/typescript/module/utils/double-tap-reset-zoom-gesture.d.ts +1 -1
- package/lib/typescript/module/utils/double-tap-reset-zoom-gesture.d.ts.map +1 -1
- package/lib/typescript/module/utils/generate-event-layouts.d.ts +1 -1
- package/lib/typescript/module/utils/generate-event-layouts.d.ts.map +1 -1
- package/lib/typescript/module/utils/globals.d.ts +1 -1
- package/lib/typescript/module/utils/globals.d.ts.map +1 -1
- package/lib/typescript/module/utils/pan-edit-event-gesture.d.ts +1 -1
- package/lib/typescript/module/utils/pan-edit-event-gesture.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/all-day-events.tsx +2 -2
- package/src/components/background-hours-content.tsx +2 -2
- package/src/components/background-hours-layout.tsx +2 -2
- package/src/components/edit-event-container.tsx +5 -5
- package/src/components/event-container.tsx +2 -2
- package/src/components/new-event-container.tsx +2 -2
- package/src/components/time-indicator.tsx +1 -1
- package/src/components/timed-event-container.tsx +5 -5
- package/src/components/timed-events.tsx +8 -8
- package/src/components/zoom-provider.tsx +4 -5
- package/src/hooks/use-cloned-events.ts +1 -1
- package/src/hooks/use-events-layout.ts +1 -1
- package/src/hooks/use-is-editing.tsx +3 -3
- package/src/index.tsx +8 -13
- package/src/utils/__tests___/compute-positioning.test.ts +2 -2
- package/src/utils/__tests___/generate-event-layout.test.ts +1 -1
- package/src/utils/calendar-layout.ts +1 -1
- package/src/utils/compute-positioning.ts +1 -1
- package/src/utils/date-utils.ts +1 -1
- package/src/utils/double-tap-reset-zoom-gesture.ts +1 -1
- package/src/utils/generate-event-layouts.ts +4 -4
- package/src/utils/globals.ts +1 -1
- package/src/utils/pan-edit-event-gesture.ts +1 -1
package/src/index.tsx
CHANGED
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
import { StyleSheet, View } from "react-native";
|
|
2
|
-
import AllDayEvents from "
|
|
2
|
+
import AllDayEvents from "./components/all-day-events";
|
|
3
3
|
import { ScrollView } from "react-native-gesture-handler";
|
|
4
4
|
import { useSharedValue } from "react-native-reanimated";
|
|
5
|
-
import ZoomProvider from "
|
|
6
|
-
import TimedEvents from "
|
|
7
|
-
import useEventsLayout, { UpdateEvent } from "
|
|
8
|
-
import { ConfigProvider, DEFAULT_MINUTE_HEIGHT } from "
|
|
5
|
+
import ZoomProvider from "./components/zoom-provider";
|
|
6
|
+
import TimedEvents from "./components/timed-events";
|
|
7
|
+
import useEventsLayout, { UpdateEvent } from "./hooks/use-events-layout";
|
|
8
|
+
import { ConfigProvider, DEFAULT_MINUTE_HEIGHT } from "./utils/globals";
|
|
9
9
|
import moment from "moment-timezone";
|
|
10
10
|
import { useMemo, useRef } from "react";
|
|
11
11
|
import { GestureRef } from "react-native-gesture-handler/lib/typescript/handlers/gestures/gesture";
|
|
12
|
-
import { IsEditingProvider } from "
|
|
13
|
-
import useClonedEvents from "
|
|
14
|
-
import type {
|
|
15
|
-
CalendarEvent,
|
|
16
|
-
Config,
|
|
17
|
-
onCreateEvent,
|
|
18
|
-
ThemeStyle,
|
|
19
|
-
} from "src/types";
|
|
12
|
+
import { IsEditingProvider } from "./hooks/use-is-editing";
|
|
13
|
+
import useClonedEvents from "./hooks/use-cloned-events";
|
|
14
|
+
import type { CalendarEvent, Config, onCreateEvent, ThemeStyle } from "./types";
|
|
20
15
|
|
|
21
16
|
export * from "./types";
|
|
22
17
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import computePositioning from "
|
|
1
|
+
import computePositioning from "../../utils/compute-positioning";
|
|
2
2
|
import moment from "moment-timezone";
|
|
3
|
-
import { PartDayEventLayoutType } from "
|
|
3
|
+
import { PartDayEventLayoutType } from "../../types";
|
|
4
4
|
|
|
5
5
|
describe("computePositioning", () => {
|
|
6
6
|
it("should compute positioning correctly without collisions", () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import generateEventLayouts from "../generate-event-layouts";
|
|
2
|
-
import { CalendarEvent, EventExtend } from "
|
|
2
|
+
import { CalendarEvent, EventExtend } from "../../types";
|
|
3
3
|
|
|
4
4
|
describe("generateEventLayouts", () => {
|
|
5
5
|
it("should separate all-day events and timed events", () => {
|
package/src/utils/date-utils.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import moment, { type Moment } from "moment-timezone";
|
|
2
2
|
import { isDate, range, size } from "lodash";
|
|
3
|
-
import { CalendarEvent, PrefabHour } from "
|
|
3
|
+
import { CalendarEvent, PrefabHour } from "../types";
|
|
4
4
|
|
|
5
5
|
export const generatePrefabHours = (
|
|
6
6
|
timeFormat: string = "HH:mm"
|
|
@@ -3,7 +3,7 @@ import _reduce from "lodash/reduce";
|
|
|
3
3
|
import _sortBy from "lodash/sortBy";
|
|
4
4
|
import _reverse from "lodash/reverse";
|
|
5
5
|
import moment, { Moment } from "moment-timezone";
|
|
6
|
-
import { CalendarLayout } from "
|
|
6
|
+
import { CalendarLayout } from "../utils/calendar-layout";
|
|
7
7
|
import {
|
|
8
8
|
computeCalendarDateRange,
|
|
9
9
|
dateRangeIntersect,
|
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
getDurationInDays,
|
|
12
12
|
isAllDayOrSpansMidnight,
|
|
13
13
|
startOfUserWeek,
|
|
14
|
-
} from "
|
|
15
|
-
import computePositioning from "
|
|
14
|
+
} from "../utils/date-utils";
|
|
15
|
+
import computePositioning from "../utils/compute-positioning";
|
|
16
16
|
import {
|
|
17
17
|
AllDayEventLayoutType,
|
|
18
18
|
CalendarEvent,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
EventExtend,
|
|
22
22
|
FullCalendarEventLayout,
|
|
23
23
|
PartDayEventLayoutType,
|
|
24
|
-
} from "
|
|
24
|
+
} from "../types";
|
|
25
25
|
|
|
26
26
|
interface GenerateEventLayouts {
|
|
27
27
|
events: CalendarEvent[];
|
package/src/utils/globals.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Gesture } from "react-native-gesture-handler";
|
|
2
2
|
import { runOnJS, SharedValue } from "react-native-reanimated";
|
|
3
3
|
import { RefObject } from "react";
|
|
4
|
-
import { PartDayEventLayoutType } from "
|
|
4
|
+
import { PartDayEventLayoutType } from "../types";
|
|
5
5
|
|
|
6
6
|
const gesturePan = (
|
|
7
7
|
startY: SharedValue<number>,
|