- Issue created by @pdureau
- 🇫🇷France pdureau Paris
The MR is open with a first commit.
After one day of experiment, the plan have changed :)
We introduce a new
ViewportSwitcher
button island with the select. This select will dynamically resize all the main wrapper, without caring about what panels are inside.So, breakpoints providers are configurable in the display builder profile, yes, but from the
ViewportSwitcher
form: by default, all themes are enabled, all modules are disabled.If a breakpoint don't have a max-width (careful, there are many way of expressing it) it is skipped, if a provider hes no breakpoints after those skipped, it is hidden.
We keep those rules:
- Default value = no values = no breakpoint = fluid
- Zoom in/out is out of the scope of this issue (and not planned yet as a feature)
- If no breakpoints are loaded, we hide the viewport switcher.
Let's move this to a follow-up issue:
- We may need to use iframe HTML element in those islands, in order to let the browser recalculate the viewport dimension. Careful about performance issue and implementation complexity, especially related to HTMX. So, the related ✨ Theming Display Builder Active issue will also be postponed.
- Do we also add a handler for free resizing?
- Merge request !75Issue #3538435 by pdureau: Manage breakpoints & add viewports switcher → (Merged) created by pdureau
- 🇫🇷France pdureau Paris
Ready for review.
What about the dependency to
breakpoint
Core module? Do we make it explicit? Implcit? how?Some warnings:
- Aside the additions, the biggest change is the move of some logic from
ComponentLibraryPanel
toPluginProvidersTrait
to avoid duplication. - the new "select" shoelace component raise a warning with
sdc_devel
but any attempt to have a better JSON schema is missing with SDC loader (I guesss...) and remove the key from some mappings - There is no Drupal behaviour for the added JS, but I saw not all JS have behaviours so I don't know if it is mandatory
As said in a previous comment, this is only the first smallest part, a follow-up issue will deal with iframes. But we are lucky it is a cleanly self-defined, fully implemented feature, so it makes sens to merge it before.
- Aside the additions, the biggest change is the move of some logic from
- 🇫🇷France pdureau Paris
missing all the phpdoc, for next functions as well.
Added: https://git.drupalcode.org/project/display_builder/-/merge_requests/75/d...
- 🇫🇷France pdureau Paris
Follow-up issue has been created ✨ Responsive viewports with iframes Active
- First commit to issue fork.
- 🇫🇷France mogtofu33
Fixed the js to not be called multiple times, fixed a but of jsdoc.
Fixed missing schema.
Add a compact mode, update the select twig.
Add e2e test. Automatically closed - issue fixed for 2 weeks with no activity.