@xylabs/sdk-react 2.9.36 → 2.10.1
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/cjs5/components/BasePage/BasePageProps.d.ts +0 -2
- package/dist/cjs5/contexts/UserEvents/{Loader.d.ts → Provider.d.ts} +1 -1
- package/dist/cjs5/contexts/UserEvents/index.d.ts +1 -1
- package/dist/cjs5/index.js +109 -74
- package/dist/cjs5/index.js.map +1 -1
- package/dist/cjs5/lib/Tracking/Facebook/index.d.ts +1 -0
- package/dist/cjs5/lib/Tracking/XyoUserEventHandler.d.ts +3 -1
- package/dist/components/Background.js +1 -0
- package/dist/components/Background.js.map +1 -1
- package/dist/components/BasePage/BasePage.js +2 -2
- package/dist/components/BasePage/BasePage.js.map +1 -1
- package/dist/components/BasePage/BasePage.stories.js +0 -2
- package/dist/components/BasePage/BasePage.stories.js.map +1 -1
- package/dist/components/BasePage/BasePageProps.d.ts +0 -2
- package/dist/components/InvertableThemeProvider/InvertableThemeProvider.js +3 -1
- package/dist/components/InvertableThemeProvider/InvertableThemeProvider.js.map +1 -1
- package/dist/components/LinkEx/LinkToEx.js +1 -0
- package/dist/components/LinkEx/LinkToEx.js.map +1 -1
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/contexts/UserEvents/{Loader.d.ts → Provider.d.ts} +1 -1
- package/dist/contexts/UserEvents/Provider.js +7 -0
- package/dist/contexts/UserEvents/Provider.js.map +1 -0
- package/dist/contexts/UserEvents/index.d.ts +1 -1
- package/dist/contexts/UserEvents/index.js +1 -1
- package/dist/contexts/UserEvents/index.js.map +1 -1
- package/dist/esm2015/components/BasePage/BasePageProps.d.ts +0 -2
- package/dist/esm2015/contexts/UserEvents/{Loader.d.ts → Provider.d.ts} +1 -1
- package/dist/esm2015/contexts/UserEvents/index.d.ts +1 -1
- package/dist/esm2015/index.js +109 -75
- package/dist/esm2015/index.js.map +1 -1
- package/dist/esm2015/lib/Tracking/Facebook/index.d.ts +1 -0
- package/dist/esm2015/lib/Tracking/XyoUserEventHandler.d.ts +3 -1
- package/dist/esm2017/components/BasePage/BasePageProps.d.ts +0 -2
- package/dist/esm2017/contexts/UserEvents/{Loader.d.ts → Provider.d.ts} +1 -1
- package/dist/esm2017/contexts/UserEvents/index.d.ts +1 -1
- package/dist/esm2017/index.js +109 -75
- package/dist/esm2017/index.js.map +1 -1
- package/dist/esm2017/lib/Tracking/Facebook/index.d.ts +1 -0
- package/dist/esm2017/lib/Tracking/XyoUserEventHandler.d.ts +3 -1
- package/dist/esm5/components/BasePage/BasePageProps.d.ts +0 -2
- package/dist/esm5/contexts/UserEvents/Provider.d.ts +7 -0
- package/dist/esm5/contexts/UserEvents/index.d.ts +1 -1
- package/dist/esm5/index.js +109 -75
- package/dist/esm5/index.js.map +1 -1
- package/dist/esm5/lib/Tracking/Facebook/index.d.ts +1 -0
- package/dist/esm5/lib/Tracking/XyoUserEventHandler.d.ts +3 -1
- package/dist/lib/Tracking/Facebook/index.d.ts +1 -0
- package/dist/lib/Tracking/Facebook/index.js +1 -0
- package/dist/lib/Tracking/Facebook/index.js.map +1 -1
- package/dist/lib/Tracking/XyoUserEventHandler.d.ts +3 -1
- package/dist/lib/Tracking/XyoUserEventHandler.js +8 -1
- package/dist/lib/Tracking/XyoUserEventHandler.js.map +1 -1
- package/dist/node/components/BasePage/BasePageProps.d.ts +0 -2
- package/dist/node/contexts/UserEvents/Provider.d.ts +7 -0
- package/dist/node/contexts/UserEvents/index.d.ts +1 -1
- package/dist/node/index.js +109 -74
- package/dist/node/index.js.map +1 -1
- package/dist/node/lib/Tracking/Facebook/index.d.ts +1 -0
- package/dist/node/lib/Tracking/XyoUserEventHandler.d.ts +3 -1
- package/dist/node-esm/components/BasePage/BasePageProps.d.ts +0 -2
- package/dist/node-esm/contexts/UserEvents/Provider.d.ts +7 -0
- package/dist/node-esm/contexts/UserEvents/index.d.ts +1 -1
- package/dist/node-esm/index.js +109 -75
- package/dist/node-esm/index.js.map +1 -1
- package/dist/node-esm/lib/Tracking/Facebook/index.d.ts +1 -0
- package/dist/node-esm/lib/Tracking/XyoUserEventHandler.d.ts +3 -1
- package/package.json +7 -7
- package/src/components/Background.tsx +1 -0
- package/src/components/BasePage/BasePage.stories.tsx +0 -2
- package/src/components/BasePage/BasePage.tsx +0 -3
- package/src/components/BasePage/BasePageProps.ts +0 -2
- package/src/components/InvertableThemeProvider/InvertableThemeProvider.tsx +1 -0
- package/src/components/LinkEx/LinkToEx.tsx +1 -0
- package/src/components/index.ts +1 -0
- package/src/contexts/UserEvents/Provider.tsx +17 -0
- package/src/contexts/UserEvents/index.ts +1 -1
- package/src/lib/Tracking/Facebook/index.ts +1 -0
- package/src/lib/Tracking/XyoUserEventHandler.ts +11 -2
- package/dist/contexts/UserEvents/Loader.js +0 -6
- package/dist/contexts/UserEvents/Loader.js.map +0 -1
- package/dist/esm5/contexts/UserEvents/Loader.d.ts +0 -7
- package/dist/node/contexts/UserEvents/Loader.d.ts +0 -7
- package/dist/node-esm/contexts/UserEvents/Loader.d.ts +0 -7
- package/src/contexts/UserEvents/Loader.tsx +0 -12
|
@@ -7,9 +7,7 @@ interface BasePageProps extends BoxProps {
|
|
|
7
7
|
beta?: boolean;
|
|
8
8
|
container?: 'xl' | 'lg' | 'md' | 'sm' | 'xs';
|
|
9
9
|
disableGutters?: boolean;
|
|
10
|
-
filterBar?: ReactElement;
|
|
11
10
|
hideAppBar?: boolean;
|
|
12
|
-
hideFilterBar?: boolean;
|
|
13
11
|
hideFooter?: boolean;
|
|
14
12
|
noindex?: boolean;
|
|
15
13
|
cookieConsent?: ReactNode;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './Context';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './Provider';
|
package/dist/cjs5/index.js
CHANGED
|
@@ -404,77 +404,9 @@ class Referrer {
|
|
|
404
404
|
}
|
|
405
405
|
Referrer.storageId = '_coin_referrer';
|
|
406
406
|
|
|
407
|
-
class XyoUserEventHandler extends pixel.UserEventHandler {
|
|
408
|
-
constructor(handlers = []) {
|
|
409
|
-
super();
|
|
410
|
-
this.handlers = handlers;
|
|
411
|
-
}
|
|
412
|
-
testStarted(data) {
|
|
413
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
414
|
-
yield Promise.allSettled(this.handlers.map((handler) => handler.testStarted(data)));
|
|
415
|
-
});
|
|
416
|
-
}
|
|
417
|
-
funnelStarted(data) {
|
|
418
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
419
|
-
yield Promise.allSettled(this.handlers.map((handler) => handler.funnelStarted(data)));
|
|
420
|
-
});
|
|
421
|
-
}
|
|
422
|
-
viewContent(data) {
|
|
423
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
424
|
-
yield Promise.allSettled(this.handlers.map((handler) => handler.viewContent(data)));
|
|
425
|
-
});
|
|
426
|
-
}
|
|
427
|
-
userClick(data) {
|
|
428
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
429
|
-
yield Promise.allSettled(this.handlers.map((handler) => handler.userClick(data)));
|
|
430
|
-
});
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
|
|
434
407
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
435
408
|
const global = window;
|
|
436
409
|
|
|
437
|
-
class DripBaseEvent {
|
|
438
|
-
constructor(name, param) {
|
|
439
|
-
this.name = name;
|
|
440
|
-
this.param = param;
|
|
441
|
-
this.dcq = this.getDcq();
|
|
442
|
-
this.dcs = this.getDcs();
|
|
443
|
-
}
|
|
444
|
-
send(data) {
|
|
445
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
446
|
-
const payload = [this.name];
|
|
447
|
-
if (this.param) {
|
|
448
|
-
payload.push(this.param);
|
|
449
|
-
}
|
|
450
|
-
payload.push(data);
|
|
451
|
-
this.dcq.push(payload);
|
|
452
|
-
yield sdkJs.delay(0);
|
|
453
|
-
});
|
|
454
|
-
}
|
|
455
|
-
getDcq() {
|
|
456
|
-
if (!global._dcq) {
|
|
457
|
-
throw Error('DCQ not found');
|
|
458
|
-
}
|
|
459
|
-
return global._dcq;
|
|
460
|
-
}
|
|
461
|
-
getDcs() {
|
|
462
|
-
if (!global._dcs) {
|
|
463
|
-
throw Error('DCS not found');
|
|
464
|
-
}
|
|
465
|
-
return global._dcs;
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
class DripCustomEvent extends DripBaseEvent {
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
class DripStandardEvents {
|
|
473
|
-
identify() {
|
|
474
|
-
return new DripBaseEvent('identify');
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
|
|
478
410
|
class Fbq {
|
|
479
411
|
constructor(pixelId) {
|
|
480
412
|
this.pixelId = pixelId;
|
|
@@ -593,6 +525,33 @@ class FacebookStandardEvents {
|
|
|
593
525
|
}
|
|
594
526
|
}
|
|
595
527
|
|
|
528
|
+
class FacebookUserEventHandler {
|
|
529
|
+
testStarted(data) {
|
|
530
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
531
|
+
const event = new FacebookCustomEvent('TestStarted');
|
|
532
|
+
return yield event.send(data);
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
funnelStarted(data) {
|
|
536
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
537
|
+
const event = new FacebookCustomEvent('FunnelStarted');
|
|
538
|
+
return yield event.send(data);
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
viewContent(data) {
|
|
542
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
543
|
+
const event = new FacebookCustomEvent('ViewContent');
|
|
544
|
+
return yield event.send(data);
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
userClick(data) {
|
|
548
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
549
|
+
const event = new FacebookCustomEvent('UserClick');
|
|
550
|
+
return yield event.send(data);
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
|
|
596
555
|
class Gtag {
|
|
597
556
|
constructor(ga4id, awid, domains) {
|
|
598
557
|
var _a, _b, _c, _d;
|
|
@@ -856,6 +815,79 @@ class GoogleStandardEvents {
|
|
|
856
815
|
}
|
|
857
816
|
}
|
|
858
817
|
|
|
818
|
+
class XyoUserEventHandler extends pixel.UserEventHandler {
|
|
819
|
+
constructor(handlers = []) {
|
|
820
|
+
super();
|
|
821
|
+
this.handlers = handlers !== null && handlers !== void 0 ? handlers : [new FacebookUserEventHandler(), new GoogleUserEventHandler()];
|
|
822
|
+
}
|
|
823
|
+
testStarted(data) {
|
|
824
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
825
|
+
yield Promise.allSettled(this.handlers.map((handler) => handler.testStarted(data)));
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
funnelStarted(data) {
|
|
829
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
830
|
+
yield Promise.allSettled(this.handlers.map((handler) => handler.funnelStarted(data)));
|
|
831
|
+
});
|
|
832
|
+
}
|
|
833
|
+
viewContent(data) {
|
|
834
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
835
|
+
yield Promise.allSettled(this.handlers.map((handler) => handler.viewContent(data)));
|
|
836
|
+
});
|
|
837
|
+
}
|
|
838
|
+
userClick(data) {
|
|
839
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
840
|
+
yield Promise.allSettled(this.handlers.map((handler) => handler.userClick(data)));
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
static get() {
|
|
844
|
+
var _a;
|
|
845
|
+
this.instance = (_a = this.instance) !== null && _a !== void 0 ? _a : new XyoUserEventHandler();
|
|
846
|
+
return this.instance;
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
class DripBaseEvent {
|
|
851
|
+
constructor(name, param) {
|
|
852
|
+
this.name = name;
|
|
853
|
+
this.param = param;
|
|
854
|
+
this.dcq = this.getDcq();
|
|
855
|
+
this.dcs = this.getDcs();
|
|
856
|
+
}
|
|
857
|
+
send(data) {
|
|
858
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
859
|
+
const payload = [this.name];
|
|
860
|
+
if (this.param) {
|
|
861
|
+
payload.push(this.param);
|
|
862
|
+
}
|
|
863
|
+
payload.push(data);
|
|
864
|
+
this.dcq.push(payload);
|
|
865
|
+
yield sdkJs.delay(0);
|
|
866
|
+
});
|
|
867
|
+
}
|
|
868
|
+
getDcq() {
|
|
869
|
+
if (!global._dcq) {
|
|
870
|
+
throw Error('DCQ not found');
|
|
871
|
+
}
|
|
872
|
+
return global._dcq;
|
|
873
|
+
}
|
|
874
|
+
getDcs() {
|
|
875
|
+
if (!global._dcs) {
|
|
876
|
+
throw Error('DCS not found');
|
|
877
|
+
}
|
|
878
|
+
return global._dcs;
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
class DripCustomEvent extends DripBaseEvent {
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
class DripStandardEvents {
|
|
886
|
+
identify() {
|
|
887
|
+
return new DripBaseEvent('identify');
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
|
|
859
891
|
class Rdt {
|
|
860
892
|
static init(pixelId) {
|
|
861
893
|
try {
|
|
@@ -1550,8 +1582,8 @@ const DebugUserEventsContext = react.createContext({
|
|
|
1550
1582
|
},
|
|
1551
1583
|
});
|
|
1552
1584
|
|
|
1553
|
-
const
|
|
1554
|
-
return jsxRuntime.jsx(UserEventsContext.Provider, Object.assign({ value: { userEvents } }, { children: children }), void 0);
|
|
1585
|
+
const UserEventsProvider = ({ userEvents, children }) => {
|
|
1586
|
+
return (jsxRuntime.jsx(UserEventsContext.Provider, Object.assign({ value: { userEvents: userEvents !== null && userEvents !== void 0 ? userEvents : XyoUserEventHandler.get() } }, { children: children }), void 0));
|
|
1555
1587
|
};
|
|
1556
1588
|
|
|
1557
1589
|
const calcSpacing = (theme, values) => {
|
|
@@ -1687,7 +1719,9 @@ const resolveThemeColors = (options) => {
|
|
|
1687
1719
|
},
|
|
1688
1720
|
});
|
|
1689
1721
|
};
|
|
1690
|
-
const InvertableThemeProvider = ({ options, children, dark, resolve = false, scoped = false, invert = false, noResponsiveFonts,
|
|
1722
|
+
const InvertableThemeProvider = ({ options, children, dark, resolve = false, scoped = false, invert = false, noResponsiveFonts,
|
|
1723
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
1724
|
+
darkTheme, darkOptions, lightOptions, }) => {
|
|
1691
1725
|
var _a, _b, _c;
|
|
1692
1726
|
const parentContext = react.useContext(InvertableThemeContext);
|
|
1693
1727
|
const clonedOptions = cloneDeep__default["default"]((_a = options !== null && options !== void 0 ? options : parentContext.options) !== null && _a !== void 0 ? _a : {});
|
|
@@ -1722,10 +1756,10 @@ const ScrollToTop = () => {
|
|
|
1722
1756
|
};
|
|
1723
1757
|
|
|
1724
1758
|
const BasePage = (_a) => {
|
|
1725
|
-
var { disableGutters, children, beta, container, hideFooter, appFooter, appBar, cookieConsent,
|
|
1759
|
+
var { disableGutters, children, beta, container, hideFooter, appFooter, appBar, cookieConsent, hideAppBar, noindex = false, scrollToTopButton = false, title } = _a, props = __rest(_a, ["disableGutters", "children", "beta", "container", "hideFooter", "appFooter", "appBar", "cookieConsent", "hideAppBar", "noindex", "scrollToTopButton", "title"]);
|
|
1726
1760
|
const theme = material.useTheme();
|
|
1727
1761
|
const scrollToTopAnchorId = 'scroll-to-top-anchor';
|
|
1728
|
-
return (jsxRuntime.jsxs(FlexCol, Object.assign({ justifyContent: "flex-start", color: theme.palette.text.primary, alignItems: "stretch", width: "100%", maxWidth: "100vw", minHeight: "100vh" }, props, { children: [jsxRuntime.jsx(ScrollToTop, {}, void 0), jsxRuntime.jsx(reactHelmet.Helmet, Object.assign({ title: title }, { children: noindex ? jsxRuntime.jsx("meta", { content: "noindex", name: "robots" }, void 0) : null }), void 0), scrollToTopButton ? jsxRuntime.jsx("div", { id: scrollToTopAnchorId }, void 0) : null, hideAppBar ? null : appBar,
|
|
1762
|
+
return (jsxRuntime.jsxs(FlexCol, Object.assign({ justifyContent: "flex-start", color: theme.palette.text.primary, alignItems: "stretch", width: "100%", maxWidth: "100vw", minHeight: "100vh" }, props, { children: [jsxRuntime.jsx(ScrollToTop, {}, void 0), jsxRuntime.jsx(reactHelmet.Helmet, Object.assign({ title: title }, { children: noindex ? jsxRuntime.jsx("meta", { content: "noindex", name: "robots" }, void 0) : null }), void 0), scrollToTopButton ? jsxRuntime.jsx("div", { id: scrollToTopAnchorId }, void 0) : null, hideAppBar ? null : appBar, beta ? (jsxRuntime.jsx(FlexRow, Object.assign({ margin: 1, position: "absolute", top: 0, left: 0, bgcolor: "#cccccc88", paddingX: 1, style: { opacity: 0.5 } }, { children: jsxRuntime.jsx(material.Typography, Object.assign({ variant: "body2" }, { children: "Important: This page is a Beta page. It is possible that some information may not be correct." }), void 0) }), void 0)) : null, container ? (jsxRuntime.jsx(material.Container, Object.assign({ style: { alignItems: 'stretch', display: 'flex', flexDirection: 'column', flexGrow: 1 }, maxWidth: container, disableGutters: disableGutters }, { children: children }), void 0)) : (children), hideFooter ? null : jsxRuntime.jsx("footer", { children: appFooter }, void 0), cookieConsent !== null && cookieConsent !== void 0 ? cookieConsent : (jsxRuntime.jsx(material.ScopedCssBaseline, { children: jsxRuntime.jsx(InvertableThemeProvider, Object.assign({ invert: true }, { children: jsxRuntime.jsx(CookieConsent, { borderRadius: 0 }, void 0) }), void 0) }, void 0)), scrollToTopButton ? (jsxRuntime.jsx(ScrollToTopButton, Object.assign({ anchorId: scrollToTopAnchorId }, { children: jsxRuntime.jsx(material.Fab, Object.assign({ "aria-label": "scroll to top", color: "secondary", size: "small" }, { children: jsxRuntime.jsx(iconsMaterial.KeyboardArrowUp, {}, void 0) }), void 0) }), void 0)) : null] }), void 0));
|
|
1729
1763
|
};
|
|
1730
1764
|
|
|
1731
1765
|
const getPartialPath = (pathParts, index) => {
|
|
@@ -2321,6 +2355,7 @@ exports.Experiments = Experiments;
|
|
|
2321
2355
|
exports.ExperimentsDebugger = ExperimentsDebugger;
|
|
2322
2356
|
exports.FacebookCustomEvent = FacebookCustomEvent;
|
|
2323
2357
|
exports.FacebookStandardEvents = FacebookStandardEvents;
|
|
2358
|
+
exports.FacebookUserEventHandler = FacebookUserEventHandler;
|
|
2324
2359
|
exports.Fbq = Fbq;
|
|
2325
2360
|
exports.FlexCol = FlexCol;
|
|
2326
2361
|
exports.FlexGrowCol = FlexGrowCol;
|
|
@@ -2363,7 +2398,7 @@ exports.TiktokStandardEvents = TiktokStandardEvents;
|
|
|
2363
2398
|
exports.TokenAmount = TokenAmount;
|
|
2364
2399
|
exports.Ttq = Ttq;
|
|
2365
2400
|
exports.UserEventsContext = UserEventsContext;
|
|
2366
|
-
exports.
|
|
2401
|
+
exports.UserEventsProvider = UserEventsProvider;
|
|
2367
2402
|
exports.XyBaseEvent = XyBaseEvent;
|
|
2368
2403
|
exports.XyCustomEvent = XyCustomEvent;
|
|
2369
2404
|
exports.XyUserEventHandler = XyUserEventHandler;
|