Commit Graph

19 Commits

Author SHA1 Message Date
Ben Henning
4074cee31b feat!: Make everything ISelectable focusable (#9004)
* feat!: Make bubbles, comments, and icons focusable

* feat!: Make ISelectable and ICopyable focusable.

* feat: Consolidate selection calls.

Now everything is based on focus with selection only being used as a
proxy.

* feat: Invert responsibility for setSelected().

Now setSelected() is only for quasi-external use.

* feat: Push up shadow check to getters.

Needed new common-level helper.

* chore: Lint fixes.

* feat!: Allow IFocusableNode to disable focus.

* chore: post-merge lint fixes

* fix: Fix tests + text bubble focusing.

This fixed then regressed a circular dependency causing the node and
advanced compilation steps to fail. This investigation is ongoing.

* fix: Clean up & fix imports.

This ensures the node and advanced compilation test steps now pass.

* fix: Lint fixes + revert commented out logic.

* chore: Remove unnecessary cast.

Addresses reviewer comment.

* fix: Some issues and a bunch of clean-ups.

This addresses a bunch of review comments, and fixes selecting workspace
comments.

* chore: Lint fix.

* fix: Remove unnecessary shadow consideration.

* chore: Revert import.

* chore: Some doc updates & added a warn statement.
2025-05-09 08:16:14 -07:00
Aaron Dodson
4dcffa0914 fix: Don't create intermediate variables when renaming a procedure argument. (#8723) 2025-01-08 09:37:28 -08:00
Aaron Dodson
9fcd5a3037 release: Merge branch 'rc/v11.2.0' into rc/v12.0.0 2024-12-04 12:06:12 -08:00
Aaron Dodson
cd1e540cca fix: Disable newly created function call blocks when the corresponding definition is disabled. (#8665) 2024-12-03 13:40:26 -08:00
Christopher Allen
ce22f42868 chore: Organise imports (#8527)
* chore(deps): Add pretter-plugin-organize-imports

* chore: Remove insignificant blank lines in import sections

  Since prettier-plugin-organize-imports sorts imports within
  sections separated by blank lines, but preserves the section
  divisions, remove any blank lines that are not dividing imports
  into meaningful sections.

  Do not remove blank lines separating side-effect-only imports
  from main imports.

* chore: Remove unneded eslint-disable directives

* chore: Organise imports
2024-08-15 03:16:14 +01:00
Christopher Allen
ebb56b2ce8 docs(blocks): block.ts and blocks/* JSDoc / formatting / etc. cleanup (#8431)
* docs(block): Improve documentation for well-known block methods

  Improve the JSDocs for the declarations of well-known block
  methods:

  - getDeveloperVariables
  - compose
  - decompose
  - saveConnections

* docs(blocks): Improve block comments

  Fix JSDoc formatting in both core/block.ts and blocks/*, as well as
  making various other minor improvments.

* chore(blocks): Remove one unexported const
2024-07-25 17:25:24 +01:00
Aaron Dodson
294ef74d1b refactor: Use IVariableModel instead of VariableModel. (#8400)
* refactor: Use IVariableModel methods instead of directly accessing properties.

* refactor: replace references to VariableModel with IVariableModel.
2024-07-19 14:58:04 -07:00
Neil Fraser
4e688bf949 fix: Don't record undo events for enable/disable (#8058)
There's no need to record and replay these events since the change will happen automatically anyway.

Resolves #7951
2024-05-07 20:33:50 +02:00
John Nesky
cee7f916bb feat!: Invalid Blocks (#7958)
* feat: Invalid Blocks

* Rename the new json property from invalid to invalidReasons.

* Merged isValid into isEnabled.

* Minor fixes.

* More minor fixes.

* Reverting some stuff that didn't need to change.

* Addressing PR feedback.

* Update the BlockInfo interface to match State.

* Make BlockChange.disabledReason private.
2024-04-17 19:47:51 -07:00
Beka Westberg
ed403d0b77 feat!: change gestures to look at selected when dragging (#7991)
* feat: change gestures to look at selected when dragging

* chore: fix tests

* chore: format

* chore: PR comments
2024-04-04 08:52:43 -07:00
Christopher Allen
10ffcb706d release: Merge branch 'develop' into rc/v11.0.0 2024-03-18 19:57:04 +00:00
Neil Fraser
0ecbcde9fc chore: Use .includes and .startsWith, not .indexOf (#7936)
Easier to read than the diverse collection of `=== 0` and `!== -1` and `> -1` tests.
2024-03-15 00:03:55 +01:00
Beka Westberg
5db9b5bf11 fix: block initialization (#7777)
* fix: reorganize initialization

* chore: fix failing tests

* fix: tests

* chore: format

* chore: remove console trace
2024-01-23 08:48:08 -08:00
Beka Westberg
75007a064c chore!: delete deprecations for v11. (#7732)
* chore: delete basic deprecations

* chore: remove deprecated align enum

* chore: remove generator deprecation

* chore: format
2024-01-23 08:48:08 -08:00
Christopher Allen
4ab8d00099 refactor(generators): Migrate JavaScript generators to TypeScript (#7602)
* refactor(generators): Migrate javascript_generator.js to TypeScript

* refactor(generators): Simplify getAdjusted

  Slightly simplify the implementation of getAdjusted, in part to
  make it more readable.  Also improve its JSDoc comment.

* refactor(generators): Migrate generators/javascript/* to TypeScript

  First pass doing very mechanistic migration, not attempting to fix
  all the resulting type errors.

* fix(generators): Fix type errors in generator functions

  This consists almost entirely of adding casts, so the code output
  by tsc should be as similar as possible to the pre-migration .js
  source files.

* refactor(generators): Migrate generators/javascript.js to TypeScript

  The way the generator functions are added to
  javascriptGenerator.forBlock has been modified so that incorrect
  generator function signatures will cause tsc to generate a type
  error.

* chore(generator): Format

  One block protected with // prettier-ignore to preserve careful
  comment formatting.

  Where there are repeated concatenations prettier has made a pretty
  mess of things, but the correct fix is probably to use template
  literals instead (rather than just locally disabling prettier).
  This has been added to the to-do list in #7600.

* fix(generators): Fixes for PR #7602

* fix(generators): Fix syntax error
2023-10-30 08:16:13 +00:00
John Nesky
1b2e91246e chore: Use JSON objects for context menu callbackFactory (#7382)
* chore: use json object for context callbackFactory

* Add test file for context menu callback function.
2023-09-08 16:16:59 -07:00
Christopher Allen
b0a7c004a9 refactor(build): Delete Closure Library (#7415)
* fix(build): Restore erroneously-deleted filter function

  This was deleted in PR #7406 as it was mainly being used to
  filter core/ vs. test/mocha/ deps into separate deps files -
  but it turns out also to be used for filtering error
  messages too.  Oops.

* refactor(tests): Migrate advanced compilation test to ES Modules

* refactor(build): Migrate main.js to TypeScript

  This turns out to be pretty straight forward, even if it would
  cause crashing if one actually tried to import this module
  instead of just feeding it to Closure Compiler.

* chore(build): Remove goog.declareModuleId calls

  Replace goog.declareModuleId calls with a comment recording the
  former module ID for posterity (or at least until we decide
  how to reformat the renamings file.

* chore(tests): Delete closure/goog/*

  For the moment we still need something to serve as base.js for
  the benefit of closure-make-deps, so we keep a vestigial
  base.js around, containing only the @provideGoog declaration.

* refactor(build): Remove vestigial base.js

  By changing slightly the command line arguments to
  closure-make-deps and closure-calculate-chunks the need to have
  any base.js is eliminated.

* chore: Typo fix for PR #7415
2023-08-31 00:24:47 +01:00
dependabot[bot]
2546b01d70 chore(deps): Bump prettier from 2.8.8 to 3.0.0 (#7322)
* chore(deps): Bump prettier from 2.8.8 to 3.0.0

Bumps [prettier](https://github.com/prettier/prettier) from 2.8.8 to 3.0.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.8...3.0.0)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: Reformat using Prettier v3.0 defaults

The main change is to add trailing commas to the last line of
block-formatted function calls.

---------

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>
2023-07-25 14:56:10 +00:00
Christopher Allen
ec71261813 refactor(blocks): Migrate blocks/procedures.js to TypeScript (#7192)
* refactor(blocks): Auto-migration of blocks/procedures.js to ts

* fix(blocks): Revert obvious automigration fails in blocks/procedures.js

* fix(blocks): Manually migrate & fix types in procecures.ts

* fix(blocks): Remove lint

* chore(blocks): Format

* fix(7192): Corrections for PR #7192
2023-06-21 21:51:14 +01:00