PluginProbe
Code Snippets / 4.0.0-beta.2
Code Snippets v4.0.0-beta.2
4.0.0-beta.2 3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 All 65 releases
code-snippets / js / components / ManageMenu / AiAgentDemo / callouts.ts

callouts.ts in Code Snippets 4.0.0-beta.2, at js/components/ManageMenu/AiAgentDemo/callouts.ts

62 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { __ } from '@wordpress/i18n'
2 import type { CalloutContent } from '../../common/demo/DemoCallout'
3 import type { DemoStage } from './types'
4
5 /**
6 * The five steps of the walkthrough, plus its closing note.
7 *
8 * Several stages share a step: the commentary describes the phase rather than
9 * the individual stage, so it stays put while the thread moves underneath it.
10 */
11 const STEPS: Record<string, CalloutContent> = {
12 ask: {
13 step: __('Step 1 of 5', 'code-snippets'),
14 title: __('Ask in plain English', 'code-snippets'),
15 body: __('No syntax to learn and no boilerplate to copy — describe what you want the site to do, and the agent works out what that means in code.', 'code-snippets')
16 },
17 plan: {
18 step: __('Step 2 of 5', 'code-snippets'),
19 title: __('Sent for planning', 'code-snippets'),
20 body: __('Your request goes to Code Snippets Cloud, which works out what needs building — and whether that is one snippet or several — before writing anything.', 'code-snippets')
21 },
22 approve: {
23 step: __('Step 3 of 5', 'code-snippets'),
24 title: __('You approve the plan', 'code-snippets'),
25 body: __('Nothing is written until you accept. Read what it intends to build, send it back for changes, or let it go ahead.', 'code-snippets')
26 },
27 build: {
28 step: __('Step 4 of 5', 'code-snippets'),
29 title: __('Built and added to your site', 'code-snippets'),
30 body: __('Each part of the plan becomes a real snippet, written to suit your site rather than pulled from a template. They arrive inactive, so nothing runs until you have read the code and switched them on.', 'code-snippets')
31 },
32 refine: {
33 step: __('Step 5 of 5', 'code-snippets'),
34 title: __('Refine what it built', 'code-snippets'),
35 body: __('Not quite right? Say what to change in plain English and it rewrites the snippets in place, keeping the conversation so each refinement builds on the last.', 'code-snippets')
36 },
37 done: {
38 step: __('Done', 'code-snippets'),
39 title: __('Ready to review', 'code-snippets'),
40 body: __('The finished snippets are on your site, waiting for you to check them over and activate them.', 'code-snippets')
41 }
42 }
43
44 const STAGE_STEPS: Partial<Record<DemoStage, keyof typeof STEPS>> = {
45 'typing-prompt': 'ask',
46 'prompt-sent': 'plan',
47 'planning': 'plan',
48 'plan-ready': 'approve',
49 'plan-accepted': 'approve',
50 'building': 'build',
51 'result-ready': 'build',
52 'refine-open': 'refine',
53 'typing-refinement': 'refine',
54 'applying': 'refine',
55 'saved': 'done'
56 }
57
58 export const getCallout = (stage: DemoStage): CalloutContent | undefined => {
59 const step = STAGE_STEPS[stage]
60 return step ? STEPS[step] : undefined
61 }
62