@kontextso/sdk-react-native 0.0.4 → 0.0.5-rc.0
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/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +154 -31
- package/dist/index.mjs +125 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -142,6 +142,7 @@ interface AdsProviderProps {
|
|
|
142
142
|
styles?: AdStyles;
|
|
143
143
|
}
|
|
144
144
|
declare const VISITOR_ID_KEY = "brain-visitor-id";
|
|
145
|
+
declare const AdsProviderWithoutBoundary: ({ children, messages, publisherToken, isLoading, adserverUrl, isDisabled, character, conversationId, userId, logLevel, onAdView, onAdClick, ...props }: AdsProviderProps) => react_jsx_runtime.JSX.Element;
|
|
145
146
|
declare const AdsProvider: ({ children, messages, publisherToken, isLoading, adserverUrl, isDisabled, character, conversationId, userId, logLevel, onAdView, onAdClick, ...props }: AdsProviderProps) => react_jsx_runtime.JSX.Element;
|
|
146
147
|
|
|
147
|
-
export { type AdStyles, AdsContext, AdsProvider, type AdsProviderProps, type ContextType, InlineAd, VISITOR_ID_KEY, useAd };
|
|
148
|
+
export { type AdStyles, AdsContext, AdsProvider, type AdsProviderProps, AdsProviderWithoutBoundary, type ContextType, InlineAd, VISITOR_ID_KEY, useAd };
|
package/dist/index.d.ts
CHANGED
|
@@ -142,6 +142,7 @@ interface AdsProviderProps {
|
|
|
142
142
|
styles?: AdStyles;
|
|
143
143
|
}
|
|
144
144
|
declare const VISITOR_ID_KEY = "brain-visitor-id";
|
|
145
|
+
declare const AdsProviderWithoutBoundary: ({ children, messages, publisherToken, isLoading, adserverUrl, isDisabled, character, conversationId, userId, logLevel, onAdView, onAdClick, ...props }: AdsProviderProps) => react_jsx_runtime.JSX.Element;
|
|
145
146
|
declare const AdsProvider: ({ children, messages, publisherToken, isLoading, adserverUrl, isDisabled, character, conversationId, userId, logLevel, onAdView, onAdClick, ...props }: AdsProviderProps) => react_jsx_runtime.JSX.Element;
|
|
146
147
|
|
|
147
|
-
export { type AdStyles, AdsContext, AdsProvider, type AdsProviderProps, type ContextType, InlineAd, VISITOR_ID_KEY, useAd };
|
|
148
|
+
export { type AdStyles, AdsContext, AdsProvider, type AdsProviderProps, AdsProviderWithoutBoundary, type ContextType, InlineAd, VISITOR_ID_KEY, useAd };
|
package/dist/index.js
CHANGED
|
@@ -32,6 +32,7 @@ var src_exports = {};
|
|
|
32
32
|
__export(src_exports, {
|
|
33
33
|
AdsContext: () => AdsContext,
|
|
34
34
|
AdsProvider: () => AdsProvider,
|
|
35
|
+
AdsProviderWithoutBoundary: () => AdsProviderWithoutBoundary,
|
|
35
36
|
InlineAd: () => InlineAd_default,
|
|
36
37
|
VISITOR_ID_KEY: () => VISITOR_ID_KEY,
|
|
37
38
|
useAd: () => useAd
|
|
@@ -39,14 +40,14 @@ __export(src_exports, {
|
|
|
39
40
|
module.exports = __toCommonJS(src_exports);
|
|
40
41
|
|
|
41
42
|
// src/formats/InlineAd.tsx
|
|
42
|
-
var
|
|
43
|
+
var import_react12 = require("react");
|
|
43
44
|
var import_react_native5 = require("react-native");
|
|
44
45
|
|
|
45
46
|
// src/hooks/useAdViewed.tsx
|
|
46
|
-
var
|
|
47
|
+
var import_react6 = require("react");
|
|
47
48
|
|
|
48
49
|
// src/context/AdsProvider.tsx
|
|
49
|
-
var
|
|
50
|
+
var import_react5 = __toESM(require("react"));
|
|
50
51
|
|
|
51
52
|
// src/hooks/useInitializeAds.tsx
|
|
52
53
|
var import_react = require("react");
|
|
@@ -747,11 +748,83 @@ function useStreamAds({
|
|
|
747
748
|
|
|
748
749
|
// src/context/AdsProvider.tsx
|
|
749
750
|
var import_loglevel4 = __toESM(require("loglevel"));
|
|
751
|
+
|
|
752
|
+
// src/components/ErrorBoundary.tsx
|
|
753
|
+
var import_react4 = __toESM(require("react"));
|
|
754
|
+
var captureErrorFn = (adServerUrl, error, componentStack, context) => {
|
|
755
|
+
fetch(`${adServerUrl}/error`, {
|
|
756
|
+
method: "POST",
|
|
757
|
+
body: JSON.stringify({
|
|
758
|
+
error: error.message,
|
|
759
|
+
stack: componentStack,
|
|
760
|
+
context
|
|
761
|
+
})
|
|
762
|
+
}).catch((e) => {
|
|
763
|
+
console.error(e);
|
|
764
|
+
}).finally(() => {
|
|
765
|
+
console.error(error, componentStack);
|
|
766
|
+
});
|
|
767
|
+
};
|
|
768
|
+
var ErrorBoundary = class extends import_react4.default.Component {
|
|
769
|
+
static contextType = AdsContext;
|
|
770
|
+
constructor(props) {
|
|
771
|
+
super(props);
|
|
772
|
+
this.state = {
|
|
773
|
+
hasError: false
|
|
774
|
+
};
|
|
775
|
+
}
|
|
776
|
+
static getDerivedStateFromError() {
|
|
777
|
+
return {
|
|
778
|
+
hasError: true
|
|
779
|
+
};
|
|
780
|
+
}
|
|
781
|
+
componentDidCatch(error, info) {
|
|
782
|
+
const contextValue = this.context;
|
|
783
|
+
const adServerUrl = this.props.adserverUrl;
|
|
784
|
+
const props = [
|
|
785
|
+
"adserverUrl",
|
|
786
|
+
"publisherToken",
|
|
787
|
+
"visitorId",
|
|
788
|
+
"sessionId",
|
|
789
|
+
"ads",
|
|
790
|
+
"enabledPlacements",
|
|
791
|
+
"isInitialised",
|
|
792
|
+
"isLoading",
|
|
793
|
+
"messages"
|
|
794
|
+
];
|
|
795
|
+
let contextProps = {};
|
|
796
|
+
if (contextValue) {
|
|
797
|
+
contextProps = props.reduce(
|
|
798
|
+
(acc, prop) => {
|
|
799
|
+
acc[prop] = contextValue[prop];
|
|
800
|
+
return acc;
|
|
801
|
+
},
|
|
802
|
+
{}
|
|
803
|
+
);
|
|
804
|
+
} else {
|
|
805
|
+
contextProps = {
|
|
806
|
+
...this.props.reqBodyParams,
|
|
807
|
+
adServerUrl
|
|
808
|
+
};
|
|
809
|
+
}
|
|
810
|
+
if (adServerUrl) {
|
|
811
|
+
captureErrorFn(adServerUrl, error, info.componentStack, contextProps);
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
render() {
|
|
815
|
+
if (this.state.hasError) {
|
|
816
|
+
return this.props.fallback || null;
|
|
817
|
+
}
|
|
818
|
+
return this.props.children;
|
|
819
|
+
}
|
|
820
|
+
};
|
|
821
|
+
|
|
822
|
+
// src/context/AdsProvider.tsx
|
|
750
823
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
751
|
-
var AdsContext =
|
|
824
|
+
var AdsContext = import_react5.default.createContext(null);
|
|
752
825
|
AdsContext.displayName = "AdsContext";
|
|
753
826
|
var VISITOR_ID_KEY = "brain-visitor-id";
|
|
754
|
-
var
|
|
827
|
+
var AdsProviderWithoutBoundary = ({
|
|
755
828
|
children,
|
|
756
829
|
messages,
|
|
757
830
|
publisherToken,
|
|
@@ -766,7 +839,7 @@ var AdsProvider = ({
|
|
|
766
839
|
onAdClick,
|
|
767
840
|
...props
|
|
768
841
|
}) => {
|
|
769
|
-
const [viewedAds, setViewedAds] = (0,
|
|
842
|
+
const [viewedAds, setViewedAds] = (0, import_react5.useState)([]);
|
|
770
843
|
const adServerUrlOrDefault = adserverUrl || "https://server.megabrain.co";
|
|
771
844
|
import_loglevel4.default.setLevel(logLevel || "ERROR");
|
|
772
845
|
const {
|
|
@@ -858,13 +931,62 @@ var AdsProvider = ({
|
|
|
858
931
|
}
|
|
859
932
|
);
|
|
860
933
|
};
|
|
934
|
+
var AdsProvider = ({
|
|
935
|
+
children,
|
|
936
|
+
messages,
|
|
937
|
+
publisherToken,
|
|
938
|
+
isLoading,
|
|
939
|
+
adserverUrl,
|
|
940
|
+
isDisabled,
|
|
941
|
+
character,
|
|
942
|
+
conversationId,
|
|
943
|
+
userId,
|
|
944
|
+
logLevel,
|
|
945
|
+
onAdView,
|
|
946
|
+
onAdClick,
|
|
947
|
+
...props
|
|
948
|
+
}) => {
|
|
949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
950
|
+
ErrorBoundary,
|
|
951
|
+
{
|
|
952
|
+
fallback: children,
|
|
953
|
+
adserverUrl,
|
|
954
|
+
reqBodyParams: {
|
|
955
|
+
publisherToken,
|
|
956
|
+
adserverUrl,
|
|
957
|
+
conversationId,
|
|
958
|
+
character,
|
|
959
|
+
userId,
|
|
960
|
+
isLoading,
|
|
961
|
+
messages
|
|
962
|
+
},
|
|
963
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
964
|
+
AdsProviderWithoutBoundary,
|
|
965
|
+
{
|
|
966
|
+
children,
|
|
967
|
+
messages,
|
|
968
|
+
publisherToken,
|
|
969
|
+
isLoading,
|
|
970
|
+
adserverUrl,
|
|
971
|
+
isDisabled,
|
|
972
|
+
character,
|
|
973
|
+
conversationId,
|
|
974
|
+
userId,
|
|
975
|
+
logLevel,
|
|
976
|
+
onAdView,
|
|
977
|
+
onAdClick
|
|
978
|
+
}
|
|
979
|
+
)
|
|
980
|
+
}
|
|
981
|
+
);
|
|
982
|
+
};
|
|
861
983
|
|
|
862
984
|
// src/hooks/useAdViewed.tsx
|
|
863
|
-
var
|
|
985
|
+
var import_react7 = require("react");
|
|
864
986
|
var import_loglevel5 = __toESM(require("loglevel"));
|
|
865
987
|
function useAdViewed(ad) {
|
|
866
|
-
const context = (0,
|
|
867
|
-
const [stillMounted, setStillMounted] = (0,
|
|
988
|
+
const context = (0, import_react7.useContext)(AdsContext);
|
|
989
|
+
const [stillMounted, setStillMounted] = (0, import_react6.useState)(false);
|
|
868
990
|
const sendRequest = async () => {
|
|
869
991
|
if (!context?.adserverUrl || !ad?.id) {
|
|
870
992
|
return;
|
|
@@ -886,7 +1008,7 @@ function useAdViewed(ad) {
|
|
|
886
1008
|
import_loglevel5.default.error("[BRAIN] Error sending view request", e);
|
|
887
1009
|
}
|
|
888
1010
|
};
|
|
889
|
-
(0,
|
|
1011
|
+
(0, import_react6.useEffect)(() => {
|
|
890
1012
|
if (!ad || ad.isError || ad.isLoading || ad.isStreaming || ad.viewed || stillMounted) {
|
|
891
1013
|
return;
|
|
892
1014
|
}
|
|
@@ -896,7 +1018,7 @@ function useAdViewed(ad) {
|
|
|
896
1018
|
setStillMounted(true);
|
|
897
1019
|
}, 1e3);
|
|
898
1020
|
}, [ad]);
|
|
899
|
-
(0,
|
|
1021
|
+
(0, import_react6.useEffect)(() => {
|
|
900
1022
|
if (stillMounted) {
|
|
901
1023
|
import_loglevel5.default.log("[BRAIN] sending request");
|
|
902
1024
|
sendRequest();
|
|
@@ -909,14 +1031,14 @@ var import_loglevel8 = __toESM(require("loglevel"));
|
|
|
909
1031
|
|
|
910
1032
|
// src/components/MarkdownText.tsx
|
|
911
1033
|
var import_loglevel6 = __toESM(require("loglevel"));
|
|
912
|
-
var
|
|
1034
|
+
var import_react8 = require("react");
|
|
913
1035
|
var import_react_native2 = require("react-native");
|
|
914
1036
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
915
1037
|
function MarkdownText({
|
|
916
1038
|
content,
|
|
917
1039
|
onLinkClick
|
|
918
1040
|
}) {
|
|
919
|
-
const context = (0,
|
|
1041
|
+
const context = (0, import_react8.useContext)(AdsContext);
|
|
920
1042
|
const textParts = parseMessageText(content);
|
|
921
1043
|
const styles = context?.styles?.markdownText;
|
|
922
1044
|
const linkClickHandler = (href) => {
|
|
@@ -950,17 +1072,17 @@ function MarkdownText({
|
|
|
950
1072
|
// src/components/VideoPlayer.tsx
|
|
951
1073
|
var import_expo_av = require("expo-av");
|
|
952
1074
|
var import_loglevel7 = __toESM(require("loglevel"));
|
|
953
|
-
var
|
|
1075
|
+
var import_react10 = require("react");
|
|
954
1076
|
var import_react_native4 = require("react-native");
|
|
955
1077
|
|
|
956
1078
|
// src/components/VideoProgressBar.tsx
|
|
957
|
-
var
|
|
1079
|
+
var import_react9 = require("react");
|
|
958
1080
|
var import_react_native3 = require("react-native");
|
|
959
1081
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
960
1082
|
function VideoProgressBar({ videoRef }) {
|
|
961
|
-
const [progress, setProgress] = (0,
|
|
962
|
-
const styles = (0,
|
|
963
|
-
(0,
|
|
1083
|
+
const [progress, setProgress] = (0, import_react9.useState)(0);
|
|
1084
|
+
const styles = (0, import_react9.useContext)(AdsContext)?.styles?.videoPlayer?.videoProgress;
|
|
1085
|
+
(0, import_react9.useEffect)(() => {
|
|
964
1086
|
const interval = setInterval(() => {
|
|
965
1087
|
if (!videoRef.current) {
|
|
966
1088
|
return;
|
|
@@ -993,14 +1115,14 @@ var VideoPlayer = ({
|
|
|
993
1115
|
mediaPlacement,
|
|
994
1116
|
onLinkClick
|
|
995
1117
|
}) => {
|
|
996
|
-
const videoRef = (0,
|
|
997
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
998
|
-
const [isPaused, setIsPaused] = (0,
|
|
999
|
-
const [isEnded, setIsEnded] = (0,
|
|
1000
|
-
const [showDownloadBadge, setShowDownloadBadge] = (0,
|
|
1001
|
-
const lastCallbackTimeRef = (0,
|
|
1002
|
-
const styles = (0,
|
|
1003
|
-
(0,
|
|
1118
|
+
const videoRef = (0, import_react10.useRef)(null);
|
|
1119
|
+
const [isPlaying, setIsPlaying] = (0, import_react10.useState)(false);
|
|
1120
|
+
const [isPaused, setIsPaused] = (0, import_react10.useState)(true);
|
|
1121
|
+
const [isEnded, setIsEnded] = (0, import_react10.useState)(false);
|
|
1122
|
+
const [showDownloadBadge, setShowDownloadBadge] = (0, import_react10.useState)(false);
|
|
1123
|
+
const lastCallbackTimeRef = (0, import_react10.useRef)(0);
|
|
1124
|
+
const styles = (0, import_react10.useContext)(AdsContext)?.styles?.videoPlayer;
|
|
1125
|
+
(0, import_react10.useEffect)(() => {
|
|
1004
1126
|
const interval = setInterval(() => {
|
|
1005
1127
|
if (videoRef.current) {
|
|
1006
1128
|
videoRef.current.getStatusAsync().then((status) => {
|
|
@@ -1083,9 +1205,9 @@ var VideoPlayer = ({
|
|
|
1083
1205
|
};
|
|
1084
1206
|
|
|
1085
1207
|
// src/hooks/useAd.tsx
|
|
1086
|
-
var
|
|
1208
|
+
var import_react11 = require("react");
|
|
1087
1209
|
function useAd({ code, messageId }) {
|
|
1088
|
-
const context = (0,
|
|
1210
|
+
const context = (0, import_react11.useContext)(AdsContext);
|
|
1089
1211
|
if (!context) {
|
|
1090
1212
|
return null;
|
|
1091
1213
|
}
|
|
@@ -1133,11 +1255,11 @@ function useAd({ code, messageId }) {
|
|
|
1133
1255
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1134
1256
|
var InlineAd = ({ code, messageId, wrapper }) => {
|
|
1135
1257
|
const ad = useAd({ code, messageId });
|
|
1136
|
-
const [linkIncluded, setLinkIncluded] = (0,
|
|
1137
|
-
const context = (0,
|
|
1258
|
+
const [linkIncluded, setLinkIncluded] = (0, import_react12.useState)(false);
|
|
1259
|
+
const context = (0, import_react12.useContext)(AdsContext);
|
|
1138
1260
|
const styles = context?.styles?.inlineAd;
|
|
1139
1261
|
useAdViewed(ad);
|
|
1140
|
-
(0,
|
|
1262
|
+
(0, import_react12.useEffect)(() => {
|
|
1141
1263
|
if (ad?.content && !ad.isStreaming && !ad.content.match(/\[.*?\]\(.*?\)/) && !linkIncluded) {
|
|
1142
1264
|
setLinkIncluded(true);
|
|
1143
1265
|
}
|
|
@@ -1223,6 +1345,7 @@ var InlineAd_default = InlineAd;
|
|
|
1223
1345
|
0 && (module.exports = {
|
|
1224
1346
|
AdsContext,
|
|
1225
1347
|
AdsProvider,
|
|
1348
|
+
AdsProviderWithoutBoundary,
|
|
1226
1349
|
InlineAd,
|
|
1227
1350
|
VISITOR_ID_KEY,
|
|
1228
1351
|
useAd
|
package/dist/index.mjs
CHANGED
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
import { useEffect as useEffect5, useState as useState5 } from "react";
|
|
21
21
|
|
|
22
22
|
// src/context/AdsProvider.tsx
|
|
23
|
-
import
|
|
23
|
+
import React2, { useState as useState4 } from "react";
|
|
24
24
|
|
|
25
25
|
// src/hooks/useInitializeAds.tsx
|
|
26
26
|
import { useEffect, useState } from "react";
|
|
@@ -721,11 +721,83 @@ function useStreamAds({
|
|
|
721
721
|
|
|
722
722
|
// src/context/AdsProvider.tsx
|
|
723
723
|
import log4 from "loglevel";
|
|
724
|
+
|
|
725
|
+
// src/components/ErrorBoundary.tsx
|
|
726
|
+
import React from "react";
|
|
727
|
+
var captureErrorFn = (adServerUrl, error, componentStack, context) => {
|
|
728
|
+
fetch(`${adServerUrl}/error`, {
|
|
729
|
+
method: "POST",
|
|
730
|
+
body: JSON.stringify({
|
|
731
|
+
error: error.message,
|
|
732
|
+
stack: componentStack,
|
|
733
|
+
context
|
|
734
|
+
})
|
|
735
|
+
}).catch((e) => {
|
|
736
|
+
console.error(e);
|
|
737
|
+
}).finally(() => {
|
|
738
|
+
console.error(error, componentStack);
|
|
739
|
+
});
|
|
740
|
+
};
|
|
741
|
+
var ErrorBoundary = class extends React.Component {
|
|
742
|
+
static contextType = AdsContext;
|
|
743
|
+
constructor(props) {
|
|
744
|
+
super(props);
|
|
745
|
+
this.state = {
|
|
746
|
+
hasError: false
|
|
747
|
+
};
|
|
748
|
+
}
|
|
749
|
+
static getDerivedStateFromError() {
|
|
750
|
+
return {
|
|
751
|
+
hasError: true
|
|
752
|
+
};
|
|
753
|
+
}
|
|
754
|
+
componentDidCatch(error, info) {
|
|
755
|
+
const contextValue = this.context;
|
|
756
|
+
const adServerUrl = this.props.adserverUrl;
|
|
757
|
+
const props = [
|
|
758
|
+
"adserverUrl",
|
|
759
|
+
"publisherToken",
|
|
760
|
+
"visitorId",
|
|
761
|
+
"sessionId",
|
|
762
|
+
"ads",
|
|
763
|
+
"enabledPlacements",
|
|
764
|
+
"isInitialised",
|
|
765
|
+
"isLoading",
|
|
766
|
+
"messages"
|
|
767
|
+
];
|
|
768
|
+
let contextProps = {};
|
|
769
|
+
if (contextValue) {
|
|
770
|
+
contextProps = props.reduce(
|
|
771
|
+
(acc, prop) => {
|
|
772
|
+
acc[prop] = contextValue[prop];
|
|
773
|
+
return acc;
|
|
774
|
+
},
|
|
775
|
+
{}
|
|
776
|
+
);
|
|
777
|
+
} else {
|
|
778
|
+
contextProps = {
|
|
779
|
+
...this.props.reqBodyParams,
|
|
780
|
+
adServerUrl
|
|
781
|
+
};
|
|
782
|
+
}
|
|
783
|
+
if (adServerUrl) {
|
|
784
|
+
captureErrorFn(adServerUrl, error, info.componentStack, contextProps);
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
render() {
|
|
788
|
+
if (this.state.hasError) {
|
|
789
|
+
return this.props.fallback || null;
|
|
790
|
+
}
|
|
791
|
+
return this.props.children;
|
|
792
|
+
}
|
|
793
|
+
};
|
|
794
|
+
|
|
795
|
+
// src/context/AdsProvider.tsx
|
|
724
796
|
import { jsx } from "react/jsx-runtime";
|
|
725
|
-
var AdsContext =
|
|
797
|
+
var AdsContext = React2.createContext(null);
|
|
726
798
|
AdsContext.displayName = "AdsContext";
|
|
727
799
|
var VISITOR_ID_KEY = "brain-visitor-id";
|
|
728
|
-
var
|
|
800
|
+
var AdsProviderWithoutBoundary = ({
|
|
729
801
|
children,
|
|
730
802
|
messages,
|
|
731
803
|
publisherToken,
|
|
@@ -832,6 +904,55 @@ var AdsProvider = ({
|
|
|
832
904
|
}
|
|
833
905
|
);
|
|
834
906
|
};
|
|
907
|
+
var AdsProvider = ({
|
|
908
|
+
children,
|
|
909
|
+
messages,
|
|
910
|
+
publisherToken,
|
|
911
|
+
isLoading,
|
|
912
|
+
adserverUrl,
|
|
913
|
+
isDisabled,
|
|
914
|
+
character,
|
|
915
|
+
conversationId,
|
|
916
|
+
userId,
|
|
917
|
+
logLevel,
|
|
918
|
+
onAdView,
|
|
919
|
+
onAdClick,
|
|
920
|
+
...props
|
|
921
|
+
}) => {
|
|
922
|
+
return /* @__PURE__ */ jsx(
|
|
923
|
+
ErrorBoundary,
|
|
924
|
+
{
|
|
925
|
+
fallback: children,
|
|
926
|
+
adserverUrl,
|
|
927
|
+
reqBodyParams: {
|
|
928
|
+
publisherToken,
|
|
929
|
+
adserverUrl,
|
|
930
|
+
conversationId,
|
|
931
|
+
character,
|
|
932
|
+
userId,
|
|
933
|
+
isLoading,
|
|
934
|
+
messages
|
|
935
|
+
},
|
|
936
|
+
children: /* @__PURE__ */ jsx(
|
|
937
|
+
AdsProviderWithoutBoundary,
|
|
938
|
+
{
|
|
939
|
+
children,
|
|
940
|
+
messages,
|
|
941
|
+
publisherToken,
|
|
942
|
+
isLoading,
|
|
943
|
+
adserverUrl,
|
|
944
|
+
isDisabled,
|
|
945
|
+
character,
|
|
946
|
+
conversationId,
|
|
947
|
+
userId,
|
|
948
|
+
logLevel,
|
|
949
|
+
onAdView,
|
|
950
|
+
onAdClick
|
|
951
|
+
}
|
|
952
|
+
)
|
|
953
|
+
}
|
|
954
|
+
);
|
|
955
|
+
};
|
|
835
956
|
|
|
836
957
|
// src/hooks/useAdViewed.tsx
|
|
837
958
|
import { useContext } from "react";
|
|
@@ -1199,6 +1320,7 @@ var InlineAd_default = InlineAd;
|
|
|
1199
1320
|
export {
|
|
1200
1321
|
AdsContext,
|
|
1201
1322
|
AdsProvider,
|
|
1323
|
+
AdsProviderWithoutBoundary,
|
|
1202
1324
|
InlineAd_default as InlineAd,
|
|
1203
1325
|
VISITOR_ID_KEY,
|
|
1204
1326
|
useAd
|