Commit Graph

2538 Commits

Author SHA1 Message Date
alschmiedt
00df97a59d Add plugin options (#3922)
* Adds a plugin through options

* Fix requires

* Fix pr comments
2020-05-29 13:22:25 -07:00
Sam El-Husseini
1052f7548b Enable unusedPrivateMembers check (#3924)
* Add unusedPrivateMembers check
2020-05-28 17:44:16 -07:00
Sam El-Husseini
acfc335870 Type fixes for Dropdown / Widget divs (#3911)
* Stricter typechecks in dropdown and widget div
2020-05-28 08:42:26 -07:00
alschmiedt
2b2ff909a9 Update interfaces (#3920) 2020-05-27 12:52:54 -07:00
alschmiedt
6bc60894db Toolbox interface (#3918)
* Add toolbox interface
2020-05-27 10:06:18 -07:00
Rachel Fenichel
2450a74101 Merge pull request #3915 from GermanBluefox/patch-4
Do not add COLLAPSED_WARNINGS_WARNING by deleting of warning
2020-05-26 14:13:48 -07:00
alschmiedt
61054ee55a Registry (#3914)
Create a global registry that fields, renderers and future objects can use
2020-05-26 11:21:42 -07:00
Bluefox
6f3e27cf16 Do not add COLLAPSED_WARNINGS_WARNING by deleting of warning
If some block tries to remove warning with `block.setWarningText(null, block.id)` in collapsed state, the warning will be shown anyway.
2020-05-25 11:40:59 +02:00
Sam El-Husseini
b84d25fe2d Strict types in input (#3912)
* Strict types in input.js
2020-05-21 17:57:13 -07:00
Sam El-Husseini
e3babee1f3 Add Blockly.utils.Metrics @record (#3913)
* Add Blockly.utils.Metrics
2020-05-21 15:03:17 -07:00
Beka Westberg
3aa1963be8 Add programmatically setting shadows (#3902)
* Add programmatically setting shadows
2020-05-21 11:44:08 -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
Sam El-Husseini
3f4faeab46 Cleanup types under components/ (#3910)
* Fix types under components

* Fix menu
2020-05-20 16:54:53 -07:00
Sam El-Husseini
6809f63555 Rename bounding box to bounded element (#3909) 2020-05-20 11:21:26 -07:00
Sam El-Husseini
fd916fdb9b Bounding Box interface (#3906)
* Add an interface describing a bounding box registered on the workspace

* Clear the bounding box array

* PR comments

* Update chromedriver
2020-05-19 18:06:11 -07:00
Sam El-Husseini
a5a3b045d3 Use the Blockly AST for block toString (#3895)
* Use the AST tree to populate block toString, add paranthesis around Number and Boolean connections
2020-05-14 17:06:35 -07:00
Beka Westberg
44ba0226c9 Add ignoring insertion markers in xml gen (#3883)
* Add ignoring insertion markers in xml gen
2020-05-14 17:05:43 -07:00
alschmiedt
d0e91a15a2 Toolbox definition (#3891)
* Add support for creating a toolbox with JSON
2020-05-13 08:16:53 -07:00
Sam El-Husseini
60a8eb63fe Fix contextmenu / dropdown field menu accessibility (#3892)
* Fix contextmenu and dropdown field accessibility
2020-05-08 09:22:28 -07:00
Neil Fraser
b9ce29843e Move Menu + MenuItem out of components to utils (#3893)
* Move Menu + MenuItem out of /core/components to /core

Blockly.Menu and Blockly.MenuItem no longer depend on Blockly.Component and thus should not be in /core/component.

Also delete Blockly.utils.uiMenu in the process.
2020-05-07 13:13:45 -04: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
888e348c69 Clean out the date field (#3876) 2020-05-06 09:42:24 -07:00
Sam El-Husseini
1e251e812b Hide the dropdown div when the flyout toolbox is scrolled (#3884) 2020-05-06 09:41:58 -07:00
Rachel Fenichel
3b6d364d07 Merge pull request #3874 from BeksOmega/fix/insertion-gen
Add ignoring insertion markers in code/xml gen
2020-05-04 10:43:08 -07:00
Beka Westberg
498ca3cba1 Improve renameVariable jsdoc (#3879) 2020-05-03 11:15:51 -07:00
Beka Westberg
65bb33635d Add ignoring insertion markers in code gen 2020-05-02 07:37:58 -07:00
Maribeth Bottorff
be50de6650 Procedure (#3875)
* Use getBlocksByType to speed up allProcedures generation

* Add tests for allProcedures

* Add error messages for some tests
2020-05-01 11:44:26 -07:00
Neil Fraser
f4fc455f83 Add Ctrl-y (redo) support.
Does not trigger on Command-y since this is a Windows-only shortcut.
2020-04-30 16:28:19 -04:00
Sam El-Husseini
33cb4d6feb Fix defineTheme startHats (#3842)
typeof null === "object", go figure..
2020-04-22 15:38:50 -07:00
Maribeth Bottorff
ba682040b1 Procedures.allProcedures only searches top blocks because procedures can only be top-level blocks. (#3854) 2020-04-22 14:51:24 -07:00
alschmiedt
16e6735748 Cleanup (#3848)
* General Toolbox Cleanup
2020-04-22 09:57:19 -07:00
alschmiedt
9513473c74 Make variable method public (#3840)
* Make nameUsedWithAnyType public
2020-04-20 11:25:35 -07:00
Maribeth Bottorff
781dbd974d Make block.removeInput return a boolean. (#3832)
Make block.removeInput return a boolean.
2020-04-17 17:47:58 -07:00
Sam El-Husseini
cfa198c6a0 Fix bug with dropdown divs in mutator dialogs. (#3835) 2020-04-17 13:19:40 -07:00
Sam El-Husseini
4b20383831 Add Selectable interface (#3823)
* Add I Selectable interface
2020-04-16 18:22:32 -07:00
Beka Westberg
9e98df9949 Fix collapsed blocks not updating when modified (#3806)
* Stop recursive render calls

* Fix visibility bugs.

* Make toString ignore collapsed input.

* Add automatic collapse rendering handling

* Fix insertion markers with collapsed

* Add tests

* Fix build?

* PR comments

* Add missing jsdoc
2020-04-16 13:02:05 -07:00
Sam El-Husseini
0230a4c192 Update IPathObject to include properties (#3822)
* Update IPathObject to include properties

* Fix ipathobject svgpath
2020-04-15 19:46:11 -07:00
Sam El-Husseini
12c8a50a0f Update the options object to reflect its properties, update the public option interface to include keymap and other little things (#3826) 2020-04-15 17:51:57 -07:00
Sam El-Husseini
493c89869e Rename dom Node enum (#3824)
* Rename Node enum to NodeType to avoid conflict with type Node
2020-04-15 15:54:36 -07:00
Sam El-Husseini
a4a390ba6d Add user agent types so they appear in dts (#3825) 2020-04-15 15:46:42 -07:00
alschmiedt
3a902ee970 Update ast node (#3808)
* Update ast node
2020-04-15 10:10:21 -07:00
Rachel Fenichel
3ad8ee89d9 Merge pull request #3783 from BeksOmega/cleanup/mutator-bump
Remove mutator bump timeout
2020-04-06 10:27:14 -07:00
Beka Westberg
bcfde92afb Fix setValue not handling block disposal (#3766) 2020-04-06 09:59:30 -07:00
Monica Kozbial
b64028521f Fix jsdoc typing in theme. (#3798) 2020-04-03 17:09:08 -07:00
Sam El-Husseini
06f6c22a27 Fix field colour in headless (#3795) 2020-04-03 14:36:19 -07:00
Sam El-Husseini
acb5d895f8 Move flyout label css into the renderer (#3780)
* Move flyout label css into the renderer and add theme options
2020-04-01 15:29:34 -07:00
Beka Westberg
7e03924d4c Remove mutator bump timeout.
Anything that changes the shape of a block should be calling
bumpNeighbors from inside BlockSvg. So this call is unnecessary. If
this call is making something bump that normally wouldn't, that should
be treated as a bug, and the root should be made to call bumpNieghbours.
2020-03-31 12:25:53 -07:00
Sam El-Husseini
a3dbbfd7ab Support a custom container element for the dropdowndiv, widgetdiv and tooltip. (#3772)
* Support a custom container element for the dropdowndiv, widgetdiv and tooltip
2020-03-27 17:13:46 -07:00
Monica Kozbial
a9223b0b22 Typo fixes. (#3769) 2020-03-25 15:47:27 -07:00
Sam El-Husseini
71f7285333 Fix mutator field scale (#3763)
* Fix mutator zoom scale
2020-03-23 17:34:12 -07:00