From 7d062275546def2e3ec5508dc33282f639fc6cd8 Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Mon, 17 Jul 2023 21:38:43 +0200 Subject: [PATCH 1/2] fix: Correct errors in HSV_SATURATION, HSV_VALUE accessors Fix the comment / message errors noted in https://github.com/google/blockly/pull/7249#issuecomment-1638645810 --- core/main.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/main.js b/core/main.js index 0b8e1a1712a..cc83733d46c 100644 --- a/core/main.js +++ b/core/main.js @@ -32,8 +32,8 @@ Object.defineProperties(Blockly, { * Must be in the range of 0 (inclusive) to 1 (exclusive). * @name Blockly.HSV_SATURATION * @type {number} - * @deprecated Use Blockly.colour.getHsvSaturation() / .setHsvSaturation( - * instead. (July 2023) + * @deprecated Use Blockly.utils.colour.getHsvSaturation() / + * .setHsvSaturation() instead. (July 2023) * @suppress {checkTypes} */ HSV_SATURATION: { @@ -42,7 +42,7 @@ Object.defineProperties(Blockly, { 'Blockly.HSV_SATURATION', 'version 10', 'version 11', - 'Blockly.colour.getHsvSaturation()' + 'Blockly.utils.colour.getHsvSaturation()' ); return colour.getHsvSaturation(); }, @@ -51,7 +51,7 @@ Object.defineProperties(Blockly, { 'Blockly.HSV_SATURATION', 'version 10', 'version 11', - 'Blockly.colour.setHsvSaturation()' + 'Blockly.utils.colour.setHsvSaturation()' ); colour.setHsvSaturation(newValue); }, @@ -61,7 +61,7 @@ Object.defineProperties(Blockly, { * Must be in the range of 0 (inclusive) to 1 (exclusive). * @name Blockly.HSV_VALUE * @type {number} - * @deprecated Use Blockly.colour.getHsvValue() / .setHsvValue instead. + * @deprecated Use Blockly.utils.colour.getHsvValue() / .setHsvValue instead. * (July 2023) * @suppress {checkTypes} */ @@ -71,7 +71,7 @@ Object.defineProperties(Blockly, { 'Blockly.HSV_VALUE', 'version 10', 'version 11', - 'Blockly.colour.getHsvValue()' + 'Blockly.utils.colour.getHsvValue()' ); return colour.getHsvValue(); }, @@ -80,7 +80,7 @@ Object.defineProperties(Blockly, { 'Blockly.HSV_VALUE', 'version 10', 'version 11', - 'Blockly.colour.setHsvValue()' + 'Blockly.utils.colour.setHsvValue()' ); colour.setHsvValue(newValue); }, From 57d0bb3833b634b7cd7a45ef2da79faf31ed6c5b Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Mon, 17 Jul 2023 21:39:25 +0200 Subject: [PATCH 2/2] chore: Add renamings for HSV_SATURATION, HSV_VALUE --- scripts/migration/renamings.json5 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/scripts/migration/renamings.json5 b/scripts/migration/renamings.json5 index ee1c33834f7..97fbc3fc0fc 100644 --- a/scripts/migration/renamings.json5 +++ b/scripts/migration/renamings.json5 @@ -1577,5 +1577,23 @@ }, ], + '10.0.1': [ + { + oldName: 'Blockly', + exports: { + HSV_SATURATION: { + newModule: 'Blockly.utils.colour', + getMethod: 'getHsvSaturation', + setMethod: 'setHsvSaturation', + }, + HSV_VALUE: { + newModule: 'Blockly.utils.colour', + getMethod: 'getHsvValue', + setMethod: 'setHsvValue', + }, + }, + }, + ], + 'develop': [], }