keystone-design-bootstrap 1.0.63 → 1.0.65
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 +31 -0
- package/dist/design_system/components/DynamicFormFields.d.ts +15 -0
- package/dist/design_system/components/DynamicFormFields.js +5049 -0
- package/dist/design_system/components/DynamicFormFields.js.map +1 -0
- package/dist/design_system/sections/index.d.ts +2 -1
- package/dist/design_system/sections/index.js +78 -31
- package/dist/design_system/sections/index.js.map +1 -1
- package/dist/form-C94A_PX_.d.ts +36 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +78 -31
- package/dist/index.js.map +1 -1
- package/dist/lib/server-api.d.ts +6 -3
- package/dist/lib/server-api.js +4 -0
- package/dist/lib/server-api.js.map +1 -1
- package/dist/{package-ByCAZw9u.d.ts → package-DeHKpQp7.d.ts} +1 -30
- package/dist/tracking/index.d.ts +52 -0
- package/dist/tracking/index.js +175 -0
- package/dist/tracking/index.js.map +1 -0
- package/dist/types/index.d.ts +2 -1
- package/package.json +2 -1
- package/src/design_system/components/DynamicFormFields.tsx +100 -24
- package/src/design_system/portal/PortalPage.tsx +42 -33
- package/src/design_system/sections/contact-section-form.aman.tsx +1 -1
- package/src/design_system/sections/contact-section-form.balance.tsx +1 -1
- package/src/design_system/sections/contact-section-form.barelux.tsx +1 -1
- package/src/design_system/sections/contact-section-form.tsx +1 -1
- package/src/design_system/sections/header-navigation.aman.tsx +14 -3
- package/src/design_system/sections/header-navigation.balance.tsx +14 -3
- package/src/design_system/sections/header-navigation.barelux.tsx +14 -3
- package/src/design_system/sections/header-navigation.tsx +14 -3
- package/src/lib/server-api.ts +7 -1
- package/src/next/routes/form.ts +16 -0
- package/src/next/routes/proxy-headers.ts +26 -4
- package/src/tracking/firePixelEvent.ts +11 -3
- package/src/tracking/index.ts +20 -0
- package/src/types/api/form.ts +7 -0
package/README.md
CHANGED
|
@@ -95,6 +95,37 @@ import type { Service, Testimonial } from '@keystone-pzjr/design-bootstrap/types
|
|
|
95
95
|
import { themes } from '@keystone-pzjr/design-bootstrap/themes'
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
+
## Meta Pixel Tracking
|
|
99
|
+
|
|
100
|
+
Meta Pixel is initialised automatically in `KeystoneRootLayout` when the account has a connected Meta integration with a pixel configured. Most events fire without any extra work. The one place you need to add tracking manually is **custom form submissions**.
|
|
101
|
+
|
|
102
|
+
### What fires automatically
|
|
103
|
+
|
|
104
|
+
| Event | Trigger |
|
|
105
|
+
|---|---|
|
|
106
|
+
| `PageView` | Every page load |
|
|
107
|
+
| `ViewContent` | Route changes to `/services`, `/services/:slug`, `/locations`, `/locations/:slug`, `/portal`, `/service-menu`, `/faq`, `/contact` |
|
|
108
|
+
| `InitiateCheckout` | Click on any link to the account's external booking URL |
|
|
109
|
+
| Portal tab events | Opening Services, Packages, Specials, or Booking tabs in the member portal |
|
|
110
|
+
|
|
111
|
+
### Adding tracking to a custom form
|
|
112
|
+
|
|
113
|
+
On successful submission, add two calls:
|
|
114
|
+
|
|
115
|
+
```tsx
|
|
116
|
+
import { firePixelEvent, setPixelUserData } from 'keystone-design-bootstrap/tracking';
|
|
117
|
+
|
|
118
|
+
// inside your success handler, after a confirmed API response:
|
|
119
|
+
await setPixelUserData({ email: data.email, phone: data.phone });
|
|
120
|
+
firePixelEvent('Lead');
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Also submit with `formType: 'lead'` in the POST body — this triggers the server-side CAPI `Lead` event automatically with no extra backend work.
|
|
124
|
+
|
|
125
|
+
Both calls are silent no-ops when no Meta Pixel is configured for the site.
|
|
126
|
+
|
|
127
|
+
See `components/sections/VipReferralForm.tsx` in any customer site for a complete working example.
|
|
128
|
+
|
|
98
129
|
## Architecture
|
|
99
130
|
|
|
100
131
|
- **Server-first**: Data fetching happens server-side, components render as Server Components where possible
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { F as FormDefinition } from '../../form-C94A_PX_.js';
|
|
3
|
+
|
|
4
|
+
interface DynamicFormFieldsProps {
|
|
5
|
+
/** Form definition from API (fields array + optional settings). */
|
|
6
|
+
form: FormDefinition;
|
|
7
|
+
/** For job_application forms: add hidden jobSlug input. */
|
|
8
|
+
jobSlug?: string;
|
|
9
|
+
/** Optional URLs for ToS/Privacy links in consent checkbox label. */
|
|
10
|
+
privacyPolicyUrl?: string;
|
|
11
|
+
termsOfServiceUrl?: string;
|
|
12
|
+
}
|
|
13
|
+
declare function DynamicFormFields({ form, jobSlug, privacyPolicyUrl, termsOfServiceUrl }: DynamicFormFieldsProps): React__default.JSX.Element;
|
|
14
|
+
|
|
15
|
+
export { DynamicFormFields, type DynamicFormFieldsProps };
|