Commit Graph

51 Commits

Author SHA1 Message Date
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
40928634e5 Add some missing requires and requireTypes 2021-01-08 15:03:55 -08:00
Monica Kozbial
637497148d Renaming ui event properties and updating documentation for consistency (#4432)
* Renaming properties and updating documentation for consistency

* Update more properties

* fix tests
2020-11-05 11:40:17 -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
Monica Kozbial
12b5658109 Rename trashcan api calls for open/close lid. (#4110)
* Rename trashcan api calls for open/close lid.

* Update comments.
2020-08-05 12:25:35 -07:00
alschmiedt
b2650e6cef Update availble connections when we have unplugged a block (#3954)
* Update availble connections when we have unplugged a block
2020-06-11 10:50:23 -07:00
alschmiedt
14479fd7e2 Update Toolbox Interface (#3934)
* Update toolbox interface
2020-06-08 09:17:38 -07:00
Neil Fraser
a65afdc189 Simplify Closure-sourced code for menus (#3880)
* Remove cargo-culted bloat from CSS

The `goog-menuitem-icon` and `goog-menuitem-noicon` classes are not present in Blockly.  Blockly doesn’t support the CSS compiler, so #noflip has no effect.  Shorten uncompressible warning string.

Also remove the “Copied from Closure” notes.  These were intended so that the CSS could be easily updated as the Closure Library evolved.  We are no longer linked to the Closure Library.

* Fix bug (in prod) where menu highlighting is lost

Previously, open playground.  Right-click on workspace.  Mouse-over “Add comment” (it highlights).  Mouse over “Download screenshot” (disabled option).  Mouse over “Add comment” (highlighting is lost).

Also remove `canHighlightItem` helper function.  In theory this helps abstract the concept of non-highlightable options.  But in practice it was only called in one of the several places that it should have been.  This was a false abstraction.

* Add support for Space/PgUp/PgDn/Home/End to menus

* Eliminate calls to clearHighlighted

The JSDoc for `setHighlightedIndex` specifically states, “If another item was previously highlighted, it is un-highlighted.”  This is not what was implemented, but it should be.  This commit adds the un-highlighting, and removes all the calls previously required to correct this bug.

* Stop wrapping at top or bottom of menu.

Real OS menus don’t wrap when one cursors off the top or bottom.

Also, replace the overly complicated helper function with a simple 1/-1 step value.

* Remove unused menu code

* Simplify menu roles

Remove unneeded sets to RTL on Menu (only MenuItem cares).

* Fix lack of disposal for context menus.

Context menus only disposed properly when an option was clicked.  If they were dismissed by clicking outside the menu there was no disposal.  This might result in a memory leak.
Also un-extract (inject?) several now trivial functions.

* Remove Component dependency from Menu & MenuItem

Component is now only used by the category tree.

* Remove unused functions in Component

These were used by Menu/MenuItem.

* Fix dependencies.

* Record highlighted menu item by object, not index

Less code, simpler.

* Rename CSS classes goog-menu* to blocklyMenu*

Old classes remain in DOM and are deprecated so that any custom CSS will continue to function.

* Remove unused focus tracker in tree.

* Add support for space/enter to toggle tree cats

* Delete unsettable .isUserCollapsible_ from tree

* Change visibility tags throughout menus.

The previous tags were inherited from Closure and don’t reflect current usage in the Blockly codebase.

The core/components/tree files are non-compliant in this regard, but I’m not going to update them since they need to be replaced and there’s no need to create an interim API change.

* Remove property on DOM element linking to JS obj

Performance is slower (O(n) rather than (O(1)), but ’n’ is the number of entries on the menu, so shouldn’t be more than a dozen or so.

* Fixes a compile error (node != element)

Usually we avoid parentElement in Blockly.  That’s because it has very spotty behaviour with SVG.  But in this case we are in pure HTML.
2020-05-06 23:55:17 -04:00
Sam El-Husseini
14428a0da4 Fix two memory leaks (#3747)
* Fix two memory leaks
2020-03-13 14:49:08 -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
Neil Fraser
123f436e04 Add parens around inline assignments (#3381) 2019-10-31 15:17:35 -07:00
Sam El-Husseini
d387841db2 Resolve remaining compiler warnings with visibility issues (#3335) 2019-10-24 19:13:51 -04:00
Sam El-Husseini
52bef4463c Fix warnings related to connections. (#3306)
* Fix warnings related to connections.
2019-10-23 17:56:52 -04:00
Sam El-Husseini
270781113d Fix warnings related to gestures and drag. (#3307)
* Fix warnings related to gestures and drag.
2019-10-22 14:21:00 -04:00
Navil Perez
c0784a61e7 Linting Fix 2019-10-17 15:23:10 -07:00
Navil Perez
ce4163c7e4 Fix capitalization in the docstring. 2019-10-17 15:13:26 -07:00
Navil Perez
bde1edff85 Add dragStart and dragEnd UI events 2019-10-17 11:41:31 -07:00
Rachel Fenichel
b342a12911 Merge pull request #3155 from rachel-fenichel/trashcan_visibility
Make trashcan setOpen package and update a few annotations.
2019-10-04 15:55:15 -07:00
Rachel Fenichel
79c2fa6688 Make trashcan setOpen package and update a few annotations. 2019-10-03 18:08:27 -07:00
Rachel Fenichel
45d66a1264 Get rid of unnecessary nulls in block dragger, insertion marker manager, and gesture dispose functions. 2019-10-03 17:58:29 -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
Beka Westberg
cdc90f4059 Refactored field utilities. 2019-08-16 09:57:27 -07:00
Neil Fraser
e06d4e648c Rename BlockAnimation > blockAnimation
Issue 2102.  And do a full recompile due to changed the dependency name.
2019-07-08 17:31:38 -07:00
Neil Fraser
a9fdf7844a Fix ordering of requires
Search and replace of a name strikes again.
2019-06-07 10:32:57 -07:00
Neil Fraser
5bf7069a2f Remove goog.math.Coordinate 2019-06-07 10:32:57 -07:00
Neil Fraser
9f528922a7 Fix some dependencies 2019-05-24 15:45:05 -07:00
Neil Fraser
e9de083361 Fix @return JSDocs. 2019-03-29 15:24:37 -07:00
Rachel Fenichel
8e6f39175a Ignore insertion markers in getAllBlocks; add accessors for inseriton markers 2019-01-29 11:57:43 -08:00
Rachel Fenichel
d95f56f546 Enable insertion markers 2019-01-08 11:19:54 -08:00
Rachel Fenichel
e182f43d12 Disable insertion markers for the December 2018 release 2018-12-14 10:57:39 -08:00
Rachel Fenichel
991b70410e Minor cleanup 2018-11-19 12:44:43 -08:00
Rachel Fenichel
17823db4df Fix problem with connecting a statement into a stack, but not a c-shape block 2018-11-14 11:22:57 -08:00
Rachel Fenichel
7d775908b9 Add insertion markers. 2018-11-14 11:18:32 -08:00
Neil Fraser
aa09ad9175 Line wrap at 80. 2018-10-16 11:34:10 -07:00
picklesrus
962fcd5c2e Fix #1959 by calling bring to front when a block drag starts inside a mutator. (#2013) 2018-08-21 12:51:43 -07:00
Neil Fraser
3909bd420a Remove all goog.asserts and goog.isXxx
First step to reducing Closure’s footprint.
2018-07-11 12:20:02 -07:00
Neil Fraser
05fcdc3510 Remove goog.Timer 2018-06-12 14:06:10 -07:00
Andrew n marshall
2c84161b4a Correct require goog.Timer statements. (#1906) 2018-06-06 15:57:53 -07:00
Rachel Fenichel
e6a875bb02 Make event filtering stricter for events 2018-05-24 17:12:00 -07:00
Rachel Fenichel
73e6cf1265 Fix undoing a drag to connect 2018-05-23 14:56:41 -07:00
Rachel Fenichel
46da00dbd3 Merge pull request #1787 from rachel-fenichel/feature/block_animations
Move block animation code to a new file and rebuild
2018-04-18 10:17:43 -07:00
Neil Fraser
662d79443f Add 'ordered' option to descendant getting functions. (#1786) 2018-04-17 11:41:03 -07:00
Rachel Fenichel
4e3b114832 Move block animation code to a new file and rebuild 2018-04-16 15:28:52 -07:00
Sam El-Husseini
3926b3f7aa Heal stack of any of the meta keys are pressed when dragging. Fixes Google/blockly#1485 2018-03-30 14:25:50 -07:00
Rachel Fenichel
d4c3835a5e Fix more compiler warnings 2018-03-14 17:37:32 -07:00
Rachel Fenichel
4c9b602523 Move event classes into separate files, and update requires accordingly 2018-02-27 17:47:33 -08:00
picklesrus
d1886572d0 Fix #1487 and only add the delete cursor if the block is not deletabl… (#1491)
* Fix #1487 and only add the delete cursor if the block is not deletable. Also add a grab cursor when it is not deletable so the cursor keeps the grab hand when over the toolbox.  This changes the toolbox api slightly, but the methods it touches are @package so it should be okay.
2017-12-04 10:36:47 -08:00
marisaleung
aff9c4867c Correctly named block events called. 2017-06-08 15:44:43 -07:00