Commit Graph

133 Commits

Author SHA1 Message Date
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
Sandeep Dubey
ec9092fd67 Changes Css.register API to accept string param (#5472)
* Chnages Css.register API to accept string param

* Address self review comments and nits

* Fix code-comment

* Address minor review comments and nits

* Allow passing an array of strings when registering CSS

* Fix lint errors

Co-authored-by: Aaron Dodson <adodson@google.com>
2021-10-14 15:47:10 -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
ede7e8c18d chore: Remove declareLegacyNamespace() from field_* files 2021-09-23 14:29:56 -07:00
Beka Westberg
96935c2502 fix: cereal backwards compatibility (#5421)
* fix: remove duplicate serialization hook implementations

* feat: add backwards compatibility to field serialization

* feat: add support for serializing old mutator hooks

* fix: build

* fix: refactor field changes into helpers

* fix: typo

* fix: removing xmlns

* tests: add tests for serialization and deserialization of mutator hooks

* fix: switch to early returns
2021-09-20 13:08:35 -07:00
Beka Westberg
8faa360b74 feat: upgrade fields to use new JSO hooks (#5077)
* Upgrade field angle to use new serialization

* Upgrade field checkbox to use new serialization

* Upgrade field colour to use new serialization

* Upgrade field dropdown to use new serialization

* Upgrade serializable label field to use new serialization

* Upgrade field multiline input to use new serialization

* Upgrade field number to use new serialization

* Upgrade field text input to use new serialization

* Upgrade variable field to use new serialization

* Fix type casts

* Feedback from PR

* Switch to use getValue()
2021-09-20 13:08:35 -07: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
Monica Kozbial
bec82da358 Remove require destructuring (#5294) 2021-08-03 15:07:14 -07:00
Aaron Dodson
595f3c0802 clang-format core/field_colour.js 2021-07-21 13:17:10 -07:00
Aaron Dodson
ba30031d36 Migrate core/field_colour.js to named requires 2021-07-21 13:13:31 -07:00
Aaron Dodson
03e1725f32 Migrate core/field_colour.js to goog.module 2021-07-21 13:00:05 -07:00
Aaron Dodson
5f305041a9 Migrate core/field_colour.js to ES6 const/let 2021-07-21 12:57:19 -07:00
Neil Fraser
cba7a68207 Allow inheriting of fromJson in fields 2021-07-11 23:19:01 -07:00
Neil Fraser
c8bea1ff3a Remove return value from Field dropdownCreate_ (#4915)
These functions have side effects and set all kinds of private fields.  It is misleading for them to return the top-level element, for the caller to assign to a private field.
2021-06-18 08:22:25 -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
Neil Fraser
dd0314bc0b Normalize comments 2021-05-19 09:57:14 -07:00
Laura Harker
5ff76ae32d Stop overriding @protected methods with @private (#4760)
An upcoming change to emit private properties in Google's internal version of
https://github.com/angular/clutz will otherwise break any
TypeScript depending on these types. This is because TypeScript errors
on overriding protected with private (Closure Compiler does not).
2021-04-06 11:05:41 -07:00
Sam El-Husseini
63d26dc186 Add extra requires check (#4677)
* Add extra requires check
2021-03-05 09:50:51 -08:00
Sam El-Husseini
f97730e83c Sort requires (#4658)
* Cleanup gulp method to sort requires
2021-02-25 17:17:42 -08:00
Rachel Fenichel
0b09d179ae Merge pull request #4642 from rachel-fenichel/event_data_type
Move bind/unbind events functions to new file, with example usage.
2021-02-25 12:00:22 -08:00
Rachel Fenichel
1d8c234d33 Update uses of bindEvent_, bindEventWithChecks_, and unbindEvent_. Add missing requires for Blockly.browserEvents. 2021-02-23 11:23:28 -08:00
Monica Kozbial
cd8860058e Upgrade closure compiler (#4631)
* Add missing casts

* Update google-closure-compiler version
2021-02-23 11:06:33 -08:00
Rachel Fenichel
54c4e8de39 Rename Blockly.eventHandling->Blockly.browserEvents and replace all Blockly.EventData annotations 2021-02-22 13:23:19 -08:00
alschmiedt
a3adc42e8a Remove keyboard navigation from core (#4593) 2021-01-19 11:50:51 -08:00
alschmiedt
f1498e7f07 Keyboard shortcuts (#4421)
* Adds shortcut registry and removes action and key map (#4398)

* Adds Shortcut tests and refactored navigation tests (#4412)

* Adds shortcut items (#4408)

* Add shortcuts for navigation (#4409)

* Add final keyboard shortcut cleanup (#4413)
2020-11-02 13:30:05 -08:00
Monica Kozbial
4ac4332f5e Update logic for field default values. (#3953)
* Update logic for field default values.

* Fix bugs

* Use contant for default value.

* Fix FieldColour

* Update field number tests.

* Update field angle test.

* Minor update.

* Update field checkbox test.

* Undo enabling logging

* Remove only.

* Update field colour test.

* Update invalid test cases for field colour

* Update field label tests

* Update field textinput test.

* Minor cleanup

* Make lint happy.
2020-06-12 15:18:28 -07:00
Sam El-Husseini
1052f7548b Enable unusedPrivateMembers check (#3924)
* Add unusedPrivateMembers check
2020-05-28 17:44:16 -07:00
Sam El-Husseini
06f6c22a27 Fix field colour in headless (#3795) 2020-04-03 14:36:19 -07:00
Sam El-Husseini
13ac939b91 Support passing renderer overrides in options (#3734)
* Support passing in renderer options through workspace options.
2020-03-10 18:36:29 -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
Sam El-Husseini
917f58ab0f Fix bugs with apply colour (#3483) 2019-12-03 13:22:41 -08:00
Sam El-Husseini
2a8e7d9ac8 [zelos] Full field colour (#3461)
* Support showing the colour value on the entire block.
2019-11-22 13:50:33 -08:00
Sam El-Husseini
2dea7038d5 Moves field layout constants into the renderer (#3437)
* Add field constants into renderer constants
2019-11-13 16:41:35 -08:00
Beka Westberg
dad8738e75 Cleaned up unbindEvent_ calls (#3429)
* Cleaned up unbindEvent_ calls.
2019-11-12 10:14:31 -08:00
alschmiedt
40bdfac017 Fix setting focus for workspace (#3425)
* Fix setting focus for workspace
2019-11-11 16:44:58 -08:00
Neil Fraser
013f2714a3 Cleanup aria usage. (#3261)
Use enums instead of arbitrary strings.
Delete unused Aria properties
Add missing requires.
Delete unused code.
2019-10-15 22:43:23 -07:00
Sam El-Husseini
2224bb2a4e More field dispose (#3201)
* Dispose of element references in fields.
* Fewer warnings
2019-10-15 17:56:53 -05:00
Beka Westberg
f4f9a67903 Fixed field editor disposal (#3109)
* Fixed field editor disposal.
2019-10-08 16:48:31 -07:00
Sam El-Husseini
1d113b5069 Add support for setting the direction in RTL. (#3192) 2019-10-07 17:28:18 -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
Sam El-Husseini
fba98fca5b Move the dropdown field into the dropdown div. (#3122)
* Move the dropdown field into the dropdown div.
2019-10-03 14:35:28 -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
Sam El-Husseini
a57c7ffb13 Clean up fields by passing the right type in fromJson (#3095) 2019-09-26 12:03:17 -07:00
Neil Fraser
75cf614104 Break CSS into modules. (#3084)
* Break CSS into modules.

Drops the compile test by 3 KB.
Remove obsolete .blocklyDraggable class stub (it used to be dynamically changed).
Remove unused menuseparator CSS.
2019-09-25 18:01:19 -07:00
Neil Fraser
b84cda2c76 Strip out more bloat from toolbox (#3068)
Also removes three private accesses from workspaceSvg into toolbox tree.

The strategy for workspace.updateToolbox is no longer to clear and repopulate the toolbox, but rather to throw away the old toolbox and rebuild a new one.  This is simpler and more reliable.

This commit trims off another KB from the compiled code.
2019-09-23 15:18:32 -07:00
alschmiedt
c16ea62b58 A bunch of small bug fixes (#3067) 2019-09-23 08:59:50 -07:00
Neil Fraser
28953d8ea0 Simplify Blockly.utils.IdGenerator
Also drop unused menu highlight hook.
2019-09-20 10:36:06 -07:00