Commit Graph

30 Commits

Author SHA1 Message Date
Christopher Allen ffb8907db8 feature(blocks): Export block definitions (#5908)
* refactor: Provide a BlockDefinition type

* refactor: Split defineBlocksWithJsonArray

  Split defineBlocksWithJsonArray into:

  - createBlockDefinitionsFromJsonArray, which creates BlockDefinitions
    from a (possibly JSON-originated) POJsO array, having no side-effects
    except possibly issuing warnings to the console.
  - defineBlocks, which add any dictionary of BlockDefinitions to
    the Blocks dictionary.

* feat(blocks): Export block definitions per-module

  - Define all blocks in a local blocks dictionary, often using
    createBlockDefinitionFromJsonArray, without registering them.
  - Separately, use defineBlocks to register the exported
    BlockDefinitions at the end of each Blockly.blocks.*
    module.
  - In Blockly.blocks.all, create a blocks export that combines all
    of the blocks exports from the individual blocks modules.

* chore: have format script run clang-format on blocks/ too
2022-01-31 21:41:29 +00: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
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
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
kozbial 99f8226655 Update Blockly.Blocks type annotation 2021-07-15 18:33:56 -07:00
kozbial d8c4541130 Migrate core/blocks.js to goog.module 2021-07-15 18:33:56 -07:00
Neil Fraser d919b0af21 Update JSDoc from Array.<> to Array<>
Same with Object.
2021-05-27 21:30:26 -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
Sam El-Husseini 986e965be8 Private/protected visibility cleanup (#3263)
* Fix a number of private visibility issues
2019-10-16 11:48:09 -05: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
Neil Fraser 2ac3447383 Create null objects properly.
new Object(null) doesn’t do anything, that’s just broken.
And the for loop with keys is silly.
2019-07-15 14:37:27 -07:00
Neil Fraser 4262b09002 Resolve 106 warnings. 2017-10-24 14:06:29 -07:00
Rachel Fenichel 72256a187d Annotation fixes 2017-03-03 13:22:50 -08:00
Rachel Fenichel 4152542c2f Fix some lint errors 2017-02-03 14:01:18 -08:00
Andrew n marshall e95991cba8 Adding @namespace annotations for JSDoc. (#900) 2017-02-01 09:10:35 -08:00
Neil Fraser 7928fac3ce Collapse the five 0/1-based index flags into one option. 2016-10-06 17:54:43 -07:00
Neil Fraser 5ea49cdf4e Change tooltips on get/set list blocks to be 0/1 index aware. All languages. 2016-07-09 04:23:01 -07:00
Neil Fraser b324efaa86 Change tooltip on text/list indexOf blocks to be 0/1 index aware. All languages.
Delete ta:TEXT_INDEXOF_TOOLTIP since that text does not appear to make
sense.
2016-07-08 18:58:28 -07:00
Neil Fraser 6acaf35967 Add workspace.newBlock, deprecate Blockly.Block.obtain. 2015-12-07 16:40:45 +01:00
Neil Fraser 349146743b Remove dependency on goog.cssom. 2015-09-29 15:40:19 -07:00
Neil Fraser 8ecfab014f Separate overlapping emboss filter and disabled pattern across multiple Blockly instances. Issue 184. 2015-09-28 12:20:28 -07:00
Neil Fraser 9050e32954 Adding JsonInit method of creating blocks. 2015-06-08 15:54:18 -07:00
Neil Fraser 0f8d01209c Headless workspaces and blocks. 2014-12-23 11:22:02 -08:00
Neil Fraser 6539211104 Change official project URL. 2014-10-07 13:09:55 -07:00
Neil Fraser 7122410373 Changing project location from Google Code to GitHub. 2014-09-08 15:18:02 -07:00
Neil Fraser d998a1c8ec Update to latest version. 2014-09-08 14:26:52 -07:00
ellen.spertus c3b19ca9cc Automatic commit Wed Feb 5 03:00:02 PST 2014 2014-02-05 03:00:02 -08:00
ellen.spertus 6ee38cdec3 Automatic commit Tue Jan 28 03:00:09 PST 2014 2014-01-28 03:00:09 -08:00
ellen.spertus 08f4022b38 Automatic commit Sat Jan 11 03:00:02 PST 2014 2014-01-11 03:00:02 -08:00
ellen.spertus a8acffd81c New initial commit with .svn directories and their contents ignored. 2013-10-30 14:46:03 -07:00