* fix: early return from updateDisabled if it is noop
* chore: trigger connect and disconnect before hiding
* chore: remove disconnectInternal
* fix: skip setting parent when disconnecting before connecting
* chore: fixup docs
* chore: remove erroneous test
* fix: add delay to context menu callback.
Improve INP by allowing the browser to do a paint (closing the context
menu) before we trigger callbacks. This improves the user experience
for expensive callbacks (e.g. collapsing, or updating disabled).
* fix: rendering bug
When disconnecting the last block in the stack, the block would not be
rerendered correctly (the top-start corner would not be reshaped)
* fix: connecting bug
The order for applying connections was changed so that connections were
applied and then the insertion marker was hidden. This caused an error
because hiding the insertion marker expected there to be a child block
when there was not.
* chore: remove setParent param from public API
* chore: tsdoc
* Reduce usage of obsolete .keyCode property.
* Rename private properties/methods which violate eslint rules.
* Use arrays of bound events rather than individual properties.
* Improve typing info.
* Also fix O(n^2) recursive performance issue in theme's getComponentStyle function.
* And replace String(...) with '${...}' (smaller, faster).
* .toString() is considered harmful.
* refactor: Remove uses of AnyDuringMigration from xml.ts.
* refactor: Remove uses of AnyDuringMigration from block_svg.ts.
* refactor: Remove uses of AnyDuringMigration from theme_manager.ts.
* refactor: Remove uses of AnyDuringMigration from names.ts.
* refactor: Remove uses of AnyDuringMigration from field_angle.ts.
* refactor: Remove some uses of AnyDuringMigration from block.ts.
* refactor: Make safename construction more readable.
* fix: Use a default size for block comments.
* fix: Clarify test of shadow block disposal.
* fix: Update assert in workspace_svg_test to use isDeadOrDying().
* feat: added `tests/typescript` to test supported TS examples
* fix: update the test name, description, and output
* chore: remove unused imports in `test_tasks.js`
* fix: wrap README line at 80 characters
* fix: implemented `different_user_input.ts` feedback
* fix: correct mistaken comments
* chore: rename `./eslintrc.json` to `./eslintrc.js`
* feat: added linting for tests/typescript
* chore: cleanup eslintrc lines over 80 characters
* fix: updated `.eslintrc.js` to provide an override for linting itself
* fix: updated tests to build to the `build` directory
* feat: updated `gulp format` to handle formatting `.eslintrc.js`
* fix: updated `.eslintrc.js` to align with both formatter and linter
* fix: updated config comment wording
* fix: removed quotes for valid identifiers
* Revert "fix: removed quotes for valid identifiers"
This reverts commit 03eff91aea1468e503bc79a90fb139914d3f39d2.
* chore(tests): Remove circular import loading issue kludge
Prior to PR #6818, circular imports resulted in the debug module
loader (in closure/goog/base.js) failing to record the
goog.module ID of most modules that were
involved in the cycle, and in particular of the Blockly.Xml
module. This had secondary fallout that resulted
in library blocks modules being loaded in the wrong order.
A kludge was introduced in PR #6703 that worked around this
problem by making sure that window.Blockly was set, allowing
the modules loaded out-of-order to still work.
Now that we have removed all remaining circular dependencies
there is no need for the kludge, since all module IDs are
properly recorded and modules are loaded in the correct order.
* chore(build): Remove exclude for non-existent core/blockly.js
There was a transitional period where we had both
core/blockly.ts and core/blockly.js, and wished to exclude
the latter from tsc's input, but the latter file was deleted
(and inadvertently restored, then re-deleted) some time ago.
* refactor(xml): Move textToDom to core/utils/xml.ts
This function being in core/xml.ts was the cause for the last
remaining circular import in core/ (between variables.ts and
xml.ts).
Moving it to utils/xml.ts makes sense anyway, since there is
nothing Blockly-specific about this function.
Fixes#6817.
* fix(closure): Reenable goog.declareModuleId multiple-call check
Reenable an assertion which check to make sure that
goog.declareModuleId is not called more than once in a module
(and which also catches circular imports amongst ES modules, which
are not detected by closure-make-deps).
* chore(tests,demos): Augo-migrate use of textToDom
Testing the migration file entry by auto-migrating all uses of
Blockly.Xml.textToDom to Blockly.utils.xml.textToDom.
* chore(blocks): Manually migrate remaining use of textToDom
Update the one remaining call to textToDom (in blocks/lists.ts)
to the function's new location - also removing the last use of
the Blockly.Xml / core/xml.ts) module from this file.
* docs(xml): Remove unneeded @alias per comments on PR #6818
* fix(imports): Remove unused import
This change had already been made (by PR #6475 amongst other) to
most of the tests, but there were a couple of stragglers that
still mentioned messages.js.
Fixes#6824.
* chore: Remove uses of AnyDuringMigration in workspace_comment_svg.ts.
* chore: Remove uses of AnyDuringMigration in toolbox.ts.
* chore: Remove uses of AnyDuringMigration in field_colour.ts.
* chore: Remove uses of AnyDuringMigration from field_image.ts.
* chore: Remove uses of AnyDuringMigration from workspace.ts.
* Update core/workspace_comment_svg.ts
Co-authored-by: Christopher Allen <cpcallen+github@gmail.com>
* chore: Remove uses of AnyDuringMigration in collapsible_category.ts.
* chore: Revert unary - change to make clang-format happy.
* chore: Remove unnecessary quotes in toolbox.ts.
* Update core/workspace_comment_svg.ts
Co-authored-by: Christopher Allen <cpcallen+github@gmail.com>
---------
Co-authored-by: Christopher Allen <cpcallen+github@gmail.com>
* fix(tests): Fix errors in event tests
- Fix actual syntax errors in imports in event_marker_move_test.js
and event_selected.test.js, which were preventing those tests from
being run.
- Remove suite.only directives in those tests that would prevent
all the other tests from running.
* refactor(build): Improve buildDeps
- Run closure-make-deps only once, instead of separately for core/
and tests/.
- Specify a larger exec maxBuffer size, to ensure output and
diagnostics are not truncated.
- Change stderr filtering in buildDeps to filter out bounded
generics messages and blank lines.
- Attempt to suppress warnings in stderr output when
closure-make-deps returns a non-zero exit code.
Unfortunately, there seems to be a race condition which usually
the stderr argument to the exec callback not to contain the
complete output, so in that case print a helpful message.
- Have buildDeps just return a Promise instead of using a callback.
* fix(docs): Typo fix in JSDoc for log helper
* chore(tests): Enable testing on node.js v18.x on GitHub CI
* chore(tests): Remove outdated calls to test:prepare npm script
The calls to `npm run test:prepare` in `tests/scripts/setup_*_env.sh`
should have been removed along with that npm script in PR #4906.
* chore(deps): Fix alphabetisation in package.json
* chore: add test for reconnecting procedure input blocks
* feat: add caller blocks responding to updates
* chore: format
* chore: add test for deserializing callers before defs
* chore: format
* feat: procedure blocks have models
* feat: add updating the name of the model
* feat: add procedure defs updating the model enabled state
* feat: add procedure blocks updating parameters in the model
* fix: add disposing of the procedure model
* chore: updates test to check for identity of parameters
* chore: move statement handling into setStatement
* fix: make parameter IDs consistent
* chore: un-only tests
* chore: fixup tests
* chore: revert validator to use Procedures.rename
* chore: cleanup typo
* chore: sketch out necessary test cases
* chore: add tests for updating the data models
* chore: outline more response tests
* chore: add tests for updating procedure def blocks based on models
* chore: add tests for updating procedure callers based on procedure model updates
* chore: add tests for renaming procedures
* chore: add tests for adding procedure parameters
* chore: add tests for renaming procedure parameters
* chore: add tests for reordering procedure parameters
* chore: add tests for enabling and disabling procedures
* chore: add tests for deleting procedure def
* chore: fixup tests that we accidentally broke
* chore: format
* docs(icon): Better description for Icon.prototype.setVisible
Also tweak description of getBlock.
* docs(blocks): Fix typo in description of BlockDefinition
* chore(tests): Factor out common goog:chromeOptions
* chore(build): Minor style fixes
Previously we had code that would, in uncompiled mode, make sure
that javascriptGenerator etc. were set to the corresponding module
exports object (by fetching it with goog.module.get), but in
compressed mode we made no effort to set (e.g.) javascriptGenerator
to Blockly.JavaScript, which is where that export actually appears
in the namespace tree when loading the chunk via a <script> tag.
This commit introduces two new configuration options to bootstrap.js
(preconfigured with defaults that should work in most cases) mapping
global variable names to their corresponding module identifiers, and
modifies the code in bootstrap_helper.js to set global variables
appropriately in both uncompressed and compressed modes.
* refactor: Remove checks for PointerEvent support.
* refactor: Deprecate and remove calls to splitEventByTouches.
* refactor: Deprecate and remove calls to setClientFromTouch().
* refactor: Use PointerEvent in place of Event/MouseEvent/TouchEvent/PseudoEvent.
* refactor: Update references to mouse/touch events in code and documentation to reference pointer events.
* refactor: Merge Gesture and TouchGesture
* chore: clang-format changed files
* refactor: Bind and expect PointerEvents instead of MouseEvents.
* refactor: Rename TouchGesture to Gesture.
* fix: Fix test failures.
* chore: clang-format changed files.
* fix: Fix errant _ from merging
* refactor: Clean up dead code in browser_events.ts.
* chore: Update version in deprecation notices to reflect release schedule
* fix: Fixed a bug that caused the browser context menu to not be suppressed in Chrome.
* fix: Re-export Gesture as TouchGesture for backwards compatibility.
* refactor: Deprecate and remove uses of opt_noPreventDefault.
* chore: Fix error message in gesture.ts.
* chore: Removed obsolete todo.
* chore: add variable map tests
* chore: move firing create events into the variable map
* feat: add early returning in the case of noop renames
* chore: format