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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,7 @@ module.exports = [
'jsdoc/require-returns': ['off'],
// Ensure there is a blank line between the body and any @tags,
// as required by the tsdoc spec.
// TODO: Re-enable soon.
// 'jsdoc/tag-lines': ['error', 'any', {'startLines': 1}],
'jsdoc/tag-lines': 'off',
'jsdoc/tag-lines': ['error', 'any', {'startLines': 1}],

// Already handled by tsc.
'no-dupe-class-members': 'off',
Expand Down
13 changes: 13 additions & 0 deletions plugins/block-dynamic-connection/src/dynamic_if.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ interface IfExtraState {
const DYNAMIC_IF_MIXIN = {
/**
* Minimum number of inputs for this block.
*
* @deprecated This is unused.
*/
minInputs: 1,
Expand All @@ -64,6 +65,7 @@ const DYNAMIC_IF_MIXIN = {

/**
* Create XML to represent if/elseif/else inputs.
*
* @returns XML storage element.
*/
mutationToDom(this: DynamicIfBlock): Element | null {
Expand All @@ -88,6 +90,7 @@ const DYNAMIC_IF_MIXIN = {

/**
* Parse XML to restore the inputs.
*
* @param xmlElement XML storage element.
*/
domToMutation(this: DynamicIfBlock, xmlElement: Element): void {
Expand All @@ -100,6 +103,7 @@ const DYNAMIC_IF_MIXIN = {

/**
* Parses XML based on the 'inputs' attribute (non-standard).
*
* @param xmlElement XML storage element.
*/
deserializeInputs(this: DynamicIfBlock, xmlElement: Element): void {
Expand Down Expand Up @@ -137,6 +141,7 @@ const DYNAMIC_IF_MIXIN = {

/**
* Parses XML based on the 'elseif' and 'else' attributes (standard).
*
* @param xmlElement XML storage element.
*/
deserializeCounts(this: DynamicIfBlock, xmlElement: Element): void {
Expand All @@ -153,6 +158,7 @@ const DYNAMIC_IF_MIXIN = {

/**
* Returns the state of this block as a JSON serializable object.
*
* @returns The state of this block, ie the else if count and else state.
*/
saveExtraState: function (this: DynamicIfBlock): IfExtraState | null {
Expand All @@ -178,6 +184,7 @@ const DYNAMIC_IF_MIXIN = {

/**
* Applies the given state to this block.
*
* @param state The state to apply to this block, ie the else if count
* and else state.
*/
Expand All @@ -203,6 +210,7 @@ const DYNAMIC_IF_MIXIN = {
/**
* Finds the index of a connection. Used to determine where in the block to
* insert new inputs.
*
* @param connection A connection on this block.
* @returns The index of the connection in the this.inputList.
*/
Expand All @@ -221,6 +229,7 @@ const DYNAMIC_IF_MIXIN = {

/**
* Inserts a boolean value input and statement input at the specified index.
*
* @param index Index of the input before which to add new inputs.
* @param id An ID to append to the case statement input names to make them
* unique.
Expand All @@ -245,6 +254,7 @@ const DYNAMIC_IF_MIXIN = {
/**
* Called by a monkey-patched version of InsertionMarkerManager when
* a block is dragged over one of the connections on this block.
*
* @param connection The connection on this block that has a pending
* connection.
*/
Expand Down Expand Up @@ -304,6 +314,7 @@ const DYNAMIC_IF_MIXIN = {
* if nor the due input in a case has an attached block, that input is
* skipped. If only one of them has an attached block, the other value in
* the pair is undefined.
*
* @returns A list of target connections attached to case inputs.
*/
collectTargetCaseConns(this: DynamicIfBlock): CaseConnectionPair[] {
Expand All @@ -330,6 +341,7 @@ const DYNAMIC_IF_MIXIN = {
*
* This is essentially rebuilding all of the cases with strictly ascending
* case numbers.
*
* @param targetConns The list of target connections to attach to this block.
*/
addCaseInputs(this: DynamicIfBlock, targetConns: CaseConnectionPair[]): void {
Expand All @@ -348,6 +360,7 @@ const DYNAMIC_IF_MIXIN = {

/**
* Adds an else input to this block.
*
* @returns The appended input.
*/
addElseInput(this: DynamicIfBlock): Blockly.Input {
Expand Down
11 changes: 11 additions & 0 deletions plugins/block-dynamic-connection/src/dynamic_list_create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const DYNAMIC_LIST_CREATE_MIXIN = {

/**
* Create XML to represent number of text inputs.
*
* @returns XML storage element.
*/
mutationToDom(this: DynamicListCreateBlock): Element {
Expand All @@ -61,6 +62,7 @@ const DYNAMIC_LIST_CREATE_MIXIN = {

/**
* Parse XML to restore the text inputs.
*
* @param xmlElement XML storage element.
*/
domToMutation(this: DynamicListCreateBlock, xmlElement: Element): void {
Expand All @@ -73,6 +75,7 @@ const DYNAMIC_LIST_CREATE_MIXIN = {

/**
* Parses XML based on the 'inputs' attribute (non-standard).
*
* @param xmlElement XML storage element.
*/
deserializeInputs(this: DynamicListCreateBlock, xmlElement: Element): void {
Expand All @@ -89,6 +92,7 @@ const DYNAMIC_LIST_CREATE_MIXIN = {

/**
* Parses XML based on the 'items' attribute (standard).
*
* @param xmlElement XML storage element.
*/
deserializeCounts(this: DynamicListCreateBlock, xmlElement: Element): void {
Expand All @@ -104,6 +108,7 @@ const DYNAMIC_LIST_CREATE_MIXIN = {

/**
* Returns the state of this block as a JSON serializable object.
*
* @returns The state of this block, ie the item count.
*/
saveExtraState: function (this: DynamicListCreateBlock): {itemCount: number} {
Expand All @@ -121,6 +126,7 @@ const DYNAMIC_LIST_CREATE_MIXIN = {

/**
* Applies the given state to this block.
*
* @param state The state to apply to this block, ie the item count.
*/
loadExtraState: function (
Expand All @@ -141,6 +147,7 @@ const DYNAMIC_LIST_CREATE_MIXIN = {

/**
* Check whether a new input should be added and determine where it should go.
*
* @param connection The connection that has a pending connection.
* @returns The index before which to insert a new input, or null if no input
* should be added.
Expand Down Expand Up @@ -183,6 +190,7 @@ const DYNAMIC_LIST_CREATE_MIXIN = {
/**
* Called by a monkey-patched version of InsertionMarkerManager when
* a block is dragged over one of the connections on this block.
*
* @param connection The connection on this block that has a pending
* connection.
*/
Expand Down Expand Up @@ -222,6 +230,7 @@ const DYNAMIC_LIST_CREATE_MIXIN = {
* Filters the given target connections so that empty connections are removed,
* unless we need those to reach the minimum input count. Empty connections
* are removed starting at the end of the array.
*
* @param targetConns The list of connections associated with inputs.
* @returns A filtered list of connections (or null/undefined) which should
* be attached to inputs.
Expand All @@ -243,6 +252,7 @@ const DYNAMIC_LIST_CREATE_MIXIN = {
* every entry in the array (if it does not already exist). If the entry is
* a connection and not null/undefined the connection will be connected to
* the input.
*
* @param targetConns The connections defining the inputs to add.
*/
addItemInputs(
Expand All @@ -263,6 +273,7 @@ const DYNAMIC_LIST_CREATE_MIXIN = {

/**
* Adds the top input with the label to this block.
*
* @returns The added input.
*/
addFirstInput(this: DynamicListCreateBlock): Blockly.Input {
Expand Down
11 changes: 11 additions & 0 deletions plugins/block-dynamic-connection/src/dynamic_text_join.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const DYNAMIC_TEXT_JOIN_MIXIN = {

/**
* Create XML to represent number of text inputs.
*
* @returns XML storage element.
*/
mutationToDom(this: DynamicTextJoinBlock): Element {
Expand All @@ -59,6 +60,7 @@ const DYNAMIC_TEXT_JOIN_MIXIN = {

/**
* Parse XML to restore the text inputs.
*
* @param xmlElement XML storage element.
*/
domToMutation(this: DynamicTextJoinBlock, xmlElement: Element): void {
Expand All @@ -71,6 +73,7 @@ const DYNAMIC_TEXT_JOIN_MIXIN = {

/**
* Parses XML based on the 'inputs' attribute (non-standard).
*
* @param xmlElement XML storage element.
*/
deserializeInputs(this: DynamicTextJoinBlock, xmlElement: Element): void {
Expand All @@ -85,6 +88,7 @@ const DYNAMIC_TEXT_JOIN_MIXIN = {

/**
* Parses XML based on the 'items' attribute (standard).
*
* @param xmlElement XML storage element.
*/
deserializeCounts(this: DynamicTextJoinBlock, xmlElement: Element): void {
Expand All @@ -100,6 +104,7 @@ const DYNAMIC_TEXT_JOIN_MIXIN = {

/**
* Returns the state of this block as a JSON serializable object.
*
* @returns The state of this block, ie the item count.
*/
saveExtraState: function (this: DynamicTextJoinBlock): {itemCount: number} {
Expand All @@ -117,6 +122,7 @@ const DYNAMIC_TEXT_JOIN_MIXIN = {

/**
* Applies the given state to this block.
*
* @param state The state to apply to this block, ie the item count.
*/
loadExtraState: function (
Expand All @@ -137,6 +143,7 @@ const DYNAMIC_TEXT_JOIN_MIXIN = {

/**
* Check whether a new input should be added and determine where it should go.
*
* @param connection The connection that has a pending connection.
* @returns The index before which to insert a new input, or null if no input
* should be added.
Expand Down Expand Up @@ -179,6 +186,7 @@ const DYNAMIC_TEXT_JOIN_MIXIN = {
/**
* Called by a monkey-patched version of InsertionMarkerManager when
* a block is dragged over one of the connections on this block.
*
* @param connection The connection on this block that has a pending
* connection.
*/
Expand Down Expand Up @@ -218,6 +226,7 @@ const DYNAMIC_TEXT_JOIN_MIXIN = {
* Filters the given target connections so that empty connections are removed,
* unless we need those to reach the minimum input count. Empty connections
* are removed starting at the end of the array.
*
* @param targetConns The list of connections associated with inputs.
* @returns A filtered list of connections (or null/undefined) which should
* be attached to inputs.
Expand All @@ -240,6 +249,7 @@ const DYNAMIC_TEXT_JOIN_MIXIN = {
* every entry in the array (if it does not already exist). If the entry is
* a connection and not null/undefined the connection will be connected to
* the input.
*
* @param targetConns The connections defining the inputs to add.
*/
addItemInputs(
Expand All @@ -260,6 +270,7 @@ const DYNAMIC_TEXT_JOIN_MIXIN = {

/**
* Adds the top input with the label to this block.
*
* @returns The added input.
*/
addFirstInput(this: DynamicTextJoinBlock): Blockly.Input {
Expand Down
1 change: 1 addition & 0 deletions plugins/block-dynamic-connection/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import * as BlockDynamicConnection from '../src/index';

/**
* Create a workspace.
*
* @param blocklyDiv The blockly container div.
* @param options The Blockly options.
* @returns The created workspace.
Expand Down
Loading