Additional Tutorials
hidden
Enables the inclusion of additional tutorials that are not part of any plugin or other component.
| ID | extra-tutorials |
| Version | 1.0.0 |
| Author | Jirka Horák |
| Source | plugins/extra-tutorials |
Dependencies
Additional configuration keys
server
See include.json for details and defaults.
Documentation
Extra Tutorials
Adds the possibility to create tutorials within an external system and enable them or run them immediately.
The parameters of this plugin expect data element to be present, an array of objects that have:
- [R]
title- the tutorial name - [O]
description- the tutorial description - [O]
runDelay- whether to run the tutorial immediately or not; only first element is run, others are ignored, defaultundefined, otherwise set a MS delay for the tutorial to start, minimum 250ms - [O]
attach- whether to enable the user to run the tutorial whenever they want, defaulttrue - [O]
confirm- when truthy, shows a confirmation overlay (built onUI.IllustratedModal) before the tutorial starts and the user can decline. Works with or withoutrunDelay: ifrunDelayis omitted, the tour starts immediately on accept; otherwise the delay is applied after accept. Passtruefor defaults or an object to customise:title— modal headingmessage— HTML-capable body copy (description is not used as a default to keep technical wording out of the overlay)acceptLabel,declineLabel— button labelsimage— URL of an illustration shown on the right pane (overridesillustrationIcon)illustrationIcon— Phosphor icon class (e.g."ph-graduation-cap","ph-laptop") used when noimageis providedaccent— palette accent for the primary button:"primary"(default),"accent","secondary","success","info"gradient— optional CSS background string overriding the default backdrop. The default is a theme-reactive pastel: fixed pastel hue stops multiplied againstoklch(var(--b1))(the active theme's surface) viabackground-blend-mode: multiply, so light themes show soft sherbet and dark themes show a muted dim-pastel variant. Pass a CSS gradient string to override (e.g."linear-gradient(135deg, #6e3afe, #00c4ff)"); the multiply still applies, so custom gradients also dim naturally in dark mode. Closing the dialog with X counts as decline.
- [R]
content- the tutorial content, a list of objects ofRULE -> TEXTmapping that define what rule (context action + selector, e.g."click #item") maps to what textual description in each tutorial step
Allowed HTML in text fields
Every external string (title, description, all confirm.* text fields, every step description in content) is sanitised at plugin load via the sanitize-html module. The allowlist is intentionally narrow — only lightweight formatting tags survive:
<b>, <strong>, <i>, <em>, <u>, <br>, <code>, <span>, <sub>, <sup>
Everything else is unwrapped to plain text. All attributes are dropped (including style, class, and every on* event handler). Anchor / link tags are not allowed. Two non-HTML fields have their own guards:
confirm.image— rejected when it starts withjavascript:(the modal then falls back to the icon illustration).confirm.gradient— rejected when it contains<,>, orjavascript:(the modal then falls back to the default themed gradient).
Step rule keys (e.g. "click #item") are not HTML and any key containing < is discarded.
Example
Example of running a focus-context simple tutorial upon the opening, without attaching it to available tutorials list:
{
"plugins": {
"extra-tutorials":{"data":[{"run":true,"content":[{"click #presenter-play-icon": "Please, click play<br>to run the story."}]}]},
"recorder": {} //note: ensures the plugin is available when we direct the the tutorial on it
}
}