Skip to content

Commit 2042334

Browse files
release: v10.0.1
Merge pull request #7270 from google/rc/v10.0.1
2 parents d832085 + 82e8697 commit 2042334

3 files changed

Lines changed: 75 additions & 5 deletions

File tree

core/main.js

Lines changed: 72 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,79 @@
1313

1414
goog.module('Blockly.main');
1515

16-
/** @suppress {extraRequire} */
17-
goog.require('Blockly');
16+
const Blockly = goog.require('Blockly');
1817
const Msg = goog.require('Blockly.Msg');
18+
const colour = goog.require('Blockly.utils.colour');
19+
const deprecation = goog.require('Blockly.utils.deprecation');
20+
21+
/*
22+
* Aliased functions and properties that used to be on the Blockly namespace.
23+
* Everything in this section is deprecated. Both external and internal code
24+
* should avoid using these functions and use the designated replacements.
25+
* Everything in this section will be removed in a future version of Blockly.
26+
*/
27+
28+
// Add accessors for properties on Blockly that have now been deprecated.
29+
Object.defineProperties(Blockly, {
30+
/**
31+
* The richness of block colours, regardless of the hue.
32+
* Must be in the range of 0 (inclusive) to 1 (exclusive).
33+
* @name Blockly.HSV_SATURATION
34+
* @type {number}
35+
* @deprecated Use Blockly.colour.getHsvSaturation() / .setHsvSaturation(
36+
* instead. (July 2023)
37+
* @suppress {checkTypes}
38+
*/
39+
HSV_SATURATION: {
40+
get: function () {
41+
deprecation.warn(
42+
'Blockly.HSV_SATURATION',
43+
'version 10',
44+
'version 11',
45+
'Blockly.colour.getHsvSaturation()'
46+
);
47+
return colour.getHsvSaturation();
48+
},
49+
set: function (newValue) {
50+
deprecation.warn(
51+
'Blockly.HSV_SATURATION',
52+
'version 10',
53+
'version 11',
54+
'Blockly.colour.setHsvSaturation()'
55+
);
56+
colour.setHsvSaturation(newValue);
57+
},
58+
},
59+
/**
60+
* The intensity of block colours, regardless of the hue.
61+
* Must be in the range of 0 (inclusive) to 1 (exclusive).
62+
* @name Blockly.HSV_VALUE
63+
* @type {number}
64+
* @deprecated Use Blockly.colour.getHsvValue() / .setHsvValue instead.
65+
* (July 2023)
66+
* @suppress {checkTypes}
67+
*/
68+
HSV_VALUE: {
69+
get: function () {
70+
deprecation.warn(
71+
'Blockly.HSV_VALUE',
72+
'version 10',
73+
'version 11',
74+
'Blockly.colour.getHsvValue()'
75+
);
76+
return colour.getHsvValue();
77+
},
78+
set: function (newValue) {
79+
deprecation.warn(
80+
'Blockly.HSV_VALUE',
81+
'version 10',
82+
'version 11',
83+
'Blockly.colour.setHsvValue()'
84+
);
85+
colour.setHsvValue(newValue);
86+
},
87+
},
88+
});
1989

2090
// If Blockly is compiled with ADVANCED_COMPILATION and/or loaded as a
2191
// CJS or ES module there will not be a Blockly global variable

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "blockly",
3-
"version": "10.0.0",
3+
"version": "10.0.1",
44
"description": "Blockly is a library for building visual programming editors.",
55
"keywords": [
66
"blockly"

0 commit comments

Comments
 (0)