Commit Graph

102 Commits

Author SHA1 Message Date
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
Maribeth Bottorff
5df8752288 fix whitespace 2021-08-11 17:16:25 -07:00
Maribeth Bottorff
f1e8f75f75 Merge branch 'goog_module' of github.com:google/blockly into bubble-module 2021-08-11 17:12:33 -07: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
Maribeth Bottorff
e1f06ca8a4 clang-format core/bubble.js 2021-07-27 16:34:32 -07:00
Maribeth Bottorff
a6a10ee945 Migrate core/bubble.js to named requires 2021-07-27 16:31:02 -07:00
Maribeth Bottorff
79bcdb0152 Migrate core/bubble.js to goog.module 2021-07-27 16:04:14 -07:00
Maribeth Bottorff
887e9d79cd Migrate core/bubble.js to ES6 const/let 2021-07-27 16:01:18 -07:00
Neil Fraser
e661c92a36 More JSDoc improvements 2021-05-27 21:30:26 -07:00
Sam El-Husseini
f2f878db8c Fix multiple strict require warnings (#4793) 2021-04-21 16:46:04 -07:00
Sam El-Husseini
63d26dc186 Add extra requires check (#4677)
* Add extra requires check
2021-03-05 09:50:51 -08:00
Rachel Fenichel
ad37d9e5c6 More renaming 2021-02-23 10:21:46 -08:00
Rachel Fenichel
f20b06faa8 Rename checkAndBind and update comments. 2021-02-23 10:20:13 -08:00
Rachel Fenichel
54c4e8de39 Rename Blockly.eventHandling->Blockly.browserEvents and replace all Blockly.EventData annotations 2021-02-22 13:23:19 -08:00
Rachel Fenichel
2a3f5040e6 Move bind/unbind events functions to new file, with example usage. 2021-02-19 14:34:45 -08:00
Rachel Fenichel
2360a12493 Fix remaining trivial missing requireTypes 2021-02-19 13:17:14 -08:00
alschmiedt
7b30cc76a4 Adds tests for metrics manager (#4635) 2021-02-18 13:45:53 -08:00
alschmiedt
a8f28c6b11 Metrics refactor (#4627) 2021-02-10 16:19:56 -08:00
Rachel Fenichel
c9be2402bd More missing requires 2021-01-12 12:38:21 -08:00
Rachel Fenichel
40928634e5 Add some missing requires and requireTypes 2021-01-08 15:03:55 -08:00
alschmiedt
697f7a2365 Move where a non editable bubble is created (#4495) 2020-12-04 12:36:42 -08:00
Sam El-Husseini
db40e44b7c Move Blockly.utils.dom.SvgElementType to Blockly.utils.Svg (#4285)
* Move SVGElementType to its own file shaving off 2.7KB
2020-09-16 14:42:58 -07:00
Sam El-Husseini
f3fdab11fb Add IBubble interface (#4104)
* Add IBubble interface and make use of it for WorkspaceCommentSvgs
2020-08-04 17:28:12 -04:00
Sam El-Husseini
0f3db47fa5 Use generics to derive SVG element type (#4036)
* Encapsulate type in a generic to automatically derive type of SVG element when using createSvgElement
2020-07-13 10:40:31 -07:00
Sam El-Husseini
e3babee1f3 Add Blockly.utils.Metrics @record (#3913)
* Add Blockly.utils.Metrics
2020-05-21 15:03:17 -07:00
Neil Fraser
4e2f8e6e02 Use SPDX licences.
This is a followup to #3127.
At the time, SPDX licenses were pending approval by Google.
2020-02-11 13:27:20 -08:00
Monica Kozbial
835a6120a2 Removing leftover constant MIN_BLOCK_Y in BlockSvg. (#3552) 2020-01-06 16:34:51 -08:00
Beka Westberg
e6e63f456b Fixed bubble dispose (#3430)
* Fixed bubble dispose.
2019-11-12 10:15:16 -08:00
Beka Westberg
8747d5e6b5 Fixed comment event listener disposal. (#3427)
* Fixed listener disposal for comment icons.

* Fixed listener disposal for bubbles.
2019-11-11 17:02:17 -08:00
Rachel Fenichel
13e4d671c3 Moved setHighlighted and setDisabled into the path object. 2019-11-01 14:28:51 -07:00
Sam El-Husseini
6367d5f27a Fix RTL bubble drag (#3356) 2019-10-30 14:15:54 -07:00
Sam El-Husseini
6df85b9ff3 Update mutator workspace delete areas when bubble is moved. (#3355)
* Update mutator workspace delete areas when its moved
2019-10-29 09:10:43 -07:00
Sam El-Husseini
3b25c514c2 Fix warnings related to icons and bubbles (#3308)
* Fix warnings related to bubbles.
2019-10-25 19:14:26 -04:00
Sam El-Husseini
270781113d Fix warnings related to gestures and drag. (#3307)
* Fix warnings related to gestures and drag.
2019-10-22 14:21:00 -04:00
Sam El-Husseini
986e965be8 Private/protected visibility cleanup (#3263)
* Fix a number of private visibility issues
2019-10-16 11:48:09 -05:00
Sam El-Husseini
2ac4149d98 Misc compiler warnings. (#3172)
* Fix misc compiler warnings. Use ws.getToolbox() instead of ws.toolbox_
2019-10-07 11:06:56 -07:00
Rachel Fenichel
79bedca5a7 Element -> SVGElement (#3140)
* Use SVGElement instead of Element for the results of createSvgElement

* More SVGElement annotations.
2019-10-02 16:12:31 -07:00
Neil Fraser
b46a4fe286 Bring our license format up to date (#3127)
* Google changed from an Inc to an LLC.

This happened back in 2017 but we didn’t notice.  Officially we should update files from Inc to LLC when they are changed as part of regular edits, but this is a nightmare to remember for the next decade.

* Remove project description/titles from licenses

This is no longer part of Google’s header requirements.  Our existing descriptions were useless (“Visual Blocks Editor”) or grossly obselete (“Visual Blocks Language”).

* License no longer requires URL.

* Fix license regexps.
2019-10-02 14:46:56 -07:00
Neil Fraser
6650ecf13f Make dynamic variables be an optional module.
Also straighten out some dependencies.
2019-09-27 10:48:14 -07:00
Neil Fraser
6ef84035ca Prevent dataset IDs from being renamed
The JS Compiler would rename ‘id’ and ‘blockId’ to something random.  Normally that would be fine, but if it ended up with a ‘$’ in the name, then that becomes an illegal HTML property name and Blockly crashes.

A bug that’s been lurking in Blockly for years and randomly surfaced on a recent compile.
2019-09-25 19:50:39 -07:00
Rachel Fenichel
269f0dc381 Enable eslint rule spaced-comment
Fix up all remaining violations and turn the rule on.
2019-09-25 16:04:05 -07:00
Beka Westberg
9e5df6216a Fixed comment ownership. (#2923)
* Moved comment icons to use a model-based system. The block holds the model of the comment, and the comment icon holds a reference to it.
* Reorganized the setVisible function.
* Changed how xml.js serializes and deserializes comments.
2019-09-20 13:16:07 -07:00
Rachel Fenichel
b4109d7c43 Add no-multi-spaces rule 2019-07-31 09:33:54 -07:00
Neil Fraser
b8cbd9e7df Resolve 13 warnings
Reduce count from 632 to 619.
Eliminate copy-paste code duplication in Field.prototype.setValue
2019-06-12 10:59:33 -07:00
Neil Fraser
848d3a3509 Move setCssTransform & createSvgElement to dom.
Also move SVG_NS and HTML_NS properties.
2019-06-07 10:32:57 -07:00
Neil Fraser
a9fdf7844a Fix ordering of requires
Search and replace of a name strikes again.
2019-06-07 10:32:57 -07:00
Neil Fraser
3dfac9a2ba Alphabetize require statements.
Search and replace for userAgent didn’t take into account alphabetic ordering.
Also some line wraping.
2019-06-07 10:32:57 -07:00
Neil Fraser
566f182fa8 Move Blockly.userAgent to Blockly.utils.userAgent 2019-06-07 10:32:57 -07:00
Neil Fraser
d1a29739d8 Move utilities into own directory.
TODO: There are more functions which may be migrated into dom and string.
2019-06-07 10:32:57 -07:00
Neil Fraser
5bf7069a2f Remove goog.math.Coordinate 2019-06-07 10:32:57 -07:00