Commit Graph

1806 Commits

Author SHA1 Message Date
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
ericblackmonGoogle
88fda6dfa8 feat: Creating structure and providing simple test for Blockly automated functional test (#7076)
* feat: Added basic example test for Blockly Playground and Blockly Demo

* feat: Added basic example test for Blockly Playground and Blockly Demo

* feat: Added basic example test for Blockly Playground and Blockly Demo

* feat: Added basic example test for Blockly Playground and Blockly Demo

* feat: Added basic example test for Blockly Playground and Blockly Demo

* feat: Added basic example test for Blockly Playground and Blockly Demo

* feat: Added basic example test for Blockly Playground and Blockly Demo

* feat: Added basic example test for Blockly Playground and Blockly Demo

* feat: Added basic example test for Blockly Playground and Blockly Demo

* feat: Added basic example test for Blockly Playground and Blockly Demo

* feat: Added basic example test for Blockly Playground and Blockly Demo

* feat: Added basic example test for Blockly Playground and Blockly Demo

* feat: Added basic example test for Blockly Playground and Blockly Demo
2023-05-11 16:58:41 -04: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
cdea0ee168 chore: test icon management (#7050)
* chore: test formatting

* chore: add unit tests for adding, removing, and accessing icons

* chore: format

* chore: PR comments
2023-05-09 10:11:34 -07:00
Beka Westberg
4cec0c23cc test: icon block hooks (#7053)
* chore: define test cases

* chore: add tests for icon block hooks

* chore: skip tests (whoops)

* chore: capitalization
2023-05-08 21:10:31 +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
fea91af90e chore: remove private underscores in gesture.ts (#7021)
* chore: remove private underscores in gesture.ts

* chore: format

* chore: remove a stale todo
2023-05-01 09:09:46 -07:00
Rachel Fenichel
08d57853be chore: remove private underscores in field_variable.ts (#7022)
* chore: remove private underscores in field_variable.ts

* chore: remove stale TODO
2023-04-27 10:05:53 -07:00
Beka Westberg
d726080eaa feat: add support for appending custom inputs (#6990)
* feat: add appendInput method

* feat: enable constructing inputs from the registry

* chore: reorganize into suites

* chore: add new input test + fixup existing

* chore: reorganize appending from registry

* chore: fix input types enum

* chore: fix tests
2023-04-21 15:58:42 -07:00
Beka Westberg
83e3dcac70 feat: add after queued renders promises to render management (#6981)
* feat: add promise to render queue system

* chore: update docs for variables

* chore: add export of render management

* chore: add tests for resolving render management promises

* fix: modify insertion marker manager to use render management promises

* chore: format

* chore: remove callback from afterQueuedRenders

* chore: don't store resolver

* chore: rename afterQueuedRenders -> finishQueuedRenders

* chore: fix tests
2023-04-18 17:02:33 -07:00
Beka Westberg
edc5843c4c fix: non-printable characters in XML (#6952)
* fix: non-printable characters in XMl

* fix: PR comments

* chore: format

* chore: move to module-level parser and serializer

* chore: reorganize textToDom

* chore: add dummy implementations of domParser and xmlSerializer

* chore: properly check classes before constructing

* chore: fix tests

* chore: PR comments

* chore: remove null char from tests

* chore: docs!
2023-04-17 16:05:09 -07:00
Rachel Fenichel
c458d63018 chore: remove underscores from private properties and methods in some fields (#6977)
* chore: remove private underscores in field_checkbox

* chore: remove private underscores from field_dropdown

* chore: remove private underscores in field_image

* chore: remove private underscores in field_label

* chore: remove private underscores in field_number

* chore: format
2023-04-13 14:59:43 -07:00
Rachel Fenichel
5f8330e74e chore: remove underscores from private properties and methods in keyboard nav and rendering (#6975)
* chore: remove underscores in keyboard navigation

* chore: remove private underscores from renderers
2023-04-12 11:19:41 -07:00
Rachel Fenichel
85013f83b2 chore: remove underscores from private properties and methods in connections (#6961)
* chore: remove private underscores in connection and connection_db

* chore: remove private underscores in rendererd_connection
2023-04-11 10:06:17 -07:00
Rachel Fenichel
2bf780e74f chore: remove underscores from private properties and methods for names and workspace comments (#6962)
* chore: remove private underscores in names.ts

* chore: remove private underscores in workspace comments

* chore: format

* chore: remove unneeded nulls
2023-04-11 10:00:39 -07:00
Rachel Fenichel
48bdeb3bdb chore: remove underscores from private properties and methods for flyout (#6960)
* chore: remove underscores in flyout files

* chore: remove underscores in flyout_button
2023-04-07 15:40:56 -07:00
Rachel Fenichel
8378eddd17 chore: remove underscores from properties and methods in trashcan (#6959) 2023-04-07 14:51:35 -07:00
Maribeth Bottorff
69afe5b60f fix: allow splicing into shadow block stacks (#6939)
* fix: allow splicing into shadow block stacks

* chore: format
2023-03-30 13:32:57 -07:00
Beka Westberg
9328eebd73 chore: Update metadata for 2023 Q1 release (#6933) 2023-03-29 10:10:11 -07:00
Beka Westberg
670f7da802 fix: dispose performance (#6894)
* fix: improve dispose performance

* chore: cleanup dispose functions

* chore: split dispose into dispose and disposeInternal

* chore: remove unnecessary node removal

* fix: remove unnecessary unbinding of event listeners

* fix: readd skipping event construction

* chore: work on fixing tests

* chore: fix remaining test failures

* chore: format

* chore: typo

* fix: first pass of PR comments

* chore: remove TODO
2023-03-16 15:28:25 -07:00
Beka Westberg
c2919c51bd fix: improve performance of connecting blocks (#6876)
* fix: early return from updateDisabled if it is noop

* chore: trigger connect and disconnect before hiding

* chore: remove disconnectInternal

* fix: skip setting parent when disconnecting before connecting

* chore: fixup docs

* chore: remove erroneous test

* fix: add delay to context menu callback.

Improve INP by allowing the browser to do a paint (closing the context
menu) before we trigger callbacks. This improves the user experience
for expensive callbacks (e.g. collapsing, or updating disabled).

* fix: rendering bug

When disconnecting the last block in the stack, the block would not be
rerendered correctly (the top-start corner would not be reshaped)

* fix: connecting bug

The order for applying connections was changed so that connections were
applied and then the insertion marker was hidden. This caused an error
because hiding the insertion marker expected there to be a child block
when there was not.

* chore: remove setParent param from public API

* chore: tsdoc
2023-03-16 13:40:33 -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
Beka Westberg
9236b4e207 fix: improve performance of modifying block shape (#6884) 2023-03-13 08:55:00 -07:00
Beka Westberg
c0934216f8 fix: creating duplicate params via renaming vars (#6885)
* feat: add IVariableHolder

* chore: reorganize variable prompts to early return

* fix: add retriggering prompt for conflicting params

* chore: add unit tests

* chore: fix build

* chore: reorganize checking for param conflicts

* fix: visibility

* chore: rename variable holder interface

* chore: fix typo

* chore: fix lint
2023-03-09 06:00:48 -08:00
Beka Westberg
5cae074431 fix: improve collapse / uncollapse performance (#6860)
* feat: enable render queueing for collapse-related things

* chore: delay bumping

* chore: fixup tests
2023-03-08 06:03:20 -08:00
Aaron Dodson
8a44dff4e8 refactor: Remove more uses of AnyDuringMigration (#6863)
* refactor: Remove uses of AnyDuringMigration from xml.ts.

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

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

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

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

* refactor: Remove some uses of AnyDuringMigration from block.ts.

* refactor: Make safename construction more readable.

* fix: Use a default size for block comments.

* fix: Clarify test of shadow block disposal.

* fix: Update assert in workspace_svg_test to use isDeadOrDying().
2023-02-28 14:38:17 -08:00
Beka Westberg
c9e2af2a27 fix: variable events not deserializing properly (#6832) 2023-02-27 10:43:19 -08:00
Beka Westberg
4d16584266 fix: serializing disabled interactions (#6847)
* feat: add own property getters for disabled interactions

* feat: add serialization of disabled attributes
2023-02-19 08:18:43 -08:00
Blake Thomas Williams
13fe6eeccf feat: added tests/typescript to test supported TS examples (#6775)
* feat: added `tests/typescript` to test supported TS examples

* fix: update the test name, description, and output

* chore: remove unused imports in `test_tasks.js`

* fix: wrap README line at 80 characters

* fix: implemented `different_user_input.ts` feedback

* fix: correct mistaken comments

* chore: rename `./eslintrc.json` to `./eslintrc.js`

* feat: added linting for tests/typescript

* chore: cleanup eslintrc lines over 80 characters

* fix: updated `.eslintrc.js` to provide an override for linting itself

* fix: updated tests to build to the `build` directory

* feat: updated `gulp format` to handle formatting `.eslintrc.js`

* fix: updated `.eslintrc.js` to align with both formatter and linter

* fix: updated config comment wording

* fix: removed quotes for valid identifiers

* Revert "fix: removed quotes for valid identifiers"

  This reverts commit 03eff91aea1468e503bc79a90fb139914d3f39d2.
2023-02-10 17:12:18 +00:00
Beka Westberg
8386024e44 chore: fix isNameUsed not fully respecting the procedure map (#6833)
* chore: fix isNameUsed not fully respecting the procedure map

* chore: add tests that isNameUsed respects the procedure map
2023-02-08 09:12:23 -08:00
Christopher Allen
d83dcfbe2e chore(build,tests): Remove obsolete kludges / config options (#6835)
* chore(tests): Remove circular import loading issue kludge

  Prior to PR #6818, circular imports resulted in the debug module
  loader (in closure/goog/base.js) failing to record the
  goog.module ID of most modules that were
  involved in the cycle, and in particular of the Blockly.Xml
  module.  This had secondary fallout that resulted
  in library blocks modules being loaded in the wrong order.

  A kludge was introduced in PR #6703 that worked around this
  problem by making sure that window.Blockly was set, allowing
  the modules loaded out-of-order to still work.

  Now that we have removed all remaining circular dependencies
  there is no need for the kludge, since all module IDs are
  properly recorded and modules are loaded in the correct order.

* chore(build): Remove exclude for non-existent core/blockly.js

  There was a transitional period where we had both
  core/blockly.ts and core/blockly.js, and wished to exclude
  the latter from tsc's input, but the latter file was deleted
  (and inadvertently restored, then re-deleted) some time ago.
2023-02-08 11:56:35 +01:00
Christopher Allen
167e26521c refactor: Remove last remaining circular import in core/ (#6818)
* refactor(xml): Move textToDom to core/utils/xml.ts

  This function being in core/xml.ts was the cause for the last
  remaining circular import in core/ (between variables.ts and
  xml.ts).

  Moving it to utils/xml.ts makes sense anyway, since there is
  nothing Blockly-specific about this function.

  Fixes #6817.

* fix(closure): Reenable goog.declareModuleId multiple-call check

  Reenable an assertion which check to make sure that
  goog.declareModuleId is not called more than once in a module
  (and which also catches circular imports amongst ES modules, which
  are not detected by closure-make-deps).

* chore(tests,demos): Augo-migrate use of textToDom

  Testing the migration file entry by auto-migrating all uses of
  Blockly.Xml.textToDom to Blockly.utils.xml.textToDom.

* chore(blocks): Manually migrate remaining use of textToDom

  Update the one remaining call to textToDom (in blocks/lists.ts)
  to the function's new location - also removing the last use of
  the Blockly.Xml / core/xml.ts) module from this file.

* docs(xml): Remove unneeded @alias per comments on PR #6818

* fix(imports): Remove unused import
2023-02-07 12:11:11 +00:00
Christopher Allen
d808c068d2 fix(tests): Use build/msg/en.js instead of msg/messages.js (#6825)
This change had already been made (by PR #6475 amongst other) to
most of the tests, but there were a couple of stragglers that
still mentioned messages.js.

Fixes #6824.
2023-02-07 10:25:13 +00: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
Maribeth Bottorff
a96eec8a70 fix: don't splice into unmovable stacks (#6800)
* fix: don't splice into unmovable stacks

* chore: fix the tests and comments

* chore: format

* chore: clean up xml

* chore: use test row blocks
2023-02-03 14:44:53 -08:00
Aaron Dodson
299016e78d chore: Remove some more uses of AnyDuringMigration (#6785)
* chore: Remove uses of AnyDuringMigration in workspace_comment_svg.ts.

* chore: Remove uses of AnyDuringMigration in toolbox.ts.

* chore: Remove uses of AnyDuringMigration in field_colour.ts.

* chore: Remove uses of AnyDuringMigration from field_image.ts.

* chore: Remove uses of AnyDuringMigration from workspace.ts.

* Update core/workspace_comment_svg.ts

Co-authored-by: Christopher Allen <cpcallen+github@gmail.com>

* chore: Remove uses of AnyDuringMigration in collapsible_category.ts.

* chore: Revert unary - change to make clang-format happy.

* chore: Remove unnecessary quotes in toolbox.ts.

* Update core/workspace_comment_svg.ts

Co-authored-by: Christopher Allen <cpcallen+github@gmail.com>

---------

Co-authored-by: Christopher Allen <cpcallen+github@gmail.com>
2023-02-03 08:03:31 -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
Christopher Allen
a7f498a6a0 fix(build): Fix event tests, improve buildDeps (#6773)
* fix(tests): Fix errors in event tests
  - Fix actual syntax errors in imports in event_marker_move_test.js
    and event_selected.test.js, which were preventing those tests from
    being run.
  - Remove suite.only directives in those tests that would prevent
    all the other tests from running.

* refactor(build): Improve buildDeps

  - Run closure-make-deps only once, instead of separately for core/
    and tests/.

  - Specify a larger exec maxBuffer size, to ensure output and
    diagnostics are not truncated.

  - Change stderr filtering in buildDeps to filter out bounded
    generics messages and blank lines.

  - Attempt to suppress warnings in stderr output when
    closure-make-deps returns a non-zero exit code.

    Unfortunately, there seems to be a race condition which usually
    the stderr argument to the exec callback not to contain the
    complete output, so in that case print a helpful message.

  - Have buildDeps just return a Promise instead of using a callback.

* fix(docs): Typo fix in JSDoc for log helper
2023-01-26 20:09:19 +00:00
Beka Westberg
75963ea58e chore: clean up leftover procedure-related things in core (#6797)
* chore: remove triggering updates

* chore: export isObservable

* chore: move the observable procedure model out of its own directory
2023-01-26 09:54:49 -08:00
Beka Westberg
5bbb39972a chore: delete procedure data models (#6796)
* chore: delete procedure data models

* chore: remove and fix procedure model related tests
2023-01-26 09:35:08 -08:00
Beka Westberg
da9ae8f472 chore: revert procedure events (#6795)
* chore: delete procedure events

* chore: delete event related tests
2023-01-26 09:25:42 -08:00
Beka Westberg
e4d7c381bc chore: revert changes to procedure blocks (#6794)
* chore: revert procedure blocks

* chore: fix tests
2023-01-26 09:21:54 -08:00
Aaron Dodson
e89fcea02c fix: Make metadata tests more resilient. (#6771)
* fix: Make metadata tests more resilient.

* fix: improve control flow and clarify xargs purpose.
2023-01-17 08:32:05 -08:00
Maribeth Bottorff
59c7cb941b fix: Increase generator test timeout (#6776) 2023-01-17 16:17:46 +00:00
Beka Westberg
3cf0663847 fix: copying and pasting procedure definitions (#6747)
* fix: copy-pasting procedure definitions

* chore: add test for loading two procedure defs
2023-01-12 12:54:51 -08:00
Beka Westberg
32c7585cd7 fix: proc json serialization (#6746)
* fix: params not being rendered when loading from JSON

* chore: fix tests
2023-01-11 16:55:06 -08:00
Beka Westberg
902c30948a chore: refactor procedures namespace (#6745)
* chore: refactor procedures namespace

* fix: getCallers

* chore: add inline docs
2023-01-11 07:45:14 -08:00
Beka Westberg
8978f573d3 chore: delete old proc data code (#6736)
* chore: refactor getVars and getVarModels

* chore: cleanup renaming procedures

* fix: updating params in mutator

* chore: remove dead visual update code

* chore: fix test assertions

* chore: move context menu to use procedure model

* fix: renaming early parameters not applying

* chore: remove data update code

* chore: remove references to argumnets from caller serialization

* chore: remove extraneous visual update code

* chore: remove delete event listener

* chore: remove last unused data attributes

* fix: creating procedure defs with params from callers

* chore: format

* chore: cleanup from rebase

* chore: format

* chore: remove logs

* chore: fix PR comments

* chore: cleanup

* chore: make hasReturn_ private
2023-01-09 16:22:24 -08:00
Samriddhi
5dbcaeb4e2 fix: change assertFieldValue in test helpers to use deepEqual (#6739) 2023-01-09 09:51:13 -08:00