@sprucelabs/spruce-calendar-components 24.2.12 → 24.2.14

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.
@@ -87,6 +87,7 @@ export default class CalendarEventManager {
87
87
  setUpdateContextHandler(handler: UpdateCalendarToolBeltContextHandler<CalendarToolBeltContext>): void;
88
88
  clearUpdateContextHandler(): void;
89
89
  selectEvent(eventId: string): Promise<void>;
90
+ getSelectedEvent(): import("@sprucelabs/calendar-utils").SpruceSchemas.HeartwoodViewControllers.v2021_02_11.CalendarEvent | undefined;
90
91
  load(): Promise<void>;
91
92
  getEvent(id: string): CalendarEvent;
92
93
  private loadCalendars;
@@ -284,7 +284,7 @@ export default class CalendarEventManager {
284
284
  }
285
285
  selectEvent(eventId) {
286
286
  return __awaiter(this, void 0, void 0, function* () {
287
- const lastSelected = this.calendarVc.getSelectedEvent();
287
+ const lastSelected = this.getSelectedEvent();
288
288
  const event = this.calendarVc.getEvent(eventId);
289
289
  yield this.calendarVc.selectEvent(event.id);
290
290
  if ((lastSelected === null || lastSelected === void 0 ? void 0 : lastSelected.id) !== event.id) {
@@ -292,6 +292,9 @@ export default class CalendarEventManager {
292
292
  }
293
293
  });
294
294
  }
295
+ getSelectedEvent() {
296
+ return this.calendarVc.getSelectedEvent();
297
+ }
295
298
  load() {
296
299
  return __awaiter(this, void 0, void 0, function* () {
297
300
  yield this.sm.on('will-update-context', this.handleWillUpdateContext.bind(this));
@@ -232,6 +232,11 @@ class RootSkillViewController extends AbstractSkillViewController {
232
232
  }
233
233
  ToolBeltVc() {
234
234
  return this.Controller('toolBelt', {
235
+ onCloseToolBelt: ({ isDrawer }) => __awaiter(this, void 0, void 0, function* () {
236
+ if (!isDrawer) {
237
+ yield this.events.deselectEvent();
238
+ }
239
+ }),
235
240
  shouldRenderAllToolsAtOnce: true,
236
241
  });
237
242
  }
@@ -204,6 +204,11 @@ class RootSkillViewController extends heartwood_view_controllers_1.AbstractSkill
204
204
  }
205
205
  ToolBeltVc() {
206
206
  return this.Controller('toolBelt', {
207
+ onCloseToolBelt: async ({ isDrawer }) => {
208
+ if (!isDrawer) {
209
+ await this.events.deselectEvent();
210
+ }
211
+ },
207
212
  shouldRenderAllToolsAtOnce: true,
208
213
  });
209
214
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sprucelabs/spruce-calendar-components",
3
3
  "description": "Calendar components for working with calendars and Sprucebot.",
4
- "version": "24.2.12",
4
+ "version": "24.2.14",
5
5
  "skill": {
6
6
  "namespace": "calendar"
7
7
  },