This supports e.g. expand/collapse icons added outside core Blockly.
MakeCode has an expand FieldImageNoText on collapsed blocks that wasn't
otherwise navigable (inserted into COLLAPSED_INPUT_NAME):
input.appendField(new FieldImageNoText(image, 24, 24, "Expand", () => {
this.setCollapsed(false)
}, false));
To support this:
1. the input that shares the block row id takes into account visibility
2. we drop the short circuit for collapsed blocks and rely on the filtering
already in place to filter out the collapsed content
Also filter icons whose updateCollapsed() hides them via display:none;
without this they remain in the candidate list and the navigator can
focus e.g. an invisible cog for a mutator workspace.
Add tests for icon visibility.
* chore: Format build_tasks.mjs
* feat: Enable `assume_function_wrapper` build flag
* refactor(build): Separate chunk exporter creation from compilation
Since the chunk export files are source files to Closure Compiler,
separate the creation of the former from the invocation of the
latter. Specifically:
- Rename writeChunkExportFiles to buildChunkExporters.
- Invoked as a separate task in the minify series, instead of
calling it directly from buildCompiled.
- Revert the changes to buildCompiled that made it an async
function just so it could call writeChunkExportFiles.
* refactor(build): Use a separate property for each chunk's exports
The existing code results in each chunk overwriting the same
well-known property ($.__chunkExports__). Since these properties
are only expected to be read once, in the same chunk's wrapper's
factory function, this isn't strictly wrong - but it made
understanding the minified bundles produced by PR #9912 a bit
confusing.
* cleanup(build): Minor naming improvements
* docs(build): Improve JSDocs + inline comments
Note that some comments have been deleted without replacement;
these made statements which are no longer true.
* cleanup(build): Reorder new chunk-exporters-related code
Reorder the new code that generates the chunk exporters, to put
it together with (but before) the code that generates the chunk
wrappers, since the two are closely coupled.
* fix(build): Rename chunk exporter's dir + filenames to "exporters"
For consistency with code and docs, call the files that contain code
which retrieves the chunks' export objects "chunk exporters", since
"chunk exports" better describes the objects being exported.
---------
Co-authored-by: Christopher Allen <cpcallen+git@google.com>
This differs from the keyboard nav plugin but I think it's correct for an
on-by-default world as it's very weird to encounter this toast on a touch
device with and not helpful for mouse usage (e.g. in MakeCode's context menu).
* chore: add additional logging to CI to catch circular deps and exit mocha on failure
* chore: fix blockly import
* chore: format
* chore: increase webdriver timeout to allow longer tests
* fix: stack overflow if a sound is missing
* chore: dont fail for any console errors
* chore: needs more timeout
* chore: run mocha in a subprocess
* chore: fix chromedriver cache issues
* chore: remove bad error condition
* fix: refactor custom input labels to simplify
* fix: handle bad field image config from block factory
* chore: remove stray log
* fix: fix move mode labels
* fix: dont use numbered inputs for dummy and end row inputs
* chore: fix test
* fix: Fix typo in unregisterWorkspace function name
* fix: Add deprecation warning for unregisterWorkpace function
* fix: Add renaming entry for unregisterWorkspace in version 13.0.0
* fix(typo): "." -> "," in renamings.json5
Co-authored-by: Maribeth Moffatt <mebottorff@gmail.com>
* fix(workspace): Correct typo in `unregisterWorkspace` method call
* chore: change v12 to v13
* chore: update import
---------
Co-authored-by: Woosuk Nam <me@suk.kr>
* chore: add legacy redirects from devsite
* chore: rename configure/web to just configure
* chore: remove youtube embeds because we are scared of cookies
* chore: fix some broken images
* chore: add accessibility section for extending a built-in field
* chore: add information about accessibility to the creating a custom field page
* chore(docs): better phrasing about getAriaValue
* feat: Announce usage hints to screenreaders on initial workspace focus
* fix: Improve robustness of tests
* fix: Fix merge
* fix: Don't announce screenreader usage on first focus of every workspace
* fix: Fix test
* feat: Add custom input labels to built in blocks
* feat: Add custom input labels to built in list blocks
* fix: replace 'command' with 'statement' in new translation docs
* fix: remove some labels
Reverts the storage mechanism introduced in #9611 (constructable
stylesheets via `adoptedStyleSheets`) while keeping the per-root
injection-site tracking that #9611 added for shadow-DOM support.
Motivations:
- Safari 15.4 compatibility. `new CSSStyleSheet()` and
`adoptedStyleSheets` require Safari 16.4+
- Cascade order. `adoptedStyleSheets` apply after `<style>`/`<link>`
elements in the document, so Blockly's defaults silently overrode
host stylesheets. Prepending a `<style>` to the head (or to the
shadow root) restores the pre-#9611 behavior where any author
stylesheet declared later wins on specificity ties.
Trade-offs:
- Per-shadow-root CSS text is duplicated rather than shared via a
single adopted sheet object. Negligible for typical use.
- `Css.register()` calls made after the first `inject()` no longer
reach already-injected roots (same as #9611's behavior); subsequent
`inject()` calls into other roots still pick them up. Web-component
consumers can legitimately register late, so this is preferred to
reinstating the pre-#9611 throw.
Fixes#9876