@adview/react 1.0.13 → 1.0.14

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.
Files changed (101) hide show
  1. package/dist/AdViewUnit/AdViewUnit.cjs +106 -298
  2. package/dist/AdViewUnit/AdViewUnit.cjs.map +1 -1
  3. package/dist/AdViewUnit/AdViewUnit.client.cjs +86 -256
  4. package/dist/AdViewUnit/AdViewUnit.client.cjs.map +1 -1
  5. package/dist/AdViewUnit/AdViewUnit.client.d.cts +2 -2
  6. package/dist/AdViewUnit/AdViewUnit.client.d.ts +2 -2
  7. package/dist/AdViewUnit/AdViewUnit.client.js +69 -239
  8. package/dist/AdViewUnit/AdViewUnit.client.js.map +1 -1
  9. package/dist/AdViewUnit/AdViewUnit.d.cts +1 -1
  10. package/dist/AdViewUnit/AdViewUnit.d.ts +1 -1
  11. package/dist/AdViewUnit/AdViewUnit.js +85 -277
  12. package/dist/AdViewUnit/AdViewUnit.js.map +1 -1
  13. package/dist/AdViewUnit/AdViewUnit.server.cjs +82 -214
  14. package/dist/AdViewUnit/AdViewUnit.server.cjs.map +1 -1
  15. package/dist/AdViewUnit/AdViewUnit.server.d.cts +2 -2
  16. package/dist/AdViewUnit/AdViewUnit.server.d.ts +2 -2
  17. package/dist/AdViewUnit/AdViewUnit.server.js +72 -204
  18. package/dist/AdViewUnit/AdViewUnit.server.js.map +1 -1
  19. package/dist/AdViewUnit/{AdViewUnitBanner.cjs → AdViewUnitBannerTemplate.cjs} +17 -14
  20. package/dist/AdViewUnit/AdViewUnitBannerTemplate.cjs.map +1 -0
  21. package/dist/AdViewUnit/AdViewUnitBannerTemplate.d.cts +12 -0
  22. package/dist/AdViewUnit/AdViewUnitBannerTemplate.d.ts +12 -0
  23. package/dist/AdViewUnit/AdViewUnitBannerTemplate.js +32 -0
  24. package/dist/AdViewUnit/AdViewUnitBannerTemplate.js.map +1 -0
  25. package/dist/AdViewUnit/AdViewUnitDefaultTemplate.cjs +48 -0
  26. package/dist/AdViewUnit/AdViewUnitDefaultTemplate.cjs.map +1 -0
  27. package/dist/AdViewUnit/AdViewUnitDefaultTemplate.d.cts +17 -0
  28. package/dist/AdViewUnit/AdViewUnitDefaultTemplate.d.ts +17 -0
  29. package/dist/AdViewUnit/AdViewUnitDefaultTemplate.js +17 -0
  30. package/dist/AdViewUnit/AdViewUnitDefaultTemplate.js.map +1 -0
  31. package/dist/AdViewUnit/{AdViewUnitNative.cjs → AdViewUnitNativeTemplate.cjs} +12 -13
  32. package/dist/AdViewUnit/AdViewUnitNativeTemplate.cjs.map +1 -0
  33. package/dist/AdViewUnit/AdViewUnitNativeTemplate.d.cts +11 -0
  34. package/dist/AdViewUnit/AdViewUnitNativeTemplate.d.ts +11 -0
  35. package/dist/AdViewUnit/{AdViewUnitNative.js → AdViewUnitNativeTemplate.js} +9 -10
  36. package/dist/AdViewUnit/AdViewUnitNativeTemplate.js.map +1 -0
  37. package/dist/AdViewUnit/{AdViewUnitProxy.cjs → AdViewUnitProxyTemplate.cjs} +14 -13
  38. package/dist/AdViewUnit/AdViewUnitProxyTemplate.cjs.map +1 -0
  39. package/dist/AdViewUnit/AdViewUnitProxyTemplate.d.cts +12 -0
  40. package/dist/AdViewUnit/AdViewUnitProxyTemplate.d.ts +12 -0
  41. package/dist/AdViewUnit/AdViewUnitProxyTemplate.js +33 -0
  42. package/dist/AdViewUnit/AdViewUnitProxyTemplate.js.map +1 -0
  43. package/dist/AdViewUnit/AdViewUnitTemplate.cjs +114 -0
  44. package/dist/AdViewUnit/AdViewUnitTemplate.cjs.map +1 -1
  45. package/dist/AdViewUnit/AdViewUnitTemplate.d.cts +14 -1
  46. package/dist/AdViewUnit/AdViewUnitTemplate.d.ts +14 -1
  47. package/dist/AdViewUnit/AdViewUnitTemplate.js +77 -0
  48. package/dist/AdViewUnit/AdViewUnitTemplate.js.map +1 -1
  49. package/dist/AdViewUnit/useAdViewController.cjs +5 -1
  50. package/dist/AdViewUnit/useAdViewController.cjs.map +1 -1
  51. package/dist/AdViewUnit/useAdViewController.d.cts +2 -2
  52. package/dist/AdViewUnit/useAdViewController.d.ts +2 -2
  53. package/dist/AdViewUnit/useAdViewController.js +5 -1
  54. package/dist/AdViewUnit/useAdViewController.js.map +1 -1
  55. package/dist/index.cjs +250 -232
  56. package/dist/index.cjs.map +1 -1
  57. package/dist/index.d.cts +8 -7
  58. package/dist/index.d.ts +8 -7
  59. package/dist/index.js +232 -222
  60. package/dist/index.js.map +1 -1
  61. package/dist/server.cjs +216 -162
  62. package/dist/server.cjs.map +1 -1
  63. package/dist/server.d.cts +7 -6
  64. package/dist/server.d.ts +7 -6
  65. package/dist/server.js +196 -149
  66. package/dist/server.js.map +1 -1
  67. package/dist/{types-BaV07oMT.d.cts → types-B65WDsgh.d.cts} +29 -25
  68. package/dist/{types-BaV07oMT.d.ts → types-B65WDsgh.d.ts} +29 -25
  69. package/package.json +1 -1
  70. package/dist/AdViewUnit/AdViewUnitBanner.cjs.map +0 -1
  71. package/dist/AdViewUnit/AdViewUnitBanner.d.cts +0 -10
  72. package/dist/AdViewUnit/AdViewUnitBanner.d.ts +0 -10
  73. package/dist/AdViewUnit/AdViewUnitBanner.js +0 -29
  74. package/dist/AdViewUnit/AdViewUnitBanner.js.map +0 -1
  75. package/dist/AdViewUnit/AdViewUnitNative.cjs.map +0 -1
  76. package/dist/AdViewUnit/AdViewUnitNative.d.cts +0 -10
  77. package/dist/AdViewUnit/AdViewUnitNative.d.ts +0 -10
  78. package/dist/AdViewUnit/AdViewUnitNative.js.map +0 -1
  79. package/dist/AdViewUnit/AdViewUnitProxy.cjs.map +0 -1
  80. package/dist/AdViewUnit/AdViewUnitProxy.d.cts +0 -10
  81. package/dist/AdViewUnit/AdViewUnitProxy.d.ts +0 -10
  82. package/dist/AdViewUnit/AdViewUnitProxy.js +0 -32
  83. package/dist/AdViewUnit/AdViewUnitProxy.js.map +0 -1
  84. package/dist/AdViewUnit/AdViewUnitTypeSwitch.cjs +0 -203
  85. package/dist/AdViewUnit/AdViewUnitTypeSwitch.cjs.map +0 -1
  86. package/dist/AdViewUnit/AdViewUnitTypeSwitch.d.cts +0 -12
  87. package/dist/AdViewUnit/AdViewUnitTypeSwitch.d.ts +0 -12
  88. package/dist/AdViewUnit/AdViewUnitTypeSwitch.js +0 -170
  89. package/dist/AdViewUnit/AdViewUnitTypeSwitch.js.map +0 -1
  90. package/dist/AdViewUnit/AdViewUnitWrapper.client.cjs +0 -250
  91. package/dist/AdViewUnit/AdViewUnitWrapper.client.cjs.map +0 -1
  92. package/dist/AdViewUnit/AdViewUnitWrapper.client.d.cts +0 -11
  93. package/dist/AdViewUnit/AdViewUnitWrapper.client.d.ts +0 -11
  94. package/dist/AdViewUnit/AdViewUnitWrapper.client.js +0 -220
  95. package/dist/AdViewUnit/AdViewUnitWrapper.client.js.map +0 -1
  96. package/dist/AdViewUnit/AdViewUnitWrapper.server.cjs +0 -232
  97. package/dist/AdViewUnit/AdViewUnitWrapper.server.cjs.map +0 -1
  98. package/dist/AdViewUnit/AdViewUnitWrapper.server.d.cts +0 -11
  99. package/dist/AdViewUnit/AdViewUnitWrapper.server.d.ts +0 -11
  100. package/dist/AdViewUnit/AdViewUnitWrapper.server.js +0 -201
  101. package/dist/AdViewUnit/AdViewUnitWrapper.server.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { AdViewGroupItem, AdViewAdFormat, AdViewConfig } from '@adview/core/typings';
2
- import { ReactNode, ReactElement } from 'react';
1
+ import { AdViewGroupItem, AdViewConfig } from '@adview/core/typings';
2
+ import { ReactNode, JSX, ReactElement } from 'react';
3
3
 
4
4
  /**
5
5
  * CSS class name tokens for styling native ad components.
@@ -25,21 +25,6 @@ type AdViewStyleTokensNative = {
25
25
  /** Call-to-action URL link */
26
26
  urlLink?: string;
27
27
  };
28
- /**
29
- * CSS class name tokens for styling banner ad components.
30
- * Banner ads typically only need container styling.
31
- */
32
- type AdViewStyleTokensBanner = {
33
- /** Container wrapper for the banner ad */
34
- container?: string;
35
- };
36
- /**
37
- * Conditional style tokens based on ad format.
38
- * Provides type-safe styling options for different ad types.
39
- */
40
- type AdViewStyleTokens = {
41
- [K in AdViewAdFormat]?: K extends 'native' ? AdViewStyleTokensNative : K extends 'banner' ? AdViewStyleTokensBanner : K extends 'proxy' ? AdViewStyleTokensNative : never;
42
- };
43
28
  /**
44
29
  * Client-side version of AdViewGroupItem without tracking data.
45
30
  * Used in components where tracking is handled separately.
@@ -56,14 +41,35 @@ type AdViewUnitClientChildrenProps = {
56
41
  state: AdLoadState;
57
42
  /** Error object if ad loading failed */
58
43
  error: Error | null;
59
- /** Optional fallback content function */
60
- onDefault?: AdViewUnitDefault;
44
+ };
45
+ /**
46
+ * AdViewOptionalDataProps is the type for the optional data props of the AdViewUnitTemplate component
47
+ */
48
+ type AdViewOptionalDataProps = {
49
+ /** Ad data from the server, or null if not loaded */
50
+ data?: AdViewDataClient | null;
51
+ /** Detailed loading state object with boolean flags */
52
+ state?: AdLoadState;
53
+ /** Error object if ad loading failed */
54
+ error?: Error | null;
55
+ };
56
+ /**
57
+ * AdViewUnitTemplateTypeProps is the type for the props of the AdViewUnitTemplate component
58
+ */
59
+ type AdViewUnitTemplateTypeProps = AdViewOptionalDataProps & {
60
+ type: string;
61
+ };
62
+ /**
63
+ * AdViewUnitTemplateProps is the type for the props of the AdViewUnitTemplate component
64
+ */
65
+ type AdViewUnitTemplateProps = AdViewUnitTemplateTypeProps & {
66
+ children?: (data: AdViewUnitClientChildrenProps) => (React.ReactNode | JSX.Element | null);
61
67
  };
62
68
  /**
63
69
  * Custom render function or component for client-side ad rendering.
64
70
  * Allows complete control over ad display and loading states.
65
71
  */
66
- type AdViewUnitClientChildren = ((props: AdViewUnitClientChildrenProps) => ReactNode) | ReactElement<AdViewUnitClientChildrenProps>;
72
+ type AdViewUnitClientChildren = ((props: AdViewUnitClientChildrenProps) => ReactNode | JSX.Element) | ReactElement<AdViewUnitTemplateTypeProps> | ReactElement<AdViewUnitTemplateTypeProps>[] | any[];
67
73
  /**
68
74
  * Props passed to server-side custom render functions.
69
75
  * Simplified version without loading states since SSR is synchronous.
@@ -78,7 +84,7 @@ type AdViewUnitServerChildrenProps = {
78
84
  * Custom render function or component for server-side ad rendering.
79
85
  * Used in SSR contexts where loading states are not applicable.
80
86
  */
81
- type AdViewUnitServerChildren = ((props: AdViewUnitServerChildrenProps) => ReactNode) | ReactElement<AdViewUnitServerChildrenProps>;
87
+ type AdViewUnitServerChildren = ((props: AdViewUnitServerChildrenProps) => ReactNode | JSX.Element) | ReactElement<AdViewUnitServerChildrenProps>;
82
88
  /**
83
89
  * Fallback content displayed when no ads are available.
84
90
  * Can be a static React node or a function that returns content.
@@ -92,9 +98,7 @@ type AdViewUnitPropsBase = {
92
98
  /** Unique identifier for the ad unit */
93
99
  unitId: string;
94
100
  /** Optional ad format specification */
95
- format?: AdViewAdFormat;
96
- /** Optional fallback content when no ads available */
97
- onDefault?: AdViewUnitDefault;
101
+ format?: string | string[];
98
102
  } & AdViewConfig;
99
103
  /**
100
104
  * Detailed loading state for ad requests.
@@ -111,4 +115,4 @@ type AdLoadState = {
111
115
  isComplete: boolean;
112
116
  };
113
117
 
114
- export type { AdViewUnitPropsBase as A, AdViewUnitClientChildren as a, AdViewUnitServerChildren as b, AdViewDataClient as c, AdViewStyleTokensNative as d, AdViewStyleTokens as e, AdViewUnitDefault as f, AdViewUnitClientChildrenProps as g, AdViewUnitServerChildrenProps as h, AdLoadState as i };
118
+ export type { AdViewUnitPropsBase as A, AdViewUnitClientChildren as a, AdViewUnitServerChildren as b, AdViewUnitTemplateTypeProps as c, AdViewOptionalDataProps as d, AdViewStyleTokensNative as e, AdViewUnitTemplateProps as f, AdLoadState as g };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adview/react",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "AdView React",
5
5
  "scripts": {
6
6
  "build": "tsup",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/AdViewUnit/AdViewUnitBanner.tsx"],"sourcesContent":["import { getAssetByName, getPrepareURL, getSrcSetCSSThumbs } from '@adview/core/utils';\nimport React from 'react';\nimport { AdViewDataClient, AdViewStyleTokensNative } from '../types';\n\ntype AdViewUnitBannerProps = AdViewDataClient & {\n classNames?: AdViewStyleTokensNative;\n};\n\nfunction AdViewUnitBanner({ assets, url }: AdViewUnitBannerProps) {\n const asset = getAssetByName('main', assets);\n\n return (\n <center>\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={getPrepareURL(url)}\n className=\"banner\"\n style={{ fontSize: 0 }}\n >\n {asset && (\n <img\n alt=\"main\"\n src={asset.path}\n srcSet={asset.thumbs ? getSrcSetCSSThumbs(asset.thumbs) : ''}\n />\n )}\n </a>\n </center>\n );\n}\n\nexport default AdViewUnitBanner;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkE;AAClE,mBAAkB;AAOlB,SAAS,iBAAiB,EAAE,QAAQ,IAAI,GAA0B;AAChE,QAAM,YAAQ,6BAAe,QAAQ,MAAM;AAE3C,SACE,6BAAAA,QAAA,cAAC,gBACC,6BAAAA,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,QAAO;AAAA,MACP,KAAI;AAAA,MACJ,UAAM,4BAAc,GAAG;AAAA,MACvB,WAAU;AAAA,MACV,OAAO,EAAE,UAAU,EAAE;AAAA;AAAA,IAEpB,SACC,6BAAAA,QAAA;AAAA,MAAC;AAAA;AAAA,QACC,KAAI;AAAA,QACJ,KAAK,MAAM;AAAA,QACX,QAAQ,MAAM,aAAS,iCAAmB,MAAM,MAAM,IAAI;AAAA;AAAA,IAC5D;AAAA,EAEJ,CACF;AAEJ;AAEA,IAAO,2BAAQ;","names":["React"]}
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { c as AdViewDataClient, d as AdViewStyleTokensNative } from '../types-BaV07oMT.cjs';
3
- import '@adview/core/typings';
4
-
5
- type AdViewUnitBannerProps = AdViewDataClient & {
6
- classNames?: AdViewStyleTokensNative;
7
- };
8
- declare function AdViewUnitBanner({ assets, url }: AdViewUnitBannerProps): React.JSX.Element;
9
-
10
- export { AdViewUnitBanner as default };
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { c as AdViewDataClient, d as AdViewStyleTokensNative } from '../types-BaV07oMT.js';
3
- import '@adview/core/typings';
4
-
5
- type AdViewUnitBannerProps = AdViewDataClient & {
6
- classNames?: AdViewStyleTokensNative;
7
- };
8
- declare function AdViewUnitBanner({ assets, url }: AdViewUnitBannerProps): React.JSX.Element;
9
-
10
- export { AdViewUnitBanner as default };
@@ -1,29 +0,0 @@
1
- // src/AdViewUnit/AdViewUnitBanner.tsx
2
- import { getAssetByName, getPrepareURL, getSrcSetCSSThumbs } from "@adview/core/utils";
3
- import React from "react";
4
- function AdViewUnitBanner({ assets, url }) {
5
- const asset = getAssetByName("main", assets);
6
- return /* @__PURE__ */ React.createElement("center", null, /* @__PURE__ */ React.createElement(
7
- "a",
8
- {
9
- target: "_blank",
10
- rel: "noopener noreferrer",
11
- href: getPrepareURL(url),
12
- className: "banner",
13
- style: { fontSize: 0 }
14
- },
15
- asset && /* @__PURE__ */ React.createElement(
16
- "img",
17
- {
18
- alt: "main",
19
- src: asset.path,
20
- srcSet: asset.thumbs ? getSrcSetCSSThumbs(asset.thumbs) : ""
21
- }
22
- )
23
- ));
24
- }
25
- var AdViewUnitBanner_default = AdViewUnitBanner;
26
- export {
27
- AdViewUnitBanner_default as default
28
- };
29
- //# sourceMappingURL=AdViewUnitBanner.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/AdViewUnit/AdViewUnitBanner.tsx"],"sourcesContent":["import { getAssetByName, getPrepareURL, getSrcSetCSSThumbs } from '@adview/core/utils';\nimport React from 'react';\nimport { AdViewDataClient, AdViewStyleTokensNative } from '../types';\n\ntype AdViewUnitBannerProps = AdViewDataClient & {\n classNames?: AdViewStyleTokensNative;\n};\n\nfunction AdViewUnitBanner({ assets, url }: AdViewUnitBannerProps) {\n const asset = getAssetByName('main', assets);\n\n return (\n <center>\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={getPrepareURL(url)}\n className=\"banner\"\n style={{ fontSize: 0 }}\n >\n {asset && (\n <img\n alt=\"main\"\n src={asset.path}\n srcSet={asset.thumbs ? getSrcSetCSSThumbs(asset.thumbs) : ''}\n />\n )}\n </a>\n </center>\n );\n}\n\nexport default AdViewUnitBanner;\n"],"mappings":";AAAA,SAAS,gBAAgB,eAAe,0BAA0B;AAClE,OAAO,WAAW;AAOlB,SAAS,iBAAiB,EAAE,QAAQ,IAAI,GAA0B;AAChE,QAAM,QAAQ,eAAe,QAAQ,MAAM;AAE3C,SACE,oCAAC,gBACC;AAAA,IAAC;AAAA;AAAA,MACC,QAAO;AAAA,MACP,KAAI;AAAA,MACJ,MAAM,cAAc,GAAG;AAAA,MACvB,WAAU;AAAA,MACV,OAAO,EAAE,UAAU,EAAE;AAAA;AAAA,IAEpB,SACC;AAAA,MAAC;AAAA;AAAA,QACC,KAAI;AAAA,QACJ,KAAK,MAAM;AAAA,QACX,QAAQ,MAAM,SAAS,mBAAmB,MAAM,MAAM,IAAI;AAAA;AAAA,IAC5D;AAAA,EAEJ,CACF;AAEJ;AAEA,IAAO,2BAAQ;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/AdViewUnit/AdViewUnitNative.tsx"],"sourcesContent":["import { getAssetByName, getPrepareURL, getSrcSetCSSThumbs } from '@adview/core/utils';\nimport React from 'react';\nimport { AdViewDataClient, AdViewStyleTokensNative } from '../types';\n\ntype AdViewUnitNativeProps = AdViewDataClient & {\n classNames?: AdViewStyleTokensNative;\n};\n\nfunction AdViewUnitNative({\n assets,\n fields,\n url,\n classNames,\n}: AdViewUnitNativeProps) {\n const asset = getAssetByName('main', assets);\n\n if (!url) {\n return null;\n }\n\n return (\n <div className={classNames?.container}>\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={getPrepareURL(url)}\n className={classNames?.imageLink}\n >\n {asset && (\n <img\n alt={fields?.title}\n title={fields?.title}\n src={asset.path}\n srcSet={asset.thumbs ? getSrcSetCSSThumbs(asset.thumbs) : undefined}\n className={classNames?.image}\n style={{ objectFit: 'cover', width: '100%', height: '100%' }}\n />\n )}\n </a>\n <div className={classNames?.label}>\n {fields?.title && (\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={getPrepareURL(url)}\n data-class=\"titleLink\"\n className={classNames?.titleLink}\n >\n {fields.title}\n </a>\n )}\n {fields?.description && (\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={getPrepareURL(url)}\n data-class=\"descriptionLink\"\n className={classNames?.descriptionLink}\n >\n {fields.description}\n </a>\n )}\n {fields?.brandname && (\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={getPrepareURL(url)}\n data-class=\"brandNameLink\"\n className={classNames?.brandNameLink}\n >\n {fields.brandname}\n </a>\n )}\n {fields?.phone && (\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={getPrepareURL(url)}\n data-class=\"phoneLink\"\n className={classNames?.phoneLink}\n >\n {fields.phone}\n </a>\n )}\n {fields?.url && (\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={getPrepareURL(url)}\n data-class=\"urlLink\"\n className={classNames?.urlLink}\n >\n {fields?.url}\n </a>\n )}\n </div>\n </div>\n );\n}\n\nexport default AdViewUnitNative;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkE;AAClE,mBAAkB;AAOlB,SAAS,iBAAiB;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA0B;AACxB,QAAM,YAAQ,6BAAe,QAAQ,MAAM;AAE3C,MAAI,CAAC,KAAK;AACR,WAAO;AAAA,EACT;AAEA,SACE,6BAAAA,QAAA,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AAA;AAAA,IAEtB,OAAO;AAAA,EACV,GAED,QAAQ,OACP,6BAAAA,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,QAAO;AAAA,MACP,KAAI;AAAA,MACJ,UAAM,4BAAc,GAAG;AAAA,MACvB,cAAW;AAAA,MACX,WAAW,YAAY;AAAA;AAAA,IAEtB,QAAQ;AAAA,EACX,CAEJ,CACF;AAEJ;AAEA,IAAO,2BAAQ;","names":["React"]}
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { c as AdViewDataClient, d as AdViewStyleTokensNative } from '../types-BaV07oMT.cjs';
3
- import '@adview/core/typings';
4
-
5
- type AdViewUnitNativeProps = AdViewDataClient & {
6
- classNames?: AdViewStyleTokensNative;
7
- };
8
- declare function AdViewUnitNative({ assets, fields, url, classNames, }: AdViewUnitNativeProps): React.JSX.Element | null;
9
-
10
- export { AdViewUnitNative as default };
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { c as AdViewDataClient, d as AdViewStyleTokensNative } from '../types-BaV07oMT.js';
3
- import '@adview/core/typings';
4
-
5
- type AdViewUnitNativeProps = AdViewDataClient & {
6
- classNames?: AdViewStyleTokensNative;
7
- };
8
- declare function AdViewUnitNative({ assets, fields, url, classNames, }: AdViewUnitNativeProps): React.JSX.Element | null;
9
-
10
- export { AdViewUnitNative as default };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/AdViewUnit/AdViewUnitNative.tsx"],"sourcesContent":["import { getAssetByName, getPrepareURL, getSrcSetCSSThumbs } from '@adview/core/utils';\nimport React from 'react';\nimport { AdViewDataClient, AdViewStyleTokensNative } from '../types';\n\ntype AdViewUnitNativeProps = AdViewDataClient & {\n classNames?: AdViewStyleTokensNative;\n};\n\nfunction AdViewUnitNative({\n assets,\n fields,\n url,\n classNames,\n}: AdViewUnitNativeProps) {\n const asset = getAssetByName('main', assets);\n\n if (!url) {\n return null;\n }\n\n return (\n <div className={classNames?.container}>\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={getPrepareURL(url)}\n className={classNames?.imageLink}\n >\n {asset && (\n <img\n alt={fields?.title}\n title={fields?.title}\n src={asset.path}\n srcSet={asset.thumbs ? getSrcSetCSSThumbs(asset.thumbs) : undefined}\n className={classNames?.image}\n style={{ objectFit: 'cover', width: '100%', height: '100%' }}\n />\n )}\n </a>\n <div className={classNames?.label}>\n {fields?.title && (\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={getPrepareURL(url)}\n data-class=\"titleLink\"\n className={classNames?.titleLink}\n >\n {fields.title}\n </a>\n )}\n {fields?.description && (\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={getPrepareURL(url)}\n data-class=\"descriptionLink\"\n className={classNames?.descriptionLink}\n >\n {fields.description}\n </a>\n )}\n {fields?.brandname && (\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={getPrepareURL(url)}\n data-class=\"brandNameLink\"\n className={classNames?.brandNameLink}\n >\n {fields.brandname}\n </a>\n )}\n {fields?.phone && (\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={getPrepareURL(url)}\n data-class=\"phoneLink\"\n className={classNames?.phoneLink}\n >\n {fields.phone}\n </a>\n )}\n {fields?.url && (\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={getPrepareURL(url)}\n data-class=\"urlLink\"\n className={classNames?.urlLink}\n >\n {fields?.url}\n </a>\n )}\n </div>\n </div>\n );\n}\n\nexport default AdViewUnitNative;\n"],"mappings":";AAAA,SAAS,gBAAgB,eAAe,0BAA0B;AAClE,OAAO,WAAW;AAOlB,SAAS,iBAAiB;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA0B;AACxB,QAAM,QAAQ,eAAe,QAAQ,MAAM;AAE3C,MAAI,CAAC,KAAK;AACR,WAAO;AAAA,EACT;AAEA,SACE,oCAAC,SAAI,WAAW,YAAY,aAC1B;AAAA,IAAC;AAAA;AAAA,MACC,QAAO;AAAA,MAC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AAAA,IAEtB,QAAQ;AAAA,EACX,CAEJ,CACF;AAEJ;AAEA,IAAO,2BAAQ;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/AdViewUnit/AdViewUnitProxy.tsx"],"sourcesContent":["import React from 'react';\nimport { AdViewDataClient, AdViewStyleTokensNative } from '../types';\n\ntype AdViewUnitProxyProps = AdViewDataClient & {\n classNames?: AdViewStyleTokensNative;\n};\n\nfunction AdViewUnitProxy({\n // assets,\n fields,\n url,\n}: AdViewUnitProxyProps) {\n const iframeSrc = fields?.url || url;\n\n if (!iframeSrc) {\n return null;\n }\n\n return (\n <iframe\n width=\"100%\"\n height=\"100%\"\n frameBorder=\"0\"\n marginWidth={0}\n marginHeight={0}\n allowTransparency={true}\n scrolling=\"no\"\n allowFullScreen={true}\n style={{ width: '100%', height: '100%' }}\n src={iframeSrc}\n ></iframe>\n );\n}\n\nexport default AdViewUnitProxy;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAOlB,SAAS,gBAAgB;AAAA;AAAA,EAEvB;AAAA,EACA;AACF,GAAyB;AACvB,QAAM,YAAY,QAAQ,OAAO;AAEjC,MAAI,CAAC,WAAW;AACd,WAAO;AAAA,EACT;AAEA,SACE,6BAAAA,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,OAAM;AAAA,MACN,QAAO;AAAA,MACP,aAAY;AAAA,MACZ,aAAa;AAAA,MACb,cAAc;AAAA,MACd,mBAAmB;AAAA,MACnB,WAAU;AAAA,MACV,iBAAiB;AAAA,MACjB,OAAO,EAAE,OAAO,QAAQ,QAAQ,OAAO;AAAA,MACvC,KAAK;AAAA;AAAA,EACN;AAEL;AAEA,IAAO,0BAAQ;","names":["React"]}
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { c as AdViewDataClient, d as AdViewStyleTokensNative } from '../types-BaV07oMT.cjs';
3
- import '@adview/core/typings';
4
-
5
- type AdViewUnitProxyProps = AdViewDataClient & {
6
- classNames?: AdViewStyleTokensNative;
7
- };
8
- declare function AdViewUnitProxy({ fields, url, }: AdViewUnitProxyProps): React.JSX.Element | null;
9
-
10
- export { AdViewUnitProxy as default };
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { c as AdViewDataClient, d as AdViewStyleTokensNative } from '../types-BaV07oMT.js';
3
- import '@adview/core/typings';
4
-
5
- type AdViewUnitProxyProps = AdViewDataClient & {
6
- classNames?: AdViewStyleTokensNative;
7
- };
8
- declare function AdViewUnitProxy({ fields, url, }: AdViewUnitProxyProps): React.JSX.Element | null;
9
-
10
- export { AdViewUnitProxy as default };
@@ -1,32 +0,0 @@
1
- // src/AdViewUnit/AdViewUnitProxy.tsx
2
- import React from "react";
3
- function AdViewUnitProxy({
4
- // assets,
5
- fields,
6
- url
7
- }) {
8
- const iframeSrc = fields?.url || url;
9
- if (!iframeSrc) {
10
- return null;
11
- }
12
- return /* @__PURE__ */ React.createElement(
13
- "iframe",
14
- {
15
- width: "100%",
16
- height: "100%",
17
- frameBorder: "0",
18
- marginWidth: 0,
19
- marginHeight: 0,
20
- allowTransparency: true,
21
- scrolling: "no",
22
- allowFullScreen: true,
23
- style: { width: "100%", height: "100%" },
24
- src: iframeSrc
25
- }
26
- );
27
- }
28
- var AdViewUnitProxy_default = AdViewUnitProxy;
29
- export {
30
- AdViewUnitProxy_default as default
31
- };
32
- //# sourceMappingURL=AdViewUnitProxy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/AdViewUnit/AdViewUnitProxy.tsx"],"sourcesContent":["import React from 'react';\nimport { AdViewDataClient, AdViewStyleTokensNative } from '../types';\n\ntype AdViewUnitProxyProps = AdViewDataClient & {\n classNames?: AdViewStyleTokensNative;\n};\n\nfunction AdViewUnitProxy({\n // assets,\n fields,\n url,\n}: AdViewUnitProxyProps) {\n const iframeSrc = fields?.url || url;\n\n if (!iframeSrc) {\n return null;\n }\n\n return (\n <iframe\n width=\"100%\"\n height=\"100%\"\n frameBorder=\"0\"\n marginWidth={0}\n marginHeight={0}\n allowTransparency={true}\n scrolling=\"no\"\n allowFullScreen={true}\n style={{ width: '100%', height: '100%' }}\n src={iframeSrc}\n ></iframe>\n );\n}\n\nexport default AdViewUnitProxy;\n"],"mappings":";AAAA,OAAO,WAAW;AAOlB,SAAS,gBAAgB;AAAA;AAAA,EAEvB;AAAA,EACA;AACF,GAAyB;AACvB,QAAM,YAAY,QAAQ,OAAO;AAEjC,MAAI,CAAC,WAAW;AACd,WAAO;AAAA,EACT;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAM;AAAA,MACN,QAAO;AAAA,MACP,aAAY;AAAA,MACZ,aAAa;AAAA,MACb,cAAc;AAAA,MACd,mBAAmB;AAAA,MACnB,WAAU;AAAA,MACV,iBAAiB;AAAA,MACjB,OAAO,EAAE,OAAO,QAAQ,QAAQ,OAAO;AAAA,MACvC,KAAK;AAAA;AAAA,EACN;AAEL;AAEA,IAAO,0BAAQ;","names":[]}
@@ -1,203 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/AdViewUnit/AdViewUnitTypeSwitch.tsx
31
- var AdViewUnitTypeSwitch_exports = {};
32
- __export(AdViewUnitTypeSwitch_exports, {
33
- default: () => AdViewUnitTypeSwitch_default
34
- });
35
- module.exports = __toCommonJS(AdViewUnitTypeSwitch_exports);
36
-
37
- // src/AdViewUnit/AdViewUnitNative.tsx
38
- var import_utils = require("@adview/core/utils");
39
- var import_react = __toESM(require("react"), 1);
40
- function AdViewUnitNative({
41
- assets,
42
- fields,
43
- url,
44
- classNames
45
- }) {
46
- const asset = (0, import_utils.getAssetByName)("main", assets);
47
- if (!url) {
48
- return null;
49
- }
50
- return /* @__PURE__ */ import_react.default.createElement("div", { className: classNames?.container }, /* @__PURE__ */ import_react.default.createElement(
51
- "a",
52
- {
53
- target: "_blank",
54
- rel: "noopener noreferrer",
55
- href: (0, import_utils.getPrepareURL)(url),
56
- className: classNames?.imageLink
57
- },
58
- asset && /* @__PURE__ */ import_react.default.createElement(
59
- "img",
60
- {
61
- alt: fields?.title,
62
- title: fields?.title,
63
- src: asset.path,
64
- srcSet: asset.thumbs ? (0, import_utils.getSrcSetCSSThumbs)(asset.thumbs) : void 0,
65
- className: classNames?.image,
66
- style: { objectFit: "cover", width: "100%", height: "100%" }
67
- }
68
- )
69
- ), /* @__PURE__ */ import_react.default.createElement("div", { className: classNames?.label }, fields?.title && /* @__PURE__ */ import_react.default.createElement(
70
- "a",
71
- {
72
- target: "_blank",
73
- rel: "noopener noreferrer",
74
- href: (0, import_utils.getPrepareURL)(url),
75
- "data-class": "titleLink",
76
- className: classNames?.titleLink
77
- },
78
- fields.title
79
- ), fields?.description && /* @__PURE__ */ import_react.default.createElement(
80
- "a",
81
- {
82
- target: "_blank",
83
- rel: "noopener noreferrer",
84
- href: (0, import_utils.getPrepareURL)(url),
85
- "data-class": "descriptionLink",
86
- className: classNames?.descriptionLink
87
- },
88
- fields.description
89
- ), fields?.brandname && /* @__PURE__ */ import_react.default.createElement(
90
- "a",
91
- {
92
- target: "_blank",
93
- rel: "noopener noreferrer",
94
- href: (0, import_utils.getPrepareURL)(url),
95
- "data-class": "brandNameLink",
96
- className: classNames?.brandNameLink
97
- },
98
- fields.brandname
99
- ), fields?.phone && /* @__PURE__ */ import_react.default.createElement(
100
- "a",
101
- {
102
- target: "_blank",
103
- rel: "noopener noreferrer",
104
- href: (0, import_utils.getPrepareURL)(url),
105
- "data-class": "phoneLink",
106
- className: classNames?.phoneLink
107
- },
108
- fields.phone
109
- ), fields?.url && /* @__PURE__ */ import_react.default.createElement(
110
- "a",
111
- {
112
- target: "_blank",
113
- rel: "noopener noreferrer",
114
- href: (0, import_utils.getPrepareURL)(url),
115
- "data-class": "urlLink",
116
- className: classNames?.urlLink
117
- },
118
- fields?.url
119
- )));
120
- }
121
- var AdViewUnitNative_default = AdViewUnitNative;
122
-
123
- // src/AdViewUnit/AdViewUnitProxy.tsx
124
- var import_react2 = __toESM(require("react"), 1);
125
- function AdViewUnitProxy({
126
- // assets,
127
- fields,
128
- url
129
- }) {
130
- const iframeSrc = fields?.url || url;
131
- if (!iframeSrc) {
132
- return null;
133
- }
134
- return /* @__PURE__ */ import_react2.default.createElement(
135
- "iframe",
136
- {
137
- width: "100%",
138
- height: "100%",
139
- frameBorder: "0",
140
- marginWidth: 0,
141
- marginHeight: 0,
142
- allowTransparency: true,
143
- scrolling: "no",
144
- allowFullScreen: true,
145
- style: { width: "100%", height: "100%" },
146
- src: iframeSrc
147
- }
148
- );
149
- }
150
- var AdViewUnitProxy_default = AdViewUnitProxy;
151
-
152
- // src/AdViewUnit/AdViewUnitBanner.tsx
153
- var import_utils2 = require("@adview/core/utils");
154
- var import_react3 = __toESM(require("react"), 1);
155
- function AdViewUnitBanner({ assets, url }) {
156
- const asset = (0, import_utils2.getAssetByName)("main", assets);
157
- return /* @__PURE__ */ import_react3.default.createElement("center", null, /* @__PURE__ */ import_react3.default.createElement(
158
- "a",
159
- {
160
- target: "_blank",
161
- rel: "noopener noreferrer",
162
- href: (0, import_utils2.getPrepareURL)(url),
163
- className: "banner",
164
- style: { fontSize: 0 }
165
- },
166
- asset && /* @__PURE__ */ import_react3.default.createElement(
167
- "img",
168
- {
169
- alt: "main",
170
- src: asset.path,
171
- srcSet: asset.thumbs ? (0, import_utils2.getSrcSetCSSThumbs)(asset.thumbs) : ""
172
- }
173
- )
174
- ));
175
- }
176
- var AdViewUnitBanner_default = AdViewUnitBanner;
177
-
178
- // src/AdViewUnit/AdViewUnitTypeSwitch.tsx
179
- var import_react4 = __toESM(require("react"), 1);
180
- function AdViewUnitTypeSwitch({
181
- data,
182
- classNames,
183
- onDefault
184
- }) {
185
- switch (data?.type) {
186
- case "native":
187
- return /* @__PURE__ */ import_react4.default.createElement(AdViewUnitNative_default, { ...data, classNames: classNames?.native });
188
- case "proxy":
189
- return /* @__PURE__ */ import_react4.default.createElement(AdViewUnitProxy_default, { ...data, classNames: classNames?.proxy });
190
- case "banner":
191
- return /* @__PURE__ */ import_react4.default.createElement(AdViewUnitBanner_default, { ...data, classNames: classNames?.banner });
192
- default:
193
- if (import_react4.default.isValidElement(onDefault)) {
194
- return import_react4.default.cloneElement(onDefault);
195
- }
196
- if (typeof onDefault === "function") {
197
- return onDefault();
198
- }
199
- return null;
200
- }
201
- }
202
- var AdViewUnitTypeSwitch_default = AdViewUnitTypeSwitch;
203
- //# sourceMappingURL=AdViewUnitTypeSwitch.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/AdViewUnit/AdViewUnitTypeSwitch.tsx","../../src/AdViewUnit/AdViewUnitNative.tsx","../../src/AdViewUnit/AdViewUnitProxy.tsx","../../src/AdViewUnit/AdViewUnitBanner.tsx"],"sourcesContent":["import {\n AdViewDataClient,\n AdViewStyleTokens,\n AdViewUnitDefault,\n} from '../types';\nimport AdViewUnitNative from './AdViewUnitNative';\nimport AdViewUnitProxy from './AdViewUnitProxy';\nimport AdViewUnitBanner from './AdViewUnitBanner';\nimport React from 'react';\n\ntype AdViewUnitDefaultProps = {\n data?: AdViewDataClient;\n classNames?: AdViewStyleTokens;\n onDefault?: AdViewUnitDefault;\n};\n\nfunction AdViewUnitTypeSwitch({\n data,\n classNames,\n onDefault,\n}: AdViewUnitDefaultProps) {\n switch (data?.type) {\n case 'native':\n return <AdViewUnitNative {...data} classNames={classNames?.native} />;\n case 'proxy':\n return <AdViewUnitProxy {...data} classNames={classNames?.proxy} />;\n case 'banner':\n return <AdViewUnitBanner {...data} classNames={classNames?.banner} />;\n default:\n if (React.isValidElement(onDefault)) {\n return React.cloneElement(onDefault);\n }\n\n if (typeof onDefault === 'function') {\n return onDefault();\n }\n\n return null;\n }\n}\n\nexport default AdViewUnitTypeSwitch;\n","import { getAssetByName, getPrepareURL, getSrcSetCSSThumbs } from '@adview/core/utils';\nimport React from 'react';\nimport { AdViewDataClient, AdViewStyleTokensNative } from '../types';\n\ntype AdViewUnitNativeProps = AdViewDataClient & {\n classNames?: AdViewStyleTokensNative;\n};\n\nfunction AdViewUnitNative({\n assets,\n fields,\n url,\n classNames,\n}: AdViewUnitNativeProps) {\n const asset = getAssetByName('main', assets);\n\n if (!url) {\n return null;\n }\n\n return (\n <div className={classNames?.container}>\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={getPrepareURL(url)}\n className={classNames?.imageLink}\n >\n {asset && (\n <img\n alt={fields?.title}\n title={fields?.title}\n src={asset.path}\n srcSet={asset.thumbs ? getSrcSetCSSThumbs(asset.thumbs) : undefined}\n className={classNames?.image}\n style={{ objectFit: 'cover', width: '100%', height: '100%' }}\n />\n )}\n </a>\n <div className={classNames?.label}>\n {fields?.title && (\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={getPrepareURL(url)}\n data-class=\"titleLink\"\n className={classNames?.titleLink}\n >\n {fields.title}\n </a>\n )}\n {fields?.description && (\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={getPrepareURL(url)}\n data-class=\"descriptionLink\"\n className={classNames?.descriptionLink}\n >\n {fields.description}\n </a>\n )}\n {fields?.brandname && (\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={getPrepareURL(url)}\n data-class=\"brandNameLink\"\n className={classNames?.brandNameLink}\n >\n {fields.brandname}\n </a>\n )}\n {fields?.phone && (\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={getPrepareURL(url)}\n data-class=\"phoneLink\"\n className={classNames?.phoneLink}\n >\n {fields.phone}\n </a>\n )}\n {fields?.url && (\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={getPrepareURL(url)}\n data-class=\"urlLink\"\n className={classNames?.urlLink}\n >\n {fields?.url}\n </a>\n )}\n </div>\n </div>\n );\n}\n\nexport default AdViewUnitNative;\n","import React from 'react';\nimport { AdViewDataClient, AdViewStyleTokensNative } from '../types';\n\ntype AdViewUnitProxyProps = AdViewDataClient & {\n classNames?: AdViewStyleTokensNative;\n};\n\nfunction AdViewUnitProxy({\n // assets,\n fields,\n url,\n}: AdViewUnitProxyProps) {\n const iframeSrc = fields?.url || url;\n\n if (!iframeSrc) {\n return null;\n }\n\n return (\n <iframe\n width=\"100%\"\n height=\"100%\"\n frameBorder=\"0\"\n marginWidth={0}\n marginHeight={0}\n allowTransparency={true}\n scrolling=\"no\"\n allowFullScreen={true}\n style={{ width: '100%', height: '100%' }}\n src={iframeSrc}\n ></iframe>\n );\n}\n\nexport default AdViewUnitProxy;\n","import { getAssetByName, getPrepareURL, getSrcSetCSSThumbs } from '@adview/core/utils';\nimport React from 'react';\nimport { AdViewDataClient, AdViewStyleTokensNative } from '../types';\n\ntype AdViewUnitBannerProps = AdViewDataClient & {\n classNames?: AdViewStyleTokensNative;\n};\n\nfunction AdViewUnitBanner({ assets, url }: AdViewUnitBannerProps) {\n const asset = getAssetByName('main', assets);\n\n return (\n <center>\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n href={getPrepareURL(url)}\n className=\"banner\"\n style={{ fontSize: 0 }}\n >\n {asset && (\n <img\n alt=\"main\"\n src={asset.path}\n srcSet={asset.thumbs ? getSrcSetCSSThumbs(asset.thumbs) : ''}\n />\n )}\n </a>\n </center>\n );\n}\n\nexport default AdViewUnitBanner;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAkE;AAClE,mBAAkB;AAOlB,SAAS,iBAAiB;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA0B;AACxB,QAAM,YAAQ,6BAAe,QAAQ,MAAM;AAE3C,MAAI,CAAC,KAAK;AACR,WAAO;AAAA,EACT;AAEA,SACE,6BAAAA,QAAA,cAAC,SAAI,WAAW,YAAY,aAC1B,6BAAAA,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,QAAO;AAAA,MACP,KAAI;AAAA,MACJ,UAAM,4BAAc,GAAG;AAAA,MACvB,WAAW,YAAY;AAAA;AAAA,IAEtB,SACC,6BAAAA,QAAA;AAAA,MAAC;AAAA;AAAA,QACC,KAAK,QAAQ;AAAA,QACb,OAAO,QAAQ;AAAA,QACf,KAAK,MAAM;AAAA,QACX,QAAQ,MAAM,aAAS,iCAAmB,MAAM,MAAM,IAAI;AAAA,QAC1D,WAAW,YAAY;AAAA,QACvB,OAAO,EAAE,WAAW,SAAS,OAAO,QAAQ,QAAQ,OAAO;AAAA;AAAA,IAC7D;AAAA,EAEJ,GACA,6BAAAA,QAAA,cAAC,SAAI,WAAW,YAAY,SACzB,QAAQ,SACP,6BAAAA,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,QAAO;AAAA,MACP,KAAI;AAAA,MACJ,UAAM,4BAAc,G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;AACF;AAEA,IAAO,+BAAQ;","names":["React","import_react","React","import_utils","import_react","React","import_react","React"]}
@@ -1,12 +0,0 @@
1
- import { c as AdViewDataClient, e as AdViewStyleTokens, f as AdViewUnitDefault } from '../types-BaV07oMT.cjs';
2
- import React from 'react';
3
- import '@adview/core/typings';
4
-
5
- type AdViewUnitDefaultProps = {
6
- data?: AdViewDataClient;
7
- classNames?: AdViewStyleTokens;
8
- onDefault?: AdViewUnitDefault;
9
- };
10
- declare function AdViewUnitTypeSwitch({ data, classNames, onDefault, }: AdViewUnitDefaultProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
11
-
12
- export { AdViewUnitTypeSwitch as default };
@@ -1,12 +0,0 @@
1
- import { c as AdViewDataClient, e as AdViewStyleTokens, f as AdViewUnitDefault } from '../types-BaV07oMT.js';
2
- import React from 'react';
3
- import '@adview/core/typings';
4
-
5
- type AdViewUnitDefaultProps = {
6
- data?: AdViewDataClient;
7
- classNames?: AdViewStyleTokens;
8
- onDefault?: AdViewUnitDefault;
9
- };
10
- declare function AdViewUnitTypeSwitch({ data, classNames, onDefault, }: AdViewUnitDefaultProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
11
-
12
- export { AdViewUnitTypeSwitch as default };