The rationale for these was to keep the control flow in one direction, so that the child blocks don't know about the wider sequence they belong to. But that's already undermined by the fact that they have to keep track of their own index number, and it just makes things needlessly unwieldy, particularly when we go on to make action buttons pluggable (and emphatically want to avoid having a mass of abstraction between the button and the action it performs).
Fixes @cnk's test case from #7248. blockErrors within a ListBlockValidationError is an array (with nulls for the items with no errors), but setError was treating it as a dict keyed by block index, which meant it was erroneously passing nulls to the child setError method. FieldBlock handles this gracefully, but other blocks such as StructBlock don't.
This means we're not artificially forcing four different entity types into the same code path, and makes it possible to define new entity types outside of this module.
Also relax the eslint no-unused-vars to allow unused function parameters - having multiple classes following the same interface is a legitimate use of this.
* Added separate SidebarPanel component
* Copied explorer implementation
It's going to need a lot of changes
* Initialise the page explorer
* Move page explorer up a bit
* Hook into page explorer navigation
* Make navigate handler replace default button click behaviour
* Update page explorer to use SidebarPanel
* Add swipe in/out transition for page explorer
This allows us to test it without having to jump through hoops to make the rest of page-editor.js module-friendly, and moving the test module out of client/src/entrypoints means we don't duplicate it into wagtail/admin/static (where the test runner tries to run it again with broken imports)
This means we don't need a bogus "eslint-disable-next-line import/no-unresolved" directive when importing built CSS, which ends up breaking lint locally. Fixes #7177
The tab code looks for the presence of a URL hash and calls showTab on a link with that href, without checking that the link A) actually exists and B) is a tab as identified by the data-tab attribute. As a result, non-tab-related uses of URL hashes (such as simply visiting /admin/#foo) throw a JS error.
Fixes #7146 - the root StreamField element is now matched by ID _and_ having a data-block attribute. (Duplicate IDs are invalid HTML and the 'proper' fix would be to add a global prefix to form fields, particularly since this problem isn't necessarily specific to StreamFields - but that would be a bigger breaking change.)
- Run `npx -p @storybook/cli sb init --type react --builder webpack5`
- Moved .storybook and stories folders into client
- Run `npm i --save-dev html-webpack-plugin@latest` to workaround https://github.com/storybookjs/storybook/issues/13332
- Add storybook-static to .gitignore