@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.
Files changed (140) hide show
  1. package/lib/commonjs/components/all-day-events.js +2 -2
  2. package/lib/commonjs/components/background-hours-content.js +1 -1
  3. package/lib/commonjs/components/background-hours-content.js.map +1 -1
  4. package/lib/commonjs/components/background-hours-layout.js +1 -1
  5. package/lib/commonjs/components/background-hours-layout.js.map +1 -1
  6. package/lib/commonjs/components/edit-event-container.js +5 -5
  7. package/lib/commonjs/components/event-container.js +2 -2
  8. package/lib/commonjs/components/event-container.js.map +1 -1
  9. package/lib/commonjs/components/new-event-container.js +2 -2
  10. package/lib/commonjs/components/new-event-container.js.map +1 -1
  11. package/lib/commonjs/components/time-indicator.js +1 -1
  12. package/lib/commonjs/components/timed-event-container.js +5 -5
  13. package/lib/commonjs/components/timed-event-container.js.map +1 -1
  14. package/lib/commonjs/components/timed-events.js +8 -8
  15. package/lib/commonjs/components/timed-events.js.map +1 -1
  16. package/lib/commonjs/components/zoom-provider.js +3 -3
  17. package/lib/commonjs/components/zoom-provider.js.map +1 -1
  18. package/lib/commonjs/hooks/use-is-editing.js +3 -3
  19. package/lib/commonjs/hooks/use-is-editing.js.map +1 -1
  20. package/lib/commonjs/index.js +7 -7
  21. package/lib/commonjs/index.js.map +1 -1
  22. package/lib/commonjs/utils/calendar-layout.js +1 -1
  23. package/lib/commonjs/utils/generate-event-layouts.js +4 -4
  24. package/lib/commonjs/utils/generate-event-layouts.js.map +1 -1
  25. package/lib/module/components/all-day-events.js +2 -2
  26. package/lib/module/components/all-day-events.js.map +1 -1
  27. package/lib/module/components/background-hours-content.js +1 -1
  28. package/lib/module/components/background-hours-content.js.map +1 -1
  29. package/lib/module/components/background-hours-layout.js +1 -1
  30. package/lib/module/components/background-hours-layout.js.map +1 -1
  31. package/lib/module/components/edit-event-container.js +5 -5
  32. package/lib/module/components/edit-event-container.js.map +1 -1
  33. package/lib/module/components/event-container.js +2 -2
  34. package/lib/module/components/event-container.js.map +1 -1
  35. package/lib/module/components/new-event-container.js +2 -2
  36. package/lib/module/components/new-event-container.js.map +1 -1
  37. package/lib/module/components/time-indicator.js +1 -1
  38. package/lib/module/components/time-indicator.js.map +1 -1
  39. package/lib/module/components/timed-event-container.js +5 -5
  40. package/lib/module/components/timed-event-container.js.map +1 -1
  41. package/lib/module/components/timed-events.js +8 -8
  42. package/lib/module/components/timed-events.js.map +1 -1
  43. package/lib/module/components/zoom-provider.js +3 -3
  44. package/lib/module/components/zoom-provider.js.map +1 -1
  45. package/lib/module/hooks/use-is-editing.js +3 -3
  46. package/lib/module/hooks/use-is-editing.js.map +1 -1
  47. package/lib/module/index.js +7 -7
  48. package/lib/module/index.js.map +1 -1
  49. package/lib/module/utils/calendar-layout.js +1 -1
  50. package/lib/module/utils/calendar-layout.js.map +1 -1
  51. package/lib/module/utils/generate-event-layouts.js +4 -4
  52. package/lib/module/utils/generate-event-layouts.js.map +1 -1
  53. package/lib/typescript/commonjs/components/background-hours-content.d.ts +1 -1
  54. package/lib/typescript/commonjs/components/background-hours-content.d.ts.map +1 -1
  55. package/lib/typescript/commonjs/components/background-hours-layout.d.ts +1 -1
  56. package/lib/typescript/commonjs/components/background-hours-layout.d.ts.map +1 -1
  57. package/lib/typescript/commonjs/components/event-container.d.ts +1 -1
  58. package/lib/typescript/commonjs/components/event-container.d.ts.map +1 -1
  59. package/lib/typescript/commonjs/components/timed-event-container.d.ts +1 -1
  60. package/lib/typescript/commonjs/components/timed-event-container.d.ts.map +1 -1
  61. package/lib/typescript/commonjs/components/zoom-provider.d.ts +1 -2
  62. package/lib/typescript/commonjs/components/zoom-provider.d.ts.map +1 -1
  63. package/lib/typescript/commonjs/hooks/use-cloned-events.d.ts +1 -1
  64. package/lib/typescript/commonjs/hooks/use-cloned-events.d.ts.map +1 -1
  65. package/lib/typescript/commonjs/hooks/use-events-layout.d.ts +1 -1
  66. package/lib/typescript/commonjs/hooks/use-events-layout.d.ts.map +1 -1
  67. package/lib/typescript/commonjs/hooks/use-is-editing.d.ts +1 -1
  68. package/lib/typescript/commonjs/hooks/use-is-editing.d.ts.map +1 -1
  69. package/lib/typescript/commonjs/index.d.ts +1 -1
  70. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  71. package/lib/typescript/commonjs/utils/calendar-layout.d.ts +1 -1
  72. package/lib/typescript/commonjs/utils/calendar-layout.d.ts.map +1 -1
  73. package/lib/typescript/commonjs/utils/compute-positioning.d.ts +1 -1
  74. package/lib/typescript/commonjs/utils/compute-positioning.d.ts.map +1 -1
  75. package/lib/typescript/commonjs/utils/date-utils.d.ts +1 -1
  76. package/lib/typescript/commonjs/utils/date-utils.d.ts.map +1 -1
  77. package/lib/typescript/commonjs/utils/double-tap-reset-zoom-gesture.d.ts +1 -1
  78. package/lib/typescript/commonjs/utils/double-tap-reset-zoom-gesture.d.ts.map +1 -1
  79. package/lib/typescript/commonjs/utils/generate-event-layouts.d.ts +1 -1
  80. package/lib/typescript/commonjs/utils/generate-event-layouts.d.ts.map +1 -1
  81. package/lib/typescript/commonjs/utils/globals.d.ts +1 -1
  82. package/lib/typescript/commonjs/utils/globals.d.ts.map +1 -1
  83. package/lib/typescript/commonjs/utils/pan-edit-event-gesture.d.ts +1 -1
  84. package/lib/typescript/commonjs/utils/pan-edit-event-gesture.d.ts.map +1 -1
  85. package/lib/typescript/module/components/background-hours-content.d.ts +1 -1
  86. package/lib/typescript/module/components/background-hours-content.d.ts.map +1 -1
  87. package/lib/typescript/module/components/background-hours-layout.d.ts +1 -1
  88. package/lib/typescript/module/components/background-hours-layout.d.ts.map +1 -1
  89. package/lib/typescript/module/components/event-container.d.ts +1 -1
  90. package/lib/typescript/module/components/event-container.d.ts.map +1 -1
  91. package/lib/typescript/module/components/timed-event-container.d.ts +1 -1
  92. package/lib/typescript/module/components/timed-event-container.d.ts.map +1 -1
  93. package/lib/typescript/module/components/zoom-provider.d.ts +1 -2
  94. package/lib/typescript/module/components/zoom-provider.d.ts.map +1 -1
  95. package/lib/typescript/module/hooks/use-cloned-events.d.ts +1 -1
  96. package/lib/typescript/module/hooks/use-cloned-events.d.ts.map +1 -1
  97. package/lib/typescript/module/hooks/use-events-layout.d.ts +1 -1
  98. package/lib/typescript/module/hooks/use-events-layout.d.ts.map +1 -1
  99. package/lib/typescript/module/hooks/use-is-editing.d.ts +1 -1
  100. package/lib/typescript/module/hooks/use-is-editing.d.ts.map +1 -1
  101. package/lib/typescript/module/index.d.ts +1 -1
  102. package/lib/typescript/module/index.d.ts.map +1 -1
  103. package/lib/typescript/module/utils/calendar-layout.d.ts +1 -1
  104. package/lib/typescript/module/utils/calendar-layout.d.ts.map +1 -1
  105. package/lib/typescript/module/utils/compute-positioning.d.ts +1 -1
  106. package/lib/typescript/module/utils/compute-positioning.d.ts.map +1 -1
  107. package/lib/typescript/module/utils/date-utils.d.ts +1 -1
  108. package/lib/typescript/module/utils/date-utils.d.ts.map +1 -1
  109. package/lib/typescript/module/utils/double-tap-reset-zoom-gesture.d.ts +1 -1
  110. package/lib/typescript/module/utils/double-tap-reset-zoom-gesture.d.ts.map +1 -1
  111. package/lib/typescript/module/utils/generate-event-layouts.d.ts +1 -1
  112. package/lib/typescript/module/utils/generate-event-layouts.d.ts.map +1 -1
  113. package/lib/typescript/module/utils/globals.d.ts +1 -1
  114. package/lib/typescript/module/utils/globals.d.ts.map +1 -1
  115. package/lib/typescript/module/utils/pan-edit-event-gesture.d.ts +1 -1
  116. package/lib/typescript/module/utils/pan-edit-event-gesture.d.ts.map +1 -1
  117. package/package.json +1 -1
  118. package/src/components/all-day-events.tsx +2 -2
  119. package/src/components/background-hours-content.tsx +2 -2
  120. package/src/components/background-hours-layout.tsx +2 -2
  121. package/src/components/edit-event-container.tsx +5 -5
  122. package/src/components/event-container.tsx +2 -2
  123. package/src/components/new-event-container.tsx +2 -2
  124. package/src/components/time-indicator.tsx +1 -1
  125. package/src/components/timed-event-container.tsx +5 -5
  126. package/src/components/timed-events.tsx +8 -8
  127. package/src/components/zoom-provider.tsx +4 -5
  128. package/src/hooks/use-cloned-events.ts +1 -1
  129. package/src/hooks/use-events-layout.ts +1 -1
  130. package/src/hooks/use-is-editing.tsx +3 -3
  131. package/src/index.tsx +8 -13
  132. package/src/utils/__tests___/compute-positioning.test.ts +2 -2
  133. package/src/utils/__tests___/generate-event-layout.test.ts +1 -1
  134. package/src/utils/calendar-layout.ts +1 -1
  135. package/src/utils/compute-positioning.ts +1 -1
  136. package/src/utils/date-utils.ts +1 -1
  137. package/src/utils/double-tap-reset-zoom-gesture.ts +1 -1
  138. package/src/utils/generate-event-layouts.ts +4 -4
  139. package/src/utils/globals.ts +1 -1
  140. 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 "src/components/all-day-events";
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 "src/components/zoom-provider";
6
- import TimedEvents from "src/components/timed-events";
7
- import useEventsLayout, { UpdateEvent } from "src/hooks/use-events-layout";
8
- import { ConfigProvider, DEFAULT_MINUTE_HEIGHT } from "src/utils/globals";
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 "src/hooks/use-is-editing";
13
- import useClonedEvents from "src/hooks/use-cloned-events";
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 "src/utils/compute-positioning";
1
+ import computePositioning from "../../utils/compute-positioning";
2
2
  import moment from "moment-timezone";
3
- import { PartDayEventLayoutType } from "src/types";
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 "src/types";
2
+ import { CalendarEvent, EventExtend } from "../../types";
3
3
 
4
4
  describe("generateEventLayouts", () => {
5
5
  it("should separate all-day events and timed events", () => {
@@ -1,5 +1,5 @@
1
1
  import { max } from "lodash";
2
- import { EventExtend } from "src/types";
2
+ import { EventExtend } from "../types";
3
3
 
4
4
  export class CalendarLayout {
5
5
  // visibleX is an array of numbers representing the x indexes currently 'in view'
@@ -1,5 +1,5 @@
1
1
  import moment, { Moment } from "moment-timezone";
2
- import { CollisionObject, EventPosition } from "src/types";
2
+ import { CollisionObject, EventPosition } from "../types";
3
3
 
4
4
  type ComputePositioning = {
5
5
  // We only need the collisions part of this type
@@ -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 "src/types";
3
+ import { CalendarEvent, PrefabHour } from "../types";
4
4
 
5
5
  export const generatePrefabHours = (
6
6
  timeFormat: string = "HH:mm"
@@ -1,6 +1,6 @@
1
1
  import { Gesture } from "react-native-gesture-handler";
2
2
  import { runOnJS, SharedValue } from "react-native-reanimated";
3
- import { Config } from "src/types";
3
+ import { Config } from "../types";
4
4
 
5
5
  const doubleTapGesture = (
6
6
  zoomLevel: SharedValue<number>,
@@ -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 "src/utils/calendar-layout";
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 "src/utils/date-utils";
15
- import computePositioning from "src/utils/compute-positioning";
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 "src/types";
24
+ } from "../types";
25
25
 
26
26
  interface GenerateEventLayouts {
27
27
  events: CalendarEvent[];
@@ -1,5 +1,5 @@
1
1
  import { createContext } from "react";
2
- import { Config } from "src/types";
2
+ import { Config } from "../types";
3
3
 
4
4
  export const ConfigProvider = createContext<Config>(undefined as never);
5
5
 
@@ -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 "src/types";
4
+ import { PartDayEventLayoutType } from "../types";
5
5
 
6
6
  const gesturePan = (
7
7
  startY: SharedValue<number>,