@rokoyfa/calendar 1.1.0 → 1.2.1
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/CHANGELOG.md +30 -0
- package/DEVELOPER_GUIDE.md +743 -0
- package/README.md +39 -108
- package/api/openapi.yaml +359 -3
- package/demo/calendar.config.jsonc +149 -0
- package/demo/calendar.config.yaml +146 -0
- package/dist-lib/cdn/browser-BSbYkIQu.js +130 -0
- package/dist-lib/cdn/browser-BSbYkIQu.js.map +1 -0
- package/dist-lib/cdn/calendar-widget.js +12 -7
- package/dist-lib/cdn/calendar-widget.js.map +1 -1
- package/dist-lib/cdn/de-CjkGEfiE.js +2 -0
- package/dist-lib/cdn/de-CjkGEfiE.js.map +1 -0
- package/dist-lib/cdn/es-BrMRh6bn.js +2 -0
- package/dist-lib/cdn/es-BrMRh6bn.js.map +1 -0
- package/dist-lib/cdn/fr-Ckr8Uxxd.js +2 -0
- package/dist-lib/cdn/fr-Ckr8Uxxd.js.map +1 -0
- package/dist-lib/cdn/it-_2BGklYa.js +2 -0
- package/dist-lib/cdn/it-_2BGklYa.js.map +1 -0
- package/dist-lib/cdn/nl-BykoYBK7.js +2 -0
- package/dist-lib/cdn/nl-BykoYBK7.js.map +1 -0
- package/dist-lib/cdn/pl-as7f_-F8.js +2 -0
- package/dist-lib/cdn/pl-as7f_-F8.js.map +1 -0
- package/dist-lib/cdn/pt-BWJIdrI6.js +2 -0
- package/dist-lib/cdn/pt-BWJIdrI6.js.map +1 -0
- package/dist-lib/cdn/rolldown-runtime-CrjiCqGf.js +1 -0
- package/dist-lib/cdn/src-l8Q4aJRr.js +12 -0
- package/dist-lib/cdn/src-l8Q4aJRr.js.map +1 -0
- package/dist-lib/npm/{de-CCzGjeTd.js → de-lDO0Tv9y.js} +135 -8
- package/dist-lib/npm/de-lDO0Tv9y.js.map +1 -0
- package/dist-lib/npm/{es-Ciaf66rH.js → es-Cy3Mmj9C.js} +135 -8
- package/dist-lib/npm/es-Cy3Mmj9C.js.map +1 -0
- package/dist-lib/npm/{fr-CAqNm10Z.js → fr-Ci0ZM0nG.js} +135 -8
- package/dist-lib/npm/fr-Ci0ZM0nG.js.map +1 -0
- package/dist-lib/npm/index.js +6012 -2564
- package/dist-lib/npm/index.js.map +1 -1
- package/dist-lib/npm/{it-Cqqdu2ua.js → it-BiTHjgzI.js} +135 -8
- package/dist-lib/npm/it-BiTHjgzI.js.map +1 -0
- package/dist-lib/npm/{nl-CkchSA8q.js → nl-DZTwpAwV.js} +135 -8
- package/dist-lib/npm/nl-DZTwpAwV.js.map +1 -0
- package/dist-lib/npm/{pl-CCBDUr8k.js → pl-DeWLtyMR.js} +135 -8
- package/dist-lib/npm/pl-DeWLtyMR.js.map +1 -0
- package/dist-lib/npm/{pt-DucaCaoY.js → pt-CaqSW5TJ.js} +135 -8
- package/dist-lib/npm/pt-CaqSW5TJ.js.map +1 -0
- package/dist-lib/npm/types/components/Button.d.ts +1 -1
- package/dist-lib/npm/types/components/Icons.d.ts +5 -0
- package/dist-lib/npm/types/components/SegmentedControl.d.ts +2 -2
- package/dist-lib/npm/types/components/SegmentedField.d.ts +2 -11
- package/dist-lib/npm/types/components/StatusMessage.d.ts +0 -1
- package/dist-lib/npm/types/components/Tabs.d.ts +3 -1
- package/dist-lib/npm/types/config/routes.d.ts +1 -1
- package/dist-lib/npm/types/context/HostContext.d.ts +26 -3
- package/dist-lib/npm/types/context/TimeZoneContext.d.ts +3 -0
- package/dist-lib/npm/types/data/restDataSource.d.ts +5 -1
- package/dist-lib/npm/types/data/tenantDataSource.d.ts +4 -1
- package/dist-lib/npm/types/data/types.d.ts +3 -1
- package/dist-lib/npm/types/features/authorization/hooks/useAuth.d.ts +2 -1
- package/dist-lib/npm/types/features/authorization/hooks/useRedirectTarget.d.ts +4 -0
- package/dist-lib/npm/types/features/authorization/index.d.ts +1 -1
- package/dist-lib/npm/types/features/authorization/repositories/HostTokenAuthRepository.d.ts +2 -0
- package/dist-lib/npm/types/features/authorization/repositories/RemoteAuthRepository.d.ts +2 -0
- package/dist-lib/npm/types/features/authorization/types/auth.d.ts +3 -0
- package/dist-lib/npm/types/features/calendar/components/Calendar.d.ts +14 -1
- package/dist-lib/npm/types/features/calendar/components/CalendarHeader.d.ts +2 -1
- package/dist-lib/npm/types/features/calendar/components/DayColumn.d.ts +2 -1
- package/dist-lib/npm/types/features/calendar/components/EventLinks.d.ts +7 -0
- package/dist-lib/npm/types/features/calendar/components/EventLocation.d.ts +3 -0
- package/dist-lib/npm/types/features/calendar/components/EventSearchModal.d.ts +9 -0
- package/dist-lib/npm/types/features/calendar/components/EventTitle.d.ts +2 -1
- package/dist-lib/npm/types/features/calendar/components/MiniMonth.d.ts +2 -1
- package/dist-lib/npm/types/features/calendar/components/UndoNotice.d.ts +7 -0
- package/dist-lib/npm/types/features/calendar/constants/views.d.ts +4 -1
- package/dist-lib/npm/types/features/calendar/context/CurrentUserContext.d.ts +3 -0
- package/dist-lib/npm/types/features/calendar/context/HolidaysContext.d.ts +4 -0
- package/dist-lib/npm/types/features/calendar/hooks/useAttendeeCandidates.d.ts +3 -0
- package/dist-lib/npm/types/features/calendar/hooks/useEventDrag.d.ts +1 -1
- package/dist-lib/npm/types/features/calendar/hooks/useEventSearch.d.ts +7 -0
- package/dist-lib/npm/types/features/calendar/hooks/useEventSource.d.ts +2 -1
- package/dist-lib/npm/types/features/calendar/hooks/usePressDrag.d.ts +23 -0
- package/dist-lib/npm/types/features/calendar/hooks/useSegmentAttributes.d.ts +15 -0
- package/dist-lib/npm/types/features/calendar/hooks/useSlotSelection.d.ts +1 -4
- package/dist-lib/npm/types/features/calendar/index.d.ts +1 -2
- package/dist-lib/npm/types/features/calendar/types/editor.d.ts +3 -0
- package/dist-lib/npm/types/features/calendar/types/view.d.ts +1 -1
- package/dist-lib/npm/types/features/calendar/utils/eventDrag.d.ts +0 -1
- package/dist-lib/npm/types/features/calendar/utils/eventLabels.d.ts +0 -3
- package/dist-lib/npm/types/features/calendar/utils/search.d.ts +11 -0
- package/dist-lib/npm/types/features/calendars/components/ShowInPersonalSwitch.d.ts +4 -0
- package/dist-lib/npm/types/features/calendars/components/settings/ExchangeSection.d.ts +4 -0
- package/dist-lib/npm/types/features/calendars/components/settings/SubscribeSection.d.ts +4 -0
- package/dist-lib/npm/types/features/calendars/context/CalendarsProvider.d.ts +2 -1
- package/dist-lib/npm/types/features/calendars/index.d.ts +2 -2
- package/dist-lib/npm/types/features/calendars/repositories/LocalCalendarRepository.d.ts +12 -1
- package/dist-lib/npm/types/features/calendars/repositories/RemoteCalendarRepository.d.ts +3 -0
- package/dist-lib/npm/types/features/calendars/types/calendar.d.ts +5 -1
- package/dist-lib/npm/types/features/calendars/utils/activeCalendarStorage.d.ts +2 -0
- package/dist-lib/npm/types/features/calendars/utils/permissions.d.ts +1 -2
- package/dist-lib/npm/types/features/chat/components/ChatPanel.d.ts +8 -0
- package/dist-lib/npm/types/features/chat/components/ChatProvider.d.ts +13 -0
- package/dist-lib/npm/types/features/chat/components/UnreadBadge.d.ts +4 -0
- package/dist-lib/npm/types/features/chat/context/ChatContext.d.ts +14 -0
- package/dist-lib/npm/types/features/chat/hooks/useChatMessages.d.ts +13 -0
- package/dist-lib/npm/types/features/chat/hooks/useChatUnread.d.ts +7 -0
- package/dist-lib/npm/types/features/chat/index.d.ts +4 -0
- package/dist-lib/npm/types/features/chat/utils/time.d.ts +2 -0
- package/dist-lib/npm/types/features/events/components/AttendeesField.d.ts +15 -0
- package/dist-lib/npm/types/features/events/components/EventModal.d.ts +19 -3
- package/dist-lib/npm/types/features/events/components/LinksField.d.ts +8 -0
- package/dist-lib/npm/types/features/events/components/ReminderField.d.ts +6 -0
- package/dist-lib/npm/types/features/events/hooks/useEvents.d.ts +6 -3
- package/dist-lib/npm/types/features/events/index.d.ts +3 -1
- package/dist-lib/npm/types/features/events/utils/icalExchange.d.ts +11 -0
- package/dist-lib/npm/types/features/events/utils/undo.d.ts +7 -0
- package/dist-lib/npm/types/features/holidays/components/HolidaySettings.d.ts +1 -0
- package/dist-lib/npm/types/features/holidays/hooks/useHolidays.d.ts +3 -0
- package/dist-lib/npm/types/features/holidays/index.d.ts +2 -0
- package/dist-lib/npm/types/features/holidays/utils/holidayLibrary.d.ts +8 -0
- package/dist-lib/npm/types/features/preferences/components/NotificationSettings.d.ts +3 -0
- package/dist-lib/npm/types/features/preferences/index.d.ts +1 -0
- package/dist-lib/npm/types/features/reminders/ReminderNotices.d.ts +1 -0
- package/dist-lib/npm/types/features/reminders/useReminders.d.ts +2 -0
- package/dist-lib/npm/types/features/storage/hooks/useStorage.d.ts +1 -2
- package/dist-lib/npm/types/features/storage/index.d.ts +4 -2
- package/dist-lib/npm/types/features/storage/repositories/LocalEventRepository.d.ts +2 -1
- package/dist-lib/npm/types/features/storage/repositories/RemoteChatRepository.d.ts +18 -0
- package/dist-lib/npm/types/features/storage/repositories/RemoteEventRepository.d.ts +5 -2
- package/dist-lib/npm/types/features/storage/repositories/RemoteHolidayRepository.d.ts +7 -0
- package/dist-lib/npm/types/features/storage/types/storage.d.ts +30 -2
- package/dist-lib/npm/types/hooks/useDebouncedValue.d.ts +1 -0
- package/dist-lib/npm/types/hooks/useForm.d.ts +5 -0
- package/dist-lib/npm/types/hooks/useFormState.d.ts +5 -0
- package/dist-lib/npm/types/hooks/useKeyboardShortcuts.d.ts +3 -0
- package/dist-lib/npm/types/hooks/useLocationUrl.d.ts +1 -0
- package/dist-lib/npm/types/i18n/format.d.ts +1 -0
- package/dist-lib/npm/types/i18n/index.d.ts +0 -1
- package/dist-lib/npm/types/i18n/locale.d.ts +0 -2
- package/dist-lib/npm/types/i18n/messages/en/calendar.d.ts +17 -0
- package/dist-lib/npm/types/i18n/messages/en/calendars.d.ts +25 -0
- package/dist-lib/npm/types/i18n/messages/en/core.d.ts +3 -0
- package/dist-lib/npm/types/i18n/messages/en/events.d.ts +64 -3
- package/dist-lib/npm/types/i18n/messages/en/index.d.ts +130 -3
- package/dist-lib/npm/types/i18n/messages/en/settings.d.ts +21 -0
- package/dist-lib/npm/types/i18n/messages/index.d.ts +130 -3
- package/dist-lib/npm/types/lib/CalendarWidget.d.ts +1 -1
- package/dist-lib/npm/types/lib/config.d.ts +9 -22
- package/dist-lib/npm/types/lib/configFile.d.ts +6 -0
- package/dist-lib/npm/types/lib/defaults.d.ts +25 -1
- package/dist-lib/npm/types/lib/element.d.ts +5 -1
- package/dist-lib/npm/types/lib/index.d.ts +6 -3
- package/dist-lib/npm/types/lib/options.d.ts +35 -0
- package/dist-lib/npm/types/lib/useCalendarOptions.d.ts +11 -0
- package/dist-lib/npm/types/pages/RespondPage.d.ts +1 -0
- package/dist-lib/npm/types/utils/api.d.ts +4 -5
- package/dist-lib/npm/types/utils/apiError.d.ts +0 -2
- package/dist-lib/npm/types/utils/appError.d.ts +2 -1
- package/dist-lib/npm/types/utils/calendarView.d.ts +1 -0
- package/dist-lib/npm/types/utils/chat.d.ts +44 -0
- package/dist-lib/npm/types/utils/color.d.ts +0 -1
- package/dist-lib/npm/types/utils/date.d.ts +0 -6
- package/dist-lib/npm/types/utils/event.d.ts +41 -5
- package/dist-lib/npm/types/utils/holidays.d.ts +18 -0
- package/dist-lib/npm/types/utils/ical.d.ts +11 -0
- package/dist-lib/npm/types/utils/location.d.ts +4 -0
- package/dist-lib/npm/types/utils/notifications.d.ts +3 -0
- package/dist-lib/npm/types/utils/preferences.d.ts +7 -1
- package/dist-lib/npm/types/utils/recurrence.d.ts +3 -4
- package/dist-lib/npm/types/utils/reminders.d.ts +13 -0
- package/dist-lib/npm/types/utils/timeZone.d.ts +1 -1
- package/package.json +10 -1
- package/schema/calendar-config.schema.json +232 -0
- package/dist-lib/cdn/de-BPZBZXaZ.js +0 -2
- package/dist-lib/cdn/de-BPZBZXaZ.js.map +0 -1
- package/dist-lib/cdn/es-DsIckdik.js +0 -2
- package/dist-lib/cdn/es-DsIckdik.js.map +0 -1
- package/dist-lib/cdn/fr-DWAs3O6J.js +0 -2
- package/dist-lib/cdn/fr-DWAs3O6J.js.map +0 -1
- package/dist-lib/cdn/it-CbhjxqIb.js +0 -2
- package/dist-lib/cdn/it-CbhjxqIb.js.map +0 -1
- package/dist-lib/cdn/nl-mjTHznX5.js +0 -2
- package/dist-lib/cdn/nl-mjTHznX5.js.map +0 -1
- package/dist-lib/cdn/pl-CXT0jb2D.js +0 -2
- package/dist-lib/cdn/pl-CXT0jb2D.js.map +0 -1
- package/dist-lib/cdn/pt-D0oXlVdU.js +0 -2
- package/dist-lib/cdn/pt-D0oXlVdU.js.map +0 -1
- package/dist-lib/npm/de-CCzGjeTd.js.map +0 -1
- package/dist-lib/npm/es-Ciaf66rH.js.map +0 -1
- package/dist-lib/npm/fr-CAqNm10Z.js.map +0 -1
- package/dist-lib/npm/it-Cqqdu2ua.js.map +0 -1
- package/dist-lib/npm/nl-CkchSA8q.js.map +0 -1
- package/dist-lib/npm/pl-CCBDUr8k.js.map +0 -1
- package/dist-lib/npm/pt-DucaCaoY.js.map +0 -1
- package/dist-lib/npm/types/hooks/useArrowKeyNavigation.d.ts +0 -6
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
type SegmentedControlProps<T extends string> = {
|
|
1
|
+
export type SegmentedControlProps<T extends string> = {
|
|
2
2
|
label: string;
|
|
3
3
|
value: T;
|
|
4
4
|
options: readonly {
|
|
5
5
|
value: T;
|
|
6
6
|
label: string;
|
|
7
|
+
title?: string;
|
|
7
8
|
}[];
|
|
8
9
|
onChange: (value: T) => void;
|
|
9
10
|
};
|
|
10
11
|
export declare function SegmentedControl<T extends string>({ label, value, options, onChange }: SegmentedControlProps<T>): import("react").JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
type
|
|
2
|
-
|
|
3
|
-
value: T;
|
|
4
|
-
options: readonly {
|
|
5
|
-
value: T;
|
|
6
|
-
label: string;
|
|
7
|
-
}[];
|
|
8
|
-
onChange: (value: T) => void;
|
|
9
|
-
};
|
|
10
|
-
export declare function SegmentedField<T extends string>({ label, ...controlProps }: SegmentedFieldProps<T>): import("react").JSX.Element;
|
|
11
|
-
export {};
|
|
1
|
+
import { type SegmentedControlProps } from './SegmentedControl.js';
|
|
2
|
+
export declare function SegmentedField<T extends string>({ label, ...controlProps }: SegmentedControlProps<T>): import("react").JSX.Element;
|
|
@@ -3,7 +3,6 @@ type StatusMessageProps = {
|
|
|
3
3
|
tone?: 'error' | 'success';
|
|
4
4
|
className?: string;
|
|
5
5
|
};
|
|
6
|
-
export declare function StatusMessage({ message, tone, className }: StatusMessageProps): import("react").JSX.Element | null;
|
|
7
6
|
export declare function ErrorMessage(props: Omit<StatusMessageProps, 'tone'>): import("react").JSX.Element;
|
|
8
7
|
type ActionFeedbackProps = {
|
|
9
8
|
error: string | null | undefined;
|
|
@@ -3,12 +3,14 @@ export type TabDefinition<T extends string> = {
|
|
|
3
3
|
value: T;
|
|
4
4
|
label: string;
|
|
5
5
|
content: ReactNode;
|
|
6
|
+
invalid?: boolean;
|
|
6
7
|
};
|
|
7
8
|
type TabsProps<T extends string> = {
|
|
8
9
|
label: string;
|
|
9
10
|
tabs: readonly TabDefinition<T>[];
|
|
10
11
|
value: T;
|
|
12
|
+
stable?: boolean;
|
|
11
13
|
onChange: (value: T) => void;
|
|
12
14
|
};
|
|
13
|
-
export declare function Tabs<T extends string>({ label, tabs, value, onChange }: TabsProps<T>): import("react").JSX.Element;
|
|
15
|
+
export declare function Tabs<T extends string>({ label, tabs, value, stable, onChange }: TabsProps<T>): import("react").JSX.Element;
|
|
14
16
|
export {};
|
|
@@ -8,11 +8,11 @@ export declare const ROUTES: {
|
|
|
8
8
|
readonly settings: "/settings";
|
|
9
9
|
readonly createCalendar: "/calendars/new";
|
|
10
10
|
readonly calendarSettings: "/calendars/:calendarId/settings";
|
|
11
|
+
readonly respond: "/respond";
|
|
11
12
|
};
|
|
12
13
|
export declare const calendarSettingsPath: (calendarId: string) => string;
|
|
13
14
|
export declare const SETTINGS_CALENDARS_PATH: string;
|
|
14
15
|
export declare const SETTINGS_INVITATIONS_PATH: string;
|
|
15
16
|
export declare const TOKEN_PARAM = "token";
|
|
16
|
-
export declare const isSafeRedirect: (path: string | null) => path is string;
|
|
17
17
|
export declare const getRedirectTarget: (searchParams: URLSearchParams) => string;
|
|
18
18
|
export declare const withRedirect: (route: string, redirectTo: string | null) => string;
|
|
@@ -1,11 +1,34 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CalendarFeatures } from '../lib/defaults.js';
|
|
2
|
+
import { type CalendarView } from '../utils/calendarView.js';
|
|
2
3
|
export type HostTheme = 'light' | 'dark';
|
|
3
4
|
export type HostOptions = {
|
|
4
|
-
|
|
5
|
+
features: CalendarFeatures;
|
|
6
|
+
views: readonly CalendarView[];
|
|
5
7
|
theme?: HostTheme;
|
|
6
8
|
initialView?: CalendarView;
|
|
7
9
|
timeZone?: string;
|
|
10
|
+
holidays?: string;
|
|
11
|
+
mapUrl?: string;
|
|
8
12
|
};
|
|
9
13
|
export declare const HostContext: import("react").Context<HostOptions>;
|
|
10
14
|
export declare const useHost: () => HostOptions;
|
|
11
|
-
export declare const
|
|
15
|
+
export declare const useFeatures: () => {
|
|
16
|
+
auth: boolean;
|
|
17
|
+
teams: boolean;
|
|
18
|
+
chat: boolean;
|
|
19
|
+
attendees: boolean;
|
|
20
|
+
recurrence: boolean;
|
|
21
|
+
reminders: boolean;
|
|
22
|
+
links: boolean;
|
|
23
|
+
mapLinks: boolean;
|
|
24
|
+
holidays: boolean;
|
|
25
|
+
search: boolean;
|
|
26
|
+
undo: boolean;
|
|
27
|
+
duplicate: boolean;
|
|
28
|
+
shortcuts: boolean;
|
|
29
|
+
subscriptions: boolean;
|
|
30
|
+
importExport: boolean;
|
|
31
|
+
emailNotifications: boolean;
|
|
32
|
+
timeZones: boolean;
|
|
33
|
+
customColors: boolean;
|
|
34
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type UserTokenProvider } from '../features/authorization/index.js';
|
|
2
|
+
import type { HolidaySource } from '../lib/defaults.js';
|
|
2
3
|
import type { CalendarDataSource } from './types.js';
|
|
3
4
|
export type RestDataSourceOptions = {
|
|
4
5
|
baseUrl: string;
|
|
@@ -7,5 +8,8 @@ export type RestDataSourceOptions = {
|
|
|
7
8
|
headers?: HeadersInit;
|
|
8
9
|
getAccessToken?: () => string | null;
|
|
9
10
|
getUserToken?: UserTokenProvider;
|
|
11
|
+
holidaySource?: HolidaySource;
|
|
12
|
+
chat?: boolean;
|
|
13
|
+
chatSocketUrl?: string;
|
|
10
14
|
};
|
|
11
|
-
export declare function restDataSource({ baseUrl, timeoutMs, auth, headers, getAccessToken, getUserToken, }: RestDataSourceOptions): CalendarDataSource;
|
|
15
|
+
export declare function restDataSource({ baseUrl, timeoutMs, auth, headers, getAccessToken, getUserToken, holidaySource, chat, chatSocketUrl, }: RestDataSourceOptions): CalendarDataSource;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { UserTokenProvider } from '../features/authorization/index.js';
|
|
2
|
+
import type { HolidaySource } from '../lib/defaults.js';
|
|
2
3
|
import type { CalendarDataSource } from './types.js';
|
|
3
4
|
export declare const TENANT_HEADER = "X-Calendar-Tenant";
|
|
4
5
|
export type TenantDataSourceOptions = {
|
|
@@ -6,5 +7,7 @@ export type TenantDataSourceOptions = {
|
|
|
6
7
|
baseUrl: string;
|
|
7
8
|
timeoutMs?: number;
|
|
8
9
|
getUserToken?: UserTokenProvider;
|
|
10
|
+
holidaySource?: HolidaySource;
|
|
11
|
+
chat?: boolean;
|
|
9
12
|
};
|
|
10
|
-
export declare const tenantDataSource: ({ tenant, baseUrl, timeoutMs, getUserToken }: TenantDataSourceOptions) => CalendarDataSource;
|
|
13
|
+
export declare const tenantDataSource: ({ tenant, baseUrl, timeoutMs, getUserToken, holidaySource, chat, }: TenantDataSourceOptions) => CalendarDataSource;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { AuthRepository } from '../features/authorization/index.js';
|
|
2
2
|
import type { CalendarRepository } from '../features/calendars/index.js';
|
|
3
|
-
import type { ColorRepository, EventRepository, PreferencesRepository, StorageMode } from '../features/storage/index.js';
|
|
3
|
+
import type { ColorRepository, EventRepository, ChatRepository, HolidayRepository, PreferencesRepository, StorageMode } from '../features/storage/index.js';
|
|
4
4
|
export type DataRepositories = {
|
|
5
5
|
mode: StorageMode;
|
|
6
6
|
events: EventRepository;
|
|
7
7
|
calendars: CalendarRepository;
|
|
8
8
|
colors: ColorRepository;
|
|
9
9
|
preferences: PreferencesRepository;
|
|
10
|
+
holidays?: HolidayRepository;
|
|
11
|
+
chat?: ChatRepository;
|
|
10
12
|
};
|
|
11
13
|
export type DataSourceContext = {
|
|
12
14
|
getLanguage: () => string | null;
|
|
@@ -10,9 +10,10 @@ export declare const useAuth: () => {
|
|
|
10
10
|
verifyEmail: (token: string) => Promise<void>;
|
|
11
11
|
resendVerificationEmail: () => Promise<void>;
|
|
12
12
|
} & {
|
|
13
|
+
respondToEvent: (token: string, status: import("../../../utils/event.ts").EventReply) => Promise<import("../../../utils/event.ts").EventResponse>;
|
|
13
14
|
enabled: boolean;
|
|
14
15
|
method: import("../index.ts").AuthMethod;
|
|
15
|
-
status: import("../
|
|
16
|
+
status: import("../types/auth.ts").AuthStatus;
|
|
16
17
|
user: import("../index.ts").User | null;
|
|
17
18
|
expireSession: () => void;
|
|
18
19
|
};
|
|
@@ -11,4 +11,4 @@ export { LoginPage } from './components/LoginPage.js';
|
|
|
11
11
|
export { RegisterPage } from './components/RegisterPage.js';
|
|
12
12
|
export { ResetPasswordPage } from './components/ResetPasswordPage.js';
|
|
13
13
|
export { VerifyEmailPage } from './components/VerifyEmailPage.js';
|
|
14
|
-
export type { AuthMethod, AuthRepository,
|
|
14
|
+
export type { AuthMethod, AuthRepository, User, UserTokenProvider } from './types/auth.js';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type EventReply } from '../../../utils/event.js';
|
|
1
2
|
import type { ApiClient } from '../../../utils/api.js';
|
|
2
3
|
import type { AuthRepository, User, UserTokenProvider } from '../types/auth.js';
|
|
3
4
|
export declare class HostTokenAuthRepository implements AuthRepository {
|
|
@@ -15,4 +16,5 @@ export declare class HostTokenAuthRepository implements AuthRepository {
|
|
|
15
16
|
resetPassword: () => Promise<never>;
|
|
16
17
|
verifyEmail: () => Promise<never>;
|
|
17
18
|
resendVerificationEmail: () => Promise<never>;
|
|
19
|
+
respondToEvent(token: string, status: EventReply): Promise<import("../../../utils/event.ts").EventResponse>;
|
|
18
20
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type EventReply } from '../../../utils/event.js';
|
|
1
2
|
import type { ApiClient } from '../../../utils/api.js';
|
|
2
3
|
import type { AccountDeletionInput, AuthRepository, LoginInput, PasswordChangeInput, PasswordResetInput, PasswordResetRequestInput, ProfileInput, RegisterInput, User } from '../types/auth.js';
|
|
3
4
|
export declare class RemoteAuthRepository implements AuthRepository {
|
|
@@ -15,4 +16,5 @@ export declare class RemoteAuthRepository implements AuthRepository {
|
|
|
15
16
|
resetPassword(input: PasswordResetInput): Promise<void>;
|
|
16
17
|
verifyEmail(token: string): Promise<void>;
|
|
17
18
|
resendVerificationEmail(): Promise<void>;
|
|
19
|
+
respondToEvent(token: string, status: EventReply): Promise<import("../../../utils/event.ts").EventResponse>;
|
|
18
20
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { EventReply, EventResponse } from '../../../utils/event.js';
|
|
1
2
|
export type User = {
|
|
2
3
|
id: string;
|
|
3
4
|
email: string;
|
|
@@ -40,9 +41,11 @@ export interface AuthRepository {
|
|
|
40
41
|
resetPassword(input: PasswordResetInput): Promise<void>;
|
|
41
42
|
verifyEmail(token: string): Promise<void>;
|
|
42
43
|
resendVerificationEmail(): Promise<void>;
|
|
44
|
+
respondToEvent?(token: string, status: EventReply): Promise<EventResponse>;
|
|
43
45
|
}
|
|
44
46
|
type AccountActions = Pick<AuthRepository, 'login' | 'register' | 'logout' | 'updateProfile' | 'changePassword' | 'deleteAccount' | 'requestPasswordReset' | 'resetPassword' | 'verifyEmail' | 'resendVerificationEmail'>;
|
|
45
47
|
export type AuthContextValue = AccountActions & {
|
|
48
|
+
respondToEvent: (token: string, status: EventReply) => Promise<EventResponse>;
|
|
46
49
|
enabled: boolean;
|
|
47
50
|
method: AuthMethod;
|
|
48
51
|
status: AuthStatus;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
+
import { type EventTab } from '../../events/index.js';
|
|
3
|
+
import { type ChatAccess } from '../../chat/index.js';
|
|
4
|
+
import { type AttendeeCandidateLoader } from '../hooks/useAttendeeCandidates.js';
|
|
2
5
|
import type { EventSources } from '../types/eventSource.js';
|
|
3
6
|
import type { CalendarView } from '../types/view.js';
|
|
4
7
|
type CalendarProps = {
|
|
@@ -9,6 +12,16 @@ type CalendarProps = {
|
|
|
9
12
|
initialView?: CalendarView;
|
|
10
13
|
headerContext?: ReactNode;
|
|
11
14
|
headerAccessory?: ReactNode;
|
|
15
|
+
currentUserEmail?: string | null;
|
|
16
|
+
loadAttendeeCandidates?: AttendeeCandidateLoader;
|
|
17
|
+
chat?: ChatAccess;
|
|
18
|
+
openEvent?: OpenEventRequest;
|
|
19
|
+
onOpenEventDone?: () => void;
|
|
12
20
|
};
|
|
13
|
-
export
|
|
21
|
+
export type OpenEventRequest = {
|
|
22
|
+
eventId: string;
|
|
23
|
+
date: string;
|
|
24
|
+
tab?: EventTab;
|
|
25
|
+
};
|
|
26
|
+
export declare function Calendar({ calendarIds, targetCalendarId, canCreate, eventSources, initialView, headerContext, headerAccessory, currentUserEmail, loadAttendeeCandidates, chat, openEvent, onOpenEventDone, }: CalendarProps): import("react").JSX.Element;
|
|
14
27
|
export {};
|
|
@@ -9,8 +9,9 @@ type CalendarHeaderProps = {
|
|
|
9
9
|
onNext: () => void;
|
|
10
10
|
onToday: () => void;
|
|
11
11
|
onCreateEvent?: () => void;
|
|
12
|
+
onSearch?: () => void;
|
|
12
13
|
context?: ReactNode;
|
|
13
14
|
accessory?: ReactNode;
|
|
14
15
|
};
|
|
15
|
-
export declare function CalendarHeader({ view, title, subtitle, onViewChange, onPrevious, onNext, onToday, onCreateEvent, context, accessory, }: CalendarHeaderProps): import("react").JSX.Element;
|
|
16
|
+
export declare function CalendarHeader({ view, title, subtitle, onViewChange, onPrevious, onNext, onToday, onCreateEvent, onSearch, context, accessory, }: CalendarHeaderProps): import("react").JSX.Element;
|
|
16
17
|
export {};
|
|
@@ -7,6 +7,7 @@ type DayColumnProps = {
|
|
|
7
7
|
nowMinutes: number | null;
|
|
8
8
|
segments: readonly EventSegment[];
|
|
9
9
|
allDaySegments: readonly AllDaySegment[];
|
|
10
|
+
allDayRowOffset?: number;
|
|
10
11
|
selection?: {
|
|
11
12
|
fromHour: number;
|
|
12
13
|
toHour: number;
|
|
@@ -17,5 +18,5 @@ type DayColumnProps = {
|
|
|
17
18
|
onEventSelect: (event: EventOccurrence) => void;
|
|
18
19
|
onHeaderSelect?: (date: string) => void;
|
|
19
20
|
};
|
|
20
|
-
export declare function DayColumn({ date, isToday, nowMinutes, segments, allDaySegments, selection, onSlotSelect, onAllDaySelect, onEventSelect, onHeaderSelect, }: DayColumnProps): import("react").JSX.Element;
|
|
21
|
+
export declare function DayColumn({ date, isToday, nowMinutes, segments, allDaySegments, allDayRowOffset, selection, onSlotSelect, onAllDaySelect, onEventSelect, onHeaderSelect, }: DayColumnProps): import("react").JSX.Element;
|
|
21
22
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type CalendarEvent } from '../../../utils/event.js';
|
|
2
|
+
type EventSearchModalProps = {
|
|
3
|
+
calendarIds: readonly string[];
|
|
4
|
+
today: string;
|
|
5
|
+
onSelect: (event: CalendarEvent, date: string) => void;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
};
|
|
8
|
+
export declare function EventSearchModal({ calendarIds, today, onSelect, onClose }: EventSearchModalProps): import("react").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -3,6 +3,7 @@ import type { EventSource } from '../types/eventSource.js';
|
|
|
3
3
|
type EventTitleProps = {
|
|
4
4
|
event: EventOccurrence;
|
|
5
5
|
source?: EventSource;
|
|
6
|
+
withLocation?: boolean;
|
|
6
7
|
};
|
|
7
|
-
export declare function EventTitle({ event, source }: EventTitleProps): import("react").JSX.Element;
|
|
8
|
+
export declare function EventTitle({ event, source, withLocation }: EventTitleProps): import("react").JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -3,7 +3,8 @@ type MiniMonthProps = {
|
|
|
3
3
|
today: string;
|
|
4
4
|
className?: string;
|
|
5
5
|
hasEvents?: (date: string) => boolean;
|
|
6
|
+
getHoliday?: (date: string) => string | undefined;
|
|
6
7
|
onSelectDay?: (date: string) => void;
|
|
7
8
|
};
|
|
8
|
-
export declare function MiniMonth({ month, today, className, hasEvents, onSelectDay }: MiniMonthProps): import("react").JSX.Element;
|
|
9
|
+
export declare function MiniMonth({ month, today, className, hasEvents, getHoliday, onSelectDay }: MiniMonthProps): import("react").JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { Messages } from '../../../i18n/index.js';
|
|
2
2
|
import { type CalendarView, type ViewDefinition } from '../types/view.js';
|
|
3
3
|
export declare const VIEW_DEFINITIONS: Record<CalendarView, ViewDefinition>;
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const VIEW_SHORTCUTS: Record<CalendarView, string>;
|
|
5
|
+
export declare const withShortcut: (label: string, key: string) => string;
|
|
6
|
+
export declare const getViewOptions: (m: Messages, views?: readonly CalendarView[], shortcuts?: boolean) => {
|
|
5
7
|
value: "day" | "week" | "month" | "year";
|
|
6
8
|
label: string;
|
|
9
|
+
title: string | undefined;
|
|
7
10
|
}[];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { CalendarEvent } from '../../../utils/event.js';
|
|
2
|
+
export declare const CurrentUserEmailContext: import("react").Context<string | null>;
|
|
3
|
+
export declare const useOwnAttendance: ({ attendees }: Pick<CalendarEvent, "attendees">) => "needsAction" | "accepted" | "tentative" | "declined" | undefined;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type HolidayMap = ReadonlyMap<string, readonly string[]>;
|
|
2
|
+
export declare const HolidaysContext: import("react").Context<HolidayMap>;
|
|
3
|
+
export declare const useHolidayMap: () => HolidayMap;
|
|
4
|
+
export declare const useHolidayNames: (date: string) => readonly string[];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { AttendeeCandidate } from '../../events/index.js';
|
|
2
|
+
export type AttendeeCandidateLoader = (calendarId: string) => Promise<AttendeeCandidate[]>;
|
|
3
|
+
export declare function useAttendeeCandidates(load: AttendeeCandidateLoader | undefined, calendarId: string | null): AttendeeCandidate[];
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { CalendarEvent } from '../../../utils/event.js';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const useEventSources: () => import("../types/eventSource.ts").EventSources;
|
|
3
|
+
export declare const useEventSource: ({ calendarId }: Pick<CalendarEvent, "calendarId">) => import("../types/eventSource.ts").EventSource | undefined;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
export type Point = {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
};
|
|
6
|
+
type PressDelay = {
|
|
7
|
+
mouse: number;
|
|
8
|
+
touch: number;
|
|
9
|
+
};
|
|
10
|
+
type PressDragHandlers<T> = {
|
|
11
|
+
start: (target: EventTarget | null, point: Point) => T | null;
|
|
12
|
+
activate: (press: T) => void;
|
|
13
|
+
move: (press: T, point: Point) => void;
|
|
14
|
+
finish: (press: T, commit: boolean, wasActive: boolean) => void;
|
|
15
|
+
};
|
|
16
|
+
type PressDragOptions<T> = PressDragHandlers<T> & {
|
|
17
|
+
containerRef: RefObject<HTMLElement | null>;
|
|
18
|
+
enabled: boolean;
|
|
19
|
+
delay: PressDelay;
|
|
20
|
+
vibrateMs?: number;
|
|
21
|
+
};
|
|
22
|
+
export declare function usePressDrag<T>({ containerRef, enabled, delay, vibrateMs, ...handlers }: PressDragOptions<T>): void;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ClassNameValue } from '../../../utils/classNames.js';
|
|
2
|
+
import type { EventSegment } from '../types/eventLayout.js';
|
|
3
|
+
export declare function useSegmentAttributes(segment: EventSegment, ...classNames: ClassNameValue[]): {
|
|
4
|
+
i18n: import("../../../i18n/I18nContext.ts").I18n & {
|
|
5
|
+
setUserLocale: (locale: string | null) => void;
|
|
6
|
+
};
|
|
7
|
+
source: import("../types/eventSource.ts").EventSource | undefined;
|
|
8
|
+
isDragging: boolean;
|
|
9
|
+
style: import("react").CSSProperties | undefined;
|
|
10
|
+
attributes: {
|
|
11
|
+
title: string;
|
|
12
|
+
'data-occurrence-key': string;
|
|
13
|
+
className?: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import { type RefObject } from 'react';
|
|
2
2
|
import { type SlotRange, type SlotSelection } from '../utils/slotSelection.js';
|
|
3
|
-
export declare function useSlotSelection(containerRef: RefObject<HTMLElement | null>, enabled: boolean, onSelect: (range: SlotRange) => void):
|
|
4
|
-
selection: SlotSelection | null;
|
|
5
|
-
isClickSuppressed: () => boolean;
|
|
6
|
-
};
|
|
3
|
+
export declare function useSlotSelection(containerRef: RefObject<HTMLElement | null>, enabled: boolean, onSelect: (range: SlotRange) => void): SlotSelection | null;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { Calendar } from './components/Calendar.js';
|
|
1
|
+
export { Calendar, type OpenEventRequest } from './components/Calendar.js';
|
|
2
2
|
export { getViewOptions } from './constants/views.js';
|
|
3
3
|
export { MiniMonth } from './components/MiniMonth.js';
|
|
4
|
-
export type { EventSource, EventSources } from './types/eventSource.js';
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { EventInput, EventOccurrence } from '../../../utils/event.js';
|
|
2
|
+
import type { EventTab } from '../../events/index.js';
|
|
2
3
|
export type EditorState = {
|
|
3
4
|
initialValue: EventInput;
|
|
4
5
|
occurrence: EventOccurrence | null;
|
|
6
|
+
notice?: string;
|
|
7
|
+
initialTab?: EventTab;
|
|
5
8
|
};
|
|
@@ -4,7 +4,7 @@ import type { EventOccurrence } from '../../../utils/event.js';
|
|
|
4
4
|
import type { SlotRange } from '../utils/slotSelection.js';
|
|
5
5
|
import type { EventSegment } from './eventLayout.js';
|
|
6
6
|
export { CALENDAR_VIEWS, type CalendarView } from '../../../utils/calendarView.js';
|
|
7
|
-
|
|
7
|
+
type ViewI18n = Pick<I18n, 'm' | 'format' | 'weekInfo'>;
|
|
8
8
|
export type ViewDefinition = {
|
|
9
9
|
getRange: (anchor: string, firstDay: number) => DateRange;
|
|
10
10
|
step: (anchor: string, direction: 1 | -1) => string;
|
|
@@ -5,7 +5,6 @@ export type DragPoint = {
|
|
|
5
5
|
date: string;
|
|
6
6
|
minutes: number;
|
|
7
7
|
};
|
|
8
|
-
export declare const DRAG_STEP_MINUTES = 15;
|
|
9
8
|
export declare const getDragDelta: (unit: DragUnit, from: DragPoint, to: DragPoint) => number;
|
|
10
9
|
export declare const applyDragDelta: (period: EventPeriod, mode: DragMode, delta: number) => EventPeriod;
|
|
11
10
|
export declare const isSamePeriod: (a: EventPeriod, b: EventPeriod) => boolean;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import type { I18n } from '../../../i18n/index.js';
|
|
2
|
-
import { type EventOccurrence } from '../../../utils/event.js';
|
|
3
2
|
import type { ClassNameValue } from '../../../utils/classNames.js';
|
|
4
3
|
import type { EventSegment } from '../types/eventLayout.js';
|
|
5
4
|
import type { EventSource } from '../types/eventSource.js';
|
|
6
5
|
type LabelI18n = Pick<I18n, 'm' | 'format'>;
|
|
7
|
-
export declare const getRecurrenceText: (event: EventOccurrence, i18n: LabelI18n) => string | null;
|
|
8
6
|
export declare const getSourceText: (source: EventSource, { m }: LabelI18n) => string;
|
|
9
|
-
export declare const getEventTooltip: (event: EventOccurrence, source: EventSource | undefined, i18n: LabelI18n) => string;
|
|
10
7
|
export declare const getSegmentAttributes: ({ event, continuesBefore, continuesAfter }: EventSegment, source: EventSource | undefined, i18n: LabelI18n, ...classNamesToMerge: ClassNameValue[]) => {
|
|
11
8
|
title: string;
|
|
12
9
|
'data-occurrence-key': string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type CalendarEvent } from '../../../utils/event.js';
|
|
2
|
+
export declare const SEARCH_MIN_LENGTH = 2;
|
|
3
|
+
export type SearchResult = {
|
|
4
|
+
event: CalendarEvent;
|
|
5
|
+
date: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const getFallbackSearchRange: (today: string) => {
|
|
8
|
+
from: string;
|
|
9
|
+
to: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const toSearchResults: (events: readonly CalendarEvent[], today: string) => SearchResult[];
|
|
@@ -2,7 +2,8 @@ import { type ReactNode } from 'react';
|
|
|
2
2
|
import type { CalendarRepository } from '../types/calendar.js';
|
|
3
3
|
type CalendarsProviderProps = {
|
|
4
4
|
repository: CalendarRepository;
|
|
5
|
+
storageScope: string;
|
|
5
6
|
children: ReactNode;
|
|
6
7
|
};
|
|
7
|
-
export declare function CalendarsProvider({ repository, children }: CalendarsProviderProps): import("react").JSX.Element;
|
|
8
|
+
export declare function CalendarsProvider({ repository, storageScope, children }: CalendarsProviderProps): import("react").JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -6,7 +6,7 @@ export { CalendarSettingsPage } from './components/settings/CalendarSettingsPage
|
|
|
6
6
|
export { CreateCalendarPage } from './components/create/CreateCalendarPage.js';
|
|
7
7
|
export { CalendarSwitcher } from './components/CalendarSwitcher.js';
|
|
8
8
|
export { ActiveCalendarIndicator } from './components/ActiveCalendarIndicator.js';
|
|
9
|
-
export { getSharedCalendars,
|
|
9
|
+
export { getSharedCalendars, hasPermission, isPersonalCalendar } from './utils/permissions.js';
|
|
10
10
|
export { LocalCalendarRepository } from './repositories/LocalCalendarRepository.js';
|
|
11
11
|
export { RemoteCalendarRepository } from './repositories/RemoteCalendarRepository.js';
|
|
12
|
-
export type { CalendarChanges, CalendarDraft,
|
|
12
|
+
export type { CalendarChanges, CalendarDraft, CalendarRepository, CalendarSummary, Invitation, PendingInvitation, TeamChanges, TeamInvitation, TeamMember, TeamRole, } from './types/calendar.js';
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import type { CalendarRepository } from '../types/calendar.js';
|
|
2
2
|
export declare class LocalCalendarRepository implements CalendarRepository {
|
|
3
|
-
list(): Promise<
|
|
3
|
+
list(): Promise<{
|
|
4
|
+
permissions: ("read_calendar" | "create_entry" | "update_own_entry" | "update_any_entry" | "delete_own_entry" | "delete_any_entry" | "invite_members" | "manage_members" | "manage_team" | "delete_team")[];
|
|
5
|
+
id: string;
|
|
6
|
+
teamId: string;
|
|
7
|
+
name: string;
|
|
8
|
+
color: import("../../../utils/event.ts").EventColor;
|
|
9
|
+
kind: "personal" | "team";
|
|
10
|
+
teamName: string | null;
|
|
11
|
+
description: string;
|
|
12
|
+
role: import("../index.ts").TeamRole;
|
|
13
|
+
showInPersonal: boolean;
|
|
14
|
+
}[]>;
|
|
4
15
|
listInvitations(): Promise<never[]>;
|
|
5
16
|
create: () => Promise<never>;
|
|
6
17
|
leave: () => Promise<never>;
|
|
@@ -20,4 +20,7 @@ export declare class RemoteCalendarRepository implements CalendarRepository {
|
|
|
20
20
|
listInvitations(): Promise<PendingInvitation[]>;
|
|
21
21
|
acceptInvitation(id: string): Promise<CalendarSummary[]>;
|
|
22
22
|
declineInvitation(id: string): Promise<void>;
|
|
23
|
+
getFeed(calendarId: string): Promise<string | null>;
|
|
24
|
+
createFeed(calendarId: string): Promise<string>;
|
|
25
|
+
deleteFeed(calendarId: string): Promise<void>;
|
|
23
26
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EventColor } from '../../../utils/event.js';
|
|
2
|
-
|
|
2
|
+
type CalendarKind = 'personal' | 'team';
|
|
3
3
|
export declare const TEAM_ROLES: readonly ["owner", "admin", "manager", "editor", "member", "contributor", "viewer"];
|
|
4
4
|
export type TeamRole = (typeof TEAM_ROLES)[number];
|
|
5
5
|
export type InvitableRole = Exclude<TeamRole, 'owner'>;
|
|
@@ -69,6 +69,9 @@ export interface CalendarRepository {
|
|
|
69
69
|
listTeamInvitations(teamId: string): Promise<TeamInvitation[]>;
|
|
70
70
|
invite(teamId: string, invitation: Invitation): Promise<TeamInvitation>;
|
|
71
71
|
revokeInvitation(teamId: string, invitationId: string): Promise<void>;
|
|
72
|
+
getFeed?(calendarId: string): Promise<string | null>;
|
|
73
|
+
createFeed?(calendarId: string): Promise<string>;
|
|
74
|
+
deleteFeed?(calendarId: string): Promise<void>;
|
|
72
75
|
}
|
|
73
76
|
export type CalendarsContextValue = {
|
|
74
77
|
repository: CalendarRepository;
|
|
@@ -89,3 +92,4 @@ export type CalendarsContextValue = {
|
|
|
89
92
|
deleteTeam: (calendar: CalendarSummary) => Promise<void>;
|
|
90
93
|
transferOwnership: (calendar: CalendarSummary, userId: string) => Promise<void>;
|
|
91
94
|
};
|
|
95
|
+
export {};
|
|
@@ -7,7 +7,6 @@ export declare const hasPermission: (calendar: CalendarSummary, permission: Perm
|
|
|
7
7
|
export declare const getSharedCalendars: (calendars: readonly CalendarSummary[], active: CalendarSummary) => CalendarSummary[];
|
|
8
8
|
export declare const outranks: (actor: TeamRole, target: TeamRole) => boolean;
|
|
9
9
|
export declare const getAssignableRoles: (actor: TeamRole) => ("owner" | "admin" | "manager" | "editor" | "member" | "contributor" | "viewer")[];
|
|
10
|
-
export declare const getInvitableRoles: (actor: TeamRole) => import("../
|
|
11
|
-
export declare const canOpenSettings: (calendar: CalendarSummary) => boolean;
|
|
10
|
+
export declare const getInvitableRoles: (actor: TeamRole) => import("../types/calendar.ts").InvitableRole[];
|
|
12
11
|
export declare const getDistinctTeamName: ({ name, teamName }: CalendarSummary) => string | null;
|
|
13
12
|
export declare const getCalendarKindLabel: (calendar: CalendarSummary, { calendars: { kind } }: Messages) => string;
|