Select the types of activity you want to include in your feed.
Add a new outliner panel to the editor.
Initial pass on adding an outliner, showing all objects in the scene and allowing users to click to select them, even objects without a physical representation on screen like Anchors and Groups.
···11+class Outliner {
22+ constructor(panel, editor) {
33+ this.panel = panel;
44+ this.editor = editor;
55+ }
66+77+ updatePanel() {
88+ // Loop over children of scene and populate lists
99+ const list = document.getElementById( "outliner-list" );
1010+ list.innerHTML = ""; // Clear the list
1111+1212+ const li = this.listify( this.editor.scene );
1313+ if ( li ) {
1414+ list.appendChild( li );
1515+ }
1616+ }
1717+1818+ // Take a Zdog object, produce a list element.
1919+ // if this object has children, this list element has another list nested inside.
2020+ // this function is called recursively.
2121+ listify(obj) {
2222+ if (obj.compositeChild) return null;
2323+ const li = document.createElement( "li" );
2424+ li.setAttribute( "data-type", obj.constructor.type );
2525+ li.obj = obj;
2626+ li.style.setProperty( "--color", obj.color || "#333" );
2727+2828+ const icon = document.createElement( "span" );
2929+ icon.classList.add( "icon" );
3030+3131+ const label = document.createElement( "span" );
3232+ label.classList.add( "name" );
3333+3434+ const name = document.createTextNode( obj.name || obj.constructor.type );
3535+3636+ label.appendChild( icon );
3737+ label.appendChild( name );
3838+ li.appendChild( label );
3939+4040+ label.onclick = () => this.editor.do(new SelectCommand( this.editor, obj, true ));
4141+4242+ let children = obj.children.map( this.listify.bind( this ) );
4343+ children = children.filter( child => child !== null );
4444+4545+ if ( children.length === 0 ) {
4646+ return li;
4747+ }
4848+4949+ const list = document.createElement( "ul" );
5050+ children.forEach( child => {
5151+ list.appendChild( child );
5252+ });
5353+ li.appendChild( list );
5454+5555+ return li;
5656+ }
5757+5858+ updateHighlights() {
5959+ const list = document.getElementById( "outliner-list" );
6060+ const items = list.querySelectorAll( "li" );
6161+ items.forEach( item => {
6262+ if ( this.editor.selection.indexOf( item.obj ) !== -1 ) {
6363+ item.classList.add( "selected" );
6464+ } else {
6565+ item.classList.remove( "selected" );
6666+ }
6767+ });
6868+ }
6969+}
+1-1
properties.js
···173173 targets.forEach( (target) => {
174174 target[propElem.id] = value;
175175 // TODO: Add additional type information to props so we can check if we actually need to do this.
176176- if (t.updatePath) target.updatePath();
176176+ if (target.updatePath) target.updatePath();
177177 });
178178 }
179179