Problem/Motivation
In #3360373-8: [2.0.0-beta2] Allow multiple previews for each pattern, Florent asked:
I think it would be nice to have a mechanism which allows a module or theme to add stories to an existing component without having to redeclare the component.
Proposed resolution
Do we introduce a component story plugin type?
So, we can implement discoveries for :
- UI Patterns 2 stories, based on Render arrays serialized in YML. We move them to separate files (as initially asked by Duaelfr)? One story by file? It will make compoennt definitions YML smaller and allow to declare additional stories as asked by Florent.
- JSON schema examples, as described in #3414774: JSON schema examples property
- Former Mateu's CL JSON format
- New Mateu's Twig format (this one looks complicated to parse)
Issue fork ui_patterns-3455354
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
grimreaperComment #3
pdureau commentedChecked with Florent, no need for this anymore
Comment #4
grimreaperAfter a night of sleep I remember why I put this comment.
In a project using a UI Suite theme and having a sub theme, you will use patterns with styles in Layout Builder or anywhere else.
The idea was to enrich the patterns preview in libraries with the styles applied on the project.
Comment #5
pdureau commentedComment #6
pdureau commentedNot enough time left in Beta 1.
Comment #7
pdureau commentedRelated to #3464909: Collaboration with UI Patterns 2
Comment #8
pdureau commentedWork has started
Comment #9
pdureau commentedComment #11
pdureau commentedWe will need #3475153: Make DirectoryWithMetadataDiscovery generic and reusable to make the implementation nice
Comment #12
pdureau commentedComment #13
pdureau commentedComment #14
pdureau commentedMostly done.
Next steps:
#storyin render element: use machineName instead of plugin IDComment #15
pdureau commentedMoved back to beta4.
Next steps:
Comment #16
pdureau commentedComment #17
grimreaperComment #18
g4mbiniAlready tested with alert component, it's working !
Now I will apply this to all other components to finish my test process.
Comment #19
g4mbiniRTBC +1 :)
Finally updated all DaisyUI components. Worked like a charm !
Just wondering: is it possible to manage ordered stories when we have more than one ?
Comment #20
pdureau commentedI need to update
ui_patterns_develtooComment #21
pdureau commentedComment #22
pdureau commentedComment #24
pdureau commentedComment #25
pdureau commented