@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
package/dist/simulator/assets/{simulator-mini-app-DzfMfnVM.js → simulator-mini-app-w1Bhwkld.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./bridge-channels-zhsumfky.js";var t=class{appId;scene;pagePath;query;apiRegistry={};appSessionId=null;bridgeId=null;resourceBaseUrl=null;serviceWcId=null;manifest=null;rootWindowConfig=null;platform;apiNamespaces;currentDevice=null;unsubscribeDeviceChange=null;constructor(e){this.appId=e.appId,this.scene=e.scene,this.pagePath=e.pagePath,this.query={...e.query??{}},this.apiNamespaces=e.apiNamespaces??[],this.platform=e.platform??`ios`}registerApi(e,t){this.apiRegistry[e]=t}invokeApi(e,t){let n=this.apiRegistry[e];if(n)return n.call(this,t)}async spawn(){let t=n();this.unsubscribeDeviceChange??=t.onSimulatorEvent(e.DEVICE_CHANGE,e=>{this.currentDevice=e});let r=await t.spawn({appId:this.appId,scene:this.scene,pagePath:this.pagePath,query:this.query,apiNamespaces:this.apiNamespaces,hostEnvSnapshot:this.getHostEnvSnapshot(),resourceBaseUrl:`${window.location.origin}/`});return this.appSessionId=r.appSessionId,this.bridgeId=r.bridgeId,this.resourceBaseUrl=r.resourceBaseUrl,this.serviceWcId=r.serviceWcId,this.manifest=r.manifest,this.rootWindowConfig=r.rootWindowConfig,this.pagePath=r.resolvedPagePath,r.bridgeId}dispose(){this.unsubscribeDeviceChange?.(),this.unsubscribeDeviceChange=null,this.currentDevice=null,this.appSessionId&&(n().dispose(this.appSessionId),this.appSessionId=null,this.bridgeId=null,this.resourceBaseUrl=null,this.serviceWcId=null,this.manifest=null,this.rootWindowConfig=null)}async openPage(e,t={}){let r=this.requireAppSessionId();return n().openPage({appSessionId:r,pagePath:e,query:t})}closePage(e){this.appSessionId&&n().closePage(e)}notifyLifecycle(e,t){let r=this.appSessionId;r&&n().notifyLifecycle({appSessionId:r,bridgeId:e,event:t})}notifyNavCallback(e){let t=this.appSessionId;t&&n().notifyNavCallback({appSessionId:t,...e})}notifyApiResponse(e){let t=this.appSessionId;t&&n().notifyApiResponse({appSessionId:t,...e})}notifyActivePage(e){let t=this.appSessionId;t&&n().notifyActivePage({appSessionId:t,bridgeId:e})}notifyPageStack(e){let t=this.appSessionId;t&&n().notifyPageStack({appSessionId:t,stack:e})}getTabBarConfig(){return this.manifest?.tabBar??null}getInitialDevice(){return n().device??null}getDeviceMetrics(){let e=this.currentDevice??this.getInitialDevice();if(e)return{pixelRatio:e.pixelRatio,screenWidth:e.screenWidth,screenHeight:e.screenHeight,statusBarHeight:e.statusBarHeight,safeAreaInsets:e.safeAreaInsets};let t=this.getHostEnvSnapshot();return{pixelRatio:t.pixelRatio,screenWidth:t.screenWidth,screenHeight:t.screenHeight,statusBarHeight:t.statusBarHeight,safeAreaInsets:{top:0,right:0,bottom:0,left:0}}}getHostEnvSnapshot(){let e=this.getInitialDevice(),t=e?.screenWidth??390,n=e?.screenHeight??844,i=e?.pixelRatio??2,a=navigator.language||`zh-CN`,o=e?.statusBarHeight??(this.platform===`ios`?44:24);return{brand:this.platform===`ios`?`iPhone`:`Android`,model:this.platform===`ios`?`iPhone`:`Android`,platform:this.platform,system:this.platform===`ios`?`iOS 16.0`:`Android 13`,version:`8.0.5`,SDKVersion:`3.0.0`,pixelRatio:i,screenWidth:t,screenHeight:n,windowWidth:t,windowHeight:n,statusBarHeight:o,language:a,theme:r()?`dark`:`light`}}createRenderHostUrl(e,t,r){return n().createRenderHostUrl({bridgeId:e,appId:this.appId,pagePath:t??this.pagePath,isTab:r})}getRenderPreloadUrl(){return n().renderPreloadUrl}onSimulatorEvent(e,t){return n().onSimulatorEvent(e,t)}onSessionEvent(e,t){return this.onSimulatorEvent(e,e=>{let n=e?.appSessionId;typeof n==`string`&&n!==this.appSessionId||t(e)})}requireAppSessionId(){if(!this.appSessionId)throw Error(`[simulator] miniApp has not been spawned yet`);return this.appSessionId}};function n(){let e=window.__diminaNativeHost;if(!e)throw Error(`[simulator] native host bridge is unavailable`);return e}function r(){return window.matchMedia?.(`(prefers-color-scheme: dark)`).matches??!1}export{t as SimulatorMiniApp};
|
|
2
|
-
//# sourceMappingURL=simulator-mini-app-
|
|
1
|
+
import{t as e}from"./bridge-channels-zhsumfky.js";var t=class{appId;scene;pagePath;query;apiRegistry={};appSessionId=null;bridgeId=null;resourceBaseUrl=null;serviceWcId=null;manifest=null;rootWindowConfig=null;platform;apiNamespaces;currentDevice=null;unsubscribeDeviceChange=null;constructor(e){this.appId=e.appId,this.scene=e.scene,this.pagePath=e.pagePath,this.query={...e.query??{}},this.apiNamespaces=e.apiNamespaces??[],this.platform=e.platform??`ios`}registerApi(e,t){this.apiRegistry[e]=t}invokeApi(e,t){let n=this.apiRegistry[e];if(n)return n.call(this,t)}async spawn(){let t=n();this.unsubscribeDeviceChange??=t.onSimulatorEvent(e.DEVICE_CHANGE,e=>{this.currentDevice=e});let r=await t.spawn({appId:this.appId,scene:this.scene,pagePath:this.pagePath,query:this.query,apiNamespaces:this.apiNamespaces,hostEnvSnapshot:this.getHostEnvSnapshot(),resourceBaseUrl:`${window.location.origin}/`});return this.appSessionId=r.appSessionId,this.bridgeId=r.bridgeId,this.resourceBaseUrl=r.resourceBaseUrl,this.serviceWcId=r.serviceWcId,this.manifest=r.manifest,this.rootWindowConfig=r.rootWindowConfig,this.pagePath=r.resolvedPagePath,r.bridgeId}dispose(){this.unsubscribeDeviceChange?.(),this.unsubscribeDeviceChange=null,this.currentDevice=null,this.appSessionId&&(n().dispose(this.appSessionId),this.appSessionId=null,this.bridgeId=null,this.resourceBaseUrl=null,this.serviceWcId=null,this.manifest=null,this.rootWindowConfig=null)}async openPage(e,t={}){let r=this.requireAppSessionId();return n().openPage({appSessionId:r,pagePath:e,query:t})}closePage(e){this.appSessionId&&n().closePage(e)}notifyLifecycle(e,t){let r=this.appSessionId;r&&n().notifyLifecycle({appSessionId:r,bridgeId:e,event:t})}notifyNavCallback(e){let t=this.appSessionId;t&&n().notifyNavCallback({appSessionId:t,...e})}notifyApiResponse(e){let t=this.appSessionId;t&&n().notifyApiResponse({appSessionId:t,...e})}notifyActivePage(e){let t=this.appSessionId;t&&n().notifyActivePage({appSessionId:t,bridgeId:e})}notifyPageStack(e){let t=this.appSessionId;t&&n().notifyPageStack({appSessionId:t,stack:e})}getTabBarConfig(){return this.manifest?.tabBar??null}getInitialDevice(){return n().device??null}getDeviceMetrics(){let e=this.currentDevice??this.getInitialDevice();if(e)return{pixelRatio:e.pixelRatio,screenWidth:e.screenWidth,screenHeight:e.screenHeight,statusBarHeight:e.statusBarHeight,safeAreaInsets:e.safeAreaInsets};let t=this.getHostEnvSnapshot();return{pixelRatio:t.pixelRatio,screenWidth:t.screenWidth,screenHeight:t.screenHeight,statusBarHeight:t.statusBarHeight,safeAreaInsets:{top:0,right:0,bottom:0,left:0}}}getHostEnvSnapshot(){let e=this.getInitialDevice(),t=e?.screenWidth??390,n=e?.screenHeight??844,i=e?.pixelRatio??2,a=navigator.language||`zh-CN`,o=e?.statusBarHeight??(this.platform===`ios`?44:24);return{brand:this.platform===`ios`?`iPhone`:`Android`,model:this.platform===`ios`?`iPhone`:`Android`,platform:this.platform,system:this.platform===`ios`?`iOS 16.0`:`Android 13`,version:`8.0.5`,SDKVersion:`3.0.0`,pixelRatio:i,screenWidth:t,screenHeight:n,windowWidth:t,windowHeight:n,statusBarHeight:o,language:a,theme:r()?`dark`:`light`}}createRenderHostUrl(e,t,r,i){return n().createRenderHostUrl({bridgeId:e,appId:this.appId,pagePath:t??this.pagePath,isTab:r,backgroundColor:i})}getRenderPreloadUrl(){return n().renderPreloadUrl}onSimulatorEvent(e,t){return n().onSimulatorEvent(e,t)}onSessionEvent(e,t){return this.onSimulatorEvent(e,e=>{let n=e?.appSessionId;typeof n==`string`&&n!==this.appSessionId||t(e)})}requireAppSessionId(){if(!this.appSessionId)throw Error(`[simulator] miniApp has not been spawned yet`);return this.appSessionId}};function n(){let e=window.__diminaNativeHost;if(!e)throw Error(`[simulator] native host bridge is unavailable`);return e}function r(){return window.matchMedia?.(`(prefers-color-scheme: dark)`).matches??!1}export{t as SimulatorMiniApp};
|
|
2
|
+
//# sourceMappingURL=simulator-mini-app-w1Bhwkld.js.map
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
7
|
<title>Dimina DevTools Simulator</title>
|
|
8
8
|
<style>html, body { overflow: hidden; height: 100%; margin: 0; }</style>
|
|
9
|
-
<script type="module" crossorigin src="/simulator/assets/simulator-
|
|
9
|
+
<script type="module" crossorigin src="/simulator/assets/simulator-CRyLSz1N.js"></script>
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/simulator/assets/jsx-runtime-BDTY6fEq.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/simulator/assets/bridge-channels-zhsumfky.js">
|
|
12
12
|
</head>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dimina-kit/devtools",
|
|
3
|
-
"version": "0.4.0-dev.
|
|
3
|
+
"version": "0.4.0-dev.20260728110120",
|
|
4
4
|
"description": "Dimina DevTools - modular developer tools for mini app debugging",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dimina",
|
|
@@ -85,10 +85,10 @@
|
|
|
85
85
|
"chrome-remote-interface": "^0.34.0",
|
|
86
86
|
"ws": "^8.20.0",
|
|
87
87
|
"zod": "^4.3.6",
|
|
88
|
-
"@dimina-kit/devkit": "0.1.2-dev.
|
|
89
|
-
"@dimina-kit/
|
|
90
|
-
"@dimina-kit/
|
|
91
|
-
"@dimina-kit/
|
|
88
|
+
"@dimina-kit/devkit": "0.1.2-dev.20260728110120",
|
|
89
|
+
"@dimina-kit/electron-deck": "0.1.0-dev.20260728110120",
|
|
90
|
+
"@dimina-kit/view-anchor": "0.1.0-dev.20260728110120",
|
|
91
|
+
"@dimina-kit/inspect": "0.4.0-dev.20260728110120"
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
94
94
|
"@playwright/test": "^1.59.1",
|