@gjsify/devtools-nativescript 0.59.0 → 0.60.0
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/lib/esm/view-tree.js +1 -1
- package/package.json +5 -5
package/lib/esm/view-tree.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";function parseViewPath(e){let t=e.split(`/`).filter(e=>e.length>0);if(t.length===0)return null;let n=t[0].match(/^toplevel:(\d+)$/);if(!n)return null;let r=[];for(let e of t.slice(1)){let t=e.match(/^child:(\d+)$/);if(!t)return null;r.push(Number(t[1]))}return{toplevel:Number(n[1]),children:r}}function buildViewPath(e,t){return[`toplevel:${e}`,...t.map(e=>`child:${e}`)].join(`/`)}function viewType(e){
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";function parseViewPath(e){let t=e.split(`/`).filter(e=>e.length>0);if(t.length===0)return null;let n=t[0].match(/^toplevel:(\d+)$/);if(!n)return null;let r=[];for(let e of t.slice(1)){let t=e.match(/^child:(\d+)$/);if(!t)return null;r.push(Number(t[1]))}return{toplevel:Number(n[1]),children:r}}function buildViewPath(e,t){return[`toplevel:${e}`,...t.map(e=>`child:${e}`)].join(`/`)}function viewType(e){if(typeof e.typeName==`string`&&e.typeName)return e.typeName;let t=e.constructor;return t&&Object.hasOwn(t,`GTypeName`)&&typeof t.GTypeName==`string`?t.GTypeName:t?.name??`View`}function viewName(e){return e.automationText||e.id||null}function viewCssClasses(e){let t=e.cssClasses;return t instanceof Set||Array.isArray(t)?[...t]:typeof e.className==`string`&&e.className?e.className.split(/\s+/).filter(Boolean):[]}function viewVisible(e){return typeof e.visibility==`string`?e.visibility===`visible`:!0}function childViews(e){let t=[];return typeof e.eachChildView==`function`&&e.eachChildView(e=>(t.push(e),!0)),t}function viewText(e){return typeof e.text==`string`&&e.text!==``?e.text:null}function rootView(e,t){return e?.getRootView?.()||(t?.topmost?.()?.currentPage??null)}function listToplevels(e){return e?[{path:`toplevel:0`,type:viewType(e),title:viewText(e),mapped:e.isLoaded??!0,focused:!0}]:[]}function resolveViewPath(e,t){let n=parseViewPath(t);if(!n||n.toplevel!==0||!e)return null;let r=e;for(let e of n.children)if(r=childViews(r)[e]??null,!r)return null;return r}function dumpTree(e,t,n){let r=viewText(e),i={path:n,type:viewType(e),name:viewName(e),cssClasses:viewCssClasses(e),mapped:e.isLoaded??!0,visible:viewVisible(e),children:[]};if(r!==null&&(i.props={text:r}),t<=0)return i;let a=childViews(e);for(let e=0;e<a.length;e++)i.children.push(dumpTree(a[e],t-1,`${n}/child:${e}`));return i}function jsonSafe(e){let t=typeof e;return e==null||t===`string`||t===`number`||t===`boolean`?e??null:`[${t}]`}function readViewProperty(e,t){let n=e,r=t.replace(/-/g,`_`),i=t.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase());for(let e of[t,r,i])if(e in n)return jsonSafe(n[e])}export{buildViewPath,dumpTree,listToplevels,parseViewPath,readViewProperty,resolveViewPath,rootView,viewType};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/devtools-nativescript",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.60.0",
|
|
4
4
|
"description": "In-app NativeScript devtools agent — exposes a running NS app's view tree + screenshots to the @gjsify/devtools-mcp bridge over the V8 CDP inspector (org.gjsify.Devtools method registry)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"ios"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@gjsify/devtools-protocol": "^0.
|
|
42
|
-
"@gjsify/native-platform": "^0.
|
|
41
|
+
"@gjsify/devtools-protocol": "^0.60.0",
|
|
42
|
+
"@gjsify/native-platform": "^0.60.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@nativescript/core": "*"
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@gjsify/cli": "^0.
|
|
54
|
-
"@gjsify/unit": "^0.
|
|
53
|
+
"@gjsify/cli": "^0.60.0",
|
|
54
|
+
"@gjsify/unit": "^0.60.0",
|
|
55
55
|
"@nativescript/types": "~9.0.0",
|
|
56
56
|
"@types/node": "^25.9.2",
|
|
57
57
|
"typescript": "^6.0.3"
|