keystone-design-bootstrap 1.0.87 → 1.0.88

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.
Files changed (51) hide show
  1. package/dist/design_system/sections/index.d.ts +1 -2
  2. package/dist/index.d.ts +24 -5
  3. package/dist/lib/server-api.d.ts +1 -2
  4. package/dist/lib/server-api.js +1 -1
  5. package/dist/lib/server-api.js.map +1 -1
  6. package/dist/package-DeHKpQp7.d.ts +121 -0
  7. package/dist/types/index.d.ts +68 -6
  8. package/package.json +28 -28
  9. package/src/design_system/portal/PortalPage.tsx +2 -3
  10. package/src/lib/server-api.ts +1 -2
  11. package/dist/company-information-C1pP-SvU.d.ts +0 -50
  12. package/dist/config-C_XBZixg.d.ts +0 -21
  13. package/dist/consumer-BWjQawiO.d.ts +0 -48
  14. package/dist/design_system/portal/index.d.ts +0 -52
  15. package/dist/design_system/portal/index.js +0 -3113
  16. package/dist/design_system/portal/index.js.map +0 -1
  17. package/dist/lib/consumer-session.d.ts +0 -16
  18. package/dist/lib/consumer-session.js +0 -85
  19. package/dist/lib/consumer-session.js.map +0 -1
  20. package/dist/lib/cta-urls.d.ts +0 -34
  21. package/dist/lib/cta-urls.js +0 -33
  22. package/dist/lib/cta-urls.js.map +0 -1
  23. package/dist/next/contexts/form-definitions.d.ts +0 -17
  24. package/dist/next/contexts/form-definitions.js +0 -21
  25. package/dist/next/contexts/form-definitions.js.map +0 -1
  26. package/dist/next/gallery/design-gallery.d.ts +0 -103
  27. package/dist/next/gallery/design-gallery.js +0 -19301
  28. package/dist/next/gallery/design-gallery.js.map +0 -1
  29. package/dist/next/layouts/root-layout.d.ts +0 -55
  30. package/dist/next/layouts/root-layout.js +0 -19713
  31. package/dist/next/layouts/root-layout.js.map +0 -1
  32. package/dist/next/legal/privacy-policy.d.ts +0 -7
  33. package/dist/next/legal/privacy-policy.js +0 -18949
  34. package/dist/next/legal/privacy-policy.js.map +0 -1
  35. package/dist/next/legal/terms-of-service.d.ts +0 -7
  36. package/dist/next/legal/terms-of-service.js +0 -18949
  37. package/dist/next/legal/terms-of-service.js.map +0 -1
  38. package/dist/next/providers/ssr-provider.d.ts +0 -12
  39. package/dist/next/providers/ssr-provider.js +0 -12
  40. package/dist/next/providers/ssr-provider.js.map +0 -1
  41. package/dist/next/routes/chat.d.ts +0 -26
  42. package/dist/next/routes/chat.js +0 -160
  43. package/dist/next/routes/chat.js.map +0 -1
  44. package/dist/next/routes/consumer-auth.d.ts +0 -33
  45. package/dist/next/routes/consumer-auth.js +0 -254
  46. package/dist/next/routes/consumer-auth.js.map +0 -1
  47. package/dist/next/routes/form.d.ts +0 -37
  48. package/dist/next/routes/form.js +0 -97
  49. package/dist/next/routes/form.js.map +0 -1
  50. package/dist/package-IU_GpDA0.d.ts +0 -74
  51. package/src/types/rails-actioncable.d.ts +0 -16
@@ -1,97 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
- var __hasOwnProp = Object.prototype.hasOwnProperty;
4
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __spreadValues = (a, b) => {
7
- for (var prop in b || (b = {}))
8
- if (__hasOwnProp.call(b, prop))
9
- __defNormalProp(a, prop, b[prop]);
10
- if (__getOwnPropSymbols)
11
- for (var prop of __getOwnPropSymbols(b)) {
12
- if (__propIsEnum.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- }
15
- return a;
16
- };
17
-
18
- // src/next/routes/proxy-headers.ts
19
- function clientContextHeaders(request) {
20
- var _a, _b;
21
- const ip = request.headers.get("x-real-ip") || ((_b = (_a = request.headers.get("x-forwarded-for")) == null ? void 0 : _a.split(",")[0]) == null ? void 0 : _b.trim());
22
- const ua = request.headers.get("user-agent");
23
- const cookieHeader = request.headers.get("cookie") || "";
24
- const cookies = Object.fromEntries(
25
- cookieHeader.split(";").map((c) => {
26
- const [k, ...v] = c.trim().split("=");
27
- return [k, v.join("=")];
28
- })
29
- );
30
- const fbp = cookies["_fbp"];
31
- const fbc = cookies["_fbc"];
32
- const headers = {};
33
- if (ip) headers["X-Real-Client-IP"] = ip;
34
- if (ua) headers["X-Real-Client-UA"] = ua;
35
- if (fbp) headers["X-Meta-FBP"] = fbp;
36
- if (fbc) headers["X-Meta-FBC"] = fbc;
37
- return headers;
38
- }
39
-
40
- // src/next/routes/form.ts
41
- var API_URL = process.env.API_URL || "http://localhost:3000/api/v1";
42
- var API_KEY = process.env.API_KEY || "";
43
- function createFormRouteHandlers(deps) {
44
- var _a, _b;
45
- const json = (_b = (_a = deps == null ? void 0 : deps.NextResponse) == null ? void 0 : _a.json) != null ? _b : ((body, init) => Response.json(body, init));
46
- return {
47
- POST: async (request) => {
48
- var _a2;
49
- try {
50
- const body = await request.json();
51
- const formType = body == null ? void 0 : body.formType;
52
- if (!formType) {
53
- return json({ success: false, error: "Form type is required." }, { status: 400 });
54
- }
55
- const response = await fetch(`${API_URL}/public/form_submissions`, {
56
- method: "POST",
57
- headers: __spreadValues({
58
- "Content-Type": "application/json",
59
- "X-API-Key": API_KEY
60
- }, clientContextHeaders(request)),
61
- body: JSON.stringify(body)
62
- });
63
- const data = await response.json();
64
- if (!response.ok) {
65
- return json(
66
- {
67
- success: false,
68
- error: data.error || "Failed to submit form. Please try again."
69
- },
70
- { status: response.status }
71
- );
72
- }
73
- const payload = {
74
- success: true,
75
- message: data.message || "Form submitted successfully."
76
- };
77
- if (formType === "lead" && ((_a2 = data.data) == null ? void 0 : _a2.event_id)) {
78
- payload.eventId = data.data.event_id;
79
- }
80
- return json(payload);
81
- } catch (error) {
82
- console.error("Form submission error:", error);
83
- return json(
84
- {
85
- success: false,
86
- error: "Network error. Please try again later."
87
- },
88
- { status: 500 }
89
- );
90
- }
91
- }
92
- };
93
- }
94
- export {
95
- createFormRouteHandlers
96
- };
97
- //# sourceMappingURL=form.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/next/routes/proxy-headers.ts","../../../src/next/routes/form.ts"],"sourcesContent":["/**\n * Extracts the real client IP, user-agent, and Meta browser cookies (_fbp / _fbc)\n * from an incoming Next.js route request and returns them as headers to forward\n * to the upstream Rails API.\n *\n * Cloudflare and other load-balancers set x-real-ip (or x-forwarded-for) on\n * inbound requests before they reach the Next.js function. Without this, the\n * Rails API sees the Next.js server IP instead of the real browser IP, which\n * produces inaccurate server-side CAPI signals.\n *\n * _fbp (Meta Browser ID) and _fbc (Meta Click ID) are first-party cookies set by\n * the Meta Pixel. Forwarding them allows the API to store them on the Contact\n * record so they can be included in all subsequent CAPI events — even those fired\n * from background jobs that have no live HTTP request.\n *\n * Convention:\n * X-Real-Client-IP — real browser IP\n * X-Real-Client-UA — real browser user-agent\n * X-Meta-FBP — value of the _fbp cookie\n * X-Meta-FBC — value of the _fbc cookie (or built from fbclid param)\n */\nexport function clientContextHeaders(request: Request): Record<string, string> {\n const ip =\n request.headers.get('x-real-ip') ||\n request.headers.get('x-forwarded-for')?.split(',')[0]?.trim();\n const ua = request.headers.get('user-agent');\n\n const cookieHeader = request.headers.get('cookie') || '';\n const cookies = Object.fromEntries(\n cookieHeader.split(';').map((c) => {\n const [k, ...v] = c.trim().split('=');\n return [k, v.join('=')];\n })\n );\n const fbp = cookies['_fbp'];\n const fbc = cookies['_fbc'];\n\n const headers: Record<string, string> = {};\n if (ip) headers['X-Real-Client-IP'] = ip;\n if (ua) headers['X-Real-Client-UA'] = ua;\n if (fbp) headers['X-Meta-FBP'] = fbp;\n if (fbc) headers['X-Meta-FBC'] = fbc;\n return headers;\n}\n","/**\n * Form submission proxy route handler for Next.js App Router.\n *\n * Usage in a site/template:\n * // app/api/form/route.ts\n * export { POST } from 'keystone-design-bootstrap/next/routes/form';\n *\n * Env (server-side only):\n * - API_URL (default: http://localhost:3000/api/v1)\n * - API_KEY\n *\n * ## Meta Pixel + CAPI tracking for custom forms\n *\n * POST body must include `formType: 'lead'` for conversion tracking to fire:\n * - Server-side: the API automatically fires a CAPI Lead event (no extra work needed).\n * - Client-side: the response includes `eventId` for browser/server deduplication.\n * After a successful response, call these two functions from 'keystone-design-bootstrap/tracking':\n *\n * const result = await response.json();\n * if (result.success) {\n * await setPixelUserData({ email, phone }); // hash + store identity for the session\n * firePixelEvent('Lead', undefined, result.eventId); // fire fbq('track', 'Lead') with server event ID for dedup\n * }\n *\n * Both tracking calls are silent no-ops when no Meta Pixel is configured for the site.\n * Non-lead form types (e.g. 'job_application') do not fire any tracking events.\n */\n\n// IMPORTANT:\n// Do NOT import NextRequest/NextResponse here.\n// Export a factory so the consuming app can pass its own `NextResponse` (from its own\n// `next/server`) to avoid type identity conflicts when used as a local file dependency.\n\nimport { clientContextHeaders } from './proxy-headers';\n\nconst API_URL = process.env.API_URL || 'http://localhost:3000/api/v1';\nconst API_KEY = process.env.API_KEY || '';\n\ntype JsonResponder = (body: unknown, init?: ResponseInit) => Response;\n\nexport function createFormRouteHandlers(deps?: { NextResponse?: { json: JsonResponder } }) {\n const json: JsonResponder = deps?.NextResponse?.json ?? ((body, init) => Response.json(body, init));\n\n return {\n POST: async (request: Request): Promise<Response> => {\n try {\n const body = await request.json();\n const formType = body?.formType;\n\n if (!formType) {\n return json({ success: false, error: 'Form type is required.' }, { status: 400 });\n }\n\n const response = await fetch(`${API_URL}/public/form_submissions`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-API-Key': API_KEY,\n ...clientContextHeaders(request),\n },\n body: JSON.stringify(body),\n });\n\n const data = await response.json();\n\n if (!response.ok) {\n return json(\n {\n success: false,\n error: data.error || 'Failed to submit form. Please try again.',\n },\n { status: response.status }\n );\n }\n\n const payload: { success: true; message?: string; eventId?: string } = {\n success: true,\n message: data.message || 'Form submitted successfully.',\n };\n\n if (formType === 'lead' && data.data?.event_id) {\n payload.eventId = data.data.event_id;\n }\n\n return json(payload);\n } catch (error) {\n console.error('Form submission error:', error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AO,KAAK,EAAE,SAAS,OAAO,OAAO,yBAAyB,GAAG,EAAE,QAAQ,IAAI,CAAC;AAAA,QAClF;AAEA,cAAM,WAAW,MAAM,MAAM,GAAG,OAAO,4BAA4B;AAAA,UACjE,QAAQ;AAAA,UACR,SAAS;AAAA,YACP,gBAAgB;AAAA,YAChB,aAAa;AAAA,aACV,qBAAqB,OAAO;AAAA,UAEjC,MAAM,KAAK,UAAU,IAAI;AAAA,QAC3B,CAAC;AAED,cAAM,OAAO,MAAM,SAAS,KAAK;AAEjC,YAAI,CAAC,SAAS,IAAI;AAChB,iBAAO;AAAA,YACL;AAAA,cACE,SAAS;AAAA,cACT,OAAO,KAAK,SAAS;AAAA,YACvB;AAAA,YACA,EAAE,QAAQ,SAAS,OAAO;AAAA,UAC5B;AAAA,QACF;AAEA,cAAM,UAAiE;AAAA,UACrE,SAAS;AAAA,UACT,SAAS,KAAK,WAAW;AAAA,QAC3B;AAEA,YAAI,aAAa,YAAUA,MAAA,KAAK,SAAL,gBAAAA,IAAW,WAAU;AAC9C,kBAAQ,UAAU,KAAK,KAAK;AAAA,QAC9B;AAEA,eAAO,KAAK,OAAO;AAAA,MACrB,SAAS,OAAO;AACd,gBAAQ,MAAM,0BAA0B,KAAK;AAC7C,eAAO;AAAA,UACL;AAAA,YACE,SAAS;AAAA,YACT,OAAO;AAAA,UACT;AAAA,UACA,EAAE,QAAQ,IAAI;AAAA,QAChB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":["_a"]}
@@ -1,74 +0,0 @@
1
- import { P as PhotoAttachment } from './photos-CmBdWiuZ.js';
2
-
3
- /** Nested under `service_items[].offers` and `packages[].offers` in public API. */
4
- interface OfferPublic {
5
- id: number;
6
- name: string;
7
- description: string | null;
8
- value_terms: string | null;
9
- active?: boolean;
10
- expires_at?: string | null;
11
- expired?: boolean;
12
- photo_attachments?: PhotoAttachment[];
13
- }
14
-
15
- interface Service {
16
- id: number;
17
- name: string;
18
- slug: string;
19
- description_markdown: string;
20
- summary?: string;
21
- pricing_info?: string;
22
- features_markdown?: string;
23
- featured: boolean;
24
- sort_order: number;
25
- photo_attachments?: PhotoAttachment[];
26
- service_items?: ServiceItem[];
27
- created_at: string;
28
- updated_at: string;
29
- }
30
- interface ServiceItem {
31
- id: number;
32
- name: string;
33
- slug: string;
34
- summary?: string | null;
35
- description_markdown?: string | null;
36
- pricing_info?: string | null;
37
- price_cents?: number | null;
38
- duration_minutes?: number | null;
39
- sort_order: number;
40
- service_id?: number;
41
- photo_attachments?: PhotoAttachment[];
42
- offers?: OfferPublic[];
43
- }
44
- interface ServiceParams {
45
- featured?: boolean;
46
- q?: string;
47
- page?: number;
48
- per_page?: number;
49
- }
50
- type ServiceResponse = Service[];
51
-
52
- interface PackageItem {
53
- quantity: number;
54
- service_item?: {
55
- id: number;
56
- name: string;
57
- slug: string;
58
- summary?: string | null;
59
- };
60
- }
61
- interface Package {
62
- id: number;
63
- name: string;
64
- slug: string;
65
- summary?: string | null;
66
- description_markdown?: string | null;
67
- pricing_info?: string | null;
68
- price_cents?: number | null;
69
- photo_attachments?: PhotoAttachment[];
70
- package_items?: PackageItem[];
71
- offers?: OfferPublic[];
72
- }
73
-
74
- export type { OfferPublic as O, Package as P, Service as S, PackageItem as a, ServiceItem as b, ServiceParams as c, ServiceResponse as d };
@@ -1,16 +0,0 @@
1
- declare module '@rails/actioncable' {
2
- export function createConsumer(url?: string): {
3
- subscriptions: {
4
- create(
5
- channel: Record<string, string>,
6
- callbacks: {
7
- connected?: () => void;
8
- disconnected?: () => void;
9
- rejected?: () => void;
10
- received?: (data: { type?: string }) => void | Promise<void>;
11
- }
12
- ): { unsubscribe: () => void };
13
- };
14
- disconnect: () => void;
15
- };
16
- }