@sprucelabs/spruce-calendar-components 22.10.49 → 22.10.51

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.
Files changed (57) hide show
  1. package/build/.spruce/errors/options.types.d.ts +1 -1
  2. package/build/.spruce/schemas/schemas.types.d.ts +243 -243
  3. package/build/__tests__/support/SpyEventManager.d.ts +1 -1
  4. package/build/__tests__/support/SpyEventManager.js +3 -3
  5. package/build/__tests__/support/utilities/calendarAssert.d.ts +2 -2
  6. package/build/__tests__/support/utilities/calendarSkillAssert.d.ts +1 -1
  7. package/build/calendar/Calendar.vc.d.ts +9 -9
  8. package/build/calendar/CalendarEventManager.d.ts +5 -5
  9. package/build/calendar/CalendarEventManager.js +7 -7
  10. package/build/calendar/CalendarPeopleManager.d.ts +2 -2
  11. package/build/constants.d.ts +1 -1
  12. package/build/esm/.spruce/errors/options.types.d.ts +1 -1
  13. package/build/esm/.spruce/schemas/schemas.types.d.ts +243 -243
  14. package/build/esm/__tests__/support/SpyEventManager.d.ts +1 -1
  15. package/build/esm/__tests__/support/SpyEventManager.js +3 -3
  16. package/build/esm/__tests__/support/utilities/calendarAssert.d.ts +2 -2
  17. package/build/esm/__tests__/support/utilities/calendarSkillAssert.d.ts +1 -1
  18. package/build/esm/calendar/Calendar.vc.d.ts +9 -9
  19. package/build/esm/calendar/CalendarEventManager.d.ts +5 -5
  20. package/build/esm/calendar/CalendarEventManager.js +7 -7
  21. package/build/esm/calendar/CalendarPeopleManager.d.ts +2 -2
  22. package/build/esm/constants.d.ts +1 -1
  23. package/build/esm/skillViewControllers/Root.svc.d.ts +1 -1
  24. package/build/esm/stores/RemoteEventStore.d.ts +2 -2
  25. package/build/esm/stores/RemotePreferencesStore.d.ts +1 -1
  26. package/build/esm/toolBelt/CalendarToolRegistrar.d.ts +1 -1
  27. package/build/esm/toolBelt/states/AbstractCalendarEventToolBeltState.d.ts +1 -1
  28. package/build/esm/toolBelt/states/PrerequisitesToolBeltState.d.ts +4 -4
  29. package/build/esm/tools/CalendarSelectTool.vc.d.ts +2 -2
  30. package/build/esm/tools/EventDateTimeTool.vc.d.ts +1 -1
  31. package/build/esm/tools/EventRepeatingTool.vc.d.ts +2 -2
  32. package/build/esm/tools/EventTitleTool.vc.d.ts +2 -2
  33. package/build/esm/tools/PersonSelectTool.vc.d.ts +3 -3
  34. package/build/esm/tools/PersonSelectTool.vc.js +10 -10
  35. package/build/esm/types/calendar.types.d.ts +22 -22
  36. package/build/esm/utilities/calendarShiftGenerator.d.ts +1 -1
  37. package/build/esm/viewControllers/DateSelectCard.vc.d.ts +2 -2
  38. package/build/esm/viewControllers/RepeatingControlsList.vc.d.ts +1 -1
  39. package/build/esm/viewControllers/SelectUpdateRepeatingStrategyCard.vc.d.ts +1 -1
  40. package/build/skillViewControllers/Root.svc.d.ts +1 -1
  41. package/build/stores/RemoteEventStore.d.ts +2 -2
  42. package/build/stores/RemotePreferencesStore.d.ts +1 -1
  43. package/build/toolBelt/CalendarToolRegistrar.d.ts +1 -1
  44. package/build/toolBelt/states/AbstractCalendarEventToolBeltState.d.ts +1 -1
  45. package/build/toolBelt/states/PrerequisitesToolBeltState.d.ts +4 -4
  46. package/build/tools/CalendarSelectTool.vc.d.ts +2 -2
  47. package/build/tools/EventDateTimeTool.vc.d.ts +1 -1
  48. package/build/tools/EventRepeatingTool.vc.d.ts +2 -2
  49. package/build/tools/EventTitleTool.vc.d.ts +2 -2
  50. package/build/tools/PersonSelectTool.vc.d.ts +3 -3
  51. package/build/tools/PersonSelectTool.vc.js +10 -10
  52. package/build/types/calendar.types.d.ts +22 -22
  53. package/build/utilities/calendarShiftGenerator.d.ts +1 -1
  54. package/build/viewControllers/DateSelectCard.vc.d.ts +2 -2
  55. package/build/viewControllers/RepeatingControlsList.vc.d.ts +1 -1
  56. package/build/viewControllers/SelectUpdateRepeatingStrategyCard.vc.d.ts +1 -1
  57. package/package.json +1 -1
@@ -63,15 +63,15 @@ export default class CalendarViewController extends CoreCalendarViewController {
63
63
  shifts?: SpruceSchemas.HeartwoodViewControllers.v2021_02_11.CalendarShift[] | null | undefined;
64
64
  };
65
65
  }
66
- declare type Calendar = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Calendar;
67
- declare type Event = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.CalendarEvent;
68
- declare type DraftAddedHandler = (event: Event) => void | Promise<void>;
69
- declare type EventSwappedHandler = (draft: Event, saved: Event) => void | Promise<void>;
70
- declare type EventDroppedHandler = (id: string, updates: Partial<Event>) => boolean | Promise<boolean>;
71
- declare type DraftRemovedHandler = () => void | Promise<void>;
72
- declare type ClickEventHandler = (options: ClickEventOptions) => void | Promise<void>;
73
- declare type StartDateTimeChangeHandler = (date: number) => void | Promise<void>;
74
- declare type DeselectEventHandler = () => void | Promise<void>;
66
+ type Calendar = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Calendar;
67
+ type Event = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.CalendarEvent;
68
+ type DraftAddedHandler = (event: Event) => void | Promise<void>;
69
+ type EventSwappedHandler = (draft: Event, saved: Event) => void | Promise<void>;
70
+ type EventDroppedHandler = (id: string, updates: Partial<Event>) => boolean | Promise<boolean>;
71
+ type DraftRemovedHandler = () => void | Promise<void>;
72
+ type ClickEventHandler = (options: ClickEventOptions) => void | Promise<void>;
73
+ type StartDateTimeChangeHandler = (date: number) => void | Promise<void>;
74
+ type DeselectEventHandler = () => void | Promise<void>;
75
75
  export interface CalendarViewControllerOptions {
76
76
  people?: NonNullable<Calendar['people']>;
77
77
  remoteEventStore?: RemoteEventStore;
@@ -102,9 +102,9 @@ export default class CalendarEventManager {
102
102
  hasEvent(id: string): boolean;
103
103
  optionallyAskForUpdateRepeatingStrategy(event: UpdateEvent, action?: RepeatingUpdateAction): Promise<boolean>;
104
104
  }
105
- export declare type EventManagerCalendarVc = Pick<CalendarViewController, 'replaceEventsInRange' | 'mixinEvents' | 'removeEvent' | 'addEvent' | 'hasEvent' | 'updateEvent' | 'setShifts' | 'getShifts' | 'getEvent' | 'getPeople' | 'setControllerForEventType' | 'setRemoteStore' | 'getSelectedEvent' | 'selectEvent' | 'deselectEvent' | 'removeEvents' | 'setStartDate'>;
106
- declare type EventManagerRemoteViewControllerFactory = Pick<RemoteViewControllerFactory, 'fetchRemoteController'>;
107
- export declare type RepeatingUpdateAction = 'update' | 'cancel';
105
+ export type EventManagerCalendarVc = Pick<CalendarViewController, 'replaceEventsInRange' | 'mixinEvents' | 'removeEvent' | 'addEvent' | 'hasEvent' | 'updateEvent' | 'setShifts' | 'getShifts' | 'getEvent' | 'getPeople' | 'setControllerForEventType' | 'setRemoteStore' | 'getSelectedEvent' | 'selectEvent' | 'deselectEvent' | 'removeEvents' | 'setStartDate'>;
106
+ type EventManagerRemoteViewControllerFactory = Pick<RemoteViewControllerFactory, 'fetchRemoteController'>;
107
+ export type RepeatingUpdateAction = 'update' | 'cancel';
108
108
  export interface CalendarEventManagerOptions {
109
109
  calendarVc: EventManagerCalendarVc;
110
110
  events: RemoteEventStore;
@@ -114,8 +114,8 @@ export interface CalendarEventManagerOptions {
114
114
  preferences: RemotePreferencesStore;
115
115
  askForUpdateStrategy: AskForUpdateStrategyHandler;
116
116
  }
117
- declare type AskForUpdateStrategyHandler = (event: UpdateEvent, action: RepeatingUpdateAction) => Promise<UpdateRepeatingStrategyWithCancel>;
118
- export declare type SavedEvent = Partial<CalendarEvent> & {
117
+ type AskForUpdateStrategyHandler = (event: UpdateEvent, action: RepeatingUpdateAction) => Promise<UpdateRepeatingStrategyWithCancel>;
118
+ export type SavedEvent = Partial<CalendarEvent> & {
119
119
  id: string;
120
120
  };
121
121
  export {};
@@ -20,6 +20,13 @@ const SpruceError_1 = __importDefault(require("../errors/SpruceError"));
20
20
  const calendarShiftGenerator_1 = __importDefault(require("../utilities/calendarShiftGenerator"));
21
21
  const draftGenerator_1 = __importDefault(require("../utilities/draftGenerator"));
22
22
  class CalendarEventManager {
23
+ get calendarIds() {
24
+ return this.calendars.map((c) => c.id);
25
+ }
26
+ get visibleCalendarIds() {
27
+ var _a;
28
+ return (_a = this.prefs.getVisibleCalendarIds()) !== null && _a !== void 0 ? _a : this.calendars.map((c) => c.id);
29
+ }
23
30
  constructor(options) {
24
31
  this.allEvents = [];
25
32
  this.inclusiveCalendarIds = [];
@@ -46,13 +53,6 @@ class CalendarEventManager {
46
53
  this.askForUpdateStrategy = askForUpdateStrategy;
47
54
  this.calendarVc.setRemoteStore(this.events);
48
55
  }
49
- get calendarIds() {
50
- return this.calendars.map((c) => c.id);
51
- }
52
- get visibleCalendarIds() {
53
- var _a;
54
- return (_a = this.prefs.getVisibleCalendarIds()) !== null && _a !== void 0 ? _a : this.calendars.map((c) => c.id);
55
- }
56
56
  replaceEventsInRange(events, startMs, endMs) {
57
57
  this.calendarVc.replaceEventsInRange(events.filter((e) => this.isCalendarSelected(e.calendarId)), startMs, endMs);
58
58
  this.allEvents = this.allEvents.filter((e) => events.findIndex((event) => event.id === e.id) === -1 &&
@@ -43,13 +43,13 @@ export interface PeopleManagerOptions {
43
43
  calendarVc: PeopleManagerCalendarVc;
44
44
  getVisibleEvents: () => CalendarEvent[];
45
45
  }
46
- export declare type PeopleManagerCalendarVc = Pick<CalendarViewController, 'addPerson' | 'getPeople' | 'removePerson' | 'setPeople'>;
46
+ export type PeopleManagerCalendarVc = Pick<CalendarViewController, 'addPerson' | 'getPeople' | 'removePerson' | 'setPeople'>;
47
47
  declare const peopleContract: {
48
48
  eventSignatures: {
49
49
  'did-update': {};
50
50
  };
51
51
  };
52
- declare type PeopleContract = typeof peopleContract;
52
+ type PeopleContract = typeof peopleContract;
53
53
  export interface SetVisiblePeolpeOptions {
54
54
  shouldForceEmitDidChange?: boolean;
55
55
  }
@@ -2,4 +2,4 @@ export declare const MAX_GET_SCHEDULE_DAYS: number;
2
2
  export declare const UPDATE_STRATEGY_SPECIFIC_DATES: "only-this-one";
3
3
  export declare const UPDATE_STRATEGY_THIS_AND_ALL_GOING_FORWARD: "all-going-forward";
4
4
  export declare const UPDATE_STRATEGY_ALL: "all";
5
- export declare type UpdateRepeatingStrategy = typeof UPDATE_STRATEGY_SPECIFIC_DATES | typeof UPDATE_STRATEGY_THIS_AND_ALL_GOING_FORWARD | typeof UPDATE_STRATEGY_ALL;
5
+ export type UpdateRepeatingStrategy = typeof UPDATE_STRATEGY_SPECIFIC_DATES | typeof UPDATE_STRATEGY_THIS_AND_ALL_GOING_FORWARD | typeof UPDATE_STRATEGY_ALL;
@@ -24,5 +24,5 @@ export interface DuplicateCalendarErrorOptions extends SpruceErrors.Calendar.Dup
24
24
  export interface CalendarNotFoundErrorOptions extends SpruceErrors.Calendar.CalendarNotFound, ISpruceErrorOptions {
25
25
  code: 'CALENDAR_NOT_FOUND';
26
26
  }
27
- declare type ErrorOptions = ValidatorNotInitializedErrorOptions | UnauthorizedAccessErrorOptions | RecordNotFoundErrorOptions | PersonNotFoundErrorOptions | EventNotFoundErrorOptions | DuplicateEventTypeErrorOptions | DuplicateCalendarErrorOptions | CalendarNotFoundErrorOptions;
27
+ type ErrorOptions = ValidatorNotInitializedErrorOptions | UnauthorizedAccessErrorOptions | RecordNotFoundErrorOptions | PersonNotFoundErrorOptions | EventNotFoundErrorOptions | DuplicateEventTypeErrorOptions | DuplicateCalendarErrorOptions | CalendarNotFoundErrorOptions;
28
28
  export default ErrorOptions;