Commit Graph

37 Commits

Author SHA1 Message Date
Aaron Dodson
389dd1a1cb chore: Post-merge fixits. 2024-12-04 12:15:19 -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
b73d6156a5 fix: Fix bug that caused comments to be incorrectly positioned. (#8668) 2024-11-21 11:28:27 -08:00
Aaron Dodson
aedcfd6da5 fix: Use a readonly textarea for non-editable comments. (#8632)
* fix: Use a readonly textarea for non-editable comments.

* chore: Run formatter.

* chore: remove old function definition
2024-11-04 09:43:17 -08:00
Christopher Allen
032b5ed9ea refactor(events): Introduce and use event type predicates (#8538)
* refactor(events): Introduce type predicates for event classes

  Introduce predicates for testing Abstract event subclasses based on
  their .type properties.  These are useful because there are places
  where it is not possible to use instanceof <ClassConstructor> tests
  for type narrowing due to load ordering issues that would be caused
  by the need to import (rather than just import type) the class
  constructors in question.

* refactor(events): Use event type predicates

  Simplify several sections of code by using type predicates for
  type narrowing and thereby avoiding the need for explicit casts.

* chore(events): Fix copyright date of recently-added files

* chore: Remove unused import
2024-08-20 19:50:29 +01:00
Christopher Allen
7ccdcc5cef refactor(events): introduce EventType enum in separate module (#8530)
* refactor(events): Use "export ... from" where applicable

* refactor(events): Introduce EventType enum

  Introduce an enum for the event .type values.  We can't actually
  use it as the type of the .type property on Abstract events,
  because we want to allow developers to add their own custom
  event types inheriting from this type, but at least this way we
  can be reasonably sure that all of our own event subclasses have
  distinct .type values—plus consistent use of enum syntax
  (EventType.TYPE_NAME) is probably good for readability overall.

  Put it in a separate module from the rest of events/utils.ts
  because it would be helpful if event utils could use

      event instanceof SomeEventType

  for type narrowing but but at the moment most events are in
  modules that depend on events/utils.ts for their .type
  constant, and although circular ESM dependencies should work
  in principle there are various restrictions and this
  particular circularity causes issues at the moment.

  A few of the event classes also depend on utils.ts for fire()
  or other functions, which will be harder to deal with, but at
  least this commit is win in terms of reducing the complexity
  of our dependencies, making most of the Abstract event subclass
  module dependent on type.ts, which has no imports, rather than
  on utils.ts which has multiple imports.
2024-08-20 08:36:33 +01: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
Gabriel Fleury
9ba791c144 bug: Rename the blockly icon CSS classes to use camelCase (#8329) (#8335) 2024-07-12 09:34:42 -07:00
Aaron Dodson
989c91f626 feat!: Add support for preserving block comment locations. (#8231)
* feat: Add support for preserving block comment locations.

* chore: format the tests.
2024-06-27 11:11:45 -07:00
Richard Knoll
4861c7d98a fix: prevent duplication of comment icon bubbles (#8053) 2024-05-02 08:38:40 -07:00
Beka Westberg
2fa6f5b954 fix: comment icon interface re serialization (#7964)
* fix: comment icon interface re serialization

* chore: fix test
2024-04-01 14:34:48 -07:00
Beka Westberg
8821c83cc9 feat: allow overriding comment icons (#7937)
* feat: add comment icon interface

* feat: have blocks construct comment icons from registry

* chore: add tests for setCommentText

* fix: typeguard
2024-03-15 18:20:08 +00: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
Beka Westberg
b1ef6ae601 feat!: modify icons to use the rendering queue (#7743) 2024-01-23 08:48:08 -08:00
Maribeth Bottorff
a3053955d3 feat: make fields and icons optionally clickable in flyouts (#7672)
* feat: add ability to click fields in flyouts

* feat: control if icons are clickable in flyouts

* fix: make default icons not clickable in flyout

* fix: use booleans like a real programmer
2023-12-06 19:02:45 +00:00
Siddheya Kulkarni
1b498681dd feat: add css classes to icons (#7626)
* Update comment_icon.ts

* Update mutator_icon.ts

* Update warning_icon.ts

* Update comment_icon.ts

* Update mutator_icon.ts

* Update warning_icon.ts

* Update core/icons/comment_icon.ts

Co-authored-by: Beka Westberg <bwestberg@google.com>

* Update mutator_icon.ts

* Update warning_icon.ts

---------

Co-authored-by: Beka Westberg <bwestberg@google.com>
2023-11-02 08:25:24 -07:00
Apoorv Garg
37bfcbc31e Fix: #7557 (#7622) 2023-10-31 11:40:15 -07:00
Beka Westberg
910abf1bb8 feat: add tooltip support for icons (#7608) 2023-10-31 10:44:49 -07:00
Trey Pisano
6b023b3a32 fix: comment change event fires block change event (#7505)
* add fire event to comment change

* change variable names to make readable

* add oldtext field to commenticon

* remove debugger

* remove oldtext field

* add firing block change event to setText

* add fire to setText

* fix: setCommentText fire block change when icon removed

* remove whitespace

* NOT PASSING TESTS: fix block test fails

* fix: remove duplicate events so tests pass

* fix: remove whitespace

* fix: run format

* refactor: add early returns to onTextChange for readability

* remove console.log

* disable events temporarily when setText called in setCommentText

* refactor: move fire event to original position

* fix: run format

* fix: move fire event so it happpens after events are enabled and disabled
2023-10-02 13:14:12 -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
Beka Westberg
82f6ca5766 fix: saveConnections listener not being disposed (#7407) 2023-08-17 11:39:09 -07: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
Beka Westberg
8355351898 fix: add compose and decompose errors to mutator icon (#7289)
* fix: add compose and decompose errors to mutator icon

* chore: format
2023-07-13 17:18:48 -07:00
Beka Westberg
452abd4b93 chore: add setVisible (#7214)
* chore: add setVisible

* chore: format
2023-06-27 13:09:10 -07:00
Beka Westberg
a4ba65abf7 chore: make getWorkspace public (#7195) 2023-06-21 17:14:25 -07:00
Beka Westberg
91e8105e81 chore: add top-level inline docs to bubbles icons and inputs (#7190)
* chore: add top-level inline docs to bubbles icons and inputs

* chore: fixup for PR comments
2023-06-21 10:14:25 -07:00
Beka Westberg
aeee278767 fix: remove old icon handling code (#7141)
* fix: remove old icon handling code

* fix: remove calls to getCommentIcon

* chore: delete the old icon class
2023-06-13 15:41:07 -07:00
Beka Westberg
0cfd388a5d feat: add types for accessing icons. (#7132)
* feat: add types for accessing icons.

* chore: PR comments
2023-06-13 14:39:36 -07:00
Beka Westberg
3e9d892934 chore: fix hiding bubbles on collapse (#7142)
* chore: fix hiding bubbles on collapse

* chore: format
2023-06-13 13:19:40 -07:00
Beka Westberg
2f74ce822f fix!: refactor mutator icon (#7115)
* 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
2023-06-02 12:18:41 -07:00
Beka Westberg
50d9474db5 fix!: refactor comment icon (#7128)
* fix: add basic comment icon

* fix: add using comment icon

* chore: delete old comment icon

* chore: add docs to the comment icon

* chore: move Comment to icons.CommentIcon

* chore: mode properties to module level

* chore: properly override and call super

* chore: remove .comment and .commentIcon_

* chore: cleanup test

* chore: deprecate getCommentIcon and getCommentText

* chore: change imports to import type

* chore: refactor code for paren peace

* chore: fix lint and make it error

* chore: remove change to block JS file

* chore: fix css

* chore: add renamings

* chore: format
2023-06-02 09:53:05 -07:00
Beka Westberg
f4e378d096 fix!: refactor warning icon (#7112)
* feat: add basic warning icon

* feat: work on actually using the warning icon

* chore: add docs

* chore: delete old warning icon

* chore: fix build

* chore: my own comments

* chore: move Warning to icons.WarningIcon

* chore: move properties to the module level

* chore: properly override and call super

* chore: properly use optional chaining

* chore: fixup comment typo

* chore: change imports to import type

* chore: reduces changes in block js files

* chore: add renaming
2023-06-02 09:34:34 -07:00
Beka Westberg
4dc2869778 fix: work on calling icon hooks (#7100)
* fix: work on calling icon hooks

* chore: PR comments

* chore: format
2023-05-19 15:36:44 -07:00
Beka Westberg
f2221652d2 feat: add registering and serializing icons (#7063)
* feat: add registry for icons

* feat: add serialization of custom icons

* feat: add deserialization of custom icons

* chore: fixup deserialization

* chore: export icons registry

* chore: add tests for serialization and deserialization

* chore: move mocks and helpers to the top level

* chore: fix doc error

* chore: remove accidental only
2023-05-15 09:03:04 -07:00
Beka Westberg
8b0c40bb1b feat: add implementations for adding, removing, and getting icons (#7059)
* feat: add implementations for adding, removing, and getting icons

* chore: fix tests

* chore: switch order of adding icons

* chore: create duplicate icon error

* chore: un-only test
2023-05-11 15:48:01 -07:00
Maribeth Bottorff
88ff901a72 chore: use prettier instead of clang-format (#7014)
* chore: add and configure prettier

* chore: remove clang-format

* chore: remove clang-format config

* chore: lint additional ts files

* chore: fix lint errors in blocks

* chore: add prettier-ignore where needed

* chore: ignore js blocks when formatting

* chore: fix playground html syntax

* chore: fix yaml spacing from merge

* chore: convert text blocks to use arrow functions

* chore: format everything with prettier

* chore: fix lint unused imports in blocks
2023-05-10 16:01:39 -07:00
Beka Westberg
39cdd8a67a feat: add abstract icon class (#7060)
* chore: rename icon to old icon

* feat: add abstract icon class

* chore: format

* chore: move icon class to icons directory

* chore: switch imports to import type
2023-05-09 23:42:58 +00:00