* fix: improve flyout performance
* refactor: don't call position() in show()
The later call to reflow() itself winds up calling position(), so this calculation is redundant.
* 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
* 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.
* fix: add basic autoclose toggling support
* fix: drag areas being incorrect
* fix: blocks getting bumped around when dragged into flyout area
* fix: respect always-open flyouts attached to toolboxes
* fix: flyout not hiding on ws click
* fix: have all flyouts filter for capacity
* chore: cleanup
* fix: view metrics not respecting flyout
* chore: fix change detectors
* fix: trashcan not firing close event on click
* add saveIds param and logic to save correctly
* remove whitespace
* add saveIds to recursive calls
* run format
* change name from addIds to saveIds
* add saveIds test
* change blockId on false saveIds to undefined
* Setting style property to make CSP less grumpy.
"Content-Security-Policy: The page’s settings blocked the loading of a resource at inline (“style-src”)."
The 'style' property should be set as an object, not as a string, according to CSP rules.
Back-ported from Blockly Games.
* fix(build): Restore erroneously-deleted filter function
This was deleted in PR #7406 as it was mainly being used to
filter core/ vs. test/mocha/ deps into separate deps files -
but it turns out also to be used for filtering error
messages too. Oops.
* refactor(tests): Migrate advanced compilation test to ES Modules
* refactor(build): Migrate main.js to TypeScript
This turns out to be pretty straight forward, even if it would
cause crashing if one actually tried to import this module
instead of just feeding it to Closure Compiler.
* chore(build): Remove goog.declareModuleId calls
Replace goog.declareModuleId calls with a comment recording the
former module ID for posterity (or at least until we decide
how to reformat the renamings file.
* chore(tests): Delete closure/goog/*
For the moment we still need something to serve as base.js for
the benefit of closure-make-deps, so we keep a vestigial
base.js around, containing only the @provideGoog declaration.
* refactor(build): Remove vestigial base.js
By changing slightly the command line arguments to
closure-make-deps and closure-calculate-chunks the need to have
any base.js is eliminated.
* chore: Typo fix for PR #7415
* chore: work on cleaning up mutator tests
* chore: remove need for dragBlockSelector
* chore: add helpers to clean up tests
* chore: add issue link in TODO
* chore: format and add docs for new helpers
* Revert "chore: remove need for dragBlockSelector"
This reverts commit dfec88a6aa.
* chore: fixup connect helper
* fix: make JSON use render queue
* fix: updating disabled for JSON system
* fix: make XML use render queue
* chore: make flyout use render queue explicitly
* feat: Add 'reason' field to move event
There are many types of move. This addition allows one to detect what the reason for each move is.
* Clang formatting.
And unsaved editor tabs.
* Change reason string to array.
* 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.
* 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
* refactor: Remove checks for PointerEvent support.
* refactor: Deprecate and remove calls to splitEventByTouches.
* refactor: Deprecate and remove calls to setClientFromTouch().
* refactor: Use PointerEvent in place of Event/MouseEvent/TouchEvent/PseudoEvent.
* refactor: Update references to mouse/touch events in code and documentation to reference pointer events.
* refactor: Merge Gesture and TouchGesture
* chore: clang-format changed files
* refactor: Bind and expect PointerEvents instead of MouseEvents.
* refactor: Rename TouchGesture to Gesture.
* fix: Fix test failures.
* chore: clang-format changed files.
* fix: Fix errant _ from merging
* refactor: Clean up dead code in browser_events.ts.
* chore: Update version in deprecation notices to reflect release schedule
* fix: Fixed a bug that caused the browser context menu to not be suppressed in Chrome.
* fix: Re-export Gesture as TouchGesture for backwards compatibility.
* refactor: Deprecate and remove uses of opt_noPreventDefault.
* chore: Fix error message in gesture.ts.
* chore: Removed obsolete todo.
* chore: remove radix from parseInt
Previously any number starting with '0' would be parsed as octal if the radix was left blank. But this was changed years ago. It is no longer needed to specify a radix.
* chore: 'ID' is identification
'id' is a part of Freud's brain.
* Use Unicode characters instead of codes
This is in line with the current style guide.
* Simplify Blockly.utils.dom methods.
classList add/remove/has supports SVG elements in all browsers Blockly supports (i.e. not IE).
* refactor: Remove uses of AnyDuringMigration from flyout_base.ts.
* refactor: Remove uses of AnyDuringMigration from flyout_metrics_manager.ts.
* refactor: Remove uses of AnyDuringMigration from variables_dynamic.ts.
* refactor: Remove uses of AnyDuringMigration from procedures.ts.
* refactor: Remove uses of AnyDuringMigration from generator.ts.
* refactor: Remove some uses of AnyDuringMigration from menu.ts.
* refactor: Remove uses of AnyDuringMigration from mutator.ts.
* refactor: Remove uses of AnyDuringMigration from variables.ts.
* refactor: Remove uses of AnyDuringMigration from array.ts.
* refactor: Remove uses of AnyDuringMigration from aria.ts.
* refactor: Remove uses of AnyDuringMigration in basic_cursor.ts.
* refactor: Remove uses of AnyDuringMigration in dropdowndiv.ts.
* refactor: Remove uses of AnyDuringMigration in utils.ts.
* refactor: Remove uses of AnyDuringMigration from menuitem.ts.
* refactor: Remove uses of AnyDuringMigration from idgenerator.ts.
* refactor: Remove uses of AnyDuringMigration in block_animations.ts.
* refactor: Initialize definitions and functionNames in generator.ts by default.
* chore: add linting for tsdoc
* chore: don't require types on return
* chore: remove redundant fileoverview from ts
* chore: change return to returns and add some newlines
* chore: remove license tag
* chore: don't require params/return docs
* chore: remove spurious struct tags
* Revert "chore: change return to returns and add some newlines"
This reverts commit d6d8656a45.
* chore: don't auto-add param names
* chore: disable require-param bc it breaks on this
* return to returns and add line breaks
* chore: configure additional jsdoc rules
* chore: run format
* Revert "chore: remove license tag"
This reverts commit 173455588a.
* chore: allow license tag format
* chore: only require jsdoc on exported items
* chore: add missing jsdoc or silence where needed
* chore: run format
* chore: lint fixes
* refactor: Remove uses of AnyDuringMigration from scrollbar.ts.
* refactor: Remove almost all uses of AnyDuringMigration from workspace_svg.ts.
* refactor: Remove uses of AnyDuringMigration from contextmenu_registry.ts.
* refactor: Remove uses of AnyDuringMigration from component_manager.ts.
* refactor: Use String() rather than toString().
* fix: Fix lint and build errors.