Commit Graph

4166 Commits

Author SHA1 Message Date
Maribeth Bottorff
a0b565724b feat: make field initView and initModel more accessible (#7345)
* chore: update loop style to remove any type

* feat: make initView protected and initModel public

* feat: make image element in image field protected
2023-08-08 10:18:51 -07:00
Beka Westberg
0ac86c7e68 fix: dedeprecate render functions (#7359) 2023-08-08 10:06:03 -07:00
Beka Westberg
2ac13b5a28 feat: have the trashcan hide scrollbars when the flyout opens (#7357) 2023-08-04 08:57:33 -07:00
देवांश वार्ष्णेय
dbe926db4a fix: removed X & Y from toolbox.ts and replaced movBy to moveTo (#7333)
* fix: removed X & Y from toolbox.ts and replaced movBy to moveTo in Horizontal/ Vertical flyout

* forget to run npm lint and format

* removed the mistakenly added comment
2023-08-04 08:47:30 -07:00
FangQiJun
f3899e21a5 fix(blocks): boolean variable block wrong shape for zelos (#7335)
* fix(blocks): boolean variable block wrong shape for zelos

* fixup! fix(blocks): boolean variable block wrong shape for zelos
2023-07-31 10:39:57 -07:00
Beka Westberg
c3aa970107 feat: add the ability to toggle scrollbar visibility (#7314) 2023-07-28 08:35:29 -07:00
Beka Westberg
7118dd3e4f chore: remove old render management system (#7308) 2023-07-27 16:08:45 -07:00
Maribeth Bottorff
734b687f40 chore(tests): Update RTL tests and misc improvements to helpers (#7293)
* chore(tests): make switch to rtl wait before continuing

* chore: use browser.pause

* chore: fix documentation

* chore: format

* fix: missing await
2023-07-27 01:03:42 +00: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]
3d9f3a9588 chore(deps): Bump @typescript-eslint/eslint-plugin from 5.59.11 to 6.1.0 (#7320)
* chore(deps): Bump @typescript-eslint/eslint-plugin from 5.59.11 to 6.1.0

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.59.11 to 6.1.0.
- [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/v6.1.0/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>

* chore: disable duplicate enum rule in keycodes file

---------

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>
2023-07-25 10:39:06 -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
36ba408b79 fix: have icons use the new render management system (#7296)
* feat: add method for triggering renders

* chore: switch icon methods to use queue
2023-07-24 14:43:14 -07:00
Christopher Allen
1bc4f67d78 fix: Correct errors in HSV_SATURATION, HSV_VALUE accessors (#7297)
* fix: Correct errors in HSV_SATURATION, HSV_VALUE accessors

  Fix the comment / message errors noted in
  https://github.com/google/blockly/pull/7249#issuecomment-1638645810

* chore: Add renamings for HSV_SATURATION, HSV_VALUE
2023-07-17 21:00:06 +01:00
Christopher Allen
d503fbb409 fix(generators): Changes to exports and access controls for TypeScript compatibility (#7295)
* fix(generators): Add missing declarations for Order enums

* chore(generators): Remove spurious whitespace

* fix(generators): Make provideFunction_ etc. public

  Remove the protected declaration on provideFunction_ and
  FUNCTION_NAME_PLACEHOLDER_ so they can be used from generator
  functions written in TypeScript.

  Not strictly part of #7283, but closely related and required to
  fixing the related issue google/blockly-samples#1785.

* chore(generators): format
2023-07-17 20:40:27 +01: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
John Nesky
75ea8d9941 fix: disposing workspace comments. (#7264)
* fix: disposing workspace comments.

* whitespace formatting
2023-07-10 09:18:42 -07:00
Beka Westberg
28b08ea306 chore: add css classes to individual zoom controls (#7261) 2023-07-07 14:19:17 -07:00
Beka Westberg
07ba841850 chore: add test helpers for connecting blocks (#7258)
* chore: get procedure test passing on linux

* chore: cleanup

* chore: format
2023-07-06 15:35:58 -07:00
Christopher Allen
a677355f73 fix: Restore HSV_SATURATION and HSV_VALUE accessors and deprecate (#7249)
* fix: Restore HSV_SATURATION and HSV_VALUE accessors

Contrary to the notice at the top of the `Object.defineProperties`
call, these were not actually marked as deprecated, and their
removal in Blockly 10.0.0 constituted an avoidable zero-notice
breaking change.

* deprecate: Add deprecation notices for HSV_SATURATION and HSV_VALUE

DEPRECATION:

Blockly.HSV_SATURATION and Blockly.HSV_VALUE are deprecated and
will be removed in a future version of Blockly.  Use
Blockly.colour.getHsvSaturation / Blockly.colour.setHsvSaturation
and Blockly.colour.getHsvValue / Blockly.colour.setHsvValue instead.
2023-07-05 09:04:49 -07:00
jayway
57fdb71ad9 fix: set flyout visbility on calling setExpanded (#7199)
* fix: set flyout visbility on calling setExpanded

* move setVisible to only set false when category is no longer expanded
2023-07-05 08:24:03 -07:00
Beka Westberg
a2672a4fe6 chore: delete drag surface files (#7216) 2023-06-29 14:00:24 -07:00
Rachel Fenichel
2d27105e3c chore: delete unused fuction clearTransformAttributes_ (#7229) 2023-06-29 13:54:37 -07:00
Rachel Fenichel
55decfe7c9 chore: delete unused function getFirstStatementConnection (#7228) 2023-06-29 20:37:10 +00:00
Beka Westberg
452abd4b93 chore: add setVisible (#7214)
* chore: add setVisible

* chore: format
2023-06-27 13:09:10 -07: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
d6848de645 fix: export the IIcon and related interfaces (#7203)
* fix: export the IIcon interface

* fix: export ISerializable interface

* fix: export IHasBubble interface
2023-06-23 14:26:32 -07:00
Beka Westberg
a4ba65abf7 chore: make getWorkspace public (#7195) 2023-06-21 17:14:25 -07:00
Beka Westberg
5ee9003044 fix: bubble exports (#7189)
* fix: bubble exports

* chore: delete the old bubble
2023-06-21 11:26:22 -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
5f2e143ab8 chore: allow themes to override eachother (#7188) 2023-06-21 08:26:01 -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
2d3aec45f6 fix: icon exports (#7159) 2023-06-16 10:59:36 -07:00
John Nesky
b8ad7d307f feat: use new intermediate block change event for field edits, normal block change event for closing editor. #7105 (#7151)
* Copy core/events/events_block_change.ts to core/events/events_block_field_intermediate_change.ts

* New intermediate event type for field edits.

* Addressing PR feedback.

* Ran npm run format.

* Fixed procedure mutator responding to param edits.

* Intermediate events now inherit from BlockBase.

* Addressing feedback on PR.

* chore: format
2023-06-16 09:27:56 -07:00
Maribeth Bottorff
cb8ed73c48 fix: update disabled status after rendering (#7172)
* fix: update disabled status after rendering

* fix: add test for json disabled
2023-06-15 15:31:40 -07:00
Christopher Allen
a3458871db refactor(generators)!: Pass this CodeGenerator to individual generator functions (#7168)
* feat(generators): Pass this CodeGenerator to generator functions

  This implements option 1A of proposal 1 of #7086.

  This commit is not by itself a breaking change, except in the unlikely event that
  developers' custom generator functions take an (optional) second argument of a
  dfferent type.

* feat(generators): Accept generator argument in block functions

  Accept a CodeGenerator instance as parameter two of every
  per-block-type generator function.

* fix(generators): Pass generator when calling other generator functions

  Make sure to pass generator to any other block functions that are
  called recursively.

* refactor(generators)!: Use generator argument in generator functions

  Refactor per-block-type generator functions to use the provided
  generator argument to make recursive calls, rather than depending
  on the closed-over <lang>Generator instance.

  This allows generator functions to be moved between CodeGenerator
  instances (of the same language, at least).

  This commit was created by search-and-replace and addresses most
  but not all recursive references; remaining uses will require
  manual attention and will be dealt with in a following commit.

  BREAKING CHANGE: This commit makes the generator functions we provide
  dependent on the new generator parameter.  Although
  CodeGenerator.prototype.blockToCode has been modified to supply this,
  so this change will not affect most developers, this change will be a
  breaking change where developers make direct calls to these generator
  functions without supplying the generator parameter.  See previous
  commit for an example of the update required.

* refactor(generators): Manual fix for remaining uses of langGenerator

  Manually replace remaining uses of <lang>Generator in block
  generator functions.

* fix(generators): Delete duplicate procedures_callnoreturn generator

  For some reason the generator function for procedures_callnoreturn
  appears twice in generators/javascript/procedures.js.  Delete the
  first copy (since the second one overwrote it anyway).

* chore(generators): Format
2023-06-14 23:25:36 +01:00
Christopher Allen
12b91ae49c chore(generators): Fix nits (#7166)
Addresses various nits that escaped previous PRs:

* Add TSDoc for `BlockGenerator` in `core/generator.ts` for PR #7150.
* Fix bad formating in `generators/javascript.js` from PR #7153.
* Add missing `@enum` tag that should have been included in PR #7160.
* Delete obsolete comment from `generators/python.js` for PR #7163.
2023-06-14 22:17:38 +01:00
Maribeth Bottorff
438df8761d fix: remove input type from number field (#7025)
* fix: use inputMode instead of type for number fields

* fix: remove input type and mode from number field
2023-06-14 09:36:52 -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
c6fbb85a69 Revert "chore!: remove angle field from core (#7155)" (#7158)
This reverts commit 0961aca4c8.
2023-06-13 15:25:41 -07:00
Beka Westberg
0961aca4c8 chore!: remove angle field from core (#7155)
* chore!: remove angle field from core

* chore: fix mocha failures
2023-06-13 15:09:15 -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
Christopher Allen
f9c865b1b3 refactor(generators)!: CodeGenerator per-block-type generator function dictionary (#7150)
* feat(generators): Add block generator function dictionary

  Add a dictionary of block generator functions, provisionally
  called .forBlock.  Look up generator functions there first, but
  fall back to looking up on 'this' (with deprecation notice)
  for backwards compatibility.

  Also tweak error message generation to use template literal.

* refactor(generators)!: Update generator definitions to use dictionary

* fix(tests): Have blockToCodeTest clean up after itself

  Have the blockToCodeTest helper function delete the block generator
  functions it adds to generator once the test is done.

* refactor(tests): Use generator dictionary in insertion marker test

  The use of generators in insertion_marker_test.js was overlooked
  in the earlier commit making such updates, and some test here
  were failing due to lack of cleanup in
  cleanup in the generator_test.js.

BREAKING CHANGE: this PR moves the generator functions we provide
from their previous location directly on the CodeGenerator instances
to the new .forBlock dictionary on each instance. This does not oblige
external developers to do the same for their custom generators, but
they will need to update any code that references the generator
functions we provide (in generators/*/*, i.e. on javascriptGenerator,
dartGenerator etc.) e.g. to replace the implementation or reuse the
implementation for a different block type.
2023-06-13 20:41:14 +01:00
Evan W. Patton
f37380969a fix: Allow for unattached elements during inject call (#7149)
Change-Id: I616cb30b8a3292b3be9f58536d7bfb9444e529d4
2023-06-13 09:30:45 -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
91be84ab7c fix!: move destroy earlier in the lifcycle (#7117) 2023-06-01 05:25:31 -07:00
Beka Westberg
473a5ab7b1 fix: have inputs construct connections (#7116)
* fix: have inputs construct connections

* chore: fix build hopefully

* fix: PR comments
2023-05-24 13:50:06 -07:00