forked from accordproject/template-playground
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTour.ts
More file actions
316 lines (297 loc) · 7.05 KB
/
Tour.ts
File metadata and controls
316 lines (297 loc) · 7.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
import Shepherd from "shepherd.js";
import "shepherd.js/dist/css/shepherd.css";
const style = document.createElement("style");
style.textContent = `
.shepherd-button-secondary {
background-color: #6c757d !important;
}
.shepherd-button {
background-color: #050c40 !important;
color: white !important;
}
`;
document.head.appendChild(style);
const tour = new Shepherd.Tour({
defaultStepOptions: {
classes: "shepherd-theme-arrows",
scrollTo: true,
},
useModalOverlay: true,
});
tour.addStep({
id: "intro",
text: "Welcome to the Template Playground! This brief tour will help you get acquainted with the key features of the platform.",
buttons: [
{
text: "Skip",
action: () => void tour.cancel(),
classes: "shepherd-button-secondary",
},
{
text: "Next",
action: () => tour.next(),
},
],
});
tour.addStep({
id: "template-dropdown",
text: "Here is the 'Template' dropdown. This dropdown contains various templates that you can edit and experiment with. Select a template to see and modify its details.",
attachTo: {
element: ".samples-element",
on: "bottom",
},
buttons: [
{
text: "Skip",
action: () => void tour.cancel(),
classes: "shepherd-button-secondary",
},
{
text: "Next",
action: () => tour.next(),
},
],
});
tour.addStep({
id: "toggle-editor",
text: "Use this button to toggle the editor panel on/off. The editor panel contains the Concerto Model, TemplateMark, and JSON Data editors.",
attachTo: {
element: ".tour-editor",
on: "right",
},
buttons: [
{
text: "Skip",
action: () => void tour.cancel(),
classes: "shepherd-button-secondary",
},
{
text: "Next",
action: () => tour.next(),
},
],
});
tour.addStep({
id: "toggle-preview",
text: "Toggle the preview window to show or hide the live preview of your template. This helps you see the results of your edits in real-time.",
attachTo: {
element: ".tour-preview",
on: "right",
},
buttons: [
{
text: "Skip",
action: () => void tour.cancel(),
classes: "shepherd-button-secondary",
},
{
text: "Next",
action: () => tour.next(),
},
],
});
tour.addStep({
id: "toggle-problems",
text: "Toggle the problems panel to view compilation errors and warnings. This helps you debug issues in your template and model.",
attachTo: {
element: ".tour-problems",
on: "right",
},
buttons: [
{
text: "Skip",
action: () => void tour.cancel(),
classes: "shepherd-button-secondary",
},
{
text: "Next",
action: () => tour.next(),
},
],
});
tour.addStep({
id: "fullscreen-modal",
text: "Open the preview in fullscreen mode for better viewing. This allows you to see your template output in a larger, focused view.",
attachTo: {
element: ".tour-fullscreen",
on: "right",
},
buttons: [
{
text: "Skip",
action: () => void tour.cancel(),
classes: "shepherd-button-secondary",
},
{
text: "Next",
action: () => tour.next(),
},
],
});
tour.addStep({
id: "template-share",
text: "Use this 'Share' button to generate and share a link for any created or edited templates. Share your work with others easily.",
attachTo: {
element: ".tour-share",
on: "right",
},
buttons: [
{
text: "Skip",
action: () => void tour.cancel(),
classes: "shepherd-button-secondary",
},
{
text: "Next",
action: () => tour.next(),
},
],
});
tour.addStep({
id: "start-tour-button",
text: "Use this button to restart the tour anytime you want to review the features and functionality of the Template Playground.",
attachTo: {
element: ".tour-start-tour",
on: "right",
},
buttons: [
{
text: "Skip",
action: () => void tour.cancel(),
classes: "shepherd-button-secondary",
},
{
text: "Next",
action: () => tour.next(),
},
],
});
tour.addStep({
id: "editor-settings",
text: "Access editor settings and configuration options here. Customize your editing experience to suit your preferences.",
attachTo: {
element: ".tour-settings",
on: "right",
},
buttons: [
{
text: "Skip",
action: () => void tour.cancel(),
classes: "shepherd-button-secondary",
},
{
text: "Next",
action: () => tour.next(),
},
],
});
tour.addStep({
id: "ai-assistant",
text: "Use the AI Assistant to get help with creating and editing your templates. The AI can provide suggestions and guidance for your template development.",
attachTo: {
element: ".tour-ai-assistant",
on: "left",
},
buttons: [
{
text: "Skip",
action: () => void tour.cancel(),
classes: "shepherd-button-secondary",
},
{
text: "Next",
action: () => tour.next(),
},
],
});
tour.addStep({
id: "concerto-model",
text: "This is the Concerto Model editor. Define the data model for your template including types, concepts, and business logic here.",
attachTo: {
element: ".tour-concerto-model",
on: "top",
},
buttons: [
{
text: "Skip",
action: () => void tour.cancel(),
classes: "shepherd-button-secondary",
},
{
text: "Next",
action: () => tour.next(),
},
],
});
tour.addStep({
id: "template-mark",
text: "This is the TemplateMark editor. Write your natural language template with embedded variables, conditional sections, and TypeScript code.",
attachTo: {
element: ".tour-template-mark",
on: "top",
},
buttons: [
{
text: "Skip",
action: () => void tour.cancel(),
classes: "shepherd-button-secondary",
},
{
text: "Next",
action: () => tour.next(),
},
],
});
tour.addStep({
id: "json-data",
text: "This is the JSON Data editor. Provide sample data that matches your Concerto model to test and preview your template.",
attachTo: {
element: ".tour-json-data",
on: "top",
},
buttons: [
{
text: "Skip",
action: () => void tour.cancel(),
classes: "shepherd-button-secondary",
},
{
text: "Next",
action: () => tour.next(),
},
],
});
tour.addStep({
id: "preview-panel",
text: "This section shows the live preview of your template. View the results of your edits and see how your template renders with the provided data.",
attachTo: {
element: ".tour-preview-panel",
on: "top",
},
buttons: [
{
text: "Skip",
action: () => void tour.cancel(),
classes: "shepherd-button-secondary",
},
{
text: "Next",
action: () => tour.next(),
},
],
});
tour.addStep({
id: "learn-button",
text: 'Click the "Learn" button to access the Learning Pathway. Here, you will find comprehensive documentation and tutorials to help you create templates effectively.',
attachTo: {
element: ".learnNow-button",
on: "bottom",
},
buttons: [
{
text: "Finish Tour",
action: () => void tour.cancel(),
},
],
});
export default tour;