From f723d1d3842cac4caa4dd75c253f4455db1b8079 Mon Sep 17 00:00:00 2001 From: kozbial Date: Fri, 16 Jul 2021 13:09:04 -0700 Subject: [PATCH] Migrate core/interfaces/i_drag_target.js to goog.module --- core/interfaces/i_drag_target.js | 19 +++++++++++-------- tests/deps.js | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/core/interfaces/i_drag_target.js b/core/interfaces/i_drag_target.js index 0af765d57..ada85a8e3 100644 --- a/core/interfaces/i_drag_target.js +++ b/core/interfaces/i_drag_target.js @@ -12,7 +12,8 @@ 'use strict'; -goog.provide('Blockly.IDragTarget'); +goog.module('Blockly.IDragTarget'); +goog.module.declareLegacyNamespace(); goog.require('Blockly.IComponent'); @@ -25,7 +26,7 @@ goog.requireType('Blockly.utils.Rect'); * @extends {Blockly.IComponent} * @interface */ -Blockly.IDragTarget = function() {}; +const IDragTarget = function() {}; /** * Returns the bounding rectangle of the drag target area in pixel units @@ -33,14 +34,14 @@ Blockly.IDragTarget = function() {}; * @return {?Blockly.utils.Rect} The component's bounding box. Null if drag * target area should be ignored. */ -Blockly.IDragTarget.prototype.getClientRect; +IDragTarget.prototype.getClientRect; /** * Handles when a cursor with a block or bubble enters this drag target. * @param {!Blockly.IDraggable} dragElement The block or bubble currently being * dragged. */ -Blockly.IDragTarget.prototype.onDragEnter; +IDragTarget.prototype.onDragEnter; /** * Handles when a cursor with a block or bubble is dragged over this drag @@ -48,7 +49,7 @@ Blockly.IDragTarget.prototype.onDragEnter; * @param {!Blockly.IDraggable} dragElement The block or bubble currently being * dragged. */ -Blockly.IDragTarget.prototype.onDragOver; +IDragTarget.prototype.onDragOver; /** @@ -56,7 +57,7 @@ Blockly.IDragTarget.prototype.onDragOver; * @param {!Blockly.IDraggable} dragElement The block or bubble currently being * dragged. */ -Blockly.IDragTarget.prototype.onDragExit; +IDragTarget.prototype.onDragExit; /** * Handles when a block or bubble is dropped on this component. @@ -64,7 +65,7 @@ Blockly.IDragTarget.prototype.onDragExit; * @param {!Blockly.IDraggable} dragElement The block or bubble currently being * dragged. */ -Blockly.IDragTarget.prototype.onDrop; +IDragTarget.prototype.onDrop; /** * Returns whether the provided block or bubble should not be moved after being @@ -75,4 +76,6 @@ Blockly.IDragTarget.prototype.onDrop; * @return {boolean} Whether the block or bubble provided should be returned to * drag start. */ -Blockly.IDragTarget.prototype.shouldPreventMove; +IDragTarget.prototype.shouldPreventMove; + +exports = IDragTarget; diff --git a/tests/deps.js b/tests/deps.js index 56cbcce9e..7a562a115 100644 --- a/tests/deps.js +++ b/tests/deps.js @@ -84,7 +84,7 @@ goog.addDependency('../../core/interfaces/i_contextmenu.js', ['Blockly.IContextM goog.addDependency('../../core/interfaces/i_copyable.js', ['Blockly.ICopyable'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/interfaces/i_deletable.js', ['Blockly.IDeletable'], [], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/interfaces/i_delete_area.js', ['Blockly.IDeleteArea'], ['Blockly.IDragTarget'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/interfaces/i_drag_target.js', ['Blockly.IDragTarget'], ['Blockly.IComponent']); +goog.addDependency('../../core/interfaces/i_drag_target.js', ['Blockly.IDragTarget'], ['Blockly.IComponent'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/interfaces/i_draggable.js', ['Blockly.IDraggable'], ['Blockly.IDeletable'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/interfaces/i_flyout.js', ['Blockly.IFlyout'], []); goog.addDependency('../../core/interfaces/i_metrics_manager.js', ['Blockly.IMetricsManager'], []);