* fix: Fix bug that preventing scrolling menu items into view.
* chore: Deprecate now-unused-in-core functions in style.
(cherry picked from commit 0c20129a26)
* chore: rename .eslintrc.js to eslint.config.js
* chore: Rename eslint.config.js to eslint.config.mjs.
* refactor: Migrate ESLint config to new flat format.
* chore: Remove old per-directory and global ignore ESLint config files.
* fix: Allowlist JSDoc tag aliases.
* fix: Don't require @license in tests/*.
* fix: Add NodeJS globals to several files that run under Node.
* chore: Remove now-unneeded ESLint directives in core.
* chore: Remove invalid/unneeded ESLint directives.
* fix: Fix invalid use of `await` outside of an `async` function.
* fix: Improve screenshot error message.
* fix: Update ESLint config file to not warn on existing violations.
* chore: Remove suppressions of rules that weren't triggering.
* chore: Fix package-lock.json.
* refactor: Move functions into FieldDropdown.
* refactor: Make dropdown field image metrics static.
* refactor: Use template literals in FieldDropdown validator.
* fix: bump connected connections in a different direction
* Bump initiator block group in orthogonal direction.
* Revert the wording of a doc comment.
* Addressing PR feedback.
* refactor(shortcuts): Improve shortcut registry documentation & style
Make some minor refactorings of shortcut_registry.ts to improve
readability and style, and add documentation for the
KeyboardShortcut interface type.
* docs(shortcuts): Fix JSDoc typos etc. for PR #8598
* chore: Format
* docs(events): JSDoc improvments
* fix(filter): Introduce enqueueEvent; don't reorder in filter
Remove the broken BlockChange event reordering code from filter.
Instead, do necessary event reordering (correctly, this time)
in a new enqueueEvent function used by fireInternal.
* chore(events): Deprecate forward parameter of filter
Since we don't filter in undo any more, and filtering in reverse
order causes problems, prepare to remove this opportunity for
error.
* fix(events): Only merge adjacent events
Simplify filter by having it consider only adjacent events in the
queue for merging.
Previously any events in the queue could potentially be merged if
they were of suitable (typically identical) .type, even if other
events had occurred between them (with the sole exception of
BlockMove events, which would only be merged with adjacent
events). This could potentially result in replay failures during
undo/redo/mirroring, though it is unknown whether any such
problems occurred in practice.
* refactor(events): Tweaks
- Use for…of loop where appropriate.
- Make filter reason-merging code more concise.
- Use arrow functions when calling Array.prototype.filter.
* chore(events): Fix typos for PR #8539.
* fix: Detect if deleting shadow block affects selection highlight
* Use contains instead of descendsFrom for html consistency.
* Added tests.
* Removing and manually inlining new contains function.
At a high-level, this change ensures that cleaning up a workspace
doesn't move blocks in a way that overlaps with immovable blocks. It
also adds missing testing coverage for both Rect (used for bounding box
calculations during workspace cleanup) and WorkspaceSvg (for verifying
the updated clean up functionality).
This also renames the clean up function to be 'tidyUp' since that better
suits what's happening (as opposed to other clean-up routines which are
actually deinitializing objects).
* refactor(events): Introduce type predicates for event classes
Introduce predicates for testing Abstract event subclasses based on
their .type properties. These are useful because there are places
where it is not possible to use instanceof <ClassConstructor> tests
for type narrowing due to load ordering issues that would be caused
by the need to import (rather than just import type) the class
constructors in question.
* refactor(events): Use event type predicates
Simplify several sections of code by using type predicates for
type narrowing and thereby avoiding the need for explicit casts.
* chore(events): Fix copyright date of recently-added files
* chore: Remove unused import
Use of the filter function in Workspace.prototype.undo has caused
problems with repeated undo/redo (see issue #7026), the
originally-chosen fix for which was the addition (in PR #7069) of
code to fireNow to post-filter the .undoStack_ and .redoStack_ of
any workspace that had just been involved in dispatching events.
This apparently resolved the issue but added considerable
additional complexity and made it difficult to reason about how
events are processed for undo/redo.
Instead, since this filtering typically does nothing (at least
nothing desirable), simply don't re-filter events on the undo
stack before replaying them.
* refactor(events): Use "export ... from" where applicable
* refactor(events): Introduce EventType enum
Introduce an enum for the event .type values. We can't actually
use it as the type of the .type property on Abstract events,
because we want to allow developers to add their own custom
event types inheriting from this type, but at least this way we
can be reasonably sure that all of our own event subclasses have
distinct .type values—plus consistent use of enum syntax
(EventType.TYPE_NAME) is probably good for readability overall.
Put it in a separate module from the rest of events/utils.ts
because it would be helpful if event utils could use
event instanceof SomeEventType
for type narrowing but but at the moment most events are in
modules that depend on events/utils.ts for their .type
constant, and although circular ESM dependencies should work
in principle there are various restrictions and this
particular circularity causes issues at the moment.
A few of the event classes also depend on utils.ts for fire()
or other functions, which will be harder to deal with, but at
least this commit is win in terms of reducing the complexity
of our dependencies, making most of the Abstract event subclass
module dependent on type.ts, which has no imports, rather than
on utils.ts which has multiple imports.
* chore(deps): Add pretter-plugin-organize-imports
* chore: Remove insignificant blank lines in import sections
Since prettier-plugin-organize-imports sorts imports within
sections separated by blank lines, but preserves the section
divisions, remove any blank lines that are not dividing imports
into meaningful sections.
Do not remove blank lines separating side-effect-only imports
from main imports.
* chore: Remove unneded eslint-disable directives
* chore: Organise imports
Add a condition check so that we don't unset
the group ID that is not set by us. Otherwise the
multi-select plugin undo/redo will be broken (apply
individually instead of all together)
Signed-off-by: Hollow Man <hollowman@opensuse.org>
* docs(block): Improve documentation for well-known block methods
Improve the JSDocs for the declarations of well-known block
methods:
- getDeveloperVariables
- compose
- decompose
- saveConnections
* docs(blocks): Improve block comments
Fix JSDoc formatting in both core/block.ts and blocks/*, as well as
making various other minor improvments.
* chore(blocks): Remove one unexported const
* feat: allow fetching block bounds not including children.
* chore: run formatter.
* chore: run the other formatter.
* fix: don't include subsequent blocks in the childless bounding rect.
* chore: remove logging.
* fix: correctly report the pre-resize-drag size to workspace comment size change listeners
* chore: run formatter
* refactor: implicitly use the presence of preResizeSize to identify a drag.