@dimina-kit/devtools 0.4.0-dev.20260728095034 → 0.4.0-dev.20260728110120
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/main/index.bundle.js +1 -2
- package/dist/main/ipc/bridge-router.js +1 -2
- package/dist/main/services/views/native-simulator-view.js +4 -0
- package/dist/preload/runtime/native-host.d.ts +8 -0
- package/dist/preload/runtime/native-host.js +2 -0
- package/dist/preload/windows/main.cjs.map +1 -1
- package/dist/preload/windows/simulator.cjs +1 -0
- package/dist/preload/windows/simulator.cjs.map +2 -2
- package/dist/preload/windows/simulator.js +1 -0
- package/dist/render-host/preload.cjs +18 -0
- package/dist/shared/bridge-channels.d.ts +5 -2
- package/dist/simulator/assets/{device-shell-Cs-rmP1f.js → device-shell-Sbkjw8Nb.js} +2 -2
- package/dist/simulator/assets/{simulator-BG-5CADK.js → simulator-CRyLSz1N.js} +3 -3
- package/dist/simulator/assets/{simulator-mini-app-DzfMfnVM.js → simulator-mini-app-w1Bhwkld.js} +2 -2
- package/dist/simulator/simulator.html +1 -1
- package/package.json +5 -5
|
@@ -9618,8 +9618,7 @@ function resolveRootPagePath(manifest, requestedPagePath) {
|
|
|
9618
9618
|
function resolvePageWindowConfig(appConfig, pagePath) {
|
|
9619
9619
|
const normalized = normalizePagePath(pagePath);
|
|
9620
9620
|
const appWindow = appConfig.app?.window ?? {};
|
|
9621
|
-
const
|
|
9622
|
-
const pageWindow = pageEntry?.window ?? {};
|
|
9621
|
+
const pageWindow = appConfig.modules?.[normalized] ?? {};
|
|
9623
9622
|
return {
|
|
9624
9623
|
navigationBarTitleText: pageWindow.navigationBarTitleText ?? appWindow.navigationBarTitleText ?? "",
|
|
9625
9624
|
navigationBarBackgroundColor: pageWindow.navigationBarBackgroundColor ?? appWindow.navigationBarBackgroundColor ?? "#ffffff",
|
|
@@ -2095,8 +2095,7 @@ function resolveRootPagePath(manifest, requestedPagePath) {
|
|
|
2095
2095
|
function resolvePageWindowConfig(appConfig, pagePath) {
|
|
2096
2096
|
const normalized = normalizePagePath(pagePath);
|
|
2097
2097
|
const appWindow = appConfig.app?.window ?? {};
|
|
2098
|
-
const
|
|
2099
|
-
const pageWindow = pageEntry?.window ?? {};
|
|
2098
|
+
const pageWindow = appConfig.modules?.[normalized] ?? {};
|
|
2100
2099
|
return {
|
|
2101
2100
|
navigationBarTitleText: pageWindow.navigationBarTitleText ?? appWindow.navigationBarTitleText ?? '',
|
|
2102
2101
|
navigationBarBackgroundColor: pageWindow.navigationBarBackgroundColor ?? appWindow.navigationBarBackgroundColor ?? '#ffffff',
|
|
@@ -248,6 +248,10 @@ export function createNativeSimulatorView(ctx, reconciler, deps) {
|
|
|
248
248
|
// URL in will-attach (where `params.src` carries the full URL) and consumed
|
|
249
249
|
// FIFO in the matching did-attach — `guestWc.getURL()` is still empty there.
|
|
250
250
|
// Per-attach scope: a fresh simWc + handlers are built on every (re)attach.
|
|
251
|
+
// (The guest's `bgColor` query param — WeChat/Android/Harmony white-flash
|
|
252
|
+
// parity — is consumed entirely outside main: device-shell.tsx's `<webview>`
|
|
253
|
+
// CSS background and render-host/preload.cjs both read it directly, since
|
|
254
|
+
// `WebContents` has no `setBackgroundColor` for main to call here.)
|
|
251
255
|
const pendingGuestIsTab = [];
|
|
252
256
|
simWc.on('will-attach-webview', (_event, webPreferences, params) => {
|
|
253
257
|
;
|
|
@@ -7,6 +7,14 @@ export interface RenderHostUrlOptions {
|
|
|
7
7
|
/** Whether this page is a tabBar page. Surfaced on the URL so main can pick
|
|
8
8
|
* the bottom safe-area policy at `did-attach-webview` (services/safe-area). */
|
|
9
9
|
isTab?: boolean;
|
|
10
|
+
/** The page's resolved `window.backgroundColor` (page ∪ app-level, already
|
|
11
|
+
* defaulted — see `pageBackgroundColor` in page-stack-controller.ts).
|
|
12
|
+
* Surfaced on the URL as `bgColor`: render-host/preload.cjs reads it and
|
|
13
|
+
* primes the guest's own document background before the page's own CSS
|
|
14
|
+
* loads. `WebContents` (the `<webview>` guest) has no `setBackgroundColor`,
|
|
15
|
+
* so main never consumes this — DeviceShell separately primes the host
|
|
16
|
+
* `<webview>` element's own CSS background from the same source. */
|
|
17
|
+
backgroundColor?: string;
|
|
10
18
|
}
|
|
11
19
|
export interface DiminaNativeHostBridge {
|
|
12
20
|
enabled: boolean;
|
|
@@ -57,6 +57,8 @@ function buildBridge(cfg) {
|
|
|
57
57
|
url.searchParams.set('pagePath', opts.pagePath);
|
|
58
58
|
if (opts.isTab)
|
|
59
59
|
url.searchParams.set('isTab', '1');
|
|
60
|
+
if (opts.backgroundColor)
|
|
61
|
+
url.searchParams.set('bgColor', opts.backgroundColor);
|
|
60
62
|
return url.toString();
|
|
61
63
|
},
|
|
62
64
|
renderPreloadUrl: cfg.renderPreloadUrl,
|