diff --git a/core/blockly.js b/core/blockly.js index 64b643510..55fa06bda 100644 --- a/core/blockly.js +++ b/core/blockly.js @@ -347,135 +347,6 @@ exports.setParentContainer = common.setParentContainer; * Anything in this section may be removed in a future version of Blockly. */ -// Add accessors for properties on Blockly that have now been deprecated. -Object.defineProperties(exports, { - /** - * Wrapper to window.alert() that app developers may override to - * provide alternatives to the modal browser window. - * @name Blockly.alert - * @type {!function(string, function()=)} - * @deprecated Use Blockly.dialog.alert / .setAlert() instead. - * (December 2021) - * @suppress {checkTypes} - */ - alert: { - set: function(newAlert) { - deprecation.warn('Blockly.alert', 'December 2021', 'December 2022'); - dialog.setAlert(newAlert); - }, - get: function() { - deprecation.warn( - 'Blockly.alert', 'December 2021', 'December 2022', - 'Blockly.dialog.alert()'); - return dialog.alert; - }, - }, - /** - * Wrapper to window.confirm() that app developers may override to - * provide alternatives to the modal browser window. - * @name Blockly.confirm - * @type {!function(string, function()=)} - * @deprecated Use Blockly.dialog.confirm / .setConfirm() instead. - * (December 2021) - * @suppress {checkTypes} - */ - confirm: { - set: function(newConfirm) { - deprecation.warn('Blockly.confirm', 'December 2021', 'December 2022'); - dialog.setConfirm(newConfirm); - }, - get: function() { - deprecation.warn( - 'Blockly.confirm', 'December 2021', 'December 2022', - 'Blockly.dialog.confirm()'); - return dialog.confirm; - }, - }, - /** - * The main workspace most recently used. - * Set by Blockly.WorkspaceSvg.prototype.markFocused - * @name Blockly.mainWorkspace - * @type {Workspace} - * @suppress {checkTypes} - */ - mainWorkspace: { - set: function(x) { - common.setMainWorkspace(x); - }, - get: function() { - return common.getMainWorkspace(); - }, - }, - /** - * Wrapper to window.prompt() that app developers may override to - * provide alternatives to the modal browser window. Built-in - * browser prompts are often used for better text input experience - * on mobile device. We strongly recommend testing mobile when - * overriding this. - * @name Blockly.prompt - * @type {!function(string, string, function()=)} - * @deprecated Use Blockly.dialog.prompt / .setPrompt() instead. - * (December 2021) - * @suppress {checkTypes} - */ - prompt: { - set: function(newPrompt) { - deprecation.warn('Blockly.prompt', 'December 2021', 'December 2022'); - dialog.setPrompt(newPrompt); - }, - get: function() { - deprecation.warn( - 'Blockly.prompt', 'December 2021', 'December 2022', - 'Blockly.dialog.prompt()'); - return dialog.prompt; - }, - }, - /** - * Currently selected block. - * @name Blockly.selected - * @type {?ICopyable} - * @suppress {checkTypes} - */ - selected: { - get: function() { - return common.getSelected(); - }, - set: function(newSelection) { - common.setSelected(newSelection); - }, - }, - /** - * The richness of block colours, regardless of the hue. - * Must be in the range of 0 (inclusive) to 1 (exclusive). - * @name Blockly.HSV_SATURATION - * @type {number} - * @suppress {checkTypes} - */ - HSV_SATURATION: { - get: function() { - return utils.colour.getHsvSaturation(); - }, - set: function(newValue) { - utils.colour.setHsvSaturation(newValue); - }, - }, - /** - * The intensity of block colours, regardless of the hue. - * Must be in the range of 0 (inclusive) to 1 (exclusive). - * @name Blockly.HSV_VALUE - * @type {number} - * @suppress {checkTypes} - */ - HSV_VALUE: { - get: function() { - return utils.colour.getHsvValue(); - }, - set: function(newValue) { - utils.colour.setHsvValue(newValue); - }, - }, -}); - /** * Returns the dimensions of the specified SVG image. * @param {!SVGElement} svg SVG image. @@ -840,49 +711,3 @@ exports.thrasos = thrasos; exports.uiPosition = uiPosition; exports.utils = utils; exports.zelos = zelos; - -// If Blockly is compiled with ADVANCED_COMPILATION and/or loaded as a -// CJS or ES module there will not be a Blockly global variable -// created. This can cause problems because a very common way of -// loading translations is to use a