* 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(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
* refactor(generators): Move lang.js -> lang/lang_gernator.js
Move the LangGenerator definitions into their respective
subdirectories and add a _generator suffix to their filenames,
i.e. generators/javascript.js becomes
generators/javascript/javascript_generator.js.
This is to keep related code together and allow the `lang/all.js`
entrypoints to be moved to the top level generators/ directory.
No goog module IDs were changed, so playground and test code
that accesses this modules by filename does not need to be modified.
* refactor(generators) Move lang/all.js -> lang.js
- Move the entrypoints in generators/*/all.js to correspondingly-named
files in generators/ instead—i.e., generators/javascript/all.js
becomes generators/javascript.js.
- Update build_tasks.js accordingly.
* fix(generators): Add missing exports for LuaGenerator, PhpGenerator
These were inadvertently omitted from #7161 and #7162, respectively.
* refactor(generators): Make block generator modules side-effect free
- Move declaration of <lang>Generator instance from
generators/<lang>/<lang>_generator.js to generators/<lang>.js.
- Move .addReservedWords() calls from generators/<lang>/*.js to
generators/<lang>.js
- Modify generators/<lang>/*.js to export block generator functions
individually, rather than installing on <lang>Generator instance.
- Modify generators/<lang>.js to import and install block generator
functions on <lang>Generator instance.
* fix(tests): Fix tests broken by restructuring of generators
Where these tests needed block generator functions preinstalled
they should have been importing the Blockly.<Lang>.all module.
Where they do not need the provided block generator functions
they can now create their own empty <Lang>Generator instances.
* chore: Update renamings file
- Fix a malformation in previous entries that was not detected by
the renaming file validator test.
- Add entries describing the work done in this and related recent
PRs.
* fix: Correct minor errors in PR #7173
- Fix a search-and-replace error in renamings.json5
- Fix an incorrect-but-usable import in generator_test.js
Due to errors in PRs #7171 and 7173 (and the author's failure to do
enough local testing before submitting those PRs), compressed mode
loading was broken in the playgrounds. Fix this by:
- Fix a typo in bootstrap.js ("Blocky" -> "Blockly").
- Updating the chunks definitions build_tasks.js to use the new
variables we expect to contain generator exports objects.
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Add functionality to run playground and block factory test locally
* feat: Add functionality to run playground and block factory test locally
* feat: Add functionality to run playground and block factory test locally
* feat: Add functionality to run playground and block factory test locally
* feat: Create procedure test
* feat: Create procedure test
* feat: Create procedure test
* chore: test for procedures
* chore: test for procedures
* chore: test for procedures
* chore: test for procedures
* fix: Switch broswer_test.yaml to be macOS as to match local development evn
* fix: Switch broswer_test.yaml to be macOS as to match local development evn
* fix: Switch broswer_test.yaml to be macOS as to match local development evn
* fix: Switch broswer_test.yaml to be macOS as to match local development evn
* fix: Update browser test to run manually, and move browser test suiteSetup in to a separate function
* fix: input exports
* chore: fix build
* chore: attempt to fix build
* chore: attempt to fix build
* chore: create new align enum to replace old one
* chore: format
* fix: Tweak renamings entries
It appears that the goal is to map:
Blockly.Input.Align -> Blockly.inputs.Align
Blockly.Align -> Blockly.inputs.Align
Blockly.ALIGN_* -> Blockly.inputs.Align.*
I believe this commit achieves that in a more minimal (and correct)
way—but if I have misunderstood the intention then this will not
be a useful correction.
---------
Co-authored-by: Christopher Allen <cpcallen+git@google.com>
* Copy core/events/events_block_change.ts to core/events/events_block_field_intermediate_change.ts
* New intermediate event type for field edits.
* Addressing PR feedback.
* Ran npm run format.
* Fixed procedure mutator responding to param edits.
* Intermediate events now inherit from BlockBase.
* Addressing feedback on PR.
* chore: format
Refactor bootstrap.js and bootstrap_helper.js to be able to deal
with generator chunks. In particular for each chunk, specify:
- The goog.module ID to goog.require() in uncompressed mode.
- The script filename to load in compressed mode.
- Where the chunk's UMD wrapper will save the export object when
loaded as a script.
- What global variable the chunk's export object should be saved in
(if desired).
- Any individual named exports to destructure to global variables.
This allows the bootstrap scripts to be slightly simpler while
also being more flexible.
* feat(generators): Add block generator function dictionary
Add a dictionary of block generator functions, provisionally
called .forBlock. Look up generator functions there first, but
fall back to looking up on 'this' (with deprecation notice)
for backwards compatibility.
Also tweak error message generation to use template literal.
* refactor(generators)!: Update generator definitions to use dictionary
* fix(tests): Have blockToCodeTest clean up after itself
Have the blockToCodeTest helper function delete the block generator
functions it adds to generator once the test is done.
* refactor(tests): Use generator dictionary in insertion marker test
The use of generators in insertion_marker_test.js was overlooked
in the earlier commit making such updates, and some test here
were failing due to lack of cleanup in
cleanup in the generator_test.js.
BREAKING CHANGE: this PR moves the generator functions we provide
from their previous location directly on the CodeGenerator instances
to the new .forBlock dictionary on each instance. This does not oblige
external developers to do the same for their custom generators, but
they will need to update any code that references the generator
functions we provide (in generators/*/*, i.e. on javascriptGenerator,
dartGenerator etc.) e.g. to replace the implementation or reuse the
implementation for a different block type.
* feat: add basic mutator icon
* feat: add actual mutation behavior to icon
* chore: add bumping blocks back into the bubble
* fix: add updating block styles
* feat: add static methods to mutator icon
* chore: delete old mutator code
* fix: use the new mutator icon
* chore: docs and format
* chore: my own comments
* chore: first pass at PR comments
* chore: make type strings internal
* chore: add todo
* chore: format
* chore: move properties to module level
* chore: fix using in demos
* chore: move Mutator to icons.MutatorIcon
* chore: move reconnect to connection
* chore: move findParentWs to workspace
* chore: properly override and call super
* chore: remove bubbleIsVisible check
* chore: change imports to import type
* chore: use elvis operator
* chore: update renamings
* chore: reduce changes to js block files
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Add functionality to run playground and block factory test locally
* feat: Add functionality to run playground and block factory test locally
* feat: Add functionality to run playground and block factory test locally
* feat: Add functionality to run playground and block factory test locally
* feat: Create procedure test
* feat: Create procedure test
* feat: Create procedure test
* chore: test for procedures
* chore(deps): Bump @hyperjump/json-schema from 0.23.3 to 1.5.0
Bumps [@hyperjump/json-schema](https://github.com/hyperjump-io/json-schema) from 0.23.3 to 1.5.0.
- [Commits](https://github.com/hyperjump-io/json-schema/compare/v0.23.3...v1.5.0)
---
updated-dependencies:
- dependency-name: "@hyperjump/json-schema"
dependency-type: direct:development
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
* chore(tests): Compatibility updates to validate-renamings.js
A minimal set of updates to validate-renamings.js to make it
compatible with @hyperjump/json-schema v1.5. The main difference
is that that package now ships ESM rather than CJS modules,
forcing the script to use import rather than require, with
various knock-on effects (no __dirname variable, must be named
*.mjs, etc.)
* chore(tests) Remove unneeded IIFE
* chore(tests): Additional tidy-up of ESM version
Now that validate-renamings is an ES module, we can do some other
cleanup to it.
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Christopher Allen <cpcallen+git@google.com>
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Add functionality to run playground and block factory test locally
* feat: Add functionality to run playground and block factory test locally
* feat: Add functionality to run playground and block factory test locally
* feat: Add functionality to run playground and block factory test locally
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* feat: Added basic example test for Blockly Playground and Blockly Demo
* chore: move input and input types into new directory
* feat: define and export new input types
* feat: modify blocks to construct individual inputs
* chore: transition code to use actual type checks
* chore: fixup input type type
* chore: format
* chore: fixup PR comments
* chore: fix build