Commit Graph

204 Commits

Author SHA1 Message Date
Beka Westberg 8625a96496 Fixed getRootBlock error. 2019-11-09 07:27:58 -08:00
Rachel Fenichel 611c8b81fe Only log about a missing event group if we actually did something 2019-11-08 15:14:14 -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
Rachel Fenichel 46f323971a Move filter and pattern creation from inject into constants. 2019-11-01 13:32:17 -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 7e82d0d201 Remove @deprecated annotation on Blockly.bindEvent_ (#3333) 2019-10-25 19:15:27 -04: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 2ac4149d98 Misc compiler warnings. (#3172)
* Fix misc compiler warnings. Use ws.getToolbox() instead of ws.toolbox_
2019-10-07 11:06:56 -07:00
Sam El-Husseini e4cc2217e6 Fix compiler warnings related to events. (#3151)
* Fix 23 warnings in event related code.
2019-10-03 15:59:01 -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
Neil Fraser 6650ecf13f Make dynamic variables be an optional module.
Also straighten out some dependencies.
2019-09-27 10:48:14 -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 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
Neil Fraser e43e19d19a Remove three functions deprecated in 2015
We’ve had four years of console warnings, and this next release is known to be breaking.  Each is trivial to fix in code.
2019-09-12 18:04:45 -07:00
alschmiedt ec07a36e44 Update cursor api (#3002)
* Move over to new implementation for cursor
2019-09-11 18:16:05 -07:00
Sam El-Husseini 63f55da379 Remove last bit of closure! (#2858) 2019-08-16 18:39:25 -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
alschmiedt 00be6a6381 Make the navigation namespace lowercase (#2812) 2019-08-13 14:00:49 -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
Beka Westberg 37efbd0559 Fixed jitter when bumping blocks if objects were too large for the workspace. (#2778) 2019-08-12 09:11:27 -07:00
alschmiedt 6dc9a07810 Integrates cursor into develop (#2710)
* Integrates cursor into blockly

* Fix review comments

* Add dispose to cursor

* Fixes dispose functionality

* Remove unnecessary dispose method
2019-07-25 11:14:40 -07:00
Neil Fraser 0213de11bc Use Rect in more places. 2019-06-07 10:32:57 -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
Neil Fraser 775ce34eac Simplify workspace.getBlocksBoundingBox
Previously it returned x,y,width,height.  Returning top,bottom,left,right results in simpler code, both in this function and in downstream callers.

This commit makes the minumum change to the metrics_test.  I’m happy to change the test’s data if that makes more sense.
2019-06-07 10:32:57 -07:00
Neil Fraser 02e9b25f03 Flaten bounding box data structure.
Old: a box object with two coordinate objects, each with two numbers.
New: a box object with four numbers.

The old system would make sense if there was a reason to group the top-left and bottom-right coordinates.  But in our code we only pulled out top/bottom/left/right numbers.

New code is simpler and faster.
2019-06-07 10:32:57 -07:00
Neil Fraser 3dfac9a2ba Alphabetize require statements.
Search and replace for userAgent didn’t take into account alphabetic ordering.
Also some line wraping.
2019-06-07 10:32:57 -07:00
Neil Fraser 566f182fa8 Move Blockly.userAgent to Blockly.utils.userAgent 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 5c614d73c1 Add tests for XY regexs. 2019-05-24 15:45:05 -07:00
Neil Fraser 9f528922a7 Fix some dependencies 2019-05-24 15:45:05 -07:00
RoboErikG 2386038138 Fix bug with in bounds bumping (#2467)
Traced one cause of Mocha tests sometimes failing to blocks being
bumped back into bounds. It looks like a block being moved to be
a child of another block was ended up out of bounds probably
because the size of the workspace isn't set yet. When the change
handler tried to move it back in it would throw an error since you
can't move child blocks with that method.
2019-05-17 17:57:53 -07:00
Neil Fraser 28ad3a9bd3 Blockly.utils.userAgent moved to Blockly.userAgent 2019-05-10 16:56:26 -07:00
Neil Fraser 4062030731 Remove goog.userAgent dependency. 2019-05-10 14:03:21 -07:00
alschmiedt be4da5feeb Reverts hideChaff fix 2019-04-11 11:43:37 -07:00
alschmiedt db7a87555f Hides chaff on document mouseup 2019-04-04 11:24:22 -07:00
Neil Fraser 51bfa9455d More comprehensive approach to gesture detection.
Search all workspaces.  The flaw with looking at the workspace of the selected block is that dragging a workspace is a gesture but has no selected block.
2019-03-29 15:24:37 -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
Rachel Fenichel 47fff5cddb Merge pull request #2313 from rachel-fenichel/feature/dropdowndiv
Add dropdowndiv and use it for the colour picker and angle fields
2019-03-01 12:54:39 -08:00
Rachel Fenichel fd8865bda6 Merge pull request #2311 from BeksOmega/fixes/AbsoluteMetrics
Changed Absolute Metrics to Avoid Simple Toolboxes
2019-03-01 11:01:50 -08:00
Rachel Fenichel c43988873e Don't try to bump if the object has already been deleted. 2019-02-28 17:32:55 -08:00
Beka Westberg d0559a5eeb Fixed scroll event binding to work with multiple workspaces. 2019-02-28 15:43:52 -08:00
Beka Westberg a0aa84d861 Changed absolute metrics to avoid simple toolboxes. 2019-02-23 14:34:26 -08: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
Rachel Fenichel 91408a3238 Add dropdowndiv file 2019-02-21 13:41:45 -08:00
Beka Westberg 0f86d6b69c Fixes block input sticking to the screen when navigated away. 2019-02-21 06:57:20 -08: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