Commit Graph

166 Commits

Author SHA1 Message Date
Sam El-Husseini
55997784ca Move blockStyles into constants (#3485)
* Move blockStyles into constants.
2019-12-06 10:51:36 -08:00
Rachel Fenichel
13e4d671c3 Moved setHighlighted and setDisabled into the path object. 2019-11-01 14:28:51 -07:00
Neil Fraser
123f436e04 Add parens around inline assignments (#3381) 2019-10-31 15:17:35 -07:00
alschmiedt
cbf867f441 Add keyboard navigation support for multiple workspaces (#3352)
* Add keyboard navigation support for multiple workspaces
2019-10-28 12:53:51 -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
3c2c4677df Fix 55 warnings related to flyouts. (#3211)
* Fix 55 warnings related to flyouts.
2019-10-16 12:13:37 -05: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
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
alschmiedt
468b673b73 Fix bugs (#3108)
* Fix various bugs around keyboard nav
2019-09-27 14:34:28 -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
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
Rachel Fenichel
269f0dc381 Enable eslint rule spaced-comment
Fix up all remaining violations and turn the rule on.
2019-09-25 16:04:05 -07:00
Neil Fraser
a03660243e Code cleanup, drop some CSS.
Random improvements to require statements.

Removal of some obviously dead CSS.

.blocklyDropDownDiv no longer supresses text selection (see comment in PR).

This PR drops the compiled size by 4 KB, which is larger than I was expecting.
2019-09-25 10:34:34 -07:00
Neil Fraser
ddb8e46b87 Make flyouts be optional modules.
No Blockly instances need both Horizontal and Vertical flyouts.  Dropping one of these saves 2 KB.  Some don’t need flyouts at all (e.g. Blockly Games Puzzle or readonly documentation blocks).
2019-09-23 22:02:59 -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
f3b4fc0732 Fix interaction between mouse and keyboard (#3070) 2019-09-23 11:07:59 -07:00
Neil Fraser
fb17b0276d Remove unused CSS classes. 2019-09-20 10:36:06 -07:00
Sam El-Husseini
cb564053b3 Merge toolbox navigation (#3054)
* Merge both types of keyboard navigation (with and without accessibility mode).
2019-09-19 16:36:39 -07:00
Sam El-Husseini
e339ae26bc Move the rendering object to live on the workspace_svg (#3016)
* Move the rendering object onto the workspace allowing the various workspaces to have different renderers.
2019-09-13 14:20:34 -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
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
Neil Fraser
096959fde9 Cleanup of last fortnight’s commits. (#2865)
No functional changes.
2019-08-19 14:07:48 -07:00
Sam El-Husseini
f118d6de88 No closure toolbox (#2819)
* Update the toolbox to not rely on closure and instead use the built in Blockly.tree component
2019-08-14 13:48:21 -07:00
Neil Fraser
aca1a43ec8 Fix regular expressions.
1) Simplifications.
2) Enable toolbox category colours to be specified using the full range of CSS formats (not just hue or #rrggbb).
3) Fix bug where `Blockly.utils.checkMessageReferences('%{BKY_today}  %{BKY_xxx}')` returns true.
2019-06-10 11:03:22 -07:00
Neil Fraser
6947010c49 Change Rect to use top/bottom/left/right
Instead of top/left/height/width.  Given our uses of Rect, it makes the math slightly simpler.

This is a setup for using Rect in other places.  Currently it is only used to describe delete areas.
2019-06-07 10:32:57 -07:00
Neil Fraser
d1a29739d8 Move utilities into own directory.
TODO: There are more functions which may be migrated into dom and string.
2019-06-07 10:32:57 -07:00
Neil Fraser
f2c57dea1b Remove goog.math.Rect dependency 2019-06-07 10:32:57 -07:00
Neil Fraser
e8d8798ecf Remove goog.events.BrowserFeature dependency. 2019-06-07 10:32:57 -07:00
Neil Fraser
069423e7cd Remove last traces of goog.color. 2019-06-05 16:41:04 -07:00
Neil Fraser
ed9330cf57 Move Blockly.hueToRgb to Blockly.utils.colour
Also adds support for ‘#f00’, ‘rgb(255, 0, 0)’ and ‘red’ for block colours, in addition to ‘#ff0000’ (and of course hue).
2019-06-05 16:41:04 -07:00
Neil Fraser
dce0b77424 Fix 19 warnings in theme-related code. (#2523)
* Fix 19 warnings in theme-related code.

Resolves #2414

* Remove suppressPrefixSuffix property definition

The mixin code throws an error if property exists on both objects.

* eslint has strange ideas about indentation.
2019-05-30 10:05:06 -07:00
Neil Fraser
9f528922a7 Fix some dependencies 2019-05-24 15:45:05 -07:00
Neil Fraser
25bc3e0268 Fix require statements.
Also throw error instead of string.
And stop using goog.asserts.
2019-05-17 15:04:39 -07:00
Neil Fraser
25adb40e66 Prefix and suffix edge cases for flow statements.
Call suffix code on break/continue before executing the break/continue.
Call prefix code for enclosing loop before executing continue.
2019-05-14 17:19:31 -07:00
Beka Westberg
9a9c6612f8 Changed buttons and labels to respect <sep> elements in toolbox. (#2395) 2019-04-22 12:23:04 -07:00
Neil Fraser
405b1e4e78 Lint issues found while debugging. 2019-03-27 15:47:29 -07:00
alschmiedt
715fdde945 Reverts changes to fix bug with selecting dropdown 2019-03-12 10:39:09 -07:00
amber-cd
c2f30d4ca6 Update toolbox.js
Changed style attribute to categorystyle.
2019-03-05 08:39:20 -05:00
Beka Westberg
7e3bff2552 Readded the toolbox click subscriber. Added preventing propagation to the toolbox click subscriber. Added clearing touch identifier to the document click subscriber. 2019-02-21 14:57:19 -08:00
Beka Westberg
0f86d6b69c Fixes block input sticking to the screen when navigated away. 2019-02-21 06:57:20 -08:00
alschmiedt
40a1ae752b Adds support for category styles 2019-01-09 11:18:44 -08:00
Neil Fraser
aa09ad9175 Line wrap at 80. 2018-10-16 11:34:10 -07:00
Andrew n marshall
411ec9724e Replacing node.parentNode.removeChild(node)
...with Blockly.utils.removeNode(..), which includes
a null/undefined check on parentNode before continuing.
2018-09-04 13:31:53 -07:00
Neil Fraser
c6afb08c4b Add unit tests and code cleanup to utils (#1993)
* Add unit tests for new util functions
* Utils functions shouldn’t be package, not private.
* Use existing utility function for insertAfter
2018-08-03 14:31:50 -07:00
Neil Fraser
6ce31942e0 Some goog.dom removal (#1991) 2018-08-01 15:47:28 -07:00
Neil Fraser
ac2fa96d7f Replace goog.dom.createDom for creating HTML 2018-07-11 12:20:02 -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
c51cf0b79c Remove goog.dom.removeNode 2018-07-11 12:20:02 -07:00
Neil Fraser
284b79407e Require Blockly.utils where needed. 2018-07-11 12:20:02 -07:00
Neil Fraser
eea2794e38 Remove goog.dom.TagName 2018-07-11 12:20:02 -07:00