akanjs 2.3.6-rc.4 → 2.3.7
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/CHANGELOG.md +6 -0
- package/client/frameConfig.ts +12 -10
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/client/frameConfig.ts
CHANGED
|
@@ -44,7 +44,9 @@ export function validatePageConfig(routeKey: string, config?: PageConfig) {
|
|
|
44
44
|
throw new Error(`[route-convention] unsupported pageConfig.transition "${pageConfig.transition}" in ${routeKey}`);
|
|
45
45
|
}
|
|
46
46
|
if (pageConfig.topInset !== undefined && !isValidInsetValue(pageConfig.topInset)) {
|
|
47
|
-
throw new Error(
|
|
47
|
+
throw new Error(
|
|
48
|
+
`[route-convention] pageConfig.topInset in ${routeKey} must be a boolean or non-negative px number.`,
|
|
49
|
+
);
|
|
48
50
|
}
|
|
49
51
|
if (pageConfig.bottomInset !== undefined && !isValidInsetValue(pageConfig.bottomInset)) {
|
|
50
52
|
throw new Error(
|
|
@@ -59,13 +61,7 @@ function isValidInsetValue(value: unknown): value is NonNullable<PageConfig["top
|
|
|
59
61
|
}
|
|
60
62
|
|
|
61
63
|
function validateSafeAreaConfig(routeKey: string, safeArea?: PageSafeAreaConfig) {
|
|
62
|
-
if (
|
|
63
|
-
safeArea === undefined ||
|
|
64
|
-
typeof safeArea === "boolean" ||
|
|
65
|
-
safeArea === "top" ||
|
|
66
|
-
safeArea === "bottom"
|
|
67
|
-
)
|
|
68
|
-
return;
|
|
64
|
+
if (safeArea === undefined || typeof safeArea === "boolean" || safeArea === "top" || safeArea === "bottom") return;
|
|
69
65
|
if (!isRecord(safeArea)) throw new Error(`[route-convention] pageConfig.safeArea in ${routeKey} is invalid.`);
|
|
70
66
|
for (const key of Object.keys(safeArea)) {
|
|
71
67
|
if (key !== "top" && key !== "bottom" && key !== "android") {
|
|
@@ -139,7 +135,11 @@ export function resolvePageState({
|
|
|
139
135
|
bottomSafeArea: safeArea.bottom,
|
|
140
136
|
topInset: resolveInset(config.topInset),
|
|
141
137
|
bottomInset: resolveInset(config.bottomInset),
|
|
142
|
-
gesture: explicitKeys.gesture
|
|
138
|
+
gesture: explicitKeys.gesture
|
|
139
|
+
? (config.gesture ?? false)
|
|
140
|
+
: transition === "none"
|
|
141
|
+
? false
|
|
142
|
+
: (config.gesture ?? false),
|
|
143
143
|
cache: config.cache ?? false,
|
|
144
144
|
topSafeAreaColor: config.topSafeAreaColor ?? "var(--color-base-100, Canvas)",
|
|
145
145
|
bottomSafeAreaColor: config.bottomSafeAreaColor ?? "var(--color-base-100, Canvas)",
|
|
@@ -193,7 +193,9 @@ function resolveSafeArea({
|
|
|
193
193
|
safeArea === "bottom" ||
|
|
194
194
|
(isRecord(safeArea) ? safeArea.bottom !== false : safeArea === undefined && platform !== "web");
|
|
195
195
|
if (platform === "android") {
|
|
196
|
-
const androidMode = isRecord(safeArea)
|
|
196
|
+
const androidMode = isRecord(safeArea)
|
|
197
|
+
? (safeArea.android as "auto" | "edge-to-edge" | "none" | undefined)
|
|
198
|
+
: "auto";
|
|
197
199
|
if (androidMode === "none") return { top: 0, bottom: 0 };
|
|
198
200
|
const source =
|
|
199
201
|
androidMode === "edge-to-edge"
|