tools: add button to copy code example to clipboard
Fixes: #46894 (closed)
Open the PR early for some initial feedback.
-
support js flavor (cjs, mjs) -
support code snippet without js flavor -
fix the button style
Quick demo: https://user-images.githubusercontent.com/38635403/222962223-4a6e21af-4a8b-420d-8d9b-10b8a1138ea6.mov