Commit Graph

79 Commits

Author SHA1 Message Date
Aaron Dodson
eeef2edf34 chore!: Fix warnings when generating docs. (#8660) 2025-01-06 10:53:45 -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
5870c66cf0 chore: Migrate ESLint configuration file to new flat format. (#8675)
* chore: rename .eslintrc.js to eslint.config.js

* chore: Rename eslint.config.js to eslint.config.mjs.

* refactor: Migrate ESLint config to new flat format.

* chore: Remove old per-directory and global ignore ESLint config files.

* fix: Allowlist JSDoc tag aliases.

* fix: Don't require @license in tests/*.

* fix: Add NodeJS globals to several files that run under Node.

* chore: Remove now-unneeded ESLint directives in core.

* chore: Remove invalid/unneeded ESLint directives.

* fix: Fix invalid use of `await` outside of an `async` function.

* fix: Improve screenshot error message.

* fix: Update ESLint config file to not warn on existing violations.

* chore: Remove suppressions of rules that weren't triggering.

* chore: Fix package-lock.json.
2024-12-03 12:40:48 -08:00
John Nesky
4230956244 fix: Create CSS vars for SVG patterns. (#8671) 2024-12-02 13:34:05 -08:00
Aaron Dodson
61bbd7dbf6 chore: Remove underscores from private fields. (#8682)
* chore: Remove underscores from private fields.

* refactor: Use public APIs in tests where possible.
2024-12-02 11:33:05 -08:00
Aaron Dodson
e5c1a89cdf fix: Fix bug that caused fields in the flyout to use the main workspace's scale. (#8607)
* fix: Fix bug that caused fields in the flyout to use the main workspace's scale.

* chore: remove errant param in docs.
2024-10-02 08:18:47 -07:00
Aaron Dodson
c79610cea6 refactor: remove redundant flyout positioning. (#8573)
* refactor: remove redundant flyout positioning.

* fix: handle the case where there is a flyout without a toolbox
2024-09-18 11:58:39 -07:00
John Nesky
561b4189fb fix: Factor out workspace drag methods into utils. (#8566) 2024-09-13 12:53:37 -07:00
Ben Henning
05795a06ea Rename 'tidyUp' back to 'cleanUp'. 2024-09-03 23:13:50 +00:00
Ben Henning
fbafda3e4c Merge branch 'develop' into ensure-immovable-blocks-are-considered-during-workspace-tidying 2024-09-03 23:02:37 +00:00
Christopher Allen
724828f689 refactor: Use arrow functions when calling Array.prototype.filter (#8557) 2024-08-30 17:23:23 +01:00
Ben Henning
0413021b7c Auto-fix formatting issues to address CI failure. 2024-08-21 21:02:07 +00:00
Ben Henning
ca42a4b4fd Merge branch 'develop' into ensure-immovable-blocks-are-considered-during-workspace-tidying 2024-08-21 17:44:37 +00:00
Ben Henning
3a3e83fe44 Fix workspace clean up not considering immovables.
At a high-level, this change ensures that cleaning up a workspace
doesn't move blocks in a way that overlaps with immovable blocks. It
also adds missing testing coverage for both Rect (used for bounding box
calculations during workspace cleanup) and WorkspaceSvg (for verifying
the updated clean up functionality).

This also renames the clean up function to be 'tidyUp' since that better
suits what's happening (as opposed to other clean-up routines which are
actually deinitializing objects).
2024-08-21 17:41:38 +00: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
dependabot[bot]
f57ef73aaf chore(deps): bump @typescript-eslint/eslint-plugin from 7.17.0 to 8.0.1 (#8479)
* chore(deps): bump @typescript-eslint/eslint-plugin from 7.17.0 to 8.0.1

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 7.17.0 to 8.0.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.0.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

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

* fix: lint plugin versions

* chore: fix linting

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Beka Westberg <bwestberg@google.com>
2024-08-14 09:10:34 -07:00
Jeremiah Saunders
731fb40faa feat: implement WorkspaceSvg class manipulation (#8473)
* Implement addClass and removeClass functions

* feat: implement `WorkspaceSvg` class manipulation

* Update core/workspace_svg.ts

* Update core/workspace_svg.ts
2024-08-13 11:14:05 -07: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
Maribeth Moffatt
7c6fbec23c Merge branch 'osd' into merge-osd 2024-05-23 10:59:53 -07:00
John Nesky
9b2ab79e73 fix: Only hide WidgetDiv if it is associated with the affected workspace. (#8150)
* Associate a workspace with WidgetDiv.

* Minor fixes after merging.

* Hide widget if owner is in an unknown workspace.
2024-05-20 12:48:05 -07:00
Beka Westberg
7d8f88a4f1 chore: delete old comments (#8038)
* chore!: delete old comment classes and references

* chore: PR comments
2024-04-17 14:33:36 -07:00
Beka Westberg
e21bb99ff1 feat!: Add context menu options for workspace comments (#8035)
* feat: add context menu support and migrate easy options

* feat: pass events to context menu options

* chore: migrate final comment context menu option

* feat: add exports for comment context menu items

* chore: PR comments
2024-04-17 13:02:53 -07:00
Beka Westberg
dabb11f4cb feat!: add ability to copy and paste workspace comments (#8024)
* chore: add support for copying and pasting workspace comments

* chore: fix build

* fix: PR comments
2024-04-15 14:43:58 -07:00
Beka Westberg
613c7335ee chore: export some types and methods (#8021) 2024-04-11 08:38:50 -07:00
Beka Westberg
da8a83b925 feat: have the gesture use a dragger for blocks (#7972)
* feat: have block use drag strategy

* fix: gesture to use dragger for blocks

* chore: register dragger

* chore: remove getInsertionMarkers and pull logic into workspace
2024-03-28 17:38:58 -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
48228e47e3 chore: merge develop into v11 to fix CI (#7893)
* fix: destroy connection highlight when the connection is disposed (#7830)

* fix: fix reference docs toc generation (#7832)

* fix: insertion marker previewer finding wrong connection for different conn counts (#7833)

* feat: make grid options togglable (#7828)

* chore(deps): Bump prettier from 3.1.1 to 3.2.5 (#7831)

Bumps [prettier](https://github.com/prettier/prettier) from 3.1.1 to 3.2.5.
- [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/3.1.1...3.2.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: disposing of connection previewer (#7834)

* fix: typo in Click event class docs

* chore: rollup of updates from translatewiki for 10.4.0 (#7856)

* chore: update metadata for v10.4.0 (#7857)

* release: update version number to 10.4.0

* fix: connection previewer disposing too early

* Merge pull request #7859 from BeksOmega/fix/previewer-disposing

fix: connection previewer disposing too early
(cherry picked from commit da3ec253bf)

* release: update version number to 10.4.1

* chore: move connection previewer out of subfolder (#7835)

* chore(deps-dev): Bump undici from 5.26.3 to 5.28.3 (#7862)

Bumps [undici](https://github.com/nodejs/undici) from 5.26.3 to 5.28.3.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.26.3...v5.28.3)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: update webdriverio to fix chrome endpoint issue (#7875)

* fix: insertion marker drag scaling (#7874)

* fix: insertion marker drag scaling

* chore: added docs for other params

* fix: restore respecting snap radius (#7873)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Maribeth Bottorff <maribethb@google.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Elvis Adomnica <elvis.adomnica@gmail.com>
Co-authored-by: Rachel Fenichel <fenichel@google.com>
2024-03-08 14:24:58 -08:00
Beka Westberg
bb8b2728e7 feat: make grid options togglable (#7828) 2024-02-07 11:48:09 -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
Ananta Bastola
0836a1db10 fix: release dummy wheel listener on workspace dispose (#7693)
fix #7674
2023-12-05 09:42:35 -08:00
Beka Westberg
02cd1c6a1b fix: blocks being dragged behind toolbox (#7619)
* fix: add layer manager to fix dragging

* chore: fix block animations

* chore: add tests

* chore: format
2023-11-08 15:25:45 -08:00
Sophie Nguyen
31a323a17b Feat: Added an API to programmatically scroll the workspace (#7532)
* Feat: Added an API to programmatically scroll the workspace

Feat: Added an API to programmatically scroll the workspace

* Feat: Added an API to programmatically scroll the workspace
2023-09-23 09:53:15 -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
Rachel Fenichel
d6d1074f51 chore: make ordered argument optional for workspace_svg functions (#7425) 2023-08-22 11:24:11 -07:00
Beka Westberg
b602f2163b feat: add accessors for the workspace svg group and block canvas (#7394) 2023-08-16 16:56:54 -07:00
Beka Westberg
bb33531854 deprecate: workspace paste (#7356)
* fix: deprecate paste

* chore: add deprecation tag

* fix: add import lost in rebase

* chore: PR feedback

* chore: fix @deprecated tag
2023-08-15 13:12:12 -07:00
Beka Westberg
1a41891bbe feat: merge copy paste work into develop
Merge pull request #7379 from google/operation-copy-that
2023-08-11 11:47:15 -07:00
Beka Westberg
a901c62d0c fix: bumping copied objects (#7349)
* fix: add logic for bumping pasted blocks

* chore: add tests for bumping pasted blocks to the correct location

* fix: add logic for bumping pasted comments

* chore: add tests for bumping pasted comments
2023-08-09 10:31:29 -07:00
Beka Westberg
0ac86c7e68 fix: dedeprecate render functions (#7359) 2023-08-08 10:06:03 -07:00
Beka Westberg
001d9ff2c9 feat: make ICopyable generic and update clipboard APIs (#7348)
* chore: rename module-local variables to not conflict

* feat: make ICopyable generic and update clipboard APIs

* chore: switch over more things to use generic ICopyables

* chore: fix shortcut items using copy paste

* chore: add test for interface between clipboard and pasters

* chore: export isCopyable

* chore: format

* chore: fixup PR comments

* chore: add deprecation tags
2023-08-03 15:33:58 -07:00
Beka Westberg
7118dd3e4f chore: remove old render management system (#7308) 2023-07-27 16:08:45 -07:00
Beka Westberg
c8be2f2538 fix: make insertion markers use new render management system (#7307) 2023-07-26 14:52:10 -07:00
Beka Westberg
435e854b8e fix: make deserialization use the new render management system (#7306)
* fix: make JSON use render queue

* fix: updating disabled for JSON system

* fix: make XML use render queue

* chore: make flyout use render queue explicitly
2023-07-26 14:01:19 -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
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
42b8c6e3ab fix: return annotations (#7118)
* chore: remove suppress annotations

* chore: remove fileoverview annotation

* chore: remove other unused annotations

* chore: change return to returns

* chore: enable tag linting
2023-05-24 13:01:33 -07:00
Beka Westberg
455c1957b8 fix!: re-remove block and workspace drag surfaces (#7070)
* refactor: Remove BlockDragSurface.

* refactor: Remove WorkspaceDragSurfaceSvg.

* chore: Remove drag surface-related CSS.

* chore: Removed unused variable in block_dragger.ts.

* chore: Remove references to drag surfaces in comments.

* refactor: Only track icons with visible bubbles for position updates during a drag.

* fix: Remove rendundant condition.

* chore: fixup parameter from rebase

---------

Co-authored-by: Aaron Dodson <adodson@google.com>
2023-05-11 16:51:46 -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