This PR tries to allow popovers examples to be tried on StackBlitz.
In the documentation, they need some JS available in site/assets/js/snippets.js
.
IMHO it would be troubling to have all this file integrated in StackBlitz.
So in this PR I'm trying to:
- Split
site/assets/js/snippets.js
into small reusable parts - Create a new
javascript
parameter for theexample
shortcode containing the name of the reusable JS file to embed into StackBlitz - Allow
site/layouts/partials/scripts.html
to gather this information and embed the content of the JS file in a<script>
.
Sub-tasks
-
Instead of using <script>
, try to create a realindex.js
file in StackBlitz imported byindex.html
. Find a better way to share the JS name between the doc, the shortcode and thesite/layouts/partials/scripts.html
-
Security concerns to gather some JS file content?
Live previews
- Live demo
- Four directions
-
Custom popovers—Not working because doesn't exist in 5.1.3
- That's a problem because we will only be able to suppose that the components will work on StackBlitz when we develop them. We will have to wait until it they are released in order to see if it is OK or not.
- Dismiss on next click
- Disabled elements
Not tackled here
- Be able to pass multiple JS files (might be useful for other examples more complex)—we will see that while developing the fix for the other components
- Be able to split the SCSS file used by examples and to pass it (them) like the JS files
- (Optional) Hide some examples if too complex or impossible to try on StackBlitz