Commit Graph

53 Commits

Author SHA1 Message Date
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
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
Beka Westberg
af991f5e1b fix: switch most remaining render calls to queueRender (#7024)
* chore: remove render call from procedure blocks

* chore: have workspace queue renders when unhiding

* chore: remove forced rendering from flyouts

* chore: change mutators to use queueing

* chore: change shadows to use queueing

* chore: add comments about icon rendering
2023-05-09 16:57:11 -07:00
Neil Fraser
64aa3e7df4 feat: Add 'reason' field to move event (#6996)
* feat: Add 'reason' field to move event

There are many types of move.  This addition allows one to detect what the reason for each move is.

* Clang formatting.

And unsaved editor tabs.

* Change reason string to array.
2023-04-26 00:22:10 +02:00
Neil Fraser
20f0c937cd chore: 'compareDocumentPosition' to 'contains' (#6982)
The 'compareDocumentPosition' call was inherited from Closure Library, in order to work with IE 8 and earlier.  Use the more modern 'contains' call instead.

This change was originally added here:
https://github.com/google/blockly/pull/1991

Remove the DOCUMENT_POSITION_CONTAINED_BY constant which is not a NodeType and should never have been part of that enum.

This change was originally added here:
https://github.com/google/blockly/pull/2736
2023-04-17 23:48:24 +02:00
Maribeth Bottorff
2bbb3aa1fc fix: do not hide all chaff when resizing (#6916) 2023-04-17 10:06:44 -07:00
Neil Fraser
6f64d1801a fix: Don't clober event group when renaming vars (#6829)
* fix: Don't clober event group when renaming vars

Also audit all existing event group commands and tweak a few of them where I think there's a potential issue.
2023-03-17 12:09:51 -07:00
Neil Fraser
42fde0f81b chore: Reduce delta on ports to blockly-samples (#6886)
* Reduce usage of obsolete .keyCode property.
* Rename private properties/methods which violate eslint rules.
* Use arrays of bound events rather than individual properties.
* Improve typing info.
* Also fix O(n^2) recursive performance issue in theme's getComponentStyle function.
* And replace String(...) with '${...}' (smaller, faster).
* .toString() is considered harmful.
2023-03-15 13:28:57 -07:00
Aaron Dodson
17064a1c39 chore: Remove various IE hacks and workarounds (#6781)
* chore: Remove IE-specific hacks from flyout_base.ts.

* chore: Remove IE hacks from workspace_svg.ts.

* chore: Remove IE hacks from css.ts.

* chore: Remove IE hacks from xml.ts.

* chore: Remove IE hacks from grid.ts.

* chore: Remove errant logging from flyout_base.ts.

* chore: Remove obsolete comments about IE from bootstrap.js.

* chore: Remove reference to IE from README.

* chore: Clean up trailing spaces in bootstrap.js.
2023-03-14 11:26:38 -07:00
Maribeth Bottorff
cdb1215d95 revert: "refactor: Remove block and workspace drag surfaces (#6758)" (#6888)
This reverts commit 332c0fd2f2.
2023-03-09 13:43:12 -08:00
Rachel Fenichel
1d1a927628 chore: remove alias comments (#6816)
* chore: remove alias comments

* chore: format

* chore: remove extra newlines

* chore: fix bad replaces
2023-02-06 10:08:55 -08:00
Aaron Dodson
c1b2ddb96f feat: Add support for centering on a block itself vs its stack. (#6810)
* feat: Add support for centering on a block itself vs its stack.

* fix: Make centerOnBlock test actually call it.
2023-02-01 14:46:28 -08:00
Aaron Dodson
332c0fd2f2 refactor: Remove block and workspace drag surfaces (#6758)
* 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.

* fix: Remove arg inadvertently reintroduced in merge
2023-01-20 11:55:28 -08:00
Aaron Dodson
90cb965e7c refactor: Migrate to PointerEvents (#6598)
* refactor: Remove checks for PointerEvent support.

* refactor: Deprecate and remove calls to splitEventByTouches.

* refactor: Deprecate and remove calls to setClientFromTouch().

* refactor: Use PointerEvent in place of Event/MouseEvent/TouchEvent/PseudoEvent.

* refactor: Update references to mouse/touch events in code and documentation to reference pointer events.

* refactor: Merge Gesture and TouchGesture

* chore: clang-format changed files

* refactor: Bind and expect PointerEvents instead of MouseEvents.

* refactor: Rename TouchGesture to Gesture.

* fix: Fix test failures.

* chore: clang-format changed files.

* fix: Fix errant _ from merging

* refactor: Clean up dead code in browser_events.ts.

* chore: Update version in deprecation notices to reflect release schedule

* fix: Fixed a bug that caused the browser context menu to not be suppressed in Chrome.

* fix: Re-export Gesture as TouchGesture for backwards compatibility.

* refactor: Deprecate and remove uses of opt_noPreventDefault.

* chore: Fix error message in gesture.ts.

* chore: Removed obsolete todo.
2022-12-05 11:27:52 -08:00
Neil Fraser
1cccc3cb4a docs: make three methods not internal (#6666)
Amusingly Flyout.isVisible and .setVisible are public, but there's no way to access a flyout given that getFlyout was not public.
2022-12-01 08:46:21 -08:00
Rachel Fenichel
ab9825cfaf chore: remove underscores from some private properties and methods (#6537)
* chore: rename properties to remove underscores in zoom_controls.ts

* chore: remove underscores from private methods in zoom_controls.ts

* chore: fix underscores in private property names in ws_svg

* chore: format
2022-10-12 16:07:13 -07:00
Beka Westberg
d3447ea565 fix!: Update deprecations for the new release. (#6470)
* chore: bump early deprecations to v10

* fixup

* fixup

* chore: remove deprecated properties

* chore: add missing @deprecated tags

* chore: format

* chore: format

* chore: fix import
2022-10-03 11:21:52 -07:00
Beka Westberg
8530e6d537 fix: adding and removing css classes that contained spaces (#6455)
* fix: adding CSS classes

* fix: removing css classes

* fix: add a test for multiple icon classes

* chore: format
2022-09-28 15:51:17 -07:00
Neil Fraser
e5dcb766bd chore: Remove radix from parseInt, simplify Blockly.utils.dom methods, use Unicode characters. (#6441)
* chore: remove radix from parseInt

Previously any number starting with '0' would be parsed as octal if the radix was left blank.  But this was changed years ago.  It is no longer needed to specify a radix.

* chore: 'ID' is identification

'id' is a part of Freud's brain.

* Use Unicode characters instead of codes

This is in line with the current style guide.

* Simplify Blockly.utils.dom methods.

classList add/remove/has supports SVG elements in all browsers Blockly supports (i.e. not IE).
2022-09-22 06:59:24 -07:00
Rachel Fenichel
5f11f3449f fix: remove calls to removeClass and hasClass (#6413)
* fix: stop using dom.addClass in most cases

* chore: format

* fix: remove use of dom.addClass in toolbox

* chore: lint and format

* fix: add checks around non-constant class names

* fix: switch back to quoted access

* chore: format

* fix: remove calls to removeClass

* chore: format

* chore: remove unused deps

* fix: remove uses of hasClass

* chore: format and lint

* chore: format
2022-09-13 08:33:49 -07:00
Rachel Fenichel
55ea12bd21 fix: stop using is3dSupported (#6400)
* fix: remove prefix checks from is3dSupported

* fix: stop using is3dSupported

* chore: mark is3dSupported deprecated

* chore: fix lint
2022-08-31 12:59:16 -04:00
Maribeth Bottorff
60bc01acc8 fix: make eventUtils throw if event type not registered (#6381)
* chore: update lint rules

* fix: have eventUtils.get throw if event isn't found

* chore: remove nonnull assertion from eventUtils.get and format
2022-08-24 13:41:32 -07:00
Aaron Dodson
1f6481e527 chore: Removed commented-out side-effect-only imports. (#6379) 2022-08-24 11:28:09 -07:00
Maribeth Bottorff
037eb59b89 chore: Lint TsDoc. (#6353)
* chore: add linting for tsdoc

* chore: don't require types on return

* chore: remove redundant fileoverview from ts

* chore: change return to returns and add some newlines

* chore: remove license tag

* chore: don't require params/return docs

* chore: remove spurious struct tags

* Revert "chore: change return to returns and add some newlines"

This reverts commit d6d8656a45.

* chore: don't auto-add param names

* chore: disable require-param bc it breaks on this

* return to returns and add line breaks

* chore: configure additional jsdoc rules

* chore: run format

* Revert "chore: remove license tag"

This reverts commit 173455588a.

* chore: allow license tag format

* chore: only require jsdoc on exported items

* chore: add missing jsdoc or silence where needed

* chore: run format

* chore: lint fixes
2022-08-23 14:27:22 -07:00
Aaron Dodson
9454b7070c refactor: Remove uses of AnyDuringMigration from scrollbar.ts, workspace_svg.ts, contextmenu_registry.ts, and component_manager.ts (#6318)
* refactor: Remove uses of AnyDuringMigration from scrollbar.ts.

* refactor: Remove almost all uses of AnyDuringMigration from workspace_svg.ts.

* refactor: Remove uses of AnyDuringMigration from contextmenu_registry.ts.

* refactor: Remove uses of AnyDuringMigration from component_manager.ts.

* refactor: Use String() rather than toString().

* fix: Fix lint and build errors.
2022-08-22 11:04:11 -07:00
Maribeth Bottorff
49f87fba79 chore: enable linting ts files (#6351)
* chore: initial setup for linting ts

* chore: Temporarily disable most of the rules causing problems

* chore: fix autofixable problems.

* chore: ignore the last few files and rules

* chore: fix remaining lint errors

* chore: fix more small lint

* chore: run original rules on js files, new ts rules on ts files

* chore: use jsdoc style return in js files

* chore: add lint fix script

* chore: fix prefer-spread lint

* chore: fix no-invalid-this rule

* chore: fix no-unused-vars

* chore: fix trashcan lint
2022-08-16 13:59:15 -07:00
Aaron Dodson
bef2ac41a0 refactor: Remove uses of AnyDuringMigration and fix types in BlocklyOptions/Options. (#6315) 2022-08-05 09:22:34 -07:00
Beka Westberg
dc44c66057 refactor: remove AnyDuringMigration from browser events (#6303)
* fix: bind data

* fix: use correct event types

* fix: make event happy with us clueging properties onto it

* fix: change thisObject to type Object | null

* chore: format

* chore: call out event conversion wierdness

* chore: fix build by changing things to use MouseEvent

* chore: remove default value for object

* fix: unbind trying to get an element of an empty array

* chore: format

* fix: call out potentially unsafe element access.

* chore: add issue number to TODO

* fix: attempt to fix CI build error?
2022-08-04 10:35:02 -07:00