Commit Graph

2843 Commits

Author SHA1 Message Date
alschmiedt 61f76e8d1d PR Comments 2021-06-10 15:36:46 -07:00
alschmiedt 8b1b7f3d7f Merge branch 'develop' of https://github.com/google/blockly into block_drag 2021-06-10 13:45:26 -07:00
Monica Kozbial 77dddca02e Fix bug with updating cursor style in draggers (#4889) 2021-06-10 10:57:09 -07:00
Monica Kozbial d2579a7369 Add removeComponent to ComponentManager (#4884) 2021-06-09 22:29:33 -07:00
Neil Fraser 96315ad449 Fix removal of spaces near parens inside strings
Extra spaces should only be stripped from the inside of paren tokens.  Parens in strings (and other static content) should not be edited.
2021-06-09 22:16:35 -07:00
Monica Kozbial d2c61d5735 Prevent uncessary add/remove class calls on cursor during drag (#4885) 2021-06-09 19:20:47 -07:00
alschmiedt f2431b94da Merge branch 'develop' of https://github.com/google/blockly into block_drag 2021-06-09 17:25:17 -07:00
Monica Kozbial 11390341b1 Adding IDragTarget support. (#4852) 2021-06-09 13:59:22 -07:00
Neil Fraser 861a981cb6 Remove extra else clauses 2021-06-09 11:41:42 -07:00
Neil Fraser cff7b359f4 Make comments more consistent. 2021-06-09 11:41:42 -07:00
Neil Fraser 6a6c630f8c Back out variable change. 2021-06-09 11:41:42 -07:00
Neil Fraser 76b5517008 Use null-prototype objects for maps
A {} has a bunch of names already defined on it (like ‘toString’).  When using an object as a map with arbitrary keys, it should not inherit from Object.prototype.
2021-06-09 11:41:42 -07:00
jschanker 53d8754ee9 Remove row healing for block deletion #4832 (#4873) 2021-06-08 17:13:17 -07:00
Monica Kozbial e3e1089641 ComponentManager API extension (#4875) 2021-06-08 14:03:41 -07:00
Monica Kozbial 8e7cb406f9 Handle overriding components in ComponentManager (#4856) 2021-06-08 12:28:59 -07:00
alschmiedt e7bf54e82e Fixes a check in bump into bounds (#4872) 2021-06-08 08:17:00 -07:00
Neil Fraser 5f7fe9096b Use String() over toLocaleString when possible
toLocaleString results in a 4.6% performance penalty when loading the Spaghetti test in Playground.
2021-06-08 06:08:12 -07:00
alschmiedt c9afdd095e Fix drag surface (#4863)
* Return copy

* Run clang format

* Address PR Comment

* update chrome version
2021-06-03 16:44:07 -07:00
Neil Fraser c5a7b481bc Code simplifications 2021-06-03 08:23:01 -07:00
Neil Fraser e661c92a36 More JSDoc improvements 2021-05-27 21:30:26 -07:00
Neil Fraser f64c11d74e Make JSDoc object nullability more strict.
Also make Blockly.utils.deprecation.warn apply to properties.
2021-05-27 21:30:26 -07:00
Neil Fraser c9b9144a50 Make explicit that names and IDs are conflated
This is potentially dangerous code.  And ID could theoretically collide with a name.
2021-05-27 21:30:26 -07:00
Neil Fraser 43b65d2aa1 Factor out procedure population from generators
Also fix bug in Lua generator where variables were not populated in the nameDB (only language with no variable initialization).
2021-05-27 21:30:26 -07:00
Neil Fraser 9869269ce2 Add procedures to name DB in init
This enables the generator for any block to see all variable names and procedure names in the whole program, including those that haven’t generated yet.
2021-05-27 21:30:26 -07:00
Neil Fraser 17f9209f2f Add missing extern 2021-05-27 21:30:26 -07:00
Neil Fraser ecca5bf274 Use Object.values rather than loop
Only for JS, Lua, and PHP.  Dart and Python need extra logic to split out import statements.

Also use ‘this’ instead of fully qualified names in generators.
2021-05-27 21:30:26 -07:00
Neil Fraser d919b0af21 Update JSDoc from Array.<> to Array<>
Same with Object.
2021-05-27 21:30:26 -07:00
Neil Fraser b50cb5779f Set generator’s isInitialized to false in finish
Previously isInitialized would remain true after first generation.
Also move common init/finish code to parent class.
2021-05-27 21:30:26 -07:00
Neil Fraser 5d2c48e1ab Remove unused Blockly.Generator.NAME_TYPE 2021-05-27 21:30:26 -07:00
Neil Fraser a385f3c2a6 Enable extraction of names from name DB.
Also gets rid of hacky name_realm contatination.
2021-05-27 21:30:26 -07:00
Neil Fraser d519ab8f54 JSDoc improvements 2021-05-27 21:30:26 -07:00
Neil Fraser 2f2252f588 Rename variableDB_ to nameDB_
There is significant confusion in names and comments with regards to variables and procedures.  `Blockly.Generator.prototype.variableDB_` is a Blockly.Names database, not a variable map.  This rename introduces a getter and setter so deprecated references still work.  This commit also fixes some comments which are either outright wrong or misleading regarding variable and procedure names.
2021-05-27 21:30:26 -07:00
Monica Kozbial 5344ad6c21 Add support for IAutoHideable (#4855) 2021-05-27 17:01:11 -07:00
Monica Kozbial 1cadbb94bd Rename PluginManager and related elements (#4857)
* Rename PluginManager and related elements to use component instead of plugin

* Rename types to capabilities
2021-05-27 16:14:33 -07:00
Beka Westberg 5ffd43824f Change lastConnectionInRow to getPlaceForOrphanedOutput - Take 2 (#4851)
* Change lastConnectionInRow to getPlaceForOrphanedOutput

* PR comments
2021-05-26 09:16:33 -07:00
alschmiedt fd417a0070 Updates BlockDragger to make it easier to override (#4842) 2021-05-21 16:04:05 -07:00
alschmiedt 50842fa85e Adds a getter for the draggers on gesture (#4844) 2021-05-21 15:48:57 -07:00
alschmiedt ab70d6b1da Caches ws scroll on block drag surface (#4841) 2021-05-21 15:35:48 -07:00
Neil Fraser dd0314bc0b Normalize comments 2021-05-19 09:57:14 -07:00
Neil Fraser 4436e2814d Use localeCompare’s case insensitivity option
Variables and procedures now sorted using local rules, not Unicode code points.  Verified that ’sensitivity’ survives Closure compiler without quotes.
2021-05-19 09:57:14 -07:00
Neil Fraser 707b42e79b Rename ‘type’ to ‘realm’ within Blockly.Names
Elsewhere ’type’ refers to int/float/string when referencing variables.  This change is local and has no API effect.
2021-05-19 09:57:14 -07:00
Rachel Fenichel d1aedd9cd5 Merge pull request #4798 from BeksOmega/fix/get-def-procedures
Fix getDefinition not working for modified/new procedures
2021-05-11 09:08:48 -07:00
Beka Westberg 75319312c1 Revert "Move ProcedureBlock to interface"
This reverts commit 918bdc2359.
2021-05-10 15:34:36 -07:00
Beka Westberg 8a00303aa7 Revert "Rename to IProcedureBlock"
This reverts commit c8a065fa13.
2021-05-10 15:33:12 -07:00
Beka Westberg c8a065fa13 Rename to IProcedureBlock 2021-05-08 07:57:38 -07:00
Monica Kozbial 6259579c64 Add positioning helpers for trashcan and zoom controls (#4807) 2021-05-07 17:13:48 -07:00
Beka Westberg 918bdc2359 Move ProcedureBlock to interface 2021-05-06 12:22:40 -07:00
Beka Westberg 43e95af14e Fix getDefinition being too restrictive 2021-04-25 14:46:51 -07:00
alschmiedt 87cc725680 Register block dragger (#4796) 2021-04-23 13:33:14 -07:00
Monica Kozbial 5139057664 Merge consecutive viewport change events (#4792) 2021-04-23 10:56:52 -07:00