Commit Graph

8445 Commits

Author SHA1 Message Date
Beka Westberg
da8a83b925 feat: have the gesture use a dragger for blocks (#7972)
* feat: have block use drag strategy

* fix: gesture to use dragger for blocks

* chore: register dragger

* chore: remove getInsertionMarkers and pull logic into workspace
2024-03-28 17:38:58 -07:00
Beka Westberg
75fc4704da feat: have block use drag strategy (#7971) 2024-03-28 17:15:36 -07:00
Beka Westberg
8b6e9d8cad feat: add block drag strategy (#7970)
* feat: add the block drag strategy

* chore: remove underscores

* chore: make crazy condition clearer?

* chore: rename var
2024-03-28 16:05:04 -07:00
Beka Westberg
da79a120f2 fix: remove parameter from wouldDelete (#7968) 2024-03-28 15:39:48 -07:00
Beka Westberg
6fe080bc6e fix: draggable interface and concrete dragger (#7967)
* fix: interface to match design

* fix: dragger implementation

* fix: rename moveToStart to revertDrag

* fixup
2024-03-28 15:11:30 -07:00
Beka Westberg
3ea330b981 fix: comment view styling (#7965) 2024-03-27 11:19:00 -07:00
Christopher Allen
0588dfade8 feat(dragging): Introduce Dragger, implementing IDragger (#7956)
* feat(dragging): Introduce Dragger, implementing iDragger

* docs(dragging): JSDoc for Dragger's .startLoc
2024-03-22 19:03:57 +00:00
Beka Westberg
d01f9a73fe fix: comment position in RTL (#7934)
* fix: how comments are laid out in RTL

* fix: comment positioning with JSON

* fix: comment positioning with XML
2024-03-22 10:46:42 -07:00
Christopher Allen
11c219c537 feat(dragging): Create (new) IDragger and IDraggable interfaces (#7953)
* chore(dragging): Rename core/interfaces/i_draggable.ts

  Rename core/interfaces/i_draggable.ts to
  core/interfaces/i_draggable.old.ts to make room for new
  IDraggable.  Do not rename actual interface as it's not yet
  clear that it will be necessary for both to coexist as
  imports in the same file.


* feat(dragging): Introduce new IDraggable interface

* feat(dragging): Introduce new IDragger interface

---------

Co-authored-by: Beka Westberg <bwestberg@google.com>
2024-03-22 16:21:14 +00:00
Christopher Allen
b0430d5302 release: Update version number to 11.0.0-beta.6 blockly-v11.0.0.-beta.6 2024-03-21 17:20:26 +00:00
Christopher Allen
3934447c64 release: Update version number to 11.0.0-beta.5 2024-03-21 17:12:14 +00:00
Christopher Allen
d3575adcb8 fix(typings): Restore inadvertently-deleted typings/msg/msg.d.ts; add TS import test (#7955)
* test(typings): Add langfile (msg) import + typings test

* fix(typings): Restore inadvertently-deleted typings/msg/msg.d.ts

  Fixes #7952.

  The main typings file for langfiles, typings/msg/msg.d.ts, was
  inadvertently deleted in PR #7822.

  This was part of a well intentioned attempt to remove spurious
  files from typings/msg/ that do not correspond to published
  langfiles, but this file should have been retained because
  msg.d.ts is reexported by all the other *.d.ts files in this
  directory.
2024-03-21 15:01:22 +00:00
Beka Westberg
5462b21b15 fix: comment have XML save and load new workspace comments classes (#7931)
* fix: have XML save and load new comment classes

* chore: fix imports to resolve circular dependencies

* chore: add round-trip tests

* chore: skip failing test

* fixup: PR comments
2024-03-20 16:25:41 -07:00
Beka Westberg
407ff44e18 feat: add JSON serialization for workspace comments (#7927)
* feat: basic comment serializer

* bad: temporarily jam new comment classes into array

* chore: implement serializer

* chore: add serialization tests

* chore: JSDoc

* chore: unonly tests
2024-03-20 12:40:27 -07:00
Beka Westberg
fd1a02ff37 feat: have RenderedWorkspaceComment implement IBoundedElement and IRenderedElement (#7919)
* feat: implement IBoundedElement

* feat: implement IRenderedElement
2024-03-20 08:27:32 -07:00
Beka Westberg
93acb62456 feat: rendered workspace comment (#7918)
* feat: add basic rendered workspace comment

* feat: add updating the view and model

* feat: add support for setting editability

* feat: add moveTo support

* feat: add disposing

* chore: add tsdoc

* fix: disposing of the comment when the delete icon is clicked

* feat: add isDeadOrDying
2024-03-19 10:52:27 -07:00
Christopher Allen
250cf90d25 release: Update version number to 11.0.0-beta.4 blockly-v11.0.0-beta.4 2024-03-18 19:58:39 +00:00
Christopher Allen
10ffcb706d release: Merge branch 'develop' into rc/v11.0.0 2024-03-18 19:57:04 +00:00
dependabot[bot]
4e2930e6a2 chore(deps-dev): Bump follow-redirects from 1.15.4 to 1.15.6 (#7941)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.4 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.4...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-15 22:43:12 +00:00
Christopher Allen
c97b13632c feat(build)!: Introduce exports section in package.json (#7822)
* fix(typings): Remove bogus .d.ts files; add new languages
  
  PR #3821 added .d.ts files for every file in msg/json/, but several
  of these are internal utility files rather than translations, and
  do not result in a langfile being output by create_messages.py
  when building langfiles.
  
  In the meantime we have added a few new languages that are being
  published but which have (until now) not had the corresponding
  type declarations.
  
* feat(build)!: Add exports section to package.json
  
  Add an exports stanza to package.json, enumerating existing
  entrypoints in a new format.
  
  - The original main entrypoint, index.js, is removed since the
    exports section can point directly at node.js or browser.js.
  - No change made (yet) to other entrypoints (core, blocks,
    generators); these will be dealt with in a subsequent PR.
  - The msg/en entrypoint is included in the top-level package.json
    as an example; entries for all other languages created as part
    of the packageJSON package task.
  
  BREAKING CHANGE: The introduction of an exports stanza means that
  correctly-behaved tools (node.js, bundlers like webpack, etc.)
  will only allow importing of the specified entrypoints.  Here
  is the full list of permitted entrypoints that can be imported
  or required:
  
  - blockly
  - blockly/core
  - blockly/blocks
  - blockly/dart
  - blockly/lua
  - blockly/javascript
  - blockly/php
  - blockly/python
  - blockly/msg/<lang>, for all supported language codes <lang>
    (e.g blockly/msg/en, blockly/msg/fr, blockly/msg/de, etc.)
  
  If you previously impored any other paths from the blockly package
  you will need to update your imports.  Here are the most common
  paths that may have been used, and their correct replacements:
  
  | If you previously imported:      | Import instead:            |
  | -------------------------------- | -------------------------- |
  | blockly/index.js                 | blockly                    |
  | blockly/node.js                  | blockly                    |
  | blockly/browser.js               | blockly                    |
  | blockly/blockly.min | This file should only be loaded as a <script>. |
  | blockly/core.js                  | blockly/core               |
  | blockly/core-browser.js          | blockly/core               |
  | blockly/blockly_compressed.js    | blockly/core               |
  | blockly/blocks.js                | blockly/blocks             |
  | blockly/blocks_compressed.js     | blockly/blocks             |
  | blockly/dart.js                  | blockly/dart               |
  | blockly/dart_compressed.js       | blockly/dart               |
  | blockly/lua.js                   | blockly/lua                |
  | blockly/lua_compressed.js        | blockly/lua                |
  | blockly/javascript.js            | blockly/javascript         |
  | blockly/javascript_compressed.js | blockly/javascript         |
  | blockly/php.js                   | blockly/php                |
  | blockly/php_compressed.js        | blockly/php                |
  | blockly/python.js                | blockly/python             |
  | blockly/python_compressed.js     | blockly/python             |
  | blockly/msg/en.js                | blockly/msg/en             |
  
* fix(build): Use package-paths (blockly/*) in wrapper imports
  
  Use 'blockly/core' instead of './core' when importing core into
  other wrappers (and similarly for other entries in package.json
  exports stanza), so that (e.g.) dist/javascript.js won't
  import dist/core.js (the node.js version that loads jsdom) when
  being loaded in a browser environment.
  
  This fixes an issue where blockly attempts to load jsdom even
  in browser environments because the browser stanza in
  package.json, which caused attempts to load core.js to load
  core-browser.js instead in browser environments, was removed
  in a previous commit.
  
* refactor(build): Remove unnecessray wrappers
  
  Remove pointless wrapper modules that no longer server any
  purpose; use exports stanza in package.json to point directly to
  compiled chunks where possible.
  
* refactor(build)!: Eliminate separate browser and node entrypoints
  
  Combine scripts/package/browser/index.js (becomes dist/browser.js)
  and scripts/package/node/index.js (becomes dist/node.js) into
  a single environment-agnostic index.js.
  
  BREAKING CHANGE: Historically, importing the main 'blockly' package
  would import 'blockly/core', 'blockly/blocks', 'blockly/en' and
  'blockly/javascript' - and additionally, in node.js, also import
  'blockly/dart', 'blockly/lua', 'blockly/php' and 'blockly/python'.
  
  Now the main 'blockly' package entrypoint never loads any of the
  generator modules.
  
  This change has been made because of changes to generator exports
  made in blockly v9.0.0 that make necessary to always separately
  import generator modules.
  
  Note that this change does not affect loading the blockly package
  via <script src="https://unpkg.com/blockly"; that continues to
  load to blockly.min.js, which includes javascript_compressed.js
  and (due to being loaded as a script) makes it available via
  Blockly.JavaScript.
  
* refactor(build): Simplify core entrypoint wrapper for node.js
  
  Move scripts/package/node/core.js to scripts/package/core-node.js,
  and have it packaged as dist/core-node.js rather than dist/core.js
  - without a UMD wrapper, since it will always be loaded as a CJS
  module.
  
* chore(build): Remove disused packageCommonJS helper
  
* refactor(build): Use subpath pattern (wildcard) for msg/* exports
  
  Use a subpath pattern (wildcard) for the msg/* entrypoints,
  obviating the need for special handling in packageJSON.
  
* fix(tests): Fix node tests
  
  run_node_test.js previously directly require()d the dist/blockly.js
  and dist/javascript.js wrapper module, which no longer exist.
  
  Change it to require('blockly-test') (and …blockly-test/javascript)
  and create a symlink ./node_modules/blocky-test -> dist/ to satisfy
  this.
  
* fix(build): Add types: and default: entries to exports['./core']
  
  In the 'blockly/core' export:
  
  - Replace the browser: entrypoint with a default: one.
  - Add a types: entrypoint for core.
2024-03-15 22:09:41 +00:00
Christopher Allen
a6208d78b7 fix(generators): Make scrub_ public (#7940)
Fixes #2156.

In PRs #7602, #7616, #7646, #7647 and #7654 the @protected
access modifier on scrub_ on the CodeGenerator subclasses
was not transcribed to the new typescript signature.  I was
going to re-add it, but this breaks some of the procedure
block generator functions which rely on it, and then
@BeksOmega pointed out that this might be one of the
CodeGenerator API functions which we had already decided
should be public—and lo and behold I found #2156.

Per discussion amongst team, I am not renaming it to
scrub at this time.
2024-03-15 22:01:46 +00:00
Blake Thomas Williams
b6b57215a8 fix: updated field_dropdown to properly infer its Field type with TS 5.3.3 (#7939)
* fix: updated field_dropdown to properly infer its Field type with TS 5.3.3

* fix: removed undefined as an option as its not needed for the type fix

* fix: updated field_dropdown to allow |undefined class validation
2024-03-15 14:45:16 -07:00
Beka Westberg
8fc439f090 feat: add headless workspace comment class (#7916)
* feat: add empty definitions for comment class

* feat: implement constructor

* feat: add method implementations

* feat: add own properties

* chore: add tsdoc

* fix: typos

* chore: cleanup TODOs
2024-03-15 11:36:10 -07:00
Rachel Fenichel
b70da6d3de chore: delete blockfactory_old (#7933) 2024-03-15 11:24:41 -07:00
Beka Westberg
8821c83cc9 feat: allow overriding comment icons (#7937)
* feat: add comment icon interface

* feat: have blocks construct comment icons from registry

* chore: add tests for setCommentText

* fix: typeguard
2024-03-15 18:20:08 +00:00
Neil Fraser
0ecbcde9fc chore: Use .includes and .startsWith, not .indexOf (#7936)
Easier to read than the diverse collection of `=== 0` and `!== -1` and `> -1` tests.
2024-03-15 00:03:55 +01:00
Beka Westberg
e91dd203c3 fix!: classes on text input bubble to match comment view (#7935) 2024-03-14 09:57:18 -07:00
Rachel Fenichel
67c3aae76c feat!: delete angle, colour, and multiline input fields and blocks (#7932)
* chore: delete mocha tests for angle field

* feat! : delete angle field

* chore(tests): delete colour tests from generator tests and golden files

* chore: delete colour blocks and associated generators

* chore: remove colour blocks from playgrounds

* chore: delete mocha tests for colour fields

* chore: fix incorrect comment

* chore: delete colour field from core

* chore: delete multiline input tests from generators tests and golden files

* chore: delete multiline text block and associated generators

* chore: remove multiline text block from playgrounds

* chore: delete mocha tests for multiline input field

* chore: delete multiline input field from core
2024-03-13 13:28:26 -07:00
Beka Westberg
a5126d1176 fix!: have disposing be true from start of dispose (#7891) 2024-03-13 09:23:11 -07:00
Beka Westberg
81e2203f7f chore: merge master into develop following V10.4.3 release
Merge pull request #7930 from BeksOmega/merge/master-to-dev
2024-03-13 16:18:23 +00:00
Beka Westberg
443f0eb316 chore: merge master into develop 2024-03-12 17:48:43 +00:00
Beka Westberg
5d4e120d9a chore: merge develop into v11.0.0
Merge pull request #7929 from BeksOmega/merge-dev-v11
2024-03-12 16:56:34 +00:00
Beka Westberg
cac6b64ab0 chore: merge develop into v11 2024-03-12 16:10:59 +00:00
Beka Westberg
30127db35f fix: comment min size (#7915)
* feat: add min and max to size

* fix: properly calculate the minimum size of the comment

* fix: inline docs
2024-03-11 20:57:47 +00:00
Beka Westberg
fc4228ce03 feat: add comment view (for workspace comments, and block comments for partners) (#7914)
* feat: add basic comment view

* feat: add icons to comment

* chore: add text area to comment view

* feat: add getting size

* feat: add collapsing comment view

* feat: add setting editability

* feat: add location and text hooks.

* feat: add changing the size

* feat: resizing

* feat: add collapsing

* feat: add disposing

* feat: add cursors

* feat: add moving to the front

* chore: split construction into subprocedures

* chore: split resizing into subprocedures

* feat: handle RTL

* chore: add doc comments throughout file

* chore: reduce css specificity where possible

* chore: format

* feat: add remove change listener methods

* chore: add tests for listeners

* feat: add disposing accessors

* chore: add coordinate system notes

* chore: add issues to TODOs where possible

* chore: remove suite.only
2024-03-11 12:12:35 -07:00
Beka Westberg
0e22a7982e release: v10.4.3
Merge pull request #7917 from BeksOmega/rc/v10.4.3
blockly-v10.2.0 blockly-v10.4.3
2024-03-11 16:44:19 +00:00
Rachel Fenichel
84218fe9b1 Merge pull request #7903 from google/rachel-fenichel-patch-2
chore: fix spelling in common.ts
2024-03-08 15:11:19 -08:00
Rachel Fenichel
3fccb75885 chore: format 2024-03-08 15:08:15 -08:00
Beka Westberg
48228e47e3 chore: merge develop into v11 to fix CI (#7893)
* fix: destroy connection highlight when the connection is disposed (#7830)

* fix: fix reference docs toc generation (#7832)

* fix: insertion marker previewer finding wrong connection for different conn counts (#7833)

* feat: make grid options togglable (#7828)

* chore(deps): Bump prettier from 3.1.1 to 3.2.5 (#7831)

Bumps [prettier](https://github.com/prettier/prettier) from 3.1.1 to 3.2.5.
- [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.1.1...3.2.5)

---
updated-dependencies:
- dependency-name: prettier
  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>

* fix: disposing of connection previewer (#7834)

* fix: typo in Click event class docs

* chore: rollup of updates from translatewiki for 10.4.0 (#7856)

* chore: update metadata for v10.4.0 (#7857)

* release: update version number to 10.4.0

* fix: connection previewer disposing too early

* Merge pull request #7859 from BeksOmega/fix/previewer-disposing

fix: connection previewer disposing too early
(cherry picked from commit da3ec253bf)

* release: update version number to 10.4.1

* chore: move connection previewer out of subfolder (#7835)

* chore(deps-dev): Bump undici from 5.26.3 to 5.28.3 (#7862)

Bumps [undici](https://github.com/nodejs/undici) from 5.26.3 to 5.28.3.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.26.3...v5.28.3)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: update webdriverio to fix chrome endpoint issue (#7875)

* fix: insertion marker drag scaling (#7874)

* fix: insertion marker drag scaling

* chore: added docs for other params

* fix: restore respecting snap radius (#7873)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Maribeth Bottorff <maribethb@google.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Elvis Adomnica <elvis.adomnica@gmail.com>
Co-authored-by: Rachel Fenichel <fenichel@google.com>
2024-03-08 14:24:58 -08:00
Beka Westberg
6a29acbe7a release: Update version number to 10.4.3 2024-03-08 20:19:00 +00:00
Beka Westberg
0ab2809ce9 fix: connection dancing (#7899)
* fix: special case zelos for connection previewing

* chore: add TODO

(cherry picked from commit 848415e48f)
2024-03-08 20:17:12 +00:00
Beka Westberg
8dee571469 chore: make getters for grid attributes public and update inline docs (#7865) 2024-03-08 09:16:18 -08:00
Beka Westberg
848415e48f fix: connection dancing (#7899)
* fix: special case zelos for connection previewing

* chore: add TODO
2024-03-08 08:45:11 -08:00
Beka Westberg
7c7dfd003f fix: shouldPreventMove not being respected (#7894)
* fix: shouldPreventMove not being respected

* fix: PR comments
2024-03-07 10:14:03 -08:00
Rachel Fenichel
ccd29be4c4 chore: fix spelling in common.ts
definiton -> definition
2024-03-06 11:37:38 -08:00
Rachel Fenichel
ca743cc85d Merge pull request #7886 from devilhyt/fix/libraryBlocks-exports
fix: libraryBlocks exports
2024-03-05 09:32:15 -08:00
Maribeth Bottorff
71185b5582 Merge pull request #7880 from google/master
chore: master into develop following v10.4.2
2024-02-28 15:32:28 -08:00
dependabot[bot]
039ccb71d0 chore(deps): Bump eslint from 8.56.0 to 8.57.0 (#7887)
Bumps [eslint](https://github.com/eslint/eslint) from 8.56.0 to 8.57.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.56.0...v8.57.0)

---
updated-dependencies:
- dependency-name: eslint
  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>
2024-02-27 17:45:49 +00:00
devilhyt
a20a8a77cf fix: libraryBlocks exports 2024-02-25 17:56:25 +08:00
Maribeth Bottorff
bdc416f691 release: v10.4.2
release: v10.4.2
blockly-v10.4.2
2024-02-21 11:45:24 -08:00