diff --git a/blockly_compressed.js b/blockly_compressed.js index 55a0666e6..8afdcde2d 100644 --- a/blockly_compressed.js +++ b/blockly_compressed.js @@ -734,152 +734,7 @@ goog.ui.Menu.prototype.setAllowHighlightDisabled=function(a){this.allowHighlight goog.ui.Menu.prototype.handleEnterItem=function(a){this.allowAutoFocus_&&this.getKeyEventTarget().focus();return goog.ui.Menu.superClass_.handleEnterItem.call(this,a)};goog.ui.Menu.prototype.highlightNextPrefix=function(a){var b=new RegExp("^"+goog.string.regExpEscape(a),"i");return this.highlightHelper(function(a,d){var c=0>a?0:a,f=!1;do{++a;a==d&&(a=0,f=!0);var g=this.getChildAt(a).getCaption();if(g&&g.match(b))return a}while(!f||a!=c);return this.getHighlightedIndex()},this.getHighlightedIndex())}; goog.ui.Menu.prototype.canHighlightItem=function(a){return(this.allowHighlightDisabled_||a.isEnabled())&&a.isVisible()&&a.isSupportedState(goog.ui.Component.State.HOVER)};goog.ui.Menu.prototype.decorateInternal=function(a){this.decorateContent(a);goog.ui.Menu.superClass_.decorateInternal.call(this,a)}; goog.ui.Menu.prototype.handleKeyEventInternal=function(a){var b=goog.ui.Menu.superClass_.handleKeyEventInternal.call(this,a);b||this.forEachChild(function(c){!b&&c.getMnemonic&&c.getMnemonic()==a.keyCode&&(this.isEnabled()&&this.setHighlighted(c),b=c.handleKeyEvent(a))},this);return b};goog.ui.Menu.prototype.setHighlightedIndex=function(a){goog.ui.Menu.superClass_.setHighlightedIndex.call(this,a);(a=this.getChildAt(a))&&goog.style.scrollIntoContainerView(a.getElement(),this.getElement())}; -goog.ui.Menu.prototype.decorateContent=function(a){var b=this.getRenderer();a=this.getDomHelper().getElementsByTagNameAndClass("DIV",b.getCssClass()+"-content",a);for(var c=a.length,d=0;d")}a.stack+="\n\n"+b.join("\n")}}; -goog.Promise.prototype.removeUnhandledRejection_=function(){if(0goog.Timer.MAX_TIMEOUT_?goog.Timer.INVALID_TIMEOUT_ID_:goog.Timer.defaultTimerObject.setTimeout(a,b||0)};goog.Timer.clear=function(a){goog.Timer.defaultTimerObject.clearTimeout(a)}; -goog.Timer.promise=function(a,b){var c=null;return(new goog.Promise(function(d,e){c=goog.Timer.callOnce(function(){d(b)},a);c==goog.Timer.INVALID_TIMEOUT_ID_&&e(Error("Failed to schedule timer."))})).thenCatch(function(a){goog.Timer.clear(c);throw a;})};goog.string.StringBuffer=function(a,b){null!=a&&this.append.apply(this,arguments)};goog.string.StringBuffer.prototype.buffer_="";goog.string.StringBuffer.prototype.set=function(a){this.buffer_=""+a};goog.string.StringBuffer.prototype.append=function(a,b,c){this.buffer_+=String(a);if(null!=b)for(var d=1;da&&(a=this.computeDepth_(),this.setDepth_(a));return a};goog.ui.tree.BaseNode.prototype.computeDepth_=function(){var a=this.getParent();return a?a.getDepth()+1:0}; -goog.ui.tree.BaseNode.prototype.setDepth_=function(a){if(a!=this.depth_){this.depth_=a;var b=this.getRowElement();if(b){var c=this.getPixelIndent_()+"px";this.isRightToLeft()?b.style.paddingRight=c:b.style.paddingLeft=c}this.forEachChild(function(b){b.setDepth_(a+1)})}};goog.ui.tree.BaseNode.prototype.contains=function(a){for(;a;){if(a==this)return!0;a=a.getParent()}return!1};goog.ui.tree.BaseNode.EMPTY_CHILDREN_=[]; -goog.ui.tree.BaseNode.prototype.getChildren=function(){var a=[];this.forEachChild(function(b){a.push(b)});return a};goog.ui.tree.BaseNode.prototype.getFirstChild=function(){return this.getChildAt(0)};goog.ui.tree.BaseNode.prototype.getLastChild=function(){return this.getChildAt(this.getChildCount()-1)};goog.ui.tree.BaseNode.prototype.getPreviousSibling=function(){return this.previousSibling_};goog.ui.tree.BaseNode.prototype.getNextSibling=function(){return this.nextSibling_}; -goog.ui.tree.BaseNode.prototype.isLastSibling=function(){return!this.nextSibling_};goog.ui.tree.BaseNode.prototype.isSelected=function(){return this.selected_};goog.ui.tree.BaseNode.prototype.select=function(){var a=this.getTree();a&&a.setSelectedItem(this)};goog.ui.tree.BaseNode.prototype.deselect=goog.nullFunction; -goog.ui.tree.BaseNode.prototype.setSelectedInternal=function(a){if(this.selected_!=a){this.selected_=a;this.updateRow();var b=this.getElement();b&&(goog.a11y.aria.setState(b,"selected",a),a&&(a=this.getTree().getElement(),goog.asserts.assert(a,"The DOM element for the tree cannot be null"),goog.a11y.aria.setState(a,"activedescendant",this.getId())))}};goog.ui.tree.BaseNode.prototype.getExpanded=function(){return this.expanded_}; -goog.ui.tree.BaseNode.prototype.setExpandedInternal=function(a){this.expanded_=a}; -goog.ui.tree.BaseNode.prototype.setExpanded=function(a){var b=a!=this.expanded_;if(!b||this.dispatchEvent(a?goog.ui.tree.BaseNode.EventType.BEFORE_EXPAND:goog.ui.tree.BaseNode.EventType.BEFORE_COLLAPSE)){this.expanded_=a;var c=this.getTree();var d=this.getElement();if(this.hasChildren()){if(!a&&c&&this.contains(c.getSelectedItem())&&this.select(),d){if(c=this.getChildrenElement())if(goog.style.setElementShown(c,a),goog.a11y.aria.setState(d,goog.a11y.aria.State.EXPANDED,a),a&&this.isInDocument()&& -!c.hasChildNodes()){var e=[];this.forEachChild(function(a){e.push(a.toSafeHtml())});goog.dom.safe.setInnerHtml(c,goog.html.SafeHtml.concat(e));this.forEachChild(function(a){a.enterDocument()})}this.updateExpandIcon()}}else(c=this.getChildrenElement())&&goog.style.setElementShown(c,!1);d&&this.updateIcon_();b&&this.dispatchEvent(a?goog.ui.tree.BaseNode.EventType.EXPAND:goog.ui.tree.BaseNode.EventType.COLLAPSE)}};goog.ui.tree.BaseNode.prototype.toggle=function(){this.setExpanded(!this.getExpanded())}; -goog.ui.tree.BaseNode.prototype.expand=function(){this.setExpanded(!0)};goog.ui.tree.BaseNode.prototype.collapse=function(){this.setExpanded(!1)};goog.ui.tree.BaseNode.prototype.collapseChildren=function(){this.forEachChild(function(a){a.collapseAll()})};goog.ui.tree.BaseNode.prototype.collapseAll=function(){this.collapseChildren();this.collapse()};goog.ui.tree.BaseNode.prototype.expandChildren=function(){this.forEachChild(function(a){a.expandAll()})}; -goog.ui.tree.BaseNode.prototype.expandAll=function(){this.expandChildren();this.expand()};goog.ui.tree.BaseNode.prototype.reveal=function(){var a=this.getParent();a&&(a.setExpanded(!0),a.reveal())};goog.ui.tree.BaseNode.prototype.setIsUserCollapsible=function(a){(this.isUserCollapsible_=a)||this.expand();this.getElement()&&this.updateExpandIcon()};goog.ui.tree.BaseNode.prototype.isUserCollapsible=function(){return this.isUserCollapsible_}; -goog.ui.tree.BaseNode.prototype.toSafeHtml=function(){var a=this.getTree(),b=!a.getShowLines()||a==this.getParent()&&!a.getShowRootLines()?this.config_.cssChildrenNoLines:this.config_.cssChildren;a=this.getExpanded()&&this.hasChildren();b={"class":b,style:this.getLineStyle()};var c=[];a&&this.forEachChild(function(a){c.push(a.toSafeHtml())});a=goog.html.SafeHtml.create("div",b,c);return goog.html.SafeHtml.create("div",{"class":this.config_.cssItem,id:this.getId()},[this.getRowSafeHtml(),a])}; -goog.ui.tree.BaseNode.prototype.getPixelIndent_=function(){return Math.max(0,(this.getDepth()-1)*this.config_.indentWidth)};goog.ui.tree.BaseNode.prototype.getRowSafeHtml=function(){var a={};a["padding-"+(this.isRightToLeft()?"right":"left")]=this.getPixelIndent_()+"px";a={"class":this.getRowClassName(),style:a};var b=[this.getExpandIconSafeHtml(),this.getIconSafeHtml(),this.getLabelSafeHtml()];return goog.html.SafeHtml.create("div",a,b)}; -goog.ui.tree.BaseNode.prototype.getRowClassName=function(){var a=this.isSelected()?" "+this.config_.cssSelectedRow:"";return this.config_.cssTreeRow+a};goog.ui.tree.BaseNode.prototype.getLabelSafeHtml=function(){var a=goog.html.SafeHtml.create("span",{"class":this.config_.cssItemLabel,title:this.getToolTip()||null},this.getSafeHtml());return goog.html.SafeHtml.concat(a,goog.html.SafeHtml.create("span",{},this.getAfterLabelSafeHtml()))};goog.ui.tree.BaseNode.prototype.getAfterLabelHtml=function(){return goog.html.SafeHtml.unwrap(this.getAfterLabelSafeHtml())}; -goog.ui.tree.BaseNode.prototype.getAfterLabelSafeHtml=function(){return this.afterLabelHtml_};goog.ui.tree.BaseNode.prototype.setAfterLabelSafeHtml=function(a){this.afterLabelHtml_=a;var b=this.getAfterLabelElement();b&&goog.dom.safe.setInnerHtml(b,a)};goog.ui.tree.BaseNode.prototype.getIconSafeHtml=function(){return goog.html.SafeHtml.create("span",{style:{display:"inline-block"},"class":this.getCalculatedIconClass()})};goog.ui.tree.BaseNode.prototype.getCalculatedIconClass=goog.abstractMethod; -goog.ui.tree.BaseNode.prototype.getExpandIconSafeHtml=function(){return goog.html.SafeHtml.create("span",{type:"expand",style:{display:"inline-block"},"class":this.getExpandIconClass()})}; -goog.ui.tree.BaseNode.prototype.getExpandIconClass=function(){var a=this.getTree(),b=!a.getShowLines()||a==this.getParent()&&!a.getShowRootLines(),c=this.config_,d=new goog.string.StringBuffer;d.append(c.cssTreeIcon," ",c.cssExpandTreeIcon," ");if(this.hasChildren()){var e=0;a.getShowExpandIcons()&&this.isUserCollapsible_&&(e=this.getExpanded()?2:1);b||(e=this.isLastSibling()?e+4:e+8);switch(e){case 1:d.append(c.cssExpandTreeIconPlus);break;case 2:d.append(c.cssExpandTreeIconMinus);break;case 4:d.append(c.cssExpandTreeIconL); -break;case 5:d.append(c.cssExpandTreeIconLPlus);break;case 6:d.append(c.cssExpandTreeIconLMinus);break;case 8:d.append(c.cssExpandTreeIconT);break;case 9:d.append(c.cssExpandTreeIconTPlus);break;case 10:d.append(c.cssExpandTreeIconTMinus);break;default:d.append(c.cssExpandTreeIconBlank)}}else b?d.append(c.cssExpandTreeIconBlank):this.isLastSibling()?d.append(c.cssExpandTreeIconL):d.append(c.cssExpandTreeIconT);return d.toString()}; -goog.ui.tree.BaseNode.prototype.getLineStyle=function(){var a=this.getExpanded()&&this.hasChildren();return goog.html.SafeStyle.create({"background-position":this.getBackgroundPosition(),display:a?null:"none"})};goog.ui.tree.BaseNode.prototype.getBackgroundPosition=function(){return(this.isLastSibling()?"-100":(this.getDepth()-1)*this.config_.indentWidth)+"px 0"}; -goog.ui.tree.BaseNode.prototype.getElement=function(){var a=goog.ui.tree.BaseNode.superClass_.getElement.call(this);a||(a=this.getDomHelper().getElement(this.getId()),this.setElementInternal(a));return a};goog.ui.tree.BaseNode.prototype.getRowElement=function(){var a=this.getElement();return a?a.firstChild:null};goog.ui.tree.BaseNode.prototype.getExpandIconElement=function(){var a=this.getRowElement();return a?a.firstChild:null}; -goog.ui.tree.BaseNode.prototype.getIconElement=function(){var a=this.getRowElement();return a?a.childNodes[1]:null};goog.ui.tree.BaseNode.prototype.getLabelElement=function(){var a=this.getRowElement();return a&&a.lastChild?a.lastChild.previousSibling:null};goog.ui.tree.BaseNode.prototype.getAfterLabelElement=function(){var a=this.getRowElement();return a?a.lastChild:null};goog.ui.tree.BaseNode.prototype.getChildrenElement=function(){var a=this.getElement();return a?a.lastChild:null}; -goog.ui.tree.BaseNode.prototype.setIconClass=function(a){this.iconClass_=a;this.isInDocument()&&this.updateIcon_()};goog.ui.tree.BaseNode.prototype.getIconClass=function(){return this.iconClass_};goog.ui.tree.BaseNode.prototype.setExpandedIconClass=function(a){this.expandedIconClass_=a;this.isInDocument()&&this.updateIcon_()};goog.ui.tree.BaseNode.prototype.getExpandedIconClass=function(){return this.expandedIconClass_};goog.ui.tree.BaseNode.prototype.setText=function(a){this.setSafeHtml(goog.html.SafeHtml.htmlEscape(a))}; -goog.ui.tree.BaseNode.prototype.getText=function(){return goog.string.unescapeEntities(goog.html.SafeHtml.unwrap(this.html_))};goog.ui.tree.BaseNode.prototype.setSafeHtml=function(a){this.html_=a;var b=this.getLabelElement();b&&goog.dom.safe.setInnerHtml(b,a);(a=this.getTree())&&a.setNode(this)};goog.ui.tree.BaseNode.prototype.getHtml=function(){return goog.html.SafeHtml.unwrap(this.getSafeHtml())};goog.ui.tree.BaseNode.prototype.getSafeHtml=function(){return this.html_}; -goog.ui.tree.BaseNode.prototype.setToolTip=function(a){this.toolTip_=a;var b=this.getLabelElement();b&&(b.title=a)};goog.ui.tree.BaseNode.prototype.getToolTip=function(){return this.toolTip_};goog.ui.tree.BaseNode.prototype.updateRow=function(){var a=this.getRowElement();a&&(a.className=this.getRowClassName())}; -goog.ui.tree.BaseNode.prototype.updateExpandIcon=function(){var a=this.getExpandIconElement();a&&(a.className=this.getExpandIconClass());if(a=this.getChildrenElement())a.style.backgroundPosition=this.getBackgroundPosition()};goog.ui.tree.BaseNode.prototype.updateIcon_=function(){this.getIconElement().className=this.getCalculatedIconClass()}; -goog.ui.tree.BaseNode.prototype.onMouseDown=function(a){"expand"==a.target.getAttribute("type")&&this.hasChildren()?this.isUserCollapsible_&&this.toggle():(this.select(),this.updateRow())};goog.ui.tree.BaseNode.prototype.onClick_=goog.events.Event.preventDefault;goog.ui.tree.BaseNode.prototype.onDoubleClick_=function(a){"expand"==a.target.getAttribute("type")&&this.hasChildren()||this.isUserCollapsible_&&this.toggle()}; -goog.ui.tree.BaseNode.prototype.onKeyDown=function(a){var b=!0;switch(a.keyCode){case goog.events.KeyCodes.RIGHT:if(a.altKey)break;this.hasChildren()&&(this.getExpanded()?this.getFirstChild().select():this.setExpanded(!0));break;case goog.events.KeyCodes.LEFT:if(a.altKey)break;if(this.hasChildren()&&this.getExpanded()&&this.isUserCollapsible_)this.setExpanded(!1);else{var c=this.getParent(),d=this.getTree();c&&(d.getShowRootNode()||c!=d)&&c.select()}break;case goog.events.KeyCodes.DOWN:(c=this.getNextShownNode())&& -c.select();break;case goog.events.KeyCodes.UP:(c=this.getPreviousShownNode())&&c.select();break;default:b=!1}b&&(a.preventDefault(),(d=this.getTree())&&d.clearTypeAhead());return b};goog.ui.tree.BaseNode.prototype.getLastShownDescendant=function(){return this.getExpanded()&&this.hasChildren()?this.getLastChild().getLastShownDescendant():this}; -goog.ui.tree.BaseNode.prototype.getNextShownNode=function(){if(this.hasChildren()&&this.getExpanded())return this.getFirstChild();for(var a=this,b;a!=this.getTree();){b=a.getNextSibling();if(null!=b)return b;a=a.getParent()}return null};goog.ui.tree.BaseNode.prototype.getPreviousShownNode=function(){var a=this.getPreviousSibling();if(null!=a)return a.getLastShownDescendant();a=this.getParent();var b=this.getTree();return!b.getShowRootNode()&&a==b||this==b?null:a}; -goog.ui.tree.BaseNode.prototype.getClientData=goog.ui.tree.BaseNode.prototype.getModel;goog.ui.tree.BaseNode.prototype.setClientData=goog.ui.tree.BaseNode.prototype.setModel;goog.ui.tree.BaseNode.prototype.getConfig=function(){return this.config_};goog.ui.tree.BaseNode.prototype.setTreeInternal=function(a){this.tree!=a&&(this.tree=a,a.setNode(this),this.forEachChild(function(b){b.setTreeInternal(a)}))}; -goog.ui.tree.BaseNode.defaultConfig={indentWidth:19,cssRoot:"goog-tree-root goog-tree-item",cssHideRoot:"goog-tree-hide-root",cssItem:"goog-tree-item",cssChildren:"goog-tree-children",cssChildrenNoLines:"goog-tree-children-nolines",cssTreeRow:"goog-tree-row",cssItemLabel:"goog-tree-item-label",cssTreeIcon:"goog-tree-icon",cssExpandTreeIcon:"goog-tree-expand-icon",cssExpandTreeIconPlus:"goog-tree-expand-icon-plus",cssExpandTreeIconMinus:"goog-tree-expand-icon-minus",cssExpandTreeIconTPlus:"goog-tree-expand-icon-tplus", -cssExpandTreeIconTMinus:"goog-tree-expand-icon-tminus",cssExpandTreeIconLPlus:"goog-tree-expand-icon-lplus",cssExpandTreeIconLMinus:"goog-tree-expand-icon-lminus",cssExpandTreeIconT:"goog-tree-expand-icon-t",cssExpandTreeIconL:"goog-tree-expand-icon-l",cssExpandTreeIconBlank:"goog-tree-expand-icon-blank",cssExpandedFolderIcon:"goog-tree-expanded-folder-icon",cssCollapsedFolderIcon:"goog-tree-collapsed-folder-icon",cssFileIcon:"goog-tree-file-icon",cssExpandedRootIcon:"goog-tree-expanded-folder-icon", -cssCollapsedRootIcon:"goog-tree-collapsed-folder-icon",cssSelectedRow:"selected"};goog.events.FocusHandler=function(a){goog.events.EventTarget.call(this);this.element_=a;a=goog.userAgent.IE?"focusout":"blur";this.listenKeyIn_=goog.events.listen(this.element_,goog.userAgent.IE?"focusin":"focus",this,!goog.userAgent.IE);this.listenKeyOut_=goog.events.listen(this.element_,a,this,!goog.userAgent.IE)};goog.inherits(goog.events.FocusHandler,goog.events.EventTarget);goog.events.FocusHandler.EventType={FOCUSIN:"focusin",FOCUSOUT:"focusout"}; -goog.events.FocusHandler.prototype.handleEvent=function(a){var b=a.getBrowserEvent();b=new goog.events.BrowserEvent(b);b.type="focusin"==a.type||"focus"==a.type?goog.events.FocusHandler.EventType.FOCUSIN:goog.events.FocusHandler.EventType.FOCUSOUT;this.dispatchEvent(b)};goog.events.FocusHandler.prototype.disposeInternal=function(){goog.events.FocusHandler.superClass_.disposeInternal.call(this);goog.events.unlistenByKey(this.listenKeyIn_);goog.events.unlistenByKey(this.listenKeyOut_);delete this.element_};goog.debug.LogRecord=function(a,b,c,d,e){this.reset(a,b,c,d,e)};goog.debug.LogRecord.prototype.sequenceNumber_=0;goog.debug.LogRecord.prototype.exception_=null;goog.debug.LogRecord.ENABLE_SEQUENCE_NUMBERS=!0;goog.debug.LogRecord.nextSequenceNumber_=0; -goog.debug.LogRecord.prototype.reset=function(a,b,c,d,e){goog.debug.LogRecord.ENABLE_SEQUENCE_NUMBERS&&(this.sequenceNumber_="number"==typeof e?e:goog.debug.LogRecord.nextSequenceNumber_++);this.time_=d||goog.now();this.level_=a;this.msg_=b;this.loggerName_=c;delete this.exception_};goog.debug.LogRecord.prototype.getLoggerName=function(){return this.loggerName_};goog.debug.LogRecord.prototype.getException=function(){return this.exception_}; -goog.debug.LogRecord.prototype.setException=function(a){this.exception_=a};goog.debug.LogRecord.prototype.setLoggerName=function(a){this.loggerName_=a};goog.debug.LogRecord.prototype.getLevel=function(){return this.level_};goog.debug.LogRecord.prototype.setLevel=function(a){this.level_=a};goog.debug.LogRecord.prototype.getMessage=function(){return this.msg_};goog.debug.LogRecord.prototype.setMessage=function(a){this.msg_=a};goog.debug.LogRecord.prototype.getMillis=function(){return this.time_}; -goog.debug.LogRecord.prototype.setMillis=function(a){this.time_=a};goog.debug.LogRecord.prototype.getSequenceNumber=function(){return this.sequenceNumber_};goog.debug.LogBuffer=function(){goog.asserts.assert(goog.debug.LogBuffer.isBufferingEnabled(),"Cannot use goog.debug.LogBuffer without defining goog.debug.LogBuffer.CAPACITY.");this.clear()};goog.debug.LogBuffer.getInstance=function(){goog.debug.LogBuffer.instance_||(goog.debug.LogBuffer.instance_=new goog.debug.LogBuffer);return goog.debug.LogBuffer.instance_};goog.debug.LogBuffer.CAPACITY=0; -goog.debug.LogBuffer.prototype.addRecord=function(a,b,c){var d=(this.curIndex_+1)%goog.debug.LogBuffer.CAPACITY;this.curIndex_=d;if(this.isFull_)return d=this.buffer_[d],d.reset(a,b,c),d;this.isFull_=d==goog.debug.LogBuffer.CAPACITY-1;return this.buffer_[d]=new goog.debug.LogRecord(a,b,c)};goog.debug.LogBuffer.isBufferingEnabled=function(){return 0=this.getEffectiveLevel().value}; -goog.debug.Logger.prototype.log=function(a,b,c){goog.debug.LOGGING_ENABLED&&this.isLoggable(a)&&(goog.isFunction(b)&&(b=b()),this.doLogRecord_(this.getLogRecord(a,b,c)))};goog.debug.Logger.prototype.getLogRecord=function(a,b,c){a=goog.debug.LogBuffer.isBufferingEnabled()?goog.debug.LogBuffer.getInstance().addRecord(a,b,this.name_):new goog.debug.LogRecord(a,String(b),this.name_);c&&a.setException(c);return a}; -goog.debug.Logger.prototype.shout=function(a,b){goog.debug.LOGGING_ENABLED&&this.log(goog.debug.Logger.Level.SHOUT,a,b)};goog.debug.Logger.prototype.severe=function(a,b){goog.debug.LOGGING_ENABLED&&this.log(goog.debug.Logger.Level.SEVERE,a,b)};goog.debug.Logger.prototype.warning=function(a,b){goog.debug.LOGGING_ENABLED&&this.log(goog.debug.Logger.Level.WARNING,a,b)};goog.debug.Logger.prototype.info=function(a,b){goog.debug.LOGGING_ENABLED&&this.log(goog.debug.Logger.Level.INFO,a,b)}; -goog.debug.Logger.prototype.config=function(a,b){goog.debug.LOGGING_ENABLED&&this.log(goog.debug.Logger.Level.CONFIG,a,b)};goog.debug.Logger.prototype.fine=function(a,b){goog.debug.LOGGING_ENABLED&&this.log(goog.debug.Logger.Level.FINE,a,b)};goog.debug.Logger.prototype.finer=function(a,b){goog.debug.LOGGING_ENABLED&&this.log(goog.debug.Logger.Level.FINER,a,b)};goog.debug.Logger.prototype.finest=function(a,b){goog.debug.LOGGING_ENABLED&&this.log(goog.debug.Logger.Level.FINEST,a,b)}; -goog.debug.Logger.prototype.logRecord=function(a){goog.debug.LOGGING_ENABLED&&this.isLoggable(a.getLevel())&&this.doLogRecord_(a)};goog.debug.Logger.prototype.doLogRecord_=function(a){goog.debug.Logger.ENABLE_PROFILER_LOGGING&&goog.debug.Logger.logToProfilers("log:"+a.getMessage());if(goog.debug.Logger.ENABLE_HIERARCHY)for(var b=this;b;)b.callPublish_(a),b=b.getParent();else{b=0;for(var c;c=goog.debug.Logger.rootHandlers_[b++];)c(a)}}; -goog.debug.Logger.prototype.callPublish_=function(a){if(this.handlers_)for(var b=0,c;c=this.handlers_[b];b++)c(a)};goog.debug.Logger.prototype.setParent_=function(a){this.parent_=a};goog.debug.Logger.prototype.addChild_=function(a,b){this.getChildren()[a]=b};goog.debug.LogManager={};goog.debug.LogManager.loggers_={};goog.debug.LogManager.rootLogger_=null; -goog.debug.LogManager.initialize=function(){goog.debug.LogManager.rootLogger_||(goog.debug.LogManager.rootLogger_=new goog.debug.Logger(goog.debug.Logger.ROOT_LOGGER_NAME),goog.debug.LogManager.loggers_[goog.debug.Logger.ROOT_LOGGER_NAME]=goog.debug.LogManager.rootLogger_,goog.debug.LogManager.rootLogger_.setLevel(goog.debug.Logger.Level.CONFIG))};goog.debug.LogManager.getLoggers=function(){return goog.debug.LogManager.loggers_}; -goog.debug.LogManager.getRoot=function(){goog.debug.LogManager.initialize();return goog.debug.LogManager.rootLogger_};goog.debug.LogManager.getLogger=function(a){goog.debug.LogManager.initialize();return goog.debug.LogManager.loggers_[a]||goog.debug.LogManager.createLogger_(a)};goog.debug.LogManager.createFunctionForCatchErrors=function(a){return function(b){(a||goog.debug.LogManager.getRoot()).severe("Error: "+b.message+" ("+b.fileName+" @ Line: "+b.line+")")}}; -goog.debug.LogManager.createLogger_=function(a){var b=new goog.debug.Logger(a);if(goog.debug.Logger.ENABLE_HIERARCHY){var c=a.lastIndexOf("."),d=a.substr(0,c);c=a.substr(c+1);d=goog.debug.LogManager.getLogger(d);d.addChild_(c,b);b.setParent_(d)}return goog.debug.LogManager.loggers_[a]=b};goog.log={};goog.log.ENABLED=goog.debug.LOGGING_ENABLED;goog.log.ROOT_LOGGER_NAME=goog.debug.Logger.ROOT_LOGGER_NAME;goog.log.Logger=goog.debug.Logger;goog.log.Level=goog.debug.Logger.Level;goog.log.LogRecord=goog.debug.LogRecord;goog.log.getLogger=function(a,b){if(goog.log.ENABLED){var c=goog.debug.LogManager.getLogger(a);b&&c&&c.setLevel(b);return c}return null};goog.log.addHandler=function(a,b){goog.log.ENABLED&&a&&a.addHandler(b)}; -goog.log.removeHandler=function(a,b){return goog.log.ENABLED&&a?a.removeHandler(b):!1};goog.log.log=function(a,b,c,d){goog.log.ENABLED&&a&&a.log(b,c,d)};goog.log.error=function(a,b,c){goog.log.ENABLED&&a&&a.severe(b,c)};goog.log.warning=function(a,b,c){goog.log.ENABLED&&a&&a.warning(b,c)};goog.log.info=function(a,b,c){goog.log.ENABLED&&a&&a.info(b,c)};goog.log.fine=function(a,b,c){goog.log.ENABLED&&a&&a.fine(b,c)};goog.ui.tree.TreeNode=function(a,b,c){goog.ui.tree.BaseNode.call(this,a,b,c)};goog.inherits(goog.ui.tree.TreeNode,goog.ui.tree.BaseNode);goog.ui.tree.TreeNode.prototype.getTree=function(){if(this.tree)return this.tree;var a=this.getParent();return a&&(a=a.getTree())?(this.setTreeInternal(a),a):null}; -goog.ui.tree.TreeNode.prototype.getCalculatedIconClass=function(){var a=this.getExpanded(),b=this.getExpandedIconClass();if(a&&b)return b;b=this.getIconClass();if(!a&&b)return b;b=this.getConfig();if(this.hasChildren()){if(a&&b.cssExpandedFolderIcon)return b.cssTreeIcon+" "+b.cssExpandedFolderIcon;if(!a&&b.cssCollapsedFolderIcon)return b.cssTreeIcon+" "+b.cssCollapsedFolderIcon}else if(b.cssFileIcon)return b.cssTreeIcon+" "+b.cssFileIcon;return""};goog.structs={};goog.structs.getCount=function(a){return a.getCount&&"function"==typeof a.getCount?a.getCount():goog.isArrayLike(a)||goog.isString(a)?a.length:goog.object.getCount(a)};goog.structs.getValues=function(a){if(a.getValues&&"function"==typeof a.getValues)return a.getValues();if(goog.isString(a))return a.split("");if(goog.isArrayLike(a)){for(var b=[],c=a.length,d=0;dthis.matchingLabelIndex_&&(b=this.nodeMap_.get(c[this.matchingLabelIndex_])),b&&b.length&&d&&(this.matchingNodeIndex_=a==goog.ui.tree.TypeAhead.Offset.UP?b.length- -1:0));if(b=this.selectMatchingNode_(b))this.matchingLabels_=c}return b};goog.ui.tree.TypeAhead.prototype.selectMatchingNode_=function(a){if(a){if(this.matchingNodeIndex_d&&(d=h,e=g)}return e?Blockly.utils.string.wrapMutate_(a,e,c):b};Blockly.utils.string.wrapToText_=function(a,b){for(var c=[],d=0;d=this.remainingCapacity()||(this.currentGesture_&&this.currentGesture_.cancel(),"comment"==a.tagName.toLowerCase()?this.pasteWorkspaceComment_(a):this.pasteBlock_(a))}; -Blockly.WorkspaceSvg.prototype.pasteBlock_=function(a){Blockly.Events.disable();try{var b=Blockly.Xml.domToBlock(a,this),c=Blockly.Navigation.marker_.getCurNode();if(Blockly.keyboardAccessibilityMode&&c){Blockly.Navigation.insertBlock(b,c.getLocation());return}var d=parseInt(a.getAttribute("x"),10),e=parseInt(a.getAttribute("y"),10);if(!isNaN(d)&&!isNaN(e)){this.RTL&&(d=-d);do{a=!1;var f=this.getAllBlocks(!1);c=0;for(var g;g=f[c];c++){var h=g.getRelativeToSurfaceXY();if(1>=Math.abs(d-h.x)&&1>=Math.abs(e- +Blockly.WorkspaceSvg.prototype.pasteBlock_=function(a){Blockly.Events.disable();try{var b=Blockly.Xml.domToBlock(a,this),c=Blockly.navigation.marker_.getCurNode();if(Blockly.keyboardAccessibilityMode&&c){Blockly.navigation.insertBlock(b,c.getLocation());return}var d=parseInt(a.getAttribute("x"),10),e=parseInt(a.getAttribute("y"),10);if(!isNaN(d)&&!isNaN(e)){this.RTL&&(d=-d);do{a=!1;var f=this.getAllBlocks(!1);c=0;for(var g;g=f[c];c++){var h=g.getRelativeToSurfaceXY();if(1>=Math.abs(d-h.x)&&1>=Math.abs(e- h.y)){a=!0;break}}if(!a){var k=b.getConnections_(!1);c=0;for(var l;l=k[c];c++)if(l.closest(Blockly.SNAP_RADIUS,new Blockly.utils.Coordinate(d,e)).connection){a=!0;break}}a&&(d=this.RTL?d-Blockly.SNAP_RADIUS:d+Blockly.SNAP_RADIUS,e+=2*Blockly.SNAP_RADIUS)}while(a);b.moveBy(d,e)}}finally{Blockly.Events.enable()}Blockly.Events.isEnabled()&&!b.isShadow()&&Blockly.Events.fire(new Blockly.Events.BlockCreate(b));b.select()}; Blockly.WorkspaceSvg.prototype.pasteWorkspaceComment_=function(a){Blockly.Events.disable();try{var b=Blockly.WorkspaceCommentSvg.fromXml(a,this),c=parseInt(a.getAttribute("x"),10),d=parseInt(a.getAttribute("y"),10);isNaN(c)||isNaN(d)||(this.RTL&&(c=-c),b.moveBy(c+50,d+50))}finally{Blockly.Events.enable()}Blockly.Events.isEnabled();b.select()}; Blockly.WorkspaceSvg.prototype.refreshToolboxSelection=function(){var a=this.isFlyout?this.targetWorkspace:this;a&&!a.currentGesture_&&a.toolbox_&&a.toolbox_.flyout_&&a.toolbox_.refreshSelection()};Blockly.WorkspaceSvg.prototype.renameVariableById=function(a,b){Blockly.WorkspaceSvg.superClass_.renameVariableById.call(this,a,b);this.refreshToolboxSelection()};Blockly.WorkspaceSvg.prototype.deleteVariableById=function(a){Blockly.WorkspaceSvg.superClass_.deleteVariableById.call(this,a);this.refreshToolboxSelection()}; @@ -1513,45 +1373,47 @@ Blockly.BlockDragSurfaceSvg.prototype.clearAndHide=function(a){a?a.appendChild(t Blockly.utils.svgPaths.arc=function(a,b,c,d){return a+" "+c+" "+c+" "+b+d};Blockly.blockRendering={};Blockly.blockRendering.constants={};Blockly.blockRendering.constants.NO_PADDING=0;Blockly.blockRendering.constants.SMALL_PADDING=3;Blockly.blockRendering.constants.MEDIUM_PADDING=5;Blockly.blockRendering.constants.MEDIUM_LARGE_PADDING=8;Blockly.blockRendering.constants.LARGE_PADDING=10;Blockly.blockRendering.constants.TALL_INPUT_FIELD_OFFSET_Y=Blockly.blockRendering.constants.MEDIUM_PADDING;Blockly.blockRendering.constants.DARK_PATH_OFFSET=1; Blockly.blockRendering.constants.TAB_HEIGHT=15;Blockly.blockRendering.constants.TAB_OFFSET_FROM_TOP=5;Blockly.blockRendering.constants.TAB_VERTICAL_OVERLAP=2.5;Blockly.blockRendering.constants.TAB_WIDTH=8;Blockly.blockRendering.constants.NOTCH_WIDTH=15;Blockly.blockRendering.constants.NOTCH_HEIGHT=4;Blockly.blockRendering.constants.MIN_BLOCK_WIDTH=12;Blockly.blockRendering.constants.EMPTY_BLOCK_SPACER_HEIGHT=16;Blockly.blockRendering.constants.CORNER_RADIUS=8; Blockly.blockRendering.constants.NOTCH_OFFSET_LEFT=Blockly.blockRendering.constants.NOTCH_WIDTH;Blockly.blockRendering.constants.NOTCH_OFFSET_ROUNDED_CORNER_PREV=Blockly.blockRendering.constants.NOTCH_OFFSET_LEFT-Blockly.blockRendering.constants.CORNER_RADIUS;Blockly.blockRendering.constants.STATEMENT_BOTTOM_SPACER=5;Blockly.blockRendering.constants.STATEMENT_INPUT_PADDING_LEFT=20;Blockly.blockRendering.constants.BETWEEN_STATEMENT_PADDING_Y=4;Blockly.blockRendering.constants.MAX_BOTTOM_WIDTH=66.5; -Blockly.blockRendering.constants.START_HAT_HEIGHT=15;Blockly.blockRendering.constants.START_HAT_WIDTH=100;Blockly.blockRendering.constants.SPACER_DEFAULT_HEIGHT=15;Blockly.blockRendering.constants.MIN_BLOCK_HEIGHT=24;Blockly.blockRendering.constants.EMPTY_INLINE_INPUT_WIDTH=Blockly.blockRendering.constants.TAB_WIDTH+14.5;Blockly.blockRendering.constants.EMPTY_INLINE_INPUT_HEIGHT=Blockly.blockRendering.constants.TAB_HEIGHT+11;Blockly.blockRendering.constants.EXTERNAL_VALUE_INPUT_WIDTH=10; -Blockly.blockRendering.constants.EMPTY_STATEMENT_INPUT_HEIGHT=Blockly.blockRendering.constants.MIN_BLOCK_HEIGHT;Blockly.blockRendering.constants.EMPTY_STATEMENT_INPUT_WIDTH=32;Blockly.blockRendering.constants.POPULATED_STATEMENT_INPUT_WIDTH=25;Blockly.blockRendering.constants.START_POINT=Blockly.utils.svgPaths.moveBy(0,0);Blockly.blockRendering.constants.TOP_LEFT_CORNER_START="m 0,"+Blockly.blockRendering.constants.CORNER_RADIUS;Blockly.blockRendering.constants.JAGGED_TEETH_HEIGHT=12; -Blockly.blockRendering.constants.JAGGED_TEETH_WIDTH=6;Blockly.blockRendering.constants.JAGGED_TEETH=function(){var a=Blockly.blockRendering.constants.JAGGED_TEETH_HEIGHT,b=Blockly.blockRendering.constants.JAGGED_TEETH_WIDTH,c=Blockly.utils.svgPaths.line([Blockly.utils.svgPaths.point(6,3),Blockly.utils.svgPaths.point(-12,6),Blockly.utils.svgPaths.point(6,3)]);return{height:a,width:b,path:c}}(); +Blockly.blockRendering.constants.START_HAT_HEIGHT=15;Blockly.blockRendering.constants.START_HAT_WIDTH=100;Blockly.blockRendering.constants.SPACER_DEFAULT_HEIGHT=15;Blockly.blockRendering.constants.MIN_BLOCK_HEIGHT=24;Blockly.blockRendering.constants.EMPTY_INLINE_INPUT_PADDING=14.5;Blockly.blockRendering.constants.EMPTY_INLINE_INPUT_HEIGHT=Blockly.blockRendering.constants.TAB_HEIGHT+11;Blockly.blockRendering.constants.EXTERNAL_VALUE_INPUT_PADDING=2; +Blockly.blockRendering.constants.EMPTY_STATEMENT_INPUT_HEIGHT=Blockly.blockRendering.constants.MIN_BLOCK_HEIGHT;Blockly.blockRendering.constants.EMPTY_STATEMENT_INPUT_WIDTH=32;Blockly.blockRendering.constants.POPULATED_STATEMENT_INPUT_WIDTH=25;Blockly.blockRendering.constants.START_POINT=Blockly.utils.svgPaths.moveBy(0,0);Blockly.blockRendering.constants.JAGGED_TEETH_HEIGHT=12;Blockly.blockRendering.constants.JAGGED_TEETH_WIDTH=6; +Blockly.blockRendering.constants.JAGGED_TEETH=function(){var a=Blockly.blockRendering.constants.JAGGED_TEETH_HEIGHT,b=Blockly.blockRendering.constants.JAGGED_TEETH_WIDTH,c=Blockly.utils.svgPaths.line([Blockly.utils.svgPaths.point(6,3),Blockly.utils.svgPaths.point(-12,6),Blockly.utils.svgPaths.point(6,3)]);return{height:a,width:b,path:c}}(); Blockly.blockRendering.constants.START_HAT=function(){var a=Blockly.blockRendering.constants.START_HAT_HEIGHT,b=Blockly.blockRendering.constants.START_HAT_WIDTH,c=Blockly.utils.svgPaths.curve("c",[Blockly.utils.svgPaths.point(30,-a),Blockly.utils.svgPaths.point(70,-a),Blockly.utils.svgPaths.point(b,0)]);return{height:a,width:b,path:c}}(); Blockly.blockRendering.constants.PUZZLE_TAB=function(){function a(a){a=a?-1:1;var d=-a,e=c/2,f=e+2.5,l=e+.5,n=Blockly.utils.svgPaths.point(-b,a*e);e=Blockly.utils.svgPaths.point(b,a*e);return Blockly.utils.svgPaths.curve("c",[Blockly.utils.svgPaths.point(0,a*f),Blockly.utils.svgPaths.point(-b,d*l),n])+Blockly.utils.svgPaths.curve("s",[Blockly.utils.svgPaths.point(b,2.5*d),e])}var b=Blockly.blockRendering.constants.TAB_WIDTH,c=Blockly.blockRendering.constants.TAB_HEIGHT,d=a(!0),e=a(!1);return{width:b, -height:c,pathDown:e,pathUp:d}}();Blockly.blockRendering.constants.NOTCH=function(){function a(a){return Blockly.utils.svgPaths.line([Blockly.utils.svgPaths.point(a*d,c),Blockly.utils.svgPaths.point(3*a,0),Blockly.utils.svgPaths.point(a*d,-c)])}var b=Blockly.blockRendering.constants.NOTCH_WIDTH,c=Blockly.blockRendering.constants.NOTCH_HEIGHT,d=(b-3)/2,e=a(1),f=a(-1);return{width:b,height:c,pathLeft:e,pathRight:f}}(); +height:c,pathDown:e,pathUp:d}}();Blockly.blockRendering.constants.TRIANGLE=function(){function a(a){a=a?-1:1;return Blockly.utils.svgPaths.lineTo(-20,20*a/2)+Blockly.utils.svgPaths.lineTo(20,20*a/2)}var b=a(!0);return{width:20,height:20,pathDown:a(!1),pathUp:b}}(); +Blockly.blockRendering.constants.NOTCH=function(){function a(a){return Blockly.utils.svgPaths.line([Blockly.utils.svgPaths.point(a*d,c),Blockly.utils.svgPaths.point(3*a,0),Blockly.utils.svgPaths.point(a*d,-c)])}var b=Blockly.blockRendering.constants.NOTCH_WIDTH,c=Blockly.blockRendering.constants.NOTCH_HEIGHT,d=(b-3)/2,e=a(1),f=a(-1);return{width:b,height:c,pathLeft:e,pathRight:f}}(); Blockly.blockRendering.constants.INSIDE_CORNERS=function(){var a=Blockly.blockRendering.constants.CORNER_RADIUS,b=Blockly.utils.svgPaths.arc("a","0 0,0",a,Blockly.utils.svgPaths.point(-a,a)),c=Blockly.utils.svgPaths.arc("a","0 0,0",a,Blockly.utils.svgPaths.point(a,a));return{height:a,pathTop:b,pathBottom:c}}(); -Blockly.blockRendering.constants.OUTSIDE_CORNERS=function(){var a=Blockly.blockRendering.constants.CORNER_RADIUS,b=Blockly.utils.svgPaths.arc("A","0 0,1",a,Blockly.utils.svgPaths.point(a,0));a=Blockly.utils.svgPaths.arc("a","0 0,1",a,Blockly.utils.svgPaths.point(-a,-a));return{topLeft:b,bottomLeft:a}}();Blockly.blockRendering.Measurable=function(){this.isInput=!1;this.height=this.width=0;this.type=null;this.centerline=this.xPos=0};Blockly.blockRendering.Measurable.prototype.isField=function(){return"field"==this.type};Blockly.blockRendering.Measurable.prototype.isHat=function(){return"hat"==this.type};Blockly.blockRendering.Measurable.prototype.isIcon=function(){return"icon"==this.type}; -Blockly.blockRendering.Measurable.prototype.isSpacer=function(){return"between-row spacer"==this.type||"in-row spacer"==this.type};Blockly.blockRendering.Measurable.prototype.isExternalInput=function(){return"external value input"==this.type};Blockly.blockRendering.Measurable.prototype.isInlineInput=function(){return"inline input"==this.type};Blockly.blockRendering.Measurable.prototype.isStatementInput=function(){return"statement input"==this.type}; -Blockly.blockRendering.Measurable.prototype.isPreviousConnection=function(){return"previous connection"==this.type};Blockly.blockRendering.Measurable.prototype.isNextConnection=function(){return"next connection"==this.type};Blockly.blockRendering.Measurable.prototype.isRoundedCorner=function(){return"round corner"==this.type};Blockly.blockRendering.Measurable.prototype.isSquareCorner=function(){return"square corner"==this.type}; -Blockly.blockRendering.Measurable.prototype.isJaggedEdge=function(){return"jagged edge"==this.type}; +Blockly.blockRendering.constants.OUTSIDE_CORNERS=function(){var a=Blockly.blockRendering.constants.CORNER_RADIUS,b=Blockly.utils.svgPaths.moveBy(0,a)+Blockly.utils.svgPaths.arc("a","0 0,1",a,Blockly.utils.svgPaths.point(a,-a));a=Blockly.utils.svgPaths.arc("a","0 0,1",a,Blockly.utils.svgPaths.point(-a,-a));return{topLeft:b,bottomLeft:a}}();Blockly.blockRendering.Measurable=function(){this.isInput=!1;this.height=this.width=0;this.type=null;this.centerline=this.xPos=0};Blockly.blockRendering.Measurable.prototype.connectionShape=Blockly.blockRendering.constants.PUZZLE_TAB;Blockly.blockRendering.Measurable.prototype.notchShape=Blockly.blockRendering.constants.NOTCH;Blockly.blockRendering.Measurable.prototype.isField=function(){return"field"==this.type};Blockly.blockRendering.Measurable.prototype.isHat=function(){return"hat"==this.type}; +Blockly.blockRendering.Measurable.prototype.isIcon=function(){return"icon"==this.type};Blockly.blockRendering.Measurable.prototype.isSpacer=function(){return"between-row spacer"==this.type||"in-row spacer"==this.type};Blockly.blockRendering.Measurable.prototype.isExternalInput=function(){return"external value input"==this.type};Blockly.blockRendering.Measurable.prototype.isInlineInput=function(){return"inline input"==this.type}; +Blockly.blockRendering.Measurable.prototype.isStatementInput=function(){return"statement input"==this.type};Blockly.blockRendering.Measurable.prototype.isPreviousConnection=function(){return"previous connection"==this.type};Blockly.blockRendering.Measurable.prototype.isNextConnection=function(){return"next connection"==this.type};Blockly.blockRendering.Measurable.prototype.isRoundedCorner=function(){return"round corner"==this.type}; +Blockly.blockRendering.Measurable.prototype.isSquareCorner=function(){return"square corner"==this.type};Blockly.blockRendering.Measurable.prototype.isJaggedEdge=function(){return"jagged edge"==this.type}; Blockly.blockRendering.Input=function(a){Blockly.blockRendering.Input.superClass_.constructor.call(this);this.isInput=!0;this.input=a;this.align=a.align;if(this.connectedBlock=a.connection&&a.connection.targetBlock()?a.connection.targetBlock():null){var b=this.connectedBlock.getHeightWidth();this.connectedBlockWidth=b.width;this.connectedBlockHeight=b.height}else this.connectedBlockHeight=this.connectedBlockWidth=0;this.connection=a.connection;this.connectionOffsetY=this.connectionOffsetX=0}; goog.inherits(Blockly.blockRendering.Input,Blockly.blockRendering.Measurable);Blockly.blockRendering.Icon=function(a){Blockly.blockRendering.Icon.superClass_.constructor.call(this);this.icon=a;this.isVisible=a.isVisible();this.type="icon";a=a.getCorrectedSize();this.height=a.height;this.width=a.width};goog.inherits(Blockly.blockRendering.Icon,Blockly.blockRendering.Measurable); Blockly.blockRendering.JaggedEdge=function(){Blockly.blockRendering.JaggedEdge.superClass_.constructor.call(this);this.type="jagged edge";this.height=Blockly.blockRendering.constants.JAGGED_TEETH.height;this.width=Blockly.blockRendering.constants.JAGGED_TEETH.width};goog.inherits(Blockly.blockRendering.JaggedEdge,Blockly.blockRendering.Measurable); Blockly.blockRendering.Field=function(a,b){Blockly.blockRendering.Field.superClass_.constructor.call(this);this.field=a;this.isEditable=a.isCurrentlyEditable();this.flipRtl=a instanceof Blockly.FieldImage&&a.getFlipRtl();this.type="field";var c=this.field.getSize();this.height=c.height;this.width=c.width;this.parentInput=b};goog.inherits(Blockly.blockRendering.Field,Blockly.blockRendering.Measurable); -Blockly.blockRendering.InlineInput=function(a){Blockly.blockRendering.InlineInput.superClass_.constructor.call(this,a);this.type="inline input";this.connectedBlock?(this.width=this.connectedBlockWidth+Blockly.blockRendering.constants.TAB_WIDTH+Blockly.blockRendering.constants.DARK_PATH_OFFSET,this.height=this.connectedBlockHeight+Blockly.blockRendering.constants.DARK_PATH_OFFSET):(this.height=Blockly.blockRendering.constants.EMPTY_INLINE_INPUT_HEIGHT,this.width=Blockly.blockRendering.constants.EMPTY_INLINE_INPUT_WIDTH); -this.connectionOffsetY=Blockly.blockRendering.constants.TAB_OFFSET_FROM_TOP;this.connectionHeight=Blockly.blockRendering.constants.PUZZLE_TAB.height;this.connectionWidth=Blockly.blockRendering.constants.PUZZLE_TAB.width};goog.inherits(Blockly.blockRendering.InlineInput,Blockly.blockRendering.Input); -Blockly.blockRendering.StatementInput=function(a){Blockly.blockRendering.StatementInput.superClass_.constructor.call(this,a);this.type="statement input";this.connectedBlock?(this.width=Blockly.blockRendering.constants.POPULATED_STATEMENT_INPUT_WIDTH,this.height=this.connectedBlockHeight+Blockly.blockRendering.constants.STATEMENT_BOTTOM_SPACER,this.connectedBlock.nextConnection&&(this.height-=Blockly.blockRendering.constants.NOTCH.height)):(this.height=Blockly.blockRendering.constants.EMPTY_STATEMENT_INPUT_HEIGHT, -this.width=Blockly.blockRendering.constants.EMPTY_STATEMENT_INPUT_WIDTH)};goog.inherits(Blockly.blockRendering.StatementInput,Blockly.blockRendering.Input); -Blockly.blockRendering.ExternalValueInput=function(a){Blockly.blockRendering.ExternalValueInput.superClass_.constructor.call(this,a);this.type="external value input";this.height=this.connectedBlock?this.connectedBlockHeight-2*Blockly.blockRendering.constants.TAB_OFFSET_FROM_TOP:Blockly.blockRendering.constants.TAB_HEIGHT;this.width=Blockly.blockRendering.constants.EXTERNAL_VALUE_INPUT_WIDTH;this.connectionOffsetY=Blockly.blockRendering.constants.TAB_OFFSET_FROM_TOP;this.connectionHeight=Blockly.blockRendering.constants.PUZZLE_TAB.height; -this.connectionWidth=Blockly.blockRendering.constants.PUZZLE_TAB.width};goog.inherits(Blockly.blockRendering.ExternalValueInput,Blockly.blockRendering.Input);Blockly.blockRendering.OutputConnection=function(){Blockly.blockRendering.OutputConnection.superClass_.constructor.call(this);this.type="output connection";this.height=Blockly.blockRendering.constants.PUZZLE_TAB.height;this.width=Blockly.blockRendering.constants.PUZZLE_TAB.width;this.connectionOffsetY=Blockly.blockRendering.constants.TAB_OFFSET_FROM_TOP}; -goog.inherits(Blockly.blockRendering.OutputConnection,Blockly.blockRendering.Measurable);Blockly.blockRendering.PreviousConnection=function(){Blockly.blockRendering.PreviousConnection.superClass_.constructor.call(this);this.type="previous connection";this.height=Blockly.blockRendering.constants.NOTCH.height;this.width=Blockly.blockRendering.constants.NOTCH.width};goog.inherits(Blockly.blockRendering.PreviousConnection,Blockly.blockRendering.Measurable); -Blockly.blockRendering.NextConnection=function(){Blockly.blockRendering.NextConnection.superClass_.constructor.call(this);this.type="next connection";this.height=Blockly.blockRendering.constants.NOTCH.height;this.width=Blockly.blockRendering.constants.NOTCH.width};goog.inherits(Blockly.blockRendering.NextConnection,Blockly.blockRendering.Measurable); -Blockly.blockRendering.Hat=function(){Blockly.blockRendering.Hat.superClass_.constructor.call(this);this.type="hat";this.height=Blockly.blockRendering.constants.NO_PADDING;this.width=Blockly.blockRendering.constants.START_HAT.width};goog.inherits(Blockly.blockRendering.Hat,Blockly.blockRendering.Measurable); -Blockly.blockRendering.SquareCorner=function(){Blockly.blockRendering.SquareCorner.superClass_.constructor.call(this);this.type="square corner";this.height=Blockly.blockRendering.constants.NOTCH.height;this.width=Blockly.blockRendering.constants.NO_PADDING};goog.inherits(Blockly.blockRendering.SquareCorner,Blockly.blockRendering.Measurable); -Blockly.blockRendering.RoundCorner=function(){Blockly.blockRendering.RoundCorner.superClass_.constructor.call(this);this.type="round corner";this.width=Blockly.blockRendering.constants.CORNER_RADIUS;this.height=Blockly.blockRendering.constants.NOTCH.height};goog.inherits(Blockly.blockRendering.RoundCorner,Blockly.blockRendering.Measurable); -Blockly.blockRendering.Row=function(){this.type="row";this.yPos=0;this.elements=[];this.height=this.width=0;this.hasJaggedEdge=this.hasDummyInput=this.hasInlineInput=this.hasStatement=this.hasExternalInput=!1};Blockly.blockRendering.Row.prototype.isSpacer=function(){return!1}; -Blockly.blockRendering.Row.prototype.measure=function(){for(var a=0,b=0;b90-b||a>-90-b&&a<-90+b?!0:!1}; Blockly.HorizontalFlyout.prototype.getClientRect=function(){if(!this.svgGroup_)return null;var a=this.svgGroup_.getBoundingClientRect(),b=a.top;return this.toolboxPosition_==Blockly.TOOLBOX_AT_TOP?new Blockly.utils.Rect(-1E9,b+a.height,-1E9,1E9):new Blockly.utils.Rect(b,-1E9,-1E9,1E9)}; -Blockly.HorizontalFlyout.prototype.reflowInternal_=function(){this.workspace_.scale=this.targetWorkspace_.scale;for(var a=0,b=this.workspace_.getTopBlocks(!1),c=0,d;d=b[c];c++)a=Math.max(a,d.getHeightWidth().height);a+=1.5*this.MARGIN;a*=this.workspace_.scale;a+=Blockly.Scrollbar.scrollbarThickness;if(this.height_!=a){for(c=0;d=b[c];c++)d.flyoutRect_&&this.moveRectToBlock_(d.flyoutRect_,d);this.height_=a;this.position()}};Blockly.VerticalFlyout=function(a){a.getMetrics=this.getMetrics_.bind(this);a.setMetrics=this.setMetrics_.bind(this);Blockly.VerticalFlyout.superClass_.constructor.call(this,a);this.horizontalLayout_=!1};goog.inherits(Blockly.VerticalFlyout,Blockly.Flyout); +Blockly.HorizontalFlyout.prototype.reflowInternal_=function(){this.workspace_.scale=this.targetWorkspace_.scale;for(var a=0,b=this.workspace_.getTopBlocks(!1),c=0,d;d=b[c];c++)a=Math.max(a,d.getHeightWidth().height);a+=1.5*this.MARGIN;a*=this.workspace_.scale;a+=Blockly.Scrollbar.scrollbarThickness;if(this.height_!=a){for(c=0;d=b[c];c++)d.flyoutRect_&&this.moveRectToBlock_(d.flyoutRect_,d);this.height_=a;this.position()}};Blockly.utils.IdGenerator=function(){};Blockly.utils.IdGenerator.getInstance=function(){Blockly.utils.IdGenerator.instance_||(Blockly.utils.IdGenerator.instance_=new Blockly.utils.IdGenerator);return Blockly.utils.IdGenerator.instance_};Blockly.utils.IdGenerator.prototype.nextId_=0;Blockly.utils.IdGenerator.prototype.getNextUniqueId=function(){return"blockly:"+(this.nextId_++).toString(36)};Blockly.Component=function(){this.rightToLeft_=Blockly.Component.defaultRightToLeft_;this.id_=null;this.inDocument_=!1;this.childIndex_=this.children_=this.parent_=this.element_=null};Blockly.Component.prototype.idGenerator_=Blockly.utils.IdGenerator.getInstance();Blockly.Component.defaultRightToLeft_=!1; +Blockly.Component.Error={NOT_SUPPORTED:"Method not supported",ALREADY_RENDERED:"Component already rendered",PARENT_UNABLE_TO_BE_SET:"Unable to set parent component",CHILD_INDEX_OUT_OF_BOUNDS:"Child component index out of bounds",NOT_OUR_CHILD:"Child is not in parent component",NOT_IN_DOCUMENT:"Operation not supported while component is not in document"};Blockly.Component.setDefaultRightToLeft=function(a){Blockly.Component.defaultRightToLeft_=a}; +Blockly.Component.prototype.getId=function(){return this.id_||(this.id_=this.idGenerator_.getNextUniqueId())};Blockly.Component.prototype.setId=function(a){this.parent_&&this.parent_.childIndex_&&(delete this.parent_.childIndex_[this.id_],this.parent_.childIndex_[a]=this);this.id_=a};Blockly.Component.prototype.getElement=function(){return this.element_};Blockly.Component.prototype.setElementInternal=function(a){this.element_=a}; +Blockly.Component.prototype.setParent=function(a){if(this==a)throw Error(Blockly.Component.Error.PARENT_UNABLE_TO_BE_SET);if(a&&this.parent_&&this.id_&&this.parent_.getChild(this.id_)&&this.parent_!=a)throw Error(Blockly.Component.Error.PARENT_UNABLE_TO_BE_SET);this.parent_=a};Blockly.Component.prototype.getParent=function(){return this.parent_};Blockly.Component.prototype.isInDocument=function(){return this.inDocument_};Blockly.Component.prototype.createDom=function(){this.element_=document.createElement("div")}; +Blockly.Component.prototype.render=function(a){this.render_(a)};Blockly.Component.prototype.renderBefore=function(a){this.render_(a.parentNode,a)};Blockly.Component.prototype.render_=function(a,b){if(this.inDocument_)throw Error(Blockly.Component.Error.ALREADY_RENDERED);this.element_||this.createDom();a?a.insertBefore(this.element_,b||null):document.body.appendChild(this.element_);this.parent_&&!this.parent_.isInDocument()||this.enterDocument()}; +Blockly.Component.prototype.enterDocument=function(){this.inDocument_=!0;this.forEachChild(function(a){!a.isInDocument()&&a.getElement()&&a.enterDocument()})};Blockly.Component.prototype.exitDocument=function(){this.forEachChild(function(a){a.isInDocument()&&a.exitDocument()});this.inDocument_=!1};Blockly.Component.prototype.dispose=function(){this.disposed_||(this.disposed_=!0,this.disposeInternal())}; +Blockly.Component.prototype.disposeInternal=function(){this.inDocument_&&this.exitDocument();this.forEachChild(function(a){a.dispose()});this.element_&&Blockly.utils.dom.removeNode(this.element_);this.parent_=this.element_=this.childIndex_=this.children_=null};Blockly.Component.prototype.makeId=function(a){return this.getId()+"."+a};Blockly.Component.prototype.makeIds=function(a){var b={},c;for(c in a)b[c]=this.makeId(a[c]);return b}; +Blockly.Component.prototype.addChild=function(a,b){this.addChildAt(a,this.getChildCount(),b)}; +Blockly.Component.prototype.addChildAt=function(a,b,c){if(a.inDocument_&&(c||!this.inDocument_))throw Error(Blockly.Component.Error.ALREADY_RENDERED);if(0>b||b>this.getChildCount())throw Error(Blockly.Component.Error.CHILD_INDEX_OUT_OF_BOUNDS);this.childIndex_&&this.children_||(this.childIndex_={},this.children_=[]);this.childIndex_[a.getId()]=a;if(a.getParent()==this){var d=this.children_.indexOf(a);-1a&&(a=this.computeDepth_(),this.setDepth_(a));return a};Blockly.tree.BaseNode.prototype.computeDepth_=function(){var a=this.getParent();return a?a.getDepth()+1:0};Blockly.tree.BaseNode.prototype.setDepth_=function(a){if(a!=this.depth_){this.depth_=a;var b=this.getRowElement();if(b){var c=this.getPixelIndent_()+"px";this.isRightToLeft()?b.style.paddingRight=c:b.style.paddingLeft=c}this.forEachChild(function(b){b.setDepth_(a+1)})}}; +Blockly.tree.BaseNode.prototype.contains=function(a){for(;a;){if(a==this)return!0;a=a.getParent()}return!1};Blockly.tree.BaseNode.prototype.getChildren=function(){var a=[];this.forEachChild(function(b){a.push(b)});return a};Blockly.tree.BaseNode.prototype.getFirstChild=function(){return this.getChildAt(0)};Blockly.tree.BaseNode.prototype.getLastChild=function(){return this.getChildAt(this.getChildCount()-1)};Blockly.tree.BaseNode.prototype.getPreviousSibling=function(){return this.previousSibling_}; +Blockly.tree.BaseNode.prototype.getNextSibling=function(){return this.nextSibling_};Blockly.tree.BaseNode.prototype.isLastSibling=function(){return!this.nextSibling_};Blockly.tree.BaseNode.prototype.isSelected=function(){return this.selected_};Blockly.tree.BaseNode.prototype.select=function(){var a=this.getTree();a&&a.setSelectedItem(this)}; +Blockly.tree.BaseNode.prototype.setSelectedInternal=function(a){if(this.selected_!=a){this.selected_=a;this.updateRow();var b=this.getElement();b&&(Blockly.utils.aria.setState(b,Blockly.utils.aria.State.SELECTED,a),a&&(a=this.getTree().getElement(),Blockly.utils.aria.setState(a,Blockly.utils.aria.State.ACTIVEDESCENDANT,this.getId())))}};Blockly.tree.BaseNode.prototype.getExpanded=function(){return this.expanded_};Blockly.tree.BaseNode.prototype.setExpandedInternal=function(a){this.expanded_=a}; +Blockly.tree.BaseNode.prototype.setExpanded=function(a){var b=a!=this.expanded_,c;this.expanded_=a;var d=this.getTree(),e=this.getElement();if(this.hasChildren()){if(!a&&d&&this.contains(d.getSelectedItem())&&this.select(),e){if(c=this.getChildrenElement())Blockly.utils.style.setElementShown(c,a),Blockly.utils.aria.setState(e,Blockly.utils.aria.State.EXPANDED,a),a&&this.isInDocument()&&!c.hasChildNodes()&&(this.forEachChild(function(a){c.appendChild(a.toDom())}),this.forEachChild(function(a){a.enterDocument()})); +this.updateExpandIcon()}}else(c=this.getChildrenElement())&&Blockly.utils.style.setElementShown(c,!1);e&&this.updateIcon_();b&&(a?this.doNodeExpanded():this.doNodeCollapsed())};Blockly.tree.BaseNode.prototype.doNodeExpanded=function(){};Blockly.tree.BaseNode.prototype.doNodeCollapsed=function(){};Blockly.tree.BaseNode.prototype.toggle=function(){this.setExpanded(!this.getExpanded())};Blockly.tree.BaseNode.prototype.expand=function(){this.setExpanded(!0)};Blockly.tree.BaseNode.prototype.collapse=function(){this.setExpanded(!1)}; +Blockly.tree.BaseNode.prototype.collapseChildren=function(){this.forEachChild(function(a){a.collapseAll()})};Blockly.tree.BaseNode.prototype.collapseAll=function(){this.collapseChildren();this.collapse()};Blockly.tree.BaseNode.prototype.expandChildren=function(){this.forEachChild(function(a){a.expandAll()})};Blockly.tree.BaseNode.prototype.expandAll=function(){this.expandChildren();this.expand()};Blockly.tree.BaseNode.prototype.reveal=function(){var a=this.getParent();a&&(a.setExpanded(!0),a.reveal())}; +Blockly.tree.BaseNode.prototype.setIsUserCollapsible=function(a){(this.isUserCollapsible_=a)||this.expand();this.getElement()&&this.updateExpandIcon()};Blockly.tree.BaseNode.prototype.isUserCollapsible=function(){return this.isUserCollapsible_}; +Blockly.tree.BaseNode.prototype.toDom=function(){var a=this.config_.cssChildrenNoLines,b=this.getExpanded()&&this.hasChildren(),c=document.createElement("div");c.setAttribute("class",a||"");c.setAttribute("style",this.getLineStyle());b&&this.forEachChild(function(a){c.appendChild(a.toDom())});a=document.createElement("div");a.setAttribute("class",this.config_.cssItem||"");a.setAttribute("id",this.getId());a.appendChild(this.getRowDom());a.appendChild(c);return a}; +Blockly.tree.BaseNode.prototype.getPixelIndent_=function(){return Math.max(0,(this.getDepth()-1)*this.config_.indentWidth)};Blockly.tree.BaseNode.prototype.getRowDom=function(){var a="padding-"+(this.isRightToLeft()?"right":"left")+":"+this.getPixelIndent_()+"px",b=document.createElement("div");b.setAttribute("class",this.getRowClassName());b.setAttribute("style",a);b.appendChild(this.getExpandIconDom());b.appendChild(this.getIconDom());b.appendChild(this.getLabelDom());return b}; +Blockly.tree.BaseNode.prototype.getRowClassName=function(){var a="";this.isSelected()&&(a=" "+(this.config_.cssSelectedRow||""));return this.config_.cssTreeRow+a};Blockly.tree.BaseNode.prototype.getLabelDom=function(){var a=document.createElement("span");a.setAttribute("class",this.config_.cssItemLabel||"");a.setAttribute("title",this.getToolTip()||"");a.textContent=this.getText();return a}; +Blockly.tree.BaseNode.prototype.getIconDom=function(){var a=document.createElement("span");a.setAttribute("style","display: inline-block;");a.setAttribute("class",this.getCalculatedIconClass());return a};Blockly.tree.BaseNode.prototype.getCalculatedIconClass=function(){throw Error("unimplemented abstract method");};Blockly.tree.BaseNode.prototype.getExpandIconDom=function(){return document.createElement("span")}; +Blockly.tree.BaseNode.prototype.getExpandIconClass=function(){var a=this.config_;var b=a.cssTreeIcon+" "+a.cssExpandTreeIcon+" ";this.hasChildren();return b+=a.cssExpandTreeIconBlank};Blockly.tree.BaseNode.prototype.getLineStyle=function(){var a=this.getExpanded()&&this.hasChildren();return"background-position: "+this.getBackgroundPosition()+"; "+(a?"":"display: none")}; +Blockly.tree.BaseNode.prototype.getBackgroundPosition=function(){return(this.isLastSibling()?"-100":(this.getDepth()-1)*this.config_.indentWidth)+"px 0"};Blockly.tree.BaseNode.prototype.getElement=function(){var a=Blockly.tree.BaseNode.superClass_.getElement.call(this);a||(a=document.getElementById(this.getId()),this.setElementInternal(a));return a};Blockly.tree.BaseNode.prototype.getRowElement=function(){var a=this.getElement();return a?a.firstChild:null}; +Blockly.tree.BaseNode.prototype.getExpandIconElement=function(){var a=this.getRowElement();return a?a.firstChild:null};Blockly.tree.BaseNode.prototype.getIconElement=function(){var a=this.getRowElement();return a?a.childNodes[1]:null};Blockly.tree.BaseNode.prototype.getLabelElement=function(){var a=this.getRowElement();return a&&a.lastChild?a.lastChild.previousSibling:null};Blockly.tree.BaseNode.prototype.getAfterLabelElement=function(){var a=this.getRowElement();return a?a.lastChild:null}; +Blockly.tree.BaseNode.prototype.getChildrenElement=function(){var a=this.getElement();return a?a.lastChild:null};Blockly.tree.BaseNode.prototype.setIconClass=function(a){this.iconClass_=a;this.isInDocument()&&this.updateIcon_()};Blockly.tree.BaseNode.prototype.getIconClass=function(){return this.iconClass_};Blockly.tree.BaseNode.prototype.setExpandedIconClass=function(a){this.expandedIconClass_=a;this.isInDocument()&&this.updateIcon_()};Blockly.tree.BaseNode.prototype.getExpandedIconClass=function(){return this.expandedIconClass_}; +Blockly.tree.BaseNode.prototype.setText=function(a){this.content_=a};Blockly.tree.BaseNode.prototype.getText=function(){return this.content_};Blockly.tree.BaseNode.prototype.setToolTip=function(a){this.toolTip_=a;var b=this.getLabelElement();b&&(b.title=a)};Blockly.tree.BaseNode.prototype.getToolTip=function(){return this.toolTip_};Blockly.tree.BaseNode.prototype.updateRow=function(){var a=this.getRowElement();a&&(a.className=this.getRowClassName())}; +Blockly.tree.BaseNode.prototype.updateExpandIcon=function(){var a=this.getExpandIconElement();a&&(a.className=this.getExpandIconClass());if(a=this.getChildrenElement())a.style.backgroundPosition=this.getBackgroundPosition()};Blockly.tree.BaseNode.prototype.updateIcon_=function(){this.getIconElement().className=this.getCalculatedIconClass()}; +Blockly.tree.BaseNode.prototype.onMouseDown=function(a){"expand"==a.target.getAttribute("type")&&this.hasChildren()?this.isUserCollapsible_&&this.toggle():(this.select(),this.updateRow())};Blockly.tree.BaseNode.prototype.onClick_=function(a){a.preventDefault()};Blockly.tree.BaseNode.prototype.onDoubleClick_=function(a){"expand"==a.target.getAttribute("type")&&this.hasChildren()||this.isUserCollapsible_&&this.toggle()}; +Blockly.tree.BaseNode.prototype.onKeyDown=function(a){var b=!0;switch(a.keyCode){case Blockly.utils.KeyCodes.RIGHT:if(a.altKey)break;this.hasChildren()&&(this.getExpanded()?this.getFirstChild().select():this.setExpanded(!0));break;case Blockly.utils.KeyCodes.LEFT:if(a.altKey)break;if(this.hasChildren()&&this.getExpanded()&&this.isUserCollapsible_)this.setExpanded(!1);else{var c=this.getParent(),d=this.getTree();c&&c!=d&&c.select()}break;case Blockly.utils.KeyCodes.DOWN:(c=this.getNextShownNode())&& +c.select();break;case Blockly.utils.KeyCodes.UP:(c=this.getPreviousShownNode())&&c.select();break;default:b=!1}b&&a.preventDefault();return b};Blockly.tree.BaseNode.prototype.getLastShownDescendant=function(){return this.getExpanded()&&this.hasChildren()?this.getLastChild().getLastShownDescendant():this}; +Blockly.tree.BaseNode.prototype.getNextShownNode=function(){if(this.hasChildren()&&this.getExpanded())return this.getFirstChild();for(var a=this,b;a!=this.getTree();){b=a.getNextSibling();if(null!=b)return b;a=a.getParent()}return null};Blockly.tree.BaseNode.prototype.getPreviousShownNode=function(){var a=this.getPreviousSibling();if(null!=a)return a.getLastShownDescendant();a=this.getParent();var b=this.getTree();return a==b||this==b?null:a};Blockly.tree.BaseNode.prototype.getConfig=function(){return this.config_}; +Blockly.tree.BaseNode.prototype.setTreeInternal=function(a){this.tree!=a&&(this.tree=a,this.forEachChild(function(b){b.setTreeInternal(a)}))};Blockly.tree.TreeNode=function(a,b,c){this.toolbox_=a;Blockly.tree.BaseNode.call(this,b,c)};goog.inherits(Blockly.tree.TreeNode,Blockly.tree.BaseNode);Blockly.tree.TreeNode.prototype.getTree=function(){if(this.tree)return this.tree;var a=this.getParent();return a&&(a=a.getTree())?(this.setTreeInternal(a),a):null}; +Blockly.tree.TreeNode.prototype.getCalculatedIconClass=function(){var a=this.getExpanded(),b=this.getExpandedIconClass();if(a&&b)return b;b=this.getIconClass();if(!a&&b)return b;b=this.getConfig();if(this.hasChildren()){if(a&&b.cssExpandedFolderIcon)return b.cssTreeIcon+" "+b.cssExpandedFolderIcon;if(!a&&b.cssCollapsedFolderIcon)return b.cssTreeIcon+" "+b.cssCollapsedFolderIcon}else if(b.cssFileIcon)return b.cssTreeIcon+" "+b.cssFileIcon;return""}; +Blockly.tree.TreeNode.prototype.onClick_=function(a){this.hasChildren()&&this.isUserCollapsible()?(this.toggle(),this.select()):this.isSelected()?this.getTree().setSelectedItem(null):this.select();this.updateRow()};Blockly.tree.TreeNode.prototype.onMouseDown=function(a){}; +Blockly.tree.TreeNode.prototype.onKeyDown=function(a){if(this.tree.toolbox_.horizontalLayout_){var b={},c=Blockly.utils.KeyCodes.DOWN,d=Blockly.utils.KeyCodes.UP;b[Blockly.utils.KeyCodes.RIGHT]=this.isRightToLeft()?d:c;b[Blockly.utils.KeyCodes.LEFT]=this.isRightToLeft()?c:d;b[Blockly.utils.KeyCodes.UP]=Blockly.utils.KeyCodes.LEFT;b[Blockly.utils.KeyCodes.DOWN]=Blockly.utils.KeyCodes.RIGHT;Object.defineProperties(a,{keyCode:{value:b[a.keyCode]||a.keyCode}})}return Blockly.tree.TreeNode.superClass_.onKeyDown.call(this, +a)};Blockly.tree.TreeNode.prototype.onSizeChanged=function(a){this.onSizeChanged_=a};Blockly.tree.TreeNode.prototype.resizeToolbox_=function(){this.onSizeChanged_&&this.onSizeChanged_.call(this.toolbox_)};Blockly.tree.TreeNode.prototype.doNodeExpanded=Blockly.tree.TreeNode.prototype.resizeToolbox_;Blockly.tree.TreeNode.prototype.doNodeCollapsed=Blockly.tree.TreeNode.prototype.resizeToolbox_;Blockly.tree.TreeControl=function(a,b){this.toolbox_=a;Blockly.tree.BaseNode.call(this,"",b);this.setExpandedInternal(!0);this.setSelectedInternal(!0);this.selectedItem_=this};goog.inherits(Blockly.tree.TreeControl,Blockly.tree.BaseNode);Blockly.tree.TreeControl.prototype.getTree=function(){return this};Blockly.tree.TreeControl.prototype.getToolbox=function(){return this.toolbox_};Blockly.tree.TreeControl.prototype.getDepth=function(){return 0};Blockly.tree.TreeControl.prototype.reveal=function(){}; +Blockly.tree.TreeControl.prototype.handleFocus_=function(a){this.focused_=!0;a=this.getElement();Blockly.utils.dom.addClass(a,"focused");this.selectedItem_&&this.selectedItem_.select()};Blockly.tree.TreeControl.prototype.handleBlur_=function(a){this.focused_=!1;a=this.getElement();Blockly.utils.dom.removeClass(a,"focused")};Blockly.tree.TreeControl.prototype.hasFocus=function(){return this.focused_};Blockly.tree.TreeControl.prototype.getExpanded=function(){return!0}; +Blockly.tree.TreeControl.prototype.setExpanded=function(a){this.setExpandedInternal(a)};Blockly.tree.TreeControl.prototype.getIconElement=function(){var a=this.getRowElement();return a?a.firstChild:null};Blockly.tree.TreeControl.prototype.getExpandIconElement=function(){return null};Blockly.tree.TreeControl.prototype.updateExpandIcon=function(){};Blockly.tree.TreeControl.prototype.getRowClassName=function(){return Blockly.tree.TreeControl.superClass_.getRowClassName.call(this)+" "+this.getConfig().cssHideRoot}; +Blockly.tree.TreeControl.prototype.getCalculatedIconClass=function(){var a=this.getExpanded(),b=this.getExpandedIconClass();if(a&&b)return b;b=this.getIconClass();if(!a&&b)return b;b=this.getConfig();return a&&b.cssExpandedRootIcon?b.cssTreeIcon+" "+b.cssExpandedRootIcon:!a&&b.cssCollapsedRootIcon?b.cssTreeIcon+" "+b.cssCollapsedRootIcon:""}; +Blockly.tree.TreeControl.prototype.setSelectedItem=function(a){if(a!=this.selectedItem_&&(!this.onBeforeSelected_||this.onBeforeSelected_.call(this.toolbox_,a))){var b=this.getSelectedItem();this.selectedItem_&&this.selectedItem_.setSelectedInternal(!1);(this.selectedItem_=a)&&a.setSelectedInternal(!0);this.onAfterSelected_&&this.onAfterSelected_.call(this.toolbox_,b,a)}};Blockly.tree.TreeControl.prototype.onBeforeSelected=function(a){this.onBeforeSelected_=a}; +Blockly.tree.TreeControl.prototype.onAfterSelected=function(a){this.onAfterSelected_=a};Blockly.tree.TreeControl.prototype.getSelectedItem=function(){return this.selectedItem_};Blockly.tree.TreeControl.prototype.updateLinesAndExpandIcons_=function(){function a(b){var c=b.getChildrenElement();if(c){var d=b.getConfig().cssChildrenNoLines;c.className=d;if(c=b.getExpandIconElement())c.className=b.getExpandIconClass()}b.forEachChild(a)}a(this)}; +Blockly.tree.TreeControl.prototype.initAccessibility=function(){Blockly.tree.TreeControl.superClass_.initAccessibility.call(this);var a=this.getElement();Blockly.utils.aria.setRole(a,Blockly.utils.aria.Role.TREE);Blockly.utils.aria.setState(a,Blockly.utils.aria.State.LABELLEDBY,this.getLabelElement().id)}; +Blockly.tree.TreeControl.prototype.enterDocument=function(){Blockly.tree.TreeControl.superClass_.enterDocument.call(this);var a=this.getElement();a.className=this.getConfig().cssRoot;a.setAttribute("hideFocus","true");this.attachEvents_();this.initAccessibility()};Blockly.tree.TreeControl.prototype.exitDocument=function(){Blockly.tree.TreeControl.superClass_.exitDocument.call(this);this.detachEvents_()}; +Blockly.tree.TreeControl.prototype.attachEvents_=function(){var a=this.getElement();a.tabIndex=0;this.onFocusWrapper_=Blockly.bindEvent_(a,"focus",this,this.handleFocus_);this.onBlurWrapper_=Blockly.bindEvent_(a,"blur",this,this.handleBlur_);this.onMousedownWrapper_=Blockly.bindEventWithChecks_(a,"mousedown",this,this.handleMouseEvent_);this.onClickWrapper_=Blockly.bindEventWithChecks_(a,"click",this,this.handleMouseEvent_);this.onKeydownWrapper_=Blockly.bindEvent_(a,"keydown",this,this.handleKeyEvent_); +Blockly.Touch.TOUCH_ENABLED&&(this.onTouchEndWrapper_=Blockly.bindEventWithChecks_(a,"touchend",this,this.handleTouchEvent_))};Blockly.tree.TreeControl.prototype.detachEvents_=function(){Blockly.unbindEvent_(this.onFocusWrapper_);Blockly.unbindEvent_(this.onBlurWrapper_);Blockly.unbindEvent_(this.onMousedownWrapper_);Blockly.unbindEvent_(this.onClickWrapper_);Blockly.unbindEvent_(this.onKeydownWrapper_);this.onTouchEndWrapper_&&Blockly.unbindEvent_(this.onTouchEndWrapper_)}; +Blockly.tree.TreeControl.prototype.handleMouseEvent_=function(a){var b=this.getNodeFromEvent_(a);if(b)switch(a.type){case "mousedown":b.onMouseDown(a);break;case "click":b.onClick_(a)}};Blockly.tree.TreeControl.prototype.handleTouchEvent_=function(a){var b=this.getNodeFromEvent_(a);b&&"touchend"===a.type&&setTimeout(function(){b.onClick_(a)},1)};Blockly.tree.TreeControl.prototype.handleKeyEvent_=function(a){var b=!1;(b=this.selectedItem_&&this.selectedItem_.onKeyDown(a)||b)&&a.preventDefault();return b}; +Blockly.tree.TreeControl.prototype.getNodeFromEvent_=function(a){for(var b=a.target;null!=b;){if(a=Blockly.tree.BaseNode.allNodes[b.id])return a;if(b==this.getElement())break;b=b.parentNode}return null};Blockly.tree.TreeControl.prototype.createNode=function(a){return new Blockly.tree.TreeNode(this.toolbox_,a||"",this.getConfig())};Blockly.VerticalFlyout=function(a){a.getMetrics=this.getMetrics_.bind(this);a.setMetrics=this.setMetrics_.bind(this);Blockly.VerticalFlyout.superClass_.constructor.call(this,a);this.horizontalLayout_=!1};goog.inherits(Blockly.VerticalFlyout,Blockly.Flyout); Blockly.VerticalFlyout.prototype.getMetrics_=function(){if(!this.isVisible())return null;try{var a=this.workspace_.getCanvas().getBBox()}catch(e){a={height:0,y:0,width:0,x:0}}var b=this.SCROLLBAR_PADDING,c=this.height_-2*this.SCROLLBAR_PADDING,d=this.width_;this.RTL||(d-=this.SCROLLBAR_PADDING);return{viewHeight:c,viewWidth:d,contentHeight:a.height*this.workspace_.scale+2*this.MARGIN,contentWidth:a.width*this.workspace_.scale+2*this.MARGIN,viewTop:-this.workspace_.scrollY+a.y,viewLeft:-this.workspace_.scrollX, contentTop:a.y,contentLeft:a.x,absoluteTop:b,absoluteLeft:0}};Blockly.VerticalFlyout.prototype.setMetrics_=function(a){var b=this.getMetrics_();b&&("number"==typeof a.y&&(this.workspace_.scrollY=-b.contentHeight*a.y),this.workspace_.translate(this.workspace_.scrollX+b.absoluteLeft,this.workspace_.scrollY+b.absoluteTop))}; Blockly.VerticalFlyout.prototype.position=function(){if(this.isVisible()){var a=this.targetWorkspace_.getMetrics();a&&(this.height_=a.viewHeight,this.setBackgroundPath_(this.width_-this.CORNER_RADIUS,a.viewHeight-2*this.CORNER_RADIUS),this.positionAt_(this.width_,this.height_,this.targetWorkspace_.toolboxPosition==this.toolboxPosition_?a.toolboxWidth?this.toolboxPosition_==Blockly.TOOLBOX_AT_LEFT?a.toolboxWidth:a.viewWidth-this.width_:this.toolboxPosition_==Blockly.TOOLBOX_AT_LEFT?0:a.viewWidth:this.toolboxPosition_== @@ -1924,26 +1854,21 @@ d.moveBy(a/this.workspace_.scale-this.MARGIN-Blockly.BlockSvg.TAB_WIDTH-e,0)),d. this.horizontalLayout_&&(this.config_.cssTreeRow+=a.RTL?" blocklyHorizontalTreeRtl":" blocklyHorizontalTree",this.treeSeparatorConfig_.cssTreeRow="blocklyTreeSeparatorHorizontal "+(a.RTL?"blocklyHorizontalTreeRtl":"blocklyHorizontalTree"),this.config_.cssTreeIcon="")};Blockly.Toolbox.prototype.width=0;Blockly.Toolbox.prototype.height=0;Blockly.Toolbox.prototype.selectedOption_=null;Blockly.Toolbox.prototype.lastCategory_=null; Blockly.Toolbox.prototype.init=function(){var a=this.workspace_,b=this.workspace_.getParentSvg();this.HtmlDiv=document.createElement("div");this.HtmlDiv.className="blocklyToolboxDiv";this.HtmlDiv.setAttribute("dir",a.RTL?"RTL":"LTR");b.parentNode.insertBefore(this.HtmlDiv,b);Blockly.bindEventWithChecks_(this.HtmlDiv,"mousedown",this,function(a){Blockly.utils.isRightButton(a)||a.target==this.HtmlDiv?Blockly.hideChaff(!1):Blockly.hideChaff(!0);Blockly.Touch.clearTouchIdentifier()},!1,!0);b={disabledPatternId:a.options.disabledPatternId, parentWorkspace:a,RTL:a.RTL,oneBasedIndex:a.options.oneBasedIndex,horizontalLayout:a.horizontalLayout,toolboxPosition:a.options.toolboxPosition};this.flyout_=null;this.flyout_=a.horizontalLayout?new Blockly.HorizontalFlyout(b):new Blockly.VerticalFlyout(b);Blockly.utils.dom.insertAfter(this.flyout_.createDom("svg"),this.workspace_.getParentSvg());this.flyout_.init(a);this.config_.cleardotPath=a.options.pathToMedia+"1x1.gif";this.config_.cssCollapsedFolderIcon="blocklyTreeIconClosed"+(a.RTL?"Rtl": -"Ltr");this.tree_=b=new Blockly.Toolbox.TreeControl(this,this.config_);b.setShowRootNode(!1);b.setShowLines(!1);b.setShowExpandIcons(!1);b.setSelectedItem(null);a=this.populate_(a.options.languageTree);b.render(this.HtmlDiv);a&&b.setSelectedItem(a);this.addColour_();this.position()};Blockly.Toolbox.prototype.dispose=function(){this.flyout_.dispose();this.tree_.dispose();Blockly.utils.dom.removeNode(this.HtmlDiv);this.lastCategory_=this.workspace_=null};Blockly.Toolbox.prototype.getWidth=function(){return this.width}; -Blockly.Toolbox.prototype.getHeight=function(){return this.height}; +"Ltr");this.tree_=b=new Blockly.tree.TreeControl(this,this.config_);b.setSelectedItem(null);b.onBeforeSelected(this.handleBeforeTreeSelected_);b.onAfterSelected(this.handleAfterTreeSelected_);a=this.populate_(a.options.languageTree);b.render(this.HtmlDiv);a&&b.setSelectedItem(a);this.addColour_();this.position();this.horizontalLayout_&&Blockly.utils.aria.setState(this.tree_.getElement(),Blockly.utils.aria.State.ORIENTATION,"horizontal")}; +Blockly.Toolbox.prototype.handleBeforeTreeSelected_=function(a){if(a==this.tree_)return!1;this.lastCategory_&&(this.lastCategory_.getRowElement().style.backgroundColor="");if(a){var b=a.hexColour||"#57e";a.getRowElement().style.backgroundColor=b;this.addColour_(a)}return!0}; +Blockly.Toolbox.prototype.handleAfterTreeSelected_=function(a,b){b&&b.blocks&&b.blocks.length?(this.flyout_.show(b.blocks),this.lastCategory_!=b&&this.flyout_.scrollToStart()):this.flyout_.hide();if(a!=b&&a!=this){var c=new Blockly.Events.Ui(null,"category",a&&a.getText(),b&&b.getText());c.workspaceId=this.workspace_.id;Blockly.Events.fire(c)}b&&(this.lastCategory_=b)};Blockly.Toolbox.prototype.handleNodeSizeChanged_=function(){Blockly.svgResize(this.workspace_)}; +Blockly.Toolbox.prototype.dispose=function(){this.flyout_.dispose();this.tree_.dispose();Blockly.utils.dom.removeNode(this.HtmlDiv);this.lastCategory_=this.workspace_=null};Blockly.Toolbox.prototype.getWidth=function(){return this.width};Blockly.Toolbox.prototype.getHeight=function(){return this.height}; Blockly.Toolbox.prototype.position=function(){var a=this.HtmlDiv;if(a){var b=this.workspace_.getParentSvg();b=Blockly.svgSize(b);this.horizontalLayout_?(a.style.left="0",a.style.height="auto",a.style.width=b.width+"px",this.height=a.offsetHeight,this.toolboxPosition==Blockly.TOOLBOX_AT_TOP?a.style.top="0":a.style.bottom="0"):(this.toolboxPosition==Blockly.TOOLBOX_AT_RIGHT?a.style.right="0":a.style.left="0",a.style.height=b.height+"px",this.width=a.offsetWidth);this.flyout_.position()}}; Blockly.Toolbox.prototype.populate_=function(a){this.tree_.removeChildren();this.tree_.blocks=[];this.hasColours_=!1;a=this.syncTrees_(a,this.tree_,this.workspace_.options.pathToMedia);if(this.tree_.blocks.length)throw Error("Toolbox cannot have both blocks and categories in the root level.");this.workspace_.resizeContents();return a}; -Blockly.Toolbox.prototype.syncTrees_=function(a,b,c){for(var d=null,e=null,f=0,g;g=a.childNodes[f];f++)if(g.tagName)switch(g.tagName.toUpperCase()){case "CATEGORY":e=Blockly.utils.replaceMessageReferences(g.getAttribute("name"));var h=this.tree_.createNode(e);h.blocks=[];b.add(h);var k=g.getAttribute("custom");k?h.blocks=k:(k=this.syncTrees_(g,h,c))&&(d=k);k=g.getAttribute("categorystyle");var l=g.getAttribute("colour");l&&k?(h.hexColour="",console.warn('Toolbox category "'+e+'" can not have both a style and a colour')): -k?this.setColourFromStyle_(k,h,e):this.setColour_(l,h,e);"true"==g.getAttribute("expanded")?(h.blocks.length&&(d=h),h.setExpanded(!0)):h.setExpanded(!1);e=g;break;case "SEP":if(e&&"CATEGORY"==e.tagName.toUpperCase()){b.add(new Blockly.Toolbox.TreeSeparator(this.treeSeparatorConfig_));break}case "BLOCK":case "SHADOW":case "LABEL":case "BUTTON":b.blocks.push(g),e=g}return d}; +Blockly.Toolbox.prototype.syncTrees_=function(a,b,c){for(var d=null,e=null,f=0,g;g=a.childNodes[f];f++)if(g.tagName)switch(g.tagName.toUpperCase()){case "CATEGORY":e=Blockly.utils.replaceMessageReferences(g.getAttribute("name"));var h=this.tree_.createNode(e);h.onSizeChanged(this.handleNodeSizeChanged_);h.blocks=[];b.add(h);var k=g.getAttribute("custom");k?h.blocks=k:(k=this.syncTrees_(g,h,c))&&(d=k);k=g.getAttribute("categorystyle");var l=g.getAttribute("colour");l&&k?(h.hexColour="",console.warn('Toolbox category "'+ +e+'" can not have both a style and a colour')):k?this.setColourFromStyle_(k,h,e):this.setColour_(l,h,e);"true"==g.getAttribute("expanded")?(h.blocks.length&&(d=h),h.setExpanded(!0)):h.setExpanded(!1);e=g;break;case "SEP":if(e&&"CATEGORY"==e.tagName.toUpperCase()){b.add(new Blockly.Toolbox.TreeSeparator(this.treeSeparatorConfig_));break}case "BLOCK":case "SHADOW":case "LABEL":case "BUTTON":b.blocks.push(g),e=g}return d}; Blockly.Toolbox.prototype.setColour_=function(a,b,c){a=Blockly.utils.replaceMessageReferences(a);if(null===a||""===a)b.hexColour="";else{var d=Number(a);isNaN(d)?(d=Blockly.utils.colour.parse(a))?(b.hexColour=d,this.hasColours_=!0):(b.hexColour="",console.warn('Toolbox category "'+c+'" has unrecognized colour attribute: '+a)):(b.hexColour=Blockly.hueToHex(d),this.hasColours_=!0)}}; Blockly.Toolbox.prototype.setColourFromStyle_=function(a,b,c){if((b.styleName=a)&&Blockly.getTheme()){var d=Blockly.getTheme().getCategoryStyle(a);d&&d.colour?this.setColour_(d.colour,b,c):console.warn('Style "'+a+'" must exist and contain a colour value')}};Blockly.Toolbox.prototype.updateColourFromTheme_=function(a){if(a=a||this.tree_){a=a.getChildren(!1);for(var b=0,c;c=a[b];b++)c.styleName&&(this.setColourFromStyle_(c.styleName,c,""),this.addColour_()),this.updateColourFromTheme_(c)}}; -Blockly.Toolbox.prototype.updateColourFromTheme=function(){var a=this.tree_;a&&(this.updateColourFromTheme_(a),this.updateSelectedItemColour_(a))};Blockly.Toolbox.prototype.updateSelectedItemColour_=function(a){var b=a.selectedItem_;if(b){var c=b.hexColour||"#57e";b.getRowElement().style.backgroundColor=c;a.toolbox_.addColour_(b)}}; +Blockly.Toolbox.prototype.updateColourFromTheme=function(){var a=this.tree_;a&&(this.updateColourFromTheme_(a),this.updateSelectedItemColour_(a))};Blockly.Toolbox.prototype.updateSelectedItemColour_=function(a){if(a=a.getSelectedItem()){var b=a.hexColour||"#57e";a.getRowElement().style.backgroundColor=b;this.addColour_(a)}}; Blockly.Toolbox.prototype.addColour_=function(a){a=(a||this.tree_).getChildren(!1);for(var b=0,c;c=a[b];b++){var d=c.getRowElement();if(d){var e=this.hasColours_?"8px solid "+(c.hexColour||"#ddd"):"none";this.workspace_.RTL?d.style.borderRight=e:d.style.borderLeft=e}this.addColour_(c)}};Blockly.Toolbox.prototype.clearSelection=function(){this.tree_.setSelectedItem(null)};Blockly.Toolbox.prototype.addStyle=function(a){Blockly.utils.dom.addClass(this.HtmlDiv,a)}; Blockly.Toolbox.prototype.removeStyle=function(a){Blockly.utils.dom.removeClass(this.HtmlDiv,a)}; Blockly.Toolbox.prototype.getClientRect=function(){if(!this.HtmlDiv)return null;var a=this.HtmlDiv.getBoundingClientRect(),b=a.top,c=b+a.height,d=a.left;a=d+a.width;return this.toolboxPosition==Blockly.TOOLBOX_AT_TOP?new Blockly.utils.Rect(-1E7,c,-1E7,1E7):this.toolboxPosition==Blockly.TOOLBOX_AT_BOTTOM?new Blockly.utils.Rect(b,1E7,-1E7,1E7):this.toolboxPosition==Blockly.TOOLBOX_AT_LEFT?new Blockly.utils.Rect(-1E7,1E7,-1E7,a):new Blockly.utils.Rect(-1E7,1E7,d,1E7)}; -Blockly.Toolbox.prototype.refreshSelection=function(){var a=this.tree_.getSelectedItem();a&&a.blocks&&this.flyout_.show(a.blocks)};Blockly.Toolbox.TreeControl=function(a,b){this.toolbox_=a;goog.ui.tree.TreeControl.call(this,goog.html.SafeHtml.EMPTY,b)};goog.inherits(Blockly.Toolbox.TreeControl,goog.ui.tree.TreeControl); -Blockly.Toolbox.TreeControl.prototype.enterDocument=function(){Blockly.Toolbox.TreeControl.superClass_.enterDocument.call(this);if(Blockly.Touch.TOUCH_ENABLED){var a=this.getElement();Blockly.bindEventWithChecks_(a,goog.events.EventType.TOUCHEND,this,this.handleTouchEvent_)}};Blockly.Toolbox.TreeControl.prototype.handleTouchEvent_=function(a){var b=this.getNodeFromEvent_(a);b&&a.type===goog.events.EventType.TOUCHEND&&setTimeout(function(){b.onClick_(a)},1)}; -Blockly.Toolbox.TreeControl.prototype.createNode=function(a){a=a?goog.html.SafeHtml.htmlEscape(a):goog.html.SafeHtml.EMPTY;return new Blockly.Toolbox.TreeNode(this.toolbox_,a,this.getConfig())}; -Blockly.Toolbox.TreeControl.prototype.setSelectedItem=function(a){var b=this.toolbox_;if(a!=this.selectedItem_&&a!=b.tree_){b.lastCategory_&&(b.lastCategory_.getRowElement().style.backgroundColor="");if(a){var c=a.hexColour||"#57e";a.getRowElement().style.backgroundColor=c;b.addColour_(a)}c=this.getSelectedItem();goog.ui.tree.TreeControl.prototype.setSelectedItem.call(this,a);a&&a.blocks&&a.blocks.length?(b.flyout_.show(a.blocks),b.lastCategory_!=a&&b.flyout_.scrollToStart()):b.flyout_.hide();c!= -a&&c!=this&&(c=new Blockly.Events.Ui(null,"category",c&&c.getHtml(),a&&a.getHtml()),c.workspaceId=b.workspace_.id,Blockly.Events.fire(c));a&&(b.lastCategory_=a)}};Blockly.Toolbox.TreeNode=function(a,b,c){goog.ui.tree.TreeNode.call(this,b,c);a&&(b=function(){Blockly.svgResize(a.workspace_)},goog.events.listen(a.tree_,goog.ui.tree.BaseNode.EventType.EXPAND,b),goog.events.listen(a.tree_,goog.ui.tree.BaseNode.EventType.COLLAPSE,b))};goog.inherits(Blockly.Toolbox.TreeNode,goog.ui.tree.TreeNode); -Blockly.Toolbox.TreeNode.prototype.getExpandIconSafeHtml=function(){return goog.html.SafeHtml.create("span")};Blockly.Toolbox.TreeNode.prototype.onClick_=function(a){this.hasChildren()&&this.isUserCollapsible_?(this.toggle(),this.select()):this.isSelected()?this.getTree().setSelectedItem(null):this.select();this.updateRow()};Blockly.Toolbox.TreeNode.prototype.onMouseDown=function(a){};Blockly.Toolbox.TreeNode.prototype.onDoubleClick_=function(a){}; -Blockly.Toolbox.TreeNode.prototype.onKeyDown=function(a){if(this.tree.toolbox_.horizontalLayout_){var b={},c=goog.events.KeyCodes.DOWN,d=goog.events.KeyCodes.UP;b[goog.events.KeyCodes.RIGHT]=this.rightToLeft_?d:c;b[goog.events.KeyCodes.LEFT]=this.rightToLeft_?c:d;b[goog.events.KeyCodes.UP]=goog.events.KeyCodes.LEFT;b[goog.events.KeyCodes.DOWN]=goog.events.KeyCodes.RIGHT;a.keyCode=b[a.keyCode]||a.keyCode}return Blockly.Toolbox.TreeNode.superClass_.onKeyDown.call(this,a)}; -Blockly.Toolbox.TreeSeparator=function(a){Blockly.Toolbox.TreeNode.call(this,null,goog.html.SafeHtml.EMPTY,a)};goog.inherits(Blockly.Toolbox.TreeSeparator,Blockly.Toolbox.TreeNode);Blockly.Css={};Blockly.Css.Cursor={OPEN:"handopen",CLOSED:"handclosed",DELETE:"handdelete"};Blockly.Css.currentCursor_="";Blockly.Css.injected_=!1;Blockly.Css.mediaPath_=""; +Blockly.Toolbox.prototype.refreshSelection=function(){var a=this.tree_.getSelectedItem();a&&a.blocks&&this.flyout_.show(a.blocks)};Blockly.Toolbox.TreeSeparator=function(a){Blockly.tree.TreeNode.call(this,null,"",a)};goog.inherits(Blockly.Toolbox.TreeSeparator,Blockly.tree.TreeNode);Blockly.Css={};Blockly.Css.Cursor={OPEN:"handopen",CLOSED:"handclosed",DELETE:"handdelete"};Blockly.Css.currentCursor_="";Blockly.Css.injected_=!1;Blockly.Css.mediaPath_=""; Blockly.Css.inject=function(a,b){if(!Blockly.Css.injected_){Blockly.Css.injected_=!0;var c=".blocklyDraggable {}\n";a&&(c+=Blockly.Css.CONTENT.join("\n"),Blockly.Css.CONTENT=null,Blockly.FieldDate&&(c+=Blockly.FieldDate.CSS.join("\n")));Blockly.Css.mediaPath_=b.replace(/[\\\/]$/,"");c=c.replace(/<<>>/g,Blockly.Css.mediaPath_);var d=document.createElement("style");c=document.createTextNode(c);d.appendChild(c);document.head.insertBefore(d,document.head.firstChild)}};Blockly.Css.setCursor=function(a){console.warn("Deprecated call to Blockly.Css.setCursor. See https://github.com/google/blockly/issues/981 for context")}; Blockly.Css.CONTENT=[".blocklySvg {","background-color: #fff;","outline: none;","overflow: hidden;","position: absolute;","display: block;","}",".blocklyWidgetDiv {","display: none;","position: absolute;","z-index: 99999;","}",".injectionDiv {","height: 100%;","position: relative;","overflow: hidden;","touch-action: none","}",".blocklyNonSelectable {","user-select: none;","-moz-user-select: none;","-ms-user-select: none;","-webkit-user-select: none;","}",".blocklyWsDragSurface {","display: none;", "position: absolute;","top: 0;","left: 0;","}",".blocklyWsDragSurface.blocklyOverflowVisible {","overflow: visible;","}",".blocklyBlockDragSurface {","display: none;","position: absolute;","top: 0;","left: 0;","right: 0;","bottom: 0;","overflow: visible !important;","z-index: 50;","}",".blocklyBlockCanvas.blocklyCanvasTransitioning,",".blocklyBubbleCanvas.blocklyCanvasTransitioning {","transition: transform .5s;","}",".blocklyTooltipDiv {","background-color: #ffffc7;","border: 1px solid #ddc;","box-shadow: 4px 4px 20px 1px rgba(0,0,0,.15);", @@ -1980,13 +1905,15 @@ Blockly.WidgetDiv.hide=function(){Blockly.WidgetDiv.owner_&&(Blockly.WidgetDiv.o Blockly.WidgetDiv.positionInternal_=function(a,b,c){Blockly.WidgetDiv.DIV.style.left=a+"px";Blockly.WidgetDiv.DIV.style.top=b+"px";Blockly.WidgetDiv.DIV.style.height=c+"px"};Blockly.WidgetDiv.positionWithAnchor=function(a,b,c,d){var e=Blockly.WidgetDiv.calculateY_(a,b,c);a=Blockly.WidgetDiv.calculateX_(a,b,c,d);0>e?Blockly.WidgetDiv.positionInternal_(a,0,c.height+e):Blockly.WidgetDiv.positionInternal_(a,e,c.height)}; Blockly.WidgetDiv.calculateX_=function(a,b,c,d){if(d)return b=Math.max(b.right-c.width,a.left),Math.min(b,a.right-c.width);b=Math.min(b.left,a.right-c.width);return Math.max(b,a.left)};Blockly.WidgetDiv.calculateY_=function(a,b,c){return b.bottom+c.height>=a.bottom?b.top-c.height:b.bottom};Blockly.inject=function(a,b){Blockly.checkBlockColourConstants();"string"==typeof a&&(a=document.getElementById(a)||document.querySelector(a));if(!Blockly.utils.dom.containsNode(document,a))throw Error("Error: container is not in current document.");var c=new Blockly.Options(b||{}),d=document.createElement("div");d.className="injectionDiv";a.appendChild(d);var e=Blockly.createDom_(d,c),f=new Blockly.BlockDragSurfaceSvg(d);d=new Blockly.WorkspaceDragSurfaceSvg(d);e=Blockly.createMainWorkspace_(e,c, f,d);Blockly.setTheme(c.theme);Blockly.user.keyMap.setKeyMap(c.keyMap);Blockly.init_(e);Blockly.mainWorkspace=e;Blockly.svgResize(e);return e}; -Blockly.createDom_=function(a,b){a.setAttribute("dir","LTR");goog.ui.Component.setDefaultRightToLeft(b.RTL);Blockly.Css.inject(b.hasCss,b.pathToMedia);var c=Blockly.utils.dom.createSvgElement("svg",{xmlns:Blockly.utils.dom.SVG_NS,"xmlns:html":Blockly.utils.dom.HTML_NS,"xmlns:xlink":Blockly.utils.dom.XLINK_NS,version:"1.1","class":"blocklySvg"},a),d=Blockly.utils.dom.createSvgElement("defs",{},c),e=String(Math.random()).substring(2),f=Blockly.utils.dom.createSvgElement("filter",{id:"blocklyEmbossFilter"+ -e},d);Blockly.utils.dom.createSvgElement("feGaussianBlur",{"in":"SourceAlpha",stdDeviation:1,result:"blur"},f);var g=Blockly.utils.dom.createSvgElement("feSpecularLighting",{"in":"blur",surfaceScale:1,specularConstant:.5,specularExponent:10,"lighting-color":"white",result:"specOut"},f);Blockly.utils.dom.createSvgElement("fePointLight",{x:-5E3,y:-1E4,z:2E4},g);Blockly.utils.dom.createSvgElement("feComposite",{"in":"specOut",in2:"SourceAlpha",operator:"in",result:"specOut"},f);Blockly.utils.dom.createSvgElement("feComposite", -{"in":"SourceGraphic",in2:"specOut",operator:"arithmetic",k1:0,k2:1,k3:1,k4:0},f);b.embossFilterId=f.id;f=Blockly.utils.dom.createSvgElement("pattern",{id:"blocklyDisabledPattern"+e,patternUnits:"userSpaceOnUse",width:10,height:10},d);Blockly.utils.dom.createSvgElement("rect",{width:10,height:10,fill:"#aaa"},f);Blockly.utils.dom.createSvgElement("path",{d:"M 0 0 L 10 10 M 10 0 L 0 10",stroke:"#cc0"},f);b.disabledPatternId=f.id;b.gridPattern=Blockly.Grid.createDom(e,b.gridOptions,d);return c}; -Blockly.createMainWorkspace_=function(a,b,c,d){b.parentWorkspace=null;var e=new Blockly.WorkspaceSvg(b,c,d);e.scale=b.zoomOptions.startScale;a.appendChild(e.createDom("blocklyMainBackground"));!b.hasCategories&&b.languageTree&&(c=e.addFlyout_("svg"),Blockly.utils.dom.insertAfter(c,a));b.hasTrashcan&&e.addTrashcan();b.zoomOptions&&b.zoomOptions.controls&&e.addZoomControls();Blockly.Navigation.setCursor(e.cursor);Blockly.Navigation.setMarker(e.marker);e.translate(0,0);Blockly.mainWorkspace=e;b.readOnly|| -e.isMovable()||e.addChangeListener(function(a){if(!e.isDragging()&&!e.isMovable()&&-1!=Blockly.Events.BUMP_EVENTS.indexOf(a.type)){var b=Object.create(null),c=e.getMetrics(),d=e.scale;b.viewLeft=c.viewLeft/d;b.viewTop=c.viewTop/d;b.viewRight=(c.viewLeft+c.viewWidth)/d;b.viewBottom=(c.viewTop+c.viewHeight)/d;e.isContentBounded()?(c=e.getBlocksBoundingBox(),b.contentLeft=c.left,b.contentTop=c.top,b.contentRight=c.right,b.contentBottom=c.bottom):(b.contentLeft=c.contentLeft/d,b.contentTop=c.contentTop/ -d,b.contentRight=(c.contentLeft+c.contentWidth)/d,b.contentBottom=(c.contentTop+c.contentHeight)/d);if(b.contentTopb.viewBottom||b.contentLeftb.viewRight){c=null;a&&(c=Blockly.Events.getGroup(),Blockly.Events.setGroup(a.group));switch(a.type){case Blockly.Events.BLOCK_CREATE:case Blockly.Events.BLOCK_MOVE:var f=e.getBlockById(a.blockId);f=f.getRootBlock();break;case Blockly.Events.COMMENT_CREATE:case Blockly.Events.COMMENT_MOVE:f=e.getCommentById(a.commentId)}if(f){d= -f.getBoundingRectangle();var n=b.viewTop-d.top;0n&&f.moveBy(0,n);n=b.viewLeft-d.left;0b&&f.moveBy(b,0)}a&&(a.group||console.log("WARNING: Moved object in bounds but there was no event group. This may break undo."),Blockly.Events.setGroup(c))}}});Blockly.svgResize(e);Blockly.WidgetDiv.createDom();Blockly.DropDownDiv.createDom();Blockly.Tooltip.createDom();return e}; +Blockly.createDom_=function(a,b){a.setAttribute("dir","LTR");goog.ui.Component.setDefaultRightToLeft(b.RTL);Blockly.Component.setDefaultRightToLeft(b.RTL);Blockly.Css.inject(b.hasCss,b.pathToMedia);var c=Blockly.utils.dom.createSvgElement("svg",{xmlns:Blockly.utils.dom.SVG_NS,"xmlns:html":Blockly.utils.dom.HTML_NS,"xmlns:xlink":Blockly.utils.dom.XLINK_NS,version:"1.1","class":"blocklySvg"},a),d=Blockly.utils.dom.createSvgElement("defs",{},c),e=String(Math.random()).substring(2),f=Blockly.utils.dom.createSvgElement("filter", +{id:"blocklyEmbossFilter"+e},d);Blockly.utils.dom.createSvgElement("feGaussianBlur",{"in":"SourceAlpha",stdDeviation:1,result:"blur"},f);var g=Blockly.utils.dom.createSvgElement("feSpecularLighting",{"in":"blur",surfaceScale:1,specularConstant:.5,specularExponent:10,"lighting-color":"white",result:"specOut"},f);Blockly.utils.dom.createSvgElement("fePointLight",{x:-5E3,y:-1E4,z:2E4},g);Blockly.utils.dom.createSvgElement("feComposite",{"in":"specOut",in2:"SourceAlpha",operator:"in",result:"specOut"}, +f);Blockly.utils.dom.createSvgElement("feComposite",{"in":"SourceGraphic",in2:"specOut",operator:"arithmetic",k1:0,k2:1,k3:1,k4:0},f);b.embossFilterId=f.id;f=Blockly.utils.dom.createSvgElement("pattern",{id:"blocklyDisabledPattern"+e,patternUnits:"userSpaceOnUse",width:10,height:10},d);Blockly.utils.dom.createSvgElement("rect",{width:10,height:10,fill:"#aaa"},f);Blockly.utils.dom.createSvgElement("path",{d:"M 0 0 L 10 10 M 10 0 L 0 10",stroke:"#cc0"},f);b.disabledPatternId=f.id;b.gridPattern=Blockly.Grid.createDom(e, +b.gridOptions,d);return c}; +Blockly.createMainWorkspace_=function(a,b,c,d){b.parentWorkspace=null;var e=new Blockly.WorkspaceSvg(b,c,d);e.scale=b.zoomOptions.startScale;a.appendChild(e.createDom("blocklyMainBackground"));!b.hasCategories&&b.languageTree&&(c=e.addFlyout_("svg"),Blockly.utils.dom.insertAfter(c,a));b.hasTrashcan&&e.addTrashcan();b.zoomOptions&&b.zoomOptions.controls&&e.addZoomControls();Blockly.navigation.setCursor(e.cursor);Blockly.navigation.setMarker(e.marker);e.translate(0,0);Blockly.mainWorkspace=e;b.readOnly|| +e.isMovable()||e.addChangeListener(function(a){if(!e.isDragging()&&!e.isMovable()&&-1!=Blockly.Events.BUMP_EVENTS.indexOf(a.type)){var b=Object.create(null),c=e.getMetrics(),d=e.scale;b.RTL=e.RTL;b.viewLeft=c.viewLeft/d;b.viewTop=c.viewTop/d;b.viewRight=(c.viewLeft+c.viewWidth)/d;b.viewBottom=(c.viewTop+c.viewHeight)/d;e.isContentBounded()?(c=e.getBlocksBoundingBox(),b.contentLeft=c.left,b.contentTop=c.top,b.contentRight=c.right,b.contentBottom=c.bottom):(b.contentLeft=c.contentLeft/d,b.contentTop= +c.contentTop/d,b.contentRight=(c.contentLeft+c.contentWidth)/d,b.contentBottom=(c.contentTop+c.contentHeight)/d);if(b.contentTopb.viewBottom||b.contentLeftb.viewRight){c=null;a&&(c=Blockly.Events.getGroup(),Blockly.Events.setGroup(a.group));switch(a.type){case Blockly.Events.BLOCK_CREATE:case Blockly.Events.BLOCK_MOVE:var f=e.getBlockById(a.blockId);f=f.getRootBlock();break;case Blockly.Events.COMMENT_CREATE:case Blockly.Events.COMMENT_MOVE:f= +e.getCommentById(a.commentId)}if(f){d=f.getBoundingRectangle();d.height=d.bottom-d.top;d.width=d.right-d.left;var n=b.viewTop,m=b.viewBottom-d.height;m=Math.max(n,m);n=Blockly.utils.math.clamp(n,d.top,m)-d.top;m=b.viewLeft;var p=b.viewRight-d.width;b.RTL?m=Math.min(p,m):p=Math.max(m,p);b=Blockly.utils.math.clamp(m,d.left,p)-d.left;f.moveBy(b,n)}a&&(a.group||console.log("WARNING: Moved object in bounds but there was no event group. This may break undo."),Blockly.Events.setGroup(c))}}});Blockly.svgResize(e); +Blockly.WidgetDiv.createDom();Blockly.DropDownDiv.createDom();Blockly.Tooltip.createDom();return e}; Blockly.init_=function(a){var b=a.options,c=a.getParentSvg();Blockly.bindEventWithChecks_(c.parentNode,"contextmenu",null,function(a){Blockly.utils.isTargetInput(a)||a.preventDefault()});c=Blockly.bindEventWithChecks_(window,"resize",null,function(){Blockly.hideChaff(!0);Blockly.svgResize(a)});a.setResizeHandlerWrapper(c);Blockly.inject.bindDocumentEvents_();b.languageTree&&(a.toolbox_?a.toolbox_.init(a):a.flyout_&&(a.flyout_.init(a),a.flyout_.show(b.languageTree.childNodes),a.flyout_.scrollToStart())); c=Blockly.Scrollbar.scrollbarThickness;b.hasTrashcan&&(c=a.trashcan.init(c));b.zoomOptions&&b.zoomOptions.controls&&a.zoomControls_.init(c);b.moveOptions&&b.moveOptions.scrollbars?(a.scrollbar=new Blockly.ScrollbarPair(a),a.scrollbar.resize()):a.setMetrics({x:.5,y:.5});b.hasSounds&&Blockly.inject.loadSounds_(b.pathToMedia,a)}; Blockly.inject.bindDocumentEvents_=function(){Blockly.documentEventsBound_||(Blockly.bindEventWithChecks_(document,"scroll",null,function(){for(var a=Blockly.Workspace.getAll(),b=0,c;c=a[b];b++)c.updateInverseScreenCTM&&c.updateInverseScreenCTM()}),Blockly.bindEventWithChecks_(document,"keydown",null,Blockly.onKeyDown_),Blockly.bindEvent_(document,"touchend",null,Blockly.longStop_),Blockly.bindEvent_(document,"touchcancel",null,Blockly.longStop_),Blockly.utils.userAgent.IPAD&&Blockly.bindEventWithChecks_(window, @@ -1994,9 +1921,9 @@ Blockly.inject.bindDocumentEvents_=function(){Blockly.documentEventsBound_||(Blo Blockly.inject.loadSounds_=function(a,b){var c=b.getAudioManager();c.load([a+"click.mp3",a+"click.wav",a+"click.ogg"],"click");c.load([a+"disconnect.wav",a+"disconnect.mp3",a+"disconnect.ogg"],"disconnect");c.load([a+"delete.mp3",a+"delete.ogg",a+"delete.wav"],"delete");var d=[],e=function(){for(;d.length;)Blockly.unbindEvent_(d.pop());c.preload()};d.push(Blockly.bindEventWithChecks_(document,"mousemove",null,e,!0));d.push(Blockly.bindEventWithChecks_(document,"touchstart",null,e,!0))}; Blockly.updateToolbox=function(a){console.warn("Deprecated call to Blockly.updateToolbox, use workspace.updateToolbox instead.");Blockly.getMainWorkspace().updateToolbox(a)};var CLOSURE_DEFINES={"goog.DEBUG":!1};Blockly.VERSION="2.20190722.0-develop";Blockly.mainWorkspace=null;Blockly.selected=null;Blockly.cursor=null;Blockly.keyboardAccessibilityMode=!1;Blockly.draggingConnections_=[];Blockly.clipboardXml_=null;Blockly.clipboardSource_=null;Blockly.clipboardTypeCounts_=null;Blockly.cache3dSupported_=null;Blockly.theme_=null;Blockly.svgSize=function(a){return{width:a.cachedWidth_,height:a.cachedHeight_}};Blockly.resizeSvgContents=function(a){a.resizeContents()}; Blockly.svgResize=function(a){for(;a.options.parentWorkspace;)a=a.options.parentWorkspace;var b=a.getParentSvg(),c=b.parentNode;if(c){var d=c.offsetWidth;c=c.offsetHeight;b.cachedWidth_!=d&&(b.setAttribute("width",d+"px"),b.cachedWidth_=d);b.cachedHeight_!=c&&(b.setAttribute("height",c+"px"),b.cachedHeight_=c);a.resize()}}; -Blockly.onKeyDown_=function(a){var b=Blockly.mainWorkspace;if(!(b.options.readOnly||Blockly.utils.isTargetInput(a)||b.rendered&&!b.isVisible())){var c=!1;if(27==a.keyCode)Blockly.hideChaff(),Blockly.keyboardAccessibilityMode&&Blockly.Navigation.navigate(a);else if(8==a.keyCode||46==a.keyCode){a.preventDefault();if(Blockly.Gesture.inProgress())return;Blockly.selected&&Blockly.selected.isDeletable()&&(c=!0)}else if(a.altKey||a.ctrlKey||a.metaKey){if(Blockly.Gesture.inProgress())return;Blockly.selected&& -Blockly.selected.isDeletable()&&Blockly.selected.isMovable()&&(67==a.keyCode?(Blockly.hideChaff(),Blockly.copy_(Blockly.selected)):88!=a.keyCode||Blockly.selected.workspace.isFlyout||(Blockly.copy_(Blockly.selected),c=!0));86==a.keyCode?Blockly.clipboardXml_&&(a=Blockly.clipboardSource_,a.isFlyout&&(a=a.targetWorkspace),Blockly.clipboardTypeCounts_&&a.isCapacityAvailable(Blockly.clipboardTypeCounts_)&&(Blockly.Events.setGroup(!0),a.paste(Blockly.clipboardXml_),Blockly.Events.setGroup(!1))):90==a.keyCode&& -(Blockly.hideChaff(),b.undo(a.shiftKey))}else if(Blockly.keyboardAccessibilityMode&&Blockly.Navigation.navigate(a))return;c&&!Blockly.selected.workspace.isFlyout&&(Blockly.Events.setGroup(!0),Blockly.hideChaff(),Blockly.selected.dispose(!0,!0),Blockly.Events.setGroup(!1))}}; +Blockly.onKeyDown_=function(a){var b=Blockly.mainWorkspace;if(!(b.options.readOnly||Blockly.utils.isTargetInput(a)||b.rendered&&!b.isVisible())){var c=!1;if(27==a.keyCode){if(Blockly.hideChaff(),Blockly.keyboardAccessibilityMode)Blockly.navigation.onKeyPress(a)}else if(8==a.keyCode||46==a.keyCode){a.preventDefault();if(Blockly.Gesture.inProgress())return;Blockly.selected&&Blockly.selected.isDeletable()&&(c=!0)}else if(a.altKey||a.ctrlKey||a.metaKey){if(Blockly.Gesture.inProgress())return;Blockly.selected&& +Blockly.selected.isDeletable()&&Blockly.selected.isMovable()&&(67==a.keyCode?(Blockly.hideChaff(),Blockly.copy_(Blockly.selected)):88!=a.keyCode||Blockly.selected.workspace.isFlyout||(Blockly.copy_(Blockly.selected),c=!0));if(86==a.keyCode)Blockly.clipboardXml_&&(a=Blockly.clipboardSource_,a.isFlyout&&(a=a.targetWorkspace),Blockly.clipboardTypeCounts_&&a.isCapacityAvailable(Blockly.clipboardTypeCounts_)&&(Blockly.Events.setGroup(!0),a.paste(Blockly.clipboardXml_),Blockly.Events.setGroup(!1)));else if(90== +a.keyCode)Blockly.hideChaff(),b.undo(a.shiftKey);else if(Blockly.keyboardAccessibilityMode&&Blockly.navigation.onKeyPress(a))return}else if(Blockly.keyboardAccessibilityMode&&Blockly.navigation.onKeyPress(a))return;c&&!Blockly.selected.workspace.isFlyout&&(Blockly.Events.setGroup(!0),Blockly.hideChaff(),Blockly.selected.dispose(!0,!0),Blockly.Events.setGroup(!1))}}; Blockly.copy_=function(a){if(a.isComment)var b=a.toXmlWithXY();else{b=Blockly.Xml.blockToDom(a,!0);Blockly.Xml.deleteNext(b);var c=a.getRelativeToSurfaceXY();b.setAttribute("x",a.RTL?-c.x:c.x);b.setAttribute("y",c.y)}Blockly.clipboardXml_=b;Blockly.clipboardSource_=a.workspace;Blockly.clipboardTypeCounts_=a.isComment?null:Blockly.utils.getBlockTypeCounts(a,!0)}; Blockly.duplicate_=function(a){var b=Blockly.clipboardXml_,c=Blockly.clipboardSource_;Blockly.copy_(a);a.workspace.paste(Blockly.clipboardXml_);Blockly.clipboardXml_=b;Blockly.clipboardSource_=c};Blockly.onContextMenu_=function(a){Blockly.utils.isTargetInput(a)||a.preventDefault()}; Blockly.hideChaff=function(a){Blockly.Tooltip.hide();Blockly.WidgetDiv.hide();Blockly.DropDownDiv.hideWithoutAnimation();var b=Blockly.getMainWorkspace();b.trashcan&&b.trashcan.flyout_&&b.trashcan.flyout_.hide();a||b.toolbox_&&b.toolbox_.flyout_&&b.toolbox_.flyout_.autoClose&&b.toolbox_.clearSelection()};Blockly.addChangeListener=function(a){console.warn("Deprecated call to Blockly.addChangeListener, use workspace.addChangeListener instead.");return Blockly.getMainWorkspace().addChangeListener(a)}; diff --git a/blockly_uncompressed.js b/blockly_uncompressed.js index cc1a34fa2..8d19d26bf 100644 --- a/blockly_uncompressed.js +++ b/blockly_uncompressed.js @@ -41,11 +41,15 @@ goog.addDependency("../../../" + dir + "/core/block_dragger.js", ['Blockly.Block goog.addDependency("../../../" + dir + "/core/block_events.js", ['Blockly.Events.BlockBase', 'Blockly.Events.BlockChange', 'Blockly.Events.BlockCreate', 'Blockly.Events.BlockDelete', 'Blockly.Events.BlockMove', 'Blockly.Events.Change', 'Blockly.Events.Create', 'Blockly.Events.Delete', 'Blockly.Events.Move'], ['Blockly.Events', 'Blockly.Events.Abstract', 'Blockly.utils.Coordinate', 'Blockly.utils.xml']); goog.addDependency("../../../" + dir + "/core/block_render_svg.js", ['Blockly.BlockSvg.render'], ['Blockly.blockRendering', 'Blockly.BlockSvg', 'Blockly.utils.dom']); goog.addDependency("../../../" + dir + "/core/block_svg.js", ['Blockly.BlockSvg'], ['Blockly.Block', 'Blockly.blockAnimations', 'Blockly.ContextMenu', 'Blockly.Events', 'Blockly.Events.Ui', 'Blockly.Events.BlockMove', 'Blockly.Grid', 'Blockly.Msg', 'Blockly.RenderedConnection', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.Rect']); -goog.addDependency("../../../" + dir + "/core/blockly.js", ['Blockly'], ['Blockly.BlockSvg.render', 'Blockly.Events', 'Blockly.Events.Ui', 'Blockly.FieldAngle', 'Blockly.FieldCheckbox', 'Blockly.FieldColour', 'Blockly.FieldDropdown', 'Blockly.FieldLabelSerializable', 'Blockly.FieldImage', 'Blockly.FieldTextInput', 'Blockly.FieldNumber', 'Blockly.FieldVariable', 'Blockly.Generator', 'Blockly.Navigation', 'Blockly.Procedures', 'Blockly.Toolbox', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.WidgetDiv', 'Blockly.WorkspaceSvg', 'Blockly.constants', 'Blockly.inject', 'Blockly.utils', 'Blockly.Xml']); +goog.addDependency("../../../" + dir + "/core/blockly.js", ['Blockly'], ['Blockly.BlockSvg.render', 'Blockly.Events', 'Blockly.Events.Ui', 'Blockly.FieldAngle', 'Blockly.FieldCheckbox', 'Blockly.FieldColour', 'Blockly.FieldDropdown', 'Blockly.FieldLabelSerializable', 'Blockly.FieldImage', 'Blockly.FieldTextInput', 'Blockly.FieldNumber', 'Blockly.FieldVariable', 'Blockly.Generator', 'Blockly.navigation', 'Blockly.Procedures', 'Blockly.Toolbox', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.WidgetDiv', 'Blockly.WorkspaceSvg', 'Blockly.constants', 'Blockly.inject', 'Blockly.utils', 'Blockly.Xml']); goog.addDependency("../../../" + dir + "/core/blocks.js", ['Blockly.Blocks'], []); goog.addDependency("../../../" + dir + "/core/bubble.js", ['Blockly.Bubble'], ['Blockly.Touch', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.math', 'Blockly.utils.userAgent', 'Blockly.Workspace']); goog.addDependency("../../../" + dir + "/core/bubble_dragger.js", ['Blockly.BubbleDragger'], ['Blockly.Bubble', 'Blockly.Events', 'Blockly.Events.CommentMove', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.WorkspaceCommentSvg']); goog.addDependency("../../../" + dir + "/core/comment.js", ['Blockly.Comment'], ['Blockly.Bubble', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.Ui', 'Blockly.Icon', 'Blockly.utils.dom', 'Blockly.utils.userAgent']); +goog.addDependency("../../../" + dir + "/core/components/component.js", ['Blockly.Component', 'Blockly.Component.Error'], ['Blockly.utils.dom', 'Blockly.utils.IdGenerator', 'Blockly.utils.style']); +goog.addDependency("../../../" + dir + "/core/components/tree/basenode.js", ['Blockly.tree.BaseNode'], ['Blockly.Component', 'Blockly.utils.aria', 'Blockly.utils.KeyCodes', 'Blockly.utils.style']); +goog.addDependency("../../../" + dir + "/core/components/tree/treecontrol.js", ['Blockly.tree.TreeControl'], ['Blockly.tree.TreeNode', 'Blockly.tree.BaseNode', 'Blockly.utils.aria']); +goog.addDependency("../../../" + dir + "/core/components/tree/treenode.js", ['Blockly.tree.TreeNode'], ['Blockly.tree.BaseNode', 'Blockly.utils.KeyCodes']); goog.addDependency("../../../" + dir + "/core/connection.js", ['Blockly.Connection'], ['Blockly.Events', 'Blockly.Events.BlockMove', 'Blockly.Xml']); goog.addDependency("../../../" + dir + "/core/connection_db.js", ['Blockly.ConnectionDB'], ['Blockly.Connection']); goog.addDependency("../../../" + dir + "/core/constants.js", ['Blockly.constants'], []); @@ -77,7 +81,7 @@ goog.addDependency("../../../" + dir + "/core/generator.js", ['Blockly.Generator goog.addDependency("../../../" + dir + "/core/gesture.js", ['Blockly.Gesture'], ['Blockly.blockAnimations', 'Blockly.BlockDragger', 'Blockly.BubbleDragger', 'Blockly.constants', 'Blockly.Events', 'Blockly.Events.Ui', 'Blockly.FlyoutDragger', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.WorkspaceDragger']); goog.addDependency("../../../" + dir + "/core/grid.js", ['Blockly.Grid'], ['Blockly.utils.dom', 'Blockly.utils.userAgent']); goog.addDependency("../../../" + dir + "/core/icon.js", ['Blockly.Icon'], ['Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.dom', 'Blockly.utils.Size']); -goog.addDependency("../../../" + dir + "/core/inject.js", ['Blockly.inject'], ['Blockly.BlockDragSurfaceSvg', 'Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.Events', 'Blockly.Grid', 'Blockly.Options', 'Blockly.Tooltip', 'Blockly.utils', 'Blockly.utils.dom', 'Blockly.utils.userAgent', 'Blockly.WorkspaceDragSurfaceSvg', 'Blockly.WorkspaceSvg', 'goog.ui.Component']); +goog.addDependency("../../../" + dir + "/core/inject.js", ['Blockly.inject'], ['Blockly.BlockDragSurfaceSvg', 'Blockly.Component', 'Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.Events', 'Blockly.Grid', 'Blockly.Options', 'Blockly.Tooltip', 'Blockly.utils', 'Blockly.utils.dom', 'Blockly.utils.userAgent', 'Blockly.WorkspaceDragSurfaceSvg', 'Blockly.WorkspaceSvg', 'goog.ui.Component']); goog.addDependency("../../../" + dir + "/core/input.js", ['Blockly.Input'], ['Blockly.Connection', 'Blockly.FieldLabel']); goog.addDependency("../../../" + dir + "/core/insertion_marker_manager.js", ['Blockly.InsertionMarkerManager'], ['Blockly.blockAnimations', 'Blockly.Events', 'Blockly.RenderedConnection']); goog.addDependency("../../../" + dir + "/core/keyboard_nav/ast_node.js", ['Blockly.ASTNode'], []); @@ -85,7 +89,7 @@ goog.addDependency("../../../" + dir + "/core/keyboard_nav/cursor.js", ['Blockly goog.addDependency("../../../" + dir + "/core/keyboard_nav/cursor_svg.js", ['Blockly.CursorSvg'], ['Blockly.Cursor']); goog.addDependency("../../../" + dir + "/core/keyboard_nav/key_action.js", ['Blockly.Action'], []); goog.addDependency("../../../" + dir + "/core/keyboard_nav/key_map.js", ['Blockly.user.keyMap'], []); -goog.addDependency("../../../" + dir + "/core/keyboard_nav/navigation.js", ['Blockly.Navigation'], ['Blockly.Action', 'Blockly.ASTNode', 'Blockly.user.keyMap']); +goog.addDependency("../../../" + dir + "/core/keyboard_nav/navigation.js", ['Blockly.navigation'], ['Blockly.Action', 'Blockly.ASTNode', 'Blockly.user.keyMap']); goog.addDependency("../../../" + dir + "/core/msg.js", ['Blockly.Msg'], []); goog.addDependency("../../../" + dir + "/core/mutator.js", ['Blockly.Mutator'], ['Blockly.Bubble', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.Ui', 'Blockly.Icon', 'Blockly.utils', 'Blockly.utils.dom', 'Blockly.utils.xml', 'Blockly.WorkspaceSvg', 'Blockly.Xml']); goog.addDependency("../../../" + dir + "/core/names.js", ['Blockly.Names'], []); @@ -105,7 +109,7 @@ goog.addDependency("../../../" + dir + "/core/theme.js", ['Blockly.Theme'], []); goog.addDependency("../../../" + dir + "/core/theme/classic.js", ['Blockly.Themes.Classic'], ['Blockly.Theme']); goog.addDependency("../../../" + dir + "/core/theme/highcontrast.js", ['Blockly.Themes.HighContrast'], ['Blockly.Theme']); goog.addDependency("../../../" + dir + "/core/theme/modern.js", ['Blockly.Themes.Modern'], ['Blockly.Theme']); -goog.addDependency("../../../" + dir + "/core/toolbox.js", ['Blockly.Toolbox'], ['Blockly.Events', 'Blockly.Events.Ui', 'Blockly.Flyout', 'Blockly.HorizontalFlyout', 'Blockly.Touch', 'Blockly.utils', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.Rect', 'Blockly.VerticalFlyout', 'goog.events', 'goog.events.EventType', 'goog.html.SafeHtml', 'goog.ui.tree.BaseNode', 'goog.ui.tree.TreeControl', 'goog.ui.tree.TreeNode']); +goog.addDependency("../../../" + dir + "/core/toolbox.js", ['Blockly.Toolbox'], ['Blockly.Events', 'Blockly.Events.Ui', 'Blockly.Flyout', 'Blockly.HorizontalFlyout', 'Blockly.Touch', 'Blockly.tree.TreeControl', 'Blockly.tree.TreeNode', 'Blockly.utils', 'Blockly.utils.aria', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.Rect', 'Blockly.VerticalFlyout']); goog.addDependency("../../../" + dir + "/core/tooltip.js", ['Blockly.Tooltip'], ['Blockly.utils.string']); goog.addDependency("../../../" + dir + "/core/touch.js", ['Blockly.Touch'], ['Blockly.utils', 'Blockly.utils.string']); goog.addDependency("../../../" + dir + "/core/touch_gesture.js", ['Blockly.TouchGesture'], ['Blockly.Gesture', 'Blockly.utils', 'Blockly.utils.Coordinate']); @@ -113,14 +117,16 @@ goog.addDependency("../../../" + dir + "/core/trashcan.js", ['Blockly.Trashcan'] goog.addDependency("../../../" + dir + "/core/ui_events.js", ['Blockly.Events.Ui'], ['Blockly.Events', 'Blockly.Events.Abstract']); goog.addDependency("../../../" + dir + "/core/ui_menu_utils.js", ['Blockly.utils.uiMenu'], ['Blockly.utils.style']); goog.addDependency("../../../" + dir + "/core/utils.js", ['Blockly.utils'], ['Blockly.Msg', 'Blockly.utils.base', 'Blockly.utils.Coordinate', 'Blockly.utils.string', 'Blockly.utils.userAgent', 'Blockly.utils.style']); +goog.addDependency("../../../" + dir + "/core/utils/aria.js", ['Blockly.utils.aria'], []); goog.addDependency("../../../" + dir + "/core/utils/base.js", ['Blockly.utils.base'], []); goog.addDependency("../../../" + dir + "/core/utils/colour.js", ['Blockly.utils.colour'], ['Blockly.utils']); goog.addDependency("../../../" + dir + "/core/utils/coordinate.js", ['Blockly.utils.Coordinate'], []); goog.addDependency("../../../" + dir + "/core/utils/dom.js", ['Blockly.utils.dom'], []); +goog.addDependency("../../../" + dir + "/core/utils/idgenerator.js", ['Blockly.utils.IdGenerator'], []); +goog.addDependency("../../../" + dir + "/core/utils/keycodes.js", ['Blockly.utils.KeyCodes'], []); goog.addDependency("../../../" + dir + "/core/utils/math.js", ['Blockly.utils.math'], []); goog.addDependency("../../../" + dir + "/core/utils/rect.js", ['Blockly.utils.Rect'], []); goog.addDependency("../../../" + dir + "/core/utils/size.js", ['Blockly.utils.Size'], []); -goog.addDependency("../../../" + dir + "/core/utils/something/something.js", [], []); goog.addDependency("../../../" + dir + "/core/utils/string.js", ['Blockly.utils.string'], []); goog.addDependency("../../../" + dir + "/core/utils/style.js", ['Blockly.utils.style'], ['Blockly.utils.Coordinate', 'Blockly.utils.Size']); goog.addDependency("../../../" + dir + "/core/utils/svg_paths.js", ['Blockly.utils.svgPaths'], []); @@ -708,10 +714,8 @@ goog.addDependency("html/sanitizer/csssanitizer.js", ['goog.html.sanitizer.CssSa goog.addDependency("html/sanitizer/csssanitizer_test.js", [], []); goog.addDependency("html/sanitizer/elementweakmap.js", [], []); goog.addDependency("html/sanitizer/elementweakmap_test.js", [], []); -goog.addDependency("html/sanitizer/html_test_vectors.js", ['goog.html.htmlTestVectors'], []); goog.addDependency("html/sanitizer/htmlsanitizer.js", ['goog.html.sanitizer.HtmlSanitizer', 'goog.html.sanitizer.HtmlSanitizer.Builder', 'goog.html.sanitizer.HtmlSanitizerAttributePolicy', 'goog.html.sanitizer.HtmlSanitizerPolicy', 'goog.html.sanitizer.HtmlSanitizerPolicyContext', 'goog.html.sanitizer.HtmlSanitizerPolicyHints', 'goog.html.sanitizer.HtmlSanitizerUrlPolicy'], ['goog.array', 'goog.asserts', 'goog.dom', 'goog.dom.TagName', 'goog.functions', 'goog.html.SafeHtml', 'goog.html.SafeStyle', 'goog.html.SafeStyleSheet', 'goog.html.SafeUrl', 'goog.html.sanitizer.AttributeSanitizedWhitelist', 'goog.html.sanitizer.AttributeWhitelist', 'goog.html.sanitizer.CssSanitizer', 'goog.html.sanitizer.SafeDomTreeProcessor', 'goog.html.sanitizer.TagBlacklist', 'goog.html.sanitizer.TagWhitelist', 'goog.html.sanitizer.noclobber', 'goog.html.uncheckedconversions', 'goog.object', 'goog.string', 'goog.string.Const']); goog.addDependency("html/sanitizer/htmlsanitizer_test.js", [], []); -goog.addDependency("html/sanitizer/htmlsanitizer_unified_test.js", [], []); goog.addDependency("html/sanitizer/noclobber.js", [], []); goog.addDependency("html/sanitizer/noclobber_test.js", [], []); goog.addDependency("html/sanitizer/safedomtreeprocessor.js", [], []); @@ -762,8 +766,6 @@ goog.addDependency("i18n/datetimesymbols.js", ['goog.i18n.DateTimeSymbols', 'goo goog.addDependency("i18n/datetimesymbolsext.js", ['goog.i18n.DateTimeSymbolsExt', 'goog.i18n.DateTimeSymbols_af_NA', 'goog.i18n.DateTimeSymbols_af_ZA', 'goog.i18n.DateTimeSymbols_agq', 'goog.i18n.DateTimeSymbols_agq_CM', 'goog.i18n.DateTimeSymbols_ak', 'goog.i18n.DateTimeSymbols_ak_GH', 'goog.i18n.DateTimeSymbols_am_ET', 'goog.i18n.DateTimeSymbols_ar_001', 'goog.i18n.DateTimeSymbols_ar_AE', 'goog.i18n.DateTimeSymbols_ar_BH', 'goog.i18n.DateTimeSymbols_ar_DJ', 'goog.i18n.DateTimeSymbols_ar_EH', 'goog.i18n.DateTimeSymbols_ar_ER', 'goog.i18n.DateTimeSymbols_ar_IL', 'goog.i18n.DateTimeSymbols_ar_IQ', 'goog.i18n.DateTimeSymbols_ar_JO', 'goog.i18n.DateTimeSymbols_ar_KM', 'goog.i18n.DateTimeSymbols_ar_KW', 'goog.i18n.DateTimeSymbols_ar_LB', 'goog.i18n.DateTimeSymbols_ar_LY', 'goog.i18n.DateTimeSymbols_ar_MA', 'goog.i18n.DateTimeSymbols_ar_MR', 'goog.i18n.DateTimeSymbols_ar_OM', 'goog.i18n.DateTimeSymbols_ar_PS', 'goog.i18n.DateTimeSymbols_ar_QA', 'goog.i18n.DateTimeSymbols_ar_SA', 'goog.i18n.DateTimeSymbols_ar_SD', 'goog.i18n.DateTimeSymbols_ar_SO', 'goog.i18n.DateTimeSymbols_ar_SS', 'goog.i18n.DateTimeSymbols_ar_SY', 'goog.i18n.DateTimeSymbols_ar_TD', 'goog.i18n.DateTimeSymbols_ar_TN', 'goog.i18n.DateTimeSymbols_ar_XB', 'goog.i18n.DateTimeSymbols_ar_YE', 'goog.i18n.DateTimeSymbols_as', 'goog.i18n.DateTimeSymbols_as_IN', 'goog.i18n.DateTimeSymbols_asa', 'goog.i18n.DateTimeSymbols_asa_TZ', 'goog.i18n.DateTimeSymbols_ast', 'goog.i18n.DateTimeSymbols_ast_ES', 'goog.i18n.DateTimeSymbols_az_Cyrl', 'goog.i18n.DateTimeSymbols_az_Cyrl_AZ', 'goog.i18n.DateTimeSymbols_az_Latn', 'goog.i18n.DateTimeSymbols_az_Latn_AZ', 'goog.i18n.DateTimeSymbols_bas', 'goog.i18n.DateTimeSymbols_bas_CM', 'goog.i18n.DateTimeSymbols_be_BY', 'goog.i18n.DateTimeSymbols_bem', 'goog.i18n.DateTimeSymbols_bem_ZM', 'goog.i18n.DateTimeSymbols_bez', 'goog.i18n.DateTimeSymbols_bez_TZ', 'goog.i18n.DateTimeSymbols_bg_BG', 'goog.i18n.DateTimeSymbols_bm', 'goog.i18n.DateTimeSymbols_bm_ML', 'goog.i18n.DateTimeSymbols_bn_BD', 'goog.i18n.DateTimeSymbols_bn_IN', 'goog.i18n.DateTimeSymbols_bo', 'goog.i18n.DateTimeSymbols_bo_CN', 'goog.i18n.DateTimeSymbols_bo_IN', 'goog.i18n.DateTimeSymbols_br_FR', 'goog.i18n.DateTimeSymbols_brx', 'goog.i18n.DateTimeSymbols_brx_IN', 'goog.i18n.DateTimeSymbols_bs_Cyrl', 'goog.i18n.DateTimeSymbols_bs_Cyrl_BA', 'goog.i18n.DateTimeSymbols_bs_Latn', 'goog.i18n.DateTimeSymbols_bs_Latn_BA', 'goog.i18n.DateTimeSymbols_ca_AD', 'goog.i18n.DateTimeSymbols_ca_ES', 'goog.i18n.DateTimeSymbols_ca_FR', 'goog.i18n.DateTimeSymbols_ca_IT', 'goog.i18n.DateTimeSymbols_ccp', 'goog.i18n.DateTimeSymbols_ccp_BD', 'goog.i18n.DateTimeSymbols_ccp_IN', 'goog.i18n.DateTimeSymbols_ce', 'goog.i18n.DateTimeSymbols_ce_RU', 'goog.i18n.DateTimeSymbols_ceb', 'goog.i18n.DateTimeSymbols_ceb_PH', 'goog.i18n.DateTimeSymbols_cgg', 'goog.i18n.DateTimeSymbols_cgg_UG', 'goog.i18n.DateTimeSymbols_chr_US', 'goog.i18n.DateTimeSymbols_ckb', 'goog.i18n.DateTimeSymbols_ckb_IQ', 'goog.i18n.DateTimeSymbols_ckb_IR', 'goog.i18n.DateTimeSymbols_cs_CZ', 'goog.i18n.DateTimeSymbols_cy_GB', 'goog.i18n.DateTimeSymbols_da_DK', 'goog.i18n.DateTimeSymbols_da_GL', 'goog.i18n.DateTimeSymbols_dav', 'goog.i18n.DateTimeSymbols_dav_KE', 'goog.i18n.DateTimeSymbols_de_BE', 'goog.i18n.DateTimeSymbols_de_DE', 'goog.i18n.DateTimeSymbols_de_IT', 'goog.i18n.DateTimeSymbols_de_LI', 'goog.i18n.DateTimeSymbols_de_LU', 'goog.i18n.DateTimeSymbols_dje', 'goog.i18n.DateTimeSymbols_dje_NE', 'goog.i18n.DateTimeSymbols_dsb', 'goog.i18n.DateTimeSymbols_dsb_DE', 'goog.i18n.DateTimeSymbols_dua', 'goog.i18n.DateTimeSymbols_dua_CM', 'goog.i18n.DateTimeSymbols_dyo', 'goog.i18n.DateTimeSymbols_dyo_SN', 'goog.i18n.DateTimeSymbols_dz', 'goog.i18n.DateTimeSymbols_dz_BT', 'goog.i18n.DateTimeSymbols_ebu', 'goog.i18n.DateTimeSymbols_ebu_KE', 'goog.i18n.DateTimeSymbols_ee', 'goog.i18n.DateTimeSymbols_ee_GH', 'goog.i18n.DateTimeSymbols_ee_TG', 'goog.i18n.DateTimeSymbols_el_CY', 'goog.i18n.DateTimeSymbols_el_GR', 'goog.i18n.DateTimeSymbols_en_001', 'goog.i18n.DateTimeSymbols_en_150', 'goog.i18n.DateTimeSymbols_en_AE', 'goog.i18n.DateTimeSymbols_en_AG', 'goog.i18n.DateTimeSymbols_en_AI', 'goog.i18n.DateTimeSymbols_en_AS', 'goog.i18n.DateTimeSymbols_en_AT', 'goog.i18n.DateTimeSymbols_en_BB', 'goog.i18n.DateTimeSymbols_en_BE', 'goog.i18n.DateTimeSymbols_en_BI', 'goog.i18n.DateTimeSymbols_en_BM', 'goog.i18n.DateTimeSymbols_en_BS', 'goog.i18n.DateTimeSymbols_en_BW', 'goog.i18n.DateTimeSymbols_en_BZ', 'goog.i18n.DateTimeSymbols_en_CC', 'goog.i18n.DateTimeSymbols_en_CH', 'goog.i18n.DateTimeSymbols_en_CK', 'goog.i18n.DateTimeSymbols_en_CM', 'goog.i18n.DateTimeSymbols_en_CX', 'goog.i18n.DateTimeSymbols_en_CY', 'goog.i18n.DateTimeSymbols_en_DE', 'goog.i18n.DateTimeSymbols_en_DG', 'goog.i18n.DateTimeSymbols_en_DK', 'goog.i18n.DateTimeSymbols_en_DM', 'goog.i18n.DateTimeSymbols_en_ER', 'goog.i18n.DateTimeSymbols_en_FI', 'goog.i18n.DateTimeSymbols_en_FJ', 'goog.i18n.DateTimeSymbols_en_FK', 'goog.i18n.DateTimeSymbols_en_FM', 'goog.i18n.DateTimeSymbols_en_GD', 'goog.i18n.DateTimeSymbols_en_GG', 'goog.i18n.DateTimeSymbols_en_GH', 'goog.i18n.DateTimeSymbols_en_GI', 'goog.i18n.DateTimeSymbols_en_GM', 'goog.i18n.DateTimeSymbols_en_GU', 'goog.i18n.DateTimeSymbols_en_GY', 'goog.i18n.DateTimeSymbols_en_HK', 'goog.i18n.DateTimeSymbols_en_IL', 'goog.i18n.DateTimeSymbols_en_IM', 'goog.i18n.DateTimeSymbols_en_IO', 'goog.i18n.DateTimeSymbols_en_JE', 'goog.i18n.DateTimeSymbols_en_JM', 'goog.i18n.DateTimeSymbols_en_KE', 'goog.i18n.DateTimeSymbols_en_KI', 'goog.i18n.DateTimeSymbols_en_KN', 'goog.i18n.DateTimeSymbols_en_KY', 'goog.i18n.DateTimeSymbols_en_LC', 'goog.i18n.DateTimeSymbols_en_LR', 'goog.i18n.DateTimeSymbols_en_LS', 'goog.i18n.DateTimeSymbols_en_MG', 'goog.i18n.DateTimeSymbols_en_MH', 'goog.i18n.DateTimeSymbols_en_MO', 'goog.i18n.DateTimeSymbols_en_MP', 'goog.i18n.DateTimeSymbols_en_MS', 'goog.i18n.DateTimeSymbols_en_MT', 'goog.i18n.DateTimeSymbols_en_MU', 'goog.i18n.DateTimeSymbols_en_MW', 'goog.i18n.DateTimeSymbols_en_MY', 'goog.i18n.DateTimeSymbols_en_NA', 'goog.i18n.DateTimeSymbols_en_NF', 'goog.i18n.DateTimeSymbols_en_NG', 'goog.i18n.DateTimeSymbols_en_NL', 'goog.i18n.DateTimeSymbols_en_NR', 'goog.i18n.DateTimeSymbols_en_NU', 'goog.i18n.DateTimeSymbols_en_NZ', 'goog.i18n.DateTimeSymbols_en_PG', 'goog.i18n.DateTimeSymbols_en_PH', 'goog.i18n.DateTimeSymbols_en_PK', 'goog.i18n.DateTimeSymbols_en_PN', 'goog.i18n.DateTimeSymbols_en_PR', 'goog.i18n.DateTimeSymbols_en_PW', 'goog.i18n.DateTimeSymbols_en_RW', 'goog.i18n.DateTimeSymbols_en_SB', 'goog.i18n.DateTimeSymbols_en_SC', 'goog.i18n.DateTimeSymbols_en_SD', 'goog.i18n.DateTimeSymbols_en_SE', 'goog.i18n.DateTimeSymbols_en_SH', 'goog.i18n.DateTimeSymbols_en_SI', 'goog.i18n.DateTimeSymbols_en_SL', 'goog.i18n.DateTimeSymbols_en_SS', 'goog.i18n.DateTimeSymbols_en_SX', 'goog.i18n.DateTimeSymbols_en_SZ', 'goog.i18n.DateTimeSymbols_en_TC', 'goog.i18n.DateTimeSymbols_en_TK', 'goog.i18n.DateTimeSymbols_en_TO', 'goog.i18n.DateTimeSymbols_en_TT', 'goog.i18n.DateTimeSymbols_en_TV', 'goog.i18n.DateTimeSymbols_en_TZ', 'goog.i18n.DateTimeSymbols_en_UG', 'goog.i18n.DateTimeSymbols_en_UM', 'goog.i18n.DateTimeSymbols_en_US_POSIX', 'goog.i18n.DateTimeSymbols_en_VC', 'goog.i18n.DateTimeSymbols_en_VG', 'goog.i18n.DateTimeSymbols_en_VI', 'goog.i18n.DateTimeSymbols_en_VU', 'goog.i18n.DateTimeSymbols_en_WS', 'goog.i18n.DateTimeSymbols_en_XA', 'goog.i18n.DateTimeSymbols_en_ZM', 'goog.i18n.DateTimeSymbols_en_ZW', 'goog.i18n.DateTimeSymbols_eo', 'goog.i18n.DateTimeSymbols_eo_001', 'goog.i18n.DateTimeSymbols_es_AR', 'goog.i18n.DateTimeSymbols_es_BO', 'goog.i18n.DateTimeSymbols_es_BR', 'goog.i18n.DateTimeSymbols_es_BZ', 'goog.i18n.DateTimeSymbols_es_CL', 'goog.i18n.DateTimeSymbols_es_CO', 'goog.i18n.DateTimeSymbols_es_CR', 'goog.i18n.DateTimeSymbols_es_CU', 'goog.i18n.DateTimeSymbols_es_DO', 'goog.i18n.DateTimeSymbols_es_EA', 'goog.i18n.DateTimeSymbols_es_EC', 'goog.i18n.DateTimeSymbols_es_GQ', 'goog.i18n.DateTimeSymbols_es_GT', 'goog.i18n.DateTimeSymbols_es_HN', 'goog.i18n.DateTimeSymbols_es_IC', 'goog.i18n.DateTimeSymbols_es_NI', 'goog.i18n.DateTimeSymbols_es_PA', 'goog.i18n.DateTimeSymbols_es_PE', 'goog.i18n.DateTimeSymbols_es_PH', 'goog.i18n.DateTimeSymbols_es_PR', 'goog.i18n.DateTimeSymbols_es_PY', 'goog.i18n.DateTimeSymbols_es_SV', 'goog.i18n.DateTimeSymbols_es_UY', 'goog.i18n.DateTimeSymbols_es_VE', 'goog.i18n.DateTimeSymbols_et_EE', 'goog.i18n.DateTimeSymbols_eu_ES', 'goog.i18n.DateTimeSymbols_ewo', 'goog.i18n.DateTimeSymbols_ewo_CM', 'goog.i18n.DateTimeSymbols_fa_AF', 'goog.i18n.DateTimeSymbols_fa_IR', 'goog.i18n.DateTimeSymbols_ff', 'goog.i18n.DateTimeSymbols_ff_Latn', 'goog.i18n.DateTimeSymbols_ff_Latn_BF', 'goog.i18n.DateTimeSymbols_ff_Latn_CM', 'goog.i18n.DateTimeSymbols_ff_Latn_GH', 'goog.i18n.DateTimeSymbols_ff_Latn_GM', 'goog.i18n.DateTimeSymbols_ff_Latn_GN', 'goog.i18n.DateTimeSymbols_ff_Latn_GW', 'goog.i18n.DateTimeSymbols_ff_Latn_LR', 'goog.i18n.DateTimeSymbols_ff_Latn_MR', 'goog.i18n.DateTimeSymbols_ff_Latn_NE', 'goog.i18n.DateTimeSymbols_ff_Latn_NG', 'goog.i18n.DateTimeSymbols_ff_Latn_SL', 'goog.i18n.DateTimeSymbols_ff_Latn_SN', 'goog.i18n.DateTimeSymbols_fi_FI', 'goog.i18n.DateTimeSymbols_fil_PH', 'goog.i18n.DateTimeSymbols_fo', 'goog.i18n.DateTimeSymbols_fo_DK', 'goog.i18n.DateTimeSymbols_fo_FO', 'goog.i18n.DateTimeSymbols_fr_BE', 'goog.i18n.DateTimeSymbols_fr_BF', 'goog.i18n.DateTimeSymbols_fr_BI', 'goog.i18n.DateTimeSymbols_fr_BJ', 'goog.i18n.DateTimeSymbols_fr_BL', 'goog.i18n.DateTimeSymbols_fr_CD', 'goog.i18n.DateTimeSymbols_fr_CF', 'goog.i18n.DateTimeSymbols_fr_CG', 'goog.i18n.DateTimeSymbols_fr_CH', 'goog.i18n.DateTimeSymbols_fr_CI', 'goog.i18n.DateTimeSymbols_fr_CM', 'goog.i18n.DateTimeSymbols_fr_DJ', 'goog.i18n.DateTimeSymbols_fr_DZ', 'goog.i18n.DateTimeSymbols_fr_FR', 'goog.i18n.DateTimeSymbols_fr_GA', 'goog.i18n.DateTimeSymbols_fr_GF', 'goog.i18n.DateTimeSymbols_fr_GN', 'goog.i18n.DateTimeSymbols_fr_GP', 'goog.i18n.DateTimeSymbols_fr_GQ', 'goog.i18n.DateTimeSymbols_fr_HT', 'goog.i18n.DateTimeSymbols_fr_KM', 'goog.i18n.DateTimeSymbols_fr_LU', 'goog.i18n.DateTimeSymbols_fr_MA', 'goog.i18n.DateTimeSymbols_fr_MC', 'goog.i18n.DateTimeSymbols_fr_MF', 'goog.i18n.DateTimeSymbols_fr_MG', 'goog.i18n.DateTimeSymbols_fr_ML', 'goog.i18n.DateTimeSymbols_fr_MQ', 'goog.i18n.DateTimeSymbols_fr_MR', 'goog.i18n.DateTimeSymbols_fr_MU', 'goog.i18n.DateTimeSymbols_fr_NC', 'goog.i18n.DateTimeSymbols_fr_NE', 'goog.i18n.DateTimeSymbols_fr_PF', 'goog.i18n.DateTimeSymbols_fr_PM', 'goog.i18n.DateTimeSymbols_fr_RE', 'goog.i18n.DateTimeSymbols_fr_RW', 'goog.i18n.DateTimeSymbols_fr_SC', 'goog.i18n.DateTimeSymbols_fr_SN', 'goog.i18n.DateTimeSymbols_fr_SY', 'goog.i18n.DateTimeSymbols_fr_TD', 'goog.i18n.DateTimeSymbols_fr_TG', 'goog.i18n.DateTimeSymbols_fr_TN', 'goog.i18n.DateTimeSymbols_fr_VU', 'goog.i18n.DateTimeSymbols_fr_WF', 'goog.i18n.DateTimeSymbols_fr_YT', 'goog.i18n.DateTimeSymbols_fur', 'goog.i18n.DateTimeSymbols_fur_IT', 'goog.i18n.DateTimeSymbols_fy', 'goog.i18n.DateTimeSymbols_fy_NL', 'goog.i18n.DateTimeSymbols_ga_IE', 'goog.i18n.DateTimeSymbols_gd', 'goog.i18n.DateTimeSymbols_gd_GB', 'goog.i18n.DateTimeSymbols_gl_ES', 'goog.i18n.DateTimeSymbols_gsw_CH', 'goog.i18n.DateTimeSymbols_gsw_FR', 'goog.i18n.DateTimeSymbols_gsw_LI', 'goog.i18n.DateTimeSymbols_gu_IN', 'goog.i18n.DateTimeSymbols_guz', 'goog.i18n.DateTimeSymbols_guz_KE', 'goog.i18n.DateTimeSymbols_gv', 'goog.i18n.DateTimeSymbols_gv_IM', 'goog.i18n.DateTimeSymbols_ha', 'goog.i18n.DateTimeSymbols_ha_GH', 'goog.i18n.DateTimeSymbols_ha_NE', 'goog.i18n.DateTimeSymbols_ha_NG', 'goog.i18n.DateTimeSymbols_haw_US', 'goog.i18n.DateTimeSymbols_he_IL', 'goog.i18n.DateTimeSymbols_hi_IN', 'goog.i18n.DateTimeSymbols_hr_BA', 'goog.i18n.DateTimeSymbols_hr_HR', 'goog.i18n.DateTimeSymbols_hsb', 'goog.i18n.DateTimeSymbols_hsb_DE', 'goog.i18n.DateTimeSymbols_hu_HU', 'goog.i18n.DateTimeSymbols_hy_AM', 'goog.i18n.DateTimeSymbols_ia', 'goog.i18n.DateTimeSymbols_ia_001', 'goog.i18n.DateTimeSymbols_id_ID', 'goog.i18n.DateTimeSymbols_ig', 'goog.i18n.DateTimeSymbols_ig_NG', 'goog.i18n.DateTimeSymbols_ii', 'goog.i18n.DateTimeSymbols_ii_CN', 'goog.i18n.DateTimeSymbols_is_IS', 'goog.i18n.DateTimeSymbols_it_CH', 'goog.i18n.DateTimeSymbols_it_IT', 'goog.i18n.DateTimeSymbols_it_SM', 'goog.i18n.DateTimeSymbols_it_VA', 'goog.i18n.DateTimeSymbols_ja_JP', 'goog.i18n.DateTimeSymbols_jgo', 'goog.i18n.DateTimeSymbols_jgo_CM', 'goog.i18n.DateTimeSymbols_jmc', 'goog.i18n.DateTimeSymbols_jmc_TZ', 'goog.i18n.DateTimeSymbols_jv', 'goog.i18n.DateTimeSymbols_jv_ID', 'goog.i18n.DateTimeSymbols_ka_GE', 'goog.i18n.DateTimeSymbols_kab', 'goog.i18n.DateTimeSymbols_kab_DZ', 'goog.i18n.DateTimeSymbols_kam', 'goog.i18n.DateTimeSymbols_kam_KE', 'goog.i18n.DateTimeSymbols_kde', 'goog.i18n.DateTimeSymbols_kde_TZ', 'goog.i18n.DateTimeSymbols_kea', 'goog.i18n.DateTimeSymbols_kea_CV', 'goog.i18n.DateTimeSymbols_khq', 'goog.i18n.DateTimeSymbols_khq_ML', 'goog.i18n.DateTimeSymbols_ki', 'goog.i18n.DateTimeSymbols_ki_KE', 'goog.i18n.DateTimeSymbols_kk_KZ', 'goog.i18n.DateTimeSymbols_kkj', 'goog.i18n.DateTimeSymbols_kkj_CM', 'goog.i18n.DateTimeSymbols_kl', 'goog.i18n.DateTimeSymbols_kl_GL', 'goog.i18n.DateTimeSymbols_kln', 'goog.i18n.DateTimeSymbols_kln_KE', 'goog.i18n.DateTimeSymbols_km_KH', 'goog.i18n.DateTimeSymbols_kn_IN', 'goog.i18n.DateTimeSymbols_ko_KP', 'goog.i18n.DateTimeSymbols_ko_KR', 'goog.i18n.DateTimeSymbols_kok', 'goog.i18n.DateTimeSymbols_kok_IN', 'goog.i18n.DateTimeSymbols_ks', 'goog.i18n.DateTimeSymbols_ks_IN', 'goog.i18n.DateTimeSymbols_ksb', 'goog.i18n.DateTimeSymbols_ksb_TZ', 'goog.i18n.DateTimeSymbols_ksf', 'goog.i18n.DateTimeSymbols_ksf_CM', 'goog.i18n.DateTimeSymbols_ksh', 'goog.i18n.DateTimeSymbols_ksh_DE', 'goog.i18n.DateTimeSymbols_ku', 'goog.i18n.DateTimeSymbols_ku_TR', 'goog.i18n.DateTimeSymbols_kw', 'goog.i18n.DateTimeSymbols_kw_GB', 'goog.i18n.DateTimeSymbols_ky_KG', 'goog.i18n.DateTimeSymbols_lag', 'goog.i18n.DateTimeSymbols_lag_TZ', 'goog.i18n.DateTimeSymbols_lb', 'goog.i18n.DateTimeSymbols_lb_LU', 'goog.i18n.DateTimeSymbols_lg', 'goog.i18n.DateTimeSymbols_lg_UG', 'goog.i18n.DateTimeSymbols_lkt', 'goog.i18n.DateTimeSymbols_lkt_US', 'goog.i18n.DateTimeSymbols_ln_AO', 'goog.i18n.DateTimeSymbols_ln_CD', 'goog.i18n.DateTimeSymbols_ln_CF', 'goog.i18n.DateTimeSymbols_ln_CG', 'goog.i18n.DateTimeSymbols_lo_LA', 'goog.i18n.DateTimeSymbols_lrc', 'goog.i18n.DateTimeSymbols_lrc_IQ', 'goog.i18n.DateTimeSymbols_lrc_IR', 'goog.i18n.DateTimeSymbols_lt_LT', 'goog.i18n.DateTimeSymbols_lu', 'goog.i18n.DateTimeSymbols_lu_CD', 'goog.i18n.DateTimeSymbols_luo', 'goog.i18n.DateTimeSymbols_luo_KE', 'goog.i18n.DateTimeSymbols_luy', 'goog.i18n.DateTimeSymbols_luy_KE', 'goog.i18n.DateTimeSymbols_lv_LV', 'goog.i18n.DateTimeSymbols_mas', 'goog.i18n.DateTimeSymbols_mas_KE', 'goog.i18n.DateTimeSymbols_mas_TZ', 'goog.i18n.DateTimeSymbols_mer', 'goog.i18n.DateTimeSymbols_mer_KE', 'goog.i18n.DateTimeSymbols_mfe', 'goog.i18n.DateTimeSymbols_mfe_MU', 'goog.i18n.DateTimeSymbols_mg', 'goog.i18n.DateTimeSymbols_mg_MG', 'goog.i18n.DateTimeSymbols_mgh', 'goog.i18n.DateTimeSymbols_mgh_MZ', 'goog.i18n.DateTimeSymbols_mgo', 'goog.i18n.DateTimeSymbols_mgo_CM', 'goog.i18n.DateTimeSymbols_mi', 'goog.i18n.DateTimeSymbols_mi_NZ', 'goog.i18n.DateTimeSymbols_mk_MK', 'goog.i18n.DateTimeSymbols_ml_IN', 'goog.i18n.DateTimeSymbols_mn_MN', 'goog.i18n.DateTimeSymbols_mr_IN', 'goog.i18n.DateTimeSymbols_ms_BN', 'goog.i18n.DateTimeSymbols_ms_MY', 'goog.i18n.DateTimeSymbols_ms_SG', 'goog.i18n.DateTimeSymbols_mt_MT', 'goog.i18n.DateTimeSymbols_mua', 'goog.i18n.DateTimeSymbols_mua_CM', 'goog.i18n.DateTimeSymbols_my_MM', 'goog.i18n.DateTimeSymbols_mzn', 'goog.i18n.DateTimeSymbols_mzn_IR', 'goog.i18n.DateTimeSymbols_naq', 'goog.i18n.DateTimeSymbols_naq_NA', 'goog.i18n.DateTimeSymbols_nb_NO', 'goog.i18n.DateTimeSymbols_nb_SJ', 'goog.i18n.DateTimeSymbols_nd', 'goog.i18n.DateTimeSymbols_nd_ZW', 'goog.i18n.DateTimeSymbols_nds', 'goog.i18n.DateTimeSymbols_nds_DE', 'goog.i18n.DateTimeSymbols_nds_NL', 'goog.i18n.DateTimeSymbols_ne_IN', 'goog.i18n.DateTimeSymbols_ne_NP', 'goog.i18n.DateTimeSymbols_nl_AW', 'goog.i18n.DateTimeSymbols_nl_BE', 'goog.i18n.DateTimeSymbols_nl_BQ', 'goog.i18n.DateTimeSymbols_nl_CW', 'goog.i18n.DateTimeSymbols_nl_NL', 'goog.i18n.DateTimeSymbols_nl_SR', 'goog.i18n.DateTimeSymbols_nl_SX', 'goog.i18n.DateTimeSymbols_nmg', 'goog.i18n.DateTimeSymbols_nmg_CM', 'goog.i18n.DateTimeSymbols_nn', 'goog.i18n.DateTimeSymbols_nn_NO', 'goog.i18n.DateTimeSymbols_nnh', 'goog.i18n.DateTimeSymbols_nnh_CM', 'goog.i18n.DateTimeSymbols_nus', 'goog.i18n.DateTimeSymbols_nus_SS', 'goog.i18n.DateTimeSymbols_nyn', 'goog.i18n.DateTimeSymbols_nyn_UG', 'goog.i18n.DateTimeSymbols_om', 'goog.i18n.DateTimeSymbols_om_ET', 'goog.i18n.DateTimeSymbols_om_KE', 'goog.i18n.DateTimeSymbols_or_IN', 'goog.i18n.DateTimeSymbols_os', 'goog.i18n.DateTimeSymbols_os_GE', 'goog.i18n.DateTimeSymbols_os_RU', 'goog.i18n.DateTimeSymbols_pa_Arab', 'goog.i18n.DateTimeSymbols_pa_Arab_PK', 'goog.i18n.DateTimeSymbols_pa_Guru', 'goog.i18n.DateTimeSymbols_pa_Guru_IN', 'goog.i18n.DateTimeSymbols_pl_PL', 'goog.i18n.DateTimeSymbols_ps', 'goog.i18n.DateTimeSymbols_ps_AF', 'goog.i18n.DateTimeSymbols_ps_PK', 'goog.i18n.DateTimeSymbols_pt_AO', 'goog.i18n.DateTimeSymbols_pt_CH', 'goog.i18n.DateTimeSymbols_pt_CV', 'goog.i18n.DateTimeSymbols_pt_GQ', 'goog.i18n.DateTimeSymbols_pt_GW', 'goog.i18n.DateTimeSymbols_pt_LU', 'goog.i18n.DateTimeSymbols_pt_MO', 'goog.i18n.DateTimeSymbols_pt_MZ', 'goog.i18n.DateTimeSymbols_pt_ST', 'goog.i18n.DateTimeSymbols_pt_TL', 'goog.i18n.DateTimeSymbols_qu', 'goog.i18n.DateTimeSymbols_qu_BO', 'goog.i18n.DateTimeSymbols_qu_EC', 'goog.i18n.DateTimeSymbols_qu_PE', 'goog.i18n.DateTimeSymbols_rm', 'goog.i18n.DateTimeSymbols_rm_CH', 'goog.i18n.DateTimeSymbols_rn', 'goog.i18n.DateTimeSymbols_rn_BI', 'goog.i18n.DateTimeSymbols_ro_MD', 'goog.i18n.DateTimeSymbols_ro_RO', 'goog.i18n.DateTimeSymbols_rof', 'goog.i18n.DateTimeSymbols_rof_TZ', 'goog.i18n.DateTimeSymbols_ru_BY', 'goog.i18n.DateTimeSymbols_ru_KG', 'goog.i18n.DateTimeSymbols_ru_KZ', 'goog.i18n.DateTimeSymbols_ru_MD', 'goog.i18n.DateTimeSymbols_ru_RU', 'goog.i18n.DateTimeSymbols_ru_UA', 'goog.i18n.DateTimeSymbols_rw', 'goog.i18n.DateTimeSymbols_rw_RW', 'goog.i18n.DateTimeSymbols_rwk', 'goog.i18n.DateTimeSymbols_rwk_TZ', 'goog.i18n.DateTimeSymbols_sah', 'goog.i18n.DateTimeSymbols_sah_RU', 'goog.i18n.DateTimeSymbols_saq', 'goog.i18n.DateTimeSymbols_saq_KE', 'goog.i18n.DateTimeSymbols_sbp', 'goog.i18n.DateTimeSymbols_sbp_TZ', 'goog.i18n.DateTimeSymbols_sd', 'goog.i18n.DateTimeSymbols_sd_PK', 'goog.i18n.DateTimeSymbols_se', 'goog.i18n.DateTimeSymbols_se_FI', 'goog.i18n.DateTimeSymbols_se_NO', 'goog.i18n.DateTimeSymbols_se_SE', 'goog.i18n.DateTimeSymbols_seh', 'goog.i18n.DateTimeSymbols_seh_MZ', 'goog.i18n.DateTimeSymbols_ses', 'goog.i18n.DateTimeSymbols_ses_ML', 'goog.i18n.DateTimeSymbols_sg', 'goog.i18n.DateTimeSymbols_sg_CF', 'goog.i18n.DateTimeSymbols_shi', 'goog.i18n.DateTimeSymbols_shi_Latn', 'goog.i18n.DateTimeSymbols_shi_Latn_MA', 'goog.i18n.DateTimeSymbols_shi_Tfng', 'goog.i18n.DateTimeSymbols_shi_Tfng_MA', 'goog.i18n.DateTimeSymbols_si_LK', 'goog.i18n.DateTimeSymbols_sk_SK', 'goog.i18n.DateTimeSymbols_sl_SI', 'goog.i18n.DateTimeSymbols_smn', 'goog.i18n.DateTimeSymbols_smn_FI', 'goog.i18n.DateTimeSymbols_sn', 'goog.i18n.DateTimeSymbols_sn_ZW', 'goog.i18n.DateTimeSymbols_so', 'goog.i18n.DateTimeSymbols_so_DJ', 'goog.i18n.DateTimeSymbols_so_ET', 'goog.i18n.DateTimeSymbols_so_KE', 'goog.i18n.DateTimeSymbols_so_SO', 'goog.i18n.DateTimeSymbols_sq_AL', 'goog.i18n.DateTimeSymbols_sq_MK', 'goog.i18n.DateTimeSymbols_sq_XK', 'goog.i18n.DateTimeSymbols_sr_Cyrl', 'goog.i18n.DateTimeSymbols_sr_Cyrl_BA', 'goog.i18n.DateTimeSymbols_sr_Cyrl_ME', 'goog.i18n.DateTimeSymbols_sr_Cyrl_RS', 'goog.i18n.DateTimeSymbols_sr_Cyrl_XK', 'goog.i18n.DateTimeSymbols_sr_Latn_BA', 'goog.i18n.DateTimeSymbols_sr_Latn_ME', 'goog.i18n.DateTimeSymbols_sr_Latn_RS', 'goog.i18n.DateTimeSymbols_sr_Latn_XK', 'goog.i18n.DateTimeSymbols_sv_AX', 'goog.i18n.DateTimeSymbols_sv_FI', 'goog.i18n.DateTimeSymbols_sv_SE', 'goog.i18n.DateTimeSymbols_sw_CD', 'goog.i18n.DateTimeSymbols_sw_KE', 'goog.i18n.DateTimeSymbols_sw_TZ', 'goog.i18n.DateTimeSymbols_sw_UG', 'goog.i18n.DateTimeSymbols_ta_IN', 'goog.i18n.DateTimeSymbols_ta_LK', 'goog.i18n.DateTimeSymbols_ta_MY', 'goog.i18n.DateTimeSymbols_ta_SG', 'goog.i18n.DateTimeSymbols_te_IN', 'goog.i18n.DateTimeSymbols_teo', 'goog.i18n.DateTimeSymbols_teo_KE', 'goog.i18n.DateTimeSymbols_teo_UG', 'goog.i18n.DateTimeSymbols_tg', 'goog.i18n.DateTimeSymbols_tg_TJ', 'goog.i18n.DateTimeSymbols_th_TH', 'goog.i18n.DateTimeSymbols_ti', 'goog.i18n.DateTimeSymbols_ti_ER', 'goog.i18n.DateTimeSymbols_ti_ET', 'goog.i18n.DateTimeSymbols_tk', 'goog.i18n.DateTimeSymbols_tk_TM', 'goog.i18n.DateTimeSymbols_to', 'goog.i18n.DateTimeSymbols_to_TO', 'goog.i18n.DateTimeSymbols_tr_CY', 'goog.i18n.DateTimeSymbols_tr_TR', 'goog.i18n.DateTimeSymbols_tt', 'goog.i18n.DateTimeSymbols_tt_RU', 'goog.i18n.DateTimeSymbols_twq', 'goog.i18n.DateTimeSymbols_twq_NE', 'goog.i18n.DateTimeSymbols_tzm', 'goog.i18n.DateTimeSymbols_tzm_MA', 'goog.i18n.DateTimeSymbols_ug', 'goog.i18n.DateTimeSymbols_ug_CN', 'goog.i18n.DateTimeSymbols_uk_UA', 'goog.i18n.DateTimeSymbols_ur_IN', 'goog.i18n.DateTimeSymbols_ur_PK', 'goog.i18n.DateTimeSymbols_uz_Arab', 'goog.i18n.DateTimeSymbols_uz_Arab_AF', 'goog.i18n.DateTimeSymbols_uz_Cyrl', 'goog.i18n.DateTimeSymbols_uz_Cyrl_UZ', 'goog.i18n.DateTimeSymbols_uz_Latn', 'goog.i18n.DateTimeSymbols_uz_Latn_UZ', 'goog.i18n.DateTimeSymbols_vai', 'goog.i18n.DateTimeSymbols_vai_Latn', 'goog.i18n.DateTimeSymbols_vai_Latn_LR', 'goog.i18n.DateTimeSymbols_vai_Vaii', 'goog.i18n.DateTimeSymbols_vai_Vaii_LR', 'goog.i18n.DateTimeSymbols_vi_VN', 'goog.i18n.DateTimeSymbols_vun', 'goog.i18n.DateTimeSymbols_vun_TZ', 'goog.i18n.DateTimeSymbols_wae', 'goog.i18n.DateTimeSymbols_wae_CH', 'goog.i18n.DateTimeSymbols_wo', 'goog.i18n.DateTimeSymbols_wo_SN', 'goog.i18n.DateTimeSymbols_xh', 'goog.i18n.DateTimeSymbols_xh_ZA', 'goog.i18n.DateTimeSymbols_xog', 'goog.i18n.DateTimeSymbols_xog_UG', 'goog.i18n.DateTimeSymbols_yav', 'goog.i18n.DateTimeSymbols_yav_CM', 'goog.i18n.DateTimeSymbols_yi', 'goog.i18n.DateTimeSymbols_yi_001', 'goog.i18n.DateTimeSymbols_yo', 'goog.i18n.DateTimeSymbols_yo_BJ', 'goog.i18n.DateTimeSymbols_yo_NG', 'goog.i18n.DateTimeSymbols_yue', 'goog.i18n.DateTimeSymbols_yue_Hans', 'goog.i18n.DateTimeSymbols_yue_Hans_CN', 'goog.i18n.DateTimeSymbols_yue_Hant', 'goog.i18n.DateTimeSymbols_yue_Hant_HK', 'goog.i18n.DateTimeSymbols_zgh', 'goog.i18n.DateTimeSymbols_zgh_MA', 'goog.i18n.DateTimeSymbols_zh_Hans', 'goog.i18n.DateTimeSymbols_zh_Hans_CN', 'goog.i18n.DateTimeSymbols_zh_Hans_HK', 'goog.i18n.DateTimeSymbols_zh_Hans_MO', 'goog.i18n.DateTimeSymbols_zh_Hans_SG', 'goog.i18n.DateTimeSymbols_zh_Hant', 'goog.i18n.DateTimeSymbols_zh_Hant_HK', 'goog.i18n.DateTimeSymbols_zh_Hant_MO', 'goog.i18n.DateTimeSymbols_zh_Hant_TW', 'goog.i18n.DateTimeSymbols_zu_ZA'], ['goog.i18n.DateTimeSymbols']); goog.addDependency("i18n/graphemebreak.js", ['goog.i18n.GraphemeBreak'], ['goog.asserts', 'goog.i18n.uChar', 'goog.structs.InversionMap']); goog.addDependency("i18n/graphemebreak_test.js", [], []); -goog.addDependency("i18n/localefeature.js", [], []); -goog.addDependency("i18n/localefeature_test.js", [], []); goog.addDependency("i18n/messageformat.js", ['goog.i18n.MessageFormat'], ['goog.array', 'goog.asserts', 'goog.i18n.CompactNumberFormatSymbols', 'goog.i18n.NumberFormat', 'goog.i18n.NumberFormatSymbols', 'goog.i18n.ordinalRules', 'goog.i18n.pluralRules']); goog.addDependency("i18n/messageformat_test.js", [], []); goog.addDependency("i18n/mime.js", ['goog.i18n.mime', 'goog.i18n.mime.encode'], ['goog.array', 'goog.i18n.uChar']); @@ -994,7 +996,7 @@ goog.addDependency("module/moduleinfo.js", ['goog.module.ModuleInfo'], ['goog.Di goog.addDependency("module/moduleinfo_test.js", [], []); goog.addDependency("module/moduleloadcallback.js", ['goog.module.ModuleLoadCallback'], ['goog.debug.entryPointRegistry', 'goog.module']); goog.addDependency("module/moduleloadcallback_test.js", [], []); -goog.addDependency("module/moduleloader.js", ['goog.module.ModuleLoader'], ['goog.Timer', 'goog.array', 'goog.asserts', 'goog.dom', 'goog.dom.safe', 'goog.events', 'goog.events.Event', 'goog.events.EventHandler', 'goog.events.EventId', 'goog.events.EventTarget', 'goog.functions', 'goog.html.TrustedResourceUrl', 'goog.labs.userAgent.browser', 'goog.log', 'goog.module.AbstractModuleLoader', 'goog.net.BulkLoader', 'goog.net.EventType', 'goog.net.jsloader', 'goog.userAgent', 'goog.userAgent.product']); +goog.addDependency("module/moduleloader.js", ['goog.module.ModuleLoader'], ['goog.Timer', 'goog.array', 'goog.asserts', 'goog.dom', 'goog.dom.safe', 'goog.events', 'goog.events.Event', 'goog.events.EventHandler', 'goog.events.EventId', 'goog.events.EventTarget', 'goog.html.TrustedResourceUrl', 'goog.labs.userAgent.browser', 'goog.log', 'goog.module.AbstractModuleLoader', 'goog.net.BulkLoader', 'goog.net.EventType', 'goog.net.jsloader', 'goog.userAgent', 'goog.userAgent.product']); goog.addDependency("module/moduleloader_test.js", ['goog.module.ModuleLoaderTest'], ['goog.Promise', 'goog.array', 'goog.dom', 'goog.dom.TagName', 'goog.events', 'goog.functions', 'goog.html.TrustedResourceUrl', 'goog.loader.activeModuleManager', 'goog.module.ModuleLoader', 'goog.module.ModuleManager', 'goog.net.BulkLoader', 'goog.net.XmlHttp', 'goog.object', 'goog.string.Const', 'goog.testing.PropertyReplacer', 'goog.testing.TestCase', 'goog.testing.events.EventObserver', 'goog.testing.jsunit', 'goog.userAgent']); goog.addDependency("module/modulemanager.js", ['goog.module.ModuleManager', 'goog.module.ModuleManager.CallbackType', 'goog.module.ModuleManager.FailureType'], ['goog.array', 'goog.asserts', 'goog.async.Deferred', 'goog.debug.Trace', 'goog.disposable.IDisposable', 'goog.disposeAll', 'goog.loader.AbstractModuleManager', 'goog.loader.activeModuleManager', 'goog.log', 'goog.module', 'goog.module.ModuleInfo', 'goog.module.ModuleLoadCallback', 'goog.object']); goog.addDependency("module/modulemanager_test.js", ['goog.module.ModuleManagerTest'], ['goog.array', 'goog.functions', 'goog.module.BaseModule', 'goog.module.ModuleManager', 'goog.testing', 'goog.testing.MockClock', 'goog.testing.jsunit', 'goog.testing.recordFunction']); @@ -1204,17 +1206,7 @@ goog.addDependency("storage/richstorage_test.js", [], []); goog.addDependency("storage/storage.js", ['goog.storage.Storage'], ['goog.json', 'goog.storage.ErrorCode']); goog.addDependency("storage/storage_test.js", [], []); goog.addDependency("storage/storagetester.js", ['goog.storage.storageTester'], ['goog.storage.Storage', 'goog.structs.Map', 'goog.testing.asserts']); -goog.addDependency("streams/defines.js", [], []); -goog.addDependency("streams/full.js", [], []); -goog.addDependency("streams/full_lite_test.js", [], []); -goog.addDependency("streams/full_test.js", [], []); goog.addDependency("streams/lite.js", [], []); -goog.addDependency("streams/lite_impl.js", [], []); -goog.addDependency("streams/lite_impl_test.js", [], []); -goog.addDependency("streams/lite_native_impl.js", [], []); -goog.addDependency("streams/lite_native_impl_test.js", [], []); -goog.addDependency("streams/lite_test_cases.js", [], ['goog.testing.jsunit']); -goog.addDependency("streams/lite_types.js", [], []); goog.addDependency("string/const.js", ['goog.string.Const'], ['goog.asserts', 'goog.string.TypedString']); goog.addDependency("string/const_test.js", [], []); goog.addDependency("string/internal.js", ['goog.string.internal'], []); @@ -1797,6 +1789,8 @@ goog.require('Blockly.Blocks'); goog.require('Blockly.Bubble'); goog.require('Blockly.BubbleDragger'); goog.require('Blockly.Comment'); +goog.require('Blockly.Component'); +goog.require('Blockly.Component.Error'); goog.require('Blockly.Connection'); goog.require('Blockly.ConnectionDB'); goog.require('Blockly.ContextMenu'); @@ -1853,7 +1847,6 @@ goog.require('Blockly.InsertionMarkerManager'); goog.require('Blockly.Msg'); goog.require('Blockly.Mutator'); goog.require('Blockly.Names'); -goog.require('Blockly.Navigation'); goog.require('Blockly.Options'); goog.require('Blockly.Procedures'); goog.require('Blockly.RenderedConnection'); @@ -1896,11 +1889,18 @@ goog.require('Blockly.blockRendering.constants'); goog.require('Blockly.blockRendering.highlightConstants'); goog.require('Blockly.constants'); goog.require('Blockly.inject'); +goog.require('Blockly.navigation'); +goog.require('Blockly.tree.BaseNode'); +goog.require('Blockly.tree.TreeControl'); +goog.require('Blockly.tree.TreeNode'); goog.require('Blockly.user.keyMap'); goog.require('Blockly.utils'); goog.require('Blockly.utils.Coordinate'); +goog.require('Blockly.utils.IdGenerator'); +goog.require('Blockly.utils.KeyCodes'); goog.require('Blockly.utils.Rect'); goog.require('Blockly.utils.Size'); +goog.require('Blockly.utils.aria'); goog.require('Blockly.utils.base'); goog.require('Blockly.utils.colour'); goog.require('Blockly.utils.dom'); diff --git a/core/components/tree/basenode.js b/core/components/tree/basenode.js index 33ae3bf89..e353318e9 100644 --- a/core/components/tree/basenode.js +++ b/core/components/tree/basenode.js @@ -1210,6 +1210,9 @@ Blockly.tree.BaseNode.prototype.getPreviousShownNode = function() { } var parent = this.getParent(); var tree = this.getTree(); + if (parent == tree) { + return null; + } // The root is the first node. if (this == tree) { return null; diff --git a/core/inject.js b/core/inject.js index 25156aac1..fe70f5e2a 100644 --- a/core/inject.js +++ b/core/inject.js @@ -27,6 +27,7 @@ goog.provide('Blockly.inject'); goog.require('Blockly.BlockDragSurfaceSvg'); +goog.require('Blockly.Component'); goog.require('Blockly.Css'); goog.require('Blockly.DropDownDiv'); goog.require('Blockly.Events'); @@ -96,8 +97,11 @@ Blockly.createDom_ = function(container, options) { // out content in RTL mode. Therefore Blockly forces the use of LTR, // then manually positions content in RTL as needed. container.setAttribute('dir', 'LTR'); + // TODO(samelh): Remove this once we no longer need goog.ui.Component // Closure can be trusted to create HTML widgets with the proper direction. goog.ui.Component.setDefaultRightToLeft(options.RTL); + // Set the default direction for Components to use. + Blockly.Component.setDefaultRightToLeft(options.RTL); // Load CSS. Blockly.Css.inject(options.hasCss, options.pathToMedia); diff --git a/core/keyboard_nav/navigation.js b/core/keyboard_nav/navigation.js index b9d9defdc..83ca65633 100644 --- a/core/keyboard_nav/navigation.js +++ b/core/keyboard_nav/navigation.js @@ -41,7 +41,7 @@ Blockly.navigation.marker_ = null; /** * The current selected category if the toolbox is open or * last selected category if focus is on a different element. - * @type {goog.ui.tree.BaseNode} + * @type {Blockly.tree.BaseNode} * @private */ Blockly.navigation.currentCategory_ = null; @@ -225,10 +225,10 @@ Blockly.navigation.outCategory = function() { } else { var parent = curCategory.getParent(); var tree = curCategory.getTree(); - if (parent && (tree.getShowRootNode() || parent != tree)) { + if (parent && parent != tree) { parent.select(); - Blockly.navigation.currentCategory_ = /** @type {goog.ui.tree.BaseNode} */ + Blockly.navigation.currentCategory_ = /** @type {Blockly.tree.BaseNode} */ (parent); } } diff --git a/core/toolbox.js b/core/toolbox.js index d0619276d..f4c0e5f0c 100644 --- a/core/toolbox.js +++ b/core/toolbox.js @@ -31,19 +31,15 @@ goog.require('Blockly.Events.Ui'); goog.require('Blockly.Flyout'); goog.require('Blockly.HorizontalFlyout'); goog.require('Blockly.Touch'); +goog.require('Blockly.tree.TreeControl'); +goog.require('Blockly.tree.TreeNode'); goog.require('Blockly.utils'); +goog.require('Blockly.utils.aria'); goog.require('Blockly.utils.colour'); goog.require('Blockly.utils.dom'); goog.require('Blockly.utils.Rect'); goog.require('Blockly.VerticalFlyout'); -goog.require('goog.events'); -goog.require('goog.events.EventType'); -goog.require('goog.html.SafeHtml'); -goog.require('goog.ui.tree.BaseNode'); -goog.require('goog.ui.tree.TreeControl'); -goog.require('goog.ui.tree.TreeNode'); - /** * Class for a Toolbox. @@ -141,7 +137,7 @@ Blockly.Toolbox.prototype.selectedOption_ = null; /** * The tree node most recently selected. - * @type {goog.ui.tree.BaseNode} + * @type {Blockly.tree.BaseNode} * @private */ Blockly.Toolbox.prototype.lastCategory_ = null; @@ -200,12 +196,11 @@ Blockly.Toolbox.prototype.init = function() { this.config_['cleardotPath'] = workspace.options.pathToMedia + '1x1.gif'; this.config_['cssCollapsedFolderIcon'] = 'blocklyTreeIconClosed' + (workspace.RTL ? 'Rtl' : 'Ltr'); - var tree = new Blockly.Toolbox.TreeControl(this, this.config_); + var tree = new Blockly.tree.TreeControl(this, this.config_); this.tree_ = tree; - tree.setShowRootNode(false); - tree.setShowLines(false); - tree.setShowExpandIcons(false); tree.setSelectedItem(null); + tree.onBeforeSelected(this.handleBeforeTreeSelected_); + tree.onAfterSelected(this.handleAfterTreeSelected_); var openNode = this.populate_(workspace.options.languageTree); tree.render(this.HtmlDiv); if (openNode) { @@ -213,6 +208,74 @@ Blockly.Toolbox.prototype.init = function() { } this.addColour_(); this.position(); + + // Trees have an implicit orientation of vertical, so we only need to set this + // when the toolbox is in horizontal mode. + if (this.horizontalLayout_) { + Blockly.utils.aria.setState(this.tree_.getElement(), + Blockly.utils.aria.State.ORIENTATION, 'horizontal'); + } +}; + +/** + * Handle the before tree item selected action. + * @param {Blockly.tree.BaseNode} node The newly selected node. + * @returns {boolean} Whether or not to cancel selecting the node. + * @private + */ +Blockly.Toolbox.prototype.handleBeforeTreeSelected_ = function(node) { + if (node == this.tree_) { + return false; + } + if (this.lastCategory_) { + this.lastCategory_.getRowElement().style.backgroundColor = ''; + } + if (node) { + var hexColour = node.hexColour || '#57e'; + node.getRowElement().style.backgroundColor = hexColour; + // Add colours to child nodes which may have been collapsed and thus + // not rendered. + this.addColour_(node); + } + return true; +}; + +/** + * Handle the after tree item selected action. + * @param {Blockly.tree.BaseNode} oldNode The previously selected node. + * @param {Blockly.tree.BaseNode} newNode The newly selected node. + * @private + */ +Blockly.Toolbox.prototype.handleAfterTreeSelected_ = function(oldNode, newNode) { + if (newNode && newNode.blocks && newNode.blocks.length) { + this.flyout_.show(newNode.blocks); + // Scroll the flyout to the top if the category has changed. + if (this.lastCategory_ != newNode) { + this.flyout_.scrollToStart(); + } + } else { + // Hide the flyout. + this.flyout_.hide(); + } + if (oldNode != newNode && oldNode != this) { + var event = new Blockly.Events.Ui(null, 'category', + oldNode && oldNode.getText(), newNode && newNode.getText()); + event.workspaceId = this.workspace_.id; + Blockly.Events.fire(event); + } + if (newNode) { + this.lastCategory_ = newNode; + } +}; + +/** + * Handle a node sized changed event. + * @private + */ +Blockly.Toolbox.prototype.handleNodeSizeChanged_ = function() { + // Even though the div hasn't changed size, the visible workspace + // surface of the workspace has, so we may need to reposition everything. + Blockly.svgResize(this.workspace_); }; /** @@ -301,8 +364,8 @@ Blockly.Toolbox.prototype.populate_ = function(newTree) { /** * Sync trees of the toolbox. * @param {!Node} treeIn DOM tree of blocks. - * @param {!Blockly.Toolbox.TreeControl} treeOut The TreeContorol object built - * from treeIn. + * @param {!Blockly.tree.BaseNode} treeOut The TreeControl or TreeNode + * object built from treeIn. * @param {string} pathToMedia The path to the Blockly media directory. * @return {Node} Tree node to open at startup (or null). * @private @@ -322,6 +385,7 @@ Blockly.Toolbox.prototype.syncTrees_ = function(treeIn, treeOut, pathToMedia) { var categoryName = Blockly.utils.replaceMessageReferences( childIn.getAttribute('name')); var childOut = this.tree_.createNode(categoryName); + childOut.onSizeChanged(this.handleNodeSizeChanged_); childOut.blocks = []; treeOut.add(childOut); var custom = childIn.getAttribute('custom'); @@ -385,7 +449,7 @@ Blockly.Toolbox.prototype.syncTrees_ = function(treeIn, treeOut, pathToMedia) { * Sets the colour on the category. * @param {number|string} colourValue HSV hue value (0 to 360), #RRGGBB string, * or a message reference string pointing to one of those two values. - * @param {Blockly.Toolbox.TreeNode} childOut The child to set the hexColour on. + * @param {Blockly.tree.TreeNode} childOut The child to set the hexColour on. * @param {string} categoryName Name of the toolbox category. * @private */ @@ -420,7 +484,7 @@ Blockly.Toolbox.prototype.setColour_ = function(colourValue, childOut, * Retrieves and sets the colour for the category using the style name. * The category colour is set from the colour style attribute. * @param {string} styleName Name of the style. - * @param {!Blockly.Toolbox.TreeNode} childOut The child to set the hexColour on. + * @param {!Blockly.tree.TreeNode} childOut The child to set the hexColour on. * @param {string} categoryName Name of the toolbox category. */ Blockly.Toolbox.prototype.setColourFromStyle_ = function( @@ -439,7 +503,7 @@ Blockly.Toolbox.prototype.setColourFromStyle_ = function( /** * Recursively updates all the category colours using the category style name. - * @param {Blockly.Toolbox.TreeNode=} opt_tree Starting point of tree. + * @param {Blockly.tree.BaseNode=} opt_tree Starting point of tree. * Defaults to the root node. * @private */ @@ -470,23 +534,23 @@ Blockly.Toolbox.prototype.updateColourFromTheme = function() { /** * Updates the background colour of the selected category. - * @param {!Blockly.Toolbox.TreeNode} tree Starting point of tree. + * @param {!Blockly.tree.BaseNode} tree Starting point of tree. * Defaults to the root node. * @private */ Blockly.Toolbox.prototype.updateSelectedItemColour_ = function(tree) { - var selectedItem = tree.selectedItem_; + var selectedItem = tree.getSelectedItem(); if (selectedItem) { var hexColour = selectedItem.hexColour || '#57e'; selectedItem.getRowElement().style.backgroundColor = hexColour; - tree.toolbox_.addColour_(selectedItem); + this.addColour_(selectedItem); } }; /** * Recursively add colours to this toolbox. - * @param {Blockly.Toolbox.TreeNode=} opt_tree Starting point of tree. + * @param {Blockly.tree.BaseNode=} opt_tree Starting point of tree. * Defaults to the root node. * @private */ @@ -581,215 +645,13 @@ Blockly.Toolbox.prototype.refreshSelection = function() { } }; -// Extending Closure's Tree UI. - -/** - * Extension of a TreeControl object that uses a custom tree node. - * @param {Blockly.Toolbox} toolbox The parent toolbox for this tree. - * @param {Object} config The configuration for the tree. See - * goog.ui.tree.TreeControl.DefaultConfig. - * @constructor - * @extends {goog.ui.tree.TreeControl} - */ -Blockly.Toolbox.TreeControl = function(toolbox, config) { - this.toolbox_ = toolbox; - goog.ui.tree.TreeControl.call(this, goog.html.SafeHtml.EMPTY, config); -}; -goog.inherits(Blockly.Toolbox.TreeControl, goog.ui.tree.TreeControl); - -/** - * Adds touch handling to TreeControl. - * @override - */ -Blockly.Toolbox.TreeControl.prototype.enterDocument = function() { - Blockly.Toolbox.TreeControl.superClass_.enterDocument.call(this); - - // Add touch handler. - if (Blockly.Touch.TOUCH_ENABLED) { - var el = this.getElement(); - Blockly.bindEventWithChecks_(el, goog.events.EventType.TOUCHEND, this, - this.handleTouchEvent_); - } -}; - -/** - * Handles touch events. - * @param {!goog.events.BrowserEvent} e The browser event. - * @private - */ -Blockly.Toolbox.TreeControl.prototype.handleTouchEvent_ = function(e) { - var node = this.getNodeFromEvent_(e); - if (node && e.type === goog.events.EventType.TOUCHEND) { - // Fire asynchronously since onMouseDown takes long enough that the browser - // would fire the default mouse event before this method returns. - setTimeout(function() { - node.onClick_(e); // Same behaviour for click and touch. - }, 1); - } -}; - -/** - * Creates a new tree node using a custom tree node. - * @param {string=} opt_html The HTML content of the node label. - * @return {!goog.ui.tree.TreeNode} The new item. - * @override - */ -Blockly.Toolbox.TreeControl.prototype.createNode = function(opt_html) { - var html = opt_html ? - goog.html.SafeHtml.htmlEscape(opt_html) : goog.html.SafeHtml.EMPTY; - return new Blockly.Toolbox.TreeNode(this.toolbox_, html, this.getConfig()); -}; - -/** - * Display/hide the flyout when an item is selected. - * @param {goog.ui.tree.BaseNode} node The item to select. - * @override - */ -Blockly.Toolbox.TreeControl.prototype.setSelectedItem = function(node) { - var toolbox = this.toolbox_; - if (node == this.selectedItem_ || node == toolbox.tree_) { - return; - } - if (toolbox.lastCategory_) { - toolbox.lastCategory_.getRowElement().style.backgroundColor = ''; - } - if (node) { - var hexColour = node.hexColour || '#57e'; - node.getRowElement().style.backgroundColor = hexColour; - // Add colours to child nodes which may have been collapsed and thus - // not rendered. - toolbox.addColour_(node); - } - var oldNode = this.getSelectedItem(); - goog.ui.tree.TreeControl.prototype.setSelectedItem.call(this, node); - if (node && node.blocks && node.blocks.length) { - toolbox.flyout_.show(node.blocks); - // Scroll the flyout to the top if the category has changed. - if (toolbox.lastCategory_ != node) { - toolbox.flyout_.scrollToStart(); - } - } else { - // Hide the flyout. - toolbox.flyout_.hide(); - } - if (oldNode != node && oldNode != this) { - var event = new Blockly.Events.Ui(null, 'category', - oldNode && oldNode.getHtml(), node && node.getHtml()); - event.workspaceId = toolbox.workspace_.id; - Blockly.Events.fire(event); - } - if (node) { - toolbox.lastCategory_ = node; - } -}; - -/** - * A single node in the tree, customized for Blockly's UI. - * @param {Blockly.Toolbox} toolbox The parent toolbox for this tree. - * @param {!goog.html.SafeHtml} html The HTML content of the node label. - * @param {Object|undefined} config The configuration for the tree. - * See goog.ui.tree.TreeControl.DefaultConfig. - * If not specified, a default config will be used. - * @constructor - * @extends {goog.ui.tree.TreeNode} - */ -Blockly.Toolbox.TreeNode = function(toolbox, html, config) { - goog.ui.tree.TreeNode.call(this, html, config); - if (toolbox) { - var resize = function() { - // Even though the div hasn't changed size, the visible workspace - // surface of the workspace has, so we may need to reposition everything. - Blockly.svgResize(toolbox.workspace_); - }; - // Fire a resize event since the toolbox may have changed width. - goog.events.listen(toolbox.tree_, - goog.ui.tree.BaseNode.EventType.EXPAND, resize); - goog.events.listen(toolbox.tree_, - goog.ui.tree.BaseNode.EventType.COLLAPSE, resize); - } -}; -goog.inherits(Blockly.Toolbox.TreeNode, goog.ui.tree.TreeNode); - -/** - * Suppress population of the +/- icon. - * @return {!goog.html.SafeHtml} The source for the icon. - * @override - */ -Blockly.Toolbox.TreeNode.prototype.getExpandIconSafeHtml = function() { - return goog.html.SafeHtml.create('span'); -}; - -/** - * Expand or collapse the node on mouse click. - * @param {!goog.events.BrowserEvent} _e The browser event. - * @override - */ -Blockly.Toolbox.TreeNode.prototype.onClick_ = function(_e) { - // Expand icon. - if (this.hasChildren() && this.isUserCollapsible_) { - this.toggle(); - this.select(); - } else if (this.isSelected()) { - this.getTree().setSelectedItem(null); - } else { - this.select(); - } - this.updateRow(); -}; - -/** - * Suppress the inherited mouse down behaviour. - * @param {!goog.events.BrowserEvent} _e The browser event. - * @override - * @private - */ -Blockly.Toolbox.TreeNode.prototype.onMouseDown = function(_e) { - // NOPE. -}; - -/** - * Suppress the inherited double-click behaviour. - * @param {!goog.events.BrowserEvent} _e The browser event. - * @override - * @private - */ -Blockly.Toolbox.TreeNode.prototype.onDoubleClick_ = function(_e) { - // NOP. -}; - -/** - * Remap event.keyCode in horizontalLayout so that arrow - * keys work properly and call original onKeyDown handler. - * @param {!goog.events.BrowserEvent} e The browser event. - * @return {boolean} The handled value. - * @override - * @private - */ -Blockly.Toolbox.TreeNode.prototype.onKeyDown = function(e) { - if (this.tree.toolbox_.horizontalLayout_) { - var map = {}; - var next = goog.events.KeyCodes.DOWN; - var prev = goog.events.KeyCodes.UP; - map[goog.events.KeyCodes.RIGHT] = this.rightToLeft_ ? prev : next; - map[goog.events.KeyCodes.LEFT] = this.rightToLeft_ ? next : prev; - map[goog.events.KeyCodes.UP] = goog.events.KeyCodes.LEFT; - map[goog.events.KeyCodes.DOWN] = goog.events.KeyCodes.RIGHT; - - var newKeyCode = map[e.keyCode]; - e.keyCode = newKeyCode || e.keyCode; - } - return Blockly.Toolbox.TreeNode.superClass_.onKeyDown.call(this, e); -}; - /** * A blank separator node in the tree. - * @param {Object|undefined} config The configuration for the tree. - * See goog.ui.tree.TreeControl.DefaultConfig - * If not specified, a default config will be used. + * @param {Blockly.tree.BaseNode.Config} config The configuration for the tree. * @constructor - * @extends {Blockly.Toolbox.TreeNode} + * @extends {Blockly.tree.TreeNode} */ Blockly.Toolbox.TreeSeparator = function(config) { - Blockly.Toolbox.TreeNode.call(this, null, goog.html.SafeHtml.EMPTY, config); + Blockly.tree.TreeNode.call(this, null, '', config); }; -goog.inherits(Blockly.Toolbox.TreeSeparator, Blockly.Toolbox.TreeNode); +goog.inherits(Blockly.Toolbox.TreeSeparator, Blockly.tree.TreeNode); diff --git a/gulpfile.js b/gulpfile.js index 645863d44..9c0a1506c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -31,12 +31,6 @@ gulp.rename = require('gulp-rename'); gulp.insert = require('gulp-insert'); gulp.umd = require('gulp-umd'); -var path = require('path'); -var fs = require('fs'); -var rimraf = require('rimraf'); -var execSync = require('child_process').execSync; - - var path = require('path'); var fs = require('fs'); var rimraf = require('rimraf'); @@ -135,6 +129,9 @@ gulp.task('typings', function (cb) { const tmpDir = './typings/tmp'; const blocklySrcs = [ "core/", + "core/components", + "core/components/tree", + "core/keyboard_nav", "core/theme", "core/utils", "msg/" @@ -166,6 +163,9 @@ gulp.task('typings', function (cb) { 'typings/parts/blockly-interfaces.d.ts', 'typings/parts/goog-closure.d.ts', `${tmpDir}/core/**`, + `${tmpDir}/core/components/**`, + `${tmpDir}/core/components/tree/**`, + `${tmpDir}/core/keyboard_nav/**`, `${tmpDir}/core/utils/**`, `${tmpDir}/core/theme/**`, `${tmpDir}/msg/**` @@ -562,63 +562,6 @@ gulp.task('release', gulp.series(['build', /*'typings',*/ function() { fs.mkdirSync(packageDistribution); }, 'package'])); -// Generates the TypeScript definition file (d.ts) for Blockly. -// As well as generating the typings of each of the files under core/ and msg/, -// the script also pulls in a number of part files from typings/parts. -// This includes the header (incl License), additional useful interfaces -// including Blockly Options and Google Closure typings -gulp.task('typings', function (cb) { - const tmpDir = './typings/tmp'; - const blocklySrcs = [ - "core/", - "core/keyboard_nav", - "core/theme", - "core/utils", - "msg/" - ]; - // Clean directory if exists - if (fs.existsSync(tmpDir)) { - rimraf.sync(tmpDir); - } - fs.mkdirSync(tmpDir); - - // Find all files that will be included in the typings file - let files = []; - blocklySrcs.forEach((src) => { - files = files.concat(fs.readdirSync(src) - .filter(fn => fn.endsWith('.js')) - .map(fn => path.join(src, fn))); - }); - - // Generate typings file for each file - files.forEach((file) => { - const typescriptFileName = `${path.join(tmpDir, file)}.d.ts`; - const cmd = `node ./node_modules/typescript-closure-tools/definition-generator/src/main.js ${file} ${typescriptFileName}`; - console.log(`Generating typings for ${file}`); - execSync(cmd, { stdio: 'inherit' }); - }); - - const srcs = [ - 'typings/parts/blockly-header.d.ts', - 'typings/parts/blockly-interfaces.d.ts', - 'typings/parts/goog-closure.d.ts', - `${tmpDir}/core/**`, - `${tmpDir}/core/utils/**`, - `${tmpDir}/core/theme/**`, - `${tmpDir}/core/keyboard_nav/**`, - `${tmpDir}/msg/**` - ]; - return gulp.src(srcs) - .pipe(gulp.concat('blockly.d.ts')) - .pipe(gulp.dest('typings')) - .on('end', function () { - // Clean up tmp directory - if (fs.existsSync(tmpDir)) { - rimraf.sync(tmpDir); - } - }); -}); - // The default task concatenates files for Node.js, using English language // blocks and the JavaScript generator. gulp.task('default', gulp.series(['build', 'blockly_node_javascript_en'])); diff --git a/typings/blockly.d.ts b/typings/blockly.d.ts index 865adae4e..da97c6b6d 100644 --- a/typings/blockly.d.ts +++ b/typings/blockly.d.ts @@ -169,15 +169,6 @@ declare namespace goog { } } - namespace ui.tree { - class BaseNode { - } - class TreeControl__Class { - } - class TreeNode__Class { - } - } - namespace events { function listen(eventSource: Element | Listenable, eventType: EventType, listener: any, capturePhase?: boolean, handler?: Object): void; function unlistenByKey(key: any): void; @@ -590,6 +581,13 @@ declare module Blockly { */ data: string; + /** + * Has this block been disposed of? + * @type {boolean} + * @package + */ + disposed: boolean; + /** * Dispose of this block. * @param {boolean} healStack If true, then try to heal any gap by connecting @@ -2783,6 +2781,13 @@ declare module Blockly { */ targetConnection: Blockly.Connection; + /** + * Has this connection been disposed of? + * @type {boolean} + * @package + */ + disposed: boolean; + /** * Horizontal location of this connection. * @type {number} @@ -2835,7 +2840,9 @@ declare module Blockly { connect_(childConnection: Blockly.Connection): void; /** - * Sever all links to this connection (not including from the source object). + * Dispose of this connection. Deal with connected blocks and remove this + * connection from the database. + * @package */ dispose(): void; @@ -4093,6 +4100,13 @@ declare module Blockly { */ name: string|any /*undefined*/; + /** + * Has this field been disposed of? + * @type {boolean} + * @package + */ + disposed: boolean; + /** * Maximum characters of text to display before adding an ellipsis. * @type {number} @@ -7625,10 +7639,10 @@ declare module Blockly { * Retrieves and sets the colour for the category using the style name. * The category colour is set from the colour style attribute. * @param {string} styleName Name of the style. - * @param {!Blockly.Toolbox.TreeNode} childOut The child to set the hexColour on. + * @param {!Blockly.tree.TreeNode} childOut The child to set the hexColour on. * @param {string} categoryName Name of the toolbox category. */ - setColourFromStyle_(styleName: string, childOut: Blockly.Toolbox.TreeNode, categoryName: string): void; + setColourFromStyle_(styleName: string, childOut: Blockly.tree.TreeNode, categoryName: string): void; /** * Updates the category colours and background colour of selected categories. @@ -7672,53 +7686,17 @@ declare module Blockly { declare module Blockly.Toolbox { - class TreeControl extends TreeControl__Class { } - /** Fake class which should be extended to avoid inheriting static properties */ - class TreeControl__Class extends goog.ui.tree.TreeControl__Class { - - /** - * Extension of a TreeControl object that uses a custom tree node. - * @param {Blockly.Toolbox} toolbox The parent toolbox for this tree. - * @param {Object} config The configuration for the tree. See - * goog.ui.tree.TreeControl.DefaultConfig. - * @constructor - * @extends {goog.ui.tree.TreeControl} - */ - constructor(toolbox: Blockly.Toolbox, config: Object); - } - - - class TreeNode extends TreeNode__Class { } - /** Fake class which should be extended to avoid inheriting static properties */ - class TreeNode__Class extends goog.ui.tree.TreeNode__Class { - - /** - * A single node in the tree, customized for Blockly's UI. - * @param {Blockly.Toolbox} toolbox The parent toolbox for this tree. - * @param {!goog.html.SafeHtml} html The HTML content of the node label. - * @param {Object|undefined} config The configuration for the tree. - * See goog.ui.tree.TreeControl.DefaultConfig. - * If not specified, a default config will be used. - * @constructor - * @extends {goog.ui.tree.TreeNode} - */ - constructor(toolbox: Blockly.Toolbox, html: goog.html.SafeHtml, config: Object|any /*undefined*/); - } - - class TreeSeparator extends TreeSeparator__Class { } /** Fake class which should be extended to avoid inheriting static properties */ - class TreeSeparator__Class extends Blockly.Toolbox.TreeNode__Class { + class TreeSeparator__Class extends Blockly.tree.TreeNode__Class { /** * A blank separator node in the tree. - * @param {Object|undefined} config The configuration for the tree. - * See goog.ui.tree.TreeControl.DefaultConfig - * If not specified, a default config will be used. + * @param {Blockly.tree.BaseNode.Config} config The configuration for the tree. * @constructor - * @extends {Blockly.Toolbox.TreeNode} + * @extends {Blockly.tree.TreeNode} */ - constructor(config: Object|any /*undefined*/); + constructor(config: Blockly.tree.BaseNode.Config); } } @@ -11115,6 +11093,402 @@ declare module Blockly { } +declare module Blockly { + + class Component extends Component__Class { } + /** Fake class which should be extended to avoid inheriting static properties */ + class Component__Class { + + /** + * Default implementation of a UI component. + * Similar to Closure's goog.ui.Component. + * + * @constructor + */ + constructor(); + + /** + * Gets the unique ID for the instance of this component. If the instance + * doesn't already have an ID, generates one on the fly. + * @return {string} Unique component ID. + * @protected + */ + getId(): string; + + /** + * Assigns an ID to this component instance. It is the caller's responsibility + * to guarantee that the ID is unique. If the component is a child of a parent + * component, then the parent component's child index is updated to reflect the + * new ID; this may throw an error if the parent already has a child with an ID + * that conflicts with the new ID. + * @param {string} id Unique component ID. + * @protected + */ + setId(id: string): void; + + /** + * Gets the component's element. + * @return {Element} The element for the component. + * @package + */ + getElement(): Element; + + /** + * Sets the component's root element to the given element. Considered + * protected and final. + * + * This should generally only be called during createDom. Setting the element + * does not actually change which element is rendered, only the element that is + * associated with this UI component. + * + * This should only be used by subclasses and its associated renderers. + * + * @param {Element} element Root element for the component. + * @protected + */ + setElementInternal(element: Element): void; + + /** + * Sets the parent of this component to use for event bubbling. Throws an error + * if the component already has a parent or if an attempt is made to add a + * component to itself as a child. Callers must use `removeChild` + * or `removeChildAt` to remove components from their containers before + * calling this method. + * @see Blockly.Component#removeChild + * @see Blockly.Component#removeChildAt + * @param {Blockly.Component} parent The parent component. + * @protected + */ + setParent(parent: Blockly.Component): void; + + /** + * Returns the component's parent, if any. + * @return {?Blockly.Component} The parent component. + * @protected + */ + getParent(): Blockly.Component; + + /** + * Determines whether the component has been added to the document. + * @return {boolean} TRUE if rendered. Otherwise, FALSE. + * @protected + */ + isInDocument(): boolean; + + /** + * Creates the initial DOM representation for the component. The default + * implementation is to set this.element_ = div. + * @protected + */ + createDom(): void; + + /** + * Renders the component. If a parent element is supplied, the component's + * element will be appended to it. If there is no optional parent element and + * the element doesn't have a parentNode then it will be appended to the + * document body. + * + * If this component has a parent component, and the parent component is + * not in the document already, then this will not call `enterDocument` + * on this component. + * + * Throws an Error if the component is already rendered. + * + * @param {Element=} opt_parentElement Optional parent element to render the + * component into. + * @protected + */ + render(opt_parentElement?: Element): void; + + /** + * Renders the component before another element. The other element should be in + * the document already. + * + * Throws an Error if the component is already rendered. + * + * @param {Node} sibling Node to render the component before. + * @protected + */ + renderBefore(sibling: Node): void; + + /** + * Called when the component's element is known to be in the document. Anything + * using document.getElementById etc. should be done at this stage. + * + * If the component contains child components, this call is propagated to its + * children. + * @protected + */ + enterDocument(): void; + + /** + * Called by dispose to clean up the elements and listeners created by a + * component, or by a parent component/application who has removed the + * component from the document but wants to reuse it later. + * + * If the component contains child components, this call is propagated to its + * children. + * + * It should be possible for the component to be rendered again once this method + * has been called. + * @protected + */ + exitDocument(): void; + + /** + * Disposes of the object. If the object hasn't already been disposed of, calls + * {@link #disposeInternal}. + * @protected + */ + dispose(): void; + + /** + * Disposes of the component. Calls `exitDocument`, which is expected to + * remove event handlers and clean up the component. Propagates the call to + * the component's children, if any. Removes the component's DOM from the + * document. + * @protected + */ + disposeInternal(): void; + + /** + * Helper function for subclasses that gets a unique id for a given fragment, + * this can be used by components to generate unique string ids for DOM + * elements. + * @param {string} idFragment A partial id. + * @return {string} Unique element id. + * @protected + */ + makeId(idFragment: string): string; + + /** + * Makes a collection of ids. This is a convenience method for makeId. The + * object's values are the id fragments and the new values are the generated + * ids. The key will remain the same. + * @param {Object} object The object that will be used to create the ids. + * @return {!Object} An object of id keys to generated ids. + * @protected + */ + makeIds(object: Object): { [key: string]: string }; + + /** + * Adds the specified component as the last child of this component. See + * {@link Blockly.Component#addChildAt} for detailed semantics. + * + * @see Blockly.Component#addChildAt + * @param {Blockly.Component} child The new child component. + * @param {boolean=} opt_render If true, the child component will be rendered + * into the parent. + * @protected + */ + addChild(child: Blockly.Component, opt_render?: boolean): void; + + /** + * Adds the specified component as a child of this component at the given + * 0-based index. + * + * Both `addChild` and `addChildAt` assume the following contract + * between parent and child components: + *
    + *
  • the child component's element must be a descendant of the parent + * component's element, and + *
  • the DOM state of the child component must be consistent with the DOM + * state of the parent component (see `isInDocument`) in the + * steady state -- the exception is to addChildAt(child, i, false) and + * then immediately decorate/render the child. + *
+ * + * In particular, `parent.addChild(child)` will throw an error if the + * child component is already in the document, but the parent isn't. + * + * Clients of this API may call `addChild` and `addChildAt` with + * `opt_render` set to true. If `opt_render` is true, calling these + * methods will automatically render the child component's element into the + * parent component's element. If the parent does not yet have an element, then + * `createDom` will automatically be invoked on the parent before + * rendering the child. + * + * Invoking {@code parent.addChild(child, true)} will throw an error if the + * child component is already in the document, regardless of the parent's DOM + * state. + * + * If `opt_render` is true and the parent component is not already + * in the document, `enterDocument` will not be called on this component + * at this point. + * + * Finally, this method also throws an error if the new child already has a + * different parent, or the given index is out of bounds. + * + * @see Blockly.Component#addChild + * @param {Blockly.Component} child The new child component. + * @param {number} index 0-based index at which the new child component is to be + * added; must be between 0 and the current child count (inclusive). + * @param {boolean=} opt_render If true, the child component will be rendered + * into the parent. + * @protected + */ + addChildAt(child: Blockly.Component, index: number, opt_render?: boolean): void; + + /** + * Returns the DOM element into which child components are to be rendered, + * or null if the component itself hasn't been rendered yet. This default + * implementation returns the component's root element. Subclasses with + * complex DOM structures must override this method. + * @return {Element} Element to contain child elements (null if none). + * @protected + */ + getContentElement(): Element; + + /** + * Returns true if the component is rendered right-to-left, false otherwise. + * The first time this function is invoked, the right-to-left rendering property + * is set if it has not been already. + * @return {boolean} Whether the control is rendered right-to-left. + * @protected + */ + isRightToLeft(): boolean; + + /** + * Set is right-to-left. This function should be used if the component needs + * to know the rendering direction during dom creation (i.e. before + * {@link #enterDocument} is called and is right-to-left is set). + * @param {boolean} rightToLeft Whether the component is rendered + * right-to-left. + * @protected + */ + setRightToLeft(rightToLeft: boolean): void; + + /** + * Returns true if the component has children. + * @return {boolean} True if the component has children. + * @protected + */ + hasChildren(): boolean; + + /** + * Returns the number of children of this component. + * @return {number} The number of children. + * @protected + */ + getChildCount(): number; + + /** + * Returns an array containing the IDs of the children of this component, or an + * empty array if the component has no children. + * @return {!Array.} Child component IDs. + * @protected + */ + getChildIds(): string[]; + + /** + * Returns the child with the given ID, or null if no such child exists. + * @param {string} id Child component ID. + * @return {?Blockly.Component} The child with the given ID; null if none. + * @protected + */ + getChild(id: string): Blockly.Component; + + /** + * Returns the child at the given index, or null if the index is out of bounds. + * @param {number} index 0-based index. + * @return {?Blockly.Component} The child at the given index; null if none. + * @protected + */ + getChildAt(index: number): Blockly.Component; + + /** + * Calls the given function on each of this component's children in order. If + * `opt_obj` is provided, it will be used as the 'this' object in the + * function when called. The function should take two arguments: the child + * component and its 0-based index. The return value is ignored. + * @param {function(this:T,?,number):?} f The function to call for every + * child component; should take 2 arguments (the child and its index). + * @param {T=} opt_obj Used as the 'this' object in f when called. + * @template T + * @protected + */ + forEachChild(f: { (_0: any, _1: number): any }, opt_obj?: T): void; + + /** + * Returns the 0-based index of the given child component, or -1 if no such + * child is found. + * @param {?Blockly.Component} child The child component. + * @return {number} 0-based index of the child component; -1 if not found. + * @protected + */ + indexOfChild(child: Blockly.Component): number; + + /** + * Removes the given child from this component, and returns it. Throws an error + * if the argument is invalid or if the specified child isn't found in the + * parent component. The argument can either be a string (interpreted as the + * ID of the child component to remove) or the child component itself. + * + * If `opt_unrender` is true, calls {@link Blockly.Component#exitDocument} + * on the removed child, and subsequently detaches the child's DOM from the + * document. Otherwise it is the caller's responsibility to clean up the child + * component's DOM. + * + * @see Blockly.Component#removeChildAt + * @param {string|Blockly.Component|null} child The ID of the child to remove, + * or the child component itself. + * @param {boolean=} opt_unrender If true, calls `exitDocument` on the + * removed child component, and detaches its DOM from the document. + * @return {Blockly.Component} The removed component, if any. + * @protected + */ + removeChild(child: string|Blockly.Component|any /*null*/, opt_unrender?: boolean): Blockly.Component; + + /** + * Removes the child at the given index from this component, and returns it. + * Throws an error if the argument is out of bounds, or if the specified child + * isn't found in the parent. See {@link Blockly.Component#removeChild} for + * detailed semantics. + * + * @see Blockly.Component#removeChild + * @param {number} index 0-based index of the child to remove. + * @param {boolean=} opt_unrender If true, calls `exitDocument` on the + * removed child component, and detaches its DOM from the document. + * @return {Blockly.Component} The removed component, if any. + * @protected + */ + removeChildAt(index: number, opt_unrender?: boolean): Blockly.Component; + + /** + * Removes every child component attached to this one and returns them. + * + * @see Blockly.Component#removeChild + * @param {boolean=} opt_unrender If true, calls {@link #exitDocument} on the + * removed child components, and detaches their DOM from the document. + * @return {!Array.} The removed components if any. + * @protected + */ + removeChildren(opt_unrender?: boolean): Blockly.Component[]; + } + +} + +declare module Blockly.Component { + + /** + * Errors thrown by the component. + * @enum {string} + */ + enum Error { NOT_SUPPORTED, ALREADY_RENDERED, PARENT_UNABLE_TO_BE_SET, CHILD_INDEX_OUT_OF_BOUNDS, NOT_OUR_CHILD, NOT_IN_DOCUMENT } + + /** + * Set the default right-to-left value. This causes all component's created from + * this point forward to have the given value. This is useful for cases where + * a given page is always in one directionality, avoiding unnecessary + * right to left determinations. + * @param {?boolean} rightToLeft Whether the components should be rendered + * right-to-left. Null iff components should determine their directionality. + * @protected + */ + function setDefaultRightToLeft(rightToLeft: boolean): void; +} + + declare module Blockly { class ASTNode extends ASTNode__Class { } @@ -11493,7 +11867,102 @@ declare module Blockly.CursorSvg { } -declare module Blockly.Navigation { +declare module Blockly { + + class Action extends Action__Class { } + /** Fake class which should be extended to avoid inheriting static properties */ + class Action__Class { + + /** + * Class for a single action. + * There can be one action for each key. If the action only applies to a + * single state (toolbox, flyout, workspace) then the function should handle this. + * @param {string} name The name of the action. + * @param {string} desc The description of the action. + * @param {Function} func The function to be called when the key is pressed. + * @constructor + */ + constructor(name: string, desc: string, func: Function); + } + +} + + +declare module Blockly.user.keyMap { + + /** + * Holds the serialized key to key action mapping. + * @type {Object} + */ + var map_: { [key: string]: Blockly.Action }; + + /** + * List of modifier keys checked when serializing the key event. + * @type {Array} + */ + var modifierKeys: string[]; + + /** + * Update the key map to contain the new action. + * @param {!string} keyCode The key code serialized by the serializeKeyEvent. + * @param {!Blockly.Action} action The action to be executed when the keys + * corresponding to the serialized key code is pressed. + * @package + */ + function setActionForKey(keyCode: string, action: Blockly.Action): void; + + /** + * Creates a new key map. + * @param {Object} keyMap The object holding the key + * to action mapping. + * @package + */ + function setKeyMap(keyMap: { [key: string]: Blockly.Action }): void; + + /** + * Gets the current key map. + * @return {Object} The object holding the key to + * action mapping. + * @package + */ + function getKeyMap(): { [key: string]: Blockly.Action }; + + /** + * Get the action by the serialized key code. + * @param {string} keyCode The serialized key code. + * @return {Blockly.Action|undefined} The action holding the function to + * call when the given keyCode is used or undefined if no action exists. + * @package + */ + function getActionByKeyCode(keyCode: string): Blockly.Action|any /*undefined*/; + + /** + * Get the serialized key that corresponds to the action. + * @param {!Blockly.Action} action The action for which we want to get + * the key. + * @return {string} The serialized key or null if the action does not have + * a key mapping. + * @package + */ + function getKeyByAction(action: Blockly.Action): string; + + /** + * Serialize the key event. + * @param {!Event} e A key up event holding the key code. + * @return {!string} A string containing the serialized key event. + */ + function serializeKeyEvent(e: Event): string; + + /** + * Creates the default key map. + * @return {!Object} An object holding the default key + * to action mapping. + */ + function createDefaultKeyMap(): { [key: string]: Blockly.Action }; +} + + +declare module Blockly.navigation { /** * The marker that shows where a user has marked while navigating blocks. @@ -11683,33 +12152,11 @@ declare module Blockly.Navigation { function handleEnterForWS(): void; /** - * TODO: Revisit keycodes before releasing * Handler for all the keyboard navigation events. * @param {Event} e The keyboard event. * @return {!boolean} True if the key was handled false otherwise. */ - function navigate(e: Event): boolean; - - /** - * Handles all keyboard events when the user is focused on the flyout. - * @param {Event} e The keyboard event. - * @return {!boolean} True if the key was handled false otherwise. - */ - function flyoutKeyHandler(e: Event): boolean; - - /** - * Handles all keyboard events when the user is focused on the toolbox. - * @param {Event} e The keyboard event. - * @return {!boolean} True if the key was handled false otherwise. - */ - function toolboxKeyHandler(e: Event): boolean; - - /** - * Handles all keyboard events when the user is focused on the workspace. - * @param {Event} e The keyboard event. - * @return {!boolean} True if the key was handled false otherwise. - */ - function workspaceKeyHandler(e: Event): boolean; + function onKeyPress(e: Event): boolean; /** * Enable accessibility mode. @@ -11731,7 +12178,7 @@ declare module Blockly.Navigation { /** * Navigation warning handler. If loggingCallback is defined, use it. - * Otherwise call Blockly.Navigation.warn. + * Otherwise call Blockly.navigation.warn. * @param {string} msg The warning message. * @package */ @@ -11744,12 +12191,126 @@ declare module Blockly.Navigation { * @package */ function error(msg: string): void; + + /** + * The previous action. + * @type Blockly.Action + */ + var ACTION_PREVIOUS: any /*missing*/; + + /** + * The previous action. + * @type Blockly.Action + */ + var ACTION_OUT: any /*missing*/; + + /** + * The previous action. + * @type Blockly.Action + */ + var ACTION_NEXT: any /*missing*/; + + /** + * The action to go in. + * @type Blockly.Action + */ + var ACTION_IN: any /*missing*/; + + /** + * The action to try to insert a block. + * @type Blockly.Action + */ + var ACTION_INSERT: any /*missing*/; + + /** + * The action to mark a certain location. + * @type Blockly.Action + */ + var ACTION_MARK: any /*missing*/; + + /** + * The action to disconnect a block. + * @type Blockly.Action + */ + var ACTION_DISCONNECT: any /*missing*/; + + /** + * The action to open the toolbox. + * @type Blockly.Action + */ + var ACTION_TOOLBOX: any /*missing*/; + + /** + * The action to exit the toolbox or flyout. + * @type Blockly.Action + */ + var ACTION_EXIT: any /*missing*/; } +declare module Blockly.utils.aria { + + /** + * ARIA role values. + * Copied from Closure's goog.a11y.aria.Role + * @enum {string} + */ + enum Role { ALERT, ALERTDIALOG, APPLICATION, ARTICLE, BANNER, BUTTON, CHECKBOX, COLUMNHEADER, COMBOBOX, COMPLEMENTARY, CONTENTINFO, DEFINITION, DIALOG, DIRECTORY, DOCUMENT, FORM, GRID, GRIDCELL, GROUP, HEADING, IMG, LINK, LIST, LISTBOX, LISTITEM, LOG, MAIN, MARQUEE, MATH, MENU, MENUBAR, MENUITEM, MENUITEMCHECKBOX, MENUITEMRADIO, NAVIGATION, NOTE, OPTION, PRESENTATION, PROGRESSBAR, RADIO, RADIOGROUP, REGION, ROW, ROWGROUP, ROWHEADER, SCROLLBAR, SEARCH, SEPARATOR, SLIDER, SPINBUTTON, STATUS, TAB, TABLIST, TABPANEL, TEXTBOX, TEXTINFO, TIMER, TOOLBAR, TOOLTIP, TREE, TREEGRID, TREEITEM } + + /** + * ARIA states and properties. + * Copied from Closure's goog.a11y.aria.State + * @enum {string} + */ + enum State { ACTIVEDESCENDANT, ATOMIC, AUTOCOMPLETE, BUSY, CHECKED, COLINDEX, CONTROLS, DESCRIBEDBY, DISABLED, DROPEFFECT, EXPANDED, FLOWTO, GRABBED, HASPOPUP, HIDDEN, INVALID, LABEL, LABELLEDBY, LEVEL, LIVE, MULTILINE, MULTISELECTABLE, ORIENTATION, OWNS, POSINSET, PRESSED, READONLY, RELEVANT, REQUIRED, ROWINDEX, SELECTED, SETSIZE, SORT, VALUEMAX, VALUEMIN, VALUENOW, VALUETEXT } + + /** + * Sets the role of an element. If the roleName is + * empty string or null, the role for the element is removed. + * We encourage clients to call the goog.a11y.aria.removeRole + * method instead of setting null and empty string values. + * Special handling for this case is added to ensure + * backword compatibility with existing code. + * + * Similar to Closure's goog.a11y.aria + * + * @param {!Element} element DOM node to set role of. + * @param {!Blockly.utils.aria.Role|string} roleName role name(s). + */ + function setRole(element: Element, roleName: Blockly.utils.aria.Role|string): void; + + /** + * Gets role of an element. + * Copied from Closure's goog.a11y.aria + * @param {!Element} element DOM element to get role of. + * @return {?Blockly.utils.aria.Role} ARIA Role name. + */ + function getRole(element: Element): Blockly.utils.aria.Role; + + /** + * Removes role of an element. + * Copied from Closure's goog.a11y.aria + * @param {!Element} element DOM element to remove the role from. + */ + function removeRole(element: Element): void; + + /** + * Sets the state or property of an element. + * Copied from Closure's goog.a11y.aria + * @param {!Element} element DOM node where we set state. + * @param {!(Blockly.utils.aria.State|string)} stateName State attribute being set. + * Automatically adds prefix 'aria-' to the state name if the attribute is + * not an extra attribute. + * @param {string|boolean|number|!Array} value Value + * for the state attribute. + */ + function setState(element: Element, stateName: Blockly.utils.aria.State|string, value: string|boolean|number|string[]): void; +} + + declare module Blockly.utils { /** @@ -12010,6 +12571,57 @@ declare module Blockly.utils.dom { } +declare module Blockly.utils { + + class IdGenerator extends IdGenerator__Class { } + /** Fake class which should be extended to avoid inheriting static properties */ + class IdGenerator__Class { + + /** + * Creates a new id generator. + * @constructor + * @final + */ + constructor(); + + /** + * Gets the next unique ID. + * The difference between this and genUid is that getNextUniqueId generates + * IDs compatible with the HTML4 id attribute restrictions: + * Use only ASCII letters, digits, '_', '-' and '.' + * @return {string} The next unique identifier. + */ + getNextUniqueId(): string; + } + +} + +declare module Blockly.utils.IdGenerator { + + /** + * Get the singleton instance of Blockly.utils.IdGenerator. + * @returns {Blockly.utils.IdGenerator} singleton instance + */ + function getInstance(): Blockly.utils.IdGenerator; +} + + +declare module Blockly.utils { + + /** + * Key codes for common characters. + * + * Copied from Closure's goog.events.KeyCodes + * + * This list is not localized and therefore some of the key codes are not + * correct for non US keyboard layouts. See comments below. + * + * @enum {number} + */ + enum KeyCodes { WIN_KEY_FF_LINUX, MAC_ENTER, BACKSPACE, TAB, NUM_CENTER, ENTER, SHIFT, CTRL, ALT, PAUSE, CAPS_LOCK, ESC, SPACE, PAGE_UP, PAGE_DOWN, END, HOME, LEFT, UP, RIGHT, DOWN, PLUS_SIGN, PRINT_SCREEN, INSERT, DELETE, ZERO, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, FF_SEMICOLON, FF_EQUALS, FF_DASH, FF_HASH, QUESTION_MARK, AT_SIGN, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, META, WIN_KEY_RIGHT, CONTEXT_MENU, NUM_ZERO, NUM_ONE, NUM_TWO, NUM_THREE, NUM_FOUR, NUM_FIVE, NUM_SIX, NUM_SEVEN, NUM_EIGHT, NUM_NINE, NUM_MULTIPLY, NUM_PLUS, NUM_MINUS, NUM_PERIOD, NUM_DIVISION, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, NUMLOCK, SCROLL_LOCK, FIRST_MEDIA_KEY, LAST_MEDIA_KEY, SEMICOLON, DASH, EQUALS, COMMA, PERIOD, SLASH, APOSTROPHE, TILDE, SINGLE_QUOTE, OPEN_SQUARE_BRACKET, BACKSLASH, CLOSE_SQUARE_BRACKET, WIN_KEY, MAC_FF_META, MAC_WK_CMD_LEFT, MAC_WK_CMD_RIGHT, WIN_IME, VK_NONAME, PHANTOM } +} + + declare module Blockly.utils.math { /** @@ -12174,15 +12786,41 @@ declare module Blockly.utils.style { /** * Gets the height and width of an element. - * Similar to Closure's goog.style.getSize. + * Similar to Closure's goog.style.getSize * @param {Element} element Element to get size of. * @return {!Blockly.utils.Size} Object with width/height properties. */ function getSize(element: Element): Blockly.utils.Size; + /** + * Retrieves a computed style value of a node. It returns empty string if the + * value cannot be computed (which will be the case in Internet Explorer) or + * "none" if the property requested is an SVG one and it has not been + * explicitly set (firefox and webkit). + * + * Copied from Closure's goog.style.getComputedStyle + * + * @param {Element} element Element to get style of. + * @param {string} property Property to get (camel-case). + * @return {string} Style value. + */ + function getComputedStyle(element: Element, property: string): string; + + /** + * Gets the cascaded style value of a node, or null if the value cannot be + * computed (only Internet Explorer can do this). + * + * Copied from Closure's goog.style.getCascadedStyle + * + * @param {Element} element Element to get style of. + * @param {string} style Property to get (camel-case). + * @return {string} Style value. + */ + function getCascadedStyle(element: Element, style: string): string; + /** * Returns a Coordinate object relative to the top-left of the HTML document. - * Similar to Closure's goog.style.getPageOffset. + * Similar to Closure's goog.style.getPageOffset * @param {Element} el Element to get the page offset for. * @return {!Blockly.utils.Coordinate} The page offset. */ @@ -12190,10 +12828,73 @@ declare module Blockly.utils.style { /** * Calculates the viewport coordinates relative to the document. - * Similar to Closure's goog.style.getViewportPageOffset. + * Similar to Closure's goog.style.getViewportPageOffset * @return {!Blockly.utils.Coordinate} The page offset of the viewport. */ function getViewportPageOffset(): Blockly.utils.Coordinate; + + /** + * Shows or hides an element from the page. Hiding the element is done by + * setting the display property to "none", removing the element from the + * rendering hierarchy so it takes up no space. To show the element, the default + * inherited display property is restored (defined either in stylesheets or by + * the browser's default style rules). + * Copied from Closure's goog.style.getViewportPageOffset + * + * @param {Element} el Element to show or hide. + * @param {*} isShown True to render the element in its default style, + * false to disable rendering the element. + */ + function setElementShown(el: Element, isShown: any): void; + + /** + * Returns true if the element is using right to left (rtl) direction. + * Copied from Closure's goog.style.isRightToLeft + * + * @param {Element} el The element to test. + * @return {boolean} True for right to left, false for left to right. + */ + function isRightToLeft(el: Element): boolean; + + /** + * Gets the computed border widths (on all sides) in pixels + * Copied from Closure's goog.style.getBorderBox + * @param {Element} element The element to get the border widths for. + * @return {!Object} The computed border widths. + */ + function getBorderBox(element: Element): Object; + + /** + * Changes the scroll position of `container` with the minimum amount so + * that the content and the borders of the given `element` become visible. + * If the element is bigger than the container, its top left corner will be + * aligned as close to the container's top left corner as possible. + * Copied from Closure's goog.style.scrollIntoContainerView + * + * @param {Element} element The element to make visible. + * @param {Element} container The container to scroll. If not set, then the + * document scroll element will be used. + * @param {boolean=} opt_center Whether to center the element in the container. + * Defaults to false. + */ + function scrollIntoContainerView(element: Element, container: Element, opt_center?: boolean): void; + + /** + * Calculate the scroll position of `container` with the minimum amount so + * that the content and the borders of the given `element` become visible. + * If the element is bigger than the container, its top left corner will be + * aligned as close to the container's top left corner as possible. + * Copied from Closure's goog.style.getContainerOffsetToScrollInto + * + * @param {Element} element The element to make visible. + * @param {Element} container The container to scroll. If not set, then the + * document scroll element will be used. + * @param {boolean=} opt_center Whether to center the element in the container. + * Defaults to false. + * @return {!Blockly.utils.Coordinate} The new scroll position of the container, + * in form of goog.math.Coordinate(scrollLeft, scrollTop). + */ + function getContainerOffsetToScrollInto(element: Element, container: Element, opt_center?: boolean): Blockly.utils.Coordinate; } @@ -12353,6 +13054,632 @@ declare module Blockly.utils.xml { } +declare module Blockly.tree { + + class BaseNode extends BaseNode__Class { } + /** Fake class which should be extended to avoid inheriting static properties */ + class BaseNode__Class extends Blockly.Component__Class { + + /** + * An abstract base class for a node in the tree. + * Similar to goog.ui.tree.BaseNode + * + * @param {string} content The content of the node label treated as + * plain-text and will be HTML escaped. + * @param {Blockly.tree.BaseNode.Config} config The configuration for the tree. + * @constructor + * @extends {Blockly.Component} + */ + constructor(content: string, config: Blockly.tree.BaseNode.Config); + + /** @protected {Blockly.tree.TreeControl} */ + tree: any /*missing*/; + + /** + * Adds roles and states. + * @protected + */ + initAccessibility(): void; + + /** + * Adds a node as a child to the current node. + * @param {Blockly.tree.BaseNode} child The child to add. + * @param {Blockly.tree.BaseNode=} opt_before If specified, the new child is + * added as a child before this one. If not specified, it's appended to the + * end. + * @return {!Blockly.tree.BaseNode} The added child. + * @package + */ + add(child: Blockly.tree.BaseNode, opt_before?: Blockly.tree.BaseNode): Blockly.tree.BaseNode; + + /** + * Returns the tree. + * @return {?Blockly.tree.TreeControl} tree + * @protected + */ + getTree(): Blockly.tree.TreeControl; + + /** + * Returns the depth of the node in the tree. Should not be overridden. + * @return {number} The non-negative depth of this node (the root is zero). + * @protected + */ + getDepth(): number; + + /** + * Returns true if the node is a descendant of this node + * @param {Blockly.tree.BaseNode} node The node to check. + * @return {boolean} True if the node is a descendant of this node, false + * otherwise. + * @protected + */ + contains(node: Blockly.tree.BaseNode): boolean; + + /** + * This is re-defined here to indicate to the closure compiler the correct + * child return type. + * @param {number} index 0-based index. + * @return {Blockly.tree.BaseNode} The child at the given index; null if none. + * @protected + */ + getChildAt(index: number): Blockly.tree.BaseNode; + + /** + * Returns the children of this node. + * @return {!Array.} The children. + * @package + */ + getChildren(): Blockly.tree.BaseNode[]; + + /** + * @return {Blockly.tree.BaseNode} The first child of this node. + * @protected + */ + getFirstChild(): Blockly.tree.BaseNode; + + /** + * @return {Blockly.tree.BaseNode} The last child of this node. + * @protected + */ + getLastChild(): Blockly.tree.BaseNode; + + /** + * @return {Blockly.tree.BaseNode} The previous sibling of this node. + * @protected + */ + getPreviousSibling(): Blockly.tree.BaseNode; + + /** + * @return {Blockly.tree.BaseNode} The next sibling of this node. + * @protected + */ + getNextSibling(): Blockly.tree.BaseNode; + + /** + * @return {boolean} Whether the node is the last sibling. + * @protected + */ + isLastSibling(): boolean; + + /** + * @return {boolean} Whether the node is selected. + * @protected + */ + isSelected(): boolean; + + /** + * Selects the node. + * @protected + */ + select(): void; + + /** + * Called from the tree to instruct the node change its selection state. + * @param {boolean} selected The new selection state. + * @protected + */ + setSelectedInternal(selected: boolean): void; + + /** + * @return {boolean} Whether the node is expanded. + * @protected + */ + getExpanded(): boolean; + + /** + * Sets the node to be expanded internally, without state change events. + * @param {boolean} expanded Whether to expand or close the node. + * @protected + */ + setExpandedInternal(expanded: boolean): void; + + /** + * Sets the node to be expanded. + * @param {boolean} expanded Whether to expand or close the node. + * @package + */ + setExpanded(expanded: boolean): void; + + /** + * Used to notify a node of that we have expanded it. + * Can be overidden by subclasses, see Blockly.tree.TreeNode. + * @protected + */ + doNodeExpanded(): void; + + /** + * Used to notify a node that we have collapsed it. + * Can be overidden by subclasses, see Blockly.tree.TreeNode. + * @protected + */ + doNodeCollapsed(): void; + + /** + * Toggles the expanded state of the node. + * @protected + */ + toggle(): void; + + /** + * Expands the node. + * @protected + */ + expand(): void; + + /** + * Collapses the node. + * @protected + */ + collapse(): void; + + /** + * Collapses the children of the node. + * @protected + */ + collapseChildren(): void; + + /** + * Collapses the children and the node. + * @protected + */ + collapseAll(): void; + + /** + * Expands the children of the node. + * @protected + */ + expandChildren(): void; + + /** + * Expands the children and the node. + * @protected + */ + expandAll(): void; + + /** + * Expands the parent chain of this node so that it is visible. + * @protected + */ + reveal(): void; + + /** + * Sets whether the node will allow the user to collapse it. + * @param {boolean} isCollapsible Whether to allow node collapse. + * @protected + */ + setIsUserCollapsible(isCollapsible: boolean): void; + + /** + * @return {boolean} Whether the node is collapsible by user actions. + * @protected + */ + isUserCollapsible(): boolean; + + /** + * Creates HTML Element for the node. + * @return {!Element} html element + * @protected + */ + toDom(): Element; + + /** + * @return {!Element} The html element for the row. + * @protected + */ + getRowDom(): Element; + + /** + * @return {string} The class name for the row. + * @protected + */ + getRowClassName(): string; + + /** + * @return {!Element} The html element for the label. + * @protected + */ + getLabelDom(): Element; + + /** + * @return {!Element} The html for the icon. + * @protected + */ + getIconDom(): Element; + + /** + * Gets the calculated icon class. + * @protected + */ + getCalculatedIconClass(): void; + + /** + * @return {!Element} The source for the icon. + * @protected + */ + getExpandIconDom(): Element; + + /** + * @return {string} The class names of the icon used for expanding the node. + * @protected + */ + getExpandIconClass(): string; + + /** + * @return {string} The line style. + * @protected + */ + getLineStyle(): string; + + /** + * @return {string} The background position style value. + * @protected + */ + getBackgroundPosition(): string; + + /** + * @return {Element} The row is the div that is used to draw the node without + * the children. + * @protected + */ + getRowElement(): Element; + + /** + * @return {Element} The expanded icon element. + * @protected + */ + getExpandIconElement(): Element; + + /** + * @return {Element} The icon element. + * @protected + */ + getIconElement(): Element; + + /** + * @return {Element} The label element. + * @protected + */ + getLabelElement(): Element; + + /** + * @return {Element} The element after the label. + * @protected + */ + getAfterLabelElement(): Element; + + /** + * @return {Element} The div containing the children. + * @protected + */ + getChildrenElement(): Element; + + /** + * Sets the icon class for the node. + * @param {string} s The icon class. + * @protected + */ + setIconClass(s: string): void; + + /** + * Gets the icon class for the node. + * @return {string} s The icon source. + * @protected + */ + getIconClass(): string; + + /** + * Sets the icon class for when the node is expanded. + * @param {string} s The expanded icon class. + * @protected + */ + setExpandedIconClass(s: string): void; + + /** + * Gets the icon class for when the node is expanded. + * @return {string} The class. + * @protected + */ + getExpandedIconClass(): string; + + /** + * Sets the text of the label. + * @param {string} s The plain text of the label. + * @protected + */ + setText(s: string): void; + + /** + * Returns the text of the label. If the text was originally set as HTML, the + * return value is unspecified. + * @return {string} The plain text of the label. + * @package + */ + getText(): string; + + /** + * Sets the text of the tooltip. + * @param {string} s The tooltip text to set. + * @protected + */ + setToolTip(s: string): void; + + /** + * Returns the text of the tooltip. + * @return {?string} The tooltip text. + * @protected + */ + getToolTip(): string; + + /** + * Updates the row styles. + * @protected + */ + updateRow(): void; + + /** + * Updates the expand icon of the node. + * @protected + */ + updateExpandIcon(): void; + + /** + * Handles mouse down event. + * @param {!Event} e The browser event. + * @protected + */ + onMouseDown(e: Event): void; + + /** + * Handles a click event. + * @param {!Event} e The browser event. + * @protected + */ + onClick_(e: Event): void; + + /** + * Handles a double click event. + * @param {!Event} e The browser event. + * @protected + */ + onDoubleClick_(e: Event): void; + + /** + * Handles a key down event. + * @param {!Event} e The browser event. + * @return {boolean} The handled value. + * @protected + */ + onKeyDown(e: Event): boolean; + + /** + * @return {Blockly.tree.BaseNode} The last shown descendant. + * @protected + */ + getLastShownDescendant(): Blockly.tree.BaseNode; + + /** + * @return {Blockly.tree.BaseNode} The next node to show or null if there isn't + * a next node to show. + * @protected + */ + getNextShownNode(): Blockly.tree.BaseNode; + + /** + * @return {Blockly.tree.BaseNode} The previous node to show. + * @protected + */ + getPreviousShownNode(): Blockly.tree.BaseNode; + + /** + * @return {Blockly.tree.BaseNode.Config} The configuration for the tree. + * @protected + */ + getConfig(): Blockly.tree.BaseNode.Config; + + /** + * Internal method that is used to set the tree control on the node. + * @param {Blockly.tree.TreeControl} tree The tree control. + * @protected + */ + setTreeInternal(tree: Blockly.tree.TreeControl): void; + } + +} + +declare module Blockly.tree.BaseNode { + + /** + * The config type for the tree. + * @typedef {{ + * indentWidth:number, + * cssRoot:string, + * cssHideRoot:string, + * cssItem:string, + * cssChildren:string, + * cssChildrenNoLines:string, + * cssTreeRow:string, + * cssItemLabel:string, + * cssTreeIcon:string, + * cssExpandTreeIcon:string, + * cssExpandTreeIconPlus:string, + * cssExpandTreeIconMinus:string, + * cssExpandTreeIconTPlus:string, + * cssExpandTreeIconTMinus:string, + * cssExpandTreeIconLPlus:string, + * cssExpandTreeIconLMinus:string, + * cssExpandTreeIconT:string, + * cssExpandTreeIconL:string, + * cssExpandTreeIconBlank:string, + * cssExpandedFolderIcon:string, + * cssCollapsedFolderIcon:string, + * cssFileIcon:string, + * cssExpandedRootIcon:string, + * cssCollapsedRootIcon:string, + * cssSelectedRow:string + * }} + */ + interface Config { + indentWidth: number; + cssRoot: string; + cssHideRoot: string; + cssItem: string; + cssChildren: string; + cssChildrenNoLines: string; + cssTreeRow: string; + cssItemLabel: string; + cssTreeIcon: string; + cssExpandTreeIcon: string; + cssExpandTreeIconPlus: string; + cssExpandTreeIconMinus: string; + cssExpandTreeIconTPlus: string; + cssExpandTreeIconTMinus: string; + cssExpandTreeIconLPlus: string; + cssExpandTreeIconLMinus: string; + cssExpandTreeIconT: string; + cssExpandTreeIconL: string; + cssExpandTreeIconBlank: string; + cssExpandedFolderIcon: string; + cssCollapsedFolderIcon: string; + cssFileIcon: string; + cssExpandedRootIcon: string; + cssCollapsedRootIcon: string; + cssSelectedRow: string + } + + /** + * Map of nodes in existence. Needed to route events to the appropriate nodes. + * Nodes are added to the map at {@link #enterDocument} time and removed at + * {@link #exitDocument} time. + * @type {Object} + * @protected + */ + var allNodes: Object; +} + + +declare module Blockly.tree { + + class TreeControl extends TreeControl__Class { } + /** Fake class which should be extended to avoid inheriting static properties */ + class TreeControl__Class extends Blockly.tree.BaseNode__Class { + + /** + * An extension of the TreeControl object in closure that provides + * a way to view a hierarchical set of data. + * Similar to Closure's goog.ui.tree.TreeControl + * + * @param {Blockly.Toolbox} toolbox The parent toolbox for this tree. + * @param {Blockly.tree.BaseNode.Config} config The configuration for the tree. + * @constructor + * @extends {Blockly.tree.BaseNode} + */ + constructor(toolbox: Blockly.Toolbox, config: Blockly.tree.BaseNode.Config); + + /** + * Returns the assosiated toolbox. + * @return {Blockly.Toolbox} The toolbox. + * @package + */ + getToolbox(): Blockly.Toolbox; + + /** + * Get whether this tree has focus or not. + * @return {boolean} True if it has focus. + * @package + */ + hasFocus(): boolean; + + /** + * Sets the selected item. + * @param {Blockly.tree.BaseNode} node The item to select. + * @package + */ + setSelectedItem(node: Blockly.tree.BaseNode): void; + + /** + * Set the handler that's triggered before a node is selected. + * @param {function(Blockly.tree.BaseNode):boolean} fn The handler + * @package + */ + onBeforeSelected(fn: { (_0: Blockly.tree.BaseNode): boolean }): void; + + /** + * Set the handler that's triggered after a node is selected. + * @param {function( + * Blockly.tree.BaseNode, Blockly.tree.BaseNode):?} fn The handler + * @package + */ + onAfterSelected(fn: { (_0: Blockly.tree.BaseNode, _1: Blockly.tree.BaseNode): any }): void; + + /** + * Returns the selected item. + * @return {Blockly.tree.BaseNode} The currently selected item. + * @package + */ + getSelectedItem(): Blockly.tree.BaseNode; + + /** + * Creates a new tree node using the same config as the root. + * @param {string=} opt_content The content of the node label. + * @return {!Blockly.tree.TreeNode} The new item. + * @package + */ + createNode(opt_content?: string): Blockly.tree.TreeNode; + } + +} + + +declare module Blockly.tree { + + class TreeNode extends TreeNode__Class { } + /** Fake class which should be extended to avoid inheriting static properties */ + class TreeNode__Class extends Blockly.tree.BaseNode__Class { + + /** + * A single node in the tree, customized for Blockly's UI. + * Similar to Closure's goog.ui.tree.TreeNode + * + * @param {Blockly.Toolbox} toolbox The parent toolbox for this tree. + * @param {string} content The content of the node label treated as + * plain-text and will be HTML escaped. + * @param {Blockly.tree.BaseNode.Config} config The configuration for the tree. + * @constructor + * @extends {Blockly.tree.BaseNode} + */ + constructor(toolbox: Blockly.Toolbox, content: string, config: Blockly.tree.BaseNode.Config); + + /** + * Set the handler that's triggered when the size of node has changed. + * @param {function():?} fn The handler + * @package + */ + onSizeChanged(fn: { (): any }): void; + } + +} + + declare module Blockly.Msg { /** @type {string} */ diff --git a/typings/parts/goog-closure.d.ts b/typings/parts/goog-closure.d.ts index 462e8e1a7..61d1f33a7 100644 --- a/typings/parts/goog-closure.d.ts +++ b/typings/parts/goog-closure.d.ts @@ -83,15 +83,6 @@ declare namespace goog { } } - namespace ui.tree { - class BaseNode { - } - class TreeControl__Class { - } - class TreeNode__Class { - } - } - namespace events { function listen(eventSource: Element | Listenable, eventType: EventType, listener: any, capturePhase?: boolean, handler?: Object): void; function unlistenByKey(key: any): void;