Migrate interactive tutorials (post realm v0.70)

Attempt migrating interactive tutorial again

Migrate interactive tutorial snippet syntax

Interactive tutorials: partially migrate send-xrp, no-freeze to new syntax

Fix Send XRP interactive tutorial

Interactive tutorials: fixes for Redocly incl. localization challenges

Interactive tutorials: switch defaultValue back to value in anticipation of Redocly bugfix

Fix document.ready→window.onRouteChange, cyclers, etc. in interactive
tutorials.
This commit is contained in:
mDuo13
2023-12-21 13:57:58 -08:00
parent 4c9a8c0bf9
commit ee8acbbd22
41 changed files with 671 additions and 540 deletions

View File

@@ -51,3 +51,16 @@ export function slugify(s) {
}
return s;
}
export function idify(s: string) {
// like slugify, but more unicode-friendly.
// for some reason the better version using \p gives an "s12 is undefined" TypeError sometimes,
// so it's disabled for now. With that fixed, we could use localized step names in interactive tutorials.
//s = s.replace(/[^\p{Alphabetic}\p{Mark}\p{Decimal_Number}\p{Connector_Punctuation}\p{Join_Control}]/gu, '').trim().toLowerCase()
s = s.replace(/[^\w\s-]/gu, '').trim().toLowerCase()
s = s.replace(/[\s-]+/gu, '-')
if (!s) {
s = "_";
}
return s
}