Commit Graph

436 Commits

Author SHA1 Message Date
Sam El-Husseini
80aac249ea Make bumpNeighbours public. (#3156) 2019-10-03 19:31:55 -07:00
Sam El-Husseini
d0772ad496 Fix compiler warnings related to fields. (#3144)
* Fix compiler warnings related to fields.
2019-10-03 15:58:46 -07:00
Sam El-Husseini
735a72c20a mutation / compose fn annotations (#3149)
* Add compose / decompose type annotations.
2019-10-03 14:25:07 -07:00
Rachel Fenichel
771d6a119e Merge pull request #3143 from rachel-fenichel/remove_block_render_svg
Remove block_render_svg
2019-10-02 16:33:47 -07:00
Rachel Fenichel
668731b545 add visibility annotations 2019-10-02 16:29:32 -07:00
Rachel Fenichel
7ed47670cf Remove block_render_svg 2019-10-02 16:21:36 -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
Beka Westberg
df5b5766c1 General cleanup. 2019-10-01 19:22:19 -07:00
Beka Westberg
5aaab251a3 Changed all other known 'hiding' references to 'tracking'. 2019-10-01 19:02:02 -07:00
Beka Westberg
08720929d3 Changed setConnectionsHidden to waitToTrackConnections and startTrackingConnections. 2019-10-01 19:00:53 -07:00
Beka Westberg
afbb2cca1e Moved all database related code out of headless and into rendered. 2019-09-27 18:00:06 -07:00
Neil Fraser
6ef84035ca Prevent dataset IDs from being renamed
The JS Compiler would rename ‘id’ and ‘blockId’ to something random.  Normally that would be fine, but if it ended up with a ‘$’ in the name, then that becomes an illegal HTML property name and Blockly crashes.

A bug that’s been lurking in Blockly for years and randomly surfaced on a recent compile.
2019-09-25 19:50:39 -07:00
Sam El-Husseini
494487b37f Mark fields as dirty when the workspace becomes visible. (#3072)
* Mark fields as dirty when the workspace becomes visible.
2019-09-23 11:21:45 -07:00
Beka Westberg
9e5df6216a Fixed comment ownership. (#2923)
* Moved comment icons to use a model-based system. The block holds the model of the comment, and the comment icon holds a reference to it.
* Reorganized the setVisible function.
* Changed how xml.js serializes and deserializes comments.
2019-09-20 13:16:07 -07:00
Neil Fraser
a1e3973499 Make block comments an optional module. (#3053)
Measured as a 5 KB *increase* in code size, but that's because some other commit just landed between my tests. It's like running down an up escalator.
2019-09-19 14:53:28 -07:00
Neil Fraser
ec34698c53 Make trashcan and zoomcontrols optional modules. (#3043)
Saves 6 KB when compiled if there is no trashcan nor zoomcontrols.
2019-09-18 15:55:12 -07:00
Sam El-Husseini
8fae0411f7 Check if a type exists before testing instanceof (#3031)
* Check if a type exists before instance of
2019-09-17 16:28:18 -07:00
alschmiedt
2c98ecaed6 Update APIs and Add New Cursor Look (#3009)
* Updates methods to be private in navigation.js

* Update cursor with new look
2019-09-16 12:33:43 -07:00
Rachel Fenichel
77185906d8 Renderers define which paths a block has. (#2981)
* Move render elements into a path object.
2019-09-16 12:13:32 -07:00
Sam El-Husseini
e339ae26bc Move the rendering object to live on the workspace_svg (#3016)
* Move the rendering object onto the workspace allowing the various workspaces to have different renderers.
2019-09-13 14:20:34 -07:00
Sam El-Husseini
8ab51c8639 Remove closure base file dependency (#2976)
* Trim down closure's base dependency even further by removing the dependency on closure's base file.
2019-09-11 17:30:51 -07:00
alschmiedt
7bba4fa59c Moves the cursor to correct location when block is deleted (#2887)
* Moves the cursor to correct location when block is deleted

* Moves cursor on block mutation
2019-08-21 16:33:16 -07:00
Neil Fraser
096959fde9 Cleanup of last fortnight’s commits. (#2865)
No functional changes.
2019-08-19 14:07:48 -07:00
Beka Westberg
cdc90f4059 Refactored field utilities. 2019-08-16 09:57:27 -07:00
Rachel Fenichel
9325e993b2 Remove call to renderInternal 2019-08-14 14:48:25 -07:00
Roy van Schaijk
bcadd836b2 Make the TabList exclude hidden fields (#2764)
* Make the TabList exclude hidden fields

* Stop using private variable
2019-08-01 11:14:52 -07:00
Rachel Fenichel
41c686e733 Use constants 2019-07-31 13:17:20 -07:00
Rachel Fenichel
bcdd691796 Make updating the connection locations called the same way for both renderers 2019-07-31 11:45:32 -07:00
alschmiedt
8ef540a8dc Used moveBy in moveTo (#2741) 2019-07-30 10:50:59 -07:00
Sam El-Husseini
c1b49a1da7 Fix some jsdoc types (#2701)
* Fix JSDoc regarding type inconsistencies. Make image field src required and update image field tests.
2019-07-25 12:24:36 -07:00
Rachel Fenichel
4901c6c040 Merge branch 'develop' into choose_renderer 2019-07-24 14:21:30 -07:00
Rachel Fenichel
eb8f1819e2 Make it possible to choose the renderer at runtime, with a constant. 2019-07-24 14:04:58 -07:00
Abby
3dd1973a5a Ran the rename script 2019-07-24 13:48:25 -07:00
Abby
1c26b6d79b Adds helper functions for keyboard nav 2019-07-24 11:42:37 -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
alschmiedt
a7ec185c69 Adds fill to svg dark path 2019-07-03 14:10:56 -07:00
Neil Fraser
d23dc0ae55 Minor cleanup from #2581 2019-06-28 16:47:12 -07:00
Neil Fraser
712576a5b1 Fix IE not unhighlighting
This is a rework of PR #2580.
2019-06-28 16:47:12 -07:00
amber-cd
492d0719d6 Pull Request: Split showContextMenu_ (#2581)
* Split showContextMenu_

Split showContextMenu_ into generateContextMenu_ and showContextMenu_. This allows for custom Blockly forks to easily extend the context menu options available on all blocks by just doing something like

```
var oldGenerateContextMenu_ = Blockly.BlockSvg.prototype.generateContextMenu_;
Blockly.BlockSvg.prototype.generateContextMenu_ = function() {
  var menuOptions = Blockly.BlockSvg.prototype.generateContextMenu_() || [];
  // Push other options into menuOptions
  return menuOptions;
}
```

Rather than having to modify the core code in such a way as to cause unnecessary maintenance overhead when upgrading Blockly versions.

* Forgot the docblock, sorry

* Oops, missed a few ESLint things

* Update block_svg.js

Updated to be protected rather than private.
2019-06-21 15:14:11 -07:00
Neil Fraser
b8cbd9e7df Resolve 13 warnings
Reduce count from 632 to 619.
Eliminate copy-paste code duplication in Field.prototype.setValue
2019-06-12 10:59:33 -07:00
Neil Fraser
0213de11bc Use Rect in more places. 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
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
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
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
5cf52c566a Fix a dozen compiler warnings. 2019-05-17 16:48:40 -07:00
Neil Fraser
32631577a4 Defenestration 2019-05-17 15:04:39 -07:00