@sprucelabs/spruce-calendar-components 25.6.13 → 26.0.3
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/build/.spruce/schemas/schemas.types.d.ts +1010 -1010
- package/build/__tests__/support/CalendarToolBeltStateMachineTestFactory.d.ts +8 -8
- package/build/__tests__/support/utilities/calendarSkillAssert.js +5 -2
- package/build/__tests__/support/utilities/calendarToolBeltInteractor.d.ts +3 -1
- package/build/__tests__/support/utilities/calendarToolBeltInteractor.js +11 -4
- package/build/calendar/Calendar.vc.d.ts +8 -12
- package/build/calendar/Calendar.vc.js +17 -52
- package/build/calendar/CalendarEventManager.d.ts +15 -9
- package/build/calendar/CalendarEventManager.js +106 -58
- package/build/calendar/calculateCalendarEventDifferences.js +3 -6
- package/build/esm/.spruce/schemas/schemas.types.d.ts +1010 -1010
- package/build/esm/__tests__/support/CalendarToolBeltStateMachineTestFactory.d.ts +8 -8
- package/build/esm/__tests__/support/utilities/calendarSkillAssert.js +5 -2
- package/build/esm/__tests__/support/utilities/calendarToolBeltInteractor.d.ts +3 -1
- package/build/esm/__tests__/support/utilities/calendarToolBeltInteractor.js +14 -5
- package/build/esm/calendar/Calendar.vc.d.ts +8 -12
- package/build/esm/calendar/Calendar.vc.js +17 -57
- package/build/esm/calendar/CalendarEventManager.d.ts +15 -9
- package/build/esm/calendar/CalendarEventManager.js +110 -58
- package/build/esm/calendar/calculateCalendarEventDifferences.js +1 -1
- package/build/esm/skillViewControllers/Root.svc.js +19 -5
- package/build/esm/stores/RemoteEventStore.js +2 -1
- package/build/esm/toolBelt/CalendarToolRegistrar.d.ts +3 -2
- package/build/esm/toolBelt/states/AbstractCalendarEventToolBeltState.d.ts +1 -0
- package/build/esm/toolBelt/states/AbstractCalendarEventToolBeltState.js +8 -3
- package/build/esm/toolBelt/states/PrerequisitesToolBeltState.d.ts +1 -1
- package/build/esm/toolBelt/states/PrerequisitesToolBeltState.js +6 -7
- package/build/skillViewControllers/Root.svc.js +19 -5
- package/build/stores/RemoteEventStore.js +3 -2
- package/build/toolBelt/CalendarToolRegistrar.d.ts +3 -2
- package/build/toolBelt/states/AbstractCalendarEventToolBeltState.d.ts +1 -0
- package/build/toolBelt/states/AbstractCalendarEventToolBeltState.js +6 -3
- package/build/toolBelt/states/PrerequisitesToolBeltState.d.ts +1 -1
- package/build/toolBelt/states/PrerequisitesToolBeltState.js +6 -7
- package/package.json +1 -5
- package/build/esm/stores/isEqual.d.ts +0 -1
- package/build/esm/stores/isEqual.js +0 -29
- package/build/stores/isEqual.d.ts +0 -1
- package/build/stores/isEqual.js +0 -32
|
@@ -72,7 +72,7 @@ class PrerequisitesToolBeltState {
|
|
|
72
72
|
await this.handleSelectType(calendarEventTypes[0]);
|
|
73
73
|
}
|
|
74
74
|
else {
|
|
75
|
-
await this.
|
|
75
|
+
await this.updateEvent();
|
|
76
76
|
await this.setupTypeSelectCard(calendarEventTypes);
|
|
77
77
|
}
|
|
78
78
|
(_d = this.calendarSelectCardVc) === null || _d === void 0 ? void 0 : _d.setIsBusy(false);
|
|
@@ -113,20 +113,19 @@ class PrerequisitesToolBeltState {
|
|
|
113
113
|
(_a = this.typeSelectCardVc) === null || _a === void 0 ? void 0 : _a.setIsBusy(true);
|
|
114
114
|
const { event } = this.sm.getContext();
|
|
115
115
|
const updated = (0, makeEventTyped_1.default)(event, type);
|
|
116
|
-
await this.
|
|
116
|
+
await this.updateEvent({
|
|
117
117
|
eventTypeSlug: type.slug,
|
|
118
118
|
timeBlocks: updated.timeBlocks,
|
|
119
119
|
});
|
|
120
120
|
await ((_b = this.selectEventTypeHandler) === null || _b === void 0 ? void 0 : _b.call(this, type));
|
|
121
121
|
(_c = this.typeSelectCardVc) === null || _c === void 0 ? void 0 : _c.setIsBusy(false);
|
|
122
122
|
}
|
|
123
|
-
async
|
|
123
|
+
async updateEvent(updates) {
|
|
124
124
|
var _a;
|
|
125
|
-
const { event } = this.sm.getContext();
|
|
125
|
+
const { event, events } = this.sm.getContext();
|
|
126
126
|
if (event) {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
});
|
|
127
|
+
events.updateEvent(event.id, Object.assign({ calendarId: (_a = this.calendar) === null || _a === void 0 ? void 0 : _a.id }, updates));
|
|
128
|
+
await events.waitForPendingOperations();
|
|
130
129
|
}
|
|
131
130
|
}
|
|
132
131
|
TypeSelectCardVc() {
|
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": "
|
|
4
|
+
"version": "26.0.3",
|
|
5
5
|
"skill": {
|
|
6
6
|
"namespace": "calendar"
|
|
7
7
|
},
|
|
@@ -66,10 +66,6 @@
|
|
|
66
66
|
"build/calendar/calculateCalendarEventDifferences.d.ts",
|
|
67
67
|
"build/esm/calendar/calculateCalendarEventDifferences.js",
|
|
68
68
|
"build/esm/calendar/calculateCalendarEventDifferences.d.ts",
|
|
69
|
-
"build/stores/isEqual.js",
|
|
70
|
-
"build/stores/isEqual.d.ts",
|
|
71
|
-
"build/esm/stores/isEqual.js",
|
|
72
|
-
"build/esm/stores/isEqual.d.ts",
|
|
73
69
|
"build/index-components.js",
|
|
74
70
|
"build/index-components.d.ts",
|
|
75
71
|
"build/esm/index-components.js",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function isEqual(a: any, b: any): boolean;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export default function isEqual(a, b) {
|
|
2
|
-
if (a === b) {
|
|
3
|
-
return true;
|
|
4
|
-
}
|
|
5
|
-
if (a instanceof Date && b instanceof Date) {
|
|
6
|
-
return a.getTime() === b.getTime();
|
|
7
|
-
}
|
|
8
|
-
if (!a || !b || (typeof a !== 'object' && typeof b !== 'object')) {
|
|
9
|
-
return a === b;
|
|
10
|
-
}
|
|
11
|
-
if (a.prototype !== b.prototype) {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
a = removeUndefinedAndNullFields(Object.assign({}, a));
|
|
15
|
-
b = removeUndefinedAndNullFields(Object.assign({}, b));
|
|
16
|
-
const keys = Object.keys(a);
|
|
17
|
-
if (keys.length !== Object.keys(b).length) {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
return keys.every((k) => isEqual(a[k], b[k]));
|
|
21
|
-
}
|
|
22
|
-
function removeUndefinedAndNullFields(obj) {
|
|
23
|
-
for (const key in obj) {
|
|
24
|
-
if (obj[key] === undefined || obj[key] === null) {
|
|
25
|
-
delete obj[key];
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return obj;
|
|
29
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function isEqual(a: any, b: any): boolean;
|
package/build/stores/isEqual.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function isEqual(a, b) {
|
|
4
|
-
if (a === b) {
|
|
5
|
-
return true;
|
|
6
|
-
}
|
|
7
|
-
if (a instanceof Date && b instanceof Date) {
|
|
8
|
-
return a.getTime() === b.getTime();
|
|
9
|
-
}
|
|
10
|
-
if (!a || !b || (typeof a !== 'object' && typeof b !== 'object')) {
|
|
11
|
-
return a === b;
|
|
12
|
-
}
|
|
13
|
-
if (a.prototype !== b.prototype) {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
a = removeUndefinedAndNullFields(Object.assign({}, a));
|
|
17
|
-
b = removeUndefinedAndNullFields(Object.assign({}, b));
|
|
18
|
-
const keys = Object.keys(a);
|
|
19
|
-
if (keys.length !== Object.keys(b).length) {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
return keys.every((k) => isEqual(a[k], b[k]));
|
|
23
|
-
}
|
|
24
|
-
exports.default = isEqual;
|
|
25
|
-
function removeUndefinedAndNullFields(obj) {
|
|
26
|
-
for (const key in obj) {
|
|
27
|
-
if (obj[key] === undefined || obj[key] === null) {
|
|
28
|
-
delete obj[key];
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return obj;
|
|
32
|
-
}
|