@kontextso/sdk-react-native 0.0.8-rc.4 → 0.0.8-rc.6
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.js +3 -2
- package/dist/index.mjs +12 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -277,7 +277,7 @@ var log = new Logger();
|
|
|
277
277
|
var log_default = log;
|
|
278
278
|
|
|
279
279
|
// package.json
|
|
280
|
-
var version = "0.0.8-rc.
|
|
280
|
+
var version = "0.0.8-rc.5";
|
|
281
281
|
|
|
282
282
|
// src/hooks/useInitializeAds.tsx
|
|
283
283
|
var SINGLE_INIT_TIMEOUT_BUDGET_MS = 3e3;
|
|
@@ -1050,7 +1050,8 @@ var AdsProvider = ({
|
|
|
1050
1050
|
userId,
|
|
1051
1051
|
logLevel,
|
|
1052
1052
|
onAdView,
|
|
1053
|
-
onAdClick
|
|
1053
|
+
onAdClick,
|
|
1054
|
+
...props
|
|
1054
1055
|
}
|
|
1055
1056
|
)
|
|
1056
1057
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
6
6
|
});
|
|
7
7
|
|
|
8
8
|
// src/formats/InlineAd.tsx
|
|
9
|
-
import { useContext as useContext6, useEffect as
|
|
9
|
+
import { useContext as useContext6, useEffect as useEffect7, useState as useState8 } from "react";
|
|
10
10
|
import {
|
|
11
11
|
Image,
|
|
12
12
|
Linking as Linking3,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "react-native";
|
|
18
18
|
|
|
19
19
|
// src/hooks/useAdViewed.tsx
|
|
20
|
-
import { useEffect as
|
|
20
|
+
import { useEffect as useEffect4, useState as useState5 } from "react";
|
|
21
21
|
|
|
22
22
|
// src/context/AdsProvider.tsx
|
|
23
23
|
import React2, { useState as useState4 } from "react";
|
|
@@ -251,7 +251,7 @@ var log = new Logger();
|
|
|
251
251
|
var log_default = log;
|
|
252
252
|
|
|
253
253
|
// package.json
|
|
254
|
-
var version = "0.0.8-rc.
|
|
254
|
+
var version = "0.0.8-rc.5";
|
|
255
255
|
|
|
256
256
|
// src/hooks/useInitializeAds.tsx
|
|
257
257
|
var SINGLE_INIT_TIMEOUT_BUDGET_MS = 3e3;
|
|
@@ -1024,7 +1024,8 @@ var AdsProvider = ({
|
|
|
1024
1024
|
userId,
|
|
1025
1025
|
logLevel,
|
|
1026
1026
|
onAdView,
|
|
1027
|
-
onAdClick
|
|
1027
|
+
onAdClick,
|
|
1028
|
+
...props
|
|
1028
1029
|
}
|
|
1029
1030
|
)
|
|
1030
1031
|
}
|
|
@@ -1057,7 +1058,7 @@ function useAdViewed(ad) {
|
|
|
1057
1058
|
log_default.warn("[BRAIN] Error sending view request", e);
|
|
1058
1059
|
}
|
|
1059
1060
|
};
|
|
1060
|
-
|
|
1061
|
+
useEffect4(() => {
|
|
1061
1062
|
if (!ad || ad.isError || ad.isLoading || ad.isStreaming || ad.viewed || stillMounted) {
|
|
1062
1063
|
return;
|
|
1063
1064
|
}
|
|
@@ -1067,7 +1068,7 @@ function useAdViewed(ad) {
|
|
|
1067
1068
|
setStillMounted(true);
|
|
1068
1069
|
}, 1e3);
|
|
1069
1070
|
}, [ad]);
|
|
1070
|
-
|
|
1071
|
+
useEffect4(() => {
|
|
1071
1072
|
if (stillMounted) {
|
|
1072
1073
|
log_default.log("[BRAIN] sending request");
|
|
1073
1074
|
sendRequest();
|
|
@@ -1119,17 +1120,17 @@ function MarkdownText({
|
|
|
1119
1120
|
|
|
1120
1121
|
// src/components/VideoPlayer.tsx
|
|
1121
1122
|
import { ResizeMode, Video } from "expo-av";
|
|
1122
|
-
import { useContext as useContext4, useEffect as
|
|
1123
|
+
import { useContext as useContext4, useEffect as useEffect6, useRef, useState as useState7 } from "react";
|
|
1123
1124
|
import { Linking as Linking2, Text as Text2, TouchableOpacity, View as View2 } from "react-native";
|
|
1124
1125
|
|
|
1125
1126
|
// src/components/VideoProgressBar.tsx
|
|
1126
|
-
import { useState as useState6, useEffect as
|
|
1127
|
+
import { useState as useState6, useEffect as useEffect5, useContext as useContext3 } from "react";
|
|
1127
1128
|
import { View } from "react-native";
|
|
1128
1129
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
1129
1130
|
function VideoProgressBar({ videoRef }) {
|
|
1130
1131
|
const [progress, setProgress] = useState6(0);
|
|
1131
1132
|
const styles = useContext3(AdsContext)?.styles?.videoPlayer?.videoProgress;
|
|
1132
|
-
|
|
1133
|
+
useEffect5(() => {
|
|
1133
1134
|
const interval = setInterval(() => {
|
|
1134
1135
|
if (!videoRef.current) {
|
|
1135
1136
|
return;
|
|
@@ -1169,7 +1170,7 @@ var VideoPlayer = ({
|
|
|
1169
1170
|
const [showDownloadBadge, setShowDownloadBadge] = useState7(false);
|
|
1170
1171
|
const lastCallbackTimeRef = useRef(0);
|
|
1171
1172
|
const styles = useContext4(AdsContext)?.styles?.videoPlayer;
|
|
1172
|
-
|
|
1173
|
+
useEffect6(() => {
|
|
1173
1174
|
const interval = setInterval(() => {
|
|
1174
1175
|
if (videoRef.current) {
|
|
1175
1176
|
videoRef.current.getStatusAsync().then((status) => {
|
|
@@ -1306,7 +1307,7 @@ var InlineAd = ({ code, messageId, wrapper }) => {
|
|
|
1306
1307
|
const context = useContext6(AdsContext);
|
|
1307
1308
|
const styles = context?.styles?.inlineAd;
|
|
1308
1309
|
useAdViewed(ad);
|
|
1309
|
-
|
|
1310
|
+
useEffect7(() => {
|
|
1310
1311
|
if (ad?.content && !ad.isStreaming && !ad.content.match(/\[.*?\]\(.*?\)/) && !linkIncluded) {
|
|
1311
1312
|
setLinkIncluded(true);
|
|
1312
1313
|
}
|