Skip to content

Commit 11579ec

Browse files
committed
chore: build
1 parent 7b72c48 commit 11579ec

4 files changed

Lines changed: 87 additions & 42 deletions

File tree

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

Lines changed: 46 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,48 @@ function getRouteOptions(path, alias = false) {
679679
}
680680
return __uniRoutes.find((route) => route.path === path);
681681
}
682+
const SYSTEM_DIALOG_PAGE_PATH_STARTER = "uni:";
683+
function isSystemDialogPage(page) {
684+
return page.route.startsWith(SYSTEM_DIALOG_PAGE_PATH_STARTER);
685+
}
686+
function getSystemDialogPages(parentPage) {
687+
if (!parentPage)
688+
return [];
689+
return parentPage.$getSystemDialogPages();
690+
}
691+
function invokeNewDialogPageHook(page, hook) {
692+
let shouldInvoke = false;
693+
const currentPage = getCurrentPage();
694+
if (isSystemDialogPage(page)) {
695+
const systemDialogPages = getSystemDialogPages(currentPage);
696+
shouldInvoke = systemDialogPages.includes(page);
697+
} else {
698+
const dialogPages = currentPage.getDialogPages();
699+
shouldInvoke = dialogPages.includes(page);
700+
}
701+
shouldInvoke && invokeHook(page.vm, hook);
702+
}
703+
function getPageInstanceByChild(child) {
704+
var _a;
705+
let pageInstance = child;
706+
while (pageInstance && ((_a = pageInstance.type) == null ? void 0 : _a.name) !== "Page") {
707+
pageInstance = pageInstance.parent;
708+
}
709+
return pageInstance;
710+
}
711+
const DIALOG_TAG = "dialog";
712+
const SYSTEM_DIALOG_TAG = "systemDialog";
713+
function isDialogPageInstance(vm) {
714+
if (!vm)
715+
return false;
716+
return isNormalDialogPageInstance(vm) || isSystemDialogPageInstance(vm);
717+
}
718+
function isNormalDialogPageInstance(vm) {
719+
return vm.attrs["data-type"] === DIALOG_TAG;
720+
}
721+
function isSystemDialogPageInstance(vm) {
722+
return vm.attrs["data-type"] === SYSTEM_DIALOG_TAG;
723+
}
682724
const invokeOnCallback = (name, res) => UniServiceJSBridge.emit("api." + name, res);
683725
let invokeViewMethodId = 1;
684726
function publishViewMethodName(pageId) {
@@ -2344,19 +2386,6 @@ const envMethod = /* @__PURE__ */ (() => "env")();
23442386
function normalizeWindowBottom(windowBottom) {
23452387
return envMethod ? `calc(${windowBottom}px + ${envMethod}(safe-area-inset-bottom))` : `${windowBottom}px`;
23462388
}
2347-
const DIALOG_TAG = "dialog";
2348-
const SYSTEM_DIALOG_TAG = "systemDialog";
2349-
function isDialogPageInstance(vm) {
2350-
if (!vm)
2351-
return false;
2352-
return isNormalDialogPageInstance(vm) || isSystemDialogPageInstance(vm);
2353-
}
2354-
function isNormalDialogPageInstance(vm) {
2355-
return vm.attrs["data-type"] === DIALOG_TAG;
2356-
}
2357-
function isSystemDialogPageInstance(vm) {
2358-
return vm.attrs["data-type"] === SYSTEM_DIALOG_TAG;
2359-
}
23602389
const homeDialogPages = [];
23612390
const homeSystemDialogPages = [];
23622391
function getPageElement(page) {
@@ -2784,14 +2813,6 @@ function getRealPath(filePath) {
27842813
}
27852814
return filePath;
27862815
}
2787-
function getPageInstanceByChild(child) {
2788-
var _a;
2789-
let pageInstance = child;
2790-
while (pageInstance && ((_a = pageInstance.type) == null ? void 0 : _a.name) !== "Page") {
2791-
pageInstance = pageInstance.parent;
2792-
}
2793-
return pageInstance;
2794-
}
27952816
const clazz = { class: "uni-async-loading" };
27962817
const loadingVNode = /* @__PURE__ */ vue.createVNode(
27972818
"i",
@@ -9461,6 +9482,10 @@ function initHooks(options, instance, publicThis) {
94619482
const $basePage = true ? publicThis.$basePage : publicThis.$page;
94629483
if (true) {
94639484
if (($basePage == null ? void 0 : $basePage.openType) !== "preloadPage") {
9485+
if (isDialogPageInstance(getPageInstanceByChild(instance))) {
9486+
invokeNewDialogPageHook(publicThis.$page, uniShared.ON_SHOW);
9487+
return;
9488+
}
94649489
invokeHook(publicThis, uniShared.ON_SHOW);
94659490
}
94669491
}

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

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,6 +1311,39 @@ function invokeLastDialogPageHookByUniPage(parentPage, hook) {
13111311
invokeHook(lastDialogPage.vm, hook);
13121312
}
13131313
}
1314+
function invokeNewDialogPageHook(page, hook) {
1315+
let shouldInvoke = false;
1316+
const currentPage = getCurrentPage();
1317+
if (isSystemDialogPage(page)) {
1318+
const systemDialogPages = getSystemDialogPages(currentPage);
1319+
shouldInvoke = systemDialogPages.includes(page);
1320+
} else {
1321+
const dialogPages = currentPage.getDialogPages();
1322+
shouldInvoke = dialogPages.includes(page);
1323+
}
1324+
shouldInvoke && invokeHook(page.vm, hook);
1325+
}
1326+
function getPageInstanceByChild(child) {
1327+
var _a;
1328+
let pageInstance = child;
1329+
while (pageInstance && ((_a = pageInstance.type) == null ? void 0 : _a.name) !== "Page") {
1330+
pageInstance = pageInstance.parent;
1331+
}
1332+
return pageInstance;
1333+
}
1334+
const DIALOG_TAG = "dialog";
1335+
const SYSTEM_DIALOG_TAG = "systemDialog";
1336+
function isDialogPageInstance(vm) {
1337+
if (!vm)
1338+
return false;
1339+
return isNormalDialogPageInstance(vm) || isSystemDialogPageInstance(vm);
1340+
}
1341+
function isNormalDialogPageInstance(vm) {
1342+
return vm.attrs["data-type"] === DIALOG_TAG;
1343+
}
1344+
function isSystemDialogPageInstance(vm) {
1345+
return vm.attrs["data-type"] === SYSTEM_DIALOG_TAG;
1346+
}
13141347
function initView() {
13151348
useRem();
13161349
initCustomDatasetOnce(isBuiltInElement);
@@ -7553,19 +7586,6 @@ function getSafeAreaInsets(pageBody) {
75537586
bottom: Math.max(pageWrapperEdge.bottom, systemSafeAreaInsets.bottom)
75547587
};
75557588
}
7556-
const DIALOG_TAG = "dialog";
7557-
const SYSTEM_DIALOG_TAG = "systemDialog";
7558-
function isDialogPageInstance(vm) {
7559-
if (!vm)
7560-
return false;
7561-
return isNormalDialogPageInstance(vm) || isSystemDialogPageInstance(vm);
7562-
}
7563-
function isNormalDialogPageInstance(vm) {
7564-
return vm.attrs["data-type"] === DIALOG_TAG;
7565-
}
7566-
function isSystemDialogPageInstance(vm) {
7567-
return vm.attrs["data-type"] === SYSTEM_DIALOG_TAG;
7568-
}
75697589
let escBackPageNum = 0;
75707590
const homeDialogPages = [];
75717591
const homeSystemDialogPages = [];
@@ -8827,14 +8847,6 @@ function initLaunchOptions({
88278847
extend(enterOptions, launchOptions);
88288848
return extend({}, launchOptions);
88298849
}
8830-
function getPageInstanceByChild(child) {
8831-
var _a;
8832-
let pageInstance = child;
8833-
while (pageInstance && ((_a = pageInstance.type) == null ? void 0 : _a.name) !== "Page") {
8834-
pageInstance = pageInstance.parent;
8835-
}
8836-
return pageInstance;
8837-
}
88388850
const clazz = { class: "uni-async-loading" };
88398851
const loadingVNode = /* @__PURE__ */ createVNode(
88408852
"i",
@@ -19150,6 +19162,10 @@ function initHooks(options, instance2, publicThis) {
1915019162
const $basePage = true ? publicThis.$basePage : publicThis.$page;
1915119163
if (true) {
1915219164
if (($basePage == null ? void 0 : $basePage.openType) !== "preloadPage") {
19165+
if (isDialogPageInstance(getPageInstanceByChild(instance2))) {
19166+
invokeNewDialogPageHook(publicThis.$page, ON_SHOW);
19167+
return;
19168+
}
1915319169
invokeHook(publicThis, ON_SHOW);
1915419170
}
1915519171
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8115,6 +8115,8 @@ function initHooks(options, instance, publicThis) {
81158115
const $basePage = false ? publicThis.$basePage : publicThis.$page;
81168116
if (true) {
81178117
if (($basePage == null ? void 0 : $basePage.openType) !== "preloadPage") {
8118+
if (false)
8119+
;
81188120
invokeHook(publicThis, uniShared.ON_SHOW);
81198121
}
81208122
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16177,6 +16177,8 @@ function initHooks(options, instance2, publicThis) {
1617716177
const $basePage = false ? publicThis.$basePage : publicThis.$page;
1617816178
if (true) {
1617916179
if (($basePage == null ? void 0 : $basePage.openType) !== "preloadPage") {
16180+
if (false)
16181+
;
1618016182
invokeHook(publicThis, ON_SHOW);
1618116183
}
1618216184
}

0 commit comments

Comments
 (0)