diff --git a/core/block.js b/core/block.js index f83f43180..7654d2537 100644 --- a/core/block.js +++ b/core/block.js @@ -18,7 +18,6 @@ const Abstract = goog.requireType('Blockly.Events.Abstract'); const Comment = goog.requireType('Blockly.Comment'); const Connection = goog.require('Blockly.Connection'); const Coordinate = goog.require('Blockly.utils.Coordinate'); -const Events = goog.require('Blockly.Events'); const Extensions = goog.require('Blockly.Extensions'); /* eslint-disable-next-line no-unused-vars */ const Field = goog.requireType('Blockly.Field'); @@ -37,6 +36,7 @@ const VariableModel = goog.requireType('Blockly.VariableModel'); const Workspace = goog.requireType('Blockly.Workspace'); const common = goog.require('Blockly.common'); const constants = goog.require('Blockly.constants'); +const eventUtils = goog.require('Blockly.Events.utils'); const fieldRegistry = goog.require('Blockly.fieldRegistry'); const idGenerator = goog.require('Blockly.utils.idGenerator'); const inputTypes = goog.require('Blockly.inputTypes'); @@ -221,31 +221,31 @@ const Block = function(workspace, prototypeName, opt_id) { // All events fired should be part of the same group. // Any events fired during init should not be undoable, // so that block creation is atomic. - const existingGroup = Events.getGroup(); + const existingGroup = eventUtils.getGroup(); if (!existingGroup) { - Events.setGroup(true); + eventUtils.setGroup(true); } - const initialUndoFlag = Events.getRecordUndo(); + const initialUndoFlag = eventUtils.getRecordUndo(); try { // Call an initialization function, if it exists. if (typeof this.init == 'function') { - Events.setRecordUndo(false); + eventUtils.setRecordUndo(false); this.init(); - Events.setRecordUndo(initialUndoFlag); + eventUtils.setRecordUndo(initialUndoFlag); } // Fire a create event. - if (Events.isEnabled()) { - Events.fire(new (Events.get(Events.BLOCK_CREATE))(this)); + if (eventUtils.isEnabled()) { + eventUtils.fire(new (eventUtils.get(eventUtils.BLOCK_CREATE))(this)); } } finally { if (!existingGroup) { - Events.setGroup(false); + eventUtils.setGroup(false); } // In case init threw, recordUndo flag should still be reset. - Events.setRecordUndo(initialUndoFlag); + eventUtils.setRecordUndo(initialUndoFlag); } // Record initial inline state. @@ -392,10 +392,10 @@ Block.prototype.dispose = function(healStack) { } this.unplug(healStack); - if (Events.isEnabled()) { - Events.fire(new (Events.get(Events.BLOCK_DELETE))(this)); + if (eventUtils.isEnabled()) { + eventUtils.fire(new (eventUtils.get(eventUtils.BLOCK_DELETE))(this)); } - Events.disable(); + eventUtils.disable(); try { // This block is now at the top of the workspace. @@ -432,7 +432,7 @@ Block.prototype.dispose = function(healStack) { connection.dispose(); } } finally { - Events.enable(); + eventUtils.enable(); this.disposed = true; } }; @@ -1271,7 +1271,7 @@ Block.prototype.setOutput = function(newBoolean, opt_check) { */ Block.prototype.setInputsInline = function(newBoolean) { if (this.inputsInline != newBoolean) { - Events.fire(new (Events.get(Events.BLOCK_CHANGE))( + eventUtils.fire(new (eventUtils.get(eventUtils.BLOCK_CHANGE))( this, 'inline', null, this.inputsInline, newBoolean)); this.inputsInline = newBoolean; } @@ -1336,7 +1336,7 @@ Block.prototype.setEnabled = function(enabled) { if (this.isEnabled() != enabled) { const oldValue = this.disabled; this.disabled = !enabled; - Events.fire(new (Events.get(Events.BLOCK_CHANGE))( + eventUtils.fire(new (eventUtils.get(eventUtils.BLOCK_CHANGE))( this, 'disabled', null, oldValue, !enabled)); } }; @@ -1372,7 +1372,7 @@ Block.prototype.isCollapsed = function() { */ Block.prototype.setCollapsed = function(collapsed) { if (this.collapsed_ != collapsed) { - Events.fire(new (Events.get(Events.BLOCK_CHANGE))( + eventUtils.fire(new (eventUtils.get(eventUtils.BLOCK_CHANGE))( this, 'collapsed', null, this.collapsed_, collapsed)); this.collapsed_ = collapsed; } @@ -2045,7 +2045,7 @@ Block.prototype.setCommentText = function(text) { if (this.commentModel.text == text) { return; } - Events.fire(new (Events.get(Events.BLOCK_CHANGE))( + eventUtils.fire(new (eventUtils.get(eventUtils.BLOCK_CHANGE))( this, 'comment', null, this.commentModel.text, text)); this.commentModel.text = text; this.comment = text; // For backwards compatibility. @@ -2088,10 +2088,10 @@ Block.prototype.moveBy = function(dx, dy) { if (this.parentBlock_) { throw Error('Block has parent.'); } - const event = new (Events.get(Events.BLOCK_MOVE))(this); + const event = new (eventUtils.get(eventUtils.BLOCK_MOVE))(this); this.xy_.translate(dx, dy); event.recordNew(); - Events.fire(event); + eventUtils.fire(event); }; /** diff --git a/core/block_dragger.js b/core/block_dragger.js index 650cf4a88..9e9c4e1cd 100644 --- a/core/block_dragger.js +++ b/core/block_dragger.js @@ -24,7 +24,7 @@ const blockAnimation = goog.require('Blockly.blockAnimations'); const bumpObjects = goog.require('Blockly.bumpObjects'); const common = goog.require('Blockly.common'); const dom = goog.require('Blockly.utils.dom'); -const events = goog.require('Blockly.Events'); +const eventUtils = goog.require('Blockly.Events.utils'); const registry = goog.require('Blockly.registry'); /* eslint-disable-next-line no-unused-vars */ const {BlockSvg} = goog.requireType('Blockly.BlockSvg'); @@ -146,8 +146,8 @@ const initIconData = function(block) { * @public */ BlockDragger.prototype.startDrag = function(currentDragDeltaXY, healStack) { - if (!events.getGroup()) { - events.setGroup(true); + if (!eventUtils.getGroup()) { + eventUtils.setGroup(true); } this.fireDragStartEvent_(); @@ -213,9 +213,9 @@ BlockDragger.prototype.disconnectBlock_ = function( * @protected */ BlockDragger.prototype.fireDragStartEvent_ = function() { - const event = new (events.get(events.BLOCK_DRAG))( + const event = new (eventUtils.get(eventUtils.BLOCK_DRAG))( this.draggingBlock_, true, this.draggingBlock_.getDescendants(false)); - events.fire(event); + eventUtils.fire(event); }; /** @@ -301,7 +301,7 @@ BlockDragger.prototype.endDrag = function(e, currentDragDeltaXY) { } this.workspace_.setResizesEnabled(true); - events.setGroup(false); + eventUtils.setGroup(false); }; /** @@ -362,9 +362,9 @@ BlockDragger.prototype.updateBlockAfterMove_ = function(delta) { * @protected */ BlockDragger.prototype.fireDragEndEvent_ = function() { - const event = new (events.get(events.BLOCK_DRAG))( + const event = new (eventUtils.get(eventUtils.BLOCK_DRAG))( this.draggingBlock_, false, this.draggingBlock_.getDescendants(false)); - events.fire(event); + eventUtils.fire(event); }; /** @@ -395,10 +395,10 @@ BlockDragger.prototype.updateToolboxStyle_ = function(isEnd) { * @protected */ BlockDragger.prototype.fireMoveEvent_ = function() { - const event = new (events.get(events.BLOCK_MOVE))(this.draggingBlock_); + const event = new (eventUtils.get(eventUtils.BLOCK_MOVE))(this.draggingBlock_); event.oldCoordinate = this.startXY_; event.recordNew(); - events.fire(event); + eventUtils.fire(event); }; /** diff --git a/core/block_svg.js b/core/block_svg.js index 166d75aff..838592305 100644 --- a/core/block_svg.js +++ b/core/block_svg.js @@ -21,7 +21,6 @@ const Connection = goog.requireType('Blockly.Connection'); const ContextMenu = goog.require('Blockly.ContextMenu'); const ContextMenuRegistry = goog.require('Blockly.ContextMenuRegistry'); const Coordinate = goog.require('Blockly.utils.Coordinate'); -const Events = goog.require('Blockly.Events'); /* eslint-disable-next-line no-unused-vars */ const Field = goog.requireType('Blockly.Field'); const FieldLabel = goog.require('Blockly.FieldLabel'); @@ -59,6 +58,7 @@ const browserEvents = goog.require('Blockly.browserEvents'); const common = goog.require('Blockly.common'); const constants = goog.require('Blockly.constants'); const dom = goog.require('Blockly.utils.dom'); +const eventUtils = goog.require('Blockly.Events.utils'); const internalConstants = goog.require('Blockly.internalConstants'); const object = goog.require('Blockly.utils.object'); const userAgent = goog.require('Blockly.utils.userAgent'); @@ -289,16 +289,16 @@ BlockSvg.prototype.select = function() { if (common.getSelected()) { oldId = common.getSelected().id; // Unselect any previously selected block. - Events.disable(); + eventUtils.disable(); try { common.getSelected().unselect(); } finally { - Events.enable(); + eventUtils.enable(); } } const event = - new (Events.get(Events.SELECTED))(oldId, this.id, this.workspace.id); - Events.fire(event); + new (eventUtils.get(eventUtils.SELECTED))(oldId, this.id, this.workspace.id); + eventUtils.fire(event); common.setSelected(this); this.addSelect(); }; @@ -312,9 +312,9 @@ BlockSvg.prototype.unselect = function() { return; } const event = - new (Events.get(Events.SELECTED))(this.id, null, this.workspace.id); + new (eventUtils.get(eventUtils.SELECTED))(this.id, null, this.workspace.id); event.workspaceId = this.workspace.id; - Events.fire(event); + eventUtils.fire(event); common.setSelected(null); this.removeSelect(); }; @@ -453,17 +453,17 @@ BlockSvg.prototype.moveBy = function(dx, dy) { if (this.parentBlock_) { throw Error('Block has parent.'); } - const eventsEnabled = Events.isEnabled(); + const eventsEnabled = eventUtils.isEnabled(); let event; if (eventsEnabled) { - event = new (Events.get(Events.BLOCK_MOVE))(this); + event = new (eventUtils.get(eventUtils.BLOCK_MOVE))(this); } const xy = this.getRelativeToSurfaceXY(); this.translate(xy.x + dx, xy.y + dy); this.moveConnections(dx, dy); if (eventsEnabled) { event.recordNew(); - Events.fire(event); + eventUtils.fire(event); } this.workspace.resizeContents(); }; @@ -943,7 +943,7 @@ BlockSvg.prototype.checkAndDelete = function() { if (this.workspace.isFlyout) { return; } - Events.setGroup(true); + eventUtils.setGroup(true); this.workspace.hideChaff(); if (this.outputConnection) { // Do not attempt to heal rows @@ -952,7 +952,7 @@ BlockSvg.prototype.checkAndDelete = function() { } else { this.dispose(/* heal */ true, true); } - Events.setGroup(false); + eventUtils.setGroup(false); }; /** @@ -1568,18 +1568,18 @@ BlockSvg.prototype.bumpNeighbours = function() { BlockSvg.prototype.scheduleSnapAndBump = function() { const block = this; // Ensure that any snap and bump are part of this move's event group. - const group = Events.getGroup(); + const group = eventUtils.getGroup(); setTimeout(function() { - Events.setGroup(group); + eventUtils.setGroup(group); block.snapToGrid(); - Events.setGroup(false); + eventUtils.setGroup(false); }, internalConstants.BUMP_DELAY / 2); setTimeout(function() { - Events.setGroup(group); + eventUtils.setGroup(group); block.bumpNeighbours(); - Events.setGroup(false); + eventUtils.setGroup(false); }, internalConstants.BUMP_DELAY); }; diff --git a/core/blockly.js b/core/blockly.js index 4ccb0fbb9..a02835e1a 100644 --- a/core/blockly.js +++ b/core/blockly.js @@ -33,6 +33,7 @@ const Css = goog.require('Blockly.Css'); const DeleteArea = goog.require('Blockly.DeleteArea'); const DragTarget = goog.require('Blockly.DragTarget'); const DropDownDiv = goog.require('Blockly.DropDownDiv'); +const Events = goog.require('Blockly.Events'); const Extensions = goog.require('Blockly.Extensions'); const Field = goog.require('Blockly.Field'); const FieldAngle = goog.require('Blockly.FieldAngle'); @@ -558,6 +559,7 @@ exports.Cursor = Cursor; exports.DeleteArea = DeleteArea; exports.DragTarget = DragTarget; exports.DropDownDiv = DropDownDiv; +exports.Events = Events; exports.Extensions = Extensions; exports.Field = Field; exports.FieldAngle = FieldAngle; diff --git a/core/bubble_dragger.js b/core/bubble_dragger.js index c6e87ea9e..83aadb24b 100644 --- a/core/bubble_dragger.js +++ b/core/bubble_dragger.js @@ -14,7 +14,6 @@ goog.module('Blockly.BubbleDragger'); const ComponentManager = goog.require('Blockly.ComponentManager'); const Coordinate = goog.require('Blockly.utils.Coordinate'); -const Events = goog.require('Blockly.Events'); /* eslint-disable-next-line no-unused-vars */ const IBubble = goog.requireType('Blockly.IBubble'); /* eslint-disable-next-line no-unused-vars */ @@ -25,6 +24,7 @@ const IDragTarget = goog.requireType('Blockly.IDragTarget'); const WorkspaceCommentSvg = goog.requireType('Blockly.WorkspaceCommentSvg'); /* eslint-disable-next-line no-unused-vars */ const WorkspaceSvg = goog.requireType('Blockly.WorkspaceSvg'); +const eventUtils = goog.require('Blockly.Events.utils'); const utils = goog.require('Blockly.utils'); /* eslint-disable-next-line no-unused-vars */ const {BlockDragSurfaceSvg} = goog.requireType('Blockly.BlockDragSurfaceSvg'); @@ -109,8 +109,8 @@ BubbleDragger.prototype.dispose = function() { * @package */ BubbleDragger.prototype.startBubbleDrag = function() { - if (!Events.getGroup()) { - Events.setGroup(true); + if (!eventUtils.getGroup()) { + eventUtils.setGroup(true); } this.workspace_.setResizesEnabled(false); @@ -226,7 +226,7 @@ BubbleDragger.prototype.endBubbleDrag = function(e, currentDragDeltaXY) { } this.workspace_.setResizesEnabled(true); - Events.setGroup(false); + eventUtils.setGroup(false); }; /** @@ -236,11 +236,11 @@ BubbleDragger.prototype.endBubbleDrag = function(e, currentDragDeltaXY) { BubbleDragger.prototype.fireMoveEvent_ = function() { if (this.draggingBubble_.isComment) { // TODO (adodson): Resolve build errors when requiring WorkspaceCommentSvg. - const event = new (Events.get(Events.COMMENT_MOVE))( + const event = new (eventUtils.get(eventUtils.COMMENT_MOVE))( /** @type {!WorkspaceCommentSvg} */ (this.draggingBubble_)); event.setOldCoordinate(this.startXY_); event.recordNew(); - Events.fire(event); + eventUtils.fire(event); } // TODO (fenichel): move events for comments. return; diff --git a/core/bump_objects.js b/core/bump_objects.js index 200e2d0d2..80f42ab91 100644 --- a/core/bump_objects.js +++ b/core/bump_objects.js @@ -13,15 +13,18 @@ goog.module('Blockly.bumpObjects'); /* eslint-disable-next-line no-unused-vars */ -const Events = goog.require('Blockly.Events'); +const Abstract = goog.requireType('Blockly.Events.Abstract'); /* eslint-disable-next-line no-unused-vars */ const IBoundedElement = goog.requireType('Blockly.IBoundedElement'); /* eslint-disable-next-line no-unused-vars */ const MetricsManager = goog.requireType('Blockly.MetricsManager'); /* eslint-disable-next-line no-unused-vars */ +const ViewportChange = goog.requireType('Blockly.Events.ViewportChange'); +/* eslint-disable-next-line no-unused-vars */ const WorkspaceCommentSvg = goog.requireType('Blockly.WorkspaceCommentSvg'); /* eslint-disable-next-line no-unused-vars */ const WorkspaceSvg = goog.requireType('Blockly.WorkspaceSvg'); +const eventUtils = goog.require('Blockly.Events.utils'); const mathUtils = goog.require('Blockly.utils.math'); /* eslint-disable-next-line no-unused-vars */ const {BlockSvg} = goog.requireType('Blockly.BlockSvg'); @@ -81,7 +84,7 @@ exports.bumpIntoBounds = bumpObjectIntoBounds; /** * Creates a handler for bumping objects when they cross fixed bounds. * @param {!WorkspaceSvg} workspace The workspace to handle. - * @return {function(Events.Abstract)} The event handler. + * @return {function(Abstract)} The event handler. */ const bumpIntoBoundsHandler = function(workspace) { return function(e) { @@ -90,7 +93,7 @@ const bumpIntoBoundsHandler = function(workspace) { return; } - if (Events.BUMP_EVENTS.indexOf(e.type) !== -1) { + if (eventUtils.BUMP_EVENTS.indexOf(e.type) !== -1) { const scrollMetricsInWsCoords = metricsManager.getScrollMetrics(true); // Triggered by move/create event @@ -99,8 +102,8 @@ const bumpIntoBoundsHandler = function(workspace) { return; } // Handle undo. - const oldGroup = Events.getGroup(); - Events.setGroup(e.group); + const oldGroup = eventUtils.getGroup(); + eventUtils.setGroup(e.group); const wasBumped = bumpObjectIntoBounds( workspace, scrollMetricsInWsCoords, @@ -112,10 +115,10 @@ const bumpIntoBoundsHandler = function(workspace) { ' event group. This may break undo.'); } if (oldGroup !== null) { - Events.setGroup(oldGroup); + eventUtils.setGroup(oldGroup); } - } else if (e.type === Events.VIEWPORT_CHANGE) { - const viewportEvent = /** @type {!Events.ViewportChange} */ (e); + } else if (e.type === eventUtils.VIEWPORT_CHANGE) { + const viewportEvent = /** @type {!ViewportChange} */ (e); if (viewportEvent.scale > viewportEvent.oldScale) { bumpTopObjectsIntoBounds(workspace); } @@ -128,22 +131,22 @@ exports.bumpIntoBoundsHandler = bumpIntoBoundsHandler; * Extracts the object from the given event. * @param {!WorkspaceSvg} workspace The workspace the event originated * from. - * @param {!Events.BumpEvent} e An event containing an object. + * @param {!eventUtils.BumpEvent} e An event containing an object. * @return {?BlockSvg|?WorkspaceCommentSvg} The extracted * object. */ const extractObjectFromEvent = function(workspace, e) { let object = null; switch (e.type) { - case Events.BLOCK_CREATE: - case Events.BLOCK_MOVE: + case eventUtils.BLOCK_CREATE: + case eventUtils.BLOCK_MOVE: object = workspace.getBlockById(e.blockId); if (object) { object = object.getRootBlock(); } break; - case Events.COMMENT_CREATE: - case Events.COMMENT_MOVE: + case eventUtils.COMMENT_CREATE: + case eventUtils.COMMENT_MOVE: object = ( /** @type {?WorkspaceCommentSvg} */ (workspace.getCommentById(e.commentId))); diff --git a/core/clipboard.js b/core/clipboard.js index 4c7205cac..33a1b9c24 100644 --- a/core/clipboard.js +++ b/core/clipboard.js @@ -12,9 +12,10 @@ goog.module('Blockly.clipboard'); -const Events = goog.require('Blockly.Events'); /* eslint-disable-next-line no-unused-vars */ const ICopyable = goog.requireType('Blockly.ICopyable'); +const eventUtils = goog.require('Blockly.Events.utils'); + /** * Metadata about the object that is currently on the clipboard. @@ -48,9 +49,9 @@ const paste = function() { } if (copyData.typeCounts && workspace.isCapacityAvailable(copyData.typeCounts)) { - Events.setGroup(true); + eventUtils.setGroup(true); workspace.paste(copyData.saveInfo); - Events.setGroup(false); + eventUtils.setGroup(false); return true; } return false; diff --git a/core/comment.js b/core/comment.js index 76a9f08d3..149b9f65d 100644 --- a/core/comment.js +++ b/core/comment.js @@ -16,7 +16,6 @@ const Bubble = goog.require('Blockly.Bubble'); /* eslint-disable-next-line no-unused-vars */ const Coordinate = goog.requireType('Blockly.utils.Coordinate'); const Css = goog.require('Blockly.Css'); -const Events = goog.require('Blockly.Events'); const Icon = goog.require('Blockly.Icon'); /* eslint-disable-next-line no-unused-vars */ const Size = goog.requireType('Blockly.utils.Size'); @@ -25,6 +24,7 @@ const Svg = goog.require('Blockly.utils.Svg'); const WorkspaceSvg = goog.requireType('Blockly.WorkspaceSvg'); const browserEvents = goog.require('Blockly.browserEvents'); const dom = goog.require('Blockly.utils.dom'); +const eventUtils = goog.require('Blockly.Events.utils'); const object = goog.require('Blockly.utils.object'); const userAgent = goog.require('Blockly.utils.userAgent'); /* eslint-disable-next-line no-unused-vars */ @@ -180,7 +180,7 @@ Comment.prototype.createEditor_ = function() { this.onChangeWrapper_ = browserEvents.conditionalBind(textarea, 'change', this, function(_e) { if (this.cachedText_ != this.model_.text) { - Events.fire(new (Events.get(Events.BLOCK_CHANGE))( + eventUtils.fire(new (eventUtils.get(eventUtils.BLOCK_CHANGE))( this.block_, 'comment', null, this.cachedText_, this.model_.text)); } @@ -245,8 +245,8 @@ Comment.prototype.setVisible = function(visible) { if (visible == this.isVisible()) { return; } - Events.fire( - new (Events.get(Events.BUBBLE_OPEN))(this.block_, visible, 'comment')); + eventUtils.fire( + new (eventUtils.get(eventUtils.BUBBLE_OPEN))(this.block_, visible, 'comment')); this.model_.pinned = visible; if (visible) { this.createBubble_(); diff --git a/core/connection.js b/core/connection.js index 5ebd1e773..30dcab1f9 100644 --- a/core/connection.js +++ b/core/connection.js @@ -12,7 +12,6 @@ goog.module('Blockly.Connection'); -const Events = goog.require('Blockly.Events'); /* eslint-disable-next-line no-unused-vars */ const IASTNodeLocationWithBlock = goog.requireType('Blockly.IASTNodeLocationWithBlock'); /* eslint-disable-next-line no-unused-vars */ @@ -22,6 +21,7 @@ const Input = goog.requireType('Blockly.Input'); const Xml = goog.require('Blockly.Xml'); const blocks = goog.require('Blockly.serialization.blocks'); const deprecation = goog.require('Blockly.utils.deprecation'); +const eventUtils = goog.require('Blockly.Events.utils'); /* eslint-disable-next-line no-unused-vars */ const {Block} = goog.requireType('Blockly.Block'); const {ConnectionType} = goog.require('Blockly.ConnectionType'); @@ -134,14 +134,14 @@ Connection.prototype.connect_ = function(childConnection) { // Connect the new connection to the parent. let event; - if (Events.isEnabled()) { - event = new (Events.get(Events.BLOCK_MOVE))(childBlock); + if (eventUtils.isEnabled()) { + event = new (eventUtils.get(eventUtils.BLOCK_MOVE))(childBlock); } connectReciprocally(parentConnection, childConnection); childBlock.setParent(parentBlock); if (event) { event.recordNew(); - Events.fire(event); + eventUtils.fire(event); } // Deal with the orphan if it exists. @@ -289,9 +289,9 @@ Connection.prototype.connect = function(otherConnection) { const checker = this.getConnectionChecker(); if (checker.canConnect(this, otherConnection, false)) { - const eventGroup = Events.getGroup(); + const eventGroup = eventUtils.getGroup(); if (!eventGroup) { - Events.setGroup(true); + eventUtils.setGroup(true); } // Determine which block is superior (higher in the source stack). if (this.isSuperior()) { @@ -302,7 +302,7 @@ Connection.prototype.connect = function(otherConnection) { otherConnection.connect_(this); } if (!eventGroup) { - Events.setGroup(false); + eventUtils.setGroup(false); } } @@ -423,9 +423,9 @@ Connection.prototype.disconnect = function() { parentConnection = otherConnection; } - const eventGroup = Events.getGroup(); + const eventGroup = eventUtils.getGroup(); if (!eventGroup) { - Events.setGroup(true); + eventUtils.setGroup(true); } this.disconnectInternal_(parentBlock, childBlock); if (!childBlock.isShadow()) { @@ -433,7 +433,7 @@ Connection.prototype.disconnect = function() { parentConnection.respawnShadow_(); } if (!eventGroup) { - Events.setGroup(false); + eventUtils.setGroup(false); } }; @@ -445,8 +445,8 @@ Connection.prototype.disconnect = function() { */ Connection.prototype.disconnectInternal_ = function(parentBlock, childBlock) { let event; - if (Events.isEnabled()) { - event = new (Events.get(Events.BLOCK_MOVE))(childBlock); + if (eventUtils.isEnabled()) { + event = new (eventUtils.get(eventUtils.BLOCK_MOVE))(childBlock); } const otherConnection = this.targetConnection; otherConnection.targetConnection = null; @@ -454,7 +454,7 @@ Connection.prototype.disconnectInternal_ = function(parentBlock, childBlock) { childBlock.setParent(null); if (event) { event.recordNew(); - Events.fire(event); + eventUtils.fire(event); } }; diff --git a/core/contextmenu.js b/core/contextmenu.js index 6f4deb922..274b2a6e4 100644 --- a/core/contextmenu.js +++ b/core/contextmenu.js @@ -15,7 +15,6 @@ goog.module('Blockly.ContextMenu'); /* eslint-disable-next-line no-unused-vars */ const WorkspaceSvg = goog.requireType('Blockly.WorkspaceSvg'); const Coordinate = goog.require('Blockly.utils.Coordinate'); -const Events = goog.require('Blockly.Events'); const Menu = goog.require('Blockly.Menu'); const MenuItem = goog.require('Blockly.MenuItem'); const Msg = goog.require('Blockly.Msg'); @@ -27,6 +26,7 @@ const browserEvents = goog.require('Blockly.browserEvents'); const clipboard = goog.require('Blockly.clipboard'); const deprecation = goog.require('Blockly.utils.deprecation'); const dom = goog.require('Blockly.utils.dom'); +const eventUtils = goog.require('Blockly.Events.utils'); const internalConstants = goog.require('Blockly.internalConstants'); const userAgent = goog.require('Blockly.utils.userAgent'); const utils = goog.require('Blockly.utils'); @@ -242,7 +242,7 @@ exports.dispose = dispose; */ const callbackFactory = function(block, xml) { return function() { - Events.disable(); + eventUtils.disable(); let newBlock; try { newBlock = Xml.domToBlock(xml, block.workspace); @@ -256,10 +256,10 @@ const callbackFactory = function(block, xml) { xy.y += internalConstants.SNAP_RADIUS * 2; newBlock.moveBy(xy.x, xy.y); } finally { - Events.enable(); + eventUtils.enable(); } - if (Events.isEnabled() && !newBlock.isShadow()) { - Events.fire(new (Events.get(Events.BLOCK_CREATE))(newBlock)); + if (eventUtils.isEnabled() && !newBlock.isShadow()) { + eventUtils.fire(new (eventUtils.get(eventUtils.BLOCK_CREATE))(newBlock)); } newBlock.select(); }; @@ -279,9 +279,9 @@ const commentDeleteOption = function(comment) { text: Msg['REMOVE_COMMENT'], enabled: true, callback: function() { - Events.setGroup(true); + eventUtils.setGroup(true); comment.dispose(); - Events.setGroup(false); + eventUtils.setGroup(false); } }; return deleteOption; diff --git a/core/contextmenu_items.js b/core/contextmenu_items.js index ac2fb56df..f8af8893d 100644 --- a/core/contextmenu_items.js +++ b/core/contextmenu_items.js @@ -13,12 +13,12 @@ goog.module('Blockly.ContextMenuItems'); const ContextMenuRegistry = goog.require('Blockly.ContextMenuRegistry'); -const Events = goog.require('Blockly.Events'); const Msg = goog.require('Blockly.Msg'); /* eslint-disable-next-line no-unused-vars */ const WorkspaceSvg = goog.requireType('Blockly.WorkspaceSvg'); const clipboard = goog.require('Blockly.clipboard'); const dialog = goog.require('Blockly.dialog'); +const eventUtils = goog.require('Blockly.Events.utils'); const idGenerator = goog.require('Blockly.utils.idGenerator'); const inputTypes = goog.require('Blockly.inputTypes'); const userAgent = goog.require('Blockly.utils.userAgent'); @@ -242,7 +242,7 @@ const getDeletableBlocks_ = function(workspace) { */ const deleteNext_ = function(deleteList, eventGroup) { const DELAY = 10; - Events.setGroup(eventGroup); + eventUtils.setGroup(eventGroup); const block = deleteList.shift(); if (block) { if (block.workspace) { @@ -252,7 +252,7 @@ const deleteNext_ = function(deleteList, eventGroup) { deleteNext_(deleteList, eventGroup); } } - Events.setGroup(false); + eventUtils.setGroup(false); }; /** Option to delete all blocks. */ @@ -484,13 +484,13 @@ const registerDisable = function() { callback: function(/** @type {!ContextMenuRegistry.Scope} */ scope) { const block = scope.block; - const group = Events.getGroup(); + const group = eventUtils.getGroup(); if (!group) { - Events.setGroup(true); + eventUtils.setGroup(true); } block.setEnabled(!block.isEnabled()); if (!group) { - Events.setGroup(false); + eventUtils.setGroup(false); } }, scopeType: ContextMenuRegistry.ScopeType.BLOCK, diff --git a/core/events/events.js b/core/events/events.js index 4c88f1c03..69ce19420 100644 --- a/core/events/events.js +++ b/core/events/events.js @@ -15,589 +15,134 @@ * @namespace Blockly.Events */ goog.module('Blockly.Events'); -goog.module.declareLegacyNamespace(); -/* eslint-disable-next-line no-unused-vars */ -const Abstract = goog.requireType('Blockly.Events.Abstract'); -/* eslint-disable-next-line no-unused-vars */ -const BlockCreate = goog.requireType('Blockly.Events.BlockCreate'); -/* eslint-disable-next-line no-unused-vars */ -const BlockMove = goog.requireType('Blockly.Events.BlockMove'); -/* eslint-disable-next-line no-unused-vars */ -const CommentCreate = goog.requireType('Blockly.Events.CommentCreate'); -/* eslint-disable-next-line no-unused-vars */ -const CommentMove = goog.requireType('Blockly.Events.CommentMove'); -/* eslint-disable-next-line no-unused-vars */ -const Workspace = goog.requireType('Blockly.Workspace'); +const Abstract = goog.require('Blockly.Events.Abstract'); +const BlockBase = goog.require('Blockly.Events.BlockBase'); +const BlockChange = goog.require('Blockly.Events.BlockChange'); +const BlockCreate = goog.require('Blockly.Events.BlockCreate'); +const BlockDelete = goog.require('Blockly.Events.BlockDelete'); +const BlockDrag = goog.require('Blockly.Events.BlockDrag'); +const BlockMove = goog.require('Blockly.Events.BlockMove'); +const BubbleOpen = goog.require('Blockly.Events.BubbleOpen'); +const Click = goog.require('Blockly.Events.Click'); +const CommentBase = goog.require('Blockly.Events.CommentBase'); +const CommentChange = goog.require('Blockly.Events.CommentChange'); +const CommentCreate = goog.require('Blockly.Events.CommentCreate'); +const CommentDelete = goog.require('Blockly.Events.CommentDelete'); +const CommentMove = goog.require('Blockly.Events.CommentMove'); +const FinishedLoading = goog.require('Blockly.Events.FinishedLoading'); +const MarkerMove = goog.require('Blockly.Events.MarkerMove'); +const Selected = goog.require('Blockly.Events.Selected'); +const ThemeChange = goog.require('Blockly.Events.ThemeChange'); +const ToolboxItemSelect = goog.require('Blockly.Events.ToolboxItemSelect'); +const TrashcanOpen = goog.require('Blockly.Events.TrashcanOpen'); +const Ui = goog.require('Blockly.Events.Ui'); +const UiBase = goog.require('Blockly.Events.UiBase'); +const VarBase = goog.require('Blockly.Events.VarBase'); +const VarCreate = goog.require('Blockly.Events.VarCreate'); +const VarDelete = goog.require('Blockly.Events.VarDelete'); +const VarRename = goog.require('Blockly.Events.VarRename'); +const ViewportChange = goog.require('Blockly.Events.ViewportChange'); const deprecation = goog.require('Blockly.utils.deprecation'); -const idGenerator = goog.require('Blockly.utils.idGenerator'); -const registry = goog.require('Blockly.registry'); -/* eslint-disable-next-line no-unused-vars */ -const {Block} = goog.requireType('Blockly.Block'); +const eventUtils = goog.require('Blockly.Events.utils'); -/** - * Group ID for new events. Grouped events are indivisible. - * @type {string} - */ -let group = ''; +// Events. +exports.Abstract = Abstract; +exports.BubbleOpen = BubbleOpen; +exports.BlockBase = BlockBase; +exports.BlockChange = BlockChange; +exports.BlockCreate = BlockCreate; +exports.BlockDelete = BlockDelete; +exports.BlockDrag = BlockDrag; +exports.BlockMove = BlockMove; +exports.Click = Click; +exports.CommentBase = CommentBase; +exports.CommentChange = CommentChange; +exports.CommentCreate = CommentCreate; +exports.CommentDelete = CommentDelete; +exports.CommentMove = CommentMove; +exports.FinishedLoading = FinishedLoading; +exports.MarkerMove = MarkerMove; +exports.Selected = Selected; +exports.ThemeChange = ThemeChange; +exports.ToolboxItemSelect = ToolboxItemSelect; +exports.TrashcanOpen = TrashcanOpen; +exports.Ui = Ui; +exports.UiBase = UiBase; +exports.VarBase = VarBase; +exports.VarCreate = VarCreate; +exports.VarDelete = VarDelete; +exports.VarRename = VarRename; +exports.ViewportChange = ViewportChange; + +// Event types. +exports.BLOCK_CHANGE = eventUtils.BLOCK_CHANGE; +exports.BLOCK_CREATE = eventUtils.BLOCK_CREATE; +exports.BLOCK_DELETE = eventUtils.BLOCK_DELETE; +exports.BLOCK_DRAG = eventUtils.BLOCK_DRAG; +exports.BLOCK_MOVE = eventUtils.BLOCK_MOVE; +exports.BUBBLE_OPEN = eventUtils.BUBBLE_OPEN; +exports.BumpEvent = eventUtils.BumpEvent; +exports.BUMP_EVENTS = eventUtils.BUMP_EVENTS; +exports.CHANGE = eventUtils.CHANGE; +exports.CLICK = eventUtils.CLICK; +exports.COMMENT_CHANGE = eventUtils.COMMENT_CHANGE; +exports.COMMENT_CREATE = eventUtils.COMMENT_CREATE; +exports.COMMENT_DELETE = eventUtils.COMMENT_DELETE; +exports.COMMENT_MOVE = eventUtils.COMMENT_MOVE; +exports.CREATE = eventUtils.CREATE; +exports.DELETE = eventUtils.DELETE; +exports.FINISHED_LOADING = eventUtils.FINISHED_LOADING; +exports.MARKER_MOVE = eventUtils.MARKER_MOVE; +exports.MOVE = eventUtils.MOVE; +exports.SELECTED = eventUtils.SELECTED; +exports.THEME_CHANGE = eventUtils.THEME_CHANGE; +exports.TOOLBOX_ITEM_SELECT = eventUtils.TOOLBOX_ITEM_SELECT; +exports.TRASHCAN_OPEN = eventUtils.TRASHCAN_OPEN; +exports.UI = eventUtils.UI; +exports.VAR_CREATE = eventUtils.VAR_CREATE; +exports.VAR_DELETE = eventUtils.VAR_DELETE; +exports.VAR_RENAME = eventUtils.VAR_RENAME; +exports.VIEWPORT_CHANGE = eventUtils.VIEWPORT_CHANGE; + +// Event utils. +exports.clearPendingUndo = eventUtils.clearPendingUndo; +exports.disable = eventUtils.disable; +exports.enable = eventUtils.enable; +exports.filter = eventUtils.filter; +exports.fire = eventUtils.fire; +exports.fromJson = eventUtils.fromJson; +exports.getDescendantIds = eventUtils.getDescendantIds; +exports.get = eventUtils.get; +exports.getGroup = eventUtils.getGroup; +exports.getRecordUndo = eventUtils.getRecordUndo; +exports.isEnabled = eventUtils.isEnabled; +exports.setGroup = eventUtils.setGroup; +exports.setRecordUndo = eventUtils.setRecordUndo; +exports.disableOrphans = eventUtils.disableOrphans; /** * Sets whether the next event should be added to the undo stack. * @type {boolean} - * @alias Blockly.Events.recordUndo + * @deprecated September 2021 */ -let recordUndo = true; -/** @deprecated September 2021 */ -exports.recordUndo = recordUndo; - -/** - * Sets whether events should be added to the undo stack. - * @param {boolean} newValue True if events should be added to the undo stack. - * @alias Blockly.Events.setRecordUndo - */ -const setRecordUndo = function(newValue) { - recordUndo = newValue; -}; -exports.setRecordUndo = setRecordUndo; - -/** - * Returns whether or not events will be added to the undo stack. - * @returns {boolean} True if events will be added to the undo stack. - * @alias Blockly.Events.getRecordUndo - */ -const getRecordUndo = function() { - return recordUndo; -}; -exports.getRecordUndo = getRecordUndo; +exports.recordUndo = false; Object.defineProperties(exports, { recordUndo: { get: function() { deprecation.warn( - 'Blockly.Events.recordUndo', 'September 2021', 'September 2022', - 'Blockly.Events.getRecordUndo()'); - return getRecordUndo(); + 'Blockly.Events.recordUndo', 'September 2021', 'September 2022', + 'Blockly.Events.getRecordUndo()'); + return eventUtils.getRecordUndo(); }, set: function(record) { deprecation.warn( - 'Blockly.Events.recordUndo', 'September 2021', 'September 2022', - 'Blockly.Events.setRecordUndo()'); - setRecordUndo(record); + 'Blockly.Events.recordUndo', 'September 2021', 'September 2022', + 'Blockly.Events.setRecordUndo()'); + eventUtils.setRecordUndo(record); }, } - }); +}); -/** - * Allow change events to be created and fired. - * @type {number} - */ -let disabled = 0; - -/** - * Name of event that creates a block. Will be deprecated for BLOCK_CREATE. - * @const - * @alias Blockly.Events.CREATE - */ -const CREATE = 'create'; -exports.CREATE = CREATE; - -/** - * Name of event that creates a block. - * @const - * @alias Blockly.Events.BLOCK_CREATE - */ -const BLOCK_CREATE = CREATE; -exports.BLOCK_CREATE = BLOCK_CREATE; - -/** - * Name of event that deletes a block. Will be deprecated for BLOCK_DELETE. - * @const - * @alias Blockly.Events.DELETE - */ -const DELETE = 'delete'; -exports.DELETE = DELETE; - -/** - * Name of event that deletes a block. - * @const - * @alias Blockly.Events.BLOCK_DELETE - */ -const BLOCK_DELETE = DELETE; -exports.BLOCK_DELETE = BLOCK_DELETE; - -/** - * Name of event that changes a block. Will be deprecated for BLOCK_CHANGE. - * @const - * @alias Blockly.Events.CHANGE - */ -const CHANGE = 'change'; -exports.CHANGE = CHANGE; - -/** - * Name of event that changes a block. - * @const - * @alias Blockly.Events.BLOCK_CHANGE - */ -const BLOCK_CHANGE = CHANGE; -exports.BLOCK_CHANGE = BLOCK_CHANGE; - -/** - * Name of event that moves a block. Will be deprecated for BLOCK_MOVE. - * @const - * @alias Blockly.Events.MOVE - */ -const MOVE = 'move'; -exports.MOVE = MOVE; - -/** - * Name of event that moves a block. - * @const - * @alias Blockly.Events.BLOCK_MOVE - */ -const BLOCK_MOVE = MOVE; -exports.BLOCK_MOVE = BLOCK_MOVE; - -/** - * Name of event that creates a variable. - * @const - * @alias Blockly.Events.VAR_CREATE - */ -const VAR_CREATE = 'var_create'; -exports.VAR_CREATE = VAR_CREATE; - -/** - * Name of event that deletes a variable. - * @const - * @alias Blockly.Events.VAR_DELETE - */ -const VAR_DELETE = 'var_delete'; -exports.VAR_DELETE = VAR_DELETE; - -/** - * Name of event that renames a variable. - * @const - * @alias Blockly.Events.VAR_RENAME - */ -const VAR_RENAME = 'var_rename'; -exports.VAR_RENAME = VAR_RENAME; - -/** - * Name of generic event that records a UI change. - * @const - * @alias Blockly.Events.UI - */ -const UI = 'ui'; -exports.UI = UI; - -/** - * Name of event that record a block drags a block. - * @const - * @alias Blockly.Events.BLOCK_DRAG - */ -const BLOCK_DRAG = 'drag'; -exports.BLOCK_DRAG = BLOCK_DRAG; - -/** - * Name of event that records a change in selected element. - * @const - * @alias Blockly.Events.SELECTED - */ -const SELECTED = 'selected'; -exports.SELECTED = SELECTED; - -/** - * Name of event that records a click. - * @const - * @alias Blockly.Events.CLICK - */ -const CLICK = 'click'; -exports.CLICK = CLICK; - -/** - * Name of event that records a marker move. - * @const - * @alias Blockly.Events.MARKER_MOVE - */ -const MARKER_MOVE = 'marker_move'; -exports.MARKER_MOVE = MARKER_MOVE; - -/** - * Name of event that records a bubble open. - * @const - * @alias Blockly.Events.BUBBLE_OPEN - */ -const BUBBLE_OPEN = 'bubble_open'; -exports.BUBBLE_OPEN = BUBBLE_OPEN; - -/** - * Name of event that records a trashcan open. - * @const - * @alias Blockly.Events.TRASHCAN_OPEN - */ -const TRASHCAN_OPEN = 'trashcan_open'; -exports.TRASHCAN_OPEN = TRASHCAN_OPEN; - -/** - * Name of event that records a toolbox item select. - * @const - * @alias Blockly.Events.TOOLBOX_ITEM_SELECT - */ -const TOOLBOX_ITEM_SELECT = 'toolbox_item_select'; -exports.TOOLBOX_ITEM_SELECT = TOOLBOX_ITEM_SELECT; - -/** - * Name of event that records a theme change. - * @const - * @alias Blockly.Events.THEME_CHANGE - */ -const THEME_CHANGE = 'theme_change'; -exports.THEME_CHANGE = THEME_CHANGE; - -/** - * Name of event that records a viewport change. - * @const - * @alias Blockly.Events.VIEWPORT_CHANGE - */ -const VIEWPORT_CHANGE = 'viewport_change'; -exports.VIEWPORT_CHANGE = VIEWPORT_CHANGE; - -/** - * Name of event that creates a comment. - * @const - * @alias Blockly.Events.COMMENT_CREATE - */ -const COMMENT_CREATE = 'comment_create'; -exports.COMMENT_CREATE = COMMENT_CREATE; - -/** - * Name of event that deletes a comment. - * @const - * @alias Blockly.Events.COMMENT_DELETE - */ -const COMMENT_DELETE = 'comment_delete'; -exports.COMMENT_DELETE = COMMENT_DELETE; - -/** - * Name of event that changes a comment. - * @const - * @alias Blockly.Events.COMMENT_CHANGE - */ -const COMMENT_CHANGE = 'comment_change'; -exports.COMMENT_CHANGE = COMMENT_CHANGE; - -/** - * Name of event that moves a comment. - * @const - * @alias Blockly.Events.COMMENT_MOVE - */ -const COMMENT_MOVE = 'comment_move'; -exports.COMMENT_MOVE = COMMENT_MOVE; - -/** - * Name of event that records a workspace load. - * @alias Blockly.Events.FINISHED_LOADING - */ -const FINISHED_LOADING = 'finished_loading'; -exports.FINISHED_LOADING = FINISHED_LOADING; - -/** - * Type of events that cause objects to be bumped back into the visible - * portion of the workspace. - * - * Not to be confused with bumping so that disconnected connections do not - * appear connected. - * @typedef {!BlockCreate|!BlockMove| - * !CommentCreate|!CommentMove} - * @alias Blockly.Events.BumpEvent - */ -let BumpEvent; -exports.BumpEvent = BumpEvent; - -/** - * List of events that cause objects to be bumped back into the visible - * portion of the workspace. - * - * Not to be confused with bumping so that disconnected connections do not - * appear connected. - * @const - * @alias Blockly.Events.BUMP_EVENTS - */ -const BUMP_EVENTS = [BLOCK_CREATE, BLOCK_MOVE, COMMENT_CREATE, COMMENT_MOVE]; -exports.BUMP_EVENTS = BUMP_EVENTS; - -/** - * List of events queued for firing. - */ -const FIRE_QUEUE = []; - -/** - * Create a custom event and fire it. - * @param {!Abstract} event Custom data for event. - * @alias Blockly.Events.fire - */ -const fire = function(event) { - if (!isEnabled()) { - return; - } - if (!FIRE_QUEUE.length) { - // First event added; schedule a firing of the event queue. - setTimeout(fireNow, 0); - } - FIRE_QUEUE.push(event); -}; -exports.fire = fire; - -/** - * Fire all queued events. - */ -const fireNow = function() { - const queue = filter(FIRE_QUEUE, true); - FIRE_QUEUE.length = 0; - for (let i = 0, event; (event = queue[i]); i++) { - if (!event.workspaceId) { - continue; - } - const Workspace = goog.module.get('Blockly.Workspace'); - const eventWorkspace = Workspace.getById(event.workspaceId); - if (eventWorkspace) { - eventWorkspace.fireChangeListener(event); - } - } -}; - -/** - * Filter the queued events and merge duplicates. - * @param {!Array} queueIn Array of events. - * @param {boolean} forward True if forward (redo), false if backward (undo). - * @return {!Array} Array of filtered events. - * @alias Blockly.Events.filter - */ -const filter = function(queueIn, forward) { - let queue = queueIn.slice(); // Shallow copy of queue. - if (!forward) { - // Undo is merged in reverse order. - queue.reverse(); - } - const mergedQueue = []; - const hash = Object.create(null); - // Merge duplicates. - for (let i = 0, event; (event = queue[i]); i++) { - if (!event.isNull()) { - // Treat all UI events as the same type in hash table. - const eventType = event.isUiEvent ? UI : event.type; - const key = [eventType, event.blockId, event.workspaceId].join(' '); - - const lastEntry = hash[key]; - const lastEvent = lastEntry ? lastEntry.event : null; - if (!lastEntry) { - // Each item in the hash table has the event and the index of that event - // in the input array. This lets us make sure we only merge adjacent - // move events. - hash[key] = {event: event, index: i}; - mergedQueue.push(event); - } else if (event.type == MOVE && lastEntry.index == i - 1) { - // Merge move events. - lastEvent.newParentId = event.newParentId; - lastEvent.newInputName = event.newInputName; - lastEvent.newCoordinate = event.newCoordinate; - lastEntry.index = i; - } else if ( - event.type == CHANGE && event.element == lastEvent.element && - event.name == lastEvent.name) { - // Merge change events. - lastEvent.newValue = event.newValue; - } else if (event.type == VIEWPORT_CHANGE) { - // Merge viewport change events. - lastEvent.viewTop = event.viewTop; - lastEvent.viewLeft = event.viewLeft; - lastEvent.scale = event.scale; - lastEvent.oldScale = event.oldScale; - } else if (event.type == CLICK && lastEvent.type == BUBBLE_OPEN) { - // Drop click events caused by opening/closing bubbles. - } else { - // Collision: newer events should merge into this event to maintain - // order. - hash[key] = {event: event, index: i}; - mergedQueue.push(event); - } - } - } - // Filter out any events that have become null due to merging. - queue = mergedQueue.filter(function(e) { - return !e.isNull(); - }); - if (!forward) { - // Restore undo order. - queue.reverse(); - } - // Move mutation events to the top of the queue. - // Intentionally skip first event. - for (let i = 1, event; (event = queue[i]); i++) { - if (event.type == CHANGE && event.element == 'mutation') { - queue.unshift(queue.splice(i, 1)[0]); - } - } - return queue; -}; -exports.filter = filter; - -/** - * Modify pending undo events so that when they are fired they don't land - * in the undo stack. Called by Workspace.clearUndo. - * @alias Blockly.Events.clearPendingUndo - */ -const clearPendingUndo = function() { - for (let i = 0, event; (event = FIRE_QUEUE[i]); i++) { - event.recordUndo = false; - } -}; -exports.clearPendingUndo = clearPendingUndo; - -/** - * Stop sending events. Every call to this function MUST also call enable. - * @alias Blockly.Events.disable - */ -const disable = function() { - disabled++; -}; -exports.disable = disable; - -/** - * Start sending events. Unless events were already disabled when the - * corresponding call to disable was made. - * @alias Blockly.Events.enable - */ -const enable = function() { - disabled--; -}; -exports.enable = enable; - -/** - * Returns whether events may be fired or not. - * @return {boolean} True if enabled. - * @alias Blockly.Events.isEnabled - */ -const isEnabled = function() { - return disabled == 0; -}; -exports.isEnabled = isEnabled; - -/** - * Current group. - * @return {string} ID string. - * @alias Blockly.Events.getGroup - */ -const getGroup = function() { - return group; -}; -exports.getGroup = getGroup; - -/** - * Start or stop a group. - * @param {boolean|string} state True to start new group, false to end group. - * String to set group explicitly. - * @alias Blockly.Events.setGroup - */ -const setGroup = function(state) { - if (typeof state == 'boolean') { - group = state ? idGenerator.genUid() : ''; - } else { - group = state; - } -}; -exports.setGroup = setGroup; - -/** - * Compute a list of the IDs of the specified block and all its descendants. - * @param {!Block} block The root block. - * @return {!Array} List of block IDs. - * @alias Blockly.Events.getDescendantIds - */ -const getDescendantIds = function(block) { - const ids = []; - const descendants = block.getDescendants(false); - for (let i = 0, descendant; (descendant = descendants[i]); i++) { - ids[i] = descendant.id; - } - return ids; -}; -/** @package */ -exports.getDescendantIds = getDescendantIds; - -/** - * Decode the JSON into an event. - * @param {!Object} json JSON representation. - * @param {!Workspace} workspace Target workspace for event. - * @return {!Abstract} The event represented by the JSON. - * @throws {Error} if an event type is not found in the registry. - * @alias Blockly.Events.fromJson - */ -const fromJson = function(json, workspace) { - const eventClass = get(json.type); - if (!eventClass) { - throw Error('Unknown event type.'); - } - const event = new eventClass(); - event.fromJson(json); - event.workspaceId = workspace.id; - return event; -}; -exports.fromJson = fromJson; - -/** - * Gets the class for a specific event type from the registry. - * @param {string} eventType The type of the event to get. - * @return {?function(new:Abstract, ...?)} The event class with - * the given type or null if none exists. - * @alias Blockly.Events.get - */ -const get = function(eventType) { - return registry.getClass(registry.Type.EVENT, eventType); -}; -exports.get = get; - -/** - * Enable/disable a block depending on whether it is properly connected. - * Use this on applications where all blocks should be connected to a top block. - * Recommend setting the 'disable' option to 'false' in the config so that - * users don't try to re-enable disabled orphan blocks. - * @param {!Abstract} event Custom data for event. - * @alias Blockly.Events.disableOrphans - */ -const disableOrphans = function(event) { - if (event.type == MOVE || event.type == CREATE) { - if (!event.workspaceId) { - return; - } - const Workspace = goog.module.get('Blockly.Workspace'); - const eventWorkspace = Workspace.getById(event.workspaceId); - let block = eventWorkspace.getBlockById(event.blockId); - if (block) { - // Changing blocks as part of this event shouldn't be undoable. - const initialUndoFlag = recordUndo; - try { - recordUndo = false; - const parent = block.getParent(); - if (parent && parent.isEnabled()) { - const children = block.getDescendants(false); - for (let i = 0, child; (child = children[i]); i++) { - child.setEnabled(true); - } - } else if ( - (block.outputConnection || block.previousConnection) && - !eventWorkspace.isDragging()) { - do { - block.setEnabled(false); - block = block.getNextBlock(); - } while (block); - } - } finally { - recordUndo = initialUndoFlag; - } - } - } -}; -exports.disableOrphans = disableOrphans; - -exports.TEST_ONLY = {FIRE_QUEUE, fireNow}; diff --git a/core/events/events_abstract.js b/core/events/events_abstract.js index eff43fdac..051ea4960 100644 --- a/core/events/events_abstract.js +++ b/core/events/events_abstract.js @@ -12,9 +12,8 @@ 'use strict'; goog.module('Blockly.Events.Abstract'); -goog.module.declareLegacyNamespace(); -const Events = goog.require('Blockly.Events'); +const eventUtils = goog.require('Blockly.Events.utils'); /* eslint-disable-next-line no-unused-vars */ const Workspace = goog.requireType('Blockly.Workspace'); @@ -42,13 +41,13 @@ const Abstract = function() { * perspective, and should be undone together. * @type {string} */ - this.group = Events.getGroup(); + this.group = eventUtils.getGroup(); /** * Sets whether the event should be added to the undo stack. * @type {boolean} */ - this.recordUndo = Events.getRecordUndo(); + this.recordUndo = eventUtils.getRecordUndo(); }; /** diff --git a/core/events/events_block_base.js b/core/events/events_block_base.js index 96cf24dc3..62769dc2b 100644 --- a/core/events/events_block_base.js +++ b/core/events/events_block_base.js @@ -11,7 +11,6 @@ 'use strict'; goog.module('Blockly.Events.BlockBase'); -goog.module.declareLegacyNamespace(); const Abstract = goog.require('Blockly.Events.Abstract'); const object = goog.require('Blockly.utils.object'); diff --git a/core/events/events_block_change.js b/core/events/events_block_change.js index 3b7d9d188..526d09bc6 100644 --- a/core/events/events_block_change.js +++ b/core/events/events_block_change.js @@ -11,11 +11,10 @@ 'use strict'; goog.module('Blockly.Events.BlockChange'); -goog.module.declareLegacyNamespace(); const BlockBase = goog.require('Blockly.Events.BlockBase'); -const Events = goog.require('Blockly.Events'); const Xml = goog.require('Blockly.Xml'); +const eventUtils = goog.require('Blockly.Events.utils'); const object = goog.require('Blockly.utils.object'); const registry = goog.require('Blockly.registry'); /* eslint-disable-next-line no-unused-vars */ @@ -52,7 +51,7 @@ object.inherits(BlockChange, BlockBase); * Type of this event. * @type {string} */ -BlockChange.prototype.type = Events.BLOCK_CHANGE; +BlockChange.prototype.type = eventUtils.BLOCK_CHANGE; /** * Encode the event as JSON. @@ -136,7 +135,7 @@ BlockChange.prototype.run = function(forward) { block.domToMutation( Xml.textToDom(/** @type {string} */ (value) || '')); } - Events.fire(new BlockChange(block, 'mutation', null, oldState, value)); + eventUtils.fire(new BlockChange(block, 'mutation', null, oldState, value)); break; } default: @@ -164,6 +163,6 @@ BlockChange.getExtraBlockState_ = function(block) { return ''; }; -registry.register(registry.Type.EVENT, Events.CHANGE, BlockChange); +registry.register(registry.Type.EVENT, eventUtils.CHANGE, BlockChange); exports = BlockChange; diff --git a/core/events/events_block_create.js b/core/events/events_block_create.js index a43c2985b..acf9e8824 100644 --- a/core/events/events_block_create.js +++ b/core/events/events_block_create.js @@ -11,12 +11,11 @@ 'use strict'; goog.module('Blockly.Events.BlockCreate'); -goog.module.declareLegacyNamespace(); const BlockBase = goog.require('Blockly.Events.BlockBase'); -const Events = goog.require('Blockly.Events'); const Xml = goog.require('Blockly.Xml'); const blocks = goog.require('Blockly.serialization.blocks'); +const eventUtils = goog.require('Blockly.Events.utils'); const object = goog.require('Blockly.utils.object'); const registry = goog.require('Blockly.registry'); /* eslint-disable-next-line no-unused-vars */ @@ -41,7 +40,7 @@ const BlockCreate = function(opt_block) { } this.xml = Xml.blockToDomWithXY(opt_block); - this.ids = Events.getDescendantIds(opt_block); + this.ids = eventUtils.getDescendantIds(opt_block); /** * JSON representation of the block that was just created. @@ -56,7 +55,7 @@ object.inherits(BlockCreate, BlockBase); * Type of this event. * @type {string} */ -BlockCreate.prototype.type = Events.BLOCK_CREATE; +BlockCreate.prototype.type = eventUtils.BLOCK_CREATE; /** * Encode the event as JSON. @@ -109,6 +108,6 @@ BlockCreate.prototype.run = function(forward) { } }; -registry.register(registry.Type.EVENT, Events.CREATE, BlockCreate); +registry.register(registry.Type.EVENT, eventUtils.CREATE, BlockCreate); exports = BlockCreate; diff --git a/core/events/events_block_delete.js b/core/events/events_block_delete.js index 023023322..5a7e03cc6 100644 --- a/core/events/events_block_delete.js +++ b/core/events/events_block_delete.js @@ -11,12 +11,11 @@ 'use strict'; goog.module('Blockly.Events.BlockDelete'); -goog.module.declareLegacyNamespace(); const BlockBase = goog.require('Blockly.Events.BlockBase'); -const Events = goog.require('Blockly.Events'); const Xml = goog.require('Blockly.Xml'); const blocks = goog.require('Blockly.serialization.blocks'); +const eventUtils = goog.require('Blockly.Events.utils'); const object = goog.require('Blockly.utils.object'); const registry = goog.require('Blockly.registry'); /* eslint-disable-next-line no-unused-vars */ @@ -44,7 +43,7 @@ const BlockDelete = function(opt_block) { } this.oldXml = Xml.blockToDomWithXY(opt_block); - this.ids = Events.getDescendantIds(opt_block); + this.ids = eventUtils.getDescendantIds(opt_block); /** * Was the block that was just deleted a shadow? @@ -65,7 +64,7 @@ object.inherits(BlockDelete, BlockBase); * Type of this event. * @type {string} */ -BlockDelete.prototype.type = Events.BLOCK_DELETE; +BlockDelete.prototype.type = eventUtils.BLOCK_DELETE; /** * Encode the event as JSON. @@ -121,6 +120,6 @@ BlockDelete.prototype.run = function(forward) { } }; -registry.register(registry.Type.EVENT, Events.DELETE, BlockDelete); +registry.register(registry.Type.EVENT, eventUtils.DELETE, BlockDelete); exports = BlockDelete; diff --git a/core/events/events_block_drag.js b/core/events/events_block_drag.js index caef95ba7..3e36d6588 100644 --- a/core/events/events_block_drag.js +++ b/core/events/events_block_drag.js @@ -11,10 +11,9 @@ 'use strict'; goog.module('Blockly.Events.BlockDrag'); -goog.module.declareLegacyNamespace(); -const Events = goog.require('Blockly.Events'); const UiBase = goog.require('Blockly.Events.UiBase'); +const eventUtils = goog.require('Blockly.Events.utils'); const object = goog.require('Blockly.utils.object'); const registry = goog.require('Blockly.registry'); /* eslint-disable-next-line no-unused-vars */ @@ -55,7 +54,7 @@ object.inherits(BlockDrag, UiBase); * Type of this event. * @type {string} */ -BlockDrag.prototype.type = Events.BLOCK_DRAG; +BlockDrag.prototype.type = eventUtils.BLOCK_DRAG; /** * Encode the event as JSON. @@ -80,6 +79,6 @@ BlockDrag.prototype.fromJson = function(json) { this.blocks = json['blocks']; }; -registry.register(registry.Type.EVENT, Events.BLOCK_DRAG, BlockDrag); +registry.register(registry.Type.EVENT, eventUtils.BLOCK_DRAG, BlockDrag); exports = BlockDrag; diff --git a/core/events/events_block_move.js b/core/events/events_block_move.js index b88ce762b..036c97a64 100644 --- a/core/events/events_block_move.js +++ b/core/events/events_block_move.js @@ -11,11 +11,10 @@ 'use strict'; goog.module('Blockly.Events.BlockMove'); -goog.module.declareLegacyNamespace(); const BlockBase = goog.require('Blockly.Events.BlockBase'); const Coordinate = goog.require('Blockly.utils.Coordinate'); -const Events = goog.require('Blockly.Events'); +const eventUtils = goog.require('Blockly.Events.utils'); const object = goog.require('Blockly.utils.object'); const registry = goog.require('Blockly.registry'); /* eslint-disable-next-line no-unused-vars */ @@ -51,7 +50,7 @@ object.inherits(BlockMove, BlockBase); * Type of this event. * @type {string} */ -BlockMove.prototype.type = Events.BLOCK_MOVE; +BlockMove.prototype.type = eventUtils.BLOCK_MOVE; /** * Encode the event as JSON. @@ -183,6 +182,6 @@ BlockMove.prototype.run = function(forward) { } }; -registry.register(registry.Type.EVENT, Events.MOVE, BlockMove); +registry.register(registry.Type.EVENT, eventUtils.MOVE, BlockMove); exports = BlockMove; diff --git a/core/events/events_bubble_open.js b/core/events/events_bubble_open.js index 5c2718c02..dd4611ffe 100644 --- a/core/events/events_bubble_open.js +++ b/core/events/events_bubble_open.js @@ -11,10 +11,9 @@ 'use strict'; goog.module('Blockly.Events.BubbleOpen'); -goog.module.declareLegacyNamespace(); -const Events = goog.require('Blockly.Events'); const UiBase = goog.require('Blockly.Events.UiBase'); +const eventUtils = goog.require('Blockly.Events.utils'); const object = goog.require('Blockly.utils.object'); const registry = goog.require('Blockly.registry'); /* eslint-disable-next-line no-unused-vars */ @@ -56,7 +55,7 @@ object.inherits(BubbleOpen, UiBase); * Type of this event. * @type {string} */ -BubbleOpen.prototype.type = Events.BUBBLE_OPEN; +BubbleOpen.prototype.type = eventUtils.BUBBLE_OPEN; /** * Encode the event as JSON. @@ -81,6 +80,6 @@ BubbleOpen.prototype.fromJson = function(json) { this.blockId = json['blockId']; }; -registry.register(registry.Type.EVENT, Events.BUBBLE_OPEN, BubbleOpen); +registry.register(registry.Type.EVENT, eventUtils.BUBBLE_OPEN, BubbleOpen); exports = BubbleOpen; diff --git a/core/events/events_click.js b/core/events/events_click.js index 3b3ca8ad2..ea64c7446 100644 --- a/core/events/events_click.js +++ b/core/events/events_click.js @@ -11,15 +11,15 @@ 'use strict'; goog.module('Blockly.Events.Click'); -goog.module.declareLegacyNamespace(); -const Events = goog.require('Blockly.Events'); const UiBase = goog.require('Blockly.Events.UiBase'); +const eventUtils = goog.require('Blockly.Events.utils'); const object = goog.require('Blockly.utils.object'); const registry = goog.require('Blockly.registry'); /* eslint-disable-next-line no-unused-vars */ const {Block} = goog.requireType('Blockly.Block'); + /** * Class for a click event. * @param {?Block=} opt_block The affected block. Null for click events @@ -49,7 +49,7 @@ object.inherits(Click, UiBase); * Type of this event. * @type {string} */ -Click.prototype.type = Events.CLICK; +Click.prototype.type = eventUtils.CLICK; /** * Encode the event as JSON. @@ -74,6 +74,6 @@ Click.prototype.fromJson = function(json) { this.blockId = json['blockId']; }; -registry.register(registry.Type.EVENT, Events.CLICK, Click); +registry.register(registry.Type.EVENT, eventUtils.CLICK, Click); exports = Click; diff --git a/core/events/events_comment_base.js b/core/events/events_comment_base.js index 59880d3db..a3ecd866c 100644 --- a/core/events/events_comment_base.js +++ b/core/events/events_comment_base.js @@ -11,13 +11,16 @@ 'use strict'; goog.module('Blockly.Events.CommentBase'); -goog.module.declareLegacyNamespace(); const AbstractEvents = goog.require('Blockly.Events.Abstract'); -const Events = goog.require('Blockly.Events'); +/* eslint-disable-next-line no-unused-vars */ +const CommentCreate = goog.requireType('Blockly.Events.CommentCreate'); +/* eslint-disable-next-line no-unused-vars */ +const CommentDelete = goog.requireType('Blockly.Events.CommentDelete'); /* eslint-disable-next-line no-unused-vars */ const WorkspaceComment = goog.requireType('Blockly.WorkspaceComment'); const Xml = goog.require('Blockly.Xml'); +const eventUtils = goog.require('Blockly.Events.utils'); const object = goog.require('Blockly.utils.object'); const utilsXml = goog.require('Blockly.utils.xml'); @@ -54,13 +57,13 @@ const CommentBase = function(opt_comment) { * perspective, and should be undone together. * @type {string} */ - this.group = Events.getGroup(); + this.group = eventUtils.getGroup(); /** * Sets whether the event should be added to the undo stack. * @type {boolean} */ - this.recordUndo = Events.getRecordUndo(); + this.recordUndo = eventUtils.getRecordUndo(); }; object.inherits(CommentBase, AbstractEvents); @@ -87,7 +90,7 @@ CommentBase.prototype.fromJson = function(json) { /** * Helper function for Comment[Create|Delete] - * @param {!Events.CommentCreate|!Events.CommentDelete} event + * @param {!CommentCreate|!CommentDelete} event * The event to run. * @param {boolean} create if True then Create, if False then Delete */ diff --git a/core/events/events_comment_change.js b/core/events/events_comment_change.js index 458785db3..7289d2779 100644 --- a/core/events/events_comment_change.js +++ b/core/events/events_comment_change.js @@ -11,12 +11,11 @@ 'use strict'; goog.module('Blockly.Events.CommentChange'); -goog.module.declareLegacyNamespace(); const CommentBase = goog.require('Blockly.Events.CommentBase'); -const Events = goog.require('Blockly.Events'); /* eslint-disable-next-line no-unused-vars */ const WorkspaceComment = goog.requireType('Blockly.WorkspaceComment'); +const eventUtils = goog.require('Blockly.Events.utils'); const object = goog.require('Blockly.utils.object'); const registry = goog.require('Blockly.registry'); @@ -47,7 +46,7 @@ object.inherits(CommentChange, CommentBase); * Type of this event. * @type {string} */ -CommentChange.prototype.type = Events.COMMENT_CHANGE; +CommentChange.prototype.type = eventUtils.COMMENT_CHANGE; /** * Encode the event as JSON. @@ -94,6 +93,6 @@ CommentChange.prototype.run = function(forward) { comment.setContent(contents); }; -registry.register(registry.Type.EVENT, Events.COMMENT_CHANGE, CommentChange); +registry.register(registry.Type.EVENT, eventUtils.COMMENT_CHANGE, CommentChange); exports = CommentChange; diff --git a/core/events/events_comment_create.js b/core/events/events_comment_create.js index 330d6ce4e..9964fc135 100644 --- a/core/events/events_comment_create.js +++ b/core/events/events_comment_create.js @@ -11,13 +11,12 @@ 'use strict'; goog.module('Blockly.Events.CommentCreate'); -goog.module.declareLegacyNamespace(); const CommentBase = goog.require('Blockly.Events.CommentBase'); -const Events = goog.require('Blockly.Events'); /* eslint-disable-next-line no-unused-vars */ const WorkspaceComment = goog.requireType('Blockly.WorkspaceComment'); const Xml = goog.require('Blockly.Xml'); +const eventUtils = goog.require('Blockly.Events.utils'); const object = goog.require('Blockly.utils.object'); const registry = goog.require('Blockly.registry'); @@ -43,7 +42,7 @@ object.inherits(CommentCreate, CommentBase); * Type of this event. * @type {string} */ -CommentCreate.prototype.type = Events.COMMENT_CREATE; +CommentCreate.prototype.type = eventUtils.COMMENT_CREATE; /** * Encode the event as JSON. @@ -73,6 +72,6 @@ CommentCreate.prototype.run = function(forward) { CommentBase.CommentCreateDeleteHelper(this, forward); }; -registry.register(registry.Type.EVENT, Events.COMMENT_CREATE, CommentCreate); +registry.register(registry.Type.EVENT, eventUtils.COMMENT_CREATE, CommentCreate); exports = CommentCreate; diff --git a/core/events/events_comment_delete.js b/core/events/events_comment_delete.js index 85db6cb83..b33a154d7 100644 --- a/core/events/events_comment_delete.js +++ b/core/events/events_comment_delete.js @@ -11,12 +11,11 @@ 'use strict'; goog.module('Blockly.Events.CommentDelete'); -goog.module.declareLegacyNamespace(); const CommentBase = goog.require('Blockly.Events.CommentBase'); -const Events = goog.require('Blockly.Events'); /* eslint-disable-next-line no-unused-vars */ const WorkspaceComment = goog.requireType('Blockly.WorkspaceComment'); +const eventUtils = goog.require('Blockly.Events.utils'); const object = goog.require('Blockly.utils.object'); const registry = goog.require('Blockly.registry'); @@ -42,7 +41,7 @@ object.inherits(CommentDelete, CommentBase); * Type of this event. * @type {string} */ -CommentDelete.prototype.type = Events.COMMENT_DELETE; +CommentDelete.prototype.type = eventUtils.COMMENT_DELETE; /** * Encode the event as JSON. @@ -70,6 +69,6 @@ CommentDelete.prototype.run = function(forward) { CommentBase.CommentCreateDeleteHelper(this, !forward); }; -registry.register(registry.Type.EVENT, Events.COMMENT_DELETE, CommentDelete); +registry.register(registry.Type.EVENT, eventUtils.COMMENT_DELETE, CommentDelete); exports = CommentDelete; diff --git a/core/events/events_comment_move.js b/core/events/events_comment_move.js index 148bff8ad..b2f53fea8 100644 --- a/core/events/events_comment_move.js +++ b/core/events/events_comment_move.js @@ -11,13 +11,12 @@ 'use strict'; goog.module('Blockly.Events.CommentMove'); -goog.module.declareLegacyNamespace(); const CommentBase = goog.require('Blockly.Events.CommentBase'); const Coordinate = goog.require('Blockly.utils.Coordinate'); -const Events = goog.require('Blockly.Events'); /* eslint-disable-next-line no-unused-vars */ const WorkspaceComment = goog.requireType('Blockly.WorkspaceComment'); +const eventUtils = goog.require('Blockly.Events.utils'); const object = goog.require('Blockly.utils.object'); const registry = goog.require('Blockly.registry'); @@ -74,7 +73,7 @@ CommentMove.prototype.recordNew = function() { * Type of this event. * @type {string} */ -CommentMove.prototype.type = Events.COMMENT_MOVE; +CommentMove.prototype.type = eventUtils.COMMENT_MOVE; /** * Override the location before the move. Use this if you don't create the @@ -147,6 +146,6 @@ CommentMove.prototype.run = function(forward) { comment.moveBy(target.x - current.x, target.y - current.y); }; -registry.register(registry.Type.EVENT, Events.COMMENT_MOVE, CommentMove); +registry.register(registry.Type.EVENT, eventUtils.COMMENT_MOVE, CommentMove); exports = CommentMove; diff --git a/core/events/events_marker_move.js b/core/events/events_marker_move.js index 8a57736b5..3d55f0d97 100644 --- a/core/events/events_marker_move.js +++ b/core/events/events_marker_move.js @@ -11,17 +11,16 @@ 'use strict'; goog.module('Blockly.Events.MarkerMove'); -goog.module.declareLegacyNamespace(); -const Events = goog.require('Blockly.Events'); const UiBase = goog.require('Blockly.Events.UiBase'); /* eslint-disable-next-line no-unused-vars */ const Workspace = goog.requireType('Blockly.Workspace'); +const eventUtils = goog.require('Blockly.Events.utils'); const object = goog.require('Blockly.utils.object'); const registry = goog.require('Blockly.registry'); +const {ASTNode} = goog.require('Blockly.ASTNode'); /* eslint-disable-next-line no-unused-vars */ const {Block} = goog.requireType('Blockly.Block'); -const {ASTNode} = goog.require('Blockly.ASTNode'); /** @@ -74,7 +73,7 @@ object.inherits(MarkerMove, UiBase); * Type of this event. * @type {string} */ -MarkerMove.prototype.type = Events.MARKER_MOVE; +MarkerMove.prototype.type = eventUtils.MARKER_MOVE; /** * Encode the event as JSON. @@ -101,6 +100,6 @@ MarkerMove.prototype.fromJson = function(json) { this.newNode = json['newNode']; }; -registry.register(registry.Type.EVENT, Events.MARKER_MOVE, MarkerMove); +registry.register(registry.Type.EVENT, eventUtils.MARKER_MOVE, MarkerMove); exports = MarkerMove; diff --git a/core/events/events_selected.js b/core/events/events_selected.js index 47fcee5df..12dba4891 100644 --- a/core/events/events_selected.js +++ b/core/events/events_selected.js @@ -11,11 +11,10 @@ 'use strict'; goog.module('Blockly.Events.Selected'); -goog.module.declareLegacyNamespace(); -const Events = goog.require('Blockly.Events'); const UiBase = goog.require('Blockly.Events.UiBase'); const object = goog.require('Blockly.utils.object'); +const eventUtils = goog.require('Blockly.Events.utils'); const registry = goog.require('Blockly.registry'); @@ -51,7 +50,7 @@ object.inherits(Selected, UiBase); * Type of this event. * @type {string} */ -Selected.prototype.type = Events.SELECTED; +Selected.prototype.type = eventUtils.SELECTED; /** * Encode the event as JSON. @@ -74,6 +73,6 @@ Selected.prototype.fromJson = function(json) { this.newElementId = json['newElementId']; }; -registry.register(registry.Type.EVENT, Events.SELECTED, Selected); +registry.register(registry.Type.EVENT, eventUtils.SELECTED, Selected); exports = Selected; diff --git a/core/events/events_theme_change.js b/core/events/events_theme_change.js index c58d11158..13e1f35fc 100644 --- a/core/events/events_theme_change.js +++ b/core/events/events_theme_change.js @@ -11,10 +11,9 @@ 'use strict'; goog.module('Blockly.Events.ThemeChange'); -goog.module.declareLegacyNamespace(); -const Events = goog.require('Blockly.Events'); const UiBase = goog.require('Blockly.Events.UiBase'); +const eventUtils = goog.require('Blockly.Events.utils'); const object = goog.require('Blockly.utils.object'); const registry = goog.require('Blockly.registry'); @@ -42,7 +41,7 @@ object.inherits(ThemeChange, UiBase); * Type of this event. * @type {string} */ -ThemeChange.prototype.type = Events.THEME_CHANGE; +ThemeChange.prototype.type = eventUtils.THEME_CHANGE; /** * Encode the event as JSON. @@ -63,6 +62,6 @@ ThemeChange.prototype.fromJson = function(json) { this.themeName = json['themeName']; }; -registry.register(registry.Type.EVENT, Events.THEME_CHANGE, ThemeChange); +registry.register(registry.Type.EVENT, eventUtils.THEME_CHANGE, ThemeChange); exports = ThemeChange; diff --git a/core/events/events_toolbox_item_select.js b/core/events/events_toolbox_item_select.js index 0fddaf4e9..44d0a1594 100644 --- a/core/events/events_toolbox_item_select.js +++ b/core/events/events_toolbox_item_select.js @@ -11,10 +11,9 @@ 'use strict'; goog.module('Blockly.Events.ToolboxItemSelect'); -goog.module.declareLegacyNamespace(); -const Events = goog.require('Blockly.Events'); const UiBase = goog.require('Blockly.Events.UiBase'); +const eventUtils = goog.require('Blockly.Events.utils'); const object = goog.require('Blockly.utils.object'); const registry = goog.require('Blockly.registry'); @@ -51,7 +50,7 @@ object.inherits(ToolboxItemSelect, UiBase); * Type of this event. * @type {string} */ -ToolboxItemSelect.prototype.type = Events.TOOLBOX_ITEM_SELECT; +ToolboxItemSelect.prototype.type = eventUtils.TOOLBOX_ITEM_SELECT; /** * Encode the event as JSON. @@ -75,6 +74,6 @@ ToolboxItemSelect.prototype.fromJson = function(json) { }; registry.register( - registry.Type.EVENT, Events.TOOLBOX_ITEM_SELECT, ToolboxItemSelect); + registry.Type.EVENT, eventUtils.TOOLBOX_ITEM_SELECT, ToolboxItemSelect); exports = ToolboxItemSelect; diff --git a/core/events/events_trashcan_open.js b/core/events/events_trashcan_open.js index 6f5318213..1bb49dea8 100644 --- a/core/events/events_trashcan_open.js +++ b/core/events/events_trashcan_open.js @@ -11,10 +11,9 @@ 'use strict'; goog.module('Blockly.Events.TrashcanOpen'); -goog.module.declareLegacyNamespace(); -const Events = goog.require('Blockly.Events'); const UiBase = goog.require('Blockly.Events.UiBase'); +const eventUtils = goog.require('Blockly.Events.utils'); const object = goog.require('Blockly.utils.object'); const registry = goog.require('Blockly.registry'); @@ -43,7 +42,7 @@ object.inherits(TrashcanOpen, UiBase); * Type of this event. * @type {string} */ -TrashcanOpen.prototype.type = Events.TRASHCAN_OPEN; +TrashcanOpen.prototype.type = eventUtils.TRASHCAN_OPEN; /** * Encode the event as JSON. @@ -64,6 +63,6 @@ TrashcanOpen.prototype.fromJson = function(json) { this.isOpen = json['isOpen']; }; -registry.register(registry.Type.EVENT, Events.TRASHCAN_OPEN, TrashcanOpen); +registry.register(registry.Type.EVENT, eventUtils.TRASHCAN_OPEN, TrashcanOpen); exports = TrashcanOpen; diff --git a/core/events/events_ui.js b/core/events/events_ui.js index 42a5e9bb6..44a743fef 100644 --- a/core/events/events_ui.js +++ b/core/events/events_ui.js @@ -12,10 +12,9 @@ 'use strict'; goog.module('Blockly.Events.Ui'); -goog.module.declareLegacyNamespace(); -const Events = goog.require('Blockly.Events'); const UiBase = goog.require('Blockly.Events.UiBase'); +const eventUtils = goog.require('Blockly.Events.utils'); const object = goog.require('Blockly.utils.object'); const registry = goog.require('Blockly.registry'); /* eslint-disable-next-line no-unused-vars */ @@ -49,7 +48,7 @@ object.inherits(Ui, UiBase); * Type of this event. * @type {string} */ -Ui.prototype.type = Events.UI; +Ui.prototype.type = eventUtils.UI; /** * Encode the event as JSON. @@ -78,6 +77,6 @@ Ui.prototype.fromJson = function(json) { this.blockId = json['blockId']; }; -registry.register(registry.Type.EVENT, Events.UI, Ui); +registry.register(registry.Type.EVENT, eventUtils.UI, Ui); exports = Ui; diff --git a/core/events/events_ui_base.js b/core/events/events_ui_base.js index 5bcf7270c..f0204616e 100644 --- a/core/events/events_ui_base.js +++ b/core/events/events_ui_base.js @@ -12,7 +12,6 @@ 'use strict'; goog.module('Blockly.Events.UiBase'); -goog.module.declareLegacyNamespace(); const Abstract = goog.require('Blockly.Events.Abstract'); const object = goog.require('Blockly.utils.object'); diff --git a/core/events/events_var_base.js b/core/events/events_var_base.js index cedf349b7..20710c73c 100644 --- a/core/events/events_var_base.js +++ b/core/events/events_var_base.js @@ -11,7 +11,6 @@ 'use strict'; goog.module('Blockly.Events.VarBase'); -goog.module.declareLegacyNamespace(); const Abstract = goog.require('Blockly.Events.Abstract'); /* eslint-disable-next-line no-unused-vars */ diff --git a/core/events/events_var_create.js b/core/events/events_var_create.js index 8db58be74..00ba59cfe 100644 --- a/core/events/events_var_create.js +++ b/core/events/events_var_create.js @@ -11,12 +11,11 @@ 'use strict'; goog.module('Blockly.Events.VarCreate'); -goog.module.declareLegacyNamespace(); -const Events = goog.require('Blockly.Events'); const VarBase = goog.require('Blockly.Events.VarBase'); /* eslint-disable-next-line no-unused-vars */ const VariableModel = goog.requireType('Blockly.VariableModel'); +const eventUtils = goog.require('Blockly.Events.utils'); const object = goog.require('Blockly.utils.object'); const registry = goog.require('Blockly.registry'); @@ -43,7 +42,7 @@ object.inherits(VarCreate, VarBase); * Type of this event. * @type {string} */ -VarCreate.prototype.type = Events.VAR_CREATE; +VarCreate.prototype.type = eventUtils.VAR_CREATE; /** * Encode the event as JSON. @@ -79,6 +78,6 @@ VarCreate.prototype.run = function(forward) { } }; -registry.register(registry.Type.EVENT, Events.VAR_CREATE, VarCreate); +registry.register(registry.Type.EVENT, eventUtils.VAR_CREATE, VarCreate); exports = VarCreate; diff --git a/core/events/events_var_delete.js b/core/events/events_var_delete.js index 48497bdd7..32d5644aa 100644 --- a/core/events/events_var_delete.js +++ b/core/events/events_var_delete.js @@ -11,12 +11,11 @@ 'use strict'; goog.module('Blockly.Events.VarDelete'); -goog.module.declareLegacyNamespace(); -const Events = goog.require('Blockly.Events'); const VarBase = goog.require('Blockly.Events.VarBase'); /* eslint-disable-next-line no-unused-vars */ const VariableModel = goog.requireType('Blockly.VariableModel'); +const eventUtils = goog.require('Blockly.Events.utils'); const object = goog.require('Blockly.utils.object'); const registry = goog.require('Blockly.registry'); @@ -43,7 +42,7 @@ object.inherits(VarDelete, VarBase); * Type of this event. * @type {string} */ -VarDelete.prototype.type = Events.VAR_DELETE; +VarDelete.prototype.type = eventUtils.VAR_DELETE; /** * Encode the event as JSON. @@ -79,6 +78,6 @@ VarDelete.prototype.run = function(forward) { } }; -registry.register(registry.Type.EVENT, Events.VAR_DELETE, VarDelete); +registry.register(registry.Type.EVENT, eventUtils.VAR_DELETE, VarDelete); exports = VarDelete; diff --git a/core/events/events_var_rename.js b/core/events/events_var_rename.js index 9fa5f7058..f7c9f8890 100644 --- a/core/events/events_var_rename.js +++ b/core/events/events_var_rename.js @@ -11,12 +11,11 @@ 'use strict'; goog.module('Blockly.Events.VarRename'); -goog.module.declareLegacyNamespace(); -const Events = goog.require('Blockly.Events'); const VarBase = goog.require('Blockly.Events.VarBase'); /* eslint-disable-next-line no-unused-vars */ const VariableModel = goog.requireType('Blockly.VariableModel'); +const eventUtils = goog.require('Blockly.Events.utils'); const object = goog.require('Blockly.utils.object'); const registry = goog.require('Blockly.registry'); @@ -44,7 +43,7 @@ object.inherits(VarRename, VarBase); * Type of this event. * @type {string} */ -VarRename.prototype.type = Events.VAR_RENAME; +VarRename.prototype.type = eventUtils.VAR_RENAME; /** * Encode the event as JSON. @@ -80,6 +79,6 @@ VarRename.prototype.run = function(forward) { } }; -registry.register(registry.Type.EVENT, Events.VAR_RENAME, VarRename); +registry.register(registry.Type.EVENT, eventUtils.VAR_RENAME, VarRename); exports = VarRename; diff --git a/core/events/events_viewport.js b/core/events/events_viewport.js index 2cfd94a7f..6eccd0a85 100644 --- a/core/events/events_viewport.js +++ b/core/events/events_viewport.js @@ -11,10 +11,9 @@ 'use strict'; goog.module('Blockly.Events.ViewportChange'); -goog.module.declareLegacyNamespace(); -const Events = goog.require('Blockly.Events'); const UiBase = goog.require('Blockly.Events.UiBase'); +const eventUtils = goog.require('Blockly.Events.utils'); const object = goog.require('Blockly.utils.object'); const registry = goog.require('Blockly.registry'); @@ -70,7 +69,7 @@ object.inherits(ViewportChange, UiBase); * Type of this event. * @type {string} */ -ViewportChange.prototype.type = Events.VIEWPORT_CHANGE; +ViewportChange.prototype.type = eventUtils.VIEWPORT_CHANGE; /** * Encode the event as JSON. @@ -97,6 +96,6 @@ ViewportChange.prototype.fromJson = function(json) { this.oldScale = json['oldScale']; }; -registry.register(registry.Type.EVENT, Events.VIEWPORT_CHANGE, ViewportChange); +registry.register(registry.Type.EVENT, eventUtils.VIEWPORT_CHANGE, ViewportChange); exports = ViewportChange; diff --git a/core/events/utils.js b/core/events/utils.js new file mode 100644 index 000000000..18a42f060 --- /dev/null +++ b/core/events/utils.js @@ -0,0 +1,579 @@ +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @fileoverview Helper methods for events that are fired as a result of + * actions in Blockly's editor. + */ +'use strict'; + +goog.module('Blockly.Events.utils'); + +/* eslint-disable-next-line no-unused-vars */ +const Abstract = goog.requireType('Blockly.Events.Abstract'); +/* eslint-disable-next-line no-unused-vars */ +const BlockMove = goog.requireType('Blockly.Events.BlockMove'); +/* eslint-disable-next-line no-unused-vars */ +const BlockCreate = goog.requireType('Blockly.Events.BlockMove'); +/* eslint-disable-next-line no-unused-vars */ +const CommentCreate = goog.requireType('Blockly.Events.CommentCreate'); +/* eslint-disable-next-line no-unused-vars */ +const CommentMove = goog.requireType('Blockly.Events.CommentMove'); +/* eslint-disable-next-line no-unused-vars */ +const Workspace = goog.requireType('Blockly.Workspace'); +const idGenerator = goog.require('Blockly.utils.idGenerator'); +const registry = goog.require('Blockly.registry'); +const {Block} = goog.requireType('Blockly.Block'); + + +/** + * Group ID for new events. Grouped events are indivisible. + * @type {string} + */ +let group = ''; + +/** + * Sets whether the next event should be added to the undo stack. + * @type {boolean} + */ +let recordUndo = true; + +/** + * Sets whether events should be added to the undo stack. + * @param {boolean} newValue True if events should be added to the undo stack. + * @alias Blockly.Events.setRecordUndo + */ +const setRecordUndo = function(newValue) { + recordUndo = newValue; +}; +exports.setRecordUndo = setRecordUndo; + +/** + * Returns whether or not events will be added to the undo stack. + * @returns {boolean} True if events will be added to the undo stack. + * @alias Blockly.Events.getRecordUndo + */ +const getRecordUndo = function() { + return recordUndo; +}; +exports.getRecordUndo = getRecordUndo; + +/** + * Allow change events to be created and fired. + * @type {number} + */ +let disabled = 0; + +/** + * Name of event that creates a block. Will be deprecated for BLOCK_CREATE. + * @const + * @alias Blockly.Events.CREATE + */ +const CREATE = 'create'; +exports.CREATE = CREATE; + +/** + * Name of event that creates a block. + * @const + * @alias Blockly.Events.BLOCK_CREATE + */ +const BLOCK_CREATE = CREATE; +exports.BLOCK_CREATE = BLOCK_CREATE; + +/** + * Name of event that deletes a block. Will be deprecated for BLOCK_DELETE. + * @const + * @alias Blockly.Events.DELETE + */ +const DELETE = 'delete'; +exports.DELETE = DELETE; + +/** + * Name of event that deletes a block. + * @const + * @alias Blockly.Events.BLOCK_DELETE + */ +const BLOCK_DELETE = DELETE; +exports.BLOCK_DELETE = BLOCK_DELETE; + +/** + * Name of event that changes a block. Will be deprecated for BLOCK_CHANGE. + * @const + * @alias Blockly.Events.CHANGE + */ +const CHANGE = 'change'; +exports.CHANGE = CHANGE; + +/** + * Name of event that changes a block. + * @const + * @alias Blockly.Events.BLOCK_CHANGE + */ +const BLOCK_CHANGE = CHANGE; +exports.BLOCK_CHANGE = BLOCK_CHANGE; + +/** + * Name of event that moves a block. Will be deprecated for BLOCK_MOVE. + * @const + * @alias Blockly.Events.MOVE + */ +const MOVE = 'move'; +exports.MOVE = MOVE; + +/** + * Name of event that moves a block. + * @const + * @alias Blockly.Events.BLOCK_MOVE + */ +const BLOCK_MOVE = MOVE; +exports.BLOCK_MOVE = BLOCK_MOVE; + +/** + * Name of event that creates a variable. + * @const + * @alias Blockly.Events.VAR_CREATE + */ +const VAR_CREATE = 'var_create'; +exports.VAR_CREATE = VAR_CREATE; + +/** + * Name of event that deletes a variable. + * @const + * @alias Blockly.Events.VAR_DELETE + */ +const VAR_DELETE = 'var_delete'; +exports.VAR_DELETE = VAR_DELETE; + +/** + * Name of event that renames a variable. + * @const + * @alias Blockly.Events.VAR_RENAME + */ +const VAR_RENAME = 'var_rename'; +exports.VAR_RENAME = VAR_RENAME; + +/** + * Name of generic event that records a UI change. + * @const + * @alias Blockly.Events.UI + */ +const UI = 'ui'; +exports.UI = UI; + +/** + * Name of event that record a block drags a block. + * @const + * @alias Blockly.Events.BLOCK_DRAG + */ +const BLOCK_DRAG = 'drag'; +exports.BLOCK_DRAG = BLOCK_DRAG; + +/** + * Name of event that records a change in selected element. + * @const + * @alias Blockly.Events.SELECTED + */ +const SELECTED = 'selected'; +exports.SELECTED = SELECTED; + +/** + * Name of event that records a click. + * @const + * @alias Blockly.Events.CLICK + */ +const CLICK = 'click'; +exports.CLICK = CLICK; + +/** + * Name of event that records a marker move. + * @const + * @alias Blockly.Events.MARKER_MOVE + */ +const MARKER_MOVE = 'marker_move'; +exports.MARKER_MOVE = MARKER_MOVE; + +/** + * Name of event that records a bubble open. + * @const + * @alias Blockly.Events.BUBBLE_OPEN + */ +const BUBBLE_OPEN = 'bubble_open'; +exports.BUBBLE_OPEN = BUBBLE_OPEN; + +/** + * Name of event that records a trashcan open. + * @const + * @alias Blockly.Events.TRASHCAN_OPEN + */ +const TRASHCAN_OPEN = 'trashcan_open'; +exports.TRASHCAN_OPEN = TRASHCAN_OPEN; + +/** + * Name of event that records a toolbox item select. + * @const + * @alias Blockly.Events.TOOLBOX_ITEM_SELECT + */ +const TOOLBOX_ITEM_SELECT = 'toolbox_item_select'; +exports.TOOLBOX_ITEM_SELECT = TOOLBOX_ITEM_SELECT; + +/** + * Name of event that records a theme change. + * @const + * @alias Blockly.Events.THEME_CHANGE + */ +const THEME_CHANGE = 'theme_change'; +exports.THEME_CHANGE = THEME_CHANGE; + +/** + * Name of event that records a viewport change. + * @const + * @alias Blockly.Events.VIEWPORT_CHANGE + */ +const VIEWPORT_CHANGE = 'viewport_change'; +exports.VIEWPORT_CHANGE = VIEWPORT_CHANGE; + +/** + * Name of event that creates a comment. + * @const + * @alias Blockly.Events.COMMENT_CREATE + */ +const COMMENT_CREATE = 'comment_create'; +exports.COMMENT_CREATE = COMMENT_CREATE; + +/** + * Name of event that deletes a comment. + * @const + * @alias Blockly.Events.COMMENT_DELETE + */ +const COMMENT_DELETE = 'comment_delete'; +exports.COMMENT_DELETE = COMMENT_DELETE; + +/** + * Name of event that changes a comment. + * @const + * @alias Blockly.Events.COMMENT_CHANGE + */ +const COMMENT_CHANGE = 'comment_change'; +exports.COMMENT_CHANGE = COMMENT_CHANGE; + +/** + * Name of event that moves a comment. + * @const + * @alias Blockly.Events.COMMENT_MOVE + */ +const COMMENT_MOVE = 'comment_move'; +exports.COMMENT_MOVE = COMMENT_MOVE; + +/** + * Name of event that records a workspace load. + * @alias Blockly.Events.FINISHED_LOADING + */ +const FINISHED_LOADING = 'finished_loading'; +exports.FINISHED_LOADING = FINISHED_LOADING; + +/** + * Type of events that cause objects to be bumped back into the visible + * portion of the workspace. + * + * Not to be confused with bumping so that disconnected connections do not + * appear connected. + * @typedef {!BlockCreate|!BlockMove| + * !CommentCreate|!CommentMove} + * @alias Blockly.Events.BumpEvent + */ +let BumpEvent; +exports.BumpEvent = BumpEvent; + +/** + * List of events that cause objects to be bumped back into the visible + * portion of the workspace. + * + * Not to be confused with bumping so that disconnected connections do not + * appear connected. + * @const + * @alias Blockly.Events.BUMP_EVENTS + */ +const BUMP_EVENTS = [BLOCK_CREATE, BLOCK_MOVE, COMMENT_CREATE, COMMENT_MOVE]; +exports.BUMP_EVENTS = BUMP_EVENTS; + +/** + * List of events queued for firing. + */ +const FIRE_QUEUE = []; + +/** + * Create a custom event and fire it. + * @param {!Abstract} event Custom data for event. + * @alias Blockly.Events.fire + */ +const fire = function(event) { + if (!isEnabled()) { + return; + } + if (!FIRE_QUEUE.length) { + // First event added; schedule a firing of the event queue. + setTimeout(fireNow, 0); + } + FIRE_QUEUE.push(event); +}; +exports.fire = fire; + +/** + * Fire all queued events. + */ +const fireNow = function() { + const queue = filter(FIRE_QUEUE, true); + FIRE_QUEUE.length = 0; + for (let i = 0, event; (event = queue[i]); i++) { + if (!event.workspaceId) { + continue; + } + const Workspace = goog.module.get('Blockly.Workspace'); + const eventWorkspace = Workspace.getById(event.workspaceId); + if (eventWorkspace) { + eventWorkspace.fireChangeListener(event); + } + } +}; + +/** + * Filter the queued events and merge duplicates. + * @param {!Array} queueIn Array of events. + * @param {boolean} forward True if forward (redo), false if backward (undo). + * @return {!Array} Array of filtered events. + * @alias Blockly.Events.filter + */ +const filter = function(queueIn, forward) { + let queue = queueIn.slice(); // Shallow copy of queue. + if (!forward) { + // Undo is merged in reverse order. + queue.reverse(); + } + const mergedQueue = []; + const hash = Object.create(null); + // Merge duplicates. + for (let i = 0, event; (event = queue[i]); i++) { + if (!event.isNull()) { + // Treat all UI events as the same type in hash table. + const eventType = event.isUiEvent ? UI : event.type; + const key = [eventType, event.blockId, event.workspaceId].join(' '); + + const lastEntry = hash[key]; + const lastEvent = lastEntry ? lastEntry.event : null; + if (!lastEntry) { + // Each item in the hash table has the event and the index of that event + // in the input array. This lets us make sure we only merge adjacent + // move events. + hash[key] = {event: event, index: i}; + mergedQueue.push(event); + } else if (event.type == MOVE && lastEntry.index == i - 1) { + // Merge move events. + lastEvent.newParentId = event.newParentId; + lastEvent.newInputName = event.newInputName; + lastEvent.newCoordinate = event.newCoordinate; + lastEntry.index = i; + } else if ( + event.type == CHANGE && event.element == lastEvent.element && + event.name == lastEvent.name) { + // Merge change events. + lastEvent.newValue = event.newValue; + } else if (event.type == VIEWPORT_CHANGE) { + // Merge viewport change events. + lastEvent.viewTop = event.viewTop; + lastEvent.viewLeft = event.viewLeft; + lastEvent.scale = event.scale; + lastEvent.oldScale = event.oldScale; + } else if (event.type == CLICK && lastEvent.type == BUBBLE_OPEN) { + // Drop click events caused by opening/closing bubbles. + } else { + // Collision: newer events should merge into this event to maintain + // order. + hash[key] = {event: event, index: i}; + mergedQueue.push(event); + } + } + } + // Filter out any events that have become null due to merging. + queue = mergedQueue.filter(function(e) { + return !e.isNull(); + }); + if (!forward) { + // Restore undo order. + queue.reverse(); + } + // Move mutation events to the top of the queue. + // Intentionally skip first event. + for (let i = 1, event; (event = queue[i]); i++) { + if (event.type == CHANGE && event.element == 'mutation') { + queue.unshift(queue.splice(i, 1)[0]); + } + } + return queue; +}; +exports.filter = filter; + +/** + * Modify pending undo events so that when they are fired they don't land + * in the undo stack. Called by Workspace.clearUndo. + * @alias Blockly.Events.clearPendingUndo + */ +const clearPendingUndo = function() { + for (let i = 0, event; (event = FIRE_QUEUE[i]); i++) { + event.recordUndo = false; + } +}; +exports.clearPendingUndo = clearPendingUndo; + +/** + * Stop sending events. Every call to this function MUST also call enable. + * @alias Blockly.Events.disable + */ +const disable = function() { + disabled++; +}; +exports.disable = disable; + +/** + * Start sending events. Unless events were already disabled when the + * corresponding call to disable was made. + * @alias Blockly.Events.enable + */ +const enable = function() { + disabled--; +}; +exports.enable = enable; + +/** + * Returns whether events may be fired or not. + * @return {boolean} True if enabled. + * @alias Blockly.Events.isEnabled + */ +const isEnabled = function() { + return disabled == 0; +}; +exports.isEnabled = isEnabled; + +/** + * Current group. + * @return {string} ID string. + * @alias Blockly.Events.getGroup + */ +const getGroup = function() { + return group; +}; +exports.getGroup = getGroup; + +/** + * Start or stop a group. + * @param {boolean|string} state True to start new group, false to end group. + * String to set group explicitly. + * @alias Blockly.Events.setGroup + */ +const setGroup = function(state) { + if (typeof state == 'boolean') { + group = state ? idGenerator.genUid() : ''; + } else { + group = state; + } +}; +exports.setGroup = setGroup; + +/** + * Compute a list of the IDs of the specified block and all its descendants. + * @param {!Block} block The root block. + * @return {!Array} List of block IDs. + * @alias Blockly.Events.getDescendantIds + */ +const getDescendantIds = function(block) { + const ids = []; + const descendants = block.getDescendants(false); + for (let i = 0, descendant; (descendant = descendants[i]); i++) { + ids[i] = descendant.id; + } + return ids; +}; +/** @package */ +exports.getDescendantIds = getDescendantIds; + +/** + * Decode the JSON into an event. + * @param {!Object} json JSON representation. + * @param {!Workspace} workspace Target workspace for event. + * @return {!Abstract} The event represented by the JSON. + * @throws {Error} if an event type is not found in the registry. + * @alias Blockly.Events.fromJson + */ +const fromJson = function(json, workspace) { + const eventClass = get(json.type); + if (!eventClass) { + throw Error('Unknown event type.'); + } + const event = new eventClass(); + event.fromJson(json); + event.workspaceId = workspace.id; + return event; +}; +exports.fromJson = fromJson; + +/** + * Gets the class for a specific event type from the registry. + * @param {string} eventType The type of the event to get. + * @return {?function(new:Abstract, ...?)} The event class with + * the given type or null if none exists. + * @alias Blockly.Events.get + */ +const get = function(eventType) { + return registry.getClass(registry.Type.EVENT, eventType); +}; +exports.get = get; + +/** + * Enable/disable a block depending on whether it is properly connected. + * Use this on applications where all blocks should be connected to a top block. + * Recommend setting the 'disable' option to 'false' in the config so that + * users don't try to re-enable disabled orphan blocks. + * @param {!Abstract} event Custom data for event. + * @alias Blockly.Events.disableOrphans + */ +const disableOrphans = function(event) { + if (event.type == MOVE || event.type == CREATE) { + if (!event.workspaceId) { + return; + } + const Workspace = goog.module.get('Blockly.Workspace'); + const eventWorkspace = Workspace.getById(event.workspaceId); + let block = eventWorkspace.getBlockById(event.blockId); + if (block) { + // Changing blocks as part of this event shouldn't be undoable. + const initialUndoFlag = recordUndo; + try { + recordUndo = false; + const parent = block.getParent(); + if (parent && parent.isEnabled()) { + const children = block.getDescendants(false); + for (let i = 0, child; (child = children[i]); i++) { + child.setEnabled(true); + } + } else if ( + (block.outputConnection || block.previousConnection) && + !eventWorkspace.isDragging()) { + do { + block.setEnabled(false); + block = block.getNextBlock(); + } while (block); + } + } finally { + recordUndo = initialUndoFlag; + } + } + } +}; +exports.disableOrphans = disableOrphans; + +exports.TEST_ONLY = { + FIRE_QUEUE, + fireNow +}; diff --git a/core/events/workspace_events.js b/core/events/workspace_events.js index df832602e..61351375b 100644 --- a/core/events/workspace_events.js +++ b/core/events/workspace_events.js @@ -11,12 +11,11 @@ 'use strict'; goog.module('Blockly.Events.FinishedLoading'); -goog.module.declareLegacyNamespace(); -const Events = goog.require('Blockly.Events'); -const EventsAbstract = goog.require('Blockly.Events.Abstract'); +const Abstract = goog.require('Blockly.Events.Abstract'); /* eslint-disable-next-line no-unused-vars */ const Workspace = goog.requireType('Blockly.Workspace'); +const eventUtils = goog.require('Blockly.Events.utils'); const object = goog.require('Blockly.utils.object'); const registry = goog.require('Blockly.registry'); @@ -28,7 +27,7 @@ const registry = goog.require('Blockly.registry'); * Finished loading events do not record undo or redo. * @param {!Workspace=} opt_workspace The workspace that has finished * loading. Undefined for a blank event. - * @extends {EventsAbstract} + * @extends {Abstract} * @constructor */ const FinishedLoading = function(opt_workspace) { @@ -50,18 +49,18 @@ const FinishedLoading = function(opt_workspace) { * perspective, and should be undone together. * @type {string} */ - this.group = Events.getGroup(); + this.group = eventUtils.getGroup(); // Workspace events do not undo or redo. this.recordUndo = false; }; -object.inherits(FinishedLoading, EventsAbstract); +object.inherits(FinishedLoading, Abstract); /** * Type of this event. * @type {string} */ -FinishedLoading.prototype.type = Events.FINISHED_LOADING; +FinishedLoading.prototype.type = eventUtils.FINISHED_LOADING; /** * Encode the event as JSON. @@ -91,6 +90,6 @@ FinishedLoading.prototype.fromJson = function(json) { }; registry.register( - registry.Type.EVENT, Events.FINISHED_LOADING, FinishedLoading); + registry.Type.EVENT, eventUtils.FINISHED_LOADING, FinishedLoading); exports = FinishedLoading; diff --git a/core/field.js b/core/field.js index 94695ccad..be6318797 100644 --- a/core/field.js +++ b/core/field.js @@ -19,7 +19,6 @@ const ConstantProvider = goog.requireType('Blockly.blockRendering.ConstantProvid /* eslint-disable-next-line no-unused-vars */ const Coordinate = goog.requireType('Blockly.utils.Coordinate'); const DropDownDiv = goog.require('Blockly.DropDownDiv'); -const Events = goog.require('Blockly.Events'); /* eslint-disable-next-line no-unused-vars */ const IASTNodeLocationSvg = goog.requireType('Blockly.IASTNodeLocationSvg'); /* eslint-disable-next-line no-unused-vars */ @@ -42,6 +41,7 @@ const WidgetDiv = goog.require('Blockly.WidgetDiv'); const WorkspaceSvg = goog.requireType('Blockly.WorkspaceSvg'); const Xml = goog.require('Blockly.Xml'); const dom = goog.require('Blockly.utils.dom'); +const eventUtils = goog.require('Blockly.Events.utils'); const browserEvents = goog.require('Blockly.browserEvents'); const style = goog.require('Blockly.utils.style'); const userAgent = goog.require('Blockly.utils.userAgent'); @@ -951,8 +951,8 @@ Field.prototype.setValue = function(newValue) { } this.doValueUpdate_(newValue); - if (source && Events.isEnabled()) { - Events.fire(new (Events.get(Events.BLOCK_CHANGE))( + if (source && eventUtils.isEnabled()) { + eventUtils.fire(new (eventUtils.get(eventUtils.BLOCK_CHANGE))( source, 'field', this.name || null, oldValue, newValue)); } if (this.isDirty_) { diff --git a/core/field_textinput.js b/core/field_textinput.js index 57b327d85..706ddec94 100644 --- a/core/field_textinput.js +++ b/core/field_textinput.js @@ -14,7 +14,6 @@ goog.module('Blockly.FieldTextInput'); const Coordinate = goog.require('Blockly.utils.Coordinate'); const DropDownDiv = goog.require('Blockly.DropDownDiv'); -const Events = goog.require('Blockly.Events'); const Field = goog.require('Blockly.Field'); const KeyCodes = goog.require('Blockly.utils.KeyCodes'); const Msg = goog.require('Blockly.Msg'); @@ -25,6 +24,7 @@ const aria = goog.require('Blockly.utils.aria'); const browserEvents = goog.require('Blockly.browserEvents'); const dialog = goog.require('Blockly.dialog'); const dom = goog.require('Blockly.utils.dom'); +const eventUtils = goog.require('Blockly.Events.utils'); const fieldRegistry = goog.require('Blockly.fieldRegistry'); const object = goog.require('Blockly.utils.object'); const userAgent = goog.require('Blockly.utils.userAgent'); @@ -209,8 +209,8 @@ FieldTextInput.prototype.doValueInvalid_ = function(_invalidValue) { const oldValue = this.value_; // Revert value when the text becomes invalid. this.value_ = this.htmlInput_.untypedDefaultValue_; - if (this.sourceBlock_ && Events.isEnabled()) { - Events.fire(new (Events.get(Events.BLOCK_CHANGE))( + if (this.sourceBlock_ && eventUtils.isEnabled()) { + eventUtils.fire(new (eventUtils.get(eventUtils.BLOCK_CHANGE))( this.sourceBlock_, 'field', this.name || null, oldValue, this.value_)); } @@ -339,7 +339,7 @@ FieldTextInput.prototype.showInlineEditor_ = function(quietInput) { * @protected */ FieldTextInput.prototype.widgetCreate_ = function() { - Events.setGroup(true); + eventUtils.setGroup(true); const div = WidgetDiv.getDiv(); dom.addClass(this.getClickTarget_(), 'editing'); @@ -401,7 +401,7 @@ FieldTextInput.prototype.widgetDispose_ = function() { if (this.onFinishEditing_) { this.onFinishEditing_(this.value_); } - Events.setGroup(false); + eventUtils.setGroup(false); // Actual disposal. this.unbindInputEvents_(); diff --git a/core/flyout_base.js b/core/flyout_base.js index 73e3c9dc1..7793a2813 100644 --- a/core/flyout_base.js +++ b/core/flyout_base.js @@ -15,7 +15,6 @@ goog.module('Blockly.Flyout'); const ComponentManager = goog.require('Blockly.ComponentManager'); const Coordinate = goog.require('Blockly.utils.Coordinate'); const DeleteArea = goog.require('Blockly.DeleteArea'); -const Events = goog.require('Blockly.Events'); /* eslint-disable-next-line no-unused-vars */ const FlyoutButton = goog.requireType('Blockly.FlyoutButton'); const FlyoutMetricsManager = goog.require('Blockly.FlyoutMetricsManager'); @@ -32,6 +31,7 @@ const Xml = goog.require('Blockly.Xml'); const blocks = goog.require('Blockly.serialization.blocks'); const browserEvents = goog.require('Blockly.browserEvents'); const dom = goog.require('Blockly.utils.dom'); +const eventUtils = goog.require('Blockly.Events.utils'); const idGenerator = goog.require('Blockly.utils.idGenerator'); const object = goog.require('Blockly.utils.object'); const toolbox = goog.require('Blockly.utils.toolbox'); @@ -909,13 +909,13 @@ Flyout.prototype.isBlockCreatable_ = function(block) { */ Flyout.prototype.createBlock = function(originalBlock) { let newBlock = null; - Events.disable(); + eventUtils.disable(); const variablesBeforeCreation = this.targetWorkspace.getAllVariables(); this.targetWorkspace.setResizesEnabled(false); try { newBlock = this.placeNewBlock_(originalBlock); } finally { - Events.enable(); + eventUtils.enable(); } // Close the flyout. @@ -924,17 +924,17 @@ Flyout.prototype.createBlock = function(originalBlock) { const newVariables = Variables.getAddedVariables( this.targetWorkspace, variablesBeforeCreation); - if (Events.isEnabled()) { - Events.setGroup(true); + if (eventUtils.isEnabled()) { + eventUtils.setGroup(true); // Fire a VarCreate event for each (if any) new variable created. for (let i = 0; i < newVariables.length; i++) { const thisVariable = newVariables[i]; - Events.fire(new (Events.get(Events.VAR_CREATE))(thisVariable)); + eventUtils.fire(new (eventUtils.get(eventUtils.VAR_CREATE))(thisVariable)); } // Block events come after var events, in case they refer to newly created // variables. - Events.fire(new (Events.get(Events.BLOCK_CREATE))(newBlock)); + eventUtils.fire(new (eventUtils.get(eventUtils.BLOCK_CREATE))(newBlock)); } if (this.autoClose) { this.hide(); diff --git a/core/gesture.js b/core/gesture.js index f2352050e..425773140 100644 --- a/core/gesture.js +++ b/core/gesture.js @@ -15,7 +15,6 @@ goog.module('Blockly.Gesture'); const BubbleDragger = goog.require('Blockly.BubbleDragger'); const Coordinate = goog.require('Blockly.utils.Coordinate'); -const Events = goog.require('Blockly.Events'); /* eslint-disable-next-line no-unused-vars */ const Field = goog.requireType('Blockly.Field'); /* eslint-disable-next-line no-unused-vars */ @@ -33,6 +32,7 @@ const WorkspaceDragger = goog.require('Blockly.WorkspaceDragger'); const blockAnimations = goog.require('Blockly.blockAnimations'); const browserEvents = goog.require('Blockly.browserEvents'); const common = goog.require('Blockly.common'); +const eventUtils = goog.require('Blockly.Events.utils'); const internalConstants = goog.require('Blockly.internalConstants'); const registry = goog.require('Blockly.registry'); /* eslint-disable-next-line no-unused-vars */ @@ -331,8 +331,8 @@ Gesture.prototype.updateIsDraggingFromFlyout_ = function() { this.startWorkspace_.updateScreenCalculationsIfScrolled(); // Start the event group now, so that the same event group is used for block // creation and block dragging. - if (!Events.getGroup()) { - Events.setGroup(true); + if (!eventUtils.getGroup()) { + eventUtils.setGroup(true); } // The start block is no longer relevant, because this is a drag. this.startBlock_ = null; @@ -663,7 +663,7 @@ Gesture.prototype.handleWsStart = function(e, ws) { * @private */ Gesture.prototype.fireWorkspaceClick_ = function(ws) { - Events.fire(new (Events.get(Events.CLICK))(null, ws.id, 'workspace')); + eventUtils.fire(new (eventUtils.get(eventUtils.CLICK))(null, ws.id, 'workspace')); }; /** @@ -745,20 +745,20 @@ Gesture.prototype.doBlockClick_ = function() { // Block click in an autoclosing flyout. if (this.flyout_ && this.flyout_.autoClose) { if (this.targetBlock_.isEnabled()) { - if (!Events.getGroup()) { - Events.setGroup(true); + if (!eventUtils.getGroup()) { + eventUtils.setGroup(true); } const newBlock = this.flyout_.createBlock(this.targetBlock_); newBlock.scheduleSnapAndBump(); } } else { // Clicks events are on the start block, even if it was a shadow. - const event = new (Events.get(Events.CLICK))( + const event = new (eventUtils.get(eventUtils.CLICK))( this.startBlock_, this.startWorkspace_.id, 'block'); - Events.fire(event); + eventUtils.fire(event); } this.bringBlockToFront_(); - Events.setGroup(false); + eventUtils.setGroup(false); }; /** diff --git a/core/insertion_marker_manager.js b/core/insertion_marker_manager.js index 75238e9d4..1012bd867 100644 --- a/core/insertion_marker_manager.js +++ b/core/insertion_marker_manager.js @@ -15,7 +15,6 @@ goog.module('Blockly.InsertionMarkerManager'); const ComponentManager = goog.require('Blockly.ComponentManager'); /* eslint-disable-next-line no-unused-vars */ const Coordinate = goog.requireType('Blockly.utils.Coordinate'); -const Events = goog.require('Blockly.Events'); /* eslint-disable-next-line no-unused-vars */ const IDeleteArea = goog.requireType('Blockly.IDeleteArea'); /* eslint-disable-next-line no-unused-vars */ @@ -27,6 +26,7 @@ const WorkspaceSvg = goog.requireType('Blockly.WorkspaceSvg'); const blockAnimations = goog.require('Blockly.blockAnimations'); const common = goog.require('Blockly.common'); const constants = goog.require('Blockly.constants'); +const eventUtils = goog.require('Blockly.Events.utils'); const internalConstants = goog.require('Blockly.internalConstants'); /* eslint-disable-next-line no-unused-vars */ const {BlockSvg} = goog.requireType('Blockly.BlockSvg'); @@ -175,7 +175,7 @@ InsertionMarkerManager.DUPLICATE_BLOCK_ERROR = 'The insertion marker ' + InsertionMarkerManager.prototype.dispose = function() { this.availableConnections_.length = 0; - Events.disable(); + eventUtils.disable(); try { if (this.firstMarker_) { this.firstMarker_.dispose(); @@ -184,7 +184,7 @@ InsertionMarkerManager.prototype.dispose = function() { this.lastMarker_.dispose(); } } finally { - Events.enable(); + eventUtils.enable(); } }; @@ -226,9 +226,9 @@ InsertionMarkerManager.prototype.wouldConnectBlock = function() { InsertionMarkerManager.prototype.applyConnections = function() { if (this.closestConnection_) { // Don't fire events for insertion markers. - Events.disable(); + eventUtils.disable(); this.hidePreview_(); - Events.enable(); + eventUtils.enable(); // Connect two blocks together. this.localConnection_.connect(this.closestConnection_); if (this.topBlock_.rendered) { @@ -263,10 +263,10 @@ InsertionMarkerManager.prototype.update = function(dxy, dragTarget) { if (shouldUpdate) { // Don't fire events for insertion marker creation or movement. - Events.disable(); + eventUtils.disable(); this.maybeHidePreview_(candidate); this.maybeShowPreview_(candidate); - Events.enable(); + eventUtils.enable(); } }; @@ -281,7 +281,7 @@ InsertionMarkerManager.prototype.update = function(dxy, dragTarget) { InsertionMarkerManager.prototype.createMarkerBlock_ = function(sourceBlock) { const imType = sourceBlock.type; - Events.disable(); + eventUtils.disable(); let result; try { result = this.workspace_.newBlock(imType); @@ -327,7 +327,7 @@ InsertionMarkerManager.prototype.createMarkerBlock_ = function(sourceBlock) { result.initSvg(); result.getSvgRoot().setAttribute('visibility', 'hidden'); } finally { - Events.enable(); + eventUtils.enable(); } return result; @@ -350,11 +350,11 @@ InsertionMarkerManager.prototype.initAvailableConnections_ = function() { available.push(lastOnStack); this.lastOnStack_ = lastOnStack; if (this.lastMarker_) { - Events.disable(); + eventUtils.disable(); try { this.lastMarker_.dispose(); } finally { - Events.enable(); + eventUtils.enable(); } } this.lastMarker_ = this.createMarkerBlock_(lastOnStack.getSourceBlock()); diff --git a/core/mutator.js b/core/mutator.js index 0ab65c5aa..c605608a4 100644 --- a/core/mutator.js +++ b/core/mutator.js @@ -15,6 +15,7 @@ goog.module('Blockly.Mutator'); /* eslint-disable-next-line no-unused-vars */ const Abstract = goog.requireType('Blockly.Events.Abstract'); +const BlockChange = goog.require('Blockly.Events.BlockChange'); /* eslint-disable-next-line no-unused-vars */ const BlocklyOptions = goog.requireType('Blockly.BlocklyOptions'); const Bubble = goog.require('Blockly.Bubble'); @@ -22,7 +23,6 @@ const Bubble = goog.require('Blockly.Bubble'); const Connection = goog.requireType('Blockly.Connection'); /* eslint-disable-next-line no-unused-vars */ const Coordinate = goog.requireType('Blockly.utils.Coordinate'); -const Events = goog.require('Blockly.Events'); const Icon = goog.require('Blockly.Icon'); const Options = goog.require('Blockly.Options'); const Svg = goog.require('Blockly.utils.Svg'); @@ -30,6 +30,7 @@ const Svg = goog.require('Blockly.utils.Svg'); const Workspace = goog.requireType('Blockly.Workspace'); const WorkspaceSvg = goog.require('Blockly.WorkspaceSvg'); const dom = goog.require('Blockly.utils.dom'); +const eventUtils = goog.require('Blockly.Events.utils'); const internalConstants = goog.require('Blockly.internalConstants'); const object = goog.require('Blockly.utils.object'); const toolbox = goog.require('Blockly.utils.toolbox'); @@ -39,8 +40,6 @@ const {Block} = goog.requireType('Blockly.Block'); /* eslint-disable-next-line no-unused-vars */ const {BlockSvg} = goog.requireType('Blockly.BlockSvg'); /** @suppress {extraRequire} */ -goog.require('Blockly.Events.BlockChange'); -/** @suppress {extraRequire} */ goog.require('Blockly.Events.BubbleOpen'); @@ -188,7 +187,7 @@ Mutator.prototype.createEditor_ = function() { } this.workspace_ = new WorkspaceSvg(workspaceOptions); this.workspace_.isMutator = true; - this.workspace_.addChangeListener(Events.disableOrphans); + this.workspace_.addChangeListener(eventUtils.disableOrphans); // Mutator flyouts go inside the mutator workspace's rather than in // a top level SVG. Instead of handling scale themselves, mutators @@ -294,8 +293,8 @@ Mutator.prototype.setVisible = function(visible) { // No change. return; } - Events.fire( - new (Events.get(Events.BUBBLE_OPEN))(this.block_, visible, 'mutator')); + eventUtils.fire( + new (eventUtils.get(eventUtils.BUBBLE_OPEN))(this.block_, visible, 'mutator')); if (visible) { // Create the bubble. this.bubble_ = new Bubble( @@ -373,8 +372,8 @@ Mutator.prototype.setVisible = function(visible) { */ Mutator.prototype.workspaceChanged_ = function(e) { if (!(e.isUiEvent || - (e.type == Events.CHANGE && e.element == 'disabled') || - e.type == Events.CREATE)) { + (e.type == eventUtils.CHANGE && e.element == 'disabled') || + e.type == eventUtils.CREATE)) { this.updateWorkspace_(); } }; @@ -414,9 +413,9 @@ Mutator.prototype.updateWorkspace_ = function() { // When the mutator's workspace changes, update the source block. if (this.rootBlock_.workspace == this.workspace_) { - Events.setGroup(true); + eventUtils.setGroup(true); const block = /** @type {!BlockSvg} */ (this.block_); - const oldExtraState = Events.BlockChange.getExtraBlockState_(block); + const oldExtraState = BlockChange.getExtraBlockState_(block); // Switch off rendering while the source block is rebuilt. const savedRendered = block.rendered; @@ -434,16 +433,16 @@ Mutator.prototype.updateWorkspace_ = function() { block.render(); } - const newExtraState = Events.BlockChange.getExtraBlockState_(block); + const newExtraState = BlockChange.getExtraBlockState_(block); if (oldExtraState != newExtraState) { - Events.fire(new (Events.get(Events.BLOCK_CHANGE))( + eventUtils.fire(new (eventUtils.get(eventUtils.BLOCK_CHANGE))( block, 'mutation', null, oldExtraState, newExtraState)); // Ensure that any bump is part of this mutation's event group. - const group = Events.getGroup(); + const group = eventUtils.getGroup(); setTimeout(function() { - Events.setGroup(group); + eventUtils.setGroup(group); block.bumpNeighbours(); - Events.setGroup(false); + eventUtils.setGroup(false); }, internalConstants.BUMP_DELAY); } @@ -452,7 +451,7 @@ Mutator.prototype.updateWorkspace_ = function() { if (!this.workspace_.isDragging()) { this.resizeBubble_(); } - Events.setGroup(false); + eventUtils.setGroup(false); } }; diff --git a/core/procedures.js b/core/procedures.js index ff15b4dcf..ff2081860 100644 --- a/core/procedures.js +++ b/core/procedures.js @@ -18,7 +18,6 @@ goog.module('Blockly.Procedures'); /* eslint-disable-next-line no-unused-vars */ const Abstract = goog.requireType('Blockly.Events.Abstract'); -const Events = goog.require('Blockly.Events'); /* eslint-disable-next-line no-unused-vars */ const Field = goog.requireType('Blockly.Field'); const Msg = goog.require('Blockly.Msg'); @@ -28,6 +27,7 @@ const Workspace = goog.require('Blockly.Workspace'); /* eslint-disable-next-line no-unused-vars */ const WorkspaceSvg = goog.requireType('Blockly.WorkspaceSvg'); const Xml = goog.require('Blockly.Xml'); +const eventUtils = goog.require('Blockly.Events.utils'); const utilsXml = goog.require('Blockly.utils.xml'); /* eslint-disable-next-line no-unused-vars */ const {Block} = goog.requireType('Blockly.Block'); @@ -306,7 +306,7 @@ const updateMutatorFlyout = function(workspace) { * @alias Blockly.Procedures.mutatorOpenListener */ const mutatorOpenListener = function(e) { - if (!(e.type == Events.BUBBLE_OPEN && e.bubbleType === 'mutator' && + if (!(e.type == eventUtils.BUBBLE_OPEN && e.bubbleType === 'mutator' && e.isOpen)) { return; } @@ -329,8 +329,8 @@ exports.mutatorOpenListener = mutatorOpenListener; * @param {!Abstract} e The event that triggered this listener. */ const mutatorChangeListener = function(e) { - if (e.type != Events.BLOCK_CREATE && e.type != Events.BLOCK_DELETE && - e.type != Events.BLOCK_CHANGE) { + if (e.type != eventUtils.BLOCK_CREATE && e.type != eventUtils.BLOCK_DELETE && + e.type != eventUtils.BLOCK_CHANGE) { return; } const workspaceId = /** @type {string} */ (e.workspaceId); @@ -371,7 +371,7 @@ exports.getCallers = getCallers; * @alias Blockly.Procedures.mutateCallers */ const mutateCallers = function(defBlock) { - const oldRecordUndo = Events.getRecordUndo(); + const oldRecordUndo = eventUtils.getRecordUndo(); const procedureBlock = /** @type {!ProcedureBlock} */ (defBlock); const name = procedureBlock.getProcedureDef()[0]; const xmlElement = defBlock.mutationToDom(true); @@ -386,10 +386,10 @@ const mutateCallers = function(defBlock) { // Fire a mutation on every caller block. But don't record this as an // undo action since it is deterministically tied to the procedure's // definition mutation. - Events.setRecordUndo(false); - Events.fire(new (Events.get(Events.BLOCK_CHANGE))( + eventUtils.setRecordUndo(false); + eventUtils.fire(new (eventUtils.get(eventUtils.BLOCK_CHANGE))( caller, 'mutation', null, oldMutation, newMutation)); - Events.setRecordUndo(oldRecordUndo); + eventUtils.setRecordUndo(oldRecordUndo); } } }; diff --git a/core/rendered_connection.js b/core/rendered_connection.js index ee2a386e3..da509e4e9 100644 --- a/core/rendered_connection.js +++ b/core/rendered_connection.js @@ -16,11 +16,11 @@ const Connection = goog.require('Blockly.Connection'); /* eslint-disable-next-line no-unused-vars */ const ConnectionDB = goog.requireType('Blockly.ConnectionDB'); const Coordinate = goog.require('Blockly.utils.Coordinate'); -const Events = goog.require('Blockly.Events'); const Svg = goog.require('Blockly.utils.Svg'); const common = goog.require('Blockly.common'); const deprecation = goog.require('Blockly.utils.deprecation'); const dom = goog.require('Blockly.utils.dom'); +const eventUtils = goog.require('Blockly.Events.utils'); const internalConstants = goog.require('Blockly.internalConstants'); const object = goog.require('Blockly.utils.object'); const svgPaths = goog.require('Blockly.utils.svgPaths'); @@ -459,13 +459,13 @@ RenderedConnection.prototype.isConnectionAllowed = function( */ RenderedConnection.prototype.onFailedConnect = function(otherConnection) { const block = this.getSourceBlock(); - if (Events.getRecordUndo()) { - const group = Events.getGroup(); + if (eventUtils.getRecordUndo()) { + const group = eventUtils.getGroup(); setTimeout(function() { if (!block.isDisposed() && !block.getParent()) { - Events.setGroup(group); + eventUtils.setGroup(group); this.bumpAwayFrom(otherConnection); - Events.setGroup(false); + eventUtils.setGroup(false); } }.bind(this), internalConstants.BUMP_DELAY); } diff --git a/core/renderers/common/marker_svg.js b/core/renderers/common/marker_svg.js index 04e900c61..770b57a6c 100644 --- a/core/renderers/common/marker_svg.js +++ b/core/renderers/common/marker_svg.js @@ -17,7 +17,6 @@ goog.module('Blockly.blockRendering.MarkerSvg'); const Connection = goog.requireType('Blockly.Connection'); /* eslint-disable-next-line no-unused-vars */ const ConstantProvider = goog.requireType('Blockly.blockRendering.ConstantProvider'); -const Events = goog.require('Blockly.Events'); /* eslint-disable-next-line no-unused-vars */ const Field = goog.requireType('Blockly.Field'); /* eslint-disable-next-line no-unused-vars */ @@ -28,6 +27,7 @@ const Svg = goog.require('Blockly.utils.Svg'); /* eslint-disable-next-line no-unused-vars */ const WorkspaceSvg = goog.requireType('Blockly.WorkspaceSvg'); const dom = goog.require('Blockly.utils.dom'); +const eventUtils = goog.require('Blockly.Events.utils'); const svgPaths = goog.require('Blockly.utils.svgPaths'); const {ASTNode} = goog.require('Blockly.ASTNode'); /* eslint-disable-next-line no-unused-vars */ @@ -557,9 +557,9 @@ MarkerSvg.prototype.hide = function() { */ MarkerSvg.prototype.fireMarkerEvent_ = function(oldNode, curNode) { const curBlock = curNode.getSourceBlock(); - const event = new (Events.get(Events.MARKER_MOVE))( + const event = new (eventUtils.get(eventUtils.MARKER_MOVE))( curBlock, this.isCursor(), oldNode, curNode); - Events.fire(event); + eventUtils.fire(event); }; /** diff --git a/core/scrollbar_pair.js b/core/scrollbar_pair.js index 2e79f1f98..f2754700c 100644 --- a/core/scrollbar_pair.js +++ b/core/scrollbar_pair.js @@ -12,7 +12,6 @@ goog.module('Blockly.ScrollbarPair'); -const Events = goog.require('Blockly.Events'); /* eslint-disable-next-line no-unused-vars */ const Metrics = goog.requireType('Blockly.utils.Metrics'); const Scrollbar = goog.require('Blockly.Scrollbar'); @@ -20,6 +19,7 @@ const Svg = goog.require('Blockly.utils.Svg'); /* eslint-disable-next-line no-unused-vars */ const WorkspaceSvg = goog.requireType('Blockly.WorkspaceSvg'); const dom = goog.require('Blockly.utils.dom'); +const eventUtils = goog.require('Blockly.Events.utils'); /** @@ -135,7 +135,7 @@ ScrollbarPair.prototype.resize = function() { if (resizeH || resizeV) { try { - Events.disable(); + eventUtils.disable(); if (this.hScroll && resizeH) { this.hScroll.resize(hostMetrics); } @@ -143,7 +143,7 @@ ScrollbarPair.prototype.resize = function() { this.vScroll.resize(hostMetrics); } } finally { - Events.enable(); + eventUtils.enable(); } this.workspace_.maybeFireViewportChangeEvent(); } diff --git a/core/serialization/blocks.js b/core/serialization/blocks.js index 33c640f66..1f43fb03b 100644 --- a/core/serialization/blocks.js +++ b/core/serialization/blocks.js @@ -16,13 +16,13 @@ goog.module.declareLegacyNamespace(); const {BadConnectionCheck, MissingBlockType, MissingConnection, RealChildOfShadow} = goog.require('Blockly.serialization.exceptions'); // eslint-disable-next-line no-unused-vars const Connection = goog.requireType('Blockly.Connection'); -const Events = goog.require('Blockly.Events'); // eslint-disable-next-line no-unused-vars const {ISerializer} = goog.require('Blockly.serialization.ISerializer'); const Size = goog.require('Blockly.utils.Size'); // eslint-disable-next-line no-unused-vars const Workspace = goog.requireType('Blockly.Workspace'); const Xml = goog.require('Blockly.Xml'); +const eventUtils = goog.require('Blockly.Events.utils'); const inputTypes = goog.require('Blockly.inputTypes'); const priorities = goog.require('Blockly.serialization.priorities'); const serializationRegistry = goog.require('Blockly.serialization.registry'); @@ -328,20 +328,20 @@ const appendInternal = function( recordUndo = false } = {} ) { - const prevRecordUndo = Events.getRecordUndo(); - Events.setRecordUndo(recordUndo); - const existingGroup = Events.getGroup(); + const prevRecordUndo = eventUtils.getRecordUndo(); + eventUtils.setRecordUndo(recordUndo); + const existingGroup = eventUtils.getGroup(); if (!existingGroup) { - Events.setGroup(true); + eventUtils.setGroup(true); } - Events.disable(); + eventUtils.disable(); const block = appendPrivate(state, workspace, {parentConnection, isShadow}); - Events.enable(); - Events.fire(new (Events.get(Events.BLOCK_CREATE))(block)); - Events.setGroup(existingGroup); - Events.setRecordUndo(prevRecordUndo); + eventUtils.enable(); + eventUtils.fire(new (eventUtils.get(eventUtils.BLOCK_CREATE))(block)); + eventUtils.setGroup(existingGroup); + eventUtils.setRecordUndo(prevRecordUndo); // Adding connections to the connection db is expensive. This defers that // operation to decrease load time. @@ -672,7 +672,7 @@ class BlockSerializer { load(state, workspace) { const blockStates = state['blocks']; for (const state of blockStates) { - append(state, workspace, {recordUndo: Events.getRecordUndo()}); + append(state, workspace, {recordUndo: eventUtils.getRecordUndo()}); } } diff --git a/core/serialization/workspaces.js b/core/serialization/workspaces.js index 2c180099b..25598116e 100644 --- a/core/serialization/workspaces.js +++ b/core/serialization/workspaces.js @@ -13,10 +13,10 @@ goog.module('Blockly.serialization.workspaces'); goog.module.declareLegacyNamespace(); -const Events = goog.require('Blockly.Events'); // eslint-disable-next-line no-unused-vars const Workspace = goog.require('Blockly.Workspace'); const dom = goog.require('Blockly.utils.dom'); +const eventUtils = goog.require('Blockly.Events.utils'); const registry = goog.require('Blockly.registry'); @@ -57,11 +57,11 @@ const load = function(state, workspace, {recordUndo = false} = {}) { .sort(([, {priority: priorityA}], [, {priority: priorityB}]) => priorityB - priorityA); - const prevRecordUndo = Events.getRecordUndo(); - Events.setRecordUndo(recordUndo); - const existingGroup = Events.getGroup(); + const prevRecordUndo = eventUtils.getRecordUndo(); + eventUtils.setRecordUndo(recordUndo); + const existingGroup = eventUtils.getGroup(); if (!existingGroup) { - Events.setGroup(true); + eventUtils.setGroup(true); } dom.startTextWidthCache(); @@ -89,9 +89,9 @@ const load = function(state, workspace, {recordUndo = false} = {}) { } dom.stopTextWidthCache(); - Events.fire(new (Events.get(Events.FINISHED_LOADING))(workspace)); + eventUtils.fire(new (eventUtils.get(eventUtils.FINISHED_LOADING))(workspace)); - Events.setGroup(existingGroup); - Events.setRecordUndo(prevRecordUndo); + eventUtils.setGroup(existingGroup); + eventUtils.setRecordUndo(prevRecordUndo); }; exports.load = load; diff --git a/core/toolbox/toolbox.js b/core/toolbox/toolbox.js index 347b06ad0..9062766a7 100644 --- a/core/toolbox/toolbox.js +++ b/core/toolbox/toolbox.js @@ -18,7 +18,6 @@ const CollapsibleToolboxCategory = goog.require('Blockly.CollapsibleToolboxCateg const ComponentManager = goog.require('Blockly.ComponentManager'); const Css = goog.require('Blockly.Css'); const DeleteArea = goog.require('Blockly.DeleteArea'); -const Events = goog.require('Blockly.Events'); /* eslint-disable-next-line no-unused-vars */ const IAutoHideable = goog.requireType('Blockly.IAutoHideable'); /* eslint-disable-next-line no-unused-vars */ @@ -46,8 +45,9 @@ const Touch = goog.require('Blockly.Touch'); const WorkspaceSvg = goog.requireType('Blockly.WorkspaceSvg'); const aria = goog.require('Blockly.utils.aria'); const browserEvents = goog.require('Blockly.browserEvents'); -const dom = goog.require('Blockly.utils.dom'); const common = goog.require('Blockly.common'); +const dom = goog.require('Blockly.utils.dom'); +const eventUtils = goog.require('Blockly.Events.utils'); const keyCodes = goog.require('Blockly.utils.KeyCodes'); const object = goog.require('Blockly.utils.object'); const registry = goog.require('Blockly.registry'); @@ -988,9 +988,9 @@ Toolbox.prototype.fireSelectEvent_ = function(oldItem, newItem) { if (oldItem == newItem) { newElement = null; } - const event = new (Events.get(Events.TOOLBOX_ITEM_SELECT))( + const event = new (eventUtils.get(eventUtils.TOOLBOX_ITEM_SELECT))( oldElement, newElement, this.workspace_.id); - Events.fire(event); + eventUtils.fire(event); }; /** diff --git a/core/trashcan.js b/core/trashcan.js index bebc5569d..36c59edbc 100644 --- a/core/trashcan.js +++ b/core/trashcan.js @@ -18,7 +18,6 @@ const Abstract = goog.requireType('Blockly.Events.Abstract'); const BlocklyOptions = goog.requireType('Blockly.BlocklyOptions'); const ComponentManager = goog.require('Blockly.ComponentManager'); const DeleteArea = goog.require('Blockly.DeleteArea'); -const Events = goog.require('Blockly.Events'); /* eslint-disable-next-line no-unused-vars */ const IAutoHideable = goog.requireType('Blockly.IAutoHideable'); /* eslint-disable-next-line no-unused-vars */ @@ -39,6 +38,7 @@ const WorkspaceSvg = goog.requireType('Blockly.WorkspaceSvg'); const blocks = goog.requireType('Blockly.serialization.blocks'); const browserEvents = goog.require('Blockly.browserEvents'); const dom = goog.require('Blockly.utils.dom'); +const eventUtils = goog.require('Blockly.Events.utils'); const internalConstants = goog.require('Blockly.internalConstants'); const object = goog.require('Blockly.utils.object'); const registry = goog.require('Blockly.registry'); @@ -627,8 +627,8 @@ Trashcan.prototype.click = function() { */ Trashcan.prototype.fireUiEvent_ = function(trashcanOpen) { const uiEvent = - new (Events.get(Events.TRASHCAN_OPEN))(trashcanOpen, this.workspace_.id); - Events.fire(uiEvent); + new (eventUtils.get(eventUtils.TRASHCAN_OPEN))(trashcanOpen, this.workspace_.id); + eventUtils.fire(uiEvent); }; /** @@ -672,7 +672,7 @@ Trashcan.prototype.onDelete_ = function(event) { if (this.workspace_.options.maxTrashcanContents <= 0) { return; } - if (event.type == Events.BLOCK_DELETE && !event.wasShadow) { + if (event.type == eventUtils.BLOCK_DELETE && !event.wasShadow) { const cleanedJson = this.cleanBlockJson_(event.oldJson); if (this.contents_.indexOf(cleanedJson) != -1) { return; diff --git a/core/variable_map.js b/core/variable_map.js index fb831d293..d0a69e6c8 100644 --- a/core/variable_map.js +++ b/core/variable_map.js @@ -12,13 +12,13 @@ goog.module('Blockly.VariableMap'); -const Events = goog.require('Blockly.Events'); const Msg = goog.require('Blockly.Msg'); const Names = goog.require('Blockly.Names'); const VariableModel = goog.require('Blockly.VariableModel'); /* eslint-disable-next-line no-unused-vars */ const Workspace = goog.requireType('Blockly.Workspace'); const dialog = goog.require('Blockly.dialog'); +const eventUtils = goog.require('Blockly.Events.utils'); const idGenerator = goog.require('Blockly.utils.idGenerator'); const object = goog.require('Blockly.utils.object'); const utils = goog.require('Blockly.utils'); @@ -73,7 +73,7 @@ VariableMap.prototype.renameVariable = function(variable, newName) { const type = variable.type; const conflictVar = this.getVariable(newName, type); const blocks = this.workspace.getAllBlocks(false); - Events.setGroup(true); + eventUtils.setGroup(true); try { // The IDs may match if the rename is a simple case change (name1 -> Name1). if (!conflictVar || conflictVar.getId() == variable.getId()) { @@ -82,7 +82,7 @@ VariableMap.prototype.renameVariable = function(variable, newName) { this.renameVariableWithConflict_(variable, newName, conflictVar, blocks); } } finally { - Events.setGroup(false); + eventUtils.setGroup(false); } }; @@ -112,7 +112,7 @@ VariableMap.prototype.renameVariableById = function(id, newName) { */ VariableMap.prototype.renameVariableAndUses_ = function( variable, newName, blocks) { - Events.fire(new (Events.get(Events.VAR_RENAME))(variable, newName)); + eventUtils.fire(new (eventUtils.get(eventUtils.VAR_RENAME))(variable, newName)); variable.name = newName; for (let i = 0; i < blocks.length; i++) { blocks[i].updateVarName(variable); @@ -149,7 +149,7 @@ VariableMap.prototype.renameVariableWithConflict_ = function( } // Finally delete the original variable, which is now unreferenced. - Events.fire(new (Events.get(Events.VAR_DELETE))(variable)); + eventUtils.fire(new (eventUtils.get(eventUtils.VAR_DELETE))(variable)); // And remove it from the list. utils.arrayRemove(this.variableMap_[type], variable); }; @@ -210,7 +210,7 @@ VariableMap.prototype.deleteVariable = function(variable) { const tempVar = variableList[i]; if (tempVar.getId() == variableId) { variableList.splice(i, 1); - Events.fire(new (Events.get(Events.VAR_DELETE))(variable)); + eventUtils.fire(new (eventUtils.get(eventUtils.VAR_DELETE))(variable)); return; } } @@ -267,9 +267,9 @@ VariableMap.prototype.deleteVariableById = function(id) { * @package */ VariableMap.prototype.deleteVariableInternal = function(variable, uses) { - const existingGroup = Events.getGroup(); + const existingGroup = eventUtils.getGroup(); if (!existingGroup) { - Events.setGroup(true); + eventUtils.setGroup(true); } try { for (let i = 0; i < uses.length; i++) { @@ -278,7 +278,7 @@ VariableMap.prototype.deleteVariableInternal = function(variable, uses) { this.deleteVariable(variable); } finally { if (!existingGroup) { - Events.setGroup(false); + eventUtils.setGroup(false); } } }; diff --git a/core/variable_model.js b/core/variable_model.js index dcded7131..150ac98fd 100644 --- a/core/variable_model.js +++ b/core/variable_model.js @@ -12,9 +12,9 @@ goog.module('Blockly.VariableModel'); -const Events = goog.require('Blockly.Events'); /* eslint-disable-next-line no-unused-vars */ const Workspace = goog.requireType('Blockly.Workspace'); +const eventUtils = goog.require('Blockly.Events.utils'); const idGenerator = goog.require('Blockly.utils.idGenerator'); /** @suppress {extraRequire} */ goog.require('Blockly.Events.VarCreate'); @@ -66,7 +66,7 @@ const VariableModel = function(workspace, name, opt_type, opt_id) { */ this.id_ = opt_id || idGenerator.genUid(); - Events.fire(new (Events.get(Events.VAR_CREATE))(this)); + eventUtils.fire(new (eventUtils.get(eventUtils.VAR_CREATE))(this)); }; /** diff --git a/core/warning.js b/core/warning.js index bf137f8d5..b3495e2b7 100644 --- a/core/warning.js +++ b/core/warning.js @@ -15,10 +15,10 @@ goog.module('Blockly.Warning'); const Bubble = goog.require('Blockly.Bubble'); /* eslint-disable-next-line no-unused-vars */ const Coordinate = goog.requireType('Blockly.utils.Coordinate'); -const Events = goog.require('Blockly.Events'); const Icon = goog.require('Blockly.Icon'); const Svg = goog.require('Blockly.utils.Svg'); const dom = goog.require('Blockly.utils.dom'); +const eventUtils = goog.require('Blockly.Events.utils'); const object = goog.require('Blockly.utils.object'); /* eslint-disable-next-line no-unused-vars */ const {Block} = goog.requireType('Blockly.Block'); @@ -89,8 +89,8 @@ Warning.prototype.setVisible = function(visible) { if (visible == this.isVisible()) { return; } - Events.fire( - new (Events.get(Events.BUBBLE_OPEN))(this.block_, visible, 'warning')); + eventUtils.fire( + new (eventUtils.get(eventUtils.BUBBLE_OPEN))(this.block_, visible, 'warning')); if (visible) { this.createBubble_(); } else { diff --git a/core/workspace.js b/core/workspace.js index dc2d26efc..5a739761a 100644 --- a/core/workspace.js +++ b/core/workspace.js @@ -18,7 +18,6 @@ const Abstract = goog.requireType('Blockly.Events.Abstract'); const BlocklyOptions = goog.requireType('Blockly.BlocklyOptions'); /* eslint-disable-next-line no-unused-vars */ const ConnectionDB = goog.requireType('Blockly.ConnectionDB'); -const Events = goog.require('Blockly.Events'); /* eslint-disable-next-line no-unused-vars */ const IASTNodeLocation = goog.requireType('Blockly.IASTNodeLocation'); /* eslint-disable-next-line no-unused-vars */ @@ -30,6 +29,7 @@ const VariableModel = goog.requireType('Blockly.VariableModel'); /* eslint-disable-next-line no-unused-vars */ const WorkspaceComment = goog.requireType('Blockly.WorkspaceComment'); const idGenerator = goog.require('Blockly.utils.idGenerator'); +const eventUtils = goog.require('Blockly.Events.utils'); const math = goog.require('Blockly.utils.math'); const registry = goog.require('Blockly.registry'); /* eslint-disable-next-line no-unused-vars */ @@ -379,9 +379,9 @@ Workspace.prototype.getAllBlocks = function(ordered) { Workspace.prototype.clear = function() { this.isClearing = true; try { - const existingGroup = Events.getGroup(); + const existingGroup = eventUtils.getGroup(); if (!existingGroup) { - Events.setGroup(true); + eventUtils.setGroup(true); } while (this.topBlocks_.length) { this.topBlocks_[0].dispose(false); @@ -390,7 +390,7 @@ Workspace.prototype.clear = function() { this.topComments_[this.topComments_.length - 1].dispose(); } if (!existingGroup) { - Events.setGroup(false); + eventUtils.setGroup(false); } this.variableMap_.clear(); if (this.potentialVariableMap_) { @@ -634,15 +634,15 @@ Workspace.prototype.undo = function(redo) { const event = events[i]; outputStack.push(event); } - events = Events.filter(events, redo); - Events.setRecordUndo(false); + events = eventUtils.filter(events, redo); + eventUtils.setRecordUndo(false); try { for (let i = 0; i < events.length; i++) { const event = events[i]; event.run(redo); } } finally { - Events.setRecordUndo(true); + eventUtils.setRecordUndo(true); } }; @@ -653,7 +653,7 @@ Workspace.prototype.clearUndo = function() { this.undoStack_.length = 0; this.redoStack_.length = 0; // Stop any events already in the firing queue from being undoable. - Events.clearPendingUndo(); + eventUtils.clearPendingUndo(); }; /** diff --git a/core/workspace_comment.js b/core/workspace_comment.js index a2a2aecaf..362132bd8 100644 --- a/core/workspace_comment.js +++ b/core/workspace_comment.js @@ -13,10 +13,10 @@ goog.module('Blockly.WorkspaceComment'); const Coordinate = goog.require('Blockly.utils.Coordinate'); -const Events = goog.require('Blockly.Events'); /* eslint-disable-next-line no-unused-vars */ const Workspace = goog.requireType('Blockly.Workspace'); const idGenerator = goog.require('Blockly.utils.idGenerator'); +const eventUtils = goog.require('Blockly.Events.utils'); const xml = goog.require('Blockly.utils.xml'); /** @suppress {extraRequire} */ goog.require('Blockly.Events.CommentChange'); @@ -128,8 +128,8 @@ WorkspaceComment.prototype.dispose = function() { return; } - if (Events.isEnabled()) { - Events.fire(new (Events.get(Events.COMMENT_DELETE))(this)); + if (eventUtils.isEnabled()) { + eventUtils.fire(new (eventUtils.get(eventUtils.COMMENT_DELETE))(this)); } // Remove from the list of top comments and the comment database. @@ -193,10 +193,10 @@ WorkspaceComment.prototype.getXY = function() { * @package */ WorkspaceComment.prototype.moveBy = function(dx, dy) { - const event = new (Events.get(Events.COMMENT_MOVE))(this); + const event = new (eventUtils.get(eventUtils.COMMENT_MOVE))(this); this.xy_.translate(dx, dy); event.recordNew(); - Events.fire(event); + eventUtils.fire(event); }; /** @@ -268,8 +268,8 @@ WorkspaceComment.prototype.getContent = function() { */ WorkspaceComment.prototype.setContent = function(content) { if (this.content_ != content) { - Events.fire( - new (Events.get(Events.COMMENT_CHANGE))(this, this.content_, content)); + eventUtils.fire( + new (eventUtils.get(eventUtils.COMMENT_CHANGE))(this, this.content_, content)); this.content_ = content; } }; @@ -312,16 +312,16 @@ WorkspaceComment.prototype.toXml = function(opt_noId) { * @package */ WorkspaceComment.fireCreateEvent = function(comment) { - if (Events.isEnabled()) { - const existingGroup = Events.getGroup(); + if (eventUtils.isEnabled()) { + const existingGroup = eventUtils.getGroup(); if (!existingGroup) { - Events.setGroup(true); + eventUtils.setGroup(true); } try { - Events.fire(new (Events.get(Events.COMMENT_CREATE))(comment)); + eventUtils.fire(new (eventUtils.get(eventUtils.COMMENT_CREATE))(comment)); } finally { if (!existingGroup) { - Events.setGroup(false); + eventUtils.setGroup(false); } } } diff --git a/core/workspace_comment_svg.js b/core/workspace_comment_svg.js index 1e8172948..d21820c1f 100644 --- a/core/workspace_comment_svg.js +++ b/core/workspace_comment_svg.js @@ -15,7 +15,6 @@ goog.module('Blockly.WorkspaceCommentSvg'); const ContextMenu = goog.require('Blockly.ContextMenu'); const Coordinate = goog.require('Blockly.utils.Coordinate'); const Css = goog.require('Blockly.Css'); -const Events = goog.require('Blockly.Events'); /* eslint-disable-next-line no-unused-vars */ const IBoundedElement = goog.requireType('Blockly.IBoundedElement'); /* eslint-disable-next-line no-unused-vars */ @@ -31,6 +30,7 @@ const WorkspaceComment = goog.require('Blockly.WorkspaceComment'); const browserEvents = goog.require('Blockly.browserEvents'); const common = goog.require('Blockly.common'); const dom = goog.require('Blockly.utils.dom'); +const eventUtils = goog.require('Blockly.Events.utils'); const object = goog.require('Blockly.utils.object'); const utils = goog.require('Blockly.utils'); /* eslint-disable-next-line no-unused-vars */ @@ -171,17 +171,17 @@ WorkspaceCommentSvg.prototype.dispose = function() { this.workspace.cancelCurrentGesture(); } - if (Events.isEnabled()) { - Events.fire(new (Events.get(Events.COMMENT_DELETE))(this)); + if (eventUtils.isEnabled()) { + eventUtils.fire(new (eventUtils.get(eventUtils.COMMENT_DELETE))(this)); } dom.removeNode(this.svgGroup_); // Dispose of any rendered components this.disposeInternal_(); - Events.disable(); + eventUtils.disable(); WorkspaceCommentSvg.superClass_.dispose.call(this); - Events.enable(); + eventUtils.enable(); }; /** @@ -260,16 +260,16 @@ WorkspaceCommentSvg.prototype.select = function() { if (common.getSelected()) { oldId = common.getSelected().id; // Unselect any previously selected block. - Events.disable(); + eventUtils.disable(); try { common.getSelected().unselect(); } finally { - Events.enable(); + eventUtils.enable(); } } const event = - new (Events.get(Events.SELECTED))(oldId, this.id, this.workspace.id); - Events.fire(event); + new (eventUtils.get(eventUtils.SELECTED))(oldId, this.id, this.workspace.id); + eventUtils.fire(event); common.setSelected(this); this.addSelect(); }; @@ -283,8 +283,8 @@ WorkspaceCommentSvg.prototype.unselect = function() { return; } const event = - new (Events.get(Events.SELECTED))(this.id, null, this.workspace.id); - Events.fire(event); + new (eventUtils.get(eventUtils.SELECTED))(this.id, null, this.workspace.id); + eventUtils.fire(event); common.setSelected(null); this.removeSelect(); this.blurFocus(); @@ -376,13 +376,13 @@ WorkspaceCommentSvg.prototype.getRelativeToSurfaceXY = function() { * @package */ WorkspaceCommentSvg.prototype.moveBy = function(dx, dy) { - const event = new (Events.get(Events.COMMENT_MOVE))(this); + const event = new (eventUtils.get(eventUtils.COMMENT_MOVE))(this); // TODO: Do I need to look up the relative to surface XY position here? const xy = this.getRelativeToSurfaceXY(); this.translate(xy.x + dx, xy.y + dy); this.xy_ = new Coordinate(xy.x + dx, xy.y + dy); event.recordNew(); - Events.fire(event); + eventUtils.fire(event); this.workspace.resizeContents(); }; @@ -606,7 +606,7 @@ WorkspaceCommentSvg.prototype.setAutoLayout = function(_enable) { * @package */ WorkspaceCommentSvg.fromXml = function(xmlComment, workspace, opt_wsWidth) { - Events.disable(); + eventUtils.disable(); let comment; try { const info = WorkspaceComment.parseAttributes(xmlComment); @@ -628,7 +628,7 @@ WorkspaceCommentSvg.fromXml = function(xmlComment, workspace, opt_wsWidth) { } } } finally { - Events.enable(); + eventUtils.enable(); } WorkspaceComment.fireCreateEvent( diff --git a/core/workspace_svg.js b/core/workspace_svg.js index 12471ef95..c56602a33 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -21,7 +21,6 @@ const ContextMenu = goog.require('Blockly.ContextMenu'); const ContextMenuRegistry = goog.require('Blockly.ContextMenuRegistry'); const Coordinate = goog.require('Blockly.utils.Coordinate'); const DropDownDiv = goog.require('Blockly.DropDownDiv'); -const Events = goog.require('Blockly.Events'); /* eslint-disable-next-line no-unused-vars */ const FlyoutButton = goog.requireType('Blockly.FlyoutButton'); const Gesture = goog.require('Blockly.Gesture'); @@ -81,6 +80,7 @@ const blocks = goog.require('Blockly.serialization.blocks'); const browserEvents = goog.require('Blockly.browserEvents'); const common = goog.require('Blockly.common'); const dom = goog.require('Blockly.utils.dom'); +const eventUtils = goog.require('Blockly.Events.utils'); const internalConstants = goog.require('Blockly.internalConstants'); const object = goog.require('Blockly.utils.object'); const registry = goog.require('Blockly.registry'); @@ -714,8 +714,8 @@ WorkspaceSvg.prototype.refreshTheme = function() { } const event = - new (Events.get(Events.THEME_CHANGE))(this.getTheme().name, this.id); - Events.fire(event); + new (eventUtils.get(eventUtils.THEME_CHANGE))(this.getTheme().name, this.id); + eventUtils.fire(event); }; /** @@ -1282,7 +1282,7 @@ WorkspaceSvg.prototype.getParentSvg = function() { * @package */ WorkspaceSvg.prototype.maybeFireViewportChangeEvent = function() { - if (!Events.isEnabled()) { + if (!eventUtils.isEnabled()) { return; } const scale = this.scale; @@ -1294,12 +1294,12 @@ WorkspaceSvg.prototype.maybeFireViewportChangeEvent = function() { // negligible changes in viewport top/left. return; } - const event = new (Events.get(Events.VIEWPORT_CHANGE))( + const event = new (eventUtils.get(eventUtils.VIEWPORT_CHANGE))( top, left, scale, this.id, this.oldScale_); this.oldScale_ = scale; this.oldTop_ = top; this.oldLeft_ = left; - Events.fire(event); + eventUtils.fire(event); }; /** @@ -1540,7 +1540,7 @@ WorkspaceSvg.prototype.paste = function(state) { * @private */ WorkspaceSvg.prototype.pasteBlock_ = function(xmlBlock, jsonBlock) { - Events.disable(); + eventUtils.disable(); let block; try { let blockX; @@ -1598,10 +1598,10 @@ WorkspaceSvg.prototype.pasteBlock_ = function(xmlBlock, jsonBlock) { block.moveTo(new Coordinate(blockX, blockY)); } } finally { - Events.enable(); + eventUtils.enable(); } - if (Events.isEnabled() && !block.isShadow()) { - Events.fire(new (Events.get(Events.BLOCK_CREATE))(block)); + if (eventUtils.isEnabled() && !block.isShadow()) { + eventUtils.fire(new (eventUtils.get(eventUtils.BLOCK_CREATE))(block)); } block.select(); }; @@ -1614,7 +1614,7 @@ WorkspaceSvg.prototype.pasteBlock_ = function(xmlBlock, jsonBlock) { * bundled in. */ WorkspaceSvg.prototype.pasteWorkspaceComment_ = function(xmlComment) { - Events.disable(); + eventUtils.disable(); let comment; try { comment = goog.module.get('Blockly.WorkspaceCommentSvg') @@ -1634,9 +1634,9 @@ WorkspaceSvg.prototype.pasteWorkspaceComment_ = function(xmlComment) { comment.moveBy(commentX, commentY); } } finally { - Events.enable(); + eventUtils.enable(); } - if (Events.isEnabled()) { + if (eventUtils.isEnabled()) { goog.module.get('Blockly.WorkspaceComment').fireCreateEvent(comment); } comment.select(); @@ -1938,7 +1938,7 @@ WorkspaceSvg.prototype.getBlocksBoundingBox = function() { */ WorkspaceSvg.prototype.cleanUp = function() { this.setResizesEnabled(false); - Events.setGroup(true); + eventUtils.setGroup(true); const topBlocks = this.getTopBlocks(true); let cursorY = 0; for (let i = 0, block; (block = topBlocks[i]); i++) { @@ -1951,7 +1951,7 @@ WorkspaceSvg.prototype.cleanUp = function() { cursorY = block.getRelativeToSurfaceXY().y + block.getHeightWidth().height + this.renderer_.getConstants().MIN_BLOCK_HEIGHT; } - Events.setGroup(false); + eventUtils.setGroup(false); this.setResizesEnabled(true); }; @@ -2171,12 +2171,12 @@ WorkspaceSvg.prototype.zoomToFit = function() { // Scale Units: (pixels / workspaceUnit) const ratioX = workspaceWidth / blocksWidth; const ratioY = workspaceHeight / blocksHeight; - Events.disable(); + eventUtils.disable(); try { this.setScale(Math.min(ratioX, ratioY)); this.scrollCenter(); } finally { - Events.enable(); + eventUtils.enable(); } this.maybeFireViewportChangeEvent(); }; diff --git a/core/xml.js b/core/xml.js index 19bc142ca..b5c25d06e 100644 --- a/core/xml.js +++ b/core/xml.js @@ -12,7 +12,6 @@ goog.module('Blockly.Xml'); -const Events = goog.require('Blockly.Events'); /* eslint-disable-next-line no-unused-vars */ const Connection = goog.requireType('Blockly.Connection'); /* eslint-disable-next-line no-unused-vars */ @@ -25,6 +24,7 @@ const Workspace = goog.requireType('Blockly.Workspace'); /* eslint-disable-next-line no-unused-vars */ const WorkspaceSvg = goog.requireType('Blockly.WorkspaceSvg'); const dom = goog.require('Blockly.utils.dom'); +const eventUtils = goog.require('Blockly.Events.utils'); const inputTypes = goog.require('Blockly.inputTypes'); const utilsXml = goog.require('Blockly.utils.xml'); /* eslint-disable-next-line no-unused-vars */ @@ -423,9 +423,9 @@ const domToWorkspace = function(xml, workspace) { } const newBlockIds = []; // A list of block IDs added by this call. dom.startTextWidthCache(); - const existingGroup = Events.getGroup(); + const existingGroup = eventUtils.getGroup(); if (!existingGroup) { - Events.setGroup(true); + eventUtils.setGroup(true); } // Disable workspace resizes as an optimization. @@ -437,7 +437,7 @@ const domToWorkspace = function(xml, workspace) { for (let i = 0, xmlChild; (xmlChild = xml.childNodes[i]); i++) { const name = xmlChild.nodeName.toLowerCase(); const xmlChildElement = /** @type {!Element} */ (xmlChild); - if (name == 'block' || (name == 'shadow' && !Events.getRecordUndo())) { + if (name == 'block' || (name == 'shadow' && !eventUtils.getRecordUndo())) { // Allow top-level shadow blocks if recordUndo is disabled since // that means an undo is in progress. Such a block is expected // to be moved to a nested destination in the next operation. @@ -492,7 +492,7 @@ const domToWorkspace = function(xml, workspace) { } } finally { if (!existingGroup) { - Events.setGroup(false); + eventUtils.setGroup(false); } dom.stopTextWidthCache(); } @@ -500,7 +500,7 @@ const domToWorkspace = function(xml, workspace) { if (workspace.setResizesEnabled) { workspace.setResizesEnabled(true); } - Events.fire(new (Events.get(Events.FINISHED_LOADING))(workspace)); + eventUtils.fire(new (eventUtils.get(eventUtils.FINISHED_LOADING))(workspace)); return newBlockIds; }; exports.domToWorkspace = domToWorkspace; @@ -574,7 +574,7 @@ const domToBlock = function(xmlBlock, workspace) { 'swap the arguments.'); } // Create top-level block. - Events.disable(); + eventUtils.disable(); const variablesBeforeCreation = workspace.getAllVariables(); let topBlock; try { @@ -608,20 +608,20 @@ const domToBlock = function(xmlBlock, workspace) { } } } finally { - Events.enable(); + eventUtils.enable(); } - if (Events.isEnabled()) { + if (eventUtils.isEnabled()) { const newVariables = goog.module.get('Blockly.Variables') .getAddedVariables(workspace, variablesBeforeCreation); // Fire a VarCreate event for each (if any) new variable created. for (let i = 0; i < newVariables.length; i++) { const thisVariable = newVariables[i]; - Events.fire(new (Events.get(Events.VAR_CREATE))(thisVariable)); + eventUtils.fire(new (eventUtils.get(eventUtils.VAR_CREATE))(thisVariable)); } // Block events come after var events, in case they refer to newly created // variables. - Events.fire(new (Events.get(Events.CREATE))(topBlock)); + eventUtils.fire(new (eventUtils.get(eventUtils.CREATE))(topBlock)); } return topBlock; }; diff --git a/core/zoom_controls.js b/core/zoom_controls.js index ec3ddaf42..5ba045f50 100644 --- a/core/zoom_controls.js +++ b/core/zoom_controls.js @@ -14,7 +14,6 @@ goog.module('Blockly.ZoomControls'); const ComponentManager = goog.require('Blockly.ComponentManager'); const Css = goog.require('Blockly.Css'); -const Events = goog.require('Blockly.Events'); /* eslint-disable-next-line no-unused-vars */ const IPositionable = goog.requireType('Blockly.IPositionable'); /* eslint-disable-next-line no-unused-vars */ @@ -27,6 +26,7 @@ const Touch = goog.require('Blockly.Touch'); const WorkspaceSvg = goog.requireType('Blockly.WorkspaceSvg'); const browserEvents = goog.require('Blockly.browserEvents'); const dom = goog.require('Blockly.utils.dom'); +const eventUtils = goog.require('Blockly.Events.utils'); const internalConstants = goog.require('Blockly.internalConstants'); const uiPosition = goog.require('Blockly.uiPosition'); /** @suppress {extraRequire} */ @@ -487,8 +487,8 @@ ZoomControls.prototype.resetZoom_ = function(e) { */ ZoomControls.prototype.fireZoomEvent_ = function() { const uiEvent = - new (Events.get(Events.CLICK))(null, this.workspace_.id, 'zoom_controls'); - Events.fire(uiEvent); + new (eventUtils.get(eventUtils.CLICK))(null, this.workspace_.id, 'zoom_controls'); + eventUtils.fire(uiEvent); }; /** diff --git a/tests/deps.js b/tests/deps.js index 892ccb970..6d8e9e4cc 100644 --- a/tests/deps.js +++ b/tests/deps.js @@ -7,65 +7,66 @@ goog.addDependency('../../blocks/procedures.js', ['Blockly.Blocks.procedures'], goog.addDependency('../../blocks/text.js', ['Blockly.Blocks.texts', 'Blockly.Constants.Text'], ['Blockly', 'Blockly.FieldDropdown', 'Blockly.FieldImage', 'Blockly.FieldMultilineInput', 'Blockly.FieldTextInput', 'Blockly.FieldVariable', 'Blockly.Mutator'], {'lang': 'es5'}); goog.addDependency('../../blocks/variables.js', ['Blockly.Blocks.variables', 'Blockly.Constants.Variables'], ['Blockly', 'Blockly.FieldLabel', 'Blockly.FieldVariable']); goog.addDependency('../../blocks/variables_dynamic.js', ['Blockly.Constants.VariablesDynamic'], ['Blockly', 'Blockly.FieldLabel', 'Blockly.FieldVariable']); -goog.addDependency('../../core/block.js', ['Blockly.Block'], ['Blockly.ASTNode', 'Blockly.Connection', 'Blockly.ConnectionType', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.BlockCreate', 'Blockly.Events.BlockDelete', 'Blockly.Events.BlockMove', 'Blockly.Extensions', 'Blockly.Input', 'Blockly.Tooltip', 'Blockly.blocks', 'Blockly.common', 'Blockly.constants', 'Blockly.fieldRegistry', 'Blockly.inputTypes', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Size', 'Blockly.utils.idGenerator', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/block.js', ['Blockly.Block'], ['Blockly.ASTNode', 'Blockly.Connection', 'Blockly.ConnectionType', 'Blockly.Events.BlockChange', 'Blockly.Events.BlockCreate', 'Blockly.Events.BlockDelete', 'Blockly.Events.BlockMove', 'Blockly.Events.utils', 'Blockly.Extensions', 'Blockly.Input', 'Blockly.Tooltip', 'Blockly.blocks', 'Blockly.common', 'Blockly.constants', 'Blockly.fieldRegistry', 'Blockly.inputTypes', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Size', 'Blockly.utils.idGenerator', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/block_animations.js', ['Blockly.blockAnimations'], ['Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/block_drag_surface.js', ['Blockly.BlockDragSurfaceSvg'], ['Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/block_dragger.js', ['Blockly.BlockDragger'], ['Blockly.Events', 'Blockly.Events.BlockDrag', 'Blockly.Events.BlockMove', 'Blockly.InsertionMarkerManager', 'Blockly.blockAnimations', 'Blockly.bumpObjects', 'Blockly.common', 'Blockly.registry', 'Blockly.utils.Coordinate', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/block_svg.js', ['Blockly.BlockSvg'], ['Blockly.ASTNode', 'Blockly.Block', 'Blockly.ConnectionType', 'Blockly.ContextMenu', 'Blockly.ContextMenuRegistry', 'Blockly.Events', 'Blockly.Events.BlockMove', 'Blockly.Events.Selected', 'Blockly.FieldLabel', 'Blockly.MarkerManager', 'Blockly.Msg', 'Blockly.RenderedConnection', 'Blockly.TabNavigateCursor', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.blockAnimations', 'Blockly.browserEvents', 'Blockly.common', 'Blockly.constants', 'Blockly.internalConstants', 'Blockly.serialization.blocks', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/blockly.js', ['Blockly'], ['Blockly.ASTNode', 'Blockly.BasicCursor', 'Blockly.Block', 'Blockly.BlockDragSurfaceSvg', 'Blockly.BlockDragger', 'Blockly.BlockSvg', 'Blockly.BlocklyOptions', 'Blockly.Bubble', 'Blockly.BubbleDragger', 'Blockly.CollapsibleToolboxCategory', 'Blockly.Comment', 'Blockly.ComponentManager', 'Blockly.Connection', 'Blockly.ConnectionChecker', 'Blockly.ConnectionDB', 'Blockly.ConnectionType', 'Blockly.ContextMenu', 'Blockly.ContextMenuItems', 'Blockly.ContextMenuRegistry', 'Blockly.Css', 'Blockly.Cursor', 'Blockly.DeleteArea', 'Blockly.DragTarget', 'Blockly.DropDownDiv', 'Blockly.Events.BlockCreate', 'Blockly.Events.FinishedLoading', 'Blockly.Events.Ui', 'Blockly.Events.UiBase', 'Blockly.Events.VarCreate', 'Blockly.Extensions', 'Blockly.Field', 'Blockly.FieldAngle', 'Blockly.FieldCheckbox', 'Blockly.FieldColour', 'Blockly.FieldDropdown', 'Blockly.FieldImage', 'Blockly.FieldLabel', 'Blockly.FieldLabelSerializable', 'Blockly.FieldMultilineInput', 'Blockly.FieldNumber', 'Blockly.FieldTextInput', 'Blockly.FieldVariable', 'Blockly.Flyout', 'Blockly.FlyoutButton', 'Blockly.FlyoutMetricsManager', 'Blockly.Generator', 'Blockly.Gesture', 'Blockly.Grid', 'Blockly.HorizontalFlyout', 'Blockly.IASTNodeLocation', 'Blockly.IASTNodeLocationSvg', 'Blockly.IASTNodeLocationWithBlock', 'Blockly.IAutoHideable', 'Blockly.IBlockDragger', 'Blockly.IBoundedElement', 'Blockly.IBubble', 'Blockly.ICollapsibleToolboxItem', 'Blockly.IComponent', 'Blockly.IConnectionChecker', 'Blockly.IContextMenu', 'Blockly.ICopyable', 'Blockly.IDeletable', 'Blockly.IDeleteArea', 'Blockly.IDragTarget', 'Blockly.IDraggable', 'Blockly.IFlyout', 'Blockly.IKeyboardAccessible', 'Blockly.IMetricsManager', 'Blockly.IMovable', 'Blockly.IPositionable', 'Blockly.IRegistrable', 'Blockly.IRegistrableField', 'Blockly.ISelectable', 'Blockly.ISelectableToolboxItem', 'Blockly.IStyleable', 'Blockly.IToolbox', 'Blockly.IToolboxItem', 'Blockly.Icon', 'Blockly.Input', 'Blockly.InsertionMarkerManager', 'Blockly.Marker', 'Blockly.MarkerManager', 'Blockly.Menu', 'Blockly.MenuItem', 'Blockly.MetricsManager', 'Blockly.Mutator', 'Blockly.Names', 'Blockly.Options', 'Blockly.Procedures', 'Blockly.Procedures', 'Blockly.RenderedConnection', 'Blockly.Scrollbar', 'Blockly.ScrollbarPair', 'Blockly.ShortcutItems', 'Blockly.ShortcutRegistry', 'Blockly.TabNavigateCursor', 'Blockly.Theme', 'Blockly.ThemeManager', 'Blockly.Themes', 'Blockly.Toolbox', 'Blockly.ToolboxCategory', 'Blockly.ToolboxItem', 'Blockly.ToolboxSeparator', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.Touch', 'Blockly.TouchGesture', 'Blockly.Trashcan', 'Blockly.VariableMap', 'Blockly.VariableModel', 'Blockly.Variables', 'Blockly.Variables', 'Blockly.VariablesDynamic', 'Blockly.VerticalFlyout', 'Blockly.Warning', 'Blockly.WidgetDiv', 'Blockly.Workspace', 'Blockly.WorkspaceAudio', 'Blockly.WorkspaceComment', 'Blockly.WorkspaceCommentSvg', 'Blockly.WorkspaceDragSurfaceSvg', 'Blockly.WorkspaceDragger', 'Blockly.WorkspaceSvg', 'Blockly.Xml', 'Blockly.Xml', 'Blockly.ZoomControls', 'Blockly.blockAnimations', 'Blockly.blockRendering', 'Blockly.blocks', 'Blockly.browserEvents', 'Blockly.bumpObjects', 'Blockly.clipboard', 'Blockly.common', 'Blockly.constants', 'Blockly.dialog', 'Blockly.fieldRegistry', 'Blockly.geras', 'Blockly.inject', 'Blockly.inject', 'Blockly.inputTypes', 'Blockly.internalConstants', 'Blockly.minimalist', 'Blockly.registry', 'Blockly.thrasos', 'Blockly.uiPosition', 'Blockly.utils', 'Blockly.utils.Size', 'Blockly.utils.colour', 'Blockly.utils.deprecation', 'Blockly.utils.toolbox', 'Blockly.zelos'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/block_dragger.js', ['Blockly.BlockDragger'], ['Blockly.Events.BlockDrag', 'Blockly.Events.BlockMove', 'Blockly.Events.utils', 'Blockly.InsertionMarkerManager', 'Blockly.blockAnimations', 'Blockly.bumpObjects', 'Blockly.common', 'Blockly.registry', 'Blockly.utils.Coordinate', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/block_svg.js', ['Blockly.BlockSvg'], ['Blockly.ASTNode', 'Blockly.Block', 'Blockly.ConnectionType', 'Blockly.ContextMenu', 'Blockly.ContextMenuRegistry', 'Blockly.Events.BlockMove', 'Blockly.Events.Selected', 'Blockly.Events.utils', 'Blockly.FieldLabel', 'Blockly.MarkerManager', 'Blockly.Msg', 'Blockly.RenderedConnection', 'Blockly.TabNavigateCursor', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.blockAnimations', 'Blockly.browserEvents', 'Blockly.common', 'Blockly.constants', 'Blockly.internalConstants', 'Blockly.serialization.blocks', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/blockly.js', ['Blockly'], ['Blockly.ASTNode', 'Blockly.BasicCursor', 'Blockly.Block', 'Blockly.BlockDragSurfaceSvg', 'Blockly.BlockDragger', 'Blockly.BlockSvg', 'Blockly.BlocklyOptions', 'Blockly.Bubble', 'Blockly.BubbleDragger', 'Blockly.CollapsibleToolboxCategory', 'Blockly.Comment', 'Blockly.ComponentManager', 'Blockly.Connection', 'Blockly.ConnectionChecker', 'Blockly.ConnectionDB', 'Blockly.ConnectionType', 'Blockly.ContextMenu', 'Blockly.ContextMenuItems', 'Blockly.ContextMenuRegistry', 'Blockly.Css', 'Blockly.Cursor', 'Blockly.DeleteArea', 'Blockly.DragTarget', 'Blockly.DropDownDiv', 'Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Events.FinishedLoading', 'Blockly.Events.Ui', 'Blockly.Events.UiBase', 'Blockly.Events.VarCreate', 'Blockly.Extensions', 'Blockly.Field', 'Blockly.FieldAngle', 'Blockly.FieldCheckbox', 'Blockly.FieldColour', 'Blockly.FieldDropdown', 'Blockly.FieldImage', 'Blockly.FieldLabel', 'Blockly.FieldLabelSerializable', 'Blockly.FieldMultilineInput', 'Blockly.FieldNumber', 'Blockly.FieldTextInput', 'Blockly.FieldVariable', 'Blockly.Flyout', 'Blockly.FlyoutButton', 'Blockly.FlyoutMetricsManager', 'Blockly.Generator', 'Blockly.Gesture', 'Blockly.Grid', 'Blockly.HorizontalFlyout', 'Blockly.IASTNodeLocation', 'Blockly.IASTNodeLocationSvg', 'Blockly.IASTNodeLocationWithBlock', 'Blockly.IAutoHideable', 'Blockly.IBlockDragger', 'Blockly.IBoundedElement', 'Blockly.IBubble', 'Blockly.ICollapsibleToolboxItem', 'Blockly.IComponent', 'Blockly.IConnectionChecker', 'Blockly.IContextMenu', 'Blockly.ICopyable', 'Blockly.IDeletable', 'Blockly.IDeleteArea', 'Blockly.IDragTarget', 'Blockly.IDraggable', 'Blockly.IFlyout', 'Blockly.IKeyboardAccessible', 'Blockly.IMetricsManager', 'Blockly.IMovable', 'Blockly.IPositionable', 'Blockly.IRegistrable', 'Blockly.IRegistrableField', 'Blockly.ISelectable', 'Blockly.ISelectableToolboxItem', 'Blockly.IStyleable', 'Blockly.IToolbox', 'Blockly.IToolboxItem', 'Blockly.Icon', 'Blockly.Input', 'Blockly.InsertionMarkerManager', 'Blockly.Marker', 'Blockly.MarkerManager', 'Blockly.Menu', 'Blockly.MenuItem', 'Blockly.MetricsManager', 'Blockly.Mutator', 'Blockly.Names', 'Blockly.Options', 'Blockly.Procedures', 'Blockly.Procedures', 'Blockly.RenderedConnection', 'Blockly.Scrollbar', 'Blockly.ScrollbarPair', 'Blockly.ShortcutItems', 'Blockly.ShortcutRegistry', 'Blockly.TabNavigateCursor', 'Blockly.Theme', 'Blockly.ThemeManager', 'Blockly.Themes', 'Blockly.Toolbox', 'Blockly.ToolboxCategory', 'Blockly.ToolboxItem', 'Blockly.ToolboxSeparator', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.Touch', 'Blockly.TouchGesture', 'Blockly.Trashcan', 'Blockly.VariableMap', 'Blockly.VariableModel', 'Blockly.Variables', 'Blockly.Variables', 'Blockly.VariablesDynamic', 'Blockly.VerticalFlyout', 'Blockly.Warning', 'Blockly.WidgetDiv', 'Blockly.Workspace', 'Blockly.WorkspaceAudio', 'Blockly.WorkspaceComment', 'Blockly.WorkspaceCommentSvg', 'Blockly.WorkspaceDragSurfaceSvg', 'Blockly.WorkspaceDragger', 'Blockly.WorkspaceSvg', 'Blockly.Xml', 'Blockly.Xml', 'Blockly.ZoomControls', 'Blockly.blockAnimations', 'Blockly.blockRendering', 'Blockly.blocks', 'Blockly.browserEvents', 'Blockly.bumpObjects', 'Blockly.clipboard', 'Blockly.common', 'Blockly.constants', 'Blockly.dialog', 'Blockly.fieldRegistry', 'Blockly.geras', 'Blockly.inject', 'Blockly.inject', 'Blockly.inputTypes', 'Blockly.internalConstants', 'Blockly.minimalist', 'Blockly.registry', 'Blockly.thrasos', 'Blockly.uiPosition', 'Blockly.utils', 'Blockly.utils.Size', 'Blockly.utils.colour', 'Blockly.utils.deprecation', 'Blockly.utils.toolbox', 'Blockly.zelos'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/blockly_options.js', ['Blockly.BlocklyOptions'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/blocks.js', ['Blockly.blocks'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/browser_events.js', ['Blockly.browserEvents'], ['Blockly.Touch', 'Blockly.internalConstants', 'Blockly.utils.global', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/bubble.js', ['Blockly.Bubble'], ['Blockly.Scrollbar', 'Blockly.Touch', 'Blockly.Workspace', 'Blockly.browserEvents', 'Blockly.utils.Coordinate', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.math', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/bubble_dragger.js', ['Blockly.BubbleDragger'], ['Blockly.Bubble', 'Blockly.ComponentManager', 'Blockly.Events', 'Blockly.Events.CommentMove', 'Blockly.constants', 'Blockly.utils', 'Blockly.utils.Coordinate'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/bump_objects.js', ['Blockly.bumpObjects'], ['Blockly.Events', 'Blockly.utils.math'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/clipboard.js', ['Blockly.clipboard'], ['Blockly.Events'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/comment.js', ['Blockly.Comment'], ['Blockly.Bubble', 'Blockly.Css', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.BubbleOpen', 'Blockly.Icon', 'Blockly.Warning', 'Blockly.browserEvents', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/bubble_dragger.js', ['Blockly.BubbleDragger'], ['Blockly.Bubble', 'Blockly.ComponentManager', 'Blockly.Events.CommentMove', 'Blockly.Events.utils', 'Blockly.constants', 'Blockly.utils', 'Blockly.utils.Coordinate'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/bump_objects.js', ['Blockly.bumpObjects'], ['Blockly.Events.utils', 'Blockly.utils.math'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/clipboard.js', ['Blockly.clipboard'], ['Blockly.Events.utils'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/comment.js', ['Blockly.Comment'], ['Blockly.Bubble', 'Blockly.Css', 'Blockly.Events.BlockChange', 'Blockly.Events.BubbleOpen', 'Blockly.Events.utils', 'Blockly.Icon', 'Blockly.Warning', 'Blockly.browserEvents', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/common.js', ['Blockly.common'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/component_manager.js', ['Blockly.ComponentManager'], ['Blockly.utils'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/connection.js', ['Blockly.Connection'], ['Blockly.ConnectionType', 'Blockly.Events', 'Blockly.Events.BlockMove', 'Blockly.Xml', 'Blockly.constants', 'Blockly.serialization.blocks', 'Blockly.utils.deprecation'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/connection.js', ['Blockly.Connection'], ['Blockly.ConnectionType', 'Blockly.Events.BlockMove', 'Blockly.Events.utils', 'Blockly.Xml', 'Blockly.constants', 'Blockly.serialization.blocks', 'Blockly.utils.deprecation'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/connection_checker.js', ['Blockly.ConnectionChecker'], ['Blockly.Connection', 'Blockly.ConnectionType', 'Blockly.common', 'Blockly.internalConstants', 'Blockly.registry'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/connection_db.js', ['Blockly.ConnectionDB'], ['Blockly.ConnectionType', 'Blockly.constants'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/connection_type.js', ['Blockly.ConnectionType'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/constants.js', ['Blockly.constants'], [], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/contextmenu.js', ['Blockly.ContextMenu'], ['Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Menu', 'Blockly.MenuItem', 'Blockly.Msg', 'Blockly.WidgetDiv', 'Blockly.Xml', 'Blockly.browserEvents', 'Blockly.clipboard', 'Blockly.internalConstants', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.aria', 'Blockly.utils.deprecation', 'Blockly.utils.dom', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/contextmenu_items.js', ['Blockly.ContextMenuItems'], ['Blockly.ContextMenuRegistry', 'Blockly.Events', 'Blockly.Msg', 'Blockly.clipboard', 'Blockly.dialog', 'Blockly.inputTypes', 'Blockly.utils.idGenerator', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/contextmenu.js', ['Blockly.ContextMenu'], ['Blockly.Events.BlockCreate', 'Blockly.Events.utils', 'Blockly.Menu', 'Blockly.MenuItem', 'Blockly.Msg', 'Blockly.WidgetDiv', 'Blockly.Xml', 'Blockly.browserEvents', 'Blockly.clipboard', 'Blockly.internalConstants', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.aria', 'Blockly.utils.deprecation', 'Blockly.utils.dom', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/contextmenu_items.js', ['Blockly.ContextMenuItems'], ['Blockly.ContextMenuRegistry', 'Blockly.Events.utils', 'Blockly.Msg', 'Blockly.clipboard', 'Blockly.dialog', 'Blockly.inputTypes', 'Blockly.utils.idGenerator', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/contextmenu_registry.js', ['Blockly.ContextMenuRegistry'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/css.js', ['Blockly.Css'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/delete_area.js', ['Blockly.DeleteArea'], ['Blockly.BlockSvg', 'Blockly.DragTarget', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/dialog.js', ['Blockly.dialog'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/drag_target.js', ['Blockly.DragTarget'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/dropdowndiv.js', ['Blockly.DropDownDiv'], ['Blockly.common', 'Blockly.utils.Rect', 'Blockly.utils.dom', 'Blockly.utils.math', 'Blockly.utils.style'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events.js', ['Blockly.Events'], ['Blockly.registry', 'Blockly.utils.deprecation', 'Blockly.utils.idGenerator'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_abstract.js', ['Blockly.Events.Abstract'], ['Blockly.Events'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events.js', ['Blockly.Events'], ['Blockly.Events.Abstract', 'Blockly.Events.BlockBase', 'Blockly.Events.BlockChange', 'Blockly.Events.BlockCreate', 'Blockly.Events.BlockDelete', 'Blockly.Events.BlockDrag', 'Blockly.Events.BlockMove', 'Blockly.Events.BubbleOpen', 'Blockly.Events.Click', 'Blockly.Events.CommentBase', 'Blockly.Events.CommentChange', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove', 'Blockly.Events.FinishedLoading', 'Blockly.Events.MarkerMove', 'Blockly.Events.Selected', 'Blockly.Events.ThemeChange', 'Blockly.Events.ToolboxItemSelect', 'Blockly.Events.TrashcanOpen', 'Blockly.Events.Ui', 'Blockly.Events.UiBase', 'Blockly.Events.VarBase', 'Blockly.Events.VarCreate', 'Blockly.Events.VarDelete', 'Blockly.Events.VarRename', 'Blockly.Events.ViewportChange', 'Blockly.Events.utils', 'Blockly.utils.deprecation'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_abstract.js', ['Blockly.Events.Abstract'], ['Blockly.Events.utils'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/events/events_block_base.js', ['Blockly.Events.BlockBase'], ['Blockly.Events.Abstract', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_block_change.js', ['Blockly.Events.BlockChange'], ['Blockly.Events', 'Blockly.Events.BlockBase', 'Blockly.Xml', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_block_create.js', ['Blockly.Events.BlockCreate'], ['Blockly.Events', 'Blockly.Events.BlockBase', 'Blockly.Xml', 'Blockly.registry', 'Blockly.serialization.blocks', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_block_delete.js', ['Blockly.Events.BlockDelete'], ['Blockly.Events', 'Blockly.Events.BlockBase', 'Blockly.Xml', 'Blockly.registry', 'Blockly.serialization.blocks', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_block_drag.js', ['Blockly.Events.BlockDrag'], ['Blockly.Events', 'Blockly.Events.UiBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_block_move.js', ['Blockly.Events.BlockMove'], ['Blockly.ConnectionType', 'Blockly.Events', 'Blockly.Events.BlockBase', 'Blockly.registry', 'Blockly.utils.Coordinate', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_bubble_open.js', ['Blockly.Events.BubbleOpen'], ['Blockly.Events', 'Blockly.Events.UiBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_click.js', ['Blockly.Events.Click'], ['Blockly.Events', 'Blockly.Events.UiBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_comment_base.js', ['Blockly.Events.CommentBase'], ['Blockly.Events', 'Blockly.Events.Abstract', 'Blockly.Xml', 'Blockly.utils.object', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_comment_change.js', ['Blockly.Events.CommentChange'], ['Blockly.Events', 'Blockly.Events.CommentBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_comment_create.js', ['Blockly.Events.CommentCreate'], ['Blockly.Events', 'Blockly.Events.CommentBase', 'Blockly.Xml', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_comment_delete.js', ['Blockly.Events.CommentDelete'], ['Blockly.Events', 'Blockly.Events.CommentBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_comment_move.js', ['Blockly.Events.CommentMove'], ['Blockly.Events', 'Blockly.Events.CommentBase', 'Blockly.registry', 'Blockly.utils.Coordinate', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_marker_move.js', ['Blockly.Events.MarkerMove'], ['Blockly.ASTNode', 'Blockly.Events', 'Blockly.Events.UiBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_selected.js', ['Blockly.Events.Selected'], ['Blockly.Events', 'Blockly.Events.UiBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_theme_change.js', ['Blockly.Events.ThemeChange'], ['Blockly.Events', 'Blockly.Events.UiBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_toolbox_item_select.js', ['Blockly.Events.ToolboxItemSelect'], ['Blockly.Events', 'Blockly.Events.UiBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_trashcan_open.js', ['Blockly.Events.TrashcanOpen'], ['Blockly.Events', 'Blockly.Events.UiBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_ui.js', ['Blockly.Events.Ui'], ['Blockly.Events', 'Blockly.Events.UiBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_block_change.js', ['Blockly.Events.BlockChange'], ['Blockly.Events.BlockBase', 'Blockly.Events.utils', 'Blockly.Xml', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_block_create.js', ['Blockly.Events.BlockCreate'], ['Blockly.Events.BlockBase', 'Blockly.Events.utils', 'Blockly.Xml', 'Blockly.registry', 'Blockly.serialization.blocks', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_block_delete.js', ['Blockly.Events.BlockDelete'], ['Blockly.Events.BlockBase', 'Blockly.Events.utils', 'Blockly.Xml', 'Blockly.registry', 'Blockly.serialization.blocks', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_block_drag.js', ['Blockly.Events.BlockDrag'], ['Blockly.Events.UiBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_block_move.js', ['Blockly.Events.BlockMove'], ['Blockly.ConnectionType', 'Blockly.Events.BlockBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.Coordinate', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_bubble_open.js', ['Blockly.Events.BubbleOpen'], ['Blockly.Events.UiBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_click.js', ['Blockly.Events.Click'], ['Blockly.Events.UiBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_comment_base.js', ['Blockly.Events.CommentBase'], ['Blockly.Events.Abstract', 'Blockly.Events.utils', 'Blockly.Xml', 'Blockly.utils.object', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_comment_change.js', ['Blockly.Events.CommentChange'], ['Blockly.Events.CommentBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_comment_create.js', ['Blockly.Events.CommentCreate'], ['Blockly.Events.CommentBase', 'Blockly.Events.utils', 'Blockly.Xml', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_comment_delete.js', ['Blockly.Events.CommentDelete'], ['Blockly.Events.CommentBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_comment_move.js', ['Blockly.Events.CommentMove'], ['Blockly.Events.CommentBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.Coordinate', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_marker_move.js', ['Blockly.Events.MarkerMove'], ['Blockly.ASTNode', 'Blockly.Events.UiBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_selected.js', ['Blockly.Events.Selected'], ['Blockly.Events.UiBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_theme_change.js', ['Blockly.Events.ThemeChange'], ['Blockly.Events.UiBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_toolbox_item_select.js', ['Blockly.Events.ToolboxItemSelect'], ['Blockly.Events.UiBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_trashcan_open.js', ['Blockly.Events.TrashcanOpen'], ['Blockly.Events.UiBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_ui.js', ['Blockly.Events.Ui'], ['Blockly.Events.UiBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/events/events_ui_base.js', ['Blockly.Events.UiBase'], ['Blockly.Events.Abstract', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/events/events_var_base.js', ['Blockly.Events.VarBase'], ['Blockly.Events.Abstract', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_var_create.js', ['Blockly.Events.VarCreate'], ['Blockly.Events', 'Blockly.Events.VarBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_var_delete.js', ['Blockly.Events.VarDelete'], ['Blockly.Events', 'Blockly.Events.VarBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_var_rename.js', ['Blockly.Events.VarRename'], ['Blockly.Events', 'Blockly.Events.VarBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_viewport.js', ['Blockly.Events.ViewportChange'], ['Blockly.Events', 'Blockly.Events.UiBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/workspace_events.js', ['Blockly.Events.FinishedLoading'], ['Blockly.Events', 'Blockly.Events.Abstract', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_var_create.js', ['Blockly.Events.VarCreate'], ['Blockly.Events.VarBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_var_delete.js', ['Blockly.Events.VarDelete'], ['Blockly.Events.VarBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_var_rename.js', ['Blockly.Events.VarRename'], ['Blockly.Events.VarBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_viewport.js', ['Blockly.Events.ViewportChange'], ['Blockly.Events.UiBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/utils.js', ['Blockly.Events.utils'], ['Blockly.registry', 'Blockly.utils.idGenerator'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/workspace_events.js', ['Blockly.Events.FinishedLoading'], ['Blockly.Events.Abstract', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/extensions.js', ['Blockly.Extensions'], ['Blockly.utils'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/field.js', ['Blockly.Field'], ['Blockly.DropDownDiv', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Gesture', 'Blockly.MarkerManager', 'Blockly.Tooltip', 'Blockly.WidgetDiv', 'Blockly.Xml', 'Blockly.browserEvents', 'Blockly.utils', 'Blockly.utils.Rect', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.style', 'Blockly.utils.userAgent', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/field.js', ['Blockly.Field'], ['Blockly.DropDownDiv', 'Blockly.Events.BlockChange', 'Blockly.Events.utils', 'Blockly.Gesture', 'Blockly.MarkerManager', 'Blockly.Tooltip', 'Blockly.WidgetDiv', 'Blockly.Xml', 'Blockly.browserEvents', 'Blockly.utils', 'Blockly.utils.Rect', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.style', 'Blockly.utils.userAgent', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/field_angle.js', ['Blockly.FieldAngle'], ['Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.FieldTextInput', 'Blockly.WidgetDiv', 'Blockly.browserEvents', 'Blockly.fieldRegistry', 'Blockly.utils.KeyCodes', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.math', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/field_checkbox.js', ['Blockly.FieldCheckbox'], ['Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.utils.dom', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/field_colour.js', ['Blockly.FieldColour'], ['Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.browserEvents', 'Blockly.fieldRegistry', 'Blockly.utils.KeyCodes', 'Blockly.utils.Size', 'Blockly.utils.aria', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.idGenerator', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); @@ -76,21 +77,21 @@ goog.addDependency('../../core/field_label_serializable.js', ['Blockly.FieldLabe goog.addDependency('../../core/field_multilineinput.js', ['Blockly.FieldMultilineInput'], ['Blockly.Css', 'Blockly.Field', 'Blockly.FieldTextInput', 'Blockly.WidgetDiv', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.KeyCodes', 'Blockly.utils.Svg', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/field_number.js', ['Blockly.FieldNumber'], ['Blockly.FieldTextInput', 'Blockly.fieldRegistry', 'Blockly.utils.aria', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/field_registry.js', ['Blockly.fieldRegistry'], ['Blockly.registry'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/field_textinput.js', ['Blockly.FieldTextInput'], ['Blockly.DropDownDiv', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.Msg', 'Blockly.WidgetDiv', 'Blockly.browserEvents', 'Blockly.dialog', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.KeyCodes', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/field_textinput.js', ['Blockly.FieldTextInput'], ['Blockly.DropDownDiv', 'Blockly.Events.BlockChange', 'Blockly.Events.utils', 'Blockly.Field', 'Blockly.Msg', 'Blockly.WidgetDiv', 'Blockly.browserEvents', 'Blockly.dialog', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.KeyCodes', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/field_variable.js', ['Blockly.FieldVariable'], ['Blockly.Events.BlockChange', 'Blockly.FieldDropdown', 'Blockly.Msg', 'Blockly.VariableModel', 'Blockly.Variables', 'Blockly.Xml', 'Blockly.fieldRegistry', 'Blockly.internalConstants', 'Blockly.utils', 'Blockly.utils.Size', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/flyout_base.js', ['Blockly.Flyout'], ['Blockly.ComponentManager', 'Blockly.DeleteArea', 'Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Events.VarCreate', 'Blockly.FlyoutMetricsManager', 'Blockly.Gesture', 'Blockly.ScrollbarPair', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.Variables', 'Blockly.WorkspaceSvg', 'Blockly.Xml', 'Blockly.blockRendering', 'Blockly.browserEvents', 'Blockly.serialization.blocks', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.idGenerator', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/flyout_base.js', ['Blockly.Flyout'], ['Blockly.ComponentManager', 'Blockly.DeleteArea', 'Blockly.Events.BlockCreate', 'Blockly.Events.VarCreate', 'Blockly.Events.utils', 'Blockly.FlyoutMetricsManager', 'Blockly.Gesture', 'Blockly.ScrollbarPair', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.Variables', 'Blockly.WorkspaceSvg', 'Blockly.Xml', 'Blockly.blockRendering', 'Blockly.browserEvents', 'Blockly.serialization.blocks', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.idGenerator', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/flyout_button.js', ['Blockly.FlyoutButton'], ['Blockly.Css', 'Blockly.browserEvents', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.style'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/flyout_horizontal.js', ['Blockly.HorizontalFlyout'], ['Blockly.DropDownDiv', 'Blockly.Flyout', 'Blockly.Scrollbar', 'Blockly.WidgetDiv', 'Blockly.browserEvents', 'Blockly.registry', 'Blockly.utils.Rect', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/flyout_metrics_manager.js', ['Blockly.FlyoutMetricsManager'], ['Blockly.MetricsManager', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/flyout_vertical.js', ['Blockly.VerticalFlyout'], ['Blockly.Block', 'Blockly.DropDownDiv', 'Blockly.Flyout', 'Blockly.Scrollbar', 'Blockly.WidgetDiv', 'Blockly.browserEvents', 'Blockly.constants', 'Blockly.registry', 'Blockly.utils.Rect', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/generator.js', ['Blockly.Generator'], ['Blockly.common', 'Blockly.internalConstants', 'Blockly.utils.deprecation'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/gesture.js', ['Blockly.Gesture'], ['Blockly.BlockDragger', 'Blockly.BubbleDragger', 'Blockly.Events', 'Blockly.Events.Click', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.Workspace', 'Blockly.WorkspaceDragger', 'Blockly.blockAnimations', 'Blockly.browserEvents', 'Blockly.common', 'Blockly.internalConstants', 'Blockly.registry', 'Blockly.utils.Coordinate'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/gesture.js', ['Blockly.Gesture'], ['Blockly.BlockDragger', 'Blockly.BubbleDragger', 'Blockly.Events.Click', 'Blockly.Events.utils', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.Workspace', 'Blockly.WorkspaceDragger', 'Blockly.blockAnimations', 'Blockly.browserEvents', 'Blockly.common', 'Blockly.internalConstants', 'Blockly.registry', 'Blockly.utils.Coordinate'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/grid.js', ['Blockly.Grid'], ['Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/icon.js', ['Blockly.Icon'], ['Blockly.browserEvents', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/inject.js', ['Blockly.inject'], ['Blockly.BlockDragSurfaceSvg', 'Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.Grid', 'Blockly.Msg', 'Blockly.Options', 'Blockly.ScrollbarPair', 'Blockly.ShortcutRegistry', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.WidgetDiv', 'Blockly.Workspace', 'Blockly.WorkspaceDragSurfaceSvg', 'Blockly.WorkspaceSvg', 'Blockly.browserEvents', 'Blockly.bumpObjects', 'Blockly.common', 'Blockly.utils.Svg', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/input.js', ['Blockly.Input'], ['Blockly.FieldLabel', 'Blockly.constants', 'Blockly.fieldRegistry', 'Blockly.inputTypes'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/input_types.js', ['Blockly.inputTypes'], ['Blockly.ConnectionType'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/insertion_marker_manager.js', ['Blockly.InsertionMarkerManager'], ['Blockly.ComponentManager', 'Blockly.ConnectionType', 'Blockly.Events', 'Blockly.blockAnimations', 'Blockly.common', 'Blockly.constants', 'Blockly.internalConstants'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/insertion_marker_manager.js', ['Blockly.InsertionMarkerManager'], ['Blockly.ComponentManager', 'Blockly.ConnectionType', 'Blockly.Events.utils', 'Blockly.blockAnimations', 'Blockly.common', 'Blockly.constants', 'Blockly.internalConstants'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/interfaces/i_ast_node_location.js', ['Blockly.IASTNodeLocation'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/interfaces/i_ast_node_location_svg.js', ['Blockly.IASTNodeLocationSvg'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/interfaces/i_ast_node_location_with_block.js', ['Blockly.IASTNodeLocationWithBlock'], [], {'lang': 'es6', 'module': 'goog'}); @@ -131,13 +132,13 @@ goog.addDependency('../../core/menu.js', ['Blockly.Menu'], ['Blockly.browserEven goog.addDependency('../../core/menuitem.js', ['Blockly.MenuItem'], ['Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.idGenerator'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/metrics_manager.js', ['Blockly.MetricsManager'], ['Blockly.registry', 'Blockly.utils.Size', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/msg.js', ['Blockly.Msg'], ['Blockly.utils.global'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/mutator.js', ['Blockly.Mutator'], ['Blockly.Bubble', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.BubbleOpen', 'Blockly.Icon', 'Blockly.Options', 'Blockly.WorkspaceSvg', 'Blockly.internalConstants', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/mutator.js', ['Blockly.Mutator'], ['Blockly.Bubble', 'Blockly.Events.BlockChange', 'Blockly.Events.BubbleOpen', 'Blockly.Events.utils', 'Blockly.Icon', 'Blockly.Options', 'Blockly.WorkspaceSvg', 'Blockly.internalConstants', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/names.js', ['Blockly.Names'], ['Blockly.Msg', 'Blockly.Variables', 'Blockly.internalConstants'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/options.js', ['Blockly.Options'], ['Blockly.Theme', 'Blockly.Themes.Classic', 'Blockly.registry', 'Blockly.utils.idGenerator', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/positionable_helpers.js', ['Blockly.uiPosition'], ['Blockly.Scrollbar', 'Blockly.utils.Rect', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/procedures.js', ['Blockly.Procedures'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Msg', 'Blockly.Names', 'Blockly.Variables', 'Blockly.Workspace', 'Blockly.Xml', 'Blockly.blocks', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/procedures.js', ['Blockly.Procedures'], ['Blockly.Events.BlockChange', 'Blockly.Events.utils', 'Blockly.Msg', 'Blockly.Names', 'Blockly.Variables', 'Blockly.Workspace', 'Blockly.Xml', 'Blockly.blocks', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/registry.js', ['Blockly.registry'], [], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/rendered_connection.js', ['Blockly.RenderedConnection'], ['Blockly.Connection', 'Blockly.ConnectionType', 'Blockly.Events', 'Blockly.common', 'Blockly.internalConstants', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Svg', 'Blockly.utils.deprecation', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.svgPaths'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/rendered_connection.js', ['Blockly.RenderedConnection'], ['Blockly.Connection', 'Blockly.ConnectionType', 'Blockly.Events.utils', 'Blockly.common', 'Blockly.internalConstants', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Svg', 'Blockly.utils.deprecation', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.svgPaths'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/renderers/common/block_rendering.js', ['Blockly.blockRendering'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.Connection', 'Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.Debug', 'Blockly.blockRendering.Drawer', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.Field', 'Blockly.blockRendering.Hat', 'Blockly.blockRendering.IPathObject', 'Blockly.blockRendering.Icon', 'Blockly.blockRendering.InRowSpacer', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InputConnection', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.JaggedEdge', 'Blockly.blockRendering.MarkerSvg', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PathObject', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Renderer', 'Blockly.blockRendering.RoundCorner', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.SquareCorner', 'Blockly.blockRendering.StatementInput', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.blockRendering.debug', 'Blockly.registry', 'Blockly.utils.deprecation'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/renderers/common/constants.js', ['Blockly.blockRendering.ConstantProvider'], ['Blockly.ConnectionType', 'Blockly.utils', 'Blockly.utils.Svg', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.svgPaths', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/renderers/common/debug.js', ['Blockly.blockRendering.debug'], [], {'lang': 'es6', 'module': 'goog'}); @@ -145,7 +146,7 @@ goog.addDependency('../../core/renderers/common/debugger.js', ['Blockly.blockRen goog.addDependency('../../core/renderers/common/drawer.js', ['Blockly.blockRendering.Drawer'], ['Blockly.blockRendering.Types', 'Blockly.blockRendering.debug', 'Blockly.utils.svgPaths'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/renderers/common/i_path_object.js', ['Blockly.blockRendering.IPathObject'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/renderers/common/info.js', ['Blockly.blockRendering.RenderInfo'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.Field', 'Blockly.blockRendering.Hat', 'Blockly.blockRendering.Icon', 'Blockly.blockRendering.InRowSpacer', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.JaggedEdge', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RoundCorner', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.SquareCorner', 'Blockly.blockRendering.StatementInput', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.constants', 'Blockly.inputTypes'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/renderers/common/marker_svg.js', ['Blockly.blockRendering.MarkerSvg'], ['Blockly.ASTNode', 'Blockly.ConnectionType', 'Blockly.Events', 'Blockly.Events.MarkerMove', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.svgPaths'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/renderers/common/marker_svg.js', ['Blockly.blockRendering.MarkerSvg'], ['Blockly.ASTNode', 'Blockly.ConnectionType', 'Blockly.Events.MarkerMove', 'Blockly.Events.utils', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.svgPaths'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/renderers/common/path_object.js', ['Blockly.blockRendering.PathObject'], ['Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/renderers/common/renderer.js', ['Blockly.blockRendering.Renderer'], ['Blockly.Connection', 'Blockly.ConnectionType', 'Blockly.InsertionMarkerManager', 'Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.Drawer', 'Blockly.blockRendering.MarkerSvg', 'Blockly.blockRendering.PathObject', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.debug', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/renderers/geras/constants.js', ['Blockly.geras.ConstantProvider'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); @@ -201,13 +202,13 @@ goog.addDependency('../../core/renderers/zelos/renderer.js', ['Blockly.zelos.Ren goog.addDependency('../../core/renderers/zelos/zelos.js', ['Blockly.zelos'], ['Blockly.zelos.BottomRow', 'Blockly.zelos.ConstantProvider', 'Blockly.zelos.Drawer', 'Blockly.zelos.MarkerSvg', 'Blockly.zelos.PathObject', 'Blockly.zelos.RenderInfo', 'Blockly.zelos.Renderer', 'Blockly.zelos.RightConnectionShape', 'Blockly.zelos.StatementInput', 'Blockly.zelos.TopRow'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/requires.js', ['Blockly.requires'], ['Blockly', 'Blockly.Comment', 'Blockly.ContextMenuItems', 'Blockly.FieldAngle', 'Blockly.FieldCheckbox', 'Blockly.FieldColour', 'Blockly.FieldDropdown', 'Blockly.FieldImage', 'Blockly.FieldLabelSerializable', 'Blockly.FieldMultilineInput', 'Blockly.FieldNumber', 'Blockly.FieldTextInput', 'Blockly.FieldVariable', 'Blockly.FlyoutButton', 'Blockly.Generator', 'Blockly.HorizontalFlyout', 'Blockly.Mutator', 'Blockly.ShortcutItems', 'Blockly.Themes.Classic', 'Blockly.Toolbox', 'Blockly.Trashcan', 'Blockly.VariablesDynamic', 'Blockly.VerticalFlyout', 'Blockly.Warning', 'Blockly.ZoomControls', 'Blockly.geras.Renderer', 'Blockly.serialization.blocks', 'Blockly.serialization.registry', 'Blockly.serialization.variables', 'Blockly.serialization.workspaces', 'Blockly.thrasos.Renderer', 'Blockly.zelos.Renderer']); goog.addDependency('../../core/scrollbar.js', ['Blockly.Scrollbar'], ['Blockly.Touch', 'Blockly.browserEvents', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/scrollbar_pair.js', ['Blockly.ScrollbarPair'], ['Blockly.Events', 'Blockly.Scrollbar', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/serialization/blocks.js', ['Blockly.serialization.blocks'], ['Blockly.Events', 'Blockly.Xml', 'Blockly.inputTypes', 'Blockly.serialization.ISerializer', 'Blockly.serialization.exceptions', 'Blockly.serialization.priorities', 'Blockly.serialization.registry', 'Blockly.utils.Size'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/scrollbar_pair.js', ['Blockly.ScrollbarPair'], ['Blockly.Events.utils', 'Blockly.Scrollbar', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/serialization/blocks.js', ['Blockly.serialization.blocks'], ['Blockly.Events.utils', 'Blockly.Xml', 'Blockly.inputTypes', 'Blockly.serialization.ISerializer', 'Blockly.serialization.exceptions', 'Blockly.serialization.priorities', 'Blockly.serialization.registry', 'Blockly.utils.Size'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/serialization/exceptions.js', ['Blockly.serialization.exceptions'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/serialization/priorities.js', ['Blockly.serialization.priorities'], [], {'module': 'goog'}); goog.addDependency('../../core/serialization/registry.js', ['Blockly.serialization.registry'], ['Blockly.registry'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/serialization/variables.js', ['Blockly.serialization.variables'], ['Blockly.serialization.ISerializer', 'Blockly.serialization.priorities', 'Blockly.serialization.registry'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/serialization/workspaces.js', ['Blockly.serialization.workspaces'], ['Blockly.Events', 'Blockly.Workspace', 'Blockly.registry', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/serialization/workspaces.js', ['Blockly.serialization.workspaces'], ['Blockly.Events.utils', 'Blockly.Workspace', 'Blockly.registry', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/shortcut_items.js', ['Blockly.ShortcutItems'], ['Blockly.Gesture', 'Blockly.ShortcutRegistry', 'Blockly.clipboard', 'Blockly.common', 'Blockly.utils.KeyCodes'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/shortcut_registry.js', ['Blockly.ShortcutRegistry'], ['Blockly.utils.KeyCodes', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/theme.js', ['Blockly.Theme'], ['Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); @@ -218,12 +219,12 @@ goog.addDependency('../../core/theme_manager.js', ['Blockly.ThemeManager'], ['Bl goog.addDependency('../../core/toolbox/category.js', ['Blockly.ToolboxCategory'], ['Blockly.Css', 'Blockly.ToolboxItem', 'Blockly.registry', 'Blockly.utils', 'Blockly.utils.aria', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/toolbox/collapsible_category.js', ['Blockly.CollapsibleToolboxCategory'], ['Blockly.ToolboxCategory', 'Blockly.ToolboxSeparator', 'Blockly.registry', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/toolbox/separator.js', ['Blockly.ToolboxSeparator'], ['Blockly.Css', 'Blockly.ToolboxItem', 'Blockly.registry', 'Blockly.utils.dom', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/toolbox/toolbox.js', ['Blockly.Toolbox'], ['Blockly.BlockSvg', 'Blockly.CollapsibleToolboxCategory', 'Blockly.ComponentManager', 'Blockly.Css', 'Blockly.DeleteArea', 'Blockly.Events', 'Blockly.Events.ToolboxItemSelect', 'Blockly.Options', 'Blockly.Touch', 'Blockly.browserEvents', 'Blockly.common', 'Blockly.registry', 'Blockly.utils.KeyCodes', 'Blockly.utils.Rect', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/toolbox/toolbox.js', ['Blockly.Toolbox'], ['Blockly.BlockSvg', 'Blockly.CollapsibleToolboxCategory', 'Blockly.ComponentManager', 'Blockly.Css', 'Blockly.DeleteArea', 'Blockly.Events.ToolboxItemSelect', 'Blockly.Events.utils', 'Blockly.Options', 'Blockly.Touch', 'Blockly.browserEvents', 'Blockly.common', 'Blockly.registry', 'Blockly.utils.KeyCodes', 'Blockly.utils.Rect', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/toolbox/toolbox_item.js', ['Blockly.ToolboxItem'], ['Blockly.utils.idGenerator'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/tooltip.js', ['Blockly.Tooltip'], ['Blockly.browserEvents', 'Blockly.common', 'Blockly.utils.deprecation', 'Blockly.utils.string'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/touch.js', ['Blockly.Touch'], ['Blockly.internalConstants', 'Blockly.utils.global', 'Blockly.utils.string'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/touch_gesture.js', ['Blockly.TouchGesture'], ['Blockly.Gesture', 'Blockly.Touch', 'Blockly.browserEvents', 'Blockly.utils.Coordinate', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/trashcan.js', ['Blockly.Trashcan'], ['Blockly.ComponentManager', 'Blockly.DeleteArea', 'Blockly.Events', 'Blockly.Events.TrashcanOpen', 'Blockly.Options', 'Blockly.browserEvents', 'Blockly.internalConstants', 'Blockly.registry', 'Blockly.uiPosition', 'Blockly.utils.Rect', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/trashcan.js', ['Blockly.Trashcan'], ['Blockly.ComponentManager', 'Blockly.DeleteArea', 'Blockly.Events.TrashcanOpen', 'Blockly.Events.utils', 'Blockly.Options', 'Blockly.browserEvents', 'Blockly.internalConstants', 'Blockly.registry', 'Blockly.uiPosition', 'Blockly.utils.Rect', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/utils.js', ['Blockly.utils'], ['Blockly.Msg', 'Blockly.browserEvents', 'Blockly.internalConstants', 'Blockly.utils.Coordinate', 'Blockly.utils.KeyCodes', 'Blockly.utils.Metrics', 'Blockly.utils.Rect', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.aria', 'Blockly.utils.colour', 'Blockly.utils.deprecation', 'Blockly.utils.dom', 'Blockly.utils.global', 'Blockly.utils.idGenerator', 'Blockly.utils.math', 'Blockly.utils.object', 'Blockly.utils.string', 'Blockly.utils.style', 'Blockly.utils.svgPaths', 'Blockly.utils.toolbox', 'Blockly.utils.userAgent', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/utils/aria.js', ['Blockly.utils.aria'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/utils/colour.js', ['Blockly.utils.colour'], ['Blockly.internalConstants'], {'lang': 'es6', 'module': 'goog'}); @@ -245,20 +246,20 @@ goog.addDependency('../../core/utils/svg_paths.js', ['Blockly.utils.svgPaths'], goog.addDependency('../../core/utils/toolbox.js', ['Blockly.utils.toolbox'], ['Blockly.Xml', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/utils/useragent.js', ['Blockly.utils.userAgent'], ['Blockly.utils.global'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/utils/xml.js', ['Blockly.utils.xml'], ['Blockly.utils.global'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/variable_map.js', ['Blockly.VariableMap'], ['Blockly.Events', 'Blockly.Events.VarDelete', 'Blockly.Events.VarRename', 'Blockly.Msg', 'Blockly.Names', 'Blockly.VariableModel', 'Blockly.dialog', 'Blockly.utils', 'Blockly.utils.idGenerator', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/variable_model.js', ['Blockly.VariableModel'], ['Blockly.Events', 'Blockly.Events.VarCreate', 'Blockly.utils.idGenerator'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/variable_map.js', ['Blockly.VariableMap'], ['Blockly.Events.VarDelete', 'Blockly.Events.VarRename', 'Blockly.Events.utils', 'Blockly.Msg', 'Blockly.Names', 'Blockly.VariableModel', 'Blockly.dialog', 'Blockly.utils', 'Blockly.utils.idGenerator', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/variable_model.js', ['Blockly.VariableModel'], ['Blockly.Events.VarCreate', 'Blockly.Events.utils', 'Blockly.utils.idGenerator'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/variables.js', ['Blockly.Variables'], ['Blockly.Msg', 'Blockly.VariableModel', 'Blockly.Xml', 'Blockly.blocks', 'Blockly.dialog', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/variables_dynamic.js', ['Blockly.VariablesDynamic'], ['Blockly.Msg', 'Blockly.VariableModel', 'Blockly.Variables', 'Blockly.blocks', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/warning.js', ['Blockly.Warning'], ['Blockly.Bubble', 'Blockly.Events', 'Blockly.Events.BubbleOpen', 'Blockly.Icon', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/warning.js', ['Blockly.Warning'], ['Blockly.Bubble', 'Blockly.Events.BubbleOpen', 'Blockly.Events.utils', 'Blockly.Icon', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/widgetdiv.js', ['Blockly.WidgetDiv'], ['Blockly.common', 'Blockly.utils.deprecation', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/workspace.js', ['Blockly.Workspace'], ['Blockly.ConnectionChecker', 'Blockly.Events', 'Blockly.Options', 'Blockly.VariableMap', 'Blockly.registry', 'Blockly.utils', 'Blockly.utils.idGenerator', 'Blockly.utils.math'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/workspace.js', ['Blockly.Workspace'], ['Blockly.ConnectionChecker', 'Blockly.Events.utils', 'Blockly.Options', 'Blockly.VariableMap', 'Blockly.registry', 'Blockly.utils', 'Blockly.utils.idGenerator', 'Blockly.utils.math'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/workspace_audio.js', ['Blockly.WorkspaceAudio'], ['Blockly.internalConstants', 'Blockly.utils.global', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/workspace_comment.js', ['Blockly.WorkspaceComment'], ['Blockly.Events', 'Blockly.Events.CommentChange', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove', 'Blockly.utils.Coordinate', 'Blockly.utils.idGenerator', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/workspace_comment_svg.js', ['Blockly.WorkspaceCommentSvg'], ['Blockly.ContextMenu', 'Blockly.Css', 'Blockly.Events', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove', 'Blockly.Events.Selected', 'Blockly.Touch', 'Blockly.WorkspaceComment', 'Blockly.browserEvents', 'Blockly.common', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/workspace_comment.js', ['Blockly.WorkspaceComment'], ['Blockly.Events.CommentChange', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove', 'Blockly.Events.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.idGenerator', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/workspace_comment_svg.js', ['Blockly.WorkspaceCommentSvg'], ['Blockly.ContextMenu', 'Blockly.Css', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove', 'Blockly.Events.Selected', 'Blockly.Events.utils', 'Blockly.Touch', 'Blockly.WorkspaceComment', 'Blockly.browserEvents', 'Blockly.common', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/workspace_drag_surface_svg.js', ['Blockly.WorkspaceDragSurfaceSvg'], ['Blockly.utils', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/workspace_dragger.js', ['Blockly.WorkspaceDragger'], ['Blockly.common', 'Blockly.utils.Coordinate'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/workspace_svg.js', ['Blockly.WorkspaceSvg'], ['Blockly.BlockSvg', 'Blockly.ComponentManager', 'Blockly.ConnectionDB', 'Blockly.ContextMenu', 'Blockly.ContextMenuRegistry', 'Blockly.DropDownDiv', 'Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Events.ThemeChange', 'Blockly.Events.ViewportChange', 'Blockly.Gesture', 'Blockly.Grid', 'Blockly.MarkerManager', 'Blockly.MetricsManager', 'Blockly.Msg', 'Blockly.Options', 'Blockly.ThemeManager', 'Blockly.Themes.Classic', 'Blockly.Tooltip', 'Blockly.TouchGesture', 'Blockly.WidgetDiv', 'Blockly.Workspace', 'Blockly.WorkspaceAudio', 'Blockly.Xml', 'Blockly.blockRendering', 'Blockly.browserEvents', 'Blockly.common', 'Blockly.internalConstants', 'Blockly.registry', 'Blockly.serialization.blocks', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/xml.js', ['Blockly.Xml'], ['Blockly.Events', 'Blockly.inputTypes', 'Blockly.utils.Size', 'Blockly.utils.dom', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/zoom_controls.js', ['Blockly.ZoomControls'], ['Blockly.ComponentManager', 'Blockly.Css', 'Blockly.Events', 'Blockly.Events.Click', 'Blockly.Touch', 'Blockly.browserEvents', 'Blockly.internalConstants', 'Blockly.uiPosition', 'Blockly.utils.Rect', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/workspace_svg.js', ['Blockly.WorkspaceSvg'], ['Blockly.BlockSvg', 'Blockly.ComponentManager', 'Blockly.ConnectionDB', 'Blockly.ContextMenu', 'Blockly.ContextMenuRegistry', 'Blockly.DropDownDiv', 'Blockly.Events.BlockCreate', 'Blockly.Events.ThemeChange', 'Blockly.Events.ViewportChange', 'Blockly.Events.utils', 'Blockly.Gesture', 'Blockly.Grid', 'Blockly.MarkerManager', 'Blockly.MetricsManager', 'Blockly.Msg', 'Blockly.Options', 'Blockly.ThemeManager', 'Blockly.Themes.Classic', 'Blockly.Tooltip', 'Blockly.TouchGesture', 'Blockly.WidgetDiv', 'Blockly.Workspace', 'Blockly.WorkspaceAudio', 'Blockly.Xml', 'Blockly.blockRendering', 'Blockly.browserEvents', 'Blockly.common', 'Blockly.internalConstants', 'Blockly.registry', 'Blockly.serialization.blocks', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/xml.js', ['Blockly.Xml'], ['Blockly.Events.utils', 'Blockly.inputTypes', 'Blockly.utils.Size', 'Blockly.utils.dom', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/zoom_controls.js', ['Blockly.ZoomControls'], ['Blockly.ComponentManager', 'Blockly.Css', 'Blockly.Events.Click', 'Blockly.Events.utils', 'Blockly.Touch', 'Blockly.browserEvents', 'Blockly.internalConstants', 'Blockly.uiPosition', 'Blockly.utils.Rect', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('base.js', [], []); diff --git a/tests/deps.mocha.js b/tests/deps.mocha.js index 7784cd000..23ffa5d68 100644 --- a/tests/deps.mocha.js +++ b/tests/deps.mocha.js @@ -7,65 +7,66 @@ goog.addDependency('../../blocks/procedures.js', ['Blockly.Blocks.procedures'], goog.addDependency('../../blocks/text.js', ['Blockly.Blocks.texts', 'Blockly.Constants.Text'], ['Blockly', 'Blockly.FieldDropdown', 'Blockly.FieldImage', 'Blockly.FieldMultilineInput', 'Blockly.FieldTextInput', 'Blockly.FieldVariable', 'Blockly.Mutator'], {'lang': 'es5'}); goog.addDependency('../../blocks/variables.js', ['Blockly.Blocks.variables', 'Blockly.Constants.Variables'], ['Blockly', 'Blockly.FieldLabel', 'Blockly.FieldVariable']); goog.addDependency('../../blocks/variables_dynamic.js', ['Blockly.Constants.VariablesDynamic'], ['Blockly', 'Blockly.FieldLabel', 'Blockly.FieldVariable']); -goog.addDependency('../../core/block.js', ['Blockly.Block'], ['Blockly.ASTNode', 'Blockly.Connection', 'Blockly.ConnectionType', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.BlockCreate', 'Blockly.Events.BlockDelete', 'Blockly.Events.BlockMove', 'Blockly.Extensions', 'Blockly.Input', 'Blockly.Tooltip', 'Blockly.blocks', 'Blockly.common', 'Blockly.constants', 'Blockly.fieldRegistry', 'Blockly.inputTypes', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Size', 'Blockly.utils.idGenerator', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/block.js', ['Blockly.Block'], ['Blockly.ASTNode', 'Blockly.Connection', 'Blockly.ConnectionType', 'Blockly.Events.BlockChange', 'Blockly.Events.BlockCreate', 'Blockly.Events.BlockDelete', 'Blockly.Events.BlockMove', 'Blockly.Events.utils', 'Blockly.Extensions', 'Blockly.Input', 'Blockly.Tooltip', 'Blockly.blocks', 'Blockly.common', 'Blockly.constants', 'Blockly.fieldRegistry', 'Blockly.inputTypes', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Size', 'Blockly.utils.idGenerator', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/block_animations.js', ['Blockly.blockAnimations'], ['Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/block_drag_surface.js', ['Blockly.BlockDragSurfaceSvg'], ['Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/block_dragger.js', ['Blockly.BlockDragger'], ['Blockly.Events', 'Blockly.Events.BlockDrag', 'Blockly.Events.BlockMove', 'Blockly.InsertionMarkerManager', 'Blockly.blockAnimations', 'Blockly.bumpObjects', 'Blockly.common', 'Blockly.registry', 'Blockly.utils.Coordinate', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/block_svg.js', ['Blockly.BlockSvg'], ['Blockly.ASTNode', 'Blockly.Block', 'Blockly.ConnectionType', 'Blockly.ContextMenu', 'Blockly.ContextMenuRegistry', 'Blockly.Events', 'Blockly.Events.BlockMove', 'Blockly.Events.Selected', 'Blockly.FieldLabel', 'Blockly.MarkerManager', 'Blockly.Msg', 'Blockly.RenderedConnection', 'Blockly.TabNavigateCursor', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.blockAnimations', 'Blockly.browserEvents', 'Blockly.common', 'Blockly.constants', 'Blockly.internalConstants', 'Blockly.serialization.blocks', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/blockly.js', ['Blockly'], ['Blockly.ASTNode', 'Blockly.BasicCursor', 'Blockly.Block', 'Blockly.BlockDragSurfaceSvg', 'Blockly.BlockDragger', 'Blockly.BlockSvg', 'Blockly.BlocklyOptions', 'Blockly.Bubble', 'Blockly.BubbleDragger', 'Blockly.CollapsibleToolboxCategory', 'Blockly.Comment', 'Blockly.ComponentManager', 'Blockly.Connection', 'Blockly.ConnectionChecker', 'Blockly.ConnectionDB', 'Blockly.ConnectionType', 'Blockly.ContextMenu', 'Blockly.ContextMenuItems', 'Blockly.ContextMenuRegistry', 'Blockly.Css', 'Blockly.Cursor', 'Blockly.DeleteArea', 'Blockly.DragTarget', 'Blockly.DropDownDiv', 'Blockly.Events.BlockCreate', 'Blockly.Events.FinishedLoading', 'Blockly.Events.Ui', 'Blockly.Events.UiBase', 'Blockly.Events.VarCreate', 'Blockly.Extensions', 'Blockly.Field', 'Blockly.FieldAngle', 'Blockly.FieldCheckbox', 'Blockly.FieldColour', 'Blockly.FieldDropdown', 'Blockly.FieldImage', 'Blockly.FieldLabel', 'Blockly.FieldLabelSerializable', 'Blockly.FieldMultilineInput', 'Blockly.FieldNumber', 'Blockly.FieldTextInput', 'Blockly.FieldVariable', 'Blockly.Flyout', 'Blockly.FlyoutButton', 'Blockly.FlyoutMetricsManager', 'Blockly.Generator', 'Blockly.Gesture', 'Blockly.Grid', 'Blockly.HorizontalFlyout', 'Blockly.IASTNodeLocation', 'Blockly.IASTNodeLocationSvg', 'Blockly.IASTNodeLocationWithBlock', 'Blockly.IAutoHideable', 'Blockly.IBlockDragger', 'Blockly.IBoundedElement', 'Blockly.IBubble', 'Blockly.ICollapsibleToolboxItem', 'Blockly.IComponent', 'Blockly.IConnectionChecker', 'Blockly.IContextMenu', 'Blockly.ICopyable', 'Blockly.IDeletable', 'Blockly.IDeleteArea', 'Blockly.IDragTarget', 'Blockly.IDraggable', 'Blockly.IFlyout', 'Blockly.IKeyboardAccessible', 'Blockly.IMetricsManager', 'Blockly.IMovable', 'Blockly.IPositionable', 'Blockly.IRegistrable', 'Blockly.IRegistrableField', 'Blockly.ISelectable', 'Blockly.ISelectableToolboxItem', 'Blockly.IStyleable', 'Blockly.IToolbox', 'Blockly.IToolboxItem', 'Blockly.Icon', 'Blockly.Input', 'Blockly.InsertionMarkerManager', 'Blockly.Marker', 'Blockly.MarkerManager', 'Blockly.Menu', 'Blockly.MenuItem', 'Blockly.MetricsManager', 'Blockly.Mutator', 'Blockly.Names', 'Blockly.Options', 'Blockly.Procedures', 'Blockly.Procedures', 'Blockly.RenderedConnection', 'Blockly.Scrollbar', 'Blockly.ScrollbarPair', 'Blockly.ShortcutItems', 'Blockly.ShortcutRegistry', 'Blockly.TabNavigateCursor', 'Blockly.Theme', 'Blockly.ThemeManager', 'Blockly.Themes', 'Blockly.Toolbox', 'Blockly.ToolboxCategory', 'Blockly.ToolboxItem', 'Blockly.ToolboxSeparator', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.Touch', 'Blockly.TouchGesture', 'Blockly.Trashcan', 'Blockly.VariableMap', 'Blockly.VariableModel', 'Blockly.Variables', 'Blockly.Variables', 'Blockly.VariablesDynamic', 'Blockly.VerticalFlyout', 'Blockly.Warning', 'Blockly.WidgetDiv', 'Blockly.Workspace', 'Blockly.WorkspaceAudio', 'Blockly.WorkspaceComment', 'Blockly.WorkspaceCommentSvg', 'Blockly.WorkspaceDragSurfaceSvg', 'Blockly.WorkspaceDragger', 'Blockly.WorkspaceSvg', 'Blockly.Xml', 'Blockly.Xml', 'Blockly.ZoomControls', 'Blockly.blockAnimations', 'Blockly.blockRendering', 'Blockly.blocks', 'Blockly.browserEvents', 'Blockly.bumpObjects', 'Blockly.clipboard', 'Blockly.common', 'Blockly.constants', 'Blockly.dialog', 'Blockly.fieldRegistry', 'Blockly.geras', 'Blockly.inject', 'Blockly.inject', 'Blockly.inputTypes', 'Blockly.internalConstants', 'Blockly.minimalist', 'Blockly.registry', 'Blockly.thrasos', 'Blockly.uiPosition', 'Blockly.utils', 'Blockly.utils.Size', 'Blockly.utils.colour', 'Blockly.utils.deprecation', 'Blockly.utils.toolbox', 'Blockly.zelos'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/block_dragger.js', ['Blockly.BlockDragger'], ['Blockly.Events.BlockDrag', 'Blockly.Events.BlockMove', 'Blockly.Events.utils', 'Blockly.InsertionMarkerManager', 'Blockly.blockAnimations', 'Blockly.bumpObjects', 'Blockly.common', 'Blockly.registry', 'Blockly.utils.Coordinate', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/block_svg.js', ['Blockly.BlockSvg'], ['Blockly.ASTNode', 'Blockly.Block', 'Blockly.ConnectionType', 'Blockly.ContextMenu', 'Blockly.ContextMenuRegistry', 'Blockly.Events.BlockMove', 'Blockly.Events.Selected', 'Blockly.Events.utils', 'Blockly.FieldLabel', 'Blockly.MarkerManager', 'Blockly.Msg', 'Blockly.RenderedConnection', 'Blockly.TabNavigateCursor', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.blockAnimations', 'Blockly.browserEvents', 'Blockly.common', 'Blockly.constants', 'Blockly.internalConstants', 'Blockly.serialization.blocks', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/blockly.js', ['Blockly'], ['Blockly.ASTNode', 'Blockly.BasicCursor', 'Blockly.Block', 'Blockly.BlockDragSurfaceSvg', 'Blockly.BlockDragger', 'Blockly.BlockSvg', 'Blockly.BlocklyOptions', 'Blockly.Bubble', 'Blockly.BubbleDragger', 'Blockly.CollapsibleToolboxCategory', 'Blockly.Comment', 'Blockly.ComponentManager', 'Blockly.Connection', 'Blockly.ConnectionChecker', 'Blockly.ConnectionDB', 'Blockly.ConnectionType', 'Blockly.ContextMenu', 'Blockly.ContextMenuItems', 'Blockly.ContextMenuRegistry', 'Blockly.Css', 'Blockly.Cursor', 'Blockly.DeleteArea', 'Blockly.DragTarget', 'Blockly.DropDownDiv', 'Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Events.FinishedLoading', 'Blockly.Events.Ui', 'Blockly.Events.UiBase', 'Blockly.Events.VarCreate', 'Blockly.Extensions', 'Blockly.Field', 'Blockly.FieldAngle', 'Blockly.FieldCheckbox', 'Blockly.FieldColour', 'Blockly.FieldDropdown', 'Blockly.FieldImage', 'Blockly.FieldLabel', 'Blockly.FieldLabelSerializable', 'Blockly.FieldMultilineInput', 'Blockly.FieldNumber', 'Blockly.FieldTextInput', 'Blockly.FieldVariable', 'Blockly.Flyout', 'Blockly.FlyoutButton', 'Blockly.FlyoutMetricsManager', 'Blockly.Generator', 'Blockly.Gesture', 'Blockly.Grid', 'Blockly.HorizontalFlyout', 'Blockly.IASTNodeLocation', 'Blockly.IASTNodeLocationSvg', 'Blockly.IASTNodeLocationWithBlock', 'Blockly.IAutoHideable', 'Blockly.IBlockDragger', 'Blockly.IBoundedElement', 'Blockly.IBubble', 'Blockly.ICollapsibleToolboxItem', 'Blockly.IComponent', 'Blockly.IConnectionChecker', 'Blockly.IContextMenu', 'Blockly.ICopyable', 'Blockly.IDeletable', 'Blockly.IDeleteArea', 'Blockly.IDragTarget', 'Blockly.IDraggable', 'Blockly.IFlyout', 'Blockly.IKeyboardAccessible', 'Blockly.IMetricsManager', 'Blockly.IMovable', 'Blockly.IPositionable', 'Blockly.IRegistrable', 'Blockly.IRegistrableField', 'Blockly.ISelectable', 'Blockly.ISelectableToolboxItem', 'Blockly.IStyleable', 'Blockly.IToolbox', 'Blockly.IToolboxItem', 'Blockly.Icon', 'Blockly.Input', 'Blockly.InsertionMarkerManager', 'Blockly.Marker', 'Blockly.MarkerManager', 'Blockly.Menu', 'Blockly.MenuItem', 'Blockly.MetricsManager', 'Blockly.Mutator', 'Blockly.Names', 'Blockly.Options', 'Blockly.Procedures', 'Blockly.Procedures', 'Blockly.RenderedConnection', 'Blockly.Scrollbar', 'Blockly.ScrollbarPair', 'Blockly.ShortcutItems', 'Blockly.ShortcutRegistry', 'Blockly.TabNavigateCursor', 'Blockly.Theme', 'Blockly.ThemeManager', 'Blockly.Themes', 'Blockly.Toolbox', 'Blockly.ToolboxCategory', 'Blockly.ToolboxItem', 'Blockly.ToolboxSeparator', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.Touch', 'Blockly.TouchGesture', 'Blockly.Trashcan', 'Blockly.VariableMap', 'Blockly.VariableModel', 'Blockly.Variables', 'Blockly.Variables', 'Blockly.VariablesDynamic', 'Blockly.VerticalFlyout', 'Blockly.Warning', 'Blockly.WidgetDiv', 'Blockly.Workspace', 'Blockly.WorkspaceAudio', 'Blockly.WorkspaceComment', 'Blockly.WorkspaceCommentSvg', 'Blockly.WorkspaceDragSurfaceSvg', 'Blockly.WorkspaceDragger', 'Blockly.WorkspaceSvg', 'Blockly.Xml', 'Blockly.Xml', 'Blockly.ZoomControls', 'Blockly.blockAnimations', 'Blockly.blockRendering', 'Blockly.blocks', 'Blockly.browserEvents', 'Blockly.bumpObjects', 'Blockly.clipboard', 'Blockly.common', 'Blockly.constants', 'Blockly.dialog', 'Blockly.fieldRegistry', 'Blockly.geras', 'Blockly.inject', 'Blockly.inject', 'Blockly.inputTypes', 'Blockly.internalConstants', 'Blockly.minimalist', 'Blockly.registry', 'Blockly.thrasos', 'Blockly.uiPosition', 'Blockly.utils', 'Blockly.utils.Size', 'Blockly.utils.colour', 'Blockly.utils.deprecation', 'Blockly.utils.toolbox', 'Blockly.zelos'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/blockly_options.js', ['Blockly.BlocklyOptions'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/blocks.js', ['Blockly.blocks'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/browser_events.js', ['Blockly.browserEvents'], ['Blockly.Touch', 'Blockly.internalConstants', 'Blockly.utils.global', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/bubble.js', ['Blockly.Bubble'], ['Blockly.Scrollbar', 'Blockly.Touch', 'Blockly.Workspace', 'Blockly.browserEvents', 'Blockly.utils.Coordinate', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.math', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/bubble_dragger.js', ['Blockly.BubbleDragger'], ['Blockly.Bubble', 'Blockly.ComponentManager', 'Blockly.Events', 'Blockly.Events.CommentMove', 'Blockly.constants', 'Blockly.utils', 'Blockly.utils.Coordinate'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/bump_objects.js', ['Blockly.bumpObjects'], ['Blockly.Events', 'Blockly.utils.math'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/clipboard.js', ['Blockly.clipboard'], ['Blockly.Events'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/comment.js', ['Blockly.Comment'], ['Blockly.Bubble', 'Blockly.Css', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.BubbleOpen', 'Blockly.Icon', 'Blockly.Warning', 'Blockly.browserEvents', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/bubble_dragger.js', ['Blockly.BubbleDragger'], ['Blockly.Bubble', 'Blockly.ComponentManager', 'Blockly.Events.CommentMove', 'Blockly.Events.utils', 'Blockly.constants', 'Blockly.utils', 'Blockly.utils.Coordinate'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/bump_objects.js', ['Blockly.bumpObjects'], ['Blockly.Events.utils', 'Blockly.utils.math'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/clipboard.js', ['Blockly.clipboard'], ['Blockly.Events.utils'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/comment.js', ['Blockly.Comment'], ['Blockly.Bubble', 'Blockly.Css', 'Blockly.Events.BlockChange', 'Blockly.Events.BubbleOpen', 'Blockly.Events.utils', 'Blockly.Icon', 'Blockly.Warning', 'Blockly.browserEvents', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/common.js', ['Blockly.common'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/component_manager.js', ['Blockly.ComponentManager'], ['Blockly.utils'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/connection.js', ['Blockly.Connection'], ['Blockly.ConnectionType', 'Blockly.Events', 'Blockly.Events.BlockMove', 'Blockly.Xml', 'Blockly.constants', 'Blockly.serialization.blocks', 'Blockly.utils.deprecation'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/connection.js', ['Blockly.Connection'], ['Blockly.ConnectionType', 'Blockly.Events.BlockMove', 'Blockly.Events.utils', 'Blockly.Xml', 'Blockly.constants', 'Blockly.serialization.blocks', 'Blockly.utils.deprecation'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/connection_checker.js', ['Blockly.ConnectionChecker'], ['Blockly.Connection', 'Blockly.ConnectionType', 'Blockly.common', 'Blockly.internalConstants', 'Blockly.registry'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/connection_db.js', ['Blockly.ConnectionDB'], ['Blockly.ConnectionType', 'Blockly.constants'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/connection_type.js', ['Blockly.ConnectionType'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/constants.js', ['Blockly.constants'], [], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/contextmenu.js', ['Blockly.ContextMenu'], ['Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Menu', 'Blockly.MenuItem', 'Blockly.Msg', 'Blockly.WidgetDiv', 'Blockly.Xml', 'Blockly.browserEvents', 'Blockly.clipboard', 'Blockly.internalConstants', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.aria', 'Blockly.utils.deprecation', 'Blockly.utils.dom', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/contextmenu_items.js', ['Blockly.ContextMenuItems'], ['Blockly.ContextMenuRegistry', 'Blockly.Events', 'Blockly.Msg', 'Blockly.clipboard', 'Blockly.dialog', 'Blockly.inputTypes', 'Blockly.utils.idGenerator', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/contextmenu.js', ['Blockly.ContextMenu'], ['Blockly.Events.BlockCreate', 'Blockly.Events.utils', 'Blockly.Menu', 'Blockly.MenuItem', 'Blockly.Msg', 'Blockly.WidgetDiv', 'Blockly.Xml', 'Blockly.browserEvents', 'Blockly.clipboard', 'Blockly.internalConstants', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.aria', 'Blockly.utils.deprecation', 'Blockly.utils.dom', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/contextmenu_items.js', ['Blockly.ContextMenuItems'], ['Blockly.ContextMenuRegistry', 'Blockly.Events.utils', 'Blockly.Msg', 'Blockly.clipboard', 'Blockly.dialog', 'Blockly.inputTypes', 'Blockly.utils.idGenerator', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/contextmenu_registry.js', ['Blockly.ContextMenuRegistry'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/css.js', ['Blockly.Css'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/delete_area.js', ['Blockly.DeleteArea'], ['Blockly.BlockSvg', 'Blockly.DragTarget', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/dialog.js', ['Blockly.dialog'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/drag_target.js', ['Blockly.DragTarget'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/dropdowndiv.js', ['Blockly.DropDownDiv'], ['Blockly.common', 'Blockly.utils.Rect', 'Blockly.utils.dom', 'Blockly.utils.math', 'Blockly.utils.style'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events.js', ['Blockly.Events'], ['Blockly.registry', 'Blockly.utils.deprecation', 'Blockly.utils.idGenerator'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_abstract.js', ['Blockly.Events.Abstract'], ['Blockly.Events'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events.js', ['Blockly.Events'], ['Blockly.Events.Abstract', 'Blockly.Events.BlockBase', 'Blockly.Events.BlockChange', 'Blockly.Events.BlockCreate', 'Blockly.Events.BlockDelete', 'Blockly.Events.BlockDrag', 'Blockly.Events.BlockMove', 'Blockly.Events.BubbleOpen', 'Blockly.Events.Click', 'Blockly.Events.CommentBase', 'Blockly.Events.CommentChange', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove', 'Blockly.Events.FinishedLoading', 'Blockly.Events.MarkerMove', 'Blockly.Events.Selected', 'Blockly.Events.ThemeChange', 'Blockly.Events.ToolboxItemSelect', 'Blockly.Events.TrashcanOpen', 'Blockly.Events.Ui', 'Blockly.Events.UiBase', 'Blockly.Events.VarBase', 'Blockly.Events.VarCreate', 'Blockly.Events.VarDelete', 'Blockly.Events.VarRename', 'Blockly.Events.ViewportChange', 'Blockly.Events.utils', 'Blockly.utils.deprecation'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_abstract.js', ['Blockly.Events.Abstract'], ['Blockly.Events.utils'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/events/events_block_base.js', ['Blockly.Events.BlockBase'], ['Blockly.Events.Abstract', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_block_change.js', ['Blockly.Events.BlockChange'], ['Blockly.Events', 'Blockly.Events.BlockBase', 'Blockly.Xml', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_block_create.js', ['Blockly.Events.BlockCreate'], ['Blockly.Events', 'Blockly.Events.BlockBase', 'Blockly.Xml', 'Blockly.registry', 'Blockly.serialization.blocks', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_block_delete.js', ['Blockly.Events.BlockDelete'], ['Blockly.Events', 'Blockly.Events.BlockBase', 'Blockly.Xml', 'Blockly.registry', 'Blockly.serialization.blocks', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_block_drag.js', ['Blockly.Events.BlockDrag'], ['Blockly.Events', 'Blockly.Events.UiBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_block_move.js', ['Blockly.Events.BlockMove'], ['Blockly.ConnectionType', 'Blockly.Events', 'Blockly.Events.BlockBase', 'Blockly.registry', 'Blockly.utils.Coordinate', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_bubble_open.js', ['Blockly.Events.BubbleOpen'], ['Blockly.Events', 'Blockly.Events.UiBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_click.js', ['Blockly.Events.Click'], ['Blockly.Events', 'Blockly.Events.UiBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_comment_base.js', ['Blockly.Events.CommentBase'], ['Blockly.Events', 'Blockly.Events.Abstract', 'Blockly.Xml', 'Blockly.utils.object', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_comment_change.js', ['Blockly.Events.CommentChange'], ['Blockly.Events', 'Blockly.Events.CommentBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_comment_create.js', ['Blockly.Events.CommentCreate'], ['Blockly.Events', 'Blockly.Events.CommentBase', 'Blockly.Xml', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_comment_delete.js', ['Blockly.Events.CommentDelete'], ['Blockly.Events', 'Blockly.Events.CommentBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_comment_move.js', ['Blockly.Events.CommentMove'], ['Blockly.Events', 'Blockly.Events.CommentBase', 'Blockly.registry', 'Blockly.utils.Coordinate', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_marker_move.js', ['Blockly.Events.MarkerMove'], ['Blockly.ASTNode', 'Blockly.Events', 'Blockly.Events.UiBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_selected.js', ['Blockly.Events.Selected'], ['Blockly.Events', 'Blockly.Events.UiBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_theme_change.js', ['Blockly.Events.ThemeChange'], ['Blockly.Events', 'Blockly.Events.UiBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_toolbox_item_select.js', ['Blockly.Events.ToolboxItemSelect'], ['Blockly.Events', 'Blockly.Events.UiBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_trashcan_open.js', ['Blockly.Events.TrashcanOpen'], ['Blockly.Events', 'Blockly.Events.UiBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_ui.js', ['Blockly.Events.Ui'], ['Blockly.Events', 'Blockly.Events.UiBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_block_change.js', ['Blockly.Events.BlockChange'], ['Blockly.Events.BlockBase', 'Blockly.Events.utils', 'Blockly.Xml', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_block_create.js', ['Blockly.Events.BlockCreate'], ['Blockly.Events.BlockBase', 'Blockly.Events.utils', 'Blockly.Xml', 'Blockly.registry', 'Blockly.serialization.blocks', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_block_delete.js', ['Blockly.Events.BlockDelete'], ['Blockly.Events.BlockBase', 'Blockly.Events.utils', 'Blockly.Xml', 'Blockly.registry', 'Blockly.serialization.blocks', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_block_drag.js', ['Blockly.Events.BlockDrag'], ['Blockly.Events.UiBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_block_move.js', ['Blockly.Events.BlockMove'], ['Blockly.ConnectionType', 'Blockly.Events.BlockBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.Coordinate', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_bubble_open.js', ['Blockly.Events.BubbleOpen'], ['Blockly.Events.UiBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_click.js', ['Blockly.Events.Click'], ['Blockly.Events.UiBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_comment_base.js', ['Blockly.Events.CommentBase'], ['Blockly.Events.Abstract', 'Blockly.Events.utils', 'Blockly.Xml', 'Blockly.utils.object', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_comment_change.js', ['Blockly.Events.CommentChange'], ['Blockly.Events.CommentBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_comment_create.js', ['Blockly.Events.CommentCreate'], ['Blockly.Events.CommentBase', 'Blockly.Events.utils', 'Blockly.Xml', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_comment_delete.js', ['Blockly.Events.CommentDelete'], ['Blockly.Events.CommentBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_comment_move.js', ['Blockly.Events.CommentMove'], ['Blockly.Events.CommentBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.Coordinate', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_marker_move.js', ['Blockly.Events.MarkerMove'], ['Blockly.ASTNode', 'Blockly.Events.UiBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_selected.js', ['Blockly.Events.Selected'], ['Blockly.Events.UiBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_theme_change.js', ['Blockly.Events.ThemeChange'], ['Blockly.Events.UiBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_toolbox_item_select.js', ['Blockly.Events.ToolboxItemSelect'], ['Blockly.Events.UiBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_trashcan_open.js', ['Blockly.Events.TrashcanOpen'], ['Blockly.Events.UiBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_ui.js', ['Blockly.Events.Ui'], ['Blockly.Events.UiBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/events/events_ui_base.js', ['Blockly.Events.UiBase'], ['Blockly.Events.Abstract', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/events/events_var_base.js', ['Blockly.Events.VarBase'], ['Blockly.Events.Abstract', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_var_create.js', ['Blockly.Events.VarCreate'], ['Blockly.Events', 'Blockly.Events.VarBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_var_delete.js', ['Blockly.Events.VarDelete'], ['Blockly.Events', 'Blockly.Events.VarBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_var_rename.js', ['Blockly.Events.VarRename'], ['Blockly.Events', 'Blockly.Events.VarBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/events_viewport.js', ['Blockly.Events.ViewportChange'], ['Blockly.Events', 'Blockly.Events.UiBase', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/events/workspace_events.js', ['Blockly.Events.FinishedLoading'], ['Blockly.Events', 'Blockly.Events.Abstract', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_var_create.js', ['Blockly.Events.VarCreate'], ['Blockly.Events.VarBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_var_delete.js', ['Blockly.Events.VarDelete'], ['Blockly.Events.VarBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_var_rename.js', ['Blockly.Events.VarRename'], ['Blockly.Events.VarBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/events_viewport.js', ['Blockly.Events.ViewportChange'], ['Blockly.Events.UiBase', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/utils.js', ['Blockly.Events.utils'], ['Blockly.registry', 'Blockly.utils.idGenerator'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/events/workspace_events.js', ['Blockly.Events.FinishedLoading'], ['Blockly.Events.Abstract', 'Blockly.Events.utils', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/extensions.js', ['Blockly.Extensions'], ['Blockly.utils'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/field.js', ['Blockly.Field'], ['Blockly.DropDownDiv', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Gesture', 'Blockly.MarkerManager', 'Blockly.Tooltip', 'Blockly.WidgetDiv', 'Blockly.Xml', 'Blockly.browserEvents', 'Blockly.utils', 'Blockly.utils.Rect', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.style', 'Blockly.utils.userAgent', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/field.js', ['Blockly.Field'], ['Blockly.DropDownDiv', 'Blockly.Events.BlockChange', 'Blockly.Events.utils', 'Blockly.Gesture', 'Blockly.MarkerManager', 'Blockly.Tooltip', 'Blockly.WidgetDiv', 'Blockly.Xml', 'Blockly.browserEvents', 'Blockly.utils', 'Blockly.utils.Rect', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.style', 'Blockly.utils.userAgent', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/field_angle.js', ['Blockly.FieldAngle'], ['Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.FieldTextInput', 'Blockly.WidgetDiv', 'Blockly.browserEvents', 'Blockly.fieldRegistry', 'Blockly.utils.KeyCodes', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.math', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/field_checkbox.js', ['Blockly.FieldCheckbox'], ['Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.fieldRegistry', 'Blockly.utils.dom', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/field_colour.js', ['Blockly.FieldColour'], ['Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.browserEvents', 'Blockly.fieldRegistry', 'Blockly.utils.KeyCodes', 'Blockly.utils.Size', 'Blockly.utils.aria', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.idGenerator', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); @@ -76,21 +77,21 @@ goog.addDependency('../../core/field_label_serializable.js', ['Blockly.FieldLabe goog.addDependency('../../core/field_multilineinput.js', ['Blockly.FieldMultilineInput'], ['Blockly.Css', 'Blockly.Field', 'Blockly.FieldTextInput', 'Blockly.WidgetDiv', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.KeyCodes', 'Blockly.utils.Svg', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/field_number.js', ['Blockly.FieldNumber'], ['Blockly.FieldTextInput', 'Blockly.fieldRegistry', 'Blockly.utils.aria', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/field_registry.js', ['Blockly.fieldRegistry'], ['Blockly.registry'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/field_textinput.js', ['Blockly.FieldTextInput'], ['Blockly.DropDownDiv', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Field', 'Blockly.Msg', 'Blockly.WidgetDiv', 'Blockly.browserEvents', 'Blockly.dialog', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.KeyCodes', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/field_textinput.js', ['Blockly.FieldTextInput'], ['Blockly.DropDownDiv', 'Blockly.Events.BlockChange', 'Blockly.Events.utils', 'Blockly.Field', 'Blockly.Msg', 'Blockly.WidgetDiv', 'Blockly.browserEvents', 'Blockly.dialog', 'Blockly.fieldRegistry', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.KeyCodes', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/field_variable.js', ['Blockly.FieldVariable'], ['Blockly.Events.BlockChange', 'Blockly.FieldDropdown', 'Blockly.Msg', 'Blockly.VariableModel', 'Blockly.Variables', 'Blockly.Xml', 'Blockly.fieldRegistry', 'Blockly.internalConstants', 'Blockly.utils', 'Blockly.utils.Size', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/flyout_base.js', ['Blockly.Flyout'], ['Blockly.ComponentManager', 'Blockly.DeleteArea', 'Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Events.VarCreate', 'Blockly.FlyoutMetricsManager', 'Blockly.Gesture', 'Blockly.ScrollbarPair', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.Variables', 'Blockly.WorkspaceSvg', 'Blockly.Xml', 'Blockly.blockRendering', 'Blockly.browserEvents', 'Blockly.serialization.blocks', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.idGenerator', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/flyout_base.js', ['Blockly.Flyout'], ['Blockly.ComponentManager', 'Blockly.DeleteArea', 'Blockly.Events.BlockCreate', 'Blockly.Events.VarCreate', 'Blockly.Events.utils', 'Blockly.FlyoutMetricsManager', 'Blockly.Gesture', 'Blockly.ScrollbarPair', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.Variables', 'Blockly.WorkspaceSvg', 'Blockly.Xml', 'Blockly.blockRendering', 'Blockly.browserEvents', 'Blockly.serialization.blocks', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.idGenerator', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/flyout_button.js', ['Blockly.FlyoutButton'], ['Blockly.Css', 'Blockly.browserEvents', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.style'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/flyout_horizontal.js', ['Blockly.HorizontalFlyout'], ['Blockly.DropDownDiv', 'Blockly.Flyout', 'Blockly.Scrollbar', 'Blockly.WidgetDiv', 'Blockly.browserEvents', 'Blockly.registry', 'Blockly.utils.Rect', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/flyout_metrics_manager.js', ['Blockly.FlyoutMetricsManager'], ['Blockly.MetricsManager', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/flyout_vertical.js', ['Blockly.VerticalFlyout'], ['Blockly.Block', 'Blockly.DropDownDiv', 'Blockly.Flyout', 'Blockly.Scrollbar', 'Blockly.WidgetDiv', 'Blockly.browserEvents', 'Blockly.constants', 'Blockly.registry', 'Blockly.utils.Rect', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/generator.js', ['Blockly.Generator'], ['Blockly.common', 'Blockly.internalConstants', 'Blockly.utils.deprecation'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/gesture.js', ['Blockly.Gesture'], ['Blockly.BlockDragger', 'Blockly.BubbleDragger', 'Blockly.Events', 'Blockly.Events.Click', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.Workspace', 'Blockly.WorkspaceDragger', 'Blockly.blockAnimations', 'Blockly.browserEvents', 'Blockly.common', 'Blockly.internalConstants', 'Blockly.registry', 'Blockly.utils.Coordinate'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/gesture.js', ['Blockly.Gesture'], ['Blockly.BlockDragger', 'Blockly.BubbleDragger', 'Blockly.Events.Click', 'Blockly.Events.utils', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.Workspace', 'Blockly.WorkspaceDragger', 'Blockly.blockAnimations', 'Blockly.browserEvents', 'Blockly.common', 'Blockly.internalConstants', 'Blockly.registry', 'Blockly.utils.Coordinate'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/grid.js', ['Blockly.Grid'], ['Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/icon.js', ['Blockly.Icon'], ['Blockly.browserEvents', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/inject.js', ['Blockly.inject'], ['Blockly.BlockDragSurfaceSvg', 'Blockly.Css', 'Blockly.DropDownDiv', 'Blockly.Grid', 'Blockly.Msg', 'Blockly.Options', 'Blockly.ScrollbarPair', 'Blockly.ShortcutRegistry', 'Blockly.Tooltip', 'Blockly.Touch', 'Blockly.WidgetDiv', 'Blockly.Workspace', 'Blockly.WorkspaceDragSurfaceSvg', 'Blockly.WorkspaceSvg', 'Blockly.browserEvents', 'Blockly.bumpObjects', 'Blockly.common', 'Blockly.utils.Svg', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/input.js', ['Blockly.Input'], ['Blockly.FieldLabel', 'Blockly.constants', 'Blockly.fieldRegistry', 'Blockly.inputTypes'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/input_types.js', ['Blockly.inputTypes'], ['Blockly.ConnectionType'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/insertion_marker_manager.js', ['Blockly.InsertionMarkerManager'], ['Blockly.ComponentManager', 'Blockly.ConnectionType', 'Blockly.Events', 'Blockly.blockAnimations', 'Blockly.common', 'Blockly.constants', 'Blockly.internalConstants'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/insertion_marker_manager.js', ['Blockly.InsertionMarkerManager'], ['Blockly.ComponentManager', 'Blockly.ConnectionType', 'Blockly.Events.utils', 'Blockly.blockAnimations', 'Blockly.common', 'Blockly.constants', 'Blockly.internalConstants'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/interfaces/i_ast_node_location.js', ['Blockly.IASTNodeLocation'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/interfaces/i_ast_node_location_svg.js', ['Blockly.IASTNodeLocationSvg'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/interfaces/i_ast_node_location_with_block.js', ['Blockly.IASTNodeLocationWithBlock'], [], {'lang': 'es6', 'module': 'goog'}); @@ -131,13 +132,13 @@ goog.addDependency('../../core/menu.js', ['Blockly.Menu'], ['Blockly.browserEven goog.addDependency('../../core/menuitem.js', ['Blockly.MenuItem'], ['Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.idGenerator'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/metrics_manager.js', ['Blockly.MetricsManager'], ['Blockly.registry', 'Blockly.utils.Size', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/msg.js', ['Blockly.Msg'], ['Blockly.utils.global'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/mutator.js', ['Blockly.Mutator'], ['Blockly.Bubble', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.BubbleOpen', 'Blockly.Icon', 'Blockly.Options', 'Blockly.WorkspaceSvg', 'Blockly.internalConstants', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/mutator.js', ['Blockly.Mutator'], ['Blockly.Bubble', 'Blockly.Events.BlockChange', 'Blockly.Events.BubbleOpen', 'Blockly.Events.utils', 'Blockly.Icon', 'Blockly.Options', 'Blockly.WorkspaceSvg', 'Blockly.internalConstants', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/names.js', ['Blockly.Names'], ['Blockly.Msg', 'Blockly.Variables', 'Blockly.internalConstants'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/options.js', ['Blockly.Options'], ['Blockly.Theme', 'Blockly.Themes.Classic', 'Blockly.registry', 'Blockly.utils.idGenerator', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/positionable_helpers.js', ['Blockly.uiPosition'], ['Blockly.Scrollbar', 'Blockly.utils.Rect', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/procedures.js', ['Blockly.Procedures'], ['Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Msg', 'Blockly.Names', 'Blockly.Variables', 'Blockly.Workspace', 'Blockly.Xml', 'Blockly.blocks', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/procedures.js', ['Blockly.Procedures'], ['Blockly.Events.BlockChange', 'Blockly.Events.utils', 'Blockly.Msg', 'Blockly.Names', 'Blockly.Variables', 'Blockly.Workspace', 'Blockly.Xml', 'Blockly.blocks', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/registry.js', ['Blockly.registry'], [], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/rendered_connection.js', ['Blockly.RenderedConnection'], ['Blockly.Connection', 'Blockly.ConnectionType', 'Blockly.Events', 'Blockly.common', 'Blockly.internalConstants', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Svg', 'Blockly.utils.deprecation', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.svgPaths'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/rendered_connection.js', ['Blockly.RenderedConnection'], ['Blockly.Connection', 'Blockly.ConnectionType', 'Blockly.Events.utils', 'Blockly.common', 'Blockly.internalConstants', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Svg', 'Blockly.utils.deprecation', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.svgPaths'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/renderers/common/block_rendering.js', ['Blockly.blockRendering'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.Connection', 'Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.Debug', 'Blockly.blockRendering.Drawer', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.Field', 'Blockly.blockRendering.Hat', 'Blockly.blockRendering.IPathObject', 'Blockly.blockRendering.Icon', 'Blockly.blockRendering.InRowSpacer', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InputConnection', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.JaggedEdge', 'Blockly.blockRendering.MarkerSvg', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PathObject', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Renderer', 'Blockly.blockRendering.RoundCorner', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.SquareCorner', 'Blockly.blockRendering.StatementInput', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.blockRendering.debug', 'Blockly.registry', 'Blockly.utils.deprecation'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/renderers/common/constants.js', ['Blockly.blockRendering.ConstantProvider'], ['Blockly.ConnectionType', 'Blockly.utils', 'Blockly.utils.Svg', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.svgPaths', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/renderers/common/debug.js', ['Blockly.blockRendering.debug'], [], {'lang': 'es6', 'module': 'goog'}); @@ -145,7 +146,7 @@ goog.addDependency('../../core/renderers/common/debugger.js', ['Blockly.blockRen goog.addDependency('../../core/renderers/common/drawer.js', ['Blockly.blockRendering.Drawer'], ['Blockly.blockRendering.Types', 'Blockly.blockRendering.debug', 'Blockly.utils.svgPaths'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/renderers/common/i_path_object.js', ['Blockly.blockRendering.IPathObject'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/renderers/common/info.js', ['Blockly.blockRendering.RenderInfo'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.Field', 'Blockly.blockRendering.Hat', 'Blockly.blockRendering.Icon', 'Blockly.blockRendering.InRowSpacer', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.JaggedEdge', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RoundCorner', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.SquareCorner', 'Blockly.blockRendering.StatementInput', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.constants', 'Blockly.inputTypes'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/renderers/common/marker_svg.js', ['Blockly.blockRendering.MarkerSvg'], ['Blockly.ASTNode', 'Blockly.ConnectionType', 'Blockly.Events', 'Blockly.Events.MarkerMove', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.svgPaths'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/renderers/common/marker_svg.js', ['Blockly.blockRendering.MarkerSvg'], ['Blockly.ASTNode', 'Blockly.ConnectionType', 'Blockly.Events.MarkerMove', 'Blockly.Events.utils', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.svgPaths'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/renderers/common/path_object.js', ['Blockly.blockRendering.PathObject'], ['Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/renderers/common/renderer.js', ['Blockly.blockRendering.Renderer'], ['Blockly.Connection', 'Blockly.ConnectionType', 'Blockly.InsertionMarkerManager', 'Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.Drawer', 'Blockly.blockRendering.MarkerSvg', 'Blockly.blockRendering.PathObject', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.debug', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/renderers/geras/constants.js', ['Blockly.geras.ConstantProvider'], ['Blockly.blockRendering.ConstantProvider', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); @@ -201,13 +202,13 @@ goog.addDependency('../../core/renderers/zelos/renderer.js', ['Blockly.zelos.Ren goog.addDependency('../../core/renderers/zelos/zelos.js', ['Blockly.zelos'], ['Blockly.zelos.BottomRow', 'Blockly.zelos.ConstantProvider', 'Blockly.zelos.Drawer', 'Blockly.zelos.MarkerSvg', 'Blockly.zelos.PathObject', 'Blockly.zelos.RenderInfo', 'Blockly.zelos.Renderer', 'Blockly.zelos.RightConnectionShape', 'Blockly.zelos.StatementInput', 'Blockly.zelos.TopRow'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/requires.js', ['Blockly.requires'], ['Blockly', 'Blockly.Comment', 'Blockly.ContextMenuItems', 'Blockly.FieldAngle', 'Blockly.FieldCheckbox', 'Blockly.FieldColour', 'Blockly.FieldDropdown', 'Blockly.FieldImage', 'Blockly.FieldLabelSerializable', 'Blockly.FieldMultilineInput', 'Blockly.FieldNumber', 'Blockly.FieldTextInput', 'Blockly.FieldVariable', 'Blockly.FlyoutButton', 'Blockly.Generator', 'Blockly.HorizontalFlyout', 'Blockly.Mutator', 'Blockly.ShortcutItems', 'Blockly.Themes.Classic', 'Blockly.Toolbox', 'Blockly.Trashcan', 'Blockly.VariablesDynamic', 'Blockly.VerticalFlyout', 'Blockly.Warning', 'Blockly.ZoomControls', 'Blockly.geras.Renderer', 'Blockly.serialization.blocks', 'Blockly.serialization.registry', 'Blockly.serialization.variables', 'Blockly.serialization.workspaces', 'Blockly.thrasos.Renderer', 'Blockly.zelos.Renderer']); goog.addDependency('../../core/scrollbar.js', ['Blockly.Scrollbar'], ['Blockly.Touch', 'Blockly.browserEvents', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/scrollbar_pair.js', ['Blockly.ScrollbarPair'], ['Blockly.Events', 'Blockly.Scrollbar', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/serialization/blocks.js', ['Blockly.serialization.blocks'], ['Blockly.Events', 'Blockly.Xml', 'Blockly.inputTypes', 'Blockly.serialization.ISerializer', 'Blockly.serialization.exceptions', 'Blockly.serialization.priorities', 'Blockly.serialization.registry', 'Blockly.utils.Size'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/scrollbar_pair.js', ['Blockly.ScrollbarPair'], ['Blockly.Events.utils', 'Blockly.Scrollbar', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/serialization/blocks.js', ['Blockly.serialization.blocks'], ['Blockly.Events.utils', 'Blockly.Xml', 'Blockly.inputTypes', 'Blockly.serialization.ISerializer', 'Blockly.serialization.exceptions', 'Blockly.serialization.priorities', 'Blockly.serialization.registry', 'Blockly.utils.Size'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/serialization/exceptions.js', ['Blockly.serialization.exceptions'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/serialization/priorities.js', ['Blockly.serialization.priorities'], [], {'module': 'goog'}); goog.addDependency('../../core/serialization/registry.js', ['Blockly.serialization.registry'], ['Blockly.registry'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/serialization/variables.js', ['Blockly.serialization.variables'], ['Blockly.serialization.ISerializer', 'Blockly.serialization.priorities', 'Blockly.serialization.registry'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/serialization/workspaces.js', ['Blockly.serialization.workspaces'], ['Blockly.Events', 'Blockly.Workspace', 'Blockly.registry', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/serialization/workspaces.js', ['Blockly.serialization.workspaces'], ['Blockly.Events.utils', 'Blockly.Workspace', 'Blockly.registry', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/shortcut_items.js', ['Blockly.ShortcutItems'], ['Blockly.Gesture', 'Blockly.ShortcutRegistry', 'Blockly.clipboard', 'Blockly.common', 'Blockly.utils.KeyCodes'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/shortcut_registry.js', ['Blockly.ShortcutRegistry'], ['Blockly.utils.KeyCodes', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/theme.js', ['Blockly.Theme'], ['Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); @@ -218,12 +219,12 @@ goog.addDependency('../../core/theme_manager.js', ['Blockly.ThemeManager'], ['Bl goog.addDependency('../../core/toolbox/category.js', ['Blockly.ToolboxCategory'], ['Blockly.Css', 'Blockly.ToolboxItem', 'Blockly.registry', 'Blockly.utils', 'Blockly.utils.aria', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/toolbox/collapsible_category.js', ['Blockly.CollapsibleToolboxCategory'], ['Blockly.ToolboxCategory', 'Blockly.ToolboxSeparator', 'Blockly.registry', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/toolbox/separator.js', ['Blockly.ToolboxSeparator'], ['Blockly.Css', 'Blockly.ToolboxItem', 'Blockly.registry', 'Blockly.utils.dom', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/toolbox/toolbox.js', ['Blockly.Toolbox'], ['Blockly.BlockSvg', 'Blockly.CollapsibleToolboxCategory', 'Blockly.ComponentManager', 'Blockly.Css', 'Blockly.DeleteArea', 'Blockly.Events', 'Blockly.Events.ToolboxItemSelect', 'Blockly.Options', 'Blockly.Touch', 'Blockly.browserEvents', 'Blockly.common', 'Blockly.registry', 'Blockly.utils.KeyCodes', 'Blockly.utils.Rect', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/toolbox/toolbox.js', ['Blockly.Toolbox'], ['Blockly.BlockSvg', 'Blockly.CollapsibleToolboxCategory', 'Blockly.ComponentManager', 'Blockly.Css', 'Blockly.DeleteArea', 'Blockly.Events.ToolboxItemSelect', 'Blockly.Events.utils', 'Blockly.Options', 'Blockly.Touch', 'Blockly.browserEvents', 'Blockly.common', 'Blockly.registry', 'Blockly.utils.KeyCodes', 'Blockly.utils.Rect', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/toolbox/toolbox_item.js', ['Blockly.ToolboxItem'], ['Blockly.utils.idGenerator'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/tooltip.js', ['Blockly.Tooltip'], ['Blockly.browserEvents', 'Blockly.common', 'Blockly.utils.deprecation', 'Blockly.utils.string'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/touch.js', ['Blockly.Touch'], ['Blockly.internalConstants', 'Blockly.utils.global', 'Blockly.utils.string'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/touch_gesture.js', ['Blockly.TouchGesture'], ['Blockly.Gesture', 'Blockly.Touch', 'Blockly.browserEvents', 'Blockly.utils.Coordinate', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/trashcan.js', ['Blockly.Trashcan'], ['Blockly.ComponentManager', 'Blockly.DeleteArea', 'Blockly.Events', 'Blockly.Events.TrashcanOpen', 'Blockly.Options', 'Blockly.browserEvents', 'Blockly.internalConstants', 'Blockly.registry', 'Blockly.uiPosition', 'Blockly.utils.Rect', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/trashcan.js', ['Blockly.Trashcan'], ['Blockly.ComponentManager', 'Blockly.DeleteArea', 'Blockly.Events.TrashcanOpen', 'Blockly.Events.utils', 'Blockly.Options', 'Blockly.browserEvents', 'Blockly.internalConstants', 'Blockly.registry', 'Blockly.uiPosition', 'Blockly.utils.Rect', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/utils.js', ['Blockly.utils'], ['Blockly.Msg', 'Blockly.browserEvents', 'Blockly.internalConstants', 'Blockly.utils.Coordinate', 'Blockly.utils.KeyCodes', 'Blockly.utils.Metrics', 'Blockly.utils.Rect', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.aria', 'Blockly.utils.colour', 'Blockly.utils.deprecation', 'Blockly.utils.dom', 'Blockly.utils.global', 'Blockly.utils.idGenerator', 'Blockly.utils.math', 'Blockly.utils.object', 'Blockly.utils.string', 'Blockly.utils.style', 'Blockly.utils.svgPaths', 'Blockly.utils.toolbox', 'Blockly.utils.userAgent', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/utils/aria.js', ['Blockly.utils.aria'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/utils/colour.js', ['Blockly.utils.colour'], ['Blockly.internalConstants'], {'lang': 'es6', 'module': 'goog'}); @@ -245,21 +246,21 @@ goog.addDependency('../../core/utils/svg_paths.js', ['Blockly.utils.svgPaths'], goog.addDependency('../../core/utils/toolbox.js', ['Blockly.utils.toolbox'], ['Blockly.Xml', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/utils/useragent.js', ['Blockly.utils.userAgent'], ['Blockly.utils.global'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/utils/xml.js', ['Blockly.utils.xml'], ['Blockly.utils.global'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/variable_map.js', ['Blockly.VariableMap'], ['Blockly.Events', 'Blockly.Events.VarDelete', 'Blockly.Events.VarRename', 'Blockly.Msg', 'Blockly.Names', 'Blockly.VariableModel', 'Blockly.dialog', 'Blockly.utils', 'Blockly.utils.idGenerator', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/variable_model.js', ['Blockly.VariableModel'], ['Blockly.Events', 'Blockly.Events.VarCreate', 'Blockly.utils.idGenerator'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/variable_map.js', ['Blockly.VariableMap'], ['Blockly.Events.VarDelete', 'Blockly.Events.VarRename', 'Blockly.Events.utils', 'Blockly.Msg', 'Blockly.Names', 'Blockly.VariableModel', 'Blockly.dialog', 'Blockly.utils', 'Blockly.utils.idGenerator', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/variable_model.js', ['Blockly.VariableModel'], ['Blockly.Events.VarCreate', 'Blockly.Events.utils', 'Blockly.utils.idGenerator'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/variables.js', ['Blockly.Variables'], ['Blockly.Msg', 'Blockly.VariableModel', 'Blockly.Xml', 'Blockly.blocks', 'Blockly.dialog', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/variables_dynamic.js', ['Blockly.VariablesDynamic'], ['Blockly.Msg', 'Blockly.VariableModel', 'Blockly.Variables', 'Blockly.blocks', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/warning.js', ['Blockly.Warning'], ['Blockly.Bubble', 'Blockly.Events', 'Blockly.Events.BubbleOpen', 'Blockly.Icon', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/warning.js', ['Blockly.Warning'], ['Blockly.Bubble', 'Blockly.Events.BubbleOpen', 'Blockly.Events.utils', 'Blockly.Icon', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/widgetdiv.js', ['Blockly.WidgetDiv'], ['Blockly.common', 'Blockly.utils.deprecation', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/workspace.js', ['Blockly.Workspace'], ['Blockly.ConnectionChecker', 'Blockly.Events', 'Blockly.Options', 'Blockly.VariableMap', 'Blockly.registry', 'Blockly.utils', 'Blockly.utils.idGenerator', 'Blockly.utils.math'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/workspace.js', ['Blockly.Workspace'], ['Blockly.ConnectionChecker', 'Blockly.Events.utils', 'Blockly.Options', 'Blockly.VariableMap', 'Blockly.registry', 'Blockly.utils', 'Blockly.utils.idGenerator', 'Blockly.utils.math'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/workspace_audio.js', ['Blockly.WorkspaceAudio'], ['Blockly.internalConstants', 'Blockly.utils.global', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/workspace_comment.js', ['Blockly.WorkspaceComment'], ['Blockly.Events', 'Blockly.Events.CommentChange', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove', 'Blockly.utils.Coordinate', 'Blockly.utils.idGenerator', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/workspace_comment_svg.js', ['Blockly.WorkspaceCommentSvg'], ['Blockly.ContextMenu', 'Blockly.Css', 'Blockly.Events', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove', 'Blockly.Events.Selected', 'Blockly.Touch', 'Blockly.WorkspaceComment', 'Blockly.browserEvents', 'Blockly.common', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/workspace_comment.js', ['Blockly.WorkspaceComment'], ['Blockly.Events.CommentChange', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove', 'Blockly.Events.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.idGenerator', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/workspace_comment_svg.js', ['Blockly.WorkspaceCommentSvg'], ['Blockly.ContextMenu', 'Blockly.Css', 'Blockly.Events.CommentCreate', 'Blockly.Events.CommentDelete', 'Blockly.Events.CommentMove', 'Blockly.Events.Selected', 'Blockly.Events.utils', 'Blockly.Touch', 'Blockly.WorkspaceComment', 'Blockly.browserEvents', 'Blockly.common', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/workspace_drag_surface_svg.js', ['Blockly.WorkspaceDragSurfaceSvg'], ['Blockly.utils', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/workspace_dragger.js', ['Blockly.WorkspaceDragger'], ['Blockly.common', 'Blockly.utils.Coordinate'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/workspace_svg.js', ['Blockly.WorkspaceSvg'], ['Blockly.BlockSvg', 'Blockly.ComponentManager', 'Blockly.ConnectionDB', 'Blockly.ContextMenu', 'Blockly.ContextMenuRegistry', 'Blockly.DropDownDiv', 'Blockly.Events', 'Blockly.Events.BlockCreate', 'Blockly.Events.ThemeChange', 'Blockly.Events.ViewportChange', 'Blockly.Gesture', 'Blockly.Grid', 'Blockly.MarkerManager', 'Blockly.MetricsManager', 'Blockly.Msg', 'Blockly.Options', 'Blockly.ThemeManager', 'Blockly.Themes.Classic', 'Blockly.Tooltip', 'Blockly.TouchGesture', 'Blockly.WidgetDiv', 'Blockly.Workspace', 'Blockly.WorkspaceAudio', 'Blockly.Xml', 'Blockly.blockRendering', 'Blockly.browserEvents', 'Blockly.common', 'Blockly.internalConstants', 'Blockly.registry', 'Blockly.serialization.blocks', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/xml.js', ['Blockly.Xml'], ['Blockly.Events', 'Blockly.inputTypes', 'Blockly.utils.Size', 'Blockly.utils.dom', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/zoom_controls.js', ['Blockly.ZoomControls'], ['Blockly.ComponentManager', 'Blockly.Css', 'Blockly.Events', 'Blockly.Events.Click', 'Blockly.Touch', 'Blockly.browserEvents', 'Blockly.internalConstants', 'Blockly.uiPosition', 'Blockly.utils.Rect', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/workspace_svg.js', ['Blockly.WorkspaceSvg'], ['Blockly.BlockSvg', 'Blockly.ComponentManager', 'Blockly.ConnectionDB', 'Blockly.ContextMenu', 'Blockly.ContextMenuRegistry', 'Blockly.DropDownDiv', 'Blockly.Events.BlockCreate', 'Blockly.Events.ThemeChange', 'Blockly.Events.ViewportChange', 'Blockly.Events.utils', 'Blockly.Gesture', 'Blockly.Grid', 'Blockly.MarkerManager', 'Blockly.MetricsManager', 'Blockly.Msg', 'Blockly.Options', 'Blockly.ThemeManager', 'Blockly.Themes.Classic', 'Blockly.Tooltip', 'Blockly.TouchGesture', 'Blockly.WidgetDiv', 'Blockly.Workspace', 'Blockly.WorkspaceAudio', 'Blockly.Xml', 'Blockly.blockRendering', 'Blockly.browserEvents', 'Blockly.common', 'Blockly.internalConstants', 'Blockly.registry', 'Blockly.serialization.blocks', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/xml.js', ['Blockly.Xml'], ['Blockly.Events.utils', 'Blockly.inputTypes', 'Blockly.utils.Size', 'Blockly.utils.dom', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/zoom_controls.js', ['Blockly.ZoomControls'], ['Blockly.ComponentManager', 'Blockly.Css', 'Blockly.Events.Click', 'Blockly.Events.utils', 'Blockly.Touch', 'Blockly.browserEvents', 'Blockly.internalConstants', 'Blockly.uiPosition', 'Blockly.utils.Rect', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../generators/dart.js', ['Blockly.Dart'], ['Blockly.Generator', 'Blockly.inputTypes', 'Blockly.utils.string']); goog.addDependency('../../generators/dart/colour.js', ['Blockly.Dart.colour'], ['Blockly.Dart']); goog.addDependency('../../generators/dart/lists.js', ['Blockly.Dart.lists'], ['Blockly.Dart']); @@ -315,7 +316,7 @@ goog.addDependency('../../tests/mocha/astnode_test.js', ['Blockly.test.astNode'] goog.addDependency('../../tests/mocha/block_change_event_test.js', ['Blockly.test.blockChangeEvent'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/block_create_event_test.js', ['Blockly.test.blockCreateEvent'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/block_json_test.js', ['Blockly.test.blockJson'], [], {'lang': 'es5', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/block_test.js', ['Blockly.test.blocks'], ['Blockly.blocks', 'Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/block_test.js', ['Blockly.test.blocks'], ['Blockly.Events.utils', 'Blockly.blocks', 'Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/comment_test.js', ['Blockly.test.comments'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/connection_checker_test.js', ['Blockly.test.connectionChecker'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/connection_db_test.js', ['Blockly.test.connectionDb'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); @@ -323,7 +324,7 @@ goog.addDependency('../../tests/mocha/connection_test.js', ['Blockly.test.connec goog.addDependency('../../tests/mocha/contextmenu_items_test.js', ['Blockly.test.contextMenuItem'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/cursor_test.js', ['Blockly.test.cursor'], ['Blockly.ASTNode', 'Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/dropdowndiv_test.js', ['Blockly.test.dropdown'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/event_test.js', ['Blockly.test.event'], ['Blockly.ASTNode', 'Blockly.WorkspaceComment', 'Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/event_test.js', ['Blockly.test.event'], ['Blockly.ASTNode', 'Blockly.Events.utils', 'Blockly.WorkspaceComment', 'Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/extensions_test.js', ['Blockly.test.extensions'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/field_angle_test.js', ['Blockly.test.fieldAngle'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/field_checkbox_test.js', ['Blockly.test.fieldCheckbox'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); @@ -347,7 +348,7 @@ goog.addDependency('../../tests/mocha/jso_deserialization_test.js', ['Blockly.te goog.addDependency('../../tests/mocha/jso_serialization_test.js', ['Blockly.test.jsoSerialization'], ['Blockly.test.helpers'], {'lang': 'es8', 'module': 'goog'}); goog.addDependency('../../tests/mocha/json_test.js', ['Blockly.test.json'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/keydown_test.js', ['Blockly.test.keydown'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/logic_ternary_test.js', ['Blockly.test.logicTernary'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/logic_ternary_test.js', ['Blockly.test.logicTernary'], ['Blockly.Events.utils', 'Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/metrics_test.js', ['Blockly.test.metrics'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/mutator_test.js', ['Blockly.test.mutator'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/names_test.js', ['Blockly.test.names'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); @@ -357,19 +358,19 @@ goog.addDependency('../../tests/mocha/registry_test.js', ['Blockly.test.registry goog.addDependency('../../tests/mocha/run_mocha_tests_in_browser.js', [], [], {'lang': 'es8'}); goog.addDependency('../../tests/mocha/serializer_test.js', ['Blockly.test.serialization'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/shortcut_registry_test.js', ['Blockly.test.shortcutRegistry'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/test_helpers.js', ['Blockly.test.helpers'], ['Blockly.blocks', 'Blockly.utils.KeyCodes'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/test_helpers.js', ['Blockly.test.helpers'], ['Blockly.Events.utils', 'Blockly.blocks', 'Blockly.utils.KeyCodes'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/theme_test.js', ['Blockly.test.theme'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/toolbox_helper.js', ['Blockly.test.toolboxHelpers'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/toolbox_test.js', ['Blockly.test.toolbox'], ['Blockly.test.helpers', 'Blockly.test.toolboxHelpers'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/tooltip_test.js', ['Blockly.test.tooltip'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/trashcan_test.js', ['Blockly.test.trashcan'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/trashcan_test.js', ['Blockly.test.trashcan'], ['Blockly.Events.utils', 'Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/utils_test.js', ['Blockly.test.utils'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/variable_map_test.js', ['Blockly.test.variableMap'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/variable_model_test.js', ['Blockly.test.variableModel'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/variables_test.js', ['Blockly.test.variables'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/widget_div_test.js', ['Blockly.test.widgetDiv'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/workspace_comment_test.js', ['Blockly.test.workspaceComment'], ['Blockly.WorkspaceComment', 'Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/workspace_helpers.js', ['Blockly.test.workspaceHelpers'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/workspace_helpers.js', ['Blockly.test.workspaceHelpers'], ['Blockly.Events.utils', 'Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/workspace_svg_test.js', ['Blockly.test.workspaceSvg'], ['Blockly.test.helpers', 'Blockly.test.workspaceHelpers'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/workspace_test.js', ['Blockly.test.workspace'], ['Blockly.test.helpers', 'Blockly.test.workspaceHelpers'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/xml_test.js', ['Blockly.test.xml'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); diff --git a/tests/mocha/block_test.js b/tests/mocha/block_test.js index 26f4eda52..04c205e9d 100644 --- a/tests/mocha/block_test.js +++ b/tests/mocha/block_test.js @@ -6,6 +6,7 @@ goog.module('Blockly.test.blocks'); +const eventUtils = goog.require('Blockly.Events.utils'); const {Blocks} = goog.require('Blockly.blocks'); const {createDeprecationWarningStub, createRenderedBlock, sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers'); @@ -1082,7 +1083,7 @@ suite('Blocks', function() { function assertCommentEvent(eventSpy, oldValue, newValue) { var calls = eventSpy.getCalls(); var event = calls[calls.length - 1].args[0]; - chai.assert.equal(event.type, Blockly.Events.BLOCK_CHANGE); + chai.assert.equal(event.type, eventUtils.BLOCK_CHANGE); chai.assert.equal(event.element, 'comment'); chai.assert.equal(event.oldValue, oldValue); chai.assert.equal(event.newValue, newValue); @@ -1090,10 +1091,10 @@ suite('Blocks', function() { function assertNoCommentEvent(eventSpy) { var calls = eventSpy.getCalls(); var event = calls[calls.length - 1].args[0]; - chai.assert.notEqual(event.type, Blockly.Events.BLOCK_CHANGE); + chai.assert.notEqual(event.type, eventUtils.BLOCK_CHANGE); } setup(function() { - this.eventsFireSpy = sinon.spy(Blockly.Events, 'fire'); + this.eventsFireSpy = sinon.spy(eventUtils, 'fire'); }); teardown(function() { this.eventsFireSpy.restore(); @@ -1364,7 +1365,7 @@ suite('Blocks', function() { } setup(function() { - Blockly.Events.disable(); + eventUtils.disable(); // We need a visible workspace. this.workspace = Blockly.inject('blocklyDiv', {}); Blockly.defineBlocksWithJsonArray([ @@ -1382,7 +1383,7 @@ suite('Blocks', function() { ]); }); teardown(function() { - Blockly.Events.enable(); + eventUtils.enable(); workspaceTeardown.call(this, this.workspace); }); suite('Connecting and Disconnecting', function() { @@ -1988,7 +1989,7 @@ suite('Blocks', function() { var recordUndoDuringInit; Blocks['init_test_block'].init = function() { initCalled = true; - recordUndoDuringInit = Blockly.Events.getRecordUndo(); + recordUndoDuringInit = eventUtils.getRecordUndo(); throw new Error(); }; chai.assert.throws(function() { @@ -1996,7 +1997,7 @@ suite('Blocks', function() { }.bind(this)); chai.assert.isFalse(recordUndoDuringInit, 'recordUndo should be false during block init function'); - chai.assert.isTrue(Blockly.Events.getRecordUndo(), + chai.assert.isTrue(eventUtils.getRecordUndo(), 'recordUndo should be reset to true after init'); chai.assert.isTrue(initCalled, 'expected init function to be called'); }); diff --git a/tests/mocha/comment_test.js b/tests/mocha/comment_test.js index f156ca136..32f7c6b89 100644 --- a/tests/mocha/comment_test.js +++ b/tests/mocha/comment_test.js @@ -6,7 +6,7 @@ goog.module('Blockly.test.comments'); -const {assertEventFired, createDeprecationWarningStub, sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers'); +const {assertEventFired, sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers'); suite('Comments', function() { diff --git a/tests/mocha/event_test.js b/tests/mocha/event_test.js index 1f0117024..26f1f29f0 100644 --- a/tests/mocha/event_test.js +++ b/tests/mocha/event_test.js @@ -6,6 +6,7 @@ goog.module('Blockly.test.event'); +const eventUtils = goog.require('Blockly.Events.utils'); const {assertEventEquals, assertNthCallEventArgEquals, assertVariableValues, createFireChangeListenerSpy, createGenUidStubWithReturns, sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers'); const {ASTNode} = goog.require('Blockly.ASTNode'); goog.require('Blockly.WorkspaceComment'); @@ -14,7 +15,7 @@ goog.require('Blockly.WorkspaceComment'); suite('Events', function() { setup(function() { sharedTestSetup.call(this, {fireEventsNow: false}); - this.eventsFireSpy = sinon.spy(Blockly.Events, 'fire'); + this.eventsFireSpy = sinon.spy(eventUtils, 'fire'); this.workspace = new Blockly.Workspace(); Blockly.defineBlocksWithJsonArray([{ 'type': 'field_variable_test_block', @@ -41,15 +42,15 @@ suite('Events', function() { // Disable events while constructing the block: this is a test of the // Blockly.Event constructors, not the block constructors. // Set the group id to avoid an extra call to genUid. - Blockly.Events.disable(); + eventUtils.disable(); try { - Blockly.Events.setGroup('unused'); + eventUtils.setGroup('unused'); var block = new Blockly.Block( workspace, 'simple_test_block'); } finally { - Blockly.Events.setGroup(false); + eventUtils.setGroup(false); } - Blockly.Events.enable(); + eventUtils.enable(); return block; } @@ -81,7 +82,7 @@ suite('Events', function() { test('Old UI event without block', function() { var TEST_GROUP_ID = 'testGroup'; - Blockly.Events.setGroup(TEST_GROUP_ID); + eventUtils.setGroup(TEST_GROUP_ID); var event = new Blockly.Events.Ui(null, 'foo', 'bar', 'baz'); assertEventEquals(event, Blockly.Events.UI, '', null, { 'element': 'foo', @@ -138,7 +139,7 @@ suite('Events', function() { test('Old UI event with block', function() { var TEST_GROUP_ID = 'testGroup'; - Blockly.Events.setGroup(TEST_GROUP_ID); + eventUtils.setGroup(TEST_GROUP_ID); var event = new Blockly.Events.Ui(this.block, 'foo', 'bar', 'baz'); sinon.assert.calledOnce(this.genUidStub); assertEventEquals(event, Blockly.Events.UI, this.workspace.id, @@ -154,7 +155,7 @@ suite('Events', function() { test('Click with block', function() { var TEST_GROUP_ID = 'testGroup'; - Blockly.Events.setGroup(TEST_GROUP_ID); + eventUtils.setGroup(TEST_GROUP_ID); var event = new Blockly.Events.Click(this.block, null, 'block'); assertEventEquals(event, Blockly.Events.CLICK, this.workspace.id, this.TEST_BLOCK_ID, { @@ -716,7 +717,7 @@ suite('Events', function() { test('Var create', function() { var json = {type: "var_create", varId: "id2", varType: "type2", varName: "name2"}; - var event = Blockly.Events.fromJson(json, this.workspace); + var event = eventUtils.fromJson(json, this.workspace); var x = this.workspace.getVariableById('id2'); chai.assert.isNull(x); event.run(true); @@ -747,7 +748,7 @@ suite('Events', function() { test('Var delete', function() { var json = {type: "var_delete", varId: "id2", varType: "type2", varName: "name2"}; - var event = Blockly.Events.fromJson(json, this.workspace); + var event = eventUtils.fromJson(json, this.workspace); chai.assert.isNull(this.workspace.getVariableById('id2')); event.run(false); assertVariableValues(this.workspace, 'name2', 'type2', 'id2'); @@ -783,7 +784,7 @@ suite('Events', function() { new Blockly.Events.BlockChange(block, 'field', 'VAR', 'id1', 'id2'), new Blockly.Events.Click(block) ]; - var filteredEvents = Blockly.Events.filter(events, true); + var filteredEvents = eventUtils.filter(events, true); chai.assert.equal(filteredEvents.length, 4); // no event should have been removed. // test that the order hasn't changed chai.assert.isTrue(filteredEvents[0] instanceof Blockly.Events.BlockCreate); @@ -801,7 +802,7 @@ suite('Events', function() { new Blockly.Events.BlockCreate(block2), new Blockly.Events.BlockMove(block2) ]; - var filteredEvents = Blockly.Events.filter(events, true); + var filteredEvents = eventUtils.filter(events, true); chai.assert.equal(filteredEvents.length, 4); // no event should have been removed. }); @@ -811,7 +812,7 @@ suite('Events', function() { addMoveEvent(events, block, 1, 1); addMoveEvent(events, block, 2, 2); addMoveEvent(events, block, 3, 3); - var filteredEvents = Blockly.Events.filter(events, true); + var filteredEvents = eventUtils.filter(events, true); chai.assert.equal(filteredEvents.length, 2); // duplicate moves should have been removed. // test that the order hasn't changed chai.assert.isTrue(filteredEvents[0] instanceof Blockly.Events.BlockCreate); @@ -826,7 +827,7 @@ suite('Events', function() { addMoveEvent(events, block, 1, 1); addMoveEvent(events, block, 2, 2); addMoveEvent(events, block, 3, 3); - var filteredEvents = Blockly.Events.filter(events, false); + var filteredEvents = eventUtils.filter(events, false); chai.assert.equal(filteredEvents.length, 2); // duplicate event should have been removed. // test that the order hasn't changed chai.assert.isTrue(filteredEvents[0] instanceof Blockly.Events.BlockCreate); @@ -840,7 +841,7 @@ suite('Events', function() { var events = []; addMoveEvent(events, block, 0, 0); addMoveEvent(events, block, 1, 1); - var filteredEvents = Blockly.Events.filter(events, true); + var filteredEvents = eventUtils.filter(events, true); chai.assert.equal(filteredEvents.length, 1); // second move event merged into first chai.assert.equal(filteredEvents[0].newCoordinate.x, 1); chai.assert.equal(filteredEvents[0].newCoordinate.y, 1); @@ -852,7 +853,7 @@ suite('Events', function() { new Blockly.Events.BlockChange(block1, 'field', 'VAR', 'item', 'item1'), new Blockly.Events.BlockChange(block1, 'field', 'VAR', 'item1', 'item2') ]; - var filteredEvents = Blockly.Events.filter(events, true); + var filteredEvents = eventUtils.filter(events, true); chai.assert.equal(filteredEvents.length, 1); // second change event merged into first chai.assert.equal(filteredEvents[0].oldValue, 'item'); chai.assert.equal(filteredEvents[0].newValue, 'item2'); @@ -863,7 +864,7 @@ suite('Events', function() { new Blockly.Events.ViewportChange(1, 2, 3, this.workspace, 4), new Blockly.Events.ViewportChange(5, 6, 7, this.workspace, 8) ]; - var filteredEvents = Blockly.Events.filter(events, true); + var filteredEvents = eventUtils.filter(events, true); chai.assert.equal(filteredEvents.length, 1); // second change event merged into first chai.assert.equal(filteredEvents[0].viewTop, 5); chai.assert.equal(filteredEvents[0].viewLeft, 6); @@ -883,7 +884,7 @@ suite('Events', function() { new Blockly.Events.BubbleOpen(block3, true, 'warning'), new Blockly.Events.Click(block3) ]; - var filteredEvents = Blockly.Events.filter(events, true); + var filteredEvents = eventUtils.filter(events, true); // click event merged into corresponding *Open event chai.assert.equal(filteredEvents.length, 3); chai.assert.isTrue(filteredEvents[0] instanceof Blockly.Events.BubbleOpen); @@ -902,7 +903,7 @@ suite('Events', function() { new Blockly.Events.Click(block), new Blockly.Events.Ui(block, 'stackclick', undefined, undefined) ]; - var filteredEvents = Blockly.Events.filter(events, true); + var filteredEvents = eventUtils.filter(events, true); // click and stackclick should both exist chai.assert.equal(filteredEvents.length, 2); chai.assert.isTrue(filteredEvents[0] instanceof Blockly.Events.Click); @@ -922,7 +923,7 @@ suite('Events', function() { var events = []; addMoveEventParent(events, block, null); addMoveEventParent(events, block, null); - var filteredEvents = Blockly.Events.filter(events, true); + var filteredEvents = eventUtils.filter(events, true); // The two events should be merged, but because nothing has changed // they will be filtered out. chai.assert.equal(filteredEvents.length, 0); @@ -943,7 +944,7 @@ suite('Events', function() { events.push(new Blockly.Events.BlockDelete(block2)); addMoveEvent(events, block1, 2, 2); - var filteredEvents = Blockly.Events.filter(events, true); + var filteredEvents = eventUtils.filter(events, true); // Nothing should have merged. chai.assert.equal(filteredEvents.length, 4); // test that the order hasn't changed @@ -1099,7 +1100,7 @@ suite('Events', function() { workspaceTeardown.call(this, this.workspace); }); test('Created orphan block is disabled', function() { - this.workspace.addChangeListener(Blockly.Events.disableOrphans); + this.workspace.addChangeListener(eventUtils.disableOrphans); var block = this.workspace.newBlock('controls_for'); block.initSvg(); block.render(); @@ -1111,7 +1112,7 @@ suite('Events', function() { 'Expected orphan block to be disabled after creation'); }); test('Created procedure block is enabled', function() { - this.workspace.addChangeListener(Blockly.Events.disableOrphans); + this.workspace.addChangeListener(eventUtils.disableOrphans); // Procedure block is never an orphan var functionBlock = this.workspace.newBlock('procedures_defnoreturn'); @@ -1125,7 +1126,7 @@ suite('Events', function() { 'Expected top-level procedure block to be enabled'); }); test('Moving a block to top-level disables it', function() { - this.workspace.addChangeListener(Blockly.Events.disableOrphans); + this.workspace.addChangeListener(eventUtils.disableOrphans); var functionBlock = this.workspace.newBlock('procedures_defnoreturn'); functionBlock.initSvg(); functionBlock.render(); @@ -1147,7 +1148,7 @@ suite('Events', function() { 'Expected disconnected block to be disabled'); }); test('Giving block a parent enables it', function() { - this.workspace.addChangeListener(Blockly.Events.disableOrphans); + this.workspace.addChangeListener(eventUtils.disableOrphans); var functionBlock = this.workspace.newBlock('procedures_defnoreturn'); functionBlock.initSvg(); functionBlock.render(); @@ -1166,7 +1167,7 @@ suite('Events', function() { 'Expected block to be enabled after connecting to parent'); }); test('disableOrphans events are not undoable', function() { - this.workspace.addChangeListener(Blockly.Events.disableOrphans); + this.workspace.addChangeListener(eventUtils.disableOrphans); var functionBlock = this.workspace.newBlock('procedures_defnoreturn'); functionBlock.initSvg(); functionBlock.render(); diff --git a/tests/mocha/logic_ternary_test.js b/tests/mocha/logic_ternary_test.js index 763db44f3..b25b12362 100644 --- a/tests/mocha/logic_ternary_test.js +++ b/tests/mocha/logic_ternary_test.js @@ -7,6 +7,7 @@ goog.module('Blockly.test.logicTernary'); const {sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers'); +const eventUtils = goog.require('Blockly.Events.utils'); suite('Logic ternary', function() { @@ -78,7 +79,7 @@ suite('Logic ternary', function() { function connectParentAndCheckConnections( block, parent, parentInputName, opt_thenInput, opt_elseInput) { parent.getInput(parentInputName).connection.connect(block.outputConnection); - Blockly.Events.TEST_ONLY.fireNow(); // Force synchronous onchange() call. + eventUtils.TEST_ONLY.fireNow(); // Force synchronous onchange() call. chai.assert.equal(block.getParent(), parent, 'Successful connection to parent'); if (opt_thenInput) { @@ -93,7 +94,7 @@ suite('Logic ternary', function() { function connectThenInputAndCheckConnections( block, thenInput, opt_elseInput, opt_parent) { block.getInput('THEN').connection.connect(thenInput.outputConnection); - Blockly.Events.TEST_ONLY.fireNow(); // Force synchronous onchange() call. + eventUtils.TEST_ONLY.fireNow(); // Force synchronous onchange() call. chai.assert.equal(thenInput.getParent(), block, 'THEN is connected'); if (opt_parent) { chai.assert.equal(block.getParent(), opt_parent, @@ -107,7 +108,7 @@ suite('Logic ternary', function() { function connectElseInputAndCheckConnections( block, elseInput, opt_thenInput, opt_parent) { block.getInput('ELSE').connection.connect(elseInput.outputConnection); - Blockly.Events.TEST_ONLY.fireNow(); // Force synchronous onchange() call. + eventUtils.TEST_ONLY.fireNow(); // Force synchronous onchange() call. chai.assert.equal(elseInput.getParent(), block, 'ELSE is connected'); if (opt_parent) { chai.assert.equal(block.getParent(), opt_parent, diff --git a/tests/mocha/test_helpers.js b/tests/mocha/test_helpers.js index b5f044d14..7f4245070 100644 --- a/tests/mocha/test_helpers.js +++ b/tests/mocha/test_helpers.js @@ -7,6 +7,7 @@ goog.module('Blockly.test.helpers'); const KeyCodes = goog.require('Blockly.utils.KeyCodes'); +const eventUtils = goog.require('Blockly.Events.utils'); const {Blocks} = goog.require('Blockly.blocks'); @@ -114,7 +115,7 @@ exports.workspaceTeardown = workspaceTeardown; * @private */ function createEventsFireStubFireImmediately_(clock) { - var stub = sinon.stub(Blockly.Events, 'fire'); + var stub = sinon.stub(eventUtils, 'fire'); stub.callsFake(function(event) { // Call original method. stub.wrappedMethod.call(this, ...arguments); @@ -230,16 +231,16 @@ function sharedTestTeardown() { console.error(testRef.fullTitle() + '\n', e); } finally { // Clear Blockly.Event state. - Blockly.Events.setGroup(false); - while (!Blockly.Events.isEnabled()) { - Blockly.Events.enable(); + eventUtils.setGroup(false); + while (!eventUtils.isEnabled()) { + eventUtils.enable(); } - Blockly.Events.setRecordUndo(true); - if (Blockly.Events.TEST_ONLY.FIRE_QUEUE.length) { + eventUtils.setRecordUndo(true); + if (eventUtils.TEST_ONLY.FIRE_QUEUE.length) { // If this happens, it may mean that some previous test is missing cleanup // (i.e. a previous test added an event to the queue on a timeout that // did not use a stubbed clock). - Blockly.Events.TEST_ONLY.FIRE_QUEUE.length = 0; + eventUtils.TEST_ONLY.FIRE_QUEUE.length = 0; console.warn('"' + testRef.fullTitle() + '" needed cleanup of Blockly.Events.TEST_ONLY.FIRE_QUEUE. This may ' + 'indicate leakage from an earlier test'); diff --git a/tests/mocha/trashcan_test.js b/tests/mocha/trashcan_test.js index ec3076502..f24022740 100644 --- a/tests/mocha/trashcan_test.js +++ b/tests/mocha/trashcan_test.js @@ -7,6 +7,7 @@ goog.module('Blockly.test.trashcan'); const {assertEventFired, assertEventNotFired, defineBasicBlockWithField, defineRowBlock, defineStatementBlock, defineStackBlock, defineMutatorBlocks, sharedTestSetup, sharedTestTeardown, simulateClick} = goog.require('Blockly.test.helpers'); +const eventUtils = goog.require('Blockly.Events.utils'); suite("Trashcan", function() { @@ -17,7 +18,7 @@ suite("Trashcan", function() { xml = xml.children[0]; var block = Blockly.Xml.domToBlock(xml, workspace); var event = new Blockly.Events.BlockDelete(block); - Blockly.Events.fire(event); + eventUtils.fire(event); } function fireNonDeleteEvent(workspace, oldXml) { var event = new Blockly.Events.Abstract(); @@ -26,7 +27,7 @@ suite("Trashcan", function() { if (oldXml) { event.oldXml = oldXml; } - Blockly.Events.fire(/** @type {Blockly.Events.Abstract} */ event); + eventUtils.fire(/** @type {Blockly.Events.Abstract} */ event); } setup(function() { diff --git a/tests/mocha/workspace_helpers.js b/tests/mocha/workspace_helpers.js index 9d4abea4e..72134e386 100644 --- a/tests/mocha/workspace_helpers.js +++ b/tests/mocha/workspace_helpers.js @@ -7,6 +7,7 @@ goog.module('Blockly.test.workspaceHelpers'); const {assertVariableValues, assertWarnings, workspaceTeardown} = goog.require('Blockly.test.helpers'); +const eventUtils = goog.require('Blockly.Events.utils'); function testAWorkspace() { @@ -26,8 +27,10 @@ function testAWorkspace() { teardown(function() { // Clear Blockly.Event state. - Blockly.Events.setGroup(false); - Blockly.Events.disabled_ = 0; + eventUtils.setGroup(false); + while (!eventUtils.isEnabled()) { + eventUtils.enable(); + } sinon.restore(); }); @@ -45,19 +48,19 @@ function testAWorkspace() { function createVarBlocksNoEvents(workspace, ids) { var blocks = []; // Turn off events to avoid testing XML at the same time. - Blockly.Events.disable(); + eventUtils.disable(); for (var i = 0, id; (id = ids[i]); i++) { var block = new Blockly.Block(workspace, 'get_var_block'); block.inputList[0].fieldRow[0].setValue(id); blocks.push(block); } - Blockly.Events.enable(); + eventUtils.enable(); return blocks; } suite('clear', function() { test('Trivial', function() { - sinon.stub(Blockly.Events, "setGroup").returns(null); + sinon.stub(eventUtils, "setGroup").returns(null); this.workspace.createVariable('name1', 'type1', 'id1'); this.workspace.createVariable('name2', 'type2', 'id2'); this.workspace.newBlock(''); @@ -70,7 +73,7 @@ function testAWorkspace() { }); test('No variables', function() { - sinon.stub(Blockly.Events, "setGroup").returns(null); + sinon.stub(eventUtils, "setGroup").returns(null); this.workspace.newBlock(''); this.workspace.clear();