Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 0 additions & 129 deletions core/blockly.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,135 +348,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.
Expand Down
27 changes: 0 additions & 27 deletions core/contextmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const Xml = goog.require('Blockly.Xml');
const aria = goog.require('Blockly.utils.aria');
const browserEvents = goog.require('Blockly.browserEvents');
const clipboard = goog.require('Blockly.clipboard');
const deprecation = goog.require('Blockly.utils.deprecation');
const dom = goog.require('Blockly.utils.dom');
const eventUtils = goog.require('Blockly.Events.utils');
const userAgent = goog.require('Blockly.utils.userAgent');
Expand Down Expand Up @@ -71,32 +70,6 @@ const setCurrentBlock = function(block) {
};
exports.setCurrentBlock = setCurrentBlock;

// Add JS accessors for backwards compatibility.
Object.defineProperties(exports, {
/**
* Which block is the context menu attached to?
* @name Blockly.ContextMenu.currentBlock
* @type {Block}
* @deprecated Use Blockly.Tooltip.getCurrentBlock() /
* .setCurrentBlock() instead. (September 2021)
* @suppress {checkTypes}
*/
currentBlock: {
get: function() {
deprecation.warn(
'Blockly.ContextMenu.currentBlock', 'September 2021',
'September 2022', 'Blockly.Tooltip.getCurrentBlock()');
return getCurrentBlock();
},
set: function(block) {
deprecation.warn(
'Blockly.ContextMenu.currentBlock', 'September 2021',
'September 2022', 'Blockly.Tooltip.setCurrentBlock(block)');
setCurrentBlock(block);
},
},
});

/**
* Menu object.
* @type {Menu}
Expand Down
26 changes: 0 additions & 26 deletions core/events/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
goog.module('Blockly.Events');

const deprecation = goog.require('Blockly.utils.deprecation');
const eventUtils = goog.require('Blockly.Events.utils');
const {Abstract: AbstractEvent} = goog.require('Blockly.Events.Abstract');
const {BlockBase} = goog.require('Blockly.Events.BlockBase');
Expand Down Expand Up @@ -120,28 +119,3 @@ exports.isEnabled = eventUtils.isEnabled;
exports.setGroup = eventUtils.setGroup;
exports.setRecordUndo = eventUtils.setRecordUndo;
exports.disableOrphans = eventUtils.disableOrphans;

Object.defineProperties(exports, {
/**
* Sets whether the next event should be added to the undo stack.
* @name Blockly.Evenents.recordUndo
* @type {boolean}
* @deprecated Use Blockly.Events.getRecordUndo() and
* .setRecordUndo(). (September 2021)
* @suppress {checkTypes}
*/
recordUndo: {
get: function() {
deprecation.warn(
'Blockly.Events.recordUndo', 'September 2021', 'September 2022',
'Blockly.Events.getRecordUndo()');
return eventUtils.getRecordUndo();
},
set: function(record) {
deprecation.warn(
'Blockly.Events.recordUndo', 'September 2021', 'September 2022',
'Blockly.Events.setRecordUndo()');
eventUtils.setRecordUndo(record);
},
},
});
4 changes: 2 additions & 2 deletions core/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,15 +547,15 @@ Object.defineProperties(Generator.prototype, {
* @return {!Names|undefined} Name database.
*/
get: function() {
deprecation.warn('variableDB_', 'May 2021', 'May 2026', 'nameDB_');
deprecation.warn('variableDB_', 'May 2021', 'September 2022', 'nameDB_');
return this.nameDB_;
},
/**
* @this {Generator}
* @param {!Names|undefined} nameDb New name database.
*/
set: function(nameDb) {
deprecation.warn('variableDB_', 'May 2021', 'May 2026', 'nameDB_');
deprecation.warn('variableDB_', 'May 2021', 'September 2022', 'nameDB_');
this.nameDB_ = nameDb;
},
},
Expand Down
39 changes: 0 additions & 39 deletions core/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ goog.module('Blockly.Tooltip');
const blocklyString = goog.require('Blockly.utils.string');
const browserEvents = goog.require('Blockly.browserEvents');
const common = goog.require('Blockly.common');
const deprecation = goog.require('Blockly.utils.deprecation');


/**
Expand Down Expand Up @@ -90,25 +89,6 @@ const isVisible = function() {
};
exports.isVisible = isVisible;

Object.defineProperties(exports, {
/**
* Is a tooltip currently showing?
* @name Blockly.Tooltip.visible
* @type {boolean}
* @deprecated Use Blockly.Tooltip.isVisible() instead. (September
* 2021)
* @suppress {checkTypes}
*/
visible: {
get: function() {
deprecation.warn(
'Blockly.Tooltip.visible', 'September 2021', 'September 2022',
'Blockly.Tooltip.isVisible()');
return isVisible();
},
},
});

/**
* Is someone else blocking the tooltip from being shown?
* @type {boolean}
Expand Down Expand Up @@ -206,25 +186,6 @@ const getDiv = function() {
};
exports.getDiv = getDiv;

Object.defineProperties(exports, {
/**
* The HTML container. Set once by createDom.
* @name Blockly.Tooltip.DIV
* @type {HTMLDivElement}
* @deprecated Use Blockly.Tooltip.getDiv() and .setDiv().
* (September 2021)
* @suppress {checkTypes}
*/
DIV: {
get: function() {
deprecation.warn(
'Blockly.Tooltip.DIV', 'September 2021', 'September 2022',
'Blockly.Tooltip.getDiv()');
return getDiv();
},
},
});

/**
* Returns the tooltip text for the given element.
* @param {?Object} object The object to get the tooltip text of.
Expand Down
20 changes: 0 additions & 20 deletions core/widgetdiv.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
goog.module('Blockly.WidgetDiv');

const common = goog.require('Blockly.common');
const deprecation = goog.require('Blockly.utils.deprecation');
const dom = goog.require('Blockly.utils.dom');
/* eslint-disable-next-line no-unused-vars */
const {Rect} = goog.requireType('Blockly.utils.Rect');
Expand Down Expand Up @@ -81,25 +80,6 @@ const testOnly_setDiv = function(newDiv) {
};
exports.testOnly_setDiv = testOnly_setDiv;

Object.defineProperties(exports, {
/**
* The HTML container for popup overlays (e.g. editor widgets).
* @name Blockly.WidgetDiv.DIV
* @type {?Element}
* @deprecated Use Blockly.WidgetDiv.getDiv() and .setDiv().
* (September 2021)
* @suppress {checkTypes}
*/
DIV: {
get: function() {
deprecation.warn(
'Blockly.WidgetDiv.DIV', 'September 2021', 'September 2022',
'Blockly.WidgetDiv.getDiv()');
return getDiv();
},
},
});

/**
* Create the widget div and inject it onto the page.
* @alias Blockly.WidgetDiv.createDom
Expand Down
18 changes: 17 additions & 1 deletion scripts/migration/renamings.json5
Original file line number Diff line number Diff line change
Expand Up @@ -1332,5 +1332,21 @@
},
],

'develop': [ ],
'develop': [
{
oldName: 'Blockly',
exports: {
HSV_SATURATION: {
newModule: 'Blockly.utils.colour',
getMethod: 'getHsvSaturation',
setMethod: 'setHsvSaturation',
},
HSV_Value: {
newModule: 'Blockly.utils.colour',
getMethod: 'getHsvValue',
setMethod: 'setHsvValue',
},
}
},
],
}