chayns-api 2.3.1 → 2.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.
@@ -16,6 +16,9 @@ const loadModule = (scope, module, url, preventSingleton = false) => {
16
16
  moduleMap,
17
17
  componentMap
18
18
  } = globalThis.moduleFederationScopes;
19
+ try {
20
+ url = new URL(url).toString();
21
+ } catch {}
19
22
  if (registeredScopes[scope] !== url || preventSingleton) {
20
23
  if (scope in registeredScopes) {
21
24
  console.error(`[chayns-api] call registerRemote with force for scope ${scope}. url: ${url}`);
@@ -61,7 +64,7 @@ const loadComponent = (scope, module, url, skipCompatMode = false, preventSingle
61
64
  }
62
65
  if (!(module in componentMap[scope]) || registeredScopes[scope] !== url) {
63
66
  const promise = loadModule(scope, module, url, preventSingleton).then(async Module => {
64
- var _sharedReact$lib;
67
+ var _shareScopes$chaynsA, _sharedReact$lib;
65
68
  if (typeof Module.default === 'function') {
66
69
  return Module;
67
70
  }
@@ -80,7 +83,7 @@ const loadComponent = (scope, module, url, skipCompatMode = false, preventSingle
80
83
  }
81
84
  });
82
85
  });
83
- const sharedReact = shareScopes['chayns-api'].react[_react.default.version];
86
+ const sharedReact = (_shareScopes$chaynsA = shareScopes['chayns-api'].react) === null || _shareScopes$chaynsA === void 0 ? void 0 : _shareScopes$chaynsA[_react.default.version];
84
87
  const matchReactVersion = sharedReact && sharedReact.useIn.includes(scope) && ((_sharedReact$lib = sharedReact.lib) === null || _sharedReact$lib === void 0 ? void 0 : _sharedReact$lib.call(sharedReact)) === _react.default;
85
88
  if (!matchReactVersion || Module.default.environment !== 'production' || (Module.default.version || 1) < 2) {
86
89
  const OriginalCompatComponent = (Module.default.version || 1) < 2.1 ? Module.default.CompatComponent.render({}).type.prototype : Module.default.CompatComponent.prototype;
@@ -42,12 +42,11 @@ let DialogSelectType = exports.DialogSelectType = function (DialogSelectType) {
42
42
  DialogSelectType[DialogSelectType["SIMPLE"] = 3] = "SIMPLE";
43
43
  return DialogSelectType;
44
44
  }({});
45
- let DialogButtonType = exports.DialogButtonType = function (DialogButtonType) {
46
- DialogButtonType[DialogButtonType["OK"] = 1] = "OK";
47
- DialogButtonType[DialogButtonType["CANCEL"] = -1] = "CANCEL";
48
- DialogButtonType[DialogButtonType["NEGATIVE"] = 0] = "NEGATIVE";
49
- return DialogButtonType;
50
- }({});
45
+ const DialogButtonType = exports.DialogButtonType = {
46
+ OK: 1,
47
+ CANCEL: -1,
48
+ NEGATIVE: 0
49
+ };
51
50
  let IconStyle = exports.IconStyle = function (IconStyle) {
52
51
  IconStyle[IconStyle["SOLID"] = 0] = "SOLID";
53
52
  IconStyle[IconStyle["REGULAR"] = 1] = "REGULAR";
@@ -10,6 +10,9 @@ export const loadModule = function (scope, module, url) {
10
10
  moduleMap,
11
11
  componentMap
12
12
  } = globalThis.moduleFederationScopes;
13
+ try {
14
+ url = new URL(url).toString();
15
+ } catch {}
13
16
  if (registeredScopes[scope] !== url || preventSingleton) {
14
17
  if (scope in registeredScopes) {
15
18
  console.error(`[chayns-api] call registerRemote with force for scope ${scope}. url: ${url}`);
@@ -56,7 +59,7 @@ const loadComponent = function (scope, module, url) {
56
59
  }
57
60
  if (!(module in componentMap[scope]) || registeredScopes[scope] !== url) {
58
61
  const promise = loadModule(scope, module, url, preventSingleton).then(async Module => {
59
- var _sharedReact$lib;
62
+ var _shareScopes$chaynsA, _sharedReact$lib;
60
63
  if (typeof Module.default === 'function') {
61
64
  return Module;
62
65
  }
@@ -75,7 +78,7 @@ const loadComponent = function (scope, module, url) {
75
78
  }
76
79
  });
77
80
  });
78
- const sharedReact = shareScopes['chayns-api'].react[React.version];
81
+ const sharedReact = (_shareScopes$chaynsA = shareScopes['chayns-api'].react) === null || _shareScopes$chaynsA === void 0 ? void 0 : _shareScopes$chaynsA[React.version];
79
82
  const matchReactVersion = sharedReact && sharedReact.useIn.includes(scope) && ((_sharedReact$lib = sharedReact.lib) === null || _sharedReact$lib === void 0 ? void 0 : _sharedReact$lib.call(sharedReact)) === React;
80
83
  if (!matchReactVersion || Module.default.environment !== 'production' || (Module.default.version || 1) < 2) {
81
84
  const OriginalCompatComponent = (Module.default.version || 1) < 2.1 ? Module.default.CompatComponent.render({}).type.prototype : Module.default.CompatComponent.prototype;
@@ -36,12 +36,11 @@ export let DialogSelectType = function (DialogSelectType) {
36
36
  DialogSelectType[DialogSelectType["SIMPLE"] = 3] = "SIMPLE";
37
37
  return DialogSelectType;
38
38
  }({});
39
- export let DialogButtonType = function (DialogButtonType) {
40
- DialogButtonType[DialogButtonType["OK"] = 1] = "OK";
41
- DialogButtonType[DialogButtonType["CANCEL"] = -1] = "CANCEL";
42
- DialogButtonType[DialogButtonType["NEGATIVE"] = 0] = "NEGATIVE";
43
- return DialogButtonType;
44
- }({});
39
+ export const DialogButtonType = {
40
+ OK: 1,
41
+ CANCEL: -1,
42
+ NEGATIVE: 0
43
+ };
45
44
  export let IconStyle = function (IconStyle) {
46
45
  IconStyle[IconStyle["SOLID"] = 0] = "SOLID";
47
46
  IconStyle[IconStyle["REGULAR"] = 1] = "REGULAR";
@@ -155,11 +155,12 @@ export interface DialogSelect {
155
155
  preventCloseOnClick?: boolean;
156
156
  selectAllCheckbox?: string;
157
157
  }
158
- export declare enum DialogButtonType {
159
- OK = 1,
160
- CANCEL = -1,
161
- NEGATIVE = 0
162
- }
158
+ export declare const DialogButtonType: {
159
+ readonly OK: 1;
160
+ readonly CANCEL: -1;
161
+ readonly NEGATIVE: 0;
162
+ };
163
+ export type DialogButtonType = typeof DialogButtonType[keyof typeof DialogButtonType];
163
164
  export type ChaynsApiUser = {
164
165
  firstName?: string;
165
166
  lastName?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chayns-api",
3
- "version": "2.3.1",
3
+ "version": "2.3.2",
4
4
  "description": "new chayns api",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",