@sprucelabs/spruce-calendar-components 22.2.0 → 22.3.0
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/esm/toolBelt/CalendarToolTestFactory.js +2 -2
- package/build/esm/toolBelt/states/AbstractCalendarEventToolBeltState.d.ts +2 -2
- package/build/esm/toolBelt/states/AbstractCalendarEventToolBeltState.js +2 -2
- package/build/toolBelt/CalendarToolTestFactory.js +2 -2
- package/build/toolBelt/states/AbstractCalendarEventToolBeltState.d.ts +2 -2
- package/build/toolBelt/states/AbstractCalendarEventToolBeltState.js +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { assertOptions, SchemaError } from '@sprucelabs/schema';
|
|
2
2
|
import { assert } from '@sprucelabs/test';
|
|
3
|
-
import
|
|
3
|
+
import clone from 'just-clone';
|
|
4
4
|
export default class CalendarToolTestFactory {
|
|
5
5
|
static Tool(stateMachine, vcId, options) {
|
|
6
6
|
assertOptions({ stateMachine, vcId }, ['stateMachine', 'vcId']);
|
|
@@ -18,7 +18,7 @@ export default class CalendarToolTestFactory {
|
|
|
18
18
|
parameters: ['getHasPendingContextChanges'],
|
|
19
19
|
friendlyMessage: `You need to pass 'getHasPendingContextChanges: () => boolean' or similar to CalendarToolTestFactory.Tool(....)`,
|
|
20
20
|
});
|
|
21
|
-
} },
|
|
21
|
+
} }, clone(options !== null && options !== void 0 ? options : {})));
|
|
22
22
|
void stateMachine.on('did-update-context', () => {
|
|
23
23
|
return vc.handleUpdateContext(stateMachine.getContext());
|
|
24
24
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SpruceSchemas, ToolBeltState, ViewControllerId } from '@sprucelabs/heartwood-view-controllers';
|
|
2
|
-
import { CalendarTool, CalendarToolBeltContext, CalendarToolBeltStateMachine, GetPersonFromEventHandler } from '../../types/calendar.types';
|
|
2
|
+
import { CalendarTool, CalendarToolBeltContext, CalendarToolBeltStateMachine, CalendarToolOptions, GetPersonFromEventHandler } from '../../types/calendar.types';
|
|
3
3
|
import EventControlsCardViewController from '../../viewControllers/EventControlsCard.vc';
|
|
4
4
|
declare type Tool = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.ToolBeltTool;
|
|
5
5
|
export declare type AddToolOptions = Omit<Tool, 'card'> & {
|
|
@@ -20,7 +20,7 @@ export default abstract class AbstractCalendarEventToolBeltState implements Tool
|
|
|
20
20
|
private getContext;
|
|
21
21
|
clearPendingContextChanges(): Promise<void>;
|
|
22
22
|
addTool(options: AddToolOptions): Promise<CalendarTool>;
|
|
23
|
-
|
|
23
|
+
protected buildVcConstructorOptions(id: string): CalendarToolOptions;
|
|
24
24
|
private addVc;
|
|
25
25
|
protected getPersonFromEvent(): ReturnType<GetPersonFromEventHandler>;
|
|
26
26
|
private handleUpdateContextFromTool;
|
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { assertOptions } from '@sprucelabs/schema';
|
|
11
|
-
import
|
|
11
|
+
import compare from 'just-compare';
|
|
12
12
|
import CalendarToolRegistrar from '../CalendarToolRegistrar.js';
|
|
13
13
|
export default class AbstractCalendarEventToolBeltState {
|
|
14
14
|
constructor() {
|
|
@@ -125,7 +125,7 @@ export default class AbstractCalendarEventToolBeltState {
|
|
|
125
125
|
handleUpdateContextFromTool(updates, fromToolId, options) {
|
|
126
126
|
return __awaiter(this, void 0, void 0, function* () {
|
|
127
127
|
const pendingUpdates = Object.assign(Object.assign({}, this.pendingContextUpdates), updates);
|
|
128
|
-
if (
|
|
128
|
+
if (compare(this.pendingContextUpdates, pendingUpdates)) {
|
|
129
129
|
return false;
|
|
130
130
|
}
|
|
131
131
|
this.pendingContextUpdates = pendingUpdates;
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const schema_1 = require("@sprucelabs/schema");
|
|
7
7
|
const test_1 = require("@sprucelabs/test");
|
|
8
|
-
const
|
|
8
|
+
const just_clone_1 = __importDefault(require("just-clone"));
|
|
9
9
|
class CalendarToolTestFactory {
|
|
10
10
|
static Tool(stateMachine, vcId, options) {
|
|
11
11
|
(0, schema_1.assertOptions)({ stateMachine, vcId }, ['stateMachine', 'vcId']);
|
|
@@ -23,7 +23,7 @@ class CalendarToolTestFactory {
|
|
|
23
23
|
parameters: ['getHasPendingContextChanges'],
|
|
24
24
|
friendlyMessage: `You need to pass 'getHasPendingContextChanges: () => boolean' or similar to CalendarToolTestFactory.Tool(....)`,
|
|
25
25
|
});
|
|
26
|
-
} }, (0,
|
|
26
|
+
} }, (0, just_clone_1.default)(options !== null && options !== void 0 ? options : {})));
|
|
27
27
|
void stateMachine.on('did-update-context', () => {
|
|
28
28
|
return vc.handleUpdateContext(stateMachine.getContext());
|
|
29
29
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SpruceSchemas, ToolBeltState, ViewControllerId } from '@sprucelabs/heartwood-view-controllers';
|
|
2
|
-
import { CalendarTool, CalendarToolBeltContext, CalendarToolBeltStateMachine, GetPersonFromEventHandler } from '../../types/calendar.types';
|
|
2
|
+
import { CalendarTool, CalendarToolBeltContext, CalendarToolBeltStateMachine, CalendarToolOptions, GetPersonFromEventHandler } from '../../types/calendar.types';
|
|
3
3
|
import EventControlsCardViewController from '../../viewControllers/EventControlsCard.vc';
|
|
4
4
|
declare type Tool = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.ToolBeltTool;
|
|
5
5
|
export declare type AddToolOptions = Omit<Tool, 'card'> & {
|
|
@@ -20,7 +20,7 @@ export default abstract class AbstractCalendarEventToolBeltState implements Tool
|
|
|
20
20
|
private getContext;
|
|
21
21
|
clearPendingContextChanges(): Promise<void>;
|
|
22
22
|
addTool(options: AddToolOptions): Promise<CalendarTool>;
|
|
23
|
-
|
|
23
|
+
protected buildVcConstructorOptions(id: string): CalendarToolOptions;
|
|
24
24
|
private addVc;
|
|
25
25
|
protected getPersonFromEvent(): ReturnType<GetPersonFromEventHandler>;
|
|
26
26
|
private handleUpdateContextFromTool;
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const schema_1 = require("@sprucelabs/schema");
|
|
7
|
-
const
|
|
7
|
+
const just_compare_1 = __importDefault(require("just-compare"));
|
|
8
8
|
const CalendarToolRegistrar_1 = __importDefault(require("../CalendarToolRegistrar"));
|
|
9
9
|
class AbstractCalendarEventToolBeltState {
|
|
10
10
|
constructor() {
|
|
@@ -104,7 +104,7 @@ class AbstractCalendarEventToolBeltState {
|
|
|
104
104
|
}
|
|
105
105
|
async handleUpdateContextFromTool(updates, fromToolId, options) {
|
|
106
106
|
const pendingUpdates = Object.assign(Object.assign({}, this.pendingContextUpdates), updates);
|
|
107
|
-
if ((0,
|
|
107
|
+
if ((0, just_compare_1.default)(this.pendingContextUpdates, pendingUpdates)) {
|
|
108
108
|
return false;
|
|
109
109
|
}
|
|
110
110
|
this.pendingContextUpdates = pendingUpdates;
|