Commit Graph

80 Commits

Author SHA1 Message Date
Monica Kozbial
7b286dbf82 Update the registered component ids (#4898) 2021-06-17 17:50:04 -07:00
Monica Kozbial
ff34e067f8 Update positionable jsdoc (#4908) 2021-06-14 13:14:01 -07:00
Monica Kozbial
0014ad3257 Add id to component interface (#4887) 2021-06-10 16:03:43 -07:00
Monica Kozbial
d2579a7369 Add removeComponent to ComponentManager (#4884) 2021-06-09 22:29:33 -07:00
Monica Kozbial
5344ad6c21 Add support for IAutoHideable (#4855) 2021-05-27 17:01:11 -07:00
Monica Kozbial
1cadbb94bd Rename PluginManager and related elements (#4857)
* Rename PluginManager and related elements to use component instead of plugin

* Rename types to capabilities
2021-05-27 16:14:33 -07:00
Neil Fraser
dd0314bc0b Normalize comments 2021-05-19 09:57:14 -07:00
Monica Kozbial
6259579c64 Add positioning helpers for trashcan and zoom controls (#4807) 2021-05-07 17:13:48 -07:00
Sam El-Husseini
0cc79b1366 Fix missing require - constructors (#4676)
* Fix missing constructors
2021-04-21 12:11:13 -07:00
Monica Kozbial
b6628da5bb Always scroll center on zoom reset (#4725)
* Always scroll center on zoom reset
2021-03-24 10:08:42 -07:00
Monica Kozbial
8386566894 Update IPositionable position JSDoc (#4705) 2021-03-19 16:39:27 -07:00
Monica Kozbial
bea85cda1c Positionables bugfix (#4685)
* Apply fixes to positionable logic

* Update variable name and add @private annotation
2021-03-08 11:20:30 -08:00
Rachel Fenichel
855185c6cf Merge pull request #4682 from rachel-fenichel/toolbox_constants
Use Blockly.utils.toolbox.Position enum everywhere
2021-03-08 10:52:58 -08:00
Monica Kozbial
d4897061d7 Cleanup comment (#4680) 2021-03-05 15:47:00 -08: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
Rachel Fenichel
f7e0d5f4ea Use existing toolbox position enum 2021-03-05 14:16:43 -08:00
Rachel Fenichel
59084a043c TOOLBOX_AT_TOP and friends -> constants.toolboxPosition.TOP, etc 2021-03-05 13:48:45 -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
ef8a5a1fe1 Add PluginManager (#4672)
* Add PluginManager.
2021-03-04 16:51:06 -08:00
Monica Kozbial
f2cec81584 Adding Positionable interface (#4669)
* Adding IPositionable interface.
2021-03-02 16:17:17 -08:00
Sam El-Husseini
f97730e83c Sort requires (#4658)
* Cleanup gulp method to sort requires
2021-02-25 17:17:42 -08:00
Sam El-Husseini
ab8a11784d Fix event related missing requires (#4656)
* Fix event related missing requires
2021-02-25 14:28:11 -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
Rachel Fenichel
54c4e8de39 Rename Blockly.eventHandling->Blockly.browserEvents and replace all Blockly.EventData annotations 2021-02-22 13:23:19 -08:00
Rachel Fenichel
c9be2402bd More missing requires 2021-01-12 12:38:21 -08:00
Monica Kozbial
40ef586260 Refactoring Ui events in core (#4418)
* Ui events base (#4370)

* Add constants for new ui event types

* Add property to indicate an event as UI event

* Click events (#4372)

* Creating new ui base class.

* Refactor theme event (#4391)

* Add themeName property to theme event

* Refactor marker move events. (#4389)

* Refactor trashcan open event (#4392)

* Refactor selected event (#4387)

* Refactor toolbox item change event (#4394)

* Refactor bubble open events (#4390)

* Refactor block drag event (#4388)

* Viewport events (#4395)

* Fix event filtering for ui events (#4401)

* Move events to new directory and rename Ui events base (#4400)

* Move events to new directory and rename Ui events base

* Add missing fromJson implementation for click event (#4410)

* Adding serialization tests for events

* Zoom controls event (#4407)

* Refactor zoom event

* Rename IS_UI_EVENT to isUiEvent
2020-11-04 14:43:54 -08:00
Sam El-Husseini
fba35d342c Add missing require Blockly.constants (#4366) 2020-10-12 17:56:42 -04: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
Monica Kozbial
f8f98831af Add zoom controls tests. (#4159) 2020-08-12 18:39:35 -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
40efb59a34 Unbind event handlers in dispose of zoom controls. (#4031)
* Unbind event handlers in dispose of zoom controls.

* Move event handler references to constructor.
2020-07-10 17:34:53 -07:00
Monica Kozbial
fdd0f4f25f Emit UI event on zoom control clicks. (#4025)
* Emit UI event on zoom control clicks.

* Fix typo

* Update jsdoc for mouse event handlers.
2020-07-10 10:15:09 -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
e5ec726253 Fix type, caught by typings 2019-10-03 14:41:15 -07:00
Rachel Fenichel
78dc82f7ac Misc cleanup: annotations, and flyoutButton disposal. 2019-10-03 10:40:43 -07:00
Rachel Fenichel
79bedca5a7 Element -> SVGElement (#3140)
* Use SVGElement instead of Element for the results of createSvgElement

* More SVGElement annotations.
2019-10-02 16:12:31 -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
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
096959fde9 Cleanup of last fortnight’s commits. (#2865)
No functional changes.
2019-08-19 14:07:48 -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
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
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
Beka Westberg
363ff487a4 Changed trashcan and zoom controls to be positioned in the opposite corner of the toolbox. Fixed trashcan hotspot being incorrect. 2019-01-28 15:24:56 -08:00
Beka Westberg
d2277f0c4b Updated createZoomSVG comments. 2019-01-07 16:04:10 -08:00
Beka Westberg
96e754cf36 Updated Comments. 2018-12-19 18:10:57 -08:00
Beka Westberg
9ee7319ac5 Trashcan/Zoom Anchored to Top when Toolbox is on Bottom. 2018-12-19 10:26:07 -08:00
Rachel Fenichel
261a067a31 Merge pull request #2157 from BeksOmega/feature/TrashcanContents
Added flyout to trashcan to "get back" deleted blocks.`
2018-12-17 15:23:17 -08:00