@player-ui/beacon-plugin 0.0.1-next.2 → 0.0.1-next.22

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/dist/index.cjs.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var tapable = require('tapable');
5
+ var tapableTs = require('tapable-ts');
6
6
  var player = require('@player-ui/player');
7
7
  var timm = require('timm');
8
8
 
@@ -55,12 +55,9 @@ const _BeaconPlugin = class {
55
55
  view: void 0
56
56
  };
57
57
  this.hooks = {
58
- buildBeacon: new tapable.AsyncSeriesWaterfallHook([
59
- "beacon",
60
- "beaconArguments"
61
- ]),
62
- cancelBeacon: new tapable.SyncBailHook(["args"]),
63
- publishBeacon: new tapable.SyncHook(["beacon"])
58
+ buildBeacon: new tapableTs.AsyncSeriesWaterfallHook(),
59
+ cancelBeacon: new tapableTs.SyncBailHook(),
60
+ publishBeacon: new tapableTs.SyncHook()
64
61
  };
65
62
  if (options == null ? void 0 : options.plugins) {
66
63
  options.plugins.forEach((plugin) => {
@@ -69,8 +66,9 @@ const _BeaconPlugin = class {
69
66
  }
70
67
  if (options == null ? void 0 : options.callback) {
71
68
  this.hooks.publishBeacon.tap("BeaconCallback", (beacon) => {
72
- if (options.callback)
69
+ if (options.callback) {
73
70
  options.callback(beacon);
71
+ }
74
72
  });
75
73
  }
76
74
  }
@@ -150,7 +148,7 @@ const _BeaconPlugin = class {
150
148
  view: view || currentView,
151
149
  logger: this.logger
152
150
  });
153
- const beacon = (yield this.hooks.buildBeacon.promise(defaultBeacon, hookArgs)) || defaultBeacon;
151
+ const beacon = (yield this.hooks.buildBeacon.call(defaultBeacon, hookArgs)) || defaultBeacon;
154
152
  const shouldCancel = this.hooks.cancelBeacon.call(hookArgs) || false;
155
153
  if (!shouldCancel) {
156
154
  const resolvedBeacon = this.dataController && this.expressionEvaluator ? player.resolveDataRefs(beacon, {
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AsyncSeriesWaterfallHook, SyncBailHook, SyncHook } from 'tapable';
1
+ import { AsyncSeriesWaterfallHook, SyncBailHook, SyncHook } from 'tapable-ts';
2
2
  import { PlayerFlowState, PlayerPlugin, Player } from '@player-ui/player';
3
3
  import { Asset, View } from '@player-ui/types';
4
4
  import { Logger } from '@player-ui/logger';
@@ -56,9 +56,9 @@ declare class BeaconPlugin implements PlayerPlugin {
56
56
  private dataController?;
57
57
  private expressionEvaluator?;
58
58
  hooks: {
59
- buildBeacon: AsyncSeriesWaterfallHook<unknown, HookArgs, any>;
60
- cancelBeacon: SyncBailHook<HookArgs, boolean, any, any>;
61
- publishBeacon: SyncHook<any, any, any>;
59
+ buildBeacon: AsyncSeriesWaterfallHook<[unknown, HookArgs], Record<string, any>>;
60
+ cancelBeacon: SyncBailHook<[HookArgs], boolean, Record<string, any>>;
61
+ publishBeacon: SyncHook<[any], Record<string, any>>;
62
62
  };
63
63
  constructor(options?: BeaconPluginOptions);
64
64
  apply(player: Player): void;
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { AsyncSeriesWaterfallHook, SyncBailHook, SyncHook } from 'tapable';
1
+ import { AsyncSeriesWaterfallHook, SyncBailHook, SyncHook } from 'tapable-ts';
2
2
  import { resolveDataRefs } from '@player-ui/player';
3
3
  import { setIn } from 'timm';
4
4
 
@@ -51,12 +51,9 @@ const _BeaconPlugin = class {
51
51
  view: void 0
52
52
  };
53
53
  this.hooks = {
54
- buildBeacon: new AsyncSeriesWaterfallHook([
55
- "beacon",
56
- "beaconArguments"
57
- ]),
58
- cancelBeacon: new SyncBailHook(["args"]),
59
- publishBeacon: new SyncHook(["beacon"])
54
+ buildBeacon: new AsyncSeriesWaterfallHook(),
55
+ cancelBeacon: new SyncBailHook(),
56
+ publishBeacon: new SyncHook()
60
57
  };
61
58
  if (options == null ? void 0 : options.plugins) {
62
59
  options.plugins.forEach((plugin) => {
@@ -65,8 +62,9 @@ const _BeaconPlugin = class {
65
62
  }
66
63
  if (options == null ? void 0 : options.callback) {
67
64
  this.hooks.publishBeacon.tap("BeaconCallback", (beacon) => {
68
- if (options.callback)
65
+ if (options.callback) {
69
66
  options.callback(beacon);
67
+ }
70
68
  });
71
69
  }
72
70
  }
@@ -146,7 +144,7 @@ const _BeaconPlugin = class {
146
144
  view: view || currentView,
147
145
  logger: this.logger
148
146
  });
149
- const beacon = (yield this.hooks.buildBeacon.promise(defaultBeacon, hookArgs)) || defaultBeacon;
147
+ const beacon = (yield this.hooks.buildBeacon.call(defaultBeacon, hookArgs)) || defaultBeacon;
150
148
  const shouldCancel = this.hooks.cancelBeacon.call(hookArgs) || false;
151
149
  if (!shouldCancel) {
152
150
  const resolvedBeacon = this.dataController && this.expressionEvaluator ? resolveDataRefs(beacon, {
package/package.json CHANGED
@@ -1,22 +1,62 @@
1
1
  {
2
2
  "name": "@player-ui/beacon-plugin",
3
- "version": "0.0.1-next.2",
3
+ "version": "0.0.1-next.22",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org"
7
7
  },
8
8
  "peerDependencies": {
9
- "@player-ui/binding-grammar": "0.0.1-next.2",
10
- "@player-ui/logger": "0.0.1-next.2",
11
- "@player-ui/types": "0.0.1-next.2"
9
+ "@player-ui/player": "0.0.1-next.22",
10
+ "@player-ui/expressions": "0.0.1-next.22",
11
+ "@player-ui/logger": "0.0.1-next.22",
12
+ "@player-ui/types": "0.0.1-next.22"
12
13
  },
13
14
  "dependencies": {
14
- "tapable": "1.1.3",
15
+ "tapable-ts": "^0.1.0",
15
16
  "timm": "^1.6.2",
16
- "@types/tapable": "^1.0.5",
17
17
  "@babel/runtime": "7.15.4"
18
18
  },
19
19
  "main": "dist/index.cjs.js",
20
20
  "module": "dist/index.esm.js",
21
- "typings": "dist/index.d.ts"
21
+ "typings": "dist/index.d.ts",
22
+ "sideEffects": false,
23
+ "license": "MIT",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "https://github.com/player-ui/player-ui"
27
+ },
28
+ "bugs": {
29
+ "url": "https://github.com/player-ui/player-ui/issues"
30
+ },
31
+ "homepage": "https://player-ui.github.io",
32
+ "contributors": [
33
+ {
34
+ "name": "Adam Dierkens",
35
+ "url": "https://github.com/adierkens"
36
+ },
37
+ {
38
+ "name": "Spencer Hamm",
39
+ "url": "https://github.com/spentacular"
40
+ },
41
+ {
42
+ "name": "Harris Borawski",
43
+ "url": "https://github.com/hborawski"
44
+ },
45
+ {
46
+ "name": "Jeremiah Zucker",
47
+ "url": "https://github.com/sugarmanz"
48
+ },
49
+ {
50
+ "name": "Ketan Reddy",
51
+ "url": "https://github.com/KetanReddy"
52
+ },
53
+ {
54
+ "name": "Brocollie08",
55
+ "url": "https://github.com/brocollie08"
56
+ },
57
+ {
58
+ "name": "Kelly Harrop",
59
+ "url": "https://github.com/kharrop"
60
+ }
61
+ ]
22
62
  }
package/src/beacon.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { SyncBailHook, AsyncSeriesWaterfallHook, SyncHook } from 'tapable';
1
+ import { SyncBailHook, AsyncSeriesWaterfallHook, SyncHook } from 'tapable-ts';
2
2
  import type {
3
3
  Player,
4
4
  PlayerPlugin,
@@ -85,12 +85,9 @@ export class BeaconPlugin implements PlayerPlugin {
85
85
  private expressionEvaluator?: ExpressionEvaluator;
86
86
 
87
87
  public hooks = {
88
- buildBeacon: new AsyncSeriesWaterfallHook<unknown, HookArgs>([
89
- 'beacon',
90
- 'beaconArguments',
91
- ]),
92
- cancelBeacon: new SyncBailHook<HookArgs, boolean>(['args']),
93
- publishBeacon: new SyncHook(['beacon']),
88
+ buildBeacon: new AsyncSeriesWaterfallHook<[unknown, HookArgs]>(),
89
+ cancelBeacon: new SyncBailHook<[HookArgs], boolean>(),
90
+ publishBeacon: new SyncHook<[any]>(),
94
91
  };
95
92
 
96
93
  constructor(options?: BeaconPluginOptions) {
@@ -102,7 +99,9 @@ export class BeaconPlugin implements PlayerPlugin {
102
99
 
103
100
  if (options?.callback) {
104
101
  this.hooks.publishBeacon.tap('BeaconCallback', (beacon: any) => {
105
- if (options.callback) options.callback(beacon);
102
+ if (options.callback) {
103
+ options.callback(beacon);
104
+ }
106
105
  });
107
106
  }
108
107
  }
@@ -204,7 +203,7 @@ export class BeaconPlugin implements PlayerPlugin {
204
203
  logger: this.logger as Logger,
205
204
  };
206
205
  const beacon =
207
- (await this.hooks.buildBeacon.promise(defaultBeacon, hookArgs)) ||
206
+ (await this.hooks.buildBeacon.call(defaultBeacon, hookArgs)) ||
208
207
  defaultBeacon;
209
208
  const shouldCancel = this.hooks.cancelBeacon.call(hookArgs) || false;
210
209