@player-ui/react 0.4.0-next.11 → 0.4.0-next.13

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
@@ -39,14 +39,23 @@ const ReactAsset = (props) => {
39
39
  } else if ("asset" in props) {
40
40
  unwrapped = props.asset;
41
41
  }
42
- if (!unwrapped || typeof unwrapped !== "object" || (unwrapped == null ? void 0 : unwrapped.type) === void 0) {
43
- throw Error(`Cannot determine asset type.`);
42
+ if (!unwrapped) {
43
+ throw Error(`Cannot determine asset type for props: ${JSON.stringify(props)}`);
44
+ }
45
+ if (typeof unwrapped !== "object") {
46
+ throw Error(`Asset was not an object got (${typeof unwrapped}) instead: ${unwrapped}`);
47
+ }
48
+ if (unwrapped.type === void 0) {
49
+ const info = unwrapped.id === void 0 ? JSON.stringify(props) : `id: ${unwrapped.id}`;
50
+ throw Error(`Asset is missing type for ${info}`);
44
51
  }
45
52
  const Impl = registry == null ? void 0 : registry.get(unwrapped);
46
53
  if (!Impl) {
47
54
  throw Error(`No implementation found for id: ${unwrapped.id} type: ${unwrapped.type}`);
48
55
  }
49
- return /* @__PURE__ */ React__default["default"].createElement(Impl, __spreadValues$4({}, unwrapped));
56
+ return /* @__PURE__ */ React__default["default"].createElement(Impl, __spreadValues$4({
57
+ key: unwrapped.id
58
+ }, unwrapped));
50
59
  };
51
60
 
52
61
  const PlayerContext = React__default["default"].createContext({});
@@ -198,8 +207,8 @@ var __async$1 = (__this, __arguments, generator) => {
198
207
  step((generator = generator.apply(__this, __arguments)).next());
199
208
  });
200
209
  };
201
- const WEB_PLAYER_VERSION = "0.4.0-next.11";
202
- const COMMIT = "843876eed97f2f08d6ade9a2d86984fc9e4bd916";
210
+ const WEB_PLAYER_VERSION = "0.4.0-next.13";
211
+ const COMMIT = "80a0ff72b097eff2e227c7effef17923655c7499";
203
212
  const _window = typeof window === "undefined" ? void 0 : window;
204
213
  class ReactPlayer {
205
214
  constructor(options) {
package/dist/index.esm.js CHANGED
@@ -32,14 +32,23 @@ const ReactAsset = (props) => {
32
32
  } else if ("asset" in props) {
33
33
  unwrapped = props.asset;
34
34
  }
35
- if (!unwrapped || typeof unwrapped !== "object" || (unwrapped == null ? void 0 : unwrapped.type) === void 0) {
36
- throw Error(`Cannot determine asset type.`);
35
+ if (!unwrapped) {
36
+ throw Error(`Cannot determine asset type for props: ${JSON.stringify(props)}`);
37
+ }
38
+ if (typeof unwrapped !== "object") {
39
+ throw Error(`Asset was not an object got (${typeof unwrapped}) instead: ${unwrapped}`);
40
+ }
41
+ if (unwrapped.type === void 0) {
42
+ const info = unwrapped.id === void 0 ? JSON.stringify(props) : `id: ${unwrapped.id}`;
43
+ throw Error(`Asset is missing type for ${info}`);
37
44
  }
38
45
  const Impl = registry == null ? void 0 : registry.get(unwrapped);
39
46
  if (!Impl) {
40
47
  throw Error(`No implementation found for id: ${unwrapped.id} type: ${unwrapped.type}`);
41
48
  }
42
- return /* @__PURE__ */ React.createElement(Impl, __spreadValues$4({}, unwrapped));
49
+ return /* @__PURE__ */ React.createElement(Impl, __spreadValues$4({
50
+ key: unwrapped.id
51
+ }, unwrapped));
43
52
  };
44
53
 
45
54
  const PlayerContext = React.createContext({});
@@ -191,8 +200,8 @@ var __async$1 = (__this, __arguments, generator) => {
191
200
  step((generator = generator.apply(__this, __arguments)).next());
192
201
  });
193
202
  };
194
- const WEB_PLAYER_VERSION = "0.4.0-next.11";
195
- const COMMIT = "843876eed97f2f08d6ade9a2d86984fc9e4bd916";
203
+ const WEB_PLAYER_VERSION = "0.4.0-next.13";
204
+ const COMMIT = "80a0ff72b097eff2e227c7effef17923655c7499";
196
205
  const _window = typeof window === "undefined" ? void 0 : window;
197
206
  class ReactPlayer {
198
207
  constructor(options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@player-ui/react",
3
- "version": "0.4.0-next.11",
3
+ "version": "0.4.0-next.13",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org"
@@ -11,10 +11,10 @@
11
11
  "react-dom": "^17.0.2"
12
12
  },
13
13
  "dependencies": {
14
- "@player-ui/player": "0.4.0-next.11",
15
- "@player-ui/partial-match-registry": "0.4.0-next.11",
16
- "@player-ui/metrics-plugin": "0.4.0-next.11",
17
- "@player-ui/react-subscribe": "0.4.0-next.11",
14
+ "@player-ui/player": "0.4.0-next.13",
15
+ "@player-ui/partial-match-registry": "0.4.0-next.13",
16
+ "@player-ui/metrics-plugin": "0.4.0-next.13",
17
+ "@player-ui/react-subscribe": "0.4.0-next.13",
18
18
  "react-error-boundary": "^3.1.3",
19
19
  "tapable-ts": "^0.2.3",
20
20
  "@babel/runtime": "7.15.4"
@@ -29,12 +29,24 @@ export const ReactAsset = (
29
29
  unwrapped = (props as unknown as AssetWrapper).asset;
30
30
  }
31
31
 
32
- if (
33
- !unwrapped ||
34
- typeof unwrapped !== 'object' ||
35
- unwrapped?.type === undefined
36
- ) {
37
- throw Error(`Cannot determine asset type.`);
32
+ if (!unwrapped) {
33
+ throw Error(
34
+ `Cannot determine asset type for props: ${JSON.stringify(props)}`
35
+ );
36
+ }
37
+
38
+ if (typeof unwrapped !== 'object') {
39
+ throw Error(
40
+ `Asset was not an object got (${typeof unwrapped}) instead: ${unwrapped}`
41
+ );
42
+ }
43
+
44
+ if (unwrapped.type === undefined) {
45
+ const info =
46
+ unwrapped.id === undefined
47
+ ? JSON.stringify(props)
48
+ : `id: ${unwrapped.id}`;
49
+ throw Error(`Asset is missing type for ${info}`);
38
50
  }
39
51
 
40
52
  const Impl = registry?.get(unwrapped);
@@ -45,5 +57,5 @@ export const ReactAsset = (
45
57
  );
46
58
  }
47
59
 
48
- return <Impl {...unwrapped} />;
60
+ return <Impl key={unwrapped.id} {...unwrapped} />;
49
61
  };
package/src/player.tsx CHANGED
@@ -19,8 +19,8 @@ import type { ReactPlayerProps } from './app';
19
19
  import PlayerComp from './app';
20
20
  import OnUpdatePlugin from './plugins/onupdate-plugin';
21
21
 
22
- const WEB_PLAYER_VERSION = '0.4.0-next.11';
23
- const COMMIT = '843876eed97f2f08d6ade9a2d86984fc9e4bd916';
22
+ const WEB_PLAYER_VERSION = '0.4.0-next.13';
23
+ const COMMIT = '80a0ff72b097eff2e227c7effef17923655c7499';
24
24
 
25
25
  export interface DevtoolsGlobals {
26
26
  /** A global for a plugin to load to Player for devtools */