MCPcopy
hub / github.com/shipshapecode/shepherd / createShepherdText

Function createShepherdText

shepherd.js/src/components/shepherd-text.ts:6–28  ·  view source on GitHub ↗
(
  descriptionId: string,
  step: Step
)

Source from the content-addressed store, hash-verified

4import './shepherd-text.css';
5
6export function createShepherdText(
7 descriptionId: string,
8 step: Step
9): HTMLDivElement {
10 const el = h('div', {
11 class: 'shepherd-text',
12 id: descriptionId
13 }) as HTMLDivElement;
14
15 let text = step.options.text;
16
17 if (isFunction(text)) {
18 text = text.call(step);
19 }
20
21 if (isHTMLElement(text)) {
22 el.appendChild(text);
23 } else {
24 el.innerHTML = text as string;
25 }
26
27 return el;
28}

Callers 2

createShepherdContentFunction · 0.90

Calls 3

hFunction · 0.90
isFunctionFunction · 0.90
isHTMLElementFunction · 0.90

Tested by

no test coverage detected