-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Blockly to v10 #3275
base: master
Are you sure you want to change the base?
Update Blockly to v10 #3275
Conversation
Change-Id: I7e5416732f574de36c4558dfa6f90b7fb1a8f1ca
Change-Id: I661c58f1db76f20510df0f5fab6b74ed52b864c0
Change-Id: I3327832eec806888294275c7b0d7adb2d848a5ac
Change-Id: I6bb65ec0a6bdb3be4d7769617646a644b02b0c9e
Change-Id: I00e5a57e318d114f25c5f0d7763f11870e4dc4b6
Change-Id: I319d4fcce6b7971a5290c58aa7ee531a80471e35
Change-Id: Ie5784962df6276ed58c750175ba558c95cbb78f1
Change-Id: Ie5f96d41534be8b05dd172774ce849e51e7bf273
Change-Id: I9b393a93a604711f19f73ae6c82d5cd08ede7e25
Change-Id: I920ad6e21cff0ab28f044f246c1583a6395ac99a
Change-Id: I37f93abf2aea184e43f3e41ca89ea93192eb1a42
Change-Id: I8d554a9d8dc0ba427d6a0d5b5e3418138d00df15
Change-Id: Id3fb7a482058d18584270f6b8ad1c2e4ea2d3e36
Change-Id: Id5fa531daa6c08fd8d38fa23dcf928f4253b07a2
Change-Id: I52805803fede2e105525ac8f71a3ea6da9bdfc9f
Change-Id: Icb041cc0376571a3715cdb99d7dd4aacec8dd5df
Change-Id: I10dfcb9bf6bb5233e03bf1971f526239e0137bdc
Change-Id: I7a6186862de76aee97b3239ce70dac6db22b6bac
Change-Id: Id4e0bd6dfd948600be5cf276111024ecd1912d7d
Change-Id: I75554acf9a151c477ce82597d9487a87433d765b
Change-Id: I6fe4830895e9079bfb003a3527ac291d7245e1df
Change-Id: I05627b37b4ee313088d3b064dd7b4b134a4559c0
Change-Id: Ia792718e059e0a5f57eb8b2fc35d79a1c9a38db1
Change-Id: I1291e958ee463455cc5f41f10918ce1fb4e87f2d
Change-Id: Ie94ef6fff8e11b329a0e28bc163389d163613732
Change-Id: I54ed0a6de1ba19afe91e71777aef05666a0f879d
Change-Id: I7c4accf21d55fa2f0fdc7613247c5863a4b43af7
Change-Id: I08192cf0ff41602649c46469c425cc06213fe520
Change-Id: I3c63ef268abb1e24037619cdec59b7e2be0f6f70
Change-Id: Id044cbe8eebcd4b8dca0792d269f27aacf47bf6e
Multiselect seems to be behaving poorly on the test server. If I select a block then hold shift to select another block, sometimes it works and sometimes it doesn't. Also, selecting the second block regardless turns off multiselect for further blocks. You can see this reflected in the state change in the UI of the multiselect button. I think the correct behavior should be that until the user releases Shift each new block should be added. It's unclear whether this is a bug in the plugin itself or some integration in this PR. cc @HollowMan6 |
…mespace Change-Id: Ib911249c5d909cd7d7f03e86a25866773f71b84b
Haven't had time to check the modification here, but firstly, we need to confirm if you are using the latest commit that support Blockly v10 instead of the v0.1.12 one, as some bugs were fixed later and we forgot to release a new version for Blockly v10 before we merged the support for Blockly v11. AFAIK, the plugin was working fine for Blockly v10 before we decide to proceed into v11, and the correct behavior applies to the plugin. If the situation you mentioned only happens in rare situations, it sounds somewhat similar to the transparent SVG issue mit-cml/workspace-multiselect#56, but it shouldn't cause the multislect state to go off. In any case, I would suggest you to check if you have any key shortcut overlap / focus change when you do multiselect/selecting the block, as those can all cause the multislect state to go off unexpectedly. |
@HollowMan6 Thanks. I'll build that commit and see if it addresses the issue. |
Change-Id: I355450fb4aca26ac0f2d81dc9e53c37c834c3d0f
Ok, so that wasn't it but I figured out the root cause. In our mouseDown handler code we focus on the Blockly div, which triggers the onBlur function in multiselect. I don't really remember why the focus call was needed in the last Blockly update but maybe it is safe to take it out. |
Change-Id: I124985896013a854cb954137558f3e7ab3cfa1d8
Change-Id: Idf883d7417a1460bcf88523a43cdf2bd53004722
Change-Id: I4e053455cfb47adac6e2adbd2db836f98f6d4501
Change-Id: I0dd35c4fa1329a4155a5530f867cfffd0d4bbac5
Change-Id: If9fcf83c4aa753efa7e368d51b58ce4ee6b40f17
Change-Id: I54357cd8da6ed89cb52dc509bcbda5517883211d
Change-Id: I57b7fb734f37119ffa702d1442f0016356b29134
Change-Id: Ida259ca6825f0646e3f5a8025179ba0e182a2788
Event parameter translation is broken... |
Change-Id: Ia86f814aee167038e8a954880a8b7f59a495e5c5
Change-Id: I79414e9e644efff787095e1a5a2354b768a52558
Change-Id: I03e4aa66126a1ce20ab9058fede5af44411af61f
Change-Id: I164a9e6be71b75d9f2c666bb7b6004873ce0bc67
…ate-2023 Change-Id: If5de35d623e31eb7a316cfd4e69ade682d885c46
inputValidator: function (newVal) { | ||
var block = this.getSourceBlock(); | ||
if (block.workspace.isLoading) { | ||
Blockly.Blocks.text.setOutputOnFinishEdit.bind(block)(newVal); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it is more efficient to call .call(block, newVal)
rather than creating a new bound function for every text. Also, since the functions are copied to the block object couldn't we just do this.setOutputOnFinishEdit(...)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the bind
to a call
. Using this
doesn't work because this
is bound to the field in this function and I can't use block
because setOutputOnFinishEdit
isn't defined on the obfuscated_text block.
I also took the opportunity to document some of the logic of using the field validator and the onchange function, since it's not immediately obvious.
((event.type === Blockly.Events.BLOCK_CHANGE) || | ||
event.type === Blockly.Events.BLOCK_CREATE)) { | ||
var text = this.getFieldValue('TEXT'); | ||
Blockly.Blocks.text.setOutputOnFinishEdit.bind(this)(text); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See previous comment on this
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my previous reply.
@@ -55,8 +58,8 @@ Blockly.Blocks.text.setOutputOnFinishEdit = function(newValue) { | |||
this.outputConnection.setCheck(AI.BlockUtils.YailTypeToBlocklyType("text", AI.BlockUtils.OUTPUT)); | |||
} else { | |||
// Remove the Number type from the output connection check if it exists. | |||
const check = Array.from(AI.BlockUtils.YailTypeToBlocklyType("text", AI.BlockUtils.OUTPUT)); | |||
const numberIndex = check.indexOf('Number'); | |||
var check = Array.from(AI.BlockUtils.YailTypeToBlocklyType("text", AI.BlockUtils.OUTPUT)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like these could have been left as const?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've made me paranoid about using "modern" JavaScript features ;-). I'll change them back.
@@ -70,8 +73,8 @@ Blockly.Blocks.text.setOutputOnFinishEdit = function(newValue) { | |||
* @block Blockly.Block | |||
*/ | |||
function maybeBumpBlockOnFinishEdit(block) { | |||
const outputConnection = block.outputConnection; | |||
const targetConnection = outputConnection.targetConnection; | |||
var outputConnection = block.outputConnection; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
@@ -609,7 +612,7 @@ Blockly.Blocks['obfuscated_text'] = { | |||
this.setColour(Blockly.TEXT_CATEGORY_HUE); | |||
var label = Blockly.Msg.LANG_TEXT_TEXT_OBFUSCATE + " " + | |||
Blockly.Msg.LANG_TEXT_TEXT_LEFT_QUOTE | |||
var textInput = new Blockly.FieldTextInput(''); | |||
var textInput = new Blockly.FieldTextInput('', Blockly.Blocks['text'].inputValidator); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we also need to adopt the logic of onchange
from the text block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did. See the definition of onchange
around line 634.
I also realized that I can remove the call to onFinishEditing_
as I did for the text block.
Also added some comments clarifying the logic.
General items:
I have updated the relevant documentation files under docs/
My code follows the:
ant tests
passes on my machineI branched from
master
My pull request has
master
as the baseWhat does this PR accomplish?
This PR updates App Inventor from Blockly circa May 2017 to Blockly v10.
Resolves #2686