@temple-wallet/extension-ads 2.0.2 → 3.0.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.
@@ -1,6 +1,6 @@
1
1
  import { StringRecord } from 'src/utils';
2
2
 
3
- import type { AdMetadata } from './ads-meta';
3
+ import { AdMetadata } from './ads-meta';
4
4
  import type { AdStylesOverrides } from './temple-wallet-api';
5
5
 
6
6
  export enum AdActionType {
@@ -11,17 +11,21 @@ export enum AdActionType {
11
11
  HideElement = 'hide-element'
12
12
  }
13
13
 
14
+ export enum AdType {
15
+ Permanent = 'permanent',
16
+ SlotReplacement = 'slot-replacement',
17
+ ProviderReplacement = 'provider-replacement'
18
+ }
19
+
14
20
  interface AdActionBase {
15
21
  type: AdActionType;
16
22
  }
17
23
 
18
24
  interface InsertAdActionProps {
19
- ad: AdMetadata;
20
- fallbacks: AdMetadata[];
21
- /** @deprecated // Always wrapping now
22
- * TODO: Clean-up usage
25
+ /** A value of 'number' type stands for the value with respective index in `BANNER_ADS_META`. It is done to shorten
26
+ * ads stack Iframe URL search parameters.
23
27
  */
24
- shouldUseDivWrapper?: boolean;
28
+ adsMetadata: (number | AdMetadata)[];
25
29
  divWrapperStyle?: StringRecord<string>;
26
30
  elementStyle?: StringRecord<string>;
27
31
  stylesOverrides?: AdStylesOverrides[];
@@ -41,6 +45,7 @@ export interface SimpleInsertAdAction extends AdActionBase, InsertAdActionProps
41
45
  type: AdActionType.SimpleInsertAd;
42
46
  parent: HTMLElement;
43
47
  insertionIndex: number;
48
+ isSiblingReplacement: boolean;
44
49
  }
45
50
 
46
51
  export interface RemoveElementAction extends AdActionBase {
@@ -55,7 +60,7 @@ export interface HideElementAction extends AdActionBase {
55
60
 
56
61
  export type InsertAdAction = ReplaceAllChildrenWithAdAction | ReplaceElementWithAdAction | SimpleInsertAdAction;
57
62
 
58
- export type OmitAdInAction<T extends InsertAdActionProps> = Omit<T, 'ad' | 'fallbacks'>;
63
+ export type OmitAdInAction<T extends InsertAdActionProps> = Omit<T, 'adsMetadata'>;
59
64
 
60
65
  export type InsertAdActionWithoutMeta =
61
66
  | OmitAdInAction<ReplaceAllChildrenWithAdAction>
@@ -66,8 +71,7 @@ export type AdAction = InsertAdAction | RemoveElementAction | HideElementAction;
66
71
 
67
72
  export type AddActionsIfAdResolutionAvailable = (
68
73
  elementToMeasure: Element,
69
- shouldUseStrictContainerLimits: boolean,
70
- minContainerWidthIsBannerWidth: boolean,
74
+ adType: AdType,
71
75
  adIsNative: boolean,
72
76
  ...actionsBases: (InsertAdActionWithoutMeta | HideElementAction | RemoveElementAction)[]
73
77
  ) => boolean;