Commit Graph

128 Commits

Author SHA1 Message Date
kozbial
50f7293f2d Migrate core/keyboard_nav/marker.js named requires 2021-07-28 10:52:20 -07:00
kozbial
014316431e Migrate core/keyboard_nav/marker.js to goog.module 2021-07-28 10:52:20 -07:00
kozbial
3837440564 Migrate core/keyboard_nav/marker.js to ES6 const/let 2021-07-28 10:52:20 -07:00
kozbial
fabba95beb Adding blocks to case statements in core/keyboard_nav/ast_node.js 2021-07-27 15:34:50 -07:00
kozbial
d9edeca432 Update for loop syntax in core/keyboard_nav/ast_node.js 2021-07-27 15:34:50 -07:00
kozbial
02f1055c44 Add eslint disable lines to core/keyboard_nav/ast_node.js 2021-07-27 15:34:50 -07:00
kozbial
c19ce37a4a clang-format core/keyboard_nav/ast_node.js 2021-07-27 15:34:50 -07:00
kozbial
e79faf4147 Migrate core/keyboard_nav/ast_node.js named requires 2021-07-27 15:34:50 -07:00
kozbial
ec06ea6586 Migrate core/keyboard_nav/ast_node.js to goog.module 2021-07-27 15:34:50 -07:00
kozbial
e6bd6cabb1 Migrate core/keyboard_nav/ast_node.js to ES6 const/let 2021-07-27 15:34:50 -07:00
Aaron Dodson
ee565f16d6 Silence unused variable warnings for requires used in JSDoc 2021-07-22 10:41:55 -07:00
Monica Kozbial
c6650f0b83 Remove need for require instead of requireType for Block in ASTNode (#5157) 2021-07-21 16:53:08 -07:00
Rachel Fenichel
cf7a8b95b8 Remove extra requires of Blockly.constants 2021-07-21 15:35:19 -07:00
kozbial
ecec6daf80 clang-format core/keyboard_nav/tab_navigate_cursor.js 2021-07-21 10:26:15 -07:00
kozbial
9a6a92bf52 Migrate core/keyboard_nav/tab_navigate_cursor.js named requires 2021-07-21 10:26:15 -07:00
kozbial
f282c57323 Migrate core/keyboard_nav/tab_navigate_cursor.js to goog.module 2021-07-21 10:26:15 -07:00
kozbial
9d6cbe96d3 Migrate core/keyboard_nav/tab_navigate_cursor.js to ES6 const/let 2021-07-21 10:26:15 -07:00
kozbial
c9f2a92ace Migrate core/keyboard_nav/cursor.js named requires 2021-07-20 10:58:08 -07:00
kozbial
e50c60bfdb Migrate core/keyboard_nav/cursor.js to goog.module 2021-07-20 10:58:08 -07:00
kozbial
317a2e6f53 Migrate core/keyboard_nav/cursor.js to ES6 const/let 2021-07-20 10:58:08 -07:00
kozbial
2ef8b2c86b clang-format core/keyboard_nav/basic_cursor.js 2021-07-20 10:42:03 -07:00
kozbial
4a3d67abeb Migrate core/keyboard_nav/basic_cursor.js named requires 2021-07-20 10:42:03 -07:00
kozbial
29cfb470aa Migrate core/keyboard_nav/basic_cursor.js to goog.module 2021-07-20 10:42:03 -07:00
kozbial
09b020e62f Migrate core/keyboard_nav/basic_cursor.js to ES6 const/let 2021-07-20 10:42:03 -07:00
Sam El-Husseini
63d26dc186 Add extra requires check (#4677)
* Add extra requires check
2021-03-05 09:50:51 -08:00
Rachel Fenichel
1c372188de Fix tests 2021-03-04 10:23:20 -08:00
Rachel Fenichel
7f8c875b29 Fix lint 2021-03-04 10:23:20 -08:00
Rachel Fenichel
750b62030b First pass at creating connectionTypes and inputTYpes 2021-03-04 10:22:24 -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
9c5521122c Fix keyboard nav requireTypes 2021-02-17 11:45:33 -08:00
alschmiedt
efdcb89b5c Register cursors (#4599) 2021-01-21 16:01:31 -08:00
alschmiedt
a3adc42e8a Remove keyboard navigation from core (#4593) 2021-01-19 11:50:51 -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
edbd6991b4 Small fixes to the toolbox (#4380) 2020-10-19 09:43:41 -07:00
Sam El-Husseini
fba35d342c Add missing require Blockly.constants (#4366) 2020-10-12 17:56:42 -04: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
Rachel Fenichel
809148b435 Fix compiler errors 2020-07-16 17:40:13 -06:00
Rachel Fenichel
7288c66294 Rename connectionTypeChecker->connectionChecker 2020-07-16 17:40:13 -06:00
Rachel Fenichel
e24f3cef9b Add isDragging to canConnectWithReason and delete newly unused code paths. 2020-07-16 17:40:13 -06:00
Rachel Fenichel
e3c8d834cb Add todos and rebuild 2020-07-16 17:40:13 -06:00
Rachel Fenichel
bb8348befd Move to a single canConnect function, and update tests 2020-07-16 17:40:12 -06:00
Rachel Fenichel
c743a92bb9 Start work on connection type checker 2020-07-16 17:40:12 -06:00
Monica Kozbial
9d4b9884fe Fixing JSDoc syntax errors. (#3993) 2020-06-24 13:47:39 -07:00
alschmiedt
1349017c8a Check if a gesture is in progress before doing keyboard nav (#3950)
* Check if a gesture is in progress before doing keyboard nav
2020-06-10 10:28:02 -07:00
alschmiedt
6bc60894db Toolbox interface (#3918)
* Add toolbox interface
2020-05-27 10:06:18 -07:00
Sam El-Husseini
317834ff59 Add accessibility interfaces and fix navigation types (#3908)
* Add accessibility interfaces and fix navigation types
2020-05-21 11:18:10 -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
alschmiedt
3a902ee970 Update ast node (#3808)
* Update ast node
2020-04-15 10:10:21 -07:00
Monica Kozbial
a9223b0b22 Typo fixes. (#3769) 2020-03-25 15:47:27 -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