Commit Graph

69 Commits

Author SHA1 Message Date
kozbial
9354670828 clang-format core/options.js 2021-08-05 10:50:44 -07:00
kozbial
d8bc82fa1c Migrate core/options.js named requires 2021-08-05 10:50:44 -07:00
kozbial
468360873f Migrate core/options.js and core/blockly_options.js to goog.module 2021-08-05 10:50:44 -07:00
kozbial
de92fe9cb8 Migrate core/options.js to ES6 const/let 2021-08-05 10:50:44 -07:00
kozbial
ef0fcdbcdd Split Blockly.BlocklyOptions into a separate file 2021-08-05 10:50:44 -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
Monica Kozbial
f837f1e44e Add zoom support for single-direction-scroll (#4653)
* Add zoom support for single-direction scroll
2021-03-05 14:37:41 -08:00
Sam El-Husseini
63d26dc186 Add extra requires check (#4677)
* Add extra requires check
2021-03-05 09:50:51 -08:00
Monica Kozbial
4844a1038c Adding single-direction scroll options to inject options (#4651)
* Adding single directions scroll config to inject options
2021-03-03 12:29:10 -08:00
Sam El-Husseini
f97730e83c Sort requires (#4658)
* Cleanup gulp method to sort requires
2021-02-25 17:17:42 -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
alschmiedt
3d698f4bcc Block factory fix (#4327) 2020-09-28 10:42:45 -07:00
alschmiedt
bdfdb2ece5 Fix jsdoc errors and warnings (#4309) 2020-09-23 13:26:58 -07:00
Maribeth Bottorff
f6688d0339 Convert toolbox position to enum (#4284)
Convert toolbox position to enum
2020-09-16 10:54:17 -07:00
Sam El-Husseini
d70d896a9f Fix field registry typings (#4281)
* Fix field registry types
2020-09-16 09:10:41 -07:00
alschmiedt
d01169fa79 Toolbox Rewrite (#4223)
Rewrite the toolbox in order to get rid of old closure code and make it easier to extend.

Co-authored-by: Maribeth Bottorff <maribethb@google.com>
2020-09-02 08:13:07 -07:00
Sam El-Husseini
4a2b0b583c Add option sub types (#4096)
* Add option types
2020-08-03 12:33:07 -07:00
Sam El-Husseini
9e7f3b07e9 Advanced compilation fixes (#3995)
* Advanced compilation fixes
2020-06-25 11:59:03 -07:00
Sam El-Husseini
60ea4cc106 Merge branch 'master' into develop 2020-06-11 13:19:47 -07:00
Sam El-Husseini
d6ad7c488b Add theme registry: 2020-06-04 17:56:56 -07:00
alschmiedt
00df97a59d Add plugin options (#3922)
* Adds a plugin through options

* Fix requires

* Fix pr comments
2020-05-29 13:22:25 -07:00
Sam El-Husseini
e3babee1f3 Add Blockly.utils.Metrics @record (#3913)
* Add Blockly.utils.Metrics
2020-05-21 15:03:17 -07:00
alschmiedt
d0e91a15a2 Toolbox definition (#3891)
* Add support for creating a toolbox with JSON
2020-05-13 08:16:53 -07:00
Sam El-Husseini
52b818ed67 Use the theme name if it exists (#3843) 2020-04-29 14:32:26 -07:00
Sam El-Husseini
12c8a50a0f Update the options object to reflect its properties, update the public option interface to include keymap and other little things (#3826) 2020-04-15 17:51:57 -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
Sam El-Husseini
a9e10807ca Support extending themes with a base theme property. (#3731)
* Support extending themes with a base theme property.
2020-03-10 10:30:13 -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
6dbb023a1d Fixing path typo. (#3663) 2020-01-27 11:19:21 -08:00
Sam El-Husseini
70f42b3395 Fix parsing and passing of workspace options around Blockly (#3616) 2020-01-21 13:29:03 -08:00
Monica Kozbial
c84ee46a89 Setting default options in workspace constructor. (#3592)
* Setting default options in workspace constructor.

* Changing logic for parsing workspace options.

* Adding gridPattern declaration to options and updating options handling for workspace.

* Addressing PR comments.

* Moving objects to constructor.

* Using constructor instead of casting for Blockly.Options.

* fix eslint

* Adding types.

* Change in type.

* eslint fix.

* Fix typings.
2020-01-17 15:16:20 -08:00
Neil Fraser
5b46652e90 Restore support for 0-length grid lines.
Resolves #3503
2019-12-11 01:24:51 -08:00
Neil Fraser
a15d9611d0 Add missing requires. 2019-11-12 13:15:06 -08:00
Sam El-Husseini
fdc50f2cd0 Add the theme name to the injection div (#3413)
* Set the theme name as a class on the injection div.
2019-11-07 15:19:58 -08:00
Sam El-Husseini
0f659b25fa Support workspace theme option as JSON (#3379)
* Allow passing in a theme as JSON
2019-10-31 15:49:48 -07:00
Monica Kozbial
17af987de0 Adding pinch zoom config option. (#3317)
* Adding pinch zoom config option.
2019-10-25 16:45:55 -07:00
Sam El-Husseini
4f02ceeba0 Make Blockly options an interface (#3312)
* Make workspace options an interface so it can be extended in the d.ts.
2019-10-22 14:20:26 -04:00
Sam El-Husseini
e07a3f03a9 Fix 14 warnings related to workspace svg (#3273)
* Fix warnings related to workspace svg
2019-10-17 15:06:22 -05: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
870824bc3e Workspace theme (#3093)
* Move the theme object so it's on the workspace.

* Add support for subscribing UI elements to theme component styles and changes.
2019-09-26 16:52:17 -07:00
Sam El-Husseini
fc420b7037 Support for registering renderers and switching between them (#3013)
* Added support for registering renderers and for choosing which renderer the workspace wants to use.
2019-09-13 10:30:20 -07:00
alschmiedt
74fa3bb71a Initial commit for changing key mappings (#2787)
* Added ability to easily change key mappings
2019-08-13 13:37:01 -07:00
Neil Fraser
e77a9b7e81 Change parseFloat() to Number()
Number() is a bit less forgiving than parseFloat() and is more likely to generate NaN rather than some random number.  An audit of each case shows nowhere that parseFloat()’s features are needed.
2019-08-01 11:36:58 -07:00
Beka Westberg
5a4cc7ae12 Removed textToDom Needing <xml> Documents (#2585)
* Removed textToDom needing <xml> documents.

* Fixed jsdoc.

* Followon changes resulting from lack of XML tag.

* Fix Mocha test.
2019-06-24 15:50:06 -07:00
Neil Fraser
b8cbd9e7df Resolve 13 warnings
Reduce count from 632 to 619.
Eliminate copy-paste code duplication in Field.prototype.setValue
2019-06-12 10:59:33 -07:00
Neil Fraser
405b1e4e78 Lint issues found while debugging. 2019-03-27 15:47:29 -07:00
Beka Westberg
9dec2da5c5 Movement Updates (#2247)
This is a squash and merge of a large set of changes by @BeksOmega 

* Added functionality to scrolling, dragging, and zooming.

* Fixed incorrect changes to workspaceChanged function.

* Fixed comment.

* Fixed typo.

* Removed scrollbar.set calls from workspace_svg.

* Removed scrollbar.resize() call.

* Added move options to playground.

* Fixed scroll_ calls that replaced scrollbar.set calls.

* Removed this.scrollbar checks.

* Changed zoom so that it always zooms towards the coordinates. Changed isContentBounded_ to be separate from isMovable_ (b/c of the previous change zoomControls had to be added to the bounded check). Fixed scroll_() calls... again.

* Changed procedures so the Highlight definition option is only available if the workspace is moveable.

* Fixed scrollCenter so that it works with flyout toolboxes.

* Fixed zoomToFit so that it works with horizontal flyout toolboxes.

* Fixed Typo.

* Fixed bumping blocks when the workspace is not movable.

* Fixed bumping not working with left and top toolbox positions.

* Re-Added not allowing scrollCenter if the workspace is not movable. Disabled scrollCenter button for this case.

* Cleaned up formatting.

* Fixed bumping... again. Reformatted workspaceChanged a bit.

* Changed blocks to be completely bumped into the workspace.

* Reorganized metrics-getting for workspaceChanged.

* Added bumping workspace comments. Moved event checking.

* Renamed workspaceChanged to bumpObjects.

* Added a bumpObjects developer reminder.

* Added warning to zoomToFit.

* Cleaned up some text.

* Added better inline documentation.

* Fixed up inline docs.

* Cleaned up comments.

* Fixed zoomCenter not actually zooming towards the center.

* Fixed zoomControls error on unmovable bottom-toolbox workspaces

* Fixed programatically placing blocks in an unmovable workspace.

* Removed unnecessary translate call in inject.

* Reversed removal of translate. (apparently it was necessary)

* Cleaned up code in response to first round of reviews.

* Added unit comments to the zoom function.

* Removed bumpObjectsEventChecker. Added BUMP_EVENTS list to Blockly.Events.

* Changed getWorkspaceObjectMetrics call to getBoundingRectangle().

* Fixed utils.mouseToSvg (was causing problems with zoom on wheel if the page was scrolled).

* Fixed zoom when page is scrolled (actually this time). Reverted changes to utils.mouseToSvg.

* Fixed centerOnBlock.

* Added unit docs to translate. Moved setting the grid position to the translate function.

* Added TODO's.
2019-02-18 15:28:51 -08:00
alschmiedt
0d78f1dcd5 Fixing compiler error for blockly themes 2019-01-11 14:28:49 -08:00
alschmiedt
f480b1ff79 Changes Blockly style to be Blockly theme. 2019-01-08 11:40:57 -08:00