@burdenoff/microfe-calendar 2026.1124.2 → 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 +811 -69
- package/dist/generated/wspace-operations.js +173 -19
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +405 -6
- package/dist/pages/ResourcesPage.js.map +1 -1
- package/dist/translations/en.d.ts +250 -1
- 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/enums.d.ts +1 -0
- package/dist/v2/data/enums.js +6 -2
- package/dist/v2/data/enums.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/dialogs/CalendarDialogsV2.js +12 -9
- package/dist/v2/dialogs/CalendarDialogsV2.js.map +1 -1
- package/dist/v2/event/CustomRepeat.d.ts +5 -0
- package/dist/v2/event/CustomRepeat.js +246 -0
- package/dist/v2/event/CustomRepeat.js.map +1 -0
- package/dist/v2/event/EventDetailsTab.d.ts +6 -0
- package/dist/v2/event/EventDetailsTab.js +291 -0
- package/dist/v2/event/EventDetailsTab.js.map +1 -0
- package/dist/v2/event/EventDialog.d.ts +35 -0
- package/dist/v2/event/EventDialog.js +388 -0
- package/dist/v2/event/EventDialog.js.map +1 -0
- package/dist/v2/event/EventDialogs.d.ts +3 -0
- package/dist/v2/event/EventDialogs.js +118 -0
- package/dist/v2/event/EventDialogs.js.map +1 -0
- package/dist/v2/event/EventMoreTab.d.ts +4 -0
- package/dist/v2/event/EventMoreTab.js +215 -0
- package/dist/v2/event/EventMoreTab.js.map +1 -0
- package/dist/v2/event/EventPeopleTab.d.ts +8 -0
- package/dist/v2/event/EventPeopleTab.js +422 -0
- package/dist/v2/event/EventPeopleTab.js.map +1 -0
- package/dist/v2/event/EventPlaceTab.d.ts +6 -0
- package/dist/v2/event/EventPlaceTab.js +264 -0
- package/dist/v2/event/EventPlaceTab.js.map +1 -0
- package/dist/v2/event/FindTimeDialog.d.ts +26 -0
- package/dist/v2/event/FindTimeDialog.js +667 -0
- package/dist/v2/event/FindTimeDialog.js.map +1 -0
- package/dist/v2/event/RepeatField.d.ts +5 -0
- package/dist/v2/event/RepeatField.js +91 -0
- package/dist/v2/event/RepeatField.js.map +1 -0
- package/dist/v2/event/dialogLogic.d.ts +97 -0
- package/dist/v2/event/dialogLogic.js +120 -0
- package/dist/v2/event/dialogLogic.js.map +1 -0
- package/dist/v2/event/dialogModel.d.ts +51 -0
- package/dist/v2/event/dialogModel.js +13 -0
- package/dist/v2/event/dialogModel.js.map +1 -0
- package/dist/v2/event/eventForm.d.ts +235 -0
- package/dist/v2/event/eventForm.js +450 -0
- package/dist/v2/event/eventForm.js.map +1 -0
- package/dist/v2/event/findTime.d.ts +120 -0
- package/dist/v2/event/findTime.js +149 -0
- package/dist/v2/event/findTime.js.map +1 -0
- package/dist/v2/event/findTimeSource.d.ts +102 -0
- package/dist/v2/event/findTimeSource.js +107 -0
- package/dist/v2/event/findTimeSource.js.map +1 -0
- package/dist/v2/event/parts.d.ts +46 -0
- package/dist/v2/event/parts.js +124 -0
- package/dist/v2/event/parts.js.map +1 -0
- package/dist/v2/event/place.d.ts +64 -0
- package/dist/v2/event/place.js +48 -0
- package/dist/v2/event/place.js.map +1 -0
- package/dist/v2/event/repeatWords.d.ts +19 -0
- package/dist/v2/event/repeatWords.js +130 -0
- package/dist/v2/event/repeatWords.js.map +1 -0
- package/dist/v2/event/rrule.d.ts +90 -0
- package/dist/v2/event/rrule.js +368 -0
- package/dist/v2/event/rrule.js.map +1 -0
- package/dist/v2/event/savePlan.d.ts +160 -0
- package/dist/v2/event/savePlan.js +219 -0
- package/dist/v2/event/savePlan.js.map +1 -0
- package/dist/v2/event/useEventData.d.ts +96 -0
- package/dist/v2/event/useEventData.js +229 -0
- package/dist/v2/event/useEventData.js.map +1 -0
- package/dist/v2/event/useEventDialogModel.d.ts +50 -0
- package/dist/v2/event/useEventDialogModel.js +144 -0
- package/dist/v2/event/useEventDialogModel.js.map +1 -0
- package/dist/v2/event/useEventSave.d.ts +57 -0
- package/dist/v2/event/useEventSave.js +276 -0
- package/dist/v2/event/useEventSave.js.map +1 -0
- 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/format.d.ts +2 -0
- package/dist/v2/format.js +4 -0
- package/dist/v2/format.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/EventPeek.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/CalendarRail.js.map +1 -1
- package/dist/v2/rail/useMonthEventDates.js +1 -1
- package/dist/v2/rail/useMonthEventDates.js.map +1 -1
- package/dist/v2/runs/RunPeek.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 +32 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarPageV2.js","names":["_Fragment","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","
|
|
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,UAAA;MACE,kBAACC,GAAD,CAAmB,CAAA;MACnB,kBAACC,GAAD,CAAoB,CAAA;MACpB,kBAACC,GAAD,CAAe,CAAA;KACF;;GACZ,CAAA;GACL,kBAACC,GAAD,CAAgB,CAAA;GAChB,kBAACC,GAAD,CAAc,CAAA;GACd,kBAACC,GAAD,CAAkB,CAAA;GAClB,kBAACC,GAAD,CAAY,CAAA;GACZ,kBAACC,GAAD,CAAoB,CAAA;EACH,EAAA,CAAA;CACA,CAAA;AAEzB;AAEA,SAASL,IAAe;CACtB,IAAMM,IAAOC,EAAgB,GACvBC,IAAUC,EAAuB,IAAI,GACrCC,IAASC,EAAmBH,GAASlB,CAAe,GACpDsB,IAAWC,GAAoB,MAAUC,EAAM,QAAQ,GACvDC,IAAW,CAACT,EAAK,WAAWM;CAClC,OACE,kBAAC,OAAD;EACE,KAAKJ;EACL,WAAU;EACV,OAAO;GAAE,QAAQE,KA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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,k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AAU,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,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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, RsvpStatus>>;
|
|
|
4
4
|
export declare const SCOPE_ALL_EVENTS: UpdateScope;
|
|
5
5
|
export declare const EVENT_TYPE_MEETING: EventType;
|
|
6
6
|
export declare const REMINDER_IN_APP: ReminderChannel;
|
|
7
|
+
export declare const REMINDER_CHANNEL: Readonly<Record<'IN_APP' | 'EMAIL' | 'SMS', ReminderChannel>>;
|
package/dist/v2/data/enums.js
CHANGED
|
@@ -4,7 +4,11 @@ var e = {
|
|
|
4
4
|
TENTATIVE: "TENTATIVE",
|
|
5
5
|
DECLINED: "DECLINED",
|
|
6
6
|
NO_RESPONSE: "NO_RESPONSE"
|
|
7
|
-
}, t = "ALL_EVENTS", n = "MEETING", r = "IN_APP"
|
|
8
|
-
|
|
7
|
+
}, t = "ALL_EVENTS", n = "MEETING", r = "IN_APP", i = {
|
|
8
|
+
IN_APP: r,
|
|
9
|
+
EMAIL: "EMAIL",
|
|
10
|
+
SMS: "SMS"
|
|
11
|
+
};
|
|
12
|
+
export { n as EVENT_TYPE_MEETING, i as REMINDER_CHANNEL, r as REMINDER_IN_APP, e as RSVP_STATUS, t as SCOPE_ALL_EVENTS };
|
|
9
13
|
|
|
10
14
|
//# sourceMappingURL=enums.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enums.js","names":["RSVP_STATUS","SCOPE_ALL_EVENTS","EVENT_TYPE_MEETING","REMINDER_IN_APP"],"sources":["../../../src/v2/data/enums.ts"],"sourcesContent":["/**\n * The schema's enum values the redesign sends (BOFF-15698 A1). The generated enums are string\n * enums whose values are the schema's names; importing them at run time would bundle every enum\n * of the workspace schema (over two thousand), so the few values sent are written here as the\n * strings they are. Each cast is exact: the string is the enum member's value.\n */\nimport type {\n EventType,\n ReminderChannel,\n RsvpStatus,\n UpdateScope,\n} from '../../generated/wspace-types';\nimport type { EventResponseV2 } from '../types';\n\nexport const RSVP_STATUS: Readonly<Record<EventResponseV2, RsvpStatus>> = {\n ACCEPTED: 'ACCEPTED' as RsvpStatus,\n TENTATIVE: 'TENTATIVE' as RsvpStatus,\n DECLINED: 'DECLINED' as RsvpStatus,\n NO_RESPONSE: 'NO_RESPONSE' as RsvpStatus,\n};\n\nexport const SCOPE_ALL_EVENTS = 'ALL_EVENTS' as UpdateScope;\n\nexport const EVENT_TYPE_MEETING = 'MEETING' as EventType;\n\nexport const REMINDER_IN_APP = 'IN_APP' as ReminderChannel;\n"],"mappings":";AAcA,IAAaA,IAA6D;CACxE,UAAU;CACV,WAAW;CACX,UAAU;CACV,aAAa;AACf,GAEaC,IAAmB,cAEnBC,IAAqB,WAErBC,IAAkB"}
|
|
1
|
+
{"version":3,"file":"enums.js","names":["RSVP_STATUS","SCOPE_ALL_EVENTS","EVENT_TYPE_MEETING","REMINDER_IN_APP","REMINDER_CHANNEL"],"sources":["../../../src/v2/data/enums.ts"],"sourcesContent":["/**\n * The schema's enum values the redesign sends (BOFF-15698 A1). The generated enums are string\n * enums whose values are the schema's names; importing them at run time would bundle every enum\n * of the workspace schema (over two thousand), so the few values sent are written here as the\n * strings they are. Each cast is exact: the string is the enum member's value.\n */\nimport type {\n EventType,\n ReminderChannel,\n RsvpStatus,\n UpdateScope,\n} from '../../generated/wspace-types';\nimport type { EventResponseV2 } from '../types';\n\nexport const RSVP_STATUS: Readonly<Record<EventResponseV2, RsvpStatus>> = {\n ACCEPTED: 'ACCEPTED' as RsvpStatus,\n TENTATIVE: 'TENTATIVE' as RsvpStatus,\n DECLINED: 'DECLINED' as RsvpStatus,\n NO_RESPONSE: 'NO_RESPONSE' as RsvpStatus,\n};\n\nexport const SCOPE_ALL_EVENTS = 'ALL_EVENTS' as UpdateScope;\n\nexport const EVENT_TYPE_MEETING = 'MEETING' as EventType;\n\nexport const REMINDER_IN_APP = 'IN_APP' as ReminderChannel;\n\nexport const REMINDER_CHANNEL: Readonly<Record<'IN_APP' | 'EMAIL' | 'SMS', ReminderChannel>> = {\n IN_APP: REMINDER_IN_APP,\n EMAIL: 'EMAIL' as ReminderChannel,\n SMS: 'SMS' as ReminderChannel,\n};\n"],"mappings":";AAcA,IAAaA,IAA6D;CACxE,UAAU;CACV,WAAW;CACX,UAAU;CACV,aAAa;AACf,GAEaC,IAAmB,cAEnBC,IAAqB,WAErBC,IAAkB,UAElBC,IAAkF;CAC7F,QAAQD;CACR,OAAO;CACP,KAAK;AACP"}
|
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. */
|
|
@@ -151,12 +151,36 @@ function C(e) {
|
|
|
151
151
|
end: r
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
|
-
function w(
|
|
154
|
+
function w(e, t) {
|
|
155
|
+
return `${e}@${t.toISOString()}`;
|
|
156
|
+
}
|
|
157
|
+
var T = /^(.+)@(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z)$/;
|
|
158
|
+
function E(e) {
|
|
159
|
+
let t = T.exec(e), n = i(t?.[2]);
|
|
160
|
+
return t?.[1] && n ? {
|
|
161
|
+
seriesId: t[1],
|
|
162
|
+
instanceDate: n
|
|
163
|
+
} : null;
|
|
164
|
+
}
|
|
165
|
+
function D(e) {
|
|
166
|
+
return e.isRecurring ? (e.recurrenceExceptions ?? []).flatMap((e) => {
|
|
167
|
+
let t = i(e);
|
|
168
|
+
return t ? [t] : [];
|
|
169
|
+
}) : [];
|
|
170
|
+
}
|
|
171
|
+
function O(e, t, n) {
|
|
172
|
+
return n.some((e) => e.getTime() === t.getTime()) ? e : w(e, t);
|
|
173
|
+
}
|
|
174
|
+
function k(t, o) {
|
|
155
175
|
let s = i(t.startTime), c = i(t.endTime);
|
|
156
176
|
if (!s || !c) return null;
|
|
157
|
-
let l = t.attendees.map(S), u = o ? l.find((e) => e.userId === o) : void 0, d = t.onlineMeetingUrl?.trim();
|
|
177
|
+
let l = t.attendees.map(S), u = o ? l.find((e) => e.userId === o) : void 0, d = t.onlineMeetingUrl?.trim(), f = D(t), p = t.isRecurring ? O(t.id, s, f) : t.id;
|
|
158
178
|
return {
|
|
159
|
-
id:
|
|
179
|
+
id: p,
|
|
180
|
+
eventId: t.id,
|
|
181
|
+
seriesId: t.isRecurring ? t.id : null,
|
|
182
|
+
instanceDate: t.isRecurring && p !== t.id ? s : null,
|
|
183
|
+
isModified: !1,
|
|
160
184
|
calendarId: t.calendarId,
|
|
161
185
|
title: t.title,
|
|
162
186
|
description: t.description ?? null,
|
|
@@ -169,6 +193,8 @@ function w(t, o) {
|
|
|
169
193
|
type: n(t.eventType, g, "MEETING"),
|
|
170
194
|
isRecurring: t.isRecurring,
|
|
171
195
|
rrule: t.rrule ?? null,
|
|
196
|
+
cancelledDates: f,
|
|
197
|
+
isBusy: t.isBusy,
|
|
172
198
|
organizerId: t.createdBy,
|
|
173
199
|
guests: l,
|
|
174
200
|
myResponse: u?.response ?? null,
|
|
@@ -195,15 +221,33 @@ function w(t, o) {
|
|
|
195
221
|
updatedAt: i(t.updatedAt) ?? s
|
|
196
222
|
};
|
|
197
223
|
}
|
|
198
|
-
function
|
|
224
|
+
function A(e, t, n) {
|
|
225
|
+
return e.filter((e) => e.start.getTime() < n.getTime() && e.end.getTime() > t.getTime());
|
|
226
|
+
}
|
|
227
|
+
function j(e, t) {
|
|
228
|
+
let n = k(e.event, t), r = i(e.start), a = i(e.end);
|
|
229
|
+
if (!n || !r || !a) return null;
|
|
230
|
+
let o = e.seriesId ?? n.seriesId, s = a.getTime() < r.getTime() ? r : a;
|
|
231
|
+
return {
|
|
232
|
+
...n,
|
|
233
|
+
id: e.id,
|
|
234
|
+
start: r,
|
|
235
|
+
end: s,
|
|
236
|
+
seriesId: o,
|
|
237
|
+
instanceDate: o ? i(e.instanceDate) ?? r : null,
|
|
238
|
+
isModified: e.isModified,
|
|
239
|
+
bookings: n.isRecurring ? A(n.bookings, r, s) : n.bookings
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
function M(e) {
|
|
199
243
|
let t = /* @__PURE__ */ new Set();
|
|
200
244
|
return [...e].sort((e, t) => e.start.getTime() - t.start.getTime() || Number(t.allDay) - Number(e.allDay) || t.end.getTime() - e.end.getTime() || e.id.localeCompare(t.id)).filter((e) => !t.has(e.id) && (t.add(e.id), !0));
|
|
201
245
|
}
|
|
202
|
-
var
|
|
246
|
+
var N = [
|
|
203
247
|
"BUSY",
|
|
204
248
|
"TENTATIVE",
|
|
205
249
|
"OUT_OF_OFFICE"
|
|
206
|
-
],
|
|
250
|
+
], P = {
|
|
207
251
|
SUNDAY: 0,
|
|
208
252
|
MONDAY: 1,
|
|
209
253
|
TUESDAY: 2,
|
|
@@ -212,14 +256,14 @@ var E = [
|
|
|
212
256
|
FRIDAY: 5,
|
|
213
257
|
SATURDAY: 6
|
|
214
258
|
};
|
|
215
|
-
function
|
|
259
|
+
function F(e) {
|
|
216
260
|
let t = /^(\d{1,2}):(\d{2})$/.exec(e.trim());
|
|
217
261
|
if (!t) return null;
|
|
218
262
|
let n = Number(t[1]), r = Number(t[2]);
|
|
219
263
|
return r > 59 || n > 24 || n === 24 && r > 0 ? null : n * 60 + r;
|
|
220
264
|
}
|
|
221
|
-
function
|
|
222
|
-
let n =
|
|
265
|
+
function I(t) {
|
|
266
|
+
let n = P[t.dayOfWeek], r = F(t.start), i = F(t.end), a = e(t.timezone);
|
|
223
267
|
return n === void 0 || r === null || i === null || !a || r === i ? null : {
|
|
224
268
|
weekday: n,
|
|
225
269
|
start: r,
|
|
@@ -227,13 +271,13 @@ function k(t) {
|
|
|
227
271
|
timeZone: a
|
|
228
272
|
};
|
|
229
273
|
}
|
|
230
|
-
function
|
|
274
|
+
function L(e) {
|
|
231
275
|
let t = e.busy.flatMap((e) => {
|
|
232
276
|
let t = i(e.start), r = i(e.end);
|
|
233
277
|
return !t || !r || r.getTime() < t.getTime() ? [] : [{
|
|
234
278
|
start: t,
|
|
235
279
|
end: r,
|
|
236
|
-
kind: n(e.kind,
|
|
280
|
+
kind: n(e.kind, N, "BUSY"),
|
|
237
281
|
allDay: e.allDay
|
|
238
282
|
}];
|
|
239
283
|
});
|
|
@@ -241,12 +285,12 @@ function A(e) {
|
|
|
241
285
|
userId: e.userId,
|
|
242
286
|
blocks: t,
|
|
243
287
|
workingHours: e.workingHours.flatMap((e) => {
|
|
244
|
-
let t =
|
|
288
|
+
let t = I(e);
|
|
245
289
|
return t ? [t] : [];
|
|
246
290
|
}),
|
|
247
291
|
truncated: e.truncated
|
|
248
292
|
};
|
|
249
293
|
}
|
|
250
|
-
export {
|
|
294
|
+
export { F as clockMinutes, w as occurrenceId, i as parseInstant, E as parseOccurrenceId, O as seriesReadAloneId, p as sortCalendarsV2, M as sortEventsV2, k as toCalendarEventV2, d as toCalendarV2, j as toOccurrenceV2, L as toPersonFreeBusyV2 };
|
|
251
295
|
|
|
252
296
|
//# sourceMappingURL=normalize.js.map
|