* fix: remove drop down div class
* fix: change name and export for drop down div
* fix: make module-local variables conform to styleguide
* fix: format
* fix: shadowing
* fix: move core test helpers into new directory
* fix: add test helpers to core and convert to goog modules
* fix: change tests to use local helpers
* fix: change local tests to use chai asserts
* fix: skip field tests in serializer b/c test blocks are unavailable
* fix: rename some helper files
* fix: rename some helper modules
* fix: split block helpers into code gen and serialization
* fix: split block defs into new helper file
* fix: split warning helpers into new file
* fix: split user input helpers into new file
* fix: split event helpers into a new file
* fix: split variable helper into new file
* fix: move remaining test helpers to new setup-teardown file
* fix: rename setup and teardown module
* fix: cleanup from rebase
* fix: undo accidental rename
* fix: lint?
* fix: bad toolbox definitions namespace
* fix: fixup warning helpers
* fix: remove inclusion of dev-tools in mocha tests
* move to modules, but break mocha
* fix: run mocha as a module
* fix: lint
* refactor: refactor tooltip show method
* refactor: make Tooltip a class that is accessed via a singleton
* revert: "refactor: make Tooltip a class that is accessed via a singleton"
This reverts commit b3d543cc35.
* feat: add the ability to set a custom tooltip function
* fix: check for null where it matters for types
* feat: Add a test for the custom tooltip function
* fix: fix formatting
* fix: format test
* fix: remove unnecessary teardown call in test
* Enable the --debug flag when running the
buildAdvancedCompilationTest gulp task.
* Migrate test/compile/main.js to goog.module.
* Use more selective goog.requires.
* Reduces compiled size from ~400k to ~370k.
* @suppress "extra" requires needed for side effects.
* refact: move super call to top of block svg
* refact: run conversion script on block svg and block
* fix: make debug build happy
* fix: tests
* style: format
* fix: cleanup from rebase
* fix: use new.target instead of a new parameter
* fix: add more overridden casted methods to BlockSvg
* style: fix typos
* style: move override tags to the end of JSDoc
* fix: cleanup from rebase
* refactor: Initial test at refactoring fields to ES6
* refact: reorganize text input and descendants to call super first
* refact: run conversion script on text input field and subclasses
* clean: cleanup fields post-conversion script
* refact: reorganize dropdown and variable fields to call super first
* refact: run class conversion script on dropdown and variable
* clean: clean fields post conversion script
* refact: reorganize misc fields to call super first
* refact: run conversion script on misc fields
* clean: cleanup misc fields after conversion
* fix: add setting the value and whatnot back to the base field. Pass sentinel conistently
* format
* refact: work on making debug compiler happy
* clean: finish making debug build happy
* fix: work on making tests happy
* fix: finish making tests happy
* Fix: fixup angle and multiline fields
* clean: format
* fix: move default value back to DEFAULT_VALUE
* fix: change SENTINEL to SKIP_SETUP
* fix: inline docs
* fix: some misc PR comments
* fix: format
* fix: make compiler hapy with new.target
* fix: types in FieldDropdown
* fix: add @final annotations to Field
* feat: move Sentinel to a utils file
* fix: remove ImageProperties from external API
* clean: cleanup chunks and deps
* fix: remove unnecessary properties from rows
* refactor: run conversion script on measurables
* clean: cleanup from conversion
* fix: make debug build happy
* clean: format
* fix: remove widthWithConnectedBlocks assignment on element
* fix: add inline docs for statementEdge
Because of our mis-use of @package, and the removal of the hack
that made it work reasonably (in PR #5918), compilation was
generating a large number of JSC_BAD_PACKAGE_PROPERTY_ACCESS
warnings, making it hard to see any other warnings/errors that
might be generated.
To make compiler diagnostics more useful, disable the visibility
diagnostic group entirely for the time being.
Also improve the documentation for JSCOMP_ERROR and the newly-
-introduced JSCOMP_WARNING and JSCOMP_OFF.
Rather than ignoring blockly_uncompressed.js, gulpfile.js and
core/utils/global.js entirely, add suitable eslint-disable directives
to those files so that they lint cleanly (and migrate gulpfile to
use const instead of var).
...and rename Blockly.blocks.all (blocks/all.js) to
Blockly.libraryBlocks (blocks/blocks.js
BREAKING CHANGE: (only) because the exports object from the
`blocks_compressed.js` chunk will be accessed as
`Blockly.libraryBlocks` instead of `Blockly.blocks.all` when the
chunk is loaded in a browser via a `<script>` tag. There will
be no changes visible when the chunk is loaded via ES module
`import` or CJS `require`.
* chore(deps): Update closure/goog/base.js, add goog.js
* Update base.js from the latest version (20220104.0.0).
* Also copy over goog.js, which provides access to asuitable subset
of goog.* via an importable module).
* refactor(tests): Have playground.html load Blockly as a module
N.B.:
* We still need a preparation step, in order to load base.js and
deps.js via <script> tags in uncompiled mode; in compiled mode
it will instead load all the *_compressed.js files via <script>
tags.
Acess to the Blockly object is via:
import Blockly from './playgrounds/blockly.mjs';
(N.B: no "* as", since blockly.mjs has only a default export.)
* There remain two serious defects when running in uncompiled mode:
* It does not attempt to load msg/messages.js, causing startup to
fail.
* Module loading only works if there are no ES Modules; if there
are, something goes wrong with base.js's attempt to sequence
module loads causing goog.modules that import ES modules to get
a null exports object for that import. X-(
* fix(tests): Have playground.html load messages.js before generators
This fixes the issue caused by missing messages when loading
the generators.
* fix(tests): Move bootsrap calls to prepare.js
Move the calls to goog.bootstrap from blockly.mjs to prepare.mjs.
This is needed to work around a bug in the Cosure Library debug
loader (https://github.com/google/closure-library/issues/1152).
This gets a bit ugly because most of the code has to go in a
<script> (because it needs goog.bootstrap, which was loaded by
an earlier <script> tag).
* fix(documentation): Minor comment corrections for PR #5931
* refact: convert toolbox items to ES6 classes
* fix: and SENTINEL so that contents can be parsed properly
* fix: fix types and whatnot related to new SENTINEL
* clean: format
* refactor: reorganize overridable calls into the init function, and remove sentinel
* clean: format
* fix: inline docs and organization
* fix(build): Correctly handle deep export paths
A problem can occur when loading chunks in a browser: although
factory() will create the full exported path on $, and thus the
assignment
root.<path> = factory(...) { ...; return $.<path> }
will normally be a do-nothing in every chunk except the first, if
the exported path (e.g. Blockly.blocks.all) is more than one level
deeper than any previously-existing path (e.g. Blockly), this will
fail because root.<path> is evaluated before calling factory(), and
so the left hand side will will evaluate to a undefined reference
(e.g. undefined.all) and TypeError will be thrown before the call
to factory is evaluated.
To fix this, call factory first and store the exports object in a
variable before assigning it to the exported path.
Fixes#5932.
* refactor: convert shortcut registry to es6 class
* refactor: convert context menu registry to es6 class
* refactor: convert registry type to es6 class
* chore: format
* chore: respond to PR comments
* refactor: move optional function declarations into the constructor
* refactor: convert options.js to es6 class
* refactor: convert generator.js to es6 class
* refactor: convert workspace_events.js to es6 class
* refactor: convert events_abstract.js to an es6 class
* chore: format
* chore: fix lint
* chore: rebuild
* chore: respond to PR feedback
Same as PR #5640, except for the addition of a parameter in the JSON to turn this on or off. While one would normally want animations/sounds on (e.g. undo/redo stack) sometimes they'd be annoying (e.g. events from realtime collaborators).
* refactor(blocks): Make loopTypes a Set
This is likely to slightly improve performance, especially if there
are many entries.
* refactor(blocks): Re-export individual block modules from Blockly.blocks.all
* fix!(blocks): Have blocks_compressed.js export Blockly.blocks.all
Previously the value obtained by
const blocks = require('blockly/blocks'); // Node.js
or
import blocks from 'blockly/blocks.js'; // ES Modules
would be the block definitions dictionary (Blockly.Blocks).
Change this so that it is instead the export object from
Blockly.blocks.all.
This means you can now access loopTypes via:
import blocks from 'blockly/blocks.js';
blocks.loops.loopTypes.add('my_loop_blocktype');
This is a breaking change for any code which depended on the value
that was exported by blocks_compressed.js.
BREAKING CHANGE: the exports provided by blocks_compressed.js (and
therefore by `import ... from 'blockly/blocks'`) have changed; see above.
* refactor: update several files to es6 classes
* refactor: update several files to es6 classes
* chore: add some type casts for specificity about event types
* chore: run formatter
* chore: rebuild
* refactor: Stop flattening Blockly sources during compilation in preparation for move to ES modules
* fix: Remove obsolete accessControls and add comment about visibility changes
* refactor: update workspace_comment and _svg to es classes
* refactor: update classes that extend icon to es classes
* refactor: update icon to es6 class
* refactor: update connection classes to es6 classes and add casts as needed
* refactor: update scrollbar to es6 class and add casts as needed
* refactor: update workspace_svg to es6 class
* refactor: update several files to es6 classes
* refactor: update several files to es6 classes
* refactor: update renderers/common/info.js to es6 class
* refactor: update several files to es6 classes
* chore: rebuild deps.js
* chore: run format
* chore: use casts to narrow types in renderers
* chore: add @struct and type information on common measurables
* refactor: update some renderer measurables to es6 classes
* refactor: convert many measurables to es6 classes
* chore: format
* chore: rebuild