diff --git a/core/renderers/common/block_rendering.ts b/core/renderers/common/block_rendering.ts index a7b558740..34d39e4c3 100644 --- a/core/renderers/common/block_rendering.ts +++ b/core/renderers/common/block_rendering.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Namespace for block rendering functionality. - * - * @namespace Blockly.blockRendering - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering'); diff --git a/core/renderers/common/constants.ts b/core/renderers/common/constants.ts index c5e294bc2..1408ccf1b 100644 --- a/core/renderers/common/constants.ts +++ b/core/renderers/common/constants.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * An object that provides constants for rendering blocks. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.ConstantProvider'); @@ -237,8 +232,6 @@ export class ConstantProvider { /** * The backing colour of a field's border rect. - * - * @internal */ FIELD_BORDER_RECT_COLOUR = '#fff'; FIELD_TEXT_BASELINE_CENTER: boolean; @@ -280,7 +273,6 @@ export class ConstantProvider { FIELD_COLOUR_DEFAULT_WIDTH = 26; FIELD_COLOUR_DEFAULT_HEIGHT: number; FIELD_CHECKBOX_X_OFFSET: number; - /** @internal */ randomIdentifier: string; /** @@ -291,8 +283,6 @@ export class ConstantProvider { /** * The ID of the emboss filter, or the empty string if no filter is set. - * - * @internal */ embossFilterId = ''; @@ -301,8 +291,6 @@ export class ConstantProvider { /** * The ID of the disabled pattern, or the empty string if no pattern is set. - * - * @internal */ disabledPatternId = ''; @@ -326,72 +314,52 @@ export class ConstantProvider { /** * Cursor colour. - * - * @internal */ CURSOR_COLOUR = '#cc0a0a'; /** * Immovable marker colour. - * - * @internal */ MARKER_COLOUR = '#4286f4'; /** * Width of the horizontal cursor. - * - * @internal */ CURSOR_WS_WIDTH = 100; /** * Height of the horizontal cursor. - * - * @internal */ WS_CURSOR_HEIGHT = 5; /** * Padding around a stack. - * - * @internal */ CURSOR_STACK_PADDING = 10; /** * Padding around a block. - * - * @internal */ CURSOR_BLOCK_PADDING = 2; /** * Stroke of the cursor. - * - * @internal */ CURSOR_STROKE_WIDTH = 4; /** * Whether text input and colour fields fill up the entire source block. - * - * @internal */ FULL_BLOCK_FIELDS = false; /** * The main colour of insertion markers, in hex. The block is rendered a * transparent grey by changing the fill opacity in CSS. - * - * @internal */ INSERTION_MARKER_COLOUR = '#000000'; /** * The insertion marker opacity. - * - * @internal */ INSERTION_MARKER_OPACITY = 0.2; @@ -409,10 +377,9 @@ export class ConstantProvider { // TODO(b/109816955): remove '!', see go/strict-prop-init-fix. OUTSIDE_CORNERS!: OutsideCorners; // TODO(b/109816955): remove '!', see go/strict-prop-init-fix. - /** @internal */ + blockStyles!: {[key: string]: BlockStyle}; - /** @internal */ constructor() { /** * Offset from the top of the row for placing fields on inline input rows @@ -493,16 +460,12 @@ export class ConstantProvider { /** * A random identifier used to ensure a unique ID is used for each * filter/pattern for the case of multiple Blockly instances on a page. - * - * @internal */ this.randomIdentifier = String(Math.random()).substring(2); } /** * Initialize shape objects based on the constants set in the constructor. - * - * @internal */ init() { /** @@ -537,7 +500,6 @@ export class ConstantProvider { * Refresh constants properties that depend on the theme. * * @param theme The current workspace theme. - * @internal */ setTheme(theme: Theme) { /** The block styles map. */ @@ -615,7 +577,6 @@ export class ConstantProvider { * @param colour #RRGGBB colour string. * @returns An object containing the style and an autogenerated name for that * style. - * @internal */ getBlockStyleForColour(colour: string): {style: BlockStyle, name: string} { const name = 'auto_' + colour; @@ -700,8 +661,6 @@ export class ConstantProvider { /** * Dispose of this constants provider. * Delete all DOM elements that this provider created. - * - * @internal */ dispose() { if (this.embossFilter_) { @@ -719,9 +678,8 @@ export class ConstantProvider { /** * @returns An object containing sizing and path information about collapsed * block indicators. - * @internal */ - makeJaggedTeeth(): JaggedTeeth { + protected makeJaggedTeeth(): JaggedTeeth { const height = this.JAGGED_TEETH_HEIGHT; const width = this.JAGGED_TEETH_WIDTH; @@ -735,9 +693,8 @@ export class ConstantProvider { /** * @returns An object containing sizing and path information about start hats. - * @internal */ - makeStartHat(): StartHat { + protected makeStartHat(): StartHat { const height = this.START_HAT_HEIGHT; const width = this.START_HAT_WIDTH; @@ -752,9 +709,8 @@ export class ConstantProvider { /** * @returns An object containing sizing and path information about puzzle * tabs. - * @internal */ - makePuzzleTab(): PuzzleTab { + protected makePuzzleTab(): PuzzleTab { const width = this.TAB_WIDTH; const height = this.TAB_HEIGHT; @@ -809,9 +765,8 @@ export class ConstantProvider { /** * @returns An object containing sizing and path information about notches. - * @internal */ - makeNotch(): Notch { + protected makeNotch(): Notch { const width = this.NOTCH_WIDTH; const height = this.NOTCH_HEIGHT; const innerWidth = 3; @@ -846,9 +801,8 @@ export class ConstantProvider { /** * @returns An object containing sizing and path information about inside * corners. - * @internal */ - makeInsideCorners(): InsideCorners { + protected makeInsideCorners(): InsideCorners { const radius = this.CORNER_RADIUS; const innerTopLeftCorner = @@ -868,9 +822,8 @@ export class ConstantProvider { /** * @returns An object containing sizing and path information about outside * corners. - * @internal */ - makeOutsideCorners(): OutsideCorners { + protected makeOutsideCorners(): OutsideCorners { const radius = this.CORNER_RADIUS; /** SVG path for drawing the rounded top-left corner. */ const topLeft = svgPaths.moveBy(0, radius) + @@ -903,7 +856,6 @@ export class ConstantProvider { * * @param connection The connection to find a shape object for * @returns The shape object for the connection. - * @internal */ shapeFor(connection: RenderedConnection): Shape { switch (connection.type) { @@ -926,7 +878,6 @@ export class ConstantProvider { * @param selector The CSS selector to use. * @suppress {strictModuleDepCheck} Debug renderer only included in * playground. - * @internal */ createDom(svg: SVGElement, tagName: string, selector: string) { this.injectCSS_(tagName, selector); diff --git a/core/renderers/common/debug.ts b/core/renderers/common/debug.ts index 6d331cc10..fed30a2b5 100644 --- a/core/renderers/common/debug.ts +++ b/core/renderers/common/debug.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Block rendering debugging functionality. - * - * @namespace Blockly.blockRendering.debug - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.debug'); diff --git a/core/renderers/common/debugger.ts b/core/renderers/common/debugger.ts index 89689630f..0490c7bce 100644 --- a/core/renderers/common/debugger.ts +++ b/core/renderers/common/debugger.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Methods for rendering debug graphics. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.Debug'); @@ -62,16 +57,13 @@ export class Debug { /** * @param constants The renderer's constants. - * @internal */ constructor(private readonly constants: ConstantProvider) {} /** * Remove all elements the this object created on the last pass. - * - * @internal */ - clearElems() { + protected clearElems() { for (let i = 0; i < this.debugElements_.length; i++) { const elem = this.debugElements_[i]; dom.removeNode(elem); @@ -86,9 +78,8 @@ export class Debug { * @param row The row to render. * @param cursorY The y position of the top of the row. * @param isRtl Whether the block is rendered RTL. - * @internal */ - drawSpacerRow(row: Row, cursorY: number, isRtl: boolean) { + protected drawSpacerRow(row: Row, cursorY: number, isRtl: boolean) { if (!Debug.config.rowSpacers) { return; } @@ -120,9 +111,9 @@ export class Debug { * @param elem The spacer to render. * @param rowHeight The height of the container row. * @param isRtl Whether the block is rendered RTL. - * @internal */ - drawSpacerElem(elem: InRowSpacer, rowHeight: number, isRtl: boolean) { + protected drawSpacerElem( + elem: InRowSpacer, rowHeight: number, isRtl: boolean) { if (!Debug.config.elemSpacers) { return; } @@ -154,9 +145,8 @@ export class Debug { * * @param elem The element to render. * @param isRtl Whether the block is rendered RTL. - * @internal */ - drawRenderedElem(elem: Measurable, isRtl: boolean) { + protected drawRenderedElem(elem: Measurable, isRtl: boolean) { if (Debug.config.elems) { let xPos = elem.xPos; if (isRtl) { @@ -208,9 +198,8 @@ export class Debug { * @param conn The connection to circle. * @suppress {visibility} Suppress visibility of conn.offsetInBlock_ since * this is a debug module. - * @internal */ - drawConnection(conn: RenderedConnection) { + protected drawConnection(conn: RenderedConnection) { if (!Debug.config.connections) { return; } @@ -253,9 +242,8 @@ export class Debug { * @param row The non-empty row to render. * @param cursorY The y position of the top of the row. * @param isRtl Whether the block is rendered RTL. - * @internal */ - drawRenderedRow(row: Row, cursorY: number, isRtl: boolean) { + protected drawRenderedRow(row: Row, cursorY: number, isRtl: boolean) { if (!Debug.config.rows) { return; } @@ -299,9 +287,8 @@ export class Debug { * @param row The non-empty row to render. * @param cursorY The y position of the top of the row. * @param isRtl Whether the block is rendered RTL. - * @internal */ - drawRowWithElements(row: Row, cursorY: number, isRtl: boolean) { + protected drawRowWithElements(row: Row, cursorY: number, isRtl: boolean) { for (let i = 0; i < row.elements.length; i++) { const elem = row.elements[i]; if (!elem) { @@ -321,9 +308,8 @@ export class Debug { * Draw a debug rectangle around the entire block. * * @param info Rendering information about the block to debug. - * @internal */ - drawBoundingBox(info: RenderInfo) { + protected drawBoundingBox(info: RenderInfo) { if (!Debug.config.blockBounds) { return; } @@ -368,7 +354,6 @@ export class Debug { * * @param block The block to draw debug information for. * @param info Rendering information about the block to debug. - * @internal */ drawDebug(block: BlockSvg, info: RenderInfo) { this.clearElems(); @@ -415,9 +400,8 @@ export class Debug { * Show a debug filter to highlight that a block has been rendered. * * @param svgPath The block's SVG path. - * @internal */ - drawRender(svgPath: SVGElement) { + protected drawRender(svgPath: SVGElement) { if (!Debug.config.render) { return; } diff --git a/core/renderers/common/drawer.ts b/core/renderers/common/drawer.ts index c48397db1..fa81e7eb1 100644 --- a/core/renderers/common/drawer.ts +++ b/core/renderers/common/drawer.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Methods for graphically rendering a block as SVG. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.Drawer'); @@ -45,7 +40,6 @@ export class Drawer { * @param block The block to render. * @param info An object containing all information needed to render this * block. - * @internal */ constructor(block: BlockSvg, info: RenderInfo) { this.block_ = block; @@ -64,8 +58,6 @@ export class Drawer { * joined with spaces and set directly on the block. This guarantees that * the steps are separated by spaces for improved readability, but isn't * required. - * - * @internal */ draw() { this.hideHiddenIcons_(); diff --git a/core/renderers/common/i_path_object.ts b/core/renderers/common/i_path_object.ts index 661e61c6f..68608910e 100644 --- a/core/renderers/common/i_path_object.ts +++ b/core/renderers/common/i_path_object.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * The interface for an object that owns a block's rendering SVG - * elements. - * - * @namespace Blockly.blockRendering.IPathObject - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.IPathObject'); @@ -28,8 +22,6 @@ import {RenderedConnection} from '../../rendered_connection.js'; export interface IPathObject { /** * The primary path of the block. - * - * @internal */ svgPath: SVGElement; @@ -55,7 +47,6 @@ export interface IPathObject { * Set the path generated by the renderer onto the respective SVG element. * * @param pathString The path. - * @internal */ setPath(pathString: string): void; @@ -64,7 +55,6 @@ export interface IPathObject { * the paths belong to a shadow block. * * @param block The source block. - * @internal */ applyColour(block: BlockSvg): void; @@ -72,14 +62,11 @@ export interface IPathObject { * Update the style. * * @param blockStyle The block style to use. - * @internal */ setStyle(blockStyle: BlockStyle): void; /** * Flip the SVG paths in RTL. - * - * @internal */ flipRTL(): void; @@ -88,7 +75,6 @@ export interface IPathObject { * * @param cursorSvg The SVG root of the cursor to be added to the block SVG * group. - * @internal */ setCursorSvg(cursorSvg: SVGElement): void; @@ -97,7 +83,6 @@ export interface IPathObject { * * @param markerSvg The SVG root of the marker to be added to the block SVG * group. - * @internal */ setMarkerSvg(markerSvg: SVGElement): void; @@ -106,7 +91,6 @@ export interface IPathObject { * often used to visually mark blocks currently being executed. * * @param highlighted True if highlighted. - * @internal */ updateHighlighted(highlighted: boolean): void; @@ -114,7 +98,6 @@ export interface IPathObject { * Add or remove styling showing that a block is selected. * * @param enable True if selection is enabled, false otherwise. - * @internal */ updateSelected(enabled: boolean): void; @@ -123,7 +106,6 @@ export interface IPathObject { * * @param enable True if the block is being dragged over a delete area, false * otherwise. - * @internal */ updateDraggingDelete(enabled: boolean): void; @@ -131,7 +113,6 @@ export interface IPathObject { * Add or remove styling showing that a block is an insertion marker. * * @param enable True if the block is an insertion marker, false otherwise. - * @internal */ updateInsertionMarker(enabled: boolean): void; @@ -139,7 +120,6 @@ export interface IPathObject { * Add or remove styling showing that a block is movable. * * @param enable True if the block is movable, false otherwise. - * @internal */ updateMovable(enabled: boolean): void; @@ -149,7 +129,6 @@ export interface IPathObject { * Otherwise it will bump. * * @param enable True if styling should be added. - * @internal */ updateReplacementFade(enabled: boolean): void; @@ -159,7 +138,6 @@ export interface IPathObject { * * @param conn The connection on the input to highlight. * @param enable True if styling should be added. - * @internal */ updateShapeForInputHighlight(conn: RenderedConnection, enable: boolean): void; } diff --git a/core/renderers/common/info.ts b/core/renderers/common/info.ts index 16f2c726a..1a162a676 100644 --- a/core/renderers/common/info.ts +++ b/core/renderers/common/info.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Methods for graphically rendering a block as SVG. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.RenderInfo'); @@ -92,7 +87,6 @@ export class RenderInfo { /** * @param renderer The renderer in use. * @param block The block to measure. - * @internal */ constructor(renderer: Renderer, block: BlockSvg) { this.renderer_ = renderer; @@ -143,7 +137,6 @@ export class RenderInfo { * Get the block renderer in use. * * @returns The block renderer in use. - * @internal */ getRenderer(): Renderer { return this.renderer_; @@ -156,8 +149,6 @@ export class RenderInfo { * This measure pass does not propagate changes to the block (although fields * may choose to rerender when getSize() is called). However, calling it * repeatedly may be expensive. - * - * @internal */ measure() { this.createRows_(); @@ -225,10 +216,8 @@ export class RenderInfo { /** * Create all non-spacer elements that belong on the top row. - * - * @internal */ - populateTopRow_() { + protected populateTopRow_() { const hasPrevious = !!this.block_.previousConnection; const hasHat = (this.block_.hat ? this.block_.hat === 'cap' : this.constants_.ADD_START_HATS) && @@ -270,10 +259,8 @@ export class RenderInfo { /** * Create all non-spacer elements that belong on the bottom row. - * - * @internal */ - populateBottomRow_() { + protected populateBottomRow_() { this.bottomRow.hasNextConnection = !!this.block_.nextConnection; const followsStatement = this.block_.inputList.length && diff --git a/core/renderers/common/marker_svg.ts b/core/renderers/common/marker_svg.ts index 6df65adf8..503df4565 100644 --- a/core/renderers/common/marker_svg.ts +++ b/core/renderers/common/marker_svg.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Methods for graphically rendering a marker as SVG. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.MarkerSvg'); @@ -45,7 +40,8 @@ const MARKER_CLASS = 'blocklyMarker'; const HEIGHT_MULTIPLIER = 3 / 4; /** - * Class for a marker. + * Class for a marker, containing methods for graphically rendering a marker as + * SVG. */ export class MarkerSvg { /** @@ -121,7 +117,6 @@ export class MarkerSvg { * Create the DOM element for the marker. * * @returns The marker controls SVG group. - * @internal */ createDom(): SVGElement { const className = this.isCursor() ? CURSOR_CLASS : MARKER_CLASS; diff --git a/core/renderers/common/path_object.ts b/core/renderers/common/path_object.ts index 5d54d929f..a262fef99 100644 --- a/core/renderers/common/path_object.ts +++ b/core/renderers/common/path_object.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * An object that owns a block's rendering SVG elements. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.PathObject'); @@ -28,35 +23,27 @@ import type {IPathObject} from './i_path_object.js'; */ export class PathObject implements IPathObject { svgRoot: SVGElement; - /** @internal */ svgPath: SVGElement; /** * Holds the cursors svg element when the cursor is attached to the block. * This is null if there is no cursor on the block. - * - * @internal */ cursorSvg: SVGElement|null = null; /** * Holds the markers svg element when the marker is attached to the block. * This is null if there is no marker on the block. - * - * @internal */ markerSvg: SVGElement|null = null; - /** @internal */ constants: ConstantProvider; - /** @internal */ style: BlockStyle; /** * @param root The root SVG element. * @param style The style object to use for colouring. * @param constants The renderer's constants. - * @internal */ constructor( root: SVGElement, style: BlockStyle, constants: ConstantProvider) { @@ -73,7 +60,6 @@ export class PathObject implements IPathObject { * Set the path generated by the renderer onto the respective SVG element. * * @param pathString The path. - * @internal */ setPath(pathString: string) { this.svgPath.setAttribute('d', pathString); @@ -81,8 +67,6 @@ export class PathObject implements IPathObject { /** * Flip the SVG paths in RTL. - * - * @internal */ flipRTL() { // Mirror the block's path. @@ -94,7 +78,6 @@ export class PathObject implements IPathObject { * * @param cursorSvg The SVG root of the cursor to be added to the block SVG * group. - * @internal */ setCursorSvg(cursorSvg: SVGElement) { if (!cursorSvg) { @@ -111,7 +94,6 @@ export class PathObject implements IPathObject { * * @param markerSvg The SVG root of the marker to be added to the block SVG * group. - * @internal */ setMarkerSvg(markerSvg: SVGElement) { if (!markerSvg) { @@ -132,7 +114,6 @@ export class PathObject implements IPathObject { * the paths belong to a shadow block. * * @param block The source block. - * @internal */ applyColour(block: BlockSvg) { this.svgPath.setAttribute('stroke', this.style.colourTertiary); @@ -146,7 +127,6 @@ export class PathObject implements IPathObject { * Set the style. * * @param blockStyle The block style to use. - * @internal */ setStyle(blockStyle: BlockStyle) { this.style = blockStyle; @@ -175,7 +155,6 @@ export class PathObject implements IPathObject { * often used to visually mark blocks currently being executed. * * @param enable True if highlighted. - * @internal */ updateHighlighted(enable: boolean) { if (enable) { @@ -215,7 +194,6 @@ export class PathObject implements IPathObject { * Add or remove styling showing that a block is selected. * * @param enable True if selection is enabled, false otherwise. - * @internal */ updateSelected(enable: boolean) { this.setClass_('blocklySelected', enable); @@ -226,7 +204,6 @@ export class PathObject implements IPathObject { * * @param enable True if the block is being dragged over a delete area, false * otherwise. - * @internal */ updateDraggingDelete(enable: boolean) { this.setClass_('blocklyDraggingDelete', enable); @@ -236,7 +213,6 @@ export class PathObject implements IPathObject { * Add or remove styling showing that a block is an insertion marker. * * @param enable True if the block is an insertion marker, false otherwise. - * @internal */ updateInsertionMarker(enable: boolean) { this.setClass_('blocklyInsertionMarker', enable); @@ -246,7 +222,6 @@ export class PathObject implements IPathObject { * Add or remove styling showing that a block is movable. * * @param enable True if the block is movable, false otherwise. - * @internal */ updateMovable(enable: boolean) { this.setClass_('blocklyDraggable', enable); @@ -258,7 +233,6 @@ export class PathObject implements IPathObject { * Otherwise it will bump. * * @param enable True if styling should be added. - * @internal */ updateReplacementFade(enable: boolean) { this.setClass_('blocklyReplaceable', enable); @@ -270,7 +244,6 @@ export class PathObject implements IPathObject { * * @param _conn The connection on the input to highlight. * @param _enable True if styling should be added. - * @internal */ updateShapeForInputHighlight(_conn: Connection, _enable: boolean) { // NOOP diff --git a/core/renderers/common/renderer.ts b/core/renderers/common/renderer.ts index fa0314cca..3b99d23ba 100644 --- a/core/renderers/common/renderer.ts +++ b/core/renderers/common/renderer.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Base renderer. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.Renderer'); @@ -40,19 +35,15 @@ export class Renderer implements IRegistrable { /** The renderer's constant provider. */ protected constants_!: ConstantProvider; - /** @internal */ - name: string; + protected name: string; /** * Rendering constant overrides, passed in through options. - * - * @internal */ - overrides: object|null = null; + protected overrides: object|null = null; /** * @param name The renderer name. - * @internal */ constructor(name: string) { this.name = name; @@ -62,7 +53,6 @@ export class Renderer implements IRegistrable { * Gets the class name that identifies this renderer. * * @returns The CSS class name. - * @internal */ getClassName(): string { return this.name + '-renderer'; @@ -73,7 +63,6 @@ export class Renderer implements IRegistrable { * * @param theme The workspace theme object. * @param opt_rendererOverrides Rendering constant overrides. - * @internal */ init( theme: Theme, opt_rendererOverrides?: {[rendererConstant: string]: any}) { @@ -88,6 +77,8 @@ export class Renderer implements IRegistrable { /** * Create any DOM elements that this renderer needs. + * If you need to create additional DOM elements, override the + * {@link ConstantProvider#createDom} method instead. * * @param svg The root of the workspace's SVG. * @param theme The workspace theme object. @@ -104,7 +95,6 @@ export class Renderer implements IRegistrable { * * @param svg The root of the workspace's SVG. * @param theme The workspace theme object. - * @internal */ refreshDom(svg: SVGElement, theme: Theme) { const previousConstants = this.getConstants(); @@ -123,8 +113,6 @@ export class Renderer implements IRegistrable { /** * Dispose of this renderer. * Delete all DOM elements that this renderer and its constants created. - * - * @internal */ dispose() { if (this.constants_) { @@ -180,7 +168,6 @@ export class Renderer implements IRegistrable { * @param workspace The workspace the marker belongs to. * @param marker The marker. * @returns The object in charge of drawing the marker. - * @internal */ makeMarkerDrawer(workspace: WorkspaceSvg, marker: Marker): MarkerSvg { return new MarkerSvg(workspace, this.getConstants(), marker); @@ -192,7 +179,6 @@ export class Renderer implements IRegistrable { * @param root The root SVG element. * @param style The style object to use for colouring. * @returns The renderer path object. - * @internal */ makePathObject(root: SVGElement, style: BlockStyle): IPathObject { return new PathObject(root, style, (this.constants_)); @@ -203,7 +189,6 @@ export class Renderer implements IRegistrable { * called, the renderer has already been initialized. * * @returns The constant provider. - * @internal */ getConstants(): ConstantProvider { return this.constants_; @@ -214,7 +199,6 @@ export class Renderer implements IRegistrable { * * @param _conn The connection to determine whether or not to highlight. * @returns True if we should highlight the connection. - * @internal */ shouldHighlightConnection(_conn: Connection): boolean { return true; @@ -231,9 +215,8 @@ export class Renderer implements IRegistrable { * @param orphanBlock The orphan block that wants to find a home. * @param localType The type of the connection being dragged. * @returns Whether there is a home for the orphan or not. - * @internal */ - orphanCanConnectAtEnd( + protected orphanCanConnectAtEnd( topBlock: BlockSvg, orphanBlock: BlockSvg, localType: number): boolean { const orphanConnection = localType === ConnectionType.OUTPUT_VALUE ? orphanBlock.outputConnection : @@ -250,7 +233,6 @@ export class Renderer implements IRegistrable { * @param local The connection currently being dragged. * @param topBlock The block currently being dragged. * @returns The preview type to display. - * @internal */ getConnectionPreviewMethod( closest: RenderedConnection, local: RenderedConnection, diff --git a/core/renderers/geras/constants.ts b/core/renderers/geras/constants.ts index b7b9cacb7..c7d0c498a 100644 --- a/core/renderers/geras/constants.ts +++ b/core/renderers/geras/constants.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * An object that provides constants for rendering blocks in Geras - * mode. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.geras.ConstantProvider'); @@ -33,9 +27,6 @@ export class ConstantProvider extends BaseConstantProvider { MAX_BOTTOM_WIDTH = 30; override STATEMENT_BOTTOM_SPACER = -this.NOTCH_HEIGHT / 2; - /** - * @internal - */ constructor() { super(); } diff --git a/core/renderers/geras/drawer.ts b/core/renderers/geras/drawer.ts index f886888df..0ccff67bc 100644 --- a/core/renderers/geras/drawer.ts +++ b/core/renderers/geras/drawer.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Renderer that preserves the look and feel of Blockly pre-2019. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.geras.Drawer'); @@ -26,7 +21,8 @@ import type {PathObject} from './path_object.js'; /** - * An object that draws a block based on the given rendering information. + * An object that draws a block based on the given rendering information, + * customized for the geras renderer. */ export class Drawer extends BaseDrawer { highlighter_: Highlighter; @@ -37,7 +33,6 @@ export class Drawer extends BaseDrawer { * @param block The block to render. * @param info An object containing all information needed to render this * block. - * @internal */ constructor(block: BlockSvg, info: RenderInfo) { super(block, info); diff --git a/core/renderers/geras/geras.ts b/core/renderers/geras/geras.ts index 9fec7d134..6aa960a8c 100644 --- a/core/renderers/geras/geras.ts +++ b/core/renderers/geras/geras.ts @@ -6,11 +6,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Re-exports of Blockly.geras.* modules. - * - * @namespace Blockly.geras - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.geras'); diff --git a/core/renderers/geras/highlight_constants.ts b/core/renderers/geras/highlight_constants.ts index bc8d768c8..736e914ee 100644 --- a/core/renderers/geras/highlight_constants.ts +++ b/core/renderers/geras/highlight_constants.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Objects for rendering highlights on blocks. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.geras.HighlightConstantProvider'); @@ -86,7 +81,6 @@ export class HighlightConstantProvider { /** * @param constants The rendering constants provider. - * @internal */ constructor(constants: ConstantProvider) { /** The renderer's constant provider. */ @@ -94,16 +88,12 @@ export class HighlightConstantProvider { /** * The start point, which is offset in both X and Y, as an SVG path chunk. - * - * @internal */ this.START_POINT = svgPaths.moveBy(this.OFFSET, this.OFFSET); } /** * Initialize shape objects based on the constants set in the constructor. - * - * @internal */ init() { /** @@ -145,9 +135,8 @@ export class HighlightConstantProvider { /** * @returns An object containing sizing and path information about inside * corner highlights. - * @internal */ - makeInsideCorner(): InsideCorner { + protected makeInsideCorner(): InsideCorner { const radius = this.constantProvider.CORNER_RADIUS; const offset = this.OFFSET; @@ -189,9 +178,8 @@ export class HighlightConstantProvider { /** * @returns An object containing sizing and path information about outside * corner highlights. - * @internal */ - makeOutsideCorner(): OutsideCorner { + protected makeOutsideCorner(): OutsideCorner { const radius = this.constantProvider.CORNER_RADIUS; const offset = this.OFFSET; @@ -238,9 +226,8 @@ export class HighlightConstantProvider { /** * @returns An object containing sizing and path information about puzzle tab * highlights. - * @internal */ - makePuzzleTab(): PuzzleTab { + protected makePuzzleTab(): PuzzleTab { const width = this.constantProvider.TAB_WIDTH; const height = this.constantProvider.TAB_HEIGHT; @@ -288,9 +275,8 @@ export class HighlightConstantProvider { /** * @returns An object containing sizing and path information about notch * highlights. - * @internal */ - makeNotch(): Notch { + protected makeNotch(): Notch { // This is only for the previous connection. const pathLeft = svgPaths.lineOnAxis('h', this.OFFSET) + this.constantProvider.NOTCH.pathLeft; @@ -300,9 +286,8 @@ export class HighlightConstantProvider { /** * @returns An object containing sizing and path information about collapsed * block edge highlights. - * @internal */ - makeJaggedTeeth(): JaggedTeeth { + protected makeJaggedTeeth(): JaggedTeeth { const pathLeft = svgPaths.lineTo(5.1, 2.6) + svgPaths.moveBy(-10.2, 6.8) + svgPaths.lineTo(5.1, 2.6); return {pathLeft, height: 12, width: 10.2}; @@ -311,9 +296,8 @@ export class HighlightConstantProvider { /** * @returns An object containing sizing and path information about start * highlights. - * @internal */ - makeStartHat(): StartHat { + protected makeStartHat(): StartHat { const hatHeight = this.constantProvider.START_HAT.height; const pathRtl = svgPaths.moveBy(25, -8.7) + svgPaths.curve('c', [ svgPaths.point(29.7, -6.2), diff --git a/core/renderers/geras/highlighter.ts b/core/renderers/geras/highlighter.ts index 097456dfd..cb2c7e2c5 100644 --- a/core/renderers/geras/highlighter.ts +++ b/core/renderers/geras/highlighter.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Methods for adding highlights on block, for rendering in - * compatibility mode. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.geras.Highlighter'); @@ -55,7 +49,6 @@ export class Highlighter { /** * @param info An object containing all information needed to render this * block. - * @internal */ constructor(info: RenderInfo) { this.info_ = info; @@ -83,7 +76,6 @@ export class Highlighter { * Get the steps for the highlight path. * * @returns The steps for the highlight path. - * @internal */ getPath(): string { return this.steps_ + '\n' + this.inlineSteps_; @@ -93,7 +85,6 @@ export class Highlighter { * Add a highlight to the top corner of a block. * * @param row The top row of the block. - * @internal */ drawTopCorner(row: TopRow) { this.steps_ += svgPaths.moveBy(row.xPos, this.info_.startY); @@ -124,7 +115,6 @@ export class Highlighter { * Add a highlight on a jagged edge for a collapsed block. * * @param row The row to highlight. - * @internal */ drawJaggedEdge_(row: Row) { if (this.info_.RTL) { @@ -139,7 +129,6 @@ export class Highlighter { * Add a highlight on a value input. * * @param row The row the input belongs to. - * @internal */ drawValueInput(row: Row) { const input = row.getLastInput() as InlineInput; @@ -161,7 +150,6 @@ export class Highlighter { * Add a highlight on a statement input. * * @param row The row to highlight. - * @internal */ drawStatementInput(row: Row) { const input = row.getLastInput(); @@ -186,7 +174,6 @@ export class Highlighter { * Add a highlight on the right side of a row. * * @param row The row to highlight. - * @internal */ drawRightSideRow(row: Row) { const rightEdge = row.xPos + row.width - this.highlightOffset_; @@ -206,7 +193,6 @@ export class Highlighter { * Add a highlight to the bottom row. * * @param row The row to highlight. - * @internal */ drawBottomRow(row: BottomRow) { // Highlight the vertical edge of the bottom row on the input side. @@ -229,8 +215,6 @@ export class Highlighter { /** * Draw the highlight on the left side of the block. - * - * @internal */ drawLeft() { const outputConnection = this.info_.outputConnection; @@ -265,7 +249,6 @@ export class Highlighter { * Add a highlight to an inline input. * * @param input The input to highlight. - * @internal */ drawInlineInput(input: InlineInput) { const offset = this.highlightOffset_; diff --git a/core/renderers/geras/info.ts b/core/renderers/geras/info.ts index 9dcfcb1ef..78262cdb9 100644 --- a/core/renderers/geras/info.ts +++ b/core/renderers/geras/info.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Old (compatibility) renderer. - * Geras: spirit of old age. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.geras.RenderInfo'); @@ -34,7 +28,8 @@ import type {Renderer} from './renderer.js'; /** - * An object containing all sizing information needed to draw this block. + * An object containing all sizing information needed to draw this block, + * customized for the geras renderer. * * This measure pass does not propagate changes to the block (although fields * may choose to rerender when getSize() is called). However, calling it @@ -49,7 +44,6 @@ export class RenderInfo extends BaseRenderInfo { /** * @param renderer The renderer in use. * @param block The block to measure. - * @internal */ constructor(renderer: Renderer, block: BlockSvg) { super(renderer, block); @@ -60,7 +54,6 @@ export class RenderInfo extends BaseRenderInfo { * Get the block renderer in use. * * @returns The block renderer in use. - * @internal */ override getRenderer(): Renderer { return this.renderer_; diff --git a/core/renderers/geras/measurables/inline_input.ts b/core/renderers/geras/measurables/inline_input.ts index 016f1fbd4..b361528f0 100644 --- a/core/renderers/geras/measurables/inline_input.ts +++ b/core/renderers/geras/measurables/inline_input.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Objects representing inline inputs with connections on a - * rendered block. - * - * @class - */ import * as goog from '../../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.geras.InlineInput'); @@ -30,7 +24,6 @@ export class InlineInput extends BaseInlineInput { /** * @param constants The rendering constants provider. * @param input The inline input to measure and store information for. - * @internal */ constructor(constants: BaseConstantProvider, input: Input) { super(constants, input); diff --git a/core/renderers/geras/measurables/statement_input.ts b/core/renderers/geras/measurables/statement_input.ts index 58e35ac5f..3720fce01 100644 --- a/core/renderers/geras/measurables/statement_input.ts +++ b/core/renderers/geras/measurables/statement_input.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Objects representing statement inputs with connections on a - * rendered block. - * - * @class - */ import * as goog from '../../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.geras.StatementInput'); @@ -30,7 +24,6 @@ export class StatementInput extends BaseStatementInput { /** * @param constants The rendering constants provider. * @param input The statement input to measure and store information for. - * @internal */ constructor(constants: BaseConstantProvider, input: Input) { super(constants, input); diff --git a/core/renderers/geras/path_object.ts b/core/renderers/geras/path_object.ts index fc11f5a6c..dcdcb6673 100644 --- a/core/renderers/geras/path_object.ts +++ b/core/renderers/geras/path_object.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * An object that owns a block's rendering SVG elements. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.geras.PathObject'); @@ -27,15 +22,11 @@ import type {ConstantProvider} from './constants.js'; * used by the renderer. */ export class PathObject extends BasePathObject { - /** @internal */ svgPathDark: SVGElement; - /** @internal */ svgPathLight: SVGElement; /** * The colour of the dark path on the block in '#RRGGBB' format. - * - * @internal */ colourDark = '#000000'; @@ -43,7 +34,6 @@ export class PathObject extends BasePathObject { * @param root The root SVG element. * @param style The style object to use for colouring. * @param constants The renderer's constants. - * @internal */ constructor( root: SVGElement, style: BlockStyle, @@ -72,7 +62,6 @@ export class PathObject extends BasePathObject { * Set the highlight path generated by the renderer onto the SVG element. * * @param highlightPath The highlight path. - * @internal */ setHighlightPath(highlightPath: string) { this.svgPathLight.setAttribute('d', highlightPath); diff --git a/core/renderers/geras/renderer.ts b/core/renderers/geras/renderer.ts index 7f0c50ed8..54b36cfc1 100644 --- a/core/renderers/geras/renderer.ts +++ b/core/renderers/geras/renderer.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Geras renderer. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.geras.Renderer'); @@ -26,7 +21,12 @@ import {PathObject} from './path_object.js'; /** - * The geras renderer. + * The geras renderer. This renderer was designed to be backwards compatible + * with pre-2019 Blockly. Newer projects that are not constrained by backwards + * compatibility should use thrasos, which is a more modern take on this + * renderer. + * + * Geras is the ancient Greek spirit of old age. */ export class Renderer extends BaseRenderer { /** The renderer's highlight constant provider. */ @@ -34,7 +34,6 @@ export class Renderer extends BaseRenderer { /** * @param name The renderer name. - * @internal */ constructor(name: string) { super(name); @@ -43,8 +42,6 @@ export class Renderer extends BaseRenderer { /** * Initialize the renderer. Geras has a highlight provider in addition to * the normal constant provider. - * - * @internal */ override init( theme: Theme, opt_rendererOverrides?: {[rendererConstant: string]: any}) { @@ -91,7 +88,6 @@ export class Renderer extends BaseRenderer { * @param root The root SVG element. * @param style The style object to use for colouring. * @returns The renderer path object. - * @internal */ override makePathObject(root: SVGElement, style: BlockStyle): PathObject { return new PathObject( @@ -112,7 +108,6 @@ export class Renderer extends BaseRenderer { * is called, the renderer has already been initialized. * * @returns The highlight constant provider. - * @internal */ getHighlightConstants(): HighlightConstantProvider { if (!this.highlightConstants_) { diff --git a/core/renderers/measurables/base.ts b/core/renderers/measurables/base.ts index 48ab5b3b0..98a9510c8 100644 --- a/core/renderers/measurables/base.ts +++ b/core/renderers/measurables/base.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Methods for graphically rendering a block as SVG. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.Measurable'); @@ -37,7 +32,6 @@ export class Measurable { /** * @param constants The rendering constants provider. - * @internal */ constructor(constants: ConstantProvider) { this.constants_ = constants; diff --git a/core/renderers/measurables/bottom_row.ts b/core/renderers/measurables/bottom_row.ts index 73602c5af..36418afad 100644 --- a/core/renderers/measurables/bottom_row.ts +++ b/core/renderers/measurables/bottom_row.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Object representing a bottom row on a rendered block. - * of its subcomponents. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.BottomRow'); @@ -30,15 +24,11 @@ import {Types} from './types.js'; export class BottomRow extends Row { /** * Whether this row has a next connection. - * - * @internal */ hasNextConnection = false; /** * The next connection on the row, if any. - * - * @internal */ connection: NextConnection|null = null; @@ -46,8 +36,6 @@ export class BottomRow extends Row { * The amount that the bottom of the block extends below the horizontal * edge, e.g. because of a next connection. Must be non-negative (see * #2820). - * - * @internal */ descenderHeight = 0; @@ -59,7 +47,6 @@ export class BottomRow extends Row { /** * @param constants The rendering constants provider. - * @internal */ constructor(constants: ConstantProvider) { super(constants); diff --git a/core/renderers/measurables/connection.ts b/core/renderers/measurables/connection.ts index 3f6080c5f..d69374a90 100644 --- a/core/renderers/measurables/connection.ts +++ b/core/renderers/measurables/connection.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Base class representing the space a connection takes up during - * rendering. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.Connection'); @@ -33,7 +27,6 @@ export class Connection extends Measurable { * @param constants The rendering constants provider. * @param connectionModel The connection object on the block that this * represents. - * @internal */ constructor( constants: ConstantProvider, public connectionModel: RenderedConnection) { diff --git a/core/renderers/measurables/external_value_input.ts b/core/renderers/measurables/external_value_input.ts index 7e4e57731..bcb0aea4d 100644 --- a/core/renderers/measurables/external_value_input.ts +++ b/core/renderers/measurables/external_value_input.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Class representing external value inputs with connections on a - * rendered block. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.ExternalValueInput'); @@ -35,7 +29,6 @@ export class ExternalValueInput extends InputConnection { /** * @param constants The rendering constants provider. * @param input The external value input to measure and store information for. - * @internal */ constructor(constants: ConstantProvider, input: Input) { super(constants, input); diff --git a/core/renderers/measurables/field.ts b/core/renderers/measurables/field.ts index 140011ae4..46c043d69 100644 --- a/core/renderers/measurables/field.ts +++ b/core/renderers/measurables/field.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Objects representing a field in a row of a rendered - * block. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.Field'); @@ -36,7 +30,6 @@ export class Field extends Measurable { * @param constants The rendering constants provider. * @param field The field to measure and store information for. * @param parentInput The parent input for the field. - * @internal */ constructor( constants: ConstantProvider, public field: BlocklyField, diff --git a/core/renderers/measurables/hat.ts b/core/renderers/measurables/hat.ts index 52eec943f..c35f8947b 100644 --- a/core/renderers/measurables/hat.ts +++ b/core/renderers/measurables/hat.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Objects representing a hat in a row of a rendered - * block. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.Hat'); @@ -28,7 +22,6 @@ export class Hat extends Measurable { /** * @param constants The rendering constants provider. - * @internal */ constructor(constants: ConstantProvider) { super(constants); diff --git a/core/renderers/measurables/icon.ts b/core/renderers/measurables/icon.ts index 1259eaafd..afba526ed 100644 --- a/core/renderers/measurables/icon.ts +++ b/core/renderers/measurables/icon.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Objects representing an icon in a row of a rendered - * block. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.Icon'); @@ -23,7 +17,7 @@ import {Types} from './types.js'; /** * An object containing information about the space an icon takes up during - * rendering + * rendering. */ export class Icon extends Measurable { isVisible: boolean; @@ -31,11 +25,10 @@ export class Icon extends Measurable { /** * An object containing information about the space an icon takes up during - * rendering + * rendering. * * @param constants The rendering constants provider. * @param icon The icon to measure and store information for. - * @internal */ constructor(constants: ConstantProvider, public icon: BlocklyIcon) { super(constants); diff --git a/core/renderers/measurables/in_row_spacer.ts b/core/renderers/measurables/in_row_spacer.ts index a28618b10..589b14608 100644 --- a/core/renderers/measurables/in_row_spacer.ts +++ b/core/renderers/measurables/in_row_spacer.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Objects representing a spacer in a row of a rendered - * block. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.InRowSpacer'); @@ -27,7 +21,6 @@ export class InRowSpacer extends Measurable { /** * @param constants The rendering constants provider. * @param width The width of the spacer. - * @internal */ constructor(constants: ConstantProvider, width: number) { super(constants); diff --git a/core/renderers/measurables/inline_input.ts b/core/renderers/measurables/inline_input.ts index 564d33227..5b04370fc 100644 --- a/core/renderers/measurables/inline_input.ts +++ b/core/renderers/measurables/inline_input.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Class representing inline inputs with connections on a rendered - * block. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.InlineInput'); @@ -23,7 +17,7 @@ import {Types} from './types.js'; /** * An object containing information about the space an inline input takes up - * during rendering + * during rendering. */ export class InlineInput extends InputConnection { connectionHeight: number; @@ -32,7 +26,6 @@ export class InlineInput extends InputConnection { /** * @param constants The rendering constants provider. * @param input The inline input to measure and store information for. - * @internal */ constructor(constants: ConstantProvider, input: Input) { super(constants, input); diff --git a/core/renderers/measurables/input_connection.ts b/core/renderers/measurables/input_connection.ts index 4716dfde9..64d0769be 100644 --- a/core/renderers/measurables/input_connection.ts +++ b/core/renderers/measurables/input_connection.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Class representing inputs with connections on a rendered block. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.InputConnection'); @@ -23,7 +18,7 @@ import {Types} from './types.js'; /** * The base class to represent an input that takes up space on a block - * during rendering + * during rendering. */ export class InputConnection extends Connection { align: number; @@ -36,7 +31,6 @@ export class InputConnection extends Connection { /** * @param constants The rendering constants provider. * @param input The input to measure and store information for. - * @internal */ constructor(constants: ConstantProvider, public input: Input) { super(constants, input.connection as RenderedConnection); diff --git a/core/renderers/measurables/input_row.ts b/core/renderers/measurables/input_row.ts index d43e29be0..65bf43480 100644 --- a/core/renderers/measurables/input_row.ts +++ b/core/renderers/measurables/input_row.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Object representing a row that holds one or more inputs on a - * rendered block. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.InputRow'); @@ -28,14 +22,11 @@ import {Types} from './types.js'; export class InputRow extends Row { /** * The total width of all blocks connected to this row. - * - * @internal */ connectedBlockWidths = 0; /** * @param constants The rendering constants provider. - * @internal */ constructor(constants: ConstantProvider) { super(constants); @@ -44,8 +35,6 @@ export class InputRow extends Row { /** * Inspect all subcomponents and populate all size properties on the row. - * - * @internal */ override measure() { this.width = this.minWidth; diff --git a/core/renderers/measurables/jagged_edge.ts b/core/renderers/measurables/jagged_edge.ts index c65c24081..72ef7fb60 100644 --- a/core/renderers/measurables/jagged_edge.ts +++ b/core/renderers/measurables/jagged_edge.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Objects representing a jagged edge in a row of a rendered - * block. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.JaggedEdge'); @@ -20,13 +14,12 @@ import {Types} from './types.js'; /** - * An object containing information about the jagged edge of a collapsed block - * takes up during rendering + * An object containing information about the space the jagged edge of a + * collapsed block takes up during rendering. */ export class JaggedEdge extends Measurable { /** * @param constants The rendering constants provider. - * @internal */ constructor(constants: ConstantProvider) { super(constants); diff --git a/core/renderers/measurables/next_connection.ts b/core/renderers/measurables/next_connection.ts index 7ef5212e7..997e4c0f9 100644 --- a/core/renderers/measurables/next_connection.ts +++ b/core/renderers/measurables/next_connection.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Class representing the space a next connection takes up during - * rendering. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.NextConnection'); @@ -29,7 +23,6 @@ export class NextConnection extends Connection { * @param constants The rendering constants provider. * @param connectionModel The connection object on the block that this * represents. - * @internal */ constructor( constants: ConstantProvider, connectionModel: RenderedConnection) { diff --git a/core/renderers/measurables/output_connection.ts b/core/renderers/measurables/output_connection.ts index c2d407a96..7d493b002 100644 --- a/core/renderers/measurables/output_connection.ts +++ b/core/renderers/measurables/output_connection.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Class representing the space a output connection takes up - * during rendering. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.OutputConnection'); @@ -33,7 +27,6 @@ export class OutputConnection extends Connection { * @param constants The rendering constants provider. * @param connectionModel The connection object on the block that this * represents. - * @internal */ constructor( constants: ConstantProvider, connectionModel: RenderedConnection) { diff --git a/core/renderers/measurables/previous_connection.ts b/core/renderers/measurables/previous_connection.ts index 6d95b02e1..b2b2444a5 100644 --- a/core/renderers/measurables/previous_connection.ts +++ b/core/renderers/measurables/previous_connection.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Class representing the space a previous connection takes up - * during rendering. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.PreviousConnection'); @@ -29,7 +23,6 @@ export class PreviousConnection extends Connection { * @param constants The rendering constants provider. * @param connectionModel The connection object on the block that this * represents. - * @internal */ constructor( constants: ConstantProvider, connectionModel: RenderedConnection) { diff --git a/core/renderers/measurables/round_corner.ts b/core/renderers/measurables/round_corner.ts index 7746b7998..ad7ebab02 100644 --- a/core/renderers/measurables/round_corner.ts +++ b/core/renderers/measurables/round_corner.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Objects representing a round corner in a row of a rendered - * block. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.RoundCorner'); @@ -27,7 +21,6 @@ export class RoundCorner extends Measurable { /** * @param constants The rendering constants provider. * @param opt_position The position of this corner. - * @internal */ constructor(constants: ConstantProvider, opt_position?: string) { super(constants); diff --git a/core/renderers/measurables/row.ts b/core/renderers/measurables/row.ts index 2063e74d9..77e9472f0 100644 --- a/core/renderers/measurables/row.ts +++ b/core/renderers/measurables/row.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Object representing a single row on a rendered block. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.Row'); @@ -25,81 +20,60 @@ import {Types} from './types.js'; * subcomponents. */ export class Row { - /** @internal */ type: number; /** * An array of elements contained in this row. - * - * @internal */ elements: Measurable[] = []; /** * The height of the row. - * - * @internal */ height = 0; /** * The width of the row, from the left edge of the block to the right. * Does not include child blocks unless they are inline. - * - * @internal */ width = 0; /** * The minimum height of the row. - * - * @internal */ minHeight = 0; /** * The minimum width of the row, from the left edge of the block to the * right. Does not include child blocks unless they are inline. - * - * @internal */ minWidth = 0; /** * The width of the row, from the left edge of the block to the edge of the * block or any connected child blocks. - * - * @internal */ widthWithConnectedBlocks = 0; /** * The Y position of the row relative to the origin of the block's svg * group. - * - * @internal */ yPos = 0; /** * The X position of the row relative to the origin of the block's svg * group. - * - * @internal */ xPos = 0; /** * Whether the row has any external inputs. - * - * @internal */ hasExternalInput = false; /** * Whether the row has any statement inputs. - * - * @internal */ hasStatement = false; @@ -112,30 +86,22 @@ export class Row { /** * Whether the row has any inline inputs. - * - * @internal */ hasInlineInput = false; /** * Whether the row has any dummy inputs. - * - * @internal */ hasDummyInput = false; /** * Whether the row has a jagged edge. - * - * @internal */ hasJaggedEdge = false; notchOffset: number; /** * Alignment of the row. - * - * @internal */ align: number|null = null; @@ -143,7 +109,6 @@ export class Row { /** * @param constants The rendering constants provider. - * @internal */ constructor(constants: ConstantProvider) { /** The renderer's constant provider. */ @@ -159,7 +124,6 @@ export class Row { * Get the last input on this row, if it has one. * * @returns The last input on the row, or null. - * @internal */ getLastInput(): InputConnection|null { // TODO: Consider moving this to InputRow, if possible. @@ -174,8 +138,6 @@ export class Row { /** * Inspect all subcomponents and populate all size properties on the row. - * - * @internal */ measure() { throw Error('Unexpected attempt to measure a base Row.'); @@ -185,7 +147,6 @@ export class Row { * Determines whether this row should start with an element spacer. * * @returns Whether the row should start with a spacer. - * @internal */ startsWithElemSpacer(): boolean { return true; @@ -195,7 +156,6 @@ export class Row { * Determines whether this row should end with an element spacer. * * @returns Whether the row should end with a spacer. - * @internal */ endsWithElemSpacer(): boolean { return true; @@ -205,7 +165,6 @@ export class Row { * Convenience method to get the first spacer element on this row. * * @returns The first spacer element on this row. - * @internal */ getFirstSpacer(): InRowSpacer|null { for (let i = 0; i < this.elements.length; i++) { @@ -221,7 +180,6 @@ export class Row { * Convenience method to get the last spacer element on this row. * * @returns The last spacer element on this row. - * @internal */ getLastSpacer(): InRowSpacer|null { for (let i = this.elements.length - 1; i >= 0; i--) { diff --git a/core/renderers/measurables/spacer_row.ts b/core/renderers/measurables/spacer_row.ts index 1e1fdcfd3..47970ea00 100644 --- a/core/renderers/measurables/spacer_row.ts +++ b/core/renderers/measurables/spacer_row.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Object representing a spacer between two rows. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.SpacerRow'); @@ -34,7 +29,6 @@ export class SpacerRow extends Row { * @param constants The rendering constants provider. * @param height The height of the spacer. * @param width The width of the spacer. - * @internal */ constructor( constants: ConstantProvider, public override height: number, diff --git a/core/renderers/measurables/square_corner.ts b/core/renderers/measurables/square_corner.ts index 9e3e4b226..d30b36fa0 100644 --- a/core/renderers/measurables/square_corner.ts +++ b/core/renderers/measurables/square_corner.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Objects representing a square corner in a row of a rendered - * block. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.SquareCorner'); @@ -27,7 +21,6 @@ export class SquareCorner extends Measurable { /** * @param constants The rendering constants provider. * @param opt_position The position of this corner. - * @internal */ constructor(constants: ConstantProvider, opt_position?: string) { super(constants); diff --git a/core/renderers/measurables/statement_input.ts b/core/renderers/measurables/statement_input.ts index f7f0ce137..ac5a0bfb2 100644 --- a/core/renderers/measurables/statement_input.ts +++ b/core/renderers/measurables/statement_input.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Class representing statement inputs with connections on a - * rendered block. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.StatementInput'); @@ -29,7 +23,6 @@ export class StatementInput extends InputConnection { /** * @param constants The rendering constants provider. * @param input The statement input to measure and store information for. - * @internal */ constructor(constants: ConstantProvider, input: Input) { super(constants, input); diff --git a/core/renderers/measurables/top_row.ts b/core/renderers/measurables/top_row.ts index 1ba9301b5..d8ebf9b9f 100644 --- a/core/renderers/measurables/top_row.ts +++ b/core/renderers/measurables/top_row.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Object representing a top row on a rendered block. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.TopRow'); @@ -34,8 +29,6 @@ export class TopRow extends Row { * The starting point for drawing the row, in the y direction. * This allows us to draw hats and similar shapes that don't start at the * origin. Must be non-negative (see #2820). - * - * @internal */ capline = 0; @@ -50,7 +43,6 @@ export class TopRow extends Row { /** * @param constants The rendering constants provider. - * @internal */ constructor(constants: ConstantProvider) { super(constants); @@ -63,7 +55,6 @@ export class TopRow extends Row { * * @param block The block whose top row this represents. * @returns Whether or not the top row has a left square corner. - * @internal */ hasLeftSquareCorner(block: BlockSvg): boolean { const hasHat = diff --git a/core/renderers/measurables/types.ts b/core/renderers/measurables/types.ts index 1667148e5..da3bcbeff 100644 --- a/core/renderers/measurables/types.ts +++ b/core/renderers/measurables/types.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Measurable types. - * - * @namespace Blockly.blockRendering.Types - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.blockRendering.Types'); @@ -50,15 +45,11 @@ class TypesContainer { /** * A Left Corner Union Type. - * - * @internal */ LEFT_CORNER = this.LEFT_SQUARE_CORNER | this.LEFT_ROUND_CORNER; /** * A Right Corner Union Type. - * - * @internal */ RIGHT_CORNER = this.RIGHT_SQUARE_CORNER | this.RIGHT_ROUND_CORNER; @@ -75,7 +66,6 @@ class TypesContainer { * * @param type The name of the type. * @returns The enum flag value associated with that type. - * @internal */ getType(type: string): number { if (!Object.prototype.hasOwnProperty.call(this, type)) { @@ -90,7 +80,6 @@ class TypesContainer { * * @param elem The element to check. * @returns 1 if the object stores information about a field. - * @internal */ isField(elem: Measurable): number { return elem.type & this.FIELD; @@ -101,7 +90,6 @@ class TypesContainer { * * @param elem The element to check. * @returns 1 if the object stores information about a hat. - * @internal */ isHat(elem: Measurable): number { return elem.type & this.HAT; @@ -112,7 +100,6 @@ class TypesContainer { * * @param elem The element to check. * @returns 1 if the object stores information about an icon. - * @internal */ isIcon(elem: Measurable): number { return elem.type & this.ICON; @@ -123,7 +110,6 @@ class TypesContainer { * * @param elem The element to check. * @returns 1 if the object stores information about a spacer. - * @internal */ isSpacer(elem: Measurable|Row): number { return elem.type & this.SPACER; @@ -134,7 +120,6 @@ class TypesContainer { * * @param elem The element to check. * @returns 1 if the object stores information about an in-row spacer. - * @internal */ isInRowSpacer(elem: Measurable): number { return elem.type & this.IN_ROW_SPACER; @@ -145,7 +130,6 @@ class TypesContainer { * * @param elem The element to check. * @returns 1 if the object stores information about an input. - * @internal */ isInput(elem: Measurable): number { return elem.type & this.INPUT; @@ -156,7 +140,6 @@ class TypesContainer { * * @param elem The element to check. * @returns 1 if the object stores information about an external input. - * @internal */ isExternalInput(elem: Measurable): number { return elem.type & this.EXTERNAL_VALUE_INPUT; @@ -167,7 +150,6 @@ class TypesContainer { * * @param elem The element to check. * @returns 1 if the object stores information about an inline input. - * @internal */ isInlineInput(elem: Measurable): number { return elem.type & this.INLINE_INPUT; @@ -178,7 +160,6 @@ class TypesContainer { * * @param elem The element to check. * @returns 1 if the object stores information about a statement input. - * @internal */ isStatementInput(elem: Measurable): number { return elem.type & this.STATEMENT_INPUT; @@ -189,7 +170,6 @@ class TypesContainer { * * @param elem The element to check. * @returns 1 if the object stores information about a previous connection. - * @internal */ isPreviousConnection(elem: Measurable): number { return elem.type & this.PREVIOUS_CONNECTION; @@ -200,7 +180,6 @@ class TypesContainer { * * @param elem The element to check. * @returns 1 if the object stores information about a next connection. - * @internal */ isNextConnection(elem: Measurable): number { return elem.type & this.NEXT_CONNECTION; @@ -213,7 +192,6 @@ class TypesContainer { * @param elem The element to check. * @returns 1 if the object stores information about a previous or next * connection. - * @internal */ isPreviousOrNextConnection(elem: Measurable): number { return elem.type & (this.PREVIOUS_CONNECTION | this.NEXT_CONNECTION); @@ -224,7 +202,6 @@ class TypesContainer { * * @param elem The element to check. * @returns 1 if the object stores information about a left round corner. - * @internal */ isLeftRoundedCorner(elem: Measurable): number { return elem.type & this.LEFT_ROUND_CORNER; @@ -235,7 +212,6 @@ class TypesContainer { * * @param elem The element to check. * @returns 1 if the object stores information about a right round corner. - * @internal */ isRightRoundedCorner(elem: Measurable): number { return elem.type & this.RIGHT_ROUND_CORNER; @@ -246,7 +222,6 @@ class TypesContainer { * * @param elem The element to check. * @returns 1 if the object stores information about a left square corner. - * @internal */ isLeftSquareCorner(elem: Measurable): number { return elem.type & this.LEFT_SQUARE_CORNER; @@ -257,7 +232,6 @@ class TypesContainer { * * @param elem The element to check. * @returns 1 if the object stores information about a right square corner. - * @internal */ isRightSquareCorner(elem: Measurable): number { return elem.type & this.RIGHT_SQUARE_CORNER; @@ -268,7 +242,6 @@ class TypesContainer { * * @param elem The element to check. * @returns 1 if the object stores information about a corner. - * @internal */ isCorner(elem: Measurable): number { return elem.type & this.CORNER; @@ -279,7 +252,6 @@ class TypesContainer { * * @param elem The element to check. * @returns 1 if the object stores information about a jagged edge. - * @internal */ isJaggedEdge(elem: Measurable): number { return elem.type & this.JAGGED_EDGE; @@ -290,7 +262,6 @@ class TypesContainer { * * @param row The row to check. * @returns 1 if the object stores information about a row. - * @internal */ isRow(row: Row): number { return row.type & this.ROW; @@ -301,7 +272,6 @@ class TypesContainer { * * @param row The row to check. * @returns 1 if the object stores information about a between-row spacer. - * @internal */ isBetweenRowSpacer(row: Row): number { return row.type & this.BETWEEN_ROW_SPACER; @@ -312,7 +282,6 @@ class TypesContainer { * * @param row The row to check. * @returns 1 if the object stores information about a top row. - * @internal */ isTopRow(row: Row): number { return row.type & this.TOP_ROW; @@ -323,7 +292,6 @@ class TypesContainer { * * @param row The row to check. * @returns 1 if the object stores information about a bottom row. - * @internal */ isBottomRow(row: Row): number { return row.type & this.BOTTOM_ROW; @@ -334,7 +302,6 @@ class TypesContainer { * * @param row The row to check. * @returns 1 if the object stores information about a top or bottom row. - * @internal */ isTopOrBottomRow(row: Row): number { return row.type & (this.TOP_ROW | this.BOTTOM_ROW); @@ -345,7 +312,6 @@ class TypesContainer { * * @param row The row to check. * @returns 1 if the object stores information about an input row. - * @internal */ isInputRow(row: Row): number { return row.type & this.INPUT_ROW; diff --git a/core/renderers/minimalist/constants.ts b/core/renderers/minimalist/constants.ts index 10b5251b2..9ca86e839 100644 --- a/core/renderers/minimalist/constants.ts +++ b/core/renderers/minimalist/constants.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * An object that provides constants for rendering blocks in the - * minimalist renderer. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.minimalist.ConstantProvider'); @@ -17,10 +11,10 @@ import {ConstantProvider as BaseConstantProvider} from '../common/constants.js'; /** - * An object that provides constants for rendering blocks in the sample. + * An object that provides constants for rendering blocks in the minimalist + * renderer. */ export class ConstantProvider extends BaseConstantProvider { - /** @internal */ constructor() { super(); } diff --git a/core/renderers/minimalist/drawer.ts b/core/renderers/minimalist/drawer.ts index 0b45cc4da..a6325d351 100644 --- a/core/renderers/minimalist/drawer.ts +++ b/core/renderers/minimalist/drawer.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Minimalist rendering drawer. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.minimalist.Drawer'); @@ -26,7 +21,6 @@ export class Drawer extends BaseDrawer { * @param block The block to render. * @param info An object containing all information needed to render this * block. - * @internal */ constructor(block: BlockSvg, info: RenderInfo) { super(block, info); diff --git a/core/renderers/minimalist/info.ts b/core/renderers/minimalist/info.ts index 1af3d4e9a..887820dfe 100644 --- a/core/renderers/minimalist/info.ts +++ b/core/renderers/minimalist/info.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Minimalist render info object. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.minimalist.RenderInfo'); @@ -32,7 +27,6 @@ export class RenderInfo extends BaseRenderInfo { /** * @param renderer The renderer in use. * @param block The block to measure. - * @internal */ constructor(renderer: Renderer, block: BlockSvg) { super(renderer, block); @@ -42,7 +36,6 @@ export class RenderInfo extends BaseRenderInfo { * Get the block renderer in use. * * @returns The block renderer in use. - * @internal */ override getRenderer(): Renderer { return this.renderer_; diff --git a/core/renderers/minimalist/minimalist.ts b/core/renderers/minimalist/minimalist.ts index 433104b3d..807fe2a86 100644 --- a/core/renderers/minimalist/minimalist.ts +++ b/core/renderers/minimalist/minimalist.ts @@ -6,11 +6,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Re-exports of Blockly.minimalist.* modules. - * - * @namespace Blockly.minimalist - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.minimalist'); diff --git a/core/renderers/minimalist/renderer.ts b/core/renderers/minimalist/renderer.ts index 0696f8e14..86f1c78d4 100644 --- a/core/renderers/minimalist/renderer.ts +++ b/core/renderers/minimalist/renderer.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Minimalist renderer. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.minimalist.Renderer'); @@ -28,7 +23,6 @@ import {RenderInfo} from './info.js'; export class Renderer extends BaseRenderer { /** * @param name The renderer name. - * @internal */ constructor(name: string) { super(name); diff --git a/core/renderers/thrasos/info.ts b/core/renderers/thrasos/info.ts index c7e62b612..26f899c4c 100644 --- a/core/renderers/thrasos/info.ts +++ b/core/renderers/thrasos/info.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * New (evolving) renderer. - * Thrasos: spirit of boldness. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.thrasos.RenderInfo'); @@ -40,7 +34,6 @@ export class RenderInfo extends BaseRenderInfo { /** * @param renderer The renderer in use. * @param block The block to measure. - * @internal */ constructor(renderer: Renderer, block: BlockSvg) { super(renderer, block); @@ -50,7 +43,6 @@ export class RenderInfo extends BaseRenderInfo { * Get the block renderer in use. * * @returns The block renderer in use. - * @internal */ override getRenderer(): Renderer { return this.renderer_; diff --git a/core/renderers/thrasos/renderer.ts b/core/renderers/thrasos/renderer.ts index 2789a0ba2..65be1d206 100644 --- a/core/renderers/thrasos/renderer.ts +++ b/core/renderers/thrasos/renderer.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Thrasos renderer. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.thrasos.Renderer'); @@ -20,12 +15,14 @@ import {RenderInfo} from './info.js'; /** - * The thrasos renderer. + * The thrasos renderer. This is a more modern take on the legacy geras + * renderer. + * + * Thrasos is the ancient Greek spirit of boldness. */ export class Renderer extends BaseRenderer { /** * @param name The renderer name. - * @internal */ constructor(name: string) { super(name); diff --git a/core/renderers/thrasos/thrasos.ts b/core/renderers/thrasos/thrasos.ts index 0854ca5ab..5b2b419f5 100644 --- a/core/renderers/thrasos/thrasos.ts +++ b/core/renderers/thrasos/thrasos.ts @@ -6,11 +6,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Re-exports of Blockly.thrasos.* modules. - * - * @namespace Blockly.thrasos - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.thrasos'); diff --git a/core/renderers/zelos/constants.ts b/core/renderers/zelos/constants.ts index 038e45d9f..73ee82e61 100644 --- a/core/renderers/zelos/constants.ts +++ b/core/renderers/zelos/constants.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * An object that provides constants for rendering blocks in Zelos - * mode. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.zelos.ConstantProvider'); @@ -47,8 +41,6 @@ export class ConstantProvider extends BaseConstantProvider { /** * Radius of the cursor for input and output connections. - * - * @internal */ CURSOR_RADIUS = 5; @@ -67,8 +59,6 @@ export class ConstantProvider extends BaseConstantProvider { * When a block with the outer shape contains an input block with the inner * shape on its left or right edge, the block elements are aligned such that * the padding specified is reached. - * - * @internal */ SHAPE_IN_SHAPE_PADDING: {[key: number]: {[key: number]: number}} = { 1: { @@ -126,8 +116,6 @@ export class ConstantProvider extends BaseConstantProvider { /** * The ID of the selected glow filter, or the empty string if no filter is * set. - * - * @internal */ selectedGlowFilterId = ''; @@ -139,8 +127,6 @@ export class ConstantProvider extends BaseConstantProvider { /** * The ID of the replacement glow filter, or the empty string if no filter * is set. - * - * @internal */ replacementGlowFilterId = ''; @@ -167,7 +153,6 @@ export class ConstantProvider extends BaseConstantProvider { */ SQUARED: Shape|null = null; - /** @internal */ constructor() { super(); @@ -310,9 +295,8 @@ export class ConstantProvider extends BaseConstantProvider { * * @returns An object containing sizing and path information about a hexagonal * shape for connections. - * @internal */ - makeHexagonal(): Shape { + protected makeHexagonal(): Shape { const maxWidth = this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH; /** @@ -374,9 +358,8 @@ export class ConstantProvider extends BaseConstantProvider { * * @returns An object containing sizing and path information about a rounded * shape for connections. - * @internal */ - makeRounded(): Shape { + protected makeRounded(): Shape { const maxWidth = this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH; const maxHeight = maxWidth * 2; @@ -447,9 +430,8 @@ export class ConstantProvider extends BaseConstantProvider { * * @returns An object containing sizing and path information about a squared * shape for connections. - * @internal */ - makeSquared(): Shape { + protected makeSquared(): Shape { const radius = this.CORNER_RADIUS; /** diff --git a/core/renderers/zelos/drawer.ts b/core/renderers/zelos/drawer.ts index 301fbd004..931afc5d2 100644 --- a/core/renderers/zelos/drawer.ts +++ b/core/renderers/zelos/drawer.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Zelos renderer. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.zelos.Drawer'); @@ -39,7 +34,6 @@ export class Drawer extends BaseDrawer { * @param block The block to render. * @param info An object containing all information needed to render this * block. - * @internal */ constructor(block: BlockSvg, info: RenderInfo) { super(block, info); diff --git a/core/renderers/zelos/info.ts b/core/renderers/zelos/info.ts index fdaa913b6..30f179cba 100644 --- a/core/renderers/zelos/info.ts +++ b/core/renderers/zelos/info.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Makecode/scratch-style renderer. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.zelos.RenderInfo'); @@ -58,7 +53,6 @@ export class RenderInfo extends BaseRenderInfo { /** * @param renderer The renderer in use. * @param block The block to measure. - * @internal */ constructor(renderer: Renderer, block: BlockSvg) { super(renderer, block); @@ -106,7 +100,6 @@ export class RenderInfo extends BaseRenderInfo { * Get the block renderer in use. * * @returns The block renderer in use. - * @internal */ override getRenderer(): Renderer { return this.renderer_ as Renderer; diff --git a/core/renderers/zelos/marker_svg.ts b/core/renderers/zelos/marker_svg.ts index 27c701d47..49e35a873 100644 --- a/core/renderers/zelos/marker_svg.ts +++ b/core/renderers/zelos/marker_svg.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Methods for graphically rendering a marker as SVG. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.zelos.MarkerSvg'); diff --git a/core/renderers/zelos/measurables/bottom_row.ts b/core/renderers/zelos/measurables/bottom_row.ts index d0e1d2ba6..429f120ac 100644 --- a/core/renderers/zelos/measurables/bottom_row.ts +++ b/core/renderers/zelos/measurables/bottom_row.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * An object representing the bottom row of a rendered block. - * - * @class - */ import * as goog from '../../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.zelos.BottomRow'); @@ -26,7 +21,6 @@ import {BottomRow as BaseBottomRow} from '../../../renderers/measurables/bottom_ export class BottomRow extends BaseBottomRow { /** * @param constants The rendering constants provider. - * @internal */ constructor(constants: ConstantProvider) { super(constants); diff --git a/core/renderers/zelos/measurables/inputs.ts b/core/renderers/zelos/measurables/inputs.ts index 909d1a314..4699bdd64 100644 --- a/core/renderers/zelos/measurables/inputs.ts +++ b/core/renderers/zelos/measurables/inputs.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Zelos specific objects representing inputs with connections on - * a rendered block. - * - * @class - */ import * as goog from '../../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.zelos.StatementInput'); @@ -29,7 +23,6 @@ export class StatementInput extends BaseStatementInput { /** * @param constants The rendering constants provider. * @param input The statement input to measure and store information for. - * @internal */ constructor(constants: ConstantProvider, input: Input) { super(constants, input); diff --git a/core/renderers/zelos/measurables/row_elements.ts b/core/renderers/zelos/measurables/row_elements.ts index 05f594766..db97735fc 100644 --- a/core/renderers/zelos/measurables/row_elements.ts +++ b/core/renderers/zelos/measurables/row_elements.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Zelos specific objects representing elements in a row of a - * rendered block. - * - * @class - */ import * as goog from '../../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.zelos.RightConnectionShape'); @@ -29,7 +23,6 @@ export class RightConnectionShape extends Measurable { /** * @param constants The rendering constants provider. - * @internal */ constructor(constants: ConstantProvider) { super(constants); diff --git a/core/renderers/zelos/measurables/top_row.ts b/core/renderers/zelos/measurables/top_row.ts index 996018ae4..531b10759 100644 --- a/core/renderers/zelos/measurables/top_row.ts +++ b/core/renderers/zelos/measurables/top_row.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * An object representing the top row of a rendered block. - * - * @class - */ import * as goog from '../../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.zelos.TopRow'); @@ -28,7 +23,6 @@ import {TopRow as BaseTopRow} from '../../../renderers/measurables/top_row.js'; export class TopRow extends BaseTopRow { /** * @param constants The rendering constants provider. - * @internal */ constructor(constants: ConstantProvider) { super(constants); diff --git a/core/renderers/zelos/path_object.ts b/core/renderers/zelos/path_object.ts index 352b7dddf..ca99f4c77 100644 --- a/core/renderers/zelos/path_object.ts +++ b/core/renderers/zelos/path_object.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * An object that owns a block's rendering SVG elements. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.zelos.PathObject'); @@ -47,14 +42,12 @@ export class PathObject extends BasePathObject { */ outputShapeType: number|null = null; - /** @internal */ public override constants: ConstantProvider; /** * @param root The root SVG element. * @param style The style object to use for colouring. * @param constants The renderer's constants. - * @internal */ constructor( root: SVGElement, style: BlockStyle, constants: ConstantProvider) { @@ -136,8 +129,6 @@ export class PathObject extends BasePathObject { /** * Method that's called when the drawer is about to draw the block. - * - * @internal */ beginDrawing() { this.remainingOutlines.clear(); @@ -148,8 +139,6 @@ export class PathObject extends BasePathObject { /** * Method that's called when the drawer is done drawing. - * - * @internal */ endDrawing() { // Go through all remaining outlines that were not used this draw pass, and @@ -168,7 +157,6 @@ export class PathObject extends BasePathObject { * * @param name The input name. * @param pathString The path. - * @internal */ setOutlinePath(name: string, pathString: string) { const outline = this.getOutlinePath_(name); diff --git a/core/renderers/zelos/renderer.ts b/core/renderers/zelos/renderer.ts index c4f8ed1ce..cbef6c5a2 100644 --- a/core/renderers/zelos/renderer.ts +++ b/core/renderers/zelos/renderer.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Zelos renderer. - * - * @class - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.zelos.Renderer'); @@ -32,14 +27,16 @@ import {PathObject} from './path_object.js'; /** - * The zelos renderer. + * The zelos renderer. This renderer emulates Scratch-style and MakeCode-style + * rendering. + * + * Zelos is the ancient Greek spirit of rivalry and emulation. */ export class Renderer extends BaseRenderer { protected override constants_!: ConstantProvider; /** * @param name The renderer name. - * @internal */ constructor(name: string) { super(name); @@ -83,7 +80,6 @@ export class Renderer extends BaseRenderer { * @param workspace The workspace the cursor belongs to. * @param marker The marker. * @returns The object in charge of drawing the marker. - * @internal */ override makeMarkerDrawer(workspace: WorkspaceSvg, marker: Marker): MarkerSvg { @@ -96,7 +92,6 @@ export class Renderer extends BaseRenderer { * @param root The root SVG element. * @param style The style object to use for colouring. * @returns The renderer path object. - * @internal */ override makePathObject(root: SVGElement, style: BlockStyle): PathObject { return new PathObject( diff --git a/core/renderers/zelos/zelos.ts b/core/renderers/zelos/zelos.ts index fa402285b..edecc16f9 100644 --- a/core/renderers/zelos/zelos.ts +++ b/core/renderers/zelos/zelos.ts @@ -6,11 +6,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * Re-exports of Blockly.zelos.* modules. - * - * @namespace Blockly.zelos - */ import * as goog from '../../../closure/goog/goog.js'; goog.declareModuleId('Blockly.zelos');