Commit Graph

4243 Commits

Author SHA1 Message Date
Neerajkumar
fe0dc8694f fix: prevent flyout block highlighting during workspace drag (#7720) 2023-12-18 10:28:37 -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
Beka Westberg
a2a041f212 fix: reenable showing empty flyouts (#7695) 2023-12-05 14:24:38 -08:00
Beka Westberg
45cc1e8fea fix: mutator coordinates not respecting flyout (#7690)
* fix: mutator coordinates not respecting flyout

* chore: fixup conditionals
2023-12-05 10:51:21 -08:00
Ananta Bastola
0836a1db10 fix: release dummy wheel listener on workspace dispose (#7693)
fix #7674
2023-12-05 09:42:35 -08:00
truongductri01
96a354b46b feat: added intermediate event change (#7671)
* feat: added intermediate event change

* fix: update prettier format for the code

* fix: update comment style

* fix: update test statements
2023-12-04 13:10:09 -08:00
Beka Westberg
71ded9dd89 fix: trashcan flyout opening on drag (#7691) 2023-12-04 11:14:19 -08:00
dependabot[bot]
80be8bc04c chore(deps): Bump prettier from 3.0.3 to 3.1.0 (#7658)
* chore(deps): Bump prettier from 3.0.3 to 3.1.0

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

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

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

* chore: format

---------

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-11-27 13:25:51 -08:00
Maribeth Bottorff
e6de8581dd fix: disabled render status after serialization (#7650)
* fix: disabled render status after serialization

* chore: format

* chore: better names

* chore: format
2023-11-17 23:58:35 +00:00
Cassidy
a2b895f7a9 fix: update setShadow TSDoc for Block and BlockSvg (#7639)
* fix: update setShadow TSDoc for Block and BlockSvg

* fix: Wrap comment lines at col 80

* fix: Corrected formatting with Prettier
2023-11-10 10:28:51 -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
Beka Westberg
d8eb7b56bb fix: make autoclose toggleable for flyouts (#7634)
* fix: add basic autoclose toggling support

* fix: drag areas being incorrect

* fix: blocks getting bumped around when dragged into flyout area

* fix: respect always-open flyouts attached to toolboxes

* fix: flyout not hiding on ws click

* fix: have all flyouts filter for capacity

* chore: cleanup

* fix: view metrics not respecting flyout

* chore: fix change detectors

* fix: trashcan not firing close event on click
2023-11-07 13:12:21 -08:00
Beka Westberg
0ad57f4fd3 fix: shadows in insertion markers being displayed as shadows (#7609)
* fix: shadows in insertion markers being displayed as shadows

* chore: add unit tests

* chore: remove only
2023-11-03 11:19:30 -07:00
Apoorv Garg
9d117674ce Fix: #7416 (#7628) 2023-11-02 08:31:17 -07: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
10024bd54e fix: prevent crash when clicking on a field to delete a block (#7621)
* Fix: #7587

* Fix: Lint error

* Fix: Move expression out of loop

* Fix: No need to use temp variable
2023-11-01 09:59:21 -07:00
Trey Pisano
73841995ec fix: flyout id is different than first placed block (#7618)
* add saveIds param and logic to save correctly

* remove whitespace

* add saveIds to recursive calls

* run format

* change name from addIds to saveIds

* add saveIds test

* change blockId on false saveIds to undefined
2023-11-01 08:52:27 -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
Beka Westberg
7d2c307fed fix: widget positioning (#7507)
* chore: delete dead code

* chore: moves location updating into the block

* chore: change dragging to use update component locations

* fix: field widgets not being moved when blocks are editted

* chore: remove unnecessary resizeEditor_ calls

* chore: format

* chore: fix build

* fix: tests

* chore: PR comments

* chore: format
2023-10-26 09:47:39 -07:00
Christopher Allen
582e19a0f1 fix(generators): Modify type signature of forBlock (#7555)
Make two changes to the forBlock dictionary on CodeGenerator
objects:

- Change the type of the second argument to the special 'this'
  type (was CodeGenerator), so that e.g. JS block generator
  functions can call JavascriptGenerator.prototype.getAdjusted
  (not defined on CodeGenerator).
- Change the way forBlock is declared from using an index
  signature to using the Record<> template type.  The two
  should be equivalent but for some reason the former provokes
  type errors when used with the 'this' type.

Additionally, deprecate the now-unused (but exported)
BlockGenerator type alias.

Technically the change of signaure is a breaking chnage, but
it is unlikely to affect any developers in practice, since
any block generator function (Block, CodeGenerator) => ...
can be substituted in for (Block, C extends CodeGenerator) =>
..., so any existing generator functions can still be added
to any CodeGenerator or subclass instance's .forBlock.  The
only situation in which this would be breaking is if a
developer was obtaining block generator functions
FROM a subclass instance's .forBlock dictionary and assuming
they were (Block CodeGenerator) => ...
2023-10-20 15:59:30 +01:00
Beka Westberg
b2688441fa chore: fix shouldStartNewRow docs and param names (#7558) 2023-10-18 09:29:08 -07:00
Oscar
3a03f4d11b fix: block creation successful with undefined messages (#7591)
closes #7589

Signed-off-by: Oscar <71343264+0scvr@users.noreply.github.com>
2023-10-17 11:19:17 -07:00
Oscar
072c5f768f fix: bring block to front when icon clicked (#7590)
Closes #7588

Signed-off-by: Oscar <71343264+0scvr@users.noreply.github.com>
2023-10-13 17:22:34 -07:00
potaracom
1e3b5b4c76 fix: recreate dropdown div (#7572)
* fix: recreate dropdown div

* fix: recreate tooltip div

* fix: recreate widget div

* fix: Stop using global variables and use getDiv()

* Revert "fix: Stop using global variables and use getDiv()"

This reverts commit 322c4d884b.

* fix: reset widget div
2023-10-10 09:19:44 -07:00
Beka Westberg
ab3bc6c3d8 fix: colour from colour picker not being updated (#7584)
* fix: colour from colour picker not being updated

* chore: clarify what code is doing
2023-10-09 10:34:06 -07:00
Minh Seikel
ed3decbb37 fix: Corrected typo from 'codefor' to 'code for' (#7549) 2023-10-09 08:29:40 -07:00
Beka Westberg
5151b28e7d fix: color field sizing being incorrect (#7566) 2023-10-02 13:16:03 -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
satya verma
4a6d4399d1 fix: incorrect blockchange firing (#7492)
* BlockChange event disabled

* BlockChange event disabled

* executed command (npm run format)
2023-09-21 05:34:24 -07:00
Beka Westberg
12ac35829e fix: loading tooltips before messages (#7504)
* fix: loading tooltips before messages

* fix: typing
2023-09-20 14:07:06 +00:00
laurensvalk
3b234c7f87 fix: Call onFinishEditing_ for fields on mobile. (#7483)
On the desktop, widgetDispose_ will call onFinishEditing_ on close.

This was missing in the mobile counterpart, so any cleanups in onFinishEditing_ would not be called.

Also update the message string comment while we are touching this code.
2023-09-20 06:15:17 -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
Beka Westberg
32c9daf885 fix: bad JSON state leaving events disabled (#7501)
* fix: broken JSON state stopping event firing

* chore: add unit test for events not breaking
2023-09-19 05:17:51 -07:00
Beka Westberg
f8a134caef fix: immediately render for JavaFX (#7502) 2023-09-18 20:12:20 +00:00
Beka Westberg
25d15fd596 fix: zelos full block fields rendering badly (#7490)
* fix: text input fields

* fix: colour field

* chore: cleanup override keywords

* chore: revert playground changes

* fix: applyColour not being called

* chore: swap visibility for display

* chore: cleanup for PR comments

* fix: PR comments
2023-09-14 22:22:40 +00:00
Rachel Fenichel
fc76981e5b Merge pull request #7482 from clementcontet/fix-7426
fix: insertion marker position when connection is resized (#7426)
2023-09-13 10:50:56 -07:00
Clément Contet
36b00fb660 chore: format 2023-09-13 07:49:13 +02:00
Clément Contet
b95067b949 chore: position insertion marker in a single function 2023-09-12 11:11:31 +02:00
Beka Westberg
4eba35ec7b fix: doFullSerialization for insertion markers (#7467) 2023-09-11 08:38:51 -07:00
John Nesky
1b2e91246e chore: Use JSON objects for context menu callbackFactory (#7382)
* chore: use json object for context callbackFactory

* Add test file for context menu callback function.
2023-09-08 16:16:59 -07:00
Beka Westberg
344861698e fix: connection highlight not disposed when block deleted (#7454) 2023-09-06 10:11:36 -07:00
Clément Contet
a2a9ab1da4 fix: insertion marker position when connection is resized (#7426) 2023-09-04 21:07:11 +02:00
Maribeth Bottorff
68261e5dd9 feat: add getVariableName and getProcedureName to CodeGenerator (#7445)
* feat: add getVariableName and getProcedureName to CodeGenerator

* feat: make nameDB_ public

* feat: update block code generators to use new APIs

* chore: fix build

* chore: remove unused imports
2023-08-31 10:49:17 -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
Christopher Allen
be809d9d98 refactor(tests): Migrate generator tests to import shims; delete bootstrap.js (#7414)
* refactor(tests): Use shims instead of bootstrap to load Blockly

  - Modify tests/generators/index.html to import the test shims
    instead of using bootstrap.js to load Blockly.

  - Modify test/generators/webdriver.js to have it wait for the
    workspace to exist before calling loadSelected().  There was
    previously a race which index.html had been winning, but
    now webdriver.js is winning (and the tests failing because
    there is no workspace yet when start() is called.

* chore(tests): Delete bootstrap.js etc.

  - Delete bootstrap.js, bootstrap_helper.js, and bootstrap_done.mjs.
  - Remove remaining references to bootstrap.js

* refactor(build): Remove deps npm script

  buildDeps is now only needed by buildCompiled, not ever for
  runnning in uncompressed mode, so:

  - Remove the deps gulp task (and the deps npm script.
  - Have the minify task run buildJavaScript and buildDeps directly.

  Additionally, the buildAdvanceCompilationTest target hasn't
  needed deps.js for some time (if ever), so skip having it run
  buildDeps entirely.

* refactor(build): Repatriate DEPS_FILE to build_tasks.js

  Since this is no longer used anywhere else it doesn't need to
  live in common.js.

* fix(scripts): Remove vestigial references to deps.mocha.js

* docs(tests): Add additional explanatory note
2023-08-31 00:02:58 +01:00
Beka Westberg
8193cffe77 chore: clean up mutator tests (#7434)
* chore: work on cleaning up mutator tests

* chore: remove need for dragBlockSelector

* chore: add helpers to clean up tests

* chore: add issue link in TODO

* chore: format and add docs for new helpers

* Revert "chore: remove need for dragBlockSelector"

This reverts commit dfec88a6aa.

* chore: fixup connect helper
2023-08-28 22:01:10 +00:00
Rachel Fenichel
51651dffe8 Revert "feat: Insertion marker json deserialization 7316 (#7364)" (#7430)
This reverts commit 84215386fb.
2023-08-24 10:46:46 -07:00
Rachel Fenichel
9db853db76 Revert "fix: insertion marker's next blocks become real block (#7384)" (#7429)
This reverts commit 18ee0ec41b.
2023-08-24 10:41:17 -07:00
Beka Westberg
7e3472c305 fix: dragging blocks within a zoomed mutator (#7423) 2023-08-24 08:34:45 -07:00