* fix(generators): Changes to exports and access controls for TypeScript compatibility (#7295)
* fix(generators): Add missing declarations for Order enums
* chore(generators): Remove spurious whitespace
* fix(generators): Make provideFunction_ etc. public
Remove the protected declaration on provideFunction_ and
FUNCTION_NAME_PLACEHOLDER_ so they can be used from generator
functions written in TypeScript.
Not strictly part of #7283, but closely related and required to
fixing the related issue google/blockly-samples#1785.
* chore(generators): format
(cherry picked from commit d503fbb409)
* fix: Correct errors in `HSV_SATURATION`, `HSV_VALUE` accessors (#7297)
* fix: Correct errors in HSV_SATURATION, HSV_VALUE accessors
Fix the comment / message errors noted in
https://github.com/google/blockly/pull/7249#issuecomment-1638645810
* chore: Add renamings for HSV_SATURATION, HSV_VALUE
(cherry picked from commit 1bc4f67d78)
* release: Update version number to 10.0.2
---------
Co-authored-by: Christopher Allen <cpcallen+git@google.com>
* fix(generators): Add missing declarations for Order enums
* chore(generators): Remove spurious whitespace
* fix(generators): Make provideFunction_ etc. public
Remove the protected declaration on provideFunction_ and
FUNCTION_NAME_PLACEHOLDER_ so they can be used from generator
functions written in TypeScript.
Not strictly part of #7283, but closely related and required to
fixing the related issue google/blockly-samples#1785.
* chore(generators): format
* refactor(tests): Have testSetup accept a URL
Have testSetup accept a URL. Make testFileLocations a dictionary
whose values are URLs, and change the spellings of the keys to
be CONSTANT_CASE.
This allows tests to specify their own URL, or to add a query or
fragment.
* feat(tests): Add getAllBlocks helper
* test: Verify drag blocks works properly
* chore(tests): Reformat comments
Manually reformat comments to comply with styleguide.
* chore: Added test for loading json and interblock deletion
* chore: Added test for loading json and interblock deletion
* chore: Added test for loading json and interblock deletion
* chore: Added test for loading json and interblock deletion
* chore: Added test for loading json and interblock deletion
* chore: create test for undo block movements and editing a field
* chore: create test for undo block movements and editing a field
* chore: create test for undo block movements and editing a field
* chore: create test for undo block movements and editing a field
* chore: create test for undo block movements and editing a field
* chore: create test for undo block movements and editing a field
* chore: create test for undo block movements and editing a field
* chore: create test for undo block movements and editing a field
* chore: create test for undo block movements and editing a field
* chore: create test for undo block movements and editing a field
* chore: create test for undo block movements and editing a field
* feat(tests): add test for collapsing block
* chore: format
* chore: format
* feat(tests): add right-click tests and helpers
* chore(tests): respond to review feedback
* fix: Restore HSV_SATURATION and HSV_VALUE accessors
Contrary to the notice at the top of the `Object.defineProperties`
call, these were not actually marked as deprecated, and their
removal in Blockly 10.0.0 constituted an avoidable zero-notice
breaking change.
* deprecate: Add deprecation notices for HSV_SATURATION and HSV_VALUE
DEPRECATION:
Blockly.HSV_SATURATION and Blockly.HSV_VALUE are deprecated and
will be removed in a future version of Blockly. Use
Blockly.colour.getHsvSaturation / Blockly.colour.setHsvSaturation
and Blockly.colour.getHsvValue / Blockly.colour.setHsvValue instead.
(cherry picked from commit a677355f73)
* fix(tests): Fix invalid import paths in mocha tests
This resolves the warnings generated during buildDeps by
closure-make-deps.
This commit does not attempt to address #7224 or otherwise
rationalise the imports and usage thereof.
* fix(tests): Fix failing context menu item test
Test appears to have been wrong: Block.prototype.getIcon is typed
as
getIcon<T extends IIcon>(/* ... */): T | undefined
and documented as "@returns The icon with the given type if it
exists on the block, undefined otherwise."
* refactor(tests): Clean up inconsistent usage of CommentIcon
Tweak the test files touched by PR #7200 to be consistent with
existing usage of Blockly.icons.CommentIcon instead of importing
this separately.
* chore: add test helpers for getting blocks from the toolbox
* chore: format
* chore: switch to use getBlockType
* chore: format
* chore: restore teardown
* fix: Restore HSV_SATURATION and HSV_VALUE accessors
Contrary to the notice at the top of the `Object.defineProperties`
call, these were not actually marked as deprecated, and their
removal in Blockly 10.0.0 constituted an avoidable zero-notice
breaking change.
* deprecate: Add deprecation notices for HSV_SATURATION and HSV_VALUE
DEPRECATION:
Blockly.HSV_SATURATION and Blockly.HSV_VALUE are deprecated and
will be removed in a future version of Blockly. Use
Blockly.colour.getHsvSaturation / Blockly.colour.setHsvSaturation
and Blockly.colour.getHsvValue / Blockly.colour.setHsvValue instead.
* chore(messages): npm run messages
This is the raw changes made by `npm run messages`, without any
manual reverts / backporting.
* fix(messages): Backport TranslateWiki hints (with edits)
Backport changes made to qqq.json by TranslateWiki editors to
messages.json, with some modifications.
See https://translatewiki.net/wiki/Template:Optional for details
of how the {{Optional}} template works.
* chore(messages): Apply backported messages.js changes to qqq.json
Also manually revert deletion of translation credits.
This is mostly just chore updating to the new import names
(e.g. BlocklyJavaScript -> javascript.javascriptGenerator),
but the change to Code.checkAllGeneratorFunctionsDefined is
a necessary fix due to the breaking change in PR #7150,
implementing the .forBlock dictionary.
Update the BlockFactory block generator function stub generator
to apply recent changes in generator function best practices:
- Use languageGenarator instead of Blockly.Language.
- Put generator functions in .forBlock dictionary.
- Accept (and use) a second argument that is the calling
CodeGenerator object.
- User Order.ATOMIC enum instead of ORDER_ATOMIC.
Also:
- Prefix (e.g.) javascriptGenerator and Order with "javascript.".
- Use template literals where useful.
- DRY up all the non-special field stub code generation.