Skip to content

Commit bc3495a

Browse files
committed
chore: build
1 parent 3032994 commit bc3495a

8 files changed

Lines changed: 96 additions & 4 deletions

File tree

packages/uni-app-plus/dist/uni.vue.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ function initHooks(options, instance, publicThis) {
9292
: publicThis.$page;
9393
if (!('app' === 'app' && false && ($basePage === null || $basePage === void 0 ? void 0 : $basePage.meta.isTabBar))) {
9494
if (($basePage === null || $basePage === void 0 ? void 0 : $basePage.openType) !== 'preloadPage') {
95+
if (false) ;
9596
invokeHook(publicThis, ON_SHOW);
9697
}
9798
}

packages/uni-app-plus/dist/uni.x.runtime.esm.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,12 @@ function getLastDialogPage(parentPage) {
210210
var lastDialogPageId = ((_lastDialogPage$vm = lastDialogPage.vm) === null || _lastDialogPage$vm === void 0 || (_lastDialogPage$vm = _lastDialogPage$vm.$basePage) === null || _lastDialogPage$vm === void 0 ? void 0 : _lastDialogPage$vm.id) || Number.MAX_SAFE_INTEGER;
211211
return lastSystemDialogPageId > lastDialogPageId ? lastSystemDialogPage : lastDialogPage;
212212
}
213+
function invokeLastDialogPageHookByUniPage(parentPage, hook) {
214+
var lastDialogPage = getLastDialogPage(parentPage);
215+
if (lastDialogPage) {
216+
invokeHook(lastDialogPage.vm, hook);
217+
}
218+
}
213219
function initPageVm(pageVm, page) {
214220
pageVm.route = page.route;
215221
pageVm.$vm = pageVm;
@@ -2900,6 +2906,7 @@ function _navigateTo(_ref2) {
29002906
var currentRouteType = currentPage == null ? "appLaunch" : API_NAVIGATE_TO;
29012907
invokeBeforeRouteHooks(currentRouteType);
29022908
invokeHook(ON_HIDE);
2909+
currentPage && invokeLastDialogPageHookByUniPage(currentPage.$page, ON_HIDE);
29032910
var eventChannel = new EventChannel(getWebviewId() + 1, events);
29042911
return new Promise((resolve) => {
29052912
setTimeout(() => {
@@ -3033,6 +3040,7 @@ function back(delta, animationType, animationDuration) {
30333040
closeWebview(webview2, animationType, animationDuration, () => {
30343041
pages2.slice(len - delta, len).forEach((page) => removePage(page));
30353042
invokeHook(ON_SHOW);
3043+
invokeLastDialogPageHookByUniPage(getCurrentPage(), ON_SHOW);
30363044
setStatusBarStyle();
30373045
});
30383046
};

packages/uni-app-plus/dist/uni.x.runtime.harmony.esm.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,12 @@ function getLastDialogPage(parentPage) {
210210
var lastDialogPageId = ((_lastDialogPage$vm = lastDialogPage.vm) === null || _lastDialogPage$vm === void 0 || (_lastDialogPage$vm = _lastDialogPage$vm.$basePage) === null || _lastDialogPage$vm === void 0 ? void 0 : _lastDialogPage$vm.id) || Number.MAX_SAFE_INTEGER;
211211
return lastSystemDialogPageId > lastDialogPageId ? lastSystemDialogPage : lastDialogPage;
212212
}
213+
function invokeLastDialogPageHookByUniPage(parentPage, hook) {
214+
var lastDialogPage = getLastDialogPage(parentPage);
215+
if (lastDialogPage) {
216+
invokeHook(lastDialogPage.vm, hook);
217+
}
218+
}
213219
function initPageVm(pageVm, page) {
214220
pageVm.route = page.route;
215221
pageVm.$vm = pageVm;
@@ -2900,6 +2906,7 @@ function _navigateTo(_ref2) {
29002906
var currentRouteType = currentPage == null ? "appLaunch" : API_NAVIGATE_TO;
29012907
invokeBeforeRouteHooks(currentRouteType);
29022908
invokeHook(ON_HIDE);
2909+
currentPage && invokeLastDialogPageHookByUniPage(currentPage.$page, ON_HIDE);
29032910
var eventChannel = new EventChannel(getWebviewId() + 1, events);
29042911
return new Promise((resolve) => {
29052912
setTimeout(() => {
@@ -3033,6 +3040,7 @@ function back(delta, animationType, animationDuration) {
30333040
closeWebview(webview2, animationType, animationDuration, () => {
30343041
pages2.slice(len - delta, len).forEach((page) => removePage(page));
30353042
invokeHook(ON_SHOW);
3043+
invokeLastDialogPageHookByUniPage(getCurrentPage(), ON_SHOW);
30363044
setStatusBarStyle();
30373045
});
30383046
};

packages/uni-app-plus/dist/uni.x.runtime.harmony.vapor.esm.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,12 @@ function getLastDialogPage(parentPage) {
210210
var lastDialogPageId = ((_lastDialogPage$vm = lastDialogPage.vm) === null || _lastDialogPage$vm === void 0 || (_lastDialogPage$vm = _lastDialogPage$vm.$basePage) === null || _lastDialogPage$vm === void 0 ? void 0 : _lastDialogPage$vm.id) || Number.MAX_SAFE_INTEGER;
211211
return lastSystemDialogPageId > lastDialogPageId ? lastSystemDialogPage : lastDialogPage;
212212
}
213+
function invokeLastDialogPageHookByUniPage(parentPage, hook) {
214+
var lastDialogPage = getLastDialogPage(parentPage);
215+
if (lastDialogPage) {
216+
invokeHook(lastDialogPage.vm, hook);
217+
}
218+
}
213219
function initPageVm(pageVm, page) {
214220
pageVm.route = page.route;
215221
pageVm.$vm = pageVm;
@@ -2900,6 +2906,7 @@ function _navigateTo(_ref2) {
29002906
var currentRouteType = currentPage == null ? "appLaunch" : API_NAVIGATE_TO;
29012907
invokeBeforeRouteHooks(currentRouteType);
29022908
invokeHook(ON_HIDE);
2909+
currentPage && invokeLastDialogPageHookByUniPage(currentPage.$page, ON_HIDE);
29032910
var eventChannel = new EventChannel(getWebviewId() + 1, events);
29042911
return new Promise((resolve) => {
29052912
setTimeout(() => {
@@ -3033,6 +3040,7 @@ function back(delta, animationType, animationDuration) {
30333040
closeWebview(webview2, animationType, animationDuration, () => {
30343041
pages2.slice(len - delta, len).forEach((page) => removePage(page));
30353042
invokeHook(ON_SHOW);
3043+
invokeLastDialogPageHookByUniPage(getCurrentPage(), ON_SHOW);
30363044
setStatusBarStyle();
30373045
});
30383046
};

packages/uni-app-plus/dist/uni.x.runtime.vapor.esm.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,12 @@ function getLastDialogPage(parentPage) {
210210
var lastDialogPageId = ((_lastDialogPage$vm = lastDialogPage.vm) === null || _lastDialogPage$vm === void 0 || (_lastDialogPage$vm = _lastDialogPage$vm.$basePage) === null || _lastDialogPage$vm === void 0 ? void 0 : _lastDialogPage$vm.id) || Number.MAX_SAFE_INTEGER;
211211
return lastSystemDialogPageId > lastDialogPageId ? lastSystemDialogPage : lastDialogPage;
212212
}
213+
function invokeLastDialogPageHookByUniPage(parentPage, hook) {
214+
var lastDialogPage = getLastDialogPage(parentPage);
215+
if (lastDialogPage) {
216+
invokeHook(lastDialogPage.vm, hook);
217+
}
218+
}
213219
function initPageVm(pageVm, page) {
214220
pageVm.route = page.route;
215221
pageVm.$vm = pageVm;
@@ -2900,6 +2906,7 @@ function _navigateTo(_ref2) {
29002906
var currentRouteType = currentPage == null ? "appLaunch" : API_NAVIGATE_TO;
29012907
invokeBeforeRouteHooks(currentRouteType);
29022908
invokeHook(ON_HIDE);
2909+
currentPage && invokeLastDialogPageHookByUniPage(currentPage.$page, ON_HIDE);
29032910
var eventChannel = new EventChannel(getWebviewId() + 1, events);
29042911
return new Promise((resolve) => {
29052912
setTimeout(() => {
@@ -3033,6 +3040,7 @@ function back(delta, animationType, animationDuration) {
30333040
closeWebview(webview2, animationType, animationDuration, () => {
30343041
pages2.slice(len - delta, len).forEach((page) => removePage(page));
30353042
invokeHook(ON_SHOW);
3043+
invokeLastDialogPageHookByUniPage(getCurrentPage(), ON_SHOW);
30363044
setStatusBarStyle();
30373045
});
30383046
};

packages/uni-app-plus/dist/uni.x.vue.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,48 @@ function invokeHook(vm, name, args) {
5151
return hooks && invokeArrayFns(hooks, args);
5252
}
5353

54+
const SYSTEM_DIALOG_PAGE_PATH_STARTER = 'uni:';
55+
function isSystemDialogPage(page) {
56+
return page.route.startsWith(SYSTEM_DIALOG_PAGE_PATH_STARTER);
57+
}
58+
function getSystemDialogPages(parentPage) {
59+
if (!parentPage)
60+
return [];
61+
{
62+
// $getSystemDialogPages harmony __$$getSystemDialogPages ios
63+
return typeof parentPage.__$$getSystemDialogPages === 'undefined'
64+
? parentPage.$getSystemDialogPages()
65+
: parentPage.__$$getSystemDialogPages();
66+
}
67+
}
68+
function invokeNewDialogPageHook(page, hook) {
69+
let shouldInvoke = false;
70+
const currentPage = getCurrentPage();
71+
if (isSystemDialogPage(page)) {
72+
const systemDialogPages = getSystemDialogPages(currentPage);
73+
shouldInvoke = systemDialogPages.includes(page);
74+
}
75+
else {
76+
const dialogPages = currentPage.getDialogPages();
77+
shouldInvoke = dialogPages.includes(page);
78+
}
79+
shouldInvoke && invokeHook(page.vm, hook);
80+
}
81+
function getPageInstanceByChild(child) {
82+
{
83+
// @ts-expect-error
84+
return child.ctx.$basePage;
85+
}
86+
}
87+
function isDialogPageInstance(vm) {
88+
if (!vm)
89+
return false;
90+
{
91+
// @ts-expect-error
92+
return vm.openType === 'openDialogPage';
93+
}
94+
}
95+
5496
function injectLifecycleHook(name, hook, publicThis, instance) {
5597
if (isFunction(hook)) {
5698
injectHook(name, hook.bind(publicThis), instance);
@@ -106,6 +148,15 @@ function initHooks(options, instance, publicThis) {
106148
: publicThis.$page;
107149
if (!('app' === 'app' && true && ($basePage === null || $basePage === void 0 ? void 0 : $basePage.meta.isTabBar))) {
108150
if (($basePage === null || $basePage === void 0 ? void 0 : $basePage.openType) !== 'preloadPage') {
151+
if (true) {
152+
if (isDialogPageInstance(getPageInstanceByChild(instance))) {
153+
invokeNewDialogPageHook(publicThis.$page, ON_SHOW);
154+
}
155+
else {
156+
invokeHook(publicThis, ON_SHOW);
157+
}
158+
return;
159+
}
109160
invokeHook(publicThis, ON_SHOW);
110161
}
111162
}

packages/uni-h5/dist-x/uni-h5.cjs.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9482,8 +9482,12 @@ function initHooks(options, instance, publicThis) {
94829482
const $basePage = true ? publicThis.$basePage : publicThis.$page;
94839483
if (true) {
94849484
if (($basePage == null ? void 0 : $basePage.openType) !== "preloadPage") {
9485-
if (isDialogPageInstance(getPageInstanceByChild(instance))) {
9486-
invokeNewDialogPageHook(publicThis.$page, uniShared.ON_SHOW);
9485+
if (true) {
9486+
if (isDialogPageInstance(getPageInstanceByChild(instance))) {
9487+
invokeNewDialogPageHook(publicThis.$page, uniShared.ON_SHOW);
9488+
} else {
9489+
invokeHook(publicThis, uniShared.ON_SHOW);
9490+
}
94879491
return;
94889492
}
94899493
invokeHook(publicThis, uniShared.ON_SHOW);

packages/uni-h5/dist-x/uni-h5.es.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19162,8 +19162,12 @@ function initHooks(options, instance2, publicThis) {
1916219162
const $basePage = true ? publicThis.$basePage : publicThis.$page;
1916319163
if (true) {
1916419164
if (($basePage == null ? void 0 : $basePage.openType) !== "preloadPage") {
19165-
if (isDialogPageInstance(getPageInstanceByChild(instance2))) {
19166-
invokeNewDialogPageHook(publicThis.$page, ON_SHOW);
19165+
if (true) {
19166+
if (isDialogPageInstance(getPageInstanceByChild(instance2))) {
19167+
invokeNewDialogPageHook(publicThis.$page, ON_SHOW);
19168+
} else {
19169+
invokeHook(publicThis, ON_SHOW);
19170+
}
1916719171
return;
1916819172
}
1916919173
invokeHook(publicThis, ON_SHOW);

0 commit comments

Comments
 (0)