@sprucelabs/spruce-calendar-components 25.2.8 → 25.2.9

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.
@@ -14,6 +14,7 @@ export default abstract class AbstractCalendarEventToolBeltState implements Tool
14
14
  getIsLoaded(): boolean;
15
15
  protected loadRemoteCards(): Promise<void>;
16
16
  protected handleClickSave(): Promise<void>;
17
+ protected handleClickCancel(eventId: string): Promise<boolean | void>;
17
18
  private deselectEvent;
18
19
  private handleDidUpdateContext;
19
20
  protected getContext(): CalendarToolBeltContext;
@@ -21,7 +21,7 @@ export default class AbstractCalendarEventToolBeltState {
21
21
  this.sm = sm;
22
22
  this.toolBeltVc = sm.getToolBeltVc();
23
23
  this.isLoaded = true;
24
- this.controlsVc = sm.Controller('calendar.event-controls-card', Object.assign(Object.assign({ onCancel: this.clearPendingContextChanges.bind(this), onSave: this.handleClickSave.bind(this) }, this.buildVcConstructorOptions('controls')), { onCancelEvent: this.sm.getContext().cancelEvent }));
24
+ this.controlsVc = sm.Controller('calendar.event-controls-card', Object.assign(Object.assign({ onCancel: this.clearPendingContextChanges.bind(this), onSave: this.handleClickSave.bind(this) }, this.buildVcConstructorOptions('controls')), { onCancelEvent: this.handleClickCancel.bind(this) }));
25
25
  this.events = sm.getContext().events;
26
26
  this.events.setUpdateContextHandler((updates) => __awaiter(this, void 0, void 0, function* () {
27
27
  return this.handleUpdateContextFromTool(updates, 'eventManager', {
@@ -58,6 +58,11 @@ export default class AbstractCalendarEventToolBeltState {
58
58
  yield this.deselectEvent();
59
59
  });
60
60
  }
61
+ handleClickCancel(eventId) {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ return this.sm.getContext().cancelEvent(eventId);
64
+ });
65
+ }
61
66
  deselectEvent() {
62
67
  return __awaiter(this, void 0, void 0, function* () {
63
68
  const { events } = this.sm.getContext();
@@ -14,6 +14,7 @@ export default abstract class AbstractCalendarEventToolBeltState implements Tool
14
14
  getIsLoaded(): boolean;
15
15
  protected loadRemoteCards(): Promise<void>;
16
16
  protected handleClickSave(): Promise<void>;
17
+ protected handleClickCancel(eventId: string): Promise<boolean | void>;
17
18
  private deselectEvent;
18
19
  private handleDidUpdateContext;
19
20
  protected getContext(): CalendarToolBeltContext;
@@ -16,7 +16,7 @@ class AbstractCalendarEventToolBeltState {
16
16
  this.sm = sm;
17
17
  this.toolBeltVc = sm.getToolBeltVc();
18
18
  this.isLoaded = true;
19
- this.controlsVc = sm.Controller('calendar.event-controls-card', Object.assign(Object.assign({ onCancel: this.clearPendingContextChanges.bind(this), onSave: this.handleClickSave.bind(this) }, this.buildVcConstructorOptions('controls')), { onCancelEvent: this.sm.getContext().cancelEvent }));
19
+ this.controlsVc = sm.Controller('calendar.event-controls-card', Object.assign(Object.assign({ onCancel: this.clearPendingContextChanges.bind(this), onSave: this.handleClickSave.bind(this) }, this.buildVcConstructorOptions('controls')), { onCancelEvent: this.handleClickCancel.bind(this) }));
20
20
  this.events = sm.getContext().events;
21
21
  this.events.setUpdateContextHandler(async (updates) => {
22
22
  return this.handleUpdateContextFromTool(updates, 'eventManager', {
@@ -48,6 +48,9 @@ class AbstractCalendarEventToolBeltState {
48
48
  await this.sm.updateContext(Object.assign({}, updates));
49
49
  await this.deselectEvent();
50
50
  }
51
+ async handleClickCancel(eventId) {
52
+ return this.sm.getContext().cancelEvent(eventId);
53
+ }
51
54
  async deselectEvent() {
52
55
  const { events } = this.sm.getContext();
53
56
  await events.deselectEvent();
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": "25.2.8",
4
+ "version": "25.2.9",
5
5
  "skill": {
6
6
  "namespace": "calendar"
7
7
  },