ant-devtools-frontend
Advanced tools
Comparing version 0.3.1 to 0.3.2
{ | ||
"name": "ant-devtools-frontend", | ||
"description": "Ant DevTools UI From Chrome", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -31,3 +31,3 @@ let mainTinyModel;const win=window;Ant.makeProxyPromiseOnce=(method,payload,callback)=>new Promise((resolve,reject)=>{window.sendToHost('render',{method,payload,});window.listenToHostOnce(`render-${method}`,(event,args)=>{const{payload}=args;if(callback&&(typeof callback)==='function') | ||
nodeForId(nodeId){return this._idToDOMNode[nodeId]||null;} | ||
propsModified(nodeId,props){const node=this._idToDOMNode[nodeId];if(!node) | ||
propsModified(nodeId,props){const node=this._idToDOMNode[nodeId];if(!node||node._localName==='swiper-item') | ||
return;Ant.combinedProps(node,props,this);this._scheduleMutationEvent(node);} | ||
@@ -222,6 +222,11 @@ _attributeModified(nodeId,name,value){var node=this._idToDOMNode[nodeId];if(name==='class'||name==='className'){name='className';value.replace(/a-[a-z]*/,'').trim();if(!value) | ||
get(path){return this._targets.get(path);}};Ant.TargetManager.Events={switchTarget:Symbol('ant-switchTarget'),};Ant.targetManager=new Ant.TargetManager();;Ant.ElementsTreeOutline=class extends Elements.ElementsTreeOutline{_updateModifiedParentNode(node){const self=this;var parentTreeElement=this.findTreeElement(node);function getData(children){return children.map(child=>({backendNodeId:child._backendNodeId,nodeId:child.id,}));} | ||
async function callback({data}){let j=0;const agent=Ant.targetManager.getCurrentTarget().domAgent();for(const i in node._children){let child=node._children[i];if(!child)continue;if(data&&data[j]&&!child._nodeValue){child=Ant.combineNativeAndReactDom(child,data[j++]);if(Ant.spanTags.has(child._localName)||(child._localName==='label'&&child._textChildren)){let textNode;if(child._localName==='text'||(child._localName==='label'&&child._textChildren)){await agent.requestChildNodes(child.id,1);textNode=child.children()[1];}else{const id=await agent.querySelector(child.id,'span');textNode=Ant.DOMNode.create(Ant.targetManager.getCurrentModel(),child._document,false,{nodeId:id+1,backendNodeId:id,nodeValue:child._textValue,nodeType:3,childNodeCount:0,localName:'',nodeName:'#text',});} | ||
async function callback({data}){let j=0;const agent=Ant.targetManager.getCurrentTarget().domAgent();if(node._localName==='picker-view-column') | ||
return this._updateChildren(parentTreeElement);if(node._localName==='picker-view'){await agent.requestChildNodes(node.id,3);if(node._children[0]._localName!=='picker-view-column'){for(const i in node._children){node._children[i]._attributes=[];node._children[i]._attributesMap={};node._children[i]._localName='picker-view-column';node._children[i]._nodeName='picker-view-column'.toUpperCase();node._children[i]._children=node._children[i]._children[2]._children;node._children[i]._children.forEach(child=>{child._attributes=[];child._attributesMap={};child._localName='picker-view-item';child._nodeName='picker-view-item'.toUpperCase();});}} | ||
return this._updateChildren(parentTreeElement);} | ||
if(node._localName==='swiper'){await agent.requestChildNodes(node.id,4);try{const ul=Ant.findUL(node);node._children=ul._children.map(child=>{child._attributes=[];child._attributesMap={};child._localName='swiper-item';child._nodeName='swiper-item'.toUpperCase();return child;});}catch(e){} | ||
return this._updateChildren(parentTreeElement);} | ||
for(const i in node._children){let child=node._children[i];if(!child)continue;if(data&&data[j]&&!child._nodeValue){child=Ant.combineNativeAndReactDom(child,data[j++]);if(Ant.spanTags.has(child._localName)||(child._localName==='label'&&child._textChildren)){let textNode;if(child._localName==='text'||(child._localName==='label'&&child._textChildren)){await agent.requestChildNodes(child.id,1);textNode=child.children()[1];}else{const id=await agent.querySelector(child.id,'span');textNode=Ant.DOMNode.create(Ant.targetManager.getCurrentModel(),child._document,false,{nodeId:id+1,backendNodeId:id,nodeValue:child._textValue,nodeType:3,childNodeCount:0,localName:'',nodeName:'#text',});} | ||
if(textNode){child.firstChild=textNode;child._children=[textNode];child.lastChild=textNode;}}}} | ||
this._updateChildren(parentTreeElement);} | ||
if(parentTreeElement){parentTreeElement.setExpandable(this._hasVisibleChildren(node));parentTreeElement.updateTitle(this._updateRecordForHighlight(node));if(parentTreeElement.populated){node.getChildNodes(children=>{if(!children)return;Ant.makeProxyPromiseOnce('setChildNodeIdOnce',{parentId:node.id,payloads:getData(children)},callback.bind(self));});}}} | ||
if(parentTreeElement){parentTreeElement.setExpandable(this._hasVisibleChildren(node));parentTreeElement.updateTitle(this._updateRecordForHighlight(node));if(parentTreeElement.populated){node.getChildNodes(children=>{if(!children)return;Ant.makeProxyPromiseOnce('setChildNodeIdOnce',{parentId:node.id,nodeType:node._localName,payloads:getData(children)},callback.bind(self));});}}} | ||
_updateChildren(treeElement){if(!treeElement.isExpandable()){var selectedTreeElement=treeElement.treeOutline.selectedTreeElement;if(selectedTreeElement&&selectedTreeElement.hasAncestor(treeElement)) | ||
@@ -231,2 +236,2 @@ treeElement.select(true);treeElement.removeChildren();return;} | ||
if(typeof value==='string'){keyValue.value=value;}else if(typeof value==='object'){Object.keys(value).forEach(property=>{keyValue.value+=`${property}: ${value[property]};`;});}else{keyValue.value+=`${String(value)}`;} | ||
keyValue._node=dom;obj.push(keyValue);objMap[key]=keyValue;});dom._attributes=obj;dom._attributesMap=objMap;return dom;};Ant.spanTags=new Set(['button','text']);; | ||
keyValue._node=dom;obj.push(keyValue);objMap[key]=keyValue;});dom._attributes=obj;dom._attributesMap=objMap;return dom;};Ant.findUL=element=>{if(element._localName==='ul')return element;return Ant.findUL(element._children[0]);};Ant.spanTags=new Set(['button','text']);; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6933546
48084