@dimina-kit/devtools 0.4.0-dev.20260728095034 → 0.4.0-dev.20260729062524
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/README.md +68 -0
- package/dist/main/api.d.ts +1 -0
- package/dist/main/app/app.d.ts +3 -0
- package/dist/main/app/app.js +8 -0
- package/dist/main/index.bundle.js +185 -7
- package/dist/main/ipc/bridge-router.js +1 -2
- package/dist/main/services/simulator/ui-extensions.d.ts +13 -0
- package/dist/main/services/simulator/ui-extensions.js +166 -0
- package/dist/main/services/views/native-simulator-view.js +7 -0
- package/dist/main/services/views/view-manager.d.ts +5 -0
- package/dist/main/services/workbench-context.d.ts +6 -0
- package/dist/main/services/workbench-context.js +3 -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 +0 -96
- package/dist/preload/windows/main.cjs.map +2 -2
- 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/renderer/assets/{index-BJlFbXHb.js → index-BBg3YI5b.js} +2 -2
- package/dist/renderer/entries/main/index.html +1 -1
- package/dist/shared/bridge-channels.d.ts +5 -2
- package/dist/shared/simulator-ui.d.ts +61 -0
- package/dist/shared/simulator-ui.js +12 -0
- package/dist/shared/types.d.ts +7 -0
- package/dist/simulator/assets/device-shell-BHz1v3Yo.css +1 -0
- package/dist/simulator/assets/device-shell-CH_DMYaz.js +2 -0
- package/dist/simulator/assets/{jsx-runtime-BDTY6fEq.js → jsx-runtime-hBv-rHqQ.js} +2 -2
- package/dist/simulator/assets/{simulator-BG-5CADK.js → simulator-DXraYerh.js} +6 -6
- package/dist/simulator/assets/{simulator-mini-app-DzfMfnVM.js → simulator-mini-app-w1Bhwkld.js} +2 -2
- package/dist/simulator/simulator.html +2 -2
- package/package.json +9 -5
- package/dist/simulator/assets/device-shell-Cs-rmP1f.js +0 -2
- package/dist/simulator/assets/device-shell-DOy53Y0s.css +0 -1
|
@@ -995,6 +995,7 @@ function buildBridge2(cfg) {
|
|
|
995
995
|
url.searchParams.set("appId", opts.appId);
|
|
996
996
|
url.searchParams.set("pagePath", opts.pagePath);
|
|
997
997
|
if (opts.isTab) url.searchParams.set("isTab", "1");
|
|
998
|
+
if (opts.backgroundColor) url.searchParams.set("bgColor", opts.backgroundColor);
|
|
998
999
|
return url.toString();
|
|
999
1000
|
},
|
|
1000
1001
|
renderPreloadUrl: cfg.renderPreloadUrl,
|
|
@@ -9,6 +9,7 @@ const CHANNELS = {
|
|
|
9
9
|
const params = new URLSearchParams(globalThis.location && globalThis.location.search || '')
|
|
10
10
|
const bridgeId = params.get('bridgeId')
|
|
11
11
|
const pagePath = params.get('pagePath') || 'pages/index/index'
|
|
12
|
+
const bgColor = params.get('bgColor')
|
|
12
13
|
const pendingMessages = []
|
|
13
14
|
let onMessageFn = null
|
|
14
15
|
let drainScheduled = false
|
|
@@ -17,6 +18,23 @@ if (!bridgeId) {
|
|
|
17
18
|
throw new Error('[render-host] missing bridgeId in URL query')
|
|
18
19
|
}
|
|
19
20
|
|
|
21
|
+
// WeChat parity: prime the page's OWN document with its configured
|
|
22
|
+
// `window.backgroundColor` before pageFrame.css / @dimina/render load — mirrors
|
|
23
|
+
// the real dimina/fe container's `webview.js` (`applyPageStyle()` sets
|
|
24
|
+
// `root.style.backgroundColor` before the inner iframe navigates). Without
|
|
25
|
+
// this the guest's document background is UA-default white until the page's
|
|
26
|
+
// own CSS paints, which is the white flash on every page transition. Applied
|
|
27
|
+
// as early as the preload can reach `document.documentElement` and again on
|
|
28
|
+
// DOMContentLoaded in case the element wasn't attached yet.
|
|
29
|
+
if (bgColor) {
|
|
30
|
+
const applyBackgroundColor = () => {
|
|
31
|
+
if (document.documentElement) document.documentElement.style.backgroundColor = bgColor
|
|
32
|
+
if (document.body) document.body.style.backgroundColor = bgColor
|
|
33
|
+
}
|
|
34
|
+
applyBackgroundColor()
|
|
35
|
+
globalThis.addEventListener('DOMContentLoaded', applyBackgroundColor)
|
|
36
|
+
}
|
|
37
|
+
|
|
20
38
|
function reportError(stage, error) {
|
|
21
39
|
const message = error && error.stack ? error.stack : String(error)
|
|
22
40
|
console.error(`[render-host] ${stage}`, error)
|