Commit Graph

79 Commits

Author SHA1 Message Date
Christopher Allen
c0d22f2002 refactor: Rename ALIGN to Align and move from constants.js to input.js (#5742)
This constant is used to specify the alignment of
an Input, so it should live in the same file as the Input class.

I've done this as a separate named export, but it could alternatively
be made a static member of Input (i.e., Input.Align with only Input
being exported by name).

Where mocha tests were referring to Blockly.constants.ALIGN.*
without actually requiring Blockly.constants, I have reverted
them to refer to Blockly.ALIGN_* instead (pending conversion
to named requries).

Part of #5073.
2021-11-29 21:59:48 +00:00
Neil Fraser
fa47c3c4a8 Normalize ++x to x++. (#5660)
There are only 10 instances of ++x in our codebase, compared with over 500 instances of x++.  The stlye guide has no opinion on which to use, nor do I.  But the lack of consistency was making regex searches for bugs more difficult.
2021-11-02 09:22:11 -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
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
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
Aaron Dodson
761eec2b69 clang-format core/input.js 2021-07-23 09:56:17 -07:00
Aaron Dodson
f59da974b4 Migrate core/input.js to named requires 2021-07-23 09:55:41 -07:00
Aaron Dodson
f96c14c003 Migrate core/input.js to goog.module 2021-07-23 09:51:25 -07:00
Aaron Dodson
2aff67498b Migrate core/input.js to ES6 const/let 2021-07-23 09:49:13 -07:00
Rachel Fenichel
cf7a8b95b8 Remove extra requires of Blockly.constants 2021-07-21 15:35:19 -07:00
Neil Fraser
861a981cb6 Remove extra else clauses 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
alschmiedt
fe41814958 Fix missing dependency (#4722) 2021-03-24 13:08:20 -07:00
alschmiedt
9a93ca486f Fix advanced compilation tests for Q1 2021 release (#4709) 2021-03-17 15:46:17 -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
750b62030b First pass at creating connectionTypes and inputTYpes 2021-03-04 10:22:24 -08:00
Rachel Fenichel
4e31deca2b Align constants -> Blockly.constants.ALIGN enum 2021-02-26 11:12:53 -08:00
Rachel Fenichel
c449a3ec6c Fix missing requires in input and xml 2021-02-09 14:41:58 -08:00
Beka Westberg
87f4799be7 Remove last FieldLabel call and fix adding dummy inputs to json (#4601)
* Change insertFieldAt to use registry

* Fix adding dummy input for non field_ prefixed fields

* Remove bad new keyword

* Add type cast
2021-02-05 16:03:32 -08:00
Sam El-Husseini
fba35d342c Add missing require Blockly.constants (#4366) 2020-10-12 17:56:42 -04:00
Monica Kozbial
ab5a51e2a4 Revert "Don't render children of collapsed blocks (#4264)" (#4300)
This reverts commit 96e8fc794e.
2020-09-21 10:40:01 -07:00
Monica Kozbial
96e8fc794e Don't render children of collapsed blocks (#4264)
* Partially revert collapsed block changes and add additional handling for setting children of collapsed blocks to not rendered

* Improve performance by checking if child is rendered in updateDisabled
2020-09-18 16:08:39 -07:00
Beka Westberg
c732484180 Add programmatically setting shadows Take 2 (#4215)
* Add programmatically setting shadows
2020-09-08 08:50:01 -07:00
Sam El-Husseini
af571e27df Call apply colour when inserting a field to a block that has already been renderered (#4183) 2020-08-17 14:08:03 -07:00
alschmiedt
4335bb6452 Add opt quiet to remove field (#3968)
* Add opt quiet to remove field
2020-06-12 14:18:28 -07:00
Sam El-Husseini
c9563c1d24 Revert "Add programmatically setting shadows (#3902)"
This reverts commit 3aa1963be8.
2020-06-12 08:54:04 -07:00
Sam El-Husseini
b84d25fe2d Strict types in input (#3912)
* Strict types in input.js
2020-05-21 17:57:13 -07:00
Beka Westberg
3aa1963be8 Add programmatically setting shadows (#3902)
* Add programmatically setting shadows
2020-05-21 11:44:08 -07:00
Beka Westberg
9e98df9949 Fix collapsed blocks not updating when modified (#3806)
* Stop recursive render calls

* Fix visibility bugs.

* Make toString ignore collapsed input.

* Add automatic collapse rendering handling

* Fix insertion markers with collapsed

* Add tests

* Fix build?

* PR comments

* Add missing jsdoc
2020-04-16 13:02:05 -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
Neil Fraser
123f436e04 Add parens around inline assignments (#3381) 2019-10-31 15:17:35 -07:00
Sam El-Husseini
bfe62f98ca Dispose makes the types we use inconsistent. Suppress checkTypes in dispose. (#3336) 2019-10-24 15:47:42 -04:00
Rachel Fenichel
608ce7b93c Merge pull request #3133 from BeksOmega/fixes/ConnectionTracking
Connection Tracking Pt 3: Changed connections to use 'tracked_' property
2019-10-07 11:05:10 -07:00
Sam El-Husseini
d0772ad496 Fix compiler warnings related to fields. (#3144)
* Fix compiler warnings related to fields.
2019-10-03 15:58:46 -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
Beka Westberg
5aaab251a3 Changed all other known 'hiding' references to 'tracking'. 2019-10-01 19:02:02 -07:00
Beka Westberg
1baf7d1dcf Added a bunch of connection related tests. 2019-09-27 15:56:29 -07:00
Sam El-Husseini
494487b37f Mark fields as dirty when the workspace becomes visible. (#3072)
* Mark fields as dirty when the workspace becomes visible.
2019-09-23 11:21:45 -07:00
Beka Westberg
e05e26ab45 Fixed insertFieldAt (#2939)
* Fixed insertFieldAt.
* Updated tests to reflect upcomming config changes.
2019-09-16 11:11:18 -07:00
Abby
1c26b6d79b Adds helper functions for keyboard nav 2019-07-24 11:42:37 -07:00
Beka Westberg
5c4c816a9b Removed setVisible from the public API (#2406) 2019-04-24 16:07:47 -07:00
Neil Fraser
aa09ad9175 Line wrap at 80. 2018-10-16 11:34:10 -07:00
Neil Fraser
dce60fd152 Replace ReferenceError with Error.
Change to 4-space indentation rather than aligning with parent structure.
2018-07-11 12:20:02 -07:00
Neil Fraser
3909bd420a Remove all goog.asserts and goog.isXxx
First step to reducing Closure’s footprint.
2018-07-11 12:20:02 -07:00