chayns-api 2.3.1 → 2.3.3
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/cjs/host/module/utils/loadComponent.js +5 -2
- package/dist/cjs/types/IChaynsReact.js +5 -6
- package/dist/cjs/util/appStorage.js +1 -1
- package/dist/esm/host/module/utils/loadComponent.js +5 -2
- package/dist/esm/types/IChaynsReact.js +5 -6
- package/dist/esm/util/appStorage.js +1 -1
- package/dist/types/types/IChaynsReact.d.ts +6 -5
- package/package.json +1 -1
|
@@ -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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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";
|
|
@@ -16,7 +16,7 @@ function isAppStorageAvailable() {
|
|
|
16
16
|
if (((_this$values$device$a = this.values.device.app) === null || _this$values$device$a === void 0 ? void 0 : _this$values$device$a.name) !== _IChaynsReact.AppName.Team) {
|
|
17
17
|
return false;
|
|
18
18
|
}
|
|
19
|
-
return ((_this$values$device$a2 = this.values.device.app) === null || _this$values$device$a2 === void 0 ? void 0 : _this$values$device$a2.appVersion) >= (['iOS', 'Mac OS'].includes(this.values.device.os) ? 1046 :
|
|
19
|
+
return ((_this$values$device$a2 = this.values.device.app) === null || _this$values$device$a2 === void 0 ? void 0 : _this$values$device$a2.appVersion) >= (['iOS', 'Mac OS'].includes(this.values.device.os) ? 1046 : 1033);
|
|
20
20
|
}
|
|
21
21
|
function getAppStorageItem(storeName, key) {
|
|
22
22
|
const callbackName = `chaynsApiV5Callback_${this.counter++}`;
|
|
@@ -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
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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";
|
|
@@ -5,7 +5,7 @@ export function isAppStorageAvailable() {
|
|
|
5
5
|
if (((_this$values$device$a = this.values.device.app) === null || _this$values$device$a === void 0 ? void 0 : _this$values$device$a.name) !== AppName.Team) {
|
|
6
6
|
return false;
|
|
7
7
|
}
|
|
8
|
-
return ((_this$values$device$a2 = this.values.device.app) === null || _this$values$device$a2 === void 0 ? void 0 : _this$values$device$a2.appVersion) >= (['iOS', 'Mac OS'].includes(this.values.device.os) ? 1046 :
|
|
8
|
+
return ((_this$values$device$a2 = this.values.device.app) === null || _this$values$device$a2 === void 0 ? void 0 : _this$values$device$a2.appVersion) >= (['iOS', 'Mac OS'].includes(this.values.device.os) ? 1046 : 1033);
|
|
9
9
|
}
|
|
10
10
|
export function getAppStorageItem(storeName, key) {
|
|
11
11
|
const callbackName = `chaynsApiV5Callback_${this.counter++}`;
|
|
@@ -155,11 +155,12 @@ export interface DialogSelect {
|
|
|
155
155
|
preventCloseOnClick?: boolean;
|
|
156
156
|
selectAllCheckbox?: string;
|
|
157
157
|
}
|
|
158
|
-
export declare
|
|
159
|
-
OK
|
|
160
|
-
CANCEL
|
|
161
|
-
NEGATIVE
|
|
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;
|