chayns-api 2.1.3-1 → 2.1.3-2

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.
@@ -62,6 +62,7 @@ const loadComponent = (scope, module, url, skipCompatMode = false, preventSingle
62
62
  }
63
63
  if (!(module in componentMap[scope]) || registeredScopes[scope] !== url) {
64
64
  const promise = loadModule(scope, module, url, preventSingleton).then(async Module => {
65
+ var _sharedReact$lib;
65
66
  if (typeof Module.default === 'function') {
66
67
  return Module;
67
68
  }
@@ -80,15 +81,8 @@ const loadComponent = (scope, module, url, skipCompatMode = false, preventSingle
80
81
  }
81
82
  });
82
83
  });
83
- const matchReactVersion = Object.values(shareScopes['chayns-api'].react).some(({
84
- lib,
85
- useIn,
86
- version
87
- }) => {
88
- if (!useIn.includes(scope)) return false;
89
- if (version !== _react.default.version) return false;
90
- return (lib === null || lib === void 0 ? void 0 : lib()) === _react.default;
91
- });
84
+ const sharedReact = shareScopes['chayns-api'].react[_react.default.version];
85
+ const matchReactVersion = sharedReact && sharedReact.useIn.includes(scope) && ((_sharedReact$lib = sharedReact.lib) === null || _sharedReact$lib === void 0 ? void 0 : _sharedReact$lib.call(sharedReact)) === _react.default;
92
86
  if (!matchReactVersion || (Module.default.version || 1) < 2) {
93
87
  const OriginalCompatComponent = (Module.default.version || 1) < 2.1 ? Module.default.CompatComponent.render({}).type.prototype : Module.default.CompatComponent.prototype;
94
88
  class CompatComponent extends _react.default.Component {
@@ -57,6 +57,7 @@ const loadComponent = function (scope, module, url) {
57
57
  }
58
58
  if (!(module in componentMap[scope]) || registeredScopes[scope] !== url) {
59
59
  const promise = loadModule(scope, module, url, preventSingleton).then(async Module => {
60
+ var _sharedReact$lib;
60
61
  if (typeof Module.default === 'function') {
61
62
  return Module;
62
63
  }
@@ -75,16 +76,8 @@ const loadComponent = function (scope, module, url) {
75
76
  }
76
77
  });
77
78
  });
78
- const matchReactVersion = Object.values(shareScopes['chayns-api'].react).some(_ref => {
79
- let {
80
- lib,
81
- useIn,
82
- version
83
- } = _ref;
84
- if (!useIn.includes(scope)) return false;
85
- if (version !== React.version) return false;
86
- return (lib === null || lib === void 0 ? void 0 : lib()) === React;
87
- });
79
+ const sharedReact = shareScopes['chayns-api'].react[React.version];
80
+ const matchReactVersion = sharedReact && sharedReact.useIn.includes(scope) && ((_sharedReact$lib = sharedReact.lib) === null || _sharedReact$lib === void 0 ? void 0 : _sharedReact$lib.call(sharedReact)) === React;
88
81
  if (!matchReactVersion || (Module.default.version || 1) < 2) {
89
82
  const OriginalCompatComponent = (Module.default.version || 1) < 2.1 ? Module.default.CompatComponent.render({}).type.prototype : Module.default.CompatComponent.prototype;
90
83
  class CompatComponent extends React.Component {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chayns-api",
3
- "version": "2.1.3-1",
3
+ "version": "2.1.3-2",
4
4
  "description": "new chayns api",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",