From 19e86ed5dbca92be79e9d6de17454922b5e7d22c Mon Sep 17 00:00:00 2001 From: kozbial Date: Fri, 16 Jul 2021 11:52:13 -0700 Subject: [PATCH] Migrate core/interfaces/i_block_dragger.js to goog.module --- core/interfaces/i_block_dragger.js | 15 +++++++++------ tests/deps.js | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/core/interfaces/i_block_dragger.js b/core/interfaces/i_block_dragger.js index ec7b79ac6..2276c7459 100644 --- a/core/interfaces/i_block_dragger.js +++ b/core/interfaces/i_block_dragger.js @@ -11,7 +11,8 @@ 'use strict'; -goog.provide('Blockly.IBlockDragger'); +goog.module('Blockly.IBlockDragger'); +goog.module.declareLegacyNamespace(); goog.requireType('Blockly.BlockSvg'); goog.requireType('Blockly.utils.Coordinate'); @@ -21,7 +22,7 @@ goog.requireType('Blockly.utils.Coordinate'); * A block dragger interface. * @interface */ -Blockly.IBlockDragger = function() {}; +const IBlockDragger = function() {}; /** * Start dragging a block. This includes moving it to the drag surface. @@ -30,7 +31,7 @@ Blockly.IBlockDragger = function() {}; * @param {boolean} healStack Whether or not to heal the stack after * disconnecting. */ -Blockly.IBlockDragger.prototype.startDrag; +IBlockDragger.prototype.startDrag; /** * Execute a step of block dragging, based on the given event. Update the @@ -39,7 +40,7 @@ Blockly.IBlockDragger.prototype.startDrag; * @param {!Blockly.utils.Coordinate} currentDragDeltaXY How far the pointer has * moved from the position at the start of the drag, in pixel units. */ -Blockly.IBlockDragger.prototype.drag; +IBlockDragger.prototype.drag; /** * Finish a block drag and put the block back on the workspace. @@ -47,7 +48,7 @@ Blockly.IBlockDragger.prototype.drag; * @param {!Blockly.utils.Coordinate} currentDragDeltaXY How far the pointer has * moved from the position at the start of the drag, in pixel units. */ -Blockly.IBlockDragger.prototype.endDrag; +IBlockDragger.prototype.endDrag; /** * Get a list of the insertion markers that currently exist. Drags have 0, 1, @@ -55,4 +56,6 @@ Blockly.IBlockDragger.prototype.endDrag; * @return {!Array.} A possibly empty list of insertion * marker blocks. */ -Blockly.IBlockDragger.prototype.getInsertionMarkers; +IBlockDragger.prototype.getInsertionMarkers; + +exports = IBlockDragger; diff --git a/tests/deps.js b/tests/deps.js index c9321eaf9..5a06dd4ae 100644 --- a/tests/deps.js +++ b/tests/deps.js @@ -75,7 +75,7 @@ goog.addDependency('../../core/input_types.js', ['Blockly.inputTypes'], ['Blockl goog.addDependency('../../core/insertion_marker_manager.js', ['Blockly.InsertionMarkerManager'], ['Blockly.ComponentManager', 'Blockly.Events', 'Blockly.blockAnimations', 'Blockly.connectionTypes', 'Blockly.constants'], {'lang': 'es5'}); goog.addDependency('../../core/interfaces/i_accessibility.js', ['Blockly.IASTNodeLocation', 'Blockly.IASTNodeLocationSvg', 'Blockly.IASTNodeLocationWithBlock', 'Blockly.IKeyboardAccessible'], []); goog.addDependency('../../core/interfaces/i_autohideable.js', ['Blockly.IAutoHideable'], ['Blockly.IComponent']); -goog.addDependency('../../core/interfaces/i_block_dragger.js', ['Blockly.IBlockDragger'], []); +goog.addDependency('../../core/interfaces/i_block_dragger.js', ['Blockly.IBlockDragger'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/interfaces/i_bounded_element.js', ['Blockly.IBoundedElement'], []); goog.addDependency('../../core/interfaces/i_bubble.js', ['Blockly.IBubble'], ['Blockly.IContextMenu', 'Blockly.IDraggable']); goog.addDependency('../../core/interfaces/i_component.js', ['Blockly.IComponent'], []);