| 1 |
import { __ } from '@wordpress/i18n' |
| 2 |
import type { CalloutContent } from '../../common/demo/DemoCallout' |
| 3 |
import type { DemoStage } from './types' |
| 4 |
|
| 5 |
/** |
| 6 |
* What the walkthrough is doing at each stage, shown alongside the form so the |
| 7 |
* visitor can follow the reasoning rather than just watching fields appear. |
| 8 |
*/ |
| 9 |
const CALLOUTS: Partial<Record<DemoStage, CalloutContent>> = { |
| 10 |
general: { |
| 11 |
step: __('Step 1 of 3', 'code-snippets'), |
| 12 |
title: __('Name the shortcode', 'code-snippets'), |
| 13 |
body: __('Every blueprint starts with the basics — the tag you type into a post, and the function that powers it.', 'code-snippets') |
| 14 |
}, |
| 15 |
attributes: { |
| 16 |
step: __('Step 2 of 3', 'code-snippets'), |
| 17 |
title: __('Add the attributes', 'code-snippets'), |
| 18 |
body: __('Attributes become the values you pass in, like [staff_profile name="Jane Doe"], each with a fallback default.', 'code-snippets') |
| 19 |
}, |
| 20 |
output: { |
| 21 |
step: __('Step 3 of 3', 'code-snippets'), |
| 22 |
title: __('Decide what it renders', 'code-snippets'), |
| 23 |
body: __('This is the PHP that runs whenever the shortcode appears. The blueprint wraps it in everything else it needs.', 'code-snippets') |
| 24 |
}, |
| 25 |
generating: { |
| 26 |
step: __('Generating', 'code-snippets'), |
| 27 |
title: __('Building the snippet', 'code-snippets'), |
| 28 |
body: __('Pro turns the whole form into a finished, working snippet — no boilerplate to write yourself.', 'code-snippets') |
| 29 |
}, |
| 30 |
generated: { |
| 31 |
step: __('Done', 'code-snippets'), |
| 32 |
title: __('Your snippet is ready', 'code-snippets'), |
| 33 |
body: __('In Pro the finished PHP appears here, ready to review and save to your site.', 'code-snippets') |
| 34 |
} |
| 35 |
} |
| 36 |
|
| 37 |
export const getCallout = (stage: DemoStage): CalloutContent | undefined => |
| 38 |
CALLOUTS[stage] |
| 39 |
|