Body, Mind & Soul — API Reference
    Preparing search index...

    Tour subclass used by every manual tour. Reads sandboxItemType from its config and, on first start, spawns a sandbox item of that type and opens its sheet. The tour then proceeds as a normal Foundry Tour, walking the user through real selectors on the live sheet.

    Subclasses or callers can override _setupSandbox() to seed the sandbox item with extra system data before the first step renders.

    Hierarchy

    • Tour
      • default
    Index
    • Returns default

    fadeElement: any
    overlayElement: any
    sandboxItem: any = null

    The sandbox item created for this tour run, if any.

    • get sandboxItemType(): any

      Configured item type (read from config.sandboxItemType).

      Returns any

    • get stepIndex(): any

      Convenience getter — Foundry stores the step index in a private field.

      Returns any

    • Returns Promise<any>

    • Before each step renders, honour two custom step-config fields:

      sheetTab: "" Activates that primary tab on the sandbox sheet so the step's selector (typically .tab.<id>.active …) matches even if the user clicked Next without clicking the highlighted tab first.

      advanceOnClick: true After the step renders, wires a one-shot click listener on the targetElement that calls this.next(). Lets the user drive the flow by interacting with the actual UI; the Next button still works.

      Returns Promise<void>

    • After the step renders, wire two recovery behaviours:

      1. advanceOnClick — let clicks reach the highlighted element through Foundry's .tour-fadeout + .tour-overlay (both block by default), then advance to the next step after the underlying click's side-effects (document update + sheet re-render) settle. Without the wait, the next step's selector queries the DOM before the new sheet paint and fails (e.g. .trigger-hook-select doesn't exist until after the Add Trigger update + render finishes).

      2. reanchor on sheet re-render — if anything else re-renders the sandbox sheet (the user clicks a different tab, the data model fires derived data, etc.), the tooltip's anchor element is detached and the tour visually disappears. We re-progress to the same step, which re-runs _preStep (sheetTab fallback) + re-resolves the selector against the new DOM.

      Returns Promise<void>

    • Create the sandbox item, open its sheet, and stash the reference. Default implementation is generic across types — subclasses can override to seed additional system data (e.g. an initial swing on the sandbox action so the swing-trigger step has something to point at).

      Returns Promise<void>

    • Resolve once the given selector matches a node in the document, or after timeoutMs (default 1500). Uses a MutationObserver and an immediate pre-check so already-present nodes resolve synchronously.

      Parameters

      • selector: any
      • timeoutMs: number = 1500

      Returns Promise<any>

    • On completion, post a chat card linking the sandbox item so the user can find / drag it without hunting through the hidden folder.

      Returns Promise<any>

    • Override of Foundry's Tour.start. We only spawn the sandbox when the tour isn't already in progress (so that resuming a paused tour doesn't mint a second item).

      Returns Promise<any>