mirror of
https://github.com/google/blockly.git
synced 2025-12-15 22:00:07 +01:00
chore: remove alias comments (#6816)
* chore: remove alias comments * chore: format * chore: remove extra newlines * chore: fix bad replaces
This commit is contained in:
@@ -50,8 +50,6 @@ import type {Workspace} from './workspace.js';
|
||||
/**
|
||||
* Class for one block.
|
||||
* Not normally called directly, workspace.newBlock() is preferred.
|
||||
*
|
||||
* @alias Blockly.Block
|
||||
*/
|
||||
export class Block implements IASTNodeLocation, IDeletable {
|
||||
/**
|
||||
|
||||
@@ -36,7 +36,6 @@ let wobblingBlock: BlockSvg|null = null;
|
||||
* Play some UI effects (sound, animation) when disposing of a block.
|
||||
*
|
||||
* @param block The block being disposed of.
|
||||
* @alias Blockly.blockAnimations.disposeUiEffect
|
||||
* @internal
|
||||
*/
|
||||
export function disposeUiEffect(block: BlockSvg) {
|
||||
@@ -88,7 +87,6 @@ function disposeUiStep(
|
||||
* Play some UI effects (sound, ripple) after a connection has been established.
|
||||
*
|
||||
* @param block The block being connected.
|
||||
* @alias Blockly.blockAnimations.connectionUiEffect
|
||||
* @internal
|
||||
*/
|
||||
export function connectionUiEffect(block: BlockSvg) {
|
||||
@@ -145,7 +143,6 @@ function connectionUiStep(ripple: SVGElement, start: Date, scale: number) {
|
||||
* Play some UI effects (sound, animation) when disconnecting a block.
|
||||
*
|
||||
* @param block The block being disconnected.
|
||||
* @alias Blockly.blockAnimations.disconnectUiEffect
|
||||
* @internal
|
||||
*/
|
||||
export function disconnectUiEffect(block: BlockSvg) {
|
||||
@@ -196,7 +193,6 @@ function disconnectUiStep(block: BlockSvg, magnitude: number, start: Date) {
|
||||
/**
|
||||
* Stop the disconnect UI animation immediately.
|
||||
*
|
||||
* @alias Blockly.blockAnimations.disconnectUiStop
|
||||
* @internal
|
||||
*/
|
||||
export function disconnectUiStop() {
|
||||
|
||||
@@ -34,8 +34,6 @@ import type {WorkspaceSvg} from './workspace_svg.js';
|
||||
/**
|
||||
* Class for a block dragger. It moves blocks around the workspace when they
|
||||
* are being dragged by a mouse or touch.
|
||||
*
|
||||
* @alias Blockly.BlockDragger
|
||||
*/
|
||||
export class BlockDragger implements IBlockDragger {
|
||||
/** The top block in the stack that is being dragged. */
|
||||
|
||||
@@ -61,8 +61,6 @@ import type {WorkspaceSvg} from './workspace_svg.js';
|
||||
/**
|
||||
* Class for a block's SVG representation.
|
||||
* Not normally called directly, workspace.newBlock() is preferred.
|
||||
*
|
||||
* @alias Blockly.BlockSvg
|
||||
*/
|
||||
export class BlockSvg extends Block implements IASTNodeLocationSvg,
|
||||
IBoundedElement, ICopyable,
|
||||
|
||||
@@ -175,7 +175,6 @@ import {ZoomControls} from './zoom_controls.js';
|
||||
* compiler to override this constant.
|
||||
*
|
||||
* @define {string}
|
||||
* @alias Blockly.VERSION
|
||||
*/
|
||||
export const VERSION = 'uncompiled';
|
||||
|
||||
@@ -193,19 +192,16 @@ export const VERSION = 'uncompiled';
|
||||
|
||||
/**
|
||||
* @see Blockly.Input.Align.LEFT
|
||||
* @alias Blockly.ALIGN_LEFT
|
||||
*/
|
||||
export const ALIGN_LEFT = Align.LEFT;
|
||||
|
||||
/**
|
||||
* @see Blockly.Input.Align.CENTRE
|
||||
* @alias Blockly.ALIGN_CENTRE
|
||||
*/
|
||||
export const ALIGN_CENTRE = Align.CENTRE;
|
||||
|
||||
/**
|
||||
* @see Blockly.Input.Align.RIGHT
|
||||
* @alias Blockly.ALIGN_RIGHT
|
||||
*/
|
||||
export const ALIGN_RIGHT = Align.RIGHT;
|
||||
/*
|
||||
@@ -214,31 +210,26 @@ export const ALIGN_RIGHT = Align.RIGHT;
|
||||
|
||||
/**
|
||||
* @see ConnectionType.INPUT_VALUE
|
||||
* @alias Blockly.INPUT_VALUE
|
||||
*/
|
||||
export const INPUT_VALUE = ConnectionType.INPUT_VALUE;
|
||||
|
||||
/**
|
||||
* @see ConnectionType.OUTPUT_VALUE
|
||||
* @alias Blockly.OUTPUT_VALUE
|
||||
*/
|
||||
export const OUTPUT_VALUE = ConnectionType.OUTPUT_VALUE;
|
||||
|
||||
/**
|
||||
* @see ConnectionType.NEXT_STATEMENT
|
||||
* @alias Blockly.NEXT_STATEMENT
|
||||
*/
|
||||
export const NEXT_STATEMENT = ConnectionType.NEXT_STATEMENT;
|
||||
|
||||
/**
|
||||
* @see ConnectionType.PREVIOUS_STATEMENT
|
||||
* @alias Blockly.PREVIOUS_STATEMENT
|
||||
*/
|
||||
export const PREVIOUS_STATEMENT = ConnectionType.PREVIOUS_STATEMENT;
|
||||
|
||||
/**
|
||||
* @see inputTypes.DUMMY_INPUT
|
||||
* @alias Blockly.DUMMY_INPUT
|
||||
*/
|
||||
export const DUMMY_INPUT = inputTypes.DUMMY;
|
||||
|
||||
@@ -246,25 +237,21 @@ export const DUMMY_INPUT = inputTypes.DUMMY;
|
||||
|
||||
/**
|
||||
* @see toolbox.Position.TOP
|
||||
* @alias Blockly.TOOLBOX_AT_TOP
|
||||
*/
|
||||
export const TOOLBOX_AT_TOP = toolbox.Position.TOP;
|
||||
|
||||
/**
|
||||
* @see toolbox.Position.BOTTOM
|
||||
* @alias Blockly.TOOLBOX_AT_BOTTOM
|
||||
*/
|
||||
export const TOOLBOX_AT_BOTTOM = toolbox.Position.BOTTOM;
|
||||
|
||||
/**
|
||||
* @see toolbox.Position.LEFT
|
||||
* @alias Blockly.TOOLBOX_AT_LEFT
|
||||
*/
|
||||
export const TOOLBOX_AT_LEFT = toolbox.Position.LEFT;
|
||||
|
||||
/**
|
||||
* @see toolbox.Position.RIGHT
|
||||
* @alias Blockly.TOOLBOX_AT_RIGHT
|
||||
*/
|
||||
export const TOOLBOX_AT_RIGHT = toolbox.Position.RIGHT;
|
||||
|
||||
@@ -281,7 +268,6 @@ export const TOOLBOX_AT_RIGHT = toolbox.Position.RIGHT;
|
||||
*
|
||||
* @param workspace Any workspace in the SVG.
|
||||
* @see Blockly.common.svgResize
|
||||
* @alias Blockly.svgResize
|
||||
*/
|
||||
export const svgResize = common.svgResize;
|
||||
|
||||
@@ -290,7 +276,6 @@ export const svgResize = common.svgResize;
|
||||
*
|
||||
* @param opt_onlyClosePopups Whether only popups should be closed.
|
||||
* @see Blockly.WorkspaceSvg.hideChaff
|
||||
* @alias Blockly.hideChaff
|
||||
*/
|
||||
export function hideChaff(opt_onlyClosePopups?: boolean) {
|
||||
(common.getMainWorkspace() as WorkspaceSvg).hideChaff(opt_onlyClosePopups);
|
||||
@@ -302,14 +287,11 @@ export function hideChaff(opt_onlyClosePopups?: boolean) {
|
||||
* Blockly instances on a page.
|
||||
*
|
||||
* @see Blockly.common.getMainWorkspace
|
||||
* @alias Blockly.getMainWorkspace
|
||||
*/
|
||||
export const getMainWorkspace = common.getMainWorkspace;
|
||||
|
||||
/**
|
||||
* Returns the currently selected copyable object.
|
||||
*
|
||||
* @alias Blockly.common.getSelected
|
||||
*/
|
||||
export const getSelected = common.getSelected;
|
||||
|
||||
@@ -319,7 +301,6 @@ export const getSelected = common.getSelected;
|
||||
*
|
||||
* @param jsonArray An array of JSON block definitions.
|
||||
* @see Blockly.common.defineBlocksWithJsonArray
|
||||
* @alias Blockly.defineBlocksWithJsonArray
|
||||
*/
|
||||
export const defineBlocksWithJsonArray = common.defineBlocksWithJsonArray;
|
||||
|
||||
@@ -331,7 +312,6 @@ export const defineBlocksWithJsonArray = common.defineBlocksWithJsonArray;
|
||||
*
|
||||
* @param container The container element.
|
||||
* @see Blockly.common.setParentContainer
|
||||
* @alias Blockly.setParentContainer
|
||||
*/
|
||||
export const setParentContainer = common.setParentContainer;
|
||||
|
||||
@@ -342,7 +322,6 @@ export const setParentContainer = common.setParentContainer;
|
||||
* @param workspace The workspace to resize.
|
||||
* @deprecated Use **workspace.resizeContents** instead.
|
||||
* @see Blockly.WorkspaceSvg.resizeContents
|
||||
* @alias Blockly.resizeSvgContents
|
||||
*/
|
||||
function resizeSvgContentsLocal(workspace: WorkspaceSvg) {
|
||||
deprecation.warn(
|
||||
@@ -358,7 +337,6 @@ export const resizeSvgContents = resizeSvgContentsLocal;
|
||||
* @param toCopy Block or Workspace Comment to be copied.
|
||||
* @deprecated Use **Blockly.clipboard.copy** instead.
|
||||
* @see Blockly.clipboard.copy
|
||||
* @alias Blockly.copy
|
||||
*/
|
||||
export function copy(toCopy: ICopyable) {
|
||||
deprecation.warn(
|
||||
@@ -373,7 +351,6 @@ export function copy(toCopy: ICopyable) {
|
||||
* @returns True if the paste was successful, false otherwise.
|
||||
* @deprecated Use **Blockly.clipboard.paste** instead.
|
||||
* @see Blockly.clipboard.paste
|
||||
* @alias Blockly.paste
|
||||
*/
|
||||
export function paste(): boolean {
|
||||
deprecation.warn(
|
||||
@@ -388,7 +365,6 @@ export function paste(): boolean {
|
||||
* @param toDuplicate Block or Workspace Comment to be copied.
|
||||
* @deprecated Use **Blockly.clipboard.duplicate** instead.
|
||||
* @see Blockly.clipboard.duplicate
|
||||
* @alias Blockly.duplicate
|
||||
*/
|
||||
export function duplicate(toDuplicate: ICopyable) {
|
||||
deprecation.warn(
|
||||
@@ -404,7 +380,6 @@ export function duplicate(toDuplicate: ICopyable) {
|
||||
* @returns True if number, false otherwise.
|
||||
* @deprecated Use **Blockly.utils.string.isNumber** instead.
|
||||
* @see Blockly.utils.string.isNumber
|
||||
* @alias Blockly.isNumber
|
||||
*/
|
||||
export function isNumber(str: string): boolean {
|
||||
deprecation.warn(
|
||||
@@ -420,7 +395,6 @@ export function isNumber(str: string): boolean {
|
||||
* @returns RGB code, e.g. '#5ba65b'.
|
||||
* @deprecated Use **Blockly.utils.colour.hueToHex** instead.
|
||||
* @see Blockly.utils.colour.hueToHex
|
||||
* @alias Blockly.hueToHex
|
||||
*/
|
||||
export function hueToHex(hue: number): string {
|
||||
deprecation.warn(
|
||||
@@ -442,7 +416,6 @@ export function hueToHex(hue: number): string {
|
||||
* @returns Opaque data that can be passed to unbindEvent_.
|
||||
* @deprecated Use **Blockly.browserEvents.bind** instead.
|
||||
* @see Blockly.browserEvents.bind
|
||||
* @alias Blockly.bindEvent_
|
||||
*/
|
||||
export function bindEvent_(
|
||||
node: EventTarget, name: string, thisObject: Object|null,
|
||||
@@ -461,7 +434,6 @@ export function bindEvent_(
|
||||
* @returns The function call.
|
||||
* @deprecated Use **Blockly.browserEvents.unbind** instead.
|
||||
* @see browserEvents.unbind
|
||||
* @alias Blockly.unbindEvent_
|
||||
*/
|
||||
export function unbindEvent_(bindData: browserEvents.Data): Function {
|
||||
deprecation.warn(
|
||||
@@ -487,7 +459,6 @@ export function unbindEvent_(bindData: browserEvents.Data): Function {
|
||||
* @returns Opaque data that can be passed to unbindEvent_.
|
||||
* @deprecated Use **Blockly.browserEvents.conditionalBind** instead.
|
||||
* @see browserEvents.conditionalBind
|
||||
* @alias Blockly.bindEventWithChecks_
|
||||
*/
|
||||
export function bindEventWithChecks_(
|
||||
node: EventTarget, name: string, thisObject: Object|null, func: Function,
|
||||
@@ -513,8 +484,6 @@ export const COLLAPSED_FIELD_NAME = constants.COLLAPSED_FIELD_NAME;
|
||||
* String for use in the "custom" attribute of a category in toolbox XML.
|
||||
* This string indicates that the category should be dynamically populated with
|
||||
* variable blocks.
|
||||
*
|
||||
* @alias Blockly.VARIABLE_CATEGORY_NAME
|
||||
*/
|
||||
export const VARIABLE_CATEGORY_NAME: string = Variables.CATEGORY_NAME;
|
||||
|
||||
@@ -522,8 +491,6 @@ export const VARIABLE_CATEGORY_NAME: string = Variables.CATEGORY_NAME;
|
||||
* String for use in the "custom" attribute of a category in toolbox XML.
|
||||
* This string indicates that the category should be dynamically populated with
|
||||
* variable blocks.
|
||||
*
|
||||
* @alias Blockly.VARIABLE_DYNAMIC_CATEGORY_NAME
|
||||
*/
|
||||
export const VARIABLE_DYNAMIC_CATEGORY_NAME: string =
|
||||
VariablesDynamic.CATEGORY_NAME;
|
||||
@@ -531,8 +498,6 @@ export const VARIABLE_DYNAMIC_CATEGORY_NAME: string =
|
||||
* String for use in the "custom" attribute of a category in toolbox XML.
|
||||
* This string indicates that the category should be dynamically populated with
|
||||
* procedure blocks.
|
||||
*
|
||||
* @alias Blockly.PROCEDURE_CATEGORY_NAME
|
||||
*/
|
||||
export const PROCEDURE_CATEGORY_NAME: string = Procedures.CATEGORY_NAME;
|
||||
|
||||
|
||||
@@ -19,8 +19,6 @@ import type {ToolboxDefinition} from './utils/toolbox.js';
|
||||
|
||||
/**
|
||||
* Blockly options.
|
||||
*
|
||||
* @alias Blockly.BlocklyOptions
|
||||
*/
|
||||
export interface BlocklyOptions {
|
||||
collapse?: boolean;
|
||||
|
||||
@@ -21,7 +21,5 @@ export type BlockDefinition = AnyDuringMigration;
|
||||
|
||||
/**
|
||||
* A mapping of block type names to block prototype objects.
|
||||
*
|
||||
* @alias Blockly.blocks.Blocks
|
||||
*/
|
||||
export const Blocks: {[key: string]: BlockDefinition} = Object.create(null);
|
||||
|
||||
@@ -20,8 +20,6 @@ import * as userAgent from './utils/useragent.js';
|
||||
/**
|
||||
* Blockly opaque event data used to unbind events when using
|
||||
* `bind` and `conditionalBind`.
|
||||
*
|
||||
* @alias Blockly.browserEvents.Data
|
||||
*/
|
||||
export type Data = [EventTarget, string, (e: Event) => void][];
|
||||
|
||||
@@ -54,7 +52,6 @@ const PAGE_MODE_MULTIPLIER = 125;
|
||||
* simultaneous touches. False by default.
|
||||
* @param opt_noPreventDefault No-op, deprecated and will be removed in v10.
|
||||
* @returns Opaque data that can be passed to unbindEvent_.
|
||||
* @alias Blockly.browserEvents.conditionalBind
|
||||
*/
|
||||
export function conditionalBind(
|
||||
node: EventTarget, name: string, thisObject: Object|null, func: Function,
|
||||
@@ -105,7 +102,6 @@ export function conditionalBind(
|
||||
* @param thisObject The value of 'this' in the function.
|
||||
* @param func Function to call when event is triggered.
|
||||
* @returns Opaque data that can be passed to unbindEvent_.
|
||||
* @alias Blockly.browserEvents.bind
|
||||
*/
|
||||
export function bind(
|
||||
node: EventTarget, name: string, thisObject: Object|null,
|
||||
@@ -142,7 +138,6 @@ export function bind(
|
||||
* @param bindData Opaque data from bindEvent_.
|
||||
* This list is emptied during the course of calling this function.
|
||||
* @returns The function call.
|
||||
* @alias Blockly.browserEvents.unbind
|
||||
*/
|
||||
export function unbind(bindData: Data): (e: Event) => void {
|
||||
// Accessing an element of the last property of the array is unsafe if the
|
||||
@@ -164,7 +159,6 @@ export function unbind(bindData: Data): (e: Event) => void {
|
||||
*
|
||||
* @param e An event.
|
||||
* @returns True if text input.
|
||||
* @alias Blockly.browserEvents.isTargetInput
|
||||
*/
|
||||
export function isTargetInput(e: Event): boolean {
|
||||
if (e.target instanceof HTMLElement) {
|
||||
@@ -194,7 +188,6 @@ export function isTargetInput(e: Event): boolean {
|
||||
*
|
||||
* @param e Mouse event.
|
||||
* @returns True if right-click.
|
||||
* @alias Blockly.browserEvents.isRightButton
|
||||
*/
|
||||
export function isRightButton(e: MouseEvent): boolean {
|
||||
if (e.ctrlKey && userAgent.MAC) {
|
||||
@@ -213,7 +206,6 @@ export function isRightButton(e: MouseEvent): boolean {
|
||||
* @param svg SVG element.
|
||||
* @param matrix Inverted screen CTM to use.
|
||||
* @returns Object with .x and .y properties.
|
||||
* @alias Blockly.browserEvents.mouseToSvg
|
||||
*/
|
||||
export function mouseToSvg(
|
||||
e: MouseEvent, svg: SVGSVGElement, matrix: SVGMatrix|null): SVGPoint {
|
||||
@@ -232,7 +224,6 @@ export function mouseToSvg(
|
||||
*
|
||||
* @param e Mouse event.
|
||||
* @returns Scroll delta object with .x and .y properties.
|
||||
* @alias Blockly.browserEvents.getScrollDeltaPixels
|
||||
*/
|
||||
export function getScrollDeltaPixels(e: WheelEvent): {x: number, y: number} {
|
||||
switch (e.deltaMode) {
|
||||
|
||||
@@ -29,8 +29,6 @@ import type {WorkspaceSvg} from './workspace_svg.js';
|
||||
|
||||
/**
|
||||
* Class for UI bubble.
|
||||
*
|
||||
* @alias Blockly.Bubble
|
||||
*/
|
||||
export class Bubble implements IBubble {
|
||||
/** Width of the border around the bubble. */
|
||||
|
||||
@@ -27,8 +27,6 @@ import type {WorkspaceSvg} from './workspace_svg.js';
|
||||
* Class for a bubble dragger. It moves things on the bubble canvas around the
|
||||
* workspace when they are being dragged by a mouse or touch. These can be
|
||||
* block comments, mutators, warnings, or workspace comments.
|
||||
*
|
||||
* @alias Blockly.BubbleDragger
|
||||
*/
|
||||
export class BubbleDragger {
|
||||
/** Which drag target the mouse pointer is over, if any. */
|
||||
|
||||
@@ -35,7 +35,6 @@ import type {WorkspaceSvg} from './workspace_svg.js';
|
||||
* in workspace coordinates.
|
||||
* @param object The object to bump.
|
||||
* @returns True if block was bumped.
|
||||
* @alias Blockly.bumpObjects.bumpIntoBounds
|
||||
*/
|
||||
function bumpObjectIntoBounds(
|
||||
workspace: WorkspaceSvg, scrollMetrics: ContainerRegion,
|
||||
@@ -87,7 +86,6 @@ export const bumpIntoBounds = bumpObjectIntoBounds;
|
||||
*
|
||||
* @param workspace The workspace to handle.
|
||||
* @returns The event handler.
|
||||
* @alias Blockly.bumpObjects.bumpIntoBoundsHandler
|
||||
*/
|
||||
export function bumpIntoBoundsHandler(workspace: WorkspaceSvg):
|
||||
(p1: Abstract) => void {
|
||||
@@ -167,7 +165,6 @@ function extractObjectFromEvent(
|
||||
* Bumps the top objects in the given workspace into bounds.
|
||||
*
|
||||
* @param workspace The workspace.
|
||||
* @alias Blockly.bumpObjects.bumpTopObjectsIntoBounds
|
||||
*/
|
||||
export function bumpTopObjectsIntoBounds(workspace: WorkspaceSvg) {
|
||||
const metricsManager = workspace.getMetricsManager();
|
||||
|
||||
@@ -22,7 +22,6 @@ let copyData: CopyData|null = null;
|
||||
* Copy a block or workspace comment onto the local clipboard.
|
||||
*
|
||||
* @param toCopy Block or Workspace Comment to be copied.
|
||||
* @alias Blockly.clipboard.copy
|
||||
* @internal
|
||||
*/
|
||||
export function copy(toCopy: ICopyable) {
|
||||
@@ -40,7 +39,6 @@ function copyInternal(toCopy: ICopyable) {
|
||||
* Paste a block or workspace comment on to the main workspace.
|
||||
*
|
||||
* @returns The pasted thing if the paste was successful, null otherwise.
|
||||
* @alias Blockly.clipboard.paste
|
||||
* @internal
|
||||
*/
|
||||
export function paste(): ICopyable|null {
|
||||
@@ -66,7 +64,6 @@ export function paste(): ICopyable|null {
|
||||
* @param toDuplicate Block or Workspace Comment to be duplicated.
|
||||
* @returns The block or workspace comment that was duplicated, or null if the
|
||||
* duplication failed.
|
||||
* @alias Blockly.clipboard.duplicate
|
||||
* @internal
|
||||
*/
|
||||
export function duplicate(toDuplicate: ICopyable): ICopyable|null {
|
||||
|
||||
@@ -32,8 +32,6 @@ import {Svg} from './utils/svg.js';
|
||||
|
||||
/**
|
||||
* Class for a comment.
|
||||
*
|
||||
* @alias Blockly.Comment
|
||||
*/
|
||||
export class Comment extends Icon {
|
||||
private readonly model: CommentModel;
|
||||
|
||||
@@ -79,7 +79,6 @@ let mainWorkspace: Workspace;
|
||||
* page.
|
||||
*
|
||||
* @returns The main workspace.
|
||||
* @alias Blockly.common.getMainWorkspace
|
||||
*/
|
||||
export function getMainWorkspace(): Workspace {
|
||||
return mainWorkspace;
|
||||
@@ -89,7 +88,6 @@ export function getMainWorkspace(): Workspace {
|
||||
* Sets last used main workspace.
|
||||
*
|
||||
* @param workspace The most recently used top level workspace.
|
||||
* @alias Blockly.common.setMainWorkspace
|
||||
*/
|
||||
export function setMainWorkspace(workspace: Workspace) {
|
||||
mainWorkspace = workspace;
|
||||
@@ -102,8 +100,6 @@ let selected: ICopyable|null = null;
|
||||
|
||||
/**
|
||||
* Returns the currently selected copyable object.
|
||||
*
|
||||
* @alias Blockly.common.getSelected
|
||||
*/
|
||||
export function getSelected(): ICopyable|null {
|
||||
return selected;
|
||||
@@ -115,7 +111,6 @@ export function getSelected(): ICopyable|null {
|
||||
* programmatically select a block, use `BlockSvg#select`.
|
||||
*
|
||||
* @param newSelection The newly selected block.
|
||||
* @alias Blockly.common.setSelected
|
||||
* @internal
|
||||
*/
|
||||
export function setSelected(newSelection: ICopyable|null) {
|
||||
@@ -132,7 +127,6 @@ let parentContainer: Element|null;
|
||||
* Tooltip.
|
||||
*
|
||||
* @returns The parent container.
|
||||
* @alias Blockly.common.getParentContainer
|
||||
*/
|
||||
export function getParentContainer(): Element|null {
|
||||
return parentContainer;
|
||||
@@ -145,7 +139,6 @@ export function getParentContainer(): Element|null {
|
||||
* This method is a NOP if called after the first `Blockly.inject`.
|
||||
*
|
||||
* @param newParent The container element.
|
||||
* @alias Blockly.common.setParentContainer
|
||||
*/
|
||||
export function setParentContainer(newParent: Element) {
|
||||
parentContainer = newParent;
|
||||
@@ -159,7 +152,6 @@ export function setParentContainer(newParent: Element) {
|
||||
* Record the height/width of the SVG image.
|
||||
*
|
||||
* @param workspace Any workspace in the SVG.
|
||||
* @alias Blockly.common.svgResize
|
||||
*/
|
||||
export function svgResize(workspace: WorkspaceSvg) {
|
||||
let mainWorkspace = workspace;
|
||||
@@ -201,7 +193,6 @@ export const draggingConnections: Connection[] = [];
|
||||
* statements (blocks that are not inside a value or statement input
|
||||
* of the block).
|
||||
* @returns Map of types to type counts for descendants of the bock.
|
||||
* @alias Blockly.common.getBlockTypeCounts
|
||||
*/
|
||||
export function getBlockTypeCounts(
|
||||
block: Block, opt_stripFollowing?: boolean): {[key: string]: number} {
|
||||
@@ -243,7 +234,6 @@ function jsonInitFactory(jsonDef: AnyDuringMigration): () => void {
|
||||
* by the Blockly Developer Tools.
|
||||
*
|
||||
* @param jsonArray An array of JSON block definitions.
|
||||
* @alias Blockly.common.defineBlocksWithJsonArray
|
||||
*/
|
||||
export function defineBlocksWithJsonArray(jsonArray: AnyDuringMigration[]) {
|
||||
TEST_ONLY.defineBlocksWithJsonArrayInternal(jsonArray);
|
||||
@@ -263,7 +253,6 @@ function defineBlocksWithJsonArrayInternal(jsonArray: AnyDuringMigration[]) {
|
||||
* @param jsonArray An array of JSON block definitions.
|
||||
* @returns A map of the block
|
||||
* definitions created.
|
||||
* @alias Blockly.common.defineBlocksWithJsonArray
|
||||
*/
|
||||
export function createBlockDefinitionsFromJsonArray(
|
||||
jsonArray: AnyDuringMigration[]): {[key: string]: BlockDefinition} {
|
||||
@@ -292,7 +281,6 @@ export function createBlockDefinitionsFromJsonArray(
|
||||
*
|
||||
* @param blocks A map of block
|
||||
* type names to block definitions.
|
||||
* @alias Blockly.common.defineBlocks
|
||||
*/
|
||||
export function defineBlocks(blocks: {[key: string]: BlockDefinition}) {
|
||||
// Iterate over own enumerable properties.
|
||||
|
||||
@@ -43,8 +43,6 @@ class Capability<_T> {
|
||||
|
||||
/**
|
||||
* Manager for all items registered with the workspace.
|
||||
*
|
||||
* @alias Blockly.ComponentManager
|
||||
*/
|
||||
export class ComponentManager {
|
||||
static Capability = Capability;
|
||||
|
||||
@@ -39,7 +39,6 @@ export const config: Config = {
|
||||
/**
|
||||
* Number of pixels the mouse must move before a drag starts.
|
||||
*
|
||||
* @alias Blockly.config.dragRadius
|
||||
*/
|
||||
dragRadius: 5,
|
||||
/**
|
||||
@@ -47,20 +46,17 @@ export const config: Config = {
|
||||
* flyout. Because the drag-intention is determined when this is reached, it
|
||||
* is larger than dragRadius so that the drag-direction is clearer.
|
||||
*
|
||||
* @alias Blockly.config.flyoutDragRadius
|
||||
*/
|
||||
flyoutDragRadius: 10,
|
||||
/**
|
||||
* Maximum misalignment between connections for them to snap together.
|
||||
*
|
||||
* @alias Blockly.config.snapRadius
|
||||
*/
|
||||
snapRadius: DEFAULT_SNAP_RADIUS,
|
||||
/**
|
||||
* Maximum misalignment between connections for them to snap together.
|
||||
* This should be the same as the snap radius.
|
||||
*
|
||||
* @alias Blockly.config.connectingSnapRadius
|
||||
*/
|
||||
connectingSnapRadius: DEFAULT_SNAP_RADIUS,
|
||||
/**
|
||||
@@ -69,13 +65,11 @@ export const config: Config = {
|
||||
* this much closer to the matching connection on the block than it actually
|
||||
* is.
|
||||
*
|
||||
* @alias Blockly.config.currentConnectionPreference
|
||||
*/
|
||||
currentConnectionPreference: 8,
|
||||
/**
|
||||
* Delay in ms between trigger and bumping unconnected block out of alignment.
|
||||
*
|
||||
* @alias Blockly.config.bumpDelay
|
||||
*/
|
||||
bumpDelay: 250,
|
||||
};
|
||||
|
||||
@@ -25,8 +25,6 @@ import * as Xml from './xml.js';
|
||||
|
||||
/**
|
||||
* Class for a connection between blocks.
|
||||
*
|
||||
* @alias Blockly.Connection
|
||||
*/
|
||||
export class Connection implements IASTNodeLocationWithBlock {
|
||||
/** Constants for checking whether two connections are compatible. */
|
||||
|
||||
@@ -24,8 +24,6 @@ import type {RenderedConnection} from './rendered_connection.js';
|
||||
|
||||
/**
|
||||
* Class for connection type checking logic.
|
||||
*
|
||||
* @alias Blockly.ConnectionChecker
|
||||
*/
|
||||
export class ConnectionChecker implements IConnectionChecker {
|
||||
/**
|
||||
|
||||
@@ -24,8 +24,6 @@ import type {Coordinate} from './utils/coordinate.js';
|
||||
* Database of connections.
|
||||
* Connections are stored in order of their vertical component. This way
|
||||
* connections in an area may be looked up quickly using a binary search.
|
||||
*
|
||||
* @alias Blockly.ConnectionDB
|
||||
*/
|
||||
export class ConnectionDB {
|
||||
/** Array of connections sorted by y position in workspace units. */
|
||||
|
||||
@@ -15,8 +15,6 @@ goog.declareModuleId('Blockly.ConnectionType');
|
||||
|
||||
/**
|
||||
* Enum for the type of a connection or input.
|
||||
*
|
||||
* @alias Blockly.ConnectionType
|
||||
*/
|
||||
export enum ConnectionType {
|
||||
// A right-facing value input. E.g. 'set item to' or 'return'.
|
||||
|
||||
@@ -15,14 +15,10 @@ goog.declareModuleId('Blockly.constants');
|
||||
|
||||
/**
|
||||
* The language-neutral ID given to the collapsed input.
|
||||
*
|
||||
* @alias Blockly.constants.COLLAPSED_INPUT_NAME
|
||||
*/
|
||||
export const COLLAPSED_INPUT_NAME = '_TEMP_COLLAPSED_INPUT';
|
||||
|
||||
/**
|
||||
* The language-neutral ID given to the collapsed field.
|
||||
*
|
||||
* @alias Blockly.constants.COLLAPSED_FIELD_NAME
|
||||
*/
|
||||
export const COLLAPSED_FIELD_NAME = '_TEMP_COLLAPSED_FIELD';
|
||||
|
||||
@@ -44,7 +44,6 @@ const dummyOwner = {};
|
||||
* Gets the block the context menu is currently attached to.
|
||||
*
|
||||
* @returns The block the context menu is attached to.
|
||||
* @alias Blockly.ContextMenu.getCurrentBlock
|
||||
*/
|
||||
export function getCurrentBlock(): Block|null {
|
||||
return currentBlock;
|
||||
@@ -54,7 +53,6 @@ export function getCurrentBlock(): Block|null {
|
||||
* Sets the block the context menu is currently attached to.
|
||||
*
|
||||
* @param block The block the context menu is attached to.
|
||||
* @alias Blockly.ContextMenu.setCurrentBlock
|
||||
*/
|
||||
export function setCurrentBlock(block: Block|null) {
|
||||
currentBlock = block;
|
||||
@@ -71,7 +69,6 @@ let menu_: Menu|null = null;
|
||||
* @param e Mouse event.
|
||||
* @param options Array of menu options.
|
||||
* @param rtl True if RTL, false if LTR.
|
||||
* @alias Blockly.ContextMenu.show
|
||||
*/
|
||||
export function show(
|
||||
e: Event, options: (ContextMenuOption|LegacyContextMenuOption)[],
|
||||
@@ -200,8 +197,6 @@ function haltPropagation(e: Event) {
|
||||
|
||||
/**
|
||||
* Hide the context menu.
|
||||
*
|
||||
* @alias Blockly.ContextMenu.hide
|
||||
*/
|
||||
export function hide() {
|
||||
WidgetDiv.hideIfOwner(dummyOwner);
|
||||
@@ -210,8 +205,6 @@ export function hide() {
|
||||
|
||||
/**
|
||||
* Dispose of the menu.
|
||||
*
|
||||
* @alias Blockly.ContextMenu.dispose
|
||||
*/
|
||||
export function dispose() {
|
||||
if (menu_) {
|
||||
@@ -227,7 +220,6 @@ export function dispose() {
|
||||
* @param block Original block.
|
||||
* @param xml XML representation of new block.
|
||||
* @returns Function that creates a block.
|
||||
* @alias Blockly.ContextMenu.callbackFactory
|
||||
*/
|
||||
export function callbackFactory(block: Block, xml: Element): Function {
|
||||
return () => {
|
||||
@@ -263,7 +255,6 @@ export function callbackFactory(block: Block, xml: Element): Function {
|
||||
* right-click originated.
|
||||
* @returns A menu option,
|
||||
* containing text, enabled, and a callback.
|
||||
* @alias Blockly.ContextMenu.commentDeleteOption
|
||||
* @internal
|
||||
*/
|
||||
export function commentDeleteOption(comment: WorkspaceCommentSvg):
|
||||
@@ -287,7 +278,6 @@ export function commentDeleteOption(comment: WorkspaceCommentSvg):
|
||||
* right-click originated.
|
||||
* @returns A menu option,
|
||||
* containing text, enabled, and a callback.
|
||||
* @alias Blockly.ContextMenu.commentDuplicateOption
|
||||
* @internal
|
||||
*/
|
||||
export function commentDuplicateOption(comment: WorkspaceCommentSvg):
|
||||
@@ -311,7 +301,6 @@ export function commentDuplicateOption(comment: WorkspaceCommentSvg):
|
||||
* @returns A menu option, containing text, enabled, and a callback.
|
||||
* @suppress {strictModuleDepCheck,checkTypes} Suppress checks while workspace
|
||||
* comments are not bundled in.
|
||||
* @alias Blockly.ContextMenu.workspaceCommentOption
|
||||
* @internal
|
||||
*/
|
||||
export function workspaceCommentOption(
|
||||
|
||||
@@ -26,8 +26,6 @@ import type {WorkspaceSvg} from './workspace_svg.js';
|
||||
|
||||
/**
|
||||
* Option to undo previous action.
|
||||
*
|
||||
* @alias Blockly.ContextMenuItems.registerUndo
|
||||
*/
|
||||
export function registerUndo() {
|
||||
const undoOption: RegistryItem = {
|
||||
@@ -52,8 +50,6 @@ export function registerUndo() {
|
||||
|
||||
/**
|
||||
* Option to redo previous action.
|
||||
*
|
||||
* @alias Blockly.ContextMenuItems.registerRedo
|
||||
*/
|
||||
export function registerRedo() {
|
||||
const redoOption: RegistryItem = {
|
||||
@@ -78,8 +74,6 @@ export function registerRedo() {
|
||||
|
||||
/**
|
||||
* Option to clean up blocks.
|
||||
*
|
||||
* @alias Blockly.ContextMenuItems.registerCleanup
|
||||
*/
|
||||
export function registerCleanup() {
|
||||
const cleanOption: RegistryItem = {
|
||||
@@ -135,8 +129,6 @@ function toggleOption_(shouldCollapse: boolean, topBlocks: BlockSvg[]) {
|
||||
|
||||
/**
|
||||
* Option to collapse all blocks.
|
||||
*
|
||||
* @alias Blockly.ContextMenuItems.registerCollapse
|
||||
*/
|
||||
export function registerCollapse() {
|
||||
const collapseOption: RegistryItem = {
|
||||
@@ -171,8 +163,6 @@ export function registerCollapse() {
|
||||
|
||||
/**
|
||||
* Option to expand all blocks.
|
||||
*
|
||||
* @alias Blockly.ContextMenuItems.registerExpand
|
||||
*/
|
||||
export function registerExpand() {
|
||||
const expandOption: RegistryItem = {
|
||||
@@ -261,8 +251,6 @@ function deleteNext_(deleteList: BlockSvg[], eventGroup: string) {
|
||||
|
||||
/**
|
||||
* Option to delete all blocks.
|
||||
*
|
||||
* @alias Blockly.ContextMenuItems.registerDeleteAll
|
||||
*/
|
||||
export function registerDeleteAll() {
|
||||
const deleteOption: RegistryItem = {
|
||||
@@ -323,8 +311,6 @@ function registerWorkspaceOptions_() {
|
||||
|
||||
/**
|
||||
* Option to duplicate a block.
|
||||
*
|
||||
* @alias Blockly.ContextMenuItems.registerDuplicate
|
||||
*/
|
||||
export function registerDuplicate() {
|
||||
const duplicateOption: RegistryItem = {
|
||||
@@ -355,8 +341,6 @@ export function registerDuplicate() {
|
||||
|
||||
/**
|
||||
* Option to add or remove block-level comment.
|
||||
*
|
||||
* @alias Blockly.ContextMenuItems.registerComment
|
||||
*/
|
||||
export function registerComment() {
|
||||
const commentOption: RegistryItem = {
|
||||
@@ -393,8 +377,6 @@ export function registerComment() {
|
||||
|
||||
/**
|
||||
* Option to inline variables.
|
||||
*
|
||||
* @alias Blockly.ContextMenuItems.registerInline
|
||||
*/
|
||||
export function registerInline() {
|
||||
const inlineOption: RegistryItem = {
|
||||
@@ -428,8 +410,6 @@ export function registerInline() {
|
||||
|
||||
/**
|
||||
* Option to collapse or expand a block.
|
||||
*
|
||||
* @alias Blockly.ContextMenuItems.registerCollapseExpandBlock
|
||||
*/
|
||||
export function registerCollapseExpandBlock() {
|
||||
const collapseExpandOption: RegistryItem = {
|
||||
@@ -457,8 +437,6 @@ export function registerCollapseExpandBlock() {
|
||||
|
||||
/**
|
||||
* Option to disable or enable a block.
|
||||
*
|
||||
* @alias Blockly.ContextMenuItems.registerDisable
|
||||
*/
|
||||
export function registerDisable() {
|
||||
const disableOption: RegistryItem = {
|
||||
@@ -497,8 +475,6 @@ export function registerDisable() {
|
||||
|
||||
/**
|
||||
* Option to delete a block.
|
||||
*
|
||||
* @alias Blockly.ContextMenuItems.registerDelete
|
||||
*/
|
||||
export function registerDelete() {
|
||||
const deleteOption: RegistryItem = {
|
||||
@@ -535,8 +511,6 @@ export function registerDelete() {
|
||||
|
||||
/**
|
||||
* Option to open help for a block.
|
||||
*
|
||||
* @alias Blockly.ContextMenuItems.registerHelp
|
||||
*/
|
||||
export function registerHelp() {
|
||||
const helpOption: RegistryItem = {
|
||||
@@ -577,7 +551,6 @@ function registerBlockOptions_() {
|
||||
* Registers all default context menu items. This should be called once per
|
||||
* instance of ContextMenuRegistry.
|
||||
*
|
||||
* @alias Blockly.ContextMenuItems.registerDefaultOptions
|
||||
* @internal
|
||||
*/
|
||||
export function registerDefaultOptions() {
|
||||
|
||||
@@ -20,8 +20,6 @@ import type {WorkspaceSvg} from './workspace_svg.js';
|
||||
* Class for the registry of context menu items. This is intended to be a
|
||||
* singleton. You should not create a new instance, and only access this class
|
||||
* from ContextMenuRegistry.registry.
|
||||
*
|
||||
* @alias Blockly.ContextMenuRegistry
|
||||
*/
|
||||
export class ContextMenuRegistry {
|
||||
static registry: ContextMenuRegistry;
|
||||
|
||||
@@ -21,7 +21,6 @@ let injected = false;
|
||||
* components such as fields and the toolbox to store separate CSS.
|
||||
*
|
||||
* @param cssContent Multiline CSS string or an array of single lines of CSS.
|
||||
* @alias Blockly.Css.register
|
||||
*/
|
||||
export function register(cssContent: string) {
|
||||
if (injected) {
|
||||
@@ -40,7 +39,6 @@ export function register(cssContent: string) {
|
||||
* @param hasCss If false, don't inject CSS (providing CSS becomes the
|
||||
* document's responsibility).
|
||||
* @param pathToMedia Path from page to the Blockly media directory.
|
||||
* @alias Blockly.Css.inject
|
||||
*/
|
||||
export function inject(hasCss: boolean, pathToMedia: string) {
|
||||
// Only inject the CSS once.
|
||||
@@ -67,8 +65,6 @@ export function inject(hasCss: boolean, pathToMedia: string) {
|
||||
|
||||
/**
|
||||
* The CSS content for Blockly.
|
||||
*
|
||||
* @alias Blockly.Css.content
|
||||
*/
|
||||
let content = `
|
||||
.blocklySvg {
|
||||
|
||||
@@ -22,8 +22,6 @@ import type {IDraggable} from './interfaces/i_draggable.js';
|
||||
/**
|
||||
* Abstract class for a component that can delete a block or bubble that is
|
||||
* dropped on top of it.
|
||||
*
|
||||
* @alias Blockly.DeleteArea
|
||||
*/
|
||||
export class DeleteArea extends DragTarget implements IDeleteArea {
|
||||
/**
|
||||
|
||||
@@ -37,7 +37,6 @@ let promptImplementation = function(
|
||||
*
|
||||
* @param message The message to display to the user.
|
||||
* @param opt_callback The callback when the alert is dismissed.
|
||||
* @alias Blockly.dialog.alert
|
||||
*/
|
||||
export function alert(message: string, opt_callback?: () => void) {
|
||||
alertImplementation(message, opt_callback);
|
||||
@@ -48,7 +47,6 @@ export function alert(message: string, opt_callback?: () => void) {
|
||||
*
|
||||
* @param alertFunction The function to be run.
|
||||
* @see Blockly.dialog.alert
|
||||
* @alias Blockly.dialog.setAlert
|
||||
*/
|
||||
export function setAlert(alertFunction: (p1: string, p2?: () => void) => void) {
|
||||
alertImplementation = alertFunction;
|
||||
@@ -60,7 +58,6 @@ export function setAlert(alertFunction: (p1: string, p2?: () => void) => void) {
|
||||
*
|
||||
* @param message The message to display to the user.
|
||||
* @param callback The callback for handling user response.
|
||||
* @alias Blockly.dialog.confirm
|
||||
*/
|
||||
export function confirm(message: string, callback: (p1: boolean) => void) {
|
||||
TEST_ONLY.confirmInternal(message, callback);
|
||||
@@ -79,7 +76,6 @@ function confirmInternal(message: string, callback: (p1: boolean) => void) {
|
||||
*
|
||||
* @param confirmFunction The function to be run.
|
||||
* @see Blockly.dialog.confirm
|
||||
* @alias Blockly.dialog.setConfirm
|
||||
*/
|
||||
export function setConfirm(
|
||||
confirmFunction: (p1: string, p2: (p1: boolean) => void) => void) {
|
||||
@@ -95,7 +91,6 @@ export function setConfirm(
|
||||
* @param message The message to display to the user.
|
||||
* @param defaultValue The value to initialize the prompt with.
|
||||
* @param callback The callback for handling user response.
|
||||
* @alias Blockly.dialog.prompt
|
||||
*/
|
||||
export function prompt(
|
||||
message: string, defaultValue: string,
|
||||
@@ -108,7 +103,6 @@ export function prompt(
|
||||
*
|
||||
* @param promptFunction The function to be run.
|
||||
* @see Blockly.dialog.prompt
|
||||
* @alias Blockly.dialog.setPrompt
|
||||
*/
|
||||
export function setPrompt(
|
||||
promptFunction: (p1: string, p2: string, p3: (p1: string|null) => void) =>
|
||||
|
||||
@@ -21,8 +21,6 @@ import type {Rect} from './utils/rect.js';
|
||||
/**
|
||||
* Abstract class for a component with custom behaviour when a block or bubble
|
||||
* is dragged over or dropped on top of it.
|
||||
*
|
||||
* @alias Blockly.DragTarget
|
||||
*/
|
||||
export class DragTarget implements IDragTarget {
|
||||
/**
|
||||
|
||||
@@ -22,8 +22,6 @@ import * as eventUtils from './utils.js';
|
||||
|
||||
/**
|
||||
* Abstract class for an event.
|
||||
*
|
||||
* @alias Blockly.Events.Abstract
|
||||
*/
|
||||
export abstract class Abstract {
|
||||
/**
|
||||
@@ -52,7 +50,6 @@ export abstract class Abstract {
|
||||
/** Type of this event. */
|
||||
type = '';
|
||||
|
||||
/** @alias Blockly.Events.Abstract */
|
||||
constructor() {
|
||||
this.group = eventUtils.getGroup();
|
||||
this.recordUndo = eventUtils.getRecordUndo();
|
||||
|
||||
@@ -21,8 +21,6 @@ import {Abstract as AbstractEvent, AbstractEventJson} from './events_abstract.js
|
||||
|
||||
/**
|
||||
* Abstract class for any event related to blocks.
|
||||
*
|
||||
* @alias Blockly.Events.BlockBase
|
||||
*/
|
||||
export class BlockBase extends AbstractEvent {
|
||||
override isBlank = true;
|
||||
|
||||
@@ -26,8 +26,6 @@ import * as eventUtils from './utils.js';
|
||||
/**
|
||||
* Notifies listeners when some element of a block has changed (e.g.
|
||||
* field values, comments, etc).
|
||||
*
|
||||
* @alias Blockly.Events.BlockChange
|
||||
*/
|
||||
export class BlockChange extends BlockBase {
|
||||
override type = eventUtils.BLOCK_CHANGE;
|
||||
|
||||
@@ -26,8 +26,6 @@ import {Workspace} from '../workspace.js';
|
||||
/**
|
||||
* Notifies listeners when a block (or connected stack of blocks) is
|
||||
* created.
|
||||
*
|
||||
* @alias Blockly.Events.BlockCreate
|
||||
*/
|
||||
export class BlockCreate extends BlockBase {
|
||||
override type = eventUtils.BLOCK_CREATE;
|
||||
|
||||
@@ -26,8 +26,6 @@ import {Workspace} from '../workspace.js';
|
||||
/**
|
||||
* Notifies listeners when a block (or connected stack of blocks) is
|
||||
* deleted.
|
||||
*
|
||||
* @alias Blockly.Events.BlockDelete
|
||||
*/
|
||||
export class BlockDelete extends BlockBase {
|
||||
/** The XML representation of the deleted block(s). */
|
||||
|
||||
@@ -23,8 +23,6 @@ import {Workspace} from '../workspace.js';
|
||||
|
||||
/**
|
||||
* Notifies listeners when a block is being manually dragged/dropped.
|
||||
*
|
||||
* @alias Blockly.Events.BlockDrag
|
||||
*/
|
||||
export class BlockDrag extends UiBase {
|
||||
/** The ID of the top-level block being dragged. */
|
||||
|
||||
@@ -32,8 +32,6 @@ interface BlockLocation {
|
||||
/**
|
||||
* Notifies listeners when a block is moved. This could be from one
|
||||
* connection to another, or from one location on the workspace to another.
|
||||
*
|
||||
* @alias Blockly.Events.BlockMove
|
||||
*/
|
||||
export class BlockMove extends BlockBase {
|
||||
override type = eventUtils.BLOCK_MOVE;
|
||||
|
||||
@@ -23,8 +23,6 @@ import type {Workspace} from '../workspace.js';
|
||||
|
||||
/**
|
||||
* Class for a bubble open event.
|
||||
*
|
||||
* @alias Blockly.Events.BubbleOpen
|
||||
*/
|
||||
export class BubbleOpen extends UiBase {
|
||||
/** The ID of the block the bubble is attached to. */
|
||||
|
||||
@@ -24,8 +24,6 @@ import {Workspace} from '../workspace.js';
|
||||
|
||||
/**
|
||||
* Notifies listeners that ome blockly element was clicked.
|
||||
*
|
||||
* @alias Blockly.Events.Click
|
||||
*/
|
||||
export class Click extends UiBase {
|
||||
/** The ID of the block that was clicked, if a block was clicked. */
|
||||
|
||||
@@ -26,8 +26,6 @@ import type {Workspace} from '../workspace.js';
|
||||
|
||||
/**
|
||||
* Abstract class for a comment event.
|
||||
*
|
||||
* @alias Blockly.Events.CommentBase
|
||||
*/
|
||||
export class CommentBase extends AbstractEvent {
|
||||
override isBlank = true;
|
||||
|
||||
@@ -23,8 +23,6 @@ import type {Workspace} from '../workspace.js';
|
||||
|
||||
/**
|
||||
* Notifies listeners that the contents of a workspace comment has changed.
|
||||
*
|
||||
* @alias Blockly.Events.CommentChange
|
||||
*/
|
||||
export class CommentChange extends CommentBase {
|
||||
override type = eventUtils.COMMENT_CHANGE;
|
||||
|
||||
@@ -24,8 +24,6 @@ import type {Workspace} from '../workspace.js';
|
||||
|
||||
/**
|
||||
* Notifies listeners that a workspace comment was created.
|
||||
*
|
||||
* @alias Blockly.Events.CommentCreate
|
||||
*/
|
||||
export class CommentCreate extends CommentBase {
|
||||
override type = eventUtils.COMMENT_CREATE;
|
||||
|
||||
@@ -23,8 +23,6 @@ import type {Workspace} from '../workspace.js';
|
||||
|
||||
/**
|
||||
* Notifies listeners that a workspace comment has been deleted.
|
||||
*
|
||||
* @alias Blockly.Events.CommentDelete
|
||||
*/
|
||||
export class CommentDelete extends CommentBase {
|
||||
override type = eventUtils.COMMENT_DELETE;
|
||||
|
||||
@@ -24,8 +24,6 @@ import type {Workspace} from '../workspace.js';
|
||||
|
||||
/**
|
||||
* Notifies listeners that a workspace comment has moved.
|
||||
*
|
||||
* @alias Blockly.Events.CommentMove
|
||||
*/
|
||||
export class CommentMove extends CommentBase {
|
||||
override type = eventUtils.COMMENT_MOVE;
|
||||
|
||||
@@ -26,8 +26,6 @@ import * as eventUtils from './utils.js';
|
||||
/**
|
||||
* Notifies listeners that a marker (used for keyboard navigation) has
|
||||
* moved.
|
||||
*
|
||||
* @alias Blockly.Events.MarkerMove
|
||||
*/
|
||||
export class MarkerMove extends UiBase {
|
||||
/** The ID of the block the marker is now on, if any. */
|
||||
|
||||
@@ -24,8 +24,6 @@ import type {Workspace} from '../workspace.js';
|
||||
/**
|
||||
* Class for a selected event.
|
||||
* Notifies listeners that a new element has been selected.
|
||||
*
|
||||
* @alias Blockly.Events.Selected
|
||||
*/
|
||||
export class Selected extends UiBase {
|
||||
/** The id of the last selected selectable element. */
|
||||
|
||||
@@ -22,8 +22,6 @@ import type {Workspace} from '../workspace.js';
|
||||
|
||||
/**
|
||||
* Notifies listeners that the workspace theme has changed.
|
||||
*
|
||||
* @alias Blockly.Events.ThemeChange
|
||||
*/
|
||||
export class ThemeChange extends UiBase {
|
||||
/** The name of the new theme that has been set. */
|
||||
|
||||
@@ -22,8 +22,6 @@ import type {Workspace} from '../workspace.js';
|
||||
|
||||
/**
|
||||
* Notifies listeners that a toolbox item has been selected.
|
||||
*
|
||||
* @alias Blockly.Events.ToolboxItemSelect
|
||||
*/
|
||||
export class ToolboxItemSelect extends UiBase {
|
||||
/** The previously selected toolbox item. */
|
||||
|
||||
@@ -23,8 +23,6 @@ import type {Workspace} from '../workspace.js';
|
||||
|
||||
/**
|
||||
* Notifies listeners when the trashcan is opening or closing.
|
||||
*
|
||||
* @alias Blockly.Events.TrashcanOpen
|
||||
*/
|
||||
export class TrashcanOpen extends UiBase {
|
||||
/**
|
||||
|
||||
@@ -23,7 +23,6 @@ import * as eventUtils from './utils.js';
|
||||
* Class for a UI event.
|
||||
*
|
||||
* @deprecated December 2020. Instead use a more specific UI event.
|
||||
* @alias Blockly.Events.Ui
|
||||
*/
|
||||
export class Ui extends UiBase {
|
||||
blockId: AnyDuringMigration;
|
||||
|
||||
@@ -22,8 +22,6 @@ import {Abstract as AbstractEvent} from './events_abstract.js';
|
||||
* editing to work (e.g. scrolling the workspace, zooming, opening toolbox
|
||||
* categories).
|
||||
* UI events do not undo or redo.
|
||||
*
|
||||
* @alias Blockly.Events.UiBase
|
||||
*/
|
||||
export class UiBase extends AbstractEvent {
|
||||
override isBlank = true;
|
||||
|
||||
@@ -21,8 +21,6 @@ import type {Workspace} from '../workspace.js';
|
||||
|
||||
/**
|
||||
* Abstract class for a variable event.
|
||||
*
|
||||
* @alias Blockly.Events.VarBase
|
||||
*/
|
||||
export class VarBase extends AbstractEvent {
|
||||
override isBlank = true;
|
||||
|
||||
@@ -23,8 +23,6 @@ import type {Workspace} from '../workspace.js';
|
||||
|
||||
/**
|
||||
* Notifies listeners that a variable model has been created.
|
||||
*
|
||||
* @alias Blockly.Events.VarCreate
|
||||
*/
|
||||
export class VarCreate extends VarBase {
|
||||
override type = eventUtils.VAR_CREATE;
|
||||
|
||||
@@ -25,8 +25,6 @@ import type {Workspace} from '../workspace.js';
|
||||
* changed.
|
||||
*
|
||||
* Does not notify when the workspace itself resizes.
|
||||
*
|
||||
* @alias Blockly.Events.ViewportChange
|
||||
*/
|
||||
export class ViewportChange extends UiBase {
|
||||
/**
|
||||
|
||||
@@ -39,7 +39,6 @@ let recordUndo = true;
|
||||
* Sets whether events should be added to the undo stack.
|
||||
*
|
||||
* @param newValue True if events should be added to the undo stack.
|
||||
* @alias Blockly.Events.utils.setRecordUndo
|
||||
*/
|
||||
export function setRecordUndo(newValue: boolean) {
|
||||
recordUndo = newValue;
|
||||
@@ -49,7 +48,6 @@ export function setRecordUndo(newValue: boolean) {
|
||||
* Returns whether or not events will be added to the undo stack.
|
||||
*
|
||||
* @returns True if events will be added to the undo stack.
|
||||
* @alias Blockly.Events.utils.getRecordUndo
|
||||
*/
|
||||
export function getRecordUndo(): boolean {
|
||||
return recordUndo;
|
||||
@@ -60,183 +58,131 @@ let disabled = 0;
|
||||
|
||||
/**
|
||||
* Name of event that creates a block. Will be deprecated for BLOCK_CREATE.
|
||||
*
|
||||
* @alias Blockly.Events.utils.CREATE
|
||||
*/
|
||||
export const CREATE = 'create';
|
||||
|
||||
/**
|
||||
* Name of event that creates a block.
|
||||
*
|
||||
* @alias Blockly.Events.utils.BLOCK_CREATE
|
||||
*/
|
||||
export const BLOCK_CREATE = CREATE;
|
||||
|
||||
/**
|
||||
* Name of event that deletes a block. Will be deprecated for BLOCK_DELETE.
|
||||
*
|
||||
* @alias Blockly.Events.utils.DELETE
|
||||
*/
|
||||
export const DELETE = 'delete';
|
||||
|
||||
/**
|
||||
* Name of event that deletes a block.
|
||||
*
|
||||
* @alias Blockly.Events.utils.BLOCK_DELETE
|
||||
*/
|
||||
export const BLOCK_DELETE = DELETE;
|
||||
|
||||
/**
|
||||
* Name of event that changes a block. Will be deprecated for BLOCK_CHANGE.
|
||||
*
|
||||
* @alias Blockly.Events.utils.CHANGE
|
||||
*/
|
||||
export const CHANGE = 'change';
|
||||
|
||||
/**
|
||||
* Name of event that changes a block.
|
||||
*
|
||||
* @alias Blockly.Events.utils.BLOCK_CHANGE
|
||||
*/
|
||||
export const BLOCK_CHANGE = CHANGE;
|
||||
|
||||
/**
|
||||
* Name of event that moves a block. Will be deprecated for BLOCK_MOVE.
|
||||
*
|
||||
* @alias Blockly.Events.utils.MOVE
|
||||
*/
|
||||
export const MOVE = 'move';
|
||||
|
||||
/**
|
||||
* Name of event that moves a block.
|
||||
*
|
||||
* @alias Blockly.Events.utils.BLOCK_MOVE
|
||||
*/
|
||||
export const BLOCK_MOVE = MOVE;
|
||||
|
||||
/**
|
||||
* Name of event that creates a variable.
|
||||
*
|
||||
* @alias Blockly.Events.utils.VAR_CREATE
|
||||
*/
|
||||
export const VAR_CREATE = 'var_create';
|
||||
|
||||
/**
|
||||
* Name of event that deletes a variable.
|
||||
*
|
||||
* @alias Blockly.Events.utils.VAR_DELETE
|
||||
*/
|
||||
export const VAR_DELETE = 'var_delete';
|
||||
|
||||
/**
|
||||
* Name of event that renames a variable.
|
||||
*
|
||||
* @alias Blockly.Events.utils.VAR_RENAME
|
||||
*/
|
||||
export const VAR_RENAME = 'var_rename';
|
||||
|
||||
/**
|
||||
* Name of generic event that records a UI change.
|
||||
*
|
||||
* @alias Blockly.Events.utils.UI
|
||||
*/
|
||||
export const UI = 'ui';
|
||||
|
||||
/**
|
||||
* Name of event that record a block drags a block.
|
||||
*
|
||||
* @alias Blockly.Events.utils.BLOCK_DRAG
|
||||
*/
|
||||
export const BLOCK_DRAG = 'drag';
|
||||
|
||||
/**
|
||||
* Name of event that records a change in selected element.
|
||||
*
|
||||
* @alias Blockly.Events.utils.SELECTED
|
||||
*/
|
||||
export const SELECTED = 'selected';
|
||||
|
||||
/**
|
||||
* Name of event that records a click.
|
||||
*
|
||||
* @alias Blockly.Events.utils.CLICK
|
||||
*/
|
||||
export const CLICK = 'click';
|
||||
|
||||
/**
|
||||
* Name of event that records a marker move.
|
||||
*
|
||||
* @alias Blockly.Events.utils.MARKER_MOVE
|
||||
*/
|
||||
export const MARKER_MOVE = 'marker_move';
|
||||
|
||||
/**
|
||||
* Name of event that records a bubble open.
|
||||
*
|
||||
* @alias Blockly.Events.utils.BUBBLE_OPEN
|
||||
*/
|
||||
export const BUBBLE_OPEN = 'bubble_open';
|
||||
|
||||
/**
|
||||
* Name of event that records a trashcan open.
|
||||
*
|
||||
* @alias Blockly.Events.utils.TRASHCAN_OPEN
|
||||
*/
|
||||
export const TRASHCAN_OPEN = 'trashcan_open';
|
||||
|
||||
/**
|
||||
* Name of event that records a toolbox item select.
|
||||
*
|
||||
* @alias Blockly.Events.utils.TOOLBOX_ITEM_SELECT
|
||||
*/
|
||||
export const TOOLBOX_ITEM_SELECT = 'toolbox_item_select';
|
||||
|
||||
/**
|
||||
* Name of event that records a theme change.
|
||||
*
|
||||
* @alias Blockly.Events.utils.THEME_CHANGE
|
||||
*/
|
||||
export const THEME_CHANGE = 'theme_change';
|
||||
|
||||
/**
|
||||
* Name of event that records a viewport change.
|
||||
*
|
||||
* @alias Blockly.Events.utils.VIEWPORT_CHANGE
|
||||
*/
|
||||
export const VIEWPORT_CHANGE = 'viewport_change';
|
||||
|
||||
/**
|
||||
* Name of event that creates a comment.
|
||||
*
|
||||
* @alias Blockly.Events.utils.COMMENT_CREATE
|
||||
*/
|
||||
export const COMMENT_CREATE = 'comment_create';
|
||||
|
||||
/**
|
||||
* Name of event that deletes a comment.
|
||||
*
|
||||
* @alias Blockly.Events.utils.COMMENT_DELETE
|
||||
*/
|
||||
export const COMMENT_DELETE = 'comment_delete';
|
||||
|
||||
/**
|
||||
* Name of event that changes a comment.
|
||||
*
|
||||
* @alias Blockly.Events.utils.COMMENT_CHANGE
|
||||
*/
|
||||
export const COMMENT_CHANGE = 'comment_change';
|
||||
|
||||
/**
|
||||
* Name of event that moves a comment.
|
||||
*
|
||||
* @alias Blockly.Events.utils.COMMENT_MOVE
|
||||
*/
|
||||
export const COMMENT_MOVE = 'comment_move';
|
||||
|
||||
/**
|
||||
* Name of event that records a workspace load.
|
||||
*
|
||||
* @alias Blockly.Events.utils.FINISHED_LOADING
|
||||
*/
|
||||
export const FINISHED_LOADING = 'finished_loading';
|
||||
|
||||
@@ -246,8 +192,6 @@ export const FINISHED_LOADING = 'finished_loading';
|
||||
*
|
||||
* Not to be confused with bumping so that disconnected connections do not
|
||||
* appear connected.
|
||||
*
|
||||
* @alias Blockly.Events.utils.BumpEvent
|
||||
*/
|
||||
export type BumpEvent = BlockCreate|BlockMove|CommentCreate|CommentMove;
|
||||
|
||||
@@ -257,8 +201,6 @@ export type BumpEvent = BlockCreate|BlockMove|CommentCreate|CommentMove;
|
||||
*
|
||||
* Not to be confused with bumping so that disconnected connections do not
|
||||
* appear connected.
|
||||
*
|
||||
* @alias Blockly.Events.utils.BUMP_EVENTS
|
||||
*/
|
||||
export const BUMP_EVENTS: string[] =
|
||||
[BLOCK_CREATE, BLOCK_MOVE, COMMENT_CREATE, COMMENT_MOVE];
|
||||
@@ -270,7 +212,6 @@ const FIRE_QUEUE: Abstract[] = [];
|
||||
* Create a custom event and fire it.
|
||||
*
|
||||
* @param event Custom data for event.
|
||||
* @alias Blockly.Events.utils.fire
|
||||
*/
|
||||
export function fire(event: Abstract) {
|
||||
TEST_ONLY.fireInternal(event);
|
||||
@@ -312,7 +253,6 @@ function fireNow() {
|
||||
* @param queueIn Array of events.
|
||||
* @param forward True if forward (redo), false if backward (undo).
|
||||
* @returns Array of filtered events.
|
||||
* @alias Blockly.Events.utils.filter
|
||||
*/
|
||||
export function filter(queueIn: Abstract[], forward: boolean): Abstract[] {
|
||||
let queue = queueIn.slice();
|
||||
@@ -395,8 +335,6 @@ export function filter(queueIn: Abstract[], forward: boolean): Abstract[] {
|
||||
/**
|
||||
* Modify pending undo events so that when they are fired they don't land
|
||||
* in the undo stack. Called by Workspace.clearUndo.
|
||||
*
|
||||
* @alias Blockly.Events.utils.clearPendingUndo
|
||||
*/
|
||||
export function clearPendingUndo() {
|
||||
for (let i = 0, event; event = FIRE_QUEUE[i]; i++) {
|
||||
@@ -406,8 +344,6 @@ export function clearPendingUndo() {
|
||||
|
||||
/**
|
||||
* Stop sending events. Every call to this function MUST also call enable.
|
||||
*
|
||||
* @alias Blockly.Events.utils.disable
|
||||
*/
|
||||
export function disable() {
|
||||
disabled++;
|
||||
@@ -416,8 +352,6 @@ export function disable() {
|
||||
/**
|
||||
* Start sending events. Unless events were already disabled when the
|
||||
* corresponding call to disable was made.
|
||||
*
|
||||
* @alias Blockly.Events.utils.enable
|
||||
*/
|
||||
export function enable() {
|
||||
disabled--;
|
||||
@@ -427,7 +361,6 @@ export function enable() {
|
||||
* Returns whether events may be fired or not.
|
||||
*
|
||||
* @returns True if enabled.
|
||||
* @alias Blockly.Events.utils.isEnabled
|
||||
*/
|
||||
export function isEnabled(): boolean {
|
||||
return disabled === 0;
|
||||
@@ -437,7 +370,6 @@ export function isEnabled(): boolean {
|
||||
* Current group.
|
||||
*
|
||||
* @returns ID string.
|
||||
* @alias Blockly.Events.utils.getGroup
|
||||
*/
|
||||
export function getGroup(): string {
|
||||
return group;
|
||||
@@ -448,7 +380,6 @@ export function getGroup(): string {
|
||||
*
|
||||
* @param state True to start new group, false to end group.
|
||||
* String to set group explicitly.
|
||||
* @alias Blockly.Events.utils.setGroup
|
||||
*/
|
||||
export function setGroup(state: boolean|string) {
|
||||
TEST_ONLY.setGroupInternal(state);
|
||||
@@ -470,7 +401,6 @@ function setGroupInternal(state: boolean|string) {
|
||||
*
|
||||
* @param block The root block.
|
||||
* @returns List of block IDs.
|
||||
* @alias Blockly.Events.utils.getDescendantIds
|
||||
* @internal
|
||||
*/
|
||||
export function getDescendantIds(block: Block): string[] {
|
||||
@@ -489,7 +419,6 @@ export function getDescendantIds(block: Block): string[] {
|
||||
* @param workspace Target workspace for event.
|
||||
* @returns The event represented by the JSON.
|
||||
* @throws {Error} if an event type is not found in the registry.
|
||||
* @alias Blockly.Events.utils.fromJson
|
||||
*/
|
||||
export function fromJson(
|
||||
json: AnyDuringMigration, workspace: Workspace): Abstract {
|
||||
@@ -526,7 +455,6 @@ function eventClassHasStaticFromJson(eventClass: new (...p: any[]) => Abstract):
|
||||
*
|
||||
* @param eventType The type of the event to get.
|
||||
* @returns The event class with the given type.
|
||||
* @alias Blockly.Events.utils.get
|
||||
*/
|
||||
export function get(eventType: string):
|
||||
(new (...p1: AnyDuringMigration[]) => Abstract) {
|
||||
@@ -544,7 +472,6 @@ export function get(eventType: string):
|
||||
* users don't try to re-enable disabled orphan blocks.
|
||||
*
|
||||
* @param event Custom data for event.
|
||||
* @alias Blockly.Events.utils.disableOrphans
|
||||
*/
|
||||
export function disableOrphans(event: Abstract) {
|
||||
if (event.type === MOVE || event.type === CREATE) {
|
||||
|
||||
@@ -21,8 +21,6 @@ import * as eventUtils from './utils.js';
|
||||
/**
|
||||
* Notifies listeners when the workspace has finished deserializing from
|
||||
* JSON/XML.
|
||||
*
|
||||
* @alias Blockly.Events.FinishedLoading
|
||||
*/
|
||||
export class FinishedLoading extends AbstractEvent {
|
||||
override isBlank = true;
|
||||
|
||||
@@ -36,7 +36,6 @@ export const TEST_ONLY = {allExtensions};
|
||||
* @param initFn The function to initialize an extended block.
|
||||
* @throws {Error} if the extension name is empty, the extension is already
|
||||
* registered, or extensionFn is not a function.
|
||||
* @alias Blockly.Extensions.register
|
||||
*/
|
||||
export function register(name: string, initFn: Function) {
|
||||
if (typeof name !== 'string' || name.trim() === '') {
|
||||
@@ -58,7 +57,6 @@ export function register(name: string, initFn: Function) {
|
||||
* @param mixinObj The values to mix in.
|
||||
* @throws {Error} if the extension name is empty or the extension is already
|
||||
* registered.
|
||||
* @alias Blockly.Extensions.registerMixin
|
||||
*/
|
||||
export function registerMixin(name: string, mixinObj: AnyDuringMigration) {
|
||||
if (!mixinObj || typeof mixinObj !== 'object') {
|
||||
@@ -81,7 +79,6 @@ export function registerMixin(name: string, mixinObj: AnyDuringMigration) {
|
||||
* @param opt_blockList A list of blocks to appear in the flyout of the mutator
|
||||
* dialog.
|
||||
* @throws {Error} if the mutation is invalid or can't be applied to the block.
|
||||
* @alias Blockly.Extensions.registerMutator
|
||||
*/
|
||||
export function registerMutator(
|
||||
name: string, mixinObj: AnyDuringMigration,
|
||||
@@ -113,7 +110,6 @@ export function registerMutator(
|
||||
* Unregisters the extension registered with the given name.
|
||||
*
|
||||
* @param name The name of the extension to unregister.
|
||||
* @alias Blockly.Extensions.unregister
|
||||
*/
|
||||
export function unregister(name: string) {
|
||||
if (isRegistered(name)) {
|
||||
@@ -129,7 +125,6 @@ export function unregister(name: string) {
|
||||
*
|
||||
* @param name The name of the extension to check for.
|
||||
* @returns True if the extension is registered. False if it is not registered.
|
||||
* @alias Blockly.Extensions.isRegistered
|
||||
*/
|
||||
export function isRegistered(name: string): boolean {
|
||||
return !!allExtensions[name];
|
||||
@@ -143,7 +138,6 @@ export function isRegistered(name: string): boolean {
|
||||
* @param block The block to apply the named extension to.
|
||||
* @param isMutator True if this extension defines a mutator.
|
||||
* @throws {Error} if the extension is not found.
|
||||
* @alias Blockly.Extensions.apply
|
||||
*/
|
||||
export function apply(name: string, block: Block, isMutator: boolean) {
|
||||
const extensionFn = allExtensions[name];
|
||||
@@ -387,7 +381,6 @@ export function runAfterPageLoad(fn: () => void) {
|
||||
* lookup table.
|
||||
* @param lookupTable The table of field values to tooltip text.
|
||||
* @returns The extension function.
|
||||
* @alias Blockly.Extensions.buildTooltipForDropdown
|
||||
*/
|
||||
export function buildTooltipForDropdown(
|
||||
dropdownName: string, lookupTable: {[key: string]: string}): Function {
|
||||
@@ -470,7 +463,6 @@ function checkDropdownOptionsInTable(
|
||||
* placeholder.
|
||||
* @param fieldName The field with the replacement text.
|
||||
* @returns The extension function.
|
||||
* @alias Blockly.Extensions.buildTooltipWithFieldText
|
||||
*/
|
||||
export function buildTooltipWithFieldText(
|
||||
msgTemplate: string, fieldName: string): Function {
|
||||
|
||||
@@ -67,7 +67,6 @@ export type FieldValidator<T = any> = (newValue: T) => T|null|undefined;
|
||||
/**
|
||||
* Abstract class for an editable field.
|
||||
*
|
||||
* @alias Blockly.Field
|
||||
* @typeParam T - The value stored on the field.
|
||||
*/
|
||||
export abstract class Field<T = any> implements IASTNodeLocationSvg,
|
||||
|
||||
@@ -31,8 +31,6 @@ export type FieldAngleValidator = FieldInputValidator<number>;
|
||||
|
||||
/**
|
||||
* Class for an editable angle field.
|
||||
*
|
||||
* @alias Blockly.FieldAngle
|
||||
*/
|
||||
export class FieldAngle extends FieldInput<number> {
|
||||
/**
|
||||
|
||||
@@ -26,8 +26,6 @@ export type FieldCheckboxValidator = FieldValidator<CheckboxBool>;
|
||||
|
||||
/**
|
||||
* Class for a checkbox field.
|
||||
*
|
||||
* @alias Blockly.FieldCheckbox
|
||||
*/
|
||||
export class FieldCheckbox extends Field<CheckboxBool> {
|
||||
/** Default character for the checkmark. */
|
||||
|
||||
@@ -33,8 +33,6 @@ export type FieldColourValidator = FieldValidator<string>;
|
||||
|
||||
/**
|
||||
* Class for a colour input field.
|
||||
*
|
||||
* @alias Blockly.FieldColour
|
||||
*/
|
||||
export class FieldColour extends Field<string> {
|
||||
/**
|
||||
|
||||
@@ -32,8 +32,6 @@ export type FieldDropdownValidator = FieldValidator<string>;
|
||||
|
||||
/**
|
||||
* Class for an editable dropdown field.
|
||||
*
|
||||
* @alias Blockly.FieldDropdown
|
||||
*/
|
||||
export class FieldDropdown extends Field<string> {
|
||||
/** Horizontal distance that a checkmark overhangs the dropdown. */
|
||||
|
||||
@@ -22,8 +22,6 @@ import {Svg} from './utils/svg.js';
|
||||
|
||||
/**
|
||||
* Class for an image on a block.
|
||||
*
|
||||
* @alias Blockly.FieldImage
|
||||
*/
|
||||
export class FieldImage extends Field<string> {
|
||||
/**
|
||||
|
||||
@@ -38,7 +38,6 @@ export type FieldInputValidator<T extends InputTypes> =
|
||||
/**
|
||||
* Abstract class for an editable input field.
|
||||
*
|
||||
* @alias Blockly.FieldInput
|
||||
* @typeParam T - The value stored on the field.
|
||||
*/
|
||||
export abstract class FieldInput<T extends InputTypes> extends Field<string|T> {
|
||||
|
||||
@@ -21,8 +21,6 @@ import type {Sentinel} from './utils/sentinel.js';
|
||||
|
||||
/**
|
||||
* Class for a non-editable, non-serializable text field.
|
||||
*
|
||||
* @alias Blockly.FieldLabel
|
||||
*/
|
||||
export class FieldLabel extends Field<string> {
|
||||
/** The html class name to use for this field. */
|
||||
|
||||
@@ -20,8 +20,6 @@ import * as parsing from './utils/parsing.js';
|
||||
|
||||
/**
|
||||
* Class for a non-editable, serializable text field.
|
||||
*
|
||||
* @alias Blockly.FieldLabelSerializable
|
||||
*/
|
||||
export class FieldLabelSerializable extends FieldLabel {
|
||||
/**
|
||||
|
||||
@@ -29,8 +29,6 @@ export type FieldMultilineInputValidator = FieldTextInputValidator;
|
||||
|
||||
/**
|
||||
* Class for an editable text area field.
|
||||
*
|
||||
* @alias Blockly.FieldMultilineInput
|
||||
*/
|
||||
export class FieldMultilineInput extends FieldTextInput {
|
||||
/**
|
||||
|
||||
@@ -22,8 +22,6 @@ export type FieldNumberValidator = FieldInputValidator<number>;
|
||||
|
||||
/**
|
||||
* Class for an editable number field.
|
||||
*
|
||||
* @alias Blockly.FieldNumber
|
||||
*/
|
||||
export class FieldNumber extends FieldInput<number> {
|
||||
/** The minimum value this number field can contain. */
|
||||
|
||||
@@ -32,7 +32,6 @@ interface RegistryOptions {
|
||||
* construct an instance of the field.
|
||||
* @throws {Error} if the type name is empty, the field is already registered,
|
||||
* or the fieldClass is not an object containing a fromJson function.
|
||||
* @alias Blockly.fieldRegistry.register
|
||||
*/
|
||||
export function register(type: string, fieldClass: FieldProto) {
|
||||
registry.register(registry.Type.FIELD, type, fieldClass);
|
||||
@@ -42,7 +41,6 @@ export function register(type: string, fieldClass: FieldProto) {
|
||||
* Unregisters the field registered with the given type.
|
||||
*
|
||||
* @param type The field type name as used in the JSON definition.
|
||||
* @alias Blockly.fieldRegistry.unregister
|
||||
*/
|
||||
export function unregister(type: string) {
|
||||
registry.unregister(registry.Type.FIELD, type);
|
||||
@@ -57,7 +55,6 @@ export function unregister(type: string) {
|
||||
* type.
|
||||
* @returns The new field instance or null if a field wasn't found with the
|
||||
* given type name
|
||||
* @alias Blockly.fieldRegistry.fromJson
|
||||
* @internal
|
||||
*/
|
||||
export function fromJson<T>(options: RegistryOptions): Field<T>|null {
|
||||
|
||||
@@ -24,8 +24,6 @@ export type FieldTextInputValidator = FieldInputValidator<string>;
|
||||
|
||||
/**
|
||||
* Class for an editable text field.
|
||||
*
|
||||
* @alias Blockly.FieldTextInput
|
||||
*/
|
||||
export class FieldTextInput extends FieldInput<string> {
|
||||
/**
|
||||
|
||||
@@ -34,8 +34,6 @@ export type FieldVariableValidator = FieldDropdownValidator;
|
||||
|
||||
/**
|
||||
* Class for a variable's dropdown field.
|
||||
*
|
||||
* @alias Blockly.FieldVariable
|
||||
*/
|
||||
export class FieldVariable extends FieldDropdown {
|
||||
protected override menuGenerator_: MenuGenerator|undefined;
|
||||
|
||||
@@ -43,8 +43,6 @@ enum FlyoutItemType {
|
||||
|
||||
/**
|
||||
* Class for a flyout.
|
||||
*
|
||||
* @alias Blockly.Flyout
|
||||
*/
|
||||
export abstract class Flyout extends DeleteArea implements IFlyout {
|
||||
/**
|
||||
|
||||
@@ -25,8 +25,6 @@ import type {WorkspaceSvg} from './workspace_svg.js';
|
||||
|
||||
/**
|
||||
* Class for a button or label in the flyout.
|
||||
*
|
||||
* @alias Blockly.FlyoutButton
|
||||
*/
|
||||
export class FlyoutButton {
|
||||
/** The horizontal margin around the text in the button. */
|
||||
|
||||
@@ -27,8 +27,6 @@ import * as WidgetDiv from './widgetdiv.js';
|
||||
|
||||
/**
|
||||
* Class for a flyout.
|
||||
*
|
||||
* @alias Blockly.HorizontalFlyout
|
||||
*/
|
||||
export class HorizontalFlyout extends Flyout {
|
||||
override horizontalLayout = true;
|
||||
|
||||
@@ -20,8 +20,6 @@ import type {WorkspaceSvg} from './workspace_svg.js';
|
||||
/**
|
||||
* Calculates metrics for a flyout's workspace.
|
||||
* The metrics are mainly used to size scrollbars for the flyout.
|
||||
*
|
||||
* @alias Blockly.FlyoutMetricsManager
|
||||
*/
|
||||
export class FlyoutMetricsManager extends MetricsManager {
|
||||
/** The flyout that owns the workspace to calculate metrics for. */
|
||||
|
||||
@@ -27,8 +27,6 @@ import * as WidgetDiv from './widgetdiv.js';
|
||||
|
||||
/**
|
||||
* Class for a flyout.
|
||||
*
|
||||
* @alias Blockly.VerticalFlyout
|
||||
*/
|
||||
export class VerticalFlyout extends Flyout {
|
||||
/** The name of the vertical flyout in the registry. */
|
||||
|
||||
@@ -24,7 +24,6 @@ import type {Workspace} from './workspace.js';
|
||||
* Class for a code generator that translates the blocks into a language.
|
||||
*
|
||||
* @unrestricted
|
||||
* @alias Blockly.CodeGenerator
|
||||
*/
|
||||
export class CodeGenerator {
|
||||
name_: string;
|
||||
|
||||
@@ -51,8 +51,6 @@ const ZOOM_OUT_MULTIPLIER = 6;
|
||||
|
||||
/**
|
||||
* Class for one gesture.
|
||||
*
|
||||
* @alias Blockly.Gesture
|
||||
*/
|
||||
export class Gesture {
|
||||
/**
|
||||
|
||||
@@ -20,8 +20,6 @@ import {GridOptions} from './options.js';
|
||||
|
||||
/**
|
||||
* Class for a workspace's grid.
|
||||
*
|
||||
* @alias Blockly.Grid
|
||||
*/
|
||||
export class Grid {
|
||||
private readonly spacing: number;
|
||||
|
||||
@@ -25,8 +25,6 @@ import * as deprecation from './utils/deprecation.js';
|
||||
|
||||
/**
|
||||
* Class for an icon.
|
||||
*
|
||||
* @alias Blockly.Icon
|
||||
*/
|
||||
export abstract class Icon {
|
||||
protected block_: BlockSvg|null;
|
||||
|
||||
@@ -39,7 +39,6 @@ import {WorkspaceSvg} from './workspace_svg.js';
|
||||
* @param container Containing element, or its ID, or a CSS selector.
|
||||
* @param opt_options Optional dictionary of options.
|
||||
* @returns Newly created main workspace.
|
||||
* @alias Blockly.inject
|
||||
*/
|
||||
export function inject(
|
||||
container: Element|string, opt_options?: BlocklyOptions): WorkspaceSvg {
|
||||
|
||||
@@ -26,8 +26,6 @@ import type {RenderedConnection} from './rendered_connection.js';
|
||||
|
||||
/**
|
||||
* Class for an input with an optional field.
|
||||
*
|
||||
* @alias Blockly.Input
|
||||
*/
|
||||
export class Input {
|
||||
private sourceBlock: Block;
|
||||
@@ -306,7 +304,6 @@ export namespace Input {
|
||||
/**
|
||||
* Enum for alignment of inputs.
|
||||
*
|
||||
* @alias Blockly.Input.Align
|
||||
*/
|
||||
export enum Align {
|
||||
LEFT = -1,
|
||||
|
||||
@@ -17,8 +17,6 @@ import {ConnectionType} from './connection_type.js';
|
||||
|
||||
/**
|
||||
* Enum for the type of a connection or input.
|
||||
*
|
||||
* @alias Blockly.inputTypes
|
||||
*/
|
||||
export enum inputTypes {
|
||||
// A right-facing value input. E.g. 'set item to' or 'return'.
|
||||
|
||||
@@ -56,8 +56,6 @@ const DUPLICATE_BLOCK_ERROR = 'The insertion marker ' +
|
||||
* Class that controls updates to connections during drags. It is primarily
|
||||
* responsible for finding the closest eligible connection and highlighting or
|
||||
* unhighlighting it as needed during a drag.
|
||||
*
|
||||
* @alias Blockly.InsertionMarkerManager
|
||||
*/
|
||||
export class InsertionMarkerManager {
|
||||
/**
|
||||
|
||||
@@ -15,7 +15,5 @@ goog.declareModuleId('Blockly.IASTNodeLocation');
|
||||
|
||||
/**
|
||||
* An AST node location interface.
|
||||
*
|
||||
* @alias Blockly.IASTNodeLocation
|
||||
*/
|
||||
export interface IASTNodeLocation {}
|
||||
|
||||
@@ -17,8 +17,6 @@ import type {IASTNodeLocation} from './i_ast_node_location.js';
|
||||
|
||||
/**
|
||||
* An AST node location SVG interface.
|
||||
*
|
||||
* @alias Blockly.IASTNodeLocationSvg
|
||||
*/
|
||||
export interface IASTNodeLocationSvg extends IASTNodeLocation {
|
||||
/**
|
||||
|
||||
@@ -19,8 +19,6 @@ import type {Block} from '../block.js';
|
||||
|
||||
/**
|
||||
* An AST node location that has an associated block.
|
||||
*
|
||||
* @alias Blockly.IASTNodeLocationWithBlock
|
||||
*/
|
||||
export interface IASTNodeLocationWithBlock extends IASTNodeLocation {
|
||||
/**
|
||||
|
||||
@@ -18,8 +18,6 @@ import type {IComponent} from './i_component.js';
|
||||
|
||||
/**
|
||||
* Interface for a component that can be automatically hidden.
|
||||
*
|
||||
* @alias Blockly.IAutoHideable
|
||||
*/
|
||||
export interface IAutoHideable extends IComponent {
|
||||
/**
|
||||
|
||||
@@ -16,8 +16,6 @@ goog.declareModuleId('Blockly.IBlockDragger');
|
||||
|
||||
/**
|
||||
* A block dragger interface.
|
||||
*
|
||||
* @alias Blockly.IBlockDragger
|
||||
*/
|
||||
export interface IBlockDragger {
|
||||
/**
|
||||
|
||||
@@ -15,8 +15,6 @@ goog.declareModuleId('Blockly.IBoundedElement');
|
||||
|
||||
/**
|
||||
* A bounded element interface.
|
||||
*
|
||||
* @alias Blockly.IBoundedElement
|
||||
*/
|
||||
export interface IBoundedElement {
|
||||
/**
|
||||
|
||||
@@ -19,8 +19,6 @@ import type {IDraggable} from './i_draggable.js';
|
||||
|
||||
/**
|
||||
* A bubble interface.
|
||||
*
|
||||
* @alias Blockly.IBubble
|
||||
*/
|
||||
export interface IBubble extends IDraggable, IContextMenu {
|
||||
/**
|
||||
|
||||
@@ -18,8 +18,6 @@ import type {IToolboxItem} from './i_toolbox_item.js';
|
||||
|
||||
/**
|
||||
* Interface for an item in the toolbox that can be collapsed.
|
||||
*
|
||||
* @alias Blockly.ICollapsibleToolboxItem
|
||||
*/
|
||||
export interface ICollapsibleToolboxItem extends ISelectableToolboxItem {
|
||||
/**
|
||||
|
||||
@@ -17,8 +17,6 @@ goog.declareModuleId('Blockly.IComponent');
|
||||
/**
|
||||
* The interface for a workspace component that can be registered with the
|
||||
* ComponentManager.
|
||||
*
|
||||
* @alias Blockly.IComponent
|
||||
*/
|
||||
export interface IComponent {
|
||||
/**
|
||||
|
||||
@@ -17,8 +17,6 @@ goog.declareModuleId('Blockly.IConnectionChecker');
|
||||
|
||||
/**
|
||||
* Class for connection type checking logic.
|
||||
*
|
||||
* @alias Blockly.IConnectionChecker
|
||||
*/
|
||||
export interface IConnectionChecker {
|
||||
/**
|
||||
|
||||
@@ -13,7 +13,6 @@ import * as goog from '../../closure/goog/goog.js';
|
||||
goog.declareModuleId('Blockly.IContextMenu');
|
||||
|
||||
|
||||
/** @alias Blockly.IContextMenu */
|
||||
export interface IContextMenu {
|
||||
/**
|
||||
* Show the context menu for this object.
|
||||
|
||||
@@ -16,7 +16,6 @@ import type {WorkspaceSvg} from '../workspace_svg.js';
|
||||
import type {ISelectable} from './i_selectable.js';
|
||||
|
||||
|
||||
/** @alias Blockly.ICopyable */
|
||||
export interface ICopyable extends ISelectable {
|
||||
/**
|
||||
* Encode for copying.
|
||||
|
||||
@@ -15,8 +15,6 @@ goog.declareModuleId('Blockly.IDeletable');
|
||||
|
||||
/**
|
||||
* The interface for an object that can be deleted.
|
||||
*
|
||||
* @alias Blockly.IDeletable
|
||||
*/
|
||||
export interface IDeletable {
|
||||
/**
|
||||
|
||||
@@ -20,8 +20,6 @@ import type {IDraggable} from './i_draggable.js';
|
||||
/**
|
||||
* Interface for a component that can delete a block or bubble that is dropped
|
||||
* on top of it.
|
||||
*
|
||||
* @alias Blockly.IDeleteArea
|
||||
*/
|
||||
export interface IDeleteArea extends IDragTarget {
|
||||
/**
|
||||
|
||||
@@ -23,8 +23,6 @@ import type {IComponent} from './i_component.js';
|
||||
/**
|
||||
* Interface for a component with custom behaviour when a block or bubble is
|
||||
* dragged over or dropped on top of it.
|
||||
*
|
||||
* @alias Blockly.IDragTarget
|
||||
*/
|
||||
export interface IDragTarget extends IComponent {
|
||||
/**
|
||||
|
||||
@@ -17,7 +17,5 @@ import type {IDeletable} from './i_deletable.js';
|
||||
|
||||
/**
|
||||
* The interface for an object that can be dragged.
|
||||
*
|
||||
* @alias Blockly.IDraggable
|
||||
*/
|
||||
export interface IDraggable extends IDeletable {}
|
||||
|
||||
@@ -22,8 +22,6 @@ import type {IRegistrable} from './i_registrable.js';
|
||||
|
||||
/**
|
||||
* Interface for a flyout.
|
||||
*
|
||||
* @alias Blockly.IFlyout
|
||||
*/
|
||||
export interface IFlyout extends IRegistrable {
|
||||
/** Whether the flyout is laid out horizontally or not. */
|
||||
|
||||
@@ -15,8 +15,6 @@ goog.declareModuleId('Blockly.IKeyboardAccessible');
|
||||
|
||||
/**
|
||||
* An interface for an object that handles keyboard shortcuts.
|
||||
*
|
||||
* @alias Blockly.IKeyboardAccessible
|
||||
*/
|
||||
export interface IKeyboardAccessible {
|
||||
/**
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user