Commit Graph

158 Commits

Author SHA1 Message Date
alschmiedt
4b5733e7c8 refactor!: allows previously internal constants to be configurable (#5897) 2022-02-09 09:46:34 -08:00
Aaron Dodson
328cd35d10 refactor: Migrate Blockly.Events.Abstract to named exports (#5916) 2022-02-04 15:32:33 -08:00
Rachel Fenichel
efdb6549d9 refactor: convert some classes to es6 classes (#5873)
* refactor: convert flyout_button.js to ES6 class

* chore: move some properties into constructor and add annotations for flyout base

* refactor: convert flyout_horizontal.js to ES6 class

* refactor: convert flyout_vertical.js to ES6 class

* refactor: convert flyout_base.js to ES6 class

* refactor: convert flyout_metrics_manager.js to ES6 class

* refactor: convert insertion_marker_manager.js to ES6 class

* refactor: convert metrics_manager.js to ES6 class

* refactor: convert grid.js to ES6 class

* refactor: convert input.js to ES6 class

* refactor: convert touch_gesture.js to ES6 class

* refactor: convert gesture.js to ES6 class

* refactor: convert trashcan.js to ES6 class

* chore: rebuild and run format

* chore: fix review comments

* chore: respond to PR comments
2022-01-25 15:26:20 -08:00
Rachel Fenichel
df2eafb8dd refactor: move properties into constructors and convert to classes (#5822)
* refactor: move properties to constructor in block_drag_surface.js

* refactor: move properties to constructor in block_svg.js

* refactor: move properties to constructor in block.js

* refactor: move properties to constructor in bubble.js

* refactor: move properties to constructor in connection.js

* refactor: move properties to constructor in flyout_base.js

* refactor: move properties to constructor in flyout_button.js

* refactor: move properties to constructor in generator.js

* refactor: move properties to constructor in grid.js

* refactor: move properties to constructor in input.js

* refactor: move properties to constructor in mutator.js

* refactor: move properties to constructor in scrollbar.js

* refactor: move properties to constructor in trashcan.js

* refactor: move properties to constructor in warning.js

* refactor: move properties to constructor in workspace_audio.js

* refactor: move properties to constructor in workspace_drag_surface_svg.js

* refactor: move properties to constructor in workspace_svg.js

* refactor: move properties to constructor in workspace.js

* refactor: move properties to constructor in zoom_controls.js

* chore: rebuild

* refactor: convert zoom_controls.js to es6 class and format

* refactor: convert workspace_audio.js to es6 class and format

* refactor: convert workspace_dragger.js to es6 class and format

* refactor: convert workspace_drag_surface_svg.js to es6 class and format

* refactor: convert variable_model.js to es6 class and format

* refactor: convert variable_map.js to es6 class and format

* refactor: convert theme.js to es6 class and format

* chore: remove bad comment
2022-01-06 13:13:40 -08:00
Neil Fraser
341dba5965 fix: Prevent error when maxTrashcanContents is 0 (#5739)
* fix: Prevent error when maxTrashcanContents is 0

Resolves #5729.

* Eliminate ’smart’ quotes.
2021-11-30 10:25:16 -08:00
Rachel Fenichel
5deed5a194 chore: fix or ignore remaining lint (#5709)
* chore: fix or ignore remaining lint

* chore: fix bad annotations

* chore: use push for array concatenation

* chore: revert use of spread for array operations
2021-11-17 08:39:00 -08:00
Rachel Fenichel
f70032aaa6 chore: replace more uses of var with const and let (#5628)
* chore: fix uses of var in core/block_dragger

* chore: fix uses of var in core/extensions.js

* chore: fix uses of var in core/field_multilineinput.js

* chore: fix uses of var in assorted core files

* chore: fix uses of var in node test runner and playground screenshot code

* fix: undefined return from measureFontMetrics

* fix: violations of no-const-assign

* chore: only one variable declaration per line
2021-10-25 09:28:31 -07:00
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
Rachel Fenichel
b25e24fd02 chore: Run clang-format on core/*.js (#5589)
* Run clang-format on core/*.js

* Revert changes for css formatting
2021-10-07 10:32:02 -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
alschmiedt
2b34748e0e chore: remove declareLegacyNamespace from events (#5532)
- Adds an extra events/utils.js file to hold helper methods related to events.
2021-09-24 14:20:32 -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
kozbial
6fc90213a6 Merge branch 'develop' into merge-develop-to-goog_module 2021-09-21 16:04:33 -07:00
Beka Westberg
84514efb09 fix: create and delete events, and the trashcan (#5425)
* fix: create and delete events with JSON serialization

* fix: trashcan with JSON serialization

* fix: build

* fix: tests

* fix: PR comments

* fix: types

* fix: tests
2021-09-20 13:08:35 -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
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
ef0fcdbcdd Split Blockly.BlocklyOptions into a separate file 2021-08-05 10:50:44 -07:00
Aaron Dodson
8860db1fd2 clang-format core/trashcan.js 2021-07-30 08:51:51 -07:00
Aaron Dodson
99dfd267f1 Migrate core/trashcan.js to named requires 2021-07-30 08:50:34 -07:00
Aaron Dodson
b3bbd70280 Migrate core/trashcan.js to goog.module 2021-07-29 15:57:08 -07:00
Aaron Dodson
0f193f1f5a Migrate core/trashcan.js to ES6 const/let 2021-07-29 12:17:57 -07:00
Aaron Dodson
3f7f137e00 Fix issue where the trashcan flyout would remain an active delete region even when closed with the continuous toolbox plugin 2021-07-28 15:16:31 -07:00
Rachel Fenichel
cc7a263fb3 Replace references to SPRITE and SOUND_LIMIT with internalConstants versions 2021-07-21 15:33:55 -07:00
Monica Kozbial
7b286dbf82 Update the registered component ids (#4898) 2021-06-17 17:50:04 -07:00
Monica Kozbial
ff34e067f8 Update positionable jsdoc (#4908) 2021-06-14 13:14:01 -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
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
Neil Fraser
e661c92a36 More JSDoc improvements 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
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
Neil Fraser
dd0314bc0b Normalize comments 2021-05-19 09:57:14 -07:00
Monica Kozbial
6259579c64 Add positioning helpers for trashcan and zoom controls (#4807) 2021-05-07 17:13:48 -07:00
Sam El-Husseini
f2f878db8c Fix multiple strict require warnings (#4793) 2021-04-21 16:46:04 -07:00
Sam El-Husseini
0cc79b1366 Fix missing require - constructors (#4676)
* Fix missing constructors
2021-04-21 12:11:13 -07:00
Monica Kozbial
8386566894 Update IPositionable position JSDoc (#4705) 2021-03-19 16:39:27 -07:00
Sam El-Husseini
82a2dd90a7 Use registry to instantiate flyout from trashcan (#4706)
* Instantiate flyouts using registry in trashcan
2021-03-16 08:54:13 -07:00
Monica Kozbial
bea85cda1c Positionables bugfix (#4685)
* Apply fixes to positionable logic

* Update variable name and add @private annotation
2021-03-08 11:20:30 -08:00
Rachel Fenichel
855185c6cf Merge pull request #4682 from rachel-fenichel/toolbox_constants
Use Blockly.utils.toolbox.Position enum everywhere
2021-03-08 10:52:58 -08:00
Monica Kozbial
d4897061d7 Cleanup comment (#4680) 2021-03-05 15:47:00 -08:00