@burdenoff/microfe-calendar 2026.704.4 → 2026.706.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/dist/components/AgendaView.js +2 -2
- package/dist/components/AgendaView.js.map +1 -1
- package/dist/components/CalendarErrorState.js +1 -1
- package/dist/components/CalendarErrorState.js.map +1 -1
- package/dist/components/ConfirmDialog.js +1 -1
- package/dist/components/ConfirmDialog.js.map +1 -1
- package/dist/components/TaskEventDetail.js +1 -1
- package/dist/components/TaskEventDetail.js.map +1 -1
- package/dist/components/ViewSwitcher.js +2 -2
- package/dist/components/ViewSwitcher.js.map +1 -1
- package/dist/pages/CalendarPage.js +11 -11
- package/dist/pages/CalendarPage.js.map +1 -1
- package/dist/pages/EventDetailsPage.js +26 -26
- package/dist/pages/EventDetailsPage.js.map +1 -1
- package/dist/pages/ResourcesPage.js +11 -11
- package/dist/pages/ResourcesPage.js.map +1 -1
- package/dist/pages/SettingsPage.js +4 -4
- package/dist/pages/SettingsPage.js.map +1 -1
- package/dist/pages/SubscriptionsPage.js +6 -6
- package/dist/pages/SubscriptionsPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -21,8 +21,8 @@ function h() {
|
|
|
21
21
|
}, []);
|
|
22
22
|
let T = /* @__PURE__ */ new Map();
|
|
23
23
|
y.sort((e, t) => e.startTime.getTime() - t.startTime.getTime()).forEach((e) => {
|
|
24
|
-
let t = e.startTime.
|
|
25
|
-
|
|
24
|
+
let t = e.startTime, n = `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, "0")}-${String(t.getDate()).padStart(2, "0")}`, r = T.get(n) ?? [];
|
|
25
|
+
r.push(e), T.set(n, r);
|
|
26
26
|
});
|
|
27
27
|
let E = Array.from(T.entries());
|
|
28
28
|
return /* @__PURE__ */ d("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgendaView.js","names":[],"sources":["../../src/components/AgendaView.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { GlassCard, IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport { useCalendarStore } from '../store/calendarStore';\nimport { addDays, formatTime, isSameDay, startOfDay } from '../utils/dateHelpers';\nimport { useEvents } from '../hooks/useEvents';\nimport { EventBlock } from './EventBlock';\nimport { CalendarErrorState } from './CalendarErrorState';\nimport type { CalendarEvent } from '../types';\n\n/**\n * Agenda view component\n * Shows upcoming events in a chronological list format grouped by date\n */\nexport function AgendaView() {\n const currentDate = useCalendarStore((state) => state.currentDate);\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const value = t(key);\n return value === key ? fallback : value;\n };\n\n // Show 30 days of upcoming events\n const rangeStart = startOfDay(currentDate);\n const rangeEnd = addDays(rangeStart, 30);\n const { events, isLoading, error, refetch } = useEvents({\n startDate: rangeStart,\n endDate: rangeEnd,\n });\n const [now, setNow] = useState<Date | null>(null);\n useEffect(() => {\n void Promise.resolve().then(() => setNow(new Date()));\n }, []);\n\n // Group events by date\n const groupedEvents: Map<string, CalendarEvent[]> = new Map();\n events\n .sort((a, b) => a.startTime.getTime() - b.startTime.getTime())\n .forEach((event) => {\n const
|
|
1
|
+
{"version":3,"file":"AgendaView.js","names":[],"sources":["../../src/components/AgendaView.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { GlassCard, IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport { useCalendarStore } from '../store/calendarStore';\nimport { addDays, formatTime, isSameDay, startOfDay } from '../utils/dateHelpers';\nimport { useEvents } from '../hooks/useEvents';\nimport { EventBlock } from './EventBlock';\nimport { CalendarErrorState } from './CalendarErrorState';\nimport type { CalendarEvent } from '../types';\n\n/**\n * Agenda view component\n * Shows upcoming events in a chronological list format grouped by date\n */\nexport function AgendaView() {\n const currentDate = useCalendarStore((state) => state.currentDate);\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const value = t(key);\n return value === key ? fallback : value;\n };\n\n // Show 30 days of upcoming events\n const rangeStart = startOfDay(currentDate);\n const rangeEnd = addDays(rangeStart, 30);\n const { events, isLoading, error, refetch } = useEvents({\n startDate: rangeStart,\n endDate: rangeEnd,\n });\n const [now, setNow] = useState<Date | null>(null);\n useEffect(() => {\n void Promise.resolve().then(() => setNow(new Date()));\n }, []);\n\n // Group events by date\n const groupedEvents: Map<string, CalendarEvent[]> = new Map();\n events\n .sort((a, b) => a.startTime.getTime() - b.startTime.getTime())\n .forEach((event) => {\n // Key by the LOCAL calendar day (every other view buckets via isSameDay,\n // which is local). Using toISOString() here keyed by UTC, so an all-day\n // overlay task at local midnight landed a day early east of UTC (e.g. IST).\n const d = event.startTime;\n const dateKey = `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(\n d.getDate(),\n ).padStart(2, '0')}`;\n const existing = groupedEvents.get(dateKey) ?? [];\n existing.push(event);\n groupedEvents.set(dateKey, existing);\n });\n\n const dateGroups = Array.from(groupedEvents.entries());\n\n return (\n <div className=\"@container\">\n <div className=\"max-w-3xl mx-auto\">\n {error && <CalendarErrorState message={error} onRetry={() => void refetch()} />}\n\n {/* Loading indicator */}\n {isLoading && (\n <div className=\"text-center py-2 text-text-tertiary font-text-xs mb-2\">\n {tr('calendar.loadingEvents', 'Loading events...')}\n </div>\n )}\n\n {dateGroups.length === 0 && !isLoading && (\n <GlassCard treatment=\"plain\" className=\"p-card-padding\">\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title={tr('calendar.noUpcomingEvents', 'No upcoming events in the next 30 days')}\n />\n </GlassCard>\n )}\n\n <div className=\"space-y-4\">\n {dateGroups.map(([dateKey, dayEvents]) => {\n const date = new Date(dateKey + 'T00:00:00');\n const today = now !== null && isSameDay(date, now);\n\n return (\n <GlassCard\n key={dateKey}\n treatment={today ? 'insight' : 'metric'}\n glow={today}\n className=\"overflow-hidden\"\n >\n {/* Date header */}\n <div\n className={`px-4 py-2 border-b border-border-seam ${today ? 'bg-accent-wash' : 'bg-bg-elevated'}`}\n >\n <h3\n className={`flex items-center gap-2 font-text-sm font-weight-semibold ${today ? 'text-action-primary-bg' : 'text-text-primary'}`}\n >\n {today && (\n <span\n aria-hidden=\"true\"\n className=\"size-2 rounded-full bg-action-primary-bg motion-safe:animate-vc-glow-pulse\"\n />\n )}\n {today ? `${tr('calendar.today', 'Today')} - ` : ''}\n {date.toLocaleDateString('en-US', {\n weekday: 'long',\n month: 'long',\n day: 'numeric',\n })}\n </h3>\n </div>\n\n {/* Events list */}\n <div className=\"divide-y divide-border-subtle\">\n {dayEvents.map((event) => (\n <div\n key={event.id}\n className=\"px-4 py-3 hover:bg-bg-elevated transition-colors\"\n >\n <div className=\"flex items-start gap-3\">\n {/* Time */}\n <div className=\"w-20 shrink-0\">\n {event.isAllDay ? (\n <span className=\"font-text-xs text-text-tertiary\">\n {tr('calendar.allDay', 'All day')}\n </span>\n ) : (\n <div>\n <span className=\"font-text-sm font-weight-medium text-text-primary\">\n {formatTime(event.startTime)}\n </span>\n <br />\n <span className=\"font-text-xs text-text-tertiary\">\n {formatTime(event.endTime)}\n </span>\n </div>\n )}\n </div>\n\n {/* Event details */}\n <div className=\"flex-1 min-w-0\">\n <EventBlock event={event} />\n {event.location && (\n <p className=\"mt-1 font-text-xs text-text-tertiary truncate\">\n {event.location}\n </p>\n )}\n {event.description && (\n <p className=\"mt-1 font-text-xs text-text-tertiary line-clamp-2\">\n {event.description}\n </p>\n )}\n </div>\n </div>\n </div>\n ))}\n </div>\n </GlassCard>\n );\n })}\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAcA,SAAgB,IAAa;CAC3B,IAAM,IAAc,GAAkB,MAAU,EAAM,YAAY,EAC5D,EAAE,SAAM,GAAS,EACjB,KAAM,GAAa,MAA6B;EACpD,IAAM,IAAQ,EAAE,EAAI;AACpB,SAAO,MAAU,IAA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7 +27,7 @@ function i({ message: i, onRetry: a }) {
|
|
|
27
27
|
a && /* @__PURE__ */ n("button", {
|
|
28
28
|
type: "button",
|
|
29
29
|
onClick: a,
|
|
30
|
-
className: "shrink-0 inline-flex items-center rounded-radius-md border border-border-default bg-bg-surface px-
|
|
30
|
+
className: "shrink-0 inline-flex items-center rounded-radius-md border border-border-default bg-bg-surface px-3 py-2 font-text-sm font-weight-medium text-text-primary transition-colors hover:bg-bg-elevated",
|
|
31
31
|
children: s("calendar.retry", "Try again")
|
|
32
32
|
})
|
|
33
33
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarErrorState.js","names":[],"sources":["../../src/components/CalendarErrorState.tsx"],"sourcesContent":["/**\n * CalendarErrorState — inline error banner for failed event loads.\n *\n * The grid/list views previously read only { events, isLoading } from\n * useEvents and ignored `error`, so a failed fetch rendered as a silent empty\n * calendar. This banner surfaces the failure with a retry, using semantic\n * status tokens (no raw colours).\n */\n\nimport { AlertTriangle } from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\n\ninterface CalendarErrorStateProps {\n message: string;\n onRetry?: () => void;\n}\n\nexport function CalendarErrorState({ message, onRetry }: CalendarErrorStateProps) {\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const value = t(key);\n return value === key ? fallback : value;\n };\n\n return (\n <div\n role=\"alert\"\n className=\"mb-3 rounded-radius-lg border border-status-error-border bg-status-error-bg-subtle p-card-padding\"\n >\n <div className=\"flex items-start gap-3\">\n <AlertTriangle className=\"size-5 shrink-0 text-status-error-text\" />\n <div className=\"min-w-0 flex-1\">\n <p className=\"font-text-sm font-weight-semibold text-text-primary\">\n {tr('calendar.eventsLoadError', \"Couldn't load events\")}\n </p>\n <p className=\"mt-1 break-words font-text-xs text-text-secondary\">{message}</p>\n </div>\n {onRetry && (\n <button\n type=\"button\"\n onClick={onRetry}\n className=\"shrink-0 inline-flex items-center rounded-radius-md border border-border-default bg-bg-surface px-
|
|
1
|
+
{"version":3,"file":"CalendarErrorState.js","names":[],"sources":["../../src/components/CalendarErrorState.tsx"],"sourcesContent":["/**\n * CalendarErrorState — inline error banner for failed event loads.\n *\n * The grid/list views previously read only { events, isLoading } from\n * useEvents and ignored `error`, so a failed fetch rendered as a silent empty\n * calendar. This banner surfaces the failure with a retry, using semantic\n * status tokens (no raw colours).\n */\n\nimport { AlertTriangle } from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\n\ninterface CalendarErrorStateProps {\n message: string;\n onRetry?: () => void;\n}\n\nexport function CalendarErrorState({ message, onRetry }: CalendarErrorStateProps) {\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const value = t(key);\n return value === key ? fallback : value;\n };\n\n return (\n <div\n role=\"alert\"\n className=\"mb-3 rounded-radius-lg border border-status-error-border bg-status-error-bg-subtle p-card-padding\"\n >\n <div className=\"flex items-start gap-3\">\n <AlertTriangle className=\"size-5 shrink-0 text-status-error-text\" />\n <div className=\"min-w-0 flex-1\">\n <p className=\"font-text-sm font-weight-semibold text-text-primary\">\n {tr('calendar.eventsLoadError', \"Couldn't load events\")}\n </p>\n <p className=\"mt-1 break-words font-text-xs text-text-secondary\">{message}</p>\n </div>\n {onRetry && (\n <button\n type=\"button\"\n onClick={onRetry}\n className=\"shrink-0 inline-flex items-center rounded-radius-md border border-border-default bg-bg-surface px-3 py-2 font-text-sm font-weight-medium text-text-primary transition-colors hover:bg-bg-elevated\"\n >\n {tr('calendar.retry', 'Try again')}\n </button>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;AAiBA,SAAgB,EAAmB,EAAE,YAAS,cAAoC;CAChF,IAAM,EAAE,SAAM,GAAS,EACjB,KAAM,GAAa,MAA6B;EACpD,IAAM,IAAQ,EAAE,EAAI;AACpB,SAAO,MAAU,IAAM,IAAW;;AAGpC,QACE,kBAAC,OAAD;EACE,MAAK;EACL,WAAU;YAEV,kBAAC,OAAD;GAAK,WAAU;aAAf;IACE,kBAAC,GAAD,EAAe,WAAU,0CAA2C,CAAA;IACpE,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,KAAD;MAAG,WAAU;gBACV,EAAG,4BAA4B,uBAAuB;MACrD,CAAA,EACJ,kBAAC,KAAD;MAAG,WAAU;gBAAqD;MAAY,CAAA,CAC1E;;IACL,KACC,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,WAAU;eAET,EAAG,kBAAkB,YAAY;KAC3B,CAAA;IAEP;;EACF,CAAA"}
|
|
@@ -36,7 +36,7 @@ var s = ({ open: s, title: c, message: l, confirmLabel: u = "Confirm", cancelLab
|
|
|
36
36
|
className: "flex items-start gap-4",
|
|
37
37
|
children: [
|
|
38
38
|
/* @__PURE__ */ a("div", {
|
|
39
|
-
className: `size-10 rounded-full bg-bg-
|
|
39
|
+
className: `size-10 rounded-full bg-bg-elevated flex items-center justify-center shrink-0 ${y.icon}`,
|
|
40
40
|
children: /* @__PURE__ */ a(r, { className: "size-5" })
|
|
41
41
|
}),
|
|
42
42
|
/* @__PURE__ */ o("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmDialog.js","names":[],"sources":["../../src/components/ConfirmDialog.tsx"],"sourcesContent":["/**\n * ConfirmDialog - Reusable confirmation dialog for destructive actions\n */\n\nimport { useEffect, useRef, type FC } from 'react';\nimport { AlertTriangle, X } from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\n\ninterface ConfirmDialogProps {\n open: boolean;\n title: string;\n message: string;\n confirmLabel?: string;\n cancelLabel?: string;\n variant?: 'danger' | 'warning' | 'info';\n loading?: boolean;\n onConfirm: () => void;\n onCancel: () => void;\n}\n\nexport const ConfirmDialog: FC<ConfirmDialogProps> = ({\n open,\n title,\n message,\n confirmLabel = 'Confirm',\n cancelLabel = 'Cancel',\n variant = 'danger',\n loading = false,\n onConfirm,\n onCancel,\n}) => {\n const dialogRef = useRef<HTMLDialogElement>(null);\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const value = t(key);\n return value === key ? fallback : value;\n };\n\n useEffect(() => {\n const dialog = dialogRef.current;\n if (!dialog) return;\n\n if (open && !dialog.open) {\n dialog.showModal();\n } else if (!open && dialog.open) {\n dialog.close();\n }\n }, [open]);\n\n if (!open) return null;\n\n const variantStyles = {\n danger: {\n icon: 'text-red-500',\n button: 'bg-red-600 hover:bg-red-700 text-white',\n },\n warning: {\n icon: 'text-amber-500',\n button: 'bg-amber-600 hover:bg-amber-700 text-white',\n },\n info: {\n icon: 'text-blue-500',\n button: 'bg-blue-600 hover:bg-blue-700 text-white',\n },\n };\n\n const styles = variantStyles[variant];\n\n return (\n <dialog\n ref={dialogRef}\n className=\"fixed inset-0 z-50 m-auto rounded-radius-lg border border-border-default bg-bg-surface shadow-lg backdrop:bg-black/50 max-w-md w-full p-0\"\n onClose={onCancel}\n >\n <div className=\"p-6\">\n {/* Header */}\n <div className=\"flex items-start gap-4\">\n <div\n className={`size-10 rounded-full bg-bg-
|
|
1
|
+
{"version":3,"file":"ConfirmDialog.js","names":[],"sources":["../../src/components/ConfirmDialog.tsx"],"sourcesContent":["/**\n * ConfirmDialog - Reusable confirmation dialog for destructive actions\n */\n\nimport { useEffect, useRef, type FC } from 'react';\nimport { AlertTriangle, X } from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\n\ninterface ConfirmDialogProps {\n open: boolean;\n title: string;\n message: string;\n confirmLabel?: string;\n cancelLabel?: string;\n variant?: 'danger' | 'warning' | 'info';\n loading?: boolean;\n onConfirm: () => void;\n onCancel: () => void;\n}\n\nexport const ConfirmDialog: FC<ConfirmDialogProps> = ({\n open,\n title,\n message,\n confirmLabel = 'Confirm',\n cancelLabel = 'Cancel',\n variant = 'danger',\n loading = false,\n onConfirm,\n onCancel,\n}) => {\n const dialogRef = useRef<HTMLDialogElement>(null);\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const value = t(key);\n return value === key ? fallback : value;\n };\n\n useEffect(() => {\n const dialog = dialogRef.current;\n if (!dialog) return;\n\n if (open && !dialog.open) {\n dialog.showModal();\n } else if (!open && dialog.open) {\n dialog.close();\n }\n }, [open]);\n\n if (!open) return null;\n\n const variantStyles = {\n danger: {\n icon: 'text-red-500',\n button: 'bg-red-600 hover:bg-red-700 text-white',\n },\n warning: {\n icon: 'text-amber-500',\n button: 'bg-amber-600 hover:bg-amber-700 text-white',\n },\n info: {\n icon: 'text-blue-500',\n button: 'bg-blue-600 hover:bg-blue-700 text-white',\n },\n };\n\n const styles = variantStyles[variant];\n\n return (\n <dialog\n ref={dialogRef}\n className=\"fixed inset-0 z-50 m-auto rounded-radius-lg border border-border-default bg-bg-surface shadow-lg backdrop:bg-black/50 max-w-md w-full p-0\"\n onClose={onCancel}\n >\n <div className=\"p-6\">\n {/* Header */}\n <div className=\"flex items-start gap-4\">\n <div\n className={`size-10 rounded-full bg-bg-elevated flex items-center justify-center shrink-0 ${styles.icon}`}\n >\n <AlertTriangle className=\"size-5\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <h3 className=\"font-heading-sm text-text-primary\">{title}</h3>\n <p className=\"mt-2 font-text-sm text-text-secondary\">{message}</p>\n </div>\n <button\n type=\"button\"\n onClick={onCancel}\n className=\"size-8 inline-flex items-center justify-center rounded-radius-sm hover:bg-bg-elevated text-text-tertiary transition-colors shrink-0\"\n aria-label={tr('calendar.close', 'Close')}\n >\n <X className=\"size-4\" />\n </button>\n </div>\n\n {/* Actions */}\n <div className=\"mt-6 flex justify-end gap-3\">\n <button\n type=\"button\"\n onClick={onCancel}\n disabled={loading}\n className=\"px-4 py-2 rounded-radius-md border border-border-default bg-bg-surface hover:bg-bg-elevated font-text-sm font-weight-medium text-text-primary transition-colors disabled:opacity-50\"\n >\n {cancelLabel}\n </button>\n <button\n type=\"button\"\n onClick={onConfirm}\n disabled={loading}\n className={`px-4 py-2 rounded-radius-md font-text-sm font-weight-medium transition-colors disabled:opacity-50 ${styles.button}`}\n >\n {loading ? tr('calendar.processing', 'Processing...') : confirmLabel}\n </button>\n </div>\n </div>\n </dialog>\n );\n};\n"],"mappings":";;;;;AAoBA,IAAa,KAAyC,EACpD,SACA,UACA,YACA,kBAAe,WACf,iBAAc,UACd,aAAU,UACV,aAAU,IACV,cACA,kBACI;CACJ,IAAM,IAAY,EAA0B,KAAK,EAC3C,EAAE,SAAM,GAAS,EACjB,KAAM,GAAa,MAA6B;EACpD,IAAM,IAAQ,EAAE,EAAI;AACpB,SAAO,MAAU,IAAM,IAAW;;AAcpC,KAXA,QAAgB;EACd,IAAM,IAAS,EAAU;AACpB,QAED,KAAQ,CAAC,EAAO,OAClB,EAAO,WAAW,GACT,CAAC,KAAQ,EAAO,QACzB,EAAO,OAAO;IAEf,CAAC,EAAK,CAAC,EAEN,CAAC,EAAM,QAAO;CAiBlB,IAAM,IAfgB;EACpB,QAAQ;GACN,MAAM;GACN,QAAQ;GACT;EACD,SAAS;GACP,MAAM;GACN,QAAQ;GACT;EACD,MAAM;GACJ,MAAM;GACN,QAAQ;GACT;EACF,CAE4B;AAE7B,QACE,kBAAC,UAAD;EACE,KAAK;EACL,WAAU;EACV,SAAS;YAET,kBAAC,OAAD;GAAK,WAAU;aAAf,CAEE,kBAAC,OAAD;IAAK,WAAU;cAAf;KACE,kBAAC,OAAD;MACE,WAAW,iFAAiF,EAAO;gBAEnG,kBAAC,GAAD,EAAe,WAAU,UAAW,CAAA;MAChC,CAAA;KACN,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,MAAD;OAAI,WAAU;iBAAqC;OAAW,CAAA,EAC9D,kBAAC,KAAD;OAAG,WAAU;iBAAyC;OAAY,CAAA,CAC9D;;KACN,kBAAC,UAAD;MACE,MAAK;MACL,SAAS;MACT,WAAU;MACV,cAAY,EAAG,kBAAkB,QAAQ;gBAEzC,kBAAC,GAAD,EAAG,WAAU,UAAW,CAAA;MACjB,CAAA;KACL;OAGN,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,UAAU;KACV,WAAU;eAET;KACM,CAAA,EACT,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,UAAU;KACV,WAAW,qGAAqG,EAAO;eAEtH,IAAU,EAAG,uBAAuB,gBAAgB,GAAG;KACjD,CAAA,CACL;MACF;;EACC,CAAA"}
|
|
@@ -45,7 +45,7 @@ var p = () => {
|
|
|
45
45
|
className: "flex items-start gap-3",
|
|
46
46
|
children: [
|
|
47
47
|
/* @__PURE__ */ u("div", {
|
|
48
|
-
className: "flex size-9 shrink-0 items-center justify-center rounded-full bg-bg-
|
|
48
|
+
className: "flex size-9 shrink-0 items-center justify-center rounded-full bg-bg-elevated text-text-secondary",
|
|
49
49
|
children: u(x ? s : c, { className: "size-4" })
|
|
50
50
|
}),
|
|
51
51
|
/* @__PURE__ */ d("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskEventDetail.js","names":[],"sources":["../../src/components/TaskEventDetail.tsx"],"sourcesContent":["/**\n * TaskEventDetail — a read-only details modal for a PlanMagnet task / milestone\n * overlay event.\n *\n * The calendar VIEWS task info; it does not own or edit it. Clicking a\n * task/milestone opens this modal (title, due date, status, priority, assignee)\n * rendered entirely from the in-memory synthetic event — no calendar-svc fetch,\n * so a synthetic id never 404s. The \"Open in Tasks\" button deep-links to the\n * host's Tasks page (`event.deepLink` → `/…/tasks?item=<id>`) where the task can\n * actually be edited/managed. Flow: Calendar → Event Details → Open in PlanMagnet.\n */\n\nimport { useEffect, useRef, type FC } from 'react';\nimport { ExternalLink, Flag, ListChecks, X } from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { useCalendarStore } from '../store/calendarStore';\nimport { useCalendar } from '../providers/CalendarProvider';\nimport { formatDate } from '../utils/dateHelpers';\n\n/** Humanize an ENUM_VALUE → \"Enum Value\" for display. */\nfunction humanize(value: unknown): string | null {\n if (typeof value !== 'string' || !value) return null;\n return value\n .toLowerCase()\n .split('_')\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ');\n}\n\nexport const TaskEventDetail: FC = () => {\n const event = useCalendarStore((state) => state.taskDetailEvent);\n const closeTaskDetail = useCalendarStore((state) => state.closeTaskDetail);\n const { navigate } = useCalendar();\n const dialogRef = useRef<HTMLDialogElement>(null);\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const value = t(key);\n return value === key ? fallback : value;\n };\n\n const open = Boolean(event);\n\n useEffect(() => {\n const dialog = dialogRef.current;\n if (!dialog) return;\n if (open && !dialog.open) dialog.showModal();\n else if (!open && dialog.open) dialog.close();\n }, [open]);\n\n if (!event) return null;\n\n const metadata = (event.metadata ?? {}) as Record<string, unknown>;\n const isMilestone = event.sourceKind === 'milestone';\n const status = humanize(metadata.status);\n const priority = humanize(metadata.priority);\n const hasAssignee = Boolean(metadata.assigneeId);\n\n const rows: Array<{ label: string; value: string }> = [\n { label: tr('calendar.dueDate', 'Due date'), value: formatDate(event.startTime) },\n {\n label: tr('calendar.type', 'Type'),\n value: isMilestone ? tr('calendar.milestone', 'Milestone') : tr('calendar.task', 'Task'),\n },\n ];\n if (status) rows.push({ label: tr('calendar.status', 'Status'), value: status });\n if (!isMilestone && priority)\n rows.push({ label: tr('calendar.priority', 'Priority'), value: priority });\n if (!isMilestone)\n rows.push({\n label: tr('calendar.assignee', 'Assignee'),\n value: hasAssignee\n ? tr('calendar.assigned', 'Assigned')\n : tr('calendar.unassigned', 'Unassigned'),\n });\n\n const openInTasks = () => {\n const deepLink = event.deepLink;\n closeTaskDetail();\n if (deepLink) navigate(deepLink);\n };\n\n return (\n <dialog\n ref={dialogRef}\n className=\"fixed inset-0 z-50 m-auto w-full max-w-md rounded-radius-lg border border-border-default bg-bg-surface p-0 shadow-lg backdrop:bg-black/50\"\n onClose={closeTaskDetail}\n >\n <div className=\"p-6\">\n {/* Header */}\n <div className=\"flex items-start gap-3\">\n <div className=\"flex size-9 shrink-0 items-center justify-center rounded-full bg-bg-
|
|
1
|
+
{"version":3,"file":"TaskEventDetail.js","names":[],"sources":["../../src/components/TaskEventDetail.tsx"],"sourcesContent":["/**\n * TaskEventDetail — a read-only details modal for a PlanMagnet task / milestone\n * overlay event.\n *\n * The calendar VIEWS task info; it does not own or edit it. Clicking a\n * task/milestone opens this modal (title, due date, status, priority, assignee)\n * rendered entirely from the in-memory synthetic event — no calendar-svc fetch,\n * so a synthetic id never 404s. The \"Open in Tasks\" button deep-links to the\n * host's Tasks page (`event.deepLink` → `/…/tasks?item=<id>`) where the task can\n * actually be edited/managed. Flow: Calendar → Event Details → Open in PlanMagnet.\n */\n\nimport { useEffect, useRef, type FC } from 'react';\nimport { ExternalLink, Flag, ListChecks, X } from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { useCalendarStore } from '../store/calendarStore';\nimport { useCalendar } from '../providers/CalendarProvider';\nimport { formatDate } from '../utils/dateHelpers';\n\n/** Humanize an ENUM_VALUE → \"Enum Value\" for display. */\nfunction humanize(value: unknown): string | null {\n if (typeof value !== 'string' || !value) return null;\n return value\n .toLowerCase()\n .split('_')\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ');\n}\n\nexport const TaskEventDetail: FC = () => {\n const event = useCalendarStore((state) => state.taskDetailEvent);\n const closeTaskDetail = useCalendarStore((state) => state.closeTaskDetail);\n const { navigate } = useCalendar();\n const dialogRef = useRef<HTMLDialogElement>(null);\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const value = t(key);\n return value === key ? fallback : value;\n };\n\n const open = Boolean(event);\n\n useEffect(() => {\n const dialog = dialogRef.current;\n if (!dialog) return;\n if (open && !dialog.open) dialog.showModal();\n else if (!open && dialog.open) dialog.close();\n }, [open]);\n\n if (!event) return null;\n\n const metadata = (event.metadata ?? {}) as Record<string, unknown>;\n const isMilestone = event.sourceKind === 'milestone';\n const status = humanize(metadata.status);\n const priority = humanize(metadata.priority);\n const hasAssignee = Boolean(metadata.assigneeId);\n\n const rows: Array<{ label: string; value: string }> = [\n { label: tr('calendar.dueDate', 'Due date'), value: formatDate(event.startTime) },\n {\n label: tr('calendar.type', 'Type'),\n value: isMilestone ? tr('calendar.milestone', 'Milestone') : tr('calendar.task', 'Task'),\n },\n ];\n if (status) rows.push({ label: tr('calendar.status', 'Status'), value: status });\n if (!isMilestone && priority)\n rows.push({ label: tr('calendar.priority', 'Priority'), value: priority });\n if (!isMilestone)\n rows.push({\n label: tr('calendar.assignee', 'Assignee'),\n value: hasAssignee\n ? tr('calendar.assigned', 'Assigned')\n : tr('calendar.unassigned', 'Unassigned'),\n });\n\n const openInTasks = () => {\n const deepLink = event.deepLink;\n closeTaskDetail();\n if (deepLink) navigate(deepLink);\n };\n\n return (\n <dialog\n ref={dialogRef}\n className=\"fixed inset-0 z-50 m-auto w-full max-w-md rounded-radius-lg border border-border-default bg-bg-surface p-0 shadow-lg backdrop:bg-black/50\"\n onClose={closeTaskDetail}\n >\n <div className=\"p-6\">\n {/* Header */}\n <div className=\"flex items-start gap-3\">\n <div className=\"flex size-9 shrink-0 items-center justify-center rounded-full bg-bg-elevated text-text-secondary\">\n {isMilestone ? <Flag className=\"size-4\" /> : <ListChecks className=\"size-4\" />}\n </div>\n <div className=\"min-w-0 flex-1\">\n <p className=\"font-text-xs font-weight-medium uppercase tracking-wide text-text-tertiary\">\n {isMilestone ? tr('calendar.milestone', 'Milestone') : tr('calendar.task', 'Task')}\n </p>\n <h3 className=\"font-heading-sm text-text-primary\">{event.title}</h3>\n </div>\n <button\n type=\"button\"\n onClick={closeTaskDetail}\n className=\"inline-flex size-8 shrink-0 items-center justify-center rounded-radius-sm text-text-tertiary transition-colors hover:bg-bg-elevated\"\n aria-label={tr('calendar.close', 'Close')}\n >\n <X className=\"size-4\" />\n </button>\n </div>\n\n {/* Read-only fields */}\n <dl className=\"mt-4 space-y-2\">\n {rows.map((row) => (\n <div key={row.label} className=\"flex items-center justify-between gap-4\">\n <dt className=\"font-text-sm text-text-secondary\">{row.label}</dt>\n <dd className=\"font-text-sm font-weight-medium text-text-primary\">{row.value}</dd>\n </div>\n ))}\n </dl>\n\n {/* Actions */}\n <div className=\"mt-6 flex justify-end gap-3\">\n <button\n type=\"button\"\n onClick={closeTaskDetail}\n className=\"rounded-radius-md border border-border-default bg-bg-surface px-4 py-2 font-text-sm font-weight-medium text-text-primary transition-colors hover:bg-bg-elevated\"\n >\n {tr('calendar.close', 'Close')}\n </button>\n <button\n type=\"button\"\n onClick={openInTasks}\n className=\"inline-flex items-center gap-2 rounded-radius-md bg-action-primary-bg px-4 py-2 font-text-sm font-weight-medium text-action-primary-text transition-colors hover:bg-action-primary-bg-hover\"\n >\n <ExternalLink className=\"size-4\" />\n {tr('calendar.openInTasks', 'Open in Tasks')}\n </button>\n </div>\n </div>\n </dialog>\n );\n};\n"],"mappings":";;;;;;;;AAoBA,SAAS,EAAS,GAA+B;AAE/C,QADI,OAAO,KAAU,YAAY,CAAC,IAAc,OACzC,EACJ,aAAa,CACb,MAAM,IAAI,CACV,KAAK,MAAS,EAAK,OAAO,EAAE,CAAC,aAAa,GAAG,EAAK,MAAM,EAAE,CAAC,CAC3D,KAAK,IAAI;;AAGd,IAAa,UAA4B;CACvC,IAAM,IAAQ,GAAkB,MAAU,EAAM,gBAAgB,EAC1D,IAAkB,GAAkB,MAAU,EAAM,gBAAgB,EACpE,EAAE,gBAAa,GAAa,EAC5B,IAAY,EAA0B,KAAK,EAC3C,EAAE,SAAM,GAAS,EACjB,KAAM,GAAa,MAA6B;EACpD,IAAM,IAAQ,EAAE,EAAI;AACpB,SAAO,MAAU,IAAM,IAAW;IAG9B,IAAO,EAAQ;AASrB,KAPA,QAAgB;EACd,IAAM,IAAS,EAAU;AACpB,QACD,KAAQ,CAAC,EAAO,OAAM,EAAO,WAAW,GACnC,CAAC,KAAQ,EAAO,QAA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B,QAAQ;iBAEzC,kBAAC,GAAD,EAAG,WAAU,UAAW,CAAA;OACjB,CAAA;MACL;;IAGN,kBAAC,MAAD;KAAI,WAAU;eACX,EAAK,KAAK,MACT,kBAAC,OAAD;MAAqB,WAAU;gBAA/B,CACE,kBAAC,MAAD;OAAI,WAAU;iBAAoC,EAAI;OAAW,CAAA,EACjE,kBAAC,MAAD;OAAI,WAAU;iBAAqD,EAAI;OAAW,CAAA,CAC9E;QAHI,EAAI,MAGR,CACN;KACC,CAAA;IAGL,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,UAAD;MACE,MAAK;MACL,SAAS;MACT,WAAU;gBAET,EAAG,kBAAkB,QAAQ;MACvB,CAAA,EACT,kBAAC,UAAD;MACE,MAAK;MACL,eAvDgB;OACxB,IAAM,IAAW,EAAM;AAEvB,OADA,GAAiB,EACb,KAAU,EAAS,EAAS;;MAqDxB,WAAU;gBAHZ,CAKE,kBAAC,GAAD,EAAc,WAAU,UAAW,CAAA,EAClC,EAAG,wBAAwB,gBAAgB,CACrC;QACL;;IACF;;EACC,CAAA"}
|
|
@@ -37,11 +37,11 @@ function a() {
|
|
|
37
37
|
a(`${o}/view/${e}`);
|
|
38
38
|
};
|
|
39
39
|
return /* @__PURE__ */ i("div", {
|
|
40
|
-
className: "inline-flex items-center gap-1
|
|
40
|
+
className: "inline-flex items-center gap-1 rounded-radius-md border border-border-default bg-bg-elevated p-1",
|
|
41
41
|
children: u.map((e) => /* @__PURE__ */ i("button", {
|
|
42
42
|
type: "button",
|
|
43
43
|
onClick: () => d(e.value),
|
|
44
|
-
className: `px-
|
|
44
|
+
className: `px-3 py-1.5 rounded-radius-sm font-text-sm font-weight-medium transition-colors ${s === e.value ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-secondary hover:bg-bg-surface/60 hover:text-text-primary"}`,
|
|
45
45
|
children: e.label
|
|
46
46
|
}, e.value))
|
|
47
47
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewSwitcher.js","names":[],"sources":["../../src/components/ViewSwitcher.tsx"],"sourcesContent":["import { useNavigate } from 'react-router-dom';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { useCalendar } from '../providers/CalendarProvider';\nimport { useCalendarStore } from '../store/calendarStore';\nimport type { CalendarViewType } from '../types';\n\n/**\n * View switcher component\n * Allows switching between different calendar views\n */\nexport function ViewSwitcher() {\n const navigate = useNavigate();\n const { basePath } = useCalendar();\n const currentView = useCalendarStore((state) => state.currentView);\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const value = t(key);\n return value === key ? fallback : value;\n };\n\n const views: Array<{ value: CalendarViewType; label: string }> = [\n { value: 'day', label: tr('calendar.day', 'Day') },\n { value: 'week', label: tr('calendar.week', 'Week') },\n { value: 'month', label: tr('calendar.month', 'Month') },\n { value: 'year', label: tr('calendar.year', 'Year') },\n { value: 'agenda', label: tr('calendar.agenda', 'Agenda') },\n { value: 'timeline', label: tr('calendar.timeline', 'Timeline') },\n ];\n\n const handleViewChange = (view: CalendarViewType) => {\n navigate(`${basePath}/view/${view}`);\n };\n\n return (\n <div className=\"inline-flex items-center gap-1
|
|
1
|
+
{"version":3,"file":"ViewSwitcher.js","names":[],"sources":["../../src/components/ViewSwitcher.tsx"],"sourcesContent":["import { useNavigate } from 'react-router-dom';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { useCalendar } from '../providers/CalendarProvider';\nimport { useCalendarStore } from '../store/calendarStore';\nimport type { CalendarViewType } from '../types';\n\n/**\n * View switcher component\n * Allows switching between different calendar views\n */\nexport function ViewSwitcher() {\n const navigate = useNavigate();\n const { basePath } = useCalendar();\n const currentView = useCalendarStore((state) => state.currentView);\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const value = t(key);\n return value === key ? fallback : value;\n };\n\n const views: Array<{ value: CalendarViewType; label: string }> = [\n { value: 'day', label: tr('calendar.day', 'Day') },\n { value: 'week', label: tr('calendar.week', 'Week') },\n { value: 'month', label: tr('calendar.month', 'Month') },\n { value: 'year', label: tr('calendar.year', 'Year') },\n { value: 'agenda', label: tr('calendar.agenda', 'Agenda') },\n { value: 'timeline', label: tr('calendar.timeline', 'Timeline') },\n ];\n\n const handleViewChange = (view: CalendarViewType) => {\n navigate(`${basePath}/view/${view}`);\n };\n\n return (\n <div className=\"inline-flex items-center gap-1 rounded-radius-md border border-border-default bg-bg-elevated p-1\">\n {views.map((view) => (\n <button\n key={view.value}\n type=\"button\"\n onClick={() => handleViewChange(view.value)}\n className={`px-3 py-1.5 rounded-radius-sm font-text-sm font-weight-medium transition-colors ${\n currentView === view.value\n ? 'bg-bg-surface text-text-primary shadow-sm'\n : 'text-text-secondary hover:bg-bg-surface/60 hover:text-text-primary'\n }`}\n >\n {view.label}\n </button>\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;;AAUA,SAAgB,IAAe;CAC7B,IAAM,IAAW,GAAa,EACxB,EAAE,gBAAa,GAAa,EAC5B,IAAc,GAAkB,MAAU,EAAM,YAAY,EAC5D,EAAE,SAAM,GAAS,EACjB,KAAM,GAAa,MAA6B;EACpD,IAAM,IAAQ,EAAE,EAAI;AACpB,SAAO,MAAU,IAAM,IAAW;IAG9B,IAA2D;EAC/D;GAAE,OAAO;GAAO,OAAO,EAAG,gBAAgB,MAAM;GAAE;EAClD;GAAE,OAAO;GAAQ,OAAO,EAAG,iBAAiB,OAAO;GAAE;EACrD;GAAE,OAAO;GAAS,OAAO,EAAG,kBAAkB,QAAQ;GAAE;EACxD;GAAE,OAAO;GAAQ,OAAO,EAAG,iBAAiB,OAAO;GAAE;EACrD;GAAE,OAAO;GAAU,OAAO,EAAG,mBAAmB,SAAS;GAAE;EAC3D;GAAE,OAAO;GAAY,OAAO,EAAG,qBAAqB,WAAW;GAAE;EAClE,EAEK,KAAoB,MAA2B;AACnD,IAAS,GAAG,EAAS,QAAQ,IAAO;;AAGtC,QACE,kBAAC,OAAD;EAAK,WAAU;YACZ,EAAM,KAAK,MACV,kBAAC,UAAD;GAEE,MAAK;GACL,eAAe,EAAiB,EAAK,MAAM;GAC3C,WAAW,mFACT,MAAgB,EAAK,QACjB,8CACA;aAGL,EAAK;GACC,EAVF,EAAK,MAUH,CACT;EACE,CAAA"}
|
|
@@ -54,13 +54,13 @@ function O() {
|
|
|
54
54
|
className: "@container min-h-screen bg-bg-canvas",
|
|
55
55
|
children: [
|
|
56
56
|
/* @__PURE__ */ C("header", {
|
|
57
|
-
className: "relative overflow-hidden border-b border-border-seam bg-bg-surface px-
|
|
57
|
+
className: "relative overflow-hidden border-b border-border-seam bg-bg-surface px-6 py-3",
|
|
58
58
|
children: [
|
|
59
59
|
/* @__PURE__ */ S(w, { intensity: "subtle" }),
|
|
60
60
|
/* @__PURE__ */ C("div", {
|
|
61
|
-
className: "flex flex-col @lg:flex-row @lg:items-center @lg:justify-between gap-
|
|
61
|
+
className: "flex flex-col @lg:flex-row @lg:items-center @lg:justify-between gap-4",
|
|
62
62
|
children: [/* @__PURE__ */ C("div", {
|
|
63
|
-
className: "flex items-center gap-
|
|
63
|
+
className: "flex items-center gap-2",
|
|
64
64
|
children: [
|
|
65
65
|
/* @__PURE__ */ S("button", {
|
|
66
66
|
type: "button",
|
|
@@ -72,11 +72,11 @@ function O() {
|
|
|
72
72
|
/* @__PURE__ */ S("button", {
|
|
73
73
|
type: "button",
|
|
74
74
|
onClick: () => L("today"),
|
|
75
|
-
className: "px-
|
|
75
|
+
className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-surface hover:bg-bg-elevated font-text-sm font-weight-medium text-text-primary transition-colors",
|
|
76
76
|
children: W("calendar.today", "Today")
|
|
77
77
|
}),
|
|
78
78
|
/* @__PURE__ */ C("div", {
|
|
79
|
-
className: "flex items-center gap-
|
|
79
|
+
className: "flex items-center gap-1.5",
|
|
80
80
|
children: [/* @__PURE__ */ S("button", {
|
|
81
81
|
type: "button",
|
|
82
82
|
onClick: () => L("prev"),
|
|
@@ -97,13 +97,13 @@ function O() {
|
|
|
97
97
|
})
|
|
98
98
|
]
|
|
99
99
|
}), /* @__PURE__ */ C("div", {
|
|
100
|
-
className: "flex items-center gap-
|
|
100
|
+
className: "flex items-center gap-2",
|
|
101
101
|
children: [/* @__PURE__ */ S(u, {}), Y ? /* @__PURE__ */ C("button", {
|
|
102
102
|
type: "button",
|
|
103
103
|
onClick: () => {
|
|
104
104
|
J(null), K(!0);
|
|
105
105
|
},
|
|
106
|
-
className: "inline-flex items-center gap-
|
|
106
|
+
className: "inline-flex items-center gap-1.5 px-3 py-2 rounded-radius-md bg-action-primary-bg text-action-primary-fg font-text-sm font-weight-medium hover:bg-action-primary-bg-hover transition-colors",
|
|
107
107
|
children: [/* @__PURE__ */ S(ie, { className: "size-4" }), /* @__PURE__ */ S("span", {
|
|
108
108
|
className: "hidden @sm:inline",
|
|
109
109
|
children: W("calendar.createEvent", "Create Event")
|
|
@@ -112,7 +112,7 @@ function O() {
|
|
|
112
112
|
})]
|
|
113
113
|
}),
|
|
114
114
|
/* @__PURE__ */ S(D, {
|
|
115
|
-
className: "relative mt-
|
|
115
|
+
className: "relative mt-3 max-w-3xl",
|
|
116
116
|
children: W("calendar.pagePurpose", "Your shared schedule. See, create, and manage events across day, week, month, agenda, and timeline views — then toggle calendars, search, and overlay scheduled jobs from the sidebar so the whole team stays in sync.")
|
|
117
117
|
})
|
|
118
118
|
]
|
|
@@ -120,7 +120,7 @@ function O() {
|
|
|
120
120
|
/* @__PURE__ */ C("div", {
|
|
121
121
|
className: "flex min-h-0 flex-1",
|
|
122
122
|
children: [ce && /* @__PURE__ */ C("aside", {
|
|
123
|
-
className: "hidden @lg:block w-72 border-r border-border-seam bg-bg-surface p-
|
|
123
|
+
className: "hidden @lg:block w-72 border-r border-border-seam bg-bg-surface p-4 space-y-5",
|
|
124
124
|
children: [
|
|
125
125
|
/* @__PURE__ */ S(d, {}),
|
|
126
126
|
/* @__PURE__ */ C("div", {
|
|
@@ -283,11 +283,11 @@ function O() {
|
|
|
283
283
|
})
|
|
284
284
|
]
|
|
285
285
|
}), /* @__PURE__ */ C("div", {
|
|
286
|
-
className: "min-w-0 flex-1 p-
|
|
286
|
+
className: "min-w-0 flex-1 p-6",
|
|
287
287
|
children: [
|
|
288
288
|
/* @__PURE__ */ S(E, {
|
|
289
289
|
storageKey: "calendar-overview",
|
|
290
|
-
className: "mb-
|
|
290
|
+
className: "mb-4",
|
|
291
291
|
steps: [
|
|
292
292
|
...Y ? [{
|
|
293
293
|
id: "create-event",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarPage.js","names":[],"sources":["../../src/pages/CalendarPage.tsx"],"sourcesContent":["import { useParams } from 'react-router-dom';\nimport { useEffect, useState } from 'react';\nimport {\n ChevronLeft,\n ChevronRight,\n Plus,\n PanelLeft,\n Search,\n Settings2,\n CalendarPlus,\n DoorOpen,\n Rss,\n} from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { AccessDenied } from '@burdenoff/fe-libs/shared/components';\nimport { AuroraBackground, GradientText, NextSteps, PagePurpose } from '@burdenoff/fe-libs/ui';\nimport { useGetCalendarsQuery } from '../generated/wspace-operations';\nimport { useCalendar } from '../providers/CalendarProvider';\nimport { useCalendarStore } from '../store/calendarStore';\nimport { useSafePermissions } from '../hooks/useSafePermissions';\nimport type { CalendarViewType } from '../types';\nimport { formatDate } from '../utils/dateHelpers';\nimport { WeekView } from '../components/WeekView';\nimport { MonthView } from '../components/MonthView';\nimport { DayView } from '../components/DayView';\nimport { AgendaView } from '../components/AgendaView';\nimport { YearView } from '../components/YearView';\nimport { TimelineView } from '../components/TimelineView';\nimport { ViewSwitcher } from '../components/ViewSwitcher';\nimport { MiniCalendar } from '../components/MiniCalendar';\nimport { EventFormModal } from '../components/EventFormModal';\nimport { TaskEventDetail } from '../components/TaskEventDetail';\nimport { CALENDAR_PERMISSIONS } from '../constants/permissions';\n\n/**\n * Main calendar page with multiple view types and event creation\n */\nexport function CalendarPage() {\n const { viewType } = useParams<{ viewType: string }>();\n const { hasPermission, isLoading: permissionsLoading } = useSafePermissions();\n const { navigate, basePath, taskOverlay } = useCalendar();\n const currentView = useCalendarStore((state) => state.currentView);\n const currentDate = useCalendarStore((state) => state.currentDate);\n const setView = useCalendarStore((state) => state.setView);\n const navigateDate = useCalendarStore((state) => state.navigateDate);\n const miniCalendarVisible = useCalendarStore((state) => state.miniCalendarVisible);\n const toggleMiniCalendar = useCalendarStore((state) => state.toggleMiniCalendar);\n const visibleCalendars = useCalendarStore((state) => state.visibleCalendars);\n const setVisibleCalendars = useCalendarStore((state) => state.setVisibleCalendars);\n const eventFilter = useCalendarStore((state) => state.eventFilter);\n const updateEventFilter = useCalendarStore((state) => state.updateEventFilter);\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const value = t(key);\n return value === key ? fallback : value;\n };\n\n const [showCreateModal, setShowCreateModal] = useState(false);\n const [createSlot, setCreateSlot] = useState<{ date: Date; hour?: number } | null>(null);\n const canCreateEvents = hasPermission(CALENDAR_PERMISSIONS.CALENDAR_EVENT_CREATE);\n // Clicking an empty grid cell opens the create modal pre-filled with that\n // slot. Left undefined (so cells stay non-interactive) when the user can't\n // create events. Day-level cells (month view) pass no hour — default to 9am\n // so the event isn't created at 1am (midnight + 1) by accident.\n const DEFAULT_CREATE_HOUR = 9;\n const handleCreateSlot = canCreateEvents\n ? (date: Date, hour?: number) => {\n setCreateSlot({ date, hour: hour ?? DEFAULT_CREATE_HOUR });\n setShowCreateModal(true);\n }\n : undefined;\n const { data: calendarsData } = useGetCalendarsQuery({\n variables: { pagination: { limit: 50 } },\n skip: permissionsLoading,\n });\n const calendars =\n (calendarsData?.calendars?.calendars as Array<{\n id: string;\n name: string;\n color?: string | null;\n isDefault: boolean;\n }>) ?? [];\n const effectiveVisibleCalendars =\n visibleCalendars.size > 0\n ? visibleCalendars\n : new Set<string>(calendars.map((calendar) => calendar.id));\n\n const handleToggleCalendar = (calendarId: string) => {\n const nextVisibleCalendars = new Set<string>(effectiveVisibleCalendars);\n if (nextVisibleCalendars.has(calendarId)) {\n nextVisibleCalendars.delete(calendarId);\n } else {\n nextVisibleCalendars.add(calendarId);\n }\n setVisibleCalendars(Array.from(nextVisibleCalendars));\n };\n\n // Sync view type from URL params\n useEffect(() => {\n if (viewType && viewType !== currentView) {\n setView(viewType as CalendarViewType);\n }\n }, [viewType, currentView, setView]);\n\n if (permissionsLoading) {\n return (\n <div className=\"@container min-h-screen bg-bg-canvas flex items-center justify-center\">\n <p className=\"font-text-md text-text-secondary\">{tr('calendar.loading', 'Loading...')}</p>\n </div>\n );\n }\n\n if (!hasPermission(CALENDAR_PERMISSIONS.CALENDAR_READ)) {\n return (\n <AccessDenied\n title={tr('calendar.accessDenied', 'Access Denied')}\n description={tr(\n 'calendar.noPermissionViewCalendar',\n \"You don't have permission to view the calendar.\"\n )}\n />\n );\n }\n\n return (\n <div className=\"@container min-h-screen bg-bg-canvas\">\n {/* Header — primary MFE hero with a living aurora backdrop */}\n <header className=\"relative overflow-hidden border-b border-border-seam bg-bg-surface px-page-padding py-element-padding\">\n <AuroraBackground intensity=\"subtle\" />\n <div className=\"flex flex-col @lg:flex-row @lg:items-center @lg:justify-between gap-stack-gap\">\n {/* Date navigation */}\n <div className=\"flex items-center gap-inline-gap\">\n <button\n type=\"button\"\n onClick={toggleMiniCalendar}\n className=\"size-9 inline-flex items-center justify-center rounded-radius-md border border-border-default bg-bg-surface hover:bg-bg-elevated text-text-primary transition-colors\"\n aria-label={tr('calendar.toggleSidebar', 'Toggle sidebar')}\n >\n <PanelLeft className=\"size-4\" />\n </button>\n\n <button\n type=\"button\"\n onClick={() => navigateDate('today')}\n className=\"px-element-padding py-element-padding-sm rounded-radius-md border border-border-default bg-bg-surface hover:bg-bg-elevated font-text-sm font-weight-medium text-text-primary transition-colors\"\n >\n {tr('calendar.today', 'Today')}\n </button>\n\n <div className=\"flex items-center gap-inline-gap-sm\">\n <button\n type=\"button\"\n onClick={() => navigateDate('prev')}\n className=\"size-9 inline-flex items-center justify-center rounded-radius-md border border-border-default bg-bg-surface hover:bg-bg-elevated text-text-primary transition-colors\"\n aria-label={tr('calendar.previous', 'Previous')}\n >\n <ChevronLeft className=\"size-4\" />\n </button>\n\n <button\n type=\"button\"\n onClick={() => navigateDate('next')}\n className=\"size-9 inline-flex items-center justify-center rounded-radius-md border border-border-default bg-bg-surface hover:bg-bg-elevated text-text-primary transition-colors\"\n aria-label={tr('calendar.next', 'Next')}\n >\n <ChevronRight className=\"size-4\" />\n </button>\n </div>\n\n <h2 className=\"font-heading-md text-text-primary tabular-nums\">\n <GradientText>{formatDate(currentDate)}</GradientText>\n </h2>\n </div>\n\n {/* Right side: view switcher + create button */}\n <div className=\"flex items-center gap-inline-gap\">\n <ViewSwitcher />\n\n {canCreateEvents ? (\n <button\n type=\"button\"\n onClick={() => {\n setCreateSlot(null);\n setShowCreateModal(true);\n }}\n className=\"inline-flex items-center gap-inline-gap-sm px-element-padding py-element-padding-sm rounded-radius-md bg-action-primary-bg text-action-primary-fg font-text-sm font-weight-medium hover:bg-action-primary-bg-hover transition-colors\"\n >\n <Plus className=\"size-4\" />\n <span className=\"hidden @sm:inline\">\n {tr('calendar.createEvent', 'Create Event')}\n </span>\n </button>\n ) : null}\n </div>\n </div>\n\n <PagePurpose className=\"relative mt-element-padding max-w-3xl\">\n {tr(\n 'calendar.pagePurpose',\n 'Your shared schedule. See, create, and manage events across day, week, month, agenda, and timeline views — then toggle calendars, search, and overlay scheduled jobs from the sidebar so the whole team stays in sync.'\n )}\n </PagePurpose>\n </header>\n\n {/* Main content */}\n <div className=\"flex min-h-0 flex-1\">\n {/* Mini calendar sidebar (optional) */}\n {miniCalendarVisible && (\n <aside className=\"hidden @lg:block w-72 border-r border-border-seam bg-bg-surface p-section-padding space-y-5\">\n <MiniCalendar />\n\n <div className=\"space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Search className=\"size-4 text-text-secondary\" />\n <input\n type=\"search\"\n value={eventFilter.search ?? ''}\n onChange={(e) =>\n updateEventFilter({ search: e.target.value.trim() || undefined })\n }\n placeholder={tr('calendar.searchEvents', 'Search events, tags, or calendars')}\n aria-label={tr('calendar.searchEvents', 'Search events, tags, or calendars')}\n className=\"w-full px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-border\"\n />\n </div>\n\n <select\n value={eventFilter.status?.[0] ?? ''}\n onChange={(e) =>\n updateEventFilter({\n status: e.target.value\n ? [e.target.value as 'CONFIRMED' | 'TENTATIVE' | 'CANCELLED']\n : undefined,\n })\n }\n className=\"w-full px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm focus:outline-none focus:ring-2 focus:ring-action-primary-border\"\n >\n <option value=\"\">{tr('calendar.allStatuses', 'All statuses')}</option>\n <option value=\"CONFIRMED\">\n {tr('calendar.eventStatusConfirmed', 'Confirmed')}\n </option>\n <option value=\"TENTATIVE\">\n {tr('calendar.eventStatusTentative', 'Tentative')}\n </option>\n <option value=\"CANCELLED\">\n {tr('calendar.eventStatusCancelled', 'Cancelled')}\n </option>\n </select>\n </div>\n\n <div className=\"space-y-3\">\n <div className=\"flex items-center justify-between\">\n <h3 className=\"font-text-sm font-weight-semibold text-text-primary\">\n {tr('calendar.visibleCalendars', 'Visible calendars')}\n </h3>\n <button\n type=\"button\"\n onClick={() => setVisibleCalendars([])}\n className=\"font-text-xs text-action-primary-bg hover:underline\"\n >\n {tr('calendar.showAll', 'Show all')}\n </button>\n </div>\n\n <div className=\"space-y-2 max-h-[280px] overflow-auto pr-1\">\n {calendars.map((calendar) => (\n <label\n key={calendar.id}\n className=\"flex items-center gap-3 rounded-radius-md border border-border-subtle px-3 py-2 hover:bg-bg-canvas\"\n >\n <input\n type=\"checkbox\"\n checked={effectiveVisibleCalendars.has(calendar.id)}\n onChange={() => handleToggleCalendar(calendar.id)}\n className=\"size-4 rounded border-border-default\"\n aria-label={calendar.name}\n />\n <span\n className=\"size-3 rounded-full shrink-0\"\n style={{\n backgroundColor: calendar.color ?? 'var(--color-action-primary-bg)',\n }}\n />\n <span className=\"min-w-0 flex-1 truncate font-text-sm text-text-primary\">\n {calendar.name}\n </span>\n </label>\n ))}\n </div>\n\n <div className=\"rounded-radius-md border border-border-subtle bg-bg-canvas px-3 py-2\">\n <p className=\"font-text-xs font-weight-semibold text-text-primary mb-1\">\n {tr('calendar.schedulerOverlay', 'Scheduler overlay')}\n </p>\n <p className=\"font-text-xs text-text-secondary\">\n {tr(\n 'calendar.schedulerOverlayDescription',\n 'Scheduled jobs from scheduler are shown in calendar views and deep-link to /scheduler.'\n )}\n </p>\n </div>\n\n {taskOverlay && (\n <div className=\"space-y-2 rounded-radius-md border border-border-subtle px-3 py-2\">\n <p className=\"font-text-xs font-weight-semibold text-text-primary\">\n {tr('calendar.taskOverlay', 'Tasks & milestones')}\n </p>\n <label className=\"flex items-center gap-3 py-1\">\n <input\n type=\"checkbox\"\n checked={eventFilter.showTasks !== false}\n onChange={(e) => updateEventFilter({ showTasks: e.target.checked })}\n className=\"size-4 rounded border-border-default\"\n aria-label={tr('calendar.showTasks', 'Show tasks')}\n />\n <span\n className=\"size-3 rounded-full shrink-0\"\n style={{ backgroundColor: 'var(--color-accent-blue)' }}\n />\n <span className=\"min-w-0 flex-1 truncate font-text-sm text-text-primary\">\n {tr('calendar.showTasks', 'Show tasks')}\n </span>\n </label>\n <label className=\"flex items-center gap-3 py-1\">\n <input\n type=\"checkbox\"\n checked={eventFilter.showMilestones !== false}\n onChange={(e) => updateEventFilter({ showMilestones: e.target.checked })}\n className=\"size-4 rounded border-border-default\"\n aria-label={tr('calendar.showMilestones', 'Show milestones')}\n />\n <span\n className=\"size-3 rounded-full shrink-0\"\n style={{ backgroundColor: 'var(--color-accent-purple)' }}\n />\n <span className=\"min-w-0 flex-1 truncate font-text-sm text-text-primary\">\n {tr('calendar.showMilestones', 'Show milestones')}\n </span>\n </label>\n </div>\n )}\n </div>\n\n <div className=\"space-y-2 pt-2 border-t border-border-subtle\">\n <button\n type=\"button\"\n onClick={() => navigate(`${basePath}/settings`)}\n className=\"w-full inline-flex items-center gap-2 px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas hover:bg-bg-elevated text-text-primary font-text-sm\"\n >\n <Settings2 className=\"size-4\" />\n {tr('calendar.manageCalendarSettings', 'Manage calendar settings')}\n </button>\n <button\n type=\"button\"\n onClick={() => navigate(`${basePath}/resources`)}\n className=\"w-full inline-flex items-center gap-2 px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas hover:bg-bg-elevated text-text-primary font-text-sm\"\n >\n {tr('calendar.openResources', 'Open resources')}\n </button>\n <button\n type=\"button\"\n onClick={() => navigate(`${basePath}/subscriptions`)}\n className=\"w-full inline-flex items-center gap-2 px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas hover:bg-bg-elevated text-text-primary font-text-sm\"\n >\n {tr('calendar.exportAndSubscriptions', 'Export and subscriptions')}\n </button>\n </div>\n </aside>\n )}\n\n {/* Calendar view — host shell already renders <main>, use a plain div */}\n <div className=\"min-w-0 flex-1 p-page-padding\">\n <NextSteps\n storageKey=\"calendar-overview\"\n className=\"mb-stack-gap\"\n steps={[\n ...(canCreateEvents\n ? [\n {\n id: 'create-event',\n label: tr('calendar.nextStepCreateEvent', 'Create your first event'),\n description: tr(\n 'calendar.nextStepCreateEventDesc',\n 'Add a meeting, reminder, or all-day event to this calendar.'\n ),\n icon: <CalendarPlus className=\"size-4\" />,\n onClick: () => {\n setCreateSlot(null);\n setShowCreateModal(true);\n },\n },\n ]\n : []),\n {\n id: 'book-resources',\n label: tr('calendar.nextStepResources', 'Book rooms and resources'),\n description: tr(\n 'calendar.nextStepResourcesDesc',\n 'Reserve conference rooms, equipment, and desks for your events.'\n ),\n icon: <DoorOpen className=\"size-4\" />,\n onClick: () => navigate(`${basePath}/resources`),\n },\n {\n id: 'export-subscribe',\n label: tr('calendar.nextStepSubscriptions', 'Export or subscribe'),\n description: tr(\n 'calendar.nextStepSubscriptionsDesc',\n 'Download ICS files to sync with Google, Apple, or Outlook calendars.'\n ),\n icon: <Rss className=\"size-4\" />,\n onClick: () => navigate(`${basePath}/subscriptions`),\n },\n {\n id: 'tune-settings',\n label: tr('calendar.nextStepSettings', 'Tune your calendar settings'),\n description: tr(\n 'calendar.nextStepSettingsDesc',\n 'Set availability, sharing, booking pages, and default view.'\n ),\n icon: <Settings2 className=\"size-4\" />,\n onClick: () => navigate(`${basePath}/settings`),\n },\n ]}\n />\n {currentView === 'day' && <DayView onCreateSlot={handleCreateSlot} />}\n {currentView === 'week' && <WeekView onCreateSlot={handleCreateSlot} />}\n {currentView === 'month' && <MonthView onCreateSlot={handleCreateSlot} />}\n {currentView === 'year' && <YearView />}\n {currentView === 'agenda' && <AgendaView />}\n {currentView === 'timeline' && <TimelineView />}\n </div>\n </div>\n\n {/* Create Event Modal */}\n <EventFormModal\n open={showCreateModal}\n defaultDate={createSlot?.date ?? currentDate}\n defaultStartHour={createSlot?.hour}\n onClose={() => {\n setShowCreateModal(false);\n setCreateSlot(null);\n }}\n />\n\n {/* Read-only details for a clicked PlanMagnet task / milestone overlay */}\n <TaskEventDetail />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAqCA,SAAgB,IAAe;CAC7B,IAAM,EAAE,gBAAa,IAAiC,EAChD,EAAE,kBAAe,WAAW,MAAuB,GAAoB,EACvE,EAAE,aAAU,aAAU,mBAAgB,GAAa,EACnD,IAAc,GAAkB,MAAU,EAAM,YAAY,EAC5D,IAAc,GAAkB,MAAU,EAAM,YAAY,EAC5D,IAAU,GAAkB,MAAU,EAAM,QAAQ,EACpD,IAAe,GAAkB,MAAU,EAAM,aAAa,EAC9D,KAAsB,GAAkB,MAAU,EAAM,oBAAoB,EAC5E,IAAqB,GAAkB,MAAU,EAAM,mBAAmB,EAC1E,IAAmB,GAAkB,MAAU,EAAM,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S,gBAAgB;SACrD;QACD;SACE,IAAI;SACJ,OAAO,EAAG,6BAA6B,8BAA8B;SACrE,aAAa,EACX,iCACA,8DACD;SACD,MAAM,kBAAC,GAAD,EAAW,WAAU,UAAW,CAAA;SACtC,eAAe,EAAS,GAAG,EAAS,WAAW;SAChD;QACF;OACD,CAAA;MACD,MAAgB,SAAS,kBAAC,GAAD,EAAS,cAAc,GAAoB,CAAA;MACpE,MAAgB,UAAU,kBAAC,IAAD,EAAU,cAAc,GAAoB,CAAA;MACtE,MAAgB,WAAW,kBAAC,GAAD,EAAW,cAAc,GAAoB,CAAA;MACxE,MAAgB,UAAU,kBAAC,GAAD,EAAY,CAAA;MACtC,MAAgB,YAAY,kBAAC,GAAD,EAAc,CAAA;MAC1C,MAAgB,cAAc,kBAAC,GAAD,EAAgB,CAAA;MAC3C;OACF;;GAGN,kBAAC,GAAD;IACE,MAAM;IACN,aAAa,GAAY,QAAQ;IACjC,kBAAkB,GAAY;IAC9B,eAAe;AAEb,KADA,EAAmB,GAAM,EACzB,EAAc,KAAK;;IAErB,CAAA;GAGF,kBAAC,GAAD,EAAmB,CAAA;GACf;MA7UJ,kBAAC,GAAD;EACE,OAAO,EAAG,yBAAyB,gBAAgB;EACnD,aAAa,EACX,qCACA,kDACD;EACD,CAAA"}
|
|
1
|
+
{"version":3,"file":"CalendarPage.js","names":[],"sources":["../../src/pages/CalendarPage.tsx"],"sourcesContent":["import { useParams } from 'react-router-dom';\nimport { useEffect, useState } from 'react';\nimport {\n ChevronLeft,\n ChevronRight,\n Plus,\n PanelLeft,\n Search,\n Settings2,\n CalendarPlus,\n DoorOpen,\n Rss,\n} from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { AccessDenied } from '@burdenoff/fe-libs/shared/components';\nimport { AuroraBackground, GradientText, NextSteps, PagePurpose } from '@burdenoff/fe-libs/ui';\nimport { useGetCalendarsQuery } from '../generated/wspace-operations';\nimport { useCalendar } from '../providers/CalendarProvider';\nimport { useCalendarStore } from '../store/calendarStore';\nimport { useSafePermissions } from '../hooks/useSafePermissions';\nimport type { CalendarViewType } from '../types';\nimport { formatDate } from '../utils/dateHelpers';\nimport { WeekView } from '../components/WeekView';\nimport { MonthView } from '../components/MonthView';\nimport { DayView } from '../components/DayView';\nimport { AgendaView } from '../components/AgendaView';\nimport { YearView } from '../components/YearView';\nimport { TimelineView } from '../components/TimelineView';\nimport { ViewSwitcher } from '../components/ViewSwitcher';\nimport { MiniCalendar } from '../components/MiniCalendar';\nimport { EventFormModal } from '../components/EventFormModal';\nimport { TaskEventDetail } from '../components/TaskEventDetail';\nimport { CALENDAR_PERMISSIONS } from '../constants/permissions';\n\n/**\n * Main calendar page with multiple view types and event creation\n */\nexport function CalendarPage() {\n const { viewType } = useParams<{ viewType: string }>();\n const { hasPermission, isLoading: permissionsLoading } = useSafePermissions();\n const { navigate, basePath, taskOverlay } = useCalendar();\n const currentView = useCalendarStore((state) => state.currentView);\n const currentDate = useCalendarStore((state) => state.currentDate);\n const setView = useCalendarStore((state) => state.setView);\n const navigateDate = useCalendarStore((state) => state.navigateDate);\n const miniCalendarVisible = useCalendarStore((state) => state.miniCalendarVisible);\n const toggleMiniCalendar = useCalendarStore((state) => state.toggleMiniCalendar);\n const visibleCalendars = useCalendarStore((state) => state.visibleCalendars);\n const setVisibleCalendars = useCalendarStore((state) => state.setVisibleCalendars);\n const eventFilter = useCalendarStore((state) => state.eventFilter);\n const updateEventFilter = useCalendarStore((state) => state.updateEventFilter);\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const value = t(key);\n return value === key ? fallback : value;\n };\n\n const [showCreateModal, setShowCreateModal] = useState(false);\n const [createSlot, setCreateSlot] = useState<{ date: Date; hour?: number } | null>(null);\n const canCreateEvents = hasPermission(CALENDAR_PERMISSIONS.CALENDAR_EVENT_CREATE);\n // Clicking an empty grid cell opens the create modal pre-filled with that\n // slot. Left undefined (so cells stay non-interactive) when the user can't\n // create events. Day-level cells (month view) pass no hour — default to 9am\n // so the event isn't created at 1am (midnight + 1) by accident.\n const DEFAULT_CREATE_HOUR = 9;\n const handleCreateSlot = canCreateEvents\n ? (date: Date, hour?: number) => {\n setCreateSlot({ date, hour: hour ?? DEFAULT_CREATE_HOUR });\n setShowCreateModal(true);\n }\n : undefined;\n const { data: calendarsData } = useGetCalendarsQuery({\n variables: { pagination: { limit: 50 } },\n skip: permissionsLoading,\n });\n const calendars =\n (calendarsData?.calendars?.calendars as Array<{\n id: string;\n name: string;\n color?: string | null;\n isDefault: boolean;\n }>) ?? [];\n const effectiveVisibleCalendars =\n visibleCalendars.size > 0\n ? visibleCalendars\n : new Set<string>(calendars.map((calendar) => calendar.id));\n\n const handleToggleCalendar = (calendarId: string) => {\n const nextVisibleCalendars = new Set<string>(effectiveVisibleCalendars);\n if (nextVisibleCalendars.has(calendarId)) {\n nextVisibleCalendars.delete(calendarId);\n } else {\n nextVisibleCalendars.add(calendarId);\n }\n setVisibleCalendars(Array.from(nextVisibleCalendars));\n };\n\n // Sync view type from URL params\n useEffect(() => {\n if (viewType && viewType !== currentView) {\n setView(viewType as CalendarViewType);\n }\n }, [viewType, currentView, setView]);\n\n if (permissionsLoading) {\n return (\n <div className=\"@container min-h-screen bg-bg-canvas flex items-center justify-center\">\n <p className=\"font-text-md text-text-secondary\">{tr('calendar.loading', 'Loading...')}</p>\n </div>\n );\n }\n\n if (!hasPermission(CALENDAR_PERMISSIONS.CALENDAR_READ)) {\n return (\n <AccessDenied\n title={tr('calendar.accessDenied', 'Access Denied')}\n description={tr(\n 'calendar.noPermissionViewCalendar',\n \"You don't have permission to view the calendar.\"\n )}\n />\n );\n }\n\n return (\n <div className=\"@container min-h-screen bg-bg-canvas\">\n {/* Header — primary MFE hero with a living aurora backdrop */}\n <header className=\"relative overflow-hidden border-b border-border-seam bg-bg-surface px-6 py-3\">\n <AuroraBackground intensity=\"subtle\" />\n <div className=\"flex flex-col @lg:flex-row @lg:items-center @lg:justify-between gap-4\">\n {/* Date navigation */}\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={toggleMiniCalendar}\n className=\"size-9 inline-flex items-center justify-center rounded-radius-md border border-border-default bg-bg-surface hover:bg-bg-elevated text-text-primary transition-colors\"\n aria-label={tr('calendar.toggleSidebar', 'Toggle sidebar')}\n >\n <PanelLeft className=\"size-4\" />\n </button>\n\n <button\n type=\"button\"\n onClick={() => navigateDate('today')}\n className=\"px-3 py-2 rounded-radius-md border border-border-default bg-bg-surface hover:bg-bg-elevated font-text-sm font-weight-medium text-text-primary transition-colors\"\n >\n {tr('calendar.today', 'Today')}\n </button>\n\n <div className=\"flex items-center gap-1.5\">\n <button\n type=\"button\"\n onClick={() => navigateDate('prev')}\n className=\"size-9 inline-flex items-center justify-center rounded-radius-md border border-border-default bg-bg-surface hover:bg-bg-elevated text-text-primary transition-colors\"\n aria-label={tr('calendar.previous', 'Previous')}\n >\n <ChevronLeft className=\"size-4\" />\n </button>\n\n <button\n type=\"button\"\n onClick={() => navigateDate('next')}\n className=\"size-9 inline-flex items-center justify-center rounded-radius-md border border-border-default bg-bg-surface hover:bg-bg-elevated text-text-primary transition-colors\"\n aria-label={tr('calendar.next', 'Next')}\n >\n <ChevronRight className=\"size-4\" />\n </button>\n </div>\n\n <h2 className=\"font-heading-md text-text-primary tabular-nums\">\n <GradientText>{formatDate(currentDate)}</GradientText>\n </h2>\n </div>\n\n {/* Right side: view switcher + create button */}\n <div className=\"flex items-center gap-2\">\n <ViewSwitcher />\n\n {canCreateEvents ? (\n <button\n type=\"button\"\n onClick={() => {\n setCreateSlot(null);\n setShowCreateModal(true);\n }}\n className=\"inline-flex items-center gap-1.5 px-3 py-2 rounded-radius-md bg-action-primary-bg text-action-primary-fg font-text-sm font-weight-medium hover:bg-action-primary-bg-hover transition-colors\"\n >\n <Plus className=\"size-4\" />\n <span className=\"hidden @sm:inline\">\n {tr('calendar.createEvent', 'Create Event')}\n </span>\n </button>\n ) : null}\n </div>\n </div>\n\n <PagePurpose className=\"relative mt-3 max-w-3xl\">\n {tr(\n 'calendar.pagePurpose',\n 'Your shared schedule. See, create, and manage events across day, week, month, agenda, and timeline views — then toggle calendars, search, and overlay scheduled jobs from the sidebar so the whole team stays in sync.'\n )}\n </PagePurpose>\n </header>\n\n {/* Main content */}\n <div className=\"flex min-h-0 flex-1\">\n {/* Mini calendar sidebar (optional) */}\n {miniCalendarVisible && (\n <aside className=\"hidden @lg:block w-72 border-r border-border-seam bg-bg-surface p-4 space-y-5\">\n <MiniCalendar />\n\n <div className=\"space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Search className=\"size-4 text-text-secondary\" />\n <input\n type=\"search\"\n value={eventFilter.search ?? ''}\n onChange={(e) =>\n updateEventFilter({ search: e.target.value.trim() || undefined })\n }\n placeholder={tr('calendar.searchEvents', 'Search events, tags, or calendars')}\n aria-label={tr('calendar.searchEvents', 'Search events, tags, or calendars')}\n className=\"w-full px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-border\"\n />\n </div>\n\n <select\n value={eventFilter.status?.[0] ?? ''}\n onChange={(e) =>\n updateEventFilter({\n status: e.target.value\n ? [e.target.value as 'CONFIRMED' | 'TENTATIVE' | 'CANCELLED']\n : undefined,\n })\n }\n className=\"w-full px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm focus:outline-none focus:ring-2 focus:ring-action-primary-border\"\n >\n <option value=\"\">{tr('calendar.allStatuses', 'All statuses')}</option>\n <option value=\"CONFIRMED\">\n {tr('calendar.eventStatusConfirmed', 'Confirmed')}\n </option>\n <option value=\"TENTATIVE\">\n {tr('calendar.eventStatusTentative', 'Tentative')}\n </option>\n <option value=\"CANCELLED\">\n {tr('calendar.eventStatusCancelled', 'Cancelled')}\n </option>\n </select>\n </div>\n\n <div className=\"space-y-3\">\n <div className=\"flex items-center justify-between\">\n <h3 className=\"font-text-sm font-weight-semibold text-text-primary\">\n {tr('calendar.visibleCalendars', 'Visible calendars')}\n </h3>\n <button\n type=\"button\"\n onClick={() => setVisibleCalendars([])}\n className=\"font-text-xs text-action-primary-bg hover:underline\"\n >\n {tr('calendar.showAll', 'Show all')}\n </button>\n </div>\n\n <div className=\"space-y-2 max-h-[280px] overflow-auto pr-1\">\n {calendars.map((calendar) => (\n <label\n key={calendar.id}\n className=\"flex items-center gap-3 rounded-radius-md border border-border-subtle px-3 py-2 hover:bg-bg-canvas\"\n >\n <input\n type=\"checkbox\"\n checked={effectiveVisibleCalendars.has(calendar.id)}\n onChange={() => handleToggleCalendar(calendar.id)}\n className=\"size-4 rounded border-border-default\"\n aria-label={calendar.name}\n />\n <span\n className=\"size-3 rounded-full shrink-0\"\n style={{\n backgroundColor: calendar.color ?? 'var(--color-action-primary-bg)',\n }}\n />\n <span className=\"min-w-0 flex-1 truncate font-text-sm text-text-primary\">\n {calendar.name}\n </span>\n </label>\n ))}\n </div>\n\n <div className=\"rounded-radius-md border border-border-subtle bg-bg-canvas px-3 py-2\">\n <p className=\"font-text-xs font-weight-semibold text-text-primary mb-1\">\n {tr('calendar.schedulerOverlay', 'Scheduler overlay')}\n </p>\n <p className=\"font-text-xs text-text-secondary\">\n {tr(\n 'calendar.schedulerOverlayDescription',\n 'Scheduled jobs from scheduler are shown in calendar views and deep-link to /scheduler.'\n )}\n </p>\n </div>\n\n {taskOverlay && (\n <div className=\"space-y-2 rounded-radius-md border border-border-subtle px-3 py-2\">\n <p className=\"font-text-xs font-weight-semibold text-text-primary\">\n {tr('calendar.taskOverlay', 'Tasks & milestones')}\n </p>\n <label className=\"flex items-center gap-3 py-1\">\n <input\n type=\"checkbox\"\n checked={eventFilter.showTasks !== false}\n onChange={(e) => updateEventFilter({ showTasks: e.target.checked })}\n className=\"size-4 rounded border-border-default\"\n aria-label={tr('calendar.showTasks', 'Show tasks')}\n />\n <span\n className=\"size-3 rounded-full shrink-0\"\n style={{ backgroundColor: 'var(--color-accent-blue)' }}\n />\n <span className=\"min-w-0 flex-1 truncate font-text-sm text-text-primary\">\n {tr('calendar.showTasks', 'Show tasks')}\n </span>\n </label>\n <label className=\"flex items-center gap-3 py-1\">\n <input\n type=\"checkbox\"\n checked={eventFilter.showMilestones !== false}\n onChange={(e) => updateEventFilter({ showMilestones: e.target.checked })}\n className=\"size-4 rounded border-border-default\"\n aria-label={tr('calendar.showMilestones', 'Show milestones')}\n />\n <span\n className=\"size-3 rounded-full shrink-0\"\n style={{ backgroundColor: 'var(--color-accent-purple)' }}\n />\n <span className=\"min-w-0 flex-1 truncate font-text-sm text-text-primary\">\n {tr('calendar.showMilestones', 'Show milestones')}\n </span>\n </label>\n </div>\n )}\n </div>\n\n <div className=\"space-y-2 pt-2 border-t border-border-subtle\">\n <button\n type=\"button\"\n onClick={() => navigate(`${basePath}/settings`)}\n className=\"w-full inline-flex items-center gap-2 px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas hover:bg-bg-elevated text-text-primary font-text-sm\"\n >\n <Settings2 className=\"size-4\" />\n {tr('calendar.manageCalendarSettings', 'Manage calendar settings')}\n </button>\n <button\n type=\"button\"\n onClick={() => navigate(`${basePath}/resources`)}\n className=\"w-full inline-flex items-center gap-2 px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas hover:bg-bg-elevated text-text-primary font-text-sm\"\n >\n {tr('calendar.openResources', 'Open resources')}\n </button>\n <button\n type=\"button\"\n onClick={() => navigate(`${basePath}/subscriptions`)}\n className=\"w-full inline-flex items-center gap-2 px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas hover:bg-bg-elevated text-text-primary font-text-sm\"\n >\n {tr('calendar.exportAndSubscriptions', 'Export and subscriptions')}\n </button>\n </div>\n </aside>\n )}\n\n {/* Calendar view — host shell already renders <main>, use a plain div */}\n <div className=\"min-w-0 flex-1 p-6\">\n <NextSteps\n storageKey=\"calendar-overview\"\n className=\"mb-4\"\n steps={[\n ...(canCreateEvents\n ? [\n {\n id: 'create-event',\n label: tr('calendar.nextStepCreateEvent', 'Create your first event'),\n description: tr(\n 'calendar.nextStepCreateEventDesc',\n 'Add a meeting, reminder, or all-day event to this calendar.'\n ),\n icon: <CalendarPlus className=\"size-4\" />,\n onClick: () => {\n setCreateSlot(null);\n setShowCreateModal(true);\n },\n },\n ]\n : []),\n {\n id: 'book-resources',\n label: tr('calendar.nextStepResources', 'Book rooms and resources'),\n description: tr(\n 'calendar.nextStepResourcesDesc',\n 'Reserve conference rooms, equipment, and desks for your events.'\n ),\n icon: <DoorOpen className=\"size-4\" />,\n onClick: () => navigate(`${basePath}/resources`),\n },\n {\n id: 'export-subscribe',\n label: tr('calendar.nextStepSubscriptions', 'Export or subscribe'),\n description: tr(\n 'calendar.nextStepSubscriptionsDesc',\n 'Download ICS files to sync with Google, Apple, or Outlook calendars.'\n ),\n icon: <Rss className=\"size-4\" />,\n onClick: () => navigate(`${basePath}/subscriptions`),\n },\n {\n id: 'tune-settings',\n label: tr('calendar.nextStepSettings', 'Tune your calendar settings'),\n description: tr(\n 'calendar.nextStepSettingsDesc',\n 'Set availability, sharing, booking pages, and default view.'\n ),\n icon: <Settings2 className=\"size-4\" />,\n onClick: () => navigate(`${basePath}/settings`),\n },\n ]}\n />\n {currentView === 'day' && <DayView onCreateSlot={handleCreateSlot} />}\n {currentView === 'week' && <WeekView onCreateSlot={handleCreateSlot} />}\n {currentView === 'month' && <MonthView onCreateSlot={handleCreateSlot} />}\n {currentView === 'year' && <YearView />}\n {currentView === 'agenda' && <AgendaView />}\n {currentView === 'timeline' && <TimelineView />}\n </div>\n </div>\n\n {/* Create Event Modal */}\n <EventFormModal\n open={showCreateModal}\n defaultDate={createSlot?.date ?? currentDate}\n defaultStartHour={createSlot?.hour}\n onClose={() => {\n setShowCreateModal(false);\n setCreateSlot(null);\n }}\n />\n\n {/* Read-only details for a clicked PlanMagnet task / milestone overlay */}\n <TaskEventDetail />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAqCA,SAAg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