@player-ui/react 0.0.1-next.5 → 0.0.1-next.8

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
@@ -7,7 +7,7 @@ var player = require('@player-ui/player');
7
7
  var reactAsset = require('@player-ui/react-asset');
8
8
  var reactErrorBoundary = require('react-error-boundary');
9
9
  var reactUtils = require('@player-ui/react-utils');
10
- var tapable = require('tapable');
10
+ var tapableTs = require('tapable-ts');
11
11
  var reactSubscribe = require('@player-ui/react-subscribe');
12
12
  var partialMatchRegistry = require('@player-ui/partial-match-registry');
13
13
  var metricsPlugin = require('@player-ui/metrics-plugin');
@@ -83,16 +83,16 @@ var __async$1 = (__this, __arguments, generator) => {
83
83
  step((generator = generator.apply(__this, __arguments)).next());
84
84
  });
85
85
  };
86
- const WEB_PLAYER_VERSION = "!!STABLE_VERSION!!";
87
- const COMMIT = "!!STABLE_GIT_COMMIT!!";
86
+ const WEB_PLAYER_VERSION = "0.0.1-next.8";
87
+ const COMMIT = "40767c627ece78c83b0879021b845fe945245a7a";
88
88
  const _window = typeof window === "undefined" ? void 0 : window;
89
89
  class WebPlayer {
90
90
  constructor(options) {
91
91
  this.assetRegistry = new partialMatchRegistry.Registry();
92
92
  this.hooks = {
93
- webComponent: new tapable.SyncWaterfallHook(["webComponent"]),
94
- playerComponent: new tapable.SyncWaterfallHook(["playerComponent"]),
95
- onBeforeViewReset: new tapable.AsyncParallelHook()
93
+ webComponent: new tapableTs.SyncWaterfallHook(),
94
+ playerComponent: new tapableTs.SyncWaterfallHook(),
95
+ onBeforeViewReset: new tapableTs.AsyncParallelHook()
96
96
  };
97
97
  this.viewUpdateSubscription = new reactSubscribe.Subscribe();
98
98
  var _a, _b;
@@ -174,7 +174,7 @@ class WebPlayer {
174
174
  }
175
175
  setWaitForNextViewUpdate() {
176
176
  const shouldCallResetHook = this.options.suspend && this.hooks.onBeforeViewReset.isUsed();
177
- return this.viewUpdateSubscription.reset(shouldCallResetHook ? this.hooks.onBeforeViewReset.promise() : void 0);
177
+ return this.viewUpdateSubscription.reset(shouldCallResetHook ? this.hooks.onBeforeViewReset.call() : void 0);
178
178
  }
179
179
  start(flow) {
180
180
  this.setWaitForNextViewUpdate();
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import * as _player_ui_player from '@player-ui/player';
3
3
  import { Asset, PlayerPlugin, Player, Flow, CompletedState, PlayerFlowState, FlowResult } from '@player-ui/player';
4
4
  export * from '@player-ui/player';
5
5
  import { AssetRegistryType } from '@player-ui/react-asset';
6
- import { SyncWaterfallHook, AsyncParallelHook } from 'tapable';
6
+ import { SyncWaterfallHook, AsyncParallelHook } from 'tapable-ts';
7
7
  import * as _player_ui_types from '@player-ui/types';
8
8
 
9
9
  interface WebPlayerProps {
@@ -60,17 +60,17 @@ declare class WebPlayer {
60
60
  /**
61
61
  * A hook to create a React Component to be used for Player, regardless of the current flow state
62
62
  */
63
- webComponent: SyncWaterfallHook<React.ComponentType<{}>, any, any>;
63
+ webComponent: SyncWaterfallHook<[React.ComponentType<{}>], Record<string, any>>;
64
64
  /**
65
65
  * A hook to create a React Component that's used to render a specific view.
66
66
  * It will be called for each view update from the core player.
67
67
  * Typically this will just be `Asset`
68
68
  */
69
- playerComponent: SyncWaterfallHook<React.ComponentType<WebPlayerProps>, any, any>;
69
+ playerComponent: SyncWaterfallHook<[React.ComponentType<WebPlayerProps>], Record<string, any>>;
70
70
  /**
71
71
  * A hook to execute async tasks before the view resets to undefined
72
72
  */
73
- onBeforeViewReset: AsyncParallelHook<any, any, any>;
73
+ onBeforeViewReset: AsyncParallelHook<[], Record<string, any>>;
74
74
  };
75
75
  private viewUpdateSubscription;
76
76
  private webplayerInfo;
package/dist/index.esm.js CHANGED
@@ -4,7 +4,7 @@ export * from '@player-ui/player';
4
4
  import { Asset, AssetContext } from '@player-ui/react-asset';
5
5
  import { ErrorBoundary } from 'react-error-boundary';
6
6
  import { PlayerContext } from '@player-ui/react-utils';
7
- import { SyncWaterfallHook, AsyncParallelHook } from 'tapable';
7
+ import { SyncWaterfallHook, AsyncParallelHook } from 'tapable-ts';
8
8
  import { Subscribe, useSubscribedState } from '@player-ui/react-subscribe';
9
9
  import { Registry } from '@player-ui/partial-match-registry';
10
10
  import { MetricsCorePluginSymbol, RequestTimeWebPlugin } from '@player-ui/metrics-plugin';
@@ -76,15 +76,15 @@ var __async$1 = (__this, __arguments, generator) => {
76
76
  step((generator = generator.apply(__this, __arguments)).next());
77
77
  });
78
78
  };
79
- const WEB_PLAYER_VERSION = "!!STABLE_VERSION!!";
80
- const COMMIT = "!!STABLE_GIT_COMMIT!!";
79
+ const WEB_PLAYER_VERSION = "0.0.1-next.8";
80
+ const COMMIT = "40767c627ece78c83b0879021b845fe945245a7a";
81
81
  const _window = typeof window === "undefined" ? void 0 : window;
82
82
  class WebPlayer {
83
83
  constructor(options) {
84
84
  this.assetRegistry = new Registry();
85
85
  this.hooks = {
86
- webComponent: new SyncWaterfallHook(["webComponent"]),
87
- playerComponent: new SyncWaterfallHook(["playerComponent"]),
86
+ webComponent: new SyncWaterfallHook(),
87
+ playerComponent: new SyncWaterfallHook(),
88
88
  onBeforeViewReset: new AsyncParallelHook()
89
89
  };
90
90
  this.viewUpdateSubscription = new Subscribe();
@@ -167,7 +167,7 @@ class WebPlayer {
167
167
  }
168
168
  setWaitForNextViewUpdate() {
169
169
  const shouldCallResetHook = this.options.suspend && this.hooks.onBeforeViewReset.isUsed();
170
- return this.viewUpdateSubscription.reset(shouldCallResetHook ? this.hooks.onBeforeViewReset.promise() : void 0);
170
+ return this.viewUpdateSubscription.reset(shouldCallResetHook ? this.hooks.onBeforeViewReset.call() : void 0);
171
171
  }
172
172
  start(flow) {
173
173
  this.setWaitForNextViewUpdate();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@player-ui/react",
3
- "version": "0.0.1-next.5",
3
+ "version": "0.0.1-next.8",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org"
@@ -11,15 +11,14 @@
11
11
  "react-dom": "^17.0.2"
12
12
  },
13
13
  "dependencies": {
14
- "@player-ui/player": "0.0.1-next.5",
15
- "@player-ui/partial-match-registry": "0.0.1-next.5",
16
- "@player-ui/metrics-plugin": "0.0.1-next.5",
17
- "@player-ui/react-asset": "0.0.1-next.5",
18
- "@player-ui/react-subscribe": "0.0.1-next.5",
19
- "@player-ui/react-utils": "0.0.1-next.5",
14
+ "@player-ui/player": "0.0.1-next.8",
15
+ "@player-ui/partial-match-registry": "0.0.1-next.8",
16
+ "@player-ui/metrics-plugin": "0.0.1-next.8",
17
+ "@player-ui/react-asset": "0.0.1-next.8",
18
+ "@player-ui/react-subscribe": "0.0.1-next.8",
19
+ "@player-ui/react-utils": "0.0.1-next.8",
20
20
  "react-error-boundary": "^3.1.3",
21
- "tapable": "1.1.3",
22
- "@types/tapable": "^1.0.5",
21
+ "tapable-ts": "^0.1.0",
23
22
  "@babel/runtime": "7.15.4"
24
23
  },
25
24
  "main": "dist/index.cjs.js",
package/src/player.tsx CHANGED
@@ -11,7 +11,7 @@ import type { AssetRegistryType } from '@player-ui/react-asset';
11
11
  import { AssetContext } from '@player-ui/react-asset';
12
12
  import { ErrorBoundary } from 'react-error-boundary';
13
13
  import { PlayerContext } from '@player-ui/react-utils';
14
- import { SyncWaterfallHook, AsyncParallelHook } from 'tapable';
14
+ import { SyncWaterfallHook, AsyncParallelHook } from 'tapable-ts';
15
15
  import { Subscribe, useSubscribedState } from '@player-ui/react-subscribe';
16
16
  import { Registry } from '@player-ui/partial-match-registry';
17
17
 
@@ -19,8 +19,8 @@ import type { WebPlayerProps } from './app';
19
19
  import PlayerComp from './app';
20
20
  import OnUpdatePlugin from './plugins/onupdate-plugin';
21
21
 
22
- const WEB_PLAYER_VERSION = '!!STABLE_VERSION!!';
23
- const COMMIT = '!!STABLE_GIT_COMMIT!!';
22
+ const WEB_PLAYER_VERSION = '0.0.1-next.8';
23
+ const COMMIT = '40767c627ece78c83b0879021b845fe945245a7a';
24
24
 
25
25
  export interface DevtoolsGlobals {
26
26
  /** A global for a plugin to load to Player for devtools */
@@ -84,20 +84,21 @@ export class WebPlayer {
84
84
  /**
85
85
  * A hook to create a React Component to be used for Player, regardless of the current flow state
86
86
  */
87
- webComponent: new SyncWaterfallHook<React.ComponentType>(['webComponent']),
87
+ webComponent: new SyncWaterfallHook<[React.ComponentType]>(),
88
88
 
89
89
  /**
90
90
  * A hook to create a React Component that's used to render a specific view.
91
91
  * It will be called for each view update from the core player.
92
92
  * Typically this will just be `Asset`
93
93
  */
94
- playerComponent: new SyncWaterfallHook<React.ComponentType<WebPlayerProps>>(
95
- ['playerComponent']
96
- ),
94
+ playerComponent: new SyncWaterfallHook<
95
+ [React.ComponentType<WebPlayerProps>]
96
+ >(),
97
+
97
98
  /**
98
99
  * A hook to execute async tasks before the view resets to undefined
99
100
  */
100
- onBeforeViewReset: new AsyncParallelHook(),
101
+ onBeforeViewReset: new AsyncParallelHook<[]>(),
101
102
  };
102
103
 
103
104
  private viewUpdateSubscription = new Subscribe<View>();
@@ -229,7 +230,7 @@ export class WebPlayer {
229
230
  this.options.suspend && this.hooks.onBeforeViewReset.isUsed();
230
231
 
231
232
  return this.viewUpdateSubscription.reset(
232
- shouldCallResetHook ? this.hooks.onBeforeViewReset.promise() : undefined
233
+ shouldCallResetHook ? this.hooks.onBeforeViewReset.call() : undefined
233
234
  );
234
235
  }
235
236