Commit Graph

112 Commits

Author SHA1 Message Date
Rachel Fenichel
e8d6f7f408 chore: auto-fix violations of comma-dangle rule (#5625) 2021-10-21 09:01:51 -07:00
Aaron Dodson
3851b14627 refactor: Migrate to named exports (#5623)
* refactor: Migrate to named exports

* fix: Sort requires

* fix: Remove duplicate deps
2021-10-20 15:53:23 -07:00
Neil Fraser
90b3f75d82 Remove @author tags (#5601)
Our files are up to a decade old, and have churned so much, that the initial author of the file no longer has much meaning.

Furthermore, this will encourage developers to post to the developer group, rather than emailing Googlers (usually me) directly.
2021-10-15 09:50:46 -07:00
Neil Fraser
c929b3015b chore: Convert == to === and != to !== where possible. (#5599) 2021-10-15 09:17:04 -07:00
Christopher Allen
d2d5dc4b71 fix: Use require instead of requireType for interfaces (#5568)
But only if the interface is used in an @implements or @extends
declaration.

Fixes #5450
2021-09-29 17:44:21 +01:00
Monica Kozbial
49bc2b1ae4 Replace namespace annotation with class annotation in files that define a class (#5566) 2021-09-28 15:57:09 -07:00
Monica Kozbial
d8fbe1b05b Add namespace and alias annotations to jsdoc (#5550)
* Add annotations to files under core/events

* Add annotations to files under core/interfaces

* Add annotations to files under core/keyboard_nav

* Add annotations to files under core/renderers

* Add annotations to files under core/serialization

* Add annotations to files under core/theme

* Add annotations to files under core/toolbox

* Add annotations to files under core/utils

* Add annotations to files under core
2021-09-27 14:42:54 -07:00
Aaron Dodson
e0693a65d2 chore: Remove declareLegacyNamespace() from files in core (#5525)
* chore: Remove declareLegacyNamespace() from files in core

* fix: Update missing/errant re-exports in blockly.js
2021-09-23 14:48:52 -07:00
Rachel Fenichel
3adfaaf6d9 chore: named exports for block* files (#5512)
* chore: named export for block.js

* chore: named export for block_drag_surface.js

* chore: named export for block_dragger.js

* chore: named export for block_svg.js

* Fix import ordering

* chore: fix imports using requireType

* Remove extra require
2021-09-22 08:46:19 -07:00
Beka Westberg
f77526e558 Move browser event utils from utils.js to browser_events.js (#5464)
* fix: move browser event utils to browserEvents

* fix: mark browser event utils in utils as deprecated

* fix: move uses of browser event funcs to browserEvents

* fix: remove browserEvents definition of noEvent

* fix: add renames for browser event utils

* docs: add suggested alternatives for browser event utils

* fix: change deprecations to stubs

* fix: PR comments
2021-09-17 14:49:01 -07: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
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