@rokoyfa/calendar 1.2.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 +8 -0
- package/DEVELOPER_GUIDE.md +743 -0
- package/README.md +39 -190
- 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 -11
- 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/npm/{de-Cuz-uz3s.js → de-lDO0Tv9y.js} +3 -1
- package/dist-lib/npm/de-lDO0Tv9y.js.map +1 -0
- package/dist-lib/npm/{es-BnRzdU90.js → es-Cy3Mmj9C.js} +3 -1
- package/dist-lib/npm/es-Cy3Mmj9C.js.map +1 -0
- package/dist-lib/npm/{fr-B-nmvStg.js → fr-Ci0ZM0nG.js} +3 -1
- package/dist-lib/npm/fr-Ci0ZM0nG.js.map +1 -0
- package/dist-lib/npm/index.js +475 -160
- package/dist-lib/npm/index.js.map +1 -1
- package/dist-lib/npm/{it-DMTpE4GO.js → it-BiTHjgzI.js} +3 -1
- package/dist-lib/npm/it-BiTHjgzI.js.map +1 -0
- package/dist-lib/npm/{nl-DQkyEt9Z.js → nl-DZTwpAwV.js} +3 -1
- package/dist-lib/npm/nl-DZTwpAwV.js.map +1 -0
- package/dist-lib/npm/{pl-CcjU41yx.js → pl-DeWLtyMR.js} +3 -1
- package/dist-lib/npm/pl-DeWLtyMR.js.map +1 -0
- package/dist-lib/npm/{pt-Dulais2f.js → pt-CaqSW5TJ.js} +3 -1
- package/dist-lib/npm/pt-CaqSW5TJ.js.map +1 -0
- package/dist-lib/npm/types/context/HostContext.d.ts +24 -2
- package/dist-lib/npm/types/data/restDataSource.d.ts +2 -1
- package/dist-lib/npm/types/data/tenantDataSource.d.ts +2 -1
- package/dist-lib/npm/types/features/calendar/constants/views.d.ts +2 -2
- package/dist-lib/npm/types/i18n/messages/en/core.d.ts +1 -0
- package/dist-lib/npm/types/i18n/messages/en/events.d.ts +1 -0
- package/dist-lib/npm/types/i18n/messages/en/index.d.ts +2 -0
- package/dist-lib/npm/types/i18n/messages/index.d.ts +2 -0
- package/dist-lib/npm/types/lib/CalendarWidget.d.ts +1 -1
- package/dist-lib/npm/types/lib/config.d.ts +9 -26
- package/dist-lib/npm/types/lib/configFile.d.ts +6 -0
- package/dist-lib/npm/types/lib/defaults.d.ts +23 -1
- package/dist-lib/npm/types/lib/element.d.ts +5 -1
- package/dist-lib/npm/types/lib/index.d.ts +4 -2
- 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/utils/calendarView.d.ts +1 -0
- package/package.json +8 -2
- package/schema/calendar-config.schema.json +232 -0
- package/dist-lib/cdn/de-BjzK4Pgn.js +0 -2
- package/dist-lib/cdn/de-BjzK4Pgn.js.map +0 -1
- package/dist-lib/cdn/es-TA5DvEsw.js +0 -2
- package/dist-lib/cdn/es-TA5DvEsw.js.map +0 -1
- package/dist-lib/cdn/fr-Dx-nmhQ7.js +0 -2
- package/dist-lib/cdn/fr-Dx-nmhQ7.js.map +0 -1
- package/dist-lib/cdn/it-D_2eA3dT.js +0 -2
- package/dist-lib/cdn/it-D_2eA3dT.js.map +0 -1
- package/dist-lib/cdn/nl-dC1zae2Z.js +0 -2
- package/dist-lib/cdn/nl-dC1zae2Z.js.map +0 -1
- package/dist-lib/cdn/pl-9TYRPoy1.js +0 -2
- package/dist-lib/cdn/pl-9TYRPoy1.js.map +0 -1
- package/dist-lib/cdn/pt-CvBN-qx1.js +0 -2
- package/dist-lib/cdn/pt-CvBN-qx1.js.map +0 -1
- package/dist-lib/npm/de-Cuz-uz3s.js.map +0 -1
- package/dist-lib/npm/es-BnRzdU90.js.map +0 -1
- package/dist-lib/npm/fr-B-nmvStg.js.map +0 -1
- package/dist-lib/npm/it-DMTpE4GO.js.map +0 -1
- package/dist-lib/npm/nl-DQkyEt9Z.js.map +0 -1
- package/dist-lib/npm/pl-CcjU41yx.js.map +0 -1
- package/dist-lib/npm/pt-Dulais2f.js.map +0 -1
package/dist-lib/npm/index.js
CHANGED
|
@@ -4,9 +4,77 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
4
4
|
import { createPortal } from "react-dom";
|
|
5
5
|
import { createRoot } from "react-dom/client";
|
|
6
6
|
|
|
7
|
+
// src/utils/object.ts
|
|
8
|
+
var pick = (source, keys) => Object.fromEntries(keys.map((key) => [key, source[key]]));
|
|
9
|
+
var isOneOf = (values, value) => values.includes(value);
|
|
10
|
+
var asRecord$1 = (value) => typeof value === "object" && value !== null ? value : {};
|
|
11
|
+
|
|
12
|
+
// src/utils/calendarView.ts
|
|
13
|
+
var CALENDAR_VIEWS = [
|
|
14
|
+
"day",
|
|
15
|
+
"week",
|
|
16
|
+
"month",
|
|
17
|
+
"year"
|
|
18
|
+
];
|
|
19
|
+
var isCalendarView = (value) => isOneOf(CALENDAR_VIEWS, value);
|
|
20
|
+
var nearestView = (wanted, enabled) => {
|
|
21
|
+
if (enabled.includes(wanted) || enabled.length === 0) return wanted;
|
|
22
|
+
const position = CALENDAR_VIEWS.indexOf(wanted);
|
|
23
|
+
return [...enabled].sort((a, b) => Math.abs(CALENDAR_VIEWS.indexOf(a) - position) - Math.abs(CALENDAR_VIEWS.indexOf(b) - position))[0];
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// src/lib/defaults.ts
|
|
27
|
+
var STORAGE_MODES = ["local", "remote"];
|
|
28
|
+
var HOLIDAY_SOURCES = ["library", "backend"];
|
|
29
|
+
var DEFAULT_FEATURES = {
|
|
30
|
+
auth: false,
|
|
31
|
+
teams: true,
|
|
32
|
+
chat: true,
|
|
33
|
+
attendees: true,
|
|
34
|
+
recurrence: true,
|
|
35
|
+
reminders: true,
|
|
36
|
+
links: true,
|
|
37
|
+
mapLinks: true,
|
|
38
|
+
holidays: true,
|
|
39
|
+
search: true,
|
|
40
|
+
undo: true,
|
|
41
|
+
duplicate: true,
|
|
42
|
+
shortcuts: true,
|
|
43
|
+
subscriptions: true,
|
|
44
|
+
importExport: true,
|
|
45
|
+
emailNotifications: true,
|
|
46
|
+
timeZones: true,
|
|
47
|
+
customColors: true
|
|
48
|
+
};
|
|
49
|
+
var FEATURE_NAMES = Object.keys(DEFAULT_FEATURES);
|
|
50
|
+
var TEAM_FEATURES = ["chat", "attendees"];
|
|
51
|
+
var resolveFeatures = (features = {}) => {
|
|
52
|
+
const resolved = { ...DEFAULT_FEATURES };
|
|
53
|
+
for (const name of FEATURE_NAMES) {
|
|
54
|
+
const value = features[name];
|
|
55
|
+
if (typeof value === "boolean") resolved[name] = value;
|
|
56
|
+
}
|
|
57
|
+
if (!resolved.teams) for (const name of TEAM_FEATURES) resolved[name] = false;
|
|
58
|
+
return resolved;
|
|
59
|
+
};
|
|
60
|
+
var resolveViews = (views) => {
|
|
61
|
+
const enabled = CALENDAR_VIEWS.filter((view) => views?.includes(view));
|
|
62
|
+
return enabled.length > 0 ? enabled : CALENDAR_VIEWS;
|
|
63
|
+
};
|
|
64
|
+
var DEFAULT_CONFIG = {
|
|
65
|
+
storageMode: "local",
|
|
66
|
+
apiBaseUrl: "/api",
|
|
67
|
+
apiTimeoutMs: 1e4,
|
|
68
|
+
features: DEFAULT_FEATURES
|
|
69
|
+
};
|
|
70
|
+
|
|
7
71
|
// src/context/HostContext.ts
|
|
8
|
-
var HostContext = createContext({
|
|
72
|
+
var HostContext = createContext({
|
|
73
|
+
features: DEFAULT_FEATURES,
|
|
74
|
+
views: CALENDAR_VIEWS
|
|
75
|
+
});
|
|
9
76
|
var useHost = () => use(HostContext);
|
|
77
|
+
var useFeatures = () => use(HostContext).features;
|
|
10
78
|
|
|
11
79
|
// src/utils/appError.ts
|
|
12
80
|
var ERROR_CODES = [
|
|
@@ -407,6 +475,7 @@ var events = {
|
|
|
407
475
|
noCustomColors: "No custom colors yet.",
|
|
408
476
|
removeColor: (label) => `Remove color ${label}`,
|
|
409
477
|
deleteTitle: "Delete event?",
|
|
478
|
+
deleteMessage: (title) => `“${title}” will be deleted. This cannot be undone.`,
|
|
410
479
|
deleteSeriesMessage: (title) => `“${title}” is a recurring event. What should be deleted? This cannot be undone.`,
|
|
411
480
|
scopeTitle: "Change recurring event",
|
|
412
481
|
scopeMessage: "Which events in the series should the changes apply to?",
|
|
@@ -923,6 +992,7 @@ var calendar = {
|
|
|
923
992
|
// src/i18n/messages/en/core.ts
|
|
924
993
|
var common = {
|
|
925
994
|
loading: "Loading …",
|
|
995
|
+
configError: "The calendar could not load its configuration.",
|
|
926
996
|
close: "Close",
|
|
927
997
|
cancel: "Cancel",
|
|
928
998
|
save: "Save",
|
|
@@ -1084,13 +1154,13 @@ var en = {
|
|
|
1084
1154
|
|
|
1085
1155
|
// src/i18n/messages/index.ts
|
|
1086
1156
|
var LOADERS = {
|
|
1087
|
-
de: () => import("./de-
|
|
1088
|
-
fr: () => import("./fr-
|
|
1089
|
-
es: () => import("./es-
|
|
1090
|
-
it: () => import("./it-
|
|
1091
|
-
nl: () => import("./nl-
|
|
1092
|
-
pl: () => import("./pl-
|
|
1093
|
-
pt: () => import("./pt-
|
|
1157
|
+
de: () => import("./de-lDO0Tv9y.js").then((module) => module.de),
|
|
1158
|
+
fr: () => import("./fr-Ci0ZM0nG.js").then((module) => module.fr),
|
|
1159
|
+
es: () => import("./es-Cy3Mmj9C.js").then((module) => module.es),
|
|
1160
|
+
it: () => import("./it-BiTHjgzI.js").then((module) => module.it),
|
|
1161
|
+
nl: () => import("./nl-DZTwpAwV.js").then((module) => module.nl),
|
|
1162
|
+
pl: () => import("./pl-DeWLtyMR.js").then((module) => module.pl),
|
|
1163
|
+
pt: () => import("./pt-CaqSW5TJ.js").then((module) => module.pt)
|
|
1094
1164
|
};
|
|
1095
1165
|
var loaded = /* @__PURE__ */ new Map([["en", en]]);
|
|
1096
1166
|
var getLoadedMessages = (language) => loaded.get(language) ?? null;
|
|
@@ -1102,10 +1172,11 @@ async function loadMessages(language) {
|
|
|
1102
1172
|
loaded.set(language, messages);
|
|
1103
1173
|
return messages;
|
|
1104
1174
|
}
|
|
1105
|
-
var isPlainObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1175
|
+
var isPlainObject$1 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1106
1176
|
var mergeDeep = (base, override) => {
|
|
1107
1177
|
if (override === void 0) return base;
|
|
1108
|
-
if (
|
|
1178
|
+
if (base !== void 0 && typeof base !== typeof override) return base;
|
|
1179
|
+
if (!isPlainObject$1(base) || !isPlainObject$1(override)) return override;
|
|
1109
1180
|
const result = { ...base };
|
|
1110
1181
|
for (const [key, value] of Object.entries(override)) result[key] = mergeDeep(base[key], value);
|
|
1111
1182
|
return result;
|
|
@@ -7133,11 +7204,6 @@ var getRelativeLuminance = (color) => {
|
|
|
7133
7204
|
};
|
|
7134
7205
|
var getReadableTextColor = (background) => getRelativeLuminance(background) > LUMINANCE_THRESHOLD ? DARK_TEXT : LIGHT_TEXT;
|
|
7135
7206
|
|
|
7136
|
-
// src/utils/object.ts
|
|
7137
|
-
var pick = (source, keys) => Object.fromEntries(keys.map((key) => [key, source[key]]));
|
|
7138
|
-
var isOneOf = (values, value) => values.includes(value);
|
|
7139
|
-
var asRecord$1 = (value) => typeof value === "object" && value !== null ? value : {};
|
|
7140
|
-
|
|
7141
7207
|
// src/utils/timeZone.ts
|
|
7142
7208
|
var MS_PER_MINUTE$1 = 6e4;
|
|
7143
7209
|
var formatters$1 = /* @__PURE__ */ new Map();
|
|
@@ -8944,7 +9010,7 @@ function CalendarRow({ calendar, onLeave }) {
|
|
|
8944
9010
|
function CalendarSettings() {
|
|
8945
9011
|
const { m } = useI18n();
|
|
8946
9012
|
const { list } = m.calendars;
|
|
8947
|
-
const { teams } =
|
|
9013
|
+
const { teams } = useFeatures();
|
|
8948
9014
|
const { calendars, error } = useCalendars();
|
|
8949
9015
|
const { user } = useAuth();
|
|
8950
9016
|
const canUseTeams = teams && user !== null;
|
|
@@ -9903,15 +9969,6 @@ var LocalColorRepository = class {
|
|
|
9903
9969
|
}
|
|
9904
9970
|
};
|
|
9905
9971
|
|
|
9906
|
-
// src/utils/calendarView.ts
|
|
9907
|
-
var CALENDAR_VIEWS = [
|
|
9908
|
-
"day",
|
|
9909
|
-
"week",
|
|
9910
|
-
"month",
|
|
9911
|
-
"year"
|
|
9912
|
-
];
|
|
9913
|
-
var isCalendarView = (value) => isOneOf(CALENDAR_VIEWS, value);
|
|
9914
|
-
|
|
9915
9972
|
// src/utils/holidays.ts
|
|
9916
9973
|
var HOLIDAYS_AUTO = "auto";
|
|
9917
9974
|
var HOLIDAYS_OFF = "off";
|
|
@@ -9962,7 +10019,7 @@ var groupHolidaysByDate = (holidays) => {
|
|
|
9962
10019
|
};
|
|
9963
10020
|
|
|
9964
10021
|
// src/utils/preferences.ts
|
|
9965
|
-
var THEMES
|
|
10022
|
+
var THEMES = [
|
|
9966
10023
|
"system",
|
|
9967
10024
|
"light",
|
|
9968
10025
|
"dark"
|
|
@@ -9985,7 +10042,7 @@ var isCompactWidth = (width) => width <= COMPACT_MAX_WIDTH;
|
|
|
9985
10042
|
var parsePreferences = (value) => {
|
|
9986
10043
|
const { theme, defaultView, mobileDefaultView, locale, timeZone, holidays, emailInvites, emailChanges, emailReminders, emailChat } = asRecord$1(value);
|
|
9987
10044
|
return {
|
|
9988
|
-
theme: isOneOf(THEMES
|
|
10045
|
+
theme: isOneOf(THEMES, theme) ? theme : DEFAULT_PREFERENCES.theme,
|
|
9989
10046
|
defaultView: isCalendarView(defaultView) ? defaultView : DEFAULT_PREFERENCES.defaultView,
|
|
9990
10047
|
mobileDefaultView: isCalendarView(mobileDefaultView) ? mobileDefaultView : DEFAULT_PREFERENCES.mobileDefaultView,
|
|
9991
10048
|
locale: locale === "auto" ? AUTO_LOCALE : canonicalizeLocale(locale) ?? DEFAULT_PREFERENCES.locale,
|
|
@@ -10226,9 +10283,9 @@ var getChatKey = (occurrence) => {
|
|
|
10226
10283
|
var getChatId = ({ eventId, occurrenceDate }) => `${eventId}|${occurrenceDate ?? ""}`;
|
|
10227
10284
|
var isSameChat = (a, b) => getChatId(a) === getChatId(b);
|
|
10228
10285
|
var asRecord = (value) => typeof value === "object" && value !== null ? value : {};
|
|
10229
|
-
var text = (value) => typeof value === "string" ? value : "";
|
|
10286
|
+
var text$1 = (value) => typeof value === "string" ? value : "";
|
|
10230
10287
|
var parseKey = (record) => ({
|
|
10231
|
-
eventId: text(record.eventId),
|
|
10288
|
+
eventId: text$1(record.eventId),
|
|
10232
10289
|
occurrenceDate: typeof record.occurrenceDate === "string" && record.occurrenceDate ? record.occurrenceDate : null
|
|
10233
10290
|
});
|
|
10234
10291
|
var parseChatMessage = (value) => {
|
|
@@ -10238,10 +10295,10 @@ var parseChatMessage = (value) => {
|
|
|
10238
10295
|
return {
|
|
10239
10296
|
...parseKey(record),
|
|
10240
10297
|
id: record.id,
|
|
10241
|
-
calendarId: text(record.calendarId),
|
|
10298
|
+
calendarId: text$1(record.calendarId),
|
|
10242
10299
|
author: typeof author.id === "string" ? {
|
|
10243
10300
|
id: author.id,
|
|
10244
|
-
name: text(author.name)
|
|
10301
|
+
name: text$1(author.name)
|
|
10245
10302
|
} : null,
|
|
10246
10303
|
text: record.text,
|
|
10247
10304
|
createdAt: record.createdAt,
|
|
@@ -10275,7 +10332,7 @@ var parseChatEvent = (value) => {
|
|
|
10275
10332
|
if (record.type === "message.deleted" && typeof record.id === "string") return {
|
|
10276
10333
|
type: "message.deleted",
|
|
10277
10334
|
id: record.id,
|
|
10278
|
-
calendarId: text(record.calendarId),
|
|
10335
|
+
calendarId: text$1(record.calendarId),
|
|
10279
10336
|
...parseKey(record)
|
|
10280
10337
|
};
|
|
10281
10338
|
return null;
|
|
@@ -10697,8 +10754,9 @@ var getLocationUrl = (location, template = DEFAULT_MAP_URL) => {
|
|
|
10697
10754
|
|
|
10698
10755
|
// src/hooks/useLocationUrl.ts
|
|
10699
10756
|
var useLocationUrl = () => {
|
|
10700
|
-
const { mapUrl } = useHost();
|
|
10701
|
-
|
|
10757
|
+
const { mapUrl, features } = useHost();
|
|
10758
|
+
const enabled = features.mapLinks;
|
|
10759
|
+
return useCallback((location) => enabled ? getLocationUrl(location, mapUrl) : null, [enabled, mapUrl]);
|
|
10702
10760
|
};
|
|
10703
10761
|
|
|
10704
10762
|
// src/features/events/utils/scopeOptions.ts
|
|
@@ -10735,7 +10793,8 @@ var DEFAULT_CUSTOM_COLOR = "#888888";
|
|
|
10735
10793
|
var NO_COLORS = [];
|
|
10736
10794
|
function useCustomColors() {
|
|
10737
10795
|
const repository = useColorRepository();
|
|
10738
|
-
const
|
|
10796
|
+
const { customColors: enabled } = useFeatures();
|
|
10797
|
+
const load = useCallback(() => enabled ? repository.list() : Promise.resolve(NO_COLORS), [repository, enabled]);
|
|
10739
10798
|
const { data: colors, error, apply } = useAsyncResource(load, NO_COLORS);
|
|
10740
10799
|
return {
|
|
10741
10800
|
colors,
|
|
@@ -10744,7 +10803,7 @@ function useCustomColors() {
|
|
|
10744
10803
|
removeColor: useCallback(async (color) => {
|
|
10745
10804
|
await apply(repository.remove(color));
|
|
10746
10805
|
}, [repository, apply]),
|
|
10747
|
-
canAddMore: colors.length < 12
|
|
10806
|
+
canAddMore: enabled && colors.length < 12
|
|
10748
10807
|
};
|
|
10749
10808
|
}
|
|
10750
10809
|
|
|
@@ -11931,6 +11990,7 @@ var isValidPeriod = ({ startDate, start, endDate, end }) => isISODate(startDate)
|
|
|
11931
11990
|
function EventModal({ initialValue, attendeeOptions, occurrence = null, notice, onSave, onDelete, onDuplicate, onRemindersChange, chat, initialTab = "general", onClose }) {
|
|
11932
11991
|
const i18n = useI18n();
|
|
11933
11992
|
const { m } = i18n;
|
|
11993
|
+
const features = useFeatures();
|
|
11934
11994
|
const viewerTimeZone = useViewerTimeZone();
|
|
11935
11995
|
const getLocationUrl = useLocationUrl();
|
|
11936
11996
|
const mode = occurrence ? "edit" : "create";
|
|
@@ -12064,7 +12124,7 @@ function EventModal({ initialValue, attendeeOptions, occurrence = null, notice,
|
|
|
12064
12124
|
onDateChange: (endDate) => setField("endDate", endDate),
|
|
12065
12125
|
onTimeChange: (end) => setField("end", end)
|
|
12066
12126
|
}),
|
|
12067
|
-
!values.allDay && /* @__PURE__ */ jsx(TimeZoneField, {
|
|
12127
|
+
!values.allDay && features.timeZones && /* @__PURE__ */ jsx(TimeZoneField, {
|
|
12068
12128
|
value: values.timeZone,
|
|
12069
12129
|
onChange: (timeZone) => setField("timeZone", timeZone)
|
|
12070
12130
|
}),
|
|
@@ -12072,7 +12132,7 @@ function EventModal({ initialValue, attendeeOptions, occurrence = null, notice,
|
|
|
12072
12132
|
className: "formHint",
|
|
12073
12133
|
children: viewerHint
|
|
12074
12134
|
}),
|
|
12075
|
-
/* @__PURE__ */ jsx(ReminderField, {
|
|
12135
|
+
features.reminders && /* @__PURE__ */ jsx(ReminderField, {
|
|
12076
12136
|
value: values.reminders,
|
|
12077
12137
|
onChange: (reminders) => setField("reminders", reminders)
|
|
12078
12138
|
}),
|
|
@@ -12081,7 +12141,8 @@ function EventModal({ initialValue, attendeeOptions, occurrence = null, notice,
|
|
|
12081
12141
|
onChange: (color) => setField("color", color)
|
|
12082
12142
|
})
|
|
12083
12143
|
] })
|
|
12084
|
-
}
|
|
12144
|
+
}];
|
|
12145
|
+
if (features.recurrence) tabDefinitions.push({
|
|
12085
12146
|
value: "recurrence",
|
|
12086
12147
|
label: m.events.tabs.recurrence,
|
|
12087
12148
|
content: /* @__PURE__ */ jsx(RecurrenceFields, {
|
|
@@ -12090,7 +12151,7 @@ function EventModal({ initialValue, attendeeOptions, occurrence = null, notice,
|
|
|
12090
12151
|
errors: errors.recurrence ?? {},
|
|
12091
12152
|
onChange: setRecurrence
|
|
12092
12153
|
})
|
|
12093
|
-
}
|
|
12154
|
+
});
|
|
12094
12155
|
if (attendeeOptions && (attendeeOptions.candidates.length > 0 || values.attendees.length > 0)) tabDefinitions.push({
|
|
12095
12156
|
value: "attendees",
|
|
12096
12157
|
label: m.calendars.settings.withCount(m.events.tabs.attendees, values.attendees.length),
|
|
@@ -12124,7 +12185,7 @@ function EventModal({ initialValue, attendeeOptions, occurrence = null, notice,
|
|
|
12124
12185
|
children: /* @__PURE__ */ jsx(MapPinIcon, { size: 18 })
|
|
12125
12186
|
})
|
|
12126
12187
|
}),
|
|
12127
|
-
/* @__PURE__ */ jsx(LinksField, {
|
|
12188
|
+
features.links && /* @__PURE__ */ jsx(LinksField, {
|
|
12128
12189
|
links: values.links,
|
|
12129
12190
|
error: errors.links,
|
|
12130
12191
|
onChange: (links) => setField("links", links)
|
|
@@ -12216,6 +12277,8 @@ function EventModal({ initialValue, attendeeOptions, occurrence = null, notice,
|
|
|
12216
12277
|
function DeleteEventModal({ occurrence, onConfirm, onClose }) {
|
|
12217
12278
|
const { m } = useI18n();
|
|
12218
12279
|
const { run, isPending, error } = useAsyncAction(onConfirm);
|
|
12280
|
+
const options = getScopeOptions(occurrence);
|
|
12281
|
+
const isSeries = options.length > 1;
|
|
12219
12282
|
return /* @__PURE__ */ jsxs(Modal, {
|
|
12220
12283
|
title: m.events.deleteTitle,
|
|
12221
12284
|
variant: "danger",
|
|
@@ -12223,15 +12286,28 @@ function DeleteEventModal({ occurrence, onConfirm, onClose }) {
|
|
|
12223
12286
|
children: [
|
|
12224
12287
|
/* @__PURE__ */ jsx("p", {
|
|
12225
12288
|
className: "modalMessage",
|
|
12226
|
-
children: m.events.deleteSeriesMessage(occurrence.title)
|
|
12289
|
+
children: isSeries ? m.events.deleteSeriesMessage(occurrence.title) : m.events.deleteMessage(occurrence.title)
|
|
12227
12290
|
}),
|
|
12228
12291
|
/* @__PURE__ */ jsx(ErrorMessage, { message: error }),
|
|
12229
|
-
/* @__PURE__ */ jsx(ScopeButtons, {
|
|
12230
|
-
options
|
|
12292
|
+
isSeries ? /* @__PURE__ */ jsx(ScopeButtons, {
|
|
12293
|
+
options,
|
|
12231
12294
|
variant: "danger",
|
|
12232
12295
|
disabled: isPending,
|
|
12233
12296
|
onSelect: (scope) => void run(scope),
|
|
12234
12297
|
onCancel: onClose
|
|
12298
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
12299
|
+
className: "modalActions",
|
|
12300
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
12301
|
+
variant: "danger",
|
|
12302
|
+
isPending,
|
|
12303
|
+
onClick: () => void run(options[0]),
|
|
12304
|
+
children: m.common.delete
|
|
12305
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
12306
|
+
variant: "secondary",
|
|
12307
|
+
onClick: onClose,
|
|
12308
|
+
"data-autofocus": true,
|
|
12309
|
+
children: m.common.cancel
|
|
12310
|
+
})]
|
|
12235
12311
|
})
|
|
12236
12312
|
]
|
|
12237
12313
|
});
|
|
@@ -12813,7 +12889,7 @@ var applyTheme = (root, theme) => {
|
|
|
12813
12889
|
};
|
|
12814
12890
|
function PreferencesProvider({ children }) {
|
|
12815
12891
|
const root = useRootElement();
|
|
12816
|
-
const { theme: hostTheme } = useHost();
|
|
12892
|
+
const { theme: hostTheme, features } = useHost();
|
|
12817
12893
|
const { setUserLocale } = useI18n();
|
|
12818
12894
|
const repository = usePreferencesRepository();
|
|
12819
12895
|
const load = useCallback(() => repository.get(), [repository]);
|
|
@@ -12835,7 +12911,7 @@ function PreferencesProvider({ children }) {
|
|
|
12835
12911
|
return /* @__PURE__ */ jsx(PreferencesContext, {
|
|
12836
12912
|
value,
|
|
12837
12913
|
children: /* @__PURE__ */ jsx(TimeZoneContext, {
|
|
12838
|
-
value: preferences.timeZone === "auto" ? null : preferences.timeZone,
|
|
12914
|
+
value: !features.timeZones || preferences.timeZone === "auto" ? null : preferences.timeZone,
|
|
12839
12915
|
children
|
|
12840
12916
|
})
|
|
12841
12917
|
});
|
|
@@ -12849,7 +12925,7 @@ function PreferencesSettings() {
|
|
|
12849
12925
|
const { m, languages } = useI18n();
|
|
12850
12926
|
const { preferences, updatePreferences } = usePreferences();
|
|
12851
12927
|
const { run, error } = useAsyncAction(updatePreferences);
|
|
12852
|
-
const themeOptions = THEMES
|
|
12928
|
+
const themeOptions = THEMES.map((theme) => ({
|
|
12853
12929
|
value: theme,
|
|
12854
12930
|
label: m.themes[theme]
|
|
12855
12931
|
}));
|
|
@@ -12859,7 +12935,8 @@ function PreferencesSettings() {
|
|
|
12859
12935
|
value: choice,
|
|
12860
12936
|
label: choice === "auto" ? m.settings.languageAuto : getLocaleName(choice)
|
|
12861
12937
|
}));
|
|
12862
|
-
const
|
|
12938
|
+
const { views, features } = useHost();
|
|
12939
|
+
const viewOptions = getViewOptions(m, views, features.shortcuts);
|
|
12863
12940
|
const automaticTimeZone = useAutomaticTimeZone();
|
|
12864
12941
|
const zones = listTimeZones();
|
|
12865
12942
|
if (preferences.timeZone !== "auto" && !zones.includes(preferences.timeZone)) zones.unshift(preferences.timeZone);
|
|
@@ -12882,7 +12959,7 @@ function PreferencesSettings() {
|
|
|
12882
12959
|
onChange: (locale) => void run({ locale })
|
|
12883
12960
|
})
|
|
12884
12961
|
}),
|
|
12885
|
-
/* @__PURE__ */ jsx(PageSection, {
|
|
12962
|
+
features.timeZones && /* @__PURE__ */ jsx(PageSection, {
|
|
12886
12963
|
title: m.settings.timeZoneTitle,
|
|
12887
12964
|
description: m.settings.timeZoneDescription,
|
|
12888
12965
|
children: /* @__PURE__ */ jsx(SelectField, {
|
|
@@ -12902,17 +12979,17 @@ function PreferencesSettings() {
|
|
|
12902
12979
|
onChange: (theme) => void run({ theme })
|
|
12903
12980
|
})
|
|
12904
12981
|
}),
|
|
12905
|
-
/* @__PURE__ */ jsxs(PageSection, {
|
|
12982
|
+
views.length > 1 && /* @__PURE__ */ jsxs(PageSection, {
|
|
12906
12983
|
title: m.settings.startViewTitle,
|
|
12907
12984
|
description: m.settings.startViewDescription,
|
|
12908
12985
|
children: [/* @__PURE__ */ jsx(SegmentedField, {
|
|
12909
12986
|
label: m.settings.desktop,
|
|
12910
|
-
value: preferences.defaultView,
|
|
12987
|
+
value: nearestView(preferences.defaultView, views),
|
|
12911
12988
|
options: viewOptions,
|
|
12912
12989
|
onChange: (defaultView) => void run({ defaultView })
|
|
12913
12990
|
}), /* @__PURE__ */ jsx(SegmentedField, {
|
|
12914
12991
|
label: m.settings.mobile,
|
|
12915
|
-
value: preferences.mobileDefaultView,
|
|
12992
|
+
value: nearestView(preferences.mobileDefaultView, views),
|
|
12916
12993
|
options: viewOptions,
|
|
12917
12994
|
onChange: (mobileDefaultView) => void run({ mobileDefaultView })
|
|
12918
12995
|
})]
|
|
@@ -12993,7 +13070,7 @@ var useHolidayRegion = () => {
|
|
|
12993
13070
|
const { preferences } = usePreferences();
|
|
12994
13071
|
const host = useHost();
|
|
12995
13072
|
const { locale } = useI18n();
|
|
12996
|
-
return resolveHolidayRegion(preferences.holidays, host.holidays, locale);
|
|
13073
|
+
return host.features.holidays ? resolveHolidayRegion(preferences.holidays, host.holidays, locale) : null;
|
|
12997
13074
|
};
|
|
12998
13075
|
function useHolidays({ from, to }) {
|
|
12999
13076
|
const region = useHolidayRegion();
|
|
@@ -13168,10 +13245,10 @@ var VIEW_SHORTCUTS = {
|
|
|
13168
13245
|
year: "y"
|
|
13169
13246
|
};
|
|
13170
13247
|
var withShortcut = (label, key) => `${label} (${key.toUpperCase()})`;
|
|
13171
|
-
var getViewOptions = (m) =>
|
|
13248
|
+
var getViewOptions = (m, views = CALENDAR_VIEWS, shortcuts = true) => views.map((view) => ({
|
|
13172
13249
|
value: view,
|
|
13173
13250
|
label: m.views[view].label,
|
|
13174
|
-
title: withShortcut(m.views[view].label, VIEW_SHORTCUTS[view])
|
|
13251
|
+
title: shortcuts ? withShortcut(m.views[view].label, VIEW_SHORTCUTS[view]) : void 0
|
|
13175
13252
|
}));
|
|
13176
13253
|
|
|
13177
13254
|
// src/features/calendar/hooks/useCalendarView.ts
|
|
@@ -13571,6 +13648,8 @@ function groupSegmentsByDate(events, range) {
|
|
|
13571
13648
|
// src/features/calendar/components/CalendarHeader.tsx
|
|
13572
13649
|
function CalendarHeader({ view, title, subtitle, onViewChange, onPrevious, onNext, onToday, onCreateEvent, onSearch, context, accessory }) {
|
|
13573
13650
|
const { m } = useI18n();
|
|
13651
|
+
const { views, features } = useHost();
|
|
13652
|
+
const withShortcut$1 = (label, key) => features.shortcuts ? withShortcut(label, key) : label;
|
|
13574
13653
|
const { previous: previousLabel, next: nextLabel } = m.views[view];
|
|
13575
13654
|
return /* @__PURE__ */ jsxs("header", {
|
|
13576
13655
|
className: "header",
|
|
@@ -13580,14 +13659,14 @@ function CalendarHeader({ view, title, subtitle, onViewChange, onPrevious, onNex
|
|
|
13580
13659
|
children: [
|
|
13581
13660
|
/* @__PURE__ */ jsx(IconButton, {
|
|
13582
13661
|
label: previousLabel,
|
|
13583
|
-
title:
|
|
13662
|
+
title: withShortcut$1(previousLabel, "←"),
|
|
13584
13663
|
plain: true,
|
|
13585
13664
|
onClick: onPrevious,
|
|
13586
13665
|
children: /* @__PURE__ */ jsx(ChevronLeftIcon, {})
|
|
13587
13666
|
}),
|
|
13588
13667
|
/* @__PURE__ */ jsx(IconButton, {
|
|
13589
13668
|
label: nextLabel,
|
|
13590
|
-
title:
|
|
13669
|
+
title: withShortcut$1(nextLabel, "→"),
|
|
13591
13670
|
plain: true,
|
|
13592
13671
|
onClick: onNext,
|
|
13593
13672
|
children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
|
|
@@ -13595,7 +13674,7 @@ function CalendarHeader({ view, title, subtitle, onViewChange, onPrevious, onNex
|
|
|
13595
13674
|
/* @__PURE__ */ jsx(Button, {
|
|
13596
13675
|
variant: "outline",
|
|
13597
13676
|
className: "todayButton",
|
|
13598
|
-
title: withShortcut(m.calendar.today, "t"),
|
|
13677
|
+
title: withShortcut$1(m.calendar.today, "t"),
|
|
13599
13678
|
onClick: onToday,
|
|
13600
13679
|
children: m.calendar.today
|
|
13601
13680
|
})
|
|
@@ -13613,24 +13692,24 @@ function CalendarHeader({ view, title, subtitle, onViewChange, onPrevious, onNex
|
|
|
13613
13692
|
}),
|
|
13614
13693
|
/* @__PURE__ */ jsxs("div", {
|
|
13615
13694
|
className: "headerActions",
|
|
13616
|
-
children: [/* @__PURE__ */ jsx(SegmentedControl, {
|
|
13695
|
+
children: [views.length > 1 && /* @__PURE__ */ jsx(SegmentedControl, {
|
|
13617
13696
|
label: m.views.label,
|
|
13618
13697
|
value: view,
|
|
13619
|
-
options: getViewOptions(m),
|
|
13698
|
+
options: getViewOptions(m, views, features.shortcuts),
|
|
13620
13699
|
onChange: onViewChange
|
|
13621
13700
|
}), /* @__PURE__ */ jsxs("span", {
|
|
13622
13701
|
className: "headerCreate",
|
|
13623
13702
|
children: [
|
|
13624
13703
|
onSearch && /* @__PURE__ */ jsx(IconButton, {
|
|
13625
13704
|
label: m.calendar.search.open,
|
|
13626
|
-
title: withShortcut(m.calendar.search.open, "/"),
|
|
13705
|
+
title: withShortcut$1(m.calendar.search.open, "/"),
|
|
13627
13706
|
plain: true,
|
|
13628
13707
|
onClick: onSearch,
|
|
13629
13708
|
children: /* @__PURE__ */ jsx(SearchIcon, { size: 18 })
|
|
13630
13709
|
}),
|
|
13631
13710
|
onCreateEvent && /* @__PURE__ */ jsx(IconButton, {
|
|
13632
13711
|
label: m.calendar.newEvent,
|
|
13633
|
-
title: withShortcut(m.calendar.newEvent, "n"),
|
|
13712
|
+
title: withShortcut$1(m.calendar.newEvent, "n"),
|
|
13634
13713
|
onClick: onCreateEvent,
|
|
13635
13714
|
children: /* @__PURE__ */ jsx(PlusIcon, { size: 16 })
|
|
13636
13715
|
}),
|
|
@@ -13985,6 +14064,7 @@ function EventBlock({ segment, column, columns, onSelect }) {
|
|
|
13985
14064
|
const { event, start } = segment;
|
|
13986
14065
|
const duration = getVisibleDuration(segment);
|
|
13987
14066
|
const { i18n, source, isDragging, style, attributes } = useSegmentAttributes(segment, "event", getSizeClass(duration));
|
|
14067
|
+
const features = useFeatures();
|
|
13988
14068
|
const showDetails = duration >= DETAILS_MIN_DURATION;
|
|
13989
14069
|
const showSource = Boolean(source) && duration >= SOURCE_MIN_DURATION;
|
|
13990
14070
|
const blockStyle = {
|
|
@@ -14011,7 +14091,7 @@ function EventBlock({ segment, column, columns, onSelect }) {
|
|
|
14011
14091
|
withLocation: !showDetails
|
|
14012
14092
|
}),
|
|
14013
14093
|
event.location && showDetails && /* @__PURE__ */ jsx(EventLocation, { location: event.location }),
|
|
14014
|
-
!isDragging && /* @__PURE__ */ jsx(EventLinks, {
|
|
14094
|
+
!isDragging && features.links && /* @__PURE__ */ jsx(EventLinks, {
|
|
14015
14095
|
links: event.links,
|
|
14016
14096
|
lines: getLinkLines(duration, showSource)
|
|
14017
14097
|
}),
|
|
@@ -14269,8 +14349,10 @@ var VIEW_COMPONENTS = {
|
|
|
14269
14349
|
month: MonthView,
|
|
14270
14350
|
year: YearView
|
|
14271
14351
|
};
|
|
14352
|
+
var NO_SHORTCUTS = {};
|
|
14272
14353
|
function Calendar({ calendarIds, targetCalendarId, canCreate = true, eventSources = NO_EVENT_SOURCES, initialView, headerContext, headerAccessory, currentUserEmail = null, loadAttendeeCandidates, chat, openEvent, onOpenEventDone }) {
|
|
14273
14354
|
const i18n = useI18n();
|
|
14355
|
+
const { features, views } = useHost();
|
|
14274
14356
|
const now = useNow();
|
|
14275
14357
|
const today = toISODate(now);
|
|
14276
14358
|
const { view, setView, anchor, range, dates, title, subtitle, previous, next, goToToday, goToDate, show } = useCalendarView(initialView, openEvent?.date);
|
|
@@ -14314,7 +14396,7 @@ function Calendar({ calendarIds, targetCalendarId, canCreate = true, eventSource
|
|
|
14314
14396
|
const [isSearchOpen, setIsSearchOpen] = useState(false);
|
|
14315
14397
|
const editorCalendarId = shownEditor ? shownEditor.occurrence?.calendarId ?? targetCalendarId : null;
|
|
14316
14398
|
const attendeeCandidates = useAttendeeCandidates(loadAttendeeCandidates, editorCalendarId);
|
|
14317
|
-
const offerUndo = (message, undo) => setUndoOffer(undo ? {
|
|
14399
|
+
const offerUndo = (message, undo) => setUndoOffer(undo && features.undo ? {
|
|
14318
14400
|
id: Date.now(),
|
|
14319
14401
|
message,
|
|
14320
14402
|
undo
|
|
@@ -14381,7 +14463,7 @@ function Calendar({ calendarIds, targetCalendarId, canCreate = true, eventSource
|
|
|
14381
14463
|
offerUndo(i18n.m.calendar.undo.deleted(occurrence.title), undo);
|
|
14382
14464
|
};
|
|
14383
14465
|
const requestDelete = async (occurrence) => {
|
|
14384
|
-
if (getScopeOptions(occurrence).length > 1) setEventToDelete(occurrence);
|
|
14466
|
+
if (!features.undo || getScopeOptions(occurrence).length > 1) setEventToDelete(occurrence);
|
|
14385
14467
|
else await removeEvent(occurrence, "all");
|
|
14386
14468
|
};
|
|
14387
14469
|
const handleSave = async (input, scope) => {
|
|
@@ -14422,19 +14504,25 @@ function Calendar({ calendarIds, targetCalendarId, canCreate = true, eventSource
|
|
|
14422
14504
|
onPreview: setDragPreview,
|
|
14423
14505
|
onDrop: handleDrop
|
|
14424
14506
|
});
|
|
14425
|
-
|
|
14507
|
+
const showView = (wanted, date) => {
|
|
14508
|
+
const target = nearestView(wanted, views);
|
|
14509
|
+
if (target === wanted || target !== view) show(target, date);
|
|
14510
|
+
else goToDate(date);
|
|
14511
|
+
};
|
|
14512
|
+
const selectView = (wanted) => views.includes(wanted) ? () => setView(wanted) : void 0;
|
|
14513
|
+
useKeyboardShortcuts(features.shortcuts ? {
|
|
14426
14514
|
ArrowLeft: previous,
|
|
14427
14515
|
ArrowRight: next,
|
|
14428
14516
|
t: goToToday,
|
|
14429
|
-
"/": () => setIsSearchOpen(true),
|
|
14517
|
+
"/": features.search ? () => setIsSearchOpen(true) : void 0,
|
|
14430
14518
|
n: canCreate ? createNow : void 0,
|
|
14431
|
-
[VIEW_SHORTCUTS.day]: (
|
|
14432
|
-
[VIEW_SHORTCUTS.week]: (
|
|
14433
|
-
[VIEW_SHORTCUTS.month]: (
|
|
14434
|
-
[VIEW_SHORTCUTS.year]: (
|
|
14435
|
-
j: (
|
|
14519
|
+
[VIEW_SHORTCUTS.day]: selectView("day"),
|
|
14520
|
+
[VIEW_SHORTCUTS.week]: selectView("week"),
|
|
14521
|
+
[VIEW_SHORTCUTS.month]: selectView("month"),
|
|
14522
|
+
[VIEW_SHORTCUTS.year]: selectView("year"),
|
|
14523
|
+
j: selectView("year"),
|
|
14436
14524
|
"mod+z": undoOffer ? () => void runUndo() : void 0
|
|
14437
|
-
});
|
|
14525
|
+
} : NO_SHORTCUTS);
|
|
14438
14526
|
const ViewComponent = VIEW_COMPONENTS[view];
|
|
14439
14527
|
const editorSource = shownEditor?.occurrence ? eventSources.get(shownEditor.occurrence.calendarId) : void 0;
|
|
14440
14528
|
return /* @__PURE__ */ jsx(HolidaysContext, {
|
|
@@ -14457,7 +14545,7 @@ function Calendar({ calendarIds, targetCalendarId, canCreate = true, eventSource
|
|
|
14457
14545
|
onPrevious: previous,
|
|
14458
14546
|
onNext: next,
|
|
14459
14547
|
onToday: goToToday,
|
|
14460
|
-
onSearch: () => setIsSearchOpen(true),
|
|
14548
|
+
onSearch: features.search ? () => setIsSearchOpen(true) : void 0,
|
|
14461
14549
|
onCreateEvent: canCreate ? createNow : void 0,
|
|
14462
14550
|
context: headerContext,
|
|
14463
14551
|
accessory: headerAccessory
|
|
@@ -14485,18 +14573,18 @@ function Calendar({ calendarIds, targetCalendarId, canCreate = true, eventSource
|
|
|
14485
14573
|
onCreateRange: openCreateRange,
|
|
14486
14574
|
onCreateAllDay: openCreateAllDay,
|
|
14487
14575
|
onEventSelect: openEdit,
|
|
14488
|
-
onShowDay: (date) =>
|
|
14489
|
-
onShowMonth: (date) =>
|
|
14576
|
+
onShowDay: (date) => showView("day", date),
|
|
14577
|
+
onShowMonth: (date) => showView("month", date)
|
|
14490
14578
|
})
|
|
14491
14579
|
}),
|
|
14492
14580
|
shownEditor && /* @__PURE__ */ jsx(EventModal, {
|
|
14493
14581
|
initialValue: shownEditor.initialValue,
|
|
14494
14582
|
occurrence: shownEditor.occurrence,
|
|
14495
|
-
attendeeOptions: {
|
|
14583
|
+
attendeeOptions: features.attendees ? {
|
|
14496
14584
|
candidates: attendeeCandidates,
|
|
14497
14585
|
ownEmail: currentUserEmail,
|
|
14498
14586
|
onRespond: respond && shownEditor.occurrence ? (status) => respond(shownEditor.occurrence, status) : void 0
|
|
14499
|
-
},
|
|
14587
|
+
} : void 0,
|
|
14500
14588
|
notice: shownEditor.notice ?? (editorSource && i18n.m.calendar.sharedEventNotice(getSourceText(editorSource, i18n))),
|
|
14501
14589
|
onSave: handleSave,
|
|
14502
14590
|
onDelete: shownEditor.occurrence ? () => requestDelete(shownEditor.occurrence) : void 0,
|
|
@@ -14505,14 +14593,14 @@ function Calendar({ calendarIds, targetCalendarId, canCreate = true, eventSource
|
|
|
14505
14593
|
calendarId: shownEditor.occurrence.calendarId
|
|
14506
14594
|
} : void 0,
|
|
14507
14595
|
initialTab: shownEditor.initialTab,
|
|
14508
|
-
onDuplicate: shownEditor.occurrence && canCreate ? duplicate : void 0,
|
|
14596
|
+
onDuplicate: features.duplicate && shownEditor.occurrence && canCreate ? duplicate : void 0,
|
|
14509
14597
|
onRemindersChange: setReminders && shownEditor.occurrence ? async (reminders) => {
|
|
14510
14598
|
await setReminders(shownEditor.occurrence, reminders);
|
|
14511
14599
|
closeEditor();
|
|
14512
14600
|
} : void 0,
|
|
14513
14601
|
onClose: closeEditor
|
|
14514
14602
|
}, shownEditor.occurrence?.occurrenceKey ?? "new"),
|
|
14515
|
-
isSearchOpen && /* @__PURE__ */ jsx(EventSearchModal, {
|
|
14603
|
+
isSearchOpen && features.search && /* @__PURE__ */ jsx(EventSearchModal, {
|
|
14516
14604
|
calendarIds,
|
|
14517
14605
|
today,
|
|
14518
14606
|
onSelect: openSearchResult,
|
|
@@ -14933,6 +15021,7 @@ function TeamSettings({ calendar }) {
|
|
|
14933
15021
|
const { withCount } = settings;
|
|
14934
15022
|
const { user } = useAuth();
|
|
14935
15023
|
const team = useTeam(calendar);
|
|
15024
|
+
const { subscriptions, importExport } = useFeatures();
|
|
14936
15025
|
const tabs = [
|
|
14937
15026
|
{
|
|
14938
15027
|
value: "general",
|
|
@@ -14964,11 +15053,11 @@ function TeamSettings({ calendar }) {
|
|
|
14964
15053
|
onRevoke: team.revokeInvitation
|
|
14965
15054
|
})
|
|
14966
15055
|
}] : [],
|
|
14967
|
-
{
|
|
15056
|
+
...subscriptions || importExport ? [{
|
|
14968
15057
|
value: "exchange",
|
|
14969
15058
|
label: settings.tabs.exchange,
|
|
14970
|
-
content: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SubscribeSection, { calendar }), /* @__PURE__ */ jsx(ExchangeSection, { calendar })] })
|
|
14971
|
-
},
|
|
15059
|
+
content: /* @__PURE__ */ jsxs(Fragment, { children: [subscriptions && /* @__PURE__ */ jsx(SubscribeSection, { calendar }), importExport && /* @__PURE__ */ jsx(ExchangeSection, { calendar })] })
|
|
15060
|
+
}] : [],
|
|
14972
15061
|
{
|
|
14973
15062
|
value: "danger",
|
|
14974
15063
|
label: settings.tabs.danger,
|
|
@@ -14997,6 +15086,7 @@ function CalendarSettingsPage() {
|
|
|
14997
15086
|
};
|
|
14998
15087
|
const { calendarId } = useParams();
|
|
14999
15088
|
const { calendars, isLoading } = useCalendars();
|
|
15089
|
+
const { subscriptions, importExport } = useFeatures();
|
|
15000
15090
|
const calendar = calendars.find((entry) => entry.id === calendarId);
|
|
15001
15091
|
if (!calendar) return /* @__PURE__ */ jsx(PageLayout, {
|
|
15002
15092
|
title: settings.title,
|
|
@@ -15013,8 +15103,8 @@ function CalendarSettingsPage() {
|
|
|
15013
15103
|
variant: "full",
|
|
15014
15104
|
children: isPersonalCalendar(calendar) ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
15015
15105
|
hasPermission(calendar, "manage_calendars") && /* @__PURE__ */ jsx(GeneralSection, { calendar }),
|
|
15016
|
-
/* @__PURE__ */ jsx(SubscribeSection, { calendar }),
|
|
15017
|
-
/* @__PURE__ */ jsx(ExchangeSection, { calendar }),
|
|
15106
|
+
subscriptions && /* @__PURE__ */ jsx(SubscribeSection, { calendar }),
|
|
15107
|
+
importExport && /* @__PURE__ */ jsx(ExchangeSection, { calendar }),
|
|
15018
15108
|
/* @__PURE__ */ jsx(PageSection, {
|
|
15019
15109
|
title: settings.personalTitle,
|
|
15020
15110
|
children: /* @__PURE__ */ jsx("p", {
|
|
@@ -15545,7 +15635,7 @@ var createLocalRepositories = () => ({
|
|
|
15545
15635
|
var localDataSource = () => ({ connect: createLocalRepositories });
|
|
15546
15636
|
|
|
15547
15637
|
// src/data/restDataSource.ts
|
|
15548
|
-
function restDataSource({ baseUrl, timeoutMs, auth = true, headers, getAccessToken, getUserToken, holidaySource = "library", chatSocketUrl }) {
|
|
15638
|
+
function restDataSource({ baseUrl, timeoutMs, auth = true, headers, getAccessToken, getUserToken, holidaySource = "library", chat = true, chatSocketUrl }) {
|
|
15549
15639
|
const normalizedBaseUrl = baseUrl.replace(/\/+$/, "");
|
|
15550
15640
|
const createApi = ({ getLanguage, onUnauthorized }) => createApiClient({
|
|
15551
15641
|
baseUrl: normalizedBaseUrl,
|
|
@@ -15571,7 +15661,7 @@ function restDataSource({ baseUrl, timeoutMs, auth = true, headers, getAccessTok
|
|
|
15571
15661
|
colors: new RemoteColorRepository(api),
|
|
15572
15662
|
preferences: new RemotePreferencesRepository(api),
|
|
15573
15663
|
holidays: holidaySource === "backend" ? new RemoteHolidayRepository(api) : void 0,
|
|
15574
|
-
chat: new RemoteChatRepository(api, getSocketUrl())
|
|
15664
|
+
chat: chat ? new RemoteChatRepository(api, getSocketUrl()) : void 0
|
|
15575
15665
|
};
|
|
15576
15666
|
};
|
|
15577
15667
|
return {
|
|
@@ -15582,13 +15672,14 @@ function restDataSource({ baseUrl, timeoutMs, auth = true, headers, getAccessTok
|
|
|
15582
15672
|
|
|
15583
15673
|
// src/data/tenantDataSource.ts
|
|
15584
15674
|
var TENANT_HEADER = "X-Calendar-Tenant";
|
|
15585
|
-
var tenantDataSource = ({ tenant, baseUrl, timeoutMs, getUserToken, holidaySource }) => restDataSource({
|
|
15675
|
+
var tenantDataSource = ({ tenant, baseUrl, timeoutMs, getUserToken, holidaySource, chat }) => restDataSource({
|
|
15586
15676
|
baseUrl,
|
|
15587
15677
|
timeoutMs,
|
|
15588
15678
|
auth: true,
|
|
15589
15679
|
headers: { [TENANT_HEADER]: tenant },
|
|
15590
15680
|
getUserToken,
|
|
15591
|
-
holidaySource
|
|
15681
|
+
holidaySource,
|
|
15682
|
+
chat
|
|
15592
15683
|
});
|
|
15593
15684
|
|
|
15594
15685
|
// src/utils/reminders.ts
|
|
@@ -15737,7 +15828,7 @@ function ReminderNotices() {
|
|
|
15737
15828
|
|
|
15738
15829
|
// src/components/TeamsGate.tsx
|
|
15739
15830
|
function TeamsGate({ children }) {
|
|
15740
|
-
const { teams } =
|
|
15831
|
+
const { teams } = useFeatures();
|
|
15741
15832
|
return teams ? children : /* @__PURE__ */ jsx(Navigate, {
|
|
15742
15833
|
to: ROUTES.settings,
|
|
15743
15834
|
replace: true
|
|
@@ -15767,11 +15858,12 @@ function CalendarPage() {
|
|
|
15767
15858
|
const openEvent = useMemo(() => linkedEventId && isISODate(linkedDate) ? {
|
|
15768
15859
|
eventId: linkedEventId,
|
|
15769
15860
|
date: linkedDate,
|
|
15770
|
-
tab: linkedTab === "chat" ? "chat" : void 0
|
|
15861
|
+
tab: linkedTab === "chat" && host.features.chat ? "chat" : void 0
|
|
15771
15862
|
} : void 0, [
|
|
15772
15863
|
linkedEventId,
|
|
15773
15864
|
linkedDate,
|
|
15774
|
-
linkedTab
|
|
15865
|
+
linkedTab,
|
|
15866
|
+
host.features.chat
|
|
15775
15867
|
]);
|
|
15776
15868
|
const linkedCalendarExists = calendars.some((calendar) => calendar.id === linkedCalendarId);
|
|
15777
15869
|
useEffect(() => {
|
|
@@ -15787,7 +15879,7 @@ function CalendarPage() {
|
|
|
15787
15879
|
return next;
|
|
15788
15880
|
}, { replace: true });
|
|
15789
15881
|
const chatAccess = useMemo(() => {
|
|
15790
|
-
if (!host.
|
|
15882
|
+
if (!host.features.chat || !user) return void 0;
|
|
15791
15883
|
const find = (calendarId) => calendars.find((calendar) => calendar.id === calendarId);
|
|
15792
15884
|
return {
|
|
15793
15885
|
currentUserId: user.id,
|
|
@@ -15801,12 +15893,12 @@ function CalendarPage() {
|
|
|
15801
15893
|
}
|
|
15802
15894
|
};
|
|
15803
15895
|
}, [
|
|
15804
|
-
host.
|
|
15896
|
+
host.features.chat,
|
|
15805
15897
|
user,
|
|
15806
15898
|
calendars
|
|
15807
15899
|
]);
|
|
15808
15900
|
const loadAttendeeCandidates = useMemo(() => {
|
|
15809
|
-
if (!host.
|
|
15901
|
+
if (!host.features.attendees || !user) return void 0;
|
|
15810
15902
|
return async (calendarId) => {
|
|
15811
15903
|
const calendar = calendars.find((entry) => entry.id === calendarId);
|
|
15812
15904
|
if (!calendar || isPersonalCalendar(calendar)) return [];
|
|
@@ -15816,7 +15908,7 @@ function CalendarPage() {
|
|
|
15816
15908
|
}));
|
|
15817
15909
|
};
|
|
15818
15910
|
}, [
|
|
15819
|
-
host.
|
|
15911
|
+
host.features.attendees,
|
|
15820
15912
|
user,
|
|
15821
15913
|
calendars,
|
|
15822
15914
|
repository
|
|
@@ -15825,7 +15917,7 @@ function CalendarPage() {
|
|
|
15825
15917
|
name,
|
|
15826
15918
|
color
|
|
15827
15919
|
}])), [calendars, activeCalendar]);
|
|
15828
|
-
const initialView = host.initialView ?? getStartView(preferences, isCompactWidth(root.clientWidth));
|
|
15920
|
+
const initialView = host.initialView ?? nearestView(getStartView(preferences, isCompactWidth(root.clientWidth)), host.views);
|
|
15829
15921
|
return /* @__PURE__ */ jsxs("div", {
|
|
15830
15922
|
className: "app",
|
|
15831
15923
|
children: [
|
|
@@ -15848,7 +15940,7 @@ function CalendarPage() {
|
|
|
15848
15940
|
"aria-label": m.common.settings,
|
|
15849
15941
|
title: m.common.settings,
|
|
15850
15942
|
children: /* @__PURE__ */ jsx(SettingsIcon, { size: 20 })
|
|
15851
|
-
}), /* @__PURE__ */ jsx(AccountMenu, { menuItems: host.teams ? /* @__PURE__ */ jsx(CalendarSwitcher, {}) : void 0 })] })
|
|
15943
|
+
}), /* @__PURE__ */ jsx(AccountMenu, { menuItems: host.features.teams ? /* @__PURE__ */ jsx(CalendarSwitcher, {}) : void 0 })] })
|
|
15852
15944
|
}),
|
|
15853
15945
|
user && /* @__PURE__ */ jsx(LocalImportPrompt, { userId: user.id })
|
|
15854
15946
|
]
|
|
@@ -15960,7 +16052,7 @@ function RespondPage() {
|
|
|
15960
16052
|
function SettingsPage() {
|
|
15961
16053
|
const { m } = useI18n();
|
|
15962
16054
|
const { enabled, method, user } = useAuth();
|
|
15963
|
-
const { teams } =
|
|
16055
|
+
const { teams, holidays, customColors, emailNotifications } = useFeatures();
|
|
15964
16056
|
const { invitations } = useCalendars();
|
|
15965
16057
|
const tabs = [{
|
|
15966
16058
|
value: "calendars",
|
|
@@ -15977,11 +16069,11 @@ function SettingsPage() {
|
|
|
15977
16069
|
label: m.settings.tabs.appearance,
|
|
15978
16070
|
content: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
15979
16071
|
/* @__PURE__ */ jsx(PreferencesSettings, {}),
|
|
15980
|
-
/* @__PURE__ */ jsx(HolidaySettings, {}),
|
|
15981
|
-
/* @__PURE__ */ jsx(CustomColorSettings, {})
|
|
16072
|
+
holidays && /* @__PURE__ */ jsx(HolidaySettings, {}),
|
|
16073
|
+
customColors && /* @__PURE__ */ jsx(CustomColorSettings, {})
|
|
15982
16074
|
] })
|
|
15983
16075
|
});
|
|
15984
|
-
if (enabled && user) tabs.push({
|
|
16076
|
+
if (emailNotifications && enabled && user) tabs.push({
|
|
15985
16077
|
value: "notifications",
|
|
15986
16078
|
label: m.settings.tabs.notifications,
|
|
15987
16079
|
content: /* @__PURE__ */ jsx(NotificationSettings, { emailVerified: user.emailVerified })
|
|
@@ -16108,6 +16200,7 @@ function SessionProviders({ dataSource, eventCallbacks, children }) {
|
|
|
16108
16200
|
const { m } = useI18n();
|
|
16109
16201
|
const getLanguage = useLocaleGetter();
|
|
16110
16202
|
const { status, user, expireSession } = useAuth();
|
|
16203
|
+
const { reminders } = useFeatures();
|
|
16111
16204
|
const isAuthenticated = status === "authenticated";
|
|
16112
16205
|
const repositories = useMemo(() => dataSource.connect({ isAuthenticated }, {
|
|
16113
16206
|
getLanguage,
|
|
@@ -16135,7 +16228,7 @@ function SessionProviders({ dataSource, eventCallbacks, children }) {
|
|
|
16135
16228
|
children: /* @__PURE__ */ jsx(PreferencesProvider, { children: /* @__PURE__ */ jsxs(CalendarsProvider, {
|
|
16136
16229
|
storageScope: user?.id ?? "guest",
|
|
16137
16230
|
repository: repositories.calendars,
|
|
16138
|
-
children: [children, /* @__PURE__ */ jsx(ReminderNotices, {})]
|
|
16231
|
+
children: [children, reminders && /* @__PURE__ */ jsx(ReminderNotices, {})]
|
|
16139
16232
|
}, user?.id ?? "guest") })
|
|
16140
16233
|
});
|
|
16141
16234
|
}
|
|
@@ -16156,18 +16249,105 @@ function CalendarApp({ dataSource, eventCallbacks, routing, basename, initialPat
|
|
|
16156
16249
|
});
|
|
16157
16250
|
}
|
|
16158
16251
|
|
|
16159
|
-
// src/lib/
|
|
16160
|
-
var
|
|
16161
|
-
var
|
|
16162
|
-
var
|
|
16163
|
-
|
|
16164
|
-
|
|
16165
|
-
|
|
16166
|
-
|
|
16167
|
-
|
|
16168
|
-
|
|
16169
|
-
|
|
16252
|
+
// src/lib/options.ts
|
|
16253
|
+
var ROUTING_MODES = ["memory", "browser"];
|
|
16254
|
+
var HOST_THEMES = ["light", "dark"];
|
|
16255
|
+
var INVALID = Symbol("invalid");
|
|
16256
|
+
var isPlainObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
16257
|
+
var text = (value) => typeof value === "string" && value.trim() !== "" ? value.trim() : INVALID;
|
|
16258
|
+
var oneOf = (values) => (value) => isOneOf(values, value) ? value : INVALID;
|
|
16259
|
+
var positiveInteger = (value) => Number.isInteger(value) && value > 0 ? value : INVALID;
|
|
16260
|
+
var linkParam = (value) => value === false ? false : text(value, "");
|
|
16261
|
+
var messages = (value) => isPlainObject(value) && Object.values(value).every(isPlainObject) ? value : INVALID;
|
|
16262
|
+
var EXPECTED = {
|
|
16263
|
+
tenant: "a non-empty string",
|
|
16264
|
+
storageMode: STORAGE_MODES.join(" or "),
|
|
16265
|
+
apiBaseUrl: "a non-empty string",
|
|
16266
|
+
apiTimeoutMs: "a positive integer",
|
|
16267
|
+
features: "an object of feature names and booleans",
|
|
16268
|
+
views: `a list with at least one of ${CALENDAR_VIEWS.join(", ")}`,
|
|
16269
|
+
routing: ROUTING_MODES.join(" or "),
|
|
16270
|
+
basename: "a non-empty string",
|
|
16271
|
+
initialPath: "a non-empty string",
|
|
16272
|
+
linkParam: "a non-empty string or false",
|
|
16273
|
+
locale: "a non-empty string",
|
|
16274
|
+
messages: "an object of languages and their texts",
|
|
16275
|
+
theme: HOST_THEMES.join(" or "),
|
|
16276
|
+
initialView: CALENDAR_VIEWS.join(", "),
|
|
16277
|
+
timeZone: "a non-empty string",
|
|
16278
|
+
holidays: "a non-empty string",
|
|
16279
|
+
holidaySource: HOLIDAY_SOURCES.join(" or "),
|
|
16280
|
+
mapUrl: "a non-empty string"
|
|
16170
16281
|
};
|
|
16282
|
+
var OPTION_NAMES = Object.keys(EXPECTED);
|
|
16283
|
+
function parseCalendarOptions(value) {
|
|
16284
|
+
const issues = [];
|
|
16285
|
+
if (!isPlainObject(value)) return {
|
|
16286
|
+
options: {},
|
|
16287
|
+
issues: ["The configuration must be an object."]
|
|
16288
|
+
};
|
|
16289
|
+
const features = (raw) => {
|
|
16290
|
+
if (!isPlainObject(raw)) return INVALID;
|
|
16291
|
+
const result = {};
|
|
16292
|
+
for (const [name, enabled] of Object.entries(raw)) if (!isOneOf(FEATURE_NAMES, name)) issues.push(`Unknown feature "${name}".`);
|
|
16293
|
+
else if (typeof enabled !== "boolean") issues.push(`Feature "${name}" must be true or false.`);
|
|
16294
|
+
else result[name] = enabled;
|
|
16295
|
+
return result;
|
|
16296
|
+
};
|
|
16297
|
+
const views = (raw) => {
|
|
16298
|
+
if (!Array.isArray(raw)) return INVALID;
|
|
16299
|
+
const valid = raw.filter(isCalendarView);
|
|
16300
|
+
return valid.length > 0 && valid.length === raw.length ? valid : INVALID;
|
|
16301
|
+
};
|
|
16302
|
+
const readers = {
|
|
16303
|
+
tenant: text,
|
|
16304
|
+
storageMode: oneOf(STORAGE_MODES),
|
|
16305
|
+
apiBaseUrl: text,
|
|
16306
|
+
apiTimeoutMs: positiveInteger,
|
|
16307
|
+
features,
|
|
16308
|
+
views,
|
|
16309
|
+
routing: oneOf(ROUTING_MODES),
|
|
16310
|
+
basename: text,
|
|
16311
|
+
initialPath: text,
|
|
16312
|
+
linkParam,
|
|
16313
|
+
locale: text,
|
|
16314
|
+
messages,
|
|
16315
|
+
theme: oneOf(HOST_THEMES),
|
|
16316
|
+
initialView: oneOf(CALENDAR_VIEWS),
|
|
16317
|
+
timeZone: text,
|
|
16318
|
+
holidays: text,
|
|
16319
|
+
holidaySource: oneOf(HOLIDAY_SOURCES),
|
|
16320
|
+
mapUrl: text
|
|
16321
|
+
};
|
|
16322
|
+
const options = {};
|
|
16323
|
+
for (const [name, raw] of Object.entries(value)) {
|
|
16324
|
+
if (name === "$schema" || raw === void 0 || raw === null) continue;
|
|
16325
|
+
if (!isOneOf(OPTION_NAMES, name)) {
|
|
16326
|
+
issues.push(`Unknown option "${name}".`);
|
|
16327
|
+
continue;
|
|
16328
|
+
}
|
|
16329
|
+
const parsed = readers[name](raw, name);
|
|
16330
|
+
if (parsed === INVALID) issues.push(`Option "${name}" must be ${EXPECTED[name]}.`);
|
|
16331
|
+
else options[name] = parsed;
|
|
16332
|
+
}
|
|
16333
|
+
return {
|
|
16334
|
+
options,
|
|
16335
|
+
issues
|
|
16336
|
+
};
|
|
16337
|
+
}
|
|
16338
|
+
function mergeCalendarOptions(base, overrides) {
|
|
16339
|
+
const merged = { ...base };
|
|
16340
|
+
for (const name of OPTION_NAMES) if (overrides[name] !== void 0) merged[name] = overrides[name];
|
|
16341
|
+
const features = { ...base.features };
|
|
16342
|
+
for (const name of FEATURE_NAMES) {
|
|
16343
|
+
const value = overrides.features?.[name];
|
|
16344
|
+
if (value !== void 0) features[name] = value;
|
|
16345
|
+
}
|
|
16346
|
+
return {
|
|
16347
|
+
...merged,
|
|
16348
|
+
features
|
|
16349
|
+
};
|
|
16350
|
+
}
|
|
16171
16351
|
|
|
16172
16352
|
// src/assets/css/index.css?inline
|
|
16173
16353
|
var css_default = ":host{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light dark;--font-family:\"Segoe UI\", Tahoma, Geneva, Verdana, sans-serif;--font-size-xs:10px;--font-size-sm:12px;--font-size-md:14px;--font-size-base:15px;--font-size-lg:20px;--font-size-xl:22px;--color-bg:var(--lightningcss-light,#fff)var(--lightningcss-dark,#16171a);--color-surface:var(--lightningcss-light,#fff)var(--lightningcss-dark,#1e1f23);--color-surface-hover:var(--lightningcss-light,#eee)var(--lightningcss-dark,#2a2b30);--color-grid:var(--lightningcss-light,#cecece)var(--lightningcss-dark,#3a3b40);--color-muted:var(--lightningcss-light,#777)var(--lightningcss-dark,#9a9a9f);--color-text:var(--lightningcss-light,#222)var(--lightningcss-dark,#e6e6e6);--color-heading:var(--lightningcss-light,#5e5b5b)var(--lightningcss-dark,#b9b6b6);--color-on-accent:#fff;--color-on-yellow:var(--lightningcss-light,#222)var(--lightningcss-dark,#1a1a1a);--color-red:var(--lightningcss-light,#be230f)var(--lightningcss-dark,#e2503c);--color-blue:var(--lightningcss-light,#365caf)var(--lightningcss-dark,#628ce6);--color-green:var(--lightningcss-light,#158115)var(--lightningcss-dark,#34aa52);--color-yellow:var(--lightningcss-light,#e9e504)var(--lightningcss-dark,#e6d228);--color-grey:var(--lightningcss-light,#5e5b5b)var(--lightningcss-dark,#969393);--shadow-color:var(--lightningcss-light,#5705054d)var(--lightningcss-dark,#0009);--shadow:0 0 20px var(--shadow-color);--focus-ring:0 0 0 2px var(--color-blue);--radius-sm:4px;--radius-md:10px;--radius-pill:25px;--radius-round:50%;--space-1:2px;--space-2:5px;--space-3:10px;--space-4:20px;--space-5:25px;--slot-height:30px;--all-day-row-height:22px;--time-column-width:100px;--day-column-min-width:110px;--column-header-height:60px;--transition-fast:80ms linear;--transition-base:.2s ease-in}@media (prefers-color-scheme:dark){:host{--lightningcss-light: ;--lightningcss-dark:initial}}.calendarRoot[data-theme=light]{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}.calendarRoot[data-theme=dark]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}*,:before,:after{box-sizing:border-box;margin:0;padding:0}:host{-webkit-text-size-adjust:100%;display:block}.calendarRoot{height:100%;font-family:var(--font-family);font-size:var(--font-size-base);color:var(--color-text);background-color:var(--color-bg);transition:background-color var(--transition-base), color var(--transition-base);line-height:1.4;position:relative;overflow:auto;container:calendar/inline-size}.calendarRoot:focus{outline:none}h1,h2,h3{color:var(--color-heading);font-weight:550;line-height:1.2}a{color:var(--color-blue);text-decoration:none}a:hover{text-decoration:underline}img,svg{max-width:100%;display:block}button,input,textarea,select{font-family:inherit;font-size:inherit;color:inherit;background:0 0;border:none;outline:none}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.5}:focus-visible{box-shadow:var(--focus-ring);outline:none}::selection{background-color:var(--color-blue);color:var(--color-on-accent)}@media (prefers-reduced-motion:reduce){*,:before,:after{transition-duration:.01ms!important;animation-duration:.01ms!important}}.app{flex-direction:column;height:100%;display:flex}.main{flex-direction:column;flex:1;min-width:0;min-height:0;display:flex}.scrollArea{scrollbar-color:var(--color-grid) transparent;overflow:auto}.header{align-items:center;gap:var(--space-3);padding:var(--space-4);grid-template-columns:1fr auto 1fr;grid-template-areas:\"nav title actions\";display:grid}.headerNav{align-items:center;gap:var(--space-2);font-size:var(--font-size-xl);grid-area:nav;display:flex}.headerCenter{align-items:center;gap:var(--space-1);flex-direction:column;grid-area:title;min-width:0;display:flex}.headerTitle{justify-content:center;align-items:baseline;gap:0 var(--space-3);text-align:center;flex-wrap:wrap;display:flex}.headerSubtitle{font-size:var(--font-size-base);color:var(--color-muted);font-weight:400}.headerCreate{align-items:center;gap:var(--space-2);display:flex}.headerActions{justify-content:flex-end;align-items:center;gap:var(--space-3);grid-area:actions;display:flex}.page{min-height:100%;padding:var(--space-4);place-items:center;display:grid}.pageCard{gap:var(--space-4);width:min(420px,100%);padding:var(--space-5);flex-direction:column;display:flex}.pageBack{font-size:var(--font-size-md);align-self:flex-start}.pageTitle{font-size:1.75rem}.pageFooter{font-size:var(--font-size-md);color:var(--color-muted);text-align:center}.pageFull{flex-direction:column;min-height:100%;display:flex}.pageHeader{gap:var(--space-2);padding:var(--space-4);border-bottom:1px solid var(--color-grid);flex-direction:column;display:flex}.pageContent{width:100%;padding:0 var(--space-4) var(--space-5);flex:1}.pageSection{gap:var(--space-3) var(--space-5);padding:var(--space-5) 0;grid-template-columns:minmax(200px,1fr) minmax(0,2fr);display:grid}.pageSection+.pageSection{border-top:1px solid var(--color-grid)}.pageSectionIntro,.pageSectionBody{gap:var(--space-3);flex-direction:column;display:flex}.roleOverview{gap:var(--space-2);margin-top:var(--space-2);flex-direction:column;display:flex}.roleOverviewTitle{font-size:var(--font-size-md);color:var(--color-text);cursor:pointer;font-weight:600}.roleOverviewList{gap:var(--space-2);font-size:var(--font-size-md);color:var(--color-muted);flex-direction:column;padding-left:1.1em;display:flex}.roleOverviewName{color:var(--color-text);font-weight:600}.roleOverviewName:after{content:\": \"}.pageSectionBody{max-width:720px}.pageSectionTitle{font-size:var(--font-size-lg)}.pageSection--danger .pageSectionTitle{color:var(--color-red)}.pageFull:has(.tabList) .pageHeader{border-bottom:none;padding-bottom:0}.tabList{z-index:2;gap:var(--space-1);margin:0 calc(-1 * var(--space-4));padding:0 var(--space-4);border-bottom:1px solid var(--color-grid);background-color:var(--color-bg);scrollbar-width:none;display:flex;position:sticky;top:0;overflow-x:auto}.tab{padding:var(--space-3) var(--space-4);color:var(--color-muted);transition:color var(--transition-fast), border-color var(--transition-fast);border-bottom:3px solid #0000;flex:none;font-weight:600}.tab:hover,.tab:focus-visible{color:var(--color-text)}.tab.active{border-bottom-color:var(--color-blue);color:var(--color-text)}.tabs--stable .tabPanels{display:grid}.tabs--stable .tabPanel{grid-area:1/1}.tabs--stable .tabPanel[inert]{visibility:hidden}.tab--invalid:after{content:\"\";width:6px;height:6px;margin-left:var(--space-1);background-color:var(--color-red);vertical-align:super;border-radius:50%;display:inline-block}.itemList{flex-direction:column;list-style:none;display:flex}.itemRow{align-items:center;gap:var(--space-3);padding:var(--space-2) 0;display:flex}.itemRow+.itemRow{border-top:1px solid var(--color-grid)}.itemRowMain{flex-direction:column;flex:1;min-width:0;display:flex}.itemRowTitle{overflow-wrap:anywhere;font-weight:600}.itemRowMeta{font-size:var(--font-size-sm);color:var(--color-muted)}.badge{padding:0 var(--space-3);border-radius:var(--radius-pill);background-color:var(--color-surface-hover);color:var(--color-muted);font-size:var(--font-size-sm);vertical-align:1px;font-weight:600;display:inline-block}.badge--success{background-color:color-mix(in srgb, var(--color-green) 18%, transparent);color:var(--color-green)}.settingValue{align-items:center;gap:var(--space-2) var(--space-3);overflow-wrap:anywhere;flex-wrap:wrap;display:flex}@container calendar (width<=900px){.header{grid-template-columns:auto 1fr;grid-template-areas:\"nav actions\"\"title title\"}.headerActions{justify-self:end}}@container calendar (width<=700px){.header{padding:var(--space-3);grid-template-columns:1fr auto;grid-template-areas:\"nav create\"\"title title\"\"views views\"}.headerActions{display:contents}.headerActions .segmentedControl{grid-area:views}.headerCreate{grid-area:create}.headerTitle,.headerNav{font-size:var(--font-size-lg)}.page{padding:var(--space-3);place-items:start center}.pageCard.surface{padding:var(--space-4);box-shadow:none}.pageHeader{padding:var(--space-3)}.pageContent{padding:0 var(--space-3) var(--space-4)}.tabList{margin:0 calc(-1 * var(--space-3));padding:0 var(--space-3)}.tab{padding:var(--space-3)}.pageSection{padding:var(--space-4) 0;grid-template-columns:minmax(0,1fr)}}.undoNotice{left:50%;bottom:var(--space-4);z-index:20;align-items:center;gap:var(--space-3);max-width:calc(100% - 2 * var(--space-4));padding:var(--space-2) var(--space-2) var(--space-2) var(--space-4);border-radius:var(--radius-md);background-color:var(--color-text);color:var(--color-bg);box-shadow:var(--shadow);animation:.15s ease-out modalIn;display:flex;position:absolute;translate:-50%}.undoNoticeText{white-space:nowrap;text-overflow:ellipsis;min-width:0;overflow:hidden}.undoNoticeAction{padding:var(--space-1) var(--space-2);border-radius:var(--radius-sm);color:var(--lightningcss-light,#8ab4ff)var(--lightningcss-dark,#365caf);flex:none;font-weight:700}.undoNoticeAction:hover,.undoNoticeAction:focus-visible{background-color:color-mix(in srgb, currentColor 15%, transparent)}.undoNotice .closeButton{color:inherit;opacity:.7}.reminderNotices{right:var(--space-4);bottom:var(--space-4);z-index:20;gap:var(--space-2);max-width:min(360px, calc(100% - 2 * var(--space-4)));flex-direction:column;display:flex;position:absolute}.reminderNotice{align-items:flex-start;gap:var(--space-3);padding:var(--space-3) var(--space-4);border:1px solid var(--color-grid);border-radius:var(--radius-md);background-color:var(--color-surface);box-shadow:var(--shadow);display:flex}.reminderNoticeLocation{color:var(--color-muted);font-size:var(--font-size-sm);display:block}.button{justify-content:center;align-items:center;gap:var(--space-2);padding:var(--space-3) var(--space-4);border-radius:var(--radius-pill);background-color:var(--color-blue);color:var(--color-on-accent);transition:opacity var(--transition-fast);font-weight:600;display:inline-flex}.button:hover,.button:focus-visible{opacity:.8}.button--danger{background-color:var(--color-red)}.button--secondary{background-color:var(--color-grey)}.button--outline{border:1px solid var(--color-grid);color:var(--color-text);background-color:#0000}.button--small{padding:var(--space-1) var(--space-3);font-size:var(--font-size-sm)}.button--block{width:100%}.iconButton{width:30px;height:30px;margin:0 var(--space-2);border:3px solid var(--color-muted);border-radius:var(--radius-round);color:var(--color-muted);transition:color var(--transition-fast), border-color var(--transition-fast);place-items:center;font-size:16px;line-height:1;display:inline-grid}.iconButton:hover,.iconButton:focus-visible{color:var(--color-text);border-color:var(--color-text)}.iconButton--plain{width:auto;height:auto;font-size:inherit;border:none}.todayButton{padding:var(--space-2) var(--space-3);font-size:var(--font-size-base)}.segmentedControl{border:1px solid var(--color-grid);border-radius:var(--radius-pill);padding:2px;display:inline-flex}.segment{padding:var(--space-2) var(--space-3);border-radius:var(--radius-pill);color:var(--color-muted);font-size:var(--font-size-md);transition:background-color var(--transition-fast), color var(--transition-fast);flex:1;font-weight:600}.segment:hover{color:var(--color-text)}.segment.active{background-color:var(--color-blue);color:var(--color-on-accent)}.closeButton{color:var(--color-muted);font-size:28px;font-weight:700;line-height:1}.closeButton:hover,.closeButton:focus-visible{color:var(--color-text)}.formSection{gap:var(--space-4);flex-direction:column;display:flex}.formSection .formSection{gap:var(--space-3)}.formRow{gap:var(--space-4);flex-wrap:wrap;display:flex}.formRow .field{flex:1;min-width:120px}.field{gap:var(--space-2);flex-direction:column;display:flex}fieldset.field{border:none;min-width:0}.label{font-weight:700}.formHint{font-size:var(--font-size-md);color:var(--color-muted)}.input{padding:var(--space-1) 1px;border-bottom:1px solid var(--color-grid);transition:border-color var(--transition-fast)}.input:focus{border-bottom-color:var(--color-text)}.formSection .input{width:100%}.formSection .numberInput{width:4.5em}select.input{background-color:var(--color-surface);color:var(--color-text);cursor:pointer}.inlineField{align-items:center;gap:var(--space-2);display:flex}.choiceList{align-items:center;gap:var(--space-3);flex-wrap:wrap;display:flex}.chip{border-radius:var(--radius-round);cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color var(--transition-fast), border-color var(--transition-fast);place-items:center;display:grid;position:relative}.chip:has(:focus-visible){box-shadow:var(--focus-ring)}.textarea{border:1px solid var(--color-grid);resize:vertical;width:100%;min-height:40px;transition:border-color var(--transition-fast);padding:4px}.textarea:focus{border-color:var(--color-text)}.input:focus-visible,.textarea:focus-visible{box-shadow:none}.input::placeholder,.textarea::placeholder{color:var(--color-muted)}.errorText{color:var(--color-red)}.successText{color:var(--color-green)}.formActions{justify-content:flex-end;gap:var(--space-3);flex-wrap:wrap;display:flex}.emptyHint{color:var(--color-muted);font-style:italic}.switch{align-items:center;gap:var(--space-2);font-size:var(--font-size-sm);cursor:pointer;display:inline-flex;position:relative}.switchInput{opacity:0;pointer-events:none;position:absolute}.switchTrack{border-radius:var(--radius-pill);background-color:var(--color-grid);width:34px;height:20px;transition:background-color var(--transition-fast);flex:none;position:relative}.switchTrack:after{content:\"\";border-radius:var(--radius-round);background-color:var(--color-bg);width:16px;height:16px;transition:translate var(--transition-fast);position:absolute;top:2px;left:2px;box-shadow:0 1px 2px #0000004d}.switchInput:checked+.switchTrack{background-color:var(--color-blue)}.switchInput:checked+.switchTrack:after{translate:14px}.switchInput:focus-visible+.switchTrack{box-shadow:var(--focus-ring)}.switchInput:disabled+.switchTrack,.switchInput:disabled~.switchLabel{opacity:.5}.buttonRow{gap:var(--space-3);flex-wrap:wrap;display:flex}.button.isDisabled{opacity:.6;pointer-events:none}.attendees{gap:var(--space-3);border:0;flex-direction:column;min-width:0;margin:0;padding:0;display:flex}.attendeeAdd{gap:var(--space-2) var(--space-3);flex-wrap:wrap;align-items:flex-end;display:flex}.attendeeAdd>.field{flex:200px;min-width:0}.attendeesSummary{color:var(--color-muted);font-weight:400}.attendeeList{gap:var(--space-1);flex-direction:column;display:flex}.attendee{align-items:center;gap:var(--space-3);display:flex}.attendeeName{overflow-wrap:anywhere;flex-direction:column;flex:1;min-width:0;display:flex}.attendeeEmail{color:var(--color-muted);font-size:var(--font-size-sm)}.attendeeStatus{padding:1px var(--space-2);border-radius:var(--radius-pill,999px);background-color:var(--color-surface-hover);font-size:var(--font-size-sm);flex:none}.attendeeStatus--accepted{color:var(--color-green)}.attendeeStatus--declined{color:var(--color-red)}.feedUrl{width:100%;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:var(--font-size-sm)}.respondEvent{gap:var(--space-1);margin-bottom:var(--space-4);overflow-wrap:anywhere;flex-direction:column;display:flex}.respondTitle{font-size:var(--font-size-lg)}.modal{width:min(450px, calc(100vw - 2 * var(--space-4)));min-width:250px;max-height:calc(100dvh - 2 * var(--space-4));border-radius:var(--radius-md);background-color:var(--color-surface);color:var(--color-text);box-shadow:var(--shadow);border:none;margin:auto;padding:0;overflow:auto}.modal--large{width:min(860px, calc(100vw - 2 * var(--space-4)))}.modal[open]{animation:.15s ease-out modalIn}.modal::backdrop{background-color:#00000059}.modalContent{padding:var(--space-4)}.modalHeader{justify-content:space-between;align-items:flex-start;gap:var(--space-3);margin-bottom:var(--space-4);display:flex}.modalMessage{overflow-wrap:anywhere;line-height:1.5}.modalTitle{font-size:1.5rem}.modal--danger .modalTitle{color:var(--color-red);font-size:25px}.modalActions{margin:var(--space-5) 0 var(--space-3);flex-wrap:wrap;gap:12px;display:flex}.modalActions--stacked{flex-direction:column}.modalActions--split{justify-content:space-between}.modalActions--split .button{min-width:90px;padding:15px 25px;font-weight:700}@keyframes modalIn{0%{opacity:0;transform:translateY(8px)}}.calendar{border-bottom:1px solid var(--color-grid);width:100%;display:flex}.dayTime{width:var(--time-column-width);text-align:center;color:var(--color-muted);flex:none}.day{min-width:var(--day-column-min-width);border-left:1px solid var(--color-grid);flex:1}.columnHeader{width:100%;height:var(--column-header-height);padding:var(--space-2) 0;line-height:1.25;font-size:var(--font-size-lg);flex-direction:column;justify-content:center;align-items:center;display:flex;overflow:hidden}button.columnHeader:hover{background-color:var(--color-surface-hover)}.calendar--day .day{min-width:0}.day .columnHeader{border-top:1px solid var(--color-grid)}.day.currentDay .columnHeader{background-color:var(--color-surface-hover)}.dayName,.dayDisplay{text-overflow:ellipsis;white-space:nowrap;max-width:100%;overflow:hidden}.dayDisplay{font-size:var(--font-size-base);color:var(--color-muted)}.compactOnly{display:none}.slots{position:relative}.allDayLane{grid-template-rows:repeat(var(--all-day-rows,1), var(--all-day-row-height));min-height:calc(var(--all-day-rows,1) * (var(--all-day-row-height) + 2px) + 4px);border-top:1px solid var(--color-grid);cursor:pointer;grid-template-columns:minmax(0,1fr);row-gap:2px;padding:2px 0;display:grid}.day .allDayLane:hover{background-color:var(--color-surface-hover)}.allDayLabel{font-size:var(--font-size-sm);cursor:default;justify-content:center;align-items:center;display:flex}.allDayLane .eventChip{white-space:nowrap;text-overflow:ellipsis;grid-column:1;width:auto;margin:0 1px;overflow:hidden}.allDayLane .eventChip.eventContinuesBefore{margin-left:-1px}.allDayLane .eventChip.eventContinuesAfter{margin-right:0}.allDayLane .eventChipContinuation>*{visibility:hidden}.slot,.time{height:var(--slot-height);border-top:1px solid var(--color-grid)}.time{font-size:var(--font-size-md)}.slot{cursor:pointer;transition:background-color var(--transition-fast)}.slot:hover{background-color:var(--color-surface-hover)}.slots{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}.isSelecting .slot:hover{background-color:#0000}.isSelecting,.isSelecting .slot{cursor:grabbing}.slotSelection{top:calc(var(--selection-start,0) * var(--slot-height));z-index:2;height:calc(var(--selection-hours,1) * var(--slot-height));padding:var(--space-1) var(--space-2);border:2px solid var(--color-blue);border-radius:var(--radius-sm);background-color:color-mix(in srgb, var(--color-blue) 22%, transparent);pointer-events:none;position:absolute;left:1px;right:1px;overflow:hidden}.slotSelectionLabel{color:var(--color-text);font-size:var(--font-size-sm);white-space:nowrap;font-weight:600;display:block}.event{top:calc(var(--event-start,0) * var(--slot-height) / 60);left:calc(var(--event-column,0) * 100% / var(--event-columns,1) + 1px);z-index:1;width:calc(100% / var(--event-columns,1) - 2px);min-width:0;height:calc(var(--event-duration,60) * var(--slot-height) / 60);padding:var(--space-1) var(--space-2);text-align:left;border-radius:var(--radius-sm);cursor:pointer;flex-direction:column;line-height:1.25;display:flex;position:absolute;overflow:hidden}.event,.eventChip{background-color:var(--event-color,var(--color-blue));color:var(--event-text,var(--color-on-accent));transition:filter var(--transition-fast)}.event:hover,.eventChip:hover{filter:brightness(1.08)}.eventContinuesBefore{border-top-left-radius:0;border-top-right-radius:0}.eventContinuesAfter{border-bottom-right-radius:0;border-bottom-left-radius:0}.nowIndicator{top:calc(var(--now-minutes,0) * var(--slot-height) / 60);z-index:3;border-top:1px solid color-mix(in srgb, var(--color-red) 45%, transparent);pointer-events:none;height:0;position:absolute;left:0;right:0}.nowIndicator--today{border-top:2px solid var(--color-red);translate:0 -1px}.nowIndicator--today:before{content:\"\";border-radius:var(--radius-round);background-color:var(--color-red);width:10px;height:10px;position:absolute;top:-6px;left:-5px}.event:has(>.eventOpen:focus-visible){z-index:2}.eventOpen{z-index:1;border-radius:inherit;cursor:inherit;position:absolute;inset:0}.eventOpen:focus-visible{outline-offset:-3px}.eventLinks{min-width:0;font-size:var(--font-size-sm);flex-direction:column;flex:none;display:flex}.eventLinkRow{gap:var(--space-1);align-items:baseline;min-width:0;display:flex}.eventLink{z-index:2;white-space:nowrap;text-overflow:ellipsis;min-width:0;color:inherit;text-underline-offset:2px;text-decoration:underline;position:relative;overflow:hidden}.eventLocationLink{max-width:100%;font-size:var(--font-size-sm);flex:none;align-self:flex-start}.eventLink:hover,.eventLink:focus-visible{text-decoration-thickness:2px}.eventLink svg{vertical-align:-1px;margin-right:3px;display:inline-block}.eventMoreLinks{opacity:.9;flex:none}.eventName,.eventTime,.eventChip{white-space:nowrap;text-overflow:ellipsis;flex:none;overflow:hidden}.eventName{font-weight:600}.eventName svg{vertical-align:-1px;margin-right:3px;display:inline-block}.eventTime,.eventSource,.eventLocation{font-size:var(--font-size-sm);opacity:.9}.eventSource,.eventLocation{white-space:nowrap;text-overflow:ellipsis;flex:none;overflow:hidden}.shortEvent{padding:0 var(--space-2);font-size:var(--font-size-sm)}.veryShortEvent{padding:0 var(--space-2);font-size:var(--font-size-xs);margin-top:-1px}.monthGrid{grid-template-columns:repeat(7,minmax(0,1fr));display:grid}.monthGridWeekday{padding:var(--space-2) 0;text-align:center;font-size:var(--font-size-md);color:var(--color-muted)}.monthView{border-bottom:1px solid var(--color-grid);flex:1;grid-template-rows:auto;grid-auto-rows:minmax(110px,1fr)}.monthCell{min-width:0;padding:var(--space-1);border-top:1px solid var(--color-grid);border-left:1px solid var(--color-grid);cursor:pointer;transition:background-color var(--transition-fast);flex-direction:column;gap:2px;display:flex}.monthCell:hover{background-color:var(--color-surface-hover)}.monthCell.outsideMonth{color:var(--color-muted);opacity:.6}.dayNumber{min-width:26px;height:26px;padding:0 var(--space-1);border-radius:var(--radius-pill);font-size:var(--font-size-md);align-self:center}.dayNumber:hover{background-color:var(--color-grid)}.today .dayNumber,.miniDay.today{background-color:var(--event-color,var(--color-blue));color:var(--event-text,var(--color-on-accent))}.monthCellEvents{flex-direction:column;gap:2px;min-width:0;display:flex}.eventChip{width:100%;padding:1px var(--space-2);border-radius:var(--radius-sm);font-size:var(--font-size-sm);text-align:left;line-height:1.4;display:block}.eventChip.eventContinuesBefore{border-radius:0 var(--radius-sm) var(--radius-sm) 0}.eventChip.eventContinuesAfter{border-radius:var(--radius-sm) 0 0 var(--radius-sm)}.eventChip.eventContinuesBefore.eventContinuesAfter{border-radius:0}.eventChip .eventName{display:inline}.eventChipTime{margin-right:var(--space-2);opacity:.9}.moreEvents{padding:0 var(--space-2);font-size:var(--font-size-sm);color:var(--color-muted);text-align:left}.moreEvents:hover{color:var(--color-text)}.eventDots{display:none}.yearView{gap:var(--space-4);padding:var(--space-4);grid-template-columns:repeat(auto-fill,minmax(230px,1fr));display:grid}.yearMonth h2{margin-bottom:var(--space-2);font-size:var(--font-size-lg)}.yearMonthTitle{font-weight:inherit;border-radius:var(--radius-sm)}.yearMonthTitle:hover{color:var(--color-blue)}.miniMonth .monthGridWeekday{font-size:var(--font-size-xs)}.miniDay{aspect-ratio:1;border-radius:var(--radius-round);font-size:var(--font-size-sm);place-items:center;display:grid;position:relative}button.miniDay:hover{background-color:var(--color-surface-hover)}.miniDay.hasEvents:after{content:\"\";border-radius:var(--radius-round);background-color:var(--color-blue);width:4px;height:4px;position:absolute;bottom:2px;left:50%;transform:translate(-50%)}.miniDay.today.hasEvents:after{background-color:var(--color-on-accent)}@container calendar (width<=900px){.day{min-width:0}.calendar--week .dayName .compactHidden{display:none}.calendar--week .dayName .compactOnly{display:inline}}@container calendar (width<=600px){.calendar--week .allDayLabel{font-size:0}.dayTime{width:56px;font-size:var(--font-size-sm)}.day{min-width:0}.columnHeader{font-size:var(--font-size-base)}.dayDisplay{font-size:var(--font-size-sm)}.calendar--week .compactHidden{display:none}.calendar--week .compactOnly{display:inline}.calendar--week .dayTime{width:40px;font-size:var(--font-size-xs)}.calendar--week .columnHeader{padding:var(--space-1) 0}.calendar--week .dayDisplay{font-size:var(--font-size-base);color:inherit;font-weight:600}.calendar--week .event{font-size:var(--font-size-xs);padding:1px 2px;line-height:1.15}.calendar--week .slotSelectionLabel{font-size:var(--font-size-xs);white-space:normal;line-height:1.2}.calendar--week .eventName{white-space:normal;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;flex:0 auto}.calendar--week .eventName svg,.calendar--week .eventLinks,.calendar--week .eventTime{display:none}.calendar--day .dayTime{width:48px}.monthView{grid-auto-rows:minmax(64px,1fr)}.monthCellEvents{display:none}.eventDots{border-radius:var(--radius-pill);background-color:var(--color-blue);min-width:18px;color:var(--color-on-accent);font-size:var(--font-size-xs);text-align:center;align-self:center;padding:0 4px;display:block}.yearView{gap:var(--space-3);padding:var(--space-3);grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}.yearMonth h2{font-size:var(--font-size-base)}}.event,.eventChip{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}.eventResizeHandle{z-index:2;cursor:ns-resize;height:6px;position:absolute;bottom:0;left:0;right:0}.eventDragging{z-index:3;box-shadow:var(--shadow);outline:2px solid var(--color-bg);filter:brightness(1.08)}.isDraggingEvent,.isDraggingEvent *{cursor:grabbing!important}.isDraggingEvent .slot:hover,.isDraggingEvent .allDayLane:hover{background-color:#0000}.calendar .columnHeader,.calendar .allDayLane{z-index:4;background-color:var(--color-bg);position:sticky}.calendar .columnHeader{top:0}.calendar .allDayLane{top:var(--column-header-height);border-bottom:1px solid var(--color-grid)}.calendar .slots{margin-top:-1px}.eventNameLocation{opacity:.85;font-weight:400}.eventNameLocation:before{content:\" · \"}.eventSearch{gap:var(--space-3);flex-direction:column;display:flex}.eventSearchResults{flex-direction:column;max-height:min(60vh,480px);display:flex;overflow-y:auto}.eventSearchResult{align-items:flex-start;gap:var(--space-3);width:100%;padding:var(--space-2) var(--space-2);border-radius:var(--radius-sm);text-align:left;display:flex}.eventSearchResult:hover,.eventSearchResult:focus-visible{background-color:var(--color-surface-hover)}.eventSearchColor{background-color:var(--event-color,var(--color-blue));border-radius:50%;flex:none;width:10px;height:10px;margin-top:6px}.eventSearchText{flex-direction:column;min-width:0;display:flex}.eventSearchTitle{font-weight:600}.eventSearchMeta{color:var(--color-muted);font-size:var(--font-size-sm)}.eventDeclined{opacity:.55;text-decoration:line-through}.eventUnanswered{background-image:repeating-linear-gradient(-45deg, transparent 0 6px, color-mix(in srgb, var(--color-bg) 22%, transparent) 6px 12px)}.holidayLabel{white-space:nowrap;text-overflow:ellipsis;color:var(--color-red);font-size:var(--font-size-sm);font-weight:600;overflow:hidden}.allDayLane .holidayLabel{padding:0 var(--space-2);grid-area:1/1;align-self:center}.day.holiday .dayDisplay,.monthCell.holiday .dayNumber,.miniDay.holiday{color:var(--color-red)}.miniDay.holiday.today{color:var(--event-text,var(--color-on-accent))}.monthCell .holidayLabel{padding:0 var(--space-1);font-size:var(--font-size-xs)}.eventDescription{height:120px}.color{border:5px solid var(--color-surface);box-sizing:content-box;background-color:var(--event-color,var(--color-blue));width:20px;height:20px}.color.active,.color:hover{border-color:var(--color-grid)}.colorAdd{background:linear-gradient(var(--color-on-accent), var(--color-on-accent)) center / 10px 2px no-repeat, linear-gradient(var(--color-on-accent), var(--color-on-accent)) center / 2px 10px no-repeat, var(--color-grey)}.weekday{border:1px solid var(--color-grid);width:34px;height:34px;font-size:var(--font-size-md)}.weekday:hover{border-color:var(--color-text)}.weekday.active{border-color:var(--color-blue);background-color:var(--color-blue);color:var(--color-on-accent)}.colorSwatch{border-radius:var(--radius-round);background-color:var(--event-color,var(--color-blue));flex:none;width:22px;height:22px}.colorCode{font-family:ui-monospace,monospace}.itemRow .iconButton{font-size:var(--font-size-lg)}.eventNotice{padding:var(--space-2) var(--space-3);border-radius:var(--radius-sm);background-color:var(--color-surface-hover);margin:0}.eventForm .tabList{background-color:var(--color-surface)}.modal:has(.eventForm){width:min(520px, calc(100vw - 2 * var(--space-4)))}.eventForm .tab{padding:var(--space-2) var(--space-3)}.eventForm .tabPanel{gap:var(--space-4);padding-top:var(--space-4);flex-direction:column;display:flex}.linkList{gap:var(--space-3);flex-direction:column;list-style:none;display:flex}.linkRow{gap:var(--space-2);grid-template-columns:minmax(0,1fr) auto;align-items:center;display:grid}.linkLabel{grid-row:2}.linkActions{grid-row:1/3;align-items:center;display:flex}.linkPlaceholder{opacity:.35}.chat{gap:var(--space-2);flex-direction:column;height:420px;min-height:240px;max-height:calc(100dvh - 260px);display:flex}.chatMessages{gap:var(--space-2);min-height:0;padding:var(--space-2);border:1px solid var(--color-grid);border-radius:var(--radius-md);overscroll-behavior:contain;flex-direction:column;flex:1;display:flex;overflow-y:auto}.chatEmpty{text-align:center;margin:auto}.chatLoadOlder{padding:var(--space-1) var(--space-3);border-radius:var(--radius-pill);color:var(--color-blue);font-size:var(--font-size-sm);align-self:center}.chatEntry{gap:var(--space-1);flex-direction:column;display:flex}.chatDate{margin:var(--space-2) 0 var(--space-1);color:var(--color-muted);font-size:var(--font-size-xs);align-self:center;font-weight:600}.chatMessage{max-width:85%;padding:var(--space-2) var(--space-3);border-radius:var(--radius-md);border-bottom-left-radius:var(--radius-sm);background-color:var(--color-surface-hover);overflow-wrap:anywhere;flex-direction:column;align-self:flex-start;gap:2px;display:flex}.chatMessage--own{border-bottom-left-radius:var(--radius-md);border-bottom-right-radius:var(--radius-sm);background-color:color-mix(in srgb, var(--color-blue) 16%, var(--color-surface));align-self:flex-end}.chatMeta{gap:var(--space-2);color:var(--color-muted);font-size:var(--font-size-xs);flex-wrap:wrap;align-items:baseline;display:flex}.chatAuthor{color:var(--color-text);font-weight:700}.chatText{white-space:pre-wrap}.chatActions{gap:var(--space-2);display:flex}.chatAction{color:var(--color-muted);font-size:var(--font-size-xs);text-decoration:underline}.chatAction:hover,.chatAction:focus-visible{color:var(--color-text)}.chatAction--danger{color:var(--color-red)}.chatEdit{gap:var(--space-1);flex-direction:column;display:flex}.chatComposer{gap:var(--space-2);align-items:flex-end;display:flex}.chatInput{resize:vertical;flex:1;min-height:2.6em;max-height:8em}.unreadBadge{z-index:2;border-radius:var(--radius-pill);background-color:var(--color-red);min-width:18px;color:var(--color-on-accent);font-size:var(--font-size-xs);pointer-events:none;align-items:center;gap:2px;padding:1px 5px;font-weight:700;line-height:1.3;display:inline-flex;position:absolute;top:2px;right:2px}.eventChip .unreadBadge{margin-left:var(--space-1);vertical-align:1px;position:static}.calendarGroup{gap:var(--space-2);flex-direction:column;display:flex}.calendarGroupTitle{font-size:var(--font-size-md);color:var(--color-muted);text-transform:uppercase;letter-spacing:.04em;font-weight:600}.calendarCards{gap:var(--space-4);grid-template-columns:repeat(auto-fill,minmax(190px,1fr));list-style:none;display:grid}.calendarCard{gap:var(--space-3);width:100%;padding:var(--space-3);border:2px solid var(--color-grid);border-radius:var(--radius-md);text-align:left;transition:border-color var(--transition-fast), background-color var(--transition-fast);flex-direction:column;display:flex;position:relative}.calendarCard:hover{background-color:var(--color-surface-hover)}.calendarCard.active{border-color:var(--color-blue)}.calendarPreview{border:1px solid var(--color-grid);border-radius:var(--radius-sm);background-color:var(--color-bg);overflow:hidden}.calendarPreviewHeader{padding:var(--space-1) var(--space-2);background-color:var(--event-color,var(--color-blue));color:var(--event-text,var(--color-on-accent));font-size:var(--font-size-sm);font-weight:600}.calendarPreviewMonth{padding:var(--space-2);row-gap:1px}.calendarPreviewMonth .monthGridWeekday{padding:0;font-size:9px}.calendarPreviewMonth .miniDay{font-size:var(--font-size-xs);color:var(--color-muted)}.calendarPreviewMonth .miniDay.today{color:var(--event-text,var(--color-on-accent));font-weight:700}.calendarCardInfo{flex-direction:column;display:flex}.calendarCardName{overflow-wrap:anywhere;font-weight:600}.calendarCardMeta{font-size:var(--font-size-sm);color:var(--color-muted)}.calendarCardBadge{top:var(--space-2);right:var(--space-2);border-radius:var(--radius-round);background-color:var(--color-blue);width:24px;height:24px;color:var(--color-on-accent);font-size:var(--font-size-sm);place-items:center;font-weight:700;display:grid;position:absolute}.calendarSettingList{gap:var(--space-4);flex-direction:column;list-style:none;display:flex}.calendarSettingCard,.wizardPanel{border:1px solid var(--color-grid);border-radius:var(--radius-md);background-color:var(--color-surface)}.calendarSettingCard{gap:var(--space-4);padding:var(--space-4) var(--space-5);flex-direction:column;display:flex}.calendarSettingHeader{align-items:center;gap:var(--space-3);display:flex}.calendarSettingHeader .itemRowMain{flex:1}.calendarSettingHeader .itemRowTitle{font-size:var(--font-size-lg)}.calendarSettingBody{gap:var(--space-3);padding-top:var(--space-4);border-top:1px solid var(--color-grid);flex-direction:column;display:flex}.calendarSettingBody .switch{font-size:var(--font-size-base)}.colorSwatch--large{width:32px;height:32px}.calendarCardNew{min-height:100%;color:var(--color-muted);border-style:dashed;justify-content:center;align-items:center;text-decoration:none}.calendarCardNew:hover{color:var(--color-blue);border-color:var(--color-blue)}.wizard{gap:var(--space-5);max-width:760px;margin:var(--space-5) auto 0;flex-direction:column;display:flex}.wizardPanel{gap:var(--space-4);padding:var(--space-5)}.wizardHeader{gap:var(--space-1);flex-direction:column;display:flex}.wizardStepCount{font-size:var(--font-size-sm);color:var(--color-blue);font-weight:600}.wizardTitle{font-size:var(--font-size-lg)}.wizardActions{justify-content:flex-end;gap:var(--space-3);padding-top:var(--space-4);border-top:1px solid var(--color-grid);display:flex}.wizardSplit{align-items:start;gap:var(--space-5);grid-template-columns:minmax(0,1fr) 220px;display:grid}.inviteRow{align-items:flex-end}.inviteAdd{flex:none}.summaryList{gap:var(--space-2) var(--space-4);grid-template-columns:max-content minmax(0,1fr);display:grid}.summaryList dt{color:var(--color-muted)}.summaryList dd{overflow-wrap:anywhere}.summaryInvitations{list-style:none}.stepper{list-style:none;display:flex}.step{flex:1;justify-content:center;display:flex;position:relative}.step+.step:before{content:\"\";background-color:var(--color-grid);height:2px;margin:0 22px;position:absolute;top:14px;left:-50%;right:50%}.step--done+.step:before,.step--done+.step--current:before{background-color:var(--color-blue)}.stepContent{align-items:center;gap:var(--space-2);color:var(--color-muted);font-size:var(--font-size-sm);flex-direction:column;font-weight:600;display:flex;position:relative}button.stepContent:hover .stepLabel{color:var(--color-blue)}.stepNumber{border:2px solid var(--color-grid);border-radius:var(--radius-round);background-color:var(--color-bg);place-items:center;width:28px;height:28px;display:grid}.step--done .stepNumber{border-color:var(--color-blue);color:var(--color-blue)}.step--current .stepNumber{border-color:var(--color-blue);background-color:var(--color-blue);color:var(--color-on-accent)}.step--current .stepContent{color:var(--color-text)}@container calendar (width<=700px){.wizard{margin-top:var(--space-4)}.wizardPanel{padding:var(--space-4)}.wizardSplit{grid-template-columns:minmax(0,1fr)}.inviteRow{flex-wrap:wrap}.step:not(.step--current) .stepLabel{display:none}.calendarSettingCard{padding:var(--space-4)}.calendarCards{gap:var(--space-3);grid-template-columns:repeat(2,minmax(0,1fr))}.calendarCard{padding:var(--space-2)}.calendarPreviewMonth .monthGridWeekday{font-size:8px}.calendarPreviewMonth .miniDay{font-size:9px}}.activeCalendar{align-items:center;gap:var(--space-2);max-width:100%;padding:var(--space-1) var(--space-3);border:1px solid color-mix(in srgb, var(--event-color,var(--color-blue)) 45%, transparent);border-radius:var(--radius-pill);background-color:color-mix(in srgb, var(--event-color,var(--color-blue)) 12%, var(--color-bg));font-size:var(--font-size-sm);margin:0;line-height:1.4;display:inline-flex}.activeCalendarDot{border-radius:var(--radius-round);background-color:var(--event-color,var(--color-blue));flex:none;width:10px;height:10px}.activeCalendarName{text-overflow:ellipsis;white-space:nowrap;font-weight:600;overflow:hidden}.activeCalendarMeta{color:var(--color-muted);flex:none}.memberRow{flex-wrap:wrap}.memberRole{width:auto;min-width:10rem}.dangerAction{justify-content:space-between;align-items:center;gap:var(--space-4);display:flex}.dangerAction>.button{white-space:nowrap;flex:none}.dangerAction+.dangerAction{padding-top:var(--space-4);border-top:1px solid var(--color-grid)}@container calendar (width<=700px){.dangerAction{flex-direction:column;align-items:stretch}.memberRow .itemRowMain{flex-basis:100%}.memberRole{flex:1}}.memberPicker{gap:var(--space-2);flex-direction:column;max-height:min(50vh,22rem);margin:0;padding:0;list-style:none;display:flex;overflow-y:auto}.memberOption{align-items:center;gap:var(--space-3);padding:var(--space-2) var(--space-3);border:1px solid var(--color-grid);border-radius:var(--radius-sm);cursor:pointer;display:flex}.memberOption:hover{background-color:var(--color-surface-hover)}.memberOption:has(input:checked){border-color:var(--color-blue);background-color:color-mix(in srgb, var(--color-blue) 10%, transparent)}.memberOption input{accent-color:var(--color-blue);flex:none}.appLoading{min-height:100%;color:var(--color-muted);place-items:center;display:grid}.fieldToggle{font-size:var(--font-size-sm);color:var(--color-blue);flex:none}.accountLogin{padding:var(--space-2) var(--space-3);font-size:var(--font-size-md);white-space:nowrap}.accountButton{border-radius:var(--radius-round);background-color:var(--color-blue);width:32px;height:32px;color:var(--color-on-accent);place-items:center;font-weight:700;display:inline-grid}.accountPopover{inset:64px var(--space-4) auto auto;width:min(280px, calc(100vw - 2 * var(--space-4)));padding:var(--space-4);color:var(--color-text);border:none;margin:0;position:fixed}.accountPopover:popover-open{gap:var(--space-2);flex-direction:column;display:flex}.accountName{overflow-wrap:anywhere;font-weight:600}.accountEmail{margin-bottom:var(--space-2);font-size:var(--font-size-md);color:var(--color-muted);overflow-wrap:anywhere}.formLink{margin-top:calc(-1 * var(--space-3));font-size:var(--font-size-md);align-self:flex-end}.iconLink{border-radius:var(--radius-round);width:32px;height:32px;color:var(--color-muted);transition:color var(--transition-fast), background-color var(--transition-fast);place-items:center;display:inline-grid}.iconLink:hover,.iconLink:focus-visible{color:var(--color-text);background-color:var(--color-surface-hover)}.banner{justify-content:center;align-items:center;gap:var(--space-2) var(--space-4);padding:var(--space-3) var(--space-4);background-color:color-mix(in srgb, var(--color-yellow) 25%, var(--color-bg));font-size:var(--font-size-md);text-align:center;flex-wrap:wrap;display:flex}.bannerAction{padding:var(--space-2) var(--space-3);font-size:var(--font-size-md)}.color-red{--event-color:var(--color-red)}.color-blue{--event-color:var(--color-blue)}.color-green{--event-color:var(--color-green)}.color-yellow{--event-color:var(--color-yellow);--event-text:var(--color-on-yellow)}.visuallyHidden{clip:rect(0 0 0 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.textCenter{text-align:center}.surface{background-color:var(--color-surface);border-radius:var(--radius-md);box-shadow:var(--shadow)}";
|
|
@@ -16220,47 +16400,145 @@ var readLinkedPath = (param) => {
|
|
|
16220
16400
|
return path?.startsWith("/") && !path.startsWith("//") ? path : void 0;
|
|
16221
16401
|
};
|
|
16222
16402
|
|
|
16403
|
+
// src/lib/configFile.ts
|
|
16404
|
+
var YAML_PATH = /\.ya?ml$/i;
|
|
16405
|
+
var JSON_PATH = /\.jsonc?$/i;
|
|
16406
|
+
var JSON_TOKEN = /"(?:\\.|[^"\\])*"|\/\/[^\n]*|\/\*[\s\S]*?\*\//g;
|
|
16407
|
+
var getConfigFormat = (url, contentType) => {
|
|
16408
|
+
const path = url.split(/[?#]/)[0];
|
|
16409
|
+
if (YAML_PATH.test(path)) return "yaml";
|
|
16410
|
+
if (JSON_PATH.test(path)) return "json";
|
|
16411
|
+
return contentType?.toLowerCase().includes("json") ? "json" : "yaml";
|
|
16412
|
+
};
|
|
16413
|
+
var stripJsonComments = (source) => source.replace(JSON_TOKEN, (token) => token.startsWith("\"") ? token : "");
|
|
16414
|
+
async function parseConfigText(source, format) {
|
|
16415
|
+
const value = format === "json" ? JSON.parse(stripJsonComments(source)) : (await import("yaml")).parse(source);
|
|
16416
|
+
return parseCalendarOptions(value);
|
|
16417
|
+
}
|
|
16418
|
+
async function loadConfigFile(url, signal) {
|
|
16419
|
+
const response = await fetch(url, {
|
|
16420
|
+
signal,
|
|
16421
|
+
headers: { Accept: "application/json, application/yaml, text/yaml, */*" }
|
|
16422
|
+
});
|
|
16423
|
+
if (!response.ok) throw new Error(`The configuration file answered with status ${response.status}.`);
|
|
16424
|
+
return parseConfigText(await response.text(), getConfigFormat(url, response.headers.get("content-type")));
|
|
16425
|
+
}
|
|
16426
|
+
|
|
16427
|
+
// src/lib/useCalendarOptions.ts
|
|
16428
|
+
var NO_OPTIONS = {};
|
|
16429
|
+
var PREFIX = "[calendar]";
|
|
16430
|
+
var report = (source, { issues }) => {
|
|
16431
|
+
if (issues.length > 0) console.warn(`${PREFIX} Configuration ${source}:\n- ${issues.join("\n- ")}`);
|
|
16432
|
+
};
|
|
16433
|
+
function useCalendarOptions(config) {
|
|
16434
|
+
const url = typeof config === "string" ? config : null;
|
|
16435
|
+
const inlineKey = config && typeof config === "object" ? JSON.stringify(config) : null;
|
|
16436
|
+
const [loaded, setLoaded] = useState(null);
|
|
16437
|
+
const inline = useMemo(() => {
|
|
16438
|
+
if (inlineKey === null) return NO_OPTIONS;
|
|
16439
|
+
const parsed = parseCalendarOptions(JSON.parse(inlineKey));
|
|
16440
|
+
report("object", parsed);
|
|
16441
|
+
return parsed.options;
|
|
16442
|
+
}, [inlineKey]);
|
|
16443
|
+
useEffect(() => {
|
|
16444
|
+
if (url === null) return;
|
|
16445
|
+
const controller = new AbortController();
|
|
16446
|
+
loadConfigFile(url, controller.signal).then((parsed) => {
|
|
16447
|
+
report(url, parsed);
|
|
16448
|
+
setLoaded({
|
|
16449
|
+
url,
|
|
16450
|
+
options: parsed.options
|
|
16451
|
+
});
|
|
16452
|
+
}).catch((error) => {
|
|
16453
|
+
if (controller.signal.aborted) return;
|
|
16454
|
+
console.error(`${PREFIX} Could not load the configuration from ${url}.`, error);
|
|
16455
|
+
setLoaded({
|
|
16456
|
+
url,
|
|
16457
|
+
options: null
|
|
16458
|
+
});
|
|
16459
|
+
});
|
|
16460
|
+
return () => controller.abort();
|
|
16461
|
+
}, [url]);
|
|
16462
|
+
return useMemo(() => {
|
|
16463
|
+
if (url === null) return {
|
|
16464
|
+
status: "ready",
|
|
16465
|
+
options: inline
|
|
16466
|
+
};
|
|
16467
|
+
if (loaded?.url !== url) return { status: "loading" };
|
|
16468
|
+
return loaded.options ? {
|
|
16469
|
+
status: "ready",
|
|
16470
|
+
options: loaded.options
|
|
16471
|
+
} : { status: "error" };
|
|
16472
|
+
}, [
|
|
16473
|
+
url,
|
|
16474
|
+
inline,
|
|
16475
|
+
loaded
|
|
16476
|
+
]);
|
|
16477
|
+
}
|
|
16478
|
+
|
|
16223
16479
|
// src/lib/CalendarWidget.tsx
|
|
16224
|
-
function
|
|
16225
|
-
const
|
|
16226
|
-
|
|
16227
|
-
|
|
16228
|
-
|
|
16229
|
-
|
|
16230
|
-
|
|
16231
|
-
|
|
16232
|
-
|
|
16233
|
-
|
|
16234
|
-
|
|
16235
|
-
|
|
16236
|
-
|
|
16237
|
-
|
|
16238
|
-
|
|
16239
|
-
|
|
16480
|
+
function ConfigStatus({ failed }) {
|
|
16481
|
+
const { m } = useI18n();
|
|
16482
|
+
return /* @__PURE__ */ jsx("p", {
|
|
16483
|
+
className: "appLoading",
|
|
16484
|
+
role: failed ? "alert" : "status",
|
|
16485
|
+
children: failed ? m.common.configError : m.common.loading
|
|
16486
|
+
});
|
|
16487
|
+
}
|
|
16488
|
+
function ConfiguredCalendar({ options, dataSource: providedDataSource, getUserToken, onEventCreate, onEventUpdate, onEventDelete }) {
|
|
16489
|
+
const { tenant, storageMode = DEFAULT_CONFIG.storageMode, apiBaseUrl = DEFAULT_CONFIG.apiBaseUrl, apiTimeoutMs = DEFAULT_CONFIG.apiTimeoutMs, routing = "memory", basename, initialPath, linkParam = DEFAULT_LINK_PARAM, theme, initialView, timeZone, holidays, holidaySource, mapUrl } = options;
|
|
16490
|
+
const featureKey = JSON.stringify(options.features ?? {});
|
|
16491
|
+
const features = useMemo(() => resolveFeatures(JSON.parse(featureKey)), [featureKey]);
|
|
16492
|
+
const viewKey = options.views?.join() ?? "";
|
|
16493
|
+
const views = useMemo(() => resolveViews(viewKey ? viewKey.split(",") : void 0), [viewKey]);
|
|
16494
|
+
const { auth, chat } = features;
|
|
16495
|
+
const holidayBackend = features.holidays ? holidaySource : "library";
|
|
16496
|
+
const dataSource = useMemo(() => {
|
|
16497
|
+
if (providedDataSource) return providedDataSource;
|
|
16498
|
+
const rest = {
|
|
16499
|
+
baseUrl: apiBaseUrl,
|
|
16500
|
+
timeoutMs: apiTimeoutMs,
|
|
16501
|
+
getUserToken,
|
|
16502
|
+
holidaySource: holidayBackend,
|
|
16503
|
+
chat
|
|
16504
|
+
};
|
|
16505
|
+
if (tenant) return tenantDataSource({
|
|
16506
|
+
...rest,
|
|
16507
|
+
tenant
|
|
16508
|
+
});
|
|
16509
|
+
return auth || storageMode === "remote" ? restDataSource({
|
|
16510
|
+
...rest,
|
|
16511
|
+
auth
|
|
16512
|
+
}) : localDataSource();
|
|
16513
|
+
}, [
|
|
16240
16514
|
providedDataSource,
|
|
16241
16515
|
tenant,
|
|
16242
16516
|
getUserToken,
|
|
16243
16517
|
auth,
|
|
16518
|
+
chat,
|
|
16244
16519
|
storageMode,
|
|
16245
16520
|
apiBaseUrl,
|
|
16246
16521
|
apiTimeoutMs,
|
|
16247
|
-
|
|
16522
|
+
holidayBackend
|
|
16248
16523
|
]);
|
|
16249
16524
|
const viewerTimeZone = timeZone && isTimeZone(timeZone) ? timeZone : void 0;
|
|
16250
16525
|
const holidayRegion = holidays?.trim().toUpperCase();
|
|
16251
16526
|
const hostHolidays = holidays?.trim().toLowerCase() === "off" ? "off" : isHolidayRegion(holidayRegion) ? holidayRegion : void 0;
|
|
16252
16527
|
const hostMapUrl = isMapUrlTemplate(mapUrl) ? mapUrl : void 0;
|
|
16528
|
+
const hostView = initialView && views.includes(initialView) ? initialView : void 0;
|
|
16253
16529
|
const host = useMemo(() => ({
|
|
16254
|
-
|
|
16530
|
+
features,
|
|
16531
|
+
views,
|
|
16255
16532
|
theme,
|
|
16256
|
-
initialView,
|
|
16533
|
+
initialView: hostView,
|
|
16257
16534
|
timeZone: viewerTimeZone,
|
|
16258
16535
|
holidays: hostHolidays,
|
|
16259
16536
|
mapUrl: hostMapUrl
|
|
16260
16537
|
}), [
|
|
16261
|
-
|
|
16538
|
+
features,
|
|
16539
|
+
views,
|
|
16262
16540
|
theme,
|
|
16263
|
-
|
|
16541
|
+
hostView,
|
|
16264
16542
|
viewerTimeZone,
|
|
16265
16543
|
hostHolidays,
|
|
16266
16544
|
hostMapUrl
|
|
@@ -16278,40 +16556,59 @@ function CalendarWidget({ dataSource: providedDataSource, tenant, getUserToken,
|
|
|
16278
16556
|
onEventDelete
|
|
16279
16557
|
]);
|
|
16280
16558
|
const startPath = initialPath ?? (routing === "memory" && linkParam ? readLinkedPath(linkParam) : void 0);
|
|
16559
|
+
return /* @__PURE__ */ jsx(HostContext, {
|
|
16560
|
+
value: host,
|
|
16561
|
+
children: /* @__PURE__ */ jsx(CalendarApp, {
|
|
16562
|
+
dataSource,
|
|
16563
|
+
eventCallbacks: callbacks,
|
|
16564
|
+
routing,
|
|
16565
|
+
basename,
|
|
16566
|
+
initialPath: startPath
|
|
16567
|
+
})
|
|
16568
|
+
});
|
|
16569
|
+
}
|
|
16570
|
+
function CalendarWidget({ config, dataSource, getUserToken, onEventCreate, onEventUpdate, onEventDelete, className, style, ...direct }) {
|
|
16571
|
+
const state = useCalendarOptions(config);
|
|
16572
|
+
const options = state.status === "ready" ? mergeCalendarOptions(state.options, direct) : direct;
|
|
16573
|
+
const routing = options.routing ?? "memory";
|
|
16281
16574
|
return /* @__PURE__ */ jsx(IsolatedRoot, {
|
|
16282
16575
|
className,
|
|
16283
16576
|
style,
|
|
16284
16577
|
autoFocus: routing === "browser",
|
|
16285
|
-
children: /* @__PURE__ */ jsx(
|
|
16286
|
-
|
|
16287
|
-
|
|
16288
|
-
|
|
16289
|
-
|
|
16290
|
-
|
|
16291
|
-
|
|
16292
|
-
|
|
16293
|
-
|
|
16294
|
-
|
|
16295
|
-
|
|
16296
|
-
})
|
|
16297
|
-
})
|
|
16578
|
+
children: /* @__PURE__ */ jsx(I18nProvider, {
|
|
16579
|
+
locale: options.locale,
|
|
16580
|
+
messages: options.messages,
|
|
16581
|
+
children: state.status === "ready" ? /* @__PURE__ */ jsx(ConfiguredCalendar, {
|
|
16582
|
+
options,
|
|
16583
|
+
dataSource,
|
|
16584
|
+
getUserToken,
|
|
16585
|
+
onEventCreate,
|
|
16586
|
+
onEventUpdate,
|
|
16587
|
+
onEventDelete
|
|
16588
|
+
}) : /* @__PURE__ */ jsx(ConfigStatus, { failed: state.status === "error" })
|
|
16298
16589
|
})
|
|
16299
16590
|
});
|
|
16300
16591
|
}
|
|
16301
16592
|
|
|
16302
16593
|
// src/lib/version.ts
|
|
16303
|
-
var VERSION = "1.2.
|
|
16594
|
+
var VERSION = "1.2.1";
|
|
16304
16595
|
|
|
16305
16596
|
// src/lib/element.tsx
|
|
16306
16597
|
var DEFAULT_ELEMENT_NAME = "calendar-widget";
|
|
16307
16598
|
var FILL = { height: "100%" };
|
|
16308
|
-
var
|
|
16599
|
+
var toFeatureAttribute = (feature) => `feature-${feature.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)}`;
|
|
16600
|
+
var FEATURE_ALIASES = {
|
|
16601
|
+
auth: "auth",
|
|
16602
|
+
teams: "teams"
|
|
16603
|
+
};
|
|
16309
16604
|
var ATTRIBUTES = [
|
|
16605
|
+
"config",
|
|
16310
16606
|
"storage-mode",
|
|
16311
16607
|
"api-base-url",
|
|
16312
16608
|
"api-timeout-ms",
|
|
16313
16609
|
"auth",
|
|
16314
16610
|
"teams",
|
|
16611
|
+
"views",
|
|
16315
16612
|
"initial-path",
|
|
16316
16613
|
"locale",
|
|
16317
16614
|
"tenant",
|
|
@@ -16321,7 +16618,8 @@ var ATTRIBUTES = [
|
|
|
16321
16618
|
"time-zone",
|
|
16322
16619
|
"holidays",
|
|
16323
16620
|
"holiday-source",
|
|
16324
|
-
"map-url"
|
|
16621
|
+
"map-url",
|
|
16622
|
+
...FEATURE_NAMES.map(toFeatureAttribute)
|
|
16325
16623
|
];
|
|
16326
16624
|
var CalendarElement = class extends HTMLElement {
|
|
16327
16625
|
static observedAttributes = ATTRIBUTES;
|
|
@@ -16330,6 +16628,7 @@ var CalendarElement = class extends HTMLElement {
|
|
|
16330
16628
|
#dataSource;
|
|
16331
16629
|
#getUserToken;
|
|
16332
16630
|
#messages;
|
|
16631
|
+
#config;
|
|
16333
16632
|
get dataSource() {
|
|
16334
16633
|
return this.#dataSource;
|
|
16335
16634
|
}
|
|
@@ -16351,7 +16650,15 @@ var CalendarElement = class extends HTMLElement {
|
|
|
16351
16650
|
this.#messages = value;
|
|
16352
16651
|
if (this.#root) this.#render();
|
|
16353
16652
|
}
|
|
16653
|
+
get config() {
|
|
16654
|
+
return this.#config ?? this.getAttribute("config") ?? void 0;
|
|
16655
|
+
}
|
|
16656
|
+
set config(value) {
|
|
16657
|
+
this.#config = value;
|
|
16658
|
+
if (this.#root) this.#render();
|
|
16659
|
+
}
|
|
16354
16660
|
connectedCallback() {
|
|
16661
|
+
this.#adoptEarlyProperty("config");
|
|
16355
16662
|
this.#adoptEarlyProperty("dataSource");
|
|
16356
16663
|
this.#adoptEarlyProperty("getUserToken");
|
|
16357
16664
|
this.#adoptEarlyProperty("messages");
|
|
@@ -16373,9 +16680,18 @@ var CalendarElement = class extends HTMLElement {
|
|
|
16373
16680
|
attributeChangedCallback() {
|
|
16374
16681
|
if (this.#root) this.#render();
|
|
16375
16682
|
}
|
|
16376
|
-
#
|
|
16377
|
-
const
|
|
16378
|
-
|
|
16683
|
+
#features() {
|
|
16684
|
+
const features = {};
|
|
16685
|
+
for (const feature of FEATURE_NAMES) {
|
|
16686
|
+
const alias = FEATURE_ALIASES[feature];
|
|
16687
|
+
const value = this.getAttribute(toFeatureAttribute(feature)) ?? (alias ? this.getAttribute(alias) : null);
|
|
16688
|
+
if (value !== null) features[feature] = value !== "false";
|
|
16689
|
+
}
|
|
16690
|
+
return features;
|
|
16691
|
+
}
|
|
16692
|
+
#views() {
|
|
16693
|
+
const views = (this.getAttribute("views") ?? "").split(/[\s,]+/).filter(isCalendarView);
|
|
16694
|
+
return views.length > 0 ? views : void 0;
|
|
16379
16695
|
}
|
|
16380
16696
|
#emit(type, detail) {
|
|
16381
16697
|
this.dispatchEvent(new CustomEvent(type, {
|
|
@@ -16398,14 +16714,13 @@ var CalendarElement = class extends HTMLElement {
|
|
|
16398
16714
|
storageMode: isOneOf(STORAGE_MODES, storageMode) ? storageMode : void 0,
|
|
16399
16715
|
apiBaseUrl: this.getAttribute("api-base-url") ?? void 0,
|
|
16400
16716
|
apiTimeoutMs: Number.isInteger(timeout) && timeout > 0 ? timeout : void 0,
|
|
16401
|
-
|
|
16402
|
-
|
|
16403
|
-
|
|
16404
|
-
},
|
|
16717
|
+
config: this.config,
|
|
16718
|
+
features: this.#features(),
|
|
16719
|
+
views: this.#views(),
|
|
16405
16720
|
initialPath: this.getAttribute("initial-path") ?? void 0,
|
|
16406
16721
|
locale: this.getAttribute("locale") ?? void 0,
|
|
16407
16722
|
tenant: this.getAttribute("tenant") ?? void 0,
|
|
16408
|
-
theme: isOneOf(
|
|
16723
|
+
theme: isOneOf(HOST_THEMES, theme) ? theme : void 0,
|
|
16409
16724
|
initialView: isCalendarView(initialView) ? initialView : void 0,
|
|
16410
16725
|
timeZone: this.getAttribute("time-zone") ?? void 0,
|
|
16411
16726
|
holidays: this.getAttribute("holidays") ?? void 0,
|
|
@@ -16432,5 +16747,5 @@ function defineCalendarElement(name = DEFAULT_ELEMENT_NAME) {
|
|
|
16432
16747
|
if (!customElements.get(name)) customElements.define(name, class extends CalendarElement {});
|
|
16433
16748
|
}
|
|
16434
16749
|
|
|
16435
|
-
export { CalendarWidget as Calendar, CalendarElement, DEFAULT_ELEMENT_NAME, TENANT_HEADER, VERSION, defineCalendarElement, localDataSource, restDataSource, tenantDataSource };
|
|
16750
|
+
export { CalendarWidget as Calendar, CalendarElement, DEFAULT_ELEMENT_NAME, DEFAULT_FEATURES, FEATURE_NAMES, TENANT_HEADER, VERSION, defineCalendarElement, localDataSource, parseCalendarOptions, restDataSource, tenantDataSource };
|
|
16436
16751
|
//# sourceMappingURL=index.js.map
|