@squaredr/fieldcraft-pro 1.6.4 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -13
- package/dist/{chunk-VECQKSWS.mjs → chunk-4MMKB2EW.mjs} +60 -86
- package/dist/{chunk-CFVT2R42.mjs → chunk-4TN6YJDF.mjs} +1 -1
- package/dist/{chunk-5LKGCZAW.mjs → chunk-GZIV2XAD.mjs} +1 -1
- package/dist/{chunk-ANBMT5AW.mjs → chunk-J5V6OVZO.mjs} +127 -55
- package/dist/chunk-VEP3DOCQ.mjs +1111 -0
- package/dist/form-builder/index.d.mts +176 -6
- package/dist/form-builder/index.d.ts +176 -6
- package/dist/form-builder/index.js +128 -79
- package/dist/form-builder/index.mjs +2 -2
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1310 -147
- package/dist/index.mjs +14 -12
- package/dist/response-viewer/index.js +4 -27
- package/dist/response-viewer/index.mjs +2 -2
- package/dist/styles.css +1 -1
- package/dist/templates/index.d.mts +43 -0
- package/dist/templates/index.d.ts +43 -0
- package/dist/templates/index.js +1119 -0
- package/dist/templates/index.mjs +1 -0
- package/dist/theme-editor/index.js +4 -27
- package/dist/theme-editor/index.mjs +2 -2
- package/dist/types-bFHsZT1n.d.mts +217 -0
- package/dist/types-bFHsZT1n.d.ts +217 -0
- package/package.json +8 -7
- package/dist/index-D19524df.d.mts +0 -387
- package/dist/index-D19524df.d.ts +0 -387
|
@@ -0,0 +1,1119 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/templates/consultation-booking.ts
|
|
4
|
+
var consultationBookingSchema = {
|
|
5
|
+
id: "consultation-booking",
|
|
6
|
+
version: "1.0.0",
|
|
7
|
+
title: "Consultation Booking",
|
|
8
|
+
description: "Book a consultation session. Select your service, answer a few questions, pick a time, and pay \u2014 all in one flow.",
|
|
9
|
+
settings: {
|
|
10
|
+
showProgress: true,
|
|
11
|
+
progressStyle: "steps",
|
|
12
|
+
navigation: { showBack: true }
|
|
13
|
+
},
|
|
14
|
+
submitAction: { type: "callback" },
|
|
15
|
+
sections: [
|
|
16
|
+
// ── Section 1: Welcome & Service Selection ────────────────────
|
|
17
|
+
{
|
|
18
|
+
id: "service-selection",
|
|
19
|
+
title: "Choose Your Service",
|
|
20
|
+
description: "Select the type of consultation you need",
|
|
21
|
+
questions: [
|
|
22
|
+
{
|
|
23
|
+
id: "welcome_info",
|
|
24
|
+
type: "info_block",
|
|
25
|
+
label: "Our consultations are 1-on-1 sessions with senior advisors. Sessions are 30 or 60 minutes. Choose your service below to get started."
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: "service_type",
|
|
29
|
+
type: "single_select",
|
|
30
|
+
label: "Service Type",
|
|
31
|
+
required: true,
|
|
32
|
+
options: [
|
|
33
|
+
{ label: "Legal Consultation ($150/hr)", value: "legal" },
|
|
34
|
+
{ label: "Business Strategy ($200/hr)", value: "business" },
|
|
35
|
+
{ label: "Technical Audit ($175/hr)", value: "technical" }
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: "session_duration",
|
|
40
|
+
type: "single_select",
|
|
41
|
+
label: "Session Duration",
|
|
42
|
+
required: true,
|
|
43
|
+
options: [
|
|
44
|
+
{ label: "30 minutes", value: "30" },
|
|
45
|
+
{ label: "60 minutes", value: "60" }
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: "urgency",
|
|
50
|
+
type: "single_select",
|
|
51
|
+
label: "How soon do you need the consultation?",
|
|
52
|
+
required: true,
|
|
53
|
+
options: [
|
|
54
|
+
{ label: "Within 24 hours (+$50 rush fee)", value: "rush" },
|
|
55
|
+
{ label: "This week", value: "this-week" },
|
|
56
|
+
{ label: "Flexible", value: "flexible" }
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
onExit: {
|
|
61
|
+
rules: [
|
|
62
|
+
{
|
|
63
|
+
condition: { field: "service_type", operator: "eq", value: "legal" },
|
|
64
|
+
jumpTo: "legal-details"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
condition: { field: "service_type", operator: "eq", value: "business" },
|
|
68
|
+
jumpTo: "business-details"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
condition: { field: "service_type", operator: "eq", value: "technical" },
|
|
72
|
+
jumpTo: "technical-details"
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
default: "scheduling"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
// ── Section 2A: Legal Consultation Path ───────────────────────
|
|
79
|
+
{
|
|
80
|
+
id: "legal-details",
|
|
81
|
+
title: "Legal Consultation Details",
|
|
82
|
+
description: "Help us prepare for your legal consultation",
|
|
83
|
+
showIf: {
|
|
84
|
+
field: "service_type",
|
|
85
|
+
operator: "eq",
|
|
86
|
+
value: "legal"
|
|
87
|
+
},
|
|
88
|
+
questions: [
|
|
89
|
+
{
|
|
90
|
+
id: "legal_area",
|
|
91
|
+
type: "single_select",
|
|
92
|
+
label: "Area of Law",
|
|
93
|
+
required: true,
|
|
94
|
+
options: [
|
|
95
|
+
{ label: "Business / Corporate", value: "corporate" },
|
|
96
|
+
{ label: "Employment / Labor", value: "employment" },
|
|
97
|
+
{ label: "Intellectual Property", value: "ip" },
|
|
98
|
+
{ label: "Contracts / Agreements", value: "contracts" },
|
|
99
|
+
{ label: "Regulatory / Compliance", value: "regulatory" },
|
|
100
|
+
{ label: "Other", value: "other" }
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: "legal_area_other",
|
|
105
|
+
type: "short_text",
|
|
106
|
+
label: "Please specify the area of law",
|
|
107
|
+
required: true,
|
|
108
|
+
placeholder: "Describe the legal area",
|
|
109
|
+
showIf: { field: "legal_area", operator: "eq", value: "other" },
|
|
110
|
+
validation: [{ type: "maxLength", value: 200 }]
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
id: "legal_existing_counsel",
|
|
114
|
+
type: "boolean",
|
|
115
|
+
label: "Do you currently have legal counsel?",
|
|
116
|
+
required: true
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: "legal_counsel_reason",
|
|
120
|
+
type: "single_select",
|
|
121
|
+
label: "Reason for seeking a second opinion",
|
|
122
|
+
required: true,
|
|
123
|
+
showIf: { field: "legal_existing_counsel", operator: "eq", value: true },
|
|
124
|
+
options: [
|
|
125
|
+
{ label: "Want a second opinion", value: "second-opinion" },
|
|
126
|
+
{ label: "Current counsel lacks specialization", value: "specialization" },
|
|
127
|
+
{ label: "Considering switching counsel", value: "switching" },
|
|
128
|
+
{ label: "Other", value: "other" }
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
id: "legal_documents",
|
|
133
|
+
type: "file_upload",
|
|
134
|
+
label: "Upload relevant documents (optional)",
|
|
135
|
+
required: false,
|
|
136
|
+
helpText: "Contracts, letters, filings \u2014 up to 3 files, 10MB each",
|
|
137
|
+
config: {
|
|
138
|
+
type: "file_upload",
|
|
139
|
+
accept: ["application/pdf", "image/png", "image/jpeg"],
|
|
140
|
+
maxSizeMb: 10,
|
|
141
|
+
maxFiles: 3
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
id: "legal_summary",
|
|
146
|
+
type: "long_text",
|
|
147
|
+
label: "Brief summary of your situation",
|
|
148
|
+
required: true,
|
|
149
|
+
placeholder: "Describe the issue, relevant dates, parties involved, and what outcome you're looking for...",
|
|
150
|
+
validation: [
|
|
151
|
+
{ type: "minLength", value: 50, message: "Please provide enough detail for our team to prepare" },
|
|
152
|
+
{ type: "maxLength", value: 3e3 }
|
|
153
|
+
]
|
|
154
|
+
}
|
|
155
|
+
],
|
|
156
|
+
onExit: {
|
|
157
|
+
rules: [],
|
|
158
|
+
default: "scheduling"
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
// ── Section 2B: Business Strategy Path ────────────────────────
|
|
162
|
+
{
|
|
163
|
+
id: "business-details",
|
|
164
|
+
title: "Business Strategy Details",
|
|
165
|
+
description: "Tell us about your business challenge",
|
|
166
|
+
showIf: {
|
|
167
|
+
field: "service_type",
|
|
168
|
+
operator: "eq",
|
|
169
|
+
value: "business"
|
|
170
|
+
},
|
|
171
|
+
questions: [
|
|
172
|
+
{
|
|
173
|
+
id: "biz_stage",
|
|
174
|
+
type: "single_select",
|
|
175
|
+
label: "Business Stage",
|
|
176
|
+
required: true,
|
|
177
|
+
options: [
|
|
178
|
+
{ label: "Pre-revenue / Idea stage", value: "idea" },
|
|
179
|
+
{ label: "Early stage (< $500K ARR)", value: "early" },
|
|
180
|
+
{ label: "Growth ($500K - $5M ARR)", value: "growth" },
|
|
181
|
+
{ label: "Scale ($5M+ ARR)", value: "scale" },
|
|
182
|
+
{ label: "Enterprise / Established", value: "enterprise" }
|
|
183
|
+
]
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
id: "biz_focus",
|
|
187
|
+
type: "multi_select",
|
|
188
|
+
label: "Areas you want to discuss",
|
|
189
|
+
required: true,
|
|
190
|
+
options: [
|
|
191
|
+
{ label: "Go-to-market strategy", value: "gtm" },
|
|
192
|
+
{ label: "Pricing & monetization", value: "pricing" },
|
|
193
|
+
{ label: "Fundraising / Investment", value: "fundraising" },
|
|
194
|
+
{ label: "Team building / Hiring", value: "team" },
|
|
195
|
+
{ label: "Operations & scaling", value: "operations" },
|
|
196
|
+
{ label: "Product strategy", value: "product" },
|
|
197
|
+
{ label: "Partnerships & channels", value: "partnerships" }
|
|
198
|
+
]
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
id: "biz_fundraising_stage",
|
|
202
|
+
type: "single_select",
|
|
203
|
+
label: "Current fundraising stage",
|
|
204
|
+
required: true,
|
|
205
|
+
showIf: { field: "biz_focus", operator: "contains", value: "fundraising" },
|
|
206
|
+
options: [
|
|
207
|
+
{ label: "Pre-seed", value: "pre-seed" },
|
|
208
|
+
{ label: "Seed", value: "seed" },
|
|
209
|
+
{ label: "Series A", value: "series-a" },
|
|
210
|
+
{ label: "Series B+", value: "series-b-plus" },
|
|
211
|
+
{ label: "Not raising / Bootstrap", value: "bootstrap" }
|
|
212
|
+
]
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
id: "biz_team_size",
|
|
216
|
+
type: "number",
|
|
217
|
+
label: "Current team size",
|
|
218
|
+
required: true,
|
|
219
|
+
validation: [
|
|
220
|
+
{ type: "min", value: 1 },
|
|
221
|
+
{ type: "max", value: 1e5 }
|
|
222
|
+
]
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
id: "biz_challenge",
|
|
226
|
+
type: "long_text",
|
|
227
|
+
label: "Describe your primary challenge",
|
|
228
|
+
required: true,
|
|
229
|
+
placeholder: "What's the #1 thing you want to solve in this session? Be specific...",
|
|
230
|
+
validation: [
|
|
231
|
+
{ type: "minLength", value: 30, message: "Please be more specific" },
|
|
232
|
+
{ type: "maxLength", value: 2e3 }
|
|
233
|
+
]
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
id: "biz_pitch_deck",
|
|
237
|
+
type: "file_upload",
|
|
238
|
+
label: "Upload pitch deck or one-pager (optional)",
|
|
239
|
+
required: false,
|
|
240
|
+
config: {
|
|
241
|
+
type: "file_upload",
|
|
242
|
+
accept: ["application/pdf"],
|
|
243
|
+
maxSizeMb: 20,
|
|
244
|
+
maxFiles: 1
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
],
|
|
248
|
+
onExit: {
|
|
249
|
+
rules: [],
|
|
250
|
+
default: "scheduling"
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
// ── Section 2C: Technical Audit Path ──────────────────────────
|
|
254
|
+
{
|
|
255
|
+
id: "technical-details",
|
|
256
|
+
title: "Technical Audit Details",
|
|
257
|
+
description: "Help us understand your technical landscape",
|
|
258
|
+
showIf: {
|
|
259
|
+
field: "service_type",
|
|
260
|
+
operator: "eq",
|
|
261
|
+
value: "technical"
|
|
262
|
+
},
|
|
263
|
+
questions: [
|
|
264
|
+
{
|
|
265
|
+
id: "tech_audit_type",
|
|
266
|
+
type: "single_select",
|
|
267
|
+
label: "What type of audit do you need?",
|
|
268
|
+
required: true,
|
|
269
|
+
options: [
|
|
270
|
+
{ label: "Architecture review", value: "architecture" },
|
|
271
|
+
{ label: "Security audit", value: "security" },
|
|
272
|
+
{ label: "Performance optimization", value: "performance" },
|
|
273
|
+
{ label: "Code quality review", value: "code-quality" },
|
|
274
|
+
{ label: "Cloud infrastructure", value: "cloud" },
|
|
275
|
+
{ label: "Database optimization", value: "database" }
|
|
276
|
+
]
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
id: "tech_stack",
|
|
280
|
+
type: "multi_select",
|
|
281
|
+
label: "Primary tech stack",
|
|
282
|
+
required: true,
|
|
283
|
+
options: [
|
|
284
|
+
{ label: "React / Next.js", value: "react" },
|
|
285
|
+
{ label: "Node.js", value: "node" },
|
|
286
|
+
{ label: "Python / Django / FastAPI", value: "python" },
|
|
287
|
+
{ label: "Go", value: "go" },
|
|
288
|
+
{ label: "Java / Spring", value: "java" },
|
|
289
|
+
{ label: ".NET / C#", value: "dotnet" },
|
|
290
|
+
{ label: "Ruby on Rails", value: "rails" },
|
|
291
|
+
{ label: "Mobile (React Native / Flutter)", value: "mobile" }
|
|
292
|
+
]
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
id: "tech_cloud",
|
|
296
|
+
type: "single_select",
|
|
297
|
+
label: "Cloud provider",
|
|
298
|
+
required: true,
|
|
299
|
+
showIf: { field: "tech_audit_type", operator: "eq", value: "cloud" },
|
|
300
|
+
options: [
|
|
301
|
+
{ label: "AWS", value: "aws" },
|
|
302
|
+
{ label: "Google Cloud", value: "gcp" },
|
|
303
|
+
{ label: "Azure", value: "azure" },
|
|
304
|
+
{ label: "Vercel / Netlify / Other", value: "other" },
|
|
305
|
+
{ label: "Self-hosted / On-prem", value: "on-prem" }
|
|
306
|
+
]
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
id: "tech_monthly_spend",
|
|
310
|
+
type: "single_select",
|
|
311
|
+
label: "Current monthly cloud spend",
|
|
312
|
+
required: true,
|
|
313
|
+
showIf: { field: "tech_audit_type", operator: "eq", value: "cloud" },
|
|
314
|
+
options: [
|
|
315
|
+
{ label: "Under $500", value: "under-500" },
|
|
316
|
+
{ label: "$500 - $2,000", value: "500-2k" },
|
|
317
|
+
{ label: "$2,000 - $10,000", value: "2k-10k" },
|
|
318
|
+
{ label: "$10,000+", value: "10k-plus" }
|
|
319
|
+
]
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
id: "tech_users",
|
|
323
|
+
type: "single_select",
|
|
324
|
+
label: "Scale (monthly active users or requests)",
|
|
325
|
+
required: true,
|
|
326
|
+
options: [
|
|
327
|
+
{ label: "< 1,000 MAU", value: "under-1k" },
|
|
328
|
+
{ label: "1K - 10K MAU", value: "1k-10k" },
|
|
329
|
+
{ label: "10K - 100K MAU", value: "10k-100k" },
|
|
330
|
+
{ label: "100K - 1M MAU", value: "100k-1m" },
|
|
331
|
+
{ label: "1M+ MAU", value: "1m-plus" }
|
|
332
|
+
]
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
id: "tech_repo_access",
|
|
336
|
+
type: "boolean",
|
|
337
|
+
label: "Can you grant temporary read access to the codebase?",
|
|
338
|
+
required: true,
|
|
339
|
+
helpText: "We'll sign an NDA before accessing any code"
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
id: "tech_description",
|
|
343
|
+
type: "long_text",
|
|
344
|
+
label: "Describe the specific issues or goals for the audit",
|
|
345
|
+
required: true,
|
|
346
|
+
placeholder: "What problems are you seeing? What do you want us to focus on?",
|
|
347
|
+
validation: [
|
|
348
|
+
{ type: "minLength", value: 30, message: "Please describe the technical issues in detail" },
|
|
349
|
+
{ type: "maxLength", value: 3e3 }
|
|
350
|
+
]
|
|
351
|
+
}
|
|
352
|
+
],
|
|
353
|
+
onExit: {
|
|
354
|
+
rules: [],
|
|
355
|
+
default: "scheduling"
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
// ── Section 3: Scheduling ─────────────────────────────────────
|
|
359
|
+
{
|
|
360
|
+
id: "scheduling",
|
|
361
|
+
title: "Pick a Time",
|
|
362
|
+
description: "Choose a convenient time for your consultation",
|
|
363
|
+
questions: [
|
|
364
|
+
{
|
|
365
|
+
id: "timezone",
|
|
366
|
+
type: "dropdown",
|
|
367
|
+
label: "Your Timezone",
|
|
368
|
+
required: true,
|
|
369
|
+
options: [
|
|
370
|
+
{ label: "US Eastern (ET)", value: "America/New_York" },
|
|
371
|
+
{ label: "US Central (CT)", value: "America/Chicago" },
|
|
372
|
+
{ label: "US Mountain (MT)", value: "America/Denver" },
|
|
373
|
+
{ label: "US Pacific (PT)", value: "America/Los_Angeles" },
|
|
374
|
+
{ label: "UK (GMT/BST)", value: "Europe/London" },
|
|
375
|
+
{ label: "Central Europe (CET)", value: "Europe/Berlin" },
|
|
376
|
+
{ label: "India (IST)", value: "Asia/Kolkata" },
|
|
377
|
+
{ label: "Japan (JST)", value: "Asia/Tokyo" },
|
|
378
|
+
{ label: "Australia Eastern (AEST)", value: "Australia/Sydney" }
|
|
379
|
+
]
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
id: "appointment_slot",
|
|
383
|
+
type: "appointment",
|
|
384
|
+
label: "Select Date & Time",
|
|
385
|
+
required: true,
|
|
386
|
+
config: {
|
|
387
|
+
type: "appointment",
|
|
388
|
+
slots: [
|
|
389
|
+
{
|
|
390
|
+
date: "2026-09-01",
|
|
391
|
+
times: ["09:00", "10:00", "11:00", "14:00", "15:00", "16:00"]
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
date: "2026-09-02",
|
|
395
|
+
times: ["09:00", "10:30", "13:00", "14:30", "16:00"]
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
date: "2026-09-03",
|
|
399
|
+
times: ["10:00", "11:00", "13:00", "15:00"]
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
date: "2026-09-04",
|
|
403
|
+
times: ["09:00", "10:00", "11:00", "14:00", "15:00"]
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
date: "2026-09-05",
|
|
407
|
+
times: ["09:00", "11:00", "13:00", "14:00", "16:00"]
|
|
408
|
+
}
|
|
409
|
+
],
|
|
410
|
+
timezone: "America/New_York",
|
|
411
|
+
duration: 60
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
id: "attendees",
|
|
416
|
+
type: "repeater",
|
|
417
|
+
label: "Additional Attendees",
|
|
418
|
+
required: false,
|
|
419
|
+
helpText: "Add anyone else who should join the session (you are already included)",
|
|
420
|
+
config: {
|
|
421
|
+
type: "repeater",
|
|
422
|
+
fields: [
|
|
423
|
+
{
|
|
424
|
+
id: "attendee_name",
|
|
425
|
+
type: "short_text",
|
|
426
|
+
label: "Name",
|
|
427
|
+
required: true
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
id: "attendee_email",
|
|
431
|
+
type: "email",
|
|
432
|
+
label: "Email",
|
|
433
|
+
required: true
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
id: "attendee_role",
|
|
437
|
+
type: "short_text",
|
|
438
|
+
label: "Role / Title",
|
|
439
|
+
required: false
|
|
440
|
+
}
|
|
441
|
+
],
|
|
442
|
+
minEntries: 0,
|
|
443
|
+
maxEntries: 5,
|
|
444
|
+
addLabel: "+ Add attendee"
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
]
|
|
448
|
+
},
|
|
449
|
+
// ── Section 4: Contact & Payment ──────────────────────────────
|
|
450
|
+
{
|
|
451
|
+
id: "payment",
|
|
452
|
+
title: "Contact & Payment",
|
|
453
|
+
description: "Complete your booking",
|
|
454
|
+
questions: [
|
|
455
|
+
{
|
|
456
|
+
id: "client_name",
|
|
457
|
+
type: "legal_name",
|
|
458
|
+
label: "Your Full Name",
|
|
459
|
+
required: true
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
id: "client_email",
|
|
463
|
+
type: "email",
|
|
464
|
+
label: "Email Address",
|
|
465
|
+
required: true,
|
|
466
|
+
placeholder: "you@company.com",
|
|
467
|
+
helpText: "Confirmation and calendar invite will be sent here"
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
id: "client_phone",
|
|
471
|
+
type: "phone",
|
|
472
|
+
label: "Phone Number",
|
|
473
|
+
required: true
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
id: "company_name",
|
|
477
|
+
type: "short_text",
|
|
478
|
+
label: "Company Name",
|
|
479
|
+
required: false,
|
|
480
|
+
placeholder: "Your organization",
|
|
481
|
+
validation: [{ type: "maxLength", value: 150 }]
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
id: "section_divider",
|
|
485
|
+
type: "divider",
|
|
486
|
+
label: ""
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
id: "promo_code",
|
|
490
|
+
type: "short_text",
|
|
491
|
+
label: "Promo Code (optional)",
|
|
492
|
+
required: false,
|
|
493
|
+
placeholder: "Enter code",
|
|
494
|
+
validation: [{ type: "maxLength", value: 20 }]
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
id: "session_payment",
|
|
498
|
+
type: "payment",
|
|
499
|
+
label: "Pay for Consultation",
|
|
500
|
+
required: true,
|
|
501
|
+
helpText: "Secure payment via Stripe. You will not be charged until the session is confirmed.",
|
|
502
|
+
config: {
|
|
503
|
+
type: "payment",
|
|
504
|
+
provider: "stripe",
|
|
505
|
+
publicKey: "",
|
|
506
|
+
amount: 2e4,
|
|
507
|
+
currency: "USD",
|
|
508
|
+
description: "Consultation Session",
|
|
509
|
+
serverUrl: "/api/payment-intents"
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
]
|
|
513
|
+
},
|
|
514
|
+
// ── Section 5: Agreement & Confirmation ───────────────────────
|
|
515
|
+
{
|
|
516
|
+
id: "agreement",
|
|
517
|
+
title: "Agreement",
|
|
518
|
+
description: "Review and sign",
|
|
519
|
+
questions: [
|
|
520
|
+
{
|
|
521
|
+
id: "terms_info",
|
|
522
|
+
type: "info_block",
|
|
523
|
+
label: "By signing below, you agree to our consultation terms: sessions start on time, cancellation within 24 hours receives a full refund, no-shows are non-refundable. All discussions are confidential."
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
id: "nda_consent",
|
|
527
|
+
type: "consent",
|
|
528
|
+
label: "I agree to the consultation terms and understand the cancellation policy.",
|
|
529
|
+
required: true
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
id: "data_consent",
|
|
533
|
+
type: "consent",
|
|
534
|
+
label: "I consent to my information being used to prepare for and conduct the consultation session.",
|
|
535
|
+
required: true
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
id: "client_signature",
|
|
539
|
+
type: "signature",
|
|
540
|
+
label: "Signature",
|
|
541
|
+
required: true,
|
|
542
|
+
helpText: "Draw your signature to confirm the booking",
|
|
543
|
+
config: {
|
|
544
|
+
type: "signature",
|
|
545
|
+
width: 500,
|
|
546
|
+
height: 180,
|
|
547
|
+
penColor: "#1a1a2e"
|
|
548
|
+
}
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
id: "special_requests",
|
|
552
|
+
type: "long_text",
|
|
553
|
+
label: "Special Requests or Notes (optional)",
|
|
554
|
+
required: false,
|
|
555
|
+
placeholder: "Anything else we should know before the session?",
|
|
556
|
+
validation: [{ type: "maxLength", value: 500 }]
|
|
557
|
+
}
|
|
558
|
+
]
|
|
559
|
+
}
|
|
560
|
+
]
|
|
561
|
+
};
|
|
562
|
+
var consultationBookingMeta = {
|
|
563
|
+
id: "consultation-booking",
|
|
564
|
+
name: "Multi-Path Consultation Booking",
|
|
565
|
+
description: "A branching consultation booking flow with 3 service paths (legal, business, technical), onExit section jumps, appointment scheduling with repeater for attendees, Stripe payment checkout, file uploads, and signature agreement.",
|
|
566
|
+
category: "advanced",
|
|
567
|
+
fieldCount: 38,
|
|
568
|
+
sectionCount: 6,
|
|
569
|
+
tags: [
|
|
570
|
+
"advanced",
|
|
571
|
+
"payment",
|
|
572
|
+
"appointment",
|
|
573
|
+
"branching",
|
|
574
|
+
"onExit",
|
|
575
|
+
"showIf",
|
|
576
|
+
"repeater",
|
|
577
|
+
"signature",
|
|
578
|
+
"file-upload",
|
|
579
|
+
"consultation"
|
|
580
|
+
]
|
|
581
|
+
};
|
|
582
|
+
var consultationBooking = {
|
|
583
|
+
meta: consultationBookingMeta,
|
|
584
|
+
schema: consultationBookingSchema
|
|
585
|
+
};
|
|
586
|
+
|
|
587
|
+
// src/templates/ecommerce-checkout.ts
|
|
588
|
+
var ecommerceCheckoutSchema = {
|
|
589
|
+
id: "ecommerce-checkout",
|
|
590
|
+
version: "1.0.0",
|
|
591
|
+
title: "E-commerce Checkout",
|
|
592
|
+
description: "Complete your purchase. Review items, enter shipping details, choose delivery, and pay securely.",
|
|
593
|
+
settings: {
|
|
594
|
+
showProgress: true,
|
|
595
|
+
progressStyle: "steps",
|
|
596
|
+
navigation: { showBack: true }
|
|
597
|
+
},
|
|
598
|
+
submitAction: { type: "callback" },
|
|
599
|
+
sections: [
|
|
600
|
+
// ── Section 1: Cart Review ──────────────────────────────────
|
|
601
|
+
{
|
|
602
|
+
id: "cart-review",
|
|
603
|
+
title: "Your Cart",
|
|
604
|
+
description: "Review your items before checkout",
|
|
605
|
+
questions: [
|
|
606
|
+
{
|
|
607
|
+
id: "cart_info",
|
|
608
|
+
type: "info_block",
|
|
609
|
+
label: "Review your order below. You can adjust quantities or remove items. Prices are in USD."
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
id: "order_items",
|
|
613
|
+
type: "repeater",
|
|
614
|
+
label: "Order Items",
|
|
615
|
+
required: true,
|
|
616
|
+
helpText: "Add the products you'd like to purchase",
|
|
617
|
+
config: {
|
|
618
|
+
type: "repeater",
|
|
619
|
+
fields: [
|
|
620
|
+
{
|
|
621
|
+
id: "product_name",
|
|
622
|
+
type: "short_text",
|
|
623
|
+
label: "Product Name",
|
|
624
|
+
required: true
|
|
625
|
+
},
|
|
626
|
+
{
|
|
627
|
+
id: "product_sku",
|
|
628
|
+
type: "short_text",
|
|
629
|
+
label: "SKU",
|
|
630
|
+
required: false
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
id: "quantity",
|
|
634
|
+
type: "number",
|
|
635
|
+
label: "Qty",
|
|
636
|
+
required: true
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
id: "unit_price",
|
|
640
|
+
type: "number",
|
|
641
|
+
label: "Unit Price ($)",
|
|
642
|
+
required: true
|
|
643
|
+
}
|
|
644
|
+
],
|
|
645
|
+
minEntries: 1,
|
|
646
|
+
maxEntries: 20,
|
|
647
|
+
addLabel: "+ Add item"
|
|
648
|
+
}
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
id: "discount_code",
|
|
652
|
+
type: "short_text",
|
|
653
|
+
label: "Discount Code",
|
|
654
|
+
required: false,
|
|
655
|
+
placeholder: "Enter promo code",
|
|
656
|
+
validation: [{ type: "maxLength", value: 30 }]
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
id: "gift_order",
|
|
660
|
+
type: "boolean",
|
|
661
|
+
label: "Is this a gift?",
|
|
662
|
+
required: false
|
|
663
|
+
},
|
|
664
|
+
{
|
|
665
|
+
id: "gift_message",
|
|
666
|
+
type: "long_text",
|
|
667
|
+
label: "Gift Message",
|
|
668
|
+
required: false,
|
|
669
|
+
showIf: { field: "gift_order", operator: "eq", value: true },
|
|
670
|
+
placeholder: "Write a personal message for the recipient...",
|
|
671
|
+
validation: [{ type: "maxLength", value: 300 }]
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
id: "gift_wrap",
|
|
675
|
+
type: "boolean",
|
|
676
|
+
label: "Add gift wrapping (+$5.99)?",
|
|
677
|
+
required: false,
|
|
678
|
+
showIf: { field: "gift_order", operator: "eq", value: true }
|
|
679
|
+
}
|
|
680
|
+
]
|
|
681
|
+
},
|
|
682
|
+
// ── Section 2: Customer Info ─────────────────────────────────
|
|
683
|
+
{
|
|
684
|
+
id: "customer-info",
|
|
685
|
+
title: "Your Details",
|
|
686
|
+
description: "Contact information for order confirmation",
|
|
687
|
+
questions: [
|
|
688
|
+
{
|
|
689
|
+
id: "customer_name",
|
|
690
|
+
type: "legal_name",
|
|
691
|
+
label: "Full Name",
|
|
692
|
+
required: true
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
id: "customer_email",
|
|
696
|
+
type: "email",
|
|
697
|
+
label: "Email Address",
|
|
698
|
+
required: true,
|
|
699
|
+
placeholder: "you@example.com",
|
|
700
|
+
helpText: "Order confirmation and tracking info will be sent here"
|
|
701
|
+
},
|
|
702
|
+
{
|
|
703
|
+
id: "customer_phone",
|
|
704
|
+
type: "phone",
|
|
705
|
+
label: "Phone Number",
|
|
706
|
+
required: true,
|
|
707
|
+
helpText: "For delivery notifications"
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
id: "account_create",
|
|
711
|
+
type: "boolean",
|
|
712
|
+
label: "Create an account for faster checkout next time?",
|
|
713
|
+
required: false
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
id: "account_password",
|
|
717
|
+
type: "short_text",
|
|
718
|
+
label: "Choose a Password",
|
|
719
|
+
required: true,
|
|
720
|
+
showIf: { field: "account_create", operator: "eq", value: true },
|
|
721
|
+
placeholder: "Min 8 characters",
|
|
722
|
+
validation: [
|
|
723
|
+
{ type: "minLength", value: 8, message: "Password must be at least 8 characters" },
|
|
724
|
+
{ type: "maxLength", value: 64 }
|
|
725
|
+
]
|
|
726
|
+
}
|
|
727
|
+
]
|
|
728
|
+
},
|
|
729
|
+
// ── Section 3: Shipping Address ─────────────────────────────
|
|
730
|
+
{
|
|
731
|
+
id: "shipping-address",
|
|
732
|
+
title: "Shipping Address",
|
|
733
|
+
description: "Where should we deliver your order?",
|
|
734
|
+
questions: [
|
|
735
|
+
{
|
|
736
|
+
id: "ship_address_line1",
|
|
737
|
+
type: "short_text",
|
|
738
|
+
label: "Address Line 1",
|
|
739
|
+
required: true,
|
|
740
|
+
placeholder: "Street address, P.O. box",
|
|
741
|
+
validation: [{ type: "maxLength", value: 200 }]
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
id: "ship_address_line2",
|
|
745
|
+
type: "short_text",
|
|
746
|
+
label: "Address Line 2",
|
|
747
|
+
required: false,
|
|
748
|
+
placeholder: "Apartment, suite, unit, building, floor",
|
|
749
|
+
validation: [{ type: "maxLength", value: 200 }]
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
id: "ship_city",
|
|
753
|
+
type: "short_text",
|
|
754
|
+
label: "City",
|
|
755
|
+
required: true,
|
|
756
|
+
validation: [{ type: "maxLength", value: 100 }]
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
id: "ship_state",
|
|
760
|
+
type: "dropdown",
|
|
761
|
+
label: "State / Province",
|
|
762
|
+
required: true,
|
|
763
|
+
options: [
|
|
764
|
+
{ label: "Alabama", value: "AL" },
|
|
765
|
+
{ label: "Alaska", value: "AK" },
|
|
766
|
+
{ label: "Arizona", value: "AZ" },
|
|
767
|
+
{ label: "California", value: "CA" },
|
|
768
|
+
{ label: "Colorado", value: "CO" },
|
|
769
|
+
{ label: "Connecticut", value: "CT" },
|
|
770
|
+
{ label: "Florida", value: "FL" },
|
|
771
|
+
{ label: "Georgia", value: "GA" },
|
|
772
|
+
{ label: "Illinois", value: "IL" },
|
|
773
|
+
{ label: "Massachusetts", value: "MA" },
|
|
774
|
+
{ label: "Michigan", value: "MI" },
|
|
775
|
+
{ label: "New York", value: "NY" },
|
|
776
|
+
{ label: "Ohio", value: "OH" },
|
|
777
|
+
{ label: "Pennsylvania", value: "PA" },
|
|
778
|
+
{ label: "Texas", value: "TX" },
|
|
779
|
+
{ label: "Washington", value: "WA" },
|
|
780
|
+
{ label: "Other", value: "other" }
|
|
781
|
+
]
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
id: "ship_state_other",
|
|
785
|
+
type: "short_text",
|
|
786
|
+
label: "State / Province (specify)",
|
|
787
|
+
required: true,
|
|
788
|
+
showIf: { field: "ship_state", operator: "eq", value: "other" },
|
|
789
|
+
validation: [{ type: "maxLength", value: 100 }]
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
id: "ship_zip",
|
|
793
|
+
type: "short_text",
|
|
794
|
+
label: "ZIP / Postal Code",
|
|
795
|
+
required: true,
|
|
796
|
+
validation: [
|
|
797
|
+
{ type: "pattern", regex: "^[0-9A-Za-z\\- ]{3,10}$", message: "Enter a valid postal code" }
|
|
798
|
+
]
|
|
799
|
+
},
|
|
800
|
+
{
|
|
801
|
+
id: "ship_country",
|
|
802
|
+
type: "dropdown",
|
|
803
|
+
label: "Country",
|
|
804
|
+
required: true,
|
|
805
|
+
options: [
|
|
806
|
+
{ label: "United States", value: "US" },
|
|
807
|
+
{ label: "Canada", value: "CA" },
|
|
808
|
+
{ label: "United Kingdom", value: "GB" },
|
|
809
|
+
{ label: "Australia", value: "AU" },
|
|
810
|
+
{ label: "Germany", value: "DE" },
|
|
811
|
+
{ label: "France", value: "FR" },
|
|
812
|
+
{ label: "Japan", value: "JP" },
|
|
813
|
+
{ label: "India", value: "IN" },
|
|
814
|
+
{ label: "Other", value: "other" }
|
|
815
|
+
]
|
|
816
|
+
},
|
|
817
|
+
{
|
|
818
|
+
id: "ship_instructions",
|
|
819
|
+
type: "long_text",
|
|
820
|
+
label: "Delivery Instructions (optional)",
|
|
821
|
+
required: false,
|
|
822
|
+
placeholder: "Gate code, leave at door, etc.",
|
|
823
|
+
validation: [{ type: "maxLength", value: 300 }]
|
|
824
|
+
}
|
|
825
|
+
]
|
|
826
|
+
},
|
|
827
|
+
// ── Section 4: Shipping Method ──────────────────────────────
|
|
828
|
+
{
|
|
829
|
+
id: "shipping-method",
|
|
830
|
+
title: "Shipping Method",
|
|
831
|
+
description: "Choose how you'd like your order delivered",
|
|
832
|
+
questions: [
|
|
833
|
+
{
|
|
834
|
+
id: "shipping_method",
|
|
835
|
+
type: "single_select",
|
|
836
|
+
label: "Delivery Option",
|
|
837
|
+
required: true,
|
|
838
|
+
options: [
|
|
839
|
+
{ label: "Standard Shipping (5-7 business days) \u2014 $7.99", value: "standard" },
|
|
840
|
+
{ label: "Express Shipping (2-3 business days) \u2014 $14.99", value: "express" },
|
|
841
|
+
{ label: "Overnight Shipping (next business day) \u2014 $29.99", value: "overnight" },
|
|
842
|
+
{ label: "In-Store Pickup (free) \u2014 Ready in 2 hours", value: "pickup" }
|
|
843
|
+
]
|
|
844
|
+
},
|
|
845
|
+
{
|
|
846
|
+
id: "pickup_store",
|
|
847
|
+
type: "single_select",
|
|
848
|
+
label: "Select Pickup Location",
|
|
849
|
+
required: true,
|
|
850
|
+
showIf: { field: "shipping_method", operator: "eq", value: "pickup" },
|
|
851
|
+
options: [
|
|
852
|
+
{ label: "Downtown \u2014 123 Main St", value: "downtown" },
|
|
853
|
+
{ label: "Westside \u2014 456 Oak Ave", value: "westside" },
|
|
854
|
+
{ label: "Mall Location \u2014 Riverside Mall, Unit 12", value: "mall" },
|
|
855
|
+
{ label: "Airport \u2014 Terminal 2, Shop 8", value: "airport" }
|
|
856
|
+
]
|
|
857
|
+
},
|
|
858
|
+
{
|
|
859
|
+
id: "pickup_person",
|
|
860
|
+
type: "short_text",
|
|
861
|
+
label: "Name of person picking up (if different)",
|
|
862
|
+
required: false,
|
|
863
|
+
showIf: { field: "shipping_method", operator: "eq", value: "pickup" },
|
|
864
|
+
validation: [{ type: "maxLength", value: 100 }]
|
|
865
|
+
},
|
|
866
|
+
{
|
|
867
|
+
id: "shipping_insurance",
|
|
868
|
+
type: "boolean",
|
|
869
|
+
label: "Add shipping insurance (+$4.99)?",
|
|
870
|
+
required: false,
|
|
871
|
+
helpText: "Covers loss or damage during transit up to $500",
|
|
872
|
+
showIf: { field: "shipping_method", operator: "neq", value: "pickup" }
|
|
873
|
+
},
|
|
874
|
+
{
|
|
875
|
+
id: "signature_required",
|
|
876
|
+
type: "boolean",
|
|
877
|
+
label: "Require signature on delivery?",
|
|
878
|
+
required: false,
|
|
879
|
+
showIf: { field: "shipping_method", operator: "neq", value: "pickup" }
|
|
880
|
+
}
|
|
881
|
+
],
|
|
882
|
+
onExit: {
|
|
883
|
+
rules: [
|
|
884
|
+
{
|
|
885
|
+
condition: { field: "shipping_method", operator: "eq", value: "pickup" },
|
|
886
|
+
jumpTo: "payment"
|
|
887
|
+
}
|
|
888
|
+
],
|
|
889
|
+
default: "billing-address"
|
|
890
|
+
}
|
|
891
|
+
},
|
|
892
|
+
// ── Section 5: Billing Address (skipped if pickup) ──────────
|
|
893
|
+
{
|
|
894
|
+
id: "billing-address",
|
|
895
|
+
title: "Billing Address",
|
|
896
|
+
description: "Enter billing details for your payment method",
|
|
897
|
+
showIf: { field: "shipping_method", operator: "neq", value: "pickup" },
|
|
898
|
+
questions: [
|
|
899
|
+
{
|
|
900
|
+
id: "billing_same_as_shipping",
|
|
901
|
+
type: "boolean",
|
|
902
|
+
label: "Billing address is the same as shipping address",
|
|
903
|
+
required: false
|
|
904
|
+
},
|
|
905
|
+
{
|
|
906
|
+
id: "bill_name",
|
|
907
|
+
type: "legal_name",
|
|
908
|
+
label: "Name on Card",
|
|
909
|
+
required: true,
|
|
910
|
+
showIf: { field: "billing_same_as_shipping", operator: "eq", value: false }
|
|
911
|
+
},
|
|
912
|
+
{
|
|
913
|
+
id: "bill_address_line1",
|
|
914
|
+
type: "short_text",
|
|
915
|
+
label: "Address Line 1",
|
|
916
|
+
required: true,
|
|
917
|
+
showIf: { field: "billing_same_as_shipping", operator: "eq", value: false },
|
|
918
|
+
placeholder: "Street address",
|
|
919
|
+
validation: [{ type: "maxLength", value: 200 }]
|
|
920
|
+
},
|
|
921
|
+
{
|
|
922
|
+
id: "bill_address_line2",
|
|
923
|
+
type: "short_text",
|
|
924
|
+
label: "Address Line 2",
|
|
925
|
+
required: false,
|
|
926
|
+
showIf: { field: "billing_same_as_shipping", operator: "eq", value: false },
|
|
927
|
+
placeholder: "Apartment, suite, unit",
|
|
928
|
+
validation: [{ type: "maxLength", value: 200 }]
|
|
929
|
+
},
|
|
930
|
+
{
|
|
931
|
+
id: "bill_city",
|
|
932
|
+
type: "short_text",
|
|
933
|
+
label: "City",
|
|
934
|
+
required: true,
|
|
935
|
+
showIf: { field: "billing_same_as_shipping", operator: "eq", value: false },
|
|
936
|
+
validation: [{ type: "maxLength", value: 100 }]
|
|
937
|
+
},
|
|
938
|
+
{
|
|
939
|
+
id: "bill_state",
|
|
940
|
+
type: "short_text",
|
|
941
|
+
label: "State / Province",
|
|
942
|
+
required: true,
|
|
943
|
+
showIf: { field: "billing_same_as_shipping", operator: "eq", value: false },
|
|
944
|
+
validation: [{ type: "maxLength", value: 100 }]
|
|
945
|
+
},
|
|
946
|
+
{
|
|
947
|
+
id: "bill_zip",
|
|
948
|
+
type: "short_text",
|
|
949
|
+
label: "ZIP / Postal Code",
|
|
950
|
+
required: true,
|
|
951
|
+
showIf: { field: "billing_same_as_shipping", operator: "eq", value: false },
|
|
952
|
+
validation: [
|
|
953
|
+
{ type: "pattern", regex: "^[0-9A-Za-z\\- ]{3,10}$", message: "Enter a valid postal code" }
|
|
954
|
+
]
|
|
955
|
+
},
|
|
956
|
+
{
|
|
957
|
+
id: "bill_country",
|
|
958
|
+
type: "dropdown",
|
|
959
|
+
label: "Country",
|
|
960
|
+
required: true,
|
|
961
|
+
showIf: { field: "billing_same_as_shipping", operator: "eq", value: false },
|
|
962
|
+
options: [
|
|
963
|
+
{ label: "United States", value: "US" },
|
|
964
|
+
{ label: "Canada", value: "CA" },
|
|
965
|
+
{ label: "United Kingdom", value: "GB" },
|
|
966
|
+
{ label: "Australia", value: "AU" },
|
|
967
|
+
{ label: "Germany", value: "DE" },
|
|
968
|
+
{ label: "France", value: "FR" },
|
|
969
|
+
{ label: "Japan", value: "JP" },
|
|
970
|
+
{ label: "India", value: "IN" },
|
|
971
|
+
{ label: "Other", value: "other" }
|
|
972
|
+
]
|
|
973
|
+
}
|
|
974
|
+
]
|
|
975
|
+
},
|
|
976
|
+
// ── Section 6: Payment ──────────────────────────────────────
|
|
977
|
+
{
|
|
978
|
+
id: "payment",
|
|
979
|
+
title: "Payment",
|
|
980
|
+
description: "Secure checkout powered by Stripe",
|
|
981
|
+
questions: [
|
|
982
|
+
{
|
|
983
|
+
id: "order_subtotal",
|
|
984
|
+
type: "calculated",
|
|
985
|
+
label: "Subtotal",
|
|
986
|
+
config: {
|
|
987
|
+
type: "calculated",
|
|
988
|
+
expression: "SUM({order_items.unit_price} * {order_items.quantity})",
|
|
989
|
+
format: "currency",
|
|
990
|
+
decimalPlaces: 2,
|
|
991
|
+
prefix: "$"
|
|
992
|
+
}
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
id: "order_tax",
|
|
996
|
+
type: "calculated",
|
|
997
|
+
label: "Estimated Tax (8.5%)",
|
|
998
|
+
config: {
|
|
999
|
+
type: "calculated",
|
|
1000
|
+
expression: "{order_subtotal} * 0.085",
|
|
1001
|
+
format: "currency",
|
|
1002
|
+
decimalPlaces: 2,
|
|
1003
|
+
prefix: "$"
|
|
1004
|
+
}
|
|
1005
|
+
},
|
|
1006
|
+
{
|
|
1007
|
+
id: "order_total",
|
|
1008
|
+
type: "calculated",
|
|
1009
|
+
label: "Order Total",
|
|
1010
|
+
config: {
|
|
1011
|
+
type: "calculated",
|
|
1012
|
+
expression: "{order_subtotal} + {order_tax}",
|
|
1013
|
+
format: "currency",
|
|
1014
|
+
decimalPlaces: 2,
|
|
1015
|
+
prefix: "$"
|
|
1016
|
+
}
|
|
1017
|
+
},
|
|
1018
|
+
{
|
|
1019
|
+
id: "payment_divider",
|
|
1020
|
+
type: "divider",
|
|
1021
|
+
label: ""
|
|
1022
|
+
},
|
|
1023
|
+
{
|
|
1024
|
+
id: "checkout_payment",
|
|
1025
|
+
type: "payment",
|
|
1026
|
+
label: "Pay Now",
|
|
1027
|
+
required: true,
|
|
1028
|
+
helpText: "Your payment is encrypted and processed securely by Stripe.",
|
|
1029
|
+
config: {
|
|
1030
|
+
type: "payment",
|
|
1031
|
+
provider: "stripe",
|
|
1032
|
+
publicKey: "",
|
|
1033
|
+
amount: 1e4,
|
|
1034
|
+
currency: "USD",
|
|
1035
|
+
description: "E-commerce Order",
|
|
1036
|
+
serverUrl: "/api/payment-intents"
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
]
|
|
1040
|
+
},
|
|
1041
|
+
// ── Section 7: Order Confirmation ───────────────────────────
|
|
1042
|
+
{
|
|
1043
|
+
id: "confirmation",
|
|
1044
|
+
title: "Confirm & Place Order",
|
|
1045
|
+
description: "Review your order details and confirm",
|
|
1046
|
+
questions: [
|
|
1047
|
+
{
|
|
1048
|
+
id: "confirm_info",
|
|
1049
|
+
type: "info_block",
|
|
1050
|
+
label: "Please review your order. By placing this order, you agree to our Terms of Service, Return Policy, and Privacy Policy."
|
|
1051
|
+
},
|
|
1052
|
+
{
|
|
1053
|
+
id: "newsletter_optin",
|
|
1054
|
+
type: "boolean",
|
|
1055
|
+
label: "Subscribe to our newsletter for exclusive deals and updates",
|
|
1056
|
+
required: false
|
|
1057
|
+
},
|
|
1058
|
+
{
|
|
1059
|
+
id: "terms_consent",
|
|
1060
|
+
type: "consent",
|
|
1061
|
+
label: "I agree to the Terms of Service, Return Policy, and Privacy Policy.",
|
|
1062
|
+
required: true
|
|
1063
|
+
},
|
|
1064
|
+
{
|
|
1065
|
+
id: "age_consent",
|
|
1066
|
+
type: "consent",
|
|
1067
|
+
label: "I confirm that I am at least 18 years old or have parental consent to make this purchase.",
|
|
1068
|
+
required: true
|
|
1069
|
+
},
|
|
1070
|
+
{
|
|
1071
|
+
id: "order_notes",
|
|
1072
|
+
type: "long_text",
|
|
1073
|
+
label: "Order Notes (optional)",
|
|
1074
|
+
required: false,
|
|
1075
|
+
placeholder: "Special instructions for your order...",
|
|
1076
|
+
validation: [{ type: "maxLength", value: 500 }]
|
|
1077
|
+
}
|
|
1078
|
+
]
|
|
1079
|
+
}
|
|
1080
|
+
]
|
|
1081
|
+
};
|
|
1082
|
+
var ecommerceCheckoutMeta = {
|
|
1083
|
+
id: "ecommerce-checkout",
|
|
1084
|
+
name: "E-commerce Checkout",
|
|
1085
|
+
description: "A full shopping checkout flow with cart review (repeater for line items), shipping & billing addresses with conditional toggling, shipping method branching (onExit jumps), calculated subtotal/tax/total, Stripe payment, and order confirmation with consent.",
|
|
1086
|
+
category: "advanced",
|
|
1087
|
+
fieldCount: 42,
|
|
1088
|
+
sectionCount: 7,
|
|
1089
|
+
tags: [
|
|
1090
|
+
"advanced",
|
|
1091
|
+
"payment",
|
|
1092
|
+
"ecommerce",
|
|
1093
|
+
"checkout",
|
|
1094
|
+
"calculated",
|
|
1095
|
+
"repeater",
|
|
1096
|
+
"showIf",
|
|
1097
|
+
"onExit",
|
|
1098
|
+
"address",
|
|
1099
|
+
"shipping"
|
|
1100
|
+
]
|
|
1101
|
+
};
|
|
1102
|
+
var ecommerceCheckout = {
|
|
1103
|
+
meta: ecommerceCheckoutMeta,
|
|
1104
|
+
schema: ecommerceCheckoutSchema
|
|
1105
|
+
};
|
|
1106
|
+
|
|
1107
|
+
// src/templates/index.ts
|
|
1108
|
+
var proTemplates = [
|
|
1109
|
+
consultationBooking,
|
|
1110
|
+
ecommerceCheckout
|
|
1111
|
+
];
|
|
1112
|
+
|
|
1113
|
+
exports.consultationBooking = consultationBooking;
|
|
1114
|
+
exports.consultationBookingMeta = consultationBookingMeta;
|
|
1115
|
+
exports.consultationBookingSchema = consultationBookingSchema;
|
|
1116
|
+
exports.ecommerceCheckout = ecommerceCheckout;
|
|
1117
|
+
exports.ecommerceCheckoutMeta = ecommerceCheckoutMeta;
|
|
1118
|
+
exports.ecommerceCheckoutSchema = ecommerceCheckoutSchema;
|
|
1119
|
+
exports.proTemplates = proTemplates;
|