@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.
@@ -1,6 +1,6 @@
1
1
  import { assertOptions, SchemaError } from '@sprucelabs/schema';
2
2
  import { assert } from '@sprucelabs/test';
3
- import cloneDeep from 'lodash/cloneDeep.js';
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
- } }, cloneDeep(options !== null && options !== void 0 ? options : {})));
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
- private buildVcConstructorOptions;
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 equalDeep from 'lodash/isEqual.js';
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 (equalDeep(this.pendingContextUpdates, pendingUpdates)) {
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 cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
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, cloneDeep_1.default)(options !== null && options !== void 0 ? options : {})));
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
- private buildVcConstructorOptions;
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 isEqual_1 = __importDefault(require("lodash/isEqual"));
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, isEqual_1.default)(this.pendingContextUpdates, pendingUpdates)) {
107
+ if ((0, just_compare_1.default)(this.pendingContextUpdates, pendingUpdates)) {
108
108
  return false;
109
109
  }
110
110
  this.pendingContextUpdates = pendingUpdates;
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": "22.2.0",
4
+ "version": "22.3.0",
5
5
  "skill": {
6
6
  "namespace": "calendar"
7
7
  },