@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.
@@ -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 pageEntry = appConfig.modules?.[normalized];
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 pageEntry = appConfig.modules?.[normalized];
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,