Commit Graph

411 Commits

Author SHA1 Message Date
Himanshu
3629ed5f65 refactor: Rename Blockly.connectionTypes to Blockly.ConnectionType (#5407)
* Renamed Blockly.connectionTypes to Blockly.ConnectionType
* Renamed core/connection_types.js to connection_type.js
* Add entry to renamings.js for renaming of Blockly.connectionTypes

Co-authored-by: Christopher Allen <cpcallen+git@google.com>
2021-09-24 12:45:10 +01:00
alschmiedt
73580b0ddb chore: named exports for keyboard_nav* files (#5517) 2021-09-22 11:25:38 -07:00
Rachel Fenichel
3adfaaf6d9 chore: named exports for block* files (#5512)
* chore: named export for block.js

* chore: named export for block_drag_surface.js

* chore: named export for block_dragger.js

* chore: named export for block_svg.js

* Fix import ordering

* chore: fix imports using requireType

* Remove extra require
2021-09-22 08:46:19 -07:00
Aaron Dodson
d6c9423bdf Remove declareLegacyNamespace from block-related files. 2021-09-21 13:18:07 -07:00
Rachel Fenichel
953e3b67b1 chore: remove deprecated functions (#5509) 2021-09-21 13:10:33 -07:00
Christopher Allen
e7955084ae refactor: Remove remaining references to Blockly.* from goog.modules (#5505) 2021-09-21 17:51:35 +01:00
Beka Westberg
e7541cb315 fix: copy paste with json system (#5423)
* fix: copy paste w/ json system

* fix: pr comments
2021-09-20 13:08:35 -07:00
Aaron Dodson
7aab18409f Migrate selected from Blockly to Blockly.common (#5489)
* Add getSelected/setSelected to core/common.js

* Migrate core to use Blockly.common.getSelected/setSelected instead of Blockly.selected

* Migrate demos to use Blockly.common.getSelected/setSelected instead of Blockly.selected

* Remove Blockly.selected

* Use variable instead of calling common.getSelected() multiple times

* Add accessor for selected on Blockly

* Add renaming record for Blockly.selected -> Blockly.common.getSelected/setSelected
2021-09-17 11:42:43 -07:00
Maribeth Bottorff
3bac582edb refactor: move Blockly.deleteBlock out of blockly.js (#5483) 2021-09-16 15:13:59 -07:00
Christopher Allen
4c40378b9a Use goog.requireType when importing interfaces (etc.) (#5343)
* Use goog.requireType when importing I* interfaces

Interfaces have no code, so should never be referred to outside of
(JSDoc) comments, and so the modules that define only interfaces never
need to be goog.require'd - goog.requireType is always sufficient.

This commit fixes imports of all modules whose name matches
/(.*\.)?I[A-Z]*/ - i.e., the hungarian-notation named ones in
core/interfaces/.

* Use goog.requireType when only using import for type specifications

Where a module is imported only to used in JSDoc comments it can
(and should) be goog.requireType'd instead of goog.require'd.

* Remove spurious eslint-disable no-unused-vars

There were a few cases where modules were being imported with
goog.require (because they are referred to in code, not just JSDoc
comments) but were prefaced by a spurious eslint suppress.

Remove these, restoring the invariant that an import gets an eslint
if and only if it is a requireType.

* Remove obsolete Closure Compiler error group

stricterMissingRequire has been superceded by missingRequire, and now
causes a Java null pointer exception if supplied.
2021-08-11 18:50:45 +01:00
Aaron Dodson
0ffdc6106d Migrate core/block_svg.js to goog.module syntax (#5323)
* Migrate core/block_svg.js to ES6 const/let

* Migrate core/block_svg.js to goog.module

* Migrate core/block_svg.js to named requires

* clang-format core/block_svg.js

* Migrate to goog.module.get for optional Comment/Warning in core/block_svg.js

* Lint changes in core/block_svg.js
2021-08-09 12:24:06 -07:00
Rachel Fenichel
7bc461ea83 polish: export draggingConnections directly 2021-08-04 17:17:24 -07:00
Rachel Fenichel
d5a6d7d3db Move draggingConnections to common 2021-08-04 15:59:41 -07:00
kozbial
19722e508f Migrate core/contextmenu.js to goog.module 2021-08-04 09:57:18 -07:00
Rachel Fenichel
8b5f5f72d6 Refer to more constants through internalConstants 2021-07-21 15:33:55 -07:00
Rachel Fenichel
ad5836b26d Convert more names to use internalConstants 2021-07-21 15:33:55 -07:00
Beka Westberg
a589cd6923 Update jsdoc 2021-07-07 14:42:18 +00:00
Beka Westberg
13bb9f5bf6 Refactor connect logic (#4880)
* Refactor connect logic.

* Fixup from rebase

* Fix build

* PR Comments
2021-06-18 09:53:43 -07:00
Monica Kozbial
a17cb7f12e Adding parameter to dragEnter and dragExit (#4890)
* introduce IDraggable interface
* Add parameter to drag methods in IDragTarget
* combines bubble/drag methods on IDragTarget and IDeleteArea to take an IDraggable element
2021-06-11 12:58:26 -07:00
Neil Fraser
c5a7b481bc Code simplifications 2021-06-03 08:23:01 -07:00
Neil Fraser
e661c92a36 More JSDoc improvements 2021-05-27 21:30:26 -07:00
Neil Fraser
d919b0af21 Update JSDoc from Array.<> to Array<>
Same with Object.
2021-05-27 21:30:26 -07:00
Neil Fraser
dd0314bc0b Normalize comments 2021-05-19 09:57:14 -07:00
Sam El-Husseini
f2f878db8c Fix multiple strict require warnings (#4793) 2021-04-21 16:46:04 -07:00
Laura Harker
5ff76ae32d Stop overriding @protected methods with @private (#4760)
An upcoming change to emit private properties in Google's internal version of
https://github.com/angular/clutz will otherwise break any
TypeScript depending on these types. This is because TypeScript errors
on overriding protected with private (Closure Compiler does not).
2021-04-06 11:05:41 -07:00
alschmiedt
fe41814958 Fix missing dependency (#4722) 2021-03-24 13:08:20 -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
750b62030b First pass at creating connectionTypes and inputTYpes 2021-03-04 10:22:24 -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
2360a12493 Fix remaining trivial missing requireTypes 2021-02-19 13:17:14 -08:00
alschmiedt
a3adc42e8a Remove keyboard navigation from core (#4593) 2021-01-19 11:50:51 -08:00
alschmiedt
fe0f401977 Fix collapsing bug and add tests (#4568) 2021-01-11 09:05:59 -08:00
Rachel Fenichel
40928634e5 Add some missing requires and requireTypes 2021-01-08 15:03:55 -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
Anjali Pal
eff3fcc289 set data-id on block svgs for IE11 (#4425) 2020-11-02 14:08:12 -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
Sam El-Husseini
fba35d342c Add missing require Blockly.constants (#4366) 2020-10-12 17:56:42 -04:00
Rachel Fenichel
3bf8a38020 Delete some deprecated functions 2020-09-28 13:09:19 -07:00
Monica Kozbial
395a2b3fcc Don't update disabled on children of collapsed blocks. (#4302) 2020-09-21 14:33:16 -07:00
Rachel Fenichel
f76560e883 Don't update disabled on unrendered children 2020-09-21 10:44:03 -07:00
Monica Kozbial
ab5a51e2a4 Revert "Don't render children of collapsed blocks (#4264)" (#4300)
This reverts commit 96e8fc794e.
2020-09-21 10:40:01 -07:00
Monica Kozbial
96e8fc794e Don't render children of collapsed blocks (#4264)
* Partially revert collapsed block changes and add additional handling for setting children of collapsed blocks to not rendered

* Improve performance by checking if child is rendered in updateDisabled
2020-09-18 16:08:39 -07: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
alschmiedt
22d598484f Update blockToDom types to include document fragments (#4280) 2020-09-16 10:51:09 -07:00
Rachel Fenichel
5b393eed76 More cleanup 2020-07-16 14:11:48 -06:00
Rachel Fenichel
6990ac5efd Fix annotation and remove redundant 'Blockly.' 2020-07-16 14:08:27 -06:00
Rachel Fenichel
2f5663b1ec Add deprecation helper + 2 uses 2020-07-16 13:59:32 -06: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