@mission-studio/puck 1.0.2 → 1.0.3
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/{chunk-RVOG4KFI.mjs → chunk-F47J7QDM.mjs} +81 -63
- package/dist/config-entry.js +81 -63
- package/dist/config-entry.mjs +1 -1
- package/dist/index.js +81 -63
- package/dist/index.mjs +1 -1
- package/package.json +2 -1
|
@@ -158,21 +158,8 @@ function Paragraph({
|
|
|
158
158
|
return /* @__PURE__ */ jsx2("p", { id, style, children: resolvedText });
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
//
|
|
162
|
-
|
|
163
|
-
return (eventName, data) => {
|
|
164
|
-
if (typeof window === "undefined") return;
|
|
165
|
-
if (typeof window.gtag !== "function") {
|
|
166
|
-
console.warn("GTM not initialized. Make sure @next/third-parties/google GoogleTagManager is added to your layout.");
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
const eventData = {
|
|
170
|
-
event: eventName,
|
|
171
|
-
...data && { value: data }
|
|
172
|
-
};
|
|
173
|
-
window.gtag("event", eventName, data || {});
|
|
174
|
-
};
|
|
175
|
-
}
|
|
161
|
+
// components/page/Button.tsx
|
|
162
|
+
import { sendGTMEvent } from "@next/third-parties/google";
|
|
176
163
|
|
|
177
164
|
// hooks/useUtmParams.ts
|
|
178
165
|
import { useEffect, useState } from "react";
|
|
@@ -263,7 +250,6 @@ function Button({
|
|
|
263
250
|
}) {
|
|
264
251
|
const { resolveColor: resolveColor2 } = useTheme();
|
|
265
252
|
const { getEntryValue } = useEntries();
|
|
266
|
-
const sendEvent = useGtmEvent();
|
|
267
253
|
const utm = useUtmParams();
|
|
268
254
|
const resolvedText = (() => {
|
|
269
255
|
if (!text) return "Button";
|
|
@@ -277,11 +263,14 @@ function Button({
|
|
|
277
263
|
return "Button";
|
|
278
264
|
})();
|
|
279
265
|
const handleClick = () => {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
266
|
+
sendGTMEvent({
|
|
267
|
+
event: "button_click",
|
|
268
|
+
value: {
|
|
269
|
+
text: resolvedText,
|
|
270
|
+
href: href || void 0,
|
|
271
|
+
variant,
|
|
272
|
+
...utm
|
|
273
|
+
}
|
|
285
274
|
});
|
|
286
275
|
};
|
|
287
276
|
const resolvedColor = (() => {
|
|
@@ -496,6 +485,7 @@ function Image({
|
|
|
496
485
|
|
|
497
486
|
// components/page/ImageCarousel.tsx
|
|
498
487
|
import { useState as useState2 } from "react";
|
|
488
|
+
import { sendGTMEvent as sendGTMEvent2 } from "@next/third-parties/google";
|
|
499
489
|
import { Fragment, jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
500
490
|
var aspectRatioMap2 = {
|
|
501
491
|
"16:9": "16 / 9",
|
|
@@ -524,7 +514,6 @@ function ImageCarousel({
|
|
|
524
514
|
}) {
|
|
525
515
|
const [currentIndex, setCurrentIndex] = useState2(0);
|
|
526
516
|
const { resolveColor: resolveColor2 } = useTheme();
|
|
527
|
-
const sendEvent = useGtmEvent();
|
|
528
517
|
const utm = useUtmParams();
|
|
529
518
|
const resolvedArrowColor = (() => {
|
|
530
519
|
if (!arrowColor) return { color: "#FFFFFF", opacity: 100 };
|
|
@@ -548,30 +537,39 @@ function ImageCarousel({
|
|
|
548
537
|
const goToPrevious = () => {
|
|
549
538
|
const newIndex = currentIndex === 0 ? images.length - 1 : currentIndex - 1;
|
|
550
539
|
setCurrentIndex(newIndex);
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
540
|
+
sendGTMEvent2({
|
|
541
|
+
event: "carousel_navigate",
|
|
542
|
+
value: {
|
|
543
|
+
direction: "previous",
|
|
544
|
+
slideIndex: newIndex,
|
|
545
|
+
totalSlides: images.length,
|
|
546
|
+
...utm
|
|
547
|
+
}
|
|
556
548
|
});
|
|
557
549
|
};
|
|
558
550
|
const goToNext = () => {
|
|
559
551
|
const newIndex = currentIndex === images.length - 1 ? 0 : currentIndex + 1;
|
|
560
552
|
setCurrentIndex(newIndex);
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
553
|
+
sendGTMEvent2({
|
|
554
|
+
event: "carousel_navigate",
|
|
555
|
+
value: {
|
|
556
|
+
direction: "next",
|
|
557
|
+
slideIndex: newIndex,
|
|
558
|
+
totalSlides: images.length,
|
|
559
|
+
...utm
|
|
560
|
+
}
|
|
566
561
|
});
|
|
567
562
|
};
|
|
568
563
|
const goToSlide = (index) => {
|
|
569
564
|
setCurrentIndex(index);
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
565
|
+
sendGTMEvent2({
|
|
566
|
+
event: "carousel_navigate",
|
|
567
|
+
value: {
|
|
568
|
+
direction: "direct",
|
|
569
|
+
slideIndex: index,
|
|
570
|
+
totalSlides: images.length,
|
|
571
|
+
...utm
|
|
572
|
+
}
|
|
575
573
|
});
|
|
576
574
|
};
|
|
577
575
|
if (images.length === 0) {
|
|
@@ -1665,6 +1663,7 @@ function FeatureGrid({
|
|
|
1665
1663
|
|
|
1666
1664
|
// components/page/Footer.tsx
|
|
1667
1665
|
import { Facebook, Instagram, Twitter } from "lucide-react";
|
|
1666
|
+
import { sendGTMEvent as sendGTMEvent3 } from "@next/third-parties/google";
|
|
1668
1667
|
import { jsx as jsx18, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1669
1668
|
function Footer({
|
|
1670
1669
|
logo,
|
|
@@ -1677,7 +1676,6 @@ function Footer({
|
|
|
1677
1676
|
puck
|
|
1678
1677
|
}) {
|
|
1679
1678
|
const DropZone = puck?.renderDropZone;
|
|
1680
|
-
const sendEvent = useGtmEvent();
|
|
1681
1679
|
const utm = useUtmParams();
|
|
1682
1680
|
const getSocialPlatform = (url) => {
|
|
1683
1681
|
if (url.includes("facebook")) return "facebook";
|
|
@@ -1687,17 +1685,22 @@ function Footer({
|
|
|
1687
1685
|
};
|
|
1688
1686
|
const handleSocialClick = (url) => {
|
|
1689
1687
|
const platform = getSocialPlatform(url);
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1688
|
+
sendGTMEvent3({
|
|
1689
|
+
event: "social_click",
|
|
1690
|
+
value: {
|
|
1691
|
+
platform,
|
|
1692
|
+
url,
|
|
1693
|
+
...utm
|
|
1694
|
+
}
|
|
1694
1695
|
});
|
|
1695
1696
|
};
|
|
1696
1697
|
const socialLinks = [
|
|
1697
1698
|
{ url: facebookUrl, Icon: Facebook },
|
|
1698
1699
|
{ url: instagramUrl, Icon: Instagram },
|
|
1699
1700
|
{ url: twitterUrl, Icon: Twitter }
|
|
1700
|
-
].filter(
|
|
1701
|
+
].filter(
|
|
1702
|
+
(link) => !!link.url
|
|
1703
|
+
);
|
|
1701
1704
|
return /* @__PURE__ */ jsx18(
|
|
1702
1705
|
"footer",
|
|
1703
1706
|
{
|
|
@@ -1728,6 +1731,7 @@ function Footer({
|
|
|
1728
1731
|
import { useState as useState3 } from "react";
|
|
1729
1732
|
import Link from "next/link";
|
|
1730
1733
|
import { Menu, X } from "lucide-react";
|
|
1734
|
+
import { sendGTMEvent as sendGTMEvent4 } from "@next/third-parties/google";
|
|
1731
1735
|
import { jsx as jsx19, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1732
1736
|
function Topbar({
|
|
1733
1737
|
logo,
|
|
@@ -1740,22 +1744,27 @@ function Topbar({
|
|
|
1740
1744
|
}) {
|
|
1741
1745
|
const DropZone = puck?.renderDropZone;
|
|
1742
1746
|
const [mobileMenuOpen, setMobileMenuOpen] = useState3(false);
|
|
1743
|
-
const sendEvent = useGtmEvent();
|
|
1744
1747
|
const utm = useUtmParams();
|
|
1745
1748
|
const handleNavClick = (item) => {
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1749
|
+
sendGTMEvent4({
|
|
1750
|
+
event: "nav_click",
|
|
1751
|
+
value: {
|
|
1752
|
+
name: item.name,
|
|
1753
|
+
url: item.url,
|
|
1754
|
+
linkType: item.linkType || "internal",
|
|
1755
|
+
...utm
|
|
1756
|
+
}
|
|
1751
1757
|
});
|
|
1752
1758
|
};
|
|
1753
1759
|
const handleMobileMenuToggle = () => {
|
|
1754
1760
|
const newState = !mobileMenuOpen;
|
|
1755
1761
|
setMobileMenuOpen(newState);
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1762
|
+
sendGTMEvent4({
|
|
1763
|
+
event: "mobile_menu_toggle",
|
|
1764
|
+
value: {
|
|
1765
|
+
open: newState,
|
|
1766
|
+
...utm
|
|
1767
|
+
}
|
|
1759
1768
|
});
|
|
1760
1769
|
};
|
|
1761
1770
|
const renderLink = (item, index) => {
|
|
@@ -1814,11 +1823,14 @@ function Topbar({
|
|
|
1814
1823
|
{
|
|
1815
1824
|
href: logoUrl,
|
|
1816
1825
|
className: "flex-shrink-0",
|
|
1817
|
-
onClick: () =>
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1826
|
+
onClick: () => sendGTMEvent4({
|
|
1827
|
+
event: "nav_click",
|
|
1828
|
+
value: {
|
|
1829
|
+
name: "logo",
|
|
1830
|
+
url: logoUrl,
|
|
1831
|
+
linkType: "internal",
|
|
1832
|
+
...utm
|
|
1833
|
+
}
|
|
1822
1834
|
}),
|
|
1823
1835
|
children: logo ? /* @__PURE__ */ jsx19("img", { src: logo, alt: "Logo", className: "h-8" }) : /* @__PURE__ */ jsx19("span", { className: "text-xl font-bold", children: "Logo" })
|
|
1824
1836
|
}
|
|
@@ -1850,6 +1862,7 @@ function Topbar({
|
|
|
1850
1862
|
// components/page/Popup.tsx
|
|
1851
1863
|
import { useState as useState4 } from "react";
|
|
1852
1864
|
import { icons as icons4, X as X2 } from "lucide-react";
|
|
1865
|
+
import { sendGTMEvent as sendGTMEvent5 } from "@next/third-parties/google";
|
|
1853
1866
|
import { Fragment as Fragment2, jsx as jsx20, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1854
1867
|
function Icon2({ name, ...props }) {
|
|
1855
1868
|
const formatted = name.charAt(0).toUpperCase() + name.slice(1);
|
|
@@ -1879,19 +1892,24 @@ function Popup({
|
|
|
1879
1892
|
puck
|
|
1880
1893
|
}) {
|
|
1881
1894
|
const [isOpen, setIsOpen] = useState4(false);
|
|
1882
|
-
const sendEvent = useGtmEvent();
|
|
1883
1895
|
const utm = useUtmParams();
|
|
1884
1896
|
const handleOpen = () => {
|
|
1885
1897
|
setIsOpen(true);
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1898
|
+
sendGTMEvent5({
|
|
1899
|
+
event: "popup_open",
|
|
1900
|
+
value: {
|
|
1901
|
+
ctaText,
|
|
1902
|
+
type: textLink ? "link" : "button",
|
|
1903
|
+
...utm
|
|
1904
|
+
}
|
|
1890
1905
|
});
|
|
1891
1906
|
};
|
|
1892
1907
|
const handleClose = () => {
|
|
1893
1908
|
setIsOpen(false);
|
|
1894
|
-
|
|
1909
|
+
sendGTMEvent5({
|
|
1910
|
+
event: "popup_close",
|
|
1911
|
+
value: { ctaText, ...utm }
|
|
1912
|
+
});
|
|
1895
1913
|
};
|
|
1896
1914
|
const trigger = textLink ? /* @__PURE__ */ jsx20(
|
|
1897
1915
|
"button",
|
package/dist/config-entry.js
CHANGED
|
@@ -292,21 +292,8 @@ function Paragraph({
|
|
|
292
292
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { id, style, children: resolvedText });
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
-
//
|
|
296
|
-
|
|
297
|
-
return (eventName, data) => {
|
|
298
|
-
if (typeof window === "undefined") return;
|
|
299
|
-
if (typeof window.gtag !== "function") {
|
|
300
|
-
console.warn("GTM not initialized. Make sure @next/third-parties/google GoogleTagManager is added to your layout.");
|
|
301
|
-
return;
|
|
302
|
-
}
|
|
303
|
-
const eventData = {
|
|
304
|
-
event: eventName,
|
|
305
|
-
...data && { value: data }
|
|
306
|
-
};
|
|
307
|
-
window.gtag("event", eventName, data || {});
|
|
308
|
-
};
|
|
309
|
-
}
|
|
295
|
+
// components/page/Button.tsx
|
|
296
|
+
var import_google = require("@next/third-parties/google");
|
|
310
297
|
|
|
311
298
|
// hooks/useUtmParams.ts
|
|
312
299
|
var import_react3 = require("react");
|
|
@@ -397,7 +384,6 @@ function Button({
|
|
|
397
384
|
}) {
|
|
398
385
|
const { resolveColor: resolveColor2 } = useTheme();
|
|
399
386
|
const { getEntryValue } = useEntries();
|
|
400
|
-
const sendEvent = useGtmEvent();
|
|
401
387
|
const utm = useUtmParams();
|
|
402
388
|
const resolvedText = (() => {
|
|
403
389
|
if (!text) return "Button";
|
|
@@ -411,11 +397,14 @@ function Button({
|
|
|
411
397
|
return "Button";
|
|
412
398
|
})();
|
|
413
399
|
const handleClick = () => {
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
400
|
+
(0, import_google.sendGTMEvent)({
|
|
401
|
+
event: "button_click",
|
|
402
|
+
value: {
|
|
403
|
+
text: resolvedText,
|
|
404
|
+
href: href || void 0,
|
|
405
|
+
variant,
|
|
406
|
+
...utm
|
|
407
|
+
}
|
|
419
408
|
});
|
|
420
409
|
};
|
|
421
410
|
const resolvedColor = (() => {
|
|
@@ -630,6 +619,7 @@ function Image({
|
|
|
630
619
|
|
|
631
620
|
// components/page/ImageCarousel.tsx
|
|
632
621
|
var import_react4 = require("react");
|
|
622
|
+
var import_google2 = require("@next/third-parties/google");
|
|
633
623
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
634
624
|
var aspectRatioMap2 = {
|
|
635
625
|
"16:9": "16 / 9",
|
|
@@ -658,7 +648,6 @@ function ImageCarousel({
|
|
|
658
648
|
}) {
|
|
659
649
|
const [currentIndex, setCurrentIndex] = (0, import_react4.useState)(0);
|
|
660
650
|
const { resolveColor: resolveColor2 } = useTheme();
|
|
661
|
-
const sendEvent = useGtmEvent();
|
|
662
651
|
const utm = useUtmParams();
|
|
663
652
|
const resolvedArrowColor = (() => {
|
|
664
653
|
if (!arrowColor) return { color: "#FFFFFF", opacity: 100 };
|
|
@@ -682,30 +671,39 @@ function ImageCarousel({
|
|
|
682
671
|
const goToPrevious = () => {
|
|
683
672
|
const newIndex = currentIndex === 0 ? images.length - 1 : currentIndex - 1;
|
|
684
673
|
setCurrentIndex(newIndex);
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
674
|
+
(0, import_google2.sendGTMEvent)({
|
|
675
|
+
event: "carousel_navigate",
|
|
676
|
+
value: {
|
|
677
|
+
direction: "previous",
|
|
678
|
+
slideIndex: newIndex,
|
|
679
|
+
totalSlides: images.length,
|
|
680
|
+
...utm
|
|
681
|
+
}
|
|
690
682
|
});
|
|
691
683
|
};
|
|
692
684
|
const goToNext = () => {
|
|
693
685
|
const newIndex = currentIndex === images.length - 1 ? 0 : currentIndex + 1;
|
|
694
686
|
setCurrentIndex(newIndex);
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
687
|
+
(0, import_google2.sendGTMEvent)({
|
|
688
|
+
event: "carousel_navigate",
|
|
689
|
+
value: {
|
|
690
|
+
direction: "next",
|
|
691
|
+
slideIndex: newIndex,
|
|
692
|
+
totalSlides: images.length,
|
|
693
|
+
...utm
|
|
694
|
+
}
|
|
700
695
|
});
|
|
701
696
|
};
|
|
702
697
|
const goToSlide = (index2) => {
|
|
703
698
|
setCurrentIndex(index2);
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
699
|
+
(0, import_google2.sendGTMEvent)({
|
|
700
|
+
event: "carousel_navigate",
|
|
701
|
+
value: {
|
|
702
|
+
direction: "direct",
|
|
703
|
+
slideIndex: index2,
|
|
704
|
+
totalSlides: images.length,
|
|
705
|
+
...utm
|
|
706
|
+
}
|
|
709
707
|
});
|
|
710
708
|
};
|
|
711
709
|
if (images.length === 0) {
|
|
@@ -1835,6 +1833,7 @@ function FeatureGrid({
|
|
|
1835
1833
|
|
|
1836
1834
|
// components/page/Footer.tsx
|
|
1837
1835
|
var import_lucide_react3 = require("lucide-react");
|
|
1836
|
+
var import_google3 = require("@next/third-parties/google");
|
|
1838
1837
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1839
1838
|
function Footer({
|
|
1840
1839
|
logo,
|
|
@@ -1847,7 +1846,6 @@ function Footer({
|
|
|
1847
1846
|
puck
|
|
1848
1847
|
}) {
|
|
1849
1848
|
const DropZone = puck?.renderDropZone;
|
|
1850
|
-
const sendEvent = useGtmEvent();
|
|
1851
1849
|
const utm = useUtmParams();
|
|
1852
1850
|
const getSocialPlatform = (url) => {
|
|
1853
1851
|
if (url.includes("facebook")) return "facebook";
|
|
@@ -1857,17 +1855,22 @@ function Footer({
|
|
|
1857
1855
|
};
|
|
1858
1856
|
const handleSocialClick = (url) => {
|
|
1859
1857
|
const platform2 = getSocialPlatform(url);
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1858
|
+
(0, import_google3.sendGTMEvent)({
|
|
1859
|
+
event: "social_click",
|
|
1860
|
+
value: {
|
|
1861
|
+
platform: platform2,
|
|
1862
|
+
url,
|
|
1863
|
+
...utm
|
|
1864
|
+
}
|
|
1864
1865
|
});
|
|
1865
1866
|
};
|
|
1866
1867
|
const socialLinks = [
|
|
1867
1868
|
{ url: facebookUrl, Icon: import_lucide_react3.Facebook },
|
|
1868
1869
|
{ url: instagramUrl, Icon: import_lucide_react3.Instagram },
|
|
1869
1870
|
{ url: twitterUrl, Icon: import_lucide_react3.Twitter }
|
|
1870
|
-
].filter(
|
|
1871
|
+
].filter(
|
|
1872
|
+
(link) => !!link.url
|
|
1873
|
+
);
|
|
1871
1874
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1872
1875
|
"footer",
|
|
1873
1876
|
{
|
|
@@ -1898,6 +1901,7 @@ function Footer({
|
|
|
1898
1901
|
var import_react5 = require("react");
|
|
1899
1902
|
var import_link = __toESM(require("next/link"));
|
|
1900
1903
|
var import_lucide_react4 = require("lucide-react");
|
|
1904
|
+
var import_google4 = require("@next/third-parties/google");
|
|
1901
1905
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1902
1906
|
function Topbar({
|
|
1903
1907
|
logo,
|
|
@@ -1910,22 +1914,27 @@ function Topbar({
|
|
|
1910
1914
|
}) {
|
|
1911
1915
|
const DropZone = puck?.renderDropZone;
|
|
1912
1916
|
const [mobileMenuOpen, setMobileMenuOpen] = (0, import_react5.useState)(false);
|
|
1913
|
-
const sendEvent = useGtmEvent();
|
|
1914
1917
|
const utm = useUtmParams();
|
|
1915
1918
|
const handleNavClick = (item) => {
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1919
|
+
(0, import_google4.sendGTMEvent)({
|
|
1920
|
+
event: "nav_click",
|
|
1921
|
+
value: {
|
|
1922
|
+
name: item.name,
|
|
1923
|
+
url: item.url,
|
|
1924
|
+
linkType: item.linkType || "internal",
|
|
1925
|
+
...utm
|
|
1926
|
+
}
|
|
1921
1927
|
});
|
|
1922
1928
|
};
|
|
1923
1929
|
const handleMobileMenuToggle = () => {
|
|
1924
1930
|
const newState = !mobileMenuOpen;
|
|
1925
1931
|
setMobileMenuOpen(newState);
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1932
|
+
(0, import_google4.sendGTMEvent)({
|
|
1933
|
+
event: "mobile_menu_toggle",
|
|
1934
|
+
value: {
|
|
1935
|
+
open: newState,
|
|
1936
|
+
...utm
|
|
1937
|
+
}
|
|
1929
1938
|
});
|
|
1930
1939
|
};
|
|
1931
1940
|
const renderLink = (item, index2) => {
|
|
@@ -1984,11 +1993,14 @@ function Topbar({
|
|
|
1984
1993
|
{
|
|
1985
1994
|
href: logoUrl,
|
|
1986
1995
|
className: "flex-shrink-0",
|
|
1987
|
-
onClick: () =>
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1996
|
+
onClick: () => (0, import_google4.sendGTMEvent)({
|
|
1997
|
+
event: "nav_click",
|
|
1998
|
+
value: {
|
|
1999
|
+
name: "logo",
|
|
2000
|
+
url: logoUrl,
|
|
2001
|
+
linkType: "internal",
|
|
2002
|
+
...utm
|
|
2003
|
+
}
|
|
1992
2004
|
}),
|
|
1993
2005
|
children: logo ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("img", { src: logo, alt: "Logo", className: "h-8" }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-xl font-bold", children: "Logo" })
|
|
1994
2006
|
}
|
|
@@ -2020,6 +2032,7 @@ function Topbar({
|
|
|
2020
2032
|
// components/page/Popup.tsx
|
|
2021
2033
|
var import_react6 = require("react");
|
|
2022
2034
|
var import_lucide_react5 = require("lucide-react");
|
|
2035
|
+
var import_google5 = require("@next/third-parties/google");
|
|
2023
2036
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2024
2037
|
function Icon2({ name, ...props }) {
|
|
2025
2038
|
const formatted = name.charAt(0).toUpperCase() + name.slice(1);
|
|
@@ -2049,19 +2062,24 @@ function Popup({
|
|
|
2049
2062
|
puck
|
|
2050
2063
|
}) {
|
|
2051
2064
|
const [isOpen, setIsOpen] = (0, import_react6.useState)(false);
|
|
2052
|
-
const sendEvent = useGtmEvent();
|
|
2053
2065
|
const utm = useUtmParams();
|
|
2054
2066
|
const handleOpen = () => {
|
|
2055
2067
|
setIsOpen(true);
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2068
|
+
(0, import_google5.sendGTMEvent)({
|
|
2069
|
+
event: "popup_open",
|
|
2070
|
+
value: {
|
|
2071
|
+
ctaText,
|
|
2072
|
+
type: textLink ? "link" : "button",
|
|
2073
|
+
...utm
|
|
2074
|
+
}
|
|
2060
2075
|
});
|
|
2061
2076
|
};
|
|
2062
2077
|
const handleClose = () => {
|
|
2063
2078
|
setIsOpen(false);
|
|
2064
|
-
|
|
2079
|
+
(0, import_google5.sendGTMEvent)({
|
|
2080
|
+
event: "popup_close",
|
|
2081
|
+
value: { ctaText, ...utm }
|
|
2082
|
+
});
|
|
2065
2083
|
};
|
|
2066
2084
|
const trigger = textLink ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2067
2085
|
"button",
|
package/dist/config-entry.mjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -332,21 +332,8 @@ function Paragraph({
|
|
|
332
332
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { id, style, children: resolvedText });
|
|
333
333
|
}
|
|
334
334
|
|
|
335
|
-
//
|
|
336
|
-
|
|
337
|
-
return (eventName, data) => {
|
|
338
|
-
if (typeof window === "undefined") return;
|
|
339
|
-
if (typeof window.gtag !== "function") {
|
|
340
|
-
console.warn("GTM not initialized. Make sure @next/third-parties/google GoogleTagManager is added to your layout.");
|
|
341
|
-
return;
|
|
342
|
-
}
|
|
343
|
-
const eventData = {
|
|
344
|
-
event: eventName,
|
|
345
|
-
...data && { value: data }
|
|
346
|
-
};
|
|
347
|
-
window.gtag("event", eventName, data || {});
|
|
348
|
-
};
|
|
349
|
-
}
|
|
335
|
+
// components/page/Button.tsx
|
|
336
|
+
var import_google = require("@next/third-parties/google");
|
|
350
337
|
|
|
351
338
|
// hooks/useUtmParams.ts
|
|
352
339
|
var import_react3 = require("react");
|
|
@@ -437,7 +424,6 @@ function Button({
|
|
|
437
424
|
}) {
|
|
438
425
|
const { resolveColor: resolveColor2 } = useTheme();
|
|
439
426
|
const { getEntryValue } = useEntries();
|
|
440
|
-
const sendEvent = useGtmEvent();
|
|
441
427
|
const utm = useUtmParams();
|
|
442
428
|
const resolvedText = (() => {
|
|
443
429
|
if (!text) return "Button";
|
|
@@ -451,11 +437,14 @@ function Button({
|
|
|
451
437
|
return "Button";
|
|
452
438
|
})();
|
|
453
439
|
const handleClick = () => {
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
440
|
+
(0, import_google.sendGTMEvent)({
|
|
441
|
+
event: "button_click",
|
|
442
|
+
value: {
|
|
443
|
+
text: resolvedText,
|
|
444
|
+
href: href || void 0,
|
|
445
|
+
variant,
|
|
446
|
+
...utm
|
|
447
|
+
}
|
|
459
448
|
});
|
|
460
449
|
};
|
|
461
450
|
const resolvedColor = (() => {
|
|
@@ -670,6 +659,7 @@ function Image({
|
|
|
670
659
|
|
|
671
660
|
// components/page/ImageCarousel.tsx
|
|
672
661
|
var import_react4 = require("react");
|
|
662
|
+
var import_google2 = require("@next/third-parties/google");
|
|
673
663
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
674
664
|
var aspectRatioMap2 = {
|
|
675
665
|
"16:9": "16 / 9",
|
|
@@ -698,7 +688,6 @@ function ImageCarousel({
|
|
|
698
688
|
}) {
|
|
699
689
|
const [currentIndex, setCurrentIndex] = (0, import_react4.useState)(0);
|
|
700
690
|
const { resolveColor: resolveColor2 } = useTheme();
|
|
701
|
-
const sendEvent = useGtmEvent();
|
|
702
691
|
const utm = useUtmParams();
|
|
703
692
|
const resolvedArrowColor = (() => {
|
|
704
693
|
if (!arrowColor) return { color: "#FFFFFF", opacity: 100 };
|
|
@@ -722,30 +711,39 @@ function ImageCarousel({
|
|
|
722
711
|
const goToPrevious = () => {
|
|
723
712
|
const newIndex = currentIndex === 0 ? images.length - 1 : currentIndex - 1;
|
|
724
713
|
setCurrentIndex(newIndex);
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
714
|
+
(0, import_google2.sendGTMEvent)({
|
|
715
|
+
event: "carousel_navigate",
|
|
716
|
+
value: {
|
|
717
|
+
direction: "previous",
|
|
718
|
+
slideIndex: newIndex,
|
|
719
|
+
totalSlides: images.length,
|
|
720
|
+
...utm
|
|
721
|
+
}
|
|
730
722
|
});
|
|
731
723
|
};
|
|
732
724
|
const goToNext = () => {
|
|
733
725
|
const newIndex = currentIndex === images.length - 1 ? 0 : currentIndex + 1;
|
|
734
726
|
setCurrentIndex(newIndex);
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
727
|
+
(0, import_google2.sendGTMEvent)({
|
|
728
|
+
event: "carousel_navigate",
|
|
729
|
+
value: {
|
|
730
|
+
direction: "next",
|
|
731
|
+
slideIndex: newIndex,
|
|
732
|
+
totalSlides: images.length,
|
|
733
|
+
...utm
|
|
734
|
+
}
|
|
740
735
|
});
|
|
741
736
|
};
|
|
742
737
|
const goToSlide = (index) => {
|
|
743
738
|
setCurrentIndex(index);
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
739
|
+
(0, import_google2.sendGTMEvent)({
|
|
740
|
+
event: "carousel_navigate",
|
|
741
|
+
value: {
|
|
742
|
+
direction: "direct",
|
|
743
|
+
slideIndex: index,
|
|
744
|
+
totalSlides: images.length,
|
|
745
|
+
...utm
|
|
746
|
+
}
|
|
749
747
|
});
|
|
750
748
|
};
|
|
751
749
|
if (images.length === 0) {
|
|
@@ -1875,6 +1873,7 @@ function FeatureGrid({
|
|
|
1875
1873
|
|
|
1876
1874
|
// components/page/Footer.tsx
|
|
1877
1875
|
var import_lucide_react3 = require("lucide-react");
|
|
1876
|
+
var import_google3 = require("@next/third-parties/google");
|
|
1878
1877
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1879
1878
|
function Footer({
|
|
1880
1879
|
logo,
|
|
@@ -1887,7 +1886,6 @@ function Footer({
|
|
|
1887
1886
|
puck
|
|
1888
1887
|
}) {
|
|
1889
1888
|
const DropZone = puck?.renderDropZone;
|
|
1890
|
-
const sendEvent = useGtmEvent();
|
|
1891
1889
|
const utm = useUtmParams();
|
|
1892
1890
|
const getSocialPlatform = (url) => {
|
|
1893
1891
|
if (url.includes("facebook")) return "facebook";
|
|
@@ -1897,17 +1895,22 @@ function Footer({
|
|
|
1897
1895
|
};
|
|
1898
1896
|
const handleSocialClick = (url) => {
|
|
1899
1897
|
const platform = getSocialPlatform(url);
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1898
|
+
(0, import_google3.sendGTMEvent)({
|
|
1899
|
+
event: "social_click",
|
|
1900
|
+
value: {
|
|
1901
|
+
platform,
|
|
1902
|
+
url,
|
|
1903
|
+
...utm
|
|
1904
|
+
}
|
|
1904
1905
|
});
|
|
1905
1906
|
};
|
|
1906
1907
|
const socialLinks = [
|
|
1907
1908
|
{ url: facebookUrl, Icon: import_lucide_react3.Facebook },
|
|
1908
1909
|
{ url: instagramUrl, Icon: import_lucide_react3.Instagram },
|
|
1909
1910
|
{ url: twitterUrl, Icon: import_lucide_react3.Twitter }
|
|
1910
|
-
].filter(
|
|
1911
|
+
].filter(
|
|
1912
|
+
(link) => !!link.url
|
|
1913
|
+
);
|
|
1911
1914
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1912
1915
|
"footer",
|
|
1913
1916
|
{
|
|
@@ -1938,6 +1941,7 @@ function Footer({
|
|
|
1938
1941
|
var import_react5 = require("react");
|
|
1939
1942
|
var import_link = __toESM(require("next/link"));
|
|
1940
1943
|
var import_lucide_react4 = require("lucide-react");
|
|
1944
|
+
var import_google4 = require("@next/third-parties/google");
|
|
1941
1945
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1942
1946
|
function Topbar({
|
|
1943
1947
|
logo,
|
|
@@ -1950,22 +1954,27 @@ function Topbar({
|
|
|
1950
1954
|
}) {
|
|
1951
1955
|
const DropZone = puck?.renderDropZone;
|
|
1952
1956
|
const [mobileMenuOpen, setMobileMenuOpen] = (0, import_react5.useState)(false);
|
|
1953
|
-
const sendEvent = useGtmEvent();
|
|
1954
1957
|
const utm = useUtmParams();
|
|
1955
1958
|
const handleNavClick = (item) => {
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1959
|
+
(0, import_google4.sendGTMEvent)({
|
|
1960
|
+
event: "nav_click",
|
|
1961
|
+
value: {
|
|
1962
|
+
name: item.name,
|
|
1963
|
+
url: item.url,
|
|
1964
|
+
linkType: item.linkType || "internal",
|
|
1965
|
+
...utm
|
|
1966
|
+
}
|
|
1961
1967
|
});
|
|
1962
1968
|
};
|
|
1963
1969
|
const handleMobileMenuToggle = () => {
|
|
1964
1970
|
const newState = !mobileMenuOpen;
|
|
1965
1971
|
setMobileMenuOpen(newState);
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1972
|
+
(0, import_google4.sendGTMEvent)({
|
|
1973
|
+
event: "mobile_menu_toggle",
|
|
1974
|
+
value: {
|
|
1975
|
+
open: newState,
|
|
1976
|
+
...utm
|
|
1977
|
+
}
|
|
1969
1978
|
});
|
|
1970
1979
|
};
|
|
1971
1980
|
const renderLink = (item, index) => {
|
|
@@ -2024,11 +2033,14 @@ function Topbar({
|
|
|
2024
2033
|
{
|
|
2025
2034
|
href: logoUrl,
|
|
2026
2035
|
className: "flex-shrink-0",
|
|
2027
|
-
onClick: () =>
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2036
|
+
onClick: () => (0, import_google4.sendGTMEvent)({
|
|
2037
|
+
event: "nav_click",
|
|
2038
|
+
value: {
|
|
2039
|
+
name: "logo",
|
|
2040
|
+
url: logoUrl,
|
|
2041
|
+
linkType: "internal",
|
|
2042
|
+
...utm
|
|
2043
|
+
}
|
|
2032
2044
|
}),
|
|
2033
2045
|
children: logo ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("img", { src: logo, alt: "Logo", className: "h-8" }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-xl font-bold", children: "Logo" })
|
|
2034
2046
|
}
|
|
@@ -2060,6 +2072,7 @@ function Topbar({
|
|
|
2060
2072
|
// components/page/Popup.tsx
|
|
2061
2073
|
var import_react6 = require("react");
|
|
2062
2074
|
var import_lucide_react5 = require("lucide-react");
|
|
2075
|
+
var import_google5 = require("@next/third-parties/google");
|
|
2063
2076
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2064
2077
|
function Icon2({ name, ...props }) {
|
|
2065
2078
|
const formatted = name.charAt(0).toUpperCase() + name.slice(1);
|
|
@@ -2089,19 +2102,24 @@ function Popup({
|
|
|
2089
2102
|
puck
|
|
2090
2103
|
}) {
|
|
2091
2104
|
const [isOpen, setIsOpen] = (0, import_react6.useState)(false);
|
|
2092
|
-
const sendEvent = useGtmEvent();
|
|
2093
2105
|
const utm = useUtmParams();
|
|
2094
2106
|
const handleOpen = () => {
|
|
2095
2107
|
setIsOpen(true);
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2108
|
+
(0, import_google5.sendGTMEvent)({
|
|
2109
|
+
event: "popup_open",
|
|
2110
|
+
value: {
|
|
2111
|
+
ctaText,
|
|
2112
|
+
type: textLink ? "link" : "button",
|
|
2113
|
+
...utm
|
|
2114
|
+
}
|
|
2100
2115
|
});
|
|
2101
2116
|
};
|
|
2102
2117
|
const handleClose = () => {
|
|
2103
2118
|
setIsOpen(false);
|
|
2104
|
-
|
|
2119
|
+
(0, import_google5.sendGTMEvent)({
|
|
2120
|
+
event: "popup_close",
|
|
2121
|
+
value: { ctaText, ...utm }
|
|
2122
|
+
});
|
|
2105
2123
|
};
|
|
2106
2124
|
const trigger = textLink ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2107
2125
|
"button",
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mission-studio/puck",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "A collection of puck components and configurations for internal use at Mission Studio.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@measured/puck": "^0.20.2",
|
|
55
|
+
"@next/third-parties": "^16.1.6",
|
|
55
56
|
"@radix-ui/react-label": "^2.1.8",
|
|
56
57
|
"@radix-ui/react-slot": "^1.2.4",
|
|
57
58
|
"@tailwindcss/postcss": "^4.1.18",
|