Commit Graph

8509 Commits

Author SHA1 Message Date
Christopher Allen
2ebdc0b7f9 feat(build)!: Introduce ESM entrypoints (#8091)
* feat(build)!: Introduce ESM entrypoints for chunks

  Introduce an "import" conditional export for each of the chunk
  entrypoints (blockly/core, blockly/blocks, blockly/javascript
  etc.), and point these at wrappers created by build_tasks.js
  that import the corresponding <chunk>_compressed.js file and
  export its named exports.

  BREAKING CHANGE:

  Importing Blockly via

      import Blockly from 'blockly/core';

  (and similarly for the other chunk entrypoints) has worked until
  now because most build tools (including Webpack in particular)
  fuilfil the request for the default export of a CJS module by
  providing the module.exports object, rather than an
  explicitly-named default export as they would for an ES module.

  Since core/blockly.ts (the notional entrypoint for blockly/core)
  does not provide a default export, the wrappers created by this
  PR do not either.

  Code of the above form will therefore break, and should be updated
  to use a wildcard:

      import * as Blockly from 'blockly/core';

* feat(build)!: Introduce main package ESM entrypoint

  Introduce an "import" conditional export for the top-level
  package entrypoint (blockly), and point it at a wrappers
  created by build_tasks.js that imports the existing index.js
  file.

  BREAKING CHANGE:

  Importing Blockly via

      import Blockly from 'blockly';

  has worked until now because most build tools (including Webpack
  in particular) fuilfil the request for the default export of a
  CJS module by providing the module.exports object, rather than an
  explicitly-named default export as they would for an ES module.

  Since core/blockly.ts does not provide a default export, the
  wrapper created by this PR does not either.

  Code of the above form will therefore break, and should be updated
  to use a wildcard:

      import * as Blockly from 'blockly';

* feat(build)!: Introduce ESM entrypoints for langfiles

  Introduce an "import" conditional export for each of the
  langfile entrypoints (msg/en, msg/fr, etc.),, and point them
  at wrappers created by build_tasks.js that import the
  existing <lang>.js file.

  BREAKING CHANGE:

  Importing languages via

      import en from 'blockly/msg/en';

  has worked until now because most build tools (including Webpack
  in particular) fuilfil the request for the default export of a
  CJS module by providing the module.exports object, rather than an
  explicitly-named default export as they would for an ES module.

  Code of the above form will therefore break, and should be updated
  to use a wildcard:

      import * as en from 'blockly/msg/en';

* fix(typings): Remove bogus .d.ts file.

  For some reason we had a typings/msg/yue.d.ts that did not
  correxpond to any msg/json/yue.json.  Delete it.
2024-05-10 22:42:35 +01:00
Beka Westberg
c704d5a887 revert: "feat: allow the dialog methods to take in extra parameters (#8084)" (#8085)
This reverts commit 278006b5f8.
2024-05-10 11:12:15 -07:00
Beka Westberg
278006b5f8 feat: allow the dialog methods to take in extra parameters (#8084)
* feat: allow prompt to take in additional params

* feat: allow confirm tot ake in extra args

* feat: allow alert dialog to take in extra parameters

* chore: add tests for dialog methods
2024-05-08 10:10:09 -07:00
Neil Fraser
4e688bf949 fix: Don't record undo events for enable/disable (#8058)
There's no need to record and replay these events since the change will happen automatically anyway.

Resolves #7951
2024-05-07 20:33:50 +02:00
Aaron Dodson
08183863e7 refactor: split out block serialization for creating new blocks from the flyout (#8065)
* refactor: split out block serialization for creating new blocks from the flyout

* fix: add JSDoc.

* chore: satisfy the linter.
2024-05-03 12:27:55 -07:00
Richard Knoll
4861c7d98a fix: prevent duplication of comment icon bubbles (#8053) 2024-05-02 08:38:40 -07:00
Christopher Allen
19fa49101a release: Update version number to 11.0.0-beta.10 blockly-v11.0.0-beta.10 2024-04-24 21:05:54 +01:00
Christopher Allen
a062ab87c8 fix(build): Reintroduce shims for subpackage entrypoints (#8050)
This is in effect a partial rollback of PR #7822.

This should solve issues encountered by users of bunders that don't
support exports at all (e.g. browserify) as well as ones that don't
support it in certain circumstances (e.g., when using webpack's
resolve.alias configuration option to alias 'blockly' to
'node_modules/blockly', as we formerly did in most plugins, which
causes webpack to ignore blockly's package.json entirely).

Assumptions:
- Such bundlers will _completely_ ignore the exports declaration.
- The bundles are intended to be used in a browser—or at least not
  in node.js—so the core entrypoint never needs to route to
  core-node.js.  This is reasonable since there's little reason to
  bundle code for node.js, and node.js has supported the exports
  clause since at least v12, considerably older than any version of
  node.js we officially support.
- It suffices to provide only a CJS entrypoint (because we can only
  provide CJS or ESM, not both.  (We could in future switch to
  providing only an ESM entrypoint instead, though.)
2024-04-24 20:52:22 +01:00
Beka Westberg
93c4d75fbd fix: comment highlight being positioned incorrectly in RTL (#8044) 2024-04-19 11:33:25 -07:00
Beka Westberg
69c5557e4f chore: fix comments being resizable when readonly (#8043) 2024-04-19 11:15:56 -07:00
Beka Westberg
7246bbc0d1 fix: comment text input size in samples (#8042) 2024-04-19 08:37:35 -07:00
John Nesky
cee7f916bb feat!: Invalid Blocks (#7958)
* feat: Invalid Blocks

* Rename the new json property from invalid to invalidReasons.

* Merged isValid into isEnabled.

* Minor fixes.

* More minor fixes.

* Reverting some stuff that didn't need to change.

* Addressing PR feedback.

* Update the BlockInfo interface to match State.

* Make BlockChange.disabledReason private.
2024-04-17 19:47:51 -07:00
Beka Westberg
7d8f88a4f1 chore: delete old comments (#8038)
* chore!: delete old comment classes and references

* chore: PR comments
2024-04-17 14:33:36 -07:00
Beka Westberg
a865744b7e fix: bumping comments into bounds (#8037) 2024-04-17 14:02:46 -07:00
Beka Westberg
41fe298a62 fix: cut shortcut for workspace comments (#8036) 2024-04-17 13:53:57 -07:00
Beka Westberg
e21bb99ff1 feat!: Add context menu options for workspace comments (#8035)
* feat: add context menu support and migrate easy options

* feat: pass events to context menu options

* chore: migrate final comment context menu option

* feat: add exports for comment context menu items

* chore: PR comments
2024-04-17 13:02:53 -07:00
Beka Westberg
70f3f52911 fix: CSS for selected collapsed comments (#8039) 2024-04-17 09:48:43 -07:00
Beka Westberg
94dda6e668 fix: text input bubble css (#8040) 2024-04-17 09:47:51 -07:00
Beka Westberg
dabb11f4cb feat!: add ability to copy and paste workspace comments (#8024)
* chore: add support for copying and pasting workspace comments

* chore: fix build

* fix: PR comments
2024-04-15 14:43:58 -07:00
Beka Westberg
b6753a250e fix: more drag exports (#8025)
* fix: more drag exports I forgot about

* chore: fix date in copyright
2024-04-12 22:09:32 +00:00
Beka Westberg
d554053bd0 feat: add ability to delete workspace comments (#8023) 2024-04-11 13:22:50 -07:00
Beka Westberg
a0f821a239 fix: revert dragger name (#8020) 2024-04-11 13:22:17 -07:00
Beka Westberg
613c7335ee chore: export some types and methods (#8021) 2024-04-11 08:38:50 -07:00
Beka Westberg
ee95b4c577 chore: rename method (#8015) 2024-04-09 10:57:03 -07:00
Beka Westberg
7491a50239 fix: compatibility with scroll plugin (#8016) 2024-04-08 13:17:03 -07:00
Beka Westberg
3e1e9b5ddc fix: blocks not being returned to the correct layer if their drag is reverted with no parent (#7998)
* fix: blocks not being returned to the correct drag layer if their drag is reverted with no parent

* fix: delete test code
2024-04-08 09:44:31 -07:00
Beka Westberg
0cec8b1d29 fix: drag cursor not showing (#7999) 2024-04-08 09:23:49 -07:00
Beka Westberg
25ba5f0a3d fix: firing move event for insertion marker (#8000) 2024-04-05 13:50:14 -07:00
Beka Westberg
6f7e04d8eb fix: bubbles not being returned to the correct drag layer (#7997) 2024-04-05 13:46:28 -07:00
Beka Westberg
e1cbddd860 feat: visual comment selection (#7996)
* feat: add visually highlighting selected comment

* chore: TSDoc
2024-04-05 13:39:20 -07:00
Maribeth Moffatt
204d081bce release: update version number to 11.0.0-beta.7 2024-04-05 10:30:47 -07:00
Beka Westberg
e8c51965b4 feat: add toFlyoutData method for compatibility with backpack (#8002) 2024-04-05 10:25:33 -07:00
Beka Westberg
d6744758f8 chore: add webdriver tests for workspace comments (#7954)
* chore: add collapse and uncollapse tests

* chore: add typing test

* chore: add resizing test

* chore: add delete tests

* chore: add better assertion messages

* chore: copyright year
2024-04-05 16:18:01 +00:00
Beka Westberg
7277a2350f chore: delete old dragging infrastructure (#7995) 2024-04-05 09:13:02 -07:00
Beka Westberg
c60db431ca chore: delete useless DRAG_STACK value (#7994) 2024-04-04 15:58:24 -07:00
Beka Westberg
fd177358ea feat: comment collapse event (#7949)
* feat: define comment collapse event

* feat: add firing collapse events

* chore: add round-trip test

* chore: add tests for firing collapse events

* chore: format
2024-04-04 15:48:34 -07:00
Beka Westberg
c0e6e6745f fix: dragging shadow blocks (#7992)
* fix: dragging shadow blocks

* fix: dragging shadows not reverting them to their original position

* fix: shadow parents not being deselected
2024-04-04 18:30:41 +00: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
Beka Westberg
ed403d0b77 feat!: change gestures to look at selected when dragging (#7991)
* feat: change gestures to look at selected when dragging

* chore: fix tests

* chore: format

* chore: PR comments
2024-04-04 08:52:43 -07:00
Beka Westberg
e75a4fb1d3 fix: comment move and change events (#7947)
* fix: comment move event

* feat: add support for a drag reason

* fix: comment change events

* chore: add tests for move and change events
2024-04-03 12:58:04 -07:00
Beka Westberg
3988e13fbc chore: fix comment colours disappearing when dragging (#7978) 2024-04-02 14:37:54 -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
Beka Westberg
f7bdfa2062 feat: support dragging comments in the gesture (#7977)
* feat: add dragging of comments in gesture

* chore: fix naming problems
2024-04-02 20:08:27 +00:00
Beka Westberg
b13f8f6737 fix: prevent default undo (#7946)
* fix: prevent default undo

* chore: fix format
2024-04-02 13:03:11 -07:00
Maribeth Bottorff
b7cdeffccd chore: merge develop into rc/v11 2024-04-01 14:57:19 -07:00
Alejandro Ramos
d56f52cb0a fix: Assign to containerDiv blockyWidgetDiv if it already exists (#7980)
* fix: assign to containerDiv if it already exists

* Delete unused return

* Fix if statement

* format file using Prettier

* Deduplicate lines and improve efficiency
2024-04-01 21:54:54 +00:00
dependabot[bot]
518fc67ec5 chore(deps): Bump @blockly/dev-tools from 7.1.5 to 7.1.7 (#7986)
Bumps [@blockly/dev-tools](https://github.com/google/blockly-samples/tree/HEAD/plugins/dev-tools) from 7.1.5 to 7.1.7.
- [Release notes](https://github.com/google/blockly-samples/releases)
- [Changelog](https://github.com/google/blockly-samples/blob/master/plugins/dev-tools/CHANGELOG.md)
- [Commits](https://github.com/google/blockly-samples/commits/@blockly/dev-tools@7.1.7/plugins/dev-tools)

---
updated-dependencies:
- dependency-name: "@blockly/dev-tools"
  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>
2024-04-01 14:45:54 -07:00
dependabot[bot]
f547fad362 chore(deps): Bump typescript from 5.4.2 to 5.4.3 (#7985)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.4.2 to 5.4.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v5.4.2...v5.4.3)

---
updated-dependencies:
- dependency-name: typescript
  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>
2024-04-01 14:45:24 -07:00
Beka Westberg
2fa6f5b954 fix: comment icon interface re serialization (#7964)
* fix: comment icon interface re serialization

* chore: fix test
2024-04-01 14:34:48 -07:00
Beka Westberg
63eb4ecb2a fix: comment create and delete events (#7945)
* chore: switch events to use new comment class

* fix: switch create and delete events to use JSON

* work on getting new comments to fire events

* chore: fixup tests

* chore: rename workspace comment test to comment view test

* chore: add tests for firing events

* chore: remove TODO
2024-04-01 21:33:50 +00:00