@rokoyfa/calendar 0.0.0-stage → 1.0.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/CHANGELOG.md +32 -0
- package/LICENSE +21 -0
- package/README.md +159 -3
- package/api/openapi.yaml +919 -0
- package/dist-lib/cdn/calendar-widget.js +14 -0
- package/dist-lib/cdn/calendar-widget.js.map +1 -0
- package/dist-lib/cdn/de-BPZBZXaZ.js +2 -0
- package/dist-lib/cdn/de-BPZBZXaZ.js.map +1 -0
- package/dist-lib/cdn/es-DsIckdik.js +2 -0
- package/dist-lib/cdn/es-DsIckdik.js.map +1 -0
- package/dist-lib/cdn/fr-DWAs3O6J.js +2 -0
- package/dist-lib/cdn/fr-DWAs3O6J.js.map +1 -0
- package/dist-lib/cdn/it-CbhjxqIb.js +2 -0
- package/dist-lib/cdn/it-CbhjxqIb.js.map +1 -0
- package/dist-lib/cdn/nl-mjTHznX5.js +2 -0
- package/dist-lib/cdn/nl-mjTHznX5.js.map +1 -0
- package/dist-lib/cdn/pl-CXT0jb2D.js +2 -0
- package/dist-lib/cdn/pl-CXT0jb2D.js.map +1 -0
- package/dist-lib/cdn/pt-D0oXlVdU.js +2 -0
- package/dist-lib/cdn/pt-D0oXlVdU.js.map +1 -0
- package/dist-lib/npm/de-CCzGjeTd.js +573 -0
- package/dist-lib/npm/de-CCzGjeTd.js.map +1 -0
- package/dist-lib/npm/es-Ciaf66rH.js +559 -0
- package/dist-lib/npm/es-Ciaf66rH.js.map +1 -0
- package/dist-lib/npm/fr-CAqNm10Z.js +559 -0
- package/dist-lib/npm/fr-CAqNm10Z.js.map +1 -0
- package/dist-lib/npm/index.d.ts +1 -0
- package/dist-lib/npm/index.js +13277 -0
- package/dist-lib/npm/index.js.map +1 -0
- package/dist-lib/npm/it-Cqqdu2ua.js +565 -0
- package/dist-lib/npm/it-Cqqdu2ua.js.map +1 -0
- package/dist-lib/npm/nl-CkchSA8q.js +559 -0
- package/dist-lib/npm/nl-CkchSA8q.js.map +1 -0
- package/dist-lib/npm/pl-CCBDUr8k.js +565 -0
- package/dist-lib/npm/pl-CCBDUr8k.js.map +1 -0
- package/dist-lib/npm/pt-DucaCaoY.js +566 -0
- package/dist-lib/npm/pt-DucaCaoY.js.map +1 -0
- package/dist-lib/npm/types/components/Button.d.ts +17 -0
- package/dist-lib/npm/types/components/ChoiceChip.d.ts +13 -0
- package/dist-lib/npm/types/components/ConfirmModal.d.ts +11 -0
- package/dist-lib/npm/types/components/DateTimeField.d.ts +15 -0
- package/dist-lib/npm/types/components/Form.d.ts +8 -0
- package/dist-lib/npm/types/components/FormField.d.ts +10 -0
- package/dist-lib/npm/types/components/IconButton.d.ts +11 -0
- package/dist-lib/npm/types/components/Icons.d.ts +10 -0
- package/dist-lib/npm/types/components/Modal.d.ts +10 -0
- package/dist-lib/npm/types/components/NumberField.d.ts +12 -0
- package/dist-lib/npm/types/components/PageLayout.d.ts +13 -0
- package/dist-lib/npm/types/components/PageSection.d.ts +10 -0
- package/dist-lib/npm/types/components/PasswordField.d.ts +4 -0
- package/dist-lib/npm/types/components/SegmentedControl.d.ts +11 -0
- package/dist-lib/npm/types/components/SegmentedField.d.ts +11 -0
- package/dist-lib/npm/types/components/SelectField.d.ts +13 -0
- package/dist-lib/npm/types/components/StatusMessage.d.ts +13 -0
- package/dist-lib/npm/types/components/Stepper.d.ts +9 -0
- package/dist-lib/npm/types/components/Switch.d.ts +8 -0
- package/dist-lib/npm/types/components/Tabs.d.ts +14 -0
- package/dist-lib/npm/types/components/TeamsGate.d.ts +4 -0
- package/dist-lib/npm/types/components/TextField.d.ts +9 -0
- package/dist-lib/npm/types/config/calendars.d.ts +1 -0
- package/dist-lib/npm/types/config/routes.d.ts +18 -0
- package/dist-lib/npm/types/context/HostContext.d.ts +11 -0
- package/dist-lib/npm/types/context/RootElementContext.d.ts +2 -0
- package/dist-lib/npm/types/data/index.d.ts +4 -0
- package/dist-lib/npm/types/data/localDataSource.d.ts +3 -0
- package/dist-lib/npm/types/data/restDataSource.d.ts +11 -0
- package/dist-lib/npm/types/data/tenantDataSource.d.ts +10 -0
- package/dist-lib/npm/types/data/types.d.ts +21 -0
- package/dist-lib/npm/types/features/authorization/components/AccountMenu.d.ts +6 -0
- package/dist-lib/npm/types/features/authorization/components/AuthFields.d.ts +26 -0
- package/dist-lib/npm/types/features/authorization/components/AuthGate.d.ts +7 -0
- package/dist-lib/npm/types/features/authorization/components/ContinueLink.d.ts +1 -0
- package/dist-lib/npm/types/features/authorization/components/EmailVerificationBanner.d.ts +1 -0
- package/dist-lib/npm/types/features/authorization/components/ForgotPasswordPage.d.ts +1 -0
- package/dist-lib/npm/types/features/authorization/components/LoginPage.d.ts +1 -0
- package/dist-lib/npm/types/features/authorization/components/RegisterPage.d.ts +1 -0
- package/dist-lib/npm/types/features/authorization/components/ResendVerificationButton.d.ts +4 -0
- package/dist-lib/npm/types/features/authorization/components/ResetPasswordPage.d.ts +1 -0
- package/dist-lib/npm/types/features/authorization/components/VerifyEmailPage.d.ts +1 -0
- package/dist-lib/npm/types/features/authorization/components/account/AccountSettings.d.ts +1 -0
- package/dist-lib/npm/types/features/authorization/components/account/DeleteAccountSection.d.ts +1 -0
- package/dist-lib/npm/types/features/authorization/components/account/EmailSection.d.ts +4 -0
- package/dist-lib/npm/types/features/authorization/components/account/PasswordSection.d.ts +1 -0
- package/dist-lib/npm/types/features/authorization/components/account/ProfileSection.d.ts +4 -0
- package/dist-lib/npm/types/features/authorization/context/AuthContext.d.ts +2 -0
- package/dist-lib/npm/types/features/authorization/context/AuthProvider.d.ts +8 -0
- package/dist-lib/npm/types/features/authorization/hooks/useAuth.d.ts +18 -0
- package/dist-lib/npm/types/features/authorization/index.d.ts +14 -0
- package/dist-lib/npm/types/features/authorization/repositories/HostTokenAuthRepository.d.ts +18 -0
- package/dist-lib/npm/types/features/authorization/repositories/RemoteAuthRepository.d.ts +18 -0
- package/dist-lib/npm/types/features/authorization/types/auth.d.ts +52 -0
- package/dist-lib/npm/types/features/authorization/utils/validation.d.ts +22 -0
- package/dist-lib/npm/types/features/calendar/components/Calendar.d.ts +14 -0
- package/dist-lib/npm/types/features/calendar/components/CalendarHeader.d.ts +16 -0
- package/dist-lib/npm/types/features/calendar/components/DayColumn.d.ts +21 -0
- package/dist-lib/npm/types/features/calendar/components/EventBlock.d.ts +10 -0
- package/dist-lib/npm/types/features/calendar/components/EventChip.d.ts +10 -0
- package/dist-lib/npm/types/features/calendar/components/EventTitle.d.ts +8 -0
- package/dist-lib/npm/types/features/calendar/components/MiniMonth.d.ts +9 -0
- package/dist-lib/npm/types/features/calendar/components/MonthGrid.d.ts +8 -0
- package/dist-lib/npm/types/features/calendar/components/MonthView.d.ts +2 -0
- package/dist-lib/npm/types/features/calendar/components/NowIndicator.d.ts +6 -0
- package/dist-lib/npm/types/features/calendar/components/TimeColumn.d.ts +1 -0
- package/dist-lib/npm/types/features/calendar/components/TimeGridView.d.ts +2 -0
- package/dist-lib/npm/types/features/calendar/components/YearView.d.ts +2 -0
- package/dist-lib/npm/types/features/calendar/constants/grid.d.ts +4 -0
- package/dist-lib/npm/types/features/calendar/constants/views.d.ts +7 -0
- package/dist-lib/npm/types/features/calendar/context/DragContext.d.ts +2 -0
- package/dist-lib/npm/types/features/calendar/context/EventSourcesContext.d.ts +3 -0
- package/dist-lib/npm/types/features/calendar/hooks/useCalendarView.d.ts +19 -0
- package/dist-lib/npm/types/features/calendar/hooks/useEventDrag.d.ts +15 -0
- package/dist-lib/npm/types/features/calendar/hooks/useEventSource.d.ts +2 -0
- package/dist-lib/npm/types/features/calendar/hooks/useNow.d.ts +1 -0
- package/dist-lib/npm/types/features/calendar/hooks/useSlotSelection.d.ts +6 -0
- package/dist-lib/npm/types/features/calendar/index.d.ts +4 -0
- package/dist-lib/npm/types/features/calendar/types/editor.d.ts +5 -0
- package/dist-lib/npm/types/features/calendar/types/eventLayout.d.ts +14 -0
- package/dist-lib/npm/types/features/calendar/types/eventSource.d.ts +6 -0
- package/dist-lib/npm/types/features/calendar/types/view.d.ts +27 -0
- package/dist-lib/npm/types/features/calendar/utils/allDay.d.ts +12 -0
- package/dist-lib/npm/types/features/calendar/utils/eventDrag.d.ts +12 -0
- package/dist-lib/npm/types/features/calendar/utils/eventGeometry.d.ts +3 -0
- package/dist-lib/npm/types/features/calendar/utils/eventLabels.d.ts +16 -0
- package/dist-lib/npm/types/features/calendar/utils/layoutEvents.d.ts +3 -0
- package/dist-lib/npm/types/features/calendar/utils/segmentEvents.d.ts +5 -0
- package/dist-lib/npm/types/features/calendar/utils/slotSelection.d.ts +17 -0
- package/dist-lib/npm/types/features/calendars/components/ActiveCalendarIndicator.d.ts +1 -0
- package/dist-lib/npm/types/features/calendars/components/CalendarPreview.d.ts +4 -0
- package/dist-lib/npm/types/features/calendars/components/CalendarSettings.d.ts +1 -0
- package/dist-lib/npm/types/features/calendars/components/CalendarSwitcher.d.ts +1 -0
- package/dist-lib/npm/types/features/calendars/components/InvitationList.d.ts +1 -0
- package/dist-lib/npm/types/features/calendars/components/create/ColorStep.d.ts +7 -0
- package/dist-lib/npm/types/features/calendars/components/create/CreateCalendarPage.d.ts +1 -0
- package/dist-lib/npm/types/features/calendars/components/create/DetailsStep.d.ts +12 -0
- package/dist-lib/npm/types/features/calendars/components/create/MembersStep.d.ts +8 -0
- package/dist-lib/npm/types/features/calendars/components/create/ReviewStep.d.ts +4 -0
- package/dist-lib/npm/types/features/calendars/components/settings/CalendarSettingsPage.d.ts +1 -0
- package/dist-lib/npm/types/features/calendars/components/settings/DangerSection.d.ts +9 -0
- package/dist-lib/npm/types/features/calendars/components/settings/GeneralSection.d.ts +4 -0
- package/dist-lib/npm/types/features/calendars/components/settings/MembersSection.d.ts +11 -0
- package/dist-lib/npm/types/features/calendars/components/settings/RoleOverview.d.ts +1 -0
- package/dist-lib/npm/types/features/calendars/components/settings/TeamInvitationsSection.d.ts +12 -0
- package/dist-lib/npm/types/features/calendars/components/settings/TransferOwnershipModal.d.ts +8 -0
- package/dist-lib/npm/types/features/calendars/constants/calendars.d.ts +9 -0
- package/dist-lib/npm/types/features/calendars/context/CalendarsContext.d.ts +2 -0
- package/dist-lib/npm/types/features/calendars/context/CalendarsProvider.d.ts +8 -0
- package/dist-lib/npm/types/features/calendars/hooks/useCalendars.d.ts +1 -0
- package/dist-lib/npm/types/features/calendars/hooks/useTeam.d.ts +12 -0
- package/dist-lib/npm/types/features/calendars/index.d.ts +12 -0
- package/dist-lib/npm/types/features/calendars/repositories/LocalCalendarRepository.d.ts +20 -0
- package/dist-lib/npm/types/features/calendars/repositories/RemoteCalendarRepository.d.ts +23 -0
- package/dist-lib/npm/types/features/calendars/types/calendar.d.ts +91 -0
- package/dist-lib/npm/types/features/calendars/utils/draft.d.ts +7 -0
- package/dist-lib/npm/types/features/calendars/utils/permissions.d.ts +13 -0
- package/dist-lib/npm/types/features/events/components/ColorPicker.d.ts +7 -0
- package/dist-lib/npm/types/features/events/components/CustomColorSettings.d.ts +1 -0
- package/dist-lib/npm/types/features/events/components/DeleteEventModal.d.ts +8 -0
- package/dist-lib/npm/types/features/events/components/EventModal.d.ts +11 -0
- package/dist-lib/npm/types/features/events/components/RecurrenceFields.d.ts +9 -0
- package/dist-lib/npm/types/features/events/components/RecurrenceScopeModal.d.ts +8 -0
- package/dist-lib/npm/types/features/events/components/ScopeButtons.d.ts +10 -0
- package/dist-lib/npm/types/features/events/components/TimeZoneField.d.ts +6 -0
- package/dist-lib/npm/types/features/events/constants/colors.d.ts +3 -0
- package/dist-lib/npm/types/features/events/hooks/useCustomColors.d.ts +8 -0
- package/dist-lib/npm/types/features/events/hooks/useEvents.d.ts +15 -0
- package/dist-lib/npm/types/features/events/index.d.ts +7 -0
- package/dist-lib/npm/types/features/events/types/eventModal.d.ts +1 -0
- package/dist-lib/npm/types/features/events/utils/scopeOptions.d.ts +3 -0
- package/dist-lib/npm/types/features/events/utils/seriesActions.d.ts +4 -0
- package/dist-lib/npm/types/features/preferences/components/PreferencesSettings.d.ts +1 -0
- package/dist-lib/npm/types/features/preferences/context/PreferencesContext.d.ts +6 -0
- package/dist-lib/npm/types/features/preferences/context/PreferencesProvider.d.ts +4 -0
- package/dist-lib/npm/types/features/preferences/hooks/usePreferences.d.ts +1 -0
- package/dist-lib/npm/types/features/preferences/index.d.ts +3 -0
- package/dist-lib/npm/types/features/storage/components/LocalImportPrompt.d.ts +5 -0
- package/dist-lib/npm/types/features/storage/context/StorageContext.d.ts +2 -0
- package/dist-lib/npm/types/features/storage/context/StorageProvider.d.ts +8 -0
- package/dist-lib/npm/types/features/storage/hooks/useStorage.d.ts +7 -0
- package/dist-lib/npm/types/features/storage/index.d.ts +10 -0
- package/dist-lib/npm/types/features/storage/repositories/LocalColorRepository.d.ts +9 -0
- package/dist-lib/npm/types/features/storage/repositories/LocalEventRepository.d.ts +13 -0
- package/dist-lib/npm/types/features/storage/repositories/LocalPreferencesRepository.d.ts +8 -0
- package/dist-lib/npm/types/features/storage/repositories/RemoteColorRepository.d.ts +10 -0
- package/dist-lib/npm/types/features/storage/repositories/RemoteEventRepository.d.ts +12 -0
- package/dist-lib/npm/types/features/storage/repositories/RemotePreferencesRepository.d.ts +9 -0
- package/dist-lib/npm/types/features/storage/types/storage.d.ts +35 -0
- package/dist-lib/npm/types/features/storage/utils/copyEvents.d.ts +3 -0
- package/dist-lib/npm/types/features/storage/utils/localStorageList.d.ts +5 -0
- package/dist-lib/npm/types/features/storage/utils/localStorageValue.d.ts +9 -0
- package/dist-lib/npm/types/hooks/useArrowKeyNavigation.d.ts +6 -0
- package/dist-lib/npm/types/hooks/useAsyncAction.d.ts +6 -0
- package/dist-lib/npm/types/hooks/useAsyncResource.d.ts +9 -0
- package/dist-lib/npm/types/hooks/useForm.d.ts +21 -0
- package/dist-lib/npm/types/hooks/useFormState.d.ts +8 -0
- package/dist-lib/npm/types/hooks/useRequiredContext.d.ts +2 -0
- package/dist-lib/npm/types/hooks/useTabParam.d.ts +3 -0
- package/dist-lib/npm/types/i18n/I18nContext.d.ts +16 -0
- package/dist-lib/npm/types/i18n/I18nProvider.d.ts +9 -0
- package/dist-lib/npm/types/i18n/errorMessage.d.ts +2 -0
- package/dist-lib/npm/types/i18n/format.d.ts +28 -0
- package/dist-lib/npm/types/i18n/index.d.ts +8 -0
- package/dist-lib/npm/types/i18n/locale.d.ts +21 -0
- package/dist-lib/npm/types/i18n/messages/de/auth.d.ts +2 -0
- package/dist-lib/npm/types/i18n/messages/de/calendar.d.ts +3 -0
- package/dist-lib/npm/types/i18n/messages/de/calendars.d.ts +2 -0
- package/dist-lib/npm/types/i18n/messages/de/core.d.ts +7 -0
- package/dist-lib/npm/types/i18n/messages/de/events.d.ts +2 -0
- package/dist-lib/npm/types/i18n/messages/de/index.d.ts +2 -0
- package/dist-lib/npm/types/i18n/messages/de/settings.d.ts +2 -0
- package/dist-lib/npm/types/i18n/messages/de/storage.d.ts +2 -0
- package/dist-lib/npm/types/i18n/messages/en/auth.d.ts +97 -0
- package/dist-lib/npm/types/i18n/messages/en/calendar.d.ts +34 -0
- package/dist-lib/npm/types/i18n/messages/en/calendars.d.ts +179 -0
- package/dist-lib/npm/types/i18n/messages/en/core.d.ts +86 -0
- package/dist-lib/npm/types/i18n/messages/en/events.d.ts +46 -0
- package/dist-lib/npm/types/i18n/messages/en/index.d.ts +468 -0
- package/dist-lib/npm/types/i18n/messages/en/settings.d.ts +19 -0
- package/dist-lib/npm/types/i18n/messages/en/storage.d.ts +7 -0
- package/dist-lib/npm/types/i18n/messages/es/index.d.ts +2 -0
- package/dist-lib/npm/types/i18n/messages/fr/index.d.ts +2 -0
- package/dist-lib/npm/types/i18n/messages/index.d.ts +473 -0
- package/dist-lib/npm/types/i18n/messages/it/index.d.ts +2 -0
- package/dist-lib/npm/types/i18n/messages/nl/index.d.ts +2 -0
- package/dist-lib/npm/types/i18n/messages/pl/index.d.ts +2 -0
- package/dist-lib/npm/types/i18n/messages/pt/index.d.ts +2 -0
- package/dist-lib/npm/types/i18n/messages/types.d.ts +7 -0
- package/dist-lib/npm/types/i18n/useI18n.d.ts +3 -0
- package/dist-lib/npm/types/i18n/useLocaleGetter.d.ts +1 -0
- package/dist-lib/npm/types/i18n/weekInfo.d.ts +5 -0
- package/dist-lib/npm/types/lib/CalendarApp.d.ts +14 -0
- package/dist-lib/npm/types/lib/CalendarWidget.d.ts +2 -0
- package/dist-lib/npm/types/lib/IsolatedRoot.d.ts +9 -0
- package/dist-lib/npm/types/lib/config.d.ts +31 -0
- package/dist-lib/npm/types/lib/defaults.d.ts +13 -0
- package/dist-lib/npm/types/lib/element.d.ts +19 -0
- package/dist-lib/npm/types/lib/eventCallbacks.d.ts +11 -0
- package/dist-lib/npm/types/lib/index.d.ts +17 -0
- package/dist-lib/npm/types/lib/linkParam.d.ts +2 -0
- package/dist-lib/npm/types/lib/version.d.ts +1 -0
- package/dist-lib/npm/types/pages/CalendarPage.d.ts +1 -0
- package/dist-lib/npm/types/pages/SettingsPage.d.ts +1 -0
- package/dist-lib/npm/types/router.d.ts +7 -0
- package/dist-lib/npm/types/utils/api.d.ts +32 -0
- package/dist-lib/npm/types/utils/apiError.d.ts +26 -0
- package/dist-lib/npm/types/utils/appError.d.ts +10 -0
- package/dist-lib/npm/types/utils/calendarView.d.ts +3 -0
- package/dist-lib/npm/types/utils/classNames.d.ts +2 -0
- package/dist-lib/npm/types/utils/color.d.ts +5 -0
- package/dist-lib/npm/types/utils/date.d.ts +44 -0
- package/dist-lib/npm/types/utils/dom.d.ts +3 -0
- package/dist-lib/npm/types/utils/event.d.ts +86 -0
- package/dist-lib/npm/types/utils/number.d.ts +1 -0
- package/dist-lib/npm/types/utils/object.d.ts +3 -0
- package/dist-lib/npm/types/utils/preferences.d.ts +14 -0
- package/dist-lib/npm/types/utils/recurrence.d.ts +33 -0
- package/dist-lib/npm/types/utils/series.d.ts +9 -0
- package/dist-lib/npm/types/utils/timeZone.d.ts +11 -0
- package/dist-lib/npm/types/utils/validation.d.ts +6 -0
- package/package.json +88 -6
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@rokoyfa/calendar`. Versions follow [Semantic Versioning](https://semver.org/). From 1.0 on, breaking changes to props, attributes, DOM events, exported types, the data adapter and the REST contract only come with a new major version.
|
|
4
|
+
|
|
5
|
+
## 1.0.0 – 2026-11-11
|
|
6
|
+
|
|
7
|
+
First stable release. The public API is now frozen in the sense of SemVer.
|
|
8
|
+
|
|
9
|
+
**Upgrading from 0.1:** No changes are needed on the host page. Your own backend should store the new event fields `allDay` and `timeZone` and return them; events without them are read as before. `GET /events` is now called with a range one day wider on each side.
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
- All-day events: `allDay` in the event format, switch in the event dialog, all-day row above the day and week grid
|
|
13
|
+
- Time zones: events store an IANA `timeZone` (or `null` for the same local time everywhere), the dialog has a zone picker and shows the time in the viewer's zone, new prop `timeZone` / attribute `time-zone` sets the zone the calendar is shown in
|
|
14
|
+
- Move events by pressing and holding them for one second, then dragging (mouse and touch). In the day and week view the lower edge changes the end time. Recurring events ask whether to change this, the following or all events
|
|
15
|
+
- Events without `allDay`/`timeZone` keep working as floating timed events
|
|
16
|
+
- The visible range sent to the backend is one day wider on each side
|
|
17
|
+
- French, Spanish, Italian, Dutch, Polish and Portuguese, loaded on demand. Language names in the settings appear in their own language
|
|
18
|
+
- `messages` prop and property to override texts or add languages
|
|
19
|
+
- Automated tests with Vitest (`npm test`), run before every publish
|
|
20
|
+
|
|
21
|
+
## 0.1.0 – 2026-11-10
|
|
22
|
+
|
|
23
|
+
First public release.
|
|
24
|
+
|
|
25
|
+
- `<Calendar />` React component and `<calendar-widget>` web component from one package, isolated in a Shadow DOM
|
|
26
|
+
- Day, week, month and year views, drag to select a time range, recurring events with "this / following / all" editing
|
|
27
|
+
- Data sources: `localDataSource`, `restDataSource`, `tenantDataSource` and custom adapters
|
|
28
|
+
- Accounts, team calendars with roles, invitations and ownership transfer when a backend is connected
|
|
29
|
+
- Sign-in through the host page with `getUserToken`
|
|
30
|
+
- English and German, region-aware week start, week numbers and time formats
|
|
31
|
+
- Host options `theme`, `initialView`, `features.teams`, `linkParam` and callbacks `onEventCreate`, `onEventUpdate`, `onEventDelete` (DOM events on the web component)
|
|
32
|
+
- REST contract as OpenAPI 3.1 in `api/openapi.yaml`
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Rokoyfa
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,159 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# @rokoyfa/calendar
|
|
2
|
+
|
|
3
|
+
An embeddable calendar for React apps and any other website. Day, week, month and year views, recurring events, team calendars with roles and invitations. English, German, French, Spanish, Italian, Dutch, Polish and Portuguese built in, more through your own texts. Runs without a backend (data stays in the browser) or against your own REST backend. Styles are isolated in a Shadow DOM, so the host page and the calendar never affect each other.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
**Any website**, React is bundled:
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@rokoyfa/calendar@1/dist-lib/cdn/calendar-widget.js"></script>
|
|
11
|
+
|
|
12
|
+
<calendar-widget style="height: 700px"></calendar-widget>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
**React 19**:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install @rokoyfa/calendar
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import { Calendar } from '@rokoyfa/calendar'
|
|
23
|
+
|
|
24
|
+
<Calendar style={{ height: 700 }} />
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Give the calendar a height, it fills its box. No CSS import is needed.
|
|
28
|
+
|
|
29
|
+
## Examples
|
|
30
|
+
|
|
31
|
+
```html
|
|
32
|
+
<!-- German, dark, month view -->
|
|
33
|
+
<calendar-widget locale="de-DE" theme="dark" initial-view="month" style="height: 600px"></calendar-widget>
|
|
34
|
+
|
|
35
|
+
<!-- Your backend with sign-in -->
|
|
36
|
+
<calendar-widget storage-mode="remote" auth api-base-url="https://api.example.com" style="height: 700px"></calendar-widget>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
<Calendar
|
|
41
|
+
storageMode="remote"
|
|
42
|
+
apiBaseUrl="https://api.example.com"
|
|
43
|
+
features={{ auth: true, teams: false }}
|
|
44
|
+
onEventCreate={(event) => console.log('created', event)}
|
|
45
|
+
/>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
document.querySelector('calendar-widget').addEventListener('event-create', (e) => console.log(e.detail))
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
| Prop | Attribute | Default | |
|
|
53
|
+
| --- | --- | --- | --- |
|
|
54
|
+
| `locale` | `locale` | browser | `en-US`, `de-DE`, `fr-FR`, `pt-BR`, … Formats follow the region |
|
|
55
|
+
| `messages` | property | – | Own texts per language, see below |
|
|
56
|
+
| `theme` | `theme` | system | `light`, `dark` |
|
|
57
|
+
| `initialView` | `initial-view` | user setting | `day`, `week`, `month`, `year` |
|
|
58
|
+
| `timeZone` | `time-zone` | browser | IANA zone the calendar is shown in, e.g. `Europe/Berlin` |
|
|
59
|
+
| `storageMode` | `storage-mode` | `local` | `local` or `remote` |
|
|
60
|
+
| `apiBaseUrl` | `api-base-url` | `/api` | Base URL of your backend |
|
|
61
|
+
| `features` | `auth`, `teams` | auth off, teams on | `teams="false"` turns team features off |
|
|
62
|
+
| `tenant`, `getUserToken` | `tenant`, property | – | Multi-tenant backend, sign-in through your own page |
|
|
63
|
+
| `dataSource` | property | – | Custom data adapter instead of REST |
|
|
64
|
+
| `onEventCreate` / `Update` / `Delete` | `event-create` / `-update` / `-delete` | – | After every stored change |
|
|
65
|
+
|
|
66
|
+
**Own texts and languages.** Override single texts or add a language. Missing texts fall back to the built-in language, or to English for a new one. The full list of keys is the `Messages` type.
|
|
67
|
+
|
|
68
|
+
```js
|
|
69
|
+
document.querySelector('calendar-widget').messages = {
|
|
70
|
+
de: { calendar: { newEvent: 'Neuer Eintrag' } },
|
|
71
|
+
sv: { calendar: { today: 'Idag', newEvent: 'Ny händelse' }, views: { weekNumber: (week) => `V. ${week}` } },
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The CDN build loads languages other than English on demand from files next to `calendar-widget.js`. When hosting it yourself, copy the whole `dist-lib/cdn` folder.
|
|
76
|
+
|
|
77
|
+
**Demo:** [`demo/cdn.html`](demo/cdn.html) shows local mode with an event log, a dark German month view and a compact widget. Download it and open it in a browser, it loads the published package from jsDelivr.
|
|
78
|
+
|
|
79
|
+
## Building your own backend
|
|
80
|
+
|
|
81
|
+
The full contract is [`api/openapi.yaml`](api/openapi.yaml) (OpenAPI 3.1, also shipped as `@rokoyfa/calendar/openapi.yaml`). The essentials:
|
|
82
|
+
|
|
83
|
+
### Data types
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
type CalendarEvent = EventInput & {
|
|
87
|
+
id: string
|
|
88
|
+
calendarId: string
|
|
89
|
+
createdAt: string // ISO date-time
|
|
90
|
+
updatedAt: string
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
type EventInput = {
|
|
94
|
+
title: string // 1–100 chars
|
|
95
|
+
startDate: string // 'YYYY-MM-DD'
|
|
96
|
+
start: string // 'HH:mm' in timeZone
|
|
97
|
+
endDate: string // inclusive for all-day events
|
|
98
|
+
end: string
|
|
99
|
+
allDay: boolean // start and end are '00:00'
|
|
100
|
+
timeZone: string | null // IANA zone, null = same local time everywhere (always null for all-day)
|
|
101
|
+
description: string // max 2000 chars
|
|
102
|
+
color: 'blue' | 'red' | 'green' | 'yellow' | `#${string}`
|
|
103
|
+
recurrence: Recurrence | null
|
|
104
|
+
excludedDates: string[] // occurrences removed from a series
|
|
105
|
+
seriesId: string | null // set on an occurrence detached from a series
|
|
106
|
+
originalDate: string | null // its original date in that series
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
type Recurrence = {
|
|
110
|
+
frequency: 'daily' | 'weekly' | 'monthly' | 'yearly'
|
|
111
|
+
interval: number // 1–99
|
|
112
|
+
weekdays: number[] // 0 = Monday … 6 = Sunday
|
|
113
|
+
monthlyMode: 'dayOfMonth' | 'weekdayOfMonth' | 'lastWeekdayOfMonth'
|
|
114
|
+
until: string | null // either until or count, or neither
|
|
115
|
+
count: number | null
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
type CalendarSummary = {
|
|
119
|
+
id: string; teamId: string; name: string; color: string
|
|
120
|
+
kind: 'personal' | 'team'; teamName: string | null; description: string
|
|
121
|
+
role: 'owner' | 'admin' | 'manager' | 'editor' | 'member' | 'contributor' | 'viewer'
|
|
122
|
+
showInPersonal: boolean; permissions: string[]
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
type User = { id: string; email: string; name: string; emailVerified: boolean }
|
|
126
|
+
type Preferences = { theme: 'system' | 'light' | 'dark'; defaultView: View; mobileDefaultView: View; locale: string }
|
|
127
|
+
type Problem = { code: string; message: string } // every error response
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
The backend stores series as one event. The component expands occurrences itself.
|
|
131
|
+
|
|
132
|
+
### When the component calls your backend
|
|
133
|
+
|
|
134
|
+
| Moment | Requests |
|
|
135
|
+
| --- | --- |
|
|
136
|
+
| Widget loads | `GET /auth/me` (only with `auth`), then `GET /preferences`, `GET /colors`, `GET /calendars`, `GET /invitations` |
|
|
137
|
+
| Visible range changes | `GET /events?from=…&to=…&calendarId=…` with the calendars shown. The range is one day wider than the view to cover time zone shifts. Return every event in the range **and** every series that can occur in it. |
|
|
138
|
+
| Create event | `POST /events` with `EventInput` + `calendarId` |
|
|
139
|
+
| Edit event / whole series | `PUT /events/:id` with the full `EventInput` |
|
|
140
|
+
| Edit only this occurrence | `PUT` the series with the date added to `excludedDates`, then `POST` a detached event with `seriesId` and `originalDate` |
|
|
141
|
+
| Edit this and following | `PUT` the series with `until` set to the day before (and `count: null`), `POST` a new series, `PUT` later detached events to relink them |
|
|
142
|
+
| Delete | single: `PUT` with `excludedDates` · following: `PUT` with `until`, `DELETE` its later detached events · all: `DELETE` detached events, then the series · plain: `DELETE /events/:id` |
|
|
143
|
+
| Settings, colors | `PATCH /preferences`, `POST /colors`, `DELETE /colors/:rrggbb` |
|
|
144
|
+
| Sign-in, teams, invitations | `/auth/*`, `/calendars`, `/teams/*`, `/invitations/*`, see the OpenAPI file |
|
|
145
|
+
|
|
146
|
+
Before editing "following" or "all" of a series, the component loads its detached events with `GET /events?seriesId=…`.
|
|
147
|
+
|
|
148
|
+
### Rules for the backend
|
|
149
|
+
|
|
150
|
+
- **Sessions:** requests use `credentials: 'include'`. Set an `HttpOnly` cookie on sign-in. If the widget runs on another domain: CORS for that origin with `Access-Control-Allow-Credentials: true`, allowed headers `Content-Type`, `Accept`, `Accept-Language`, `Authorization`, `X-Calendar-Tenant`, and the cookie as `SameSite=None; Secure`. Answer `401` when the session is gone.
|
|
151
|
+
- **Errors:** always `{ code, message }`. Known codes such as `invalidCredentials`, `emailTaken`, `forbidden`, `lastOwner` are shown translated, others with `message`.
|
|
152
|
+
- **Language:** every request carries `Accept-Language`. Use it, or the stored `locale`, for emails.
|
|
153
|
+
- **Email links:** point them at the host page with the screen as parameter, e.g. `https://host.example/calendar?calendarPath=%2Freset-password%3Ftoken%3D…`.
|
|
154
|
+
|
|
155
|
+
Building, the test backend and all internals are described in German in [DEVELOPMENT.md](DEVELOPMENT.md).
|
|
156
|
+
|
|
157
|
+
## License
|
|
158
|
+
|
|
159
|
+
[MIT](LICENSE) © Rokoyfa
|