@mission-studio/puck 1.0.3 → 1.0.15
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/dist/{ResponsiveToggleField-CVhKzDAT.d.mts → ResponsiveToggleField-BGofgB3u.d.mts} +1 -49
- package/dist/{ResponsiveToggleField-CVhKzDAT.d.ts → ResponsiveToggleField-BGofgB3u.d.ts} +1 -49
- package/dist/chunk-A3QDUUOF.mjs +80 -0
- package/dist/{chunk-F47J7QDM.mjs → chunk-HHHD5TX2.mjs} +62 -142
- package/dist/{chunk-OZYZPWP7.mjs → chunk-JD6CULMT.mjs} +248 -284
- package/dist/chunk-QSWQDR6M.mjs +67 -0
- package/dist/{chunk-TTKY3YGP.mjs → chunk-XRKFMCSS.mjs} +1 -79
- package/dist/config-entry.js +335 -394
- package/dist/config-entry.mjs +5 -3
- package/dist/editor.d.mts +3 -2
- package/dist/editor.d.ts +3 -2
- package/dist/editor.js +271 -309
- package/dist/editor.mjs +8 -6
- package/dist/hooks/index.d.mts +33 -0
- package/dist/hooks/index.d.ts +33 -0
- package/dist/hooks/index.js +94 -0
- package/dist/hooks/index.mjs +8 -0
- package/dist/index.d.mts +6 -287
- package/dist/index.d.ts +6 -287
- package/dist/index.js +60 -91
- package/dist/index.mjs +18 -15
- package/dist/renderer.d.mts +287 -0
- package/dist/renderer.d.ts +287 -0
- package/dist/renderer.js +2162 -0
- package/dist/renderer.mjs +55 -0
- package/dist/styles.css +1 -1
- package/dist/typography-DwjKOx3F.d.mts +49 -0
- package/dist/typography-DwjKOx3F.d.ts +49 -0
- package/package.json +11 -1
|
@@ -108,54 +108,6 @@ declare function useTheme(): ThemeContextValue;
|
|
|
108
108
|
|
|
109
109
|
declare const DEFAULT_THEME: PageTheme;
|
|
110
110
|
|
|
111
|
-
type BorderRadiusPreset = {
|
|
112
|
-
label: string;
|
|
113
|
-
value: number;
|
|
114
|
-
};
|
|
115
|
-
declare const borderRadiusScale: BorderRadiusPreset[];
|
|
116
|
-
declare const getClosestBorderRadiusValue: (value: number) => number;
|
|
117
|
-
declare const getBorderRadiusCSS: (value: number) => string;
|
|
118
|
-
|
|
119
|
-
type ColorPreset = {
|
|
120
|
-
label: string;
|
|
121
|
-
value: string;
|
|
122
|
-
};
|
|
123
|
-
declare const neutralColors: ColorPreset[];
|
|
124
|
-
declare const allColorPresets: ColorPreset[];
|
|
125
|
-
|
|
126
|
-
type ShadowPreset = {
|
|
127
|
-
label: string;
|
|
128
|
-
value: string;
|
|
129
|
-
css: string;
|
|
130
|
-
};
|
|
131
|
-
declare const shadowPresets: ShadowPreset[];
|
|
132
|
-
declare const getShadowCSS: (value: string) => string;
|
|
133
|
-
|
|
134
|
-
type SpacingPreset = {
|
|
135
|
-
label: string;
|
|
136
|
-
value: number;
|
|
137
|
-
};
|
|
138
|
-
declare const spacingScale: SpacingPreset[];
|
|
139
|
-
declare const getClosestSpacingValue: (value: number) => number;
|
|
140
|
-
|
|
141
|
-
type FontFamilyPreset = {
|
|
142
|
-
label: string;
|
|
143
|
-
value: string;
|
|
144
|
-
};
|
|
145
|
-
type FontSizePreset = {
|
|
146
|
-
label: string;
|
|
147
|
-
value: string;
|
|
148
|
-
css: string;
|
|
149
|
-
};
|
|
150
|
-
type FontWeightPreset = {
|
|
151
|
-
label: string;
|
|
152
|
-
value: number;
|
|
153
|
-
};
|
|
154
|
-
declare const fontFamilies: FontFamilyPreset[];
|
|
155
|
-
declare const fontSizes: FontSizePreset[];
|
|
156
|
-
declare const fontWeights: FontWeightPreset[];
|
|
157
|
-
declare const getFontSizeCSS: (value: string) => string;
|
|
158
|
-
|
|
159
111
|
type EntryContent = Record<string, string | number | boolean | null>;
|
|
160
112
|
type Entry = {
|
|
161
113
|
id: string;
|
|
@@ -180,4 +132,4 @@ type ResponsiveVisibility = {
|
|
|
180
132
|
};
|
|
181
133
|
declare function ResponsiveToggleField({ value, onChangeAction, disabled, label, }: CustomFieldProps<ResponsiveVisibility>): react_jsx_runtime.JSX.Element;
|
|
182
134
|
|
|
183
|
-
export {
|
|
135
|
+
export { type ColorValue as C, DEFAULT_THEME as D, type Entry as E, type PageTheme as P, type ResponsiveVisibility as R, type ThemeBorderKey as T, type ThemeBorders as a, type ThemeColorKey as b, type ThemeColors as c, ThemeProvider as d, type ThemeShadowKey as e, type ThemeShadows as f, type ThemeSpacing as g, type ThemeSpacingKey as h, type ThemeTypography as i, type ThemeableBorderRadiusValue as j, type ThemeableColorValue as k, type ThemeableShadowValue as l, type ThemeableSpacingValue as m, type EntryBoundValue as n, type CustomFieldProps as o, type EntryContent as p, ResponsiveToggleField as q, useTheme as u };
|
|
@@ -108,54 +108,6 @@ declare function useTheme(): ThemeContextValue;
|
|
|
108
108
|
|
|
109
109
|
declare const DEFAULT_THEME: PageTheme;
|
|
110
110
|
|
|
111
|
-
type BorderRadiusPreset = {
|
|
112
|
-
label: string;
|
|
113
|
-
value: number;
|
|
114
|
-
};
|
|
115
|
-
declare const borderRadiusScale: BorderRadiusPreset[];
|
|
116
|
-
declare const getClosestBorderRadiusValue: (value: number) => number;
|
|
117
|
-
declare const getBorderRadiusCSS: (value: number) => string;
|
|
118
|
-
|
|
119
|
-
type ColorPreset = {
|
|
120
|
-
label: string;
|
|
121
|
-
value: string;
|
|
122
|
-
};
|
|
123
|
-
declare const neutralColors: ColorPreset[];
|
|
124
|
-
declare const allColorPresets: ColorPreset[];
|
|
125
|
-
|
|
126
|
-
type ShadowPreset = {
|
|
127
|
-
label: string;
|
|
128
|
-
value: string;
|
|
129
|
-
css: string;
|
|
130
|
-
};
|
|
131
|
-
declare const shadowPresets: ShadowPreset[];
|
|
132
|
-
declare const getShadowCSS: (value: string) => string;
|
|
133
|
-
|
|
134
|
-
type SpacingPreset = {
|
|
135
|
-
label: string;
|
|
136
|
-
value: number;
|
|
137
|
-
};
|
|
138
|
-
declare const spacingScale: SpacingPreset[];
|
|
139
|
-
declare const getClosestSpacingValue: (value: number) => number;
|
|
140
|
-
|
|
141
|
-
type FontFamilyPreset = {
|
|
142
|
-
label: string;
|
|
143
|
-
value: string;
|
|
144
|
-
};
|
|
145
|
-
type FontSizePreset = {
|
|
146
|
-
label: string;
|
|
147
|
-
value: string;
|
|
148
|
-
css: string;
|
|
149
|
-
};
|
|
150
|
-
type FontWeightPreset = {
|
|
151
|
-
label: string;
|
|
152
|
-
value: number;
|
|
153
|
-
};
|
|
154
|
-
declare const fontFamilies: FontFamilyPreset[];
|
|
155
|
-
declare const fontSizes: FontSizePreset[];
|
|
156
|
-
declare const fontWeights: FontWeightPreset[];
|
|
157
|
-
declare const getFontSizeCSS: (value: string) => string;
|
|
158
|
-
|
|
159
111
|
type EntryContent = Record<string, string | number | boolean | null>;
|
|
160
112
|
type Entry = {
|
|
161
113
|
id: string;
|
|
@@ -180,4 +132,4 @@ type ResponsiveVisibility = {
|
|
|
180
132
|
};
|
|
181
133
|
declare function ResponsiveToggleField({ value, onChangeAction, disabled, label, }: CustomFieldProps<ResponsiveVisibility>): react_jsx_runtime.JSX.Element;
|
|
182
134
|
|
|
183
|
-
export {
|
|
135
|
+
export { type ColorValue as C, DEFAULT_THEME as D, type Entry as E, type PageTheme as P, type ResponsiveVisibility as R, type ThemeBorderKey as T, type ThemeBorders as a, type ThemeColorKey as b, type ThemeColors as c, ThemeProvider as d, type ThemeShadowKey as e, type ThemeShadows as f, type ThemeSpacing as g, type ThemeSpacingKey as h, type ThemeTypography as i, type ThemeableBorderRadiusValue as j, type ThemeableColorValue as k, type ThemeableShadowValue as l, type ThemeableSpacingValue as m, type EntryBoundValue as n, type CustomFieldProps as o, type EntryContent as p, ResponsiveToggleField as q, useTheme as u };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// design-system/borders.ts
|
|
2
|
+
var borderRadiusScale = [
|
|
3
|
+
{ label: "None", value: 0 },
|
|
4
|
+
{ label: "XS", value: 2 },
|
|
5
|
+
{ label: "SM", value: 4 },
|
|
6
|
+
{ label: "MD", value: 6 },
|
|
7
|
+
{ label: "LG", value: 8 },
|
|
8
|
+
{ label: "XL", value: 12 },
|
|
9
|
+
{ label: "2XL", value: 16 },
|
|
10
|
+
{ label: "3XL", value: 24 }
|
|
11
|
+
];
|
|
12
|
+
var getClosestBorderRadiusValue = (value) => {
|
|
13
|
+
return borderRadiusScale.reduce(
|
|
14
|
+
(prev, curr) => Math.abs(curr.value - value) < Math.abs(prev.value - value) ? curr : prev
|
|
15
|
+
).value;
|
|
16
|
+
};
|
|
17
|
+
var getBorderRadiusCSS = (value) => {
|
|
18
|
+
return `${value}px`;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// design-system/spacing.ts
|
|
22
|
+
var spacingScale = [
|
|
23
|
+
{ label: "None", value: 0 },
|
|
24
|
+
{ label: "2XS", value: 4 },
|
|
25
|
+
{ label: "XS", value: 8 },
|
|
26
|
+
{ label: "SM", value: 12 },
|
|
27
|
+
{ label: "MD", value: 16 },
|
|
28
|
+
{ label: "LG", value: 24 },
|
|
29
|
+
{ label: "XL", value: 32 },
|
|
30
|
+
{ label: "2XL", value: 48 },
|
|
31
|
+
{ label: "3XL", value: 64 },
|
|
32
|
+
{ label: "4XL", value: 96 }
|
|
33
|
+
];
|
|
34
|
+
var getClosestSpacingValue = (value) => {
|
|
35
|
+
return spacingScale.reduce(
|
|
36
|
+
(prev, curr) => Math.abs(curr.value - value) < Math.abs(prev.value - value) ? curr : prev
|
|
37
|
+
).value;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// design-system/typography.ts
|
|
41
|
+
var fontFamilies = [
|
|
42
|
+
{ label: "System", value: "system-ui, sans-serif" },
|
|
43
|
+
{ label: "Sans", value: "ui-sans-serif, system-ui, sans-serif" },
|
|
44
|
+
{ label: "Serif", value: "ui-serif, Georgia, serif" },
|
|
45
|
+
{ label: "Mono", value: "ui-monospace, monospace" }
|
|
46
|
+
];
|
|
47
|
+
var fontSizes = [
|
|
48
|
+
{ label: "XS", value: "xs", css: "0.75rem" },
|
|
49
|
+
{ label: "SM", value: "sm", css: "0.875rem" },
|
|
50
|
+
{ label: "Base", value: "base", css: "1rem" },
|
|
51
|
+
{ label: "LG", value: "lg", css: "1.125rem" },
|
|
52
|
+
{ label: "XL", value: "xl", css: "1.25rem" },
|
|
53
|
+
{ label: "2XL", value: "2xl", css: "1.5rem" },
|
|
54
|
+
{ label: "3XL", value: "3xl", css: "1.875rem" },
|
|
55
|
+
{ label: "4XL", value: "4xl", css: "2.25rem" },
|
|
56
|
+
{ label: "5XL", value: "5xl", css: "3rem" }
|
|
57
|
+
];
|
|
58
|
+
var fontWeights = [
|
|
59
|
+
{ label: "Light", value: 300 },
|
|
60
|
+
{ label: "Normal", value: 400 },
|
|
61
|
+
{ label: "Medium", value: 500 },
|
|
62
|
+
{ label: "Semibold", value: 600 },
|
|
63
|
+
{ label: "Bold", value: 700 }
|
|
64
|
+
];
|
|
65
|
+
var getFontSizeCSS = (value) => {
|
|
66
|
+
const preset = fontSizes.find((p) => p.value === value);
|
|
67
|
+
return preset?.css ?? "1rem";
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export {
|
|
71
|
+
borderRadiusScale,
|
|
72
|
+
getClosestBorderRadiusValue,
|
|
73
|
+
getBorderRadiusCSS,
|
|
74
|
+
spacingScale,
|
|
75
|
+
getClosestSpacingValue,
|
|
76
|
+
fontFamilies,
|
|
77
|
+
fontSizes,
|
|
78
|
+
fontWeights,
|
|
79
|
+
getFontSizeCSS
|
|
80
|
+
};
|
|
@@ -4,7 +4,11 @@ import {
|
|
|
4
4
|
hexToRgba,
|
|
5
5
|
useEntries,
|
|
6
6
|
useTheme
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XRKFMCSS.mjs";
|
|
8
|
+
import {
|
|
9
|
+
useGtmEvent,
|
|
10
|
+
useUtmParams
|
|
11
|
+
} from "./chunk-QSWQDR6M.mjs";
|
|
8
12
|
|
|
9
13
|
// components/page/Heading.tsx
|
|
10
14
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -158,62 +162,6 @@ function Paragraph({
|
|
|
158
162
|
return /* @__PURE__ */ jsx2("p", { id, style, children: resolvedText });
|
|
159
163
|
}
|
|
160
164
|
|
|
161
|
-
// components/page/Button.tsx
|
|
162
|
-
import { sendGTMEvent } from "@next/third-parties/google";
|
|
163
|
-
|
|
164
|
-
// hooks/useUtmParams.ts
|
|
165
|
-
import { useEffect, useState } from "react";
|
|
166
|
-
function useUtmParams() {
|
|
167
|
-
const [utmParams, setUtmParams] = useState({});
|
|
168
|
-
useEffect(() => {
|
|
169
|
-
if (typeof window === "undefined") return;
|
|
170
|
-
const urlParams = new URLSearchParams(window.location.search);
|
|
171
|
-
const source = urlParams.get("utm_source");
|
|
172
|
-
const medium = urlParams.get("utm_medium");
|
|
173
|
-
const campaign = urlParams.get("utm_campaign");
|
|
174
|
-
const content = urlParams.get("utm_content");
|
|
175
|
-
const term = urlParams.get("utm_term");
|
|
176
|
-
const params = {};
|
|
177
|
-
if (source) {
|
|
178
|
-
params.source = source;
|
|
179
|
-
sessionStorage.setItem("utm_source", source);
|
|
180
|
-
} else {
|
|
181
|
-
const stored = sessionStorage.getItem("utm_source");
|
|
182
|
-
if (stored) params.source = stored;
|
|
183
|
-
}
|
|
184
|
-
if (medium) {
|
|
185
|
-
params.medium = medium;
|
|
186
|
-
sessionStorage.setItem("utm_medium", medium);
|
|
187
|
-
} else {
|
|
188
|
-
const stored = sessionStorage.getItem("utm_medium");
|
|
189
|
-
if (stored) params.medium = stored;
|
|
190
|
-
}
|
|
191
|
-
if (campaign) {
|
|
192
|
-
params.campaign = campaign;
|
|
193
|
-
sessionStorage.setItem("utm_campaign", campaign);
|
|
194
|
-
} else {
|
|
195
|
-
const stored = sessionStorage.getItem("utm_campaign");
|
|
196
|
-
if (stored) params.campaign = stored;
|
|
197
|
-
}
|
|
198
|
-
if (content) {
|
|
199
|
-
params.content = content;
|
|
200
|
-
sessionStorage.setItem("utm_content", content);
|
|
201
|
-
} else {
|
|
202
|
-
const stored = sessionStorage.getItem("utm_content");
|
|
203
|
-
if (stored) params.content = stored;
|
|
204
|
-
}
|
|
205
|
-
if (term) {
|
|
206
|
-
params.term = term;
|
|
207
|
-
sessionStorage.setItem("utm_term", term);
|
|
208
|
-
} else {
|
|
209
|
-
const stored = sessionStorage.getItem("utm_term");
|
|
210
|
-
if (stored) params.term = stored;
|
|
211
|
-
}
|
|
212
|
-
setUtmParams(params);
|
|
213
|
-
}, []);
|
|
214
|
-
return utmParams;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
165
|
// components/page/Button.tsx
|
|
218
166
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
219
167
|
var sizeStyles = {
|
|
@@ -251,6 +199,7 @@ function Button({
|
|
|
251
199
|
const { resolveColor: resolveColor2 } = useTheme();
|
|
252
200
|
const { getEntryValue } = useEntries();
|
|
253
201
|
const utm = useUtmParams();
|
|
202
|
+
const sendEvent = useGtmEvent();
|
|
254
203
|
const resolvedText = (() => {
|
|
255
204
|
if (!text) return "Button";
|
|
256
205
|
if (typeof text === "string") return text;
|
|
@@ -263,14 +212,13 @@ function Button({
|
|
|
263
212
|
return "Button";
|
|
264
213
|
})();
|
|
265
214
|
const handleClick = () => {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
}
|
|
215
|
+
const sessionId = typeof window !== "undefined" ? sessionStorage.getItem("session_id") : null;
|
|
216
|
+
sendEvent("button_click", {
|
|
217
|
+
text: resolvedText,
|
|
218
|
+
href: href || void 0,
|
|
219
|
+
variant,
|
|
220
|
+
session_id: sessionId,
|
|
221
|
+
...utm
|
|
274
222
|
});
|
|
275
223
|
};
|
|
276
224
|
const resolvedColor = (() => {
|
|
@@ -484,8 +432,7 @@ function Image({
|
|
|
484
432
|
}
|
|
485
433
|
|
|
486
434
|
// components/page/ImageCarousel.tsx
|
|
487
|
-
import { useState
|
|
488
|
-
import { sendGTMEvent as sendGTMEvent2 } from "@next/third-parties/google";
|
|
435
|
+
import { useState } from "react";
|
|
489
436
|
import { Fragment, jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
490
437
|
var aspectRatioMap2 = {
|
|
491
438
|
"16:9": "16 / 9",
|
|
@@ -512,9 +459,10 @@ function ImageCarousel({
|
|
|
512
459
|
dotColor,
|
|
513
460
|
id
|
|
514
461
|
}) {
|
|
515
|
-
const [currentIndex, setCurrentIndex] =
|
|
462
|
+
const [currentIndex, setCurrentIndex] = useState(0);
|
|
516
463
|
const { resolveColor: resolveColor2 } = useTheme();
|
|
517
464
|
const utm = useUtmParams();
|
|
465
|
+
const sendEvent = useGtmEvent();
|
|
518
466
|
const resolvedArrowColor = (() => {
|
|
519
467
|
if (!arrowColor) return { color: "#FFFFFF", opacity: 100 };
|
|
520
468
|
if (typeof arrowColor === "string")
|
|
@@ -537,39 +485,30 @@ function ImageCarousel({
|
|
|
537
485
|
const goToPrevious = () => {
|
|
538
486
|
const newIndex = currentIndex === 0 ? images.length - 1 : currentIndex - 1;
|
|
539
487
|
setCurrentIndex(newIndex);
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
totalSlides: images.length,
|
|
546
|
-
...utm
|
|
547
|
-
}
|
|
488
|
+
sendEvent("carousel_navigate", {
|
|
489
|
+
direction: "previous",
|
|
490
|
+
slideIndex: newIndex,
|
|
491
|
+
totalSlides: images.length,
|
|
492
|
+
...utm
|
|
548
493
|
});
|
|
549
494
|
};
|
|
550
495
|
const goToNext = () => {
|
|
551
496
|
const newIndex = currentIndex === images.length - 1 ? 0 : currentIndex + 1;
|
|
552
497
|
setCurrentIndex(newIndex);
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
totalSlides: images.length,
|
|
559
|
-
...utm
|
|
560
|
-
}
|
|
498
|
+
sendEvent("carousel_navigate", {
|
|
499
|
+
direction: "next",
|
|
500
|
+
slideIndex: newIndex,
|
|
501
|
+
totalSlides: images.length,
|
|
502
|
+
...utm
|
|
561
503
|
});
|
|
562
504
|
};
|
|
563
505
|
const goToSlide = (index) => {
|
|
564
506
|
setCurrentIndex(index);
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
totalSlides: images.length,
|
|
571
|
-
...utm
|
|
572
|
-
}
|
|
507
|
+
sendEvent("carousel_navigate", {
|
|
508
|
+
direction: "direct",
|
|
509
|
+
slideIndex: index,
|
|
510
|
+
totalSlides: images.length,
|
|
511
|
+
...utm
|
|
573
512
|
});
|
|
574
513
|
};
|
|
575
514
|
if (images.length === 0) {
|
|
@@ -1663,7 +1602,6 @@ function FeatureGrid({
|
|
|
1663
1602
|
|
|
1664
1603
|
// components/page/Footer.tsx
|
|
1665
1604
|
import { Facebook, Instagram, Twitter } from "lucide-react";
|
|
1666
|
-
import { sendGTMEvent as sendGTMEvent3 } from "@next/third-parties/google";
|
|
1667
1605
|
import { jsx as jsx18, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1668
1606
|
function Footer({
|
|
1669
1607
|
logo,
|
|
@@ -1677,6 +1615,7 @@ function Footer({
|
|
|
1677
1615
|
}) {
|
|
1678
1616
|
const DropZone = puck?.renderDropZone;
|
|
1679
1617
|
const utm = useUtmParams();
|
|
1618
|
+
const sendEvent = useGtmEvent();
|
|
1680
1619
|
const getSocialPlatform = (url) => {
|
|
1681
1620
|
if (url.includes("facebook")) return "facebook";
|
|
1682
1621
|
if (url.includes("instagram")) return "instagram";
|
|
@@ -1685,13 +1624,10 @@ function Footer({
|
|
|
1685
1624
|
};
|
|
1686
1625
|
const handleSocialClick = (url) => {
|
|
1687
1626
|
const platform = getSocialPlatform(url);
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
url,
|
|
1693
|
-
...utm
|
|
1694
|
-
}
|
|
1627
|
+
sendEvent("social_click", {
|
|
1628
|
+
platform,
|
|
1629
|
+
url,
|
|
1630
|
+
...utm
|
|
1695
1631
|
});
|
|
1696
1632
|
};
|
|
1697
1633
|
const socialLinks = [
|
|
@@ -1728,10 +1664,8 @@ function Footer({
|
|
|
1728
1664
|
}
|
|
1729
1665
|
|
|
1730
1666
|
// components/page/Topbar.tsx
|
|
1731
|
-
import { useState as
|
|
1732
|
-
import Link from "next/link";
|
|
1667
|
+
import { useState as useState2 } from "react";
|
|
1733
1668
|
import { Menu, X } from "lucide-react";
|
|
1734
|
-
import { sendGTMEvent as sendGTMEvent4 } from "@next/third-parties/google";
|
|
1735
1669
|
import { jsx as jsx19, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1736
1670
|
function Topbar({
|
|
1737
1671
|
logo,
|
|
@@ -1743,28 +1677,23 @@ function Topbar({
|
|
|
1743
1677
|
puck
|
|
1744
1678
|
}) {
|
|
1745
1679
|
const DropZone = puck?.renderDropZone;
|
|
1746
|
-
const [mobileMenuOpen, setMobileMenuOpen] =
|
|
1680
|
+
const [mobileMenuOpen, setMobileMenuOpen] = useState2(false);
|
|
1747
1681
|
const utm = useUtmParams();
|
|
1682
|
+
const sendEvent = useGtmEvent();
|
|
1748
1683
|
const handleNavClick = (item) => {
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
linkType: item.linkType || "internal",
|
|
1755
|
-
...utm
|
|
1756
|
-
}
|
|
1684
|
+
sendEvent("nav_click", {
|
|
1685
|
+
name: item.name,
|
|
1686
|
+
url: item.url,
|
|
1687
|
+
linkType: item.linkType || "internal",
|
|
1688
|
+
...utm
|
|
1757
1689
|
});
|
|
1758
1690
|
};
|
|
1759
1691
|
const handleMobileMenuToggle = () => {
|
|
1760
1692
|
const newState = !mobileMenuOpen;
|
|
1761
1693
|
setMobileMenuOpen(newState);
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
open: newState,
|
|
1766
|
-
...utm
|
|
1767
|
-
}
|
|
1694
|
+
sendEvent("mobile_menu_toggle", {
|
|
1695
|
+
open: newState,
|
|
1696
|
+
...utm
|
|
1768
1697
|
});
|
|
1769
1698
|
};
|
|
1770
1699
|
const renderLink = (item, index) => {
|
|
@@ -1796,7 +1725,7 @@ function Topbar({
|
|
|
1796
1725
|
);
|
|
1797
1726
|
}
|
|
1798
1727
|
return /* @__PURE__ */ jsx19(
|
|
1799
|
-
|
|
1728
|
+
"a",
|
|
1800
1729
|
{
|
|
1801
1730
|
href: item.url,
|
|
1802
1731
|
className,
|
|
@@ -1819,18 +1748,15 @@ function Topbar({
|
|
|
1819
1748
|
style: { maxWidth },
|
|
1820
1749
|
children: [
|
|
1821
1750
|
/* @__PURE__ */ jsx19(
|
|
1822
|
-
|
|
1751
|
+
"a",
|
|
1823
1752
|
{
|
|
1824
1753
|
href: logoUrl,
|
|
1825
1754
|
className: "flex-shrink-0",
|
|
1826
|
-
onClick: () =>
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
linkType: "internal",
|
|
1832
|
-
...utm
|
|
1833
|
-
}
|
|
1755
|
+
onClick: () => sendEvent("nav_click", {
|
|
1756
|
+
name: "logo",
|
|
1757
|
+
url: logoUrl,
|
|
1758
|
+
linkType: "internal",
|
|
1759
|
+
...utm
|
|
1834
1760
|
}),
|
|
1835
1761
|
children: logo ? /* @__PURE__ */ jsx19("img", { src: logo, alt: "Logo", className: "h-8" }) : /* @__PURE__ */ jsx19("span", { className: "text-xl font-bold", children: "Logo" })
|
|
1836
1762
|
}
|
|
@@ -1860,9 +1786,8 @@ function Topbar({
|
|
|
1860
1786
|
}
|
|
1861
1787
|
|
|
1862
1788
|
// components/page/Popup.tsx
|
|
1863
|
-
import { useState as
|
|
1789
|
+
import { useState as useState3 } from "react";
|
|
1864
1790
|
import { icons as icons4, X as X2 } from "lucide-react";
|
|
1865
|
-
import { sendGTMEvent as sendGTMEvent5 } from "@next/third-parties/google";
|
|
1866
1791
|
import { Fragment as Fragment2, jsx as jsx20, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1867
1792
|
function Icon2({ name, ...props }) {
|
|
1868
1793
|
const formatted = name.charAt(0).toUpperCase() + name.slice(1);
|
|
@@ -1891,25 +1816,20 @@ function Popup({
|
|
|
1891
1816
|
textLink = false,
|
|
1892
1817
|
puck
|
|
1893
1818
|
}) {
|
|
1894
|
-
const [isOpen, setIsOpen] =
|
|
1819
|
+
const [isOpen, setIsOpen] = useState3(false);
|
|
1895
1820
|
const utm = useUtmParams();
|
|
1821
|
+
const sendEvent = useGtmEvent();
|
|
1896
1822
|
const handleOpen = () => {
|
|
1897
1823
|
setIsOpen(true);
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
type: textLink ? "link" : "button",
|
|
1903
|
-
...utm
|
|
1904
|
-
}
|
|
1824
|
+
sendEvent("popup_open", {
|
|
1825
|
+
ctaText,
|
|
1826
|
+
type: textLink ? "link" : "button",
|
|
1827
|
+
...utm
|
|
1905
1828
|
});
|
|
1906
1829
|
};
|
|
1907
1830
|
const handleClose = () => {
|
|
1908
1831
|
setIsOpen(false);
|
|
1909
|
-
|
|
1910
|
-
event: "popup_close",
|
|
1911
|
-
value: { ctaText, ...utm }
|
|
1912
|
-
});
|
|
1832
|
+
sendEvent("popup_close", { ctaText, ...utm });
|
|
1913
1833
|
};
|
|
1914
1834
|
const trigger = textLink ? /* @__PURE__ */ jsx20(
|
|
1915
1835
|
"button",
|