Commit Graph

76 Commits

Author SHA1 Message Date
Maribeth Bottorff
6dbc534dcc refactor: Move Blockly.svgResize to Blockly.common (#5485)
* refactor: Move Blockly.svgResize to Blockly.common

* fix formatting and deps
2021-09-16 15:53:33 -07:00
Christopher Allen
81e645a771 Remove vestigial (circular) require of Blockly (#5474) 2021-09-16 16:46:06 +01:00
Aaron Dodson
6a4a359f7b Migrate hideChaff() from Blockly to WorkspaceSvg (#5460)
* Add hideChaff() to core/workspace_svg.js

* Mark Blockly.hideChaff as deprecated

* Update uses of Blockly.hideChaff() to WorkspaceSvg.hideChaff() in core

* Update uses of Blockly.hideChaff() to WorkspaceSvg.hideChaff() in demos

* Style and formatting fixes

* Switch from accessor to stub wrapper for Blockly.hideChaff

Co-authored-by: Christopher Allen <cpcallen+github@gmail.com>

Co-authored-by: Christopher Allen <cpcallen+github@gmail.com>
2021-09-15 13:41:20 -07:00
Aaron Dodson
2ba51d4d75 Migrate Blockly.hueToHex to Blockly.utils.colour.hueToHex (#5462)
* Move hueToHex to core/utils/colour.js

* Mark Blockly.hueToHex as deprecated and pass calls through to Blockly.utils.colour.hueToHex

* Migrate core to use Blockly.utils.colour.hueToHex

* Migrate demos to use Blockly.utils.colour.hueToHex
2021-09-14 14:13:24 -07:00
Christopher Allen
79b814018e Migrate core/utils.js to goog.module syntax (#5446)
* Add missing requires for Blockly.utils.*
  - Blockly.utils.svgPaths in core/rendered_connection.js
  - Blockly.utils.colour in core/toolbox/category.js
  - Blockly.utils.KeyCodes in core/toolbox/toolbox.js
* Migrate core/utils.js to ES6 const/let
* Migrate core/utils.js to goog.module
* Migrate core/utils.js named requires
* clang-format core/utils.js
2021-09-09 17:25:53 +01:00
Christopher Allen
a6471c4276 Rename Blockly.utils.IdGenerator to idGenerator and move Blockly.utils.genUid to there (#5441)
* Rename Blockly.utils.IdGenerator -> idGenerator
* Move genUid from Blockly.utils to Blockly.utils.idGenerator
2021-09-09 17:08:44 +01:00
Christopher Allen
c31895dc60 fix: Add missing require for Blockly.utils.object, .Size (#5427)
Some files were using Blockly.utils.object.inherits (or .mixin) without
having imported Blockly.utils.object.

Similarly, trashcan.js tried to use utils.Size as a constructor
instead of importing Size from Blockly.utils.Size.
2021-09-03 22:45:54 +01:00
Christopher Allen
4c40378b9a Use goog.requireType when importing interfaces (etc.) (#5343)
* Use goog.requireType when importing I* interfaces

Interfaces have no code, so should never be referred to outside of
(JSDoc) comments, and so the modules that define only interfaces never
need to be goog.require'd - goog.requireType is always sufficient.

This commit fixes imports of all modules whose name matches
/(.*\.)?I[A-Z]*/ - i.e., the hungarian-notation named ones in
core/interfaces/.

* Use goog.requireType when only using import for type specifications

Where a module is imported only to used in JSDoc comments it can
(and should) be goog.requireType'd instead of goog.require'd.

* Remove spurious eslint-disable no-unused-vars

There were a few cases where modules were being imported with
goog.require (because they are referred to in code, not just JSDoc
comments) but were prefaced by a spurious eslint suppress.

Remove these, restoring the invariant that an import gets an eslint
if and only if it is a requireType.

* Remove obsolete Closure Compiler error group

stricterMissingRequire has been superceded by missingRequire, and now
causes a Java null pointer exception if supplied.
2021-08-11 18:50:45 +01:00
kozbial
6ad723afbc Add eslint disable 2021-08-09 18:53:11 -07:00
kozbial
6863d7fa08 clang-format core/toolbox/toolbox.js 2021-08-09 18:53:11 -07:00
kozbial
a2e9509542 Migrate core/toolbox/toolbox.js named requires 2021-08-09 18:53:11 -07:00
kozbial
ec1567020b Migrate core/toolbox/toolbox.js to goog.module 2021-08-09 18:53:11 -07:00
kozbial
8875dbd50c Migrate core/toolbox/toolbox.js to ES6 const/let 2021-08-09 18:53:11 -07:00
kozbial
f818f882bc clang-format core/toolbox/category.js 2021-08-05 10:55:13 -07:00
kozbial
3c564982fc Migrate core/toolbox/category.js named requires 2021-08-05 10:55:13 -07:00
kozbial
68654b34d1 Migrate core/toolbox/category.js to goog.module 2021-08-05 10:55:13 -07:00
kozbial
3ae6a21c55 Migrate core/toolbox/category.js to ES6 const/let 2021-08-05 10:55:13 -07:00
kozbial
ef0fcdbcdd Split Blockly.BlocklyOptions into a separate file 2021-08-05 10:50:44 -07:00
kozbial
38b44f5dab Remove unecessary implements 2021-08-03 15:32:13 -07:00
kozbial
d5d155641e Add eslint disable to core/toolbox/separator.js 2021-08-03 15:32:13 -07:00
kozbial
d004607b3b clang-format core/toolbox/separator.js 2021-08-03 15:32:13 -07:00
kozbial
6bf443bdd6 Migrate core/toolbox/separator.js named requires 2021-08-03 15:32:13 -07:00
kozbial
bce1136500 Migrate core/toolbox/separator.js to goog.module 2021-08-03 15:32:13 -07:00
kozbial
582b67ae7b Migrate core/toolbox/separator.js to ES6 const/let 2021-08-03 15:32:13 -07:00
kozbial
4eed760a19 Fix eslint disable lines 2021-07-30 15:53:51 -07:00
kozbial
7596388124 clang-format core/toolbox/toolbox_item.js 2021-07-30 15:53:51 -07:00
kozbial
65608065ea Migrate core/toolbox/toolbox_item.js named requires 2021-07-30 15:53:51 -07:00
kozbial
af3f04b508 Migrate core/toolbox/toolbox_item.js to goog.module 2021-07-30 15:53:51 -07:00
kozbial
7f5ec67860 Fix lint warnings in core/toolbox/collapsible_category.js 2021-07-29 16:54:07 -07:00
kozbial
17bc528039 Add eslint disable for requireType in core/toolbox/collapsible_category.js 2021-07-29 16:54:07 -07:00
kozbial
c3521b7eb4 clang-format core/toolbox/collapsible_category.js 2021-07-29 16:54:07 -07:00
kozbial
d7a864a498 Migrate core/toolbox/collapsible_category.js named requires 2021-07-29 16:54:07 -07:00
kozbial
41b53c50cd Migrate core/toolbox/collapsible_category.js to goog.module 2021-07-29 16:54:07 -07:00
kozbial
787145acf4 Migrate core/toolbox/collapsible_category.js to ES6 const/let 2021-07-29 16:54:07 -07:00
Neil Fraser
b3c94db951 Revert "Revert "Group field edits together for undo/redo""
This reverts commit 344ebcfd02.
2021-07-12 09:38:04 -07:00
Neil Fraser
344ebcfd02 Revert "Group field edits together for undo/redo"
This reverts commit 33ad2448b8.
2021-06-29 11:35:21 -07:00
Neil Fraser
33ad2448b8 Group field edits together for undo/redo
Fixes #4189.
Also use 0 instead of 0px, in accordance with the rest of Blockly and Google’s CSS style guide.
2021-06-29 09:57:25 -07:00
Monica Kozbial
7b286dbf82 Update the registered component ids (#4898) 2021-06-17 17:50:04 -07:00
Monica Kozbial
7d45b531ac Update toolbox drag target when visibility changes (#4919) 2021-06-17 15:17:36 -07:00
alschmiedt
a46dbb37e7 Fixes workspace scroll bug (#4921) 2021-06-16 08:18:28 -07:00
Monica Kozbial
34fce2c1cb Moves toolbox cursor styling out of block_dragger (#4896) 2021-06-11 18:02:40 -07:00
Monica Kozbial
a17cb7f12e Adding parameter to dragEnter and dragExit (#4890)
* introduce IDraggable interface
* Add parameter to drag methods in IDragTarget
* combines bubble/drag methods on IDragTarget and IDeleteArea to take an IDraggable element
2021-06-11 12:58:26 -07:00
Monica Kozbial
2005576036 Add onDragOver and wouldDelete_ to DeleteArea (#4888)
* keep track of state for whether the block or bubble would be deleted for use with drag enter exit

* Check if block and bubble is deletable in IDeleteArea

* Add to jsdoc of IDeleteArea
2021-06-10 16:27:04 -07:00
Monica Kozbial
0014ad3257 Add id to component interface (#4887) 2021-06-10 16:03:43 -07:00
Monica Kozbial
d2579a7369 Add removeComponent to ComponentManager (#4884) 2021-06-09 22:29:33 -07:00
Monica Kozbial
11390341b1 Adding IDragTarget support. (#4852) 2021-06-09 13:59:22 -07:00
Neil Fraser
cff7b359f4 Make comments more consistent. 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
Monica Kozbial
5344ad6c21 Add support for IAutoHideable (#4855) 2021-05-27 17:01:11 -07:00
Neil Fraser
dd0314bc0b Normalize comments 2021-05-19 09:57:14 -07:00