Commit Graph

612 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
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
8f2228658e feat: Allow customizing GRID_UNIT for the Zelos renderer. (#8636) 2024-11-07 12:16:55 -08:00
Aaron Dodson
2523093cc9 refactor!: Remove the InsertionMarkerManager. (#8649)
* refactor!: Remove the InsertionMarkerManager.

* chore: Remove unused imports.

* chore: Remove import of insertion marker manager test.
2024-11-07 12:15:55 -08:00
Aaron Dodson
9fc693140a fix: Correctly calculate the bounds of hat blocks. (#8616) 2024-10-14 08:19:27 -07:00
Rachel Fenichel
0a6596ce75 feat: mark some marker_svg properties protected instead of private (#8558) 2024-09-03 09:17:42 -07: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
Shreshtha Sharma
64fd9ad89a feat: added blocklyHighlighted CSS class to highlighted block's root… (#8407)
* fix: added 'blocklyHighlighted' CSS class to highlighted block's root svg

* fix: added 'blocklyHighlighted' CSS class to highlighted block's root svg

* fix: added 'blocklyHighlighted' CSS class to highlighted block's root svg

* fix: added 'blocklyHighlighted' CSS class to highlighted block's root svg

* fix: added 'blocklyHighlighted' CSS class to highlighted block's root svg
2024-08-14 09:06:27 -07:00
Adityajaiswal03
59fab944f4 feat: change blocklyEditableText to blocklyEditableField and blocklyNonEditableText to blocklyNonEditableField BREAKING CHANGE: The blocklyEditableText and blocklyNonEditableText identifiers have been renamed to blocklyEditableField and blocklyNonEditableField respectively. This change may require updates to any existing code that references the old identifiers. (#8475) 2024-08-12 13:10:38 -07:00
Chaitanya Yeole
76eebc2f24 feat: Add a blocklyBlock CSS class to the block's root SVG (#8397) 2024-07-22 16:05:19 -07:00
Gabriel Fleury
e29d7abfdb fix!: Rename editing CSS class to blocklyEditing (#8287) (#8301)
* chore!: Rename editing CSS class to blocklyEditing (#8287)

* further changes
2024-07-22 15:38:40 -07:00
Devesh Rahatekar
8cca066bcf feat: Add a blocklyShadow class (#8336)
* feat: Add blockShadow class

* formatted the file
2024-07-17 09:44:24 -07:00
Shashwat Pathak
dd18edd343 fix!: Make IPathObject styling methods optional (#8332) 2024-07-12 09:36:25 -07:00
Aaron Dodson
fa15cda950 feat: allow fetching block bounds not including children. (#8284)
* feat: allow fetching block bounds not including children.

* chore: run formatter.

* chore: run the other formatter.

* fix: don't include subsequent blocks in the childless bounding rect.

* chore: remove logging.
2024-07-10 14:52:07 -07:00
Neil Fraser
5a8969f855 fix: Zelos comments shouldn't be bold (#8141)
Resolves #8061
2024-05-17 21:33:52 +02:00
Maribeth Bottorff
b0c29b8b69 Merge pull request #7993 from google/develop
chore: merge develop into rc/v11
2024-04-04 11:14:18 -07:00
Mike Harvey
9e05d69d2a feat: support keyboard navigation of flyout buttons (#7852)
* feat: support keyboard navigation of flyout buttons

* fix: use FlyoutItem type for flyout contents, rework navigateBetweenStacks for flyouts
2024-04-02 13:40: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
b2b12f42fd merge develop into rc/v11.0.0 2024-02-02 22:14:46 +00:00
Beka Westberg
018df03715 chore: deprecate insertion marker manager and related methods (#7797) 2024-02-02 11:55:14 -08:00
Beka Westberg
702eed42db fix: highlighting connections in zelos, also highlight connections moving (#7795)
* fix: remove zelos highlight override

* feat: add isHighlighted to rendered connection

* feat: add refreshing connection highlighting

* chore: remove highlight and unhighlight connection APIs

* chore: PR comments
2024-02-02 11:55:14 -08:00
Beka Westberg
318621d3c0 feat: add connection highlighting to zelos (#7781)
* feat: add connection highlighting to zelos

* fix: drawing outputs

* chore: cleanup
2024-02-02 11:55:14 -08:00
Beka Westberg
461dfac05a feat: connection highlighting in geras and thrasos (#7698)
* chore: move connection highlighting into the geras renderer

* chore: remove IConnectionHighlighter interface

* chore: format

* chore: fixup

* chore: format

* fix: PR comments
2024-02-02 11:55:14 -08:00
Beka Westberg
2c95c4202c feat: connection highlighter interface (#7638)
* feat: add connection highlighter interface

* fix: remove unnecessary method from the path object interface
2024-02-02 11:55:14 -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
Beka Westberg
b2688441fa chore: fix shouldStartNewRow docs and param names (#7558) 2023-10-18 09:29:08 -07:00
Beka Westberg
5151b28e7d fix: color field sizing being incorrect (#7566) 2023-10-02 13:16:03 -07:00
Neil Fraser
61cdbb65d3 chore: Setting style property to make CSP less grumpy. (#7503)
* Setting style property to make CSP less grumpy.

"Content-Security-Policy: The page’s settings blocked the loading of a resource at inline (“style-src”)."

The 'style' property should be set as an object, not as a string, according to CSP rules.

Back-ported from Blockly Games.
2023-09-19 17:01:14 +02: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
John Nesky
f246adbd26 feat: Parse newlines in JSON message as row separators. (#6944)
* feat: Parse message newlines as endOfRow dummies.

* Fix the multilineinput field test.

* Addressing PR feedback.

* Addressing PR feedback.

* Newline parsing now uses a new custom input.

* npm run format

* Added input_end_row to block factory.

* Addres feedback, fix endrow after external value.
2023-08-11 12:41:49 -07:00
Devansh Varshney (देवांश वार्ष्णेय)
be2a6bb41d feat: Export shape interfaces from ConstantProvider (#7373)
* feat: Export shape interfaces from ConstantProvider

* feat: removed  import/export ConstantProvider
2023-08-11 10:37:31 -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
b189b1989c chore: deprecate minimalist renderer (#7210)
* chore: deprecate the minimalist renderer

* chore: add renamings
2023-06-26 14:30:06 -07:00
Beka Westberg
d7ccf8a5ee fix: input exports (#7165)
* 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>
2023-06-16 11:27:46 -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
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
5b2529a25d fix: updating icon locations (#7110)
* fix: updating icon locations

* fix: updating icon locations after appending

* fix: updating icon locations in deserialization
2023-05-24 12:46:06 -07:00
Beka Westberg
6e3d052100 fix: collapsing blocks with children with icons (#7111)
* fix: collapsing blocks with icons

* chore: add tests for hiding icons of collapsed children
2023-05-22 13:53: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
Rachel Fenichel
b29a5caae6 chore: delete debug renderer (#7078) 2023-05-11 16:09:24 -07:00
Rachel Fenichel
de904ab128 chore: remove deprecated functionality for v10 (#7077)
* chore: remove deprecated functionality in events files

* chore: remove deprecated items in renderers

* chore: remove deprecated items in core

* chore: remove mixin deprecation

* chore: fix tests after removing deprecations
2023-05-11 14:30:54 -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
Beka Westberg
3a9a9bd24e feat: break input types into separate classes (#7019)
* 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
2023-05-04 08:50:45 -07:00
Rachel Fenichel
705a35a2d2 chore: clean up some drawer code lint (#6994)
* chore: clean up some drawer code lint

* chore: remove hungarian notation
2023-04-24 10:38:32 -07:00