@burdenoff/microfe-calendar 2026.1124.3 → 2026.1124.4
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/generated/wspace-operations.d.ts +342 -69
- package/dist/generated/wspace-operations.js +73 -31
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +405 -6
- package/dist/translations/en.d.ts +22 -4
- package/dist/v2/CalendarPageV2.js +45 -41
- package/dist/v2/CalendarPageV2.js.map +1 -1
- package/dist/v2/CalendarRoutesV2.js +64 -64
- package/dist/v2/CalendarRoutesV2.js.map +1 -1
- package/dist/v2/data/errors.d.ts +5 -0
- package/dist/v2/data/errors.js +6 -2
- package/dist/v2/data/errors.js.map +1 -1
- package/dist/v2/data/normalize.d.ts +31 -3
- package/dist/v2/data/normalize.js +57 -13
- package/dist/v2/data/normalize.js.map +1 -1
- package/dist/v2/data/seriesDateLookup.d.ts +9 -0
- package/dist/v2/data/seriesDateLookup.js +12 -0
- package/dist/v2/data/seriesDateLookup.js.map +1 -0
- package/dist/v2/data/useEventActions.d.ts +9 -3
- package/dist/v2/data/useEventActions.js +239 -186
- package/dist/v2/data/useEventActions.js.map +1 -1
- package/dist/v2/data/useEventForPeek.js +63 -21
- package/dist/v2/data/useEventForPeek.js.map +1 -1
- package/dist/v2/data/useEventsInRangeV2.d.ts +40 -2
- package/dist/v2/data/useEventsInRangeV2.js +76 -47
- package/dist/v2/data/useEventsInRangeV2.js.map +1 -1
- package/dist/v2/day/DayPanel.js +1 -1
- package/dist/v2/day/DayPanel.js.map +1 -1
- package/dist/v2/event/EventDialog.d.ts +13 -3
- package/dist/v2/event/EventDialog.js +189 -166
- package/dist/v2/event/EventDialog.js.map +1 -1
- package/dist/v2/event/EventDialogs.js +57 -50
- package/dist/v2/event/EventDialogs.js.map +1 -1
- package/dist/v2/event/EventMoreTab.js +8 -7
- package/dist/v2/event/EventMoreTab.js.map +1 -1
- package/dist/v2/event/EventPlaceTab.js +2 -2
- package/dist/v2/event/EventPlaceTab.js.map +1 -1
- package/dist/v2/event/FindTimeDialog.js +1 -1
- package/dist/v2/event/FindTimeDialog.js.map +1 -1
- package/dist/v2/event/RepeatField.js +10 -7
- package/dist/v2/event/RepeatField.js.map +1 -1
- package/dist/v2/event/dialogLogic.d.ts +10 -0
- package/dist/v2/event/dialogLogic.js +25 -22
- package/dist/v2/event/dialogLogic.js.map +1 -1
- package/dist/v2/event/dialogModel.d.ts +3 -0
- package/dist/v2/event/dialogModel.js.map +1 -1
- package/dist/v2/event/eventForm.d.ts +26 -0
- package/dist/v2/event/eventForm.js +145 -92
- package/dist/v2/event/eventForm.js.map +1 -1
- package/dist/v2/event/findTimeSource.js +44 -44
- package/dist/v2/event/findTimeSource.js.map +1 -1
- package/dist/v2/event/rrule.js.map +1 -1
- package/dist/v2/event/savePlan.d.ts +125 -15
- package/dist/v2/event/savePlan.js +162 -68
- package/dist/v2/event/savePlan.js.map +1 -1
- package/dist/v2/event/useEventData.d.ts +7 -2
- package/dist/v2/event/useEventData.js +107 -80
- package/dist/v2/event/useEventData.js.map +1 -1
- package/dist/v2/event/useEventDialogModel.d.ts +16 -3
- package/dist/v2/event/useEventDialogModel.js +82 -67
- package/dist/v2/event/useEventDialogModel.js.map +1 -1
- package/dist/v2/event/useEventSave.d.ts +20 -4
- package/dist/v2/event/useEventSave.js +181 -90
- package/dist/v2/event/useEventSave.js.map +1 -1
- package/dist/v2/events/eventLook.js +16 -16
- package/dist/v2/events/eventLook.js.map +1 -1
- package/dist/v2/events/eventModel.d.ts +17 -4
- package/dist/v2/events/eventModel.js +46 -34
- package/dist/v2/events/eventModel.js.map +1 -1
- package/dist/v2/events/localChanges.d.ts +4 -1
- package/dist/v2/events/localChanges.js +4 -2
- package/dist/v2/events/localChanges.js.map +1 -1
- package/dist/v2/page/CalendarPageContext.d.ts +2 -2
- package/dist/v2/page/CalendarPageContext.js.map +1 -1
- package/dist/v2/page/useCalendarPageModel.js +141 -139
- package/dist/v2/page/useCalendarPageModel.js.map +1 -1
- package/dist/v2/page/viewState.d.ts +9 -1
- package/dist/v2/page/viewState.js +5 -3
- package/dist/v2/page/viewState.js.map +1 -1
- package/dist/v2/peek/PeekEvent.js +210 -204
- package/dist/v2/peek/PeekEvent.js.map +1 -1
- package/dist/v2/rail/useMonthEventDates.js +1 -1
- package/dist/v2/rail/useMonthEventDates.js.map +1 -1
- package/dist/v2/states/CalendarStates.d.ts +15 -0
- package/dist/v2/states/CalendarStates.js +42 -11
- package/dist/v2/states/CalendarStates.js.map +1 -1
- package/dist/v2/types.d.ts +30 -2
- package/package.json +1 -1
|
@@ -388,12 +388,17 @@ export declare const enTranslations: {
|
|
|
388
388
|
created: string;
|
|
389
389
|
createFailed: string;
|
|
390
390
|
createUndone: string;
|
|
391
|
+
cutOffBody: string;
|
|
392
|
+
cutOffTitle: string;
|
|
391
393
|
day: string;
|
|
392
394
|
dayColumn: string;
|
|
393
395
|
dayEvents: string;
|
|
394
396
|
declinedHidden: string;
|
|
395
397
|
delete: string;
|
|
396
398
|
deleted: string;
|
|
399
|
+
deletedDate: string;
|
|
400
|
+
deletedDateGuests: string;
|
|
401
|
+
deletedDateRest: string;
|
|
397
402
|
deletedSeries: string;
|
|
398
403
|
deletedTellMany: string;
|
|
399
404
|
deletedTellOne: string;
|
|
@@ -454,14 +459,19 @@ export declare const enTranslations: {
|
|
|
454
459
|
eventAdded: string;
|
|
455
460
|
eventAddedPartly: string;
|
|
456
461
|
eventAddFailed: string;
|
|
462
|
+
eventKeepCancelledFailed: string;
|
|
463
|
+
eventRestFailed: string;
|
|
457
464
|
eventRuleFailed: string;
|
|
458
465
|
eventSaveAgain: string;
|
|
459
466
|
eventSaved: string;
|
|
467
|
+
eventSavedDate: string;
|
|
468
|
+
eventSavedLater: string;
|
|
460
469
|
eventSavedPartly: string;
|
|
461
470
|
eventSavedSeries: string;
|
|
462
471
|
eventSaveFailed: string;
|
|
463
472
|
eventSaveOffline: string;
|
|
464
473
|
eventsFailed: string;
|
|
474
|
+
eventTagsFailed: string;
|
|
465
475
|
eventTitle: string;
|
|
466
476
|
everyDay: string;
|
|
467
477
|
everyHour: string;
|
|
@@ -530,9 +540,10 @@ export declare const enTranslations: {
|
|
|
530
540
|
evSaving: string;
|
|
531
541
|
evScopeAll: string;
|
|
532
542
|
evScopeLater: string;
|
|
533
|
-
|
|
543
|
+
evScopeLaterCount: string;
|
|
544
|
+
evScopeLaterFirst: string;
|
|
534
545
|
evScopeThis: string;
|
|
535
|
-
|
|
546
|
+
evScopeThisNote: string;
|
|
536
547
|
evSections: string;
|
|
537
548
|
evSeeConfidential: string;
|
|
538
549
|
evSeeConfidentialBody: string;
|
|
@@ -541,7 +552,7 @@ export declare const enTranslations: {
|
|
|
541
552
|
evSeePublic: string;
|
|
542
553
|
evSeePublicBody: string;
|
|
543
554
|
evShowAs: string;
|
|
544
|
-
|
|
555
|
+
evShowAsNote: string;
|
|
545
556
|
evStarts: string;
|
|
546
557
|
evTeamAdded: string;
|
|
547
558
|
evTeamAddedSome: string;
|
|
@@ -578,7 +589,6 @@ export declare const enTranslations: {
|
|
|
578
589
|
failedBody: string;
|
|
579
590
|
findBetterTime: string;
|
|
580
591
|
findTime: string;
|
|
581
|
-
firstOccurrenceNote: string;
|
|
582
592
|
freeLeftToday: string;
|
|
583
593
|
freeTime: string;
|
|
584
594
|
fromTo: string;
|
|
@@ -728,6 +738,8 @@ export declare const enTranslations: {
|
|
|
728
738
|
resized: string;
|
|
729
739
|
resizeFailed: string;
|
|
730
740
|
restored: string;
|
|
741
|
+
restoreDateFailed: string;
|
|
742
|
+
restoredDate: string;
|
|
731
743
|
restoreFailed: string;
|
|
732
744
|
roomBookFailed: string;
|
|
733
745
|
roomBusyUntil: string;
|
|
@@ -771,6 +783,7 @@ export declare const enTranslations: {
|
|
|
771
783
|
rrKept: string;
|
|
772
784
|
rrLastDate: string;
|
|
773
785
|
rrLastWeekday: string;
|
|
786
|
+
rrLockedDate: string;
|
|
774
787
|
rrLockedSingle: string;
|
|
775
788
|
rrMonths: string;
|
|
776
789
|
rrNever: string;
|
|
@@ -868,6 +881,7 @@ export declare const enTranslations: {
|
|
|
868
881
|
showAll: string;
|
|
869
882
|
showOnly: string;
|
|
870
883
|
showRail: string;
|
|
884
|
+
showsAsFree: string;
|
|
871
885
|
startsNow: string;
|
|
872
886
|
statBooked: string;
|
|
873
887
|
statFree: string;
|
|
@@ -904,6 +918,10 @@ export declare const enTranslations: {
|
|
|
904
918
|
unitMonth: string;
|
|
905
919
|
unitThreeDays: string;
|
|
906
920
|
unitWeek: string;
|
|
921
|
+
unreadableMany: string;
|
|
922
|
+
unreadableNameOne: string;
|
|
923
|
+
unreadableNamesMany: string;
|
|
924
|
+
unreadableOne: string;
|
|
907
925
|
until: string;
|
|
908
926
|
untitled: string;
|
|
909
927
|
upNext: string;
|
|
@@ -16,82 +16,86 @@ import { RunsNotices as _ } from "./runs/RunsNotices.js";
|
|
|
16
16
|
import { WorkflowRunsLayer as v } from "./runs/WorkflowRunsLayer.js";
|
|
17
17
|
import { SearchResults as y } from "./search/SearchResults.js";
|
|
18
18
|
import { useCalendarV2Store as b } from "./state/calendarV2Store.js";
|
|
19
|
-
import { AllHiddenState as x,
|
|
20
|
-
import { useRef as
|
|
21
|
-
import { Fragment as
|
|
22
|
-
import { WorkspacePage as
|
|
19
|
+
import { AllHiddenState as x, CutOffNotice as S, LoadErrorState as C, PartialFailureNotice as w, SyncStoppedNotices as T, UnreadableCalendarsNotice as E } from "./states/CalendarStates.js";
|
|
20
|
+
import { useRef as D } from "react";
|
|
21
|
+
import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
22
|
+
import { WorkspacePage as j } from "@burdenoff/fe-libs/ui";
|
|
23
23
|
// src/v2/CalendarPageV2.tsx
|
|
24
|
-
var
|
|
25
|
-
function
|
|
24
|
+
var M = 420;
|
|
25
|
+
function N() {
|
|
26
26
|
let t = f();
|
|
27
|
-
return a(t), /* @__PURE__ */
|
|
27
|
+
return a(t), /* @__PURE__ */ k(u, {
|
|
28
28
|
value: t,
|
|
29
|
-
children: /* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
29
|
+
children: /* @__PURE__ */ A(v, { children: [
|
|
30
|
+
/* @__PURE__ */ k("div", {
|
|
31
31
|
className: "flex min-h-0 min-w-0 flex-1 flex-col bg-bg-canvas",
|
|
32
32
|
"data-calendar-view": t.nav.view,
|
|
33
33
|
"data-calendar-date": t.nav.date,
|
|
34
|
-
children: /* @__PURE__ */
|
|
34
|
+
children: /* @__PURE__ */ A(j, {
|
|
35
35
|
className: "pb-0 max-md:pb-0",
|
|
36
36
|
children: [
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ k(c, {}),
|
|
38
|
+
/* @__PURE__ */ k(l, {}),
|
|
39
|
+
/* @__PURE__ */ k(P, {})
|
|
40
40
|
]
|
|
41
41
|
})
|
|
42
42
|
}),
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ k(p, {}),
|
|
44
|
+
/* @__PURE__ */ k(g, {}),
|
|
45
|
+
/* @__PURE__ */ k(n, {}),
|
|
46
|
+
/* @__PURE__ */ k(h, {}),
|
|
47
|
+
/* @__PURE__ */ k(e, {})
|
|
48
48
|
] })
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
let e = d(), t =
|
|
53
|
-
return /* @__PURE__ */
|
|
51
|
+
function P() {
|
|
52
|
+
let e = d(), t = D(null), n = i(t, M), r = b((e) => e.railOpen), a = !e.compact && r;
|
|
53
|
+
return /* @__PURE__ */ A("div", {
|
|
54
54
|
ref: t,
|
|
55
55
|
className: "flex min-h-0 gap-3.5",
|
|
56
56
|
style: {
|
|
57
57
|
height: n ?? void 0,
|
|
58
|
-
minHeight:
|
|
58
|
+
minHeight: M
|
|
59
59
|
},
|
|
60
|
-
children: [a ? /* @__PURE__ */
|
|
60
|
+
children: [a ? /* @__PURE__ */ k("aside", {
|
|
61
61
|
id: "calendar-v2-rail",
|
|
62
62
|
"aria-label": e.tr("calendar.v2.calendars", "Calendars"),
|
|
63
63
|
className: "w-[232px] shrink-0 overflow-y-auto pe-1 max-lg:w-[208px]",
|
|
64
|
-
children: /* @__PURE__ */
|
|
65
|
-
}) : null, /* @__PURE__ */
|
|
64
|
+
children: /* @__PURE__ */ k(m, {})
|
|
65
|
+
}) : null, /* @__PURE__ */ k("div", {
|
|
66
66
|
className: "flex min-h-0 min-w-0 flex-1 flex-col gap-2.5",
|
|
67
|
-
children: /* @__PURE__ */
|
|
67
|
+
children: /* @__PURE__ */ k(F, {})
|
|
68
68
|
})]
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function F() {
|
|
72
72
|
let e = d();
|
|
73
|
-
if (b((e) => e.search).trim() !== "") return /* @__PURE__ */
|
|
73
|
+
if (b((e) => e.search).trim() !== "") return /* @__PURE__ */ k(y, {});
|
|
74
74
|
let { state: n } = e;
|
|
75
|
-
if (n.kind === "error") return /* @__PURE__ */
|
|
75
|
+
if (n.kind === "error") return /* @__PURE__ */ k(C, {
|
|
76
76
|
failed: n.failed,
|
|
77
77
|
error: n.failed === "events" ? e.eventsError : e.calendarsError,
|
|
78
78
|
onRetry: n.failed === "calendars" ? e.refetchCalendars : e.refetchEvents
|
|
79
79
|
});
|
|
80
|
-
if (n.kind === "all-hidden") return /* @__PURE__ */
|
|
81
|
-
let i = e.nav.view === "month" ? /* @__PURE__ */
|
|
80
|
+
if (n.kind === "all-hidden") return /* @__PURE__ */ k(x, {});
|
|
81
|
+
let i = e.nav.view === "month" ? /* @__PURE__ */ k(s, {}) : e.nav.view === "list" ? /* @__PURE__ */ k(o, {}) : e.nav.view === "day" && !e.compact ? /* @__PURE__ */ A("div", {
|
|
82
82
|
className: "flex min-h-0 flex-1 gap-3.5",
|
|
83
|
-
children: [/* @__PURE__ */
|
|
84
|
-
}) : /* @__PURE__ */
|
|
85
|
-
return /* @__PURE__ */ O
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
n.kind === "ready" ? /* @__PURE__ */
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
83
|
+
children: [/* @__PURE__ */ k(r, {}), /* @__PURE__ */ k(t, {})]
|
|
84
|
+
}) : /* @__PURE__ */ k(r, {});
|
|
85
|
+
return /* @__PURE__ */ A(O, { children: [
|
|
86
|
+
/* @__PURE__ */ k(T, {}),
|
|
87
|
+
n.kind === "ready" ? /* @__PURE__ */ A(O, { children: [
|
|
88
|
+
/* @__PURE__ */ k(w, {
|
|
89
|
+
calendarIds: n.failedCalendarIds,
|
|
90
|
+
onRetry: e.refetchEvents
|
|
91
|
+
}),
|
|
92
|
+
/* @__PURE__ */ k(E, { calendarIds: n.unreadableCalendarIds }),
|
|
93
|
+
/* @__PURE__ */ k(S, { truncated: n.truncated })
|
|
94
|
+
] }) : null,
|
|
95
|
+
/* @__PURE__ */ k(_, {}),
|
|
92
96
|
i
|
|
93
97
|
] });
|
|
94
98
|
}
|
|
95
|
-
export {
|
|
99
|
+
export { N as CalendarPageV2 };
|
|
96
100
|
|
|
97
101
|
//# sourceMappingURL=CalendarPageV2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarPageV2.js","names":["_Fragment","Fragment$1","MIN_BODY_HEIGHT","CalendarPageV2","model","useCalendarPageModel","useCalendarShortcuts","CalendarPageContext","WorkflowRunsLayer","WorkspacePage","CalendarHeaderV2","CalendarToolbarV2","CalendarBody","EventPeekHost","RunPeekHost","QuickCreateHost","RailSheet","CalendarDialogsV2","page","useCalendarPage","bodyRef","useRef","height","useAvailableHeight","railOpen","useCalendarV2Store","state","showRail","CalendarRail","MainArea","SearchResults","LoadErrorState","AllHiddenState","view","MonthView","ListViewV2","TimeGrid","DayPanel","SyncStoppedNotices","PartialFailureNotice","RunsNotices"],"sources":["../../src/v2/CalendarPageV2.tsx"],"sourcesContent":["/**\n * The redesigned calendar page (BOFF-15698 A1): the header and toolbar, the rail, and the Day ·\n * Week · Month · List views with the peek, quick create, search and their states. The address\n * says which view and day (`useCalendarV2Navigation`); the shared model\n * (`useCalendarPageModel`) holds the calendars, the view's events and what can be done to them.\n *\n * The page fills the window and scrolls inside itself. No product shows it yet: FluidGrids\n * passes `calendarRedesign` once A1–A3 have shipped (§7). The workflow runs layer (B5) lays\n * FluidGrids' scheduled runs over the views, behind the rail's switch.\n */\nimport { useRef } from 'react';\nimport { WorkspacePage } from '@burdenoff/fe-libs/ui';\nimport { CalendarDialogsV2 } from './dialogs/CalendarDialogsV2';\nimport { DayPanel } from './day/DayPanel';\nimport { QuickCreateHost } from './grid/QuickCreate';\nimport { TimeGrid } from './grid/TimeGrid';\nimport { useAvailableHeight } from './hooks/useAvailableHeight';\nimport { useCalendarShortcuts } from './hooks/useCalendarShortcuts';\nimport { ListViewV2 } from './list/ListViewV2';\nimport { MonthView } from './month/MonthView';\nimport { CalendarHeaderV2, CalendarToolbarV2 } from './page/CalendarChrome';\nimport { CalendarPageContext, useCalendarPage } from './page/CalendarPageContext';\nimport { useCalendarPageModel } from './page/useCalendarPageModel';\nimport { EventPeekHost } from './peek/EventPeek';\nimport { CalendarRail, RailSheet } from './rail/CalendarRail';\nimport { RunPeekHost } from './runs/RunPeek';\nimport { RunsNotices } from './runs/RunsNotices';\nimport { WorkflowRunsLayer } from './runs/WorkflowRunsLayer';\nimport { SearchResults } from './search/SearchResults';\nimport { useCalendarV2Store } from './state/calendarV2Store';\nimport {\n AllHiddenState,\n LoadErrorState,\n PartialFailureNotice,\n SyncStoppedNotices,\n} from './states/CalendarStates';\n\n/** The calendar never gets shorter than this; a shorter window scrolls the page. */\nconst MIN_BODY_HEIGHT = 420;\n\nexport function CalendarPageV2() {\n const model = useCalendarPageModel();\n useCalendarShortcuts(model);\n return (\n <CalendarPageContext value={model}>\n <WorkflowRunsLayer>\n <div\n className=\"flex min-h-0 min-w-0 flex-1 flex-col bg-bg-canvas\"\n data-calendar-view={model.nav.view}\n data-calendar-date={model.nav.date}\n >\n <WorkspacePage className=\"pb-0 max-md:pb-0\">\n <CalendarHeaderV2 />\n <CalendarToolbarV2 />\n <CalendarBody />\n </WorkspacePage>\n </div>\n <EventPeekHost />\n <RunPeekHost />\n <QuickCreateHost />\n <RailSheet />\n <CalendarDialogsV2 />\n </WorkflowRunsLayer>\n </CalendarPageContext>\n );\n}\n\nfunction CalendarBody() {\n const page = useCalendarPage();\n const bodyRef = useRef<HTMLDivElement>(null);\n const height = useAvailableHeight(bodyRef, MIN_BODY_HEIGHT);\n const railOpen = useCalendarV2Store((state) => state.railOpen);\n const showRail = !page.compact && railOpen;\n return (\n <div\n ref={bodyRef}\n className=\"flex min-h-0 gap-3.5\"\n style={{ height: height ?? undefined, minHeight: MIN_BODY_HEIGHT }}\n >\n {showRail ? (\n <aside\n id=\"calendar-v2-rail\"\n aria-label={page.tr('calendar.v2.calendars', 'Calendars')}\n className=\"w-[232px] shrink-0 overflow-y-auto pe-1 max-lg:w-[208px]\"\n >\n <CalendarRail />\n </aside>\n ) : null}\n <div className=\"flex min-h-0 min-w-0 flex-1 flex-col gap-2.5\">\n <MainArea />\n </div>\n </div>\n );\n}\n\nfunction MainArea() {\n const page = useCalendarPage();\n const search = useCalendarV2Store((state) => state.search);\n if (search.trim() !== '') return <SearchResults />;\n const { state } = page;\n if (state.kind === 'error') {\n return (\n <LoadErrorState\n failed={state.failed}\n error={state.failed === 'events' ? page.eventsError : page.calendarsError}\n onRetry={state.failed === 'calendars' ? page.refetchCalendars : page.refetchEvents}\n />\n );\n }\n if (state.kind === 'all-hidden') return <AllHiddenState />;\n const view =\n page.nav.view === 'month' ? (\n <MonthView />\n ) : page.nav.view === 'list' ? (\n <ListViewV2 />\n ) : page.nav.view === 'day' && !page.compact ? (\n <div className=\"flex min-h-0 flex-1 gap-3.5\">\n <TimeGrid />\n <DayPanel />\n </div>\n ) : (\n <TimeGrid />\n );\n return (\n <>\n <SyncStoppedNotices />\n {state.kind === 'ready' ? (\n <PartialFailureNotice
|
|
1
|
+
{"version":3,"file":"CalendarPageV2.js","names":["_Fragment","Fragment$1","MIN_BODY_HEIGHT","CalendarPageV2","model","useCalendarPageModel","useCalendarShortcuts","CalendarPageContext","WorkflowRunsLayer","WorkspacePage","CalendarHeaderV2","CalendarToolbarV2","CalendarBody","EventPeekHost","RunPeekHost","QuickCreateHost","RailSheet","CalendarDialogsV2","page","useCalendarPage","bodyRef","useRef","height","useAvailableHeight","railOpen","useCalendarV2Store","state","showRail","CalendarRail","MainArea","SearchResults","LoadErrorState","AllHiddenState","view","MonthView","ListViewV2","TimeGrid","DayPanel","SyncStoppedNotices","PartialFailureNotice","UnreadableCalendarsNotice","CutOffNotice","RunsNotices"],"sources":["../../src/v2/CalendarPageV2.tsx"],"sourcesContent":["/**\n * The redesigned calendar page (BOFF-15698 A1): the header and toolbar, the rail, and the Day ·\n * Week · Month · List views with the peek, quick create, search and their states. The address\n * says which view and day (`useCalendarV2Navigation`); the shared model\n * (`useCalendarPageModel`) holds the calendars, the view's events and what can be done to them.\n *\n * The page fills the window and scrolls inside itself. No product shows it yet: FluidGrids\n * passes `calendarRedesign` once A1–A3 have shipped (§7). The workflow runs layer (B5) lays\n * FluidGrids' scheduled runs over the views, behind the rail's switch.\n */\nimport { useRef } from 'react';\nimport { WorkspacePage } from '@burdenoff/fe-libs/ui';\nimport { CalendarDialogsV2 } from './dialogs/CalendarDialogsV2';\nimport { DayPanel } from './day/DayPanel';\nimport { QuickCreateHost } from './grid/QuickCreate';\nimport { TimeGrid } from './grid/TimeGrid';\nimport { useAvailableHeight } from './hooks/useAvailableHeight';\nimport { useCalendarShortcuts } from './hooks/useCalendarShortcuts';\nimport { ListViewV2 } from './list/ListViewV2';\nimport { MonthView } from './month/MonthView';\nimport { CalendarHeaderV2, CalendarToolbarV2 } from './page/CalendarChrome';\nimport { CalendarPageContext, useCalendarPage } from './page/CalendarPageContext';\nimport { useCalendarPageModel } from './page/useCalendarPageModel';\nimport { EventPeekHost } from './peek/EventPeek';\nimport { CalendarRail, RailSheet } from './rail/CalendarRail';\nimport { RunPeekHost } from './runs/RunPeek';\nimport { RunsNotices } from './runs/RunsNotices';\nimport { WorkflowRunsLayer } from './runs/WorkflowRunsLayer';\nimport { SearchResults } from './search/SearchResults';\nimport { useCalendarV2Store } from './state/calendarV2Store';\nimport {\n AllHiddenState,\n CutOffNotice,\n LoadErrorState,\n PartialFailureNotice,\n SyncStoppedNotices,\n UnreadableCalendarsNotice,\n} from './states/CalendarStates';\n\n/** The calendar never gets shorter than this; a shorter window scrolls the page. */\nconst MIN_BODY_HEIGHT = 420;\n\nexport function CalendarPageV2() {\n const model = useCalendarPageModel();\n useCalendarShortcuts(model);\n return (\n <CalendarPageContext value={model}>\n <WorkflowRunsLayer>\n <div\n className=\"flex min-h-0 min-w-0 flex-1 flex-col bg-bg-canvas\"\n data-calendar-view={model.nav.view}\n data-calendar-date={model.nav.date}\n >\n <WorkspacePage className=\"pb-0 max-md:pb-0\">\n <CalendarHeaderV2 />\n <CalendarToolbarV2 />\n <CalendarBody />\n </WorkspacePage>\n </div>\n <EventPeekHost />\n <RunPeekHost />\n <QuickCreateHost />\n <RailSheet />\n <CalendarDialogsV2 />\n </WorkflowRunsLayer>\n </CalendarPageContext>\n );\n}\n\nfunction CalendarBody() {\n const page = useCalendarPage();\n const bodyRef = useRef<HTMLDivElement>(null);\n const height = useAvailableHeight(bodyRef, MIN_BODY_HEIGHT);\n const railOpen = useCalendarV2Store((state) => state.railOpen);\n const showRail = !page.compact && railOpen;\n return (\n <div\n ref={bodyRef}\n className=\"flex min-h-0 gap-3.5\"\n style={{ height: height ?? undefined, minHeight: MIN_BODY_HEIGHT }}\n >\n {showRail ? (\n <aside\n id=\"calendar-v2-rail\"\n aria-label={page.tr('calendar.v2.calendars', 'Calendars')}\n className=\"w-[232px] shrink-0 overflow-y-auto pe-1 max-lg:w-[208px]\"\n >\n <CalendarRail />\n </aside>\n ) : null}\n <div className=\"flex min-h-0 min-w-0 flex-1 flex-col gap-2.5\">\n <MainArea />\n </div>\n </div>\n );\n}\n\nfunction MainArea() {\n const page = useCalendarPage();\n const search = useCalendarV2Store((state) => state.search);\n if (search.trim() !== '') return <SearchResults />;\n const { state } = page;\n if (state.kind === 'error') {\n return (\n <LoadErrorState\n failed={state.failed}\n error={state.failed === 'events' ? page.eventsError : page.calendarsError}\n onRetry={state.failed === 'calendars' ? page.refetchCalendars : page.refetchEvents}\n />\n );\n }\n if (state.kind === 'all-hidden') return <AllHiddenState />;\n const view =\n page.nav.view === 'month' ? (\n <MonthView />\n ) : page.nav.view === 'list' ? (\n <ListViewV2 />\n ) : page.nav.view === 'day' && !page.compact ? (\n <div className=\"flex min-h-0 flex-1 gap-3.5\">\n <TimeGrid />\n <DayPanel />\n </div>\n ) : (\n <TimeGrid />\n );\n return (\n <>\n <SyncStoppedNotices />\n {state.kind === 'ready' ? (\n <>\n <PartialFailureNotice\n calendarIds={state.failedCalendarIds}\n onRetry={page.refetchEvents}\n />\n <UnreadableCalendarsNotice calendarIds={state.unreadableCalendarIds} />\n <CutOffNotice truncated={state.truncated} />\n </>\n ) : null}\n <RunsNotices />\n {view}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAwCA,IAAME,IAAkB;AAExB,SAAgBC,IAAiB;CAC/B,IAAMC,IAAQC,EAAqB;CAEnC,OADAC,EAAqBF,CAAK,GAExB,kBAACG,GAAD;EAAqB,OAAOH;EAC1B,UAAA,kBAACI,GAAD,EAAA,UAAA;GACE,kBAAC,OAAD;IACE,WAAU;IACV,sBAAoBJ,EAAM,IAAI;IAC9B,sBAAoBA,EAAM,IAAI;IAE9B,UAAA,kBAACK,GAAD;KAAe,WAAU;KAAzB,U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cAAc,OAAO,kBAACM,GAAD,CAAiB,CAAA;CACzD,IAAMC,IACJf,EAAK,IAAI,SAAS,UAChB,kBAACgB,GAAD,CAAY,CAAA,IACVhB,EAAK,IAAI,SAAS,SACpB,kBAACiB,GAAD,CAAa,CAAA,IACXjB,EAAK,IAAI,SAAS,SAAS,CAACA,EAAK,UACnC,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,kBAACkB,GAAD,CAAW,CAAA,GACX,kBAACC,GAAD,CAAW,CAAA,CACR;CAEL,CAAA,IAAA,kBAACD,GAAD,CAAW,CAAA;CAEf,OACE,kBAAApC,GAAA,EAAA,UAAA;EACE,kBAACsC,GAAD,CAAqB,CAAA;EACpBZ,EAAM,SAAS,UACd,kBAAA1B,GAAA,EAAA,UAAA;GACE,kBAACuC,GAAD;IACE,aAAab,EAAM;IACnB,SAASR,EAAK;GACf,CAAA;GACD,kBAACsB,GAAD,EAA2B,aAAad,EAAM,sBAAwB,CAAA;GACtE,kBAACe,GAAD,EAAc,WAAWf,EAAM,UAAY,CAAA;EAC3C,EAAA,CAAA,IACA;EACJ,kBAACgB,GAAD,CAAc,CAAA;EACbT;CACD,EAAA,CAAA;AAEN"}
|
|
@@ -2,116 +2,116 @@ import { CalendarV2EventDayDocument as e } from "../generated/wspace-operations.
|
|
|
2
2
|
import { useCalendar as t } from "../providers/CalendarProvider.js";
|
|
3
3
|
import { useTr as n } from "../shared/hooks/useTr.js";
|
|
4
4
|
import { CalendarPageV2 as r } from "./CalendarPageV2.js";
|
|
5
|
-
import { parseInstant as i } from "./data/normalize.js";
|
|
6
|
-
import { CalendarPrefsProvider as
|
|
7
|
-
import { DEFAULT_VIEW as
|
|
8
|
-
import { useCalendarV2Store as
|
|
9
|
-
import { useCalendarV2Navigation as
|
|
10
|
-
import { useCalendarV2PrefsBridge as
|
|
11
|
-
import { eventDays as
|
|
12
|
-
import { useEffect as
|
|
13
|
-
import { Navigate as
|
|
14
|
-
import { jsx as
|
|
15
|
-
import { WorkspacePagesV2Provider as
|
|
16
|
-
import { useQuery as
|
|
5
|
+
import { parseInstant as i, seriesReadAloneId as a } from "./data/normalize.js";
|
|
6
|
+
import { CalendarPrefsProvider as o, useCalendarPrefs as s, useCalendarTimeZone as c, usePrefsSettled as l } from "./prefs/CalendarPrefsProvider.js";
|
|
7
|
+
import { DEFAULT_VIEW as u, LEGACY_PAGE_DIALOGS as d, SEARCH_PARAMS as f, calendarV2Href as p, viewForName as m, viewPath as h } from "./routes.js";
|
|
8
|
+
import { useCalendarV2Store as g } from "./state/calendarV2Store.js";
|
|
9
|
+
import { useCalendarV2Navigation as _ } from "./state/useCalendarV2Navigation.js";
|
|
10
|
+
import { useCalendarV2PrefsBridge as v } from "./state/useCalendarV2PrefsBridge.js";
|
|
11
|
+
import { eventDays as y } from "./time/calendarTime.js";
|
|
12
|
+
import { useEffect as b } from "react";
|
|
13
|
+
import { Navigate as x, Route as S, Routes as C, useLocation as w, useParams as T } from "react-router";
|
|
14
|
+
import { jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
15
|
+
import { WorkspacePagesV2Provider as O } from "@burdenoff/fe-libs/ui";
|
|
16
|
+
import { useQuery as k } from "@apollo/client/react";
|
|
17
17
|
// src/v2/CalendarRoutesV2.tsx
|
|
18
|
-
function
|
|
18
|
+
function A() {
|
|
19
19
|
let { currentUser: e } = t();
|
|
20
|
-
return /* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */ E(O, {
|
|
21
21
|
enabled: !0,
|
|
22
|
-
children: /* @__PURE__ */
|
|
23
|
-
/* @__PURE__ */
|
|
22
|
+
children: /* @__PURE__ */ E(o, { children: /* @__PURE__ */ E(j, { children: /* @__PURE__ */ D(C, { children: [
|
|
23
|
+
/* @__PURE__ */ E(S, {
|
|
24
24
|
index: !0,
|
|
25
|
-
element: /* @__PURE__ */
|
|
25
|
+
element: /* @__PURE__ */ E(P, {})
|
|
26
26
|
}),
|
|
27
|
-
/* @__PURE__ */
|
|
27
|
+
/* @__PURE__ */ E(S, {
|
|
28
28
|
path: "view/:viewType",
|
|
29
|
-
element: /* @__PURE__ */
|
|
29
|
+
element: /* @__PURE__ */ E(F, {})
|
|
30
30
|
}),
|
|
31
|
-
/* @__PURE__ */
|
|
31
|
+
/* @__PURE__ */ E(S, {
|
|
32
32
|
path: "event/:eventId",
|
|
33
|
-
element: /* @__PURE__ */
|
|
33
|
+
element: /* @__PURE__ */ E(R, {})
|
|
34
34
|
}),
|
|
35
|
-
Object.entries(
|
|
35
|
+
Object.entries(d).map(([e, t]) => /* @__PURE__ */ E(S, {
|
|
36
36
|
path: e,
|
|
37
|
-
element: /* @__PURE__ */
|
|
37
|
+
element: /* @__PURE__ */ E(L, { dialog: t })
|
|
38
38
|
}, e)),
|
|
39
|
-
/* @__PURE__ */
|
|
39
|
+
/* @__PURE__ */ E(S, {
|
|
40
40
|
path: "*",
|
|
41
|
-
element: /* @__PURE__ */
|
|
41
|
+
element: /* @__PURE__ */ E(z, {})
|
|
42
42
|
})
|
|
43
43
|
] }) }) }, e?.id ?? "")
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
return
|
|
46
|
+
function j({ children: e }) {
|
|
47
|
+
return v(), b(() => () => g.getState().reset(), []), e;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
return /* @__PURE__ */
|
|
49
|
+
function M({ label: e }) {
|
|
50
|
+
return /* @__PURE__ */ E("div", {
|
|
51
51
|
className: "min-h-screen bg-bg-canvas flex items-center justify-center",
|
|
52
52
|
role: "status",
|
|
53
53
|
"aria-live": "polite",
|
|
54
|
-
children: /* @__PURE__ */
|
|
54
|
+
children: /* @__PURE__ */ E("div", {
|
|
55
55
|
className: "text-text-secondary font-text-md",
|
|
56
56
|
children: e
|
|
57
57
|
})
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
let { basePath: r } = t(), { search: i } =
|
|
62
|
-
return /* @__PURE__ */
|
|
60
|
+
function N({ view: e, changes: n }) {
|
|
61
|
+
let { basePath: r } = t(), { search: i } = w();
|
|
62
|
+
return /* @__PURE__ */ E(x, {
|
|
63
63
|
replace: !0,
|
|
64
|
-
to:
|
|
64
|
+
to: p(r, e, n, i)
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
function N() {
|
|
68
|
-
let e = n(), { prefs: t } = o();
|
|
69
|
-
return c() ? /* @__PURE__ */ T(M, { view: t.defaultView }) : /* @__PURE__ */ T(j, { label: e("calendar.v2.openingCalendar", "Opening the calendar…") });
|
|
70
|
-
}
|
|
71
67
|
function P() {
|
|
72
|
-
let
|
|
73
|
-
return
|
|
68
|
+
let e = n(), { prefs: t } = s();
|
|
69
|
+
return l() ? /* @__PURE__ */ E(N, { view: t.defaultView }) : /* @__PURE__ */ E(M, { label: e("calendar.v2.openingCalendar", "Opening the calendar…") });
|
|
70
|
+
}
|
|
71
|
+
function F() {
|
|
72
|
+
let { viewType: e } = T(), t = m(e);
|
|
73
|
+
return t === null ? /* @__PURE__ */ E(N, { view: u }) : E(t === e ? I : N, { view: t });
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
let { date: t } =
|
|
77
|
-
return
|
|
78
|
-
|
|
79
|
-
}, [e, t]), /* @__PURE__ */
|
|
75
|
+
function I({ view: e }) {
|
|
76
|
+
let { date: t } = _();
|
|
77
|
+
return b(() => {
|
|
78
|
+
g.getState().syncRoute(e, t);
|
|
79
|
+
}, [e, t]), /* @__PURE__ */ E(r, {});
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
return /* @__PURE__ */
|
|
81
|
+
function L({ dialog: e }) {
|
|
82
|
+
return /* @__PURE__ */ E(N, {
|
|
83
83
|
view: "week",
|
|
84
|
-
changes: { [
|
|
84
|
+
changes: { [f.dialog]: e }
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
|
-
function
|
|
88
|
-
let { eventId: t = "" } =
|
|
87
|
+
function R() {
|
|
88
|
+
let { eventId: t = "" } = T(), r = n(), o = c(), s = l(), { data: u, loading: d } = k(e, {
|
|
89
89
|
variables: { id: t },
|
|
90
90
|
skip: t === "",
|
|
91
91
|
fetchPolicy: "network-only"
|
|
92
92
|
});
|
|
93
|
-
if (!
|
|
94
|
-
let
|
|
95
|
-
start:
|
|
96
|
-
end:
|
|
97
|
-
allDay:
|
|
98
|
-
timeZone:
|
|
99
|
-
},
|
|
100
|
-
return /* @__PURE__ */
|
|
93
|
+
if (!s || t !== "" && d && !u) return /* @__PURE__ */ E(M, { label: r("calendar.v2.openingEvent", "Opening the event…") });
|
|
94
|
+
let p = u?.event, m = i(p?.startTime), h = i(p?.endTime), g = p && m && h ? y({
|
|
95
|
+
start: m,
|
|
96
|
+
end: h,
|
|
97
|
+
allDay: p.allDay,
|
|
98
|
+
timeZone: p.timezone
|
|
99
|
+
}, o).start : null, _ = p?.isRecurring && m ? a(t, m, (p.recurrenceExceptions ?? []).flatMap((e) => i(e) ?? [])) : t;
|
|
100
|
+
return /* @__PURE__ */ E(N, {
|
|
101
101
|
view: "week",
|
|
102
102
|
changes: {
|
|
103
|
-
[
|
|
104
|
-
[
|
|
103
|
+
[f.event]: _ || null,
|
|
104
|
+
[f.date]: g
|
|
105
105
|
}
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function z() {
|
|
109
109
|
let { basePath: e } = t();
|
|
110
|
-
return /* @__PURE__ */
|
|
110
|
+
return /* @__PURE__ */ E(x, {
|
|
111
111
|
replace: !0,
|
|
112
|
-
to:
|
|
112
|
+
to: h(e, u)
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
|
-
export {
|
|
115
|
+
export { A as CalendarRoutesV2 };
|
|
116
116
|
|
|
117
117
|
//# sourceMappingURL=CalendarRoutesV2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarRoutesV2.js","names":["CalendarRoutesV2","useCalendar","WorkspacePagesV2Provider","CalendarPrefsProvider","CalendarV2Session","Routes","Route","OpeningViewRedirect","ViewRoute","EventRedirect","LEGACY_PAGE_DIALOGS","path","dialog","DialogRedirect","UnknownAddressRedirect","currentUser","useCalendarV2PrefsBridge","useEffect","useCalendarV2Store","children","CalendarV2Loading","label","RedirectToView","useLocation","Navigate","calendarV2Href","basePath","view","changes","search","tr","useTr","useCalendarPrefs","usePrefsSettled","prefs","useParams","viewForName","viewType","DEFAULT_VIEW","jsx","ViewPage","useCalendarV2Navigation","date","CalendarPageV2","SEARCH_PARAMS","timeZone","useCalendarTimeZone","prefsSettled","useQuery","CalendarV2EventDayDocument","eventId","loading","data","event","start","parseInstant","end","day","eventDays","viewPath"],"sources":["../../src/v2/CalendarRoutesV2.tsx"],"sourcesContent":["/**\n * The redesigned calendar's routes (BOFF-15698), rendered instead of today's when the host\n * passes `calendarRedesign` (FluidGrids only). Today's addresses keep working (§2):\n *\n * /calendar → view/<opening view> (the person's setting; Week by default)\n * /calendar/view/year → view/month\n * /calendar/view/timeline → view/week\n * /calendar/view/agenda → view/list\n * /calendar/resources → view/week?dialog=rooms\n * /calendar/subscriptions → view/week?dialog=share\n * /calendar/settings → view/week?dialog=settings\n * /calendar/event/:id → view/week?event=:id&date=<its day> (opens the peek)\n * anything else → view/week\n *\n * A redirect keeps the query parameters a link carried. The tree renders under\n * `WorkspacePagesV2Provider enabled` (BOFF-15645), so the shared v2 parts take their new look\n * before the app turns `workspacePagesV2` on everywhere.\n */\nimport { useEffect, type ReactNode } from 'react';\nimport { Navigate, Route, Routes, useLocation, useParams } from 'react-router';\nimport { useQuery } from '@apollo/client/react';\nimport { WorkspacePagesV2Provider } from '@burdenoff/fe-libs/ui';\nimport {\n CalendarV2EventDayDocument,\n type CalendarV2EventDayQuery,\n type CalendarV2EventDayQueryVariables,\n} from '../generated/wspace-operations';\nimport { useCalendar } from '../providers/CalendarProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport { CalendarPageV2 } from './CalendarPageV2';\nimport { parseInstant } from './data/normalize';\nimport {\n CalendarPrefsProvider,\n useCalendarPrefs,\n useCalendarTimeZone,\n usePrefsSettled,\n} from './prefs/CalendarPrefsProvider';\nimport {\n calendarV2Href,\n DEFAULT_VIEW,\n LEGACY_PAGE_DIALOGS,\n SEARCH_PARAMS,\n viewForName,\n viewPath,\n} from './routes';\nimport { useCalendarV2Store } from './state/calendarV2Store';\nimport { useCalendarV2Navigation } from './state/useCalendarV2Navigation';\nimport { useCalendarV2PrefsBridge } from './state/useCalendarV2PrefsBridge';\nimport { eventDays } from './time/calendarTime';\nimport type { CalendarV2Dialog, CalendarV2View } from './types';\n\nexport function CalendarRoutesV2() {\n const { currentUser } = useCalendar();\n return (\n <WorkspacePagesV2Provider enabled>\n {/* One settings session per person: another person signing in starts afresh. */}\n <CalendarPrefsProvider key={currentUser?.id ?? ''}>\n <CalendarV2Session>\n <Routes>\n <Route index element={<OpeningViewRedirect />} />\n <Route path=\"view/:viewType\" element={<ViewRoute />} />\n <Route path=\"event/:eventId\" element={<EventRedirect />} />\n {Object.entries(LEGACY_PAGE_DIALOGS).map(([path, dialog]) => (\n <Route key={path} path={path} element={<DialogRedirect dialog={dialog} />} />\n ))}\n <Route path=\"*\" element={<UnknownAddressRedirect />} />\n </Routes>\n </CalendarV2Session>\n </CalendarPrefsProvider>\n </WorkspacePagesV2Provider>\n );\n}\n\n/** What lives for the visit: the settings bridge; the visit's state is cleared on leaving. */\nfunction CalendarV2Session({ children }: { children: ReactNode }) {\n useCalendarV2PrefsBridge();\n useEffect(() => () => useCalendarV2Store.getState().reset(), []);\n return children;\n}\n\nfunction CalendarV2Loading({ label }: { label: string }) {\n return (\n <div\n className=\"min-h-screen bg-bg-canvas flex items-center justify-center\"\n role=\"status\"\n aria-live=\"polite\"\n >\n <div className=\"text-text-secondary font-text-md\">{label}</div>\n </div>\n );\n}\n\n/** Replaces the address with a view of the redesign, keeping the query the link carried. */\nfunction RedirectToView({\n view,\n changes,\n}: {\n view: CalendarV2View;\n changes?: Readonly<Record<string, string | null>>;\n}) {\n const { basePath } = useCalendar();\n const { search } = useLocation();\n return <Navigate replace to={calendarV2Href(basePath, view, changes, search)} />;\n}\n\n/** The person's opening view, once the account has said which (not a stale device copy's). */\nfunction OpeningViewRedirect() {\n const tr = useTr();\n const { prefs } = useCalendarPrefs();\n if (!usePrefsSettled()) {\n return <CalendarV2Loading label={tr('calendar.v2.openingCalendar', 'Opening the calendar…')} />;\n }\n return <RedirectToView view={prefs.defaultView} />;\n}\n\nfunction ViewRoute() {\n const { viewType } = useParams();\n const view = viewForName(viewType);\n if (view === null) return <RedirectToView view={DEFAULT_VIEW} />;\n if (view !== viewType) return <RedirectToView view={view} />;\n return <ViewPage view={view} />;\n}\n\n/** A view of the redesign: mirrors the address into the store, then shows the page. */\nfunction ViewPage({ view }: { view: CalendarV2View }) {\n const { date } = useCalendarV2Navigation();\n useEffect(() => {\n useCalendarV2Store.getState().syncRoute(view, date);\n }, [view, date]);\n return <CalendarPageV2 />;\n}\n\nfunction DialogRedirect({ dialog }: { dialog: CalendarV2Dialog }) {\n return <RedirectToView view=\"week\" changes={{ [SEARCH_PARAMS.dialog]: dialog }} />;\n}\n\n/**\n * Today's event page: the event's week with its peek open. The day is the event's in the\n * calendar's zone (an all-day event's own day), read once the account has said which zone; an\n * event that can't be read (deleted, not shared) opens the peek without a day, and the peek\n * says what happened.\n */\nfunction EventRedirect() {\n const { eventId = '' } = useParams();\n const tr = useTr();\n const timeZone = useCalendarTimeZone();\n const prefsSettled = usePrefsSettled();\n const { data, loading } = useQuery<CalendarV2EventDayQuery, CalendarV2EventDayQueryVariables>(\n CalendarV2EventDayDocument,\n { variables: { id: eventId }, skip: eventId === '', fetchPolicy: 'network-only' }\n );\n if (!prefsSettled || (eventId !== '' && loading && !data)) {\n return <CalendarV2Loading label={tr('calendar.v2.openingEvent', 'Opening the event…')} />;\n }\n const event = data?.event;\n const start = parseInstant(event?.startTime);\n const end = parseInstant(event?.endTime);\n const day =\n event && start && end\n ? eventDays({ start, end, allDay: event.allDay, timeZone: event.timezone }, timeZone).start\n : null;\n return (\n <RedirectToView\n view=\"week\"\n changes={{ [SEARCH_PARAMS.event]: eventId || null, [SEARCH_PARAMS.date]: day }}\n />\n );\n}\n\nfunction UnknownAddressRedirect() {\n const { basePath } = useCalendar();\n return <Navigate replace to={viewPath(basePath, DEFAULT_VIEW)} />;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAmDA,SAAgBA,IAAmB;CACjC,IAAM,EAAE,mBAAgBC,EAAY;CACpC,OACE,kBAACC,GAAD;EAA0B,SAAA;EAExB,UAAA,kBAACC,GAAD,EAAA,UACE,kBAACC,GAAD,EAAA,UACE,kBAACC,GAAD,EAAA,UAAA;GACE,kBAACC,GAAD;IAAO,OAAA;IAAM,SAAS,kBAACC,GAAD,CAAsB,CAAA;GAAI,CAAA;GAChD,kBAACD,GAAD;IAAO,MAAK;IAAiB,SAAS,kBAACE,GAAD,CAAY,CAAA;GAAI,CAAA;GACtD,kBAACF,GAAD;IAAO,MAAK;IAAiB,SAAS,kBAACG,GAAD,CAAgB,CAAA;GAAI,CAAA;GACzD,OAAO,QAAQC,CAAmB,CAAC,CAAC,KAAK,CAACC,GAAMC,OAC/C,kBAACN,GAAD;IAAwB;IAAM,SAAS,kBAACO,GAAD,EAAwB,UAAS,CAAA;GAAI,GAAhEF,CAAgE,CAC7E;GACD,kBAACL,GAAD;IAAO,MAAK;IAAI,SAAS,kBAACQ,GAAD,CAAyB,CAAA;GAAI,CAAA;EAChD,EAAA,CAAA,EACS,CAAA,EACE,GAZKC,GAAa,MAAM,EAYxB;CACC,CAAA;AAE9B;AAGA,SAASX,EAAkB,EAAE,eAAqC;CAGhE,OAFAY,EAAyB,GACzBC,cAAsBC,EAAmB,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,GACxDC;AACT;AAEA,SAASC,EAAkB,EAAE,YAA4B;CACvD,OACE,kBAAC,OAAD;EACE,WAAU;EACV,MAAK;EACL,aAAU;EAEV,UAAA,kBAAC,OAAD;GAAK,WAAU;GAAoC,UAA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I,aAAa;CAAe,CAClF;CACA,IAAI,CAACH,KAAiBG,MAAY,MAAMC,KAAW,CAACC,GAClD,OAAO,kBAAChC,GAAD,EAAmB,OAAOU,EAAG,4BAA4B,oBAAoB,EAAI,CAAA;CAE1F,IAAMuB,IAAQD,GAAM,OACdE,IAAQC,EAAaF,GAAO,SAAS,GACrCG,IAAMD,EAAaF,GAAO,OAAO,GACjCI,IACJJ,KAASC,KAASE,IACdE,EAAU;EAAE;EAAO;EAAK,QAAQL,EAAM;EAAQ,UAAUA,EAAM;CAAS,GAAGR,CAAQ,CAAC,CAAC,QACpF;CACN,OACE,kBAACvB,GAAD;EACE,MAAK;EACL,SAAS;IAAGsB,EAAc,QAAQM,KAAW;IAAON,EAAc,OAAOa;EAAI;CAC9E,CAAA;AAEL;AAEA,SAAS3C,IAAyB;CAChC,IAAM,EAAE,gBAAab,EAAY;CACjC,OAAO,kBAACuB,GAAD;EAAU,SAAA;EAAQ,IAAImC,EAASjC,GAAUY,CAAY;CAAI,CAAA;AAClE"}
|
|
1
|
+
{"version":3,"file":"CalendarRoutesV2.js","names":["CalendarRoutesV2","useCalendar","WorkspacePagesV2Provider","CalendarPrefsProvider","CalendarV2Session","Routes","Route","OpeningViewRedirect","ViewRoute","EventRedirect","LEGACY_PAGE_DIALOGS","path","dialog","DialogRedirect","UnknownAddressRedirect","currentUser","useCalendarV2PrefsBridge","useEffect","useCalendarV2Store","children","CalendarV2Loading","label","RedirectToView","useLocation","Navigate","calendarV2Href","basePath","view","changes","search","tr","useTr","useCalendarPrefs","usePrefsSettled","prefs","useParams","viewForName","viewType","DEFAULT_VIEW","jsx","ViewPage","useCalendarV2Navigation","date","CalendarPageV2","SEARCH_PARAMS","timeZone","useCalendarTimeZone","prefsSettled","useQuery","CalendarV2EventDayDocument","eventId","loading","data","event","start","parseInstant","end","day","eventDays","peekId","seriesReadAloneId","value","viewPath"],"sources":["../../src/v2/CalendarRoutesV2.tsx"],"sourcesContent":["/**\n * The redesigned calendar's routes (BOFF-15698), rendered instead of today's when the host\n * passes `calendarRedesign` (FluidGrids only). Today's addresses keep working (§2):\n *\n * /calendar → view/<opening view> (the person's setting; Week by default)\n * /calendar/view/year → view/month\n * /calendar/view/timeline → view/week\n * /calendar/view/agenda → view/list\n * /calendar/resources → view/week?dialog=rooms\n * /calendar/subscriptions → view/week?dialog=share\n * /calendar/settings → view/week?dialog=settings\n * /calendar/event/:id → view/week?event=:id&date=<its day> (opens the peek)\n * anything else → view/week\n *\n * A redirect keeps the query parameters a link carried. The tree renders under\n * `WorkspacePagesV2Provider enabled` (BOFF-15645), so the shared v2 parts take their new look\n * before the app turns `workspacePagesV2` on everywhere.\n */\nimport { useEffect, type ReactNode } from 'react';\nimport { Navigate, Route, Routes, useLocation, useParams } from 'react-router';\nimport { useQuery } from '@apollo/client/react';\nimport { WorkspacePagesV2Provider } from '@burdenoff/fe-libs/ui';\nimport {\n CalendarV2EventDayDocument,\n type CalendarV2EventDayQuery,\n type CalendarV2EventDayQueryVariables,\n} from '../generated/wspace-operations';\nimport { useCalendar } from '../providers/CalendarProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport { CalendarPageV2 } from './CalendarPageV2';\nimport { parseInstant, seriesReadAloneId } from './data/normalize';\nimport {\n CalendarPrefsProvider,\n useCalendarPrefs,\n useCalendarTimeZone,\n usePrefsSettled,\n} from './prefs/CalendarPrefsProvider';\nimport {\n calendarV2Href,\n DEFAULT_VIEW,\n LEGACY_PAGE_DIALOGS,\n SEARCH_PARAMS,\n viewForName,\n viewPath,\n} from './routes';\nimport { useCalendarV2Store } from './state/calendarV2Store';\nimport { useCalendarV2Navigation } from './state/useCalendarV2Navigation';\nimport { useCalendarV2PrefsBridge } from './state/useCalendarV2PrefsBridge';\nimport { eventDays } from './time/calendarTime';\nimport type { CalendarV2Dialog, CalendarV2View } from './types';\n\nexport function CalendarRoutesV2() {\n const { currentUser } = useCalendar();\n return (\n <WorkspacePagesV2Provider enabled>\n {/* One settings session per person: another person signing in starts afresh. */}\n <CalendarPrefsProvider key={currentUser?.id ?? ''}>\n <CalendarV2Session>\n <Routes>\n <Route index element={<OpeningViewRedirect />} />\n <Route path=\"view/:viewType\" element={<ViewRoute />} />\n <Route path=\"event/:eventId\" element={<EventRedirect />} />\n {Object.entries(LEGACY_PAGE_DIALOGS).map(([path, dialog]) => (\n <Route key={path} path={path} element={<DialogRedirect dialog={dialog} />} />\n ))}\n <Route path=\"*\" element={<UnknownAddressRedirect />} />\n </Routes>\n </CalendarV2Session>\n </CalendarPrefsProvider>\n </WorkspacePagesV2Provider>\n );\n}\n\n/** What lives for the visit: the settings bridge; the visit's state is cleared on leaving. */\nfunction CalendarV2Session({ children }: { children: ReactNode }) {\n useCalendarV2PrefsBridge();\n useEffect(() => () => useCalendarV2Store.getState().reset(), []);\n return children;\n}\n\nfunction CalendarV2Loading({ label }: { label: string }) {\n return (\n <div\n className=\"min-h-screen bg-bg-canvas flex items-center justify-center\"\n role=\"status\"\n aria-live=\"polite\"\n >\n <div className=\"text-text-secondary font-text-md\">{label}</div>\n </div>\n );\n}\n\n/** Replaces the address with a view of the redesign, keeping the query the link carried. */\nfunction RedirectToView({\n view,\n changes,\n}: {\n view: CalendarV2View;\n changes?: Readonly<Record<string, string | null>>;\n}) {\n const { basePath } = useCalendar();\n const { search } = useLocation();\n return <Navigate replace to={calendarV2Href(basePath, view, changes, search)} />;\n}\n\n/** The person's opening view, once the account has said which (not a stale device copy's). */\nfunction OpeningViewRedirect() {\n const tr = useTr();\n const { prefs } = useCalendarPrefs();\n if (!usePrefsSettled()) {\n return <CalendarV2Loading label={tr('calendar.v2.openingCalendar', 'Opening the calendar…')} />;\n }\n return <RedirectToView view={prefs.defaultView} />;\n}\n\nfunction ViewRoute() {\n const { viewType } = useParams();\n const view = viewForName(viewType);\n if (view === null) return <RedirectToView view={DEFAULT_VIEW} />;\n if (view !== viewType) return <RedirectToView view={view} />;\n return <ViewPage view={view} />;\n}\n\n/** A view of the redesign: mirrors the address into the store, then shows the page. */\nfunction ViewPage({ view }: { view: CalendarV2View }) {\n const { date } = useCalendarV2Navigation();\n useEffect(() => {\n useCalendarV2Store.getState().syncRoute(view, date);\n }, [view, date]);\n return <CalendarPageV2 />;\n}\n\nfunction DialogRedirect({ dialog }: { dialog: CalendarV2Dialog }) {\n return <RedirectToView view=\"week\" changes={{ [SEARCH_PARAMS.dialog]: dialog }} />;\n}\n\n/**\n * Today's event page: the event's week with its peek open. The day is the event's in the\n * calendar's zone (an all-day event's own day), read once the account has said which zone; an\n * event that can't be read (deleted, not shared) opens the peek without a day, and the peek\n * says what happened. A repeating event opens at its first date, unless that was cancelled (A4).\n */\nfunction EventRedirect() {\n const { eventId = '' } = useParams();\n const tr = useTr();\n const timeZone = useCalendarTimeZone();\n const prefsSettled = usePrefsSettled();\n const { data, loading } = useQuery<CalendarV2EventDayQuery, CalendarV2EventDayQueryVariables>(\n CalendarV2EventDayDocument,\n { variables: { id: eventId }, skip: eventId === '', fetchPolicy: 'network-only' }\n );\n if (!prefsSettled || (eventId !== '' && loading && !data)) {\n return <CalendarV2Loading label={tr('calendar.v2.openingEvent', 'Opening the event…')} />;\n }\n const event = data?.event;\n const start = parseInstant(event?.startTime);\n const end = parseInstant(event?.endTime);\n const day =\n event && start && end\n ? eventDays({ start, end, allDay: event.allDay, timeZone: event.timezone }, timeZone).start\n : null;\n const peekId =\n event?.isRecurring && start\n ? seriesReadAloneId(\n eventId,\n start,\n (event.recurrenceExceptions ?? []).flatMap((value) => parseInstant(value) ?? [])\n )\n : eventId;\n return (\n <RedirectToView\n view=\"week\"\n changes={{ [SEARCH_PARAMS.event]: peekId || null, [SEARCH_PARAMS.date]: day }}\n />\n );\n}\n\nfunction UnknownAddressRedirect() {\n const { basePath } = useCalendar();\n return <Navigate replace to={viewPath(basePath, DEFAULT_VIEW)} />;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAmDA,SAAgBA,IAAmB;CACjC,IAAM,EAAE,mBAAgBC,EAAY;CACpC,OACE,kBAACC,GA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,QAAQL,EAAM;EAAQ,UAAUA,EAAM;CAAS,GAAGR,CAAQ,CAAC,CAAC,QACpF,MACAc,IACJN,GAAO,eAAeC,IAClBM,EACEV,GACAI,IACCD,EAAM,wBAAwB,CAAC,EAAA,CAAG,SAAS,MAAUE,EAAaM,CAAK,KAAK,CAAC,CAAC,CACjF,IACAX;CACN,OACE,kBAAC5B,GAAD;EACE,MAAK;EACL,SAAS;IAAGsB,EAAc,QAAQe,KAAU;IAAOf,EAAc,OAAOa;EAAI;CAC7E,CAAA;AAEL;AAEA,SAAS3C,IAAyB;CAChC,IAAM,EAAE,gBAAab,EAAY;CACjC,OAAO,kBAACuB,GAAD;EAAU,SAAA;EAAQ,IAAIsC,EAASpC,GAAUY,CAAY;CAAI,CAAA;AAClE"}
|
package/dist/v2/data/errors.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
/** The error's code, e.g. `NOT_FOUND`; null for a network failure or no code. */
|
|
2
2
|
export declare function graphQLErrorCode(error: unknown): string | null;
|
|
3
|
+
/**
|
|
4
|
+
* The service's key for the error's words (`i18nKey`, e.g. `resource.errors.bookingNotFound`):
|
|
5
|
+
* what went wrong, in any language; null when it carries none.
|
|
6
|
+
*/
|
|
7
|
+
export declare function graphQLErrorKey(error: unknown): string | null;
|
|
3
8
|
/** The text to show under "Show technical details": the service's own message. */
|
|
4
9
|
export declare function technicalDetails(error: unknown): string;
|
package/dist/v2/data/errors.js
CHANGED
|
@@ -9,9 +9,13 @@ function n(e) {
|
|
|
9
9
|
let n = t(e)?.code;
|
|
10
10
|
return typeof n == "string" ? n : null;
|
|
11
11
|
}
|
|
12
|
-
function r(
|
|
12
|
+
function r(e) {
|
|
13
|
+
let n = t(e)?.i18nKey;
|
|
14
|
+
return typeof n == "string" ? n : null;
|
|
15
|
+
}
|
|
16
|
+
function i(t) {
|
|
13
17
|
return e.is(t) ? t.errors.map((e) => e.message).join("\n") : t instanceof Error ? t.message : String(t);
|
|
14
18
|
}
|
|
15
|
-
export { n as graphQLErrorCode, r as technicalDetails };
|
|
19
|
+
export { n as graphQLErrorCode, r as graphQLErrorKey, i as technicalDetails };
|
|
16
20
|
|
|
17
21
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","names":["firstExtensions","CombinedGraphQLErrors","error","extensions","graphQLErrorCode","code","technicalDetails","item"],"sources":["../../../src/v2/data/errors.ts"],"sourcesContent":["/**\n * Reading the service's errors (BOFF-15698 A1): the code a GraphQL error carries in its\n * extensions (`NOT_FOUND`, `FORBIDDEN`, …), so the page can say what happened instead of a\n * generic failure, and the service's own words for \"Show technical details\".\n */\nimport { CombinedGraphQLErrors } from '@apollo/client';\n\nfunction firstExtensions(error: unknown): Record<string, unknown> | null {\n if (!CombinedGraphQLErrors.is(error)) return null;\n const extensions = error.errors[0]?.extensions;\n return extensions && typeof extensions === 'object' ? extensions : null;\n}\n\n/** The error's code, e.g. `NOT_FOUND`; null for a network failure or no code. */\nexport function graphQLErrorCode(error: unknown): string | null {\n const code = firstExtensions(error)?.code;\n return typeof code === 'string' ? code : null;\n}\n\n/** The text to show under \"Show technical details\": the service's own message. */\nexport function technicalDetails(error: unknown): string {\n if (CombinedGraphQLErrors.is(error)) {\n return error.errors.map((item) => item.message).join('\\n');\n }\n return error instanceof Error ? error.message : String(error);\n}\n"],"mappings":";;AAOA,SAASA,EAAgB,GAAgD;CACvE,IAAI,CAACC,EAAsB,GAAGC,CAAK,GAAG,OAAO;CAC7C,IAAMC,IAAaD,EAAM,OAAO,EAAE,EAAE;CACpC,OAAOC,KAAc,OAAOA,KAAe,WAAWA,IAAa;AACrE;AAGA,SAAgBC,EAAiB,GAA+B;CAC9D,IAAMC,IAAOL,EAAgBE,CAAK,CAAC,EAAE;CACrC,OAAO,OAAOG,KAAS,WAAWA,IAAO;AAC3C;AAGA,SAAgBC,EAAiB,GAAwB;CAIvD,
|
|
1
|
+
{"version":3,"file":"errors.js","names":["firstExtensions","CombinedGraphQLErrors","error","extensions","graphQLErrorCode","code","graphQLErrorKey","key","technicalDetails","item"],"sources":["../../../src/v2/data/errors.ts"],"sourcesContent":["/**\n * Reading the service's errors (BOFF-15698 A1): the code a GraphQL error carries in its\n * extensions (`NOT_FOUND`, `FORBIDDEN`, …), so the page can say what happened instead of a\n * generic failure, and the service's own words for \"Show technical details\".\n */\nimport { CombinedGraphQLErrors } from '@apollo/client';\n\nfunction firstExtensions(error: unknown): Record<string, unknown> | null {\n if (!CombinedGraphQLErrors.is(error)) return null;\n const extensions = error.errors[0]?.extensions;\n return extensions && typeof extensions === 'object' ? extensions : null;\n}\n\n/** The error's code, e.g. `NOT_FOUND`; null for a network failure or no code. */\nexport function graphQLErrorCode(error: unknown): string | null {\n const code = firstExtensions(error)?.code;\n return typeof code === 'string' ? code : null;\n}\n\n/**\n * The service's key for the error's words (`i18nKey`, e.g. `resource.errors.bookingNotFound`):\n * what went wrong, in any language; null when it carries none.\n */\nexport function graphQLErrorKey(error: unknown): string | null {\n const key = firstExtensions(error)?.i18nKey;\n return typeof key === 'string' ? key : null;\n}\n\n/** The text to show under \"Show technical details\": the service's own message. */\nexport function technicalDetails(error: unknown): string {\n if (CombinedGraphQLErrors.is(error)) {\n return error.errors.map((item) => item.message).join('\\n');\n }\n return error instanceof Error ? error.message : String(error);\n}\n"],"mappings":";;AAOA,SAASA,EAAgB,GAAgD;CACvE,IAAI,CAACC,EAAsB,GAAGC,CAAK,GAAG,OAAO;CAC7C,IAAMC,IAAaD,EAAM,OAAO,EAAE,EAAE;CACpC,OAAOC,KAAc,OAAOA,KAAe,WAAWA,IAAa;AACrE;AAGA,SAAgBC,EAAiB,GAA+B;CAC9D,IAAMC,IAAOL,EAAgBE,CAAK,CAAC,EAAE;CACrC,OAAO,OAAOG,KAAS,WAAWA,IAAO;AAC3C;AAMA,SAAgBC,EAAgB,GAA+B;CAC7D,IAAMC,IAAMP,EAAgBE,CAAK,CAAC,EAAE;CACpC,OAAO,OAAOK,KAAQ,WAAWA,IAAM;AACzC;AAGA,SAAgBC,EAAiB,GAAwB;CAIvD,OAHIP,EAAsB,GAAGC,CAAK,IACzBA,EAAM,OAAO,KAAK,MAASO,EAAK,OAAO,CAAC,CAAC,KAAK,IAAI,IAEpDP,aAAiB,QAAQA,EAAM,UAAU,OAAOA,CAAK;AAC9D"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { CalendarV2CalendarsQuery,
|
|
1
|
+
import { CalendarV2CalendarsQuery, CalendarV2EventFieldsFragment, CalendarV2EventOccurrencesQuery, CalendarV2FreeBusyQuery } from '../../generated/wspace-operations';
|
|
2
2
|
import { CalendarEventV2, CalendarV2, PersonFreeBusyV2 } from '../types';
|
|
3
3
|
export type RawCalendarV2 = CalendarV2CalendarsQuery['calendars']['calendars'][number];
|
|
4
|
-
export type RawEventV2 =
|
|
4
|
+
export type RawEventV2 = CalendarV2EventFieldsFragment;
|
|
5
|
+
export type RawOccurrenceV2 = CalendarV2EventOccurrencesQuery['eventsInRangeForCalendars']['occurrences'][number];
|
|
5
6
|
export type RawPersonFreeBusyV2 = CalendarV2FreeBusyQuery['freeBusy'][number];
|
|
6
7
|
/** The instant an API time names; null when it doesn't parse. */
|
|
7
8
|
export declare function parseInstant(value: string | null | undefined): Date | null;
|
|
@@ -16,8 +17,35 @@ export declare function toCalendarV2(raw: RawCalendarV2, myUserId: string | null
|
|
|
16
17
|
* default first in each), then the others; by name within each.
|
|
17
18
|
*/
|
|
18
19
|
export declare function sortCalendarsV2(calendars: readonly CalendarV2[]): CalendarV2[];
|
|
19
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* A date of a series as the service names it among the occurrences: `<seriesId>@<instanceDate>`,
|
|
22
|
+
* the date as an ISO 8601 UTC instant.
|
|
23
|
+
*/
|
|
24
|
+
export declare function occurrenceId(seriesId: string, instanceDate: Date): string;
|
|
25
|
+
/** The series and date an occurrence id names; null for any other id (an event's own). */
|
|
26
|
+
export declare function parseOccurrenceId(id: string): {
|
|
27
|
+
seriesId: string;
|
|
28
|
+
instanceDate: Date;
|
|
29
|
+
} | null;
|
|
30
|
+
/**
|
|
31
|
+
* The id a series read on its own goes by: its first date, named as the views name it, unless
|
|
32
|
+
* that date was cancelled; then the series' own id, a series with no date to name (its first
|
|
33
|
+
* date isn't on the calendar, and the views would never find it).
|
|
34
|
+
*/
|
|
35
|
+
export declare function seriesReadAloneId(seriesId: string, start: Date, cancelledDates: readonly Date[]): string;
|
|
36
|
+
/**
|
|
37
|
+
* A stored event as the views show it; null when its times don't parse (it can't be placed). A
|
|
38
|
+
* series read on its own (the peek, the event dialog, search) is its first date, named as the
|
|
39
|
+
* views name that date; when that date was cancelled, it is the series with no date to name.
|
|
40
|
+
*/
|
|
20
41
|
export declare function toCalendarEventV2(raw: RawEventV2, myUserId: string | null): CalendarEventV2 | null;
|
|
42
|
+
/**
|
|
43
|
+
* One occurrence for the views (A4): its event, at this date's times. A regular date of a series
|
|
44
|
+
* carries the series (whose own times are its first date's) with only the room bookings of that
|
|
45
|
+
* date; a date moved on its own carries its own row and names the series and the date it was
|
|
46
|
+
* moved from. Null when its times don't parse.
|
|
47
|
+
*/
|
|
48
|
+
export declare function toOccurrenceV2(raw: RawOccurrenceV2, myUserId: string | null): CalendarEventV2 | null;
|
|
21
49
|
/** Events by start (all-day first on a tie, then longer first), each once. */
|
|
22
50
|
export declare function sortEventsV2(events: readonly CalendarEventV2[]): CalendarEventV2[];
|
|
23
51
|
/** Minutes after midnight of an "HH:MM" time ("24:00" is 1440); null for anything else. */
|