@adtogether/web-sdk 0.1.25 → 0.1.26
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-IDISPRGA.mjs → chunk-V3TR7YMJ.mjs} +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/react/index.d.mts +2 -2
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +3 -3
- package/dist/react/index.mjs +3 -3
- package/package.json +3 -4
- package/src/core/AdTogether.ts +1 -1
- package/src/react/AdTogetherBanner.tsx +2 -2
- package/src/react/AdTogetherInterstitial.tsx +2 -2
|
@@ -35,7 +35,7 @@ var AdTogether = class _AdTogether {
|
|
|
35
35
|
}
|
|
36
36
|
return true;
|
|
37
37
|
}
|
|
38
|
-
static async fetchAd(adUnitId, adType) {
|
|
38
|
+
static async fetchAd(adUnitId = "default", adType) {
|
|
39
39
|
if (!_AdTogether.shared.assertInitialized()) {
|
|
40
40
|
throw new Error("AdTogether not initialized");
|
|
41
41
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -28,7 +28,7 @@ declare class AdTogether {
|
|
|
28
28
|
static initialize(options: AdTogetherOptions): void;
|
|
29
29
|
assertInitialized(): boolean;
|
|
30
30
|
private lastAdId?;
|
|
31
|
-
static fetchAd(adUnitId
|
|
31
|
+
static fetchAd(adUnitId?: string, adType?: AdType): Promise<AdModel>;
|
|
32
32
|
static trackImpression(adId: string, token?: string): void;
|
|
33
33
|
static trackClick(adId: string, token?: string): void;
|
|
34
34
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ declare class AdTogether {
|
|
|
28
28
|
static initialize(options: AdTogetherOptions): void;
|
|
29
29
|
assertInitialized(): boolean;
|
|
30
30
|
private lastAdId?;
|
|
31
|
-
static fetchAd(adUnitId
|
|
31
|
+
static fetchAd(adUnitId?: string, adType?: AdType): Promise<AdModel>;
|
|
32
32
|
static trackImpression(adId: string, token?: string): void;
|
|
33
33
|
static trackClick(adId: string, token?: string): void;
|
|
34
34
|
/**
|
package/dist/index.js
CHANGED
|
@@ -61,7 +61,7 @@ var AdTogether = class _AdTogether {
|
|
|
61
61
|
}
|
|
62
62
|
return true;
|
|
63
63
|
}
|
|
64
|
-
static async fetchAd(adUnitId, adType) {
|
|
64
|
+
static async fetchAd(adUnitId = "default", adType) {
|
|
65
65
|
if (!_AdTogether.shared.assertInitialized()) {
|
|
66
66
|
throw new Error("AdTogether not initialized");
|
|
67
67
|
}
|
package/dist/index.mjs
CHANGED
package/dist/react/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
interface AdTogetherBannerProps {
|
|
4
|
-
adUnitId
|
|
4
|
+
adUnitId?: string;
|
|
5
5
|
className?: string;
|
|
6
6
|
style?: React.CSSProperties;
|
|
7
7
|
onAdLoaded?: () => void;
|
|
@@ -20,7 +20,7 @@ interface AdTogetherBannerProps {
|
|
|
20
20
|
declare const AdTogetherBanner: React.FC<AdTogetherBannerProps>;
|
|
21
21
|
|
|
22
22
|
interface AdTogetherInterstitialProps {
|
|
23
|
-
adUnitId
|
|
23
|
+
adUnitId?: string;
|
|
24
24
|
/** When true, the interstitial is shown (fetches and displays full-screen ad) */
|
|
25
25
|
isOpen: boolean;
|
|
26
26
|
/** Called when the user closes the interstitial */
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
interface AdTogetherBannerProps {
|
|
4
|
-
adUnitId
|
|
4
|
+
adUnitId?: string;
|
|
5
5
|
className?: string;
|
|
6
6
|
style?: React.CSSProperties;
|
|
7
7
|
onAdLoaded?: () => void;
|
|
@@ -20,7 +20,7 @@ interface AdTogetherBannerProps {
|
|
|
20
20
|
declare const AdTogetherBanner: React.FC<AdTogetherBannerProps>;
|
|
21
21
|
|
|
22
22
|
interface AdTogetherInterstitialProps {
|
|
23
|
-
adUnitId
|
|
23
|
+
adUnitId?: string;
|
|
24
24
|
/** When true, the interstitial is shown (fetches and displays full-screen ad) */
|
|
25
25
|
isOpen: boolean;
|
|
26
26
|
/** Called when the user closes the interstitial */
|
package/dist/react/index.js
CHANGED
|
@@ -65,7 +65,7 @@ var AdTogether = class _AdTogether {
|
|
|
65
65
|
}
|
|
66
66
|
return true;
|
|
67
67
|
}
|
|
68
|
-
static async fetchAd(adUnitId, adType) {
|
|
68
|
+
static async fetchAd(adUnitId = "default", adType) {
|
|
69
69
|
if (!_AdTogether.shared.assertInitialized()) {
|
|
70
70
|
throw new Error("AdTogether not initialized");
|
|
71
71
|
}
|
|
@@ -154,7 +154,7 @@ var AdTogether = class _AdTogether {
|
|
|
154
154
|
// src/react/AdTogetherBanner.tsx
|
|
155
155
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
156
156
|
var AdTogetherBanner = ({
|
|
157
|
-
adUnitId,
|
|
157
|
+
adUnitId = "default",
|
|
158
158
|
className = "",
|
|
159
159
|
style = {},
|
|
160
160
|
onAdLoaded,
|
|
@@ -341,7 +341,7 @@ var import_react2 = require("react");
|
|
|
341
341
|
var import_react_dom = require("react-dom");
|
|
342
342
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
343
343
|
var AdTogetherInterstitial = ({
|
|
344
|
-
adUnitId,
|
|
344
|
+
adUnitId = "default",
|
|
345
345
|
isOpen,
|
|
346
346
|
onClose,
|
|
347
347
|
onAdLoaded,
|
package/dist/react/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AdTogether
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-V3TR7YMJ.mjs";
|
|
4
4
|
|
|
5
5
|
// src/react/AdTogetherBanner.tsx
|
|
6
6
|
import { useEffect, useRef, useState } from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
var AdTogetherBanner = ({
|
|
9
|
-
adUnitId,
|
|
9
|
+
adUnitId = "default",
|
|
10
10
|
className = "",
|
|
11
11
|
style = {},
|
|
12
12
|
onAdLoaded,
|
|
@@ -193,7 +193,7 @@ import { useEffect as useEffect2, useRef as useRef2, useState as useState2, useC
|
|
|
193
193
|
import { createPortal } from "react-dom";
|
|
194
194
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
195
195
|
var AdTogetherInterstitial = ({
|
|
196
|
-
adUnitId,
|
|
196
|
+
adUnitId = "default",
|
|
197
197
|
isOpen,
|
|
198
198
|
onClose,
|
|
199
199
|
onAdLoaded,
|
package/package.json
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adtogether/web-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.26",
|
|
4
4
|
"description": "The official AdTogether Web SDK — reciprocal ad exchange to increase conversions and grow your audience.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/undecided2003/
|
|
8
|
-
"directory": "sdk/web-sdk"
|
|
7
|
+
"url": "git+https://github.com/undecided2003/adtogether-web-sdk.git"
|
|
9
8
|
},
|
|
10
9
|
"homepage": "https://adtogether.relaxsoftwareapps.com",
|
|
11
10
|
"bugs": {
|
|
12
|
-
"url": "https://github.com/undecided2003/
|
|
11
|
+
"url": "https://github.com/undecided2003/adtogether-web-sdk/issues"
|
|
13
12
|
},
|
|
14
13
|
"keywords": [
|
|
15
14
|
"ads",
|
package/src/core/AdTogether.ts
CHANGED
|
@@ -50,7 +50,7 @@ export class AdTogether {
|
|
|
50
50
|
|
|
51
51
|
private lastAdId?: string;
|
|
52
52
|
|
|
53
|
-
static async fetchAd(adUnitId: string, adType?: AdType): Promise<AdModel> {
|
|
53
|
+
static async fetchAd(adUnitId: string = 'default', adType?: AdType): Promise<AdModel> {
|
|
54
54
|
if (!AdTogether.shared.assertInitialized()) {
|
|
55
55
|
throw new Error('AdTogether not initialized');
|
|
56
56
|
}
|
|
@@ -3,7 +3,7 @@ import { AdTogether } from '../core/AdTogether';
|
|
|
3
3
|
import { AdModel } from '../core/types';
|
|
4
4
|
|
|
5
5
|
export interface AdTogetherBannerProps {
|
|
6
|
-
adUnitId
|
|
6
|
+
adUnitId?: string;
|
|
7
7
|
className?: string;
|
|
8
8
|
style?: React.CSSProperties;
|
|
9
9
|
onAdLoaded?: () => void;
|
|
@@ -21,7 +21,7 @@ export interface AdTogetherBannerProps {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export const AdTogetherBanner: React.FC<AdTogetherBannerProps> = ({
|
|
24
|
-
adUnitId,
|
|
24
|
+
adUnitId = 'default',
|
|
25
25
|
className = '',
|
|
26
26
|
style = {},
|
|
27
27
|
onAdLoaded,
|
|
@@ -4,7 +4,7 @@ import { AdTogether } from '../core/AdTogether';
|
|
|
4
4
|
import { AdModel } from '../core/types';
|
|
5
5
|
|
|
6
6
|
export interface AdTogetherInterstitialProps {
|
|
7
|
-
adUnitId
|
|
7
|
+
adUnitId?: string;
|
|
8
8
|
/** When true, the interstitial is shown (fetches and displays full-screen ad) */
|
|
9
9
|
isOpen: boolean;
|
|
10
10
|
/** Called when the user closes the interstitial */
|
|
@@ -20,7 +20,7 @@ export interface AdTogetherInterstitialProps {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export const AdTogetherInterstitial: React.FC<AdTogetherInterstitialProps> = ({
|
|
23
|
-
adUnitId,
|
|
23
|
+
adUnitId = 'default',
|
|
24
24
|
isOpen,
|
|
25
25
|
onClose,
|
|
26
26
|
onAdLoaded,
|