Commit Graph

8126 Commits

Author SHA1 Message Date
Beka Westberg
a0301a217a feat: make generator quoting methods public (#7392)
* feat: make quoting methods public

* feat: add quote and multilineQuote methods

* fix: update code generators to use new methods

* chore: remove aliases

* chore: revert changes to generators
2023-08-21 09:05:23 -07:00
dependabot[bot]
eebf19ca39 chore(deps): Bump @typescript-eslint/eslint-plugin from 6.1.0 to 6.4.0 (#7420)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.1.0 to 6.4.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.4.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  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>
2023-08-21 08:27:41 -07:00
Rachel Fenichel
a38340bfdf chore(tests): set browser pause time in one place and enable toolbox tests (#7402)
* chore(tests): add a PAUSE_TIME constant for all test pauses

* chore(tests): respond to PR feedback
2023-08-18 17:13:32 -07:00
Christopher Allen
6f20ac290d refactor(tests): Use import instead of goog.bootstrap to load Blockly in mocha tests (#7406)
* fix(build): Have buildShims clean up up after itself

  We need to create a build/package.json file to allow node.js to
  load build/src/core/blockly.js and the other chunk entry points
  as ES modules (it forcibly assumes .js means CJS even if one is
  trying to import, unless package.json says {"type": "module"}),
  but this interferes with scripts/migration/js2ts doing a
  require('build/deps.js'), which is _not_ an ES module.

  Specific error message was:

  /Users/cpcallen/src/blockly/scripts/migration/js2ts:56
  require(path.resolve(__dirname, '../../build/deps.js'));
  ^

  Error [ERR_REQUIRE_ESM]: require() of ES Module
  /Users/cpcallen/src/blockly/build/deps.js from /Users/cpcallen/src/blockly/scripts/migration/js2ts
  not supported.
  deps.js is treated as an ES module file as it is a .js file whose
  nearest parent package.json contains "type": "module" which
  declares all .js files in that package scope as ES modules.
  Instead rename deps.js to end in .cjs, change the requiring code
  to use dynamic import() which is available in all CommonJS
  modules, or change "type": "module" to "type": "commonjs" in
  /Users/cpcallen/src/blockly/build/package.json to treat all .js
  files as CommonJS (using .mjs for all ES modules instead).

      at Object.<anonymous> (/Users/cpcallen/src/blockly/scripts/migration/js2ts:56:1) {
    code: 'ERR_REQUIRE_ESM'
  }

* chore(tests): Reorder to put interesting script nearer top of file

* chore(tests): Add missing imports of closure/goog/goog.js

  These modules were depending on being loaded via the
  debug module loader, which cannot be used without first loading
  base.js as a script, and thereby defining goog.declareModuleId
  as a side effect—but if they are to be loaded via direct import
  statements then they need to actually import their own
  dependencies.

  This is a temporary measure as soon the goog.declareMouleId
  calls can themselves be deleted.

* refactor(tests): Use import instead of bootstrap to load Blockly

* chores(build): Stop generating deps.mocha.js

  This file was only needed by tests/mocha/index.html's use of
  the debug module loader (via bootstrap.js), which has now been
  removed.

* chore(tests): Remove unneeded goog.declareModuleId calls

  These were only needed because these modules were previously
  being loaded by goog.require and/or goog.bootstrap.

* chores(tests): Remove dead code

  We are fully committed to proper modules now.
2023-08-18 18:06:52 +01:00
Beka Westberg
cb0f7032fd feat: add custom context menu rendering (#7409) 2023-08-17 14:50:41 -07:00
Rachel Fenichel
60aa99af53 chore: clean up measurement code in mini workspace bubble (#7408) 2023-08-17 13:00:25 -07:00
Beka Westberg
82f6ca5766 fix: saveConnections listener not being disposed (#7407) 2023-08-17 11:39:09 -07:00
Maribeth Bottorff
0dd814dee8 chore: update PR template and add info for new contribs (#7405)
* chore: update PR template and add info for new contribs

* chore: format

* chore: typo
2023-08-17 18:31:22 +00:00
Rachel Fenichel
d87386e235 chore: Update README.md (#7404)
Remove out of date info from readme.
2023-08-17 00:15:27 +00:00
Beka Westberg
b602f2163b feat: add accessors for the workspace svg group and block canvas (#7394) 2023-08-16 16:56:54 -07:00
dependabot[bot]
d5c71050c4 chore(deps): Bump @microsoft/api-documenter from 7.22.20 to 7.22.33 (#7386)
Bumps [@microsoft/api-documenter](https://github.com/microsoft/rushstack/tree/HEAD/apps/api-documenter) from 7.22.20 to 7.22.33.
- [Changelog](https://github.com/microsoft/rushstack/blob/main/apps/api-documenter/CHANGELOG.md)
- [Commits](https://github.com/microsoft/rushstack/commits/@microsoft/api-documenter_v7.22.33/apps/api-documenter)

---
updated-dependencies:
- dependency-name: "@microsoft/api-documenter"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-16 16:33:29 -07:00
Rachel Fenichel
10ab8738af chore: fix docs in FieldImage (#7403) 2023-08-16 16:30:58 -07:00
Beka Westberg
9efd944de7 fix: block change serialization (#7400) 2023-08-16 15:05:08 -07:00
Rachel Fenichel
d32a13cf3f fix(tests): wait for the workspace to render before starting test actions (#7399) 2023-08-16 14:30:05 -07:00
Beka Westberg
b4ce6afd2a feat: add doFullSerialization support to blocks (#7363)
* feat: add doFullSerialization support to blocks

* chore: PR comments
2023-08-16 09:30:13 -07:00
Christopher Allen
51be0760c3 fix(build): Fix import of parent chunk's shim (#7398)
In PR #7380 it was suggested[1] that the shims be renamed from
(e.g.) blockly.mjs to blockly.loader.mjs, and in commit 6f930f5
this was duly done, but alas one place was overlooked.

The problem was not spotted in local testing because the
blockly.mjs module that the blocks and generators chunks were
attempting to import did still exist on disk, left over from
before the change was made.

Running npm run clean would have revealed the issue but alas
that was not done.

[1] https://github.com/google/blockly/pull/7380#discussion_r1291667037
2023-08-16 08:29:48 -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
dependabot[bot]
754448a1df chore(deps): Bump patch-package from 7.0.0 to 8.0.0 (#7388)
Bumps [patch-package](https://github.com/ds300/patch-package) from 7.0.0 to 8.0.0.
- [Release notes](https://github.com/ds300/patch-package/releases)
- [Changelog](https://github.com/ds300/patch-package/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ds300/patch-package/compare/v7.0.0...v8.0.0)

---
updated-dependencies:
- dependency-name: patch-package
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-14 22:52:35 +01:00
Christopher Allen
5b5a56586c refactor(tests): Introduce loading shims, use in playgrounds (#7380)
* refactor(build): Simplify implementation of posixPath

* fix(closure): Make safe to import in node.js

  Make the implementation declareModlueId safe to import and
  execute in node.js, which does not provide a window global.

  (N.B. because this is an ESM and therefore automatically
  strict, using window?.goog?.declareModuleId doesn't work
  because window being undefined is an early error.)

* feat(tests): Introduce chunk loading shims

  - Add a buildShims task to build_tasks.js that, for each chunk,
    creates a correspondingly-named build/<chunk>.mjs that will
    either (in uncompressed mode) import and reexport that chunk's
    entry point module (e.g. core/blockly.js) or (in compressed
    mode) load dist/<chunk>_compressed.js using a <script> tag
    and then export the corresponding properties on the chunk's
    exports object.

  - Provide helper methods used by these shims in
    tests/scripts/loading.mjs, including code to detect whether
    to load in compressed or uncompressed mode.

  - Add a quote() function to scripts/helpers.js, used by
    buildShims.  This is copied from tests/bootstrap_helper.js,
    which will be removed in a later commit.

* refactor(tests): Update playground.html to use new loading shims

* refactor(tests): Update advanced_playground.html to use new loading shims

* refactor(tests): Update multi_playground.html to use new loading shims

* chore(tests): Delete playgrounds/shared_procedures.html

  Shared procedure support was moved to a plugin and this should
  have been removed from core along with it.

* docs(tests): Typo corrections.

* chore(tests): Add ".loader" infix to shim filenames.

  Per suggestion on PR #7380, have buildShims name the shims
  ${chunk.name}.loader.mjs instead of just `${chunk.name}.mjs`.
2023-08-14 22:47:19 +01:00
ericblackmonGoogle
86f3182b46 Merge pull request #7393 from google/master
chore: merge master back into develop for 10.1.2
2023-08-14 13:26:47 -04:00
ericblackmonGoogle
36dfc34e3d Merge pull request #7391 from google/rc/v10.1.2
release: Rc/v10.1.2
2023-08-14 13:14:47 -04:00
Eric Blackmon
4457e575ae release: Update version number to 10.1.2 2023-08-14 12:54:22 -04:00
Hollow Man
5e85cdefaa fix: insertion marker's next blocks become real block (#7384)
Don't add next block to the insertion marker when we do
an insertion marker json serialization.

Also, to keep consistent with the old behavior, we don't
need to add input blocks for the insertion marker.

And we don't need to do a full serialization here as it
will just become an insertion marker.

Resolves #7383

Address issues in PR #7364

Signed-off-by: Hollow Man <hollowman@opensuse.org>
(cherry picked from commit 18ee0ec41b)
2023-08-14 12:52:52 -04:00
Hollow Man
18ee0ec41b fix: insertion marker's next blocks become real block (#7384)
Don't add next block to the insertion marker when we do
an insertion marker json serialization.

Also, to keep consistent with the old behavior, we don't
need to add input blocks for the insertion marker.

And we don't need to do a full serialization here as it
will just become an insertion marker.

Resolves #7383

Address issues in PR #7364

Signed-off-by: Hollow Man <hollowman@opensuse.org>
blockly-v10.1.2
2023-08-14 09:19:42 -07:00
dependabot[bot]
cd9b0c1f83 chore(deps): Bump google-closure-compiler (#7389)
Bumps [google-closure-compiler](https://github.com/google/closure-compiler-npm) from 20230502.0.0 to 20230802.0.0.
- [Release notes](https://github.com/google/closure-compiler-npm/releases)
- [Commits](https://github.com/google/closure-compiler-npm/compare/v20230502.0.0...v20230802.0.0)

---
updated-dependencies:
- dependency-name: google-closure-compiler
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-14 08:34:44 -07: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
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
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
Beka Westberg
e30c4acd92 chore: upgrade keyboard shortcuts and context menus to use non-deprecated APIs (#7352)
* chore: remove references to clipboard.copy in shortcuts

* chore: remove references to clipboard.copy in context menus

* chore: fix tests

* chore: format

* fix: PR comments
2023-08-11 09:38:50 -07:00
Maribeth Bottorff
8b6c780c3e fix: remove specific warning text (#7376)
* fix: remove specific warning text

* chore: teardown rendered workspace after test

* chore: reformat new tests
2023-08-11 00:01:12 +00:00
ericblackmonGoogle
a8fca2d2f8 Merge pull request #7378 from google/master
chore: Merge master back into develop following v10.1.1 release
2023-08-10 17:29:59 -04:00
ericblackmonGoogle
11b7b728a3 Merge pull request #7377 from google/rc/v10.1.1
release: v10.1.1
2023-08-10 17:10:35 -04:00
Eric Blackmon
b17f5ac775 release: Update version number to 10.1.1 2023-08-10 16:54:03 -04:00
Beka Westberg
e5bfbdd324 Revert "fix: removed X & Y from toolbox.ts and replaced movBy to moveTo (#7333)" (#7375)
This reverts commit dbe926db4a.

The reverted commit made it so that RTL flyouts were rendered incorrectly.

(cherry picked from commit 7bca438ab8)
2023-08-10 16:53:29 -04:00
Beka Westberg
7bca438ab8 Revert "fix: removed X & Y from toolbox.ts and replaced movBy to moveTo (#7333)" (#7375)
This reverts commit dbe926db4a.

The reverted commit made it so that RTL flyouts were rendered incorrectly.
blockly-v10.1.1
2023-08-10 20:40:08 +00:00
ericblackmonGoogle
8cbc7ed1e3 release: v10.1.0
Merge pull request #7371 from google/rc/v10.1.0
2023-08-10 16:40:46 +00:00
Eric Blackmon
74049c769a chore: fixing core/main.js formatting 2023-08-10 12:31:19 -04:00
Eric Blackmon
f391d5c486 release: Update version number to 10.1.0 2023-08-10 11:38:08 -04:00
Eric Blackmon
7e1cfd935a chore: merging develop 2023-08-10 11:36:35 -04:00
Eric Blackmon
e276e912e7 chore: update renamings file for new release 2023-08-10 09:19:15 -04:00
Beka Westberg
80b1b44540 fix: connect animation persisting (#7365)
* fix: connect animation

* chore: format
blockly-v10.1.0
2023-08-09 12:46:09 -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
Devansh Varshney (देवांश वार्ष्णेय)
84215386fb feat: Insertion marker json deserialization 7316 (#7364)
* fix: insertion markers to use JSON deserialization

* removed the const DUPLICATE_BLOCK_ERROR

* modified to import module instead of referencing

* removed coments for better readability
2023-08-09 08:33:22 -07:00
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
Neil Fraser
826510f242 fix: Preemptively fix API change in NDB. (#7361)
Glockenspiel broke due to 'query' now being required within a client context.  This change fixed Glockenspiel.  Blockly samples doesn't appear to be broken yet, but Glokenspeil broke at midnight yesterday.

Similar change being made to Blockly Games.
2023-08-07 20:22:21 +02:00
Maribeth Bottorff
2a2b3b3ac5 chore: change the way we look for upstream remote (#7230)
* chore: change the way we look for upstream remote

* chore: use js instead of shell

thanks christopher

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

* chore: store the found upstream name

---------

Co-authored-by: Christopher Allen <cpcallen+github@gmail.com>
2023-08-04 16:41:24 -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
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