mirror of
https://github.com/google/blockly.git
synced 2026-01-10 18:37:09 +01:00
Migrate core/interfaces/i_collapsible_toolbox_item.js, core/interfaces/i_selectable_toolbox_item.js, and core/interfaces/i_toolbox_item.js to goog.module
This commit is contained in:
@@ -11,10 +11,11 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
goog.provide('Blockly.ICollapsibleToolboxItem');
|
||||
goog.module('Blockly.ICollapsibleToolboxItem');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
goog.require('Blockly.IToolboxItem');
|
||||
goog.requireType('Blockly.utils.toolbox');
|
||||
goog.require('Blockly.ISelectableToolboxItem');
|
||||
goog.requireType('Blockly.IToolboxItem');
|
||||
|
||||
|
||||
/**
|
||||
@@ -22,13 +23,13 @@ goog.requireType('Blockly.utils.toolbox');
|
||||
* @extends {Blockly.ISelectableToolboxItem}
|
||||
* @interface
|
||||
*/
|
||||
Blockly.ICollapsibleToolboxItem = function() {};
|
||||
const ICollapsibleToolboxItem = function() {};
|
||||
|
||||
/**
|
||||
* Gets any children toolbox items. (ex. Gets the subcategories)
|
||||
* @return {!Array<!Blockly.IToolboxItem>} The child toolbox items.
|
||||
*/
|
||||
Blockly.ICollapsibleToolboxItem.prototype.getChildToolboxItems;
|
||||
ICollapsibleToolboxItem.prototype.getChildToolboxItems;
|
||||
|
||||
/**
|
||||
* Whether the toolbox item is expanded to show its child subcategories.
|
||||
@@ -36,10 +37,12 @@ Blockly.ICollapsibleToolboxItem.prototype.getChildToolboxItems;
|
||||
* is collapsed.
|
||||
* @public
|
||||
*/
|
||||
Blockly.ICollapsibleToolboxItem.prototype.isExpanded;
|
||||
ICollapsibleToolboxItem.prototype.isExpanded;
|
||||
|
||||
/**
|
||||
* Toggles whether or not the toolbox item is expanded.
|
||||
* @public
|
||||
*/
|
||||
Blockly.ICollapsibleToolboxItem.prototype.toggleExpanded;
|
||||
ICollapsibleToolboxItem.prototype.toggleExpanded;
|
||||
|
||||
exports = ICollapsibleToolboxItem;
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
goog.provide('Blockly.ISelectableToolboxItem');
|
||||
goog.module('Blockly.ISelectableToolboxItem');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
goog.require('Blockly.IToolboxItem');
|
||||
goog.requireType('Blockly.utils.toolbox');
|
||||
@@ -22,14 +23,14 @@ goog.requireType('Blockly.utils.toolbox');
|
||||
* @extends {Blockly.IToolboxItem}
|
||||
* @interface
|
||||
*/
|
||||
Blockly.ISelectableToolboxItem = function() {};
|
||||
const ISelectableToolboxItem = function() {};
|
||||
|
||||
/**
|
||||
* Gets the name of the toolbox item. Used for emitting events.
|
||||
* @return {string} The name of the toolbox item.
|
||||
* @public
|
||||
*/
|
||||
Blockly.ISelectableToolboxItem.prototype.getName;
|
||||
ISelectableToolboxItem.prototype.getName;
|
||||
|
||||
/**
|
||||
* Gets the contents of the toolbox item. These are items that are meant to be
|
||||
@@ -38,7 +39,7 @@ Blockly.ISelectableToolboxItem.prototype.getName;
|
||||
* of items to be displayed in the flyout.
|
||||
* @public
|
||||
*/
|
||||
Blockly.ISelectableToolboxItem.prototype.getContents;
|
||||
ISelectableToolboxItem.prototype.getContents;
|
||||
|
||||
/**
|
||||
* Sets the current toolbox item as selected.
|
||||
@@ -46,7 +47,7 @@ Blockly.ISelectableToolboxItem.prototype.getContents;
|
||||
* otherwise.
|
||||
* @public
|
||||
*/
|
||||
Blockly.ISelectableToolboxItem.prototype.setSelected;
|
||||
ISelectableToolboxItem.prototype.setSelected;
|
||||
|
||||
/**
|
||||
* Gets the HTML element that is clickable.
|
||||
@@ -55,11 +56,13 @@ Blockly.ISelectableToolboxItem.prototype.setSelected;
|
||||
* @return {!Element} The HTML element that receives clicks.
|
||||
* @public
|
||||
*/
|
||||
Blockly.ISelectableToolboxItem.prototype.getClickTarget;
|
||||
ISelectableToolboxItem.prototype.getClickTarget;
|
||||
|
||||
/**
|
||||
* Handles when the toolbox item is clicked.
|
||||
* @param {!Event} _e Click event to handle.
|
||||
* @public
|
||||
*/
|
||||
Blockly.ISelectableToolboxItem.prototype.onClick;
|
||||
ISelectableToolboxItem.prototype.onClick;
|
||||
|
||||
exports = ISelectableToolboxItem;
|
||||
|
||||
@@ -11,16 +11,15 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
goog.provide('Blockly.IToolboxItem');
|
||||
|
||||
goog.requireType('Blockly.utils.toolbox');
|
||||
goog.module('Blockly.IToolboxItem');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
|
||||
/**
|
||||
* Interface for an item in the toolbox.
|
||||
* @interface
|
||||
*/
|
||||
Blockly.IToolboxItem = function() {};
|
||||
const IToolboxItem = function() {};
|
||||
|
||||
/**
|
||||
* Initializes the toolbox item.
|
||||
@@ -29,21 +28,21 @@ Blockly.IToolboxItem = function() {};
|
||||
* @return {void}
|
||||
* @public
|
||||
*/
|
||||
Blockly.IToolboxItem.prototype.init;
|
||||
IToolboxItem.prototype.init;
|
||||
|
||||
/**
|
||||
* Gets the div for the toolbox item.
|
||||
* @return {?Element} The div for the toolbox item.
|
||||
* @public
|
||||
*/
|
||||
Blockly.IToolboxItem.prototype.getDiv;
|
||||
IToolboxItem.prototype.getDiv;
|
||||
|
||||
/**
|
||||
* Gets a unique identifier for this toolbox item.
|
||||
* @return {string} The ID for the toolbox item.
|
||||
* @public
|
||||
*/
|
||||
Blockly.IToolboxItem.prototype.getId;
|
||||
IToolboxItem.prototype.getId;
|
||||
|
||||
/**
|
||||
* Gets the parent if the toolbox item is nested.
|
||||
@@ -51,31 +50,33 @@ Blockly.IToolboxItem.prototype.getId;
|
||||
* this toolbox item is not nested.
|
||||
* @public
|
||||
*/
|
||||
Blockly.IToolboxItem.prototype.getParent;
|
||||
IToolboxItem.prototype.getParent;
|
||||
|
||||
/**
|
||||
* Gets the nested level of the category.
|
||||
* @return {number} The nested level of the category.
|
||||
* @package
|
||||
*/
|
||||
Blockly.IToolboxItem.prototype.getLevel;
|
||||
IToolboxItem.prototype.getLevel;
|
||||
|
||||
/**
|
||||
* Whether the toolbox item is selectable.
|
||||
* @return {boolean} True if the toolbox item can be selected.
|
||||
* @public
|
||||
*/
|
||||
Blockly.IToolboxItem.prototype.isSelectable;
|
||||
IToolboxItem.prototype.isSelectable;
|
||||
|
||||
/**
|
||||
* Whether the toolbox item is collapsible.
|
||||
* @return {boolean} True if the toolbox item is collapsible.
|
||||
* @public
|
||||
*/
|
||||
Blockly.IToolboxItem.prototype.isCollapsible;
|
||||
IToolboxItem.prototype.isCollapsible;
|
||||
|
||||
/**
|
||||
* Dispose of this toolbox item. No-op by default.
|
||||
* @public
|
||||
*/
|
||||
Blockly.IToolboxItem.prototype.dispose;
|
||||
IToolboxItem.prototype.dispose;
|
||||
|
||||
exports = IToolboxItem;
|
||||
|
||||
@@ -80,6 +80,7 @@ goog.addDependency('../../core/interfaces/i_autohideable.js', ['Blockly.IAutoHid
|
||||
goog.addDependency('../../core/interfaces/i_block_dragger.js', ['Blockly.IBlockDragger'], [], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/interfaces/i_bounded_element.js', ['Blockly.IBoundedElement'], [], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/interfaces/i_bubble.js', ['Blockly.IBubble'], ['Blockly.IContextMenu', 'Blockly.IDraggable'], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/interfaces/i_collapsible_toolbox_item.js', ['Blockly.ICollapsibleToolboxItem'], ['Blockly.ISelectableToolboxItem'], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/interfaces/i_component.js', ['Blockly.IComponent'], [], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/interfaces/i_connection_checker.js', ['Blockly.IConnectionChecker'], [], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/interfaces/i_contextmenu.js', ['Blockly.IContextMenu'], [], {'lang': 'es6', 'module': 'goog'});
|
||||
@@ -96,9 +97,10 @@ goog.addDependency('../../core/interfaces/i_positionable.js', ['Blockly.IPositio
|
||||
goog.addDependency('../../core/interfaces/i_registrable.js', ['Blockly.IRegistrable'], [], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/interfaces/i_registrable_field.js', ['Blockly.IRegistrableField'], []);
|
||||
goog.addDependency('../../core/interfaces/i_selectable.js', ['Blockly.ISelectable'], [], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/interfaces/i_selectable_toolbox_item.js', ['Blockly.ISelectableToolboxItem'], ['Blockly.IToolboxItem'], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/interfaces/i_styleable.js', ['Blockly.IStyleable'], [], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/interfaces/i_toolbox.js', ['Blockly.IToolbox'], ['Blockly.IRegistrable'], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/interfaces/i_toolbox_item.js', ['Blockly.ICollapsibleToolboxItem', 'Blockly.ISelectableToolboxItem', 'Blockly.IToolboxItem'], []);
|
||||
goog.addDependency('../../core/interfaces/i_toolbox_item.js', ['Blockly.IToolboxItem'], [], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/keyboard_nav/ast_node.js', ['Blockly.ASTNode'], ['Blockly.connectionTypes', 'Blockly.constants', 'Blockly.utils.Coordinate'], {'lang': 'es5'});
|
||||
goog.addDependency('../../core/keyboard_nav/basic_cursor.js', ['Blockly.BasicCursor'], ['Blockly.ASTNode', 'Blockly.Cursor', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/keyboard_nav/cursor.js', ['Blockly.Cursor'], ['Blockly.ASTNode', 'Blockly.Marker', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'});
|
||||
|
||||
Reference in New Issue
Block a user