Commit Graph

85 Commits

Author SHA1 Message Date
Aaron Dodson
328cd35d10 refactor: Migrate Blockly.Events.Abstract to named exports (#5916) 2022-02-04 15:32:33 -08:00
Christopher Allen
da16a66f33 refactor: msg.js: use named export, remove declareLegacyNamespace (#5768) 2021-12-02 16:47:27 +00:00
Rachel Fenichel
8ef0b20146 feat: clarify variable and procedure constants (#5743)
* chore: move dynamic category names into their respective files

* feat: create NameType enum on Names

* chore: use NameType enum for Names helper functions

* docs: update comments for category names
2021-11-30 09:13:36 -08:00
Rachel Fenichel
f14a1c8034 chore: fix more lint (#5676)
* chore: fix assorted lint

* chore: clang-format

* chore: clang-format
2021-11-08 16:41:52 -08:00
alschmiedt
0f3c06306f chore: runs clang format on all files (#5627) 2021-10-21 15:22:24 -07:00
Aaron Dodson
3851b14627 refactor: Migrate to named exports (#5623)
* refactor: Migrate to named exports

* fix: Sort requires

* fix: Remove duplicate deps
2021-10-20 15:53:23 -07:00
Neil Fraser
90b3f75d82 Remove @author tags (#5601)
Our files are up to a decade old, and have churned so much, that the initial author of the file no longer has much meaning.

Furthermore, this will encourage developers to post to the developer group, rather than emailing Googlers (usually me) directly.
2021-10-15 09:50:46 -07:00
Neil Fraser
c929b3015b chore: Convert == to === and != to !== where possible. (#5599) 2021-10-15 09:17:04 -07:00
Rachel Fenichel
b25e24fd02 chore: Run clang-format on core/*.js (#5589)
* Run clang-format on core/*.js

* Revert changes for css formatting
2021-10-07 10:32:02 -07:00
Monica Kozbial
f67214dac5 Update @package annotations (#5558) 2021-09-28 08:55:49 -07:00
Monica Kozbial
d8fbe1b05b Add namespace and alias annotations to jsdoc (#5550)
* Add annotations to files under core/events

* Add annotations to files under core/interfaces

* Add annotations to files under core/keyboard_nav

* Add annotations to files under core/renderers

* Add annotations to files under core/serialization

* Add annotations to files under core/theme

* Add annotations to files under core/toolbox

* Add annotations to files under core/utils

* Add annotations to files under core
2021-09-27 14:42:54 -07:00
alschmiedt
2b34748e0e chore: remove declareLegacyNamespace from events (#5532)
- Adds an extra events/utils.js file to hold helper methods related to events.
2021-09-24 14:20:32 -07:00
Christopher Allen
16b6d4526a refactor: Rename Blockly.Blocks, migrate to named exports (#5515)
* Rename Blockly.Blocks to Blockly.blocks
  Because it does not export a type as its default export.

  Part of #5073.

* Name default export of Blockly.blocks Blocks.

  Use named exports in Blockly.blocks by giving the former default
  export the name Blocks.

  Part of #5153.

* Reexport Blockly.blocks from blockly.js

* Document the format of renamings.js better.
2021-09-24 19:12:03 +01:00
Aaron Dodson
e0693a65d2 chore: Remove declareLegacyNamespace() from files in core (#5525)
* chore: Remove declareLegacyNamespace() from files in core

* fix: Update missing/errant re-exports in blockly.js
2021-09-23 14:48:52 -07:00
Aaron Dodson
e1310b6464 fix: JSDoc generation for modules without classes 2021-09-22 14:37:55 -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
a3b52aaab3 Migrate core/events/events.js to goog.module syntax (#5302)
* Migrate core/events/events.js to ES6 const/let

* Migrate core/events/events.js to goog.module

* Migrate core/events/events.js to named requires

* clang-format core/events/events.js

* Migrate Blockly core to use getRecordUndo/setRecordUndo

* Update core/events.js to reflect latest guidance around exporting mutable fields
2021-08-26 08:53:31 -07:00
Aaron Dodson
cf96aac58e Migrate core/procedures.js to goog.module syntax (#5265)
* Migrate core/procedures.js to ES6 const/let

* Migrate core/procedures.js to goog.module

* Migrate core/procedures.js to named requires

* clang-format core/procedures.js

* Rename xml to utilsXml to disambiguate from Xml
2021-08-11 14:04:02 -07:00
Rachel Fenichel
b3f837a8d2 Replace references to constants with internalConstants 2021-07-21 15:33:55 -07:00
Neil Fraser
6a6c630f8c Back out variable change. 2021-06-09 11:41:42 -07:00
Neil Fraser
76b5517008 Use null-prototype objects for maps
A {} has a bunch of names already defined on it (like ‘toString’).  When using an object as a map with arbitrary keys, it should not inherit from Object.prototype.
2021-06-09 11:41:42 -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
4436e2814d Use localeCompare’s case insensitivity option
Variables and procedures now sorted using local rules, not Unicode code points.  Verified that ’sensitivity’ survives Closure compiler without quotes.
2021-05-19 09:57:14 -07:00
Beka Westberg
75319312c1 Revert "Move ProcedureBlock to interface"
This reverts commit 918bdc2359.
2021-05-10 15:34:36 -07:00
Beka Westberg
8a00303aa7 Revert "Rename to IProcedureBlock"
This reverts commit c8a065fa13.
2021-05-10 15:33:12 -07:00
Beka Westberg
c8a065fa13 Rename to IProcedureBlock 2021-05-08 07:57:38 -07:00
Beka Westberg
918bdc2359 Move ProcedureBlock to interface 2021-05-06 12:22:40 -07:00
Beka Westberg
43e95af14e Fix getDefinition being too restrictive 2021-04-25 14:46:51 -07:00
Sam El-Husseini
63d26dc186 Add extra requires check (#4677)
* Add extra requires check
2021-03-05 09:50:51 -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
05ab37690e Missing requiretypes, m through r 2021-02-17 14:39:15 -08:00
Monica Kozbial
29b96d8d35 Fix ui event checks (#4512) 2020-12-08 16:21:52 -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
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
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
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
Beka Westberg
6d1bb201f7 feat: Improved procedure arg interaction. (#3527)
* feat: Improved procedure arg interaction.

* Added docs.

* Fixed typos and typings.

* Fixed typings?

* Changed visibility to private.
2020-01-07 13:55:46 -08:00
Neil Fraser
123f436e04 Add parens around inline assignments (#3381) 2019-10-31 15:17:35 -07:00
Sam El-Husseini
730dee7aca Fix warnings in procedures. (#3304) 2019-10-23 17:51:24 -04: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
Rachel Fenichel
e523943ee9 Merge pull request #2615 from BeksOmega/fixes/Procedures
Fixed Procedure Empty Names & Procedure Parameters
2019-07-23 11:21:22 -07:00
Neil Fraser
74be35e23d Rename Blockly.Xml.utils to Blockly.utils.xml 2019-07-08 13:29:43 -07:00
Beka Westberg
7b02728ff2 Cleaned up unamed handling w/ safename. 2019-07-08 10:48:42 -07:00
Beka Westberg
87fbe0447b Fixed procedures not handling empty names. Renenabled/fixed tests. 2019-07-08 09:23:16 -07:00
alschmiedt
c45be91f7a Fixes spacing problem in procedure name 2019-07-03 11:40:55 -07:00
Neil Fraser
aca1a43ec8 Fix regular expressions.
1) Simplifications.
2) Enable toolbox category colours to be specified using the full range of CSS formats (not just hue or #rrggbb).
3) Fix bug where `Blockly.utils.checkMessageReferences('%{BKY_today}  %{BKY_xxx}')` returns true.
2019-06-10 11:03:22 -07:00
Beka Westberg
73ff710a4d Added getSourceBlock function to field. (#2508) 2019-05-29 12:50:00 -07:00
Neil Fraser
9f528922a7 Fix some dependencies 2019-05-24 15:45:05 -07:00
Neil Fraser
dddb94aedd Fix circular dependency. 2018-10-16 11:34:10 -07:00