Commit Graph

104 Commits

Author SHA1 Message Date
Rachel Fenichel 969fcac455 chore: Move functions from utils (#5706)
* chore: move functions from utils to more specific files

* chore: use new names for utils functions

* chore: run clang-format

* chore: add deprecation warnings back to utils.js
2021-11-15 15:59:27 -08: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
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
Monica Kozbial bec82da358 Remove require destructuring (#5294) 2021-08-03 15:07:14 -07:00
kozbial 8b815cd5b1 clang-format core/field_image.js 2021-07-22 17:26:58 -07:00
kozbial 8a934b0e9c Migrate core/field_image.js named requires 2021-07-22 17:26:58 -07:00
kozbial f1882fc218 Migrate core/field_image.js to goog.module 2021-07-22 17:26:58 -07:00
kozbial 60c03cef4f Migrate core/field_image.js to ES6 const/let 2021-07-22 17:26:58 -07:00
Neil Fraser cba7a68207 Allow inheriting of fromJson in fields 2021-07-11 23:19:01 -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 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 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
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 eb40ca44ba Dynamic fonts (#3698)
* Piping themes into the renderer and ensuring fields update their size information when constants change.
2020-02-20 17:16:01 -08: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 f6b5e9ebb4 Add test block for field image with a click handler (#3642) 2020-01-23 16:19:24 -08: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 2224bb2a4e More field dispose (#3201)
* Dispose of element references in fields.
* Fewer warnings
2019-10-15 17:56:53 -05: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
Sam El-Husseini a57c7ffb13 Clean up fields by passing the right type in fromJson (#3095) 2019-09-26 12:03:17 -07:00
Sam El-Husseini 8fae0411f7 Check if a type exists before testing instanceof (#3031)
* Check if a type exists before instance of
2019-09-17 16:28:18 -07:00
Beka Westberg b149aabd16 Image Field Config (#2983)
* Added image field configuration.
2019-09-16 11:05:32 -07:00
Sam El-Husseini f3f3329355 Fix configure method (#2915)
* Fix configure method.
2019-09-12 17:01:03 -07:00
Sam El-Husseini 8ab51c8639 Remove closure base file dependency (#2976)
* Trim down closure's base dependency even further by removing the dependency on closure's base file.
2019-09-11 17:30:51 -07:00
Sam El-Husseini f23b659898 Remove this.text_ (#2910)
* Remove this.text_ and have every field handle its own properties.
2019-08-26 10:56:36 -07:00
Beka Westberg 0872d022e1 Changed utils.fields -> fieldRegistry. Also removed useless tooltip requires. 2019-08-16 09:57:28 -07:00
Beka Westberg cdc90f4059 Refactored field utilities. 2019-08-16 09:57:27 -07:00
Rachel Fenichel ed245a3c9e Remove dealWithOffsetFields 2019-08-06 11:44:03 -07:00
Rachel Fenichel c6463acc70 Cleanup and comments 2019-08-06 11:03:53 -07:00
Rachel Fenichel 3802a0c960 Remove getCorrectedSize for fields 2019-08-05 16:01:50 -07:00
Neil Fraser 45e5fb4157 More JSDoc and lint corrections 2019-07-30 17:00:40 -07:00
Sam El-Husseini 57868e7e83 Remove all calls to goog.math (#2739)
* Replace calls to goog.math.Size and goog.math.Coordinate with Blockly equivelants
2019-07-30 11:22:08 -07:00
Sam El-Husseini 4c626e7b76 Fix setOnClickHandler jsdoc casing (#2730) 2019-07-29 15:29:06 -07:00
Rachel Fenichel 08982ce55e Merge pull request #2668 from BeksOmega/fixes/DeprecateSetText
Deprecated Field.setText
2019-07-26 13:02:35 -07:00
Sam El-Husseini c1b49a1da7 Fix some jsdoc types (#2701)
* Fix JSDoc regarding type inconsistencies. Make image field src required and update image field tests.
2019-07-25 12:24:36 -07:00
Rachel Fenichel 5ab6977c89 Merge branch 'develop' into feature/SetOnClickImage 2019-07-24 14:23:54 -07:00
Rachel Fenichel fc4372dbc2 Add TODOs with github issue number 2019-07-22 16:29:44 -07:00
Beka Westberg ed41b7f900 Added a setOnClickHandler function to the image field. 2019-07-19 09:17:09 -07:00
Beka Westberg 20837da54f Deprecated field setText function. 2019-07-19 08:57:34 -07:00
Rachel Fenichel f469a388ed Add getCorrectedSize functions to fields 2019-07-17 11:00:20 -07:00
Beka Westberg 303115953e Moved to #2125 disposal. Cleaned up some doc. 2019-06-11 13:32:09 -07:00
Beka Westberg 0122f36450 Fixed field disposal, and reorganized editor creation. 2019-06-11 13:30:50 -07:00
Neil Fraser 98a98bcce6 Add Blockly.utils.dom.XLINK_NS
And fix provide/require mixup.
2019-06-07 10:32:57 -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