@momoyu-ink/kit 0.8.0 → 0.8.1
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/lib.cjs +9 -2
- package/dist/lib.d.mts +8 -1
- package/dist/lib.d.ts +8 -1
- package/dist/lib.mjs +9 -2
- package/package.json +1 -1
package/dist/lib.cjs
CHANGED
|
@@ -1027,13 +1027,20 @@ function createStackNavigator(options) {
|
|
|
1027
1027
|
goBack: () => {
|
|
1028
1028
|
console.warn("goBack() not implemented yet");
|
|
1029
1029
|
},
|
|
1030
|
-
|
|
1030
|
+
hasActiveOverlay: (overlay, id) => {
|
|
1031
|
+
if (id) {
|
|
1032
|
+
console.log(navigationState.overlayStack.some((o) => o.type === overlay && o.id === id));
|
|
1033
|
+
return navigationState.overlayStack.some((o) => o.type === overlay && o.id === id);
|
|
1034
|
+
}
|
|
1035
|
+
return navigationState.overlayStack.some((o) => o.type === overlay);
|
|
1036
|
+
},
|
|
1037
|
+
pushOverlay: (overlay, params, _id) => {
|
|
1031
1038
|
if (!normalizedOverlays[overlay]) {
|
|
1032
1039
|
console.error(`Navigation Error: Overlay "${overlay}" not found in navigator configuration.`);
|
|
1033
1040
|
return;
|
|
1034
1041
|
}
|
|
1035
1042
|
validateParams("overlay", overlay, normalizedOverlays[overlay], params);
|
|
1036
|
-
const id = generateOverlayId();
|
|
1043
|
+
const id = _id ?? generateOverlayId();
|
|
1037
1044
|
const overlayInfo = { type: overlay, id };
|
|
1038
1045
|
navigationState.overlayStack.push(overlayInfo);
|
|
1039
1046
|
if (params !== void 0) {
|
package/dist/lib.d.mts
CHANGED
|
@@ -424,12 +424,19 @@ interface Navigator<PageName extends string = DefaultPageName, OverlayName exten
|
|
|
424
424
|
* Go back to the previous page (not implemented yet)
|
|
425
425
|
*/
|
|
426
426
|
goBack: () => void;
|
|
427
|
+
/**
|
|
428
|
+
* Check whether an overlay has been pushed, optionally by ID
|
|
429
|
+
* @param overlay Overlay name
|
|
430
|
+
* @param id Optional unique ID to check for specific overlay instance
|
|
431
|
+
*/
|
|
432
|
+
hasActiveOverlay: (overlay: OverlayName, id?: string) => boolean;
|
|
427
433
|
/**
|
|
428
434
|
* Push an overlay to the overlay stack
|
|
429
435
|
* @param overlay Overlay name
|
|
430
436
|
* @param params Parameters to pass to the overlay (optional)
|
|
437
|
+
* @param id Unique ID for the overlay (optional)
|
|
431
438
|
*/
|
|
432
|
-
pushOverlay: (overlay: OverlayName, params?: Record<string, any
|
|
439
|
+
pushOverlay: (overlay: OverlayName, params?: Record<string, any>, id?: string) => void;
|
|
433
440
|
/**
|
|
434
441
|
* Pop the top overlay from the stack
|
|
435
442
|
*/
|
package/dist/lib.d.ts
CHANGED
|
@@ -424,12 +424,19 @@ interface Navigator<PageName extends string = DefaultPageName, OverlayName exten
|
|
|
424
424
|
* Go back to the previous page (not implemented yet)
|
|
425
425
|
*/
|
|
426
426
|
goBack: () => void;
|
|
427
|
+
/**
|
|
428
|
+
* Check whether an overlay has been pushed, optionally by ID
|
|
429
|
+
* @param overlay Overlay name
|
|
430
|
+
* @param id Optional unique ID to check for specific overlay instance
|
|
431
|
+
*/
|
|
432
|
+
hasActiveOverlay: (overlay: OverlayName, id?: string) => boolean;
|
|
427
433
|
/**
|
|
428
434
|
* Push an overlay to the overlay stack
|
|
429
435
|
* @param overlay Overlay name
|
|
430
436
|
* @param params Parameters to pass to the overlay (optional)
|
|
437
|
+
* @param id Unique ID for the overlay (optional)
|
|
431
438
|
*/
|
|
432
|
-
pushOverlay: (overlay: OverlayName, params?: Record<string, any
|
|
439
|
+
pushOverlay: (overlay: OverlayName, params?: Record<string, any>, id?: string) => void;
|
|
433
440
|
/**
|
|
434
441
|
* Pop the top overlay from the stack
|
|
435
442
|
*/
|
package/dist/lib.mjs
CHANGED
|
@@ -1015,13 +1015,20 @@ function createStackNavigator(options) {
|
|
|
1015
1015
|
goBack: () => {
|
|
1016
1016
|
console.warn("goBack() not implemented yet");
|
|
1017
1017
|
},
|
|
1018
|
-
|
|
1018
|
+
hasActiveOverlay: (overlay, id) => {
|
|
1019
|
+
if (id) {
|
|
1020
|
+
console.log(navigationState.overlayStack.some((o) => o.type === overlay && o.id === id));
|
|
1021
|
+
return navigationState.overlayStack.some((o) => o.type === overlay && o.id === id);
|
|
1022
|
+
}
|
|
1023
|
+
return navigationState.overlayStack.some((o) => o.type === overlay);
|
|
1024
|
+
},
|
|
1025
|
+
pushOverlay: (overlay, params, _id) => {
|
|
1019
1026
|
if (!normalizedOverlays[overlay]) {
|
|
1020
1027
|
console.error(`Navigation Error: Overlay "${overlay}" not found in navigator configuration.`);
|
|
1021
1028
|
return;
|
|
1022
1029
|
}
|
|
1023
1030
|
validateParams("overlay", overlay, normalizedOverlays[overlay], params);
|
|
1024
|
-
const id = generateOverlayId();
|
|
1031
|
+
const id = _id ?? generateOverlayId();
|
|
1025
1032
|
const overlayInfo = { type: overlay, id };
|
|
1026
1033
|
navigationState.overlayStack.push(overlayInfo);
|
|
1027
1034
|
if (params !== void 0) {
|