; }; onDOMNodeMouseOut = async () => { return highlighter.unhighlight(); }; onInspectIconClick = async grip => { return toolbox.viewElementInInspector(grip, "inspect_dom"); }; } // This is the integration point with Reps. The DomTree is using // Reps to render all values. The code also specifies default rep // used for data types that don't have its own specific template. const renderValue = props => { const repProps = Object.assign({}, props, { onDOMNodeMouseOver, onDOMNodeMouseOut, onInspectIconClick, defaultRep: Grip, cropLimit: 50, }); // Object can be an objectFront, while Rep always expect grips. if (props?.object?.getGrip) { repProps.object = props.object.getGrip(); } return Rep(repProps); }; return TreeView({ columns, decorator: new DomDecorator(), mode: MODE.SHORT, object, onFilter: this.onFilter, openLink, provider: new GripProvider(grips, dispatch), renderValue, // Ensure passing a stable expanded Set, // so that TreeView doesn't reset to default prop's Set // on each new received props. expandedNodes: this.expandedNodes, }); } } const mapStateToProps = state => { return { grips: state.grips, filter: state.filter, }; }; // Exports from this module module.exports = connect(mapStateToProps)(DomTree); PK