From 3aae7ffbde2a161b8ee60aa7bd3bcf78e054b0f8 Mon Sep 17 00:00:00 2001 From: kozbial Date: Thu, 29 Jul 2021 16:22:37 -0700 Subject: [PATCH] Migrate core/renderers/common/i_path_object.js to goog.module --- core/renderers/common/i_path_object.js | 41 ++++++++++++++------------ tests/deps.js | 2 +- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/core/renderers/common/i_path_object.js b/core/renderers/common/i_path_object.js index 6a7dfc2b7..01a279e03 100644 --- a/core/renderers/common/i_path_object.js +++ b/core/renderers/common/i_path_object.js @@ -12,7 +12,8 @@ 'use strict'; -goog.provide('Blockly.blockRendering.IPathObject'); +goog.module('Blockly.blockRendering.IPathObject'); +goog.module.declareLegacyNamespace(); goog.requireType('Blockly.Block'); goog.requireType('Blockly.blockRendering.ConstantProvider'); @@ -26,46 +27,46 @@ goog.requireType('Blockly.Theme'); * constants. * @interface */ -Blockly.blockRendering.IPathObject = function(_root, _constants) {}; +const IPathObject = function(_root, _constants) {}; /** * The primary path of the block. * @type {!SVGElement} */ -Blockly.blockRendering.IPathObject.prototype.svgPath; +IPathObject.prototype.svgPath; /** * The renderer's constant provider. * @type {!Blockly.blockRendering.ConstantProvider} */ -Blockly.blockRendering.IPathObject.prototype.constants; +IPathObject.prototype.constants; /** * The primary path of the block. * @type {!Blockly.Theme.BlockStyle} */ -Blockly.blockRendering.IPathObject.prototype.style; +IPathObject.prototype.style; /** * Holds the cursors SVG element when the cursor is attached to the block. * This is null if there is no cursor on the block. * @type {SVGElement} */ -Blockly.blockRendering.IPathObject.prototype.cursorSvg; +IPathObject.prototype.cursorSvg; /** * Holds the markers SVG element when the marker is attached to the block. * This is null if there is no marker on the block. * @type {SVGElement} */ -Blockly.blockRendering.IPathObject.prototype.markerSvg; +IPathObject.prototype.markerSvg; /** * Set the path generated by the renderer onto the respective SVG element. * @param {string} pathString The path. * @package */ -Blockly.blockRendering.IPathObject.prototype.setPath; +IPathObject.prototype.setPath; /** * Apply the stored colours to the block's path, taking into account whether @@ -73,20 +74,20 @@ Blockly.blockRendering.IPathObject.prototype.setPath; * @param {!Blockly.Block} block The source block. * @package */ -Blockly.blockRendering.IPathObject.prototype.applyColour; +IPathObject.prototype.applyColour; /** * Update the style. * @param {!Blockly.Theme.BlockStyle} blockStyle The block style to use. * @package */ -Blockly.blockRendering.IPathObject.prototype.setStyle; +IPathObject.prototype.setStyle; /** * Flip the SVG paths in RTL. * @package */ -Blockly.blockRendering.IPathObject.prototype.flipRTL; +IPathObject.prototype.flipRTL; /** * Add the cursor SVG to this block's SVG group. @@ -94,7 +95,7 @@ Blockly.blockRendering.IPathObject.prototype.flipRTL; * block SVG group. * @package */ -Blockly.blockRendering.IPathObject.prototype.setCursorSvg; +IPathObject.prototype.setCursorSvg; /** * Add the marker SVG to this block's SVG group. @@ -102,7 +103,7 @@ Blockly.blockRendering.IPathObject.prototype.setCursorSvg; * block SVG group. * @package */ -Blockly.blockRendering.IPathObject.prototype.setMarkerSvg; +IPathObject.prototype.setMarkerSvg; /** * Set whether the block shows a highlight or not. Block highlighting is @@ -110,14 +111,14 @@ Blockly.blockRendering.IPathObject.prototype.setMarkerSvg; * @param {boolean} highlighted True if highlighted. * @package */ -Blockly.blockRendering.IPathObject.prototype.updateHighlighted; +IPathObject.prototype.updateHighlighted; /** * Add or remove styling showing that a block is selected. * @param {boolean} enable True if selection is enabled, false otherwise. * @package */ -Blockly.blockRendering.IPathObject.prototype.updateSelected; +IPathObject.prototype.updateSelected; /** * Add or remove styling showing that a block is dragged over a delete area. @@ -125,7 +126,7 @@ Blockly.blockRendering.IPathObject.prototype.updateSelected; * area, false otherwise. * @package */ -Blockly.blockRendering.IPathObject.prototype.updateDraggingDelete; +IPathObject.prototype.updateDraggingDelete; /** * Add or remove styling showing that a block is an insertion marker. @@ -133,14 +134,14 @@ Blockly.blockRendering.IPathObject.prototype.updateDraggingDelete; * otherwise. * @package */ -Blockly.blockRendering.IPathObject.prototype.updateInsertionMarker; +IPathObject.prototype.updateInsertionMarker; /** * Add or remove styling showing that a block is movable. * @param {boolean} enable True if the block is movable, false otherwise. * @package */ -Blockly.blockRendering.IPathObject.prototype.updateMovable; +IPathObject.prototype.updateMovable; /** * Add or remove styling that shows that if the dragging block is dropped, this @@ -149,4 +150,6 @@ Blockly.blockRendering.IPathObject.prototype.updateMovable; * @param {boolean} enable True if styling should be added. * @package */ -Blockly.blockRendering.IPathObject.prototype.updateReplacementFade; +IPathObject.prototype.updateReplacementFade; + +exports = IPathObject; diff --git a/tests/deps.js b/tests/deps.js index 3eaba3083..64c88377b 100644 --- a/tests/deps.js +++ b/tests/deps.js @@ -125,7 +125,7 @@ goog.addDependency('../../core/renderers/common/block_rendering.js', ['Blockly.b goog.addDependency('../../core/renderers/common/constants.js', ['Blockly.blockRendering.ConstantProvider'], ['Blockly.connectionTypes', 'Blockly.utils', 'Blockly.utils.Svg', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.svgPaths', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/renderers/common/debugger.js', ['Blockly.blockRendering.Debug'], ['Blockly.blockRendering.Measurable', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.Types', 'Blockly.connectionTypes', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es5'}); goog.addDependency('../../core/renderers/common/drawer.js', ['Blockly.blockRendering.Drawer'], ['Blockly.blockRendering.Row', 'Blockly.blockRendering.Types', 'Blockly.utils.svgPaths'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/renderers/common/i_path_object.js', ['Blockly.blockRendering.IPathObject'], []); +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.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RoundCorner', 'Blockly.blockRendering.Row', '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.Events', 'Blockly.Events.MarkerMove', 'Blockly.connectionTypes', 'Blockly.utils.Svg', 'Blockly.utils.dom']); goog.addDependency('../../core/renderers/common/path_object.js', ['Blockly.blockRendering.PathObject'], ['Blockly.blockRendering.IPathObject', 'Blockly.utils.Svg', 'Blockly.utils.dom'], {'lang': 'es6', 'module': 'goog'});