chayns-api 3.6.0-beta.1 → 3.6.0-beta.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.
|
@@ -72,17 +72,19 @@ const createAppleSafeAreaFunctions = functions => {
|
|
|
72
72
|
};
|
|
73
73
|
};
|
|
74
74
|
const normalizeFunctions = functions => {
|
|
75
|
-
var _runtimeFunctions$
|
|
75
|
+
var _runtimeFunctions$isT;
|
|
76
76
|
const runtimeFunctions = functions;
|
|
77
|
-
|
|
77
|
+
const hasSafeAreaFunctions = runtimeFunctions.addAppleSafeAreaListener && runtimeFunctions.removeAppleSafeAreaListener && runtimeFunctions.getAppleSafeArea;
|
|
78
|
+
if (hasSafeAreaFunctions && runtimeFunctions.isTrustedUrl) {
|
|
78
79
|
return functions;
|
|
79
80
|
}
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
...functions,
|
|
83
|
-
addAppleSafeAreaListener: (_runtimeFunctions$add2 = runtimeFunctions.addAppleSafeAreaListener) !== null && _runtimeFunctions$add2 !== void 0 ? _runtimeFunctions$add2 : safeAreaFunctions.addAppleSafeAreaListener,
|
|
84
|
-
removeAppleSafeAreaListener: (_runtimeFunctions$rem2 = runtimeFunctions.removeAppleSafeAreaListener) !== null && _runtimeFunctions$rem2 !== void 0 ? _runtimeFunctions$rem2 : safeAreaFunctions.removeAppleSafeAreaListener,
|
|
85
|
-
getAppleSafeArea: (_runtimeFunctions$get = runtimeFunctions.getAppleSafeArea) !== null && _runtimeFunctions$get !== void 0 ? _runtimeFunctions$get : safeAreaFunctions.getAppleSafeArea
|
|
81
|
+
const normalizedFunctions = {
|
|
82
|
+
...functions
|
|
86
83
|
};
|
|
84
|
+
if (!hasSafeAreaFunctions) {
|
|
85
|
+
Object.assign(normalizedFunctions, createAppleSafeAreaFunctions(functions));
|
|
86
|
+
}
|
|
87
|
+
normalizedFunctions.isTrustedUrl = (_runtimeFunctions$isT = runtimeFunctions.isTrustedUrl) !== null && _runtimeFunctions$isT !== void 0 ? _runtimeFunctions$isT : () => Promise.resolve(true);
|
|
88
|
+
return normalizedFunctions;
|
|
87
89
|
};
|
|
88
90
|
exports.normalizeFunctions = normalizeFunctions;
|
|
@@ -66,16 +66,18 @@ const createAppleSafeAreaFunctions = functions => {
|
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
68
|
export const normalizeFunctions = functions => {
|
|
69
|
-
var _runtimeFunctions$
|
|
69
|
+
var _runtimeFunctions$isT;
|
|
70
70
|
const runtimeFunctions = functions;
|
|
71
|
-
|
|
71
|
+
const hasSafeAreaFunctions = runtimeFunctions.addAppleSafeAreaListener && runtimeFunctions.removeAppleSafeAreaListener && runtimeFunctions.getAppleSafeArea;
|
|
72
|
+
if (hasSafeAreaFunctions && runtimeFunctions.isTrustedUrl) {
|
|
72
73
|
return functions;
|
|
73
74
|
}
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
...functions,
|
|
77
|
-
addAppleSafeAreaListener: (_runtimeFunctions$add2 = runtimeFunctions.addAppleSafeAreaListener) !== null && _runtimeFunctions$add2 !== void 0 ? _runtimeFunctions$add2 : safeAreaFunctions.addAppleSafeAreaListener,
|
|
78
|
-
removeAppleSafeAreaListener: (_runtimeFunctions$rem2 = runtimeFunctions.removeAppleSafeAreaListener) !== null && _runtimeFunctions$rem2 !== void 0 ? _runtimeFunctions$rem2 : safeAreaFunctions.removeAppleSafeAreaListener,
|
|
79
|
-
getAppleSafeArea: (_runtimeFunctions$get = runtimeFunctions.getAppleSafeArea) !== null && _runtimeFunctions$get !== void 0 ? _runtimeFunctions$get : safeAreaFunctions.getAppleSafeArea
|
|
75
|
+
const normalizedFunctions = {
|
|
76
|
+
...functions
|
|
80
77
|
};
|
|
78
|
+
if (!hasSafeAreaFunctions) {
|
|
79
|
+
Object.assign(normalizedFunctions, createAppleSafeAreaFunctions(functions));
|
|
80
|
+
}
|
|
81
|
+
normalizedFunctions.isTrustedUrl = (_runtimeFunctions$isT = runtimeFunctions.isTrustedUrl) !== null && _runtimeFunctions$isT !== void 0 ? _runtimeFunctions$isT : () => Promise.resolve(true);
|
|
82
|
+
return normalizedFunctions;
|
|
81
83
|
};
|