@burdenoff/microfe-calendar 2026.830.1 → 2026.1013.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/CalendarRoot.d.ts.map +1 -1
- package/dist/CalendarRoot.js +35 -38
- package/dist/CalendarRoot.js.map +1 -1
- package/dist/CalendarRoutes.d.ts.map +1 -1
- package/dist/CalendarRoutes.js +35 -34
- package/dist/CalendarRoutes.js.map +1 -1
- package/dist/components/AgendaView.d.ts.map +1 -1
- package/dist/components/AgendaView.js +33 -36
- package/dist/components/AgendaView.js.map +1 -1
- package/dist/components/CalendarErrorState.d.ts.map +1 -1
- package/dist/components/CalendarErrorState.js +4 -7
- package/dist/components/CalendarErrorState.js.map +1 -1
- package/dist/components/ConfirmDialog.d.ts.map +1 -1
- package/dist/components/ConfirmDialog.js +11 -14
- package/dist/components/ConfirmDialog.js.map +1 -1
- package/dist/components/DayView.d.ts.map +1 -1
- package/dist/components/DayView.js +21 -24
- package/dist/components/DayView.js.map +1 -1
- package/dist/components/EventFormModal.d.ts.map +1 -1
- package/dist/components/EventFormModal.js +184 -187
- package/dist/components/EventFormModal.js.map +1 -1
- package/dist/components/MiniCalendar.d.ts.map +1 -1
- package/dist/components/MiniCalendar.js +38 -37
- package/dist/components/MiniCalendar.js.map +1 -1
- package/dist/components/MonthView.d.ts.map +1 -1
- package/dist/components/MonthView.js +28 -31
- package/dist/components/MonthView.js.map +1 -1
- package/dist/components/TaskEventDetail.d.ts.map +1 -1
- package/dist/components/TaskEventDetail.js +28 -31
- package/dist/components/TaskEventDetail.js.map +1 -1
- package/dist/components/TimelineView.d.ts.map +1 -1
- package/dist/components/TimelineView.js +35 -38
- package/dist/components/TimelineView.js.map +1 -1
- package/dist/components/ViewSwitcher.d.ts.map +1 -1
- package/dist/components/ViewSwitcher.js +13 -16
- package/dist/components/ViewSwitcher.js.map +1 -1
- package/dist/components/WeekView.d.ts.map +1 -1
- package/dist/components/WeekView.js +24 -27
- package/dist/components/WeekView.js.map +1 -1
- package/dist/components/YearView.d.ts.map +1 -1
- package/dist/components/YearView.js +30 -33
- package/dist/components/YearView.js.map +1 -1
- package/dist/pages/CalendarPage.d.ts.map +1 -1
- package/dist/pages/CalendarPage.js +173 -176
- package/dist/pages/CalendarPage.js.map +1 -1
- package/dist/pages/EventDetailsPage.d.ts.map +1 -1
- package/dist/pages/EventDetailsPage.js +88 -85
- package/dist/pages/EventDetailsPage.js.map +1 -1
- package/dist/pages/ResourcesPage.d.ts.map +1 -1
- package/dist/pages/ResourcesPage.js +197 -200
- package/dist/pages/ResourcesPage.js.map +1 -1
- package/dist/pages/SettingsPage.d.ts.map +1 -1
- package/dist/pages/SettingsPage.js +213 -169
- package/dist/pages/SettingsPage.js.map +1 -1
- package/dist/pages/SubscriptionsPage.d.ts.map +1 -1
- package/dist/pages/SubscriptionsPage.js +37 -40
- package/dist/pages/SubscriptionsPage.js.map +1 -1
- package/dist/shared/hooks/useTr.d.ts +17 -0
- package/dist/shared/hooks/useTr.d.ts.map +1 -0
- package/dist/shared/hooks/useTr.js +14 -0
- package/dist/shared/hooks/useTr.js.map +1 -0
- package/dist/translations/en.d.ts +351 -0
- package/dist/translations/en.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarRoot.d.ts","sourceRoot":"","sources":["../src/CalendarRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"CalendarRoot.d.ts","sourceRoot":"","sources":["../src/CalendarRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAa,MAAM,OAAO,CAAC;AAM3C,OAAO,KAAK,EAAE,iBAAiB,EAAuB,MAAM,SAAS,CAAC;AAGtE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA6F9C,CAAC"}
|
package/dist/CalendarRoot.js
CHANGED
|
@@ -1,81 +1,78 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { useTr as e } from "./shared/hooks/useTr.js";
|
|
2
|
+
import { CalendarProvider as t } from "./providers/CalendarProvider.js";
|
|
3
|
+
import { CalendarRoutes as n } from "./CalendarRoutes.js";
|
|
4
|
+
import { useEffect as r } from "react";
|
|
4
5
|
import { ErrorBoundary as i } from "@burdenoff/fe-libs/shared/components";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { FeatureFlagProvider as d } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
6
|
+
import { CalendarDays as a, DoorOpen as o, Rss as s, Settings as c } from "lucide-react";
|
|
7
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
8
|
+
import { FeatureFlagProvider as u } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
9
9
|
//#region src/CalendarRoot.tsx
|
|
10
|
-
var
|
|
11
|
-
let { registerNavItems:
|
|
12
|
-
let n = g(e);
|
|
13
|
-
return n === e ? t : n;
|
|
14
|
-
}, [g]), v = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`);
|
|
10
|
+
var d = (d) => {
|
|
11
|
+
let { registerNavItems: f, registerFooterItems: p, basePath: m = "/" } = d, h = e(), g = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`);
|
|
15
12
|
return r(() => {
|
|
16
|
-
if (
|
|
13
|
+
if (f) return f([
|
|
17
14
|
{
|
|
18
15
|
id: "calendar-main",
|
|
19
|
-
label:
|
|
20
|
-
path:
|
|
21
|
-
icon: /* @__PURE__ */
|
|
16
|
+
label: h("calendar.myCalendar", "My Calendar"),
|
|
17
|
+
path: m === "/" ? "/" : m,
|
|
18
|
+
icon: /* @__PURE__ */ l(a, { size: 20 }),
|
|
22
19
|
order: 10,
|
|
23
20
|
group: "calendar"
|
|
24
21
|
},
|
|
25
22
|
{
|
|
26
23
|
id: "calendar-resources",
|
|
27
|
-
label:
|
|
28
|
-
path:
|
|
29
|
-
icon: /* @__PURE__ */
|
|
24
|
+
label: h("calendar.resources", "Resources"),
|
|
25
|
+
path: g(m, "resources"),
|
|
26
|
+
icon: /* @__PURE__ */ l(o, { size: 20 }),
|
|
30
27
|
order: 20,
|
|
31
28
|
group: "calendar"
|
|
32
29
|
},
|
|
33
30
|
{
|
|
34
31
|
id: "calendar-subscriptions",
|
|
35
|
-
label:
|
|
36
|
-
path:
|
|
37
|
-
icon: /* @__PURE__ */
|
|
32
|
+
label: h("calendar.subscriptions", "Subscriptions"),
|
|
33
|
+
path: g(m, "subscriptions"),
|
|
34
|
+
icon: /* @__PURE__ */ l(s, { size: 20 }),
|
|
38
35
|
order: 30,
|
|
39
36
|
group: "calendar"
|
|
40
37
|
},
|
|
41
38
|
{
|
|
42
39
|
id: "calendar-settings",
|
|
43
|
-
label:
|
|
44
|
-
path:
|
|
45
|
-
icon: /* @__PURE__ */
|
|
40
|
+
label: h("calendar.settings", "Settings"),
|
|
41
|
+
path: g(m, "settings"),
|
|
42
|
+
icon: /* @__PURE__ */ l(c, { size: 20 }),
|
|
46
43
|
order: 40,
|
|
47
44
|
group: "calendar"
|
|
48
45
|
}
|
|
49
46
|
]);
|
|
50
47
|
}, [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
f,
|
|
49
|
+
m,
|
|
50
|
+
h
|
|
54
51
|
]), r(() => {
|
|
55
|
-
if (
|
|
52
|
+
if (p) return p([{
|
|
56
53
|
id: "calendar-status",
|
|
57
|
-
label:
|
|
54
|
+
label: h("calendar.calendarReady", "Calendar Ready"),
|
|
58
55
|
type: "status",
|
|
59
56
|
order: 10,
|
|
60
57
|
section: "left"
|
|
61
58
|
}]);
|
|
62
|
-
}, [
|
|
63
|
-
fallback: /* @__PURE__ */
|
|
59
|
+
}, [p, h]), /* @__PURE__ */ l(i, {
|
|
60
|
+
fallback: /* @__PURE__ */ l("div", {
|
|
64
61
|
className: "p-6 text-center text-text-secondary",
|
|
65
|
-
children: "Something went wrong loading this module. Please refresh the page."
|
|
62
|
+
children: h("calendar.moduleLoadError", "Something went wrong loading this module. Please refresh the page.")
|
|
66
63
|
}),
|
|
67
|
-
children: /* @__PURE__ */ u
|
|
64
|
+
children: /* @__PURE__ */ l(u, {
|
|
68
65
|
workspaceId: null,
|
|
69
66
|
gateway: "global",
|
|
70
67
|
defaultEnabled: !0,
|
|
71
|
-
children: /* @__PURE__ */
|
|
72
|
-
...
|
|
73
|
-
children: /* @__PURE__ */
|
|
68
|
+
children: /* @__PURE__ */ l(t, {
|
|
69
|
+
...d,
|
|
70
|
+
children: /* @__PURE__ */ l(n, {})
|
|
74
71
|
})
|
|
75
72
|
})
|
|
76
73
|
});
|
|
77
74
|
};
|
|
78
75
|
//#endregion
|
|
79
|
-
export {
|
|
76
|
+
export { d as CalendarRoot };
|
|
80
77
|
|
|
81
78
|
//# sourceMappingURL=CalendarRoot.js.map
|
package/dist/CalendarRoot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarRoot.js","names":[],"sources":["../src/CalendarRoot.tsx"],"sourcesContent":["import { type FC,
|
|
1
|
+
{"version":3,"file":"CalendarRoot.js","names":[],"sources":["../src/CalendarRoot.tsx"],"sourcesContent":["import { type FC, useEffect } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { useTr } from './shared/hooks/useTr';\nimport { CalendarDays, DoorOpen, Rss, Settings } from 'lucide-react';\nimport { CalendarProvider } from './providers/CalendarProvider';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport type { CalendarRootProps, NavItem, FooterItem } from './types';\nimport { CalendarRoutes } from './CalendarRoutes';\n\n/**\n * Root component for the Calendar microfrontend.\n *\n * This is the main entry point that host applications import and render.\n * It sets up the necessary providers and renders the internal routing.\n * Automatically registers navigation items with the shell if registration functions are provided.\n *\n * @example\n * ```tsx\n * import { CalendarRoot, type CalendarRootProps } from '@burdenoff/micro-fe/calendar';\n *\n * function App() {\n * const props: CalendarRootProps = {\n * basePath: '/calendar',\n * navigate: (path) => router.push(path),\n * currentUser: { id: '1', email: 'user@example.com' },\n * workspaceId: 'ws-123',\n * apiGatewayUrl: 'https://api.example.com',\n * authToken: 'token',\n * defaultView: 'week',\n * onEventSelect: (event) => console.log('Event selected:', event),\n * registerNavItems: (items) => { return () => {}; },\n * };\n *\n * return <CalendarRoot {...props} />;\n * }\n * ```\n */\nexport const CalendarRoot: FC<CalendarRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const tr = useTr();\n\n // Helper to join paths correctly, avoiding double slashes\n const joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith('/') ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith('/') ? path : `/${path}`;\n return cleanBase + cleanPath;\n };\n\n // Register navigation items with the shell\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'calendar-main',\n label: tr('calendar.myCalendar', 'My Calendar'),\n path: basePath === '/' ? '/' : basePath,\n icon: <CalendarDays size={20} />,\n order: 10,\n group: 'calendar',\n },\n {\n id: 'calendar-resources',\n label: tr('calendar.resources', 'Resources'),\n path: joinPath(basePath, 'resources'),\n icon: <DoorOpen size={20} />,\n order: 20,\n group: 'calendar',\n },\n {\n id: 'calendar-subscriptions',\n label: tr('calendar.subscriptions', 'Subscriptions'),\n path: joinPath(basePath, 'subscriptions'),\n icon: <Rss size={20} />,\n order: 30,\n group: 'calendar',\n },\n {\n id: 'calendar-settings',\n label: tr('calendar.settings', 'Settings'),\n path: joinPath(basePath, 'settings'),\n icon: <Settings size={20} />,\n order: 40,\n group: 'calendar',\n },\n ];\n\n // Register and get cleanup function\n const cleanup = registerNavItems(navItems);\n\n // Return cleanup function to unregister on unmount\n return cleanup;\n }, [registerNavItems, basePath, tr]);\n\n // Register footer items\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems: FooterItem[] = [\n {\n id: 'calendar-status',\n label: tr('calendar.calendarReady', 'Calendar Ready'),\n type: 'status',\n order: 10,\n section: 'left',\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [registerFooterItems, tr]);\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n {tr(\n 'calendar.moduleLoadError',\n 'Something went wrong loading this module. Please refresh the page.'\n )}\n </div>\n }\n >\n <FeatureFlagProvider workspaceId={null} gateway=\"global\" defaultEnabled={true}>\n <CalendarProvider {...props}>\n <CalendarRoutes />\n </CalendarProvider>\n </FeatureFlagProvider>\n </ErrorBoundary>\n );\n};\n"],"mappings":";;;;;;;;;AAqCA,IAAa,KAAuC,MAAU;CAC5D,IAAM,EAAE,qBAAkB,wBAAqB,cAAW,QAAQ,GAC5D,IAAK,GAAO,EAGZ,KAAY,GAAc,OACZ,EAAK,SAAS,IAAI,GAAG,EAAK,MAAM,GAAG,GAAG,GAAG,MACzC,EAAK,WAAW,IAAI,GAAG,IAAO,IAAI;AAoEtD,QA/DA,QAAgB;AACT,QAyCL,QAHgB,EApCY;GAC1B;IACE,IAAI;IACJ,OAAO,EAAG,uBAAuB,cAAc;IAC/C,MAAM,MAAa,MAAM,MAAM;IAC/B,MAAM,kBAAC,GAAD,EAAc,MAAM,IAAM,CAAA;IAChC,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO,EAAG,sBAAsB,YAAY;IAC5C,MAAM,EAAS,GAAU,YAAY;IACrC,MAAM,kBAAC,GAAD,EAAU,MAAM,IAAM,CAAA;IAC5B,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO,EAAG,0BAA0B,gBAAgB;IACpD,MAAM,EAAS,GAAU,gBAAgB;IACzC,MAAM,kBAAC,GAAD,EAAK,MAAM,IAAM,CAAA;IACvB,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO,EAAG,qBAAqB,WAAW;IAC1C,MAAM,EAAS,GAAU,WAAW;IACpC,MAAM,kBAAC,GAAD,EAAU,MAAM,IAAM,CAAA;IAC5B,OAAO;IACP,OAAO;IACR;GACF,CAGyC;IAIzC;EAAC;EAAkB;EAAU;EAAG,CAAC,EAGpC,QAAgB;AACT,QAaL,QADgB,EAVkB,CAChC;GACE,IAAI;GACJ,OAAO,EAAG,0BAA0B,iBAAiB;GACrD,MAAM;GACN,OAAO;GACP,SAAS;GACV,CACF,CAE+C;IAE/C,CAAC,GAAqB,EAAG,CAAC,EAG3B,kBAAC,GAAD;EACE,UACE,kBAAC,OAAD;GAAK,WAAU;aACZ,EACC,4BACA,qEACD;GACG,CAAA;YAGR,kBAAC,GAAD;GAAqB,aAAa;GAAM,SAAQ;GAAS,gBAAgB;aACvE,kBAAC,GAAD;IAAkB,GAAI;cACpB,kBAAC,GAAD,EAAkB,CAAA;IACD,CAAA;GACC,CAAA;EACR,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarRoutes.d.ts","sourceRoot":"","sources":["../src/CalendarRoutes.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CalendarRoutes.d.ts","sourceRoot":"","sources":["../src/CalendarRoutes.tsx"],"names":[],"mappings":"AAiCA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,gCAsD7B"}
|
package/dist/CalendarRoutes.js
CHANGED
|
@@ -1,62 +1,63 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { useTr as e } from "./shared/hooks/useTr.js";
|
|
2
|
+
import { CalendarPage as t } from "./pages/CalendarPage.js";
|
|
3
|
+
import { Suspense as n, lazy as r } from "react";
|
|
4
|
+
import { Navigate as i, Route as a, Routes as o } from "react-router";
|
|
5
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
5
6
|
//#region src/CalendarRoutes.tsx
|
|
6
|
-
var
|
|
7
|
-
function
|
|
8
|
-
return /* @__PURE__ */
|
|
7
|
+
var l = r(() => import("./pages/EventDetailsPage.js").then((e) => ({ default: e.EventDetailsPage }))), u = r(() => import("./pages/ResourcesPage.js").then((e) => ({ default: e.ResourcesPage }))), d = r(() => import("./pages/SettingsPage.js").then((e) => ({ default: e.SettingsPage }))), f = r(() => import("./pages/SubscriptionsPage.js").then((e) => ({ default: e.SubscriptionsPage })));
|
|
8
|
+
function p() {
|
|
9
|
+
return /* @__PURE__ */ s("div", {
|
|
9
10
|
className: "min-h-screen bg-bg-canvas flex items-center justify-center",
|
|
10
|
-
children: /* @__PURE__ */
|
|
11
|
+
children: /* @__PURE__ */ s("div", {
|
|
11
12
|
className: "text-text-secondary font-text-md",
|
|
12
|
-
children: "Loading…"
|
|
13
|
+
children: e()("calendar.loadingPage", "Loading…")
|
|
13
14
|
})
|
|
14
15
|
});
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
/* @__PURE__ */
|
|
17
|
+
function m() {
|
|
18
|
+
return /* @__PURE__ */ c(o, { children: [
|
|
19
|
+
/* @__PURE__ */ s(a, {
|
|
19
20
|
index: !0,
|
|
20
|
-
element: /* @__PURE__ */
|
|
21
|
+
element: /* @__PURE__ */ s(i, {
|
|
21
22
|
to: "view/week",
|
|
22
23
|
replace: !0
|
|
23
24
|
})
|
|
24
25
|
}),
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
+
/* @__PURE__ */ s(a, {
|
|
26
27
|
path: "view/:viewType",
|
|
27
|
-
element: /* @__PURE__ */
|
|
28
|
+
element: /* @__PURE__ */ s(t, {})
|
|
28
29
|
}),
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ s(a, {
|
|
30
31
|
path: "event/:eventId",
|
|
31
|
-
element: /* @__PURE__ */
|
|
32
|
-
fallback: /* @__PURE__ */
|
|
33
|
-
children: /* @__PURE__ */
|
|
32
|
+
element: /* @__PURE__ */ s(n, {
|
|
33
|
+
fallback: /* @__PURE__ */ s(p, {}),
|
|
34
|
+
children: /* @__PURE__ */ s(l, {})
|
|
34
35
|
})
|
|
35
36
|
}),
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ s(a, {
|
|
37
38
|
path: "resources",
|
|
38
|
-
element: /* @__PURE__ */
|
|
39
|
-
fallback: /* @__PURE__ */
|
|
40
|
-
children: /* @__PURE__ */
|
|
39
|
+
element: /* @__PURE__ */ s(n, {
|
|
40
|
+
fallback: /* @__PURE__ */ s(p, {}),
|
|
41
|
+
children: /* @__PURE__ */ s(u, {})
|
|
41
42
|
})
|
|
42
43
|
}),
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */ s(a, {
|
|
44
45
|
path: "settings",
|
|
45
|
-
element: /* @__PURE__ */
|
|
46
|
-
fallback: /* @__PURE__ */
|
|
47
|
-
children: /* @__PURE__ */
|
|
46
|
+
element: /* @__PURE__ */ s(n, {
|
|
47
|
+
fallback: /* @__PURE__ */ s(p, {}),
|
|
48
|
+
children: /* @__PURE__ */ s(d, {})
|
|
48
49
|
})
|
|
49
50
|
}),
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ s(a, {
|
|
51
52
|
path: "subscriptions",
|
|
52
|
-
element: /* @__PURE__ */
|
|
53
|
-
fallback: /* @__PURE__ */
|
|
54
|
-
children: /* @__PURE__ */
|
|
53
|
+
element: /* @__PURE__ */ s(n, {
|
|
54
|
+
fallback: /* @__PURE__ */ s(p, {}),
|
|
55
|
+
children: /* @__PURE__ */ s(f, {})
|
|
55
56
|
})
|
|
56
57
|
}),
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ s(a, {
|
|
58
59
|
path: "*",
|
|
59
|
-
element: /* @__PURE__ */
|
|
60
|
+
element: /* @__PURE__ */ s(i, {
|
|
60
61
|
to: "view/week",
|
|
61
62
|
replace: !0
|
|
62
63
|
})
|
|
@@ -64,6 +65,6 @@ function p() {
|
|
|
64
65
|
] });
|
|
65
66
|
}
|
|
66
67
|
//#endregion
|
|
67
|
-
export {
|
|
68
|
+
export { m as CalendarRoutes };
|
|
68
69
|
|
|
69
70
|
//# sourceMappingURL=CalendarRoutes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarRoutes.js","names":[],"sources":["../src/CalendarRoutes.tsx"],"sourcesContent":["import { lazy, Suspense } from 'react';\nimport { Navigate, Route, Routes } from 'react-router';\nimport { CalendarPage } from './pages/CalendarPage';\n\n// Lazy-loaded pages for code splitting\nconst EventDetailsPage = lazy(() =>\n import('./pages/EventDetailsPage').then((m) => ({ default: m.EventDetailsPage }))\n);\nconst ResourcesPage = lazy(() =>\n import('./pages/ResourcesPage').then((m) => ({ default: m.ResourcesPage }))\n);\nconst SettingsPage = lazy(() =>\n import('./pages/SettingsPage').then((m) => ({ default: m.SettingsPage }))\n);\nconst SubscriptionsPage = lazy(() =>\n import('./pages/SubscriptionsPage').then((m) => ({ default: m.SubscriptionsPage }))\n);\n\n/**\n * Fallback component for lazy-loaded pages\n */\nfunction PageLoadingFallback() {\n return (\n <div className=\"min-h-screen bg-bg-canvas flex items-center justify-center\">\n <div className=\"text-text-secondary font-text-md\"
|
|
1
|
+
{"version":3,"file":"CalendarRoutes.js","names":[],"sources":["../src/CalendarRoutes.tsx"],"sourcesContent":["import { lazy, Suspense } from 'react';\nimport { Navigate, Route, Routes } from 'react-router';\nimport { useTr } from './shared/hooks/useTr';\nimport { CalendarPage } from './pages/CalendarPage';\n\n// Lazy-loaded pages for code splitting\nconst EventDetailsPage = lazy(() =>\n import('./pages/EventDetailsPage').then((m) => ({ default: m.EventDetailsPage }))\n);\nconst ResourcesPage = lazy(() =>\n import('./pages/ResourcesPage').then((m) => ({ default: m.ResourcesPage }))\n);\nconst SettingsPage = lazy(() =>\n import('./pages/SettingsPage').then((m) => ({ default: m.SettingsPage }))\n);\nconst SubscriptionsPage = lazy(() =>\n import('./pages/SubscriptionsPage').then((m) => ({ default: m.SubscriptionsPage }))\n);\n\n/**\n * Fallback component for lazy-loaded pages\n */\nfunction PageLoadingFallback() {\n const tr = useTr();\n return (\n <div className=\"min-h-screen bg-bg-canvas flex items-center justify-center\">\n <div className=\"text-text-secondary font-text-md\">\n {tr('calendar.loadingPage', 'Loading…')}\n </div>\n </div>\n );\n}\n\n/**\n * Internal routing for the Calendar microfrontend.\n *\n * All routes are relative to the basePath provided by the host.\n * Example: If basePath=\"/calendar\", then:\n * - /calendar → redirects to /calendar/view/week\n * - /calendar/view/week → CalendarPage (week view)\n * - /calendar/event/:eventId → EventDetailsPage\n * - /calendar/resources → ResourcesPage\n * - /calendar/settings → SettingsPage\n * - /calendar/subscriptions → SubscriptionsPage\n *\n * Lazy Loading Strategy:\n * - CalendarPage: Eager (main entry point, most frequently accessed)\n * - EventDetailsPage: Lazy (accessed on-demand)\n * - ResourcesPage: Lazy (secondary feature)\n * - SettingsPage: Lazy (infrequently accessed)\n * - SubscriptionsPage: Lazy (infrequently accessed)\n */\nexport function CalendarRoutes() {\n return (\n <Routes>\n {/* Default redirect to week view */}\n <Route index element={<Navigate to=\"view/week\" replace />} />\n\n {/* Calendar views - Eager loaded (primary entry point) */}\n <Route path=\"view/:viewType\" element={<CalendarPage />} />\n {/* viewType: day | week | month | year | agenda | timeline */}\n\n {/* Event details - Lazy loaded */}\n <Route\n path=\"event/:eventId\"\n element={\n <Suspense fallback={<PageLoadingFallback />}>\n <EventDetailsPage />\n </Suspense>\n }\n />\n\n {/* Resources - Lazy loaded */}\n <Route\n path=\"resources\"\n element={\n <Suspense fallback={<PageLoadingFallback />}>\n <ResourcesPage />\n </Suspense>\n }\n />\n\n {/* Settings - Lazy loaded */}\n <Route\n path=\"settings\"\n element={\n <Suspense fallback={<PageLoadingFallback />}>\n <SettingsPage />\n </Suspense>\n }\n />\n\n {/* Subscriptions - Lazy loaded */}\n <Route\n path=\"subscriptions\"\n element={\n <Suspense fallback={<PageLoadingFallback />}>\n <SubscriptionsPage />\n </Suspense>\n }\n />\n\n {/* Catch-all: redirect to default view */}\n <Route path=\"*\" element={<Navigate to=\"view/week\" replace />} />\n </Routes>\n );\n}\n"],"mappings":";;;;;;AAMA,IAAM,IAAmB,QACvB,OAAO,+BAA4B,MAAM,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAClF,EACK,IAAgB,QACpB,OAAO,4BAAyB,MAAM,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAC5E,EACK,IAAe,QACnB,OAAO,2BAAwB,MAAM,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAC1E,EACK,IAAoB,QACxB,OAAO,gCAA6B,MAAM,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,CACpF;AAKD,SAAS,IAAsB;AAE7B,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,OAAD;GAAK,WAAU;aAHR,GAAO,CAIR,wBAAwB,WAAW;GACnC,CAAA;EACF,CAAA;;AAuBV,SAAgB,IAAiB;AAC/B,QACE,kBAAC,GAAD,EAAA,UAAA;EAEE,kBAAC,GAAD;GAAO,OAAA;GAAM,SAAS,kBAAC,GAAD;IAAU,IAAG;IAAY,SAAA;IAAU,CAAA;GAAI,CAAA;EAG7D,kBAAC,GAAD;GAAO,MAAK;GAAiB,SAAS,kBAAC,GAAD,EAAgB,CAAA;GAAI,CAAA;EAI1D,kBAAC,GAAD;GACE,MAAK;GACL,SACE,kBAAC,GAAD;IAAU,UAAU,kBAAC,GAAD,EAAuB,CAAA;cACzC,kBAAC,GAAD,EAAoB,CAAA;IACX,CAAA;GAEb,CAAA;EAGF,kBAAC,GAAD;GACE,MAAK;GACL,SACE,kBAAC,GAAD;IAAU,UAAU,kBAAC,GAAD,EAAuB,CAAA;cACzC,kBAAC,GAAD,EAAiB,CAAA;IACR,CAAA;GAEb,CAAA;EAGF,kBAAC,GAAD;GACE,MAAK;GACL,SACE,kBAAC,GAAD;IAAU,UAAU,kBAAC,GAAD,EAAuB,CAAA;cACzC,kBAAC,GAAD,EAAgB,CAAA;IACP,CAAA;GAEb,CAAA;EAGF,kBAAC,GAAD;GACE,MAAK;GACL,SACE,kBAAC,GAAD;IAAU,UAAU,kBAAC,GAAD,EAAuB,CAAA;cACzC,kBAAC,GAAD,EAAqB,CAAA;IACZ,CAAA;GAEb,CAAA;EAGF,kBAAC,GAAD;GAAO,MAAK;GAAI,SAAS,kBAAC,GAAD;IAAU,IAAG;IAAY,SAAA;IAAU,CAAA;GAAI,CAAA;EACzD,EAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgendaView.d.ts","sourceRoot":"","sources":["../../src/components/AgendaView.tsx"],"names":[],"mappings":"AAUA;;;GAGG;AACH,wBAAgB,UAAU,
|
|
1
|
+
{"version":3,"file":"AgendaView.d.ts","sourceRoot":"","sources":["../../src/components/AgendaView.tsx"],"names":[],"mappings":"AAUA;;;GAGG;AACH,wBAAgB,UAAU,gCA8IzB"}
|
|
@@ -1,55 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { useTr as e } from "../shared/hooks/useTr.js";
|
|
2
|
+
import { useCalendarStore as t } from "../store/calendarStore.js";
|
|
3
|
+
import { addDays as n, formatTime as r, isSameDay as i, startOfDay as a } from "../utils/dateHelpers.js";
|
|
4
|
+
import { useEvents as o } from "../hooks/useEvents.js";
|
|
5
|
+
import { EventBlock as s } from "./EventBlock.js";
|
|
6
|
+
import { CalendarErrorState as c } from "./CalendarErrorState.js";
|
|
7
|
+
import { useEffect as l, useState as u } from "react";
|
|
8
8
|
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
9
9
|
import { GlassCard as p, IllustratedEmptyState as m } from "@burdenoff/fe-libs/ui";
|
|
10
10
|
//#region src/components/AgendaView.tsx
|
|
11
11
|
function h() {
|
|
12
|
-
let h =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}), [C, w] = l(null);
|
|
19
|
-
c(() => {
|
|
20
|
-
Promise.resolve().then(() => w(/* @__PURE__ */ new Date()));
|
|
12
|
+
let h = t((e) => e.currentDate), g = e(), _ = a(h), { events: v, isLoading: y, error: b, refetch: x } = o({
|
|
13
|
+
startDate: _,
|
|
14
|
+
endDate: n(_, 30)
|
|
15
|
+
}), [S, C] = u(null);
|
|
16
|
+
l(() => {
|
|
17
|
+
Promise.resolve().then(() => C(/* @__PURE__ */ new Date()));
|
|
21
18
|
}, []);
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
let t = e.startTime, n = `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, "0")}-${String(t.getDate()).padStart(2, "0")}`, r =
|
|
25
|
-
r.push(e),
|
|
19
|
+
let w = /* @__PURE__ */ new Map();
|
|
20
|
+
v.sort((e, t) => e.startTime.getTime() - t.startTime.getTime()).forEach((e) => {
|
|
21
|
+
let t = e.startTime, n = `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, "0")}-${String(t.getDate()).padStart(2, "0")}`, r = w.get(n) ?? [];
|
|
22
|
+
r.push(e), w.set(n, r);
|
|
26
23
|
});
|
|
27
|
-
let
|
|
24
|
+
let T = Array.from(w.entries());
|
|
28
25
|
return /* @__PURE__ */ d("div", {
|
|
29
26
|
className: "@container",
|
|
30
27
|
children: /* @__PURE__ */ f("div", {
|
|
31
28
|
className: "max-w-3xl mx-auto",
|
|
32
29
|
children: [
|
|
33
|
-
|
|
34
|
-
message:
|
|
35
|
-
onRetry: () => void
|
|
30
|
+
b && /* @__PURE__ */ d(c, {
|
|
31
|
+
message: b,
|
|
32
|
+
onRetry: () => void x()
|
|
36
33
|
}),
|
|
37
|
-
|
|
34
|
+
y && /* @__PURE__ */ d("div", {
|
|
38
35
|
className: "text-center py-2 text-text-tertiary font-text-xs mb-2",
|
|
39
|
-
children:
|
|
36
|
+
children: g("calendar.loadingEvents", "Loading events...")
|
|
40
37
|
}),
|
|
41
|
-
|
|
38
|
+
T.length === 0 && !y && /* @__PURE__ */ d(p, {
|
|
42
39
|
treatment: "plain",
|
|
43
40
|
className: "p-card-padding",
|
|
44
41
|
children: /* @__PURE__ */ d(m, {
|
|
45
42
|
illustration: "empty-data",
|
|
46
|
-
title:
|
|
43
|
+
title: g("calendar.noUpcomingEvents", "No upcoming events in the next 30 days")
|
|
47
44
|
})
|
|
48
45
|
}),
|
|
49
46
|
/* @__PURE__ */ d("div", {
|
|
50
47
|
className: "space-y-4",
|
|
51
|
-
children:
|
|
52
|
-
let
|
|
48
|
+
children: T.map(([e, t]) => {
|
|
49
|
+
let n = /* @__PURE__ */ new Date(e + "T00:00:00"), a = S !== null && i(n, S);
|
|
53
50
|
return /* @__PURE__ */ f(p, {
|
|
54
51
|
treatment: a ? "insight" : "metric",
|
|
55
52
|
glow: a,
|
|
@@ -63,8 +60,8 @@ function h() {
|
|
|
63
60
|
"aria-hidden": "true",
|
|
64
61
|
className: "size-2 rounded-full bg-action-primary-bg motion-safe:animate-vc-glow-pulse"
|
|
65
62
|
}),
|
|
66
|
-
a ? `${
|
|
67
|
-
|
|
63
|
+
a ? `${g("calendar.today", "Today")} - ` : "",
|
|
64
|
+
n.toLocaleDateString("en-US", {
|
|
68
65
|
weekday: "long",
|
|
69
66
|
month: "long",
|
|
70
67
|
day: "numeric"
|
|
@@ -81,22 +78,22 @@ function h() {
|
|
|
81
78
|
className: "w-20 shrink-0",
|
|
82
79
|
children: e.isAllDay ? /* @__PURE__ */ d("span", {
|
|
83
80
|
className: "font-text-xs text-text-tertiary",
|
|
84
|
-
children:
|
|
81
|
+
children: g("calendar.allDay", "All day")
|
|
85
82
|
}) : /* @__PURE__ */ f("div", { children: [
|
|
86
83
|
/* @__PURE__ */ d("span", {
|
|
87
84
|
className: "font-text-sm font-weight-medium text-text-primary",
|
|
88
|
-
children:
|
|
85
|
+
children: r(e.startTime)
|
|
89
86
|
}),
|
|
90
87
|
/* @__PURE__ */ d("br", {}),
|
|
91
88
|
/* @__PURE__ */ d("span", {
|
|
92
89
|
className: "font-text-xs text-text-tertiary",
|
|
93
|
-
children:
|
|
90
|
+
children: r(e.endTime)
|
|
94
91
|
})
|
|
95
92
|
] })
|
|
96
93
|
}), /* @__PURE__ */ f("div", {
|
|
97
94
|
className: "flex-1 min-w-0",
|
|
98
95
|
children: [
|
|
99
|
-
/* @__PURE__ */ d(
|
|
96
|
+
/* @__PURE__ */ d(s, { event: e }),
|
|
100
97
|
e.location && /* @__PURE__ */ d("p", {
|
|
101
98
|
className: "mt-1 font-text-xs text-text-tertiary truncate",
|
|
102
99
|
children: e.location
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgendaView.js","names":[],"sources":["../../src/components/AgendaView.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport {
|
|
1
|
+
{"version":3,"file":"AgendaView.js","names":[],"sources":["../../src/components/AgendaView.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { useTr } from '../shared/hooks/useTr';\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 tr = useTr();\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":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarErrorState.d.ts","sourceRoot":"","sources":["../../src/components/CalendarErrorState.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,UAAU,uBAAuB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,kBAAkB,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,uBAAuB,+
|
|
1
|
+
{"version":3,"file":"CalendarErrorState.d.ts","sourceRoot":"","sources":["../../src/components/CalendarErrorState.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,UAAU,uBAAuB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,kBAAkB,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,uBAAuB,+BA4B/E"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useTr as e } from "../shared/hooks/useTr.js";
|
|
2
2
|
import { AlertTriangle as t } from "lucide-react";
|
|
3
3
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/CalendarErrorState.tsx
|
|
5
5
|
function i({ message: i, onRetry: a }) {
|
|
6
|
-
let
|
|
7
|
-
let n = o(e);
|
|
8
|
-
return n === e ? t : n;
|
|
9
|
-
};
|
|
6
|
+
let o = e();
|
|
10
7
|
return /* @__PURE__ */ n("div", {
|
|
11
8
|
role: "alert",
|
|
12
9
|
className: "mb-3 rounded-radius-lg border border-status-error-border bg-status-error-bg-subtle p-card-padding",
|
|
@@ -18,7 +15,7 @@ function i({ message: i, onRetry: a }) {
|
|
|
18
15
|
className: "min-w-0 flex-1",
|
|
19
16
|
children: [/* @__PURE__ */ n("p", {
|
|
20
17
|
className: "font-text-sm font-weight-semibold text-text-primary",
|
|
21
|
-
children:
|
|
18
|
+
children: o("calendar.eventsLoadError", "Couldn't load events")
|
|
22
19
|
}), /* @__PURE__ */ n("p", {
|
|
23
20
|
className: "mt-1 break-words font-text-xs text-text-secondary",
|
|
24
21
|
children: i
|
|
@@ -28,7 +25,7 @@ function i({ message: i, onRetry: a }) {
|
|
|
28
25
|
type: "button",
|
|
29
26
|
onClick: a,
|
|
30
27
|
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
|
-
children:
|
|
28
|
+
children: o("calendar.retry", "Try again")
|
|
32
29
|
})
|
|
33
30
|
]
|
|
34
31
|
})
|
|
@@ -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 {
|
|
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 { useTr } from '../shared/hooks/useTr';\n\ninterface CalendarErrorStateProps {\n message: string;\n onRetry?: () => void;\n}\n\nexport function CalendarErrorState({ message, onRetry }: CalendarErrorStateProps) {\n const tr = useTr();\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,IAAK,GAAO;AAElB,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmDialog.d.ts","sourceRoot":"","sources":["../../src/components/ConfirmDialog.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAqB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAInD,UAAU,kBAAkB;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"ConfirmDialog.d.ts","sourceRoot":"","sources":["../../src/components/ConfirmDialog.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAqB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAInD,UAAU,kBAAkB;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAiGhD,CAAC"}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { useTr as e } from "../shared/hooks/useTr.js";
|
|
2
|
+
import { useEffect as t, useRef as n } from "react";
|
|
3
3
|
import { AlertTriangle as r, X as i } from "lucide-react";
|
|
4
4
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/ConfirmDialog.tsx
|
|
6
|
-
var s = ({ open: s, title: c, message: l, confirmLabel: u
|
|
7
|
-
let g =
|
|
8
|
-
|
|
9
|
-
return n === e ? t : n;
|
|
10
|
-
};
|
|
11
|
-
if (e(() => {
|
|
6
|
+
var s = ({ open: s, title: c, message: l, confirmLabel: u, cancelLabel: d, variant: f = "danger", loading: p = !1, onConfirm: m, onCancel: h }) => {
|
|
7
|
+
let g = n(null), _ = e();
|
|
8
|
+
if (t(() => {
|
|
12
9
|
let e = g.current;
|
|
13
10
|
e && (s && !e.open ? e.showModal() : !s && e.open && e.close());
|
|
14
11
|
}, [s]), !s) return null;
|
|
15
|
-
let y = {
|
|
12
|
+
let v = u ?? _("calendar.confirm", "Confirm"), y = d ?? _("calendar.cancel", "Cancel"), b = {
|
|
16
13
|
danger: {
|
|
17
14
|
icon: "text-red-500",
|
|
18
15
|
button: "bg-red-600 hover:bg-red-700 text-white"
|
|
@@ -36,7 +33,7 @@ var s = ({ open: s, title: c, message: l, confirmLabel: u = "Confirm", cancelLab
|
|
|
36
33
|
className: "flex items-start gap-4",
|
|
37
34
|
children: [
|
|
38
35
|
/* @__PURE__ */ a("div", {
|
|
39
|
-
className: `size-10 rounded-full bg-bg-elevated flex items-center justify-center shrink-0 ${
|
|
36
|
+
className: `size-10 rounded-full bg-bg-elevated flex items-center justify-center shrink-0 ${b.icon}`,
|
|
40
37
|
children: /* @__PURE__ */ a(r, { className: "size-5" })
|
|
41
38
|
}),
|
|
42
39
|
/* @__PURE__ */ o("div", {
|
|
@@ -53,7 +50,7 @@ var s = ({ open: s, title: c, message: l, confirmLabel: u = "Confirm", cancelLab
|
|
|
53
50
|
type: "button",
|
|
54
51
|
onClick: h,
|
|
55
52
|
className: "size-8 inline-flex items-center justify-center rounded-radius-sm hover:bg-bg-elevated text-text-tertiary transition-colors shrink-0",
|
|
56
|
-
"aria-label":
|
|
53
|
+
"aria-label": _("calendar.close", "Close"),
|
|
57
54
|
children: /* @__PURE__ */ a(i, { className: "size-4" })
|
|
58
55
|
})
|
|
59
56
|
]
|
|
@@ -64,13 +61,13 @@ var s = ({ open: s, title: c, message: l, confirmLabel: u = "Confirm", cancelLab
|
|
|
64
61
|
onClick: h,
|
|
65
62
|
disabled: p,
|
|
66
63
|
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",
|
|
67
|
-
children:
|
|
64
|
+
children: y
|
|
68
65
|
}), /* @__PURE__ */ a("button", {
|
|
69
66
|
type: "button",
|
|
70
67
|
onClick: m,
|
|
71
68
|
disabled: p,
|
|
72
|
-
className: `px-4 py-2 rounded-radius-md font-text-sm font-weight-medium transition-colors disabled:opacity-50 ${
|
|
73
|
-
children: p ?
|
|
69
|
+
className: `px-4 py-2 rounded-radius-md font-text-sm font-weight-medium transition-colors disabled:opacity-50 ${b.button}`,
|
|
70
|
+
children: p ? _("calendar.processing", "Processing...") : v
|
|
74
71
|
})]
|
|
75
72
|
})]
|
|
76
73
|
})
|