@squaredr/fieldcraft-pro 1.7.0 → 1.9.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/LICENSE.txt +51 -51
- package/README.md +139 -139
- package/dist/{chunk-VEP3DOCQ.mjs → chunk-5QXKDYWY.mjs} +103 -19
- package/dist/{chunk-GZIV2XAD.mjs → chunk-7GPX3YIB.mjs} +146 -183
- package/dist/{chunk-J5V6OVZO.mjs → chunk-DWRLPGX5.mjs} +690 -211
- package/dist/{chunk-4TN6YJDF.mjs → chunk-KTIU7VCP.mjs} +971 -214
- package/dist/default-schema-BGxf9Jrg.d.ts +174 -0
- package/dist/default-schema-Bwq8FATF.d.mts +174 -0
- package/dist/form-builder/index.d.mts +14 -170
- package/dist/form-builder/index.d.ts +14 -170
- package/dist/form-builder/index.js +827 -326
- package/dist/form-builder/index.mjs +1 -1
- package/dist/index.d.mts +111 -10
- package/dist/index.d.ts +111 -10
- package/dist/index.js +3525 -971
- package/dist/index.mjs +1424 -124
- package/dist/response-viewer/index.d.mts +1 -1
- package/dist/response-viewer/index.d.ts +1 -1
- package/dist/response-viewer/index.js +146 -183
- package/dist/response-viewer/index.mjs +1 -1
- package/dist/styles.css +2 -2
- package/dist/templates/index.d.mts +1 -1
- package/dist/templates/index.d.ts +1 -1
- package/dist/templates/index.js +103 -19
- package/dist/templates/index.mjs +1 -1
- package/dist/theme-editor/index.d.mts +12 -7
- package/dist/theme-editor/index.d.ts +12 -7
- package/dist/theme-editor/index.js +971 -214
- package/dist/theme-editor/index.mjs +1 -1
- package/dist/{types-bFHsZT1n.d.mts → types-BQOeI3LX.d.mts} +1 -1
- package/dist/{types-bFHsZT1n.d.ts → types-BQOeI3LX.d.ts} +1 -1
- package/package.json +29 -18
- package/theme-editor/styles.css +497 -466
package/LICENSE.txt
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
SquaredR Commercial License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024-2026 SquaredR. All rights reserved.
|
|
4
|
-
|
|
5
|
-
This software and associated documentation files (the "Software") are the
|
|
6
|
-
proprietary property of SquaredR.
|
|
7
|
-
|
|
8
|
-
GRANT OF LICENSE
|
|
9
|
-
|
|
10
|
-
Subject to the terms of this license and payment of applicable fees, SquaredR
|
|
11
|
-
grants you a non-exclusive, non-transferable license to:
|
|
12
|
-
|
|
13
|
-
1. Use the Software in a single production application per license key.
|
|
14
|
-
2. Modify the Software for your own internal use within the licensed
|
|
15
|
-
application.
|
|
16
|
-
3. Use the Software in unlimited development and staging environments
|
|
17
|
-
without a license key (development mode).
|
|
18
|
-
|
|
19
|
-
RESTRICTIONS
|
|
20
|
-
|
|
21
|
-
You may NOT:
|
|
22
|
-
|
|
23
|
-
1. Redistribute, sublicense, sell, or otherwise transfer the Software or
|
|
24
|
-
any derivative works to third parties.
|
|
25
|
-
2. Remove or alter any copyright notices, license keys, or proprietary
|
|
26
|
-
markings in the Software.
|
|
27
|
-
3. Use the Software to build a competing product or service.
|
|
28
|
-
4. Share license keys across organizations or unrelated projects.
|
|
29
|
-
|
|
30
|
-
DEVELOPMENT MODE
|
|
31
|
-
|
|
32
|
-
The Software may be used without a license key for development and evaluation
|
|
33
|
-
purposes. Development mode includes visual watermarks and console notices to
|
|
34
|
-
indicate unlicensed usage. Production deployment requires a valid license key.
|
|
35
|
-
|
|
36
|
-
DISCLAIMER OF WARRANTIES
|
|
37
|
-
|
|
38
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
39
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
40
|
-
FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
41
|
-
SQUAREDR BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY ARISING FROM
|
|
42
|
-
THE USE OF THE SOFTWARE.
|
|
43
|
-
|
|
44
|
-
TERMINATION
|
|
45
|
-
|
|
46
|
-
This license is effective until terminated. It will terminate automatically
|
|
47
|
-
if you fail to comply with any term. Upon termination, you must destroy all
|
|
48
|
-
copies of the Software in your possession.
|
|
49
|
-
|
|
50
|
-
For licensing inquiries: support@squaredr.tech
|
|
51
|
-
Purchase a license: https://squaredr.tech/products/fieldcraft/admin-pro#pricing
|
|
1
|
+
SquaredR Commercial License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-2026 SquaredR. All rights reserved.
|
|
4
|
+
|
|
5
|
+
This software and associated documentation files (the "Software") are the
|
|
6
|
+
proprietary property of SquaredR.
|
|
7
|
+
|
|
8
|
+
GRANT OF LICENSE
|
|
9
|
+
|
|
10
|
+
Subject to the terms of this license and payment of applicable fees, SquaredR
|
|
11
|
+
grants you a non-exclusive, non-transferable license to:
|
|
12
|
+
|
|
13
|
+
1. Use the Software in a single production application per license key.
|
|
14
|
+
2. Modify the Software for your own internal use within the licensed
|
|
15
|
+
application.
|
|
16
|
+
3. Use the Software in unlimited development and staging environments
|
|
17
|
+
without a license key (development mode).
|
|
18
|
+
|
|
19
|
+
RESTRICTIONS
|
|
20
|
+
|
|
21
|
+
You may NOT:
|
|
22
|
+
|
|
23
|
+
1. Redistribute, sublicense, sell, or otherwise transfer the Software or
|
|
24
|
+
any derivative works to third parties.
|
|
25
|
+
2. Remove or alter any copyright notices, license keys, or proprietary
|
|
26
|
+
markings in the Software.
|
|
27
|
+
3. Use the Software to build a competing product or service.
|
|
28
|
+
4. Share license keys across organizations or unrelated projects.
|
|
29
|
+
|
|
30
|
+
DEVELOPMENT MODE
|
|
31
|
+
|
|
32
|
+
The Software may be used without a license key for development and evaluation
|
|
33
|
+
purposes. Development mode includes visual watermarks and console notices to
|
|
34
|
+
indicate unlicensed usage. Production deployment requires a valid license key.
|
|
35
|
+
|
|
36
|
+
DISCLAIMER OF WARRANTIES
|
|
37
|
+
|
|
38
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
39
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
40
|
+
FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
41
|
+
SQUAREDR BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY ARISING FROM
|
|
42
|
+
THE USE OF THE SOFTWARE.
|
|
43
|
+
|
|
44
|
+
TERMINATION
|
|
45
|
+
|
|
46
|
+
This license is effective until terminated. It will terminate automatically
|
|
47
|
+
if you fail to comply with any term. Upon termination, you must destroy all
|
|
48
|
+
copies of the Software in your possession.
|
|
49
|
+
|
|
50
|
+
For licensing inquiries: support@squaredr.tech
|
|
51
|
+
Purchase a license: https://squaredr.tech/products/fieldcraft/admin-pro#pricing
|
package/README.md
CHANGED
|
@@ -1,139 +1,139 @@
|
|
|
1
|
-
# @squaredr/fieldcraft-pro
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/@squaredr/fieldcraft-pro)
|
|
4
|
-
[](https://fieldcraft.squaredr.tech/pro#pricing)
|
|
5
|
-
|
|
6
|
-
Pro components for [FieldCraft](https://fieldcraft.squaredr.tech) — a schema-driven form engine for React. Build forms visually, view responses, and customize themes without writing code.
|
|
7
|
-
|
|
8
|
-
## What's Included
|
|
9
|
-
|
|
10
|
-
| Component | Description |
|
|
11
|
-
|-----------|-------------|
|
|
12
|
-
| **FormBuilder** | Drag-and-drop visual form designer with 44 field types, undo/redo, import/export, and live preview |
|
|
13
|
-
| **ResponseViewer** | Read-only viewer for submitted form data with table and detail views, CSV/JSON export |
|
|
14
|
-
| **ThemeEditor** | Visual theme editor for form styling with color pickers, typography controls, and live preview |
|
|
15
|
-
|
|
16
|
-
## Install
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
npm install @squaredr/fieldcraft-pro @squaredr/fieldcraft-core @squaredr/fieldcraft-react
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Quick Start
|
|
23
|
-
|
|
24
|
-
```tsx
|
|
25
|
-
import { FieldCraftProProvider, FormBuilder } from "@squaredr/fieldcraft-pro";
|
|
26
|
-
import "@squaredr/fieldcraft-pro/styles.css";
|
|
27
|
-
|
|
28
|
-
function App() {
|
|
29
|
-
return (
|
|
30
|
-
<FieldCraftProProvider licenseKey="YOUR_LICENSE_KEY">
|
|
31
|
-
<FormBuilder
|
|
32
|
-
onSave={(schema) => console.log(schema)}
|
|
33
|
-
height="100vh"
|
|
34
|
-
/>
|
|
35
|
-
</FieldCraftProProvider>
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Subpath Imports
|
|
41
|
-
|
|
42
|
-
```tsx
|
|
43
|
-
// Root — everything
|
|
44
|
-
import { FormBuilder, ResponseViewer, ThemeEditor } from "@squaredr/fieldcraft-pro";
|
|
45
|
-
|
|
46
|
-
// Tree-shakeable subpath imports
|
|
47
|
-
import { FormBuilder } from "@squaredr/fieldcraft-pro/form-builder";
|
|
48
|
-
import { ResponseViewer } from "@squaredr/fieldcraft-pro/response-viewer";
|
|
49
|
-
import { ThemeEditor } from "@squaredr/fieldcraft-pro/theme-editor";
|
|
50
|
-
|
|
51
|
-
// CSS
|
|
52
|
-
import "@squaredr/fieldcraft-pro/styles.css"; // Form Builder styles
|
|
53
|
-
import "@squaredr/fieldcraft-pro/theme-editor/styles.css"; // Theme Editor styles
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## Form Builder
|
|
57
|
-
|
|
58
|
-
Visual form designer with drag-and-drop, live preview, and schema export:
|
|
59
|
-
|
|
60
|
-
```tsx
|
|
61
|
-
import { FormBuilder } from "@squaredr/fieldcraft-pro";
|
|
62
|
-
|
|
63
|
-
<FormBuilder
|
|
64
|
-
onSave={(schema) => saveToServer(schema)}
|
|
65
|
-
onChange={(schema) => setPreview(schema)}
|
|
66
|
-
height="100vh"
|
|
67
|
-
/>
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### Field Types (42)
|
|
71
|
-
|
|
72
|
-
| Category | Fields |
|
|
73
|
-
|----------|--------|
|
|
74
|
-
| Text | Short Text, Long Text, Email, Phone, URL, Password |
|
|
75
|
-
| Numeric | Number, Slider, Rating, NPS, Opinion Scale, Currency |
|
|
76
|
-
| Selection | Single Select, Multi Select, Dropdown, Yes/No, Ranking, Checkbox Group |
|
|
77
|
-
| Date/Time | Date, Time, Date Range, Date of Birth |
|
|
78
|
-
| Media | File Upload, Signature, Image Capture |
|
|
79
|
-
| Content | Welcome Screen, Thank You Screen, Rich Text, Image, Video, Divider, Spacer |
|
|
80
|
-
| Structural | Section Header, Info Block, Page Break, Consent |
|
|
81
|
-
| Advanced | Matrix, Calculated, Hidden, Repeater, Address, Legal Name, Country Select |
|
|
82
|
-
|
|
83
|
-
### Extending with Custom Fields
|
|
84
|
-
|
|
85
|
-
The FormBuilder accepts `questionTypes` and `palette` props to inject additional field types at runtime:
|
|
86
|
-
|
|
87
|
-
```tsx
|
|
88
|
-
import { FormBuilder, QUESTION_TYPE_INFO, DEFAULT_PALETTE } from "@squaredr/fieldcraft-pro";
|
|
89
|
-
|
|
90
|
-
<FormBuilder
|
|
91
|
-
questionTypes={{ ...QUESTION_TYPE_INFO, ...myCustomTypes }}
|
|
92
|
-
palette={[...DEFAULT_PALETTE, ...myCustomCategories]}
|
|
93
|
-
/>
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
## Response Viewer
|
|
97
|
-
|
|
98
|
-
Display submitted form responses in table or card/detail views:
|
|
99
|
-
|
|
100
|
-
```tsx
|
|
101
|
-
import { ResponseViewer } from "@squaredr/fieldcraft-pro";
|
|
102
|
-
|
|
103
|
-
<ResponseViewer
|
|
104
|
-
schema={schema}
|
|
105
|
-
responses={responses}
|
|
106
|
-
onExport={(format) => console.log(`Export as ${format}`)}
|
|
107
|
-
/>
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
## Theme Editor
|
|
111
|
-
|
|
112
|
-
Live-edit form themes with color pickers, typography controls, and shape/spacing sliders:
|
|
113
|
-
|
|
114
|
-
```tsx
|
|
115
|
-
import { ThemeEditor } from "@squaredr/fieldcraft-pro";
|
|
116
|
-
|
|
117
|
-
<ThemeEditor
|
|
118
|
-
onChange={(theme) => console.log(theme)}
|
|
119
|
-
onSave={(theme) => saveToServer(theme)}
|
|
120
|
-
/>
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
Includes presets: Clean, Dark, Modern, High Contrast, Clinical, Playful.
|
|
124
|
-
|
|
125
|
-
## Requirements
|
|
126
|
-
|
|
127
|
-
- React 18 or 19
|
|
128
|
-
- `@squaredr/fieldcraft-core` >= 1.6.0
|
|
129
|
-
- `@squaredr/fieldcraft-react` >= 1.6.0
|
|
130
|
-
|
|
131
|
-
## License
|
|
132
|
-
|
|
133
|
-
Commercial license required for production use. Free in development mode.
|
|
134
|
-
|
|
135
|
-
See [LICENSE.txt](./LICENSE.txt) for details.
|
|
136
|
-
|
|
137
|
-
---
|
|
138
|
-
|
|
139
|
-
[Get a license](https://fieldcraft.squaredr.tech/pro#pricing) | [Documentation](https://fieldcraft.squaredr.tech/docs) | [GitHub](https://github.com/SquaredR98/fieldcraft-pro) | [Discord](https://discord.gg/squaredr)
|
|
1
|
+
# @squaredr/fieldcraft-pro
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@squaredr/fieldcraft-pro)
|
|
4
|
+
[](https://fieldcraft.squaredr.tech/pro#pricing)
|
|
5
|
+
|
|
6
|
+
Pro components for [FieldCraft](https://fieldcraft.squaredr.tech) — a schema-driven form engine for React. Build forms visually, view responses, and customize themes without writing code.
|
|
7
|
+
|
|
8
|
+
## What's Included
|
|
9
|
+
|
|
10
|
+
| Component | Description |
|
|
11
|
+
|-----------|-------------|
|
|
12
|
+
| **FormBuilder** | Drag-and-drop visual form designer with 44 field types, undo/redo, import/export, and live preview |
|
|
13
|
+
| **ResponseViewer** | Read-only viewer for submitted form data with table and detail views, CSV/JSON export |
|
|
14
|
+
| **ThemeEditor** | Visual theme editor for form styling with color pickers, typography controls, and live preview |
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install @squaredr/fieldcraft-pro @squaredr/fieldcraft-core @squaredr/fieldcraft-react
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import { FieldCraftProProvider, FormBuilder } from "@squaredr/fieldcraft-pro";
|
|
26
|
+
import "@squaredr/fieldcraft-pro/styles.css";
|
|
27
|
+
|
|
28
|
+
function App() {
|
|
29
|
+
return (
|
|
30
|
+
<FieldCraftProProvider licenseKey="YOUR_LICENSE_KEY">
|
|
31
|
+
<FormBuilder
|
|
32
|
+
onSave={(schema) => console.log(schema)}
|
|
33
|
+
height="100vh"
|
|
34
|
+
/>
|
|
35
|
+
</FieldCraftProProvider>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Subpath Imports
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
// Root — everything
|
|
44
|
+
import { FormBuilder, ResponseViewer, ThemeEditor } from "@squaredr/fieldcraft-pro";
|
|
45
|
+
|
|
46
|
+
// Tree-shakeable subpath imports
|
|
47
|
+
import { FormBuilder } from "@squaredr/fieldcraft-pro/form-builder";
|
|
48
|
+
import { ResponseViewer } from "@squaredr/fieldcraft-pro/response-viewer";
|
|
49
|
+
import { ThemeEditor } from "@squaredr/fieldcraft-pro/theme-editor";
|
|
50
|
+
|
|
51
|
+
// CSS
|
|
52
|
+
import "@squaredr/fieldcraft-pro/styles.css"; // Form Builder styles
|
|
53
|
+
import "@squaredr/fieldcraft-pro/theme-editor/styles.css"; // Theme Editor styles
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Form Builder
|
|
57
|
+
|
|
58
|
+
Visual form designer with drag-and-drop, live preview, and schema export:
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
import { FormBuilder } from "@squaredr/fieldcraft-pro";
|
|
62
|
+
|
|
63
|
+
<FormBuilder
|
|
64
|
+
onSave={(schema) => saveToServer(schema)}
|
|
65
|
+
onChange={(schema) => setPreview(schema)}
|
|
66
|
+
height="100vh"
|
|
67
|
+
/>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Field Types (42)
|
|
71
|
+
|
|
72
|
+
| Category | Fields |
|
|
73
|
+
|----------|--------|
|
|
74
|
+
| Text | Short Text, Long Text, Email, Phone, URL, Password |
|
|
75
|
+
| Numeric | Number, Slider, Rating, NPS, Opinion Scale, Currency |
|
|
76
|
+
| Selection | Single Select, Multi Select, Dropdown, Yes/No, Ranking, Checkbox Group |
|
|
77
|
+
| Date/Time | Date, Time, Date Range, Date of Birth |
|
|
78
|
+
| Media | File Upload, Signature, Image Capture |
|
|
79
|
+
| Content | Welcome Screen, Thank You Screen, Rich Text, Image, Video, Divider, Spacer |
|
|
80
|
+
| Structural | Section Header, Info Block, Page Break, Consent |
|
|
81
|
+
| Advanced | Matrix, Calculated, Hidden, Repeater, Address, Legal Name, Country Select |
|
|
82
|
+
|
|
83
|
+
### Extending with Custom Fields
|
|
84
|
+
|
|
85
|
+
The FormBuilder accepts `questionTypes` and `palette` props to inject additional field types at runtime:
|
|
86
|
+
|
|
87
|
+
```tsx
|
|
88
|
+
import { FormBuilder, QUESTION_TYPE_INFO, DEFAULT_PALETTE } from "@squaredr/fieldcraft-pro";
|
|
89
|
+
|
|
90
|
+
<FormBuilder
|
|
91
|
+
questionTypes={{ ...QUESTION_TYPE_INFO, ...myCustomTypes }}
|
|
92
|
+
palette={[...DEFAULT_PALETTE, ...myCustomCategories]}
|
|
93
|
+
/>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Response Viewer
|
|
97
|
+
|
|
98
|
+
Display submitted form responses in table or card/detail views:
|
|
99
|
+
|
|
100
|
+
```tsx
|
|
101
|
+
import { ResponseViewer } from "@squaredr/fieldcraft-pro";
|
|
102
|
+
|
|
103
|
+
<ResponseViewer
|
|
104
|
+
schema={schema}
|
|
105
|
+
responses={responses}
|
|
106
|
+
onExport={(format) => console.log(`Export as ${format}`)}
|
|
107
|
+
/>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Theme Editor
|
|
111
|
+
|
|
112
|
+
Live-edit form themes with color pickers, typography controls, and shape/spacing sliders:
|
|
113
|
+
|
|
114
|
+
```tsx
|
|
115
|
+
import { ThemeEditor } from "@squaredr/fieldcraft-pro";
|
|
116
|
+
|
|
117
|
+
<ThemeEditor
|
|
118
|
+
onChange={(theme) => console.log(theme)}
|
|
119
|
+
onSave={(theme) => saveToServer(theme)}
|
|
120
|
+
/>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Includes presets: Clean, Dark, Modern, High Contrast, Clinical, Playful.
|
|
124
|
+
|
|
125
|
+
## Requirements
|
|
126
|
+
|
|
127
|
+
- React 18 or 19
|
|
128
|
+
- `@squaredr/fieldcraft-core` >= 1.6.0
|
|
129
|
+
- `@squaredr/fieldcraft-react` >= 1.6.0
|
|
130
|
+
|
|
131
|
+
## License
|
|
132
|
+
|
|
133
|
+
Commercial license required for production use. Free in development mode.
|
|
134
|
+
|
|
135
|
+
See [LICENSE.txt](./LICENSE.txt) for details.
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
[Get a license](https://fieldcraft.squaredr.tech/pro#pricing) | [Documentation](https://fieldcraft.squaredr.tech/docs) | [GitHub](https://github.com/SquaredR98/fieldcraft-pro) | [Discord](https://discord.gg/squaredr)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { TIMEZONES } from '@squaredr/fieldcraft-core';
|
|
2
|
+
|
|
1
3
|
// src/templates/consultation-booking.ts
|
|
2
4
|
var consultationBookingSchema = {
|
|
3
5
|
id: "consultation-booking",
|
|
@@ -364,17 +366,10 @@ var consultationBookingSchema = {
|
|
|
364
366
|
type: "dropdown",
|
|
365
367
|
label: "Your Timezone",
|
|
366
368
|
required: true,
|
|
367
|
-
options:
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
{ label: "US Pacific (PT)", value: "America/Los_Angeles" },
|
|
372
|
-
{ label: "UK (GMT/BST)", value: "Europe/London" },
|
|
373
|
-
{ label: "Central Europe (CET)", value: "Europe/Berlin" },
|
|
374
|
-
{ label: "India (IST)", value: "Asia/Kolkata" },
|
|
375
|
-
{ label: "Japan (JST)", value: "Asia/Tokyo" },
|
|
376
|
-
{ label: "Australia Eastern (AEST)", value: "Australia/Sydney" }
|
|
377
|
-
]
|
|
369
|
+
options: TIMEZONES.map((tz) => ({
|
|
370
|
+
label: `${tz.label} (${tz.offset})`,
|
|
371
|
+
value: tz.value
|
|
372
|
+
}))
|
|
378
373
|
},
|
|
379
374
|
{
|
|
380
375
|
id: "appointment_slot",
|
|
@@ -383,6 +378,7 @@ var consultationBookingSchema = {
|
|
|
383
378
|
required: true,
|
|
384
379
|
config: {
|
|
385
380
|
type: "appointment",
|
|
381
|
+
// Example slots — replace with dynamic data or a slots URL in production
|
|
386
382
|
slots: [
|
|
387
383
|
{
|
|
388
384
|
date: "2026-09-01",
|
|
@@ -405,7 +401,7 @@ var consultationBookingSchema = {
|
|
|
405
401
|
times: ["09:00", "11:00", "13:00", "14:00", "16:00"]
|
|
406
402
|
}
|
|
407
403
|
],
|
|
408
|
-
|
|
404
|
+
timezoneField: "timezone",
|
|
409
405
|
duration: 60
|
|
410
406
|
}
|
|
411
407
|
},
|
|
@@ -483,6 +479,55 @@ var consultationBookingSchema = {
|
|
|
483
479
|
type: "divider",
|
|
484
480
|
label: ""
|
|
485
481
|
},
|
|
482
|
+
{
|
|
483
|
+
id: "hourly_rate",
|
|
484
|
+
type: "calculated",
|
|
485
|
+
label: "Hourly Rate",
|
|
486
|
+
config: {
|
|
487
|
+
type: "calculated",
|
|
488
|
+
expression: 'IF({service_type} = "legal", 150, IF({service_type} = "business", 200, IF({service_type} = "technical", 175, 0)))',
|
|
489
|
+
format: "currency",
|
|
490
|
+
decimalPlaces: 2,
|
|
491
|
+
prefix: "$"
|
|
492
|
+
}
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
id: "session_cost",
|
|
496
|
+
type: "calculated",
|
|
497
|
+
label: "Session Cost",
|
|
498
|
+
helpText: "Based on service type and session duration",
|
|
499
|
+
config: {
|
|
500
|
+
type: "calculated",
|
|
501
|
+
expression: "{hourly_rate} * {session_duration} / 60",
|
|
502
|
+
format: "currency",
|
|
503
|
+
decimalPlaces: 2,
|
|
504
|
+
prefix: "$"
|
|
505
|
+
}
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
id: "rush_fee",
|
|
509
|
+
type: "calculated",
|
|
510
|
+
label: "Rush Fee",
|
|
511
|
+
config: {
|
|
512
|
+
type: "calculated",
|
|
513
|
+
expression: 'IF({urgency} = "rush", 50, 0)',
|
|
514
|
+
format: "currency",
|
|
515
|
+
decimalPlaces: 2,
|
|
516
|
+
prefix: "$"
|
|
517
|
+
}
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
id: "total_cost",
|
|
521
|
+
type: "calculated",
|
|
522
|
+
label: "Total",
|
|
523
|
+
config: {
|
|
524
|
+
type: "calculated",
|
|
525
|
+
expression: "{session_cost} + {rush_fee}",
|
|
526
|
+
format: "currency",
|
|
527
|
+
decimalPlaces: 2,
|
|
528
|
+
prefix: "$"
|
|
529
|
+
}
|
|
530
|
+
},
|
|
486
531
|
{
|
|
487
532
|
id: "promo_code",
|
|
488
533
|
type: "short_text",
|
|
@@ -501,10 +546,11 @@ var consultationBookingSchema = {
|
|
|
501
546
|
type: "payment",
|
|
502
547
|
provider: "stripe",
|
|
503
548
|
publicKey: "",
|
|
504
|
-
|
|
549
|
+
// Set your Stripe publishable key (pk_test_... or pk_live_...)
|
|
550
|
+
amountField: "total_cost",
|
|
505
551
|
currency: "USD",
|
|
506
|
-
description: "Consultation Session"
|
|
507
|
-
serverUrl: "
|
|
552
|
+
description: "Consultation Session"
|
|
553
|
+
// serverUrl: "" — developer must configure their own payment intent endpoint
|
|
508
554
|
}
|
|
509
555
|
}
|
|
510
556
|
]
|
|
@@ -1001,13 +1047,50 @@ var ecommerceCheckoutSchema = {
|
|
|
1001
1047
|
prefix: "$"
|
|
1002
1048
|
}
|
|
1003
1049
|
},
|
|
1050
|
+
{
|
|
1051
|
+
id: "shipping_cost",
|
|
1052
|
+
type: "calculated",
|
|
1053
|
+
label: "Shipping",
|
|
1054
|
+
helpText: "Based on your selected shipping method",
|
|
1055
|
+
config: {
|
|
1056
|
+
type: "calculated",
|
|
1057
|
+
expression: 'IF({shipping_method} = "overnight", 29.99, IF({shipping_method} = "express", 14.99, IF({shipping_method} = "standard", 7.99, 0)))',
|
|
1058
|
+
format: "currency",
|
|
1059
|
+
decimalPlaces: 2,
|
|
1060
|
+
prefix: "$"
|
|
1061
|
+
}
|
|
1062
|
+
},
|
|
1063
|
+
{
|
|
1064
|
+
id: "insurance_cost",
|
|
1065
|
+
type: "calculated",
|
|
1066
|
+
label: "Shipping Insurance",
|
|
1067
|
+
config: {
|
|
1068
|
+
type: "calculated",
|
|
1069
|
+
expression: "IF({shipping_insurance} = true, 4.99, 0)",
|
|
1070
|
+
format: "currency",
|
|
1071
|
+
decimalPlaces: 2,
|
|
1072
|
+
prefix: "$"
|
|
1073
|
+
}
|
|
1074
|
+
},
|
|
1075
|
+
{
|
|
1076
|
+
id: "gift_wrap_cost",
|
|
1077
|
+
type: "calculated",
|
|
1078
|
+
label: "Gift Wrapping",
|
|
1079
|
+
config: {
|
|
1080
|
+
type: "calculated",
|
|
1081
|
+
expression: "IF({gift_wrap} = true, 5.99, 0)",
|
|
1082
|
+
format: "currency",
|
|
1083
|
+
decimalPlaces: 2,
|
|
1084
|
+
prefix: "$"
|
|
1085
|
+
}
|
|
1086
|
+
},
|
|
1004
1087
|
{
|
|
1005
1088
|
id: "order_total",
|
|
1006
1089
|
type: "calculated",
|
|
1007
1090
|
label: "Order Total",
|
|
1008
1091
|
config: {
|
|
1009
1092
|
type: "calculated",
|
|
1010
|
-
expression: "{order_subtotal} + {order_tax}",
|
|
1093
|
+
expression: "{order_subtotal} + {order_tax} + {shipping_cost} + {insurance_cost} + {gift_wrap_cost}",
|
|
1011
1094
|
format: "currency",
|
|
1012
1095
|
decimalPlaces: 2,
|
|
1013
1096
|
prefix: "$"
|
|
@@ -1028,10 +1111,11 @@ var ecommerceCheckoutSchema = {
|
|
|
1028
1111
|
type: "payment",
|
|
1029
1112
|
provider: "stripe",
|
|
1030
1113
|
publicKey: "",
|
|
1031
|
-
|
|
1114
|
+
// Set your Stripe publishable key (pk_test_... or pk_live_...)
|
|
1115
|
+
amountField: "order_total",
|
|
1032
1116
|
currency: "USD",
|
|
1033
|
-
description: "E-commerce Order"
|
|
1034
|
-
serverUrl: "
|
|
1117
|
+
description: "E-commerce Order"
|
|
1118
|
+
// serverUrl: "" — developer must configure their own payment intent endpoint
|
|
1035
1119
|
}
|
|
1036
1120
|
}
|
|
1037
1121
|
]
|