blockly-proceds
Advanced tools
Comparing version 1.0.4 to 1.0.5
{ | ||
"name": "blockly-proceds", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "A Blockly plugin.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -1,17 +0,5 @@ | ||
/** | ||
* @license | ||
* Copyright 2023 Google LLC | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
import 'blockly/blocks'; | ||
import * as Blockly from 'blockly/core' | ||
// TODO: Edit plugin overview. | ||
/** | ||
* @fileoverview Plugin overview. | ||
*/ | ||
// TODO: Rename plugin and edit plugin description. | ||
/** | ||
* Plugin description. | ||
*/ | ||
export class Plugin { | ||
export class BlocklyProceds { | ||
/** | ||
@@ -76,4 +64,4 @@ * Constructor for ... | ||
Blockly.Msg.PROCEDURES_ADD_PARAMETER, | ||
function () { /*addParameter(block, 0, nameField)*/ } | ||
); | ||
function () { this.addParameter(block) } | ||
) | ||
@@ -121,21 +109,18 @@ var input = block.appendDummyInput() | ||
addParameter = function (self) { | ||
var argsAmount = self.getVars() | ||
var defaultName = Blockly.Msg.PROCEDURES_PARAMETER + " " + (argsAmount + 1); | ||
var name = this.getAvailableName(self, defaultName); | ||
var id = "INPUTARG" + argsAmount; | ||
addParameter = (self) => { | ||
const argsAmount = self.getVars() | ||
const defaultName = Blockly.Msg.PROCEDURES_PARAMETER + " " + (argsAmount + 1); | ||
const name = this.getAvailableName(self, defaultName); | ||
const id = "INPUTARG" + argsAmount; | ||
/* if (index === undefined) { | ||
self.arguments_.push(name); | ||
self.updateParams_(); | ||
var blocks = self.workspace.getAllBlocks(); | ||
for (block of blocks) | ||
if (block.type === self.callType_ && block.getProcedureCall() === self.getProcedureDef()[0]) { | ||
block.arguments_.push(name); | ||
block.updateShape_(); | ||
} | ||
} */ | ||
self.arguments_.push(name); | ||
self.updateParams_(); | ||
var createCallButton = new Blockly.FieldImage( | ||
const callers = Blockly.Procedures.getCallers(self.getProcedureDef()[0], self.workspace); | ||
callers.forEach(caller => { | ||
caller.arguments_.push(name); | ||
caller.updateShape_() | ||
}) | ||
const createCallButton = new Blockly.FieldImage( | ||
ProcedsBlockly.HAND, | ||
@@ -150,3 +135,3 @@ 16, | ||
var removeParameterButton = new Blockly.FieldImage( | ||
const removeParameterButton = new Blockly.FieldImage( | ||
ProcedsBlockly.MINUS, | ||
@@ -173,4 +158,4 @@ 16, | ||
var nameField = new Blockly.FieldTextInput(name, function (newName) { | ||
var oldName = self.getVars()[argsAmount]; | ||
const nameField = new Blockly.FieldTextInput(name, function (newName) { | ||
const oldName = self.getVars()[argsAmount]; | ||
@@ -182,3 +167,2 @@ if (oldName !== newName) | ||
var callers = Blockly.Procedures.getCallers(self.getProcedureDef()[0], self.workspace); | ||
callers.forEach(caller => { | ||
@@ -185,0 +169,0 @@ caller.arguments_ = caller.arguments_.map(argName => argName === oldName ? newName : argName) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
7318
164